@eventcatalog/sdk 2.29.1 → 2.30.0-beta.0
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/LICENSE +0 -10
- package/dist/index.d.mts +43 -4
- package/dist/index.d.ts +43 -4
- package/dist/index.js +50 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2298,6 +2298,7 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
|
|
|
2298
2298
|
// src/eventcatalog.ts
|
|
2299
2299
|
import fs13 from "fs";
|
|
2300
2300
|
import path6, { join as join15 } from "path";
|
|
2301
|
+
import { pathToFileURL } from "url";
|
|
2301
2302
|
var DUMP_VERSION = "0.0.1";
|
|
2302
2303
|
var getEventCatalogVersion = async (catalogDir) => {
|
|
2303
2304
|
try {
|
|
@@ -2336,7 +2337,10 @@ var filterCollection = (collection, options) => {
|
|
|
2336
2337
|
var getEventCatalogConfigurationFile = (directory) => async () => {
|
|
2337
2338
|
try {
|
|
2338
2339
|
const path11 = join15(directory, "eventcatalog.config.js");
|
|
2339
|
-
const configModule = await import(
|
|
2340
|
+
const configModule = await import(
|
|
2341
|
+
/* @vite-ignore */
|
|
2342
|
+
pathToFileURL(path11).href
|
|
2343
|
+
);
|
|
2340
2344
|
return configModule.default;
|
|
2341
2345
|
} catch (error) {
|
|
2342
2346
|
console.error("Error getting event catalog configuration file", error);
|
|
@@ -2578,6 +2582,9 @@ var cloneStep = (step) => ({
|
|
|
2578
2582
|
...step.message ? { message: { ...step.message } } : {},
|
|
2579
2583
|
...step.agent ? { agent: { ...step.agent } } : {},
|
|
2580
2584
|
...step.service ? { service: { ...step.service } } : {},
|
|
2585
|
+
...step.systems ? { systems: { ...step.systems } } : {},
|
|
2586
|
+
...step.system ? { system: { ...step.system } } : {},
|
|
2587
|
+
...step.channel ? { channel: { ...step.channel } } : {},
|
|
2581
2588
|
...step.flow ? { flow: { ...step.flow } } : {},
|
|
2582
2589
|
...step.container ? { container: { ...step.container } } : {},
|
|
2583
2590
|
...step.dataProduct ? { dataProduct: { ...step.dataProduct } } : {},
|
|
@@ -2725,6 +2732,41 @@ var FlowBuilder = class _FlowBuilder {
|
|
|
2725
2732
|
step.nextSteps
|
|
2726
2733
|
);
|
|
2727
2734
|
}
|
|
2735
|
+
/**
|
|
2736
|
+
* Add a channel step.
|
|
2737
|
+
*
|
|
2738
|
+
* @param step - The channel step payload.
|
|
2739
|
+
*
|
|
2740
|
+
* @example
|
|
2741
|
+
* ```ts
|
|
2742
|
+
* FlowBuilder.create({
|
|
2743
|
+
* id: 'OrderFlow',
|
|
2744
|
+
* name: 'Order Flow',
|
|
2745
|
+
* version: '1.0.0',
|
|
2746
|
+
* markdown: '',
|
|
2747
|
+
* })
|
|
2748
|
+
* .addChannelStep({
|
|
2749
|
+
* id: 'orders-topic',
|
|
2750
|
+
* channel: { id: 'orders-topic', version: '1.0.0' },
|
|
2751
|
+
* });
|
|
2752
|
+
* ```
|
|
2753
|
+
*/
|
|
2754
|
+
addChannelStep(step) {
|
|
2755
|
+
const channel = step.channel || {
|
|
2756
|
+
id: String(step.id),
|
|
2757
|
+
...step.version ? { version: step.version } : {}
|
|
2758
|
+
};
|
|
2759
|
+
return this.addStepWithNext(
|
|
2760
|
+
{
|
|
2761
|
+
id: step.id,
|
|
2762
|
+
// Left out, EventCatalog names the step after its channel
|
|
2763
|
+
...step.title ? { title: step.title } : {},
|
|
2764
|
+
...step.summary ? { summary: step.summary } : {},
|
|
2765
|
+
channel: { ...channel, ...step.version && !channel.version ? { version: step.version } : {} }
|
|
2766
|
+
},
|
|
2767
|
+
step.nextSteps
|
|
2768
|
+
);
|
|
2769
|
+
}
|
|
2728
2770
|
/**
|
|
2729
2771
|
* Add an agent step.
|
|
2730
2772
|
*
|
|
@@ -3330,6 +3372,9 @@ var getGraph = (directory) => {
|
|
|
3330
3372
|
if (step.message) await addPointers([step.message], ["event", "command", "query"]);
|
|
3331
3373
|
if (step.agent) await addPointers([step.agent], ["agent"]);
|
|
3332
3374
|
if (step.service) await addPointers([step.service], ["service"]);
|
|
3375
|
+
if (step.systems) await addPointers([step.systems], ["system"]);
|
|
3376
|
+
if (step.system) await addPointers([step.system], ["system"]);
|
|
3377
|
+
if (step.channel) await addPointers([step.channel], ["channel"]);
|
|
3333
3378
|
if (step.flow) await addPointers([step.flow], ["flow"]);
|
|
3334
3379
|
if (step.container) await addPointers([step.container], ["container"]);
|
|
3335
3380
|
if (step.dataProduct) await addPointers([step.dataProduct], ["data-product"]);
|
|
@@ -3804,6 +3849,9 @@ var normalizeSpecifications = async (resource, resourcePath, hashContent) => {
|
|
|
3804
3849
|
};
|
|
3805
3850
|
var getFlowReferences = (steps) => steps.flatMap((step) => [
|
|
3806
3851
|
...step.service ? [{ kind: "service", ...step.service }] : [],
|
|
3852
|
+
...step.systems ? [{ kind: "system", ...step.systems }] : [],
|
|
3853
|
+
...step.system ? [{ kind: "system", ...step.system }] : [],
|
|
3854
|
+
...step.channel ? [{ kind: "channel", ...step.channel }] : [],
|
|
3807
3855
|
...step.message ? [{ kind: "message", ...step.message }] : [],
|
|
3808
3856
|
...step.agent ? [{ kind: "agent", ...step.agent }] : [],
|
|
3809
3857
|
...step.container ? [{ kind: "container", ...step.container }] : [],
|
|
@@ -4632,7 +4680,7 @@ var IndexAssetSchema = z.object({
|
|
|
4632
4680
|
hash: contentHash.optional()
|
|
4633
4681
|
}).strict();
|
|
4634
4682
|
var IndexReferenceSchema = ResourcePointerSchema.extend({
|
|
4635
|
-
kind: z.enum(["agent", "container", "data-product", "flow", "message", "service"])
|
|
4683
|
+
kind: z.enum(["agent", "channel", "container", "data-product", "flow", "message", "service", "system"])
|
|
4636
4684
|
});
|
|
4637
4685
|
var AdrPointerSchema = z.object({
|
|
4638
4686
|
id: nonEmptyString,
|