@kosdev-code/kos-codegen-core 3.0.16 → 3.0.18
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/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +404 -229
- package/index.js.map +1 -1
- package/index.mjs +404 -229
- package/index.mjs.map +1 -1
- package/lib/generators/augment/ts-toolkit.d.ts +16 -0
- package/lib/generators/augment/ts-toolkit.d.ts.map +1 -1
- package/lib/generators/ci-sync.d.ts.map +1 -1
- package/lib/generators/index.d.ts +2 -1
- package/lib/generators/index.d.ts.map +1 -1
- package/lib/generators/kab-targets.d.ts +54 -10
- package/lib/generators/kab-targets.d.ts.map +1 -1
- package/lib/generators/member-mutators/add-service-request.d.ts +18 -1
- package/lib/generators/member-mutators/add-service-request.d.ts.map +1 -1
- package/lib/generators/service-catalog.d.ts +39 -0
- package/lib/generators/service-catalog.d.ts.map +1 -0
- package/package.json +2 -2
- package/templates/kos-splash-project/project/project.json.template +1 -1
- package/templates/kos-splash-project/tools/splashtool.mjs.template +14 -1
- package/templates/polyglot-workspace/github/build-release.json.template +1 -1
- package/templates/polyglot-workspace/github/build-ui.json.template +1 -1
|
@@ -6,6 +6,12 @@ import { CodegenFileSystem } from '../../codegen-filesystem';
|
|
|
6
6
|
* so the caller's CodegenFileSystem (real or dry-run overlay) owns all I/O.
|
|
7
7
|
*/
|
|
8
8
|
export declare function transformSourceFile(codegenFs: CodegenFileSystem, filePath: string, mutate: (sf: SourceFile) => void): void;
|
|
9
|
+
/**
|
|
10
|
+
* Read a file via the filesystem abstraction and inspect it as a ts-morph
|
|
11
|
+
* SourceFile, writing nothing back. The read-only counterpart of
|
|
12
|
+
* `transformSourceFile`, for discovery over generated declarations.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readSourceFile<T>(codegenFs: CodegenFileSystem, filePath: string, inspect: (sf: SourceFile) => T): T;
|
|
9
15
|
/** A named import to ensure on a module: the symbol and whether it is type-only. */
|
|
10
16
|
export interface NamedImportSpec {
|
|
11
17
|
name: string;
|
|
@@ -51,6 +57,15 @@ export declare function ensureDeclarationMerge(sourceFile: SourceFile, interface
|
|
|
51
57
|
* Call LAST in a mutation — it uses raw text insertion and invalidates node refs.
|
|
52
58
|
*/
|
|
53
59
|
export declare function ensureFileEslintDisable(sourceFile: SourceFile, rule: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Add a module-level `const` after the import block, idempotently. Returns true
|
|
62
|
+
* if added. Used for endpoint descriptors, which must sit outside the class so
|
|
63
|
+
* `typeof NAME` can be referenced from a parameter type.
|
|
64
|
+
*/
|
|
65
|
+
export declare function ensureModuleConst(sourceFile: SourceFile, spec: {
|
|
66
|
+
name: string;
|
|
67
|
+
initializer: string;
|
|
68
|
+
}): boolean;
|
|
54
69
|
/** A decorated method to add to a model class. */
|
|
55
70
|
export interface DecoratedMethodSpec {
|
|
56
71
|
name: string;
|
|
@@ -59,6 +74,7 @@ export interface DecoratedMethodSpec {
|
|
|
59
74
|
parameters?: {
|
|
60
75
|
name: string;
|
|
61
76
|
type?: string;
|
|
77
|
+
optional?: boolean;
|
|
62
78
|
}[];
|
|
63
79
|
returnType?: string;
|
|
64
80
|
isAsync?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-toolkit.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/ts-toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"ts-toolkit.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/ts-toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAML,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;GAIG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C;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAQD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAkBT;AAED,iDAAiD;AACjD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAW1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-sync.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/ci-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ci-sync.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/ci-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,UAAU,EAAE;QAAE,EAAE,EAAE,kBAAkB,EAAE,CAAC;QAAC,IAAI,EAAE,kBAAkB,EAAE,CAAA;KAAE,CAAC;CACtE;AAgBD,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,iBAAiB,GAC3B,kBAAkB,EAAE,CAyDtB;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,iBAAiB,GAC3B,kBAAkB,EAAE,CAsBtB;AAkDD,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,GAAE,aAAkB,GAC1B,YAAY,CAmBd"}
|
|
@@ -4,7 +4,8 @@ export { generatePolyglotWorkspace, type PolyglotWorkspaceOptions, type Polyglot
|
|
|
4
4
|
export { syncCiManifests, discoverUiArtifacts, discoverJavaArtifacts, type CiSyncOptions, type CiSyncResult, type CiSyncManifestResult, type DiscoveredArtifact, } from './ci-sync';
|
|
5
5
|
export { ensureJavaAggregatorPom, type EnsureJavaAggregatorOptions, finalizeArchetypeModule, type FinalizeArchetypeModuleOptions, addJavaArtifactToManifests, type AddJavaArtifactOptions, } from './java-workspace';
|
|
6
6
|
export { normalizeOptions, type KosBaseGeneratorOptions, type NormalizedOptions, } from './normalize-options';
|
|
7
|
-
export { buildKabTargets, buildSbomTarget, type KabTargetsOptions, type KabTargetDefinition, UPDATE_RELEASE_VERSION_SCRIPT_PATH, } from './kab-targets';
|
|
7
|
+
export { buildKabTargets, buildSbomTarget, resolveKabPath, KAB_OUTPUT_DIR, KAB_OUTPUT_PATH, type KabTargetsOptions, type KabTargetDefinition, UPDATE_RELEASE_VERSION_SCRIPT_PATH, } from './kab-targets';
|
|
8
|
+
export { listServiceCatalog, type ServiceCatalogEntry, type ServiceCatalogQuery, type ServiceOperation, type CatalogMethod, } from './service-catalog';
|
|
8
9
|
export { UPDATE_RELEASE_VERSION_SCRIPT } from './release-version-script';
|
|
9
10
|
export { appendBarrelExport } from './barrel-utils';
|
|
10
11
|
export { updateModelIndex } from './update-model-index';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EACL,yBAAyB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,uBAAuB,EACvB,KAAK,2BAA2B,EAChC,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,0BAA0B,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,kCAAkC,GACnC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/index.ts"],"names":[],"mappings":"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B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -2,11 +2,31 @@
|
|
|
2
2
|
* Shared KOS artifact-target bundle.
|
|
3
3
|
*
|
|
4
4
|
* Every project that packages a KAB gets the same target family:
|
|
5
|
-
* kab — kabtool build + list (dependsOn zip
|
|
6
|
-
* zip — archiver (dependsOn build [+ descriptor])
|
|
5
|
+
* kab — kabtool build + list (dependsOn zip)
|
|
6
|
+
* zip — archiver (dependsOn build, sbom [+ descriptor])
|
|
7
7
|
* descriptor — descriptor.mjs (optional; apps/plugins/content/i18n)
|
|
8
8
|
* version — stamps the release version into the project's `.kos.json`
|
|
9
|
-
* sbom — SPDX SBOM (pruned lockfile)
|
|
9
|
+
* sbom — SPDX SBOM (pruned lockfile), packaged inside the KAB
|
|
10
|
+
*
|
|
11
|
+
* ARTIFACT LAYOUT: the KAB and ui.zip land in `{projectRoot}/target/` — a peer
|
|
12
|
+
* of the project's `src/`, the same place the Maven half of a polyglot repo
|
|
13
|
+
* drops its KABs (`java/<module>/target/*.kab`). A project's artifacts sit
|
|
14
|
+
* beside the sources that produced them rather than in a workspace-wide
|
|
15
|
+
* `dist/archives/` tree.
|
|
16
|
+
*
|
|
17
|
+
* `descriptor` and `sbom` write to the project's BUILD output dir
|
|
18
|
+
* (`dist/{projectRoot}`) instead, because archiver zips that directory
|
|
19
|
+
* wholesale: both have to end up INSIDE ui.zip — and therefore inside the KAB
|
|
20
|
+
* — rather than beside it. An SBOM that shipped next to the KAB would not
|
|
21
|
+
* travel with the distribution, which is the entire reason it is generated.
|
|
22
|
+
* That is also why `zip` (not `kab`) is what depends on `sbom`: by the time
|
|
23
|
+
* kabtool runs, the zip it packages is already sealed.
|
|
24
|
+
*
|
|
25
|
+
* Paths are written as Nx `{projectRoot}` tokens so `nx move` needs no
|
|
26
|
+
* rewrite. Nx does NOT interpolate arbitrary target options, so the scripts
|
|
27
|
+
* that read these (kabtool.mjs, archiver.js, descriptor.mjs, splashtool.mjs)
|
|
28
|
+
* and the sbom executor expand the token themselves against the project's
|
|
29
|
+
* root — see `resolveTargetPath` in each script.
|
|
10
30
|
*
|
|
11
31
|
* The `version` target is KOS *artifact* versioning: it rewrites the
|
|
12
32
|
* `version` field of the project's `.kos.json` (which kabtool/descriptor bake
|
|
@@ -17,17 +37,35 @@
|
|
|
17
37
|
* kab and version are deliberately produced by ONE helper so no generator can
|
|
18
38
|
* emit a KAB-packaging project that is not release-versionable.
|
|
19
39
|
*/
|
|
40
|
+
/** Directory, under each project root, that holds the project's KAB artifacts. */
|
|
41
|
+
export declare const KAB_OUTPUT_DIR = "target";
|
|
42
|
+
/**
|
|
43
|
+
* Archive directory for every KAB-producing project — `{projectRoot}/target/`.
|
|
44
|
+
*
|
|
45
|
+
* Deliberately a token rather than a resolved path: a project that moves keeps
|
|
46
|
+
* working without anyone rewriting its project.json. Consumers expand it with
|
|
47
|
+
* `resolveKabPath` (or its per-script equivalent) before touching the disk.
|
|
48
|
+
*/
|
|
49
|
+
export declare const KAB_OUTPUT_PATH = "{projectRoot}/target/";
|
|
50
|
+
/**
|
|
51
|
+
* Expand the Nx path tokens KOS artifact targets use in their options.
|
|
52
|
+
*
|
|
53
|
+
* Nx interpolates `{projectRoot}`/`{workspaceRoot}` in a target's `outputs`,
|
|
54
|
+
* never in arbitrary `options`, and the KAB scripts read those options straight
|
|
55
|
+
* off the cached project graph — so expansion is on us. The result stays
|
|
56
|
+
* workspace-root-relative (the cwd Nx runs commands from) unless the token was
|
|
57
|
+
* `{workspaceRoot}`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveKabPath(value: string, projectRoot: string): string;
|
|
20
60
|
export interface KabTargetsOptions {
|
|
21
61
|
/** Project name as Nx knows it (argument to kabtool/archiver/descriptor). */
|
|
22
62
|
name: string;
|
|
23
|
-
/** Subdirectory of dist/archives/ the KAB lands in. Default: "packages". */
|
|
24
|
-
archiveDir?: string;
|
|
25
63
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
64
|
+
* Emit a `descriptor` target (and make `zip` depend on it). Its
|
|
65
|
+
* descriptor.json is written into the build output dir so the zip contains
|
|
66
|
+
* it. Omit for projects without a descriptor (themes).
|
|
29
67
|
*/
|
|
30
|
-
|
|
68
|
+
descriptor?: boolean;
|
|
31
69
|
/** Build target `zip` depends on. Default: "build" (plugins: "build:production"). */
|
|
32
70
|
buildTarget?: string;
|
|
33
71
|
}
|
|
@@ -43,12 +81,18 @@ export interface KabTargetDefinition {
|
|
|
43
81
|
export declare const UPDATE_RELEASE_VERSION_SCRIPT_PATH = "tools/scripts/update-release-version.mjs";
|
|
44
82
|
export declare function buildKabTargets(options: KabTargetsOptions): Record<string, KabTargetDefinition>;
|
|
45
83
|
export interface SbomTargetOptions {
|
|
46
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Directory the SBOM lands in. `dist/{projectRoot}` — the build output dir
|
|
86
|
+
* archiver zips — so the SBOM ships inside the KAB.
|
|
87
|
+
*/
|
|
47
88
|
outputPath: string;
|
|
48
89
|
}
|
|
49
90
|
/**
|
|
50
91
|
* SBOM target for any artifact-producing project. Standalone so migrations
|
|
51
92
|
* can retrofit it onto existing projects without rebuilding the kab bundle.
|
|
93
|
+
*
|
|
94
|
+
* Whatever consumes this must order it BEFORE `zip`; an SBOM written after the
|
|
95
|
+
* zip is sealed never reaches the KAB.
|
|
52
96
|
*/
|
|
53
97
|
export declare function buildSbomTarget({ outputPath, }: SbomTargetOptions): KabTargetDefinition;
|
|
54
98
|
//# sourceMappingURL=kab-targets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kab-targets.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/kab-targets.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kab-targets.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/kab-targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,kFAAkF;AAClF,eAAO,MAAM,cAAc,WAAW,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,0BAAqC,CAAC;AAElE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAKzE;AAED,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,kCAAkC,6CACH,CAAC;AAE7C,wBAAgB,eAAe,CAC7B,OAAO,EAAE,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAoDrC;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,GACX,EAAE,iBAAiB,GAAG,mBAAmB,CAezC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CodegenFileSystem } from '../../codegen-filesystem';
|
|
2
2
|
import { ProjectConfiguration } from '../../project-discovery';
|
|
3
|
+
export type ServiceRequestMode = "lifecycle" | "method";
|
|
3
4
|
export interface AddServiceRequestOptions {
|
|
4
5
|
modelName: string;
|
|
5
6
|
modelProject: string;
|
|
@@ -9,15 +10,31 @@ export interface AddServiceRequestOptions {
|
|
|
9
10
|
servicePath: string;
|
|
10
11
|
/** HTTP method. Default `get`. */
|
|
11
12
|
method?: string;
|
|
12
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Which form to emit. Defaults to `lifecycle` when `lifecycle` is supplied and
|
|
15
|
+
* `method` otherwise — the same rule @kosServiceRequest applies at runtime.
|
|
16
|
+
*/
|
|
17
|
+
mode?: ServiceRequestMode;
|
|
18
|
+
/**
|
|
19
|
+
* DependencyLifecycle member name (LOAD, INIT, …). Only meaningful in
|
|
20
|
+
* `lifecycle` mode; defaults to `LOAD` there.
|
|
21
|
+
*/
|
|
13
22
|
lifecycle?: string;
|
|
14
23
|
/** Import specifier for the generated typed service module (relative to the model
|
|
15
24
|
* file). If omitted, auto-resolved when the project has exactly one. */
|
|
16
25
|
serviceModule?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Root-relative path of the service module, as `listServiceCatalog` reports
|
|
28
|
+
* it. Converted to an import specifier here, so a caller that picked an
|
|
29
|
+
* operation from the catalog does not have to compute one — and does not trip
|
|
30
|
+
* the "multiple service modules" error when a project types several versions.
|
|
31
|
+
*/
|
|
32
|
+
serviceModulePath?: string;
|
|
17
33
|
modelPath?: string;
|
|
18
34
|
}
|
|
19
35
|
export declare function addServiceRequestToModel(codegenFs: CodegenFileSystem, options: AddServiceRequestOptions, projects?: Map<string, ProjectConfiguration>): {
|
|
20
36
|
modelFilePath: string;
|
|
21
37
|
serviceModule: string;
|
|
38
|
+
mode: ServiceRequestMode;
|
|
22
39
|
};
|
|
23
40
|
//# sourceMappingURL=add-service-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-service-request.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/add-service-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-service-request.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/add-service-request.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAepE,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;6EACyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwBD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,wBAAwB,EACjC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAmJ5E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CodegenFileSystem } from '../codegen-filesystem';
|
|
2
|
+
import { ProjectConfiguration } from '../project-discovery';
|
|
3
|
+
/** HTTP methods a response type can be derived for (lowercase, as spec'd). */
|
|
4
|
+
declare const CATALOG_METHODS: readonly ["get", "put", "post", "delete", "patch"];
|
|
5
|
+
export type CatalogMethod = (typeof CATALOG_METHODS)[number];
|
|
6
|
+
export interface ServiceOperation {
|
|
7
|
+
/** OpenAPI path, e.g. `/api/board/{id}`. */
|
|
8
|
+
path: string;
|
|
9
|
+
method: CatalogMethod;
|
|
10
|
+
/** The spec's `summary`, when it had one. */
|
|
11
|
+
summary?: string;
|
|
12
|
+
/** Names of the `{…}` placeholders the path declares, in order. */
|
|
13
|
+
pathParams: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ServiceCatalogEntry {
|
|
16
|
+
/** App segment of the services dir, e.g. `dispense`. */
|
|
17
|
+
app: string;
|
|
18
|
+
/** Version segment, e.g. `daily` or `1.9.x`. */
|
|
19
|
+
version: string;
|
|
20
|
+
/** Root-relative path of the generated service module (with extension). */
|
|
21
|
+
serviceModulePath: string;
|
|
22
|
+
operations: ServiceOperation[];
|
|
23
|
+
}
|
|
24
|
+
export interface ServiceCatalogQuery {
|
|
25
|
+
/** Project whose generated types to read. */
|
|
26
|
+
modelProject: string;
|
|
27
|
+
/** Limit to one app segment (e.g. `dispense`). */
|
|
28
|
+
app?: string;
|
|
29
|
+
/** Limit to one version segment (e.g. `daily`). */
|
|
30
|
+
version?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* List every generated service module in a project and the operations it types.
|
|
34
|
+
* Returns an empty array when the project has no generated types — the caller
|
|
35
|
+
* should tell the user to run `api:generate`, not treat it as "no endpoints".
|
|
36
|
+
*/
|
|
37
|
+
export declare function listServiceCatalog(codegenFs: CodegenFileSystem, query: ServiceCatalogQuery, projects?: Map<string, ProjectConfiguration>): ServiceCatalogEntry[];
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=service-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-catalog.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/service-catalog.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,8EAA8E;AAC9E,QAAA,MAAM,eAAe,oDAAqD,CAAC;AAC3E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAID,MAAM,WAAW,mBAAmB;IAClC,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,mBAAmB,EAC1B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,mBAAmB,EAAE,CAiCvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-codegen-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.18",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"kos": {
|
|
27
27
|
"build": {
|
|
28
|
-
"gitHash": "
|
|
28
|
+
"gitHash": "73541b64a3b84967ded025956dd8a6f29eca4371"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"splash": {
|
|
8
8
|
"command": "node tools/scripts/splashtool.mjs <%= nameDashCase %>",
|
|
9
9
|
"options": {
|
|
10
|
-
"outputPath": "
|
|
10
|
+
"outputPath": "{projectRoot}/target/",
|
|
11
11
|
"layerName": "<%= nameDashCase %>",
|
|
12
12
|
"startPath": "start.html"
|
|
13
13
|
}
|
|
@@ -20,7 +20,20 @@ const config = dotenv.config({
|
|
|
20
20
|
dotenvExpand.expand(config);
|
|
21
21
|
const splashOptions = project.data?.targets?.splash?.options;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Expand the Nx path tokens a KOS artifact target may use in its options.
|
|
25
|
+
* Nx interpolates {projectRoot} in a target's `outputs` but never in arbitrary
|
|
26
|
+
* `options`, and this script reads the options straight off the cached graph.
|
|
27
|
+
*/
|
|
28
|
+
function resolveTargetPath(value) {
|
|
29
|
+
if (!value) return value;
|
|
30
|
+
return value
|
|
31
|
+
.replace(/\{projectRoot\}/g, project.data.root)
|
|
32
|
+
.replace(/\{workspaceRoot\}\/?/g, '');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const { layerName, startPath } = splashOptions;
|
|
36
|
+
const outputPath = resolveTargetPath(splashOptions.outputPath);
|
|
24
37
|
const installPath = process.env.KOS_INSTALL_PATH;
|
|
25
38
|
if (!fs.existsSync(outputPath)) {
|
|
26
39
|
fs.mkdirSync(outputPath, { recursive: true });
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"artifacts": [<% if (hasUi) { %>
|
|
7
7
|
{
|
|
8
8
|
"id": "<%= appUiName %>",
|
|
9
|
-
"filename": "ui/
|
|
9
|
+
"filename": "ui/apps/<%= appUiName %>/target/<%= appUiName %>.kab",
|
|
10
10
|
"artifactstore": "kos-cdn",
|
|
11
11
|
"marketplace": 1
|
|
12
12
|
}<% } %>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"artifacts": [<% if (hasUi) { %>
|
|
6
6
|
{
|
|
7
7
|
"id": "<%= appUiName %>",
|
|
8
|
-
"filename": "ui/
|
|
8
|
+
"filename": "ui/apps/<%= appUiName %>/target/<%= appUiName %>.kab",
|
|
9
9
|
"artifactstore": "kos-cdn",
|
|
10
10
|
"marketplace": 1
|
|
11
11
|
}<% } %>
|