@skmtc/core 0.0.479 → 0.0.480

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 (65) hide show
  1. package/esm/context/GenerateContext.d.ts +2 -2
  2. package/esm/context/GenerateContext.d.ts.map +1 -1
  3. package/esm/dsl/model/ModelInsertable.d.ts +1 -1
  4. package/esm/dsl/model/ModelInsertable.d.ts.map +1 -1
  5. package/esm/dsl/model/toModelInsertable.d.ts +2 -2
  6. package/esm/dsl/model/toModelInsertable.d.ts.map +1 -1
  7. package/esm/dsl/model/toModelInsertable.js +2 -2
  8. package/esm/dsl/operation/OperationInsertable.d.ts +2 -2
  9. package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -1
  10. package/esm/dsl/operation/toOperationGateway.d.ts +2 -2
  11. package/esm/dsl/operation/toOperationGateway.d.ts.map +1 -1
  12. package/esm/dsl/operation/toOperationGateway.js +2 -2
  13. package/esm/dsl/operation/toOperationInsertable.d.ts +2 -2
  14. package/esm/dsl/operation/toOperationInsertable.d.ts.map +1 -1
  15. package/esm/dsl/operation/toOperationInsertable.js +2 -2
  16. package/esm/mod.d.ts +1 -5
  17. package/esm/mod.d.ts.map +1 -1
  18. package/esm/mod.js +1 -5
  19. package/esm/run/handleEnrichment.d.ts +3 -0
  20. package/esm/run/handleEnrichment.d.ts.map +1 -0
  21. package/esm/run/handleEnrichment.js +46 -0
  22. package/esm/run/toEnrichments.d.ts +12 -0
  23. package/esm/run/toEnrichments.d.ts.map +1 -0
  24. package/esm/run/toEnrichments.js +26 -0
  25. package/esm/run/toSettings.d.ts.map +1 -1
  26. package/esm/run/toSettings.js +3 -2
  27. package/esm/types/EnrichmentRequest.d.ts +2 -51
  28. package/esm/types/EnrichmentRequest.d.ts.map +1 -1
  29. package/esm/types/EnrichmentRequest.js +0 -20
  30. package/esm/types/Settings.d.ts +140 -24
  31. package/esm/types/Settings.d.ts.map +1 -1
  32. package/esm/types/Settings.js +6 -2
  33. package/package.json +2 -1
  34. package/script/context/GenerateContext.d.ts +2 -2
  35. package/script/context/GenerateContext.d.ts.map +1 -1
  36. package/script/dsl/model/ModelInsertable.d.ts +1 -1
  37. package/script/dsl/model/ModelInsertable.d.ts.map +1 -1
  38. package/script/dsl/model/toModelInsertable.d.ts +2 -2
  39. package/script/dsl/model/toModelInsertable.d.ts.map +1 -1
  40. package/script/dsl/model/toModelInsertable.js +2 -2
  41. package/script/dsl/operation/OperationInsertable.d.ts +2 -2
  42. package/script/dsl/operation/OperationInsertable.d.ts.map +1 -1
  43. package/script/dsl/operation/toOperationGateway.d.ts +2 -2
  44. package/script/dsl/operation/toOperationGateway.d.ts.map +1 -1
  45. package/script/dsl/operation/toOperationGateway.js +2 -2
  46. package/script/dsl/operation/toOperationInsertable.d.ts +2 -2
  47. package/script/dsl/operation/toOperationInsertable.d.ts.map +1 -1
  48. package/script/dsl/operation/toOperationInsertable.js +2 -2
  49. package/script/mod.d.ts +1 -5
  50. package/script/mod.d.ts.map +1 -1
  51. package/script/mod.js +1 -5
  52. package/script/run/handleEnrichment.d.ts +3 -0
  53. package/script/run/handleEnrichment.d.ts.map +1 -0
  54. package/script/run/handleEnrichment.js +73 -0
  55. package/script/run/toEnrichments.d.ts +12 -0
  56. package/script/run/toEnrichments.d.ts.map +1 -0
  57. package/script/run/toEnrichments.js +30 -0
  58. package/script/run/toSettings.d.ts.map +1 -1
  59. package/script/run/toSettings.js +3 -2
  60. package/script/types/EnrichmentRequest.d.ts +2 -51
  61. package/script/types/EnrichmentRequest.d.ts.map +1 -1
  62. package/script/types/EnrichmentRequest.js +0 -21
  63. package/script/types/Settings.d.ts +140 -24
  64. package/script/types/Settings.d.ts.map +1 -1
  65. package/script/types/Settings.js +7 -3
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.handleEnrichment = void 0;
27
+ const dntShim = __importStar(require("../_dnt.shims.js"));
28
+ const generative_ai_1 = require("@google/generative-ai");
29
+ const apiKey = dntShim.Deno.env.get('GEMINI_API_KEY');
30
+ if (!apiKey) {
31
+ throw new Error('GEMINI_API_KEY is not set');
32
+ }
33
+ const genAI = new generative_ai_1.GoogleGenerativeAI(apiKey);
34
+ const model = genAI.getGenerativeModel({
35
+ model: 'gemini-1.5-flash'
36
+ });
37
+ const handleEnrichment = async ({ prompt, content, responseSchema }) => {
38
+ console.log('PROMPT', prompt);
39
+ console.log('CONTENT', content);
40
+ console.log('RESPONSE SCHEMA', responseSchema);
41
+ const chatSession = model.startChat({
42
+ generationConfig: {
43
+ temperature: 1,
44
+ topP: 0.95,
45
+ topK: 40,
46
+ maxOutputTokens: 8192,
47
+ responseMimeType: 'application/json',
48
+ responseSchema
49
+ },
50
+ history: [
51
+ {
52
+ role: 'user',
53
+ parts: [
54
+ {
55
+ text: "Below is part of an openapi schema.\\n- Does the provided endpoint return paginated data\\n- If it does, please provide an object path to access the response list\n\nPaginatedAbilitySummaryList:\n type: object\n properties:\n count:\n type: integer\n example: 123\n next:\n type: string\n nullable: true\n format: uri\n example: http://api.example.org/accounts/?offset=400&limit=100\n previous:\n type: string\n nullable: true\n format: uri\n example: http://api.example.org/accounts/?offset=200&limit=100\n results:\n type: array\n items:\n $ref: '#/components/schemas/AbilitySummary'"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ role: 'model',
61
+ parts: [
62
+ { text: '```json\n' },
63
+ { text: '{"isPaginated": true, "pathToList": "results"}' },
64
+ { text: '\n```' }
65
+ ]
66
+ }
67
+ ]
68
+ });
69
+ const result = await chatSession.sendMessage(`${prompt}\n\n${content}`);
70
+ console.log('RESULT', result);
71
+ return result.response.text();
72
+ };
73
+ exports.handleEnrichment = handleEnrichment;
@@ -0,0 +1,12 @@
1
+ import type { ModelInsertable } from '../dsl/model/ModelInsertable.js';
2
+ import type { OperationGateway, OperationInsertable } from '../dsl/operation/OperationInsertable.js';
3
+ import type { GeneratedValue } from '../types/GeneratedValue.js';
4
+ import type { OasDocument } from '../oas/document/Document.js';
5
+ type GeneratorsType = OperationGateway | OperationInsertable<GeneratedValue> | ModelInsertable<GeneratedValue>;
6
+ type ToEnrichmentsArgs = {
7
+ generators: GeneratorsType[];
8
+ oasDocument: OasDocument;
9
+ };
10
+ export declare const toEnrichments: ({ generators, oasDocument }: ToEnrichmentsArgs) => Promise<Record<string, unknown>>;
11
+ export {};
12
+ //# sourceMappingURL=toEnrichments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toEnrichments.d.ts","sourceRoot":"","sources":["../../src/run/toEnrichments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AACpG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAI9D,KAAK,cAAc,GACf,gBAAgB,GAChB,mBAAmB,CAAC,cAAc,CAAC,GACnC,eAAe,CAAC,cAAc,CAAC,CAAA;AAEnC,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,aAAa,gCAAuC,iBAAiB,qCA6BjF,CAAA"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toEnrichments = void 0;
4
+ const handleEnrichment_js_1 = require("./handleEnrichment.js");
5
+ const toEnrichments = async ({ generators, oasDocument }) => {
6
+ const output = {};
7
+ for (const generator of generators) {
8
+ if (generator.type === 'operation') {
9
+ for (const operation of oasDocument.operations) {
10
+ const enrichmentRequest = generator.toEnrichmentRequest?.(operation);
11
+ if (enrichmentRequest) {
12
+ const enrichmentResponse = await (0, handleEnrichment_js_1.handleEnrichment)(enrichmentRequest);
13
+ output[`${generator.name}.${operation.path}.${operation.method}.enrichments`] =
14
+ JSON.parse(enrichmentResponse);
15
+ }
16
+ }
17
+ }
18
+ else if (generator.type === 'model') {
19
+ for (const [refName, schema] of Object.entries(oasDocument.components?.schemas ?? {})) {
20
+ const enrichmentRequest = generator.toEnrichmentRequest?.(refName);
21
+ if (enrichmentRequest) {
22
+ const enrichmentResponse = await (0, handleEnrichment_js_1.handleEnrichment)(enrichmentRequest);
23
+ output[`${generator.name}.${refName}.enrichments`] = JSON.parse(enrichmentResponse);
24
+ }
25
+ }
26
+ }
27
+ }
28
+ return output;
29
+ };
30
+ exports.toEnrichments = toEnrichments;
@@ -1 +1 @@
1
- {"version":3,"file":"toSettings.d.ts","sourceRoot":"","sources":["../../src/run/toSettings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAA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,CAAA;AAED,eAAO,MAAM,UAAU,iEAKpB,cAAc,8BA4DhB,CAAA"}
@@ -61,18 +61,19 @@ exports.toSettings = toSettings;
61
61
  const toModels = ({ defaultSelected, oasDocument, modelsSettings }) => {
62
62
  return Object.fromEntries(Object.keys(oasDocument.components?.schemas ?? {}).map(refName => [
63
63
  refName,
64
- modelsSettings?.[refName] ? modelsSettings?.[refName] : defaultSelected
64
+ modelsSettings?.[refName] ? modelsSettings?.[refName] : { selected: defaultSelected }
65
65
  ]));
66
66
  };
67
67
  const toOperations = ({ generator, oasDocument, operationsSettings, defaultSelected }) => {
68
68
  return Object.values(oasDocument.operations)
69
69
  .filter(operation => generator.isSupported(operation))
70
70
  .reduce((acc, operation) => {
71
+ const enrichmentRequests = generator.toEnrichmentRequest?.(operation);
71
72
  const { path, method } = operation;
72
73
  acc[path] = acc[path] ?? {};
73
74
  acc[path][method] = operationsSettings?.[path]?.[method]
74
75
  ? operationsSettings?.[path]?.[method]
75
- : defaultSelected;
76
+ : { selected: defaultSelected };
76
77
  return acc;
77
78
  }, {});
78
79
  };
@@ -1,57 +1,8 @@
1
1
  import "../_dnt.polyfills.js";
2
+ import type { ResponseSchema } from '@google/generative-ai';
2
3
  export type EnrichmentRequest = {
3
4
  prompt: string;
4
- responseSchema: EnrichmentResponseSchema;
5
+ responseSchema: ResponseSchema;
5
6
  content: string;
6
7
  };
7
- /**
8
- * Contains the list of OpenAPI data types
9
- * as defined by https://swagger.io/docs/specification/data-models/data-types/
10
- * @public
11
- */
12
- export declare enum EnrichmentResponseSchemaType {
13
- /** String type. */
14
- STRING = "string",
15
- /** Number type. */
16
- NUMBER = "number",
17
- /** Integer type. */
18
- INTEGER = "integer",
19
- /** Boolean type. */
20
- BOOLEAN = "boolean",
21
- /** Array type. */
22
- ARRAY = "array",
23
- /** Object type. */
24
- OBJECT = "object"
25
- }
26
- /**
27
- * Schema is used to define the format of input/output data.
28
- * Represents a select subset of an OpenAPI 3.0 schema object.
29
- * More fields may be added in the future as needed.
30
- * @public
31
- */
32
- export interface EnrichmentResponseSchema {
33
- /**
34
- * Optional. The type of the property. {@link
35
- * SchemaType}.
36
- */
37
- type?: EnrichmentResponseSchemaType;
38
- /** Optional. The format of the property. */
39
- format?: string;
40
- /** Optional. The description of the property. */
41
- description?: string;
42
- /** Optional. Whether the property is nullable. */
43
- nullable?: boolean;
44
- /** Optional. The items of the property. */
45
- items?: EnrichmentResponseSchema;
46
- /** Optional. The enum of the property. */
47
- enum?: string[];
48
- /** Optional. Map of {@link Schema}. */
49
- properties?: {
50
- [k: string]: EnrichmentResponseSchema;
51
- };
52
- /** Optional. Array of required property. */
53
- required?: string[];
54
- /** Optional. The example of the property. */
55
- example?: unknown;
56
- }
57
8
  //# sourceMappingURL=EnrichmentRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnrichmentRequest.d.ts","sourceRoot":"","sources":["../../src/types/EnrichmentRequest.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,wBAAwB,CAAA;IACxC,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;GAIG;AACH,oBAAY,4BAA4B;IACtC,mBAAmB;IACnB,MAAM,WAAW;IACjB,mBAAmB;IACnB,MAAM,WAAW;IACjB,oBAAoB;IACpB,OAAO,YAAY;IACnB,oBAAoB;IACpB,OAAO,YAAY;IACnB,kBAAkB;IAClB,KAAK,UAAU;IACf,mBAAmB;IACnB,MAAM,WAAW;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,4BAA4B,CAAA;IACnC,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,wBAAwB,CAAA;IAChC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,uCAAuC;IACvC,UAAU,CAAC,EAAE;QACX,CAAC,CAAC,EAAE,MAAM,GAAG,wBAAwB,CAAA;KACtC,CAAA;IACD,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
1
+ {"version":3,"file":"EnrichmentRequest.d.ts","sourceRoot":"","sources":["../../src/types/EnrichmentRequest.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,cAAc,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
@@ -1,24 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnrichmentResponseSchemaType = void 0;
4
3
  require("../_dnt.polyfills.js");
5
- /**
6
- * Contains the list of OpenAPI data types
7
- * as defined by https://swagger.io/docs/specification/data-models/data-types/
8
- * @public
9
- */
10
- var EnrichmentResponseSchemaType;
11
- (function (EnrichmentResponseSchemaType) {
12
- /** String type. */
13
- EnrichmentResponseSchemaType["STRING"] = "string";
14
- /** Number type. */
15
- EnrichmentResponseSchemaType["NUMBER"] = "number";
16
- /** Integer type. */
17
- EnrichmentResponseSchemaType["INTEGER"] = "integer";
18
- /** Boolean type. */
19
- EnrichmentResponseSchemaType["BOOLEAN"] = "boolean";
20
- /** Array type. */
21
- EnrichmentResponseSchemaType["ARRAY"] = "array";
22
- /** Object type. */
23
- EnrichmentResponseSchemaType["OBJECT"] = "object";
24
- })(EnrichmentResponseSchemaType || (exports.EnrichmentResponseSchemaType = EnrichmentResponseSchemaType = {}));
@@ -1,37 +1,81 @@
1
1
  import "../_dnt.polyfills.js";
2
2
  import { type Method } from './Method.js';
3
3
  import { z } from 'zod';
4
+ export declare const enrichedSetting: z.ZodObject<{
5
+ selected: z.ZodBoolean;
6
+ enrichments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ selected: boolean;
9
+ enrichments?: Record<string, unknown> | undefined;
10
+ }, {
11
+ selected: boolean;
12
+ enrichments?: Record<string, unknown> | undefined;
13
+ }>;
14
+ export type EnrichedSetting = {
15
+ selected: boolean;
16
+ enrichments?: Record<string, unknown>;
17
+ };
4
18
  export declare const operationsGeneratorSettings: z.ZodObject<{
5
19
  id: z.ZodString;
6
20
  description: z.ZodOptional<z.ZodString>;
7
- operations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodType<Method, z.ZodTypeDef, Method>, z.ZodBoolean>>;
21
+ operations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodType<Method, z.ZodTypeDef, Method>, z.ZodObject<{
22
+ selected: z.ZodBoolean;
23
+ enrichments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ selected: boolean;
26
+ enrichments?: Record<string, unknown> | undefined;
27
+ }, {
28
+ selected: boolean;
29
+ enrichments?: Record<string, unknown> | undefined;
30
+ }>>>;
8
31
  }, "strip", z.ZodTypeAny, {
9
- operations: Record<string, Partial<Record<Method, boolean>>>;
32
+ operations: Record<string, Partial<Record<Method, {
33
+ selected: boolean;
34
+ enrichments?: Record<string, unknown> | undefined;
35
+ }>>>;
10
36
  id: string;
11
37
  description?: string | undefined;
12
38
  }, {
13
- operations: Record<string, Partial<Record<Method, boolean>>>;
39
+ operations: Record<string, Partial<Record<Method, {
40
+ selected: boolean;
41
+ enrichments?: Record<string, unknown> | undefined;
42
+ }>>>;
14
43
  id: string;
15
44
  description?: string | undefined;
16
45
  }>;
17
46
  export type OperationsGeneratorSettings = {
18
47
  id: string;
19
48
  description?: string;
20
- operations: Record<string, Partial<Record<Method, boolean>>>;
49
+ operations: Record<string, Partial<Record<Method, EnrichedSetting>>>;
21
50
  };
22
51
  export declare const modelsGeneratorSettings: z.ZodObject<{
23
52
  id: z.ZodString;
24
53
  exportPath: z.ZodOptional<z.ZodString>;
25
54
  description: z.ZodOptional<z.ZodString>;
26
- models: z.ZodRecord<z.ZodString, z.ZodBoolean>;
55
+ models: z.ZodRecord<z.ZodString, z.ZodObject<{
56
+ selected: z.ZodBoolean;
57
+ enrichments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ selected: boolean;
60
+ enrichments?: Record<string, unknown> | undefined;
61
+ }, {
62
+ selected: boolean;
63
+ enrichments?: Record<string, unknown> | undefined;
64
+ }>>;
27
65
  }, "strip", z.ZodTypeAny, {
28
66
  id: string;
29
- models: Record<string, boolean>;
67
+ models: Record<string, {
68
+ selected: boolean;
69
+ enrichments?: Record<string, unknown> | undefined;
70
+ }>;
30
71
  description?: string | undefined;
31
72
  exportPath?: string | undefined;
32
73
  }, {
33
74
  id: string;
34
- models: Record<string, boolean>;
75
+ models: Record<string, {
76
+ selected: boolean;
77
+ enrichments?: Record<string, unknown> | undefined;
78
+ }>;
35
79
  description?: string | undefined;
36
80
  exportPath?: string | undefined;
37
81
  }>;
@@ -39,33 +83,63 @@ export type ModelsGeneratorSettings = {
39
83
  id: string;
40
84
  exportPath?: string;
41
85
  description?: string;
42
- models: Record<string, boolean>;
86
+ models: Record<string, EnrichedSetting>;
43
87
  };
44
88
  export declare const clientGeneratorSettings: z.ZodUnion<[z.ZodObject<{
45
89
  id: z.ZodString;
46
90
  description: z.ZodOptional<z.ZodString>;
47
- operations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodType<Method, z.ZodTypeDef, Method>, z.ZodBoolean>>;
91
+ operations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodType<Method, z.ZodTypeDef, Method>, z.ZodObject<{
92
+ selected: z.ZodBoolean;
93
+ enrichments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ selected: boolean;
96
+ enrichments?: Record<string, unknown> | undefined;
97
+ }, {
98
+ selected: boolean;
99
+ enrichments?: Record<string, unknown> | undefined;
100
+ }>>>;
48
101
  }, "strip", z.ZodTypeAny, {
49
- operations: Record<string, Partial<Record<Method, boolean>>>;
102
+ operations: Record<string, Partial<Record<Method, {
103
+ selected: boolean;
104
+ enrichments?: Record<string, unknown> | undefined;
105
+ }>>>;
50
106
  id: string;
51
107
  description?: string | undefined;
52
108
  }, {
53
- operations: Record<string, Partial<Record<Method, boolean>>>;
109
+ operations: Record<string, Partial<Record<Method, {
110
+ selected: boolean;
111
+ enrichments?: Record<string, unknown> | undefined;
112
+ }>>>;
54
113
  id: string;
55
114
  description?: string | undefined;
56
115
  }>, z.ZodObject<{
57
116
  id: z.ZodString;
58
117
  exportPath: z.ZodOptional<z.ZodString>;
59
118
  description: z.ZodOptional<z.ZodString>;
60
- models: z.ZodRecord<z.ZodString, z.ZodBoolean>;
119
+ models: z.ZodRecord<z.ZodString, z.ZodObject<{
120
+ selected: z.ZodBoolean;
121
+ enrichments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
122
+ }, "strip", z.ZodTypeAny, {
123
+ selected: boolean;
124
+ enrichments?: Record<string, unknown> | undefined;
125
+ }, {
126
+ selected: boolean;
127
+ enrichments?: Record<string, unknown> | undefined;
128
+ }>>;
61
129
  }, "strip", z.ZodTypeAny, {
62
130
  id: string;
63
- models: Record<string, boolean>;
131
+ models: Record<string, {
132
+ selected: boolean;
133
+ enrichments?: Record<string, unknown> | undefined;
134
+ }>;
64
135
  description?: string | undefined;
65
136
  exportPath?: string | undefined;
66
137
  }, {
67
138
  id: string;
68
- models: Record<string, boolean>;
139
+ models: Record<string, {
140
+ selected: boolean;
141
+ enrichments?: Record<string, unknown> | undefined;
142
+ }>;
69
143
  description?: string | undefined;
70
144
  exportPath?: string | undefined;
71
145
  }>]>;
@@ -99,39 +173,75 @@ export declare const clientSettings: z.ZodObject<{
99
173
  generators: z.ZodArray<z.ZodUnion<[z.ZodObject<{
100
174
  id: z.ZodString;
101
175
  description: z.ZodOptional<z.ZodString>;
102
- operations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodType<Method, z.ZodTypeDef, Method>, z.ZodBoolean>>;
176
+ operations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodType<Method, z.ZodTypeDef, Method>, z.ZodObject<{
177
+ selected: z.ZodBoolean;
178
+ enrichments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ selected: boolean;
181
+ enrichments?: Record<string, unknown> | undefined;
182
+ }, {
183
+ selected: boolean;
184
+ enrichments?: Record<string, unknown> | undefined;
185
+ }>>>;
103
186
  }, "strip", z.ZodTypeAny, {
104
- operations: Record<string, Partial<Record<Method, boolean>>>;
187
+ operations: Record<string, Partial<Record<Method, {
188
+ selected: boolean;
189
+ enrichments?: Record<string, unknown> | undefined;
190
+ }>>>;
105
191
  id: string;
106
192
  description?: string | undefined;
107
193
  }, {
108
- operations: Record<string, Partial<Record<Method, boolean>>>;
194
+ operations: Record<string, Partial<Record<Method, {
195
+ selected: boolean;
196
+ enrichments?: Record<string, unknown> | undefined;
197
+ }>>>;
109
198
  id: string;
110
199
  description?: string | undefined;
111
200
  }>, z.ZodObject<{
112
201
  id: z.ZodString;
113
202
  exportPath: z.ZodOptional<z.ZodString>;
114
203
  description: z.ZodOptional<z.ZodString>;
115
- models: z.ZodRecord<z.ZodString, z.ZodBoolean>;
204
+ models: z.ZodRecord<z.ZodString, z.ZodObject<{
205
+ selected: z.ZodBoolean;
206
+ enrichments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
207
+ }, "strip", z.ZodTypeAny, {
208
+ selected: boolean;
209
+ enrichments?: Record<string, unknown> | undefined;
210
+ }, {
211
+ selected: boolean;
212
+ enrichments?: Record<string, unknown> | undefined;
213
+ }>>;
116
214
  }, "strip", z.ZodTypeAny, {
117
215
  id: string;
118
- models: Record<string, boolean>;
216
+ models: Record<string, {
217
+ selected: boolean;
218
+ enrichments?: Record<string, unknown> | undefined;
219
+ }>;
119
220
  description?: string | undefined;
120
221
  exportPath?: string | undefined;
121
222
  }, {
122
223
  id: string;
123
- models: Record<string, boolean>;
224
+ models: Record<string, {
225
+ selected: boolean;
226
+ enrichments?: Record<string, unknown> | undefined;
227
+ }>;
124
228
  description?: string | undefined;
125
229
  exportPath?: string | undefined;
126
230
  }>]>, "many">;
127
231
  }, "strip", z.ZodTypeAny, {
128
232
  generators: ({
129
- operations: Record<string, Partial<Record<Method, boolean>>>;
233
+ operations: Record<string, Partial<Record<Method, {
234
+ selected: boolean;
235
+ enrichments?: Record<string, unknown> | undefined;
236
+ }>>>;
130
237
  id: string;
131
238
  description?: string | undefined;
132
239
  } | {
133
240
  id: string;
134
- models: Record<string, boolean>;
241
+ models: Record<string, {
242
+ selected: boolean;
243
+ enrichments?: Record<string, unknown> | undefined;
244
+ }>;
135
245
  description?: string | undefined;
136
246
  exportPath?: string | undefined;
137
247
  })[];
@@ -142,12 +252,18 @@ export declare const clientSettings: z.ZodObject<{
142
252
  }[] | undefined;
143
253
  }, {
144
254
  generators: ({
145
- operations: Record<string, Partial<Record<Method, boolean>>>;
255
+ operations: Record<string, Partial<Record<Method, {
256
+ selected: boolean;
257
+ enrichments?: Record<string, unknown> | undefined;
258
+ }>>>;
146
259
  id: string;
147
260
  description?: string | undefined;
148
261
  } | {
149
262
  id: string;
150
- models: Record<string, boolean>;
263
+ models: Record<string, {
264
+ selected: boolean;
265
+ enrichments?: Record<string, unknown> | undefined;
266
+ }>;
151
267
  description?: string | undefined;
152
268
  exportPath?: string | undefined;
153
269
  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MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAKzD,CAAA;AAEF,eAAO,MAAM,aAAa,mCAAiC,CAAA;AAE3D,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,OAAO,CAAA;AAEjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA"}
@@ -1,19 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.skmtcStackConfig = exports.generatorType = exports.skmtcClientConfig = exports.clientSettings = exports.modulePackage = exports.clientGeneratorSettings = exports.modelsGeneratorSettings = exports.operationsGeneratorSettings = void 0;
3
+ exports.skmtcStackConfig = exports.generatorType = exports.skmtcClientConfig = exports.clientSettings = exports.modulePackage = exports.clientGeneratorSettings = exports.modelsGeneratorSettings = exports.operationsGeneratorSettings = exports.enrichedSetting = void 0;
4
4
  require("../_dnt.polyfills.js");
5
5
  const Method_js_1 = require("./Method.js");
6
6
  const zod_1 = require("zod");
7
+ exports.enrichedSetting = zod_1.z.object({
8
+ selected: zod_1.z.boolean(),
9
+ enrichments: zod_1.z.record(zod_1.z.unknown()).optional()
10
+ });
7
11
  exports.operationsGeneratorSettings = zod_1.z.object({
8
12
  id: zod_1.z.string(),
9
13
  description: zod_1.z.string().optional(),
10
- operations: zod_1.z.record(zod_1.z.record(Method_js_1.method, zod_1.z.boolean()))
14
+ operations: zod_1.z.record(zod_1.z.record(Method_js_1.method, exports.enrichedSetting))
11
15
  });
12
16
  exports.modelsGeneratorSettings = zod_1.z.object({
13
17
  id: zod_1.z.string(),
14
18
  exportPath: zod_1.z.string().optional(),
15
19
  description: zod_1.z.string().optional(),
16
- models: zod_1.z.record(zod_1.z.boolean())
20
+ models: zod_1.z.record(exports.enrichedSetting)
17
21
  });
18
22
  exports.clientGeneratorSettings = zod_1.z.union([
19
23
  exports.operationsGeneratorSettings,