@eventcatalog/sdk 2.21.2 → 2.23.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 +225 -25
- package/dist/index.d.ts +225 -25
- package/dist/index.js +578 -268
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +557 -247
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -188,8 +188,44 @@ interface Service extends BaseSchema {
|
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
type AgentTool = {
|
|
192
|
+
name: string;
|
|
193
|
+
type: string;
|
|
194
|
+
icon?: string;
|
|
195
|
+
url?: string;
|
|
196
|
+
description?: string;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
type AgentModel = {
|
|
200
|
+
provider?: string;
|
|
201
|
+
name?: string;
|
|
202
|
+
version?: string;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
interface Agent extends BaseSchema {
|
|
206
|
+
sends?: SendsPointer[];
|
|
207
|
+
receives?: ReceivesPointer[];
|
|
208
|
+
writesTo?: ResourcePointer[];
|
|
209
|
+
readsFrom?: ResourcePointer[];
|
|
210
|
+
flows?: ResourcePointer[];
|
|
211
|
+
model?: AgentModel;
|
|
212
|
+
tools?: AgentTool[];
|
|
213
|
+
detailsPanel?: {
|
|
214
|
+
domains?: DetailPanelProperty;
|
|
215
|
+
messages?: DetailPanelProperty;
|
|
216
|
+
versions?: DetailPanelProperty;
|
|
217
|
+
repository?: DetailPanelProperty;
|
|
218
|
+
owners?: DetailPanelProperty;
|
|
219
|
+
changelog?: DetailPanelProperty;
|
|
220
|
+
containers?: DetailPanelProperty;
|
|
221
|
+
tools?: DetailPanelProperty;
|
|
222
|
+
model?: DetailPanelProperty;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
191
226
|
interface Domain extends BaseSchema {
|
|
192
227
|
services?: ResourcePointer[];
|
|
228
|
+
agents?: ResourcePointer[];
|
|
193
229
|
domains?: ResourcePointer[];
|
|
194
230
|
entities?: ResourcePointer[];
|
|
195
231
|
dataProducts?: ResourcePointer[];
|
|
@@ -200,6 +236,7 @@ interface Domain extends BaseSchema {
|
|
|
200
236
|
parentDomains?: DetailPanelProperty;
|
|
201
237
|
subdomains?: DetailPanelProperty;
|
|
202
238
|
services?: DetailPanelProperty;
|
|
239
|
+
agents?: DetailPanelProperty;
|
|
203
240
|
entities?: DetailPanelProperty;
|
|
204
241
|
messages?: DetailPanelProperty;
|
|
205
242
|
ubiquitousLanguage?: DetailPanelProperty;
|
|
@@ -336,10 +373,11 @@ declare enum DataClassification {
|
|
|
336
373
|
|
|
337
374
|
interface FlowStep {
|
|
338
375
|
id: string | number;
|
|
339
|
-
type?: 'node' | 'message' | 'user' | 'actor';
|
|
376
|
+
type?: 'node' | 'message' | 'agent' | 'user' | 'actor';
|
|
340
377
|
title: string;
|
|
341
378
|
summary?: string;
|
|
342
379
|
message?: ResourcePointer;
|
|
380
|
+
agent?: ResourcePointer;
|
|
343
381
|
service?: ResourcePointer;
|
|
344
382
|
flow?: ResourcePointer;
|
|
345
383
|
container?: ResourcePointer;
|
|
@@ -400,6 +438,7 @@ type EventCatalog = {
|
|
|
400
438
|
resources: {
|
|
401
439
|
domains?: ExportedResource<Domain>[];
|
|
402
440
|
services?: ExportedResource<Service>[];
|
|
441
|
+
agents?: ExportedResource<Agent>[];
|
|
403
442
|
messages?: {
|
|
404
443
|
events?: ExportedResource<Event>[];
|
|
405
444
|
queries?: ExportedResource<Query>[];
|
|
@@ -429,6 +468,7 @@ type SnapshotGitInfo = {
|
|
|
429
468
|
type SnapshotResources = {
|
|
430
469
|
domains: Record<string, any>[];
|
|
431
470
|
services: Record<string, any>[];
|
|
471
|
+
agents?: Record<string, any>[];
|
|
432
472
|
messages: {
|
|
433
473
|
events: Record<string, any>[];
|
|
434
474
|
commands: Record<string, any>[];
|
|
@@ -459,7 +499,7 @@ type SnapshotMeta = {
|
|
|
459
499
|
filePath: string;
|
|
460
500
|
git?: SnapshotGitInfo;
|
|
461
501
|
};
|
|
462
|
-
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'domain' | 'channel';
|
|
502
|
+
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'agent' | 'domain' | 'channel';
|
|
463
503
|
type ResourceChangeType = 'added' | 'removed' | 'modified' | 'versioned';
|
|
464
504
|
type ResourceChange = {
|
|
465
505
|
resourceId: string;
|
|
@@ -537,6 +577,16 @@ type FlowMessageStepInput<TMessageId extends string = string> = FlowStepInput &
|
|
|
537
577
|
};
|
|
538
578
|
version?: string;
|
|
539
579
|
};
|
|
580
|
+
/**
|
|
581
|
+
* Payload for a flow step that references an agent.
|
|
582
|
+
*/
|
|
583
|
+
type FlowAgentStepInput = FlowStepInput & {
|
|
584
|
+
agent?: {
|
|
585
|
+
id: string;
|
|
586
|
+
version?: string;
|
|
587
|
+
};
|
|
588
|
+
version?: string;
|
|
589
|
+
};
|
|
540
590
|
/**
|
|
541
591
|
* Payload for a flow step that references a service.
|
|
542
592
|
*/
|
|
@@ -781,6 +831,26 @@ declare class FlowBuilder<TMessageId extends string = string> {
|
|
|
781
831
|
* ```
|
|
782
832
|
*/
|
|
783
833
|
addServiceStep(step: FlowServiceStepInput): this;
|
|
834
|
+
/**
|
|
835
|
+
* Add an agent step.
|
|
836
|
+
*
|
|
837
|
+
* @param step - The agent step payload.
|
|
838
|
+
*
|
|
839
|
+
* @example
|
|
840
|
+
* ```ts
|
|
841
|
+
* FlowBuilder.create({
|
|
842
|
+
* id: 'OrderFlow',
|
|
843
|
+
* name: 'Order Flow',
|
|
844
|
+
* version: '1.0.0',
|
|
845
|
+
* markdown: '',
|
|
846
|
+
* })
|
|
847
|
+
* .addAgentStep({
|
|
848
|
+
* id: 'FraudReviewAgent',
|
|
849
|
+
* agent: { id: 'FraudReviewAgent', version: '1.0.0' },
|
|
850
|
+
* });
|
|
851
|
+
* ```
|
|
852
|
+
*/
|
|
853
|
+
addAgentStep(step: FlowAgentStepInput): this;
|
|
784
854
|
/**
|
|
785
855
|
* Add a data store step.
|
|
786
856
|
*
|
|
@@ -986,6 +1056,22 @@ declare const _default: (path: string) => {
|
|
|
986
1056
|
format?: "md" | "mdx";
|
|
987
1057
|
override?: boolean;
|
|
988
1058
|
}) => Promise<void>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Adds an event to an agent in EventCatalog
|
|
1061
|
+
*
|
|
1062
|
+
* @param event - The event to write to the agent
|
|
1063
|
+
* @param agent - The agent and its id to write the event to
|
|
1064
|
+
* @param options - Optional options to write the event
|
|
1065
|
+
*
|
|
1066
|
+
*/
|
|
1067
|
+
writeEventToAgent: (event: Event, agent: {
|
|
1068
|
+
id: string;
|
|
1069
|
+
version?: string;
|
|
1070
|
+
}, options?: {
|
|
1071
|
+
path?: string;
|
|
1072
|
+
format?: "md" | "mdx";
|
|
1073
|
+
override?: boolean;
|
|
1074
|
+
}) => Promise<void>;
|
|
989
1075
|
/**
|
|
990
1076
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
991
1077
|
*
|
|
@@ -1099,6 +1185,22 @@ declare const _default: (path: string) => {
|
|
|
1099
1185
|
format?: "md" | "mdx";
|
|
1100
1186
|
override?: boolean;
|
|
1101
1187
|
}) => Promise<void>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Adds a command to an agent in EventCatalog
|
|
1190
|
+
*
|
|
1191
|
+
* @param command - The command to write to the agent
|
|
1192
|
+
* @param agent - The agent and its id to write the command to
|
|
1193
|
+
* @param options - Optional options to write the command
|
|
1194
|
+
*
|
|
1195
|
+
*/
|
|
1196
|
+
writeCommandToAgent: (command: Command, agent: {
|
|
1197
|
+
id: string;
|
|
1198
|
+
version?: string;
|
|
1199
|
+
}, options?: {
|
|
1200
|
+
path?: string;
|
|
1201
|
+
format?: "md" | "mdx";
|
|
1202
|
+
override?: boolean;
|
|
1203
|
+
}) => Promise<void>;
|
|
1102
1204
|
/**
|
|
1103
1205
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1104
1206
|
*
|
|
@@ -1212,6 +1314,22 @@ declare const _default: (path: string) => {
|
|
|
1212
1314
|
format?: "md" | "mdx";
|
|
1213
1315
|
override?: boolean;
|
|
1214
1316
|
}) => Promise<void>;
|
|
1317
|
+
/**
|
|
1318
|
+
* Adds a query to an agent in EventCatalog
|
|
1319
|
+
*
|
|
1320
|
+
* @param query - The query to write to the agent
|
|
1321
|
+
* @param agent - The agent and its id to write the query to
|
|
1322
|
+
* @param options - Optional options to write the query
|
|
1323
|
+
*
|
|
1324
|
+
*/
|
|
1325
|
+
writeQueryToAgent: (query: Query, agent: {
|
|
1326
|
+
id: string;
|
|
1327
|
+
version?: string;
|
|
1328
|
+
}, options?: {
|
|
1329
|
+
path?: string;
|
|
1330
|
+
format?: "md" | "mdx";
|
|
1331
|
+
override?: boolean;
|
|
1332
|
+
}) => Promise<void>;
|
|
1215
1333
|
/**
|
|
1216
1334
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1217
1335
|
*
|
|
@@ -1417,14 +1535,7 @@ declare const _default: (path: string) => {
|
|
|
1417
1535
|
path?: string;
|
|
1418
1536
|
override?: boolean;
|
|
1419
1537
|
versionExistingContent?: boolean;
|
|
1420
|
-
format
|
|
1421
|
-
* Adds an event to a service in EventCatalog
|
|
1422
|
-
*
|
|
1423
|
-
* @param event - The event to write to the service
|
|
1424
|
-
* @param service - The service and it's id to write to the event to
|
|
1425
|
-
* @param options - Optional options to write the event
|
|
1426
|
-
*
|
|
1427
|
-
*/: "md" | "mdx";
|
|
1538
|
+
format?: "md" | "mdx";
|
|
1428
1539
|
}) => Promise<void>;
|
|
1429
1540
|
/**
|
|
1430
1541
|
* Adds a versioned service to EventCatalog
|
|
@@ -1446,12 +1557,7 @@ declare const _default: (path: string) => {
|
|
|
1446
1557
|
version?: string;
|
|
1447
1558
|
direction?: string;
|
|
1448
1559
|
}, options?: {
|
|
1449
|
-
path
|
|
1450
|
-
* Returns a command from EventCatalog
|
|
1451
|
-
* @param id - The id of the command to retrieve
|
|
1452
|
-
* @param version - Optional id of the version to get (supports semver)
|
|
1453
|
-
* @returns Command|Undefined
|
|
1454
|
-
*/: string;
|
|
1560
|
+
path?: string;
|
|
1455
1561
|
format?: "md" | "mdx";
|
|
1456
1562
|
override?: boolean;
|
|
1457
1563
|
}) => Promise<void>;
|
|
@@ -1659,6 +1765,67 @@ declare const _default: (path: string) => {
|
|
|
1659
1765
|
* @returns The service.
|
|
1660
1766
|
*/
|
|
1661
1767
|
toService: (file: string) => Promise<Service>;
|
|
1768
|
+
/**
|
|
1769
|
+
* ================================
|
|
1770
|
+
* Agents
|
|
1771
|
+
* ================================
|
|
1772
|
+
*/
|
|
1773
|
+
writeAgent: (agent: Agent, options?: {
|
|
1774
|
+
path?: string;
|
|
1775
|
+
override?: boolean;
|
|
1776
|
+
versionExistingContent?: boolean;
|
|
1777
|
+
format?: "md" | "mdx";
|
|
1778
|
+
}) => Promise<void>;
|
|
1779
|
+
writeVersionedAgent: (agent: Agent) => Promise<void>;
|
|
1780
|
+
writeAgentToDomain: (agent: Agent, domain: {
|
|
1781
|
+
id: string;
|
|
1782
|
+
version?: string;
|
|
1783
|
+
}, options?: {
|
|
1784
|
+
path?: string;
|
|
1785
|
+
format?: "md" | "mdx";
|
|
1786
|
+
override?: boolean;
|
|
1787
|
+
}) => Promise<void>;
|
|
1788
|
+
getAgent: (id: string, version?: string) => Promise<Agent>;
|
|
1789
|
+
getAgentByPath: (path: string) => Promise<Agent>;
|
|
1790
|
+
getAgents: (options?: {
|
|
1791
|
+
latestOnly?: boolean;
|
|
1792
|
+
}) => Promise<Agent[]>;
|
|
1793
|
+
versionAgent: (id: string) => Promise<void>;
|
|
1794
|
+
rmAgent: (path: string) => Promise<void>;
|
|
1795
|
+
rmAgentById: (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
|
|
1796
|
+
addFileToAgent: (id: string, file: {
|
|
1797
|
+
content: string;
|
|
1798
|
+
fileName: string;
|
|
1799
|
+
}, version?: string) => Promise<void>;
|
|
1800
|
+
addEventToAgent: (id: string, direction: string, message: {
|
|
1801
|
+
id: string;
|
|
1802
|
+
version: string;
|
|
1803
|
+
fields?: string[];
|
|
1804
|
+
group?: string;
|
|
1805
|
+
}, version?: string) => Promise<void>;
|
|
1806
|
+
addCommandToAgent: (id: string, direction: string, message: {
|
|
1807
|
+
id: string;
|
|
1808
|
+
version: string;
|
|
1809
|
+
fields?: string[];
|
|
1810
|
+
group?: string;
|
|
1811
|
+
}, version?: string) => Promise<void>;
|
|
1812
|
+
addQueryToAgent: (id: string, direction: string, message: {
|
|
1813
|
+
id: string;
|
|
1814
|
+
version: string;
|
|
1815
|
+
fields?: string[];
|
|
1816
|
+
group?: string;
|
|
1817
|
+
}, version?: string) => Promise<void>;
|
|
1818
|
+
addDataStoreToAgent: (id: string, direction: string, dataStore: {
|
|
1819
|
+
id: string;
|
|
1820
|
+
version: string;
|
|
1821
|
+
}, version?: string) => Promise<void>;
|
|
1822
|
+
addFlowToAgent: (id: string, flow: {
|
|
1823
|
+
id: string;
|
|
1824
|
+
version: string;
|
|
1825
|
+
}, version?: string) => Promise<void>;
|
|
1826
|
+
agentHasVersion: (id: string, version?: string) => Promise<boolean>;
|
|
1827
|
+
isAgent: (path: string) => Promise<boolean>;
|
|
1828
|
+
toAgent: (file: string) => Promise<Agent>;
|
|
1662
1829
|
/**
|
|
1663
1830
|
* ================================
|
|
1664
1831
|
* Domains
|
|
@@ -1756,6 +1923,17 @@ declare const _default: (path: string) => {
|
|
|
1756
1923
|
id: string;
|
|
1757
1924
|
version: string;
|
|
1758
1925
|
}, version?: string) => Promise<void>;
|
|
1926
|
+
/**
|
|
1927
|
+
* Adds a given agent to a domain
|
|
1928
|
+
* @param id - The id of the domain
|
|
1929
|
+
* @param agent - The id and version of the agent to add
|
|
1930
|
+
* @param version - (Optional) The version of the domain to add the agent to
|
|
1931
|
+
* @returns
|
|
1932
|
+
*/
|
|
1933
|
+
addAgentToDomain: (id: string, agent: {
|
|
1934
|
+
id: string;
|
|
1935
|
+
version: string;
|
|
1936
|
+
}, version?: string) => Promise<void>;
|
|
1759
1937
|
/**
|
|
1760
1938
|
* Adds a given subdomain to a domain
|
|
1761
1939
|
* @param id - The id of the domain
|
|
@@ -2045,29 +2223,29 @@ declare const _default: (path: string) => {
|
|
|
2045
2223
|
attachSchema?: boolean;
|
|
2046
2224
|
}) => Promise<Message>;
|
|
2047
2225
|
/**
|
|
2048
|
-
* Returns the producers and consumers (services) for a given message
|
|
2226
|
+
* Returns the producers and consumers (services and agents) for a given message
|
|
2049
2227
|
* @param id - The id of the message to get the producers and consumers for
|
|
2050
2228
|
* @param version - Optional version of the message
|
|
2051
|
-
* @returns { producers: Service[], consumers: Service[] }
|
|
2229
|
+
* @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
|
|
2052
2230
|
*/
|
|
2053
2231
|
getProducersAndConsumersForMessage: (id: string, version?: string, options?: {
|
|
2054
2232
|
latestOnly?: boolean;
|
|
2055
2233
|
}) => Promise<{
|
|
2056
|
-
producers: Service[];
|
|
2057
|
-
consumers: Service[];
|
|
2234
|
+
producers: (Service | Agent)[];
|
|
2235
|
+
consumers: (Service | Agent)[];
|
|
2058
2236
|
}>;
|
|
2059
2237
|
/**
|
|
2060
2238
|
* Returns the consumers of a given schema path
|
|
2061
2239
|
* @param path - The path to the schema to get the consumers for
|
|
2062
|
-
* @returns Service[]
|
|
2240
|
+
* @returns (Service|Agent)[]
|
|
2063
2241
|
*/
|
|
2064
|
-
getConsumersOfSchema: (path: string) => Promise<Service[]>;
|
|
2242
|
+
getConsumersOfSchema: (path: string) => Promise<(Service | Agent)[]>;
|
|
2065
2243
|
/**
|
|
2066
2244
|
* Returns the producers of a given schema path
|
|
2067
2245
|
* @param path - The path to the schema to get the producers for
|
|
2068
|
-
* @returns Service[]
|
|
2246
|
+
* @returns (Service|Agent)[]
|
|
2069
2247
|
*/
|
|
2070
|
-
getProducersOfSchema: (path: string) => Promise<Service[]>;
|
|
2248
|
+
getProducersOfSchema: (path: string) => Promise<(Service | Agent)[]>;
|
|
2071
2249
|
/**
|
|
2072
2250
|
* Returns the schema for a given message (event, command or query) by its id and version.
|
|
2073
2251
|
* If no version is given, the latest version is used.
|
|
@@ -2215,6 +2393,28 @@ declare const _default: (path: string) => {
|
|
|
2215
2393
|
writeFlowToService: (flow: Flow, service: {
|
|
2216
2394
|
id: string;
|
|
2217
2395
|
version?: string;
|
|
2396
|
+
}, options?: {
|
|
2397
|
+
path?: string;
|
|
2398
|
+
format? /**
|
|
2399
|
+
* Adds a file to the given event
|
|
2400
|
+
* @param id - The id of the event to add the file to
|
|
2401
|
+
* @param file - File contents to add including the content and the file name
|
|
2402
|
+
* @param version - Optional version of the event to add the file to
|
|
2403
|
+
* @returns
|
|
2404
|
+
*/: "md" | "mdx";
|
|
2405
|
+
override?: boolean;
|
|
2406
|
+
}) => Promise<void>;
|
|
2407
|
+
/**
|
|
2408
|
+
* Adds a flow to an agent in EventCatalog
|
|
2409
|
+
*
|
|
2410
|
+
* @param flow - The flow to write to the agent
|
|
2411
|
+
* @param agent - The agent and its id to write the flow to
|
|
2412
|
+
* @param options - Optional options to write the flow
|
|
2413
|
+
*
|
|
2414
|
+
*/
|
|
2415
|
+
writeFlowToAgent: (flow: Flow, agent: {
|
|
2416
|
+
id: string;
|
|
2417
|
+
version?: string;
|
|
2218
2418
|
}, options?: {
|
|
2219
2419
|
path?: string;
|
|
2220
2420
|
format?: "md" | "mdx";
|
|
@@ -2522,4 +2722,4 @@ declare const _default: (path: string) => {
|
|
|
2522
2722
|
toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
|
|
2523
2723
|
};
|
|
2524
2724
|
|
|
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 };
|
|
2725
|
+
export { type Agent, type AgentModel, type AgentTool, 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 };
|