@eventcatalog/sdk 2.8.0 → 2.8.2

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
@@ -1,4 +1,4 @@
1
- import { Event, Command, Query, Channel, Service, Domain, UbiquitousLanguageDictionary, Team, User, CustomDoc, EventCatalog, Message, Entity } from './types.d.mjs';
1
+ import { Event, Command, Query, Channel, Service, Domain, UbiquitousLanguageDictionary, Team, User, CustomDoc, EventCatalog, Message, Entity, Container } from './types.d.mjs';
2
2
  export { Badge, BaseSchema, ChannelPointer, ResourceGroup, ResourcePointer, Specification, Specifications, UbiquitousLanguage } from './types.d.mjs';
3
3
 
4
4
  /**
@@ -135,7 +135,12 @@ declare const _default: (path: string) => {
135
135
  */
136
136
  writeCommand: (command: Command, options?: {
137
137
  path?: string;
138
- override?: boolean;
138
+ override? /**
139
+ * Remove an event by an Event id
140
+ *
141
+ * @param id - The id of the event you want to remove
142
+ *
143
+ */: boolean;
139
144
  versionExistingContent?: boolean;
140
145
  format?: "md" | "mdx";
141
146
  }) => Promise<void>;
@@ -252,19 +257,7 @@ declare const _default: (path: string) => {
252
257
  version?: string;
253
258
  }, options?: {
254
259
  path?: string;
255
- format
256
- /**
257
- * Check to see if an event version exists
258
- * @param id - The id of the event
259
- * @param version - The version of the event (supports semver)
260
- * @returns
261
- */
262
- ? /**
263
- * Check to see if an event version exists
264
- * @param id - The id of the event
265
- * @param version - The version of the event (supports semver)
266
- * @returns
267
- */: "md" | "mdx";
260
+ format?: "md" | "mdx";
268
261
  override?: boolean;
269
262
  }) => Promise<void>;
270
263
  /**
@@ -456,13 +449,7 @@ declare const _default: (path: string) => {
456
449
  *
457
450
  */
458
451
  writeService: (service: Service, options?: {
459
- path? /**
460
- * Adds a schema to the given event
461
- * @param id - The id of the event to add the schema to
462
- * @param schema - Schema contents to add including the content and the file name
463
- * @param version - Optional version of the event to add the schema to
464
- * @returns
465
- */: string;
452
+ path?: string;
466
453
  override?: boolean;
467
454
  versionExistingContent?: boolean;
468
455
  format?: "md" | "mdx";
@@ -682,7 +669,12 @@ declare const _default: (path: string) => {
682
669
  *
683
670
  */
684
671
  writeDomain: (domain: Domain, options?: {
685
- path?: string;
672
+ path? /**
673
+ * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
674
+ *
675
+ * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
676
+ *
677
+ */: string;
686
678
  override?: boolean;
687
679
  versionExistingContent?: boolean;
688
680
  format?: "md" | "mdx";
@@ -834,13 +826,7 @@ declare const _default: (path: string) => {
834
826
  *
835
827
  */
836
828
  writeUser: (user: User, options?: {
837
- override? /**
838
- * Adds an event to EventCatalog
839
- *
840
- * @param event - The event to write
841
- * @param options - Optional options to write the event
842
- *
843
- */: boolean;
829
+ override?: boolean;
844
830
  }) => Promise<void>;
845
831
  /**
846
832
  * Returns a user from EventCatalog
@@ -1027,6 +1013,85 @@ declare const _default: (path: string) => {
1027
1013
  * @returns
1028
1014
  */
1029
1015
  entityHasVersion: (id: string, version?: string) => Promise<boolean>;
1016
+ /**
1017
+ * ================================
1018
+ * Data Stores
1019
+ * ================================
1020
+ */
1021
+ /**
1022
+ * Adds a data store to EventCatalog
1023
+ * @param dataStore - The data store to write
1024
+ * @param options - Optional options to write the data store
1025
+ *
1026
+ */
1027
+ writeDataStore: (data: Container, options?: {
1028
+ path?: string;
1029
+ override?: boolean;
1030
+ versionExistingContent?: boolean;
1031
+ format?: "md" | "mdx";
1032
+ }) => Promise<void>;
1033
+ /**
1034
+ * Returns a data store from EventCatalog
1035
+ * @param id - The id of the data store to retrieve
1036
+ * @param version - Optional id of the version to get (supports semver)
1037
+ * @returns Container|Undefined
1038
+ */
1039
+ getDataStore: (id: string, version?: string) => Promise<Container>;
1040
+ /**
1041
+ * Returns all data stores from EventCatalog
1042
+ * @param latestOnly - optional boolean, set to true to get only latest versions
1043
+ * @returns Container[]|Undefined
1044
+ */
1045
+ getDataStores: (options?: {
1046
+ latestOnly?: boolean;
1047
+ }) => Promise<Container[]>;
1048
+ /**
1049
+ * Version a data store by its id
1050
+ * @param id - The id of the data store to version
1051
+ */
1052
+ versionDataStore: (id: string) => Promise<void>;
1053
+ /**
1054
+ * Remove a data store by its path
1055
+ * @param path - The path to the data store to remove
1056
+ */
1057
+ rmDataStore: (path: string) => Promise<void>;
1058
+ /**
1059
+ * Remove a data store by its id
1060
+ * @param id - The id of the data store to remove
1061
+ */
1062
+ rmDataStoreById: (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
1063
+ /**
1064
+ * Check to see if a data store version exists
1065
+ * @param id - The id of the data store
1066
+ * @param version - The version of the data store (supports semver)
1067
+ * @returns
1068
+ */
1069
+ dataStoreHasVersion: (id: string, version?: string) => Promise<boolean>;
1070
+ /**
1071
+ * Adds a file to a data store by its id
1072
+ * @param id - The id of the data store to add the file to
1073
+ * @param file - File contents to add including the content and the file name
1074
+ * @param version - Optional version of the data store to add the file to
1075
+ * @returns
1076
+ */
1077
+ addFileToDataStore: (id: string, file: {
1078
+ content: string;
1079
+ fileName: string;
1080
+ }, version?: string) => Promise<void>;
1081
+ /**
1082
+ * Writes a data store to a service by its id
1083
+ * @param dataStore - The data store to write
1084
+ * @param service - The service to write the data store to
1085
+ * @returns
1086
+ */
1087
+ writeDataStoreToService: (container: Container, service: {
1088
+ id: string;
1089
+ version?: string;
1090
+ }, options?: {
1091
+ path?: string;
1092
+ format?: "md" | "mdx";
1093
+ override?: boolean;
1094
+ }) => Promise<void>;
1030
1095
  };
1031
1096
 
1032
- export { Channel, Command, CustomDoc, Domain, Entity, Event, EventCatalog, Message, Query, Service, Team, UbiquitousLanguageDictionary, User, _default as default };
1097
+ export { Channel, Command, Container, CustomDoc, Domain, Entity, Event, EventCatalog, Message, Query, Service, Team, UbiquitousLanguageDictionary, User, _default as default };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Event, Command, Query, Channel, Service, Domain, UbiquitousLanguageDictionary, Team, User, CustomDoc, EventCatalog, Message, Entity } from './types.d.js';
1
+ import { Event, Command, Query, Channel, Service, Domain, UbiquitousLanguageDictionary, Team, User, CustomDoc, EventCatalog, Message, Entity, Container } from './types.d.js';
2
2
  export { Badge, BaseSchema, ChannelPointer, ResourceGroup, ResourcePointer, Specification, Specifications, UbiquitousLanguage } from './types.d.js';
3
3
 
4
4
  /**
@@ -135,7 +135,12 @@ declare const _default: (path: string) => {
135
135
  */
136
136
  writeCommand: (command: Command, options?: {
137
137
  path?: string;
138
- override?: boolean;
138
+ override? /**
139
+ * Remove an event by an Event id
140
+ *
141
+ * @param id - The id of the event you want to remove
142
+ *
143
+ */: boolean;
139
144
  versionExistingContent?: boolean;
140
145
  format?: "md" | "mdx";
141
146
  }) => Promise<void>;
@@ -252,19 +257,7 @@ declare const _default: (path: string) => {
252
257
  version?: string;
253
258
  }, options?: {
254
259
  path?: string;
255
- format
256
- /**
257
- * Check to see if an event version exists
258
- * @param id - The id of the event
259
- * @param version - The version of the event (supports semver)
260
- * @returns
261
- */
262
- ? /**
263
- * Check to see if an event version exists
264
- * @param id - The id of the event
265
- * @param version - The version of the event (supports semver)
266
- * @returns
267
- */: "md" | "mdx";
260
+ format?: "md" | "mdx";
268
261
  override?: boolean;
269
262
  }) => Promise<void>;
270
263
  /**
@@ -456,13 +449,7 @@ declare const _default: (path: string) => {
456
449
  *
457
450
  */
458
451
  writeService: (service: Service, options?: {
459
- path? /**
460
- * Adds a schema to the given event
461
- * @param id - The id of the event to add the schema to
462
- * @param schema - Schema contents to add including the content and the file name
463
- * @param version - Optional version of the event to add the schema to
464
- * @returns
465
- */: string;
452
+ path?: string;
466
453
  override?: boolean;
467
454
  versionExistingContent?: boolean;
468
455
  format?: "md" | "mdx";
@@ -682,7 +669,12 @@ declare const _default: (path: string) => {
682
669
  *
683
670
  */
684
671
  writeDomain: (domain: Domain, options?: {
685
- path?: string;
672
+ path? /**
673
+ * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
674
+ *
675
+ * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
676
+ *
677
+ */: string;
686
678
  override?: boolean;
687
679
  versionExistingContent?: boolean;
688
680
  format?: "md" | "mdx";
@@ -834,13 +826,7 @@ declare const _default: (path: string) => {
834
826
  *
835
827
  */
836
828
  writeUser: (user: User, options?: {
837
- override? /**
838
- * Adds an event to EventCatalog
839
- *
840
- * @param event - The event to write
841
- * @param options - Optional options to write the event
842
- *
843
- */: boolean;
829
+ override?: boolean;
844
830
  }) => Promise<void>;
845
831
  /**
846
832
  * Returns a user from EventCatalog
@@ -1027,6 +1013,85 @@ declare const _default: (path: string) => {
1027
1013
  * @returns
1028
1014
  */
1029
1015
  entityHasVersion: (id: string, version?: string) => Promise<boolean>;
1016
+ /**
1017
+ * ================================
1018
+ * Data Stores
1019
+ * ================================
1020
+ */
1021
+ /**
1022
+ * Adds a data store to EventCatalog
1023
+ * @param dataStore - The data store to write
1024
+ * @param options - Optional options to write the data store
1025
+ *
1026
+ */
1027
+ writeDataStore: (data: Container, options?: {
1028
+ path?: string;
1029
+ override?: boolean;
1030
+ versionExistingContent?: boolean;
1031
+ format?: "md" | "mdx";
1032
+ }) => Promise<void>;
1033
+ /**
1034
+ * Returns a data store from EventCatalog
1035
+ * @param id - The id of the data store to retrieve
1036
+ * @param version - Optional id of the version to get (supports semver)
1037
+ * @returns Container|Undefined
1038
+ */
1039
+ getDataStore: (id: string, version?: string) => Promise<Container>;
1040
+ /**
1041
+ * Returns all data stores from EventCatalog
1042
+ * @param latestOnly - optional boolean, set to true to get only latest versions
1043
+ * @returns Container[]|Undefined
1044
+ */
1045
+ getDataStores: (options?: {
1046
+ latestOnly?: boolean;
1047
+ }) => Promise<Container[]>;
1048
+ /**
1049
+ * Version a data store by its id
1050
+ * @param id - The id of the data store to version
1051
+ */
1052
+ versionDataStore: (id: string) => Promise<void>;
1053
+ /**
1054
+ * Remove a data store by its path
1055
+ * @param path - The path to the data store to remove
1056
+ */
1057
+ rmDataStore: (path: string) => Promise<void>;
1058
+ /**
1059
+ * Remove a data store by its id
1060
+ * @param id - The id of the data store to remove
1061
+ */
1062
+ rmDataStoreById: (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
1063
+ /**
1064
+ * Check to see if a data store version exists
1065
+ * @param id - The id of the data store
1066
+ * @param version - The version of the data store (supports semver)
1067
+ * @returns
1068
+ */
1069
+ dataStoreHasVersion: (id: string, version?: string) => Promise<boolean>;
1070
+ /**
1071
+ * Adds a file to a data store by its id
1072
+ * @param id - The id of the data store to add the file to
1073
+ * @param file - File contents to add including the content and the file name
1074
+ * @param version - Optional version of the data store to add the file to
1075
+ * @returns
1076
+ */
1077
+ addFileToDataStore: (id: string, file: {
1078
+ content: string;
1079
+ fileName: string;
1080
+ }, version?: string) => Promise<void>;
1081
+ /**
1082
+ * Writes a data store to a service by its id
1083
+ * @param dataStore - The data store to write
1084
+ * @param service - The service to write the data store to
1085
+ * @returns
1086
+ */
1087
+ writeDataStoreToService: (container: Container, service: {
1088
+ id: string;
1089
+ version?: string;
1090
+ }, options?: {
1091
+ path?: string;
1092
+ format?: "md" | "mdx";
1093
+ override?: boolean;
1094
+ }) => Promise<void>;
1030
1095
  };
1031
1096
 
1032
- export { Channel, Command, CustomDoc, Domain, Entity, Event, EventCatalog, Message, Query, Service, Team, UbiquitousLanguageDictionary, User, _default as default };
1097
+ export { Channel, Command, Container, CustomDoc, Domain, Entity, Event, EventCatalog, Message, Query, Service, Team, UbiquitousLanguageDictionary, User, _default as default };