@futdevpro/nts-dynamo 1.15.304 → 1.15.307
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/build/_collections/global-settings.const.d.ts.map +1 -1
- package/build/_collections/global-settings.const.js +1 -0
- package/build/_collections/global-settings.const.js.map +1 -1
- package/build/_models/interfaces/global-settings.interface.d.ts +6 -0
- package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
- package/build/_modules/cli/_collections/cli-commander.util.d.ts +25 -0
- package/build/_modules/cli/_collections/cli-commander.util.d.ts.map +1 -0
- package/build/_modules/cli/_collections/cli-commander.util.js +69 -0
- package/build/_modules/cli/_collections/cli-commander.util.js.map +1 -0
- package/build/_modules/cli/_collections/cli-flag.util.d.ts +37 -0
- package/build/_modules/cli/_collections/cli-flag.util.d.ts.map +1 -0
- package/build/_modules/cli/_collections/cli-flag.util.js +174 -0
- package/build/_modules/cli/_collections/cli-flag.util.js.map +1 -0
- package/build/_modules/cli/_enums/cli-exit-code.type-enum.d.ts +20 -0
- package/build/_modules/cli/_enums/cli-exit-code.type-enum.d.ts.map +1 -0
- package/build/_modules/cli/_enums/cli-exit-code.type-enum.js +24 -0
- package/build/_modules/cli/_enums/cli-exit-code.type-enum.js.map +1 -0
- package/build/_modules/cli/_enums/cli-flag-value.type-enum.d.ts +16 -0
- package/build/_modules/cli/_enums/cli-flag-value.type-enum.d.ts.map +1 -0
- package/build/_modules/cli/_enums/cli-flag-value.type-enum.js +20 -0
- package/build/_modules/cli/_enums/cli-flag-value.type-enum.js.map +1 -0
- package/build/_modules/cli/_enums/cli-output.type-enum.d.ts +8 -0
- package/build/_modules/cli/_enums/cli-output.type-enum.d.ts.map +1 -0
- package/build/_modules/cli/_enums/cli-output.type-enum.js +12 -0
- package/build/_modules/cli/_enums/cli-output.type-enum.js.map +1 -0
- package/build/_modules/cli/_models/control-models/cli-command-params.control-model.d.ts +115 -0
- package/build/_modules/cli/_models/control-models/cli-command-params.control-model.d.ts.map +1 -0
- package/build/_modules/cli/_models/control-models/cli-command-params.control-model.js +237 -0
- package/build/_modules/cli/_models/control-models/cli-command-params.control-model.js.map +1 -0
- package/build/_modules/cli/_models/interfaces/cli-flag.interface.d.ts +47 -0
- package/build/_modules/cli/_models/interfaces/cli-flag.interface.d.ts.map +1 -0
- package/build/_modules/cli/_models/interfaces/cli-flag.interface.js +3 -0
- package/build/_modules/cli/_models/interfaces/cli-flag.interface.js.map +1 -0
- package/build/_modules/cli/_models/interfaces/cli-settings.interface.d.ts +25 -0
- package/build/_modules/cli/_models/interfaces/cli-settings.interface.d.ts.map +1 -0
- package/build/_modules/cli/_models/interfaces/cli-settings.interface.js +3 -0
- package/build/_modules/cli/_models/interfaces/cli-settings.interface.js.map +1 -0
- package/build/_modules/cli/index.d.ts +9 -0
- package/build/_modules/cli/index.d.ts.map +1 -0
- package/build/_modules/cli/index.js +19 -0
- package/build/_modules/cli/index.js.map +1 -0
- package/package.json +16 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-settings.const.d.ts","sourceRoot":"","sources":["../../src/_collections/global-settings.const.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAIxF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"global-settings.const.d.ts","sourceRoot":"","sources":["../../src/_collections/global-settings.const.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAIxF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,qBAmInC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-settings.const.js","sourceRoot":"","sources":["../../src/_collections/global-settings.const.ts"],"names":[],"mappings":";;;AAEA,uEAAoE;AAEpE,yFAAsF;AACtF,mFAAgF;AAEhF;;;GAGG;AACU,QAAA,qBAAqB,GAA0B;IAC1D,OAA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E,IAAI;QAClB,aAAa,EAAE,IAAI;KACpB;IAED,6FAA6F;IAC7F,0FAA0F;IAC1F,+FAA+F;IAC/F,eAAe,EAAE;QACf,OAAO,EAAE,IAAI;QACb,eAAe,EAAE,IAAI;KACtB;IAED,yFAAyF;IACzF,yFAAyF;IACzF,uFAAuF;IACvF,WAAW,EAAE;QACX,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,KAAK;QACrB,oBAAoB,EAAE,EAAE;QACxB,qBAAqB,EAAE,EAAE;QACzB,cAAc,EAAE,EAAE;QAClB,eAAe,EAAE,GAAG;QACpB,kHAAkH;QAClH,iBAAiB,EAAE,IAAI;QACvB,kBAAkB,EAAE,IAAI;QACxB,2GAA2G;QAC3G,0GAA0G;QAC1G,kGAAkG;QAClG,sBAAsB,EAAE,CAAC;QACzB,uBAAuB,EAAE,CAAC;QAC1B,oBAAoB,EAAE,IAAI;QAC1B,uBAAuB,EAAE,KAAK;QAC9B,sBAAsB,EAAE,CAAC;QACzB,QAAQ,EAAE,GAAG;QACb,WAAW,EAAE,KAAK;QAClB,8FAA8F;QAC9F,eAAe,EAAE,KAAK;QACtB,uBAAuB,EAAE,CAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,CAAE;KACzE;IACD,+FAA+F;IAC/F,aAAa,EAAE;QACb,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,GAAG;KACrB;IAED,+FAA+F;IAC/F,iGAAiG;IACjG,iGAAiG;IACjG,gGAAgG;IAChG,uBAAuB,EAAE;QACvB,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,MAAM;QACtB,qBAAqB,EAAE,MAAM;QAC7B,sBAAsB,EAAE,EAAE;QAC1B,iBAAiB,EAAE,OAAO;KAC3B;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"global-settings.const.js","sourceRoot":"","sources":["../../src/_collections/global-settings.const.ts"],"names":[],"mappings":";;;AAEA,uEAAoE;AAEpE,yFAAsF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{ DyNTS_AppVersionHeader_Settings } from './app-version-header-settings.i
|
|
|
4
4
|
import { DyNTS_Environment_Settings } from './environment-settings.interface';
|
|
5
5
|
import { DyNTS_GlobalLog_Settings } from './global-log-settings.interface';
|
|
6
6
|
import { DyNTS_SecurityHeaders_Settings } from './security-headers-settings.interface';
|
|
7
|
+
import type { DyCLI_Settings } from '../../_modules/cli/_models/interfaces/cli-settings.interface';
|
|
7
8
|
import type { DyNTS_Mcp_Settings } from '../../_modules/mcp/_models/interfaces/mcp-settings.interface';
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
@@ -118,6 +119,11 @@ export interface DyNTS_Global_Settings {
|
|
|
118
119
|
* `null` (default) = every field takes its documented default ({@link DyNTS_Mcp_Settings}).
|
|
119
120
|
*/
|
|
120
121
|
mcp_settings: DyNTS_Mcp_Settings | null;
|
|
122
|
+
/**
|
|
123
|
+
* CLI-wide defaults (HP-DOPL MP-4.2): the default output and the exit-code overrides of the `/cli` commands.
|
|
124
|
+
* `null` (default) = every field takes its documented default ({@link DyCLI_Settings}).
|
|
125
|
+
*/
|
|
126
|
+
cli_settings: DyCLI_Settings | null;
|
|
121
127
|
/**
|
|
122
128
|
* this setting will set the openai settings
|
|
123
129
|
* (this will be set in the {@link DyNTS_OAI_LLMChat_ServiceBase} constructor)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-settings.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/global-settings.interface.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,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AAC,EAAE,MAAM,EAAE,CAAC;QACnC;;;;;WAKG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF;;;;OAIG;IACH,aAAa,CAAC,EAAE;QACd,8FAA8F;QAC9F,OAAO,EAAE,OAAO,CAAC;QACjB,qDAAqD;QACrD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,kFAAkF;QAClF,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IAEF;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE;QACxB,8EAA8E;QAC9E,OAAO,EAAE,OAAO,CAAC;QACjB,wDAAwD;QACxD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,4EAA4E;QAC5E,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,uFAAuF;QACvF,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC;;;WAGG;QACH,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnD,wGAAwG;QACxG,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAEF;;;;;OAKG;IACH,aAAa,CAAC,EAAE;QACd,oFAAoF;QACpF,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,2FAA2F;QAC3F,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,sDAAsD;QACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH"}
|
|
1
|
+
{"version":3,"file":"global-settings.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/global-settings.interface.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,wBAA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,sGAAsG;QACtG,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC,gFAAgF;QAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;WAKG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B;;;;WAIG;QACH,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;QACnC;;;;;WAKG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF;;;;OAIG;IACH,aAAa,CAAC,EAAE;QACd,8FAA8F;QAC9F,OAAO,EAAE,OAAO,CAAC;QACjB,qDAAqD;QACrD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,kFAAkF;QAClF,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IAEF;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE;QACxB,8EAA8E;QAC9E,OAAO,EAAE,OAAO,CAAC;QACjB,wDAAwD;QACxD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,4EAA4E;QAC5E,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,uFAAuF;QACvF,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC;;;WAGG;QACH,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnD,wGAAwG;QACxG,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAEF;;;;;OAKG;IACH,aAAa,CAAC,EAAE;QACd,oFAAoF;QACpF,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,2FAA2F;QAC3F,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,sDAAsD;QACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as Commander from 'commander';
|
|
2
|
+
/** The supported `commander` range — kept in sync with `peerDependencies` (measured fleet: 12.1 – 14.x). */
|
|
3
|
+
export declare const DyCLI_commanderRange: string;
|
|
4
|
+
/**
|
|
5
|
+
* Lazy access to `commander` (HP-DOPL MP-4.1, D-5): `commander` is an OPTIONAL peer of `@futdevpro/nts-dynamo`, so
|
|
6
|
+
* it is never required in a module body — a server that only imports the root package must not need it. The `/cli`
|
|
7
|
+
* subpath loads it here, at the place of use; a missing package becomes the coded `DyNTS-OPT-MIS` error that says
|
|
8
|
+
* what to install.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const commander: typeof Commander = await DyCLI_Commander_Util.load();
|
|
13
|
+
* const program: Commander.Command = new commander.Command('organizer');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class DyCLI_Commander_Util {
|
|
17
|
+
/**
|
|
18
|
+
* Loads `commander`.
|
|
19
|
+
* @throws 501 `DyNTS-OPT-MIS` (not installed) · `DyNTS-OPT-LDF` (installed, but failed to load)
|
|
20
|
+
*/
|
|
21
|
+
static load(): Promise<typeof Commander>;
|
|
22
|
+
/** Imports `commander` — a static seam, so a spec can simulate a missing package. */
|
|
23
|
+
private static importCommander;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=cli-commander.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-commander.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/cli/_collections/cli-commander.util.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,SAAS,MAAM,WAAW,CAAC;AAK5C,4GAA4G;AAC5G,eAAO,MAAM,oBAAoB,EAAE,MAAuB,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,qBAAa,oBAAoB;IAC/B;;;OAGG;WACU,IAAI,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC;IAO9C,qFAAqF;IACrF,OAAO,CAAC,MAAM,CAAC,eAAe,CAEyB;CACxD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DyCLI_Commander_Util = exports.DyCLI_commanderRange = void 0;
|
|
37
|
+
const optional_peer_util_1 = require("../../../_collections/optional-peer.util");
|
|
38
|
+
/** The supported `commander` range — kept in sync with `peerDependencies` (measured fleet: 12.1 – 14.x). */
|
|
39
|
+
exports.DyCLI_commanderRange = '>=12.1.0 <15';
|
|
40
|
+
/**
|
|
41
|
+
* Lazy access to `commander` (HP-DOPL MP-4.1, D-5): `commander` is an OPTIONAL peer of `@futdevpro/nts-dynamo`, so
|
|
42
|
+
* it is never required in a module body — a server that only imports the root package must not need it. The `/cli`
|
|
43
|
+
* subpath loads it here, at the place of use; a missing package becomes the coded `DyNTS-OPT-MIS` error that says
|
|
44
|
+
* what to install.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const commander: typeof Commander = await DyCLI_Commander_Util.load();
|
|
49
|
+
* const program: Commander.Command = new commander.Command('organizer');
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
class DyCLI_Commander_Util {
|
|
53
|
+
/**
|
|
54
|
+
* Loads `commander`.
|
|
55
|
+
* @throws 501 `DyNTS-OPT-MIS` (not installed) · `DyNTS-OPT-LDF` (installed, but failed to load)
|
|
56
|
+
*/
|
|
57
|
+
static async load() {
|
|
58
|
+
return optional_peer_util_1.DyNTS_OptionalPeer_Util.load({
|
|
59
|
+
packageName: 'commander', range: exports.DyCLI_commanderRange, feature: 'the Dynamo CLI',
|
|
60
|
+
importer: DyCLI_Commander_Util.importCommander,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Imports `commander` — a static seam, so a spec can simulate a missing package. */
|
|
64
|
+
static importCommander =
|
|
65
|
+
// eslint-disable-next-line @futdevpro/dynamo/no-dynamic-imports
|
|
66
|
+
() => Promise.resolve().then(() => __importStar(require('commander')));
|
|
67
|
+
}
|
|
68
|
+
exports.DyCLI_Commander_Util = DyCLI_Commander_Util;
|
|
69
|
+
//# sourceMappingURL=cli-commander.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-commander.util.js","sourceRoot":"","sources":["../../../../src/_modules/cli/_collections/cli-commander.util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,iFAAmF;AAGnF,4GAA4G;AAC/F,QAAA,oBAAoB,GAAW,cAAc,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,MAAa,oBAAoB;IAC/B;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI;QACf,OAAO,4CAAuB,CAAC,IAAI,CAAC;YAClC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,4BAAoB,EAAE,OAAO,EAAE,gBAAgB;YAChF,QAAQ,EAAE,oBAAoB,CAAC,eAAe;SAC/C,CAAC,CAAC;IACL,CAAC;IAED,qFAAqF;IAC7E,MAAM,CAAC,eAAe;IAC5B,gEAAgE;IAChE,GAA8B,EAAE,mDAAQ,WAAW,GAAC,CAAC;;AAfzD,oDAgBC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DyFM_Error, DyFM_Operation_Settings } from '@futdevpro/fsm-dynamo';
|
|
2
|
+
import { DyCLI_Flag, DyCLI_Flag_Settings } from '../_models/interfaces/cli-flag.interface';
|
|
3
|
+
/** Flags every command has from commander itself — a command flag can not take them. */
|
|
4
|
+
export declare const DyCLI_reservedFlags: string[];
|
|
5
|
+
/**
|
|
6
|
+
* The flags of a CLI command (HP-DOPL MP-4.2): generation from the operation input schema, name validation and the
|
|
7
|
+
* conversion of the command-line text to typed values. Used by `DyCLI_Command_Params`.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DyCLI_Flag_Util {
|
|
10
|
+
/**
|
|
11
|
+
* Converts the raw text of a flag to its value.
|
|
12
|
+
* @param flag - the flag
|
|
13
|
+
* @param raw - the text from the command line
|
|
14
|
+
* @throws 400 `DyNTS-CLP-VAL` when the text is not a valid value of the flag
|
|
15
|
+
*/
|
|
16
|
+
static convert(flag: DyCLI_Flag, raw: string): unknown;
|
|
17
|
+
/** The commander attribute of a long flag (commander's own camel-casing: `note-id` → `noteId`). */
|
|
18
|
+
static attributeOf(flag: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* The flags of a command: generated from the operation schema, overridden and extended by `flags`.
|
|
21
|
+
* @param operation - the operation (absent for a local command)
|
|
22
|
+
* @param overrides - the per-parameter flag settings
|
|
23
|
+
* @param invalid - builds the construction error of the calling command
|
|
24
|
+
*/
|
|
25
|
+
static resolveFlags(operation: DyFM_Operation_Settings<unknown, unknown[], unknown> | undefined, overrides: {
|
|
26
|
+
[param: string]: DyCLI_Flag_Settings;
|
|
27
|
+
}, invalid: (code: string, reason: string) => DyFM_Error): DyCLI_Flag[];
|
|
28
|
+
/** Validates the long and short flag names: format, reserved names, duplicates. */
|
|
29
|
+
private static checkFlagNames;
|
|
30
|
+
/** The flag value kind of a schema property. */
|
|
31
|
+
private static typeOf;
|
|
32
|
+
/** `noteId` → `note-id`. */
|
|
33
|
+
private static kebabOf;
|
|
34
|
+
/** Sets only the defined optional fields, so the resolved flag carries no `undefined` keys. */
|
|
35
|
+
private static assign;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=cli-flag.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-flag.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/cli/_collections/cli-flag.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAA6B,uBAAuB,EAC/D,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAQ3F,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,EAAE,MAAM,EAA0B,CAAC;AAEnE;;;GAGG;AACH,qBAAa,eAAe;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IA0CtD,mGAAmG;IACnG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIxC;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,SAAS,EAAE,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3E,SAAS,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAAA;KAAE,EACnD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,UAAU,GACpD,UAAU,EAAE;IAyDf,mFAAmF;IACnF,OAAO,CAAC,MAAM,CAAC,cAAc;IAsC7B,gDAAgD;IAChD,OAAO,CAAC,MAAM,CAAC,MAAM;IAerB,4BAA4B;IAC5B,OAAO,CAAC,MAAM,CAAC,OAAO;IAItB,+FAA+F;IAC/F,OAAO,CAAC,MAAM,CAAC,MAAM;CAMtB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyCLI_Flag_Util = exports.DyCLI_reservedFlags = void 0;
|
|
4
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
+
const global_settings_const_1 = require("../../../_collections/global-settings.const");
|
|
6
|
+
const cli_flag_value_type_enum_1 = require("../_enums/cli-flag-value.type-enum");
|
|
7
|
+
/** Long flag names: kebab-case. */
|
|
8
|
+
const DyCLI_flagName = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
9
|
+
/** A finite decimal number — the same notations the REST adapter accepts. */
|
|
10
|
+
const DyCLI_decimal = /^[-+]?(\d+\.?\d*|\.\d+)([eE][-+]?\d+)?$/;
|
|
11
|
+
/** Flags every command has from commander itself — a command flag can not take them. */
|
|
12
|
+
exports.DyCLI_reservedFlags = ['help', 'version'];
|
|
13
|
+
/**
|
|
14
|
+
* The flags of a CLI command (HP-DOPL MP-4.2): generation from the operation input schema, name validation and the
|
|
15
|
+
* conversion of the command-line text to typed values. Used by `DyCLI_Command_Params`.
|
|
16
|
+
*/
|
|
17
|
+
class DyCLI_Flag_Util {
|
|
18
|
+
/**
|
|
19
|
+
* Converts the raw text of a flag to its value.
|
|
20
|
+
* @param flag - the flag
|
|
21
|
+
* @param raw - the text from the command line
|
|
22
|
+
* @throws 400 `DyNTS-CLP-VAL` when the text is not a valid value of the flag
|
|
23
|
+
*/
|
|
24
|
+
static convert(flag, raw) {
|
|
25
|
+
const refuse = (expected) => new fsm_dynamo_1.DyFM_Error({
|
|
26
|
+
status: 400,
|
|
27
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-CLP-VAL`,
|
|
28
|
+
message: `--${flag.flag} must be ${expected} (got: ${JSON.stringify(raw)})`,
|
|
29
|
+
userMessage: `--${flag.flag} must be ${expected} (got: ${JSON.stringify(raw)})`,
|
|
30
|
+
additionalContent: { flag: flag.flag },
|
|
31
|
+
});
|
|
32
|
+
let value = raw;
|
|
33
|
+
if (flag.parse) {
|
|
34
|
+
value = flag.parse(raw);
|
|
35
|
+
}
|
|
36
|
+
else if (flag.type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.number ||
|
|
37
|
+
(flag.type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.list && flag.itemType === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.number)) {
|
|
38
|
+
if (!DyCLI_decimal.test(raw.trim()) || !Number.isFinite(Number(raw))) {
|
|
39
|
+
throw refuse('a finite decimal number');
|
|
40
|
+
}
|
|
41
|
+
value = Number(raw);
|
|
42
|
+
}
|
|
43
|
+
else if (flag.type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.date) {
|
|
44
|
+
if (Number.isNaN(new Date(raw).getTime())) {
|
|
45
|
+
throw refuse('an ISO date-time');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (flag.type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.json) {
|
|
49
|
+
try {
|
|
50
|
+
value = JSON.parse(raw);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
throw refuse('JSON');
|
|
54
|
+
}
|
|
55
|
+
if (value === null || typeof value !== 'object') {
|
|
56
|
+
throw refuse('a JSON object or array');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (flag.enum && !flag.enum.includes(value)) {
|
|
60
|
+
throw refuse(`one of ${flag.enum.join(', ')}`);
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
/** The commander attribute of a long flag (commander's own camel-casing: `note-id` → `noteId`). */
|
|
65
|
+
static attributeOf(flag) {
|
|
66
|
+
return flag.split('-').reduce((name, word) => name + word[0].toUpperCase() + word.slice(1));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The flags of a command: generated from the operation schema, overridden and extended by `flags`.
|
|
70
|
+
* @param operation - the operation (absent for a local command)
|
|
71
|
+
* @param overrides - the per-parameter flag settings
|
|
72
|
+
* @param invalid - builds the construction error of the calling command
|
|
73
|
+
*/
|
|
74
|
+
static resolveFlags(operation, overrides, invalid) {
|
|
75
|
+
const schema = operation ?
|
|
76
|
+
fsm_dynamo_1.DyFM_OperationSchema_Util.inputSchema(operation) : { type: 'object', properties: {} };
|
|
77
|
+
const required = schema.required ?? [];
|
|
78
|
+
const params = [...Object.keys(schema.properties ?? {})];
|
|
79
|
+
Object.keys(overrides).filter((param) => !params.includes(param))
|
|
80
|
+
.forEach((param) => {
|
|
81
|
+
params.push(param);
|
|
82
|
+
});
|
|
83
|
+
const flags = params.map((param) => {
|
|
84
|
+
const property = schema.properties?.[param];
|
|
85
|
+
const override = overrides[param] ?? {};
|
|
86
|
+
const type = override.type ?? DyCLI_Flag_Util.typeOf(property);
|
|
87
|
+
if (!Object.values(cli_flag_value_type_enum_1.DyCLI_FlagValue_Type).includes(type)) {
|
|
88
|
+
throw invalid('DyNTS-CLP-TYP', `flag of "${param}" needs a known type (an extra flag must declare it)`);
|
|
89
|
+
}
|
|
90
|
+
['parse'].forEach((name) => {
|
|
91
|
+
if (override[name] !== undefined && typeof override[name] !== 'function') {
|
|
92
|
+
throw invalid('DyNTS-CLP-HOK', `flags.${param}.${name} must be a function`);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const enumValues = override.enum ?? property?.enum;
|
|
96
|
+
if (enumValues !== undefined && !Array.isArray(enumValues)) {
|
|
97
|
+
throw invalid('DyNTS-CLP-ENM', `flags.${param}.enum must be an array`);
|
|
98
|
+
}
|
|
99
|
+
const flag = {
|
|
100
|
+
param: param,
|
|
101
|
+
flag: override.flag ?? DyCLI_Flag_Util.kebabOf(param),
|
|
102
|
+
description: override.description ?? property?.description ?? param,
|
|
103
|
+
type: type,
|
|
104
|
+
required: override.required ?? required.includes(param),
|
|
105
|
+
};
|
|
106
|
+
DyCLI_Flag_Util.assign(flag, {
|
|
107
|
+
short: override.short,
|
|
108
|
+
itemType: type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.list ?
|
|
109
|
+
(property?.items?.type === 'number' ? cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.number : cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.string) : undefined,
|
|
110
|
+
enum: enumValues ? [...enumValues] : undefined,
|
|
111
|
+
default: override.default ?? property?.default,
|
|
112
|
+
parse: override.parse,
|
|
113
|
+
});
|
|
114
|
+
return flag;
|
|
115
|
+
});
|
|
116
|
+
DyCLI_Flag_Util.checkFlagNames(flags, invalid);
|
|
117
|
+
return flags;
|
|
118
|
+
}
|
|
119
|
+
/** Validates the long and short flag names: format, reserved names, duplicates. */
|
|
120
|
+
static checkFlagNames(flags, invalid) {
|
|
121
|
+
const longs = new Set();
|
|
122
|
+
const shorts = new Set();
|
|
123
|
+
flags.forEach((flag) => {
|
|
124
|
+
if (typeof flag.flag !== 'string' || !DyCLI_flagName.test(flag.flag)) {
|
|
125
|
+
throw invalid('DyNTS-CLP-FLG', `flag of "${flag.param}" must be kebab-case (got: ${JSON.stringify(flag.flag)})`);
|
|
126
|
+
}
|
|
127
|
+
if (exports.DyCLI_reservedFlags.includes(flag.flag)) {
|
|
128
|
+
throw invalid('DyNTS-CLP-RSV', `--${flag.flag} is reserved; set flags.${flag.param}.flag to another name`);
|
|
129
|
+
}
|
|
130
|
+
// `--x` and its negated `--no-x` share one attribute, so they collide as well
|
|
131
|
+
const attribute = DyCLI_Flag_Util.attributeOf(flag.flag.replace(/^no-/, ''));
|
|
132
|
+
if (longs.has(attribute)) {
|
|
133
|
+
throw invalid('DyNTS-CLP-DUP', `two flags use --${flag.flag}`);
|
|
134
|
+
}
|
|
135
|
+
longs.add(attribute);
|
|
136
|
+
if (flag.short === undefined) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (typeof flag.short !== 'string' || !/^[A-Za-z]$/.test(flag.short) || flag.short === 'h' || flag.short === 'V') {
|
|
140
|
+
throw invalid('DyNTS-CLP-SHT', `short flag of "${flag.param}" must be one letter, not -h or -V`);
|
|
141
|
+
}
|
|
142
|
+
if (shorts.has(flag.short)) {
|
|
143
|
+
throw invalid('DyNTS-CLP-DUP', `two flags use -${flag.short}`);
|
|
144
|
+
}
|
|
145
|
+
shorts.add(flag.short);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/** The flag value kind of a schema property. */
|
|
149
|
+
static typeOf(property) {
|
|
150
|
+
if (!property) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
if (property.format === 'date-time') {
|
|
154
|
+
return cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.date;
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
string: cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.string, number: cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.number, integer: cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.number,
|
|
158
|
+
boolean: cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.boolean, array: cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.list,
|
|
159
|
+
}[property.type] ?? cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.json;
|
|
160
|
+
}
|
|
161
|
+
/** `noteId` → `note-id`. */
|
|
162
|
+
static kebabOf(param) {
|
|
163
|
+
return param.replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/_/g, '-').toLowerCase();
|
|
164
|
+
}
|
|
165
|
+
/** Sets only the defined optional fields, so the resolved flag carries no `undefined` keys. */
|
|
166
|
+
static assign(flag, optional) {
|
|
167
|
+
Object.entries(optional).filter(([, value]) => value !== undefined)
|
|
168
|
+
.forEach(([key, value]) => {
|
|
169
|
+
flag[key] = value;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.DyCLI_Flag_Util = DyCLI_Flag_Util;
|
|
174
|
+
//# sourceMappingURL=cli-flag.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-flag.util.js","sourceRoot":"","sources":["../../../../src/_modules/cli/_collections/cli-flag.util.ts"],"names":[],"mappings":";;;AAAA,sDAE+B;AAE/B,uFAAoF;AACpF,iFAA0E;AAI1E,mCAAmC;AACnC,MAAM,cAAc,GAAW,+BAA+B,CAAC;AAC/D,6EAA6E;AAC7E,MAAM,aAAa,GAAW,yCAAyC,CAAC;AAExE,wFAAwF;AAC3E,QAAA,mBAAmB,GAAa,CAAE,MAAM,EAAE,SAAS,CAAE,CAAC;AAEnE;;;GAGG;AACH,MAAa,eAAe;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,IAAgB,EAAE,GAAW;QAC1C,MAAM,MAAM,GAAG,CAAC,QAAgB,EAAc,EAAE,CAAC,IAAI,uBAAU,CAAC;YAC9D,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,gBAAgB;YACvE,OAAO,EAAE,KAAK,IAAI,CAAC,IAAI,YAAY,QAAQ,UAAU,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG;YAC3E,WAAW,EAAE,KAAK,IAAI,CAAC,IAAI,YAAY,QAAQ,UAA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ynamo CLI command (HP-DOPL MP-4.2). The values follow the organizer `fo` CLI, the pattern the
|
|
3
|
+
* fleet CLIs copy (`ok 0 · operation error 1 · usage 2 · auth 10 · network 11 · remote 12`); a command may override
|
|
4
|
+
* them with `DyCLI_Command_Params.exitCodes`.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum DyCLI_ExitCode_Type {
|
|
7
|
+
/** Success. */
|
|
8
|
+
ok = 0,
|
|
9
|
+
/** The command failed without an HTTP-like status (a local error). */
|
|
10
|
+
operationError = 1,
|
|
11
|
+
/** Invalid arguments: a parse error, or a 400/404/422 answer. */
|
|
12
|
+
usage = 2,
|
|
13
|
+
/** Not authenticated or not allowed: a 401/403 answer. */
|
|
14
|
+
auth = 10,
|
|
15
|
+
/** The server could not be reached. */
|
|
16
|
+
network = 11,
|
|
17
|
+
/** The server answered with any other error status. */
|
|
18
|
+
remote = 12
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=cli-exit-code.type-enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-exit-code.type-enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/cli/_enums/cli-exit-code.type-enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,mBAAmB;IAC7B,eAAe;IACf,EAAE,IAAI;IACN,sEAAsE;IACtE,cAAc,IAAI;IAClB,iEAAiE;IACjE,KAAK,IAAI;IACT,0DAA0D;IAC1D,IAAI,KAAK;IACT,uCAAuC;IACvC,OAAO,KAAK;IACZ,uDAAuD;IACvD,MAAM,KAAK;CACZ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyCLI_ExitCode_Type = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Process exit codes of a Dynamo CLI command (HP-DOPL MP-4.2). The values follow the organizer `fo` CLI, the pattern the
|
|
6
|
+
* fleet CLIs copy (`ok 0 · operation error 1 · usage 2 · auth 10 · network 11 · remote 12`); a command may override
|
|
7
|
+
* them with `DyCLI_Command_Params.exitCodes`.
|
|
8
|
+
*/
|
|
9
|
+
var DyCLI_ExitCode_Type;
|
|
10
|
+
(function (DyCLI_ExitCode_Type) {
|
|
11
|
+
/** Success. */
|
|
12
|
+
DyCLI_ExitCode_Type[DyCLI_ExitCode_Type["ok"] = 0] = "ok";
|
|
13
|
+
/** The command failed without an HTTP-like status (a local error). */
|
|
14
|
+
DyCLI_ExitCode_Type[DyCLI_ExitCode_Type["operationError"] = 1] = "operationError";
|
|
15
|
+
/** Invalid arguments: a parse error, or a 400/404/422 answer. */
|
|
16
|
+
DyCLI_ExitCode_Type[DyCLI_ExitCode_Type["usage"] = 2] = "usage";
|
|
17
|
+
/** Not authenticated or not allowed: a 401/403 answer. */
|
|
18
|
+
DyCLI_ExitCode_Type[DyCLI_ExitCode_Type["auth"] = 10] = "auth";
|
|
19
|
+
/** The server could not be reached. */
|
|
20
|
+
DyCLI_ExitCode_Type[DyCLI_ExitCode_Type["network"] = 11] = "network";
|
|
21
|
+
/** The server answered with any other error status. */
|
|
22
|
+
DyCLI_ExitCode_Type[DyCLI_ExitCode_Type["remote"] = 12] = "remote";
|
|
23
|
+
})(DyCLI_ExitCode_Type || (exports.DyCLI_ExitCode_Type = DyCLI_ExitCode_Type = {}));
|
|
24
|
+
//# sourceMappingURL=cli-exit-code.type-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-exit-code.type-enum.js","sourceRoot":"","sources":["../../../../src/_modules/cli/_enums/cli-exit-code.type-enum.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,mBAaX;AAbD,WAAY,mBAAmB;IAC7B,eAAe;IACf,yDAAM,CAAA;IACN,sEAAsE;IACtE,iFAAkB,CAAA;IAClB,iEAAiE;IACjE,+DAAS,CAAA;IACT,0DAA0D;IAC1D,8DAAS,CAAA;IACT,uCAAuC;IACvC,oEAAY,CAAA;IACZ,uDAAuD;IACvD,kEAAW,CAAA;AACb,CAAC,EAbW,mBAAmB,mCAAnB,mBAAmB,QAa9B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The value kind of a CLI flag — decides how the text from the command line is converted (HP-DOPL MP-4.2). */
|
|
2
|
+
export declare enum DyCLI_FlagValue_Type {
|
|
3
|
+
/** Any text. */
|
|
4
|
+
string = "string",
|
|
5
|
+
/** A finite decimal number (`12`, `-2.5`, `1e3`); `Infinity`, hex and binary notations are refused. */
|
|
6
|
+
number = "number",
|
|
7
|
+
/** A switch without a value (`--done`); a flag whose default is `true` is negated (`--no-done`). */
|
|
8
|
+
boolean = "boolean",
|
|
9
|
+
/** An ISO date-time text, kept as text (the same value an MCP call sends). */
|
|
10
|
+
date = "date",
|
|
11
|
+
/** A repeatable flag collecting its values into an array (`--tag a --tag b`). */
|
|
12
|
+
list = "list",
|
|
13
|
+
/** A JSON object or array (`--location '{"city":"Pécs"}'`). */
|
|
14
|
+
json = "json"
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=cli-flag-value.type-enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-flag-value.type-enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/cli/_enums/cli-flag-value.type-enum.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,oBAAY,oBAAoB;IAC9B,gBAAgB;IAChB,MAAM,WAAW;IACjB,uGAAuG;IACvG,MAAM,WAAW;IACjB,oGAAoG;IACpG,OAAO,YAAY;IACnB,8EAA8E;IAC9E,IAAI,SAAS;IACb,iFAAiF;IACjF,IAAI,SAAS;IACb,+DAA+D;IAC/D,IAAI,SAAS;CACd"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyCLI_FlagValue_Type = void 0;
|
|
4
|
+
/** The value kind of a CLI flag — decides how the text from the command line is converted (HP-DOPL MP-4.2). */
|
|
5
|
+
var DyCLI_FlagValue_Type;
|
|
6
|
+
(function (DyCLI_FlagValue_Type) {
|
|
7
|
+
/** Any text. */
|
|
8
|
+
DyCLI_FlagValue_Type["string"] = "string";
|
|
9
|
+
/** A finite decimal number (`12`, `-2.5`, `1e3`); `Infinity`, hex and binary notations are refused. */
|
|
10
|
+
DyCLI_FlagValue_Type["number"] = "number";
|
|
11
|
+
/** A switch without a value (`--done`); a flag whose default is `true` is negated (`--no-done`). */
|
|
12
|
+
DyCLI_FlagValue_Type["boolean"] = "boolean";
|
|
13
|
+
/** An ISO date-time text, kept as text (the same value an MCP call sends). */
|
|
14
|
+
DyCLI_FlagValue_Type["date"] = "date";
|
|
15
|
+
/** A repeatable flag collecting its values into an array (`--tag a --tag b`). */
|
|
16
|
+
DyCLI_FlagValue_Type["list"] = "list";
|
|
17
|
+
/** A JSON object or array (`--location '{"city":"Pécs"}'`). */
|
|
18
|
+
DyCLI_FlagValue_Type["json"] = "json";
|
|
19
|
+
})(DyCLI_FlagValue_Type || (exports.DyCLI_FlagValue_Type = DyCLI_FlagValue_Type = {}));
|
|
20
|
+
//# sourceMappingURL=cli-flag-value.type-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-flag-value.type-enum.js","sourceRoot":"","sources":["../../../../src/_modules/cli/_enums/cli-flag-value.type-enum.ts"],"names":[],"mappings":";;;AAAA,+GAA+G;AAC/G,IAAY,oBAaX;AAbD,WAAY,oBAAoB;IAC9B,gBAAgB;IAChB,yCAAiB,CAAA;IACjB,uGAAuG;IACvG,yCAAiB,CAAA;IACjB,oGAAoG;IACpG,2CAAmB,CAAA;IACnB,8EAA8E;IAC9E,qCAAa,CAAA;IACb,iFAAiF;IACjF,qCAAa,CAAA;IACb,+DAA+D;IAC/D,qCAAa,CAAA;AACf,CAAC,EAbW,oBAAoB,oCAApB,oBAAoB,QAa/B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** How a Dynamo CLI command prints its result (HP-DOPL MP-4.2). */
|
|
2
|
+
export declare enum DyCLI_Output_Type {
|
|
3
|
+
/** The JSON result envelope — for scripts and agents (default). */
|
|
4
|
+
json = "json",
|
|
5
|
+
/** Human-readable text, through the command's `formatHuman`. */
|
|
6
|
+
human = "human"
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=cli-output.type-enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-output.type-enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/cli/_enums/cli-output.type-enum.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAY,iBAAiB;IAC3B,mEAAmE;IACnE,IAAI,SAAS;IACb,gEAAgE;IAChE,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyCLI_Output_Type = void 0;
|
|
4
|
+
/** How a Dynamo CLI command prints its result (HP-DOPL MP-4.2). */
|
|
5
|
+
var DyCLI_Output_Type;
|
|
6
|
+
(function (DyCLI_Output_Type) {
|
|
7
|
+
/** The JSON result envelope — for scripts and agents (default). */
|
|
8
|
+
DyCLI_Output_Type["json"] = "json";
|
|
9
|
+
/** Human-readable text, through the command's `formatHuman`. */
|
|
10
|
+
DyCLI_Output_Type["human"] = "human";
|
|
11
|
+
})(DyCLI_Output_Type || (exports.DyCLI_Output_Type = DyCLI_Output_Type = {}));
|
|
12
|
+
//# sourceMappingURL=cli-output.type-enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-output.type-enum.js","sourceRoot":"","sources":["../../../../src/_modules/cli/_enums/cli-output.type-enum.ts"],"names":[],"mappings":";;;AAAA,mEAAmE;AACnE,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,mEAAmE;IACnE,kCAAa,CAAA;IACb,gEAAgE;IAChE,oCAAe,CAAA;AACjB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type * as Commander from 'commander';
|
|
2
|
+
import { DyFM_Operation_Settings } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
import { DyCLI_Output_Type } from '../../_enums/cli-output.type-enum';
|
|
4
|
+
import { DyCLI_Flag, DyCLI_Flag_Settings } from '../interfaces/cli-flag.interface';
|
|
5
|
+
import { DyCLI_ExitCodes, DyCLI_Settings } from '../interfaces/cli-settings.interface';
|
|
6
|
+
/** The values of a command call, keyed by parameter name — the same object an MCP `tools/call` sends as arguments. */
|
|
7
|
+
export type DyCLI_CommandValues = {
|
|
8
|
+
[param: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* One CLI command (HP-DOPL MP-4.2, decision D-4): ONE class for hand-written local commands and for commands
|
|
12
|
+
* generated from a server operation. With an `operation`, the flags come from the operation's input schema
|
|
13
|
+
* (`DyFM_OperationSchema_Util.inputSchema` — inputs, body properties, guardrail arguments), so the collected values are
|
|
14
|
+
* exactly the arguments of the MCP tool of the same operation. Without an operation (a local command of `dc`, `fdp` or
|
|
15
|
+
* `ma`), `action` runs the command.
|
|
16
|
+
*
|
|
17
|
+
* Custom options (D-4): per-parameter flag overrides and extra flags (`flags`), an own `action`, a `formatHuman` text
|
|
18
|
+
* formatter, `before` / `after` hooks, `output` and `exitCodes`. Defaults come from `DyNTS_global_settings.cli_settings`.
|
|
19
|
+
*
|
|
20
|
+
* `commander` is never loaded here: `buildCommand` receives the module loaded by `DyCLI_Commander_Util.load()`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const listTasks: DyCLI_Command_Params = new DyCLI_Command_Params({
|
|
25
|
+
* operation: listTasksOperation, // command: 'tasks.list'
|
|
26
|
+
* flags: { limit: { short: 'l' } },
|
|
27
|
+
* formatHuman: (tasks: Task[]): string => tasks.map((task: Task): string => task.title).join('\n'),
|
|
28
|
+
* });
|
|
29
|
+
* const commander: typeof Commander = await DyCLI_Commander_Util.load();
|
|
30
|
+
*
|
|
31
|
+
* program.addCommand(listTasks.buildCommand(commander, async (values: DyCLI_CommandValues): Promise<void> => {
|
|
32
|
+
* await runner.run(listTasks, values); // `--project-id p-1 -l 5` → { projectId: 'p-1', limit: 5 }
|
|
33
|
+
* }));
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class DyCLI_Command_Params {
|
|
37
|
+
/** The command name; default: the operation name (`<domain>.<action>`). */
|
|
38
|
+
readonly command: string;
|
|
39
|
+
/** The help description; default: the operation description. */
|
|
40
|
+
readonly description: string;
|
|
41
|
+
/** Alternative command names. */
|
|
42
|
+
readonly aliases: string[];
|
|
43
|
+
/** Extra help text shown after the options (examples). */
|
|
44
|
+
readonly helpText?: string;
|
|
45
|
+
/** The server operation the command calls; absent for a local command. */
|
|
46
|
+
readonly operation?: DyFM_Operation_Settings<unknown, unknown[], unknown>;
|
|
47
|
+
/** The resolved flags, in schema order, then the extra flags. */
|
|
48
|
+
readonly flags: DyCLI_Flag[];
|
|
49
|
+
/** The output of this command; absent = `cli_settings.output`, then `json`. */
|
|
50
|
+
readonly output?: DyCLI_Output_Type;
|
|
51
|
+
/** Exit-code overrides of this command. */
|
|
52
|
+
readonly exitCodes: Partial<DyCLI_ExitCodes>;
|
|
53
|
+
/** Where the params were constructed (for error diagnostics). */
|
|
54
|
+
readonly stackLocation: string;
|
|
55
|
+
/** Runs the command instead of calling the operation (required without an operation). */
|
|
56
|
+
action?(values: DyCLI_CommandValues, params: DyCLI_Command_Params): Promise<unknown>;
|
|
57
|
+
/** The human-readable text of a result (output `human`). */
|
|
58
|
+
formatHuman?(result: unknown): string;
|
|
59
|
+
/** Runs before the command, e.g. to ensure a local server runs. */
|
|
60
|
+
before?(values: DyCLI_CommandValues, params: DyCLI_Command_Params): Promise<void>;
|
|
61
|
+
/** Runs after a successful command. */
|
|
62
|
+
after?(result: unknown, values: DyCLI_CommandValues, params: DyCLI_Command_Params): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* @param set - the command settings; throws a coded `DyFM_Error` (500 `DyNTS-CLP-*`) when invalid
|
|
65
|
+
*/
|
|
66
|
+
constructor(set: {
|
|
67
|
+
operation?: DyFM_Operation_Settings<unknown, unknown[], unknown>;
|
|
68
|
+
command?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
aliases?: string[];
|
|
71
|
+
helpText?: string;
|
|
72
|
+
flags?: {
|
|
73
|
+
[param: string]: DyCLI_Flag_Settings;
|
|
74
|
+
};
|
|
75
|
+
output?: DyCLI_Output_Type;
|
|
76
|
+
exitCodes?: Partial<DyCLI_ExitCodes>;
|
|
77
|
+
action?(values: DyCLI_CommandValues, params: DyCLI_Command_Params): Promise<unknown>;
|
|
78
|
+
formatHuman?(result: unknown): string;
|
|
79
|
+
before?(values: DyCLI_CommandValues, params: DyCLI_Command_Params): Promise<void>;
|
|
80
|
+
after?(result: unknown, values: DyCLI_CommandValues, params: DyCLI_Command_Params): Promise<void>;
|
|
81
|
+
stackLocation?: string;
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Builds the commander command: name, description, aliases, help text and one option per flag; the action collects
|
|
85
|
+
* the typed values and hands them to `onAction`. A value that does not convert is a commander usage error.
|
|
86
|
+
* @param commander - the module from `DyCLI_Commander_Util.load()`
|
|
87
|
+
* @param onAction - receives the collected values
|
|
88
|
+
*/
|
|
89
|
+
buildCommand(commander: typeof Commander, onAction: (values: DyCLI_CommandValues) => Promise<void>): Commander.Command;
|
|
90
|
+
/**
|
|
91
|
+
* The values of a call from the parsed commander options: keyed by parameter name, defaults applied, absent flags
|
|
92
|
+
* left out.
|
|
93
|
+
* @param options - the parsed options (`command.opts()`)
|
|
94
|
+
*/
|
|
95
|
+
readValues(options: {
|
|
96
|
+
[attribute: string]: unknown;
|
|
97
|
+
}): DyCLI_CommandValues;
|
|
98
|
+
/** The output of this command: its own, then `cli_settings.output`, then `json`. */
|
|
99
|
+
getOutput(settings?: DyCLI_Settings | null): DyCLI_Output_Type;
|
|
100
|
+
/**
|
|
101
|
+
* The process exit code of a failure: a commander parse error or 400/404/422 → usage · 401/403 → auth · an
|
|
102
|
+
* unreachable server → network · any other status → remote · no status → operation error. The command's
|
|
103
|
+
* `exitCodes` win over `cli_settings.exitCodes`, which win over `DyCLI_ExitCode_Type`.
|
|
104
|
+
* @param error - the failure
|
|
105
|
+
* @param settings - the CLI settings (default: `DyNTS_global_settings.cli_settings`)
|
|
106
|
+
*/
|
|
107
|
+
exitCodeOf(error: unknown, settings?: DyCLI_Settings | null): number;
|
|
108
|
+
/** Builds the commander option of a flag. */
|
|
109
|
+
private static optionOf;
|
|
110
|
+
/** Validates the exit-code overrides: integers between 1 and 255 of known outcomes. */
|
|
111
|
+
private static checkExitCodes;
|
|
112
|
+
/** Builds the construction error with a stable error code and the construction location. */
|
|
113
|
+
private static invalid;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=cli-command-params.control-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-command-params.control-model.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/cli/_models/control-models/cli-command-params.control-model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,SAAS,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAiD,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAM/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAUvF,sHAAsH;AACtH,MAAM,MAAM,mBAAmB,GAAG;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AA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,cAAc,GAAG,IAAyC,GAAG,MAAM;IAiCxG,6CAA6C;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ;IA4BvB,uFAAuF;IACvF,OAAO,CAAC,MAAM,CAAC,cAAc;IAa7B,4FAA4F;IAC5F,OAAO,CAAC,MAAM,CAAC,OAAO;CAQvB"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyCLI_Command_Params = void 0;
|
|
4
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
+
const global_settings_const_1 = require("../../../../_collections/global-settings.const");
|
|
6
|
+
const cli_flag_util_1 = require("../../_collections/cli-flag.util");
|
|
7
|
+
const cli_exit_code_type_enum_1 = require("../../_enums/cli-exit-code.type-enum");
|
|
8
|
+
const cli_flag_value_type_enum_1 = require("../../_enums/cli-flag-value.type-enum");
|
|
9
|
+
const cli_output_type_enum_1 = require("../../_enums/cli-output.type-enum");
|
|
10
|
+
/** Command names: letters, digits, `.`, `_`, `-` (an operation name `<domain>.<action>` fits), max 64 characters. */
|
|
11
|
+
const DyCLI_commandName = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
12
|
+
/** Error codes of a server that can not be reached. */
|
|
13
|
+
const DyCLI_networkCodes = [
|
|
14
|
+
'ECONNREFUSED', 'ECONNRESET', 'ENOTFOUND', 'ETIMEDOUT', 'EAI_AGAIN', 'UND_ERR_CONNECT_TIMEOUT', 'UND_ERR_SOCKET',
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* One CLI command (HP-DOPL MP-4.2, decision D-4): ONE class for hand-written local commands and for commands
|
|
18
|
+
* generated from a server operation. With an `operation`, the flags come from the operation's input schema
|
|
19
|
+
* (`DyFM_OperationSchema_Util.inputSchema` — inputs, body properties, guardrail arguments), so the collected values are
|
|
20
|
+
* exactly the arguments of the MCP tool of the same operation. Without an operation (a local command of `dc`, `fdp` or
|
|
21
|
+
* `ma`), `action` runs the command.
|
|
22
|
+
*
|
|
23
|
+
* Custom options (D-4): per-parameter flag overrides and extra flags (`flags`), an own `action`, a `formatHuman` text
|
|
24
|
+
* formatter, `before` / `after` hooks, `output` and `exitCodes`. Defaults come from `DyNTS_global_settings.cli_settings`.
|
|
25
|
+
*
|
|
26
|
+
* `commander` is never loaded here: `buildCommand` receives the module loaded by `DyCLI_Commander_Util.load()`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const listTasks: DyCLI_Command_Params = new DyCLI_Command_Params({
|
|
31
|
+
* operation: listTasksOperation, // command: 'tasks.list'
|
|
32
|
+
* flags: { limit: { short: 'l' } },
|
|
33
|
+
* formatHuman: (tasks: Task[]): string => tasks.map((task: Task): string => task.title).join('\n'),
|
|
34
|
+
* });
|
|
35
|
+
* const commander: typeof Commander = await DyCLI_Commander_Util.load();
|
|
36
|
+
*
|
|
37
|
+
* program.addCommand(listTasks.buildCommand(commander, async (values: DyCLI_CommandValues): Promise<void> => {
|
|
38
|
+
* await runner.run(listTasks, values); // `--project-id p-1 -l 5` → { projectId: 'p-1', limit: 5 }
|
|
39
|
+
* }));
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
class DyCLI_Command_Params {
|
|
43
|
+
/** The command name; default: the operation name (`<domain>.<action>`). */
|
|
44
|
+
command;
|
|
45
|
+
/** The help description; default: the operation description. */
|
|
46
|
+
description;
|
|
47
|
+
/** Alternative command names. */
|
|
48
|
+
aliases;
|
|
49
|
+
/** Extra help text shown after the options (examples). */
|
|
50
|
+
helpText;
|
|
51
|
+
/** The server operation the command calls; absent for a local command. */
|
|
52
|
+
operation;
|
|
53
|
+
/** The resolved flags, in schema order, then the extra flags. */
|
|
54
|
+
flags;
|
|
55
|
+
/** The output of this command; absent = `cli_settings.output`, then `json`. */
|
|
56
|
+
output;
|
|
57
|
+
/** Exit-code overrides of this command. */
|
|
58
|
+
exitCodes;
|
|
59
|
+
/** Where the params were constructed (for error diagnostics). */
|
|
60
|
+
stackLocation;
|
|
61
|
+
/**
|
|
62
|
+
* @param set - the command settings; throws a coded `DyFM_Error` (500 `DyNTS-CLP-*`) when invalid
|
|
63
|
+
*/
|
|
64
|
+
constructor(set) {
|
|
65
|
+
const stackLocation = set?.stackLocation ?? (0, fsm_dynamo_1.DyFM_getConstructionStackLocation)();
|
|
66
|
+
const invalid = (code, reason) => DyCLI_Command_Params.invalid(code, `${reason} (command "${set?.command ?? set?.operation?.name}")`, stackLocation);
|
|
67
|
+
const operation = set?.operation;
|
|
68
|
+
// a plain object would skip the construction-time validation of the operation
|
|
69
|
+
if (operation !== undefined && (typeof operation?.name !== 'string' || !operation?.expose)) {
|
|
70
|
+
throw invalid('DyNTS-CLP-OPR', 'operation must be a constructed DyFM_Operation_Settings');
|
|
71
|
+
}
|
|
72
|
+
if (operation?.expose.cli === false) {
|
|
73
|
+
throw invalid('DyNTS-CLP-EXP', `operation "${operation.name}" is not exposed on the CLI (expose.cli: false)`);
|
|
74
|
+
}
|
|
75
|
+
['action', 'formatHuman', 'before', 'after'].forEach((name) => {
|
|
76
|
+
if (set?.[name] !== undefined && typeof set[name] !== 'function') {
|
|
77
|
+
throw invalid('DyNTS-CLP-HOK', `${name} must be a function`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
if (!operation && !set?.action) {
|
|
81
|
+
throw invalid('DyNTS-CLP-ACT', 'a command needs an operation to call or an own action');
|
|
82
|
+
}
|
|
83
|
+
const command = set.command ?? operation?.name;
|
|
84
|
+
if (typeof command !== 'string' || !DyCLI_commandName.test(command)) {
|
|
85
|
+
throw invalid('DyNTS-CLP-CMD', `command name must be 1-64 letters, digits, ".", "_" or "-" (got: ${JSON.stringify(command)})`);
|
|
86
|
+
}
|
|
87
|
+
const description = set.description ?? operation?.description;
|
|
88
|
+
if (typeof description !== 'string' || !description.trim()) {
|
|
89
|
+
throw invalid('DyNTS-CLP-DSC', 'a command needs a description');
|
|
90
|
+
}
|
|
91
|
+
const aliases = set.aliases ?? [];
|
|
92
|
+
if (!Array.isArray(aliases) || aliases.some((alias) => typeof alias !== 'string' || !DyCLI_commandName.test(alias) || alias === command)) {
|
|
93
|
+
throw invalid('DyNTS-CLP-ALS', 'aliases must be valid command names, different from the command');
|
|
94
|
+
}
|
|
95
|
+
if (set.output !== undefined && !Object.values(cli_output_type_enum_1.DyCLI_Output_Type).includes(set.output)) {
|
|
96
|
+
throw invalid('DyNTS-CLP-OUT', `unknown output ${JSON.stringify(set.output)}`);
|
|
97
|
+
}
|
|
98
|
+
DyCLI_Command_Params.checkExitCodes(set.exitCodes, invalid);
|
|
99
|
+
this.command = command;
|
|
100
|
+
this.description = description;
|
|
101
|
+
this.aliases = [...aliases];
|
|
102
|
+
this.helpText = set.helpText;
|
|
103
|
+
this.operation = operation;
|
|
104
|
+
this.flags = cli_flag_util_1.DyCLI_Flag_Util.resolveFlags(operation, set.flags ?? {}, invalid);
|
|
105
|
+
this.output = set.output;
|
|
106
|
+
this.exitCodes = { ...set.exitCodes };
|
|
107
|
+
this.stackLocation = stackLocation;
|
|
108
|
+
if (set.action) {
|
|
109
|
+
this.action = set.action;
|
|
110
|
+
}
|
|
111
|
+
if (set.formatHuman) {
|
|
112
|
+
this.formatHuman = set.formatHuman;
|
|
113
|
+
}
|
|
114
|
+
if (set.before) {
|
|
115
|
+
this.before = set.before;
|
|
116
|
+
}
|
|
117
|
+
if (set.after) {
|
|
118
|
+
this.after = set.after;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Builds the commander command: name, description, aliases, help text and one option per flag; the action collects
|
|
123
|
+
* the typed values and hands them to `onAction`. A value that does not convert is a commander usage error.
|
|
124
|
+
* @param commander - the module from `DyCLI_Commander_Util.load()`
|
|
125
|
+
* @param onAction - receives the collected values
|
|
126
|
+
*/
|
|
127
|
+
buildCommand(commander, onAction) {
|
|
128
|
+
const command = new commander.Command(this.command).description(this.description);
|
|
129
|
+
this.aliases.forEach((alias) => {
|
|
130
|
+
command.alias(alias);
|
|
131
|
+
});
|
|
132
|
+
if (this.helpText) {
|
|
133
|
+
command.addHelpText('after', this.helpText);
|
|
134
|
+
}
|
|
135
|
+
this.flags.forEach((flag) => {
|
|
136
|
+
command.addOption(DyCLI_Command_Params.optionOf(commander, flag));
|
|
137
|
+
});
|
|
138
|
+
command.action(async (options) => {
|
|
139
|
+
await onAction(this.readValues(options));
|
|
140
|
+
});
|
|
141
|
+
return command;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The values of a call from the parsed commander options: keyed by parameter name, defaults applied, absent flags
|
|
145
|
+
* left out.
|
|
146
|
+
* @param options - the parsed options (`command.opts()`)
|
|
147
|
+
*/
|
|
148
|
+
readValues(options) {
|
|
149
|
+
const values = {};
|
|
150
|
+
this.flags.forEach((flag) => {
|
|
151
|
+
const value = options?.[cli_flag_util_1.DyCLI_Flag_Util.attributeOf(flag.flag)] ?? flag.default;
|
|
152
|
+
if (value !== undefined) {
|
|
153
|
+
values[flag.param] = value;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
return values;
|
|
157
|
+
}
|
|
158
|
+
/** The output of this command: its own, then `cli_settings.output`, then `json`. */
|
|
159
|
+
getOutput(settings = global_settings_const_1.DyNTS_global_settings.cli_settings) {
|
|
160
|
+
return this.output ?? settings?.output ?? cli_output_type_enum_1.DyCLI_Output_Type.json;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The process exit code of a failure: a commander parse error or 400/404/422 → usage · 401/403 → auth · an
|
|
164
|
+
* unreachable server → network · any other status → remote · no status → operation error. The command's
|
|
165
|
+
* `exitCodes` win over `cli_settings.exitCodes`, which win over `DyCLI_ExitCode_Type`.
|
|
166
|
+
* @param error - the failure
|
|
167
|
+
* @param settings - the CLI settings (default: `DyNTS_global_settings.cli_settings`)
|
|
168
|
+
*/
|
|
169
|
+
exitCodeOf(error, settings = global_settings_const_1.DyNTS_global_settings.cli_settings) {
|
|
170
|
+
const codes = {
|
|
171
|
+
operationError: cli_exit_code_type_enum_1.DyCLI_ExitCode_Type.operationError, usage: cli_exit_code_type_enum_1.DyCLI_ExitCode_Type.usage,
|
|
172
|
+
auth: cli_exit_code_type_enum_1.DyCLI_ExitCode_Type.auth, network: cli_exit_code_type_enum_1.DyCLI_ExitCode_Type.network, remote: cli_exit_code_type_enum_1.DyCLI_ExitCode_Type.remote,
|
|
173
|
+
...settings?.exitCodes, ...this.exitCodes,
|
|
174
|
+
};
|
|
175
|
+
const failure = (error ?? {});
|
|
176
|
+
const status = failure.___status ?? failure.status;
|
|
177
|
+
if (typeof failure.code === 'string' && failure.code.startsWith('commander.')) {
|
|
178
|
+
return codes.usage;
|
|
179
|
+
}
|
|
180
|
+
if (DyCLI_networkCodes.includes(String(failure.code)) || DyCLI_networkCodes.includes(String(failure.cause?.code))) {
|
|
181
|
+
return codes.network;
|
|
182
|
+
}
|
|
183
|
+
if (typeof status !== 'number') {
|
|
184
|
+
return codes.operationError;
|
|
185
|
+
}
|
|
186
|
+
if (status === 401 || status === 403) {
|
|
187
|
+
return codes.auth;
|
|
188
|
+
}
|
|
189
|
+
if (status === 400 || status === 404 || status === 422) {
|
|
190
|
+
return codes.usage;
|
|
191
|
+
}
|
|
192
|
+
return status >= 400 ? codes.remote : codes.operationError;
|
|
193
|
+
}
|
|
194
|
+
/** Builds the commander option of a flag. */
|
|
195
|
+
static optionOf(commander, flag) {
|
|
196
|
+
const isSwitch = flag.type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.boolean;
|
|
197
|
+
const long = isSwitch && flag.default === true ? `--no-${flag.flag}` : `--${flag.flag}`;
|
|
198
|
+
const value = isSwitch ? '' : ` <${flag.type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.list ? 'item' : 'value'}>`;
|
|
199
|
+
const option = new commander.Option(`${flag.short ? `-${flag.short}, ` : ''}${long}${value}`, flag.description);
|
|
200
|
+
if (!isSwitch) {
|
|
201
|
+
option.argParser((raw, previous) => {
|
|
202
|
+
try {
|
|
203
|
+
const converted = cli_flag_util_1.DyCLI_Flag_Util.convert(flag, raw);
|
|
204
|
+
return flag.type === cli_flag_value_type_enum_1.DyCLI_FlagValue_Type.list ?
|
|
205
|
+
[...(Array.isArray(previous) ? previous : []), converted] : converted;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
throw new commander.InvalidArgumentError(error.__userMessage ?? error.message);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
if (flag.required && !isSwitch) {
|
|
213
|
+
option.makeOptionMandatory(true);
|
|
214
|
+
}
|
|
215
|
+
return option;
|
|
216
|
+
}
|
|
217
|
+
/** Validates the exit-code overrides: integers between 1 and 255 of known outcomes. */
|
|
218
|
+
static checkExitCodes(exitCodes, invalid) {
|
|
219
|
+
const outcomes = ['operationError', 'usage', 'auth', 'network', 'remote'];
|
|
220
|
+
Object.entries(exitCodes ?? {}).forEach(([outcome, code]) => {
|
|
221
|
+
if (!outcomes.includes(outcome) || !Number.isInteger(code) || code < 1 || code > 255) {
|
|
222
|
+
throw invalid('DyNTS-CLP-EXC', `exitCodes.${outcome} must be a known outcome with an integer 1-255`);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/** Builds the construction error with a stable error code and the construction location. */
|
|
227
|
+
static invalid(code, reason, stackLocation) {
|
|
228
|
+
return new fsm_dynamo_1.DyFM_Error({
|
|
229
|
+
status: 500,
|
|
230
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|${code}`,
|
|
231
|
+
message: `DyCLI_Command_Params construction failed: ${reason}`,
|
|
232
|
+
additionalContent: { stackLocation: stackLocation },
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
exports.DyCLI_Command_Params = DyCLI_Command_Params;
|
|
237
|
+
//# sourceMappingURL=cli-command-params.control-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-command-params.control-model.js","sourceRoot":"","sources":["../../../../../src/_modules/cli/_models/control-models/cli-command-params.control-model.ts"],"names":[],"mappings":";;;AAIA,sDAA+G;AAE/G,0FAAuF;AACvF,oEAAmE;AACnE,kFAA2E;AAC3E,oFAA6E;AAC7E,4EAAsE;AAKtE,qHAAqH;AACrH,MAAM,iBAAiB,GAAW,mCAAmC,CAAC;AACtE,uDAAuD;AACvD,MAAM,kBAAkB,GAAa;IACnC,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,yBAAyB,EAAE,gBAAgB;CACjH,CAAC;AAKF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,oBAAoB;IAC/B,2EAA2E;IAClE,OAAO,CAAS;IACzB,gEAAgE;IACvD,WAAW,CAAS;IAC7B,iCAAiC;IACxB,OAAO,CAAW;IAC3B,0DAA0D;IACjD,QAAQ,CAAU;IAC3B,0EAA0E;IACjE,SAAS,CAAwD;IAC1E,iEAAiE;IACxD,KAAK,CAAe;IAC7B,+EAA+E;IACtE,MAAM,CAAqB;IACpC,2CAA2C;IAClC,SAAS,CAA2B;IAC7C,iEAAiE;IACxD,aAAa,CAAS;IAW/B;;OAEG;IACH,YAAY,GAcX;QACC,MAAM,aAAa,GAAW,GAAG,EAAE,aAAa,IAAI,IAAA,8CAAiC,GAAE,CAAC;QACxF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,MAAc,EAAc,EAAE,CAC3D,oBAAoB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,MAAM,cAAc,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,aAAa,CAAC,CAAC;QACrH,MAAM,SAAS,GAAqE,GAAG,EAAE,SAAS,CAAC;QAEnG,8EAA8E;QAC9E,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,OAAO,SAAS,EAAE,IAAI,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MAAM,EAAE,SAAS,EAAE,QAAQ,CAAE,CAAC;QAEtF,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,OAAO,EAAE,IAAI,CAAqB,EAAQ,EAAE;YACrF,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAK,IAAe,GAAG,CAAC,IAAK,IAAe,GAAG,GAAG,EAAE,CAAC;gBAC7G,MAAM,OAAO,CAAC,eAAe,EAAE,aAAa,OAAO,gDAAgD,CAAC,CAAC;YACvG,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,4FAA4F;IACpF,MAAM,CAAC,OAAO,CAAC,IAAY,EAAE,MAAc,EAAE,aAAqB;QACxE,OAAO,IAAI,uBAAU,CAAC;YACpB,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,IAAI,IAAI,EAAE;YACjE,OAAO,EAAE,6CAA6C,MAAM,EAAE;YAC9D,iBAAiB,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AA9QD,oDA8QC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DyCLI_FlagValue_Type } from '../../_enums/cli-flag-value.type-enum';
|
|
2
|
+
/**
|
|
3
|
+
* The per-parameter flag settings of a command (HP-DOPL MP-4.2): an override of a flag generated from the operation's
|
|
4
|
+
* input schema, or an extra flag the operation does not have. Every field is optional for an override.
|
|
5
|
+
*/
|
|
6
|
+
export interface DyCLI_Flag_Settings {
|
|
7
|
+
/** The long flag without dashes (kebab-case); default: the parameter name in kebab-case (`noteId` → `note-id`). */
|
|
8
|
+
flag?: string;
|
|
9
|
+
/** A one-letter short flag (`l` → `-l`). */
|
|
10
|
+
short?: string;
|
|
11
|
+
/** The help text; default: the schema description. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** The value kind; default: from the schema type (required for an extra flag). */
|
|
14
|
+
type?: DyCLI_FlagValue_Type;
|
|
15
|
+
/** Allowed values. */
|
|
16
|
+
enum?: (string | number)[];
|
|
17
|
+
/** Whether the flag must be given. */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** The value when the flag is not given. */
|
|
20
|
+
default?: unknown;
|
|
21
|
+
/** A custom converter of the raw text; runs instead of the built-in conversion of `type`. */
|
|
22
|
+
parse?(raw: string): unknown;
|
|
23
|
+
}
|
|
24
|
+
/** A resolved flag of a command — what `DyCLI_Command_Params.flags` holds (HP-DOPL MP-4.2). */
|
|
25
|
+
export interface DyCLI_Flag {
|
|
26
|
+
/** The value name (the operation input / body property / guardrail argument name, e.g. `noteId`). */
|
|
27
|
+
param: string;
|
|
28
|
+
/** The long flag without dashes (e.g. `note-id`). */
|
|
29
|
+
flag: string;
|
|
30
|
+
/** The one-letter short flag. */
|
|
31
|
+
short?: string;
|
|
32
|
+
/** The help text. */
|
|
33
|
+
description: string;
|
|
34
|
+
/** The value kind. */
|
|
35
|
+
type: DyCLI_FlagValue_Type;
|
|
36
|
+
/** The kind of one item of a `list` flag (`string` or `number`). */
|
|
37
|
+
itemType?: DyCLI_FlagValue_Type;
|
|
38
|
+
/** Allowed values. */
|
|
39
|
+
enum?: (string | number)[];
|
|
40
|
+
/** Whether the flag must be given. */
|
|
41
|
+
required: boolean;
|
|
42
|
+
/** The value when the flag is not given. */
|
|
43
|
+
default?: unknown;
|
|
44
|
+
/** A custom converter of the raw text. */
|
|
45
|
+
parse?(raw: string): unknown;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=cli-flag.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-flag.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/cli/_models/interfaces/cli-flag.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,mHAAmH;IACnH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,sBAAsB;IACtB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6FAA6F;IAC7F,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAED,+FAA+F;AAC/F,MAAM,WAAW,UAAU;IACzB,qGAAqG;IACrG,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,sBAAsB;IACtB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-flag.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/cli/_models/interfaces/cli-flag.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DyCLI_Output_Type } from '../../_enums/cli-output.type-enum';
|
|
2
|
+
/** The exit codes of the command outcomes (HP-DOPL MP-4.2); every value is an integer between 1 and 255. */
|
|
3
|
+
export interface DyCLI_ExitCodes {
|
|
4
|
+
/** A local error without a status (default `1`). */
|
|
5
|
+
operationError: number;
|
|
6
|
+
/** Invalid arguments (default `2`). */
|
|
7
|
+
usage: number;
|
|
8
|
+
/** 401/403 (default `10`). */
|
|
9
|
+
auth: number;
|
|
10
|
+
/** The server could not be reached (default `11`). */
|
|
11
|
+
network: number;
|
|
12
|
+
/** Any other error status (default `12`). */
|
|
13
|
+
remote: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* CLI-wide defaults (`DyNTS_global_settings.cli_settings`, HP-DOPL MP-4.2). `null` (the default) means every field below
|
|
17
|
+
* takes its documented default; a command's own settings win.
|
|
18
|
+
*/
|
|
19
|
+
export interface DyCLI_Settings {
|
|
20
|
+
/** The default output of the commands; default: `json`. */
|
|
21
|
+
output?: DyCLI_Output_Type;
|
|
22
|
+
/** Exit-code overrides; default: `DyCLI_ExitCode_Type`. */
|
|
23
|
+
exitCodes?: Partial<DyCLI_ExitCodes>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=cli-settings.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-settings.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/cli/_models/interfaces/cli-settings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAGtE,4GAA4G;AAC5G,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-settings.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/cli/_models/interfaces/cli-settings.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './_enums/cli-exit-code.type-enum';
|
|
2
|
+
export * from './_enums/cli-flag-value.type-enum';
|
|
3
|
+
export * from './_enums/cli-output.type-enum';
|
|
4
|
+
export * from './_models/interfaces/cli-flag.interface';
|
|
5
|
+
export * from './_models/interfaces/cli-settings.interface';
|
|
6
|
+
export * from './_models/control-models/cli-command-params.control-model';
|
|
7
|
+
export * from './_collections/cli-commander.util';
|
|
8
|
+
export * from './_collections/cli-flag.util';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/cli/index.ts"],"names":[],"mappings":"AAOA,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAG9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC;AAG5D,cAAc,2DAA2D,CAAC;AAG1E,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// CLI MODULE (HP-DOPL MP-4, D-4/D-5) — `@futdevpro/nts-dynamo/cli`: CLI commands from the same operation settings as
|
|
3
|
+
// the REST endpoints and the MCP tools. `commander` is an OPTIONAL peer, loaded lazily; the root `index.ts` does NOT
|
|
4
|
+
// re-export this module, so a server never needs `commander`.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
// ENUMS
|
|
8
|
+
tslib_1.__exportStar(require("./_enums/cli-exit-code.type-enum"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./_enums/cli-flag-value.type-enum"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./_enums/cli-output.type-enum"), exports);
|
|
11
|
+
// INTERFACES
|
|
12
|
+
tslib_1.__exportStar(require("./_models/interfaces/cli-flag.interface"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./_models/interfaces/cli-settings.interface"), exports);
|
|
14
|
+
// CONTROL MODELS
|
|
15
|
+
tslib_1.__exportStar(require("./_models/control-models/cli-command-params.control-model"), exports);
|
|
16
|
+
// COLLECTIONS
|
|
17
|
+
tslib_1.__exportStar(require("./_collections/cli-commander.util"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./_collections/cli-flag.util"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/cli/index.ts"],"names":[],"mappings":";AAEA,qHAAqH;AACrH,qHAAqH;AACrH,8DAA8D;;;AAE9D,QAAQ;AACR,2EAAiD;AACjD,4EAAkD;AAClD,wEAA8C;AAE9C,aAAa;AACb,kFAAwD;AACxD,sFAA4D;AAE5D,iBAAiB;AACjB,oGAA0E;AAE1E,cAAc;AACd,4EAAkD;AAClD,uEAA6C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/nts-dynamo",
|
|
3
|
-
"version": "01.15.
|
|
3
|
+
"version": "01.15.307",
|
|
4
4
|
"description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Program Ltd.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "server-package",
|
|
@@ -203,6 +203,12 @@
|
|
|
203
203
|
"types": "./build/_modules/mcp/index.d.ts",
|
|
204
204
|
"typings": "./build/_modules/mcp/index.d.ts"
|
|
205
205
|
},
|
|
206
|
+
"./cli": {
|
|
207
|
+
"default": "./build/_modules/cli/index.js",
|
|
208
|
+
"module": "./build/_modules/cli/index.js",
|
|
209
|
+
"types": "./build/_modules/cli/index.d.ts",
|
|
210
|
+
"typings": "./build/_modules/cli/index.d.ts"
|
|
211
|
+
},
|
|
206
212
|
"./admin-auth": {
|
|
207
213
|
"default": "./build/_modules/admin-auth/index.js",
|
|
208
214
|
"module": "./build/_modules/admin-auth/index.js",
|
|
@@ -378,6 +384,9 @@
|
|
|
378
384
|
"mcp": [
|
|
379
385
|
"build/_modules/mcp/index.d.ts"
|
|
380
386
|
],
|
|
387
|
+
"cli": [
|
|
388
|
+
"build/_modules/cli/index.d.ts"
|
|
389
|
+
],
|
|
381
390
|
"admin-auth": [
|
|
382
391
|
"build/_modules/admin-auth/index.d.ts"
|
|
383
392
|
],
|
|
@@ -452,6 +461,7 @@
|
|
|
452
461
|
"@anthropic-ai/sdk": "~0.39.0",
|
|
453
462
|
"@modelcontextprotocol/sdk": "~1.29.0",
|
|
454
463
|
"better-sqlite3": "~12.4.1",
|
|
464
|
+
"commander": ">=12.1.0 <15",
|
|
455
465
|
"@futdevpro/fsm-dynamo": ">=1.20.64 <2",
|
|
456
466
|
"@types/express": "4.17.21",
|
|
457
467
|
"@types/geoip-lite": "~1.4.4",
|
|
@@ -479,6 +489,9 @@
|
|
|
479
489
|
"better-sqlite3": {
|
|
480
490
|
"optional": true
|
|
481
491
|
},
|
|
492
|
+
"commander": {
|
|
493
|
+
"optional": true
|
|
494
|
+
},
|
|
482
495
|
"discord.js": {
|
|
483
496
|
"optional": true
|
|
484
497
|
},
|
|
@@ -510,9 +523,11 @@
|
|
|
510
523
|
"@modelcontextprotocol/sdk": "~1.29.0",
|
|
511
524
|
"@types/better-sqlite3": "~7.6.13",
|
|
512
525
|
"better-sqlite3": "~12.4.1",
|
|
526
|
+
"commander": "~14.0.3",
|
|
513
527
|
"decimal.js": "10.6.0",
|
|
514
528
|
"discord.js": "~14.24.2",
|
|
515
529
|
"eslint": "~9.39.5",
|
|
530
|
+
"express": "~4.22.2",
|
|
516
531
|
"eslint-plugin-import": "^2.29.0",
|
|
517
532
|
"eslint-plugin-jsdoc": "^48.0.0",
|
|
518
533
|
"eslint-plugin-max-params-no-constructor": "^0.0.4",
|