@kosdev-code/kos-codegen-core 0.1.0-next.871 → 0.1.0-next.894
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 +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +872 -335
- package/index.js.map +1 -1
- package/index.mjs +873 -336
- package/index.mjs.map +1 -1
- package/lib/generators/add-container-support/generate-add-container-support.d.ts +14 -0
- package/lib/generators/add-container-support/generate-add-container-support.d.ts.map +1 -1
- package/lib/generators/add-parent-aware/generate-add-parent-aware.d.ts +15 -0
- package/lib/generators/add-parent-aware/generate-add-parent-aware.d.ts.map +1 -0
- package/lib/generators/add-parent-aware/index.d.ts +2 -0
- package/lib/generators/add-parent-aware/index.d.ts.map +1 -0
- package/lib/generators/augment/find-model-declaration.d.ts +4 -0
- package/lib/generators/augment/find-model-declaration.d.ts.map +1 -0
- package/lib/generators/augment/resolve-child-model.d.ts +16 -0
- package/lib/generators/augment/resolve-child-model.d.ts.map +1 -0
- package/lib/generators/augment/resolve-model-file.d.ts.map +1 -1
- package/lib/generators/augment/ts-toolkit.d.ts +25 -1
- package/lib/generators/augment/ts-toolkit.d.ts.map +1 -1
- package/lib/generators/describe/describe-model.d.ts.map +1 -1
- package/lib/generators/generate-container-model.d.ts +7 -0
- package/lib/generators/generate-container-model.d.ts.map +1 -1
- package/lib/generators/generate-model-project.d.ts +36 -0
- package/lib/generators/generate-model-project.d.ts.map +1 -0
- package/lib/generators/generate-view-model.d.ts +27 -0
- package/lib/generators/generate-view-model.d.ts.map +1 -0
- package/lib/generators/index.d.ts +21 -16
- package/lib/generators/index.d.ts.map +1 -1
- package/lib/generators/member-mutators/add-child.d.ts +10 -2
- package/lib/generators/member-mutators/add-child.d.ts.map +1 -1
- package/lib/generators/member-mutators/add-service-request.d.ts.map +1 -1
- package/lib/generators/normalize-options.d.ts +2 -0
- package/lib/generators/normalize-options.d.ts.map +1 -1
- package/lib/generators/registration/upsert-chain-entry.d.ts +13 -0
- package/lib/generators/registration/upsert-chain-entry.d.ts.map +1 -0
- package/package.json +2 -2
- package/templates/kos-container-model/model/types/index.d.ts.template +2 -2
- package/templates/kos-model/model/__nameDashCase__-model.ts.template +7 -4
- package/templates/kos-model-project/project/.eslintrc.json.template +33 -0
- package/templates/kos-model-project/project/.kos.json.template +14 -0
- package/templates/kos-model-project/project/README.md.template +7 -0
- package/templates/kos-model-project/project/package.json.template +9 -0
- package/templates/kos-model-project/project/project.json.template +35 -0
- package/templates/kos-model-project/project/src/index.ts.template +1 -0
- package/templates/kos-model-project/project/src/lib/__projectName__.ts.template +3 -0
- package/templates/kos-model-project/project/tsconfig.json.template +20 -0
- package/templates/kos-model-project/project/tsconfig.lib.json.template +10 -0
- package/templates/kos-model-project/project/vite.config.ts.template +47 -0
- package/templates/kos-view-model/__nameDashCase__-view-model.ts.template +30 -0
- package/templates/kos-view-model/index.ts.template +1 -0
|
@@ -11,6 +11,20 @@ export interface AddContainerSupportOptions {
|
|
|
11
11
|
sortKey?: string;
|
|
12
12
|
/** Explicit model file path (relative to root), overriding resolution. */
|
|
13
13
|
modelPath?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Module the `childType` is imported from, when it is a model type rather
|
|
16
|
+
* than the SDK default. Without it a caller naming a concrete child type
|
|
17
|
+
* produces a file that references a type it never imports.
|
|
18
|
+
*/
|
|
19
|
+
childTypeModule?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Name of the model the container holds. Resolves to `<ProperCase>Model` and
|
|
22
|
+
* to the module that exports it, so the caller does not have to know whether
|
|
23
|
+
* that is a relative path or the child project's package name.
|
|
24
|
+
*/
|
|
25
|
+
childModel?: string;
|
|
26
|
+
/** Project owning `childModel`. Defaults to the container model's project. */
|
|
27
|
+
childModelProject?: string;
|
|
14
28
|
}
|
|
15
29
|
/**
|
|
16
30
|
* Add `@kosContainerAware` support to an existing model file.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-add-container-support.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-container-support/generate-add-container-support.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-add-container-support.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-container-support/generate-add-container-support.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAajC,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAeD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,0BAA0B,EACnC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAgF3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CodegenFileSystem } from '../../codegen-filesystem';
|
|
2
|
+
import { ProjectConfiguration } from '../../project-discovery';
|
|
3
|
+
export interface AddParentAwareOptions {
|
|
4
|
+
modelName: string;
|
|
5
|
+
modelProject: string;
|
|
6
|
+
/** Options key holding the parent id. Defaults to the SDK's own key. */
|
|
7
|
+
parentId?: string;
|
|
8
|
+
/** Explicit model file path (relative to root), overriding resolution. */
|
|
9
|
+
modelPath?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function addParentAwareToModel(codegenFs: CodegenFileSystem, options: AddParentAwareOptions, projects?: Map<string, ProjectConfiguration>): {
|
|
12
|
+
modelFilePath: string;
|
|
13
|
+
optionsFilePath?: string;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=generate-add-parent-aware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-add-parent-aware.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-parent-aware/generate-add-parent-aware.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAUpE,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CAsCrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-parent-aware/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CodegenFileSystem } from '../../codegen-filesystem';
|
|
2
|
+
/** The single file declaring one of `typeIds`; null when none, throws on ambiguity. */
|
|
3
|
+
export declare function findModelDeclarationFile(codegenFs: CodegenFileSystem, searchRoot: string, typeIds: string[]): string | null;
|
|
4
|
+
//# sourceMappingURL=find-model-declaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-model-declaration.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/find-model-declaration.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,uFAAuF;AACvF,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,iBAAiB,EAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EAAE,GAChB,MAAM,GAAG,IAAI,CA0Bf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CodegenFileSystem } from '../../codegen-filesystem';
|
|
2
|
+
import { ProjectConfiguration } from '../../project-discovery';
|
|
3
|
+
export interface ChildModelQuery {
|
|
4
|
+
/** Model the child is being added to; its file anchors a relative import. */
|
|
5
|
+
modelFilePath: string;
|
|
6
|
+
/** Project owning the model being edited. */
|
|
7
|
+
modelProject: string;
|
|
8
|
+
childModel: string;
|
|
9
|
+
/** Project owning `childModel`. Defaults to `modelProject`. */
|
|
10
|
+
childModelProject?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function resolveChildModelType(codegenFs: CodegenFileSystem, query: ChildModelQuery, projects?: Map<string, ProjectConfiguration>): {
|
|
13
|
+
childType: string;
|
|
14
|
+
childTypeModule?: string;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=resolve-child-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-child-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/resolve-child-model.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,aAAa,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,eAAe,EACtB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CA2BjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-model-file.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/resolve-model-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-model-file.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/resolve-model-file.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,EAC5B,KAAK,EAAE,cAAc,EACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CA6DnE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClassDeclaration, SourceFile } from 'ts-morph';
|
|
2
2
|
import { CodegenFileSystem } from '../../codegen-filesystem';
|
|
3
3
|
/**
|
|
4
4
|
* Read a file via the filesystem abstraction, apply an AST mutation, write it back.
|
|
@@ -12,6 +12,12 @@ export declare function transformSourceFile(codegenFs: CodegenFileSystem, filePa
|
|
|
12
12
|
* `transformSourceFile`, for discovery over generated declarations.
|
|
13
13
|
*/
|
|
14
14
|
export declare function readSourceFile<T>(codegenFs: CodegenFileSystem, filePath: string, inspect: (sf: SourceFile) => T): T;
|
|
15
|
+
/**
|
|
16
|
+
* The object-literal text of a class decorator's first argument, whether written
|
|
17
|
+
* inline or passed as a same-file const. Generated models name the config so a
|
|
18
|
+
* derived type can read it; hand-written ones inline it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function decoratorConfigText(sourceFile: SourceFile, cls: ClassDeclaration, decoratorName: string): string | undefined;
|
|
15
21
|
/** A named import to ensure on a module: the symbol and whether it is type-only. */
|
|
16
22
|
export interface NamedImportSpec {
|
|
17
23
|
name: string;
|
|
@@ -104,6 +110,24 @@ export declare function ensureExportedMapper(sourceFile: SourceFile, spec: {
|
|
|
104
110
|
}): boolean;
|
|
105
111
|
/** Add `export * from "<moduleSpecifier>"` unless the barrel already has it. */
|
|
106
112
|
export declare function ensureBarrelExport(sourceFile: SourceFile, moduleSpecifier: string): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Add named exports for a module to a barrel, creating the export declaration
|
|
115
|
+
* when the module is not exported yet and appending only the missing names when
|
|
116
|
+
* it is. Value and type exports are kept as separate declarations so a type-only
|
|
117
|
+
* export is not widened into a value export.
|
|
118
|
+
*
|
|
119
|
+
* Returns true if the file changed.
|
|
120
|
+
*/
|
|
121
|
+
export declare function ensureNamedExports(sourceFile: SourceFile, moduleSpecifier: string, names: string[], isTypeOnly?: boolean): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Add an exported interface to a declarations file, leaving any existing
|
|
124
|
+
* declaration untouched. Returns true if the interface was added.
|
|
125
|
+
*/
|
|
126
|
+
export declare function ensureExportedInterface(sourceFile: SourceFile, name: string, properties?: {
|
|
127
|
+
name: string;
|
|
128
|
+
type: string;
|
|
129
|
+
hasQuestionToken?: boolean;
|
|
130
|
+
}[], extendsTypes?: string[]): boolean;
|
|
107
131
|
/** A decorated method to add to a model class. */
|
|
108
132
|
export interface DecoratedMethodSpec {
|
|
109
133
|
name: string;
|
|
@@ -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,EAOL,KAAK,gBAAgB,EAErB,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,IAAI,GAC/B,IAAI,CAiBN;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,CAAC,GAC7B,CAAC,CASH;AAED;;;;GAIG;AACH,wBAAgB,mBAA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AC,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":"describe-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/describe/describe-model.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"describe-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/describe/describe-model.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAIpE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2FAA2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,6CAA6C;IAC7C,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,6CAA6C;IAC7C,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,2DAA2D;IAC3D,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,+CAA+C;IAC/C,eAAe,EAAE,eAAe,EAAE,CAAC;IACnC,wCAAwC;IACxC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,iDAAiD;IACjD,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AA8CD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,gBAAgB,CA8DlB"}
|
|
@@ -5,6 +5,13 @@ export interface ContainerModelOptions extends KosBaseGeneratorOptions {
|
|
|
5
5
|
modelName?: string;
|
|
6
6
|
singleton?: boolean;
|
|
7
7
|
autoRegister?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The model folder already exists and holds a written model, so the container
|
|
10
|
+
* is ADDED to it: only the container model file is rendered, and the folder's
|
|
11
|
+
* types and barrel are edited in place. Rendering the whole template set here
|
|
12
|
+
* would overwrite the model's own options interface and barrel.
|
|
13
|
+
*/
|
|
14
|
+
existingModel?: boolean;
|
|
8
15
|
}
|
|
9
16
|
/**
|
|
10
17
|
* Generate a container model.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-container-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-container-model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-container-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-container-model.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAS/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAOjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,qBAAqB,EAC9B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,IAAI,CAsFN"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CodegenFileSystem } from '../codegen-filesystem';
|
|
2
|
+
/** Directory model libraries live under when the workspace declares no libsDir. */
|
|
3
|
+
export declare const DEFAULT_MODEL_LIBS_DIR = "libs";
|
|
4
|
+
export interface ModelProjectOptions {
|
|
5
|
+
/** Base name; the `-models` suffix is appended unless already present. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Workspace `workspaceLayout.libsDir`, when the workspace declares one. */
|
|
8
|
+
libsDir?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ModelProjectLayout {
|
|
11
|
+
/** Nx project name, e.g. `acme-models`. */
|
|
12
|
+
projectName: string;
|
|
13
|
+
/** Project root relative to the workspace root, e.g. `libs/acme-models`. */
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
/** TypeScript path alias the workspace maps to the lib, e.g. `@acme/acme-models`. */
|
|
16
|
+
importPath: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve where a model project lands and what it is called.
|
|
20
|
+
*
|
|
21
|
+
* `importPath` needs the workspace's npm scope, so the root package.json is
|
|
22
|
+
* read when one is reachable; a workspace without a scoped name maps the lib
|
|
23
|
+
* under its bare project name, matching Nx's own import-path rule.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveModelProjectLayout(codegenFs: CodegenFileSystem | null, options: ModelProjectOptions): ModelProjectLayout;
|
|
26
|
+
/**
|
|
27
|
+
* Generate a KOS model project.
|
|
28
|
+
*
|
|
29
|
+
* @param codegenFs - Target filesystem
|
|
30
|
+
* @param templateDir - Absolute path to the template directory containing a
|
|
31
|
+
* `project/` subdirectory
|
|
32
|
+
* @param options - Generator options
|
|
33
|
+
* @returns Where the project landed, what it is named, and its import path
|
|
34
|
+
*/
|
|
35
|
+
export declare function generateModelProject(codegenFs: CodegenFileSystem, templateDir: string, options: ModelProjectOptions): ModelProjectLayout;
|
|
36
|
+
//# sourceMappingURL=generate-model-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-model-project.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-model-project.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAQ/D,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAS7C,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iBAAiB,GAAG,IAAI,EACnC,OAAO,EAAE,mBAAmB,GAC3B,kBAAkB,CAepB;AAuBD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,mBAAmB,GAC3B,kBAAkB,CAmBpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CodegenFileSystem } from '../codegen-filesystem';
|
|
2
|
+
import { ProjectConfiguration } from '../project-discovery';
|
|
3
|
+
import { KosBaseGeneratorOptions } from './normalize-options';
|
|
4
|
+
/** A KOS data model the ViewModel is built over. */
|
|
5
|
+
export interface ViewModelSource {
|
|
6
|
+
/** Model name, e.g. `beverage-container`. */
|
|
7
|
+
model: string;
|
|
8
|
+
/** Project owning the model. Defaults to the ViewModel's own project. */
|
|
9
|
+
project?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ViewModelOptions extends KosBaseGeneratorOptions {
|
|
12
|
+
/** Models passed to the constructor, in declaration order. Empty is valid. */
|
|
13
|
+
models?: ViewModelSource[];
|
|
14
|
+
/** `@kosViewModel` typeId. Defaults to the dash-case name. */
|
|
15
|
+
typeId?: string;
|
|
16
|
+
/** Register the instance with KOS DevTools. */
|
|
17
|
+
devToolsEnabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ViewModelResult {
|
|
20
|
+
/** Path of the ViewModel file, whether or not this call wrote it. */
|
|
21
|
+
viewModelFilePath: string;
|
|
22
|
+
/** False when the file already existed, in which case nothing was written. */
|
|
23
|
+
created: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Generate a ViewModel. */
|
|
26
|
+
export declare function generateViewModel(codegenFs: CodegenFileSystem, templateDir: string, options: ViewModelOptions, cwd: string, projects?: Map<string, ProjectConfiguration>): ViewModelResult;
|
|
27
|
+
//# sourceMappingURL=generate-view-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-view-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-view-model.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAG7B,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC/D,8EAA8E;IAC9E,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;CAClB;AAWD,4BAA4B;AAC5B,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,eAAe,CA8FjB"}
|
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
export { generateSplashProject, type SplashProjectOptions, } from './generate-splash-project';
|
|
2
|
+
export { DEFAULT_MODEL_LIBS_DIR, generateModelProject, resolveModelProjectLayout, type ModelProjectLayout, type ModelProjectOptions, } from './generate-model-project';
|
|
2
3
|
export { generateInit, type KosInitOptions } from './generate-init';
|
|
3
4
|
export { generatePolyglotWorkspace, type PolyglotWorkspaceOptions, type PolyglotWorkspaceResult, } from './generate-polyglot-workspace';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
5
|
+
export { discoverJavaArtifacts, discoverUiArtifacts, syncCiManifests, type CiSyncManifestResult, type CiSyncOptions, type CiSyncResult, type DiscoveredArtifact, } from './ci-sync';
|
|
6
|
+
export { addJavaArtifactToManifests, ensureJavaAggregatorPom, finalizeArchetypeModule, type AddJavaArtifactOptions, type EnsureJavaAggregatorOptions, type FinalizeArchetypeModuleOptions, } from './java-workspace';
|
|
6
7
|
export { normalizeOptions, type KosBaseGeneratorOptions, type NormalizedOptions, } from './normalize-options';
|
|
7
|
-
export { buildKabTargets, buildSbomTarget,
|
|
8
|
-
export { listServiceCatalog, readServiceModuleOperations, type ServiceCatalogEntry, type ServiceCatalogQuery, type ServiceOperation, type CatalogMethod, } from './service-catalog';
|
|
8
|
+
export { buildKabTargets, buildSbomTarget, KAB_OUTPUT_DIR, KAB_OUTPUT_PATH, resolveKabPath, UPDATE_RELEASE_VERSION_SCRIPT_PATH, type KabTargetDefinition, type KabTargetsOptions, } from './kab-targets';
|
|
9
9
|
export { UPDATE_RELEASE_VERSION_SCRIPT } from './release-version-script';
|
|
10
|
+
export { listServiceCatalog, readServiceModuleOperations, type CatalogMethod, type ServiceCatalogEntry, type ServiceCatalogQuery, type ServiceOperation, } from './service-catalog';
|
|
10
11
|
export { appendBarrelExport } from './barrel-utils';
|
|
11
12
|
export { updateModelIndex } from './update-model-index';
|
|
12
|
-
export { generateHook, type HookOptions } from './generate-hook';
|
|
13
|
-
export { generateContext, type ContextOptions } from './generate-context';
|
|
14
|
-
export { generateContainerModel, type ContainerModelOptions, } from './generate-container-model';
|
|
15
13
|
export { generateCompanionModel, type CompanionModelOptions, } from './generate-companion-model';
|
|
16
|
-
export {
|
|
14
|
+
export { generateContainerModel, type ContainerModelOptions, } from './generate-container-model';
|
|
15
|
+
export { generateContext, type ContextOptions } from './generate-context';
|
|
16
|
+
export { generateHook, type HookOptions } from './generate-hook';
|
|
17
|
+
export { generateModel, type GenerateModelParams, type ModelOptions, } from './generate-model';
|
|
18
|
+
export { generateViewModel, type ViewModelOptions, type ViewModelResult, type ViewModelSource, } from './generate-view-model';
|
|
17
19
|
export { addFutureToModel, type AddFutureToModelOptions, type NormalizedAddFutureToModelOptions, } from './add-future-to-model';
|
|
18
20
|
export { addContainerSupportToModel, type AddContainerSupportOptions, } from './add-container-support';
|
|
19
|
-
export {
|
|
21
|
+
export { addParentAwareToModel, type AddParentAwareOptions, } from './add-parent-aware';
|
|
20
22
|
export { resolveModelFilePath, type ModelFileQuery, } from './augment/resolve-model-file';
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
23
|
+
export { addClassDecorator, addDecoratedMethod, addDecoratedProperty, addGetter, addPlainProperty, ensureDeclarationMerge, ensureFileEslintDisable, ensureNamedImport, getModelClass, resolveSdkModuleSpecifier, transformSourceFile, } from './augment/ts-toolkit';
|
|
24
|
+
export { describeModel, type DescribedMember, type DescribeModelOptions, type ModelDescription, } from './describe';
|
|
25
|
+
export { addChildToModel, addComputedToModel, addConfigPropertyToModel, addDependencyToModel, addModelEffectToModel, addPropertyToModel, addServiceRequestToModel, addTopicHandlerToModel, type AddChildOptions, type AddComputedOptions, type AddConfigPropertyOptions, type AddDependencyOptions, type AddModelEffectOptions, type AddPropertyOptions, type AddServiceRequestOptions, type AddServiceRequestResult, type AddTopicHandlerOptions, type ChildShape, type ServiceRequestMockMode, type UntypedEndpointDetails, type UntypedEndpointError, } from './member-mutators';
|
|
24
26
|
export { lookupSdkType, type LookupSdkTypeOptions, type SdkSymbolDeclaration, type SdkTypeLookupResult, } from './types';
|
|
27
|
+
export { validateModel, type ValidateModelOptions, type ValidationFinding, type ValidationResult, } from './validate';
|
|
25
28
|
export { generateComponent, type ComponentOptions, } from './component/generate-component';
|
|
26
|
-
export type { NormalizedComponentOptions, PluginConfiguration, PluginContribution, ExperienceConfig, PluginType, } from './component/types';
|
|
27
|
-
export { PLUGIN_TYPES, CONTRIBUTION_TYPE_MAP, LOCALIZED_PLUGIN_TYPES, KOS_JSON_PATHS, } from './component/types';
|
|
28
|
-
export { PluginHandlerFactory } from './component/plugin-handlers/factory';
|
|
29
|
-
export type { PluginHandler } from './component/plugin-handlers/base';
|
|
30
29
|
export { BasePluginHandler } from './component/plugin-handlers/base';
|
|
30
|
+
export type { PluginHandler } from './component/plugin-handlers/base';
|
|
31
|
+
export { PluginHandlerFactory } from './component/plugin-handlers/factory';
|
|
32
|
+
export { CONTRIBUTION_TYPE_MAP, KOS_JSON_PATHS, LOCALIZED_PLUGIN_TYPES, PLUGIN_TYPES, } from './component/types';
|
|
33
|
+
export type { ExperienceConfig, NormalizedComponentOptions, PluginConfiguration, PluginContribution, PluginType, } from './component/types';
|
|
31
34
|
export { KosConfigBuilder } from './component/utils/kos-config-builder';
|
|
32
35
|
export { ValidationError } from './component/utils/validation';
|
|
36
|
+
export { countChainEntries, upsertChainEntry, } from './registration/upsert-chain-entry';
|
|
37
|
+
export type { UpsertChainEntryResult } from './registration/upsert-chain-entry';
|
|
33
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,
|
|
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,EACL,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAC;AAElC,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,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,GACpC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,6BAA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AAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -6,8 +6,16 @@ export interface AddChildOptions {
|
|
|
6
6
|
modelProject: string;
|
|
7
7
|
/** Property name that holds the child(ren), e.g. `pages`, `pump`, `sensors`. */
|
|
8
8
|
propertyName: string;
|
|
9
|
-
/** Child model TS type, e.g. `PageModel`. */
|
|
10
|
-
childType
|
|
9
|
+
/** Child model TS type, e.g. `PageModel`. Derived when `childModel` is given. */
|
|
10
|
+
childType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Name of the child model. Resolves to `<ProperCase>Model` and to the module
|
|
13
|
+
* that exports it, so the caller does not have to know whether that is a
|
|
14
|
+
* relative path or the child project's package name.
|
|
15
|
+
*/
|
|
16
|
+
childModel?: string;
|
|
17
|
+
/** Project owning `childModel`. Defaults to the parent model's project. */
|
|
18
|
+
childModelProject?: string;
|
|
11
19
|
/** How the child(ren) are held. Default `single`. */
|
|
12
20
|
shape?: ChildShape;
|
|
13
21
|
/** Package that owns the child model; when set, its type is imported from the root. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-child.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/add-child.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"add-child.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/add-child.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAYpE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAgF3B"}
|
|
@@ -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":"AA+CA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AA6BpE,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjE,MAAM,WAAW,wBAAwB;IACvC,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;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,wBAAwB,EAAE,OAAO,CAAC;IAClC,+DAA+D;IAC/D,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,8EAA8E;IAC9E,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,0EAA0E;AAC1E,MAAM,WAAW,oBAAqB,SAAQ,KAAK;IACjD,OAAO,EAAE,sBAAsB,CAAC;CACjC;
|
|
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":"AA+CA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AA6BpE,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjE,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;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,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AAC;CACjC;AAgTD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,wBAAwB,EACjC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,uBAAuB,CAsXzB"}
|
|
@@ -11,6 +11,8 @@ export interface KosBaseGeneratorOptions {
|
|
|
11
11
|
companionModelProject?: string;
|
|
12
12
|
companionPattern?: "composition" | "decorator";
|
|
13
13
|
futureAware?: "none" | "minimal" | "complete";
|
|
14
|
+
/** Absent is a legacy third state in @kosModel, so generated models always state it. */
|
|
15
|
+
singleton?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export type NormalizedOptions<T extends KosBaseGeneratorOptions> = T & {
|
|
16
18
|
nameDashCase: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/normalize-options.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gBAAgB,CAAC,EAAE,aAAa,GAAG,WAAW,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/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C;AAEF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,uBAAuB,EAChE,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,CAAC,EACV,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,iBAAiB,CAAC,CAAC,CAAC,CAwDtB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UpsertChainEntryResult {
|
|
2
|
+
changed: boolean;
|
|
3
|
+
/** The full file text after the edit (only when `changed`). */
|
|
4
|
+
content?: string;
|
|
5
|
+
/** Whether an import for the bean had to be added (only when `changed`). */
|
|
6
|
+
importAdded?: boolean;
|
|
7
|
+
note?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Number of `.model(...)` entries in a chain file. */
|
|
11
|
+
export declare function countChainEntries(content: string): number;
|
|
12
|
+
export declare function upsertChainEntry(content: string, bean: string, importSpec: string): UpsertChainEntryResult;
|
|
13
|
+
//# sourceMappingURL=upsert-chain-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upsert-chain-entry.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/registration/upsert-chain-entry.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwCD,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,GACjB,sBAAsB,CA4CxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-codegen-core",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.894",
|
|
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": "603ba7e1c76ba75bf9c65d06f9d7e2dc1a2e8be3"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
<% if (parentAware) { %>import type {KosParentAware} from "@kosdev-code/kos-ui-sdk";<% } %>
|
|
2
|
+
<% if (locals.parentAware) { %>import type {KosParentAware} from "@kosdev-code/kos-ui-sdk";<% } %>
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
// --------------- <%= modelNameProperCase %> ---------------
|
|
6
6
|
|
|
7
|
-
export interface <%= modelNameProperCase %>Options <% if (parentAware) { %>extends KosParentAware<% } %> {
|
|
7
|
+
export interface <%= modelNameProperCase %>Options <% if (locals.parentAware) { %>extends KosParentAware<% } %> {
|
|
8
8
|
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
IKosDataModel,
|
|
10
10
|
KosContextLogger
|
|
11
11
|
} from "../../../core/core/kosModel";
|
|
12
|
-
import type {
|
|
12
|
+
import type { KosRegistrationFor } from "../../../core/core/registration/model-registration";
|
|
13
13
|
import type { IKosIdentifiable } from "../../../core/core/types";
|
|
14
14
|
import type { PublicModelInterface } from "../../../core/types";
|
|
15
15
|
<% if (hasFutureSupport) { %>import type {
|
|
@@ -17,7 +17,7 @@ import type { PublicModelInterface } from "../../../core/types";
|
|
|
17
17
|
IFutureModel
|
|
18
18
|
} from "../../../models/types/future-interfaces";<% } %>
|
|
19
19
|
<% if (isDecoratorCompanion) { %>import { KosCompanionDecorator } from "../../../core/core/decorators";<% } %>
|
|
20
|
-
<% } else { %>import type { IKosDataModel, IKosIdentifiable, PublicModelInterface,
|
|
20
|
+
<% } else { %>import type { IKosDataModel, IKosIdentifiable, PublicModelInterface, KosRegistrationFor<% if (hasFutureSupport) { %>, ExternalFutureInterface, IFutureModel<% } %><% if (isDecoratorCompanion) { %>, KosCompanionDecorator<% } %> } from "@kosdev-code/kos-ui-sdk";
|
|
21
21
|
import { kosModel<% if (parentAware) { %>, kosParentAware<% } %><% if (hasFutureSupport) { %>, kosFuture, kosFutureAware, Kos<% if (isCompleteFuture) { %>FutureAwareFull<% } else { %>FutureAwareMinimal<% } %><% } %><% if (isDecoratorCompanion) { %>, kosCompanion<% } %>, kosLoggerAware, KosLoggerAware } from "@kosdev-code/kos-ui-sdk";
|
|
22
22
|
<% } %>
|
|
23
23
|
import type { <%= nameProperCase %>Options} from "./types";
|
|
@@ -34,14 +34,17 @@ export type <%= nameProperCase %>Model = PublicModelInterface<<%= nameProperCase
|
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
35
35
|
export interface <%= nameProperCase %>ModelImpl extends KosLoggerAware<% if (hasFutureSupport) { %>, Kos<% if (isCompleteFuture) { %>FutureAwareFull<% } else { %>FutureAwareMinimal<% } %><<%= nameProperCase %>OperationProgress><% } %><% if (isDecoratorCompanion) { %>, KosCompanionDecorator<<%= companionModelProperCase %>Model><% } %> {}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// Flipping `singleton` here moves the Registration type with it.
|
|
38
|
+
export const MODEL_CONFIG = { modelTypeId: MODEL_TYPE, singleton: <%= singleton ? "true" : "false" %><% if (autoRegister) { %>, autoRegister: true<% } %> } as const;
|
|
39
|
+
|
|
40
|
+
@kosModel(MODEL_CONFIG)
|
|
38
41
|
<% if (parentAware && !isDecoratorCompanion) { %>@kosParentAware()<% } %>
|
|
39
42
|
<% if (hasFutureSupport) { %>@kosFutureAware(<% if (!isCompleteFuture) { %>{ mode: 'minimal' }<% } %>)<% } %>
|
|
40
43
|
<% if (isDecoratorCompanion) { %>@kosCompanion()<% } %>
|
|
41
44
|
@kosLoggerAware()
|
|
42
45
|
export class <%= nameProperCase %>ModelImpl implements IKosDataModel, IKosIdentifiable {
|
|
43
46
|
// Registration property for type safety - actual value injected by @kosModel decorator
|
|
44
|
-
static Registration:
|
|
47
|
+
static Registration: KosRegistrationFor<typeof MODEL_CONFIG, <%= nameProperCase %>Model, <%= nameProperCase %>Options>;
|
|
45
48
|
|
|
46
49
|
id: string;
|
|
47
50
|
// logger property is automatically provided by @kosLoggerAware decorator
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["<%= offsetFromRoot %>.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*"],
|
|
4
|
+
"overrides": [
|
|
5
|
+
{
|
|
6
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
+
"rules": {}
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"files": ["*.ts", "*.tsx"],
|
|
11
|
+
"rules": {}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"files": ["*.js", "*.jsx"],
|
|
15
|
+
"rules": {}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"files": ["*.json"],
|
|
19
|
+
"parser": "jsonc-eslint-parser",
|
|
20
|
+
"rules": {
|
|
21
|
+
"@nx/dependency-checks": [
|
|
22
|
+
"error",
|
|
23
|
+
{
|
|
24
|
+
"ignoredFiles": [
|
|
25
|
+
"{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}",
|
|
26
|
+
"{projectRoot}/vite.config.{js,ts,mjs,mts}"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|