@skmtc/core 0.0.485 → 0.0.487

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":"enrichSettings.d.ts","sourceRoot":"","sources":["../../src/run/enrichSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAEnE,KAAK,kBAAkB,GAAG;IACxB,iBAAiB,EAAE,uBAAuB,EAAE,CAAA;IAC5C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACrD,CAAA;AAED,eAAO,MAAM,cAAc,uCAAwC,kBAAkB,8BAQpF,CAAA"}
1
+ {"version":3,"file":"enrichSettings.d.ts","sourceRoot":"","sources":["../../src/run/enrichSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAEnE,KAAK,kBAAkB,GAAG;IACxB,iBAAiB,EAAE,uBAAuB,EAAE,CAAA;IAC5C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACrD,CAAA;AAED,eAAO,MAAM,cAAc,uCAAwC,kBAAkB,8BASpF,CAAA"}
@@ -1,7 +1,8 @@
1
1
  import { set } from 'lodash-es';
2
2
  export const enrichSettings = ({ generatorSettings, enrichments }) => {
3
- Object.entries(generatorSettings).forEach(([id, setting]) => {
4
- Object.entries(enrichments[id] ?? {}).forEach(([key, value]) => {
3
+ Object.values(generatorSettings).forEach(setting => {
4
+ Object.entries(enrichments[setting.id] ?? {}).forEach(([key, value]) => {
5
+ console.log('KEY', key);
5
6
  set(setting, key, value);
6
7
  });
7
8
  });
@@ -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;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"}
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,qDAkCjF,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import { handleEnrichment } from './handleEnrichment.js';
2
- import { set } from 'lodash-es';
3
2
  export const toEnrichments = async ({ generators, oasDocument }) => {
4
3
  const output = {};
5
4
  for (const generator of generators) {
@@ -8,7 +7,10 @@ export const toEnrichments = async ({ generators, oasDocument }) => {
8
7
  const enrichmentRequest = generator.toEnrichmentRequest?.(operation);
9
8
  if (enrichmentRequest) {
10
9
  const enrichmentResponse = await handleEnrichment(enrichmentRequest);
11
- set(output, [generator.id, 'operations', operation.path, operation.method, 'enrichments'], JSON.parse(enrichmentResponse));
10
+ const key = `operations.${operation.path}.${operation.method}.enrichments`;
11
+ output[generator.id] = {
12
+ [key]: JSON.parse(enrichmentResponse)
13
+ };
12
14
  }
13
15
  }
14
16
  }
@@ -17,7 +19,10 @@ export const toEnrichments = async ({ generators, oasDocument }) => {
17
19
  const enrichmentRequest = generator.toEnrichmentRequest?.(refName);
18
20
  if (enrichmentRequest) {
19
21
  const enrichmentResponse = await handleEnrichment(enrichmentRequest);
20
- output[generator.id][`models.${refName}.enrichments`] = JSON.parse(enrichmentResponse);
22
+ const key = `models.${refName}.enrichments`;
23
+ output[generator.id] = {
24
+ [key]: JSON.parse(enrichmentResponse)
25
+ };
21
26
  }
22
27
  }
23
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skmtc/core",
3
- "version": "0.0.485",
3
+ "version": "0.0.487",
4
4
  "module": "./esm/mod.js",
5
5
  "exports": {
6
6
  ".": {