@decaf-ts/for-nest 0.1.11 → 0.1.12

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.
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const cli_module_1 = __importDefault(require("./../cli-module.cjs"));
7
+ (0, cli_module_1.default)().parse(process.argv);
8
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":";;;;;AAAA,qEAAiC;AAEjC,IAAA,oBAAI,GAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -1,122 +1,133 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
2
38
  Object.defineProperty(exports, "__esModule", { value: true });
3
39
  exports.default = nest;
4
- const commander_1 = require("commander");
5
- const utils_1 = require("@decaf-ts/utils");
6
40
  const logging_1 = require("@decaf-ts/logging");
7
- var Projects;
8
- (function (Projects) {
9
- Projects["NEST_PROJECT"] = "nest-project";
10
- })(Projects || (Projects = {}));
11
- var Types;
12
- (function (Types) {
13
- Types["CONTROLLER"] = "page";
14
- Types["SCHEMATICS"] = "schematics";
15
- })(Types || (Types = {}));
16
- const logger = logging_1.Logging.for("nestjs-cli");
17
- /**
18
- * Creates and returns a Command object for the Angular CLI module in decaf-ts.
19
- * This function sets up a 'generate' command that can create various Angular artifacts.
20
- *
21
- * @returns {Command} A Command object configured with the 'generate' subcommand and its action.
22
- *
23
- * The command syntax is: generate <type> <name> [project]
24
- * @param {Types} type - The type of artifact to generate (e.g., service, component, directive, page).
25
- * @param {string} name - The name of the artifact to be generated.
26
- * @param {Projects} [project=Projects.FOR_ANGULAR] - The project for which to generate the artifact.
27
- * Defaults to the main Angular project if not specified.
28
- *
29
- * @throws {Error} If an invalid type is provided.
30
- *
31
- * @example
32
- * // Usage in CLI
33
- * // decaf-ts generate service my-service
34
- * // decaf-ts generate component my-component for-angular-app
35
- */
36
- function nest() {
37
- return new commander_1.Command()
38
- .name("nest")
39
- .command("generate <type> <name> [project]")
40
- .description(`decaf-ts NestJS CLI module`)
41
- .action(async (type, name,
42
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
43
- project = Projects.NEST_PROJECT) => {
44
- if (!validateType(type))
45
- return logger.error(`${type} is not valid. Use service, component or directive.`);
46
- //
47
- // if (type === Types.SCHEMATICS) return await generateSchematics();
48
- //
49
- // if (type === Types.CONTROLLER) {
50
- // logger.info(
51
- // `Pages can be only generate for app. Forcing project to: ${Projects.FOR_ANGULAR_APP}`
52
- // );
53
- // project = Projects.FOR_ANGULAR_APP;
54
- // }
55
- //
56
- // (project as string) = parseProjectName(project);
57
- //
58
- // if (!validateProject(project)) project = Projects.NEST_PROJECT;
59
- // const command =
60
- // project === Projects.FOR_ANGULAR_APP
61
- // ? "ionic generate"
62
- // : `ng generate --project=${Projects.NEST_PROJECT} --path=src/lib/${type}s`;
63
- //
64
- // try {
65
- // const result = await execute(`${command} ${type} ${name}`);
66
- // logger.info(result as string);
67
- // } catch (error: any) {
68
- // logger.error(error?.message || error);
69
- // }
70
- });
71
- }
72
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
73
- async function generateSchematics() {
74
- return Promise.all([
75
- execute(`npm link schematics`),
76
- execute(`cd schematics`),
77
- execute(`npm install`),
78
- execute(`npm run build`),
79
- execute(`npx schematics .:schematics --name=decaf`),
80
- ])
81
- .then((res) => res)
82
- .catch((error) => error);
83
- }
84
- /**
85
- * Executes a shell command asynchronously.
86
- *
87
- * @param command - The shell command to execute.
88
- * @returns A Promise that resolves with the command's stdout output as a string if successful,
89
- * or rejects with an error message if the command fails or produces stderr output.
90
- */
91
- async function execute(command) {
41
+ const logger = logging_1.Logging.for("for-nest");
42
+ const commander_1 = require("commander");
43
+ const fs_1 = __importDefault(require("fs"));
44
+ const path_1 = __importDefault(require("path"));
45
+ const shared_1 = require("@decaf-ts/for-fabric/shared");
46
+ const db_decorators_1 = require("@decaf-ts/db-decorators");
47
+ const core_1 = require("@nestjs/core");
48
+ const swagger_1 = require("@nestjs/swagger");
49
+ async function bootApp(log, p) {
50
+ log = log.for(bootApp);
51
+ let module;
92
52
  try {
93
- return await (0, utils_1.runCommand)(command).promise;
53
+ module = await (0, shared_1.normalizeImport)(Promise.resolve(`${p}`).then(s => __importStar(require(s))));
94
54
  }
95
- catch (error) {
96
- logger.error(error?.message || error);
55
+ catch (e) {
56
+ throw new db_decorators_1.InternalError(`Failed to load module under ${p}: ${e}`);
97
57
  }
58
+ log.verbose(`Booting app without opening a port`);
59
+ const app = await core_1.NestFactory.create(module, {
60
+ logger: false,
61
+ });
62
+ await app.init();
63
+ log.info(`dev mode app booted`);
64
+ return app;
98
65
  }
99
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
100
- function parseProjectName(value) {
101
- return value.toLowerCase();
66
+ async function shutdownApp(log, app) {
67
+ log.for(shutdownApp).verbose(`Shutting down app`);
68
+ await app.close();
102
69
  }
103
- /**
104
- * Validates if the given type value is a valid enum member of Types.
105
- *
106
- * @param value - The type value to validate.
107
- * @returns A boolean indicating whether the value is a valid Types enum member.
108
- */
109
- function validateType(value) {
110
- return Object.values(Types).includes(value);
70
+ async function createSwagger(log, app, cfg) {
71
+ const { title, description, version } = cfg;
72
+ const config = new swagger_1.DocumentBuilder()
73
+ .setTitle(title)
74
+ .setDescription(description)
75
+ .setVersion(version)
76
+ .build();
77
+ log = log.for(createSwagger);
78
+ log.verbose(`Creating swgger`);
79
+ const document = swagger_1.SwaggerModule.createDocument(app, config);
80
+ log.info(`Swagger doc created`);
81
+ return document;
111
82
  }
112
- /**
113
- * Validates if the given project value is a valid enum member of Projects.
114
- *
115
- * @param value - The project value to validate.
116
- * @returns A boolean indicating whether the value is a valid Projects enum member.
117
- */
118
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
119
- function validateProject(value) {
120
- return Object.values(Projects).includes(value);
83
+ const compileCommand = new commander_1.Command()
84
+ .name("export-api")
85
+ .description("exports the api in json format")
86
+ .option("--input <String>", "path to app module", "./src/app.module.ts")
87
+ .option("--output <String>", "output folder for api definition file", "./")
88
+ .option("--appendVersion <Boolean>", "if the version if to be appended to the json file name", false)
89
+ .option("--title [String]", "title of the OpenApi spec. defaults to name in package")
90
+ .option("--description [String]", "description of the OpenApi spec. defaults to description in package")
91
+ .option("--name [String]", "file name (without json). defaults to name on package.json")
92
+ .action(async (options) => {
93
+ const pkg = JSON.parse(fs_1.default.readFileSync(path_1.default.join(process.cwd(), "package.json"), "utf-8"));
94
+ const version = pkg.version;
95
+ // eslint-disable-next-line prefer-const
96
+ let { title, name, description, output, input, appendVersion } = options;
97
+ const log = logger.for("export-api");
98
+ log.debug(`running with options: ${JSON.stringify(options)} for ${pkg.name} version ${version}`);
99
+ description = description = description || pkg.description;
100
+ title = title || pkg.name;
101
+ output = path_1.default.resolve(output);
102
+ try {
103
+ fs_1.default.statfsSync(output);
104
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
105
+ }
106
+ catch (e) {
107
+ fs_1.default.mkdirSync(output, { recursive: true });
108
+ }
109
+ output = path_1.default.resolve(path_1.default.join(output, (name || pkg.name) + (appendVersion ? `-${version}` : "") + ".json"));
110
+ const app = await bootApp(log, input);
111
+ const document = await createSwagger(log, app, {
112
+ title,
113
+ description,
114
+ version,
115
+ });
116
+ try {
117
+ fs_1.default.writeFileSync(output, JSON.stringify(document, null, 2), "utf8");
118
+ }
119
+ catch (e) {
120
+ throw new db_decorators_1.InternalError(e);
121
+ }
122
+ finally {
123
+ await shutdownApp(log, app);
124
+ }
125
+ });
126
+ const nestCmd = new commander_1.Command()
127
+ .name("nest")
128
+ .description("exposes several commands to help manage the nest integration");
129
+ nestCmd.addCommand(compileCommand);
130
+ function nest() {
131
+ return nestCmd;
121
132
  }
122
133
  //# sourceMappingURL=cli-module.js.map
@@ -1,20 +1 @@
1
- /**
2
- * Creates and returns a Command object for the Angular CLI module in decaf-ts.
3
- * This function sets up a 'generate' command that can create various Angular artifacts.
4
- *
5
- * @returns {Command} A Command object configured with the 'generate' subcommand and its action.
6
- *
7
- * The command syntax is: generate <type> <name> [project]
8
- * @param {Types} type - The type of artifact to generate (e.g., service, component, directive, page).
9
- * @param {string} name - The name of the artifact to be generated.
10
- * @param {Projects} [project=Projects.FOR_ANGULAR] - The project for which to generate the artifact.
11
- * Defaults to the main Angular project if not specified.
12
- *
13
- * @throws {Error} If an invalid type is provided.
14
- *
15
- * @example
16
- * // Usage in CLI
17
- * // decaf-ts generate service my-service
18
- * // decaf-ts generate component my-component for-angular-app
19
- */
20
1
  export default function nest(): import("commander").Command;
@@ -1 +1 @@
1
- {"version":3,"file":"cli-module.js","sourceRoot":"","sources":["../src/cli-module.ts"],"names":[],"mappings":";;AAkCA,uBA0CC;AA5ED,yCAAoC;AACpC,2CAA6C;AAC7C,+CAA4C;AAE5C,IAAK,QAEJ;AAFD,WAAK,QAAQ;IACX,yCAA6B,CAAA;AAC/B,CAAC,EAFI,QAAQ,KAAR,QAAQ,QAEZ;AAED,IAAK,KAGJ;AAHD,WAAK,KAAK;IACR,4BAAmB,CAAA;IACnB,kCAAyB,CAAA;AAC3B,CAAC,EAHI,KAAK,KAAL,KAAK,QAGT;AAED,MAAM,MAAM,GAAG,iBAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAwB,IAAI;IAC1B,OAAO,IAAI,mBAAO,EAAE;SACjB,IAAI,CAAC,MAAM,CAAC;SACZ,OAAO,CAAC,kCAAkC,CAAC;SAC3C,WAAW,CAAC,4BAA4B,CAAC;SACzC,MAAM,CACL,KAAK,EACH,IAAW,EACX,IAAY;IACZ,6DAA6D;IAC7D,UAAoB,QAAQ,CAAC,YAAY,EACzC,EAAE;QACF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,OAAO,MAAM,CAAC,KAAK,CACjB,GAAG,IAAI,qDAAqD,CAC7D,CAAC;QACJ,EAAE;QACF,sEAAsE;QACtE,EAAE;QACF,qCAAqC;QACrC,mBAAmB;QACnB,8FAA8F;QAC9F,SAAS;QACT,0CAA0C;QAC1C,MAAM;QACN,EAAE;QACF,qDAAqD;QACrD,EAAE;QACF,oEAAoE;QACpE,oBAAoB;QACpB,2CAA2C;QAC3C,2BAA2B;QAC3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AC;QACpB,MAAM,IAAI,6BAAa,CAAC,CAAU,CAAC,CAAC;IACtC,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE;KAC1B,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,8DAA8D,CAAC,CAAC;AAE/E,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEnC,SAAwB,IAAI;IAC1B,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import nest from "./../cli-module.js";
2
+ nest().parse(process.argv);
3
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/bin/cli.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,2BAAsB;AAEjC,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -1,20 +1 @@
1
- /**
2
- * Creates and returns a Command object for the Angular CLI module in decaf-ts.
3
- * This function sets up a 'generate' command that can create various Angular artifacts.
4
- *
5
- * @returns {Command} A Command object configured with the 'generate' subcommand and its action.
6
- *
7
- * The command syntax is: generate <type> <name> [project]
8
- * @param {Types} type - The type of artifact to generate (e.g., service, component, directive, page).
9
- * @param {string} name - The name of the artifact to be generated.
10
- * @param {Projects} [project=Projects.FOR_ANGULAR] - The project for which to generate the artifact.
11
- * Defaults to the main Angular project if not specified.
12
- *
13
- * @throws {Error} If an invalid type is provided.
14
- *
15
- * @example
16
- * // Usage in CLI
17
- * // decaf-ts generate service my-service
18
- * // decaf-ts generate component my-component for-angular-app
19
- */
20
1
  export default function nest(): import("commander").Command;
@@ -1,119 +1,94 @@
1
- import { Command } from "commander";
2
- import { runCommand } from "@decaf-ts/utils";
3
1
  import { Logging } from "@decaf-ts/logging";
4
- var Projects;
5
- (function (Projects) {
6
- Projects["NEST_PROJECT"] = "nest-project";
7
- })(Projects || (Projects = {}));
8
- var Types;
9
- (function (Types) {
10
- Types["CONTROLLER"] = "page";
11
- Types["SCHEMATICS"] = "schematics";
12
- })(Types || (Types = {}));
13
- const logger = Logging.for("nestjs-cli");
14
- /**
15
- * Creates and returns a Command object for the Angular CLI module in decaf-ts.
16
- * This function sets up a 'generate' command that can create various Angular artifacts.
17
- *
18
- * @returns {Command} A Command object configured with the 'generate' subcommand and its action.
19
- *
20
- * The command syntax is: generate <type> <name> [project]
21
- * @param {Types} type - The type of artifact to generate (e.g., service, component, directive, page).
22
- * @param {string} name - The name of the artifact to be generated.
23
- * @param {Projects} [project=Projects.FOR_ANGULAR] - The project for which to generate the artifact.
24
- * Defaults to the main Angular project if not specified.
25
- *
26
- * @throws {Error} If an invalid type is provided.
27
- *
28
- * @example
29
- * // Usage in CLI
30
- * // decaf-ts generate service my-service
31
- * // decaf-ts generate component my-component for-angular-app
32
- */
33
- export default function nest() {
34
- return new Command()
35
- .name("nest")
36
- .command("generate <type> <name> [project]")
37
- .description(`decaf-ts NestJS CLI module`)
38
- .action(async (type, name,
39
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
40
- project = Projects.NEST_PROJECT) => {
41
- if (!validateType(type))
42
- return logger.error(`${type} is not valid. Use service, component or directive.`);
43
- //
44
- // if (type === Types.SCHEMATICS) return await generateSchematics();
45
- //
46
- // if (type === Types.CONTROLLER) {
47
- // logger.info(
48
- // `Pages can be only generate for app. Forcing project to: ${Projects.FOR_ANGULAR_APP}`
49
- // );
50
- // project = Projects.FOR_ANGULAR_APP;
51
- // }
52
- //
53
- // (project as string) = parseProjectName(project);
54
- //
55
- // if (!validateProject(project)) project = Projects.NEST_PROJECT;
56
- // const command =
57
- // project === Projects.FOR_ANGULAR_APP
58
- // ? "ionic generate"
59
- // : `ng generate --project=${Projects.NEST_PROJECT} --path=src/lib/${type}s`;
60
- //
61
- // try {
62
- // const result = await execute(`${command} ${type} ${name}`);
63
- // logger.info(result as string);
64
- // } catch (error: any) {
65
- // logger.error(error?.message || error);
66
- // }
67
- });
68
- }
69
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
70
- async function generateSchematics() {
71
- return Promise.all([
72
- execute(`npm link schematics`),
73
- execute(`cd schematics`),
74
- execute(`npm install`),
75
- execute(`npm run build`),
76
- execute(`npx schematics .:schematics --name=decaf`),
77
- ])
78
- .then((res) => res)
79
- .catch((error) => error);
80
- }
81
- /**
82
- * Executes a shell command asynchronously.
83
- *
84
- * @param command - The shell command to execute.
85
- * @returns A Promise that resolves with the command's stdout output as a string if successful,
86
- * or rejects with an error message if the command fails or produces stderr output.
87
- */
88
- async function execute(command) {
2
+ const logger = Logging.for("for-nest");
3
+ import { Command } from "commander";
4
+ import fs from "fs";
5
+ import path from "path";
6
+ import { normalizeImport } from "@decaf-ts/for-fabric/shared";
7
+ import { InternalError } from "@decaf-ts/db-decorators";
8
+ import { NestFactory } from "@nestjs/core";
9
+ import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
10
+ async function bootApp(log, p) {
11
+ log = log.for(bootApp);
12
+ let module;
89
13
  try {
90
- return await runCommand(command).promise;
14
+ module = await normalizeImport(import(p));
91
15
  }
92
- catch (error) {
93
- logger.error(error?.message || error);
16
+ catch (e) {
17
+ throw new InternalError(`Failed to load module under ${p}: ${e}`);
94
18
  }
19
+ log.verbose(`Booting app without opening a port`);
20
+ const app = await NestFactory.create(module, {
21
+ logger: false,
22
+ });
23
+ await app.init();
24
+ log.info(`dev mode app booted`);
25
+ return app;
95
26
  }
96
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
97
- function parseProjectName(value) {
98
- return value.toLowerCase();
27
+ async function shutdownApp(log, app) {
28
+ log.for(shutdownApp).verbose(`Shutting down app`);
29
+ await app.close();
99
30
  }
100
- /**
101
- * Validates if the given type value is a valid enum member of Types.
102
- *
103
- * @param value - The type value to validate.
104
- * @returns A boolean indicating whether the value is a valid Types enum member.
105
- */
106
- function validateType(value) {
107
- return Object.values(Types).includes(value);
31
+ async function createSwagger(log, app, cfg) {
32
+ const { title, description, version } = cfg;
33
+ const config = new DocumentBuilder()
34
+ .setTitle(title)
35
+ .setDescription(description)
36
+ .setVersion(version)
37
+ .build();
38
+ log = log.for(createSwagger);
39
+ log.verbose(`Creating swgger`);
40
+ const document = SwaggerModule.createDocument(app, config);
41
+ log.info(`Swagger doc created`);
42
+ return document;
108
43
  }
109
- /**
110
- * Validates if the given project value is a valid enum member of Projects.
111
- *
112
- * @param value - The project value to validate.
113
- * @returns A boolean indicating whether the value is a valid Projects enum member.
114
- */
115
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
116
- function validateProject(value) {
117
- return Object.values(Projects).includes(value);
44
+ const compileCommand = new Command()
45
+ .name("export-api")
46
+ .description("exports the api in json format")
47
+ .option("--input <String>", "path to app module", "./src/app.module.ts")
48
+ .option("--output <String>", "output folder for api definition file", "./")
49
+ .option("--appendVersion <Boolean>", "if the version if to be appended to the json file name", false)
50
+ .option("--title [String]", "title of the OpenApi spec. defaults to name in package")
51
+ .option("--description [String]", "description of the OpenApi spec. defaults to description in package")
52
+ .option("--name [String]", "file name (without json). defaults to name on package.json")
53
+ .action(async (options) => {
54
+ const pkg = JSON.parse(fs.readFileSync(path.join(process.cwd(), "package.json"), "utf-8"));
55
+ const version = pkg.version;
56
+ // eslint-disable-next-line prefer-const
57
+ let { title, name, description, output, input, appendVersion } = options;
58
+ const log = logger.for("export-api");
59
+ log.debug(`running with options: ${JSON.stringify(options)} for ${pkg.name} version ${version}`);
60
+ description = description = description || pkg.description;
61
+ title = title || pkg.name;
62
+ output = path.resolve(output);
63
+ try {
64
+ fs.statfsSync(output);
65
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
66
+ }
67
+ catch (e) {
68
+ fs.mkdirSync(output, { recursive: true });
69
+ }
70
+ output = path.resolve(path.join(output, (name || pkg.name) + (appendVersion ? `-${version}` : "") + ".json"));
71
+ const app = await bootApp(log, input);
72
+ const document = await createSwagger(log, app, {
73
+ title,
74
+ description,
75
+ version,
76
+ });
77
+ try {
78
+ fs.writeFileSync(output, JSON.stringify(document, null, 2), "utf8");
79
+ }
80
+ catch (e) {
81
+ throw new InternalError(e);
82
+ }
83
+ finally {
84
+ await shutdownApp(log, app);
85
+ }
86
+ });
87
+ const nestCmd = new Command()
88
+ .name("nest")
89
+ .description("exposes several commands to help manage the nest integration");
90
+ nestCmd.addCommand(compileCommand);
91
+ export default function nest() {
92
+ return nestCmd;
118
93
  }
119
94
  //# sourceMappingURL=cli-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-module.js","sourceRoot":"","sources":["../../src/cli-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,IAAK,QAEJ;AAFD,WAAK,QAAQ;IACX,yCAA6B,CAAA;AAC/B,CAAC,EAFI,QAAQ,KAAR,QAAQ,QAEZ;AAED,IAAK,KAGJ;AAHD,WAAK,KAAK;IACR,4BAAmB,CAAA;IACnB,kCAAyB,CAAA;AAC3B,CAAC,EAHI,KAAK,KAAL,KAAK,QAGT;AAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI;IAC1B,OAAO,IAAI,OAAO,EAAE;SACjB,IAAI,CAAC,MAAM,CAAC;SACZ,OAAO,CAAC,kCAAkC,CAAC;SAC3C,WAAW,CAAC,4BAA4B,CAAC;SACzC,MAAM,CACL,KAAK,EACH,IAAW,EACX,IAAY;IACZ,6DAA6D;IAC7D,UAAoB,QAAQ,CAAC,YAAY,EACzC,EAAE;QACF,IAAI,CAAC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AI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CACpE,CACF,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE;QAC7C,KAAK;QACL,WAAW;QACX,OAAO;KACR,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,MAAM,IAAI,aAAa,CAAC,CAAU,CAAC,CAAC;IACtC,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;KAC1B,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,8DAA8D,CAAC,CAAC;AAE/E,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEnC,MAAM,CAAC,OAAO,UAAU,IAAI;IAC1B,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -35,5 +35,5 @@ export * from "./request";
35
35
  * @constant
36
36
  * @type {string}
37
37
  */
38
- export declare const VERSION = "0.1.10";
38
+ export declare const VERSION = "0.1.11";
39
39
  export declare const PACKAGE_NAME = "@decaf-ts/for-nest";
package/lib/esm/index.js CHANGED
@@ -36,7 +36,7 @@ export * from "./request/index.js";
36
36
  * @constant
37
37
  * @type {string}
38
38
  */
39
- export const VERSION = "0.1.10";
39
+ export const VERSION = "0.1.11";
40
40
  export const PACKAGE_NAME = "@decaf-ts/for-nest";
41
41
  Metadata.registerLibrary(PACKAGE_NAME, VERSION);
42
42
  //# sourceMappingURL=index.js.map
package/lib/index.cjs CHANGED
@@ -53,7 +53,7 @@ __exportStar(require("./request/index.cjs"), exports);
53
53
  * @constant
54
54
  * @type {string}
55
55
  */
56
- exports.VERSION = "0.1.10";
56
+ exports.VERSION = "0.1.11";
57
57
  exports.PACKAGE_NAME = "@decaf-ts/for-nest";
58
58
  decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
59
59
  //# sourceMappingURL=index.js.map
package/lib/index.d.ts CHANGED
@@ -35,5 +35,5 @@ export * from "./request";
35
35
  * @constant
36
36
  * @type {string}
37
37
  */
38
- export declare const VERSION = "0.1.10";
38
+ export declare const VERSION = "0.1.11";
39
39
  export declare const PACKAGE_NAME = "@decaf-ts/for-nest";
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-nest",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "NestJS decaf integration",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "require": "./lib/index.cjs",
8
8
  "import": "./lib/esm/index.js"
9
9
  },
10
+ "bin": {
11
+ "for-nest": "./lib/bin/cli.cjs"
12
+ },
10
13
  "types": "lib/index.d.ts",
11
14
  "scripts": {
12
15
  "do-install": "NPM_TOKEN=$(cat .npmtoken) npm install",