@eventcatalog/sdk 2.7.4 → 2.7.6
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/dist/eventcatalog.js +12 -5
- package/dist/eventcatalog.js.map +1 -1
- package/dist/eventcatalog.mjs +12 -5
- package/dist/eventcatalog.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -5
- package/dist/index.mjs.map +1 -1
- package/dist/messages.js.map +1 -1
- package/dist/messages.mjs.map +1 -1
- package/dist/services.js +12 -5
- package/dist/services.js.map +1 -1
- package/dist/services.mjs +12 -5
- package/dist/services.mjs.map +1 -1
- package/dist/types.d.d.mts +18 -2
- package/dist/types.d.d.ts +18 -2
- package/dist/types.d.js.map +1 -1
- package/package.json +1 -1
package/dist/eventcatalog.mjs
CHANGED
|
@@ -477,14 +477,21 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
|
|
|
477
477
|
let specs = [];
|
|
478
478
|
if (service.specifications) {
|
|
479
479
|
const serviceSpecifications = service.specifications;
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
let specificationFiles;
|
|
481
|
+
if (Array.isArray(serviceSpecifications)) {
|
|
482
|
+
specificationFiles = serviceSpecifications.map((spec) => ({ key: spec.type, path: spec.path }));
|
|
483
|
+
} else {
|
|
484
|
+
specificationFiles = Object.keys(serviceSpecifications).map((spec) => ({
|
|
485
|
+
key: spec,
|
|
486
|
+
path: serviceSpecifications[spec]
|
|
487
|
+
}));
|
|
488
|
+
}
|
|
489
|
+
const getSpecs = specificationFiles.map(async ({ key, path: fileName }) => {
|
|
483
490
|
if (!fileName) {
|
|
484
|
-
throw new Error(`Specification file name for ${
|
|
491
|
+
throw new Error(`Specification file name for ${fileName} is undefined`);
|
|
485
492
|
}
|
|
486
493
|
const rawFile = await getFileFromResource(directory, id, { fileName }, version);
|
|
487
|
-
return { key
|
|
494
|
+
return { key, content: rawFile, fileName, path: join6(dirname4(filePathToService), fileName) };
|
|
488
495
|
});
|
|
489
496
|
specs = await Promise.all(getSpecs);
|
|
490
497
|
}
|