@eventcatalog/sdk 2.25.0-beta.0 → 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.mts CHANGED
@@ -402,6 +402,54 @@ interface Diagram extends BaseSchema {
402
402
  };
403
403
  }
404
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
+
405
453
  type DataProductOutputPointer = {
406
454
  id: string;
407
455
  version?: string;
@@ -514,6 +562,7 @@ type EventCatalog = {
514
562
  entities?: ExportedResource<Entity>[];
515
563
  containers?: ExportedResource<Container>[];
516
564
  flows?: ExportedResource<Flow>[];
565
+ adrs?: ExportedResource<Adr>[];
517
566
  customDocs?: ExportedResource<CustomDoc>[];
518
567
  };
519
568
  };
@@ -1390,7 +1439,23 @@ declare const _default: (path: string) => {
1390
1439
  id: string;
1391
1440
  version?: string;
1392
1441
  }, options?: {
1393
- 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;
1394
1459
  format?: "md" | "mdx";
1395
1460
  override?: boolean;
1396
1461
  }) => Promise<void>;
@@ -1618,13 +1683,7 @@ declare const _default: (path: string) => {
1618
1683
  */
1619
1684
  writeServiceToDomain: (service: Service, domain: {
1620
1685
  id: string;
1621
- version? /**
1622
- * Adds a file to the given event
1623
- * @param id - The id of the event to add the file to
1624
- * @param file - File contents to add including the content and the file name
1625
- * @param version - Optional version of the event to add the file to
1626
- * @returns
1627
- */: string;
1686
+ version?: string;
1628
1687
  direction?: string;
1629
1688
  }, options?: {
1630
1689
  path?: string;
@@ -2364,7 +2423,7 @@ declare const _default: (path: string) => {
2364
2423
  latestOnly?: boolean;
2365
2424
  ignore?: string[];
2366
2425
  attachSchema?: boolean;
2367
- }) => Promise<(Service | CustomDoc | Message)[] | undefined>;
2426
+ }) => Promise<(Service | CustomDoc | Message | Adr)[] | undefined>;
2368
2427
  /**
2369
2428
  * ================================
2370
2429
  * General Message Utils
@@ -2549,7 +2608,11 @@ declare const _default: (path: string) => {
2549
2608
  */
2550
2609
  writeFlowToDomain: (flow: Flow, domain: {
2551
2610
  id: string;
2552
- 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;
2553
2616
  }, options?: {
2554
2617
  path?: string;
2555
2618
  format?: "md" | "mdx";
@@ -2568,7 +2631,12 @@ declare const _default: (path: string) => {
2568
2631
  version?: string;
2569
2632
  }, options?: {
2570
2633
  path?: string;
2571
- format?: "md" | "mdx";
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";
2572
2640
  override?: boolean;
2573
2641
  }) => Promise<void>;
2574
2642
  /**
@@ -2895,6 +2963,29 @@ declare const _default: (path: string) => {
2895
2963
  content: string;
2896
2964
  fileName: string;
2897
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>;
2898
2989
  /**
2899
2990
  * ================================
2900
2991
  * DSL
@@ -2919,4 +3010,4 @@ declare const _default: (path: string) => {
2919
3010
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
2920
3011
  };
2921
3012
 
2922
- 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 System, type SystemActorRelationship, type SystemRelationshipPointer, type SystemScope, 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 };
package/dist/index.d.ts CHANGED
@@ -402,6 +402,54 @@ interface Diagram extends BaseSchema {
402
402
  };
403
403
  }
404
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
+
405
453
  type DataProductOutputPointer = {
406
454
  id: string;
407
455
  version?: string;
@@ -514,6 +562,7 @@ type EventCatalog = {
514
562
  entities?: ExportedResource<Entity>[];
515
563
  containers?: ExportedResource<Container>[];
516
564
  flows?: ExportedResource<Flow>[];
565
+ adrs?: ExportedResource<Adr>[];
517
566
  customDocs?: ExportedResource<CustomDoc>[];
518
567
  };
519
568
  };
@@ -1390,7 +1439,23 @@ declare const _default: (path: string) => {
1390
1439
  id: string;
1391
1440
  version?: string;
1392
1441
  }, options?: {
1393
- 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;
1394
1459
  format?: "md" | "mdx";
1395
1460
  override?: boolean;
1396
1461
  }) => Promise<void>;
@@ -1618,13 +1683,7 @@ declare const _default: (path: string) => {
1618
1683
  */
1619
1684
  writeServiceToDomain: (service: Service, domain: {
1620
1685
  id: string;
1621
- version? /**
1622
- * Adds a file to the given event
1623
- * @param id - The id of the event to add the file to
1624
- * @param file - File contents to add including the content and the file name
1625
- * @param version - Optional version of the event to add the file to
1626
- * @returns
1627
- */: string;
1686
+ version?: string;
1628
1687
  direction?: string;
1629
1688
  }, options?: {
1630
1689
  path?: string;
@@ -2364,7 +2423,7 @@ declare const _default: (path: string) => {
2364
2423
  latestOnly?: boolean;
2365
2424
  ignore?: string[];
2366
2425
  attachSchema?: boolean;
2367
- }) => Promise<(Service | CustomDoc | Message)[] | undefined>;
2426
+ }) => Promise<(Service | CustomDoc | Message | Adr)[] | undefined>;
2368
2427
  /**
2369
2428
  * ================================
2370
2429
  * General Message Utils
@@ -2549,7 +2608,11 @@ declare const _default: (path: string) => {
2549
2608
  */
2550
2609
  writeFlowToDomain: (flow: Flow, domain: {
2551
2610
  id: string;
2552
- 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;
2553
2616
  }, options?: {
2554
2617
  path?: string;
2555
2618
  format?: "md" | "mdx";
@@ -2568,7 +2631,12 @@ declare const _default: (path: string) => {
2568
2631
  version?: string;
2569
2632
  }, options?: {
2570
2633
  path?: string;
2571
- format?: "md" | "mdx";
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";
2572
2640
  override?: boolean;
2573
2641
  }) => Promise<void>;
2574
2642
  /**
@@ -2895,6 +2963,29 @@ declare const _default: (path: string) => {
2895
2963
  content: string;
2896
2964
  fileName: string;
2897
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>;
2898
2989
  /**
2899
2990
  * ================================
2900
2991
  * DSL
@@ -2919,4 +3010,4 @@ declare const _default: (path: string) => {
2919
3010
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
2920
3011
  };
2921
3012
 
2922
- 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 System, type SystemActorRelationship, type SystemRelationshipPointer, type SystemScope, 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 };