@skmtc/core 0.0.556 → 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.
- package/esm/context/GenerateContext.d.ts +2 -12
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +32 -100
- package/esm/dsl/operation/OperationInsertable.d.ts +0 -16
- package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationInsertable.js +2 -2
- package/esm/mod.d.ts +0 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +0 -2
- package/esm/run/handleEnrichment.d.ts +1 -1
- package/esm/run/handleEnrichment.d.ts.map +1 -1
- package/esm/run/handleEnrichment.js +3 -3
- package/esm/run/toSettings.d.ts.map +1 -1
- package/esm/run/toSettings.js +7 -27
- package/esm/types/EnrichmentRequest.d.ts +1 -1
- package/esm/types/EnrichmentRequest.d.ts.map +1 -1
- package/esm/types/GeneratorType.d.ts +1 -2
- package/esm/types/GeneratorType.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +2 -12
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +32 -100
- package/script/dsl/operation/OperationInsertable.d.ts +0 -16
- package/script/dsl/operation/OperationInsertable.d.ts.map +1 -1
- package/script/dsl/operation/toOperationInsertable.js +2 -2
- package/script/mod.d.ts +0 -2
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +0 -2
- package/script/run/handleEnrichment.d.ts +1 -1
- package/script/run/handleEnrichment.d.ts.map +1 -1
- package/script/run/handleEnrichment.js +3 -3
- package/script/run/toSettings.d.ts.map +1 -1
- package/script/run/toSettings.js +7 -27
- package/script/types/EnrichmentRequest.d.ts +1 -1
- package/script/types/EnrichmentRequest.d.ts.map +1 -1
- package/script/types/GeneratorType.d.ts +1 -2
- package/script/types/GeneratorType.d.ts.map +1 -1
- package/esm/dsl/GatewayBase.d.ts +0 -13
- package/esm/dsl/GatewayBase.d.ts.map +0 -1
- package/esm/dsl/GatewayBase.js +0 -19
- package/esm/dsl/operation/toOperationGateway.d.ts +0 -39
- package/esm/dsl/operation/toOperationGateway.d.ts.map +0 -1
- package/esm/dsl/operation/toOperationGateway.js +0 -84
- package/script/dsl/GatewayBase.d.ts +0 -13
- package/script/dsl/GatewayBase.d.ts.map +0 -1
- package/script/dsl/GatewayBase.js +0 -23
- package/script/dsl/operation/toOperationGateway.d.ts +0 -39
- package/script/dsl/operation/toOperationGateway.d.ts.map +0 -1
- package/script/dsl/operation/toOperationGateway.js +0 -88
|
@@ -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;
|