@eventcatalog/sdk 2.7.6 → 2.8.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.
Files changed (60) hide show
  1. package/dist/channels.js +18 -9
  2. package/dist/channels.js.map +1 -1
  3. package/dist/channels.mjs +11 -2
  4. package/dist/channels.mjs.map +1 -1
  5. package/dist/commands.js +14 -5
  6. package/dist/commands.js.map +1 -1
  7. package/dist/commands.mjs +11 -2
  8. package/dist/commands.mjs.map +1 -1
  9. package/dist/containers.d.mts +179 -0
  10. package/dist/containers.d.ts +179 -0
  11. package/dist/containers.js +374 -0
  12. package/dist/containers.js.map +1 -0
  13. package/dist/containers.mjs +331 -0
  14. package/dist/containers.mjs.map +1 -0
  15. package/dist/custom-docs.js +6 -5
  16. package/dist/custom-docs.js.map +1 -1
  17. package/dist/custom-docs.mjs +1 -0
  18. package/dist/custom-docs.mjs.map +1 -1
  19. package/dist/domains.js +17 -8
  20. package/dist/domains.js.map +1 -1
  21. package/dist/domains.mjs +11 -2
  22. package/dist/domains.mjs.map +1 -1
  23. package/dist/entities.js +13 -4
  24. package/dist/entities.js.map +1 -1
  25. package/dist/entities.mjs +11 -2
  26. package/dist/entities.mjs.map +1 -1
  27. package/dist/eventcatalog.js +255 -152
  28. package/dist/eventcatalog.js.map +1 -1
  29. package/dist/eventcatalog.mjs +209 -106
  30. package/dist/eventcatalog.mjs.map +1 -1
  31. package/dist/events.js +14 -5
  32. package/dist/events.js.map +1 -1
  33. package/dist/events.mjs +11 -2
  34. package/dist/events.mjs.map +1 -1
  35. package/dist/index.d.mts +97 -30
  36. package/dist/index.d.ts +97 -30
  37. package/dist/index.js +255 -152
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.mjs +203 -100
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/messages.js +4 -3
  42. package/dist/messages.js.map +1 -1
  43. package/dist/messages.mjs +1 -0
  44. package/dist/messages.mjs.map +1 -1
  45. package/dist/queries.js +14 -5
  46. package/dist/queries.js.map +1 -1
  47. package/dist/queries.mjs +11 -2
  48. package/dist/queries.mjs.map +1 -1
  49. package/dist/services.js +20 -11
  50. package/dist/services.js.map +1 -1
  51. package/dist/services.mjs +11 -2
  52. package/dist/services.mjs.map +1 -1
  53. package/dist/teams.js +9 -8
  54. package/dist/teams.js.map +1 -1
  55. package/dist/teams.mjs +1 -0
  56. package/dist/teams.mjs.map +1 -1
  57. package/dist/types.d.d.mts +24 -1
  58. package/dist/types.d.d.ts +24 -1
  59. package/dist/types.d.js.map +1 -1
  60. package/package.json +1 -1
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
  /**
@@ -151,7 +151,19 @@ declare const _default: (path: string) => {
151
151
  id: string;
152
152
  version?: string;
153
153
  }, options?: {
154
- path?: string;
154
+ path
155
+ /**
156
+ * Check to see if an event version exists
157
+ * @param id - The id of the event
158
+ * @param version - The version of the event (supports semver)
159
+ * @returns
160
+ */
161
+ ? /**
162
+ * Check to see if an event version exists
163
+ * @param id - The id of the event
164
+ * @param version - The version of the event (supports semver)
165
+ * @returns
166
+ */: string;
155
167
  format?: "md" | "mdx";
156
168
  override?: boolean;
157
169
  }) => Promise<void>;
@@ -252,19 +264,7 @@ declare const _default: (path: string) => {
252
264
  version?: string;
253
265
  }, options?: {
254
266
  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";
267
+ format?: "md" | "mdx";
268
268
  override?: boolean;
269
269
  }) => Promise<void>;
270
270
  /**
@@ -456,13 +456,7 @@ declare const _default: (path: string) => {
456
456
  *
457
457
  */
458
458
  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;
459
+ path?: string;
466
460
  override?: boolean;
467
461
  versionExistingContent?: boolean;
468
462
  format?: "md" | "mdx";
@@ -834,13 +828,7 @@ declare const _default: (path: string) => {
834
828
  *
835
829
  */
836
830
  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;
831
+ override?: boolean;
844
832
  }) => Promise<void>;
845
833
  /**
846
834
  * Returns a user from EventCatalog
@@ -1027,6 +1015,85 @@ declare const _default: (path: string) => {
1027
1015
  * @returns
1028
1016
  */
1029
1017
  entityHasVersion: (id: string, version?: string) => Promise<boolean>;
1018
+ /**
1019
+ * ================================
1020
+ * Data Stores
1021
+ * ================================
1022
+ */
1023
+ /**
1024
+ * Adds a data store to EventCatalog
1025
+ * @param dataStore - The data store to write
1026
+ * @param options - Optional options to write the data store
1027
+ *
1028
+ */
1029
+ writeDataStore: (data: Container, options?: {
1030
+ path?: string;
1031
+ override?: boolean;
1032
+ versionExistingContent?: boolean;
1033
+ format?: "md" | "mdx";
1034
+ }) => Promise<void>;
1035
+ /**
1036
+ * Returns a container from EventCatalog
1037
+ * @param id - The id of the container to retrieve
1038
+ * @param version - Optional id of the version to get (supports semver)
1039
+ * @returns Container|Undefined
1040
+ */
1041
+ getDataStore: (id: string, version?: string) => Promise<Container>;
1042
+ /**
1043
+ * Returns all data stores from EventCatalog
1044
+ * @param latestOnly - optional boolean, set to true to get only latest versions
1045
+ * @returns Container[]|Undefined
1046
+ */
1047
+ getDataStores: (options?: {
1048
+ latestOnly?: boolean;
1049
+ }) => Promise<Container[]>;
1050
+ /**
1051
+ * Version a data store by its id
1052
+ * @param id - The id of the data store to version
1053
+ */
1054
+ versionDataStore: (id: string) => Promise<void>;
1055
+ /**
1056
+ * Remove a data store by its path
1057
+ * @param path - The path to the data store to remove
1058
+ */
1059
+ rmDataStore: (path: string) => Promise<void>;
1060
+ /**
1061
+ * Remove a data store by its id
1062
+ * @param id - The id of the data store to remove
1063
+ */
1064
+ rmDataStoreById: (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
1065
+ /**
1066
+ * Check to see if a data store version exists
1067
+ * @param id - The id of the data store
1068
+ * @param version - The version of the data store (supports semver)
1069
+ * @returns
1070
+ */
1071
+ dataStoreHasVersion: (id: string, version?: string) => Promise<boolean>;
1072
+ /**
1073
+ * Adds a file to a data store by its id
1074
+ * @param id - The id of the data store to add the file to
1075
+ * @param file - File contents to add including the content and the file name
1076
+ * @param version - Optional version of the data store to add the file to
1077
+ * @returns
1078
+ */
1079
+ addFileToDataStore: (id: string, file: {
1080
+ content: string;
1081
+ fileName: string;
1082
+ }, version?: string) => Promise<void>;
1083
+ /**
1084
+ * Writes a data store to a service by its id
1085
+ * @param dataStore - The data store to write
1086
+ * @param service - The service to write the data store to
1087
+ * @returns
1088
+ */
1089
+ writeDataStoreToService: (container: Container, service: {
1090
+ id: string;
1091
+ version?: string;
1092
+ }, options?: {
1093
+ path?: string;
1094
+ format?: "md" | "mdx";
1095
+ override?: boolean;
1096
+ }) => Promise<void>;
1030
1097
  };
1031
1098
 
1032
- export { Channel, Command, CustomDoc, Domain, Entity, Event, EventCatalog, Message, Query, Service, Team, UbiquitousLanguageDictionary, User, _default as default };
1099
+ export { Channel, Command, Container, CustomDoc, Domain, Entity, Event, EventCatalog, Message, Query, Service, Team, UbiquitousLanguageDictionary, User, _default as default };