@kosdev-code/kos-codegen-core 3.0.20 → 3.0.22

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.
Files changed (57) hide show
  1. package/index.d.ts +2 -2
  2. package/index.d.ts.map +1 -1
  3. package/index.js +1284 -379
  4. package/index.js.map +1 -1
  5. package/index.mjs +1285 -380
  6. package/index.mjs.map +1 -1
  7. package/lib/generators/add-container-support/generate-add-container-support.d.ts +14 -0
  8. package/lib/generators/add-container-support/generate-add-container-support.d.ts.map +1 -1
  9. package/lib/generators/add-parent-aware/generate-add-parent-aware.d.ts +15 -0
  10. package/lib/generators/add-parent-aware/generate-add-parent-aware.d.ts.map +1 -0
  11. package/lib/generators/add-parent-aware/index.d.ts +2 -0
  12. package/lib/generators/add-parent-aware/index.d.ts.map +1 -0
  13. package/lib/generators/augment/find-model-declaration.d.ts +4 -0
  14. package/lib/generators/augment/find-model-declaration.d.ts.map +1 -0
  15. package/lib/generators/augment/model-mocks.d.ts +47 -0
  16. package/lib/generators/augment/model-mocks.d.ts.map +1 -0
  17. package/lib/generators/augment/resolve-child-model.d.ts +16 -0
  18. package/lib/generators/augment/resolve-child-model.d.ts.map +1 -0
  19. package/lib/generators/augment/resolve-model-file.d.ts.map +1 -1
  20. package/lib/generators/augment/ts-toolkit.d.ts +32 -1
  21. package/lib/generators/augment/ts-toolkit.d.ts.map +1 -1
  22. package/lib/generators/describe/describe-model.d.ts.map +1 -1
  23. package/lib/generators/generate-container-model.d.ts +7 -0
  24. package/lib/generators/generate-container-model.d.ts.map +1 -1
  25. package/lib/generators/generate-model-project.d.ts +36 -0
  26. package/lib/generators/generate-model-project.d.ts.map +1 -0
  27. package/lib/generators/generate-view-model.d.ts +27 -0
  28. package/lib/generators/generate-view-model.d.ts.map +1 -0
  29. package/lib/generators/index.d.ts +21 -16
  30. package/lib/generators/index.d.ts.map +1 -1
  31. package/lib/generators/member-mutators/add-child.d.ts +10 -2
  32. package/lib/generators/member-mutators/add-child.d.ts.map +1 -1
  33. package/lib/generators/member-mutators/add-service-request.d.ts +71 -0
  34. package/lib/generators/member-mutators/add-service-request.d.ts.map +1 -1
  35. package/lib/generators/member-mutators/index.d.ts +1 -1
  36. package/lib/generators/member-mutators/index.d.ts.map +1 -1
  37. package/lib/generators/normalize-options.d.ts +2 -0
  38. package/lib/generators/normalize-options.d.ts.map +1 -1
  39. package/lib/generators/registration/upsert-chain-entry.d.ts +13 -0
  40. package/lib/generators/registration/upsert-chain-entry.d.ts.map +1 -0
  41. package/lib/generators/service-catalog.d.ts +12 -0
  42. package/lib/generators/service-catalog.d.ts.map +1 -1
  43. package/package.json +2 -2
  44. package/templates/kos-container-model/model/types/index.d.ts.template +2 -2
  45. package/templates/kos-model/model/__nameDashCase__-model.ts.template +7 -4
  46. package/templates/kos-model-project/project/.eslintrc.json.template +33 -0
  47. package/templates/kos-model-project/project/.kos.json.template +14 -0
  48. package/templates/kos-model-project/project/README.md.template +7 -0
  49. package/templates/kos-model-project/project/package.json.template +9 -0
  50. package/templates/kos-model-project/project/project.json.template +35 -0
  51. package/templates/kos-model-project/project/src/index.ts.template +1 -0
  52. package/templates/kos-model-project/project/src/lib/__projectName__.ts.template +3 -0
  53. package/templates/kos-model-project/project/tsconfig.json.template +20 -0
  54. package/templates/kos-model-project/project/tsconfig.lib.json.template +10 -0
  55. package/templates/kos-model-project/project/vite.config.ts.template +47 -0
  56. package/templates/kos-view-model/__nameDashCase__-view-model.ts.template +30 -0
  57. 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":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAcpE,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;CACpB;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,CA0D3B"}
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,2 @@
1
+ export * from './generate-add-parent-aware';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,47 @@
1
+ import { CodegenFileSystem } from '../../codegen-filesystem';
2
+ /** Where a model's mocks module lives, whether or not it exists yet. */
3
+ export declare function mocksFilePathFor(modelFilePath: string, modelBase: string): string;
4
+ /** The function an app calls to arm this model's provisional routes. */
5
+ export declare function mockRegisterFunctionName(modelBase: string): string;
6
+ /**
7
+ * KosMock matches `:name` segments; OpenAPI writes `{name}`. Same meaning, one
8
+ * translation — so the route pattern and the endpoint stay recognizably the
9
+ * same string.
10
+ */
11
+ export declare function toMockRoutePattern(servicePath: string): string;
12
+ export interface EnsureMockRouteOptions {
13
+ modelFilePath: string;
14
+ /** `board-model.ts` → `board`. */
15
+ modelBase: string;
16
+ /** Specifier the MODEL imports the SDK from, e.g. `@kosdev-code/kos-ui-sdk`. */
17
+ sdkModuleSpecifier: string;
18
+ /** Raw wire type exported by the model's services module. */
19
+ rawAlias: string;
20
+ /** Endpoint the route stands in for. */
21
+ servicePath: string;
22
+ method: string;
23
+ /** Catalog key, used to name the sample payload. */
24
+ endpointKey: string;
25
+ /**
26
+ * Sample payload as TypeScript expression text. Omitted when the caller
27
+ * supplied none, and a placeholder + TODO is emitted instead.
28
+ */
29
+ sampleText?: string;
30
+ }
31
+ export interface EnsureMockRouteResult {
32
+ mocksFilePath: string;
33
+ registerFunction: string;
34
+ routePattern: string;
35
+ sampleName: string;
36
+ /** False when a route for this (method, pattern) was already registered. */
37
+ routeCreated: boolean;
38
+ /** True when no sample was supplied, so the route serves a placeholder. */
39
+ samplePlaceholder: boolean;
40
+ }
41
+ /**
42
+ * Ensure the model's mocks module registers a route for one provisional
43
+ * endpoint. Idempotent on (method, pattern): a second call for the same
44
+ * endpoint adds nothing.
45
+ */
46
+ export declare function ensureMockRoute(codegenFs: CodegenFileSystem, options: EnsureMockRouteOptions): EnsureMockRouteResult;
47
+ //# sourceMappingURL=model-mocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-mocks.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/model-mocks.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAMR;AAED,wEAAwE;AACxE,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D;AA0CD,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,YAAY,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CA6DvB"}
@@ -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":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,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,CAiDnE"}
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 { SourceFile, ClassDeclaration } from 'ts-morph';
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;
@@ -80,6 +86,8 @@ export declare function ensureConstCatalogEntry(sourceFile: SourceFile, spec: {
80
86
  key: string;
81
87
  initializer: string;
82
88
  equals?: (existing: string, candidate: string) => boolean;
89
+ /** Doc comment for the new entry. Not applied when an entry is reused. */
90
+ leadingTrivia?: string;
83
91
  }): {
84
92
  key: string;
85
93
  created: boolean;
@@ -88,6 +96,7 @@ export declare function ensureConstCatalogEntry(sourceFile: SourceFile, spec: {
88
96
  export declare function ensureExportedTypeAlias(sourceFile: SourceFile, spec: {
89
97
  name: string;
90
98
  type: string;
99
+ docs?: string;
91
100
  }): boolean;
92
101
  /**
93
102
  * Add an exported identity mapper `raw -> data` unless one of that name exists.
@@ -101,10 +110,30 @@ export declare function ensureExportedMapper(sourceFile: SourceFile, spec: {
101
110
  }): boolean;
102
111
  /** Add `export * from "<moduleSpecifier>"` unless the barrel already has it. */
103
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;
104
131
  /** A decorated method to add to a model class. */
105
132
  export interface DecoratedMethodSpec {
106
133
  name: string;
107
134
  decoratorName: string;
135
+ /** Explicit decorator type arguments, e.g. `["RawType", "DataType"]`. */
136
+ decoratorTypeArgs?: string[];
108
137
  decoratorArgsText?: string;
109
138
  parameters?: {
110
139
  name: string;
@@ -114,6 +143,8 @@ export interface DecoratedMethodSpec {
114
143
  returnType?: string;
115
144
  isAsync?: boolean;
116
145
  statements?: string;
146
+ /** Doc comment emitted above the method. */
147
+ docs?: string;
117
148
  }
118
149
  /**
119
150
  * Add a decorated method to a class idempotently (skips if a method of that name
@@ -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,EAQL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,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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b,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAaD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAWT;AAED,oDAAoD;AACpD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;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
+ {"version":3,"file":"ts-toolkit.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/ts-toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAaD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAWT;AAED,oDAAoD;AACpD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;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":"describe-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/describe/describe-model.ts"],"names":[],"mappings":"AAS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,CAgElB"}
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":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAUjE,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;CACxB;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,CAyEN"}
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 { syncCiManifests, discoverUiArtifacts, discoverJavaArtifacts, type CiSyncOptions, type CiSyncResult, type CiSyncManifestResult, type DiscoveredArtifact, } from './ci-sync';
5
- export { ensureJavaAggregatorPom, type EnsureJavaAggregatorOptions, finalizeArchetypeModule, type FinalizeArchetypeModuleOptions, addJavaArtifactToManifests, type AddJavaArtifactOptions, } from './java-workspace';
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, 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
+ 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 { generateModel, type ModelOptions, type GenerateModelParams, } from './generate-model';
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 { addModelEffectToModel, type AddModelEffectOptions, addDependencyToModel, type AddDependencyOptions, addChildToModel, type AddChildOptions, type ChildShape, addTopicHandlerToModel, type AddTopicHandlerOptions, addConfigPropertyToModel, type AddConfigPropertyOptions, addServiceRequestToModel, type AddServiceRequestOptions, addPropertyToModel, type AddPropertyOptions, addComputedToModel, type AddComputedOptions, } from './member-mutators';
21
+ export { addParentAwareToModel, type AddParentAwareOptions, } from './add-parent-aware';
20
22
  export { resolveModelFilePath, type ModelFileQuery, } from './augment/resolve-model-file';
21
- export { transformSourceFile, ensureNamedImport, resolveSdkModuleSpecifier, getModelClass, addClassDecorator, ensureDeclarationMerge, ensureFileEslintDisable, addDecoratedMethod, addDecoratedProperty, addPlainProperty, addGetter, } from './augment/ts-toolkit';
22
- export { validateModel, type ValidateModelOptions, type ValidationFinding, type ValidationResult, } from './validate';
23
- export { describeModel, type DescribeModelOptions, type DescribedMember, type ModelDescription, } from './describe';
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,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;AAE1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;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
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,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,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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: string;
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;AAWpE,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,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,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,CAmE3B"}
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,6 +1,14 @@
1
1
  import { CodegenFileSystem } from '../../codegen-filesystem';
2
2
  import { ProjectConfiguration } from '../../project-discovery';
3
3
  export type ServiceRequestMode = "lifecycle" | "method";
4
+ /**
5
+ * What to do when the generated types do not declare the requested endpoint.
6
+ *
7
+ * `auto` never silently substitutes mocking for a real request — the result says
8
+ * plainly that it did, and why, so the caller reports a missing endpoint rather
9
+ * than a finished feature.
10
+ */
11
+ export type ServiceRequestMockMode = "auto" | "always" | "never";
4
12
  export interface AddServiceRequestOptions {
5
13
  modelName: string;
6
14
  modelProject: string;
@@ -20,6 +28,31 @@ export interface AddServiceRequestOptions {
20
28
  * `lifecycle` mode; defaults to `LOAD` there.
21
29
  */
22
30
  lifecycle?: string;
31
+ /**
32
+ * What to do about an endpoint the generated types do not declare.
33
+ *
34
+ * `never` — a hard error; nothing is written.
35
+ * `auto` — (default) emit the provisional, mock-backed form and say so.
36
+ * `always` — emit a KosMock route even for an endpoint that IS typed, for
37
+ * developing against something the spec declares but the device does not
38
+ * serve yet. A typed endpoint keeps its typed request; only the mock is added.
39
+ */
40
+ mock?: ServiceRequestMockMode;
41
+ /**
42
+ * The raw wire shape a PROVISIONAL endpoint is expected to serve, as TypeScript
43
+ * type text (`DeviceGrantSyncBean[]`, `{ id: string; label: string }`). This is
44
+ * the UNWRAPPED `data` payload: the client strips the `{status, data}` envelope
45
+ * before the transform runs. Defaults to `unknown`, which compiles but leaves
46
+ * the response boundary undescribed.
47
+ */
48
+ rawType?: string;
49
+ /**
50
+ * Sample payload for the mock route, as TypeScript expression text. Typed
51
+ * against the raw wire shape, so a sample that does not match it fails the
52
+ * build rather than the demo. Without one the route answers with a placeholder
53
+ * and the transform is never exercised.
54
+ */
55
+ sample?: string;
23
56
  /** Import specifier for the generated typed service module (relative to the model
24
57
  * file). If omitted, auto-resolved when the project has exactly one. */
25
58
  serviceModule?: string;
@@ -42,6 +75,44 @@ export interface AddServiceRequestResult {
42
75
  endpointKey: string;
43
76
  /** False when an existing catalog entry for this (path, method) was reused. */
44
77
  endpointCreated: boolean;
78
+ /**
79
+ * Whether the path was actually checked. False when the generated module
80
+ * exposes no `paths` this can read — which is not evidence the endpoint exists.
81
+ */
82
+ pathValidated: boolean;
83
+ /** True when the endpoint is absent from the generated types and was mocked. */
84
+ provisional: boolean;
85
+ /** The mock module, when one was written. */
86
+ mocksFilePath?: string;
87
+ /** Function the app must call to arm the routes, when one was written. */
88
+ mockRegisterFunction?: string;
89
+ /** `GET /api/board/grants`, when a route was registered. */
90
+ mockRoute?: string;
91
+ /** True when no sample was supplied, so the mock serves a placeholder. */
92
+ mockSamplePlaceholder?: boolean;
93
+ /** Exactly what to undo when the endpoint lands, in order. */
94
+ removalSteps?: string[];
95
+ }
96
+ /**
97
+ * Everything needed to report a rejected path, carried on the error rather than
98
+ * flattened into its message — so a tool surface can present the alternatives
99
+ * with their warning attached instead of as a list of corrections.
100
+ */
101
+ export interface UntypedEndpointDetails {
102
+ servicePath: string;
103
+ method: string;
104
+ /** True when the path is typed, but not for this method. */
105
+ pathTypedForOtherMethods: boolean;
106
+ /** Methods this path DOES support, when it is typed at all. */
107
+ methodsForPath: string[];
108
+ /** Nearest paths in the same API — alternatives to rule out, not to adopt. */
109
+ otherEndpointsInThisApi: string[];
110
+ warning: string;
111
+ waysForward: string[];
112
+ }
113
+ /** A rejected path, with the alternatives kept apart from the verdict. */
114
+ export interface UntypedEndpointError extends Error {
115
+ details: UntypedEndpointDetails;
45
116
  }
46
117
  export declare function addServiceRequestToModel(codegenFs: CodegenFileSystem, options: AddServiceRequestOptions, projects?: Map<string, ProjectConfiguration>): AddServiceRequestResult;
47
118
  //# 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":"AA6BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAwBpE,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;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,kBAAkB,CAAC;IACzB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,eAAe,EAAE,OAAO,CAAC;CAC1B;AA4ED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,wBAAwB,EACjC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,uBAAuB,CA8NzB"}
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,MA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,EAAE,CAAC;CACzB;AAED;;;;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;AAgTD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,wBAAwB,EACjC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,uBAAuB,CAsXzB"}
@@ -5,5 +5,5 @@ export { addTopicHandlerToModel, type AddTopicHandlerOptions, } from './add-topi
5
5
  export { addConfigPropertyToModel, type AddConfigPropertyOptions, } from './add-config-property';
6
6
  export { addPropertyToModel, type AddPropertyOptions } from './add-property';
7
7
  export { addComputedToModel, type AddComputedOptions } from './add-computed';
8
- export { addServiceRequestToModel, type AddServiceRequestOptions, } from './add-service-request';
8
+ export { addServiceRequestToModel, type AddServiceRequestOptions, type AddServiceRequestResult, type ServiceRequestMockMode, type UntypedEndpointDetails, type UntypedEndpointError, } from './add-service-request';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC"}
@@ -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;CAC/C;AAED,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,uBAAuB,IAAI,CAAC,GAAG;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,EAAE,MAAM,CAAC;IACjC,uBAAuB,EAAE,MAAM,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC;IACjC,0BAA0B,EAAE,MAAM,CAAC;IACnC,uBAAuB,EAAE,MAAM,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;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,CAuDtB"}
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;IAC9C,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAC;C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