@eventcatalog/sdk 2.15.0 → 2.16.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 CHANGED
@@ -75,6 +75,12 @@ interface ChannelPointer extends ResourcePointer {
75
75
  parameters?: Record<string, string>;
76
76
  }
77
77
 
78
+ type Operation = {
79
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
80
+ path?: string;
81
+ statusCodes?: string[];
82
+ };
83
+
78
84
  type Message = Event | Command | Query;
79
85
 
80
86
  interface CustomDoc {
@@ -101,14 +107,17 @@ interface MessageDetailsPanelProperty {
101
107
 
102
108
  interface Event extends BaseSchema {
103
109
  channels?: ChannelPointer[];
110
+ operation?: Operation;
104
111
  detailsPanel?: MessageDetailsPanelProperty;
105
112
  }
106
113
  interface Command extends BaseSchema {
107
114
  channels?: ChannelPointer[];
115
+ operation?: Operation;
108
116
  detailsPanel?: MessageDetailsPanelProperty;
109
117
  }
110
118
  interface Query extends BaseSchema {
111
119
  channels?: ChannelPointer[];
120
+ operation?: Operation;
112
121
  detailsPanel?: MessageDetailsPanelProperty;
113
122
  }
114
123
  interface Channel extends BaseSchema {
@@ -226,6 +235,12 @@ interface Badge {
226
235
  icon?: string;
227
236
  }
228
237
 
238
+ interface Changelog {
239
+ createdAt: Date | string;
240
+ badges?: Badge[];
241
+ markdown: string;
242
+ }
243
+
229
244
  interface UbiquitousLanguage {
230
245
  id: string;
231
246
  name: string;
@@ -737,18 +752,7 @@ declare const _default: (path: string) => {
737
752
  addEventToChannel: (id: string, _message: {
738
753
  id: string;
739
754
  version: string;
740
- parameters
741
- /**
742
- * Returns a query from EventCatalog
743
- * @param id - The id of the query to retrieve
744
- * @param version - Optional id of the version to get (supports semver)
745
- * @returns Query|Undefined
746
- */
747
- ? /**
748
- * ================================
749
- * Queries
750
- * ================================
751
- */: {
755
+ parameters?: {
752
756
  [key: string]: string;
753
757
  };
754
758
  }, version?: string) => Promise<void>;
@@ -771,18 +775,7 @@ declare const _default: (path: string) => {
771
775
  addCommandToChannel: (id: string, _message: {
772
776
  id: string;
773
777
  version: string;
774
- parameters
775
- /**
776
- * Returns a query from EventCatalog
777
- * @param id - The id of the query to retrieve
778
- * @param version - Optional id of the version to get (supports semver)
779
- * @returns Query|Undefined
780
- */
781
- ? /**
782
- * ================================
783
- * Queries
784
- * ================================
785
- */: {
778
+ parameters?: {
786
779
  [key: string]: string;
787
780
  };
788
781
  }, version?: string) => Promise<void>;
@@ -805,18 +798,7 @@ declare const _default: (path: string) => {
805
798
  addQueryToChannel: (id: string, _message: {
806
799
  id: string;
807
800
  version: string;
808
- parameters
809
- /**
810
- * Returns a query from EventCatalog
811
- * @param id - The id of the query to retrieve
812
- * @param version - Optional id of the version to get (supports semver)
813
- * @returns Query|Undefined
814
- */
815
- ? /**
816
- * ================================
817
- * Queries
818
- * ================================
819
- */: {
801
+ parameters?: {
820
802
  [key: string]: string;
821
803
  };
822
804
  }, version?: string) => Promise<void>;
@@ -835,15 +817,7 @@ declare const _default: (path: string) => {
835
817
  writeService: (service: Service, options?: {
836
818
  path?: string;
837
819
  override?: boolean;
838
- versionExistingContent
839
- /**
840
- * Moves a given event id to the version directory
841
- * @param directory
842
- */
843
- ? /**
844
- * Moves a given event id to the version directory
845
- * @param directory
846
- */: boolean;
820
+ versionExistingContent?: boolean;
847
821
  format?: "md" | "mdx";
848
822
  }) => Promise<void>;
849
823
  /**
@@ -1366,6 +1340,56 @@ declare const _default: (path: string) => {
1366
1340
  * @returns A JSON object with the configuration for the event catalog.
1367
1341
  */
1368
1342
  getEventCatalogConfigurationFile: () => Promise<any>;
1343
+ /**
1344
+ * ================================
1345
+ * Changelogs
1346
+ * ================================
1347
+ */
1348
+ /**
1349
+ * Writes a changelog entry to a resource in EventCatalog
1350
+ *
1351
+ * @param id - The id of the resource to write the changelog to
1352
+ * @param changelog - The changelog entry to write
1353
+ * @param options - Optional options (version, format)
1354
+ *
1355
+ */
1356
+ writeChangelog: (id: string, changelog: Changelog, options?: {
1357
+ version?: string;
1358
+ format?: "md" | "mdx";
1359
+ }) => Promise<void>;
1360
+ /**
1361
+ * Appends a changelog entry to an existing changelog for a resource.
1362
+ * If no changelog exists, one is created.
1363
+ *
1364
+ * @param id - The id of the resource to append the changelog to
1365
+ * @param changelog - The changelog entry to append
1366
+ * @param options - Optional options (version, format)
1367
+ *
1368
+ */
1369
+ appendChangelog: (id: string, changelog: Changelog, options?: {
1370
+ version?: string;
1371
+ format?: "md" | "mdx";
1372
+ }) => Promise<void>;
1373
+ /**
1374
+ * Returns the changelog for a resource in EventCatalog
1375
+ *
1376
+ * @param id - The id of the resource to get the changelog for
1377
+ * @param options - Optional options (version)
1378
+ * @returns Changelog|Undefined
1379
+ */
1380
+ getChangelog: (id: string, options?: {
1381
+ version?: string;
1382
+ }) => Promise<Changelog | undefined>;
1383
+ /**
1384
+ * Removes the changelog for a resource in EventCatalog
1385
+ *
1386
+ * @param id - The id of the resource to remove the changelog from
1387
+ * @param options - Optional options (version)
1388
+ *
1389
+ */
1390
+ rmChangelog: (id: string, options?: {
1391
+ version?: string;
1392
+ }) => Promise<void>;
1369
1393
  /**
1370
1394
  * ================================
1371
1395
  * Resources Utils
@@ -1749,4 +1773,4 @@ declare const _default: (path: string) => {
1749
1773
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
1750
1774
  };
1751
1775
 
1752
- export { type Badge, type BaseSchema, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type Domain, type Entity, type Event, type EventCatalog, type Message, type Query, type ReceivesPointer, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
1776
+ export { type Badge, type BaseSchema, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type Domain, type Entity, type Event, type EventCatalog, type Message, type Operation, type Query, type ReceivesPointer, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
package/dist/index.d.ts CHANGED
@@ -75,6 +75,12 @@ interface ChannelPointer extends ResourcePointer {
75
75
  parameters?: Record<string, string>;
76
76
  }
77
77
 
78
+ type Operation = {
79
+ method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
80
+ path?: string;
81
+ statusCodes?: string[];
82
+ };
83
+
78
84
  type Message = Event | Command | Query;
79
85
 
80
86
  interface CustomDoc {
@@ -101,14 +107,17 @@ interface MessageDetailsPanelProperty {
101
107
 
102
108
  interface Event extends BaseSchema {
103
109
  channels?: ChannelPointer[];
110
+ operation?: Operation;
104
111
  detailsPanel?: MessageDetailsPanelProperty;
105
112
  }
106
113
  interface Command extends BaseSchema {
107
114
  channels?: ChannelPointer[];
115
+ operation?: Operation;
108
116
  detailsPanel?: MessageDetailsPanelProperty;
109
117
  }
110
118
  interface Query extends BaseSchema {
111
119
  channels?: ChannelPointer[];
120
+ operation?: Operation;
112
121
  detailsPanel?: MessageDetailsPanelProperty;
113
122
  }
114
123
  interface Channel extends BaseSchema {
@@ -226,6 +235,12 @@ interface Badge {
226
235
  icon?: string;
227
236
  }
228
237
 
238
+ interface Changelog {
239
+ createdAt: Date | string;
240
+ badges?: Badge[];
241
+ markdown: string;
242
+ }
243
+
229
244
  interface UbiquitousLanguage {
230
245
  id: string;
231
246
  name: string;
@@ -737,18 +752,7 @@ declare const _default: (path: string) => {
737
752
  addEventToChannel: (id: string, _message: {
738
753
  id: string;
739
754
  version: string;
740
- parameters
741
- /**
742
- * Returns a query from EventCatalog
743
- * @param id - The id of the query to retrieve
744
- * @param version - Optional id of the version to get (supports semver)
745
- * @returns Query|Undefined
746
- */
747
- ? /**
748
- * ================================
749
- * Queries
750
- * ================================
751
- */: {
755
+ parameters?: {
752
756
  [key: string]: string;
753
757
  };
754
758
  }, version?: string) => Promise<void>;
@@ -771,18 +775,7 @@ declare const _default: (path: string) => {
771
775
  addCommandToChannel: (id: string, _message: {
772
776
  id: string;
773
777
  version: string;
774
- parameters
775
- /**
776
- * Returns a query from EventCatalog
777
- * @param id - The id of the query to retrieve
778
- * @param version - Optional id of the version to get (supports semver)
779
- * @returns Query|Undefined
780
- */
781
- ? /**
782
- * ================================
783
- * Queries
784
- * ================================
785
- */: {
778
+ parameters?: {
786
779
  [key: string]: string;
787
780
  };
788
781
  }, version?: string) => Promise<void>;
@@ -805,18 +798,7 @@ declare const _default: (path: string) => {
805
798
  addQueryToChannel: (id: string, _message: {
806
799
  id: string;
807
800
  version: string;
808
- parameters
809
- /**
810
- * Returns a query from EventCatalog
811
- * @param id - The id of the query to retrieve
812
- * @param version - Optional id of the version to get (supports semver)
813
- * @returns Query|Undefined
814
- */
815
- ? /**
816
- * ================================
817
- * Queries
818
- * ================================
819
- */: {
801
+ parameters?: {
820
802
  [key: string]: string;
821
803
  };
822
804
  }, version?: string) => Promise<void>;
@@ -835,15 +817,7 @@ declare const _default: (path: string) => {
835
817
  writeService: (service: Service, options?: {
836
818
  path?: string;
837
819
  override?: boolean;
838
- versionExistingContent
839
- /**
840
- * Moves a given event id to the version directory
841
- * @param directory
842
- */
843
- ? /**
844
- * Moves a given event id to the version directory
845
- * @param directory
846
- */: boolean;
820
+ versionExistingContent?: boolean;
847
821
  format?: "md" | "mdx";
848
822
  }) => Promise<void>;
849
823
  /**
@@ -1366,6 +1340,56 @@ declare const _default: (path: string) => {
1366
1340
  * @returns A JSON object with the configuration for the event catalog.
1367
1341
  */
1368
1342
  getEventCatalogConfigurationFile: () => Promise<any>;
1343
+ /**
1344
+ * ================================
1345
+ * Changelogs
1346
+ * ================================
1347
+ */
1348
+ /**
1349
+ * Writes a changelog entry to a resource in EventCatalog
1350
+ *
1351
+ * @param id - The id of the resource to write the changelog to
1352
+ * @param changelog - The changelog entry to write
1353
+ * @param options - Optional options (version, format)
1354
+ *
1355
+ */
1356
+ writeChangelog: (id: string, changelog: Changelog, options?: {
1357
+ version?: string;
1358
+ format?: "md" | "mdx";
1359
+ }) => Promise<void>;
1360
+ /**
1361
+ * Appends a changelog entry to an existing changelog for a resource.
1362
+ * If no changelog exists, one is created.
1363
+ *
1364
+ * @param id - The id of the resource to append the changelog to
1365
+ * @param changelog - The changelog entry to append
1366
+ * @param options - Optional options (version, format)
1367
+ *
1368
+ */
1369
+ appendChangelog: (id: string, changelog: Changelog, options?: {
1370
+ version?: string;
1371
+ format?: "md" | "mdx";
1372
+ }) => Promise<void>;
1373
+ /**
1374
+ * Returns the changelog for a resource in EventCatalog
1375
+ *
1376
+ * @param id - The id of the resource to get the changelog for
1377
+ * @param options - Optional options (version)
1378
+ * @returns Changelog|Undefined
1379
+ */
1380
+ getChangelog: (id: string, options?: {
1381
+ version?: string;
1382
+ }) => Promise<Changelog | undefined>;
1383
+ /**
1384
+ * Removes the changelog for a resource in EventCatalog
1385
+ *
1386
+ * @param id - The id of the resource to remove the changelog from
1387
+ * @param options - Optional options (version)
1388
+ *
1389
+ */
1390
+ rmChangelog: (id: string, options?: {
1391
+ version?: string;
1392
+ }) => Promise<void>;
1369
1393
  /**
1370
1394
  * ================================
1371
1395
  * Resources Utils
@@ -1749,4 +1773,4 @@ declare const _default: (path: string) => {
1749
1773
  toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
1750
1774
  };
1751
1775
 
1752
- export { type Badge, type BaseSchema, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type Domain, type Entity, type Event, type EventCatalog, type Message, type Query, type ReceivesPointer, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
1776
+ export { type Badge, type BaseSchema, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type Domain, type Entity, type Event, type EventCatalog, type Message, type Operation, type Query, type ReceivesPointer, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };