@eventcatalog/sdk 2.2.8 → 2.2.10
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/channels.d.mts +1 -0
- package/dist/channels.d.ts +1 -0
- package/dist/channels.js +12 -1
- package/dist/channels.js.map +1 -1
- package/dist/channels.mjs +13 -2
- package/dist/channels.mjs.map +1 -1
- package/dist/domains.js +12 -1
- package/dist/domains.js.map +1 -1
- package/dist/domains.mjs +12 -1
- package/dist/domains.mjs.map +1 -1
- package/dist/eventcatalog.js +9 -3
- package/dist/eventcatalog.js.map +1 -1
- package/dist/eventcatalog.mjs +11 -5
- package/dist/eventcatalog.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -5
- package/dist/index.mjs.map +1 -1
- package/dist/services.js +12 -1
- package/dist/services.js.map +1 -1
- package/dist/services.mjs +13 -2
- package/dist/services.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -328,6 +328,7 @@ declare const _default: (path: string) => {
|
|
|
328
328
|
path?: string;
|
|
329
329
|
override?: boolean;
|
|
330
330
|
versionExistingContent?: boolean;
|
|
331
|
+
format?: "md" | "mdx";
|
|
331
332
|
}) => Promise<void>;
|
|
332
333
|
/**
|
|
333
334
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
@@ -463,7 +464,12 @@ declare const _default: (path: string) => {
|
|
|
463
464
|
direction?: string;
|
|
464
465
|
}, options?: {
|
|
465
466
|
path?: string;
|
|
466
|
-
format
|
|
467
|
+
format? /**
|
|
468
|
+
* Remove an command by an Event id
|
|
469
|
+
*
|
|
470
|
+
* @param id - The id of the command you want to remove
|
|
471
|
+
*
|
|
472
|
+
*/: "md" | "mdx";
|
|
467
473
|
}) => Promise<void>;
|
|
468
474
|
/**
|
|
469
475
|
* Returns a service from EventCatalog
|
package/dist/index.d.ts
CHANGED
|
@@ -328,6 +328,7 @@ declare const _default: (path: string) => {
|
|
|
328
328
|
path?: string;
|
|
329
329
|
override?: boolean;
|
|
330
330
|
versionExistingContent?: boolean;
|
|
331
|
+
format?: "md" | "mdx";
|
|
331
332
|
}) => Promise<void>;
|
|
332
333
|
/**
|
|
333
334
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
@@ -463,7 +464,12 @@ declare const _default: (path: string) => {
|
|
|
463
464
|
direction?: string;
|
|
464
465
|
}, options?: {
|
|
465
466
|
path?: string;
|
|
466
|
-
format
|
|
467
|
+
format? /**
|
|
468
|
+
* Remove an command by an Event id
|
|
469
|
+
*
|
|
470
|
+
* @param id - The id of the command you want to remove
|
|
471
|
+
*
|
|
472
|
+
*/: "md" | "mdx";
|
|
467
473
|
}) => Promise<void>;
|
|
468
474
|
/**
|
|
469
475
|
* Returns a service from EventCatalog
|
package/dist/index.js
CHANGED
|
@@ -441,6 +441,8 @@ var getSpecificationFilesForService = (directory) => async (id, version) => {
|
|
|
441
441
|
};
|
|
442
442
|
var addMessageToService = (directory) => async (id, direction, event, version) => {
|
|
443
443
|
let service = await getService(directory)(id, version);
|
|
444
|
+
const servicePath = await getResourcePath(directory, id, version);
|
|
445
|
+
const extension = (0, import_node_path5.extname)(servicePath?.fullPath || "");
|
|
444
446
|
if (direction === "sends") {
|
|
445
447
|
if (service.sends === void 0) {
|
|
446
448
|
service.sends = [];
|
|
@@ -471,7 +473,7 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
471
473
|
const path4 = existingResource.split("/services")[0];
|
|
472
474
|
const pathToResource = (0, import_node_path5.join)(path4, "services");
|
|
473
475
|
await rmServiceById(directory)(id, version);
|
|
474
|
-
await writeService(pathToResource)(service);
|
|
476
|
+
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
475
477
|
};
|
|
476
478
|
var serviceHasVersion = (directory) => async (id, version) => {
|
|
477
479
|
const file = await findFileById(directory, id, version);
|
|
@@ -529,6 +531,8 @@ var domainHasVersion = (directory) => async (id, version) => {
|
|
|
529
531
|
};
|
|
530
532
|
var addServiceToDomain = (directory) => async (id, service, version) => {
|
|
531
533
|
let domain = await getDomain(directory)(id, version);
|
|
534
|
+
const domainPath = await getResourcePath(directory, id, version);
|
|
535
|
+
const extension = import_node_path6.default.extname(domainPath?.fullPath || "");
|
|
532
536
|
if (domain.services === void 0) {
|
|
533
537
|
domain.services = [];
|
|
534
538
|
}
|
|
@@ -538,7 +542,7 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
|
|
|
538
542
|
}
|
|
539
543
|
domain.services.push(service);
|
|
540
544
|
await rmDomainById(directory)(id, version, true);
|
|
541
|
-
await writeDomain(directory)(domain);
|
|
545
|
+
await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
542
546
|
};
|
|
543
547
|
|
|
544
548
|
// src/channels.ts
|
|
@@ -577,6 +581,8 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
577
581
|
};
|
|
578
582
|
const { getMessage, rmMessageById, writeMessage } = functions[collection];
|
|
579
583
|
const message = await getMessage(directory)(_message.id, _message.version);
|
|
584
|
+
const messagePath = await getResourcePath(directory, _message.id, _message.version);
|
|
585
|
+
const extension = (0, import_node_path7.extname)(messagePath?.fullPath || "");
|
|
580
586
|
if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
|
|
581
587
|
if (message.channels === void 0) {
|
|
582
588
|
message.channels = [];
|
|
@@ -590,7 +596,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
590
596
|
const path4 = existingResource.split(`/${collection}`)[0];
|
|
591
597
|
const pathToResource = (0, import_node_path7.join)(path4, collection);
|
|
592
598
|
await rmMessageById(directory)(_message.id, _message.version, true);
|
|
593
|
-
await writeMessage(pathToResource)(message);
|
|
599
|
+
await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
|
|
594
600
|
};
|
|
595
601
|
|
|
596
602
|
// src/eventcatalog.ts
|