@skmtc/core 0.0.555 → 0.0.557

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 (59) hide show
  1. package/esm/context/GenerateContext.d.ts +2 -12
  2. package/esm/context/GenerateContext.d.ts.map +1 -1
  3. package/esm/context/GenerateContext.js +32 -100
  4. package/esm/context/RenderContext.d.ts.map +1 -1
  5. package/esm/context/RenderContext.js +3 -4
  6. package/esm/dsl/operation/OperationInsertable.d.ts +0 -16
  7. package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -1
  8. package/esm/dsl/operation/toOperationInsertable.js +2 -2
  9. package/esm/mod.d.ts +0 -2
  10. package/esm/mod.d.ts.map +1 -1
  11. package/esm/mod.js +0 -2
  12. package/esm/run/handleEnrichment.d.ts +1 -1
  13. package/esm/run/handleEnrichment.d.ts.map +1 -1
  14. package/esm/run/handleEnrichment.js +3 -3
  15. package/esm/run/toSettings.d.ts.map +1 -1
  16. package/esm/run/toSettings.js +7 -27
  17. package/esm/types/EnrichmentRequest.d.ts +1 -1
  18. package/esm/types/EnrichmentRequest.d.ts.map +1 -1
  19. package/esm/types/GeneratorType.d.ts +1 -2
  20. package/esm/types/GeneratorType.d.ts.map +1 -1
  21. package/esm/types/Manifest.d.ts +18 -27
  22. package/esm/types/Manifest.d.ts.map +1 -1
  23. package/esm/types/Manifest.js +2 -3
  24. package/package.json +1 -1
  25. package/script/context/GenerateContext.d.ts +2 -12
  26. package/script/context/GenerateContext.d.ts.map +1 -1
  27. package/script/context/GenerateContext.js +32 -100
  28. package/script/context/RenderContext.d.ts.map +1 -1
  29. package/script/context/RenderContext.js +3 -4
  30. package/script/dsl/operation/OperationInsertable.d.ts +0 -16
  31. package/script/dsl/operation/OperationInsertable.d.ts.map +1 -1
  32. package/script/dsl/operation/toOperationInsertable.js +2 -2
  33. package/script/mod.d.ts +0 -2
  34. package/script/mod.d.ts.map +1 -1
  35. package/script/mod.js +0 -2
  36. package/script/run/handleEnrichment.d.ts +1 -1
  37. package/script/run/handleEnrichment.d.ts.map +1 -1
  38. package/script/run/handleEnrichment.js +3 -3
  39. package/script/run/toSettings.d.ts.map +1 -1
  40. package/script/run/toSettings.js +7 -27
  41. package/script/types/EnrichmentRequest.d.ts +1 -1
  42. package/script/types/EnrichmentRequest.d.ts.map +1 -1
  43. package/script/types/GeneratorType.d.ts +1 -2
  44. package/script/types/GeneratorType.d.ts.map +1 -1
  45. package/script/types/Manifest.d.ts +18 -27
  46. package/script/types/Manifest.d.ts.map +1 -1
  47. package/script/types/Manifest.js +2 -3
  48. package/esm/dsl/GatewayBase.d.ts +0 -13
  49. package/esm/dsl/GatewayBase.d.ts.map +0 -1
  50. package/esm/dsl/GatewayBase.js +0 -19
  51. package/esm/dsl/operation/toOperationGateway.d.ts +0 -39
  52. package/esm/dsl/operation/toOperationGateway.d.ts.map +0 -1
  53. package/esm/dsl/operation/toOperationGateway.js +0 -84
  54. package/script/dsl/GatewayBase.d.ts +0 -13
  55. package/script/dsl/GatewayBase.d.ts.map +0 -1
  56. package/script/dsl/GatewayBase.js +0 -23
  57. package/script/dsl/operation/toOperationGateway.d.ts +0 -39
  58. package/script/dsl/operation/toOperationGateway.d.ts.map +0 -1
  59. package/script/dsl/operation/toOperationGateway.js +0 -88
@@ -1,13 +0,0 @@
1
- import type { GenerateContext, RegisterArgs } from '../context/GenerateContext.js';
2
- import type { ContentSettings } from './ContentSettings.js';
3
- import { ValueBase } from './ValueBase.js';
4
- export type OperationGatewayArgs = {
5
- context: GenerateContext;
6
- settings: ContentSettings<undefined>;
7
- };
8
- export declare class GatewayBase extends ValueBase {
9
- settings: ContentSettings<undefined>;
10
- constructor({ context, settings }: OperationGatewayArgs);
11
- register(args: Omit<RegisterArgs, 'destinationPath'>): void;
12
- }
13
- //# sourceMappingURL=GatewayBase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GatewayBase.d.ts","sourceRoot":"","sources":["../../src/dsl/GatewayBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CACrC,CAAA;AAED,qBAAa,WAAY,SAAQ,SAAS;IACxC,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;gBAExB,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,oBAAoB;IAM9C,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC;CAM9D"}
@@ -1,19 +0,0 @@
1
- import { ValueBase } from './ValueBase.js';
2
- export class GatewayBase extends ValueBase {
3
- constructor({ context, settings }) {
4
- super({ context });
5
- Object.defineProperty(this, "settings", {
6
- enumerable: true,
7
- configurable: true,
8
- writable: true,
9
- value: void 0
10
- });
11
- this.settings = settings;
12
- }
13
- register(args) {
14
- this.context.register({
15
- ...args,
16
- destinationPath: this.settings.exportPath
17
- });
18
- }
19
- }
@@ -1,39 +0,0 @@
1
- import type { OasOperation } from '../../oas/operation/Operation.js';
2
- import { type OperationGatewayArgs } from '../GatewayBase.js';
3
- import type { Identifier } from '../Identifier.js';
4
- import type { EnrichmentRequest } from '../../types/EnrichmentRequest.js';
5
- import type { IsSupportedOperationConfigArgs, IsSupportedOperationArgs } from './OperationInsertable.js';
6
- import type { GenerateContext } from '../../context/GenerateContext.js';
7
- import type { z } from 'zod';
8
- export type ToOperationGatewayArgs<EnrichmentType> = {
9
- id: string;
10
- toIdentifier: () => Identifier;
11
- toExportPath: () => string;
12
- isSupported?: ({ context, operation, enrichments }: IsSupportedOperationConfigArgs<EnrichmentType>) => boolean;
13
- toEnrichmentRequest?: <RequestedEnrichment extends EnrichmentType>(operation: OasOperation) => EnrichmentRequest<RequestedEnrichment> | undefined;
14
- toEnrichmentSchema: () => z.ZodType<EnrichmentType>;
15
- };
16
- type ToEnrichmentsArgs = {
17
- operation: OasOperation;
18
- context: GenerateContext;
19
- };
20
- export declare const toOperationGateway: <EnrichmentType>(config: ToOperationGatewayArgs<EnrichmentType>) => {
21
- new ({ context, settings }: OperationGatewayArgs): {
22
- settings: import("../ContentSettings.js").ContentSettings<undefined>;
23
- register(args: Omit<import("../../context/GenerateContext.js").RegisterArgs, "destinationPath">): void;
24
- context: GenerateContext;
25
- skipped: boolean;
26
- generatorKey: import("../../mod.js").GeneratorKey | undefined;
27
- };
28
- id: string;
29
- type: "operation";
30
- _class: "OperationGateway";
31
- toIdentifier: () => Identifier;
32
- toExportPath: () => string;
33
- toEnrichmentRequest: (<RequestedEnrichment extends EnrichmentType>(operation: OasOperation) => EnrichmentRequest<RequestedEnrichment> | undefined) | undefined;
34
- toEnrichmentSchema: () => z.ZodType<EnrichmentType>;
35
- toEnrichments: ({ operation, context }: ToEnrichmentsArgs) => EnrichmentType;
36
- isSupported: ({ context, operation }: IsSupportedOperationArgs) => boolean;
37
- };
38
- export {};
39
- //# sourceMappingURL=toOperationGateway.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toOperationGateway.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EACV,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,MAAM,MAAM,sBAAsB,CAAC,cAAc,IAAI;IACnD,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,UAAU,CAAA;IAC9B,YAAY,EAAE,MAAM,MAAM,CAAA;IAC1B,WAAW,CAAC,EAAE,CAAC,EACb,OAAO,EACP,SAAS,EACT,WAAW,EACZ,EAAE,8BAA8B,CAAC,cAAc,CAAC,KAAK,OAAO,CAAA;IAC7D,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,SAAS,cAAc,EAC/D,SAAS,EAAE,YAAY,KACpB,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAA;IACvD,kBAAkB,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;CACpD,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,cAAc,UACvC,sBAAsB,CAAC,cAAc,CAAC;gCAkCT,oBAAoB;;;;;;;;;;wBArDrC,UAAU;wBACV,MAAM;2BAMH,mBAAmB,oCAC7B,YAAY,KACpB,iBAAiB,qBAAqB,GAAG,SAAS;8BAC7B,CAAC,CAAC,OAAO,gBAAgB;4CAqBD,iBAAiB,KAAG,cAAc;0CAYpC,wBAAwB;CAgBzE,CAAA"}
@@ -1,84 +0,0 @@
1
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
2
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
3
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
4
- };
5
- import { GatewayBase } from '../GatewayBase.js';
6
- export const toOperationGateway = (config) => {
7
- var _a;
8
- const OperationGateway = (_a = class extends GatewayBase {
9
- constructor({ context, settings }) {
10
- super({ context, settings });
11
- }
12
- },
13
- __setFunctionName(_a, "OperationGateway"),
14
- Object.defineProperty(_a, "id", {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value: config.id
19
- }),
20
- Object.defineProperty(_a, "type", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: 'operation'
25
- }),
26
- Object.defineProperty(_a, "_class", {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: 'OperationGateway'
31
- }),
32
- Object.defineProperty(_a, "toIdentifier", {
33
- enumerable: true,
34
- configurable: true,
35
- writable: true,
36
- value: config.toIdentifier.bind(config)
37
- }),
38
- Object.defineProperty(_a, "toExportPath", {
39
- enumerable: true,
40
- configurable: true,
41
- writable: true,
42
- value: config.toExportPath.bind(config)
43
- }),
44
- Object.defineProperty(_a, "toEnrichmentRequest", {
45
- enumerable: true,
46
- configurable: true,
47
- writable: true,
48
- value: config.toEnrichmentRequest?.bind(config)
49
- }),
50
- Object.defineProperty(_a, "toEnrichmentSchema", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: config.toEnrichmentSchema.bind(config)
55
- }),
56
- Object.defineProperty(_a, "toEnrichments", {
57
- enumerable: true,
58
- configurable: true,
59
- writable: true,
60
- value: ({ operation, context }) => {
61
- const generatorSettings = context.toOperationSettings({
62
- generatorId: config.id,
63
- path: operation.path,
64
- method: operation.method
65
- });
66
- const responseSchema = config.toEnrichmentSchema?.();
67
- return responseSchema?.parse(generatorSettings.enrichments);
68
- }
69
- }),
70
- Object.defineProperty(_a, "isSupported", {
71
- enumerable: true,
72
- configurable: true,
73
- writable: true,
74
- value: ({ context, operation }) => {
75
- if (typeof config.isSupported !== 'function') {
76
- return true;
77
- }
78
- const enrichments = OperationGateway.toEnrichments({ operation, context });
79
- return config.isSupported({ context, operation, enrichments });
80
- }
81
- }),
82
- _a);
83
- return OperationGateway;
84
- };
@@ -1,13 +0,0 @@
1
- import type { GenerateContext, RegisterArgs } from '../context/GenerateContext.js';
2
- import type { ContentSettings } from './ContentSettings.js';
3
- import { ValueBase } from './ValueBase.js';
4
- export type OperationGatewayArgs = {
5
- context: GenerateContext;
6
- settings: ContentSettings<undefined>;
7
- };
8
- export declare class GatewayBase extends ValueBase {
9
- settings: ContentSettings<undefined>;
10
- constructor({ context, settings }: OperationGatewayArgs);
11
- register(args: Omit<RegisterArgs, 'destinationPath'>): void;
12
- }
13
- //# sourceMappingURL=GatewayBase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GatewayBase.d.ts","sourceRoot":"","sources":["../../src/dsl/GatewayBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CACrC,CAAA;AAED,qBAAa,WAAY,SAAQ,SAAS;IACxC,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;gBAExB,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,oBAAoB;IAM9C,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC;CAM9D"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GatewayBase = void 0;
4
- const ValueBase_js_1 = require("./ValueBase.js");
5
- class GatewayBase extends ValueBase_js_1.ValueBase {
6
- constructor({ context, settings }) {
7
- super({ context });
8
- Object.defineProperty(this, "settings", {
9
- enumerable: true,
10
- configurable: true,
11
- writable: true,
12
- value: void 0
13
- });
14
- this.settings = settings;
15
- }
16
- register(args) {
17
- this.context.register({
18
- ...args,
19
- destinationPath: this.settings.exportPath
20
- });
21
- }
22
- }
23
- exports.GatewayBase = GatewayBase;
@@ -1,39 +0,0 @@
1
- import type { OasOperation } from '../../oas/operation/Operation.js';
2
- import { type OperationGatewayArgs } from '../GatewayBase.js';
3
- import type { Identifier } from '../Identifier.js';
4
- import type { EnrichmentRequest } from '../../types/EnrichmentRequest.js';
5
- import type { IsSupportedOperationConfigArgs, IsSupportedOperationArgs } from './OperationInsertable.js';
6
- import type { GenerateContext } from '../../context/GenerateContext.js';
7
- import type { z } from 'zod';
8
- export type ToOperationGatewayArgs<EnrichmentType> = {
9
- id: string;
10
- toIdentifier: () => Identifier;
11
- toExportPath: () => string;
12
- isSupported?: ({ context, operation, enrichments }: IsSupportedOperationConfigArgs<EnrichmentType>) => boolean;
13
- toEnrichmentRequest?: <RequestedEnrichment extends EnrichmentType>(operation: OasOperation) => EnrichmentRequest<RequestedEnrichment> | undefined;
14
- toEnrichmentSchema: () => z.ZodType<EnrichmentType>;
15
- };
16
- type ToEnrichmentsArgs = {
17
- operation: OasOperation;
18
- context: GenerateContext;
19
- };
20
- export declare const toOperationGateway: <EnrichmentType>(config: ToOperationGatewayArgs<EnrichmentType>) => {
21
- new ({ context, settings }: OperationGatewayArgs): {
22
- settings: import("../ContentSettings.js").ContentSettings<undefined>;
23
- register(args: Omit<import("../../context/GenerateContext.js").RegisterArgs, "destinationPath">): void;
24
- context: GenerateContext;
25
- skipped: boolean;
26
- generatorKey: import("../../mod.js").GeneratorKey | undefined;
27
- };
28
- id: string;
29
- type: "operation";
30
- _class: "OperationGateway";
31
- toIdentifier: () => Identifier;
32
- toExportPath: () => string;
33
- toEnrichmentRequest: (<RequestedEnrichment extends EnrichmentType>(operation: OasOperation) => EnrichmentRequest<RequestedEnrichment> | undefined) | undefined;
34
- toEnrichmentSchema: () => z.ZodType<EnrichmentType>;
35
- toEnrichments: ({ operation, context }: ToEnrichmentsArgs) => EnrichmentType;
36
- isSupported: ({ context, operation }: IsSupportedOperationArgs) => boolean;
37
- };
38
- export {};
39
- //# sourceMappingURL=toOperationGateway.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toOperationGateway.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EACV,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,MAAM,MAAM,sBAAsB,CAAC,cAAc,IAAI;IACnD,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,UAAU,CAAA;IAC9B,YAAY,EAAE,MAAM,MAAM,CAAA;IAC1B,WAAW,CAAC,EAAE,CAAC,EACb,OAAO,EACP,SAAS,EACT,WAAW,EACZ,EAAE,8BAA8B,CAAC,cAAc,CAAC,KAAK,OAAO,CAAA;IAC7D,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,SAAS,cAAc,EAC/D,SAAS,EAAE,YAAY,KACpB,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAA;IACvD,kBAAkB,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;CACpD,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,cAAc,UACvC,sBAAsB,CAAC,cAAc,CAAC;gCAkCT,oBAAoB;;;;;;;;;;wBArDrC,UAAU;wBACV,MAAM;2BAMH,mBAAmB,oCAC7B,YAAY,KACpB,iBAAiB,qBAAqB,GAAG,SAAS;8BAC7B,CAAC,CAAC,OAAO,gBAAgB;4CAqBD,iBAAiB,KAAG,cAAc;0CAYpC,wBAAwB;CAgBzE,CAAA"}
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
3
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
4
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.toOperationGateway = void 0;
8
- const GatewayBase_js_1 = require("../GatewayBase.js");
9
- const toOperationGateway = (config) => {
10
- var _a;
11
- const OperationGateway = (_a = class extends GatewayBase_js_1.GatewayBase {
12
- constructor({ context, settings }) {
13
- super({ context, settings });
14
- }
15
- },
16
- __setFunctionName(_a, "OperationGateway"),
17
- Object.defineProperty(_a, "id", {
18
- enumerable: true,
19
- configurable: true,
20
- writable: true,
21
- value: config.id
22
- }),
23
- Object.defineProperty(_a, "type", {
24
- enumerable: true,
25
- configurable: true,
26
- writable: true,
27
- value: 'operation'
28
- }),
29
- Object.defineProperty(_a, "_class", {
30
- enumerable: true,
31
- configurable: true,
32
- writable: true,
33
- value: 'OperationGateway'
34
- }),
35
- Object.defineProperty(_a, "toIdentifier", {
36
- enumerable: true,
37
- configurable: true,
38
- writable: true,
39
- value: config.toIdentifier.bind(config)
40
- }),
41
- Object.defineProperty(_a, "toExportPath", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: config.toExportPath.bind(config)
46
- }),
47
- Object.defineProperty(_a, "toEnrichmentRequest", {
48
- enumerable: true,
49
- configurable: true,
50
- writable: true,
51
- value: config.toEnrichmentRequest?.bind(config)
52
- }),
53
- Object.defineProperty(_a, "toEnrichmentSchema", {
54
- enumerable: true,
55
- configurable: true,
56
- writable: true,
57
- value: config.toEnrichmentSchema.bind(config)
58
- }),
59
- Object.defineProperty(_a, "toEnrichments", {
60
- enumerable: true,
61
- configurable: true,
62
- writable: true,
63
- value: ({ operation, context }) => {
64
- const generatorSettings = context.toOperationSettings({
65
- generatorId: config.id,
66
- path: operation.path,
67
- method: operation.method
68
- });
69
- const responseSchema = config.toEnrichmentSchema?.();
70
- return responseSchema?.parse(generatorSettings.enrichments);
71
- }
72
- }),
73
- Object.defineProperty(_a, "isSupported", {
74
- enumerable: true,
75
- configurable: true,
76
- writable: true,
77
- value: ({ context, operation }) => {
78
- if (typeof config.isSupported !== 'function') {
79
- return true;
80
- }
81
- const enrichments = OperationGateway.toEnrichments({ operation, context });
82
- return config.isSupported({ context, operation, enrichments });
83
- }
84
- }),
85
- _a);
86
- return OperationGateway;
87
- };
88
- exports.toOperationGateway = toOperationGateway;