@kosdev-code/kos-codegen-core 3.0.19 → 3.0.21

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 (67) hide show
  1. package/index.d.ts +2 -2
  2. package/index.d.ts.map +1 -1
  3. package/index.js +1527 -569
  4. package/index.js.map +1 -1
  5. package/index.mjs +1523 -565
  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-future-to-model/normalize-options.d.ts.map +1 -1
  10. package/lib/generators/add-future-to-model/service-transformer.d.ts +1 -3
  11. package/lib/generators/add-future-to-model/service-transformer.d.ts.map +1 -1
  12. package/lib/generators/add-parent-aware/generate-add-parent-aware.d.ts +15 -0
  13. package/lib/generators/add-parent-aware/generate-add-parent-aware.d.ts.map +1 -0
  14. package/lib/generators/add-parent-aware/index.d.ts +2 -0
  15. package/lib/generators/add-parent-aware/index.d.ts.map +1 -0
  16. package/lib/generators/augment/find-model-declaration.d.ts +11 -0
  17. package/lib/generators/augment/find-model-declaration.d.ts.map +1 -0
  18. package/lib/generators/augment/model-mocks.d.ts +47 -0
  19. package/lib/generators/augment/model-mocks.d.ts.map +1 -0
  20. package/lib/generators/augment/model-services.d.ts +11 -0
  21. package/lib/generators/augment/model-services.d.ts.map +1 -0
  22. package/lib/generators/augment/resolve-child-model.d.ts +16 -0
  23. package/lib/generators/augment/resolve-child-model.d.ts.map +1 -0
  24. package/lib/generators/augment/resolve-model-file.d.ts.map +1 -1
  25. package/lib/generators/augment/ts-toolkit.d.ts +61 -1
  26. package/lib/generators/augment/ts-toolkit.d.ts.map +1 -1
  27. package/lib/generators/generate-container-model.d.ts +7 -1
  28. package/lib/generators/generate-container-model.d.ts.map +1 -1
  29. package/lib/generators/generate-init.d.ts.map +1 -1
  30. package/lib/generators/generate-model-project.d.ts +36 -0
  31. package/lib/generators/generate-model-project.d.ts.map +1 -0
  32. package/lib/generators/generate-model.d.ts +0 -1
  33. package/lib/generators/generate-model.d.ts.map +1 -1
  34. package/lib/generators/generate-view-model.d.ts +35 -0
  35. package/lib/generators/generate-view-model.d.ts.map +1 -0
  36. package/lib/generators/index.d.ts +21 -16
  37. package/lib/generators/index.d.ts.map +1 -1
  38. package/lib/generators/member-mutators/add-child.d.ts +10 -2
  39. package/lib/generators/member-mutators/add-child.d.ts.map +1 -1
  40. package/lib/generators/member-mutators/add-service-request.d.ts +80 -2
  41. package/lib/generators/member-mutators/add-service-request.d.ts.map +1 -1
  42. package/lib/generators/member-mutators/index.d.ts +1 -1
  43. package/lib/generators/member-mutators/index.d.ts.map +1 -1
  44. package/lib/generators/registration/upsert-chain-entry.d.ts +13 -0
  45. package/lib/generators/registration/upsert-chain-entry.d.ts.map +1 -0
  46. package/lib/generators/service-catalog.d.ts +12 -0
  47. package/lib/generators/service-catalog.d.ts.map +1 -1
  48. package/package.json +2 -2
  49. package/templates/kos-container-model/model/index.ts.template +0 -2
  50. package/templates/kos-container-model/model/types/index.d.ts.template +2 -2
  51. package/templates/kos-model/model/index.ts__template__ +0 -3
  52. package/templates/kos-model-project/project/.eslintrc.json.template +33 -0
  53. package/templates/kos-model-project/project/.kos.json.template +14 -0
  54. package/templates/kos-model-project/project/README.md.template +7 -0
  55. package/templates/kos-model-project/project/package.json.template +9 -0
  56. package/templates/kos-model-project/project/project.json.template +35 -0
  57. package/templates/kos-model-project/project/src/index.ts.template +1 -0
  58. package/templates/kos-model-project/project/src/lib/__projectName__.ts.template +3 -0
  59. package/templates/kos-model-project/project/tsconfig.json.template +20 -0
  60. package/templates/kos-model-project/project/tsconfig.lib.json.template +10 -0
  61. package/templates/kos-model-project/project/vite.config.ts.template +47 -0
  62. package/templates/kos-view-model/__nameDashCase__-view-model.ts.template +30 -0
  63. package/templates/kos-view-model/index.ts.template +1 -0
  64. package/templates/kos-container-model/services/__modelNameDashCase__-services.ts.template +0 -22
  65. package/templates/kos-container-model/services/index.ts.template +0 -1
  66. package/templates/kos-model/services/__nameDashCase__-services.ts.template +0 -58
  67. package/templates/kos-model/services/index.ts.template +0 -1
@@ -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"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/normalize-options.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV,uBAAuB,EACvB,iCAAiC,EAClC,MAAM,SAAS,CAAC;AAEjB,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,iCAAiC,CA0EnC"}
1
+ {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/normalize-options.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EACV,uBAAuB,EACvB,iCAAiC,EAClC,MAAM,SAAS,CAAC;AAEjB,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAC3C,iCAAiC,CAwEnC"}
@@ -5,9 +5,7 @@ export declare class ServiceFileTransformer {
5
5
  private options;
6
6
  constructor(codegenFs: CodegenFileSystem, options: NormalizedAddFutureToModelOptions);
7
7
  transform(): void;
8
- private createServicesFile;
9
- private addFutureImports;
10
- private addFutureService;
8
+ private addFutureOperation;
11
9
  private addProgressTypes;
12
10
  }
13
11
  //# sourceMappingURL=service-transformer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-transformer.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/service-transformer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEjE,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,iCAAiC;IAGpD,SAAS,IAAI,IAAI;IAkBjB,OAAO,CAAC,kBAAkB;IA+E1B,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,gBAAgB;IAkCxB,OAAO,CAAC,gBAAgB;CA4BzB"}
1
+ {"version":3,"file":"service-transformer.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/add-future-to-model/service-transformer.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAWjE,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,iCAAiC;IAGpD,SAAS,IAAI,IAAI;IA0BjB,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,gBAAgB;CAoBzB"}
@@ -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,11 @@
1
+ import { CodegenFileSystem } from '../../codegen-filesystem';
2
+ /**
3
+ * Find the file declaring a model with one of `typeIds`.
4
+ *
5
+ * Returns the single match, or null when there is none or when the search would
6
+ * have to guess. Ambiguity THROWS rather than picking: two files declaring the
7
+ * same type id is a real workspace problem, and mutating the wrong model is
8
+ * worse than a named failure.
9
+ */
10
+ export declare function findModelDeclarationFile(codegenFs: CodegenFileSystem, searchRoot: string, typeIds: string[]): string | null;
11
+ //# 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;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAMlE;;;;;;;GAOG;AACH,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,11 @@
1
+ import { CodegenFileSystem } from '../../codegen-filesystem';
2
+ /** `board-model.ts` → `board`; falls back to the requested model name. */
3
+ export declare function modelBaseName(modelFilePath: string, modelName: string): string;
4
+ /** Where a model's services module lives, whether or not it exists yet. */
5
+ export declare function servicesFilePathFor(modelFilePath: string, modelBase: string): string;
6
+ /**
7
+ * Ensure the model's services module and its barrel exist, and return the
8
+ * module's path. Existing files are left alone — callers add to them.
9
+ */
10
+ export declare function ensureServicesModule(codegenFs: CodegenFileSystem, modelFilePath: string, modelBase: string): string;
11
+ //# sourceMappingURL=model-services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-services.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/model-services.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,0EAA0E;AAC1E,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAIR;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAMR;AAWD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,EAC5B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAeR"}
@@ -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":"AAeA,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,CA+DnE"}
@@ -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.
@@ -66,10 +66,68 @@ export declare function ensureModuleConst(sourceFile: SourceFile, spec: {
66
66
  name: string;
67
67
  initializer: string;
68
68
  }): boolean;
69
+ /**
70
+ * Ensure an exported `as const` catalog holds an entry with this initializer,
71
+ * and report the key that holds it.
72
+ *
73
+ * An entry whose initializer already matches is REUSED rather than duplicated,
74
+ * so one descriptor is declared once however many members reference it.
75
+ * Equivalence is delegated to `equals` because equivalent initializers are not
76
+ * always identical text — quote style and spacing vary by who wrote the file.
77
+ */
78
+ export declare function ensureConstCatalogEntry(sourceFile: SourceFile, spec: {
79
+ catalogName: string;
80
+ key: string;
81
+ initializer: string;
82
+ equals?: (existing: string, candidate: string) => boolean;
83
+ /** Doc comment for the new entry. Not applied when an entry is reused. */
84
+ leadingTrivia?: string;
85
+ }): {
86
+ key: string;
87
+ created: boolean;
88
+ };
89
+ /** Add an exported type alias unless one of that name already exists. */
90
+ export declare function ensureExportedTypeAlias(sourceFile: SourceFile, spec: {
91
+ name: string;
92
+ type: string;
93
+ docs?: string;
94
+ }): boolean;
95
+ /**
96
+ * Add an exported identity mapper `raw -> data` unless one of that name exists.
97
+ * Emitted as an identity so it compiles untouched; narrowing the data type is
98
+ * what makes it a real boundary.
99
+ */
100
+ export declare function ensureExportedMapper(sourceFile: SourceFile, spec: {
101
+ name: string;
102
+ rawType: string;
103
+ dataType: string;
104
+ }): boolean;
105
+ /** Add `export * from "<moduleSpecifier>"` unless the barrel already has it. */
106
+ export declare function ensureBarrelExport(sourceFile: SourceFile, moduleSpecifier: string): boolean;
107
+ /**
108
+ * Add named exports for a module to a barrel, creating the export declaration
109
+ * when the module is not exported yet and appending only the missing names when
110
+ * it is. Value and type exports are kept as separate declarations so a type-only
111
+ * export is not widened into a value export.
112
+ *
113
+ * Returns true if the file changed.
114
+ */
115
+ export declare function ensureNamedExports(sourceFile: SourceFile, moduleSpecifier: string, names: string[], isTypeOnly?: boolean): boolean;
116
+ /**
117
+ * Add an exported interface to a declarations file, leaving any existing
118
+ * declaration untouched. Returns true if the interface was added.
119
+ */
120
+ export declare function ensureExportedInterface(sourceFile: SourceFile, name: string, properties?: {
121
+ name: string;
122
+ type: string;
123
+ hasQuestionToken?: boolean;
124
+ }[], extendsTypes?: string[]): boolean;
69
125
  /** A decorated method to add to a model class. */
70
126
  export interface DecoratedMethodSpec {
71
127
  name: string;
72
128
  decoratorName: string;
129
+ /** Explicit decorator type arguments, e.g. `["RawType", "DataType"]`. */
130
+ decoratorTypeArgs?: string[];
73
131
  decoratorArgsText?: string;
74
132
  parameters?: {
75
133
  name: string;
@@ -79,6 +137,8 @@ export interface DecoratedMethodSpec {
79
137
  returnType?: string;
80
138
  isAsync?: boolean;
81
139
  statements?: string;
140
+ /** Doc comment emitted above the method. */
141
+ docs?: string;
82
142
  }
83
143
  /**
84
144
  * 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,EAML,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,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EAC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AM,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;;;;;;;;;;;;;;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,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,eAAe,EAAE,GACvB,IAAI,CAyBN;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAKxE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAYlB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,EACr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,14 @@ import { KosBaseGeneratorOptions } from './normalize-options';
4
4
  export interface ContainerModelOptions extends KosBaseGeneratorOptions {
5
5
  modelName?: string;
6
6
  singleton?: boolean;
7
- dataServices?: boolean;
8
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;
9
15
  }
10
16
  /**
11
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;IACvB,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,CAwFN"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate-init.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI/D,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,cAAc,GACtB,IAAI,CAgDN"}
1
+ {"version":3,"file":"generate-init.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI/D,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,cAAc,GACtB,IAAI,CA+CN"}
@@ -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"}
@@ -5,7 +5,6 @@ export interface ModelOptions extends KosBaseGeneratorOptions {
5
5
  singleton?: boolean;
6
6
  isContainerSingleton?: boolean;
7
7
  unitTests?: boolean;
8
- dataServices?: boolean;
9
8
  container?: boolean;
10
9
  parentAware?: boolean;
11
10
  autoRegister?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"generate-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-model.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAW7B,MAAM,WAAW,YAAa,SAAQ,uBAAuB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAyI/D"}
1
+ {"version":3,"file":"generate-model.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-codegen-core/src/lib/generators/generate-model.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAW7B,MAAM,WAAW,YAAa,SAAQ,uBAAuB;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,YAAY,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CA0H/D"}
@@ -0,0 +1,35 @@
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
+ /**
26
+ * Generate a ViewModel.
27
+ *
28
+ * @param codegenFs - Target filesystem
29
+ * @param templateDir - Absolute path to the kos-view-model template directory
30
+ * @param options - Generator options
31
+ * @param cwd - Current working directory for project resolution
32
+ * @param projects - Optional pre-computed project map
33
+ */
34
+ export declare function generateViewModel(codegenFs: CodegenFileSystem, templateDir: string, options: ViewModelOptions, cwd: string, projects?: Map<string, ProjectConfiguration>): ViewModelResult;
35
+ //# 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":"AAcA,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;;;;;;;;GAQG;AACH,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,CA+FjB"}
@@ -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;AAE1B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,kCAAkC,GACnC,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAA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AACpB,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
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,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,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,KAAK,gBAAgB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,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: 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"}