@eventcatalog/sdk 2.21.1 → 2.22.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/dist/index.d.mts CHANGED
@@ -246,6 +246,7 @@ interface Badge {
246
246
  backgroundColor: string;
247
247
  textColor: string;
248
248
  icon?: string;
249
+ url?: string;
249
250
  }
250
251
 
251
252
  interface Changelog {
@@ -335,10 +336,11 @@ declare enum DataClassification {
335
336
 
336
337
  interface FlowStep {
337
338
  id: string | number;
338
- type?: 'node' | 'message' | 'user' | 'actor';
339
+ type?: 'node' | 'message' | 'agent' | 'user' | 'actor';
339
340
  title: string;
340
341
  summary?: string;
341
342
  message?: ResourcePointer;
343
+ agent?: ResourcePointer;
342
344
  service?: ResourcePointer;
343
345
  flow?: ResourcePointer;
344
346
  container?: ResourcePointer;
@@ -536,6 +538,16 @@ type FlowMessageStepInput<TMessageId extends string = string> = FlowStepInput &
536
538
  };
537
539
  version?: string;
538
540
  };
541
+ /**
542
+ * Payload for a flow step that references an agent.
543
+ */
544
+ type FlowAgentStepInput = FlowStepInput & {
545
+ agent?: {
546
+ id: string;
547
+ version?: string;
548
+ };
549
+ version?: string;
550
+ };
539
551
  /**
540
552
  * Payload for a flow step that references a service.
541
553
  */
@@ -780,6 +792,26 @@ declare class FlowBuilder<TMessageId extends string = string> {
780
792
  * ```
781
793
  */
782
794
  addServiceStep(step: FlowServiceStepInput): this;
795
+ /**
796
+ * Add an agent step.
797
+ *
798
+ * @param step - The agent step payload.
799
+ *
800
+ * @example
801
+ * ```ts
802
+ * FlowBuilder.create({
803
+ * id: 'OrderFlow',
804
+ * name: 'Order Flow',
805
+ * version: '1.0.0',
806
+ * markdown: '',
807
+ * })
808
+ * .addAgentStep({
809
+ * id: 'FraudReviewAgent',
810
+ * agent: { id: 'FraudReviewAgent', version: '1.0.0' },
811
+ * });
812
+ * ```
813
+ */
814
+ addAgentStep(step: FlowAgentStepInput): this;
783
815
  /**
784
816
  * Add a data store step.
785
817
  *
@@ -2521,4 +2553,4 @@ declare const _default: (path: string) => {
2521
2553
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
2522
2554
  };
2523
2555
 
2524
- export { type Badge, type BaseSchema, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type Entity, type Event, type EventCatalog, type Flow, type FlowActorStepInput, FlowBuilder, type FlowBuilderInput, type FlowCustomStepInput, type FlowDataProductStepInput, type FlowDataStoreStepInput, type FlowExternalSystemStepInput, type FlowMessageStepInput, type FlowServiceStepInput, type FlowStep, type FlowStepInput, type FlowSubFlowStepInput, type Message, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
2556
+ export { type Badge, type BaseSchema, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type Entity, type Event, type EventCatalog, 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 Message, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
package/dist/index.d.ts CHANGED
@@ -246,6 +246,7 @@ interface Badge {
246
246
  backgroundColor: string;
247
247
  textColor: string;
248
248
  icon?: string;
249
+ url?: string;
249
250
  }
250
251
 
251
252
  interface Changelog {
@@ -335,10 +336,11 @@ declare enum DataClassification {
335
336
 
336
337
  interface FlowStep {
337
338
  id: string | number;
338
- type?: 'node' | 'message' | 'user' | 'actor';
339
+ type?: 'node' | 'message' | 'agent' | 'user' | 'actor';
339
340
  title: string;
340
341
  summary?: string;
341
342
  message?: ResourcePointer;
343
+ agent?: ResourcePointer;
342
344
  service?: ResourcePointer;
343
345
  flow?: ResourcePointer;
344
346
  container?: ResourcePointer;
@@ -536,6 +538,16 @@ type FlowMessageStepInput<TMessageId extends string = string> = FlowStepInput &
536
538
  };
537
539
  version?: string;
538
540
  };
541
+ /**
542
+ * Payload for a flow step that references an agent.
543
+ */
544
+ type FlowAgentStepInput = FlowStepInput & {
545
+ agent?: {
546
+ id: string;
547
+ version?: string;
548
+ };
549
+ version?: string;
550
+ };
539
551
  /**
540
552
  * Payload for a flow step that references a service.
541
553
  */
@@ -780,6 +792,26 @@ declare class FlowBuilder<TMessageId extends string = string> {
780
792
  * ```
781
793
  */
782
794
  addServiceStep(step: FlowServiceStepInput): this;
795
+ /**
796
+ * Add an agent step.
797
+ *
798
+ * @param step - The agent step payload.
799
+ *
800
+ * @example
801
+ * ```ts
802
+ * FlowBuilder.create({
803
+ * id: 'OrderFlow',
804
+ * name: 'Order Flow',
805
+ * version: '1.0.0',
806
+ * markdown: '',
807
+ * })
808
+ * .addAgentStep({
809
+ * id: 'FraudReviewAgent',
810
+ * agent: { id: 'FraudReviewAgent', version: '1.0.0' },
811
+ * });
812
+ * ```
813
+ */
814
+ addAgentStep(step: FlowAgentStepInput): this;
783
815
  /**
784
816
  * Add a data store step.
785
817
  *
@@ -2521,4 +2553,4 @@ declare const _default: (path: string) => {
2521
2553
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
2522
2554
  };
2523
2555
 
2524
- export { type Badge, type BaseSchema, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type Entity, type Event, type EventCatalog, type Flow, type FlowActorStepInput, FlowBuilder, type FlowBuilderInput, type FlowCustomStepInput, type FlowDataProductStepInput, type FlowDataStoreStepInput, type FlowExternalSystemStepInput, type FlowMessageStepInput, type FlowServiceStepInput, type FlowStep, type FlowStepInput, type FlowSubFlowStepInput, type Message, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
2556
+ export { type Badge, type BaseSchema, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type Entity, type Event, type EventCatalog, 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 Message, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
package/dist/index.js CHANGED
@@ -2529,6 +2529,7 @@ var import_node_path19 = require("path");
2529
2529
  var cloneStep = (step) => ({
2530
2530
  ...step,
2531
2531
  ...step.message ? { message: { ...step.message } } : {},
2532
+ ...step.agent ? { agent: { ...step.agent } } : {},
2532
2533
  ...step.service ? { service: { ...step.service } } : {},
2533
2534
  ...step.flow ? { flow: { ...step.flow } } : {},
2534
2535
  ...step.container ? { container: { ...step.container } } : {},
@@ -2677,6 +2678,40 @@ var FlowBuilder = class _FlowBuilder {
2677
2678
  step.nextSteps
2678
2679
  );
2679
2680
  }
2681
+ /**
2682
+ * Add an agent step.
2683
+ *
2684
+ * @param step - The agent step payload.
2685
+ *
2686
+ * @example
2687
+ * ```ts
2688
+ * FlowBuilder.create({
2689
+ * id: 'OrderFlow',
2690
+ * name: 'Order Flow',
2691
+ * version: '1.0.0',
2692
+ * markdown: '',
2693
+ * })
2694
+ * .addAgentStep({
2695
+ * id: 'FraudReviewAgent',
2696
+ * agent: { id: 'FraudReviewAgent', version: '1.0.0' },
2697
+ * });
2698
+ * ```
2699
+ */
2700
+ addAgentStep(step) {
2701
+ const agent = step.agent || {
2702
+ id: String(step.id),
2703
+ ...step.version ? { version: step.version } : {}
2704
+ };
2705
+ return this.addStepWithNext(
2706
+ {
2707
+ id: step.id,
2708
+ title: step.title || String(step.id),
2709
+ ...step.summary ? { summary: step.summary } : {},
2710
+ agent: { ...agent, ...step.version && !agent.version ? { version: step.version } : {} }
2711
+ },
2712
+ step.nextSteps
2713
+ );
2714
+ }
2680
2715
  /**
2681
2716
  * Add a data store step.
2682
2717
  *