@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 CHANGED
@@ -19,13 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
- ---
24
-
25
- Note: Source code within the following directories is licensed under the
26
- EventCatalog Commercial License and is NOT covered by the MIT License above:
27
-
28
- - `packages/core/eventcatalog/src/enterprise/`
29
- - `packages/core/src/federation/`
30
-
31
- See the `LICENSE` file in each directory for the full terms.
package/dist/index.d.mts CHANGED
@@ -573,12 +573,18 @@ declare enum DataClassification {
573
573
 
574
574
  interface FlowStep {
575
575
  id: string | number;
576
+ /** @deprecated Ignored by EventCatalog: the kind of step comes from what it points at. */
576
577
  type?: 'node' | 'message' | 'agent' | 'user' | 'actor';
577
- title: string;
578
+ /** Defaults to the name of what the step points at (or its id). */
579
+ title?: string;
578
580
  summary?: string;
579
581
  message?: ResourcePointer;
580
582
  agent?: ResourcePointer;
581
583
  service?: ResourcePointer;
584
+ /** Catalog system referenced by this step. `system` is an alias for `systems`. */
585
+ systems?: ResourcePointer;
586
+ system?: ResourcePointer;
587
+ channel?: ResourcePointer;
582
588
  flow?: ResourcePointer;
583
589
  container?: ResourcePointer;
584
590
  dataProduct?: ResourcePointer;
@@ -587,7 +593,8 @@ interface FlowStep {
587
593
  summary?: string;
588
594
  };
589
595
  custom?: {
590
- title: string;
596
+ /** Defaults to the step's title. */
597
+ title?: string;
591
598
  icon?: string;
592
599
  type?: string;
593
600
  summary?: string;
@@ -680,7 +687,7 @@ type IndexAsset = {
680
687
  hash?: string;
681
688
  };
682
689
  type IndexReference = ResourcePointer & {
683
- kind: 'agent' | 'container' | 'data-product' | 'flow' | 'message' | 'service';
690
+ kind: 'agent' | 'channel' | 'container' | 'data-product' | 'flow' | 'message' | 'service' | 'system';
684
691
  };
685
692
  type IndexResource = {
686
693
  type: IndexResourceType;
@@ -935,6 +942,16 @@ type FlowServiceStepInput = FlowStepInput & {
935
942
  };
936
943
  version?: string;
937
944
  };
945
+ /**
946
+ * Payload for a flow step that references a channel.
947
+ */
948
+ type FlowChannelStepInput = FlowStepInput & {
949
+ channel?: {
950
+ id: string;
951
+ version?: string;
952
+ };
953
+ version?: string;
954
+ };
938
955
  /**
939
956
  * Payload for a flow step that references a data store/container.
940
957
  */
@@ -1169,6 +1186,26 @@ declare class FlowBuilder<TMessageId extends string = string> {
1169
1186
  * ```
1170
1187
  */
1171
1188
  addServiceStep(step: FlowServiceStepInput): this;
1189
+ /**
1190
+ * Add a channel step.
1191
+ *
1192
+ * @param step - The channel step payload.
1193
+ *
1194
+ * @example
1195
+ * ```ts
1196
+ * FlowBuilder.create({
1197
+ * id: 'OrderFlow',
1198
+ * name: 'Order Flow',
1199
+ * version: '1.0.0',
1200
+ * markdown: '',
1201
+ * })
1202
+ * .addChannelStep({
1203
+ * id: 'orders-topic',
1204
+ * channel: { id: 'orders-topic', version: '1.0.0' },
1205
+ * });
1206
+ * ```
1207
+ */
1208
+ addChannelStep(step: FlowChannelStepInput): this;
1172
1209
  /**
1173
1210
  * Add an agent step.
1174
1211
  *
@@ -1454,7 +1491,9 @@ declare const FederationIndexSchema: z.ZodObject<{
1454
1491
  type: z.ZodOptional<z.ZodString>;
1455
1492
  kind: z.ZodEnum<{
1456
1493
  service: "service";
1494
+ system: "system";
1457
1495
  agent: "agent";
1496
+ channel: "channel";
1458
1497
  message: "message";
1459
1498
  "data-product": "data-product";
1460
1499
  container: "container";
@@ -3534,4 +3573,4 @@ declare const _default: (path: string) => {
3534
3573
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
3535
3574
  };
3536
3575
 
3537
- export { type Adr, type AdrPointer, type AdrResourcePointer, type AdrStatus, type Agent, type AgentModel, type AgentTool, type Badge, type BaseSchema, type Cache, type CatalogGraph, type CatalogGraphNode, type CatalogGraphOptions, type CatalogGraphResource, type CatalogGraphResourceType, type CatalogGraphRoot, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Conflict, type ConflictKind, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type EdgeDirection, type Entity, type EntityProperty, type Event, type EventCatalog, type ExtensionProperties, type External, FederationIndexSchema, type Fetcher, type FlatCatalogGraph, type Flow, type FlowActorStepInput, type FlowAgentStepInput, FlowBuilder, type FlowBuilderInput, type FlowCustomStepInput, type FlowDataProductStepInput, type FlowDataStoreStepInput, type FlowExternalSystemStepInput, type FlowMessageStepInput, type FlowServiceStepInput, type FlowStep, type FlowStepInput, type FlowSubFlowStepInput, type GetCatalogGraph, type HydrateOptions, type HydrateResult, type Index, type IndexAsset, type IndexReference, type IndexResource, type IndexResourceType, type IndexSchema, type IndexSidecar, type IndexSpecification, type IndexValidationIssue, InvalidIndexError, type Message, type MessagePointerInput, type NestedCatalogGraph, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResolutionWarning, type ResolvedAsset, type ResolvedEdge, type ResolvedEntity, type ResolvedGraph, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SchemaPointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type System, type SystemActorRelationship, type SystemRelationshipPointer, type SystemScope, type Team, type TriggerPointer, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default, hydrate, parseIndex, resolve };
3576
+ export { type Adr, type AdrPointer, type AdrResourcePointer, type AdrStatus, type Agent, type AgentModel, type AgentTool, type Badge, type BaseSchema, type Cache, type CatalogGraph, type CatalogGraphNode, type CatalogGraphOptions, type CatalogGraphResource, type CatalogGraphResourceType, type CatalogGraphRoot, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Conflict, type ConflictKind, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type EdgeDirection, type Entity, type EntityProperty, type Event, type EventCatalog, type ExtensionProperties, type External, FederationIndexSchema, type Fetcher, type FlatCatalogGraph, type Flow, type FlowActorStepInput, type FlowAgentStepInput, FlowBuilder, type FlowBuilderInput, type FlowChannelStepInput, type FlowCustomStepInput, type FlowDataProductStepInput, type FlowDataStoreStepInput, type FlowExternalSystemStepInput, type FlowMessageStepInput, type FlowServiceStepInput, type FlowStep, type FlowStepInput, type FlowSubFlowStepInput, type GetCatalogGraph, type HydrateOptions, type HydrateResult, type Index, type IndexAsset, type IndexReference, type IndexResource, type IndexResourceType, type IndexSchema, type IndexSidecar, type IndexSpecification, type IndexValidationIssue, InvalidIndexError, type Message, type MessagePointerInput, type NestedCatalogGraph, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResolutionWarning, type ResolvedAsset, type ResolvedEdge, type ResolvedEntity, type ResolvedGraph, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SchemaPointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type System, type SystemActorRelationship, type SystemRelationshipPointer, type SystemScope, type Team, type TriggerPointer, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default, hydrate, parseIndex, resolve };
package/dist/index.d.ts CHANGED
@@ -573,12 +573,18 @@ declare enum DataClassification {
573
573
 
574
574
  interface FlowStep {
575
575
  id: string | number;
576
+ /** @deprecated Ignored by EventCatalog: the kind of step comes from what it points at. */
576
577
  type?: 'node' | 'message' | 'agent' | 'user' | 'actor';
577
- title: string;
578
+ /** Defaults to the name of what the step points at (or its id). */
579
+ title?: string;
578
580
  summary?: string;
579
581
  message?: ResourcePointer;
580
582
  agent?: ResourcePointer;
581
583
  service?: ResourcePointer;
584
+ /** Catalog system referenced by this step. `system` is an alias for `systems`. */
585
+ systems?: ResourcePointer;
586
+ system?: ResourcePointer;
587
+ channel?: ResourcePointer;
582
588
  flow?: ResourcePointer;
583
589
  container?: ResourcePointer;
584
590
  dataProduct?: ResourcePointer;
@@ -587,7 +593,8 @@ interface FlowStep {
587
593
  summary?: string;
588
594
  };
589
595
  custom?: {
590
- title: string;
596
+ /** Defaults to the step's title. */
597
+ title?: string;
591
598
  icon?: string;
592
599
  type?: string;
593
600
  summary?: string;
@@ -680,7 +687,7 @@ type IndexAsset = {
680
687
  hash?: string;
681
688
  };
682
689
  type IndexReference = ResourcePointer & {
683
- kind: 'agent' | 'container' | 'data-product' | 'flow' | 'message' | 'service';
690
+ kind: 'agent' | 'channel' | 'container' | 'data-product' | 'flow' | 'message' | 'service' | 'system';
684
691
  };
685
692
  type IndexResource = {
686
693
  type: IndexResourceType;
@@ -935,6 +942,16 @@ type FlowServiceStepInput = FlowStepInput & {
935
942
  };
936
943
  version?: string;
937
944
  };
945
+ /**
946
+ * Payload for a flow step that references a channel.
947
+ */
948
+ type FlowChannelStepInput = FlowStepInput & {
949
+ channel?: {
950
+ id: string;
951
+ version?: string;
952
+ };
953
+ version?: string;
954
+ };
938
955
  /**
939
956
  * Payload for a flow step that references a data store/container.
940
957
  */
@@ -1169,6 +1186,26 @@ declare class FlowBuilder<TMessageId extends string = string> {
1169
1186
  * ```
1170
1187
  */
1171
1188
  addServiceStep(step: FlowServiceStepInput): this;
1189
+ /**
1190
+ * Add a channel step.
1191
+ *
1192
+ * @param step - The channel step payload.
1193
+ *
1194
+ * @example
1195
+ * ```ts
1196
+ * FlowBuilder.create({
1197
+ * id: 'OrderFlow',
1198
+ * name: 'Order Flow',
1199
+ * version: '1.0.0',
1200
+ * markdown: '',
1201
+ * })
1202
+ * .addChannelStep({
1203
+ * id: 'orders-topic',
1204
+ * channel: { id: 'orders-topic', version: '1.0.0' },
1205
+ * });
1206
+ * ```
1207
+ */
1208
+ addChannelStep(step: FlowChannelStepInput): this;
1172
1209
  /**
1173
1210
  * Add an agent step.
1174
1211
  *
@@ -1454,7 +1491,9 @@ declare const FederationIndexSchema: z.ZodObject<{
1454
1491
  type: z.ZodOptional<z.ZodString>;
1455
1492
  kind: z.ZodEnum<{
1456
1493
  service: "service";
1494
+ system: "system";
1457
1495
  agent: "agent";
1496
+ channel: "channel";
1458
1497
  message: "message";
1459
1498
  "data-product": "data-product";
1460
1499
  container: "container";
@@ -3534,4 +3573,4 @@ declare const _default: (path: string) => {
3534
3573
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
3535
3574
  };
3536
3575
 
3537
- export { type Adr, type AdrPointer, type AdrResourcePointer, type AdrStatus, type Agent, type AgentModel, type AgentTool, type Badge, type BaseSchema, type Cache, type CatalogGraph, type CatalogGraphNode, type CatalogGraphOptions, type CatalogGraphResource, type CatalogGraphResourceType, type CatalogGraphRoot, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Conflict, type ConflictKind, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type EdgeDirection, type Entity, type EntityProperty, type Event, type EventCatalog, type ExtensionProperties, type External, FederationIndexSchema, type Fetcher, type FlatCatalogGraph, type Flow, type FlowActorStepInput, type FlowAgentStepInput, FlowBuilder, type FlowBuilderInput, type FlowCustomStepInput, type FlowDataProductStepInput, type FlowDataStoreStepInput, type FlowExternalSystemStepInput, type FlowMessageStepInput, type FlowServiceStepInput, type FlowStep, type FlowStepInput, type FlowSubFlowStepInput, type GetCatalogGraph, type HydrateOptions, type HydrateResult, type Index, type IndexAsset, type IndexReference, type IndexResource, type IndexResourceType, type IndexSchema, type IndexSidecar, type IndexSpecification, type IndexValidationIssue, InvalidIndexError, type Message, type MessagePointerInput, type NestedCatalogGraph, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResolutionWarning, type ResolvedAsset, type ResolvedEdge, type ResolvedEntity, type ResolvedGraph, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SchemaPointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type System, type SystemActorRelationship, type SystemRelationshipPointer, type SystemScope, type Team, type TriggerPointer, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default, hydrate, parseIndex, resolve };
3576
+ export { type Adr, type AdrPointer, type AdrResourcePointer, type AdrStatus, type Agent, type AgentModel, type AgentTool, type Badge, type BaseSchema, type Cache, type CatalogGraph, type CatalogGraphNode, type CatalogGraphOptions, type CatalogGraphResource, type CatalogGraphResourceType, type CatalogGraphRoot, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Conflict, type ConflictKind, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type EdgeDirection, type Entity, type EntityProperty, type Event, type EventCatalog, type ExtensionProperties, type External, FederationIndexSchema, type Fetcher, type FlatCatalogGraph, type Flow, type FlowActorStepInput, type FlowAgentStepInput, FlowBuilder, type FlowBuilderInput, type FlowChannelStepInput, type FlowCustomStepInput, type FlowDataProductStepInput, type FlowDataStoreStepInput, type FlowExternalSystemStepInput, type FlowMessageStepInput, type FlowServiceStepInput, type FlowStep, type FlowStepInput, type FlowSubFlowStepInput, type GetCatalogGraph, type HydrateOptions, type HydrateResult, type Index, type IndexAsset, type IndexReference, type IndexResource, type IndexResourceType, type IndexSchema, type IndexSidecar, type IndexSpecification, type IndexValidationIssue, InvalidIndexError, type Message, type MessagePointerInput, type NestedCatalogGraph, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResolutionWarning, type ResolvedAsset, type ResolvedEdge, type ResolvedEntity, type ResolvedGraph, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SchemaPointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type System, type SystemActorRelationship, type SystemRelationshipPointer, type SystemScope, type Team, type TriggerPointer, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default, hydrate, parseIndex, resolve };
package/dist/index.js CHANGED
@@ -2338,6 +2338,7 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
2338
2338
  // src/eventcatalog.ts
2339
2339
  var import_fs = __toESM(require("fs"));
2340
2340
  var import_node_path18 = __toESM(require("path"));
2341
+ var import_node_url = require("url");
2341
2342
  var DUMP_VERSION = "0.0.1";
2342
2343
  var getEventCatalogVersion = async (catalogDir) => {
2343
2344
  try {
@@ -2376,7 +2377,10 @@ var filterCollection = (collection, options) => {
2376
2377
  var getEventCatalogConfigurationFile = (directory) => async () => {
2377
2378
  try {
2378
2379
  const path11 = (0, import_node_path18.join)(directory, "eventcatalog.config.js");
2379
- const configModule = await import(path11);
2380
+ const configModule = await import(
2381
+ /* @vite-ignore */
2382
+ (0, import_node_url.pathToFileURL)(path11).href
2383
+ );
2380
2384
  return configModule.default;
2381
2385
  } catch (error) {
2382
2386
  console.error("Error getting event catalog configuration file", error);
@@ -2618,6 +2622,9 @@ var cloneStep = (step) => ({
2618
2622
  ...step.message ? { message: { ...step.message } } : {},
2619
2623
  ...step.agent ? { agent: { ...step.agent } } : {},
2620
2624
  ...step.service ? { service: { ...step.service } } : {},
2625
+ ...step.systems ? { systems: { ...step.systems } } : {},
2626
+ ...step.system ? { system: { ...step.system } } : {},
2627
+ ...step.channel ? { channel: { ...step.channel } } : {},
2621
2628
  ...step.flow ? { flow: { ...step.flow } } : {},
2622
2629
  ...step.container ? { container: { ...step.container } } : {},
2623
2630
  ...step.dataProduct ? { dataProduct: { ...step.dataProduct } } : {},
@@ -2765,6 +2772,41 @@ var FlowBuilder = class _FlowBuilder {
2765
2772
  step.nextSteps
2766
2773
  );
2767
2774
  }
2775
+ /**
2776
+ * Add a channel step.
2777
+ *
2778
+ * @param step - The channel step payload.
2779
+ *
2780
+ * @example
2781
+ * ```ts
2782
+ * FlowBuilder.create({
2783
+ * id: 'OrderFlow',
2784
+ * name: 'Order Flow',
2785
+ * version: '1.0.0',
2786
+ * markdown: '',
2787
+ * })
2788
+ * .addChannelStep({
2789
+ * id: 'orders-topic',
2790
+ * channel: { id: 'orders-topic', version: '1.0.0' },
2791
+ * });
2792
+ * ```
2793
+ */
2794
+ addChannelStep(step) {
2795
+ const channel = step.channel || {
2796
+ id: String(step.id),
2797
+ ...step.version ? { version: step.version } : {}
2798
+ };
2799
+ return this.addStepWithNext(
2800
+ {
2801
+ id: step.id,
2802
+ // Left out, EventCatalog names the step after its channel
2803
+ ...step.title ? { title: step.title } : {},
2804
+ ...step.summary ? { summary: step.summary } : {},
2805
+ channel: { ...channel, ...step.version && !channel.version ? { version: step.version } : {} }
2806
+ },
2807
+ step.nextSteps
2808
+ );
2809
+ }
2768
2810
  /**
2769
2811
  * Add an agent step.
2770
2812
  *
@@ -3370,6 +3412,9 @@ var getGraph = (directory) => {
3370
3412
  if (step.message) await addPointers([step.message], ["event", "command", "query"]);
3371
3413
  if (step.agent) await addPointers([step.agent], ["agent"]);
3372
3414
  if (step.service) await addPointers([step.service], ["service"]);
3415
+ if (step.systems) await addPointers([step.systems], ["system"]);
3416
+ if (step.system) await addPointers([step.system], ["system"]);
3417
+ if (step.channel) await addPointers([step.channel], ["channel"]);
3373
3418
  if (step.flow) await addPointers([step.flow], ["flow"]);
3374
3419
  if (step.container) await addPointers([step.container], ["container"]);
3375
3420
  if (step.dataProduct) await addPointers([step.dataProduct], ["data-product"]);
@@ -3844,6 +3889,9 @@ var normalizeSpecifications = async (resource, resourcePath, hashContent) => {
3844
3889
  };
3845
3890
  var getFlowReferences = (steps) => steps.flatMap((step) => [
3846
3891
  ...step.service ? [{ kind: "service", ...step.service }] : [],
3892
+ ...step.systems ? [{ kind: "system", ...step.systems }] : [],
3893
+ ...step.system ? [{ kind: "system", ...step.system }] : [],
3894
+ ...step.channel ? [{ kind: "channel", ...step.channel }] : [],
3847
3895
  ...step.message ? [{ kind: "message", ...step.message }] : [],
3848
3896
  ...step.agent ? [{ kind: "agent", ...step.agent }] : [],
3849
3897
  ...step.container ? [{ kind: "container", ...step.container }] : [],
@@ -4672,7 +4720,7 @@ var IndexAssetSchema = import_zod.z.object({
4672
4720
  hash: contentHash.optional()
4673
4721
  }).strict();
4674
4722
  var IndexReferenceSchema = ResourcePointerSchema.extend({
4675
- kind: import_zod.z.enum(["agent", "container", "data-product", "flow", "message", "service"])
4723
+ kind: import_zod.z.enum(["agent", "channel", "container", "data-product", "flow", "message", "service", "system"])
4676
4724
  });
4677
4725
  var AdrPointerSchema = import_zod.z.object({
4678
4726
  id: nonEmptyString,