@voxgig/sdkgen 0.22.0 → 0.23.0
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/bin/voxgig-sdkgen +12 -4
- package/dist/action/action.d.ts +4 -0
- package/dist/action/action.js +35 -0
- package/dist/action/action.js.map +1 -0
- package/dist/action/feature.d.ts +4 -2
- package/dist/action/feature.js +57 -38
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.d.ts +4 -2
- package/dist/action/target.js +136 -45
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Entity.js +5 -0
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/Feature.js +5 -0
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/cmp/Main.js +4 -1
- package/dist/cmp/Main.js.map +1 -1
- package/dist/cmp/Top.d.ts +2 -0
- package/dist/cmp/Top.js +23 -0
- package/dist/cmp/Top.js.map +1 -0
- package/dist/sdkgen.d.ts +10 -3
- package/dist/sdkgen.js +53 -8
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +16 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utility.d.ts +3 -3
- package/dist/utility.js +7 -8
- package/dist/utility.js.map +1 -1
- package/package.json +6 -10
- package/project/.sdk/model/feature/README.md +2 -0
- package/project/.sdk/model/feature/log.jsonic +7 -4
- package/project/.sdk/model/feature/test.jsonic +26 -0
- package/project/.sdk/model/target/ts.jsonic +1 -0
- package/project/.sdk/src/cmp/ts/Config_ts.ts +7 -2
- package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +67 -0
- package/project/.sdk/src/cmp/ts/EntityTest_ts.ts +180 -0
- package/project/.sdk/src/cmp/ts/Entity_ts.ts +41 -66
- package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +22 -0
- package/project/.sdk/src/cmp/ts/Main_ts.ts +52 -53
- package/project/.sdk/src/cmp/ts/Package_ts.ts +12 -7
- package/project/.sdk/src/cmp/ts/ReadmeInstall_ts.ts +19 -0
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +24 -0
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +13 -0
- package/project/.sdk/src/cmp/ts/TestMain_ts.ts +19 -0
- package/project/.sdk/src/cmp/ts/Test_ts.ts +20 -0
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +8 -1
- package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +164 -0
- package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +37 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +91 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +92 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +96 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +96 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +95 -0
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +107 -0
- package/project/.sdk/src/cmp/ts/utility_ts.ts +10 -0
- package/project/.sdk/tm/ts/src/feature/base/BaseFeature.ts +43 -0
- package/project/.sdk/tm/ts/src/feature/log/LogFeature.ts +109 -0
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +159 -0
- package/project/.sdk/tm/ts/src/tsconfig.json +1 -1
- package/project/.sdk/tm/ts/src/types.ts +114 -0
- package/project/.sdk/tm/ts/src/utility/AddfeatureUtility.ts +47 -0
- package/project/.sdk/tm/ts/src/utility/AuthUtility.ts +42 -0
- package/project/.sdk/tm/ts/src/utility/BodyUtility.ts +29 -0
- package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +50 -0
- package/project/.sdk/tm/ts/src/utility/ContextUtility.ts +67 -0
- package/project/.sdk/tm/ts/src/utility/DoneUtility.ts +28 -0
- package/project/.sdk/tm/ts/src/utility/ErrorUtility.ts +59 -0
- package/project/.sdk/tm/ts/src/utility/FeaturehookUtility.ts +26 -0
- package/project/.sdk/tm/ts/src/utility/FetcherUtility.ts +17 -0
- package/project/.sdk/tm/ts/src/utility/FindparamUtility.ts +54 -0
- package/project/.sdk/tm/ts/src/utility/FullurlUtility.ts +46 -0
- package/project/.sdk/tm/ts/src/utility/HeadersUtility.ts +24 -0
- package/project/.sdk/tm/ts/src/utility/InitfeatureUtility.ts +13 -0
- package/project/.sdk/tm/ts/src/utility/JoinurlUtility.ts +15 -0
- package/project/.sdk/tm/ts/src/utility/MethodUtility.ts +25 -0
- package/project/.sdk/tm/ts/src/utility/OperatorUtility.ts +90 -0
- package/project/.sdk/tm/ts/src/utility/OptionsUtility.ts +72 -0
- package/project/.sdk/tm/ts/src/utility/ParamsUtility.ts +37 -0
- package/project/.sdk/tm/ts/src/utility/QueryUtility.ts +27 -0
- package/project/.sdk/tm/ts/src/utility/ReqformUtility.ts +33 -0
- package/project/.sdk/tm/ts/src/utility/RequestUtility.ts +66 -0
- package/project/.sdk/tm/ts/src/utility/ResbasicUtility.ts +34 -0
- package/project/.sdk/tm/ts/src/utility/ResbodyUtility.ts +19 -0
- package/project/.sdk/tm/ts/src/utility/ResformUtility.ts +36 -0
- package/project/.sdk/tm/ts/src/utility/ResheadersUtility.ts +23 -0
- package/project/.sdk/tm/ts/src/utility/ResponseUtility.ts +30 -0
- package/project/.sdk/tm/ts/src/utility/ResultUtility.ts +36 -0
- package/project/.sdk/tm/ts/src/utility/SpecUtility.ts +61 -0
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +2499 -0
- package/project/.sdk/tm/ts/src/utility/Utility.ts +88 -0
- package/project/.sdk/tm/ts/test/exists.test.ts +17 -0
- package/project/.sdk/tm/ts/test/runner.ts +402 -0
- package/project/.sdk/tm/ts/test/tsconfig.json +1 -1
- package/project/.sdk/tm/ts/test/utility/Custom.test.ts +62 -0
- package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +244 -0
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +678 -0
- package/project/.sdk/tm/ts/test/utility/index.ts +9 -0
- package/project/.sdk/tm/ts/test/utility.ts +86 -0
- package/src/action/action.ts +54 -0
- package/src/action/feature.ts +83 -47
- package/src/action/target.ts +173 -53
- package/src/cmp/Entity.ts +6 -0
- package/src/cmp/Feature.ts +6 -3
- package/src/cmp/Main.ts +4 -1
- package/src/sdkgen.ts +86 -11
- package/src/types.ts +33 -0
- package/src/utility.ts +5 -3
- package/project/.sdk/model/feature/limit.jsonic +0 -12
- package/project/.sdk/model/feature/page.jsonic +0 -9
- package/project/.sdk/model/feature/telemetry.jsonic +0 -10
- package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.js +0 -79
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.js +0 -61
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.js +0 -57
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.js +0 -61
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.js +0 -61
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.js +0 -61
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.js +0 -67
- package/project/.sdk/tm/ts/test/README.md~ +0 -2
package/dist/cmp/Top.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Top = void 0;
|
|
4
|
+
const jostraca_1 = require("jostraca");
|
|
5
|
+
const utility_1 = require("../utility");
|
|
6
|
+
const Top = (0, jostraca_1.cmp)(function Top(props) {
|
|
7
|
+
const { ctx$ } = props;
|
|
8
|
+
const { model, stdrep, log } = ctx$;
|
|
9
|
+
// TOOD: copy non-target items, suck as LICENSE
|
|
10
|
+
/*
|
|
11
|
+
Copy({
|
|
12
|
+
from,
|
|
13
|
+
replace: {
|
|
14
|
+
...stdrep,
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
*/
|
|
18
|
+
const Top_sdk = (0, utility_1.requirePath)(ctx$, `Top`);
|
|
19
|
+
Top_sdk['Top']({ model, stdrep });
|
|
20
|
+
log.info({ point: 'generate-top' });
|
|
21
|
+
});
|
|
22
|
+
exports.Top = Top;
|
|
23
|
+
//# sourceMappingURL=Top.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Top.js","sourceRoot":"","sources":["../../src/cmp/Top.ts"],"names":[],"mappings":";;;AACA,uCAA2C;AAE3C,wCAAwC;AAGxC,MAAM,GAAG,GAAG,IAAA,cAAG,EAAC,SAAS,GAAG,CAAC,KAAU;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAA;IACtB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAEnC,gDAAgD;IAChD;;;;;;;MAOE;IAEF,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAExC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;IAEjC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAA;AACrC,CAAC,CAAC,CAAA;AAIA,kBAAG"}
|
package/dist/sdkgen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Pino } from '@voxgig/util';
|
|
2
1
|
import * as JostracaModule from 'jostraca';
|
|
2
|
+
import type { ActionResult } from './types';
|
|
3
3
|
import { requirePath } from './utility';
|
|
4
4
|
import { Main } from './cmp/Main';
|
|
5
5
|
import { Entity } from './cmp/Entity';
|
|
@@ -22,21 +22,28 @@ type SdkGenOptions = {
|
|
|
22
22
|
name: string;
|
|
23
23
|
};
|
|
24
24
|
debug?: boolean | string;
|
|
25
|
-
pino?:
|
|
25
|
+
pino?: any;
|
|
26
26
|
now?: () => number;
|
|
27
27
|
existing?: {
|
|
28
28
|
txt?: any;
|
|
29
29
|
bin?: any;
|
|
30
30
|
};
|
|
31
|
+
dryrun?: boolean;
|
|
31
32
|
};
|
|
32
33
|
declare const Jostraca: typeof JostracaModule.Jostraca;
|
|
33
34
|
declare function SdkGen(opts: SdkGenOptions): {
|
|
34
|
-
pino:
|
|
35
|
+
pino: any;
|
|
35
36
|
generate: (spec: any) => Promise<{
|
|
36
37
|
ok: boolean;
|
|
37
38
|
name: string;
|
|
38
39
|
}>;
|
|
39
40
|
action: (args: string[]) => Promise<void>;
|
|
41
|
+
target: {
|
|
42
|
+
add: (targets: string[]) => Promise<ActionResult>;
|
|
43
|
+
};
|
|
44
|
+
feature: {
|
|
45
|
+
add: (features: string[]) => Promise<ActionResult>;
|
|
46
|
+
};
|
|
40
47
|
};
|
|
41
48
|
declare namespace SdkGen {
|
|
42
49
|
var makeBuild: (opts: SdkGenOptions) => Promise<(model: any, build: any, ctx: any) => Promise<any>>;
|
package/dist/sdkgen.js
CHANGED
|
@@ -33,14 +33,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
40
|
exports.requirePath = exports.Jostraca = exports.FeatureHook = exports.ReadmeEntity = exports.ReadmeOptions = exports.ReadmeInstall = exports.Readme = exports.Feature = exports.Entity = exports.Main = exports.List = exports.Slot = exports.Line = exports.Inject = exports.Fragment = exports.Copy = exports.Content = exports.File = exports.Folder = exports.Project = exports.omap = exports.deep = exports.indent = exports.template = exports.getx = exports.get = exports.vmap = exports.cmap = exports.kebabify = exports.camelify = exports.snakify = exports.each = exports.names = exports.cmp = void 0;
|
|
38
41
|
exports.SdkGen = SdkGen;
|
|
39
|
-
const
|
|
42
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
43
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
40
44
|
const util_1 = require("@voxgig/util");
|
|
41
45
|
const jsonic_1 = require("jsonic");
|
|
42
46
|
const JostracaModule = __importStar(require("jostraca"));
|
|
43
47
|
const aontu_1 = require("aontu");
|
|
48
|
+
const util_2 = require("@voxgig/util");
|
|
44
49
|
const utility_1 = require("./utility");
|
|
45
50
|
Object.defineProperty(exports, "requirePath", { enumerable: true, get: function () { return utility_1.requirePath; } });
|
|
46
51
|
const Main_1 = require("./cmp/Main");
|
|
@@ -67,17 +72,29 @@ const ACTION_MAP = {
|
|
|
67
72
|
target: target_1.action_target,
|
|
68
73
|
feature: feature_1.action_feature,
|
|
69
74
|
};
|
|
75
|
+
const dlog = (0, util_2.getdlog)('sdkgen', __filename);
|
|
70
76
|
function SdkGen(opts) {
|
|
71
|
-
const fs = opts.fs ||
|
|
77
|
+
const fs = opts.fs || node_fs_1.default;
|
|
72
78
|
const folder = opts.folder || '../';
|
|
73
79
|
const now = opts.now || (() => Date.now());
|
|
74
|
-
const
|
|
80
|
+
const jopts = {
|
|
81
|
+
now,
|
|
82
|
+
control: {
|
|
83
|
+
dryrun: opts.dryrun
|
|
84
|
+
},
|
|
85
|
+
existing: {
|
|
86
|
+
txt: {
|
|
87
|
+
merge: true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const jostraca = Jostraca(jopts);
|
|
75
92
|
const pino = (0, util_1.prettyPino)('sdkgen', opts);
|
|
76
93
|
const log = pino.child({ cmp: 'sdkgen' });
|
|
77
94
|
async function generate(spec) {
|
|
78
95
|
const start = Date.now();
|
|
79
96
|
const { model, config } = spec;
|
|
80
|
-
log.info({ point: 'generate-start', start });
|
|
97
|
+
log.info({ point: 'generate-start', start, note: opts.dryrun ? '** DRY RUN **' : '' });
|
|
81
98
|
log.debug({ point: 'generate-spec', spec });
|
|
82
99
|
let Root = spec.root;
|
|
83
100
|
if (null == Root && null != config.root) {
|
|
@@ -91,9 +108,16 @@ function SdkGen(opts) {
|
|
|
91
108
|
log: log.child({ cmp: 'jostraca' }),
|
|
92
109
|
meta: { spec },
|
|
93
110
|
debug: opts.debug,
|
|
94
|
-
existing: opts.existing
|
|
111
|
+
existing: opts.existing,
|
|
95
112
|
};
|
|
96
|
-
await jostraca.generate(jopts, () => Root({ model }));
|
|
113
|
+
const jres = await jostraca.generate(jopts, () => Root({ model }));
|
|
114
|
+
(0, util_2.showChanges)(jopts.log, 'generate-result', jres, node_path_1.default.dirname(process.cwd()));
|
|
115
|
+
const dlogs = dlog.log();
|
|
116
|
+
if (0 < dlogs.length) {
|
|
117
|
+
for (let dlogentry of dlogs) {
|
|
118
|
+
log.debug({ point: 'generate-warning', dlogentry, note: String(dlogentry) });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
97
121
|
log.info({ point: 'generate-end' });
|
|
98
122
|
return { ok: true, name: 'sdkgen' };
|
|
99
123
|
}
|
|
@@ -104,6 +128,11 @@ function SdkGen(opts) {
|
|
|
104
128
|
if (null == action) {
|
|
105
129
|
throw new utility_1.SdkGenError('Unknown action: ' + actname);
|
|
106
130
|
}
|
|
131
|
+
const ctx = resolveActionContext();
|
|
132
|
+
await action(pargs, ctx);
|
|
133
|
+
}
|
|
134
|
+
function resolveActionContext() {
|
|
135
|
+
// TODO: use AsyncLocalStorage to avoid reloading model
|
|
107
136
|
const { model, tree } = resolveModel();
|
|
108
137
|
const ctx = {
|
|
109
138
|
fs: () => fs,
|
|
@@ -111,8 +140,10 @@ function SdkGen(opts) {
|
|
|
111
140
|
folder: '.', // The `generate` folder,
|
|
112
141
|
model,
|
|
113
142
|
tree,
|
|
143
|
+
jostraca,
|
|
144
|
+
opts,
|
|
114
145
|
};
|
|
115
|
-
|
|
146
|
+
return ctx;
|
|
116
147
|
}
|
|
117
148
|
function resolveModel() {
|
|
118
149
|
const path = './model/sdk.jsonic';
|
|
@@ -153,10 +184,24 @@ function SdkGen(opts) {
|
|
|
153
184
|
tree,
|
|
154
185
|
};
|
|
155
186
|
}
|
|
187
|
+
const target = {
|
|
188
|
+
add: async (targets) => {
|
|
189
|
+
const ctx = resolveActionContext();
|
|
190
|
+
return (0, target_1.target_add)(targets, ctx);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
const feature = {
|
|
194
|
+
add: async (features) => {
|
|
195
|
+
const ctx = resolveActionContext();
|
|
196
|
+
return (0, feature_1.feature_add)(features, ctx);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
156
199
|
return {
|
|
157
|
-
pino,
|
|
200
|
+
pino: pino,
|
|
158
201
|
generate,
|
|
159
202
|
action,
|
|
203
|
+
target,
|
|
204
|
+
feature,
|
|
160
205
|
};
|
|
161
206
|
}
|
|
162
207
|
SdkGen.makeBuild = async function (opts) {
|
package/dist/sdkgen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkgen.js","sourceRoot":"","sources":["../src/sdkgen.ts"],"names":[],"mappings":";AAAA,oDAAoD
|
|
1
|
+
{"version":3,"file":"sdkgen.js","sourceRoot":"","sources":["../src/sdkgen.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0XlD,wBAAM;AAxXR,sDAAwB;AACxB,0DAA4B;AAE5B,uCAA+C;AAE/C,mCAA+B;AAC/B,yDAA0C;AAC1C,iCAAsC;AAEtC,uCAGqB;AAOrB,uCAAoD;AAuWlD,4FAvWoB,qBAAW,OAuWpB;AArWb,qCAAiC;AAyV/B,qFAzVO,WAAI,OAyVP;AAxVN,yCAAqC;AAyVnC,uFAzVO,eAAM,OAyVP;AAxVR,2CAAuC;AAyVrC,wFAzVO,iBAAO,OAyVP;AAxVT,yCAAqC;AAyVnC,uFAzVO,eAAM,OAyVP;AAxVR,uDAAmD;AAyVjD,8FAzVO,6BAAa,OAyVP;AAxVf,uDAAmD;AAyVjD,8F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AAM,CAAA;AACzC,QAAA,IAAI,GAAc,cAAc,CAAC,IAAI,CAAA;AACrC,QAAA,OAAO,GAAc,cAAc,CAAC,OAAO,CAAA;AAC3C,QAAA,IAAI,GAAc,cAAc,CAAC,IAAI,CAAA;AACrC,QAAA,QAAQ,GAAc,cAAc,CAAC,QAAQ,CAAA;AAC7C,QAAA,MAAM,GAAc,cAAc,CAAC,MAAM,CAAA;AACzC,QAAA,IAAI,GAAc,cAAc,CAAC,IAAI,CAAA;AACrC,QAAA,IAAI,GAAc,cAAc,CAAC,IAAI,CAAA;AACrC,QAAA,IAAI,GAAc,cAAc,CAAC,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/sdkgen.ts","../src/utility.ts","../src/action/feature.ts","../src/action/target.ts","../src/cmp/entity.ts","../src/cmp/feature.ts","../src/cmp/featurehook.ts","../src/cmp/main.ts","../src/cmp/readme.ts","../src/cmp/readmeentity.ts","../src/cmp/readmeinstall.ts","../src/cmp/readmeintro.ts","../src/cmp/readmemodel.ts","../src/cmp/readmeoptions.ts","../src/cmp/readmequick.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/sdkgen.ts","../src/types.ts","../src/utility.ts","../src/action/action.ts","../src/action/feature.ts","../src/action/target.ts","../src/cmp/entity.ts","../src/cmp/feature.ts","../src/cmp/featurehook.ts","../src/cmp/main.ts","../src/cmp/readme.ts","../src/cmp/readmeentity.ts","../src/cmp/readmeinstall.ts","../src/cmp/readmeintro.ts","../src/cmp/readmemodel.ts","../src/cmp/readmeoptions.ts","../src/cmp/readmequick.ts"],"version":"5.8.3"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Fs from 'node:fs';
|
|
2
|
+
import type { JostracaResult } from 'jostraca';
|
|
3
|
+
type FsUtil = typeof Fs;
|
|
4
|
+
type ActionContext = {
|
|
5
|
+
fs: () => FsUtil;
|
|
6
|
+
log: any;
|
|
7
|
+
folder: string;
|
|
8
|
+
model: any;
|
|
9
|
+
tree: any;
|
|
10
|
+
opts: any;
|
|
11
|
+
jostraca: any;
|
|
12
|
+
};
|
|
13
|
+
type ActionResult = {
|
|
14
|
+
jres: JostracaResult;
|
|
15
|
+
};
|
|
16
|
+
export type { ActionContext, ActionResult, };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/utility.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare
|
|
2
|
-
declare
|
|
1
|
+
declare function resolvePath(ctx$: any, path: string): any;
|
|
2
|
+
declare function requirePath(ctx$: any, path: string, flags?: {
|
|
3
3
|
ignore?: boolean;
|
|
4
|
-
})
|
|
4
|
+
}): any;
|
|
5
5
|
declare class SdkGenError extends Error {
|
|
6
6
|
constructor(...args: any[]);
|
|
7
7
|
}
|
package/dist/utility.js
CHANGED
|
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SdkGenError =
|
|
6
|
+
exports.SdkGenError = void 0;
|
|
7
|
+
exports.resolvePath = resolvePath;
|
|
8
|
+
exports.requirePath = requirePath;
|
|
7
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
|
|
9
|
-
const resolvePath = (ctx$, path) => {
|
|
10
|
+
function resolvePath(ctx$, path) {
|
|
10
11
|
const fullpath = node_path_1.default.join(ctx$.folder, '.sdk', 'dist', path);
|
|
11
12
|
return fullpath;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const requirePath = (ctx$, path, flags) => {
|
|
13
|
+
}
|
|
14
|
+
function requirePath(ctx$, path, flags) {
|
|
15
15
|
const fullpath = resolvePath(ctx$, path);
|
|
16
16
|
const ignore = null == flags?.ignore ? false : flags.ignore;
|
|
17
17
|
try {
|
|
@@ -25,8 +25,7 @@ const requirePath = (ctx$, path, flags) => {
|
|
|
25
25
|
throw err;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
}
|
|
29
|
-
exports.requirePath = requirePath;
|
|
28
|
+
}
|
|
30
29
|
class SdkGenError extends Error {
|
|
31
30
|
constructor(...args) {
|
|
32
31
|
super(...args);
|
package/dist/utility.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../src/utility.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../src/utility.ts"],"names":[],"mappings":";;;;;;AAwCE,kCAAW;AACX,kCAAW;AAxCb,0DAA4B;AAM5B,SAAS,WAAW,CAAC,IAAS,EAAE,IAAY;IAC1C,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IAC7D,OAAO,QAAQ,CAAA;AACjB,CAAC;AAGD,SAAS,WAAW,CAAC,IAAS,EAAE,IAAY,EAAE,KAA4B;IACxE,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACxC,MAAM,MAAM,GAAG,IAAI,IAAI,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAA;IAE3D,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC1B,CAAC;IACD,OAAO,GAAQ,EAAE,CAAC;QAChB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QAC/D,CAAC;aACI,CAAC;YACJ,MAAM,GAAG,CAAA;QACX,CAAC;IACH,CAAC;AACH,CAAC;AAGD,MAAM,WAAY,SAAQ,KAAK;IAC7B,YAAY,GAAG,IAAW;QACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;IAC3B,CAAC;CACF;AAMC,kCAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voxgig/sdkgen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"main": "dist/sdkgen.js",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"types": "dist/sdkgen.d.ts",
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
"voxgig-sdkgen": "bin/voxgig-sdkgen"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"test": "node --enable-source-maps --test dist-test",
|
|
23
|
-
"
|
|
24
|
-
"test-some": "node --enable-source-maps --test-name-pattern=\"$npm_config_pattern\" --test dist-test",
|
|
22
|
+
"test": "node --enable-source-maps --test dist-test/**/*.test.js",
|
|
23
|
+
"test-some": "node --enable-source-maps --test-name-pattern=\"$npm_config_pattern\" --test dist-test/**/*.test.js",
|
|
25
24
|
"watch": "tsc --build src test -w",
|
|
26
25
|
"build": "tsc --build src test",
|
|
27
26
|
"clean": "rm -rf node_modules yarn.lock package-lock.json",
|
|
@@ -42,19 +41,16 @@
|
|
|
42
41
|
"devDependencies": {
|
|
43
42
|
"@hapi/code": "^9.0.3",
|
|
44
43
|
"@types/js-yaml": "^4.0.9",
|
|
45
|
-
"@types/node": "24.0
|
|
46
|
-
"esbuild": "^0.25.6",
|
|
44
|
+
"@types/node": "24.1.0",
|
|
47
45
|
"json-schema-to-ts": "^3.1.1",
|
|
48
|
-
"memfs": "^4.
|
|
46
|
+
"memfs": "^4.24.0",
|
|
49
47
|
"typescript": "^5.8.3"
|
|
50
48
|
},
|
|
51
49
|
"peerDependencies": {
|
|
52
50
|
"@redocly/openapi-core": ">=1",
|
|
53
51
|
"@voxgig/util": ">=0",
|
|
52
|
+
"@voxgig/struct": ">=0",
|
|
54
53
|
"aontu": ">=0",
|
|
55
54
|
"jostraca": ">=0"
|
|
56
|
-
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"@voxgig/struct": "^0.0.4"
|
|
59
55
|
}
|
|
60
56
|
}
|
|
@@ -9,15 +9,17 @@ main: sdk: feature: log: {
|
|
|
9
9
|
|
|
10
10
|
hook: {
|
|
11
11
|
PostConstruct: active: true
|
|
12
|
+
PostConstructEntity: active: true
|
|
12
13
|
SetData: active: true
|
|
13
14
|
GetData: active: true
|
|
15
|
+
SetMatch: active: true
|
|
14
16
|
GetMatch: active: true
|
|
15
17
|
|
|
16
18
|
PreOperation: active: true
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
PreSpec: active: true
|
|
20
|
+
PreRequest: active: true
|
|
21
|
+
PreResponse: active: true
|
|
22
|
+
PreResult: active: true
|
|
21
23
|
PostOperation: active: true
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -27,6 +29,7 @@ main: sdk: feature: log: {
|
|
|
27
29
|
'pino-pretty': { active: true, version: '>=13', kind: peer }
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
deps: ts: .js
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
main: sdk: feature: test: {
|
|
3
|
+
|
|
4
|
+
name: .$KEY
|
|
5
|
+
title: Test
|
|
6
|
+
version: '0.0.1'
|
|
7
|
+
active: true
|
|
8
|
+
|
|
9
|
+
hook: {
|
|
10
|
+
PostConstruct: active: true
|
|
11
|
+
PostConstructEntity: active: true
|
|
12
|
+
SetData: active: true
|
|
13
|
+
GetData: active: true
|
|
14
|
+
SetMatch: active: true
|
|
15
|
+
GetMatch: active: true
|
|
16
|
+
|
|
17
|
+
PreOperation: active: true
|
|
18
|
+
PreSpec: active: true
|
|
19
|
+
PreRequest: active: true
|
|
20
|
+
PreResponse: active: true
|
|
21
|
+
PreResult: active: true
|
|
22
|
+
PostOperation: active: true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
@@ -2,23 +2,28 @@
|
|
|
2
2
|
import * as Path from 'node:path'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
cmp, each,
|
|
6
|
-
|
|
5
|
+
cmp, each, indent,
|
|
6
|
+
File, Content, Fragment
|
|
7
7
|
} from '@voxgig/sdkgen'
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
const Config = cmp(async function Config(props: any) {
|
|
12
13
|
const { target, ctx$: { model } } = props
|
|
13
14
|
const { main: { sdk: { entity } } } = model
|
|
14
15
|
|
|
15
16
|
const ff = Path.normalize(__dirname + '/../../../src/cmp/ts/fragment/')
|
|
16
17
|
|
|
18
|
+
const headers = model?.main?.sdk?.config?.headers || {}
|
|
19
|
+
|
|
17
20
|
File({ name: 'Config.' + target.ext }, () => {
|
|
18
21
|
|
|
19
22
|
Fragment({
|
|
20
23
|
from: ff + 'Config.fragment.ts',
|
|
24
|
+
|
|
21
25
|
replace: {
|
|
26
|
+
"'HEADERS'": indent(JSON.stringify(headers, null, 2), 4).trim(),
|
|
22
27
|
'// #EntityConfigs': () => each(entity, (entity: any) => {
|
|
23
28
|
Content(`
|
|
24
29
|
${entity.name}: {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
cmp, camelify,
|
|
4
|
+
Content, Fragment
|
|
5
|
+
} from '@voxgig/sdkgen'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
import { jsonify } from '@voxgig/struct'
|
|
9
|
+
|
|
10
|
+
import { formatJSONSrc } from './utility_ts'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const EntityOperation = cmp(function Operation(props: any) {
|
|
14
|
+
const { model } = props.ctx$
|
|
15
|
+
const { ff, opname, entity, entrep } = props
|
|
16
|
+
|
|
17
|
+
let { indent } = props
|
|
18
|
+
|
|
19
|
+
indent = indent.substring(2)
|
|
20
|
+
if ('' == indent) {
|
|
21
|
+
indent = undefined
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const entop = entity.op[opname]
|
|
25
|
+
const path = entop.path
|
|
26
|
+
|
|
27
|
+
// // TODO: move up to to common Entity
|
|
28
|
+
// const params = JSON.stringify((path.match(/\{[^}]+\}/g) || [])
|
|
29
|
+
// .map((p: string) => p.substring(1, p.length - 1))
|
|
30
|
+
// .filter((p: string) => null != p && '' !== p))
|
|
31
|
+
|
|
32
|
+
// const aliasmap = JSON.stringify(entitySDK.alias.field)
|
|
33
|
+
const aliasmap = JSON.stringify(entity.alias.field)
|
|
34
|
+
|
|
35
|
+
// const hasp = '' != entop.place
|
|
36
|
+
|
|
37
|
+
Fragment({
|
|
38
|
+
from: ff + '/Entity' + camelify(opname) + 'Op.fragment.ts',
|
|
39
|
+
eject: ['// EJECT-START', '// EJECT-END'],
|
|
40
|
+
indent,
|
|
41
|
+
replace: {
|
|
42
|
+
...entrep,
|
|
43
|
+
SdkName: model.const.Name,
|
|
44
|
+
EntityName: entity.Name,
|
|
45
|
+
entityname: entity.name,
|
|
46
|
+
PATH: entop.path,
|
|
47
|
+
"['PATHALT']": entop.pathalt,
|
|
48
|
+
"['PARAM-LIST']": jsonify(Object.keys(entop.param)),
|
|
49
|
+
"{ 'ALIAS': 'MAP' }": aliasmap,
|
|
50
|
+
"'REQFORM'": formatJSONSrc(JSON.stringify(entop.reqform)),
|
|
51
|
+
"'RESFORM'": formatJSONSrc(JSON.stringify(entop.resform)),
|
|
52
|
+
"'VALIDATE'": formatJSONSrc(JSON.stringify(entop.validate)),
|
|
53
|
+
|
|
54
|
+
'#Feature-Hook': ({ name, indent }: any) =>
|
|
55
|
+
Content({ indent }, `
|
|
56
|
+
fres = featurehook(ctx, '${name}')
|
|
57
|
+
if (fres instanceof Promise) { await fres }
|
|
58
|
+
`)
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
EntityOperation
|
|
67
|
+
}
|