@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.js
CHANGED
|
@@ -512,14 +512,21 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
|
|
|
512
512
|
let specs = [];
|
|
513
513
|
if (service.specifications) {
|
|
514
514
|
const serviceSpecifications = service.specifications;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
let specificationFiles;
|
|
516
|
+
if (Array.isArray(serviceSpecifications)) {
|
|
517
|
+
specificationFiles = serviceSpecifications.map((spec) => ({ key: spec.type, path: spec.path }));
|
|
518
|
+
} else {
|
|
519
|
+
specificationFiles = Object.keys(serviceSpecifications).map((spec) => ({
|
|
520
|
+
key: spec,
|
|
521
|
+
path: serviceSpecifications[spec]
|
|
522
|
+
}));
|
|
523
|
+
}
|
|
524
|
+
const getSpecs = specificationFiles.map(async ({ key, path: fileName }) => {
|
|
518
525
|
if (!fileName) {
|
|
519
|
-
throw new Error(`Specification file name for ${
|
|
526
|
+
throw new Error(`Specification file name for ${fileName} is undefined`);
|
|
520
527
|
}
|
|
521
528
|
const rawFile = await getFileFromResource(directory, id, { fileName }, version);
|
|
522
|
-
return { key
|
|
529
|
+
return { key, content: rawFile, fileName, path: (0, import_node_path5.join)((0, import_node_path5.dirname)(filePathToService), fileName) };
|
|
523
530
|
});
|
|
524
531
|
specs = await Promise.all(getSpecs);
|
|
525
532
|
}
|