@kosdev-code/kos-codegen-core 0.1.0-next.855 → 0.1.0-next.861
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +293 -222
- package/index.js.map +1 -1
- package/index.mjs +293 -222
- package/index.mjs.map +1 -1
- package/lib/generators/add-future-to-model/normalize-options.d.ts.map +1 -1
- package/lib/generators/add-future-to-model/service-transformer.d.ts +1 -3
- package/lib/generators/add-future-to-model/service-transformer.d.ts.map +1 -1
- package/lib/generators/augment/model-services.d.ts +11 -0
- package/lib/generators/augment/model-services.d.ts.map +1 -0
- package/lib/generators/augment/ts-toolkit.d.ts +35 -0
- package/lib/generators/augment/ts-toolkit.d.ts.map +1 -1
- package/lib/generators/generate-container-model.d.ts +0 -1
- package/lib/generators/generate-container-model.d.ts.map +1 -1
- package/lib/generators/generate-init.d.ts.map +1 -1
- package/lib/generators/generate-model.d.ts +0 -1
- package/lib/generators/generate-model.d.ts.map +1 -1
- package/lib/generators/member-mutators/add-service-request.d.ts +9 -2
- package/lib/generators/member-mutators/add-service-request.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/kos-container-model/model/index.ts.template +0 -2
- package/templates/kos-model/model/index.ts__template__ +0 -3
- package/templates/kos-container-model/services/__modelNameDashCase__-services.ts.template +0 -22
- package/templates/kos-container-model/services/index.ts.template +0 -1
- package/templates/kos-model/services/__nameDashCase__-services.ts.template +0 -58
- package/templates/kos-model/services/index.ts.template +0 -1
|
@@ -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;
|
|
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
|
|
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":"
|
|
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,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"}
|
|
@@ -66,6 +66,41 @@ 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
|
+
}): {
|
|
84
|
+
key: string;
|
|
85
|
+
created: boolean;
|
|
86
|
+
};
|
|
87
|
+
/** Add an exported type alias unless one of that name already exists. */
|
|
88
|
+
export declare function ensureExportedTypeAlias(sourceFile: SourceFile, spec: {
|
|
89
|
+
name: string;
|
|
90
|
+
type: string;
|
|
91
|
+
}): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Add an exported identity mapper `raw -> data` unless one of that name exists.
|
|
94
|
+
* Emitted as an identity so it compiles untouched; narrowing the data type is
|
|
95
|
+
* what makes it a real boundary.
|
|
96
|
+
*/
|
|
97
|
+
export declare function ensureExportedMapper(sourceFile: SourceFile, spec: {
|
|
98
|
+
name: string;
|
|
99
|
+
rawType: string;
|
|
100
|
+
dataType: string;
|
|
101
|
+
}): boolean;
|
|
102
|
+
/** Add `export * from "<moduleSpecifier>"` unless the barrel already has it. */
|
|
103
|
+
export declare function ensureBarrelExport(sourceFile: SourceFile, moduleSpecifier: string): boolean;
|
|
69
104
|
/** A decorated method to add to a model class. */
|
|
70
105
|
export interface DecoratedMethodSpec {
|
|
71
106
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-toolkit.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/ts-toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"ts-toolkit.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/augment/ts-toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,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,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,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;IAAE,QAAQ,CAA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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":"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;
|
|
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 +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,
|
|
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"}
|
|
@@ -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,
|
|
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"}
|
|
@@ -32,9 +32,16 @@ export interface AddServiceRequestOptions {
|
|
|
32
32
|
serviceModulePath?: string;
|
|
33
33
|
modelPath?: string;
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export interface AddServiceRequestResult {
|
|
36
36
|
modelFilePath: string;
|
|
37
|
+
/** The model's services module the descriptor was written to. */
|
|
38
|
+
servicesFilePath: string;
|
|
37
39
|
serviceModule: string;
|
|
38
40
|
mode: ServiceRequestMode;
|
|
39
|
-
|
|
41
|
+
/** Catalog entry the method points at — reused when the endpoint was known. */
|
|
42
|
+
endpointKey: string;
|
|
43
|
+
/** False when an existing catalog entry for this (path, method) was reused. */
|
|
44
|
+
endpointCreated: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function addServiceRequestToModel(codegenFs: CodegenFileSystem, options: AddServiceRequestOptions, projects?: Map<string, ProjectConfiguration>): AddServiceRequestResult;
|
|
40
47
|
//# sourceMappingURL=add-service-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-service-request.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/add-service-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-service-request.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-codegen-core/src/lib/generators/member-mutators/add-service-request.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-codegen-core",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.861",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"kos": {
|
|
27
27
|
"build": {
|
|
28
|
-
"gitHash": "
|
|
28
|
+
"gitHash": "05106416ab6fb1417733c28960bca2fec81d2a09"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -8,6 +8,4 @@ export type { <%= nameProperCase %>Model } from "./<%= nameDashCase %>-model";
|
|
|
8
8
|
export type { <%= modelNameProperCase %>Model } from "./<%= modelNameDashCase %>-model";
|
|
9
9
|
export type * from "./types";
|
|
10
10
|
|
|
11
|
-
<% if (dataServices) { %>// Export services if configured
|
|
12
|
-
export * as <%= modelNameProperCase %>Services from "./services";<% } %>
|
|
13
11
|
|
|
@@ -4,6 +4,3 @@ export { <%= nameProperCase %> } from "./<%= nameDashCase %>-model";
|
|
|
4
4
|
// Export types
|
|
5
5
|
export type { <%= nameProperCase %>Model } from "./<%= nameDashCase %>-model";
|
|
6
6
|
export type * from "./types";
|
|
7
|
-
|
|
8
|
-
<% if (dataServices) { %>// Export services if configured
|
|
9
|
-
export * as <%= nameProperCase %>Services from "./services";<% } %>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
KosLog,
|
|
3
|
-
type ElementType,
|
|
4
|
-
type ServiceResponse
|
|
5
|
-
} from '@kosdev-code/kos-ui-sdk';
|
|
6
|
-
|
|
7
|
-
import API, { type KosApi, type ApiPath, type ApiResponse } from '../../../utils/service';
|
|
8
|
-
|
|
9
|
-
const log = KosLog.createLogger({name: "<%= nameDashCase %>-service", group: "Services"});
|
|
10
|
-
|
|
11
|
-
const SERVICE_PATH: ApiPath = "ENTER_SERVICE_PATH"
|
|
12
|
-
export type <%= nameProperCase %>Response = ApiResponse<typeof SERVICE_PATH,'get'>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @category Service
|
|
17
|
-
* Retrieves the initial list of <%= name %> data.
|
|
18
|
-
*/
|
|
19
|
-
export const get<%= nameProperCase %> = async (): Promise<ServiceResponse<<%= nameProperCase %>ClientResponse>> => {
|
|
20
|
-
log.debug('sending GET for <%= name %>');
|
|
21
|
-
return await API.get(SERVICE_PATH);
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./<%= modelNameDashCase %>-services";
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<% const hasFutureSupport = futureAware && futureAware !== 'none'; %>
|
|
2
|
-
import {
|
|
3
|
-
KosLog,
|
|
4
|
-
type ElementType,
|
|
5
|
-
type ServiceResponse<% if (hasFutureSupport) { %>,
|
|
6
|
-
type FutureResponse<% } %>
|
|
7
|
-
} from '@kosdev-code/kos-ui-sdk';
|
|
8
|
-
|
|
9
|
-
import API, { type ApiPath, type ApiResponse } from '../../../utils/service';
|
|
10
|
-
|
|
11
|
-
const log = KosLog.createLogger({name: "<%= nameDashCase %>-service", group: "Services"});
|
|
12
|
-
|
|
13
|
-
const SERVICE_PATH: ApiPath = "ENTER_SERVICE_PATH"
|
|
14
|
-
export type <%= nameProperCase %>Response = ApiResponse<typeof SERVICE_PATH, 'get'>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @category Service
|
|
19
|
-
* Retrieves the initial <%= name %> data.
|
|
20
|
-
*/
|
|
21
|
-
export const get<%= nameProperCase %> = async (): Promise<ServiceResponse<<%= nameProperCase %>Response>> => {
|
|
22
|
-
log.debug('sending GET for <%= name %>');
|
|
23
|
-
return await API.get(SERVICE_PATH);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
<% if (hasFutureSupport) { %>
|
|
27
|
-
/**
|
|
28
|
-
* @category Service - Future Operation
|
|
29
|
-
* Placeholder for a long-running operation that returns a Future for progress tracking
|
|
30
|
-
*
|
|
31
|
-
* Replace this with your actual long-running service operation
|
|
32
|
-
*/
|
|
33
|
-
export const perform<%= nameProperCase %>Operation = async (): Promise<FutureResponse> => {
|
|
34
|
-
// TODO: Implement your long-running service operation here
|
|
35
|
-
// This should return a Future that can be tracked for progress
|
|
36
|
-
|
|
37
|
-
log.debug('starting long-running <%= name %> operation');
|
|
38
|
-
|
|
39
|
-
// Example pattern:
|
|
40
|
-
// return API.post(OPERATION_SERVICE_PATH, {
|
|
41
|
-
// // operation parameters
|
|
42
|
-
// });
|
|
43
|
-
|
|
44
|
-
// Placeholder - replace with actual implementation
|
|
45
|
-
throw new Error('perform<%= nameProperCase %>Operation not yet implemented');
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Additional Future-aware service types (add as needed)
|
|
49
|
-
export type <%= nameProperCase %>OperationProgress = {
|
|
50
|
-
// Define your progress data structure here
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type <%= nameProperCase %>OperationResult = {
|
|
55
|
-
// Define your operation result structure here
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
<% } %>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./<%= nameDashCase %>-services";
|