From f68eba2c86cfb30df08e2d71fa2ed9ab9f8d6ecf Mon Sep 17 00:00:00 2001 From: Futa Arai Date: Tue, 24 Dec 2024 21:16:38 +0900 Subject: [PATCH] remove unnecessary files --- apps/pdf-converter/dist/bin/index.d.ts | 1 - apps/pdf-converter/dist/bin/index.js | 8 - apps/pdf-converter/dist/bin/index.js.map | 1 - .../pdf-converter/dist/controllers/index.d.ts | 2 - apps/pdf-converter/dist/controllers/index.js | 3 - .../dist/controllers/index.js.map | 1 - apps/pdf-converter/dist/controllers/pdf.d.ts | 11 - apps/pdf-converter/dist/controllers/pdf.js | 59 ----- .../pdf-converter/dist/controllers/pdf.js.map | 1 - .../dist/controllers/terminus.d.ts | 10 - .../dist/controllers/terminus.js | 28 -- .../dist/controllers/terminus.js.map | 1 - apps/pdf-converter/dist/index.d.ts | 1 - apps/pdf-converter/dist/index.js | 23 -- apps/pdf-converter/dist/index.js.map | 1 - apps/pdf-converter/dist/server.d.ts | 8 - apps/pdf-converter/dist/server.js | 41 --- apps/pdf-converter/dist/server.js.map | 1 - .../dist/service/pdf-convert.d.ts | 81 ------ .../pdf-converter/dist/service/pdf-convert.js | 240 ------------------ .../dist/service/pdf-convert.js.map | 1 - apps/pdf-converter/specs/v3/docs/swagger.json | 149 ----------- apps/pdf-converter/specs/v3/docs/swagger.yaml | 106 -------- 23 files changed, 778 deletions(-) delete mode 100644 apps/pdf-converter/dist/bin/index.d.ts delete mode 100644 apps/pdf-converter/dist/bin/index.js delete mode 100644 apps/pdf-converter/dist/bin/index.js.map delete mode 100644 apps/pdf-converter/dist/controllers/index.d.ts delete mode 100644 apps/pdf-converter/dist/controllers/index.js delete mode 100644 apps/pdf-converter/dist/controllers/index.js.map delete mode 100644 apps/pdf-converter/dist/controllers/pdf.d.ts delete mode 100644 apps/pdf-converter/dist/controllers/pdf.js delete mode 100644 apps/pdf-converter/dist/controllers/pdf.js.map delete mode 100644 apps/pdf-converter/dist/controllers/terminus.d.ts delete mode 100644 apps/pdf-converter/dist/controllers/terminus.js delete mode 100644 apps/pdf-converter/dist/controllers/terminus.js.map delete mode 100644 apps/pdf-converter/dist/index.d.ts delete mode 100644 apps/pdf-converter/dist/index.js delete mode 100644 apps/pdf-converter/dist/index.js.map delete mode 100644 apps/pdf-converter/dist/server.d.ts delete mode 100644 apps/pdf-converter/dist/server.js delete mode 100644 apps/pdf-converter/dist/server.js.map delete mode 100644 apps/pdf-converter/dist/service/pdf-convert.d.ts delete mode 100644 apps/pdf-converter/dist/service/pdf-convert.js delete mode 100644 apps/pdf-converter/dist/service/pdf-convert.js.map delete mode 100644 apps/pdf-converter/specs/v3/docs/swagger.json delete mode 100644 apps/pdf-converter/specs/v3/docs/swagger.yaml diff --git a/apps/pdf-converter/dist/bin/index.d.ts b/apps/pdf-converter/dist/bin/index.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/apps/pdf-converter/dist/bin/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/apps/pdf-converter/dist/bin/index.js b/apps/pdf-converter/dist/bin/index.js deleted file mode 100644 index 739c44a3b94..00000000000 --- a/apps/pdf-converter/dist/bin/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import { CliCore } from '@tsed/cli-core'; -import { GenerateSwaggerCmd } from '@tsed/cli-generate-swagger'; -import Server from '../server.js'; -CliCore.bootstrap({ - server: Server, - commands: [GenerateSwaggerCmd], -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/apps/pdf-converter/dist/bin/index.js.map b/apps/pdf-converter/dist/bin/index.js.map deleted file mode 100644 index cfeea24b63b..00000000000 --- a/apps/pdf-converter/dist/bin/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,OAAO,CAAC,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,CAAC,kBAAkB,CAAC;CAC/B,CAAC,CAAC"} \ No newline at end of file diff --git a/apps/pdf-converter/dist/controllers/index.d.ts b/apps/pdf-converter/dist/controllers/index.d.ts deleted file mode 100644 index 2a0cb4e4092..00000000000 --- a/apps/pdf-converter/dist/controllers/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as PdfCtrl } from './pdf.js'; -export { default as TerminusCtrl } from './terminus.js'; diff --git a/apps/pdf-converter/dist/controllers/index.js b/apps/pdf-converter/dist/controllers/index.js deleted file mode 100644 index 64c626801ef..00000000000 --- a/apps/pdf-converter/dist/controllers/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as PdfCtrl } from './pdf.js'; -export { default as TerminusCtrl } from './terminus.js'; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/apps/pdf-converter/dist/controllers/index.js.map b/apps/pdf-converter/dist/controllers/index.js.map deleted file mode 100644 index 2523c601f79..00000000000 --- a/apps/pdf-converter/dist/controllers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controllers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/apps/pdf-converter/dist/controllers/pdf.d.ts b/apps/pdf-converter/dist/controllers/pdf.d.ts deleted file mode 100644 index 7e5bff76916..00000000000 --- a/apps/pdf-converter/dist/controllers/pdf.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Logger } from '@tsed/common'; -import PdfConvertService, { JobStatusSharedWithGrowi, JobStatus } from '../service/pdf-convert.js'; -declare class PdfCtrl { - private readonly pdfConvertService; - logger: Logger; - constructor(pdfConvertService: PdfConvertService); - syncJobStatus(jobId: string, expirationDateStr: string, growiJobStatus: JobStatusSharedWithGrowi): Promise<{ - status: JobStatus; - }>; -} -export default PdfCtrl; diff --git a/apps/pdf-converter/dist/controllers/pdf.js b/apps/pdf-converter/dist/controllers/pdf.js deleted file mode 100644 index 6613180de55..00000000000 --- a/apps/pdf-converter/dist/controllers/pdf.js +++ /dev/null @@ -1,59 +0,0 @@ -import { __decorate, __metadata, __param } from "tslib"; -import { BodyParams, Logger } from '@tsed/common'; -import { Controller, Inject } from '@tsed/di'; -import { InternalServerError } from '@tsed/exceptions'; -import { Post, Returns, Enum, Description, } from '@tsed/schema'; -import PdfConvertService, { JobStatusSharedWithGrowi, JobStatus } from '../service/pdf-convert.js'; -let PdfCtrl = class PdfCtrl { - pdfConvertService; - logger; - constructor(pdfConvertService) { - this.pdfConvertService = pdfConvertService; - } - async syncJobStatus(jobId, expirationDateStr, growiJobStatus) { - const expirationDate = new Date(expirationDateStr); - try { - await this.pdfConvertService.registerOrUpdateJob(jobId, expirationDate, growiJobStatus); - const status = this.pdfConvertService.getJobStatus(jobId); // get status before cleanup - this.pdfConvertService.cleanUpJobList(); - return { status }; - } - catch (err) { - this.logger.error('Failed to register or update job', err); - throw new InternalServerError(err); - } - } -}; -__decorate([ - Inject(), - __metadata("design:type", Logger) -], PdfCtrl.prototype, "logger", void 0); -__decorate([ - Post('/sync-job'), - (Returns(202).ContentType('application/json').Schema({ - type: 'object', - properties: { - status: { type: 'string', enum: Object.values(JobStatus) }, - }, - required: ['status'], - })), - Returns(500), - Description(` - Sync job pdf convert status with GROWI. - Register or update job inside pdf-converter with given jobId, expirationDate, and status. - Return resulting status of job to GROWI. - `), - __param(0, BodyParams('jobId')), - __param(1, BodyParams('expirationDate')), - __param(2, BodyParams('status')), - __param(2, Enum(Object.values(JobStatusSharedWithGrowi))), - __metadata("design:type", Function), - __metadata("design:paramtypes", [String, String, String]), - __metadata("design:returntype", Promise) -], PdfCtrl.prototype, "syncJobStatus", null); -PdfCtrl = __decorate([ - Controller('/pdf'), - __metadata("design:paramtypes", [PdfConvertService]) -], PdfCtrl); -export default PdfCtrl; -//# sourceMappingURL=pdf.js.map \ No newline at end of file diff --git a/apps/pdf-converter/dist/controllers/pdf.js.map b/apps/pdf-converter/dist/controllers/pdf.js.map deleted file mode 100644 index 7103e501df4..00000000000 --- a/apps/pdf-converter/dist/controllers/pdf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pdf.js","sourceRoot":"","sources":["../../src/controllers/pdf.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GACjC,MAAM,cAAc,CAAC;AAEtB,OAAO,iBAAiB,EAAE,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEnG,IACM,OAAO,GADb,MACM,OAAO;IAKkB;IAF3B,MAAM,CAAS;IAEjB,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAgB/D,AAAN,KAAK,CAAC,aAAa,CACI,KAAa,EACJ,iBAAyB,EACc,cAAwC;QAE7G,MAAM,cAAc,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACnD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;YACxF,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,4BAA4B;YACvF,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;YACxC,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;YAC3D,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;CAEF,CAAA;AApCG;IADD,MAAM,EAAE;8BACC,MAAM;uCAAC;AAkBX;IAdL,IAAI,CAAC,WAAW,CAAC;IACjB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC;QACpD,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;SAC3D;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC;IACZ,WAAW,CAAC;;;;GAIZ,CAAC;IAEC,WAAA,UAAU,CAAC,OAAO,CAAC,CAAA;IACnB,WAAA,UAAU,CAAC,gBAAgB,CAAC,CAAA;IAC5B,WAAA,UAAU,CAAC,QAAQ,CAAC,CAAA;IAAE,WAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAA;;;;4CAarE;AArCG,OAAO;IADZ,UAAU,CAAC,MAAM,CAAC;qCAM+B,iBAAiB;GAL7D,OAAO,CAuCZ;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/apps/pdf-converter/dist/controllers/terminus.d.ts b/apps/pdf-converter/dist/controllers/terminus.d.ts deleted file mode 100644 index 3366c8935f0..00000000000 --- a/apps/pdf-converter/dist/controllers/terminus.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Logger } from '@tsed/common'; -import PdfConvertService from '../service/pdf-convert.js'; -declare class TerminusCtrl { - private readonly pdfConvertService; - logger: Logger; - constructor(pdfConvertService: PdfConvertService); - $onSignal(): Promise; - $onShutdown(): void; -} -export default TerminusCtrl; diff --git a/apps/pdf-converter/dist/controllers/terminus.js b/apps/pdf-converter/dist/controllers/terminus.js deleted file mode 100644 index 6cf41cf7794..00000000000 --- a/apps/pdf-converter/dist/controllers/terminus.js +++ /dev/null @@ -1,28 +0,0 @@ -import { __decorate, __metadata } from "tslib"; -import { Logger } from '@tsed/common'; -import { Inject, Injectable } from '@tsed/di'; -import PdfConvertService from '../service/pdf-convert.js'; -let TerminusCtrl = class TerminusCtrl { - pdfConvertService; - logger; - constructor(pdfConvertService) { - this.pdfConvertService = pdfConvertService; - } - async $onSignal() { - this.logger.info('Server is starting cleanup'); - await this.pdfConvertService.closePuppeteerCluster(); - } - $onShutdown() { - this.logger.info('Cleanup finished, server is shutting down'); - } -}; -__decorate([ - Inject(), - __metadata("design:type", Logger) -], TerminusCtrl.prototype, "logger", void 0); -TerminusCtrl = __decorate([ - Injectable(), - __metadata("design:paramtypes", [PdfConvertService]) -], TerminusCtrl); -export default TerminusCtrl; -//# sourceMappingURL=terminus.js.map \ No newline at end of file diff --git a/apps/pdf-converter/dist/controllers/terminus.js.map b/apps/pdf-converter/dist/controllers/terminus.js.map deleted file mode 100644 index 2b91734977f..00000000000 --- a/apps/pdf-converter/dist/controllers/terminus.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"terminus.js","sourceRoot":"","sources":["../../src/controllers/terminus.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,IACM,YAAY,GADlB,MACM,YAAY;IAKa;IAF3B,MAAM,CAAS;IAEjB,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAErE,KAAK,CAAC,SAAS;QACb,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAC/C,MAAM,IAAI,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC;IACvD,CAAC;IAED,WAAW;QACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;IAChE,CAAC;CAEF,CAAA;AAbG;IADD,MAAM,EAAE;8BACC,MAAM;4CAAC;AAHb,YAAY;IADjB,UAAU,EAAE;qCAMqC,iBAAiB;GAL7D,YAAY,CAgBjB;AAED,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/apps/pdf-converter/dist/index.d.ts b/apps/pdf-converter/dist/index.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/apps/pdf-converter/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/apps/pdf-converter/dist/index.js b/apps/pdf-converter/dist/index.js deleted file mode 100644 index c0b50a17b57..00000000000 --- a/apps/pdf-converter/dist/index.js +++ /dev/null @@ -1,23 +0,0 @@ -import { $log } from '@tsed/common'; -import { PlatformExpress } from '@tsed/platform-express'; -import Server from './server.js'; -function hasProcessFlag(flag) { - return process.argv.join('').indexOf(flag) > -1; -} -async function bootstrap() { - try { - $log.debug('Start server...'); - const platform = await PlatformExpress.bootstrap(Server); - await platform.listen(); - $log.debug('Server initialized'); - if (hasProcessFlag('ci')) { - $log.info('"--ci" flag is detected. Exit process.'); - process.exit(); - } - } - catch (error) { - $log.error(error); - } -} -bootstrap(); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/apps/pdf-converter/dist/index.js.map b/apps/pdf-converter/dist/index.js.map deleted file mode 100644 index 69e7836e147..00000000000 --- a/apps/pdf-converter/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,KAAK,UAAU,SAAS;IACtB,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC9B,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAEzD,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxB,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAEjC,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;YACpD,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/apps/pdf-converter/dist/server.d.ts b/apps/pdf-converter/dist/server.d.ts deleted file mode 100644 index 88a90c15c37..00000000000 --- a/apps/pdf-converter/dist/server.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PlatformApplication } from '@tsed/common'; -import '@tsed/swagger'; -import '@tsed/terminus'; -import '@tsed/platform-express'; -declare class Server { - app: PlatformApplication; -} -export default Server; diff --git a/apps/pdf-converter/dist/server.js b/apps/pdf-converter/dist/server.js deleted file mode 100644 index 2871573e472..00000000000 --- a/apps/pdf-converter/dist/server.js +++ /dev/null @@ -1,41 +0,0 @@ -import { __decorate, __metadata } from "tslib"; -import { PlatformApplication } from '@tsed/common'; -import { Configuration, Inject } from '@tsed/di'; -import express from 'express'; -import '@tsed/swagger'; -import '@tsed/terminus'; -import * as Controllers from './controllers/index.js'; -import '@tsed/platform-express'; -const PORT = Number(process.env.PORT || 3010); -let Server = class Server { - app; -}; -__decorate([ - Inject(), - __metadata("design:type", PlatformApplication) -], Server.prototype, "app", void 0); -Server = __decorate([ - Configuration({ - port: PORT, - acceptMimes: ['application/json'], - mount: { - '/': [...Object.values(Controllers)], - }, - middlewares: [ - 'json-parser', - express.json({ limit: '50mb' }), - express.urlencoded({ extended: true, limit: '50mb' }), - ], - swagger: [ - { - path: '/v3/docs', - specVersion: '3.0.1', - }, - ], - terminus: { - signals: ['SIGINT', 'SIGTERM'], - }, - }) -], Server); -export default Server; -//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/apps/pdf-converter/dist/server.js.map b/apps/pdf-converter/dist/server.js.map deleted file mode 100644 index 956e290bed3..00000000000 --- a/apps/pdf-converter/dist/server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAExB,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AAEtD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;AAuB9C,IAAM,MAAM,GAAZ,MAAM,MAAM;IAGR,GAAG,CAAsB;CAE5B,CAAA;AAFG;IADD,MAAM,EAAE;8BACF,mBAAmB;mCAAC;AAHvB,MAAM;IArBX,aAAa,CAAC;QACb,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,CAAC,kBAAkB,CAAC;QACjC,KAAK,EAAE;YACL,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;SACrC;QACD,WAAW,EAAE;YACX,aAAa;YACb,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YAC/B,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;SACtD;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,OAAO;aACrB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B;KACF,CAAC;GACI,MAAM,CAKX;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/apps/pdf-converter/dist/service/pdf-convert.d.ts b/apps/pdf-converter/dist/service/pdf-convert.d.ts deleted file mode 100644 index 6ef50084e71..00000000000 --- a/apps/pdf-converter/dist/service/pdf-convert.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Logger, OnInit } from '@tsed/common'; -export declare const JobStatusSharedWithGrowi: { - readonly HTML_EXPORT_IN_PROGRESS: "HTML_EXPORT_IN_PROGRESS"; - readonly HTML_EXPORT_DONE: "HTML_EXPORT_DONE"; - readonly FAILED: "FAILED"; -}; -export declare const JobStatus: { - readonly PDF_EXPORT_DONE: "PDF_EXPORT_DONE"; - readonly HTML_EXPORT_IN_PROGRESS: "HTML_EXPORT_IN_PROGRESS"; - readonly HTML_EXPORT_DONE: "HTML_EXPORT_DONE"; - readonly FAILED: "FAILED"; -}; -export type JobStatusSharedWithGrowi = typeof JobStatusSharedWithGrowi[keyof typeof JobStatusSharedWithGrowi]; -export type JobStatus = typeof JobStatus[keyof typeof JobStatus]; -declare class PdfConvertService implements OnInit { - private puppeteerCluster; - private maxConcurrency; - private convertRetryLimit; - private tmpOutputRootDir; - private tmpHtmlDir; - private jobList; - logger: Logger; - $onInit(): Promise; - /** - * Register or update job inside jobList with given jobId, expirationDate, and status. - * If job is new, start reading html files and convert them to pdf. - * @param jobId id of PageBulkExportJob - * @param expirationDate expiration date of job - * @param status status of job - */ - registerOrUpdateJob(jobId: string, expirationDate: Date, status: JobStatusSharedWithGrowi): Promise; - /** - * Get job status - * @param jobId id of PageBulkExportJob - * @returns job status - */ - getJobStatus(jobId: string): JobStatus; - /** - * Clean up job list by removing expired jobs, finished jobs, and failed jobs - */ - cleanUpJobList(): void; - /** - * Close puppeteer cluster - */ - closePuppeteerCluster(): Promise; - private isJobCompleted; - /** - * Read html files from shared fs path, convert them to pdf, and save them to shared fs path. - * Repeat this until all html files are converted to pdf or job fails. - * @param jobId id of PageBulkExportJob - */ - private readHtmlAndConvertToPdfUntilFinish; - /** - * Get readable stream that reads html files from shared fs path - * @param jobId id of PageBulkExportJob - * @returns readable stream - */ - private getHtmlReadable; - /** - * Get writable stream that converts html to pdf, and save it to shared fs path - * @returns writable stream - */ - private getPdfWritable; - /** - * Convert html to pdf. Retry up to convertRetryLimit if failed. - * @param htmlString html to convert to pdf - * @returns converted pdf - */ - private convertHtmlToPdf; - /** - * Initialize puppeteer cluster - */ - private initPuppeteerCluster; - /** - * Get parent path from given path - * @param path target path - * @returns parent path - */ - private getParentPath; -} -export default PdfConvertService; diff --git a/apps/pdf-converter/dist/service/pdf-convert.js b/apps/pdf-converter/dist/service/pdf-convert.js deleted file mode 100644 index 8446a5c8d4b..00000000000 --- a/apps/pdf-converter/dist/service/pdf-convert.js +++ /dev/null @@ -1,240 +0,0 @@ -import { __decorate, __metadata } from "tslib"; -import fs from 'fs'; -import path from 'path'; -import { Readable, Writable } from 'stream'; -import { pipeline as pipelinePromise } from 'stream/promises'; -import { Logger } from '@tsed/common'; -import { Inject, Service } from '@tsed/di'; -import { Cluster } from 'puppeteer-cluster'; -export const JobStatusSharedWithGrowi = { - HTML_EXPORT_IN_PROGRESS: 'HTML_EXPORT_IN_PROGRESS', - HTML_EXPORT_DONE: 'HTML_EXPORT_DONE', - FAILED: 'FAILED', -}; -export const JobStatus = { - ...JobStatusSharedWithGrowi, - PDF_EXPORT_DONE: 'PDF_EXPORT_DONE', -}; -let PdfConvertService = class PdfConvertService { - puppeteerCluster; - maxConcurrency = 1; - convertRetryLimit = 5; - tmpOutputRootDir = '/tmp/page-bulk-export'; - tmpHtmlDir = `${this.tmpOutputRootDir}/html`; - jobList = {}; - logger; - async $onInit() { - if (process.env.SWAGGER_GENERATION === 'true') - return; - await this.initPuppeteerCluster(); - } - /** - * Register or update job inside jobList with given jobId, expirationDate, and status. - * If job is new, start reading html files and convert them to pdf. - * @param jobId id of PageBulkExportJob - * @param expirationDate expiration date of job - * @param status status of job - */ - async registerOrUpdateJob(jobId, expirationDate, status) { - const isJobNew = !(jobId in this.jobList); - if (isJobNew) { - this.jobList[jobId] = { expirationDate, status }; - } - else { - const jobInfo = this.jobList[jobId]; - jobInfo.expirationDate = expirationDate; - if (!this.isJobCompleted(jobId)) { - jobInfo.status = status; - } - } - if (status === JobStatus.FAILED) { - this.jobList[jobId].currentStream?.destroy(new Error('job failed')); - } - if (isJobNew && status !== JobStatus.FAILED) { - this.readHtmlAndConvertToPdfUntilFinish(jobId); - } - } - /** - * Get job status - * @param jobId id of PageBulkExportJob - * @returns job status - */ - getJobStatus(jobId) { - if (!(jobId in this.jobList)) - return JobStatus.FAILED; - return this.jobList[jobId].status; - } - /** - * Clean up job list by removing expired jobs, finished jobs, and failed jobs - */ - cleanUpJobList() { - const now = new Date(); - for (const jobId of Object.keys(this.jobList)) { - const job = this.jobList[jobId]; - if (now > job.expirationDate || this.isJobCompleted(jobId)) { - job.currentStream?.destroy(new Error('job expired')); - delete this.jobList[jobId]; - } - } - } - /** - * Close puppeteer cluster - */ - async closePuppeteerCluster() { - if (this.puppeteerCluster == null) { - this.logger.info('No puppeteer cluster running for closure'); - return; - } - this.logger.info('Closing puppeteer cluster...'); - await this.puppeteerCluster.idle(); - await this.puppeteerCluster.close(); - } - isJobCompleted(jobId) { - if (this.jobList[jobId] == null) - return true; - return this.jobList[jobId].status === JobStatus.PDF_EXPORT_DONE || this.jobList[jobId].status === JobStatus.FAILED; - } - /** - * Read html files from shared fs path, convert them to pdf, and save them to shared fs path. - * Repeat this until all html files are converted to pdf or job fails. - * @param jobId id of PageBulkExportJob - */ - async readHtmlAndConvertToPdfUntilFinish(jobId) { - while (!this.isJobCompleted(jobId)) { - // eslint-disable-next-line no-await-in-loop - await new Promise(resolve => setTimeout(resolve, 10 * 1000)); - try { - if (new Date() > this.jobList[jobId].expirationDate) { - throw new Error('Job expired'); - } - const htmlReadable = this.getHtmlReadable(jobId); - const pdfWritable = this.getPdfWritable(); - this.jobList[jobId].currentStream = htmlReadable; - // eslint-disable-next-line no-await-in-loop - await pipelinePromise(htmlReadable, pdfWritable); - this.jobList[jobId].currentStream = undefined; - } - catch (err) { - this.logger.error('Failed to convert html to pdf', err); - this.jobList[jobId].status = JobStatus.FAILED; - this.jobList[jobId].currentStream?.destroy(new Error('Failed to convert html to pdf')); - break; - } - } - } - /** - * Get readable stream that reads html files from shared fs path - * @param jobId id of PageBulkExportJob - * @returns readable stream - */ - getHtmlReadable(jobId) { - const htmlFileEntries = fs.readdirSync(path.join(this.tmpHtmlDir, jobId), { recursive: true, withFileTypes: true }).filter(entry => entry.isFile()); - let index = 0; - const jobList = this.jobList; - return new Readable({ - objectMode: true, - async read() { - if (index >= htmlFileEntries.length) { - if (jobList[jobId].status === JobStatus.HTML_EXPORT_DONE && htmlFileEntries.length === 0) { - jobList[jobId].status = JobStatus.PDF_EXPORT_DONE; - } - this.push(null); - return; - } - const entry = htmlFileEntries[index]; - const htmlFilePath = path.join(entry.parentPath, entry.name); - const htmlString = await fs.promises.readFile(htmlFilePath, 'utf-8'); - this.push({ htmlString, htmlFilePath }); - index += 1; - }, - }); - } - /** - * Get writable stream that converts html to pdf, and save it to shared fs path - * @returns writable stream - */ - getPdfWritable() { - return new Writable({ - objectMode: true, - write: async (pageInfo, encoding, callback) => { - const fileOutputPath = pageInfo.htmlFilePath.replace(new RegExp(`^${this.tmpHtmlDir}`), this.tmpOutputRootDir).replace(/\.html$/, '.pdf'); - const fileOutputParentPath = this.getParentPath(fileOutputPath); - try { - const pdfBody = await this.convertHtmlToPdf(pageInfo.htmlString); - await fs.promises.mkdir(fileOutputParentPath, { recursive: true }); - await fs.promises.writeFile(fileOutputPath, pdfBody); - await fs.promises.rm(pageInfo.htmlFilePath, { force: true }); - } - catch (err) { - callback(err); - return; - } - callback(); - }, - }); - } - /** - * Convert html to pdf. Retry up to convertRetryLimit if failed. - * @param htmlString html to convert to pdf - * @returns converted pdf - */ - async convertHtmlToPdf(htmlString) { - const executeConvert = async (retries) => { - try { - return this.puppeteerCluster.execute(htmlString); - } - catch (err) { - if (retries > 0) { - this.logger.error('Failed to convert markdown to pdf. Retrying...', err); - return executeConvert(retries - 1); - } - throw err; - } - }; - const result = await executeConvert(this.convertRetryLimit); - return result; - } - /** - * Initialize puppeteer cluster - */ - async initPuppeteerCluster() { - this.puppeteerCluster = await Cluster.launch({ - concurrency: Cluster.CONCURRENCY_PAGE, - maxConcurrency: this.maxConcurrency, - workerCreationDelay: 10000, - }); - await this.puppeteerCluster.task(async ({ page, data: htmlString }) => { - await page.setContent(htmlString, { waitUntil: 'domcontentloaded' }); - await page.emulateMediaType('screen'); - const pdfResult = await page.pdf({ - margin: { - top: '100px', right: '50px', bottom: '100px', left: '50px', - }, - printBackground: true, - format: 'A4', - }); - return pdfResult; - }); - } - /** - * Get parent path from given path - * @param path target path - * @returns parent path - */ - getParentPath(path) { - const parentPath = path.split('/').slice(0, -1).join('/'); - if (parentPath === '' || parentPath === '/') { - return '/'; - } - return parentPath; - } -}; -__decorate([ - Inject(), - __metadata("design:type", Logger) -], PdfConvertService.prototype, "logger", void 0); -PdfConvertService = __decorate([ - Service() -], PdfConvertService); -export default PdfConvertService; -//# sourceMappingURL=pdf-convert.js.map \ No newline at end of file diff --git a/apps/pdf-converter/dist/service/pdf-convert.js.map b/apps/pdf-converter/dist/service/pdf-convert.js.map deleted file mode 100644 index 7a382bb256f..00000000000 --- a/apps/pdf-converter/dist/service/pdf-convert.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pdf-convert.js","sourceRoot":"","sources":["../../src/service/pdf-convert.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAU,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAO5C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,uBAAuB,EAAE,yBAAyB;IAClD,gBAAgB,EAAE,kBAAkB;IACpC,MAAM,EAAE,QAAQ;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,wBAAwB;IAC3B,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAYX,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEb,gBAAgB,CAAsB;IAEtC,cAAc,GAAG,CAAC,CAAC;IAEnB,iBAAiB,GAAG,CAAC,CAAC;IAEtB,gBAAgB,GAAG,uBAAuB,CAAC;IAE3C,UAAU,GAAG,GAAG,IAAI,CAAC,gBAAgB,OAAO,CAAC;IAE7C,OAAO,GAEX,EAAE,CAAC;IAGL,MAAM,CAAS;IAEjB,KAAK,CAAC,OAAO;QACX,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM;YAAE,OAAO;QAEtD,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACpC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,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file diff --git a/apps/pdf-converter/specs/v3/docs/swagger.json b/apps/pdf-converter/specs/v3/docs/swagger.json deleted file mode 100644 index 2ea227cc93b..00000000000 --- a/apps/pdf-converter/specs/v3/docs/swagger.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "Api documentation", - "version": "1.0.0" - }, - "paths": { - "/pdf/sync-job": { - "post": { - "responses": { - "202": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "HTML_EXPORT_IN_PROGRESS", - "HTML_EXPORT_DONE", - "FAILED", - "PDF_EXPORT_DONE" - ] - } - }, - "required": [ - "status" - ] - } - } - }, - "description": "Accepted" - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - }, - "description": "Internal Server Error" - } - }, - "description": "\n Sync job pdf convert status with GROWI.\n Register or update job inside pdf-converter with given jobId, expirationDate, and status.\n Return resulting status of job to GROWI.\n ", - "parameters": [], - "requestBody": { - "required": false, - "content": { - "application/json": { - "schema": { - "properties": { - "jobId": { - "type": "string" - }, - "expirationDate": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "HTML_EXPORT_IN_PROGRESS", - "HTML_EXPORT_DONE", - "FAILED" - ] - } - }, - "type": "object" - } - } - } - }, - "tags": [ - "PdfCtrl" - ], - "operationId": "pdfCtrlSyncJobStatus" - } - } - }, - "tags": [ - { - "name": "PdfCtrl" - } - ], - "components": { - "schemas": { - "InternalServerError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "description": "The error name", - "example": "INTERNAL_SERVER_ERROR", - "default": "INTERNAL_SERVER_ERROR" - }, - "message": { - "type": "string", - "minLength": 1, - "description": "An error message" - }, - "status": { - "type": "number", - "description": "The status code of the exception", - "example": 500, - "default": 500 - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GenericError" - }, - "description": "A list of related errors" - }, - "stack": { - "type": "string", - "description": "The stack trace (only in development mode)" - } - }, - "required": [ - "name", - "message", - "status" - ] - }, - "GenericError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "description": "The error name" - }, - "message": { - "type": "string", - "minLength": 1, - "description": "An error message" - } - }, - "additionalProperties": true, - "required": [ - "name", - "message" - ] - } - } - } -} \ No newline at end of file diff --git a/apps/pdf-converter/specs/v3/docs/swagger.yaml b/apps/pdf-converter/specs/v3/docs/swagger.yaml deleted file mode 100644 index 6df7d2036d2..00000000000 --- a/apps/pdf-converter/specs/v3/docs/swagger.yaml +++ /dev/null @@ -1,106 +0,0 @@ -openapi: 3.0.1 -info: - title: Api documentation - version: 1.0.0 -paths: - /pdf/sync-job: - post: - responses: - '202': - content: - application/json: - schema: - type: object - properties: - status: - type: string - enum: - - HTML_EXPORT_IN_PROGRESS - - HTML_EXPORT_DONE - - FAILED - - PDF_EXPORT_DONE - required: - - status - description: Accepted - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server Error - description: |2- - - Sync job pdf convert status with GROWI. - Register or update job inside pdf-converter with given jobId, expirationDate, and status. - Return resulting status of job to GROWI. - - parameters: [] - requestBody: - required: false - content: - application/json: - schema: - properties: - jobId: - type: string - expirationDate: - type: string - status: - type: string - enum: - - HTML_EXPORT_IN_PROGRESS - - HTML_EXPORT_DONE - - FAILED - type: object - tags: - - PdfCtrl - operationId: pdfCtrlSyncJobStatus -tags: - - name: PdfCtrl -components: - schemas: - InternalServerError: - type: object - properties: - name: - type: string - minLength: 1 - description: The error name - example: INTERNAL_SERVER_ERROR - default: INTERNAL_SERVER_ERROR - message: - type: string - minLength: 1 - description: An error message - status: - type: number - description: The status code of the exception - example: 500 - default: 500 - errors: - type: array - items: - $ref: '#/components/schemas/GenericError' - description: A list of related errors - stack: - type: string - description: The stack trace (only in development mode) - required: - - name - - message - - status - GenericError: - type: object - properties: - name: - type: string - minLength: 1 - description: The error name - message: - type: string - minLength: 1 - description: An error message - additionalProperties: true - required: - - name - - message