@eventcatalog/sdk 2.21.2 → 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 +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -336,10 +336,11 @@ declare enum DataClassification {
|
|
|
336
336
|
|
|
337
337
|
interface FlowStep {
|
|
338
338
|
id: string | number;
|
|
339
|
-
type?: 'node' | 'message' | 'user' | 'actor';
|
|
339
|
+
type?: 'node' | 'message' | 'agent' | 'user' | 'actor';
|
|
340
340
|
title: string;
|
|
341
341
|
summary?: string;
|
|
342
342
|
message?: ResourcePointer;
|
|
343
|
+
agent?: ResourcePointer;
|
|
343
344
|
service?: ResourcePointer;
|
|
344
345
|
flow?: ResourcePointer;
|
|
345
346
|
container?: ResourcePointer;
|
|
@@ -537,6 +538,16 @@ type FlowMessageStepInput<TMessageId extends string = string> = FlowStepInput &
|
|
|
537
538
|
};
|
|
538
539
|
version?: string;
|
|
539
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
|
+
};
|
|
540
551
|
/**
|
|
541
552
|
* Payload for a flow step that references a service.
|
|
542
553
|
*/
|
|
@@ -781,6 +792,26 @@ declare class FlowBuilder<TMessageId extends string = string> {
|
|
|
781
792
|
* ```
|
|
782
793
|
*/
|
|
783
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;
|
|
784
815
|
/**
|
|
785
816
|
* Add a data store step.
|
|
786
817
|
*
|
|
@@ -2522,4 +2553,4 @@ declare const _default: (path: string) => {
|
|
|
2522
2553
|
toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
|
|
2523
2554
|
};
|
|
2524
2555
|
|
|
2525
|
-
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
|
@@ -336,10 +336,11 @@ declare enum DataClassification {
|
|
|
336
336
|
|
|
337
337
|
interface FlowStep {
|
|
338
338
|
id: string | number;
|
|
339
|
-
type?: 'node' | 'message' | 'user' | 'actor';
|
|
339
|
+
type?: 'node' | 'message' | 'agent' | 'user' | 'actor';
|
|
340
340
|
title: string;
|
|
341
341
|
summary?: string;
|
|
342
342
|
message?: ResourcePointer;
|
|
343
|
+
agent?: ResourcePointer;
|
|
343
344
|
service?: ResourcePointer;
|
|
344
345
|
flow?: ResourcePointer;
|
|
345
346
|
container?: ResourcePointer;
|
|
@@ -537,6 +538,16 @@ type FlowMessageStepInput<TMessageId extends string = string> = FlowStepInput &
|
|
|
537
538
|
};
|
|
538
539
|
version?: string;
|
|
539
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
|
+
};
|
|
540
551
|
/**
|
|
541
552
|
* Payload for a flow step that references a service.
|
|
542
553
|
*/
|
|
@@ -781,6 +792,26 @@ declare class FlowBuilder<TMessageId extends string = string> {
|
|
|
781
792
|
* ```
|
|
782
793
|
*/
|
|
783
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;
|
|
784
815
|
/**
|
|
785
816
|
* Add a data store step.
|
|
786
817
|
*
|
|
@@ -2522,4 +2553,4 @@ declare const _default: (path: string) => {
|
|
|
2522
2553
|
toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
|
|
2523
2554
|
};
|
|
2524
2555
|
|
|
2525
|
-
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
|
*
|