@eventcatalog/sdk 2.24.2 → 2.25.0-beta.1

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.ts CHANGED
@@ -52,6 +52,21 @@ type ResourcePointer = {
52
52
  type?: string;
53
53
  };
54
54
 
55
+ type SystemScope = 'internal' | 'external';
56
+
57
+ type SystemRelationshipPointer = {
58
+ id: string;
59
+ version?: string;
60
+ label?: string;
61
+ };
62
+
63
+ type SystemActorRelationship = {
64
+ id: string;
65
+ name?: string;
66
+ label?: string;
67
+ direction?: 'inbound' | 'outbound';
68
+ };
69
+
55
70
  type SchemaPointer = {
56
71
  id?: string;
57
72
  ref?: string;
@@ -239,6 +254,7 @@ interface Domain extends BaseSchema {
239
254
  services?: ResourcePointer[];
240
255
  agents?: ResourcePointer[];
241
256
  domains?: ResourcePointer[];
257
+ systems?: ResourcePointer[];
242
258
  entities?: ResourcePointer[];
243
259
  dataProducts?: ResourcePointer[];
244
260
  flows?: ResourcePointer[];
@@ -247,6 +263,7 @@ interface Domain extends BaseSchema {
247
263
  detailsPanel?: {
248
264
  parentDomains?: DetailPanelProperty;
249
265
  subdomains?: DetailPanelProperty;
266
+ systems?: DetailPanelProperty;
250
267
  services?: DetailPanelProperty;
251
268
  agents?: DetailPanelProperty;
252
269
  entities?: DetailPanelProperty;
@@ -259,6 +276,28 @@ interface Domain extends BaseSchema {
259
276
  };
260
277
  }
261
278
 
279
+ interface System extends BaseSchema {
280
+ scope?: SystemScope;
281
+ services?: ResourcePointer[];
282
+ flows?: ResourcePointer[];
283
+ entities?: ResourcePointer[];
284
+ containers?: ResourcePointer[];
285
+ relationships?: SystemRelationshipPointer[];
286
+ actors?: SystemActorRelationship[];
287
+ detailsPanel?: {
288
+ versions?: DetailPanelProperty;
289
+ repository?: DetailPanelProperty;
290
+ owners?: DetailPanelProperty;
291
+ changelog?: DetailPanelProperty;
292
+ attachments?: DetailPanelProperty;
293
+ services?: DetailPanelProperty;
294
+ flows?: DetailPanelProperty;
295
+ entities?: DetailPanelProperty;
296
+ containers?: DetailPanelProperty;
297
+ diagrams?: DetailPanelProperty;
298
+ };
299
+ }
300
+
262
301
  interface Team {
263
302
  id: string;
264
303
  name: string;
@@ -363,6 +402,54 @@ interface Diagram extends BaseSchema {
363
402
  };
364
403
  }
365
404
 
405
+ type AdrStatus = 'proposed' | 'accepted' | 'rejected' | 'deprecated' | 'superseded';
406
+
407
+ type AdrPointer = {
408
+ id: string;
409
+ version?: string;
410
+ };
411
+
412
+ type AdrResourcePointer = AdrPointer & {
413
+ type:
414
+ | 'agent'
415
+ | 'service'
416
+ | 'event'
417
+ | 'command'
418
+ | 'query'
419
+ | 'flow'
420
+ | 'channel'
421
+ | 'domain'
422
+ | 'system'
423
+ | 'user'
424
+ | 'team'
425
+ | 'container'
426
+ | 'entity'
427
+ | 'diagram'
428
+ | 'data-product';
429
+ };
430
+
431
+ interface Adr extends BaseSchema {
432
+ status: AdrStatus;
433
+ date: Date | string;
434
+ decisionMakers?: string[];
435
+ appliesTo?: AdrResourcePointer[];
436
+ supersedes?: AdrPointer[];
437
+ supersededBy?: AdrPointer[];
438
+ amends?: AdrPointer[];
439
+ amendedBy?: AdrPointer[];
440
+ related?: AdrPointer[];
441
+ detailsPanel?: {
442
+ status?: DetailPanelProperty;
443
+ date?: DetailPanelProperty;
444
+ decisionMakers?: DetailPanelProperty;
445
+ appliesTo?: DetailPanelProperty;
446
+ relationships?: DetailPanelProperty;
447
+ owners?: DetailPanelProperty;
448
+ repository?: DetailPanelProperty;
449
+ changelog?: DetailPanelProperty;
450
+ };
451
+ }
452
+
366
453
  type DataProductOutputPointer = {
367
454
  id: string;
368
455
  version?: string;
@@ -461,6 +548,7 @@ type EventCatalog = {
461
548
  createdAt: string;
462
549
  resources: {
463
550
  domains?: ExportedResource<Domain>[];
551
+ systems?: ExportedResource<System>[];
464
552
  services?: ExportedResource<Service>[];
465
553
  agents?: ExportedResource<Agent>[];
466
554
  messages?: {
@@ -474,6 +562,7 @@ type EventCatalog = {
474
562
  entities?: ExportedResource<Entity>[];
475
563
  containers?: ExportedResource<Container>[];
476
564
  flows?: ExportedResource<Flow>[];
565
+ adrs?: ExportedResource<Adr>[];
477
566
  customDocs?: ExportedResource<CustomDoc>[];
478
567
  };
479
568
  };
@@ -1350,7 +1439,23 @@ declare const _default: (path: string) => {
1350
1439
  id: string;
1351
1440
  version?: string;
1352
1441
  }, options?: {
1353
- path?: string;
1442
+ path
1443
+ /**
1444
+ * Adds an event to a service in EventCatalog
1445
+ *
1446
+ * @param event - The event to write to the service
1447
+ * @param service - The service and it's id to write to the event to
1448
+ * @param options - Optional options to write the event
1449
+ *
1450
+ */
1451
+ ? /**
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
+ */: string;
1354
1459
  format?: "md" | "mdx";
1355
1460
  override?: boolean;
1356
1461
  }) => Promise<void>;
@@ -1585,6 +1690,22 @@ declare const _default: (path: string) => {
1585
1690
  format?: "md" | "mdx";
1586
1691
  override?: boolean;
1587
1692
  }) => Promise<void>;
1693
+ /**
1694
+ * Adds a service to a system in EventCatalog
1695
+ *
1696
+ * @param service - The service to write
1697
+ * @param system - The system to add the service to
1698
+ * @param options - Optional options to write the service
1699
+ *
1700
+ */
1701
+ writeServiceToSystem: (service: Service, system: {
1702
+ id: string;
1703
+ version?: string;
1704
+ }, options?: {
1705
+ path?: string;
1706
+ format?: "md" | "mdx";
1707
+ override?: boolean;
1708
+ }) => Promise<void>;
1588
1709
  /**
1589
1710
  * Returns a service from EventCatalog
1590
1711
  * @param id - The id of the service to retrieve
@@ -1789,6 +1910,56 @@ declare const _default: (path: string) => {
1789
1910
  * @returns The service.
1790
1911
  */
1791
1912
  toService: (file: string) => Promise<Service>;
1913
+ /**
1914
+ * ================================
1915
+ * Systems
1916
+ * ================================
1917
+ */
1918
+ writeSystem: (system: System, options?: {
1919
+ path?: string;
1920
+ override?: boolean;
1921
+ versionExistingContent?: boolean;
1922
+ format?: "md" | "mdx";
1923
+ }) => Promise<void>;
1924
+ writeSystemToDomain: (system: System, domain: {
1925
+ id: string;
1926
+ version?: string;
1927
+ }, options?: {
1928
+ path?: string;
1929
+ format?: "md" | "mdx";
1930
+ override?: boolean;
1931
+ }) => Promise<void>;
1932
+ getSystem: (id: string, version?: string) => Promise<System>;
1933
+ getSystemByPath: (path: string) => Promise<System>;
1934
+ getSystems: (options?: {
1935
+ latestOnly?: boolean;
1936
+ }) => Promise<System[]>;
1937
+ versionSystem: (id: string) => Promise<void>;
1938
+ rmSystem: (path: string) => Promise<void>;
1939
+ rmSystemById: (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
1940
+ addFileToSystem: (id: string, file: {
1941
+ content: string;
1942
+ fileName: string;
1943
+ }, version?: string) => Promise<void>;
1944
+ addServiceToSystem: (id: string, resource: {
1945
+ id: string;
1946
+ version: string;
1947
+ }, version?: string) => Promise<void>;
1948
+ addFlowToSystem: (id: string, resource: {
1949
+ id: string;
1950
+ version: string;
1951
+ }, version?: string) => Promise<void>;
1952
+ addEntityToSystem: (id: string, resource: {
1953
+ id: string;
1954
+ version: string;
1955
+ }, version?: string) => Promise<void>;
1956
+ addContainerToSystem: (id: string, resource: {
1957
+ id: string;
1958
+ version: string;
1959
+ }, version?: string) => Promise<void>;
1960
+ systemHasVersion: (id: string, version?: string) => Promise<boolean>;
1961
+ isSystem: (path: string) => Promise<boolean>;
1962
+ toSystem: (file: string) => Promise<System>;
1792
1963
  /**
1793
1964
  * ================================
1794
1965
  * Agents
@@ -1969,6 +2140,17 @@ declare const _default: (path: string) => {
1969
2140
  id: string;
1970
2141
  version: string;
1971
2142
  }, version?: string) => Promise<void>;
2143
+ /**
2144
+ * Adds a given system to a domain
2145
+ * @param id - The id of the domain
2146
+ * @param system - The id and version of the system to add
2147
+ * @param version - (Optional) The version of the domain to add the system to
2148
+ * @returns
2149
+ */
2150
+ addSystemToDomain: (id: string, system: {
2151
+ id: string;
2152
+ version: string;
2153
+ }, version?: string) => Promise<void>;
1972
2154
  /**
1973
2155
  * Adds an entity to a domain
1974
2156
  * @param id - The id of the domain
@@ -2241,7 +2423,7 @@ declare const _default: (path: string) => {
2241
2423
  latestOnly?: boolean;
2242
2424
  ignore?: string[];
2243
2425
  attachSchema?: boolean;
2244
- }) => Promise<(Service | CustomDoc | Message)[] | undefined>;
2426
+ }) => Promise<(Service | CustomDoc | Message | Adr)[] | undefined>;
2245
2427
  /**
2246
2428
  * ================================
2247
2429
  * General Message Utils
@@ -2331,6 +2513,22 @@ declare const _default: (path: string) => {
2331
2513
  versionExistingContent?: boolean;
2332
2514
  format?: "md" | "mdx";
2333
2515
  }) => Promise<void>;
2516
+ /**
2517
+ * Adds an entity to a system in EventCatalog
2518
+ *
2519
+ * @param entity - The entity to write to the system
2520
+ * @param system - The system and its id to write the entity to
2521
+ * @param options - Optional options to write the entity
2522
+ *
2523
+ */
2524
+ writeEntityToSystem: (entity: Entity, system: {
2525
+ id: string;
2526
+ version?: string;
2527
+ }, options?: {
2528
+ path?: string;
2529
+ format?: "md" | "mdx";
2530
+ override?: boolean;
2531
+ }) => Promise<void>;
2334
2532
  /**
2335
2533
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
2336
2534
  *
@@ -2410,7 +2608,11 @@ declare const _default: (path: string) => {
2410
2608
  */
2411
2609
  writeFlowToDomain: (flow: Flow, domain: {
2412
2610
  id: string;
2413
- version?: string;
2611
+ version? /**
2612
+ * Returns all events from EventCatalog
2613
+ * @param latestOnly - optional boolean, set to true to get only latest versions
2614
+ * @returns Event[]|Undefined
2615
+ */: string;
2414
2616
  }, options?: {
2415
2617
  path?: string;
2416
2618
  format?: "md" | "mdx";
@@ -2427,6 +2629,27 @@ declare const _default: (path: string) => {
2427
2629
  writeFlowToService: (flow: Flow, service: {
2428
2630
  id: string;
2429
2631
  version?: string;
2632
+ }, options?: {
2633
+ path?: string;
2634
+ format? /**
2635
+ * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
2636
+ *
2637
+ * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
2638
+ *
2639
+ */: "md" | "mdx";
2640
+ override?: boolean;
2641
+ }) => Promise<void>;
2642
+ /**
2643
+ * Adds a flow to a system in EventCatalog
2644
+ *
2645
+ * @param flow - The flow to write to the system
2646
+ * @param system - The system and its id to write the flow to
2647
+ * @param options - Optional options to write the flow
2648
+ *
2649
+ */
2650
+ writeFlowToSystem: (flow: Flow, system: {
2651
+ id: string;
2652
+ version?: string;
2430
2653
  }, options?: {
2431
2654
  path?: string;
2432
2655
  format?: "md" | "mdx";
@@ -2564,6 +2787,20 @@ declare const _default: (path: string) => {
2564
2787
  format?: "md" | "mdx";
2565
2788
  override?: boolean;
2566
2789
  }) => Promise<void>;
2790
+ /**
2791
+ * Writes a data store to a system by its id
2792
+ * @param dataStore - The data store to write
2793
+ * @param system - The system to write the data store to
2794
+ * @returns
2795
+ */
2796
+ writeDataStoreToSystem: (container: Container, system: {
2797
+ id: string;
2798
+ version?: string;
2799
+ }, options?: {
2800
+ path?: string;
2801
+ format?: "md" | "mdx";
2802
+ override?: boolean;
2803
+ }) => Promise<void>;
2567
2804
  /**
2568
2805
  * ================================
2569
2806
  * Data Products
@@ -2726,6 +2963,29 @@ declare const _default: (path: string) => {
2726
2963
  content: string;
2727
2964
  fileName: string;
2728
2965
  }, version?: string) => Promise<void>;
2966
+ /**
2967
+ * ================================
2968
+ * ADRs
2969
+ * ================================
2970
+ */
2971
+ getAdr: (id: string, version?: string) => Promise<Adr>;
2972
+ getAdrs: (options?: {
2973
+ latestOnly?: boolean;
2974
+ }) => Promise<Adr[]>;
2975
+ writeAdr: (adr: Adr, options?: {
2976
+ path?: string;
2977
+ override?: boolean;
2978
+ versionExistingContent?: boolean;
2979
+ format?: "md" | "mdx";
2980
+ }) => Promise<void>;
2981
+ rmAdr: (path: string) => Promise<void>;
2982
+ rmAdrById: (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
2983
+ versionAdr: (id: string) => Promise<void>;
2984
+ adrHasVersion: (id: string, version?: string) => Promise<boolean>;
2985
+ addFileToAdr: (id: string, file: {
2986
+ content: string;
2987
+ fileName: string;
2988
+ }, version?: string) => Promise<void>;
2729
2989
  /**
2730
2990
  * ================================
2731
2991
  * DSL
@@ -2750,4 +3010,4 @@ declare const _default: (path: string) => {
2750
3010
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
2751
3011
  };
2752
3012
 
2753
- 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 SchemaPointer, 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 };
3013
+ export { type Adr, type AdrPointer, type AdrResourcePointer, type AdrStatus, 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 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 UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };