@tsed/cli 6.6.3 → 7.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/commands/add/AddCmd.js +16 -16
- package/lib/esm/commands/generate/GenerateCmd.js +69 -222
- package/lib/esm/commands/generate/mappers/mapGenerateContext.js +29 -0
- package/lib/esm/commands/init/InitCmd.js +190 -171
- package/lib/esm/commands/init/config/FeaturesPrompt.js +101 -3
- package/lib/esm/commands/init/mappers/mapToContext.js +4 -3
- package/lib/esm/commands/run/RunCmd.js +22 -26
- package/lib/esm/commands/update/UpdateCmd.js +9 -13
- package/lib/esm/fn/exec.js +5 -0
- package/lib/esm/fn/render.js +5 -0
- package/lib/esm/fn/taskOutput.js +7 -0
- package/lib/esm/index.js +7 -4
- package/lib/esm/interfaces/AlterPackageJson.js +1 -0
- package/lib/esm/interfaces/AlterProjectFiles.js +1 -0
- package/lib/esm/interfaces/AlterRenderFiles.js +1 -0
- package/lib/esm/interfaces/CliCommandHooks.js +1 -0
- package/lib/esm/interfaces/GenerateCmdContext.js +1 -0
- package/lib/esm/interfaces/InitCmdOptions.js +1 -0
- package/lib/esm/interfaces/RenderDataContext.js +1 -0
- package/lib/esm/interfaces/RuntimeTypes.js +1 -0
- package/lib/esm/interfaces/index.js +9 -0
- package/lib/esm/pipes/OutputFilePathPipe.js +40 -18
- package/lib/esm/pipes/RoutePipe.js +4 -8
- package/lib/esm/pipes/{ClassNamePipe.js → SymbolNamePipe.js} +14 -11
- package/lib/esm/pipes/index.js +1 -1
- package/lib/esm/platforms/{InitPlatformsModule.js → PlatformsModule.js} +4 -10
- package/lib/esm/platforms/supports/InitExpressPlatform.js +27 -10
- package/lib/esm/platforms/supports/InitFastifyPlatform.js +27 -10
- package/lib/esm/platforms/supports/InitKoaPlatform.js +16 -10
- package/lib/esm/processors/__fixtures__/createFakeProject.js +35 -0
- package/lib/esm/processors/transformBinFile.js +47 -0
- package/lib/esm/processors/transformConfigFile.js +105 -0
- package/lib/esm/processors/transformIndexFile.js +23 -0
- package/lib/esm/processors/transformServerFile.js +60 -0
- package/lib/esm/runtimes/RuntimesModule.js +7 -17
- package/lib/esm/runtimes/supports/BabelRuntime.js +5 -11
- package/lib/esm/runtimes/supports/BunRuntime.js +4 -10
- package/lib/esm/runtimes/supports/NodeRuntime.js +1 -1
- package/lib/esm/runtimes/supports/WebpackRuntime.js +1 -1
- package/lib/esm/services/CliProjectService.js +96 -0
- package/lib/esm/services/CliRunScript.js +4 -8
- package/lib/esm/services/CliTemplatesService.js +68 -0
- package/lib/esm/services/ProjectClient.js +161 -0
- package/lib/esm/services/mappers/mapDefaultTemplateOptions.js +30 -0
- package/lib/esm/templates/asyncFactory.template.js +38 -0
- package/lib/esm/templates/barrels.template.js +22 -0
- package/lib/esm/templates/command.template.js +56 -0
- package/lib/esm/templates/config.template.js +27 -0
- package/lib/esm/templates/controller.template.js +45 -0
- package/lib/esm/templates/decorator.template.js +182 -0
- package/lib/esm/templates/docker-compose.template.js +25 -0
- package/lib/esm/templates/dockerfile.template.js +236 -0
- package/lib/esm/templates/exception-filter.template.js +19 -0
- package/lib/esm/templates/factory.template.js +37 -0
- package/lib/esm/templates/index.command.template.js +18 -0
- package/lib/esm/templates/index.config.utils.template.js +17 -0
- package/{templates/init/src/controllers/pages/IndexController.ts.hbs → lib/esm/templates/index.controller.template.js} +14 -3
- package/lib/esm/templates/index.js +32 -0
- package/lib/esm/templates/index.logger.template.js +38 -0
- package/{templates/init/src/index.ts.hbs → lib/esm/templates/index.template.js} +17 -5
- package/lib/esm/templates/interceptor.template.js +31 -0
- package/lib/esm/templates/interface.template.js +13 -0
- package/lib/esm/templates/middleware.template.js +34 -0
- package/lib/esm/templates/model.template.js +16 -0
- package/lib/esm/templates/module.template.js +16 -0
- package/lib/esm/templates/pipe.template.js +19 -0
- package/lib/esm/templates/pm2.template.js +111 -0
- package/lib/esm/templates/prisma.service.template.js +23 -0
- package/{templates/init/README.md.hbs → lib/esm/templates/readme.template.js} +28 -13
- package/lib/esm/templates/repository.template.js +16 -0
- package/lib/esm/templates/response-filter.template.js +19 -0
- package/lib/esm/templates/server.template.js +37 -0
- package/lib/esm/templates/service.template.js +16 -0
- package/lib/esm/templates/tsconfig.spec.template.js +34 -0
- package/lib/esm/templates/tsconfig.template.js +31 -0
- package/lib/esm/templates/value.template.js +13 -0
- package/lib/esm/utils/defineTemplate.js +13 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/commands/add/AddCmd.d.ts +2 -2
- package/lib/types/commands/generate/GenerateCmd.d.ts +33 -87
- package/lib/types/commands/generate/mappers/mapGenerateContext.d.ts +2 -0
- package/lib/types/commands/init/InitCmd.d.ts +18 -20
- package/lib/types/commands/init/config/FeaturesPrompt.d.ts +11 -2
- package/lib/types/commands/init/mappers/mapToContext.d.ts +2 -2
- package/lib/types/commands/init/mappers/mapUniqFeatures.d.ts +1 -1
- package/lib/types/commands/init/prompts/getFeaturesPrompt.d.ts +1 -1
- package/lib/types/commands/update/UpdateCmd.d.ts +2 -2
- package/lib/types/fn/exec.d.ts +1 -0
- package/lib/types/fn/render.d.ts +2 -0
- package/lib/types/fn/taskOutput.d.ts +1 -0
- package/lib/types/index.d.ts +7 -4
- package/lib/types/interfaces/AlterGenerateTasks.d.ts +5 -0
- package/lib/types/interfaces/AlterInitSubTasks.d.ts +5 -0
- package/lib/types/interfaces/AlterPackageJson.d.ts +5 -0
- package/lib/types/interfaces/AlterProjectFiles.d.ts +5 -0
- package/lib/types/interfaces/AlterRenderFiles.d.ts +10 -0
- package/lib/types/interfaces/CliCommandHooks.d.ts +11 -0
- package/lib/types/interfaces/GenerateCmdContext.d.ts +19 -0
- package/lib/types/interfaces/InitCmdOptions.d.ts +8 -0
- package/lib/types/interfaces/PlatformType.d.ts +7 -0
- package/lib/types/interfaces/RenderDataContext.d.ts +61 -0
- package/lib/types/interfaces/RuntimeTypes.d.ts +8 -0
- package/lib/types/interfaces/index.d.ts +9 -0
- package/lib/types/pipes/OutputFilePathPipe.d.ts +7 -4
- package/lib/types/pipes/{ClassNamePipe.d.ts → SymbolNamePipe.d.ts} +3 -3
- package/lib/types/pipes/index.d.ts +1 -1
- package/lib/types/platforms/{InitPlatformsModule.d.ts → PlatformsModule.d.ts} +1 -1
- package/lib/types/platforms/supports/InitBasePlatform.d.ts +3 -0
- package/lib/types/platforms/supports/InitExpressPlatform.d.ts +2 -0
- package/lib/types/platforms/supports/InitFastifyPlatform.d.ts +2 -0
- package/lib/types/platforms/supports/InitKoaPlatform.d.ts +2 -0
- package/lib/types/processors/__fixtures__/createFakeProject.d.ts +5 -0
- package/lib/types/processors/transformBinFile.d.ts +3 -0
- package/lib/types/processors/transformConfigFile.d.ts +3 -0
- package/lib/types/processors/transformIndexFile.d.ts +3 -0
- package/lib/types/processors/transformServerFile.d.ts +3 -0
- package/lib/types/runtimes/RuntimesModule.d.ts +5 -5
- package/lib/types/services/CliProjectService.d.ts +16 -0
- package/lib/types/services/CliTemplatesService.d.ts +29 -0
- package/lib/types/services/ProjectClient.d.ts +40 -0
- package/lib/types/services/mappers/mapDefaultTemplateOptions.d.ts +11 -0
- package/lib/types/templates/asyncFactory.template.d.ts +2 -0
- package/lib/types/templates/barrels.template.d.ts +2 -0
- package/lib/types/templates/command.template.d.ts +2 -0
- package/lib/types/templates/config.template.d.ts +2 -0
- package/lib/types/templates/controller.template.d.ts +2 -0
- package/lib/types/templates/decorator.template.d.ts +2 -0
- package/lib/types/templates/docker-compose.template.d.ts +2 -0
- package/lib/types/templates/dockerfile.template.d.ts +1 -0
- package/lib/types/templates/exception-filter.template.d.ts +2 -0
- package/lib/types/templates/factory.template.d.ts +2 -0
- package/lib/types/templates/index.command.template.d.ts +2 -0
- package/lib/types/templates/index.config.utils.template.d.ts +2 -0
- package/lib/types/templates/index.controller.template.d.ts +2 -0
- package/lib/types/templates/index.d.ts +31 -0
- package/lib/types/templates/index.logger.template.d.ts +2 -0
- package/lib/types/templates/index.template.d.ts +2 -0
- package/lib/types/templates/interceptor.template.d.ts +2 -0
- package/lib/types/templates/interface.template.d.ts +2 -0
- package/lib/types/templates/middleware.template.d.ts +2 -0
- package/lib/types/templates/model.template.d.ts +2 -0
- package/lib/types/templates/module.template.d.ts +2 -0
- package/lib/types/templates/pipe.template.d.ts +2 -0
- package/lib/types/templates/pm2.template.d.ts +1 -0
- package/lib/types/templates/prisma.service.template.d.ts +2 -0
- package/lib/types/templates/readme.template.d.ts +2 -0
- package/lib/types/templates/repository.template.d.ts +2 -0
- package/lib/types/templates/response-filter.template.d.ts +2 -0
- package/lib/types/templates/server.template.d.ts +2 -0
- package/lib/types/templates/service.template.d.ts +2 -0
- package/lib/types/templates/tsconfig.spec.template.d.ts +2 -0
- package/lib/types/templates/tsconfig.template.d.ts +2 -0
- package/lib/types/templates/value.template.d.ts +2 -0
- package/lib/types/utils/defineTemplate.d.ts +39 -0
- package/package.json +14 -12
- package/templates/tsconfig.node.json +14 -0
- package/templates/webpack.config.js +55 -0
- package/lib/esm/commands/generate/ProviderTypes.js +0 -103
- package/lib/esm/commands/init/interfaces/InitOptions.js +0 -5
- package/lib/esm/services/ProvidersInfoService.js +0 -46
- package/lib/esm/services/Renderer.js +0 -162
- package/lib/esm/utils/fillImports.js +0 -38
- package/lib/esm/utils/hbs/array.js +0 -515
- package/lib/esm/utils/hbs/collection.js +0 -60
- package/lib/esm/utils/hbs/comparison.js +0 -431
- package/lib/esm/utils/hbs/index.js +0 -11
- package/lib/esm/utils/hbs/object.js +0 -236
- package/lib/esm/utils/hbs/switch.js +0 -10
- package/lib/esm/utils/renderer/insertAfter.js +0 -12
- package/lib/esm/utils/renderer/insertImport.js +0 -11
- package/lib/types/commands/generate/ProviderTypes.d.ts +0 -11
- package/lib/types/commands/init/interfaces/InitCmdContext.d.ts +0 -6
- package/lib/types/commands/init/interfaces/InitOptions.d.ts +0 -20
- package/lib/types/services/ProvidersInfoService.d.ts +0 -21
- package/lib/types/services/Renderer.d.ts +0 -44
- package/lib/types/utils/fillImports.d.ts +0 -1
- package/lib/types/utils/hbs/array.d.ts +0 -1
- package/lib/types/utils/hbs/collection.d.ts +0 -1
- package/lib/types/utils/hbs/comparison.d.ts +0 -1
- package/lib/types/utils/hbs/object.d.ts +0 -1
- package/lib/types/utils/hbs/switch.d.ts +0 -1
- package/lib/types/utils/renderer/insertAfter.d.ts +0 -1
- package/lib/types/utils/renderer/insertImport.d.ts +0 -1
- package/templates/generate/async.factory.hbs +0 -35
- package/templates/generate/command.hbs +0 -45
- package/templates/generate/controller.hbs +0 -10
- package/templates/generate/decorator.class.hbs +0 -14
- package/templates/generate/decorator.endpoint.hbs +0 -15
- package/templates/generate/decorator.generic.hbs +0 -19
- package/templates/generate/decorator.method.hbs +0 -16
- package/templates/generate/decorator.middleware.hbs +0 -26
- package/templates/generate/decorator.param.hbs +0 -15
- package/templates/generate/decorator.parameters.hbs +0 -9
- package/templates/generate/decorator.prop.hbs +0 -14
- package/templates/generate/decorator.property.hbs +0 -5
- package/templates/generate/exception-filter.hbs +0 -9
- package/templates/generate/factory.hbs +0 -11
- package/templates/generate/injectable.hbs +0 -6
- package/templates/generate/interceptor.hbs +0 -21
- package/templates/generate/interface.hbs +0 -3
- package/templates/generate/middleware.hbs +0 -9
- package/templates/generate/model.hbs +0 -6
- package/templates/generate/module.hbs +0 -6
- package/templates/generate/pipe.hbs +0 -9
- package/templates/generate/prisma.service.hbs +0 -13
- package/templates/generate/repository.hbs +0 -6
- package/templates/generate/response-filter.hbs +0 -9
- package/templates/generate/server/_partials/server-footer.hbs +0 -10
- package/templates/generate/server/_partials/server-header.hbs +0 -34
- package/templates/generate/server/express/server.hbs +0 -10
- package/templates/generate/server/fastify/server.hbs +0 -14
- package/templates/generate/server/koa/server.hbs +0 -8
- package/templates/generate/service.hbs +0 -6
- package/templates/generate/value.hbs +0 -3
- package/templates/init/.barrels.json.hbs +0 -9
- package/templates/init/.gitignore.hbs +0 -57
- package/templates/init/.npmrc.hbs +0 -2
- package/templates/init/docker/_partials/docker-body.hbs +0 -5
- package/templates/init/docker/_partials/docker-dev-tools.hbs +0 -2
- package/templates/init/docker/_partials/docker-header.hbs +0 -16
- package/templates/init/docker/bun/Dockerfile.hbs +0 -36
- package/templates/init/docker/npm/Dockerfile.hbs +0 -28
- package/templates/init/docker/pnpm/Dockerfile.hbs +0 -28
- package/templates/init/docker/yarn/Dockerfile.hbs +0 -28
- package/templates/init/docker/yarn_berry/Dockerfile.hbs +0 -31
- package/templates/init/docker-compose.yml.hbs +0 -14
- package/templates/init/pm2/bun/processes.config.cjs.hbs +0 -23
- package/templates/init/pm2/node-compiled/processes.config.cjs.hbs +0 -22
- package/templates/init/pm2/node-loader/processes.config.cjs.hbs +0 -24
- package/templates/init/src/bin/index.ts.hbs +0 -9
- package/templates/init/src/config/envs/index.ts.hbs +0 -7
- package/templates/init/src/config/index.ts.hbs +0 -38
- package/templates/init/src/config/logger/index.ts.hbs +0 -25
- package/templates/init/tsconfig.json.hbs +0 -16
- package/templates/init/tsconfig.node.json.hbs +0 -20
- package/templates/init/tsconfig.spec.json.hbs +0 -25
- package/templates/init/webpack.config.js.hbs +0 -65
- /package/lib/esm/{commands/init/interfaces/InitCmdContext.js → interfaces/AlterGenerateTasks.js} +0 -0
- /package/lib/{types/utils/hbs/index.d.ts → esm/interfaces/AlterInitSubTasks.js} +0 -0
- /package/templates/{init/.babelrc.hbs → .babelrc} +0 -0
- /package/templates/{init/.dockerignore.hbs → .dockerignore} +0 -0
- /package/templates/{init/.swcrc.hbs → .swcrc} +0 -0
- /package/templates/{init/.yarnrc.hbs → .yarnrc} +0 -0
- /package/templates/{init/nodemon.json.hbs → nodemon.json} +0 -0
- /package/templates/{init/tsconfig.base.json.hbs → tsconfig.base.json} +0 -0
- /package/templates/{init/views/swagger.ejs.hbs → views/swagger.ejs} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
import { camelCase, pascalCase } from "change-case";
|
|
3
|
+
export default defineTemplate({
|
|
4
|
+
id: "factory",
|
|
5
|
+
label: "Factory",
|
|
6
|
+
fileName: "{{symbolName}}.factory?",
|
|
7
|
+
outputDir: "{{srcDir}}/services",
|
|
8
|
+
render(symbolName) {
|
|
9
|
+
const camelName = camelCase(symbolName);
|
|
10
|
+
const optName = pascalCase(symbolName + "Options");
|
|
11
|
+
return `import {injectable} from "@tsed/di";
|
|
12
|
+
|
|
13
|
+
interface ${optName} {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare global {
|
|
18
|
+
namespace TsED {
|
|
19
|
+
interface Configuration extends Record<string, any> {
|
|
20
|
+
${camelName}: Options;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const ${symbolName} = injectable(Symbol.for("${symbolName}"))
|
|
26
|
+
.factory(() => {
|
|
27
|
+
const myConstant = constant<${optName}>("${camelName}");
|
|
28
|
+
|
|
29
|
+
// do something
|
|
30
|
+
|
|
31
|
+
return {};
|
|
32
|
+
})
|
|
33
|
+
.token();
|
|
34
|
+
|
|
35
|
+
export type {{symbolName}} = typeof ${symbolName};`;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "index.command",
|
|
4
|
+
label: "CLI Entry Point",
|
|
5
|
+
description: "Create a new CLI entry point file",
|
|
6
|
+
outputDir: "{{srcDir}}/bin",
|
|
7
|
+
render() {
|
|
8
|
+
return `#!/usr/bin/env node
|
|
9
|
+
import {CliCore} from "@tsed/cli-core";
|
|
10
|
+
import {config} from "@/config";
|
|
11
|
+
|
|
12
|
+
CliCore.bootstrap({
|
|
13
|
+
...config,
|
|
14
|
+
commands: []
|
|
15
|
+
}).catch(console.error);
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "index.config.util",
|
|
4
|
+
label: "Is Production utility",
|
|
5
|
+
type: "util",
|
|
6
|
+
description: "Create a utility to check if the environment is production",
|
|
7
|
+
fileName: "index",
|
|
8
|
+
outputDir: "{{srcDir}}/config/utils",
|
|
9
|
+
preserveCase: true,
|
|
10
|
+
hidden: true,
|
|
11
|
+
render(_, data) {
|
|
12
|
+
return `process.env.NODE_ENV = process.env.NODE_ENV || "development";
|
|
13
|
+
|
|
14
|
+
export const isProduction = process.env.NODE_ENV === "production";
|
|
15
|
+
`;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "index.controller",
|
|
4
|
+
label: "Index Controller",
|
|
5
|
+
description: "Create a new index controller file",
|
|
6
|
+
outputDir: "{{srcDir}}/controllers/pages",
|
|
7
|
+
fileName: "index.controller",
|
|
8
|
+
hidden: true,
|
|
9
|
+
render() {
|
|
10
|
+
return `import {Constant, Controller} from "@tsed/di";
|
|
2
11
|
import {HeaderParams} from "@tsed/platform-params";
|
|
3
12
|
import {View} from "@tsed/platform-views";
|
|
4
13
|
import {SwaggerSettings} from "@tsed/swagger";
|
|
@@ -14,7 +23,7 @@ export class IndexController {
|
|
|
14
23
|
@View("swagger.ejs")
|
|
15
24
|
@(Returns(200, String).ContentType("text/html"))
|
|
16
25
|
get(@HeaderParams("x-forwarded-proto") protocol: string, @HeaderParams("host") host: string) {
|
|
17
|
-
const hostUrl =
|
|
26
|
+
const hostUrl = \`\${protocol || "http"}://\${host}\`;
|
|
18
27
|
|
|
19
28
|
return {
|
|
20
29
|
BASE_URL: hostUrl,
|
|
@@ -26,4 +35,6 @@ export class IndexController {
|
|
|
26
35
|
})
|
|
27
36
|
};
|
|
28
37
|
}
|
|
29
|
-
}
|
|
38
|
+
}`;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Import all templates to register them with the DI container
|
|
2
|
+
import "./asyncFactory.template.js";
|
|
3
|
+
import "./command.template.js";
|
|
4
|
+
import "./controller.template.js";
|
|
5
|
+
import "./decorator.template.js";
|
|
6
|
+
import "./exception-filter.template.js";
|
|
7
|
+
import "./factory.template.js";
|
|
8
|
+
import "./interface.template.js";
|
|
9
|
+
import "./interceptor.template.js";
|
|
10
|
+
import "./middleware.template.js";
|
|
11
|
+
import "./model.template.js";
|
|
12
|
+
import "./module.template.js";
|
|
13
|
+
import "./pipe.template.js";
|
|
14
|
+
import "./prisma.service.template.js";
|
|
15
|
+
import "./repository.template.js";
|
|
16
|
+
import "./response-filter.template.js";
|
|
17
|
+
import "./service.template.js";
|
|
18
|
+
import "./value.template.js";
|
|
19
|
+
import "./barrels.template.js";
|
|
20
|
+
import "./server.template.js";
|
|
21
|
+
import "./config.template.js";
|
|
22
|
+
import "./index.template.js";
|
|
23
|
+
import "./index.controller.template.js";
|
|
24
|
+
import "./index.command.template.js";
|
|
25
|
+
import "./index.logger.template.js";
|
|
26
|
+
import "./index.config.utils.template.js";
|
|
27
|
+
import "./tsconfig.template.js";
|
|
28
|
+
import "./tsconfig.spec.template.js";
|
|
29
|
+
import "./docker-compose.template.js";
|
|
30
|
+
import "./dockerfile.template.js";
|
|
31
|
+
import "./pm2.template.js";
|
|
32
|
+
import "./readme.template.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
import { ProjectConvention } from "../interfaces/index.js";
|
|
3
|
+
export default defineTemplate({
|
|
4
|
+
id: "index.logger",
|
|
5
|
+
label: "Logger",
|
|
6
|
+
description: "Create a new logger configuration file",
|
|
7
|
+
outputDir: "{{srcDir}}/config/logger",
|
|
8
|
+
fileName: "index",
|
|
9
|
+
preserveCase: true,
|
|
10
|
+
render(_, data) {
|
|
11
|
+
return `import {DILoggerOptions} from "@tsed/di";
|
|
12
|
+
import {$log} from "@tsed/logger";
|
|
13
|
+
import {isProduction} from "../utils/index.js";
|
|
14
|
+
|
|
15
|
+
if (isProduction) {
|
|
16
|
+
$log.appenders.set("stdout", {
|
|
17
|
+
type: "stdout",
|
|
18
|
+
levels: ["info", "debug"],
|
|
19
|
+
layout: {
|
|
20
|
+
type: "json"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
$log.appenders.set("stderr", {
|
|
25
|
+
levels: ["trace", "fatal", "error", "warn"],
|
|
26
|
+
type: "stderr",
|
|
27
|
+
layout: {
|
|
28
|
+
type: "json"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default <DILoggerOptions>{
|
|
34
|
+
disableRoutesSummary: isProduction
|
|
35
|
+
};
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "index",
|
|
4
|
+
label: "Main index application file",
|
|
5
|
+
description: "Create a new main index application file",
|
|
6
|
+
outputDir: "{{srcDir}}",
|
|
7
|
+
fileName: "index",
|
|
8
|
+
hidden: true,
|
|
9
|
+
preserveCase: true,
|
|
10
|
+
render() {
|
|
11
|
+
return `import {$log} from "@tsed/logger";
|
|
12
|
+
import {PlatformBuilder} from "@tsed/platform-http";
|
|
4
13
|
|
|
5
14
|
const SIG_EVENTS = [
|
|
6
15
|
"beforeExit",
|
|
@@ -19,7 +28,8 @@ const SIG_EVENTS = [
|
|
|
19
28
|
];
|
|
20
29
|
|
|
21
30
|
try {
|
|
22
|
-
const platform = await
|
|
31
|
+
const platform = await PlatformBuilder.bootstrap(Server);
|
|
32
|
+
|
|
23
33
|
await platform.listen();
|
|
24
34
|
|
|
25
35
|
SIG_EVENTS.forEach((evt) => process.on(evt, () => platform.stop()));
|
|
@@ -33,4 +43,6 @@ try {
|
|
|
33
43
|
} catch (error) {
|
|
34
44
|
$log.error({event: "SERVER_BOOTSTRAP_ERROR", message: error.message, stack: error.stack});
|
|
35
45
|
}
|
|
36
|
-
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "interceptor",
|
|
4
|
+
label: "Interceptor",
|
|
5
|
+
fileName: "{{symbolName}}.interceptor",
|
|
6
|
+
outputDir: "{{srcDir}}/interceptors",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import {InterceptorMethods, InterceptorContext, InterceptorMethods, Interceptor} from "@tsed/di";
|
|
9
|
+
|
|
10
|
+
@Interceptor()
|
|
11
|
+
export class ${symbolName} implements InterceptorMethods {
|
|
12
|
+
/**
|
|
13
|
+
* ctx: The context that holds the dynamic data related to the method execution and the proceed method
|
|
14
|
+
* to proceed with the original method execution
|
|
15
|
+
*
|
|
16
|
+
* opts: Static params that can be provided when the interceptor is attached to a specific method
|
|
17
|
+
*/
|
|
18
|
+
async intercept(context: InterceptorContext<any>, next: InterceptorMethods) {
|
|
19
|
+
console.log(\`the method \${context.propertyKey} will be executed with args \${context.args} and static data \${context.options}\`);
|
|
20
|
+
// let the original method by calling next function
|
|
21
|
+
const result = await next();
|
|
22
|
+
|
|
23
|
+
console.log(\`the method was executed, and returned \${result}\`);
|
|
24
|
+
|
|
25
|
+
// must return the returned value back to the caller
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "interface",
|
|
4
|
+
label: "Interface",
|
|
5
|
+
fileName: "{{symbolName}}.interface",
|
|
6
|
+
outputDir: "{{srcDir}}/interfaces",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `export interface ${symbolName} {
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "middleware",
|
|
4
|
+
label: "Middleware",
|
|
5
|
+
fileName: "{{symbolName}}.middleware",
|
|
6
|
+
outputDir: "{{srcDir}}/middlewares",
|
|
7
|
+
prompts: (data) => [
|
|
8
|
+
{
|
|
9
|
+
type: "list",
|
|
10
|
+
name: "middlewarePosition",
|
|
11
|
+
message: () => `The middleware should be called:`,
|
|
12
|
+
choices: [
|
|
13
|
+
{ name: "Before the endpoint", value: "before" },
|
|
14
|
+
{ name: "After the endpoint", value: "after" }
|
|
15
|
+
],
|
|
16
|
+
when(state) {
|
|
17
|
+
return !!((["decorator"].includes(state.type || data.type) && ["middleware"].includes(state.templateType)) ||
|
|
18
|
+
data.middlewarePosition);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
render(symbolName) {
|
|
23
|
+
return `import {Middleware, MiddlewareMethods} from "@tsed/platform-middlewares";
|
|
24
|
+
import {Context} from "@tsed/platform-params";
|
|
25
|
+
|
|
26
|
+
@Middleware()
|
|
27
|
+
export class ${symbolName} implements MiddlewareMethods {
|
|
28
|
+
use(@Context() ctx: Context) {
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "model",
|
|
4
|
+
label: "Model",
|
|
5
|
+
fileName: "{{symbolName}}.model",
|
|
6
|
+
outputDir: "{{srcDir}}/models",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import {Property} from "@tsed/schema";
|
|
9
|
+
|
|
10
|
+
export class ${symbolName} {
|
|
11
|
+
@Property()
|
|
12
|
+
id: string;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "module",
|
|
4
|
+
label: "Module",
|
|
5
|
+
fileName: "{{symbolName}}.module",
|
|
6
|
+
outputDir: "{{srcDir}}",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import {Module} from "@tsed/di";
|
|
9
|
+
|
|
10
|
+
@Module()
|
|
11
|
+
export class ${symbolName} {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "pipe",
|
|
4
|
+
label: "Pipe",
|
|
5
|
+
fileName: "{{symbolName}}.pipe",
|
|
6
|
+
outputDir: "{{srcDir}}/pipes",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import {Injectable} from "@tsed/di";
|
|
9
|
+
import {PipeMethods, ParamMetadata} from "@tsed/platform-params";
|
|
10
|
+
|
|
11
|
+
@Injectable()
|
|
12
|
+
export class ${symbolName} extends PipeMethods {
|
|
13
|
+
transform(value: any, param: ParamMetadata) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
import { constant } from "@tsed/di";
|
|
3
|
+
defineTemplate({
|
|
4
|
+
id: "pm2.node-loader",
|
|
5
|
+
label: "PM2 Ecosystem for Node with loader",
|
|
6
|
+
description: "Add a PM2 ecosystem file to manage your application running with node",
|
|
7
|
+
type: "pm2",
|
|
8
|
+
fileName: "processes.config",
|
|
9
|
+
ext: "cjs",
|
|
10
|
+
outputDir: ".",
|
|
11
|
+
preserveCase: true,
|
|
12
|
+
hidden: true,
|
|
13
|
+
render() {
|
|
14
|
+
return `'use strict'
|
|
15
|
+
|
|
16
|
+
const path = require('path')
|
|
17
|
+
const defaultLogFile = path.join(__dirname, '/logs/project-server.log')
|
|
18
|
+
|
|
19
|
+
module.exports = {
|
|
20
|
+
'apps': [
|
|
21
|
+
{
|
|
22
|
+
name: 'api',
|
|
23
|
+
'interpreter': 'node',
|
|
24
|
+
interpreter_args: '--import @swc-node/register/esm-register --enable-source-maps',
|
|
25
|
+
'script': \`\${process.env.WORKDIR}${constant("projectDir.srcDir")}/index.ts\`,
|
|
26
|
+
'cwd': process.env.WORKDIR,
|
|
27
|
+
exec_mode: 'cluster',
|
|
28
|
+
instances: process.env.NODE_ENV === 'test' ? 1 : process.env.NB_INSTANCES || 2,
|
|
29
|
+
autorestart: true,
|
|
30
|
+
max_memory_restart: process.env.MAX_MEMORY_RESTART || '750M',
|
|
31
|
+
'out_file': defaultLogFile,
|
|
32
|
+
'error_file': defaultLogFile,
|
|
33
|
+
'merge_logs': true,
|
|
34
|
+
'kill_timeout': 30000,
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
defineTemplate({
|
|
42
|
+
id: "pm2.node-compiled",
|
|
43
|
+
label: "PM2 Ecosystem for Node Compiled",
|
|
44
|
+
description: "Add a PM2 ecosystem file to manage your application compiled with tsc",
|
|
45
|
+
type: "pm2",
|
|
46
|
+
fileName: "processes.config",
|
|
47
|
+
ext: "cjs",
|
|
48
|
+
outputDir: ".",
|
|
49
|
+
preserveCase: true,
|
|
50
|
+
hidden: true,
|
|
51
|
+
render() {
|
|
52
|
+
return `'use strict'
|
|
53
|
+
|
|
54
|
+
const path = require('path')
|
|
55
|
+
const defaultLogFile = path.join(__dirname, '/logs/project-server.log')
|
|
56
|
+
|
|
57
|
+
module.exports = {
|
|
58
|
+
'apps': [
|
|
59
|
+
{
|
|
60
|
+
name: 'api',
|
|
61
|
+
'script': \`\${process.env.WORKDIR}/dist/index.js\`,
|
|
62
|
+
'cwd': process.env.WORKDIR,
|
|
63
|
+
exec_mode: "cluster",
|
|
64
|
+
instances: process.env.NODE_ENV === 'test' ? 1 : process.env.NB_INSTANCES || 2,
|
|
65
|
+
autorestart: true,
|
|
66
|
+
max_memory_restart: process.env.MAX_MEMORY_RESTART || '750M',
|
|
67
|
+
'out_file': defaultLogFile,
|
|
68
|
+
'error_file': defaultLogFile,
|
|
69
|
+
'merge_logs': true,
|
|
70
|
+
'kill_timeout': 30000,
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}`;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
defineTemplate({
|
|
77
|
+
id: "pm2.bun",
|
|
78
|
+
label: "PM2 Ecosystem for Bun",
|
|
79
|
+
description: "Add a PM2 ecosystem file to manage your application running with Bun",
|
|
80
|
+
type: "pm2",
|
|
81
|
+
fileName: "processes.config",
|
|
82
|
+
ext: "cjs",
|
|
83
|
+
outputDir: ".",
|
|
84
|
+
preserveCase: true,
|
|
85
|
+
hidden: true,
|
|
86
|
+
render() {
|
|
87
|
+
return `'use strict'
|
|
88
|
+
|
|
89
|
+
const path = require('path')
|
|
90
|
+
const defaultLogFile = path.join(__dirname, '/logs/project-server.log')
|
|
91
|
+
|
|
92
|
+
module.exports = {
|
|
93
|
+
'apps': [
|
|
94
|
+
{
|
|
95
|
+
name: 'api',
|
|
96
|
+
interpreter: '~/.bun/bin/bun',
|
|
97
|
+
'script': \`\${process.env.WORKDIR}/dist/index.js\`,
|
|
98
|
+
'cwd': process.env.WORKDIR,
|
|
99
|
+
exec_mode: 'cluster',
|
|
100
|
+
instances: process.env.NODE_ENV === 'test' ? 1 : process.env.NB_INSTANCES || 2,
|
|
101
|
+
autorestart: true,
|
|
102
|
+
max_memory_restart: process.env.MAX_MEMORY_RESTART || '750M',
|
|
103
|
+
'out_file': defaultLogFile,
|
|
104
|
+
'error_file': defaultLogFile,
|
|
105
|
+
'merge_logs': true,
|
|
106
|
+
'kill_timeout': 30000,
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}`;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "prisma.service",
|
|
4
|
+
label: "Prisma Service",
|
|
5
|
+
fileName: "prisma.service",
|
|
6
|
+
outputDir: "{{srcDir}}/services",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import { Injectable, OnInit, OnDestroy } from "@tsed/di";
|
|
9
|
+
import { PrismaClient } from "@prisma/client";
|
|
10
|
+
|
|
11
|
+
@Injectable()
|
|
12
|
+
export class ${symbolName} extends PrismaClient implements OnInit, OnDestroy {
|
|
13
|
+
async $onInit() {
|
|
14
|
+
await this.$connect();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async $onDestroy() {
|
|
18
|
+
await this.$disconnect();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
import { PackageManager } from "@tsed/cli-core";
|
|
3
|
+
export default defineTemplate({
|
|
4
|
+
id: "readme",
|
|
5
|
+
label: "Readme file",
|
|
6
|
+
fileName: "README",
|
|
7
|
+
outputDir: ".",
|
|
8
|
+
ext: "md",
|
|
9
|
+
preserveCase: true,
|
|
10
|
+
hidden: true,
|
|
11
|
+
render(_, data) {
|
|
12
|
+
const pkgCmd = data.packageManager === PackageManager.YARN_BERRY ? "yarn" : data.packageManager;
|
|
13
|
+
return `<p style="text-align: center" align="center">
|
|
2
14
|
<a href="https://tsed.dev" target="_blank"><img src="https://tsed.dev/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
|
|
3
15
|
</p>
|
|
4
16
|
|
|
5
17
|
<div align="center">
|
|
6
|
-
<h1>Ts.ED - {
|
|
18
|
+
<h1>Ts.ED - ${data.projectName}</h1>
|
|
7
19
|
<br />
|
|
8
20
|
<div align="center">
|
|
9
21
|
<a href="https://cli.tsed.dev/">Website</a>
|
|
@@ -23,35 +35,35 @@
|
|
|
23
35
|
|
|
24
36
|
> **Important!** Ts.ED requires Node >= 20.x or Bun.js and TypeScript >= 5.
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
\`\`\`batch
|
|
27
39
|
# install dependencies
|
|
28
|
-
$ {
|
|
40
|
+
$ ${pkgCmd} install
|
|
29
41
|
|
|
30
42
|
# serve
|
|
31
|
-
$ {
|
|
43
|
+
$ ${pkgCmd} start
|
|
32
44
|
|
|
33
45
|
# build for production
|
|
34
|
-
$ {
|
|
35
|
-
$ {
|
|
36
|
-
|
|
46
|
+
$ ${pkgCmd} run build
|
|
47
|
+
$ ${pkgCmd} run start:prod
|
|
48
|
+
\`\`\`
|
|
37
49
|
|
|
38
50
|
## Docker
|
|
39
51
|
|
|
40
|
-
|
|
52
|
+
\`\`\`
|
|
41
53
|
# build docker image
|
|
42
54
|
docker compose build
|
|
43
55
|
|
|
44
56
|
# start docker image
|
|
45
57
|
docker compose up
|
|
46
|
-
|
|
58
|
+
\`\`\`
|
|
47
59
|
|
|
48
60
|
## Barrels
|
|
49
61
|
|
|
50
62
|
This project uses [barrels](https://www.npmjs.com/package/@tsed/barrels) to generate index files to import the controllers.
|
|
51
63
|
|
|
52
|
-
Edit
|
|
64
|
+
Edit \`.barrels.json\` to customize it:
|
|
53
65
|
|
|
54
|
-
|
|
66
|
+
\`\`\`json
|
|
55
67
|
{
|
|
56
68
|
"directory": [
|
|
57
69
|
"./src/controllers/rest",
|
|
@@ -64,4 +76,7 @@ Edit `.barrels.json` to customize it:
|
|
|
64
76
|
],
|
|
65
77
|
"delete": true
|
|
66
78
|
}
|
|
67
|
-
|
|
79
|
+
\`\`\`
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "repository",
|
|
4
|
+
label: "Repository",
|
|
5
|
+
fileName: "{{symbolName}}.repository",
|
|
6
|
+
outputDir: "{{srcDir}}/services",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import {Injectable} from "@tsed/di";
|
|
9
|
+
|
|
10
|
+
@Injectable()
|
|
11
|
+
export class ${symbolName} {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "response-filter",
|
|
4
|
+
label: "Response Filter",
|
|
5
|
+
fileName: "{{symbolName}}.response-filter",
|
|
6
|
+
outputDir: "{{srcDir}}/filters",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import {ResponseFilter, ResponseFilterMethods} from "@tsed/platform-response-filter";
|
|
9
|
+
import {BaseContext} from "@tsed/di";
|
|
10
|
+
|
|
11
|
+
@ResponseFilter("text/xml")
|
|
12
|
+
export class ${symbolName} implements ResponseFilterMethods {
|
|
13
|
+
transform(data: any, ctx: BaseContext) {
|
|
14
|
+
return jsToXML(data);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "server",
|
|
4
|
+
label: "Server",
|
|
5
|
+
description: "Create a new server file",
|
|
6
|
+
outputDir: "{{srcDir}}",
|
|
7
|
+
fileName: "server",
|
|
8
|
+
hidden: true,
|
|
9
|
+
render() {
|
|
10
|
+
return `import "@tsed/platform-log-request";
|
|
11
|
+
import "@tsed/ajv";
|
|
12
|
+
|
|
13
|
+
import {join} from "node:path";
|
|
14
|
+
import {Configuration} from "@tsed/di";
|
|
15
|
+
import {application} from "@tsed/platform-http";
|
|
16
|
+
|
|
17
|
+
import {config} from "@/config/config.js";
|
|
18
|
+
|
|
19
|
+
@Configuration({
|
|
20
|
+
...config,
|
|
21
|
+
acceptMimes: ["application/json"],
|
|
22
|
+
httpPort: process.env.PORT || 8083,
|
|
23
|
+
httpsPort: false, // CHANGE
|
|
24
|
+
mount: {},
|
|
25
|
+
views: {
|
|
26
|
+
root: join(process.cwd(), "../views"),
|
|
27
|
+
extensions: {
|
|
28
|
+
ejs: "ejs"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
export class Server {
|
|
33
|
+
protected app = application();
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineTemplate } from "../utils/defineTemplate.js";
|
|
2
|
+
export default defineTemplate({
|
|
3
|
+
id: "service",
|
|
4
|
+
label: "Service",
|
|
5
|
+
fileName: "{{symbolName}}.service",
|
|
6
|
+
outputDir: "{{srcDir}}/services",
|
|
7
|
+
render(symbolName) {
|
|
8
|
+
return `import {Injectable} from "@tsed/di";
|
|
9
|
+
|
|
10
|
+
@Injectable()
|
|
11
|
+
export class ${symbolName} {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
});
|