@eventcatalog/sdk 2.22.0 → 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 +193 -24
- package/dist/index.d.ts +193 -24
- package/dist/index.js +543 -268
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +522 -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;
|
|
@@ -401,6 +438,7 @@ type EventCatalog = {
|
|
|
401
438
|
resources: {
|
|
402
439
|
domains?: ExportedResource<Domain>[];
|
|
403
440
|
services?: ExportedResource<Service>[];
|
|
441
|
+
agents?: ExportedResource<Agent>[];
|
|
404
442
|
messages?: {
|
|
405
443
|
events?: ExportedResource<Event>[];
|
|
406
444
|
queries?: ExportedResource<Query>[];
|
|
@@ -430,6 +468,7 @@ type SnapshotGitInfo = {
|
|
|
430
468
|
type SnapshotResources = {
|
|
431
469
|
domains: Record<string, any>[];
|
|
432
470
|
services: Record<string, any>[];
|
|
471
|
+
agents?: Record<string, any>[];
|
|
433
472
|
messages: {
|
|
434
473
|
events: Record<string, any>[];
|
|
435
474
|
commands: Record<string, any>[];
|
|
@@ -460,7 +499,7 @@ type SnapshotMeta = {
|
|
|
460
499
|
filePath: string;
|
|
461
500
|
git?: SnapshotGitInfo;
|
|
462
501
|
};
|
|
463
|
-
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'domain' | 'channel';
|
|
502
|
+
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'agent' | 'domain' | 'channel';
|
|
464
503
|
type ResourceChangeType = 'added' | 'removed' | 'modified' | 'versioned';
|
|
465
504
|
type ResourceChange = {
|
|
466
505
|
resourceId: string;
|
|
@@ -1017,6 +1056,22 @@ declare const _default: (path: string) => {
|
|
|
1017
1056
|
format?: "md" | "mdx";
|
|
1018
1057
|
override?: boolean;
|
|
1019
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>;
|
|
1020
1075
|
/**
|
|
1021
1076
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1022
1077
|
*
|
|
@@ -1130,6 +1185,22 @@ declare const _default: (path: string) => {
|
|
|
1130
1185
|
format?: "md" | "mdx";
|
|
1131
1186
|
override?: boolean;
|
|
1132
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>;
|
|
1133
1204
|
/**
|
|
1134
1205
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1135
1206
|
*
|
|
@@ -1243,6 +1314,22 @@ declare const _default: (path: string) => {
|
|
|
1243
1314
|
format?: "md" | "mdx";
|
|
1244
1315
|
override?: boolean;
|
|
1245
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>;
|
|
1246
1333
|
/**
|
|
1247
1334
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1248
1335
|
*
|
|
@@ -1448,14 +1535,7 @@ declare const _default: (path: string) => {
|
|
|
1448
1535
|
path?: string;
|
|
1449
1536
|
override?: boolean;
|
|
1450
1537
|
versionExistingContent?: boolean;
|
|
1451
|
-
format
|
|
1452
|
-
* Adds an event to a service in EventCatalog
|
|
1453
|
-
*
|
|
1454
|
-
* @param event - The event to write to the service
|
|
1455
|
-
* @param service - The service and it's id to write to the event to
|
|
1456
|
-
* @param options - Optional options to write the event
|
|
1457
|
-
*
|
|
1458
|
-
*/: "md" | "mdx";
|
|
1538
|
+
format?: "md" | "mdx";
|
|
1459
1539
|
}) => Promise<void>;
|
|
1460
1540
|
/**
|
|
1461
1541
|
* Adds a versioned service to EventCatalog
|
|
@@ -1477,12 +1557,7 @@ declare const _default: (path: string) => {
|
|
|
1477
1557
|
version?: string;
|
|
1478
1558
|
direction?: string;
|
|
1479
1559
|
}, options?: {
|
|
1480
|
-
path
|
|
1481
|
-
* Returns a command from EventCatalog
|
|
1482
|
-
* @param id - The id of the command to retrieve
|
|
1483
|
-
* @param version - Optional id of the version to get (supports semver)
|
|
1484
|
-
* @returns Command|Undefined
|
|
1485
|
-
*/: string;
|
|
1560
|
+
path?: string;
|
|
1486
1561
|
format?: "md" | "mdx";
|
|
1487
1562
|
override?: boolean;
|
|
1488
1563
|
}) => Promise<void>;
|
|
@@ -1690,6 +1765,67 @@ declare const _default: (path: string) => {
|
|
|
1690
1765
|
* @returns The service.
|
|
1691
1766
|
*/
|
|
1692
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>;
|
|
1693
1829
|
/**
|
|
1694
1830
|
* ================================
|
|
1695
1831
|
* Domains
|
|
@@ -1787,6 +1923,17 @@ declare const _default: (path: string) => {
|
|
|
1787
1923
|
id: string;
|
|
1788
1924
|
version: string;
|
|
1789
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>;
|
|
1790
1937
|
/**
|
|
1791
1938
|
* Adds a given subdomain to a domain
|
|
1792
1939
|
* @param id - The id of the domain
|
|
@@ -2076,29 +2223,29 @@ declare const _default: (path: string) => {
|
|
|
2076
2223
|
attachSchema?: boolean;
|
|
2077
2224
|
}) => Promise<Message>;
|
|
2078
2225
|
/**
|
|
2079
|
-
* Returns the producers and consumers (services) for a given message
|
|
2226
|
+
* Returns the producers and consumers (services and agents) for a given message
|
|
2080
2227
|
* @param id - The id of the message to get the producers and consumers for
|
|
2081
2228
|
* @param version - Optional version of the message
|
|
2082
|
-
* @returns { producers: Service[], consumers: Service[] }
|
|
2229
|
+
* @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
|
|
2083
2230
|
*/
|
|
2084
2231
|
getProducersAndConsumersForMessage: (id: string, version?: string, options?: {
|
|
2085
2232
|
latestOnly?: boolean;
|
|
2086
2233
|
}) => Promise<{
|
|
2087
|
-
producers: Service[];
|
|
2088
|
-
consumers: Service[];
|
|
2234
|
+
producers: (Service | Agent)[];
|
|
2235
|
+
consumers: (Service | Agent)[];
|
|
2089
2236
|
}>;
|
|
2090
2237
|
/**
|
|
2091
2238
|
* Returns the consumers of a given schema path
|
|
2092
2239
|
* @param path - The path to the schema to get the consumers for
|
|
2093
|
-
* @returns Service[]
|
|
2240
|
+
* @returns (Service|Agent)[]
|
|
2094
2241
|
*/
|
|
2095
|
-
getConsumersOfSchema: (path: string) => Promise<Service[]>;
|
|
2242
|
+
getConsumersOfSchema: (path: string) => Promise<(Service | Agent)[]>;
|
|
2096
2243
|
/**
|
|
2097
2244
|
* Returns the producers of a given schema path
|
|
2098
2245
|
* @param path - The path to the schema to get the producers for
|
|
2099
|
-
* @returns Service[]
|
|
2246
|
+
* @returns (Service|Agent)[]
|
|
2100
2247
|
*/
|
|
2101
|
-
getProducersOfSchema: (path: string) => Promise<Service[]>;
|
|
2248
|
+
getProducersOfSchema: (path: string) => Promise<(Service | Agent)[]>;
|
|
2102
2249
|
/**
|
|
2103
2250
|
* Returns the schema for a given message (event, command or query) by its id and version.
|
|
2104
2251
|
* If no version is given, the latest version is used.
|
|
@@ -2246,6 +2393,28 @@ declare const _default: (path: string) => {
|
|
|
2246
2393
|
writeFlowToService: (flow: Flow, service: {
|
|
2247
2394
|
id: string;
|
|
2248
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;
|
|
2249
2418
|
}, options?: {
|
|
2250
2419
|
path?: string;
|
|
2251
2420
|
format?: "md" | "mdx";
|
|
@@ -2553,4 +2722,4 @@ declare const _default: (path: string) => {
|
|
|
2553
2722
|
toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
|
|
2554
2723
|
};
|
|
2555
2724
|
|
|
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 };
|
|
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 };
|
package/dist/index.d.ts
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;
|
|
@@ -401,6 +438,7 @@ type EventCatalog = {
|
|
|
401
438
|
resources: {
|
|
402
439
|
domains?: ExportedResource<Domain>[];
|
|
403
440
|
services?: ExportedResource<Service>[];
|
|
441
|
+
agents?: ExportedResource<Agent>[];
|
|
404
442
|
messages?: {
|
|
405
443
|
events?: ExportedResource<Event>[];
|
|
406
444
|
queries?: ExportedResource<Query>[];
|
|
@@ -430,6 +468,7 @@ type SnapshotGitInfo = {
|
|
|
430
468
|
type SnapshotResources = {
|
|
431
469
|
domains: Record<string, any>[];
|
|
432
470
|
services: Record<string, any>[];
|
|
471
|
+
agents?: Record<string, any>[];
|
|
433
472
|
messages: {
|
|
434
473
|
events: Record<string, any>[];
|
|
435
474
|
commands: Record<string, any>[];
|
|
@@ -460,7 +499,7 @@ type SnapshotMeta = {
|
|
|
460
499
|
filePath: string;
|
|
461
500
|
git?: SnapshotGitInfo;
|
|
462
501
|
};
|
|
463
|
-
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'domain' | 'channel';
|
|
502
|
+
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'agent' | 'domain' | 'channel';
|
|
464
503
|
type ResourceChangeType = 'added' | 'removed' | 'modified' | 'versioned';
|
|
465
504
|
type ResourceChange = {
|
|
466
505
|
resourceId: string;
|
|
@@ -1017,6 +1056,22 @@ declare const _default: (path: string) => {
|
|
|
1017
1056
|
format?: "md" | "mdx";
|
|
1018
1057
|
override?: boolean;
|
|
1019
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>;
|
|
1020
1075
|
/**
|
|
1021
1076
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1022
1077
|
*
|
|
@@ -1130,6 +1185,22 @@ declare const _default: (path: string) => {
|
|
|
1130
1185
|
format?: "md" | "mdx";
|
|
1131
1186
|
override?: boolean;
|
|
1132
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>;
|
|
1133
1204
|
/**
|
|
1134
1205
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1135
1206
|
*
|
|
@@ -1243,6 +1314,22 @@ declare const _default: (path: string) => {
|
|
|
1243
1314
|
format?: "md" | "mdx";
|
|
1244
1315
|
override?: boolean;
|
|
1245
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>;
|
|
1246
1333
|
/**
|
|
1247
1334
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1248
1335
|
*
|
|
@@ -1448,14 +1535,7 @@ declare const _default: (path: string) => {
|
|
|
1448
1535
|
path?: string;
|
|
1449
1536
|
override?: boolean;
|
|
1450
1537
|
versionExistingContent?: boolean;
|
|
1451
|
-
format
|
|
1452
|
-
* Adds an event to a service in EventCatalog
|
|
1453
|
-
*
|
|
1454
|
-
* @param event - The event to write to the service
|
|
1455
|
-
* @param service - The service and it's id to write to the event to
|
|
1456
|
-
* @param options - Optional options to write the event
|
|
1457
|
-
*
|
|
1458
|
-
*/: "md" | "mdx";
|
|
1538
|
+
format?: "md" | "mdx";
|
|
1459
1539
|
}) => Promise<void>;
|
|
1460
1540
|
/**
|
|
1461
1541
|
* Adds a versioned service to EventCatalog
|
|
@@ -1477,12 +1557,7 @@ declare const _default: (path: string) => {
|
|
|
1477
1557
|
version?: string;
|
|
1478
1558
|
direction?: string;
|
|
1479
1559
|
}, options?: {
|
|
1480
|
-
path
|
|
1481
|
-
* Returns a command from EventCatalog
|
|
1482
|
-
* @param id - The id of the command to retrieve
|
|
1483
|
-
* @param version - Optional id of the version to get (supports semver)
|
|
1484
|
-
* @returns Command|Undefined
|
|
1485
|
-
*/: string;
|
|
1560
|
+
path?: string;
|
|
1486
1561
|
format?: "md" | "mdx";
|
|
1487
1562
|
override?: boolean;
|
|
1488
1563
|
}) => Promise<void>;
|
|
@@ -1690,6 +1765,67 @@ declare const _default: (path: string) => {
|
|
|
1690
1765
|
* @returns The service.
|
|
1691
1766
|
*/
|
|
1692
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>;
|
|
1693
1829
|
/**
|
|
1694
1830
|
* ================================
|
|
1695
1831
|
* Domains
|
|
@@ -1787,6 +1923,17 @@ declare const _default: (path: string) => {
|
|
|
1787
1923
|
id: string;
|
|
1788
1924
|
version: string;
|
|
1789
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>;
|
|
1790
1937
|
/**
|
|
1791
1938
|
* Adds a given subdomain to a domain
|
|
1792
1939
|
* @param id - The id of the domain
|
|
@@ -2076,29 +2223,29 @@ declare const _default: (path: string) => {
|
|
|
2076
2223
|
attachSchema?: boolean;
|
|
2077
2224
|
}) => Promise<Message>;
|
|
2078
2225
|
/**
|
|
2079
|
-
* Returns the producers and consumers (services) for a given message
|
|
2226
|
+
* Returns the producers and consumers (services and agents) for a given message
|
|
2080
2227
|
* @param id - The id of the message to get the producers and consumers for
|
|
2081
2228
|
* @param version - Optional version of the message
|
|
2082
|
-
* @returns { producers: Service[], consumers: Service[] }
|
|
2229
|
+
* @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
|
|
2083
2230
|
*/
|
|
2084
2231
|
getProducersAndConsumersForMessage: (id: string, version?: string, options?: {
|
|
2085
2232
|
latestOnly?: boolean;
|
|
2086
2233
|
}) => Promise<{
|
|
2087
|
-
producers: Service[];
|
|
2088
|
-
consumers: Service[];
|
|
2234
|
+
producers: (Service | Agent)[];
|
|
2235
|
+
consumers: (Service | Agent)[];
|
|
2089
2236
|
}>;
|
|
2090
2237
|
/**
|
|
2091
2238
|
* Returns the consumers of a given schema path
|
|
2092
2239
|
* @param path - The path to the schema to get the consumers for
|
|
2093
|
-
* @returns Service[]
|
|
2240
|
+
* @returns (Service|Agent)[]
|
|
2094
2241
|
*/
|
|
2095
|
-
getConsumersOfSchema: (path: string) => Promise<Service[]>;
|
|
2242
|
+
getConsumersOfSchema: (path: string) => Promise<(Service | Agent)[]>;
|
|
2096
2243
|
/**
|
|
2097
2244
|
* Returns the producers of a given schema path
|
|
2098
2245
|
* @param path - The path to the schema to get the producers for
|
|
2099
|
-
* @returns Service[]
|
|
2246
|
+
* @returns (Service|Agent)[]
|
|
2100
2247
|
*/
|
|
2101
|
-
getProducersOfSchema: (path: string) => Promise<Service[]>;
|
|
2248
|
+
getProducersOfSchema: (path: string) => Promise<(Service | Agent)[]>;
|
|
2102
2249
|
/**
|
|
2103
2250
|
* Returns the schema for a given message (event, command or query) by its id and version.
|
|
2104
2251
|
* If no version is given, the latest version is used.
|
|
@@ -2246,6 +2393,28 @@ declare const _default: (path: string) => {
|
|
|
2246
2393
|
writeFlowToService: (flow: Flow, service: {
|
|
2247
2394
|
id: string;
|
|
2248
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;
|
|
2249
2418
|
}, options?: {
|
|
2250
2419
|
path?: string;
|
|
2251
2420
|
format?: "md" | "mdx";
|
|
@@ -2553,4 +2722,4 @@ declare const _default: (path: string) => {
|
|
|
2553
2722
|
toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
|
|
2554
2723
|
};
|
|
2555
2724
|
|
|
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 };
|
|
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 };
|