@skmtc/core 0.0.482 → 0.0.483
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.
|
@@ -1 +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;
|
|
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;AAK9D,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,qDAgCjF,CAAA"}
|
package/esm/run/toEnrichments.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { handleEnrichment } from './handleEnrichment.js';
|
|
2
|
+
import { set } from 'lodash-es';
|
|
2
3
|
export const toEnrichments = async ({ generators, oasDocument }) => {
|
|
3
4
|
const output = {};
|
|
4
5
|
for (const generator of generators) {
|
|
@@ -7,8 +8,7 @@ export const toEnrichments = async ({ generators, oasDocument }) => {
|
|
|
7
8
|
const enrichmentRequest = generator.toEnrichmentRequest?.(operation);
|
|
8
9
|
if (enrichmentRequest) {
|
|
9
10
|
const enrichmentResponse = await handleEnrichment(enrichmentRequest);
|
|
10
|
-
output[generator.id
|
|
11
|
-
JSON.parse(enrichmentResponse);
|
|
11
|
+
set(output, [generator.id, 'operations', operation.path, operation.method, 'enrichments'], JSON.parse(enrichmentResponse));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1 +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;
|
|
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;AAK9D,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,qDAgCjF,CAAA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toEnrichments = void 0;
|
|
4
4
|
const handleEnrichment_js_1 = require("./handleEnrichment.js");
|
|
5
|
+
const lodash_es_1 = require("lodash-es");
|
|
5
6
|
const toEnrichments = async ({ generators, oasDocument }) => {
|
|
6
7
|
const output = {};
|
|
7
8
|
for (const generator of generators) {
|
|
@@ -10,8 +11,7 @@ const toEnrichments = async ({ generators, oasDocument }) => {
|
|
|
10
11
|
const enrichmentRequest = generator.toEnrichmentRequest?.(operation);
|
|
11
12
|
if (enrichmentRequest) {
|
|
12
13
|
const enrichmentResponse = await (0, handleEnrichment_js_1.handleEnrichment)(enrichmentRequest);
|
|
13
|
-
output[generator.id
|
|
14
|
-
JSON.parse(enrichmentResponse);
|
|
14
|
+
(0, lodash_es_1.set)(output, [generator.id, 'operations', operation.path, operation.method, 'enrichments'], JSON.parse(enrichmentResponse));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|