@eventcatalog/sdk 2.11.0 → 2.12.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 (114) hide show
  1. package/README.md +86 -1
  2. package/dist/cli/index.d.mts +1 -0
  3. package/dist/cli/index.d.ts +1 -0
  4. package/dist/{eventcatalog.js → cli/index.js} +588 -378
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/{eventcatalog.mjs → cli/index.mjs} +666 -436
  7. package/dist/cli/index.mjs.map +1 -0
  8. package/dist/cli-docs.d.mts +43 -0
  9. package/dist/cli-docs.d.ts +43 -0
  10. package/dist/cli-docs.js +1614 -0
  11. package/dist/cli-docs.js.map +1 -0
  12. package/dist/cli-docs.mjs +1586 -0
  13. package/dist/cli-docs.mjs.map +1 -0
  14. package/dist/index.d.mts +443 -25
  15. package/dist/index.d.ts +443 -25
  16. package/dist/index.js +204 -121
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +204 -121
  19. package/dist/index.mjs.map +1 -1
  20. package/package.json +13 -4
  21. package/dist/channels.d.mts +0 -214
  22. package/dist/channels.d.ts +0 -214
  23. package/dist/channels.js +0 -432
  24. package/dist/channels.js.map +0 -1
  25. package/dist/channels.mjs +0 -384
  26. package/dist/channels.mjs.map +0 -1
  27. package/dist/commands.d.mts +0 -274
  28. package/dist/commands.d.ts +0 -274
  29. package/dist/commands.js +0 -394
  30. package/dist/commands.js.map +0 -1
  31. package/dist/commands.mjs +0 -350
  32. package/dist/commands.mjs.map +0 -1
  33. package/dist/containers.d.mts +0 -179
  34. package/dist/containers.d.ts +0 -179
  35. package/dist/containers.js +0 -388
  36. package/dist/containers.js.map +0 -1
  37. package/dist/containers.mjs +0 -345
  38. package/dist/containers.mjs.map +0 -1
  39. package/dist/custom-docs.d.mts +0 -89
  40. package/dist/custom-docs.d.ts +0 -89
  41. package/dist/custom-docs.js +0 -164
  42. package/dist/custom-docs.js.map +0 -1
  43. package/dist/custom-docs.mjs +0 -122
  44. package/dist/custom-docs.mjs.map +0 -1
  45. package/dist/data-products.d.mts +0 -225
  46. package/dist/data-products.d.ts +0 -225
  47. package/dist/data-products.js +0 -375
  48. package/dist/data-products.js.map +0 -1
  49. package/dist/data-products.mjs +0 -332
  50. package/dist/data-products.mjs.map +0 -1
  51. package/dist/data-stores.d.mts +0 -179
  52. package/dist/data-stores.d.ts +0 -179
  53. package/dist/data-stores.js +0 -401
  54. package/dist/data-stores.js.map +0 -1
  55. package/dist/data-stores.mjs +0 -356
  56. package/dist/data-stores.mjs.map +0 -1
  57. package/dist/domains.d.mts +0 -347
  58. package/dist/domains.d.ts +0 -347
  59. package/dist/domains.js +0 -547
  60. package/dist/domains.js.map +0 -1
  61. package/dist/domains.mjs +0 -498
  62. package/dist/domains.mjs.map +0 -1
  63. package/dist/entities.d.mts +0 -174
  64. package/dist/entities.d.ts +0 -174
  65. package/dist/entities.js +0 -348
  66. package/dist/entities.js.map +0 -1
  67. package/dist/entities.mjs +0 -307
  68. package/dist/entities.mjs.map +0 -1
  69. package/dist/eventcatalog.d.mts +0 -21
  70. package/dist/eventcatalog.d.ts +0 -21
  71. package/dist/eventcatalog.js.map +0 -1
  72. package/dist/eventcatalog.mjs.map +0 -1
  73. package/dist/events.d.mts +0 -276
  74. package/dist/events.d.ts +0 -276
  75. package/dist/events.js +0 -393
  76. package/dist/events.js.map +0 -1
  77. package/dist/events.mjs +0 -349
  78. package/dist/events.mjs.map +0 -1
  79. package/dist/messages.d.mts +0 -65
  80. package/dist/messages.d.ts +0 -65
  81. package/dist/messages.js +0 -312
  82. package/dist/messages.js.map +0 -1
  83. package/dist/messages.mjs +0 -269
  84. package/dist/messages.mjs.map +0 -1
  85. package/dist/queries.d.mts +0 -276
  86. package/dist/queries.d.ts +0 -276
  87. package/dist/queries.js +0 -394
  88. package/dist/queries.js.map +0 -1
  89. package/dist/queries.mjs +0 -350
  90. package/dist/queries.mjs.map +0 -1
  91. package/dist/services.d.mts +0 -384
  92. package/dist/services.d.ts +0 -384
  93. package/dist/services.js +0 -577
  94. package/dist/services.js.map +0 -1
  95. package/dist/services.mjs +0 -526
  96. package/dist/services.mjs.map +0 -1
  97. package/dist/teams.d.mts +0 -90
  98. package/dist/teams.d.ts +0 -90
  99. package/dist/teams.js +0 -246
  100. package/dist/teams.js.map +0 -1
  101. package/dist/teams.mjs +0 -202
  102. package/dist/teams.mjs.map +0 -1
  103. package/dist/types.d.d.mts +0 -331
  104. package/dist/types.d.d.ts +0 -331
  105. package/dist/types.d.js +0 -19
  106. package/dist/types.d.js.map +0 -1
  107. package/dist/types.d.mjs +0 -1
  108. package/dist/types.d.mjs.map +0 -1
  109. package/dist/users.d.mts +0 -83
  110. package/dist/users.d.ts +0 -83
  111. package/dist/users.js +0 -127
  112. package/dist/users.js.map +0 -1
  113. package/dist/users.mjs +0 -88
  114. package/dist/users.mjs.map +0 -1
@@ -1,274 +0,0 @@
1
- import { Command } from './types.d.mjs';
2
-
3
- /**
4
- * Returns a command from EventCatalog.
5
- *
6
- * You can optionally specify a version to get a specific version of the command
7
- *
8
- * @example
9
- * ```ts
10
- * import utils from '@eventcatalog/utils';
11
- *
12
- * const { getCommand } = utils('/path/to/eventcatalog');
13
- *
14
- * // Gets the latest version of the command
15
- * const command = await getCommand('UpdateInventory');
16
- *
17
- * // Gets a version of the command
18
- * const command = await getCommand('UpdateInventory', '0.0.1');
19
- *
20
- * // Gets the command with the schema attached
21
- * const command = await getCommand('UpdateInventory', '0.0.1', { attachSchema: true });
22
- * ```
23
- */
24
- declare const getCommand: (directory: string) => (id: string, version?: string, options?: {
25
- attachSchema?: boolean;
26
- }) => Promise<Command>;
27
- /**
28
- * Returns all commands from EventCatalog.
29
- *
30
- * You can optionally specify if you want to get the latest version of the events.
31
- *
32
- * @example
33
- * ```ts
34
- * import utils from '@eventcatalog/utils';
35
- *
36
- * const { getCommands } = utils('/path/to/eventcatalog');
37
- *
38
- * // Gets all commands (and versions) from the catalog
39
- * const commands = await getCommands();
40
- *
41
- * // Gets all commands (only latest version) from the catalog
42
- * const commands = await getCommands({ latestOnly: true });
43
- *
44
- * // Gets all commands with the schema attached
45
- * const commands = await getCommands({ attachSchema: true });
46
- * ```
47
- */
48
- declare const getCommands: (directory: string) => (options?: {
49
- latestOnly?: boolean;
50
- attachSchema?: boolean;
51
- }) => Promise<Command[]>;
52
- /**
53
- * Write a command to EventCatalog.
54
- *
55
- * You can optionally override the path of the command.
56
- *
57
- * @example
58
- * ```ts
59
- * import utils from '@eventcatalog/utils';
60
- *
61
- * const { writeCommand } = utils('/path/to/eventcatalog');
62
- *
63
- * // Write a command to the catalog
64
- * // Command would be written to commands/UpdateInventory
65
- * await writeCommand({
66
- * id: 'UpdateInventory',
67
- * name: 'Update Inventory',
68
- * version: '0.0.1',
69
- * summary: 'This is a summary',
70
- * markdown: '# Hello world',
71
- * });
72
- *
73
- * // Write a command to the catalog but override the path
74
- * // Command would be written to commands/Inventory/UpdateInventory
75
- * await writeCommand({
76
- * id: 'UpdateInventory',
77
- * name: 'Update Inventory',
78
- * version: '0.0.1',
79
- * summary: 'This is a summary',
80
- * markdown: '# Hello world',
81
- * }, { path: "/Inventory/UpdateInventory"});
82
- *
83
- * // Write a command to the catalog and override the existing content (if there is any)
84
- * await writeCommand({
85
- * id: 'UpdateInventory',
86
- * name: 'Update Inventory',
87
- * version: '0.0.1',
88
- * summary: 'This is a summary',
89
- * markdown: '# Hello world',
90
- * }, { override: true });
91
- *
92
- * // Write a command to the catalog and version the previous version
93
- * // only works if the new version is greater than the previous version
94
- * await writeCommand({
95
- * id: 'UpdateInventory',
96
- * name: 'Update Inventory',
97
- * version: '0.0.1',
98
- * summary: 'This is a summary',
99
- * markdown: '# Hello world',
100
- * }, { versionExistingContent: true });
101
- *
102
- * ```
103
- */
104
- declare const writeCommand: (directory: string) => (command: Command, options?: {
105
- path?: string;
106
- override?: boolean;
107
- versionExistingContent?: boolean;
108
- format?: "md" | "mdx";
109
- }) => Promise<void>;
110
- /**
111
- * Write an command to a service in EventCatalog.
112
- *
113
- * @example
114
- * ```ts
115
- * import utils from '@eventcatalog/utils';
116
- *
117
- * const { writeCommandToService } = utils('/path/to/eventcatalog');
118
- *
119
- * // Write an event to a given service in the catalog
120
- * // Event would be written to services/Inventory/commands/UpdateInventory
121
- * await writeCommandToService({
122
- * id: 'UpdateInventory',
123
- * name: 'Update Inventory',
124
- * version: '0.0.1',
125
- * summary: 'This is a summary',
126
- * markdown: '# Hello world',
127
- * }, { id: 'Inventory' });
128
- * ```
129
- */
130
- declare const writeCommandToService: (directory: string) => (command: Command, service: {
131
- id: string;
132
- version?: string;
133
- }, options?: {
134
- path?: string;
135
- format?: "md" | "mdx";
136
- override?: boolean;
137
- }) => Promise<void>;
138
- /**
139
- * Delete a command at it's given path.
140
- *
141
- * @example
142
- * ```ts
143
- * import utils from '@eventcatalog/utils';
144
- *
145
- * const { rmCommand } = utils('/path/to/eventcatalog');
146
- *
147
- * // removes a command at the given path (commands dir is appended to the given path)
148
- * // Removes the command at commands/UpdateInventory
149
- * await rmCommand('/UpdateInventory');
150
- * ```
151
- */
152
- declare const rmCommand: (directory: string) => (path: string) => Promise<void>;
153
- /**
154
- * Delete a command by it's id.
155
- *
156
- * Optionally specify a version to delete a specific version of the command.
157
- *
158
- * @example
159
- * ```ts
160
- * import utils from '@eventcatalog/utils';
161
- *
162
- * const { rmCommandById } = utils('/path/to/eventcatalog');
163
- *
164
- * // deletes the latest UpdateInventory command
165
- * await rmCommandById('UpdateInventory');
166
- *
167
- * // deletes a specific version of the UpdateInventory command
168
- * await rmCommandById('UpdateInventory', '0.0.1');
169
- * ```
170
- */
171
- declare const rmCommandById: (directory: string) => (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
172
- /**
173
- * Version a command by it's id.
174
- *
175
- * Takes the latest command and moves it to a versioned directory.
176
- * All files with this command are also versioned (e.g /commands/UpdateInventory/schema.json)
177
- *
178
- * @example
179
- * ```ts
180
- * import utils from '@eventcatalog/utils';
181
- *
182
- * const { versionCommand } = utils('/path/to/eventcatalog');
183
- *
184
- * // moves the latest UpdateInventory command to a versioned directory
185
- * // the version within that command is used as the version number.
186
- * await versionCommand('UpdateInventory');
187
- *
188
- * ```
189
- */
190
- declare const versionCommand: (directory: string) => (id: string) => Promise<void>;
191
- /**
192
- * Add a file to a command by it's id.
193
- *
194
- * Optionally specify a version to add a file to a specific version of the command.
195
- *
196
- * @example
197
- * ```ts
198
- * import utils from '@eventcatalog/utils';
199
- *
200
- * const { addFileToCommand } = utils('/path/to/eventcatalog');
201
- *
202
- * // adds a file to the latest UpdateInventory command
203
- * await addFileToCommand('UpdateInventory', { content: 'Hello world', fileName: 'hello.txt' });
204
- *
205
- * // adds a file to a specific version of the UpdateInventory command
206
- * await addFileToCommand('UpdateInventory', { content: 'Hello world', fileName: 'hello.txt' }, '0.0.1');
207
- *
208
- * ```
209
- */
210
- declare const addFileToCommand: (directory: string) => (id: string, file: {
211
- content: string;
212
- fileName: string;
213
- }, version?: string, options?: {
214
- path?: string;
215
- }) => Promise<void>;
216
- /**
217
- * Add a schema to a command by it's id.
218
- *
219
- * Optionally specify a version to add a schema to a specific version of the command.
220
- *
221
- * @example
222
- * ```ts
223
- * import utils from '@eventcatalog/utils';
224
- *
225
- * const { addSchemaToCommand } = utils('/path/to/eventcatalog');
226
- *
227
- * // JSON schema example
228
- * const schema = {
229
- * "$schema": "http://json-schema.org/draft-07/schema#",
230
- * "type": "object",
231
- * "properties": {
232
- * "name": {
233
- * "type": "string"
234
- * },
235
- * "age": {
236
- * "type": "number"
237
- * }
238
- * },
239
- * "required": ["name", "age"]
240
- * };
241
- *
242
- * // adds a schema to the latest UpdateInventory command
243
- * await addSchemaToCommand('UpdateInventory', { schema, fileName: 'schema.json' });
244
- *
245
- * // adds a file to a specific version of the UpdateInventory command
246
- * await addSchemaToCommand('UpdateInventory', { schema, fileName: 'schema.json' }, '0.0.1');
247
- *
248
- * ```
249
- */
250
- declare const addSchemaToCommand: (directory: string) => (id: string, schema: {
251
- schema: string;
252
- fileName: string;
253
- }, version?: string, options?: {
254
- path?: string;
255
- }) => Promise<void>;
256
- /**
257
- * Check to see if the catalog has a version for the given command.
258
- *
259
- * @example
260
- * ```ts
261
- * import utils from '@eventcatalog/utils';
262
- *
263
- * const { commandHasVersion } = utils('/path/to/eventcatalog');
264
- *
265
- * // returns true if version is found for the given event and version (supports semver)
266
- * await commandHasVersion('InventoryAdjusted', '0.0.1');
267
- * await commandHasVersion('InventoryAdjusted', 'latest');
268
- * await commandHasVersion('InventoryAdjusted', '0.0.x');*
269
- *
270
- * ```
271
- */
272
- declare const commandHasVersion: (directory: string) => (id: string, version?: string) => Promise<boolean>;
273
-
274
- export { addFileToCommand, addSchemaToCommand, commandHasVersion, getCommand, getCommands, rmCommand, rmCommandById, versionCommand, writeCommand, writeCommandToService };
@@ -1,274 +0,0 @@
1
- import { Command } from './types.d.js';
2
-
3
- /**
4
- * Returns a command from EventCatalog.
5
- *
6
- * You can optionally specify a version to get a specific version of the command
7
- *
8
- * @example
9
- * ```ts
10
- * import utils from '@eventcatalog/utils';
11
- *
12
- * const { getCommand } = utils('/path/to/eventcatalog');
13
- *
14
- * // Gets the latest version of the command
15
- * const command = await getCommand('UpdateInventory');
16
- *
17
- * // Gets a version of the command
18
- * const command = await getCommand('UpdateInventory', '0.0.1');
19
- *
20
- * // Gets the command with the schema attached
21
- * const command = await getCommand('UpdateInventory', '0.0.1', { attachSchema: true });
22
- * ```
23
- */
24
- declare const getCommand: (directory: string) => (id: string, version?: string, options?: {
25
- attachSchema?: boolean;
26
- }) => Promise<Command>;
27
- /**
28
- * Returns all commands from EventCatalog.
29
- *
30
- * You can optionally specify if you want to get the latest version of the events.
31
- *
32
- * @example
33
- * ```ts
34
- * import utils from '@eventcatalog/utils';
35
- *
36
- * const { getCommands } = utils('/path/to/eventcatalog');
37
- *
38
- * // Gets all commands (and versions) from the catalog
39
- * const commands = await getCommands();
40
- *
41
- * // Gets all commands (only latest version) from the catalog
42
- * const commands = await getCommands({ latestOnly: true });
43
- *
44
- * // Gets all commands with the schema attached
45
- * const commands = await getCommands({ attachSchema: true });
46
- * ```
47
- */
48
- declare const getCommands: (directory: string) => (options?: {
49
- latestOnly?: boolean;
50
- attachSchema?: boolean;
51
- }) => Promise<Command[]>;
52
- /**
53
- * Write a command to EventCatalog.
54
- *
55
- * You can optionally override the path of the command.
56
- *
57
- * @example
58
- * ```ts
59
- * import utils from '@eventcatalog/utils';
60
- *
61
- * const { writeCommand } = utils('/path/to/eventcatalog');
62
- *
63
- * // Write a command to the catalog
64
- * // Command would be written to commands/UpdateInventory
65
- * await writeCommand({
66
- * id: 'UpdateInventory',
67
- * name: 'Update Inventory',
68
- * version: '0.0.1',
69
- * summary: 'This is a summary',
70
- * markdown: '# Hello world',
71
- * });
72
- *
73
- * // Write a command to the catalog but override the path
74
- * // Command would be written to commands/Inventory/UpdateInventory
75
- * await writeCommand({
76
- * id: 'UpdateInventory',
77
- * name: 'Update Inventory',
78
- * version: '0.0.1',
79
- * summary: 'This is a summary',
80
- * markdown: '# Hello world',
81
- * }, { path: "/Inventory/UpdateInventory"});
82
- *
83
- * // Write a command to the catalog and override the existing content (if there is any)
84
- * await writeCommand({
85
- * id: 'UpdateInventory',
86
- * name: 'Update Inventory',
87
- * version: '0.0.1',
88
- * summary: 'This is a summary',
89
- * markdown: '# Hello world',
90
- * }, { override: true });
91
- *
92
- * // Write a command to the catalog and version the previous version
93
- * // only works if the new version is greater than the previous version
94
- * await writeCommand({
95
- * id: 'UpdateInventory',
96
- * name: 'Update Inventory',
97
- * version: '0.0.1',
98
- * summary: 'This is a summary',
99
- * markdown: '# Hello world',
100
- * }, { versionExistingContent: true });
101
- *
102
- * ```
103
- */
104
- declare const writeCommand: (directory: string) => (command: Command, options?: {
105
- path?: string;
106
- override?: boolean;
107
- versionExistingContent?: boolean;
108
- format?: "md" | "mdx";
109
- }) => Promise<void>;
110
- /**
111
- * Write an command to a service in EventCatalog.
112
- *
113
- * @example
114
- * ```ts
115
- * import utils from '@eventcatalog/utils';
116
- *
117
- * const { writeCommandToService } = utils('/path/to/eventcatalog');
118
- *
119
- * // Write an event to a given service in the catalog
120
- * // Event would be written to services/Inventory/commands/UpdateInventory
121
- * await writeCommandToService({
122
- * id: 'UpdateInventory',
123
- * name: 'Update Inventory',
124
- * version: '0.0.1',
125
- * summary: 'This is a summary',
126
- * markdown: '# Hello world',
127
- * }, { id: 'Inventory' });
128
- * ```
129
- */
130
- declare const writeCommandToService: (directory: string) => (command: Command, service: {
131
- id: string;
132
- version?: string;
133
- }, options?: {
134
- path?: string;
135
- format?: "md" | "mdx";
136
- override?: boolean;
137
- }) => Promise<void>;
138
- /**
139
- * Delete a command at it's given path.
140
- *
141
- * @example
142
- * ```ts
143
- * import utils from '@eventcatalog/utils';
144
- *
145
- * const { rmCommand } = utils('/path/to/eventcatalog');
146
- *
147
- * // removes a command at the given path (commands dir is appended to the given path)
148
- * // Removes the command at commands/UpdateInventory
149
- * await rmCommand('/UpdateInventory');
150
- * ```
151
- */
152
- declare const rmCommand: (directory: string) => (path: string) => Promise<void>;
153
- /**
154
- * Delete a command by it's id.
155
- *
156
- * Optionally specify a version to delete a specific version of the command.
157
- *
158
- * @example
159
- * ```ts
160
- * import utils from '@eventcatalog/utils';
161
- *
162
- * const { rmCommandById } = utils('/path/to/eventcatalog');
163
- *
164
- * // deletes the latest UpdateInventory command
165
- * await rmCommandById('UpdateInventory');
166
- *
167
- * // deletes a specific version of the UpdateInventory command
168
- * await rmCommandById('UpdateInventory', '0.0.1');
169
- * ```
170
- */
171
- declare const rmCommandById: (directory: string) => (id: string, version?: string, persistFiles?: boolean) => Promise<void>;
172
- /**
173
- * Version a command by it's id.
174
- *
175
- * Takes the latest command and moves it to a versioned directory.
176
- * All files with this command are also versioned (e.g /commands/UpdateInventory/schema.json)
177
- *
178
- * @example
179
- * ```ts
180
- * import utils from '@eventcatalog/utils';
181
- *
182
- * const { versionCommand } = utils('/path/to/eventcatalog');
183
- *
184
- * // moves the latest UpdateInventory command to a versioned directory
185
- * // the version within that command is used as the version number.
186
- * await versionCommand('UpdateInventory');
187
- *
188
- * ```
189
- */
190
- declare const versionCommand: (directory: string) => (id: string) => Promise<void>;
191
- /**
192
- * Add a file to a command by it's id.
193
- *
194
- * Optionally specify a version to add a file to a specific version of the command.
195
- *
196
- * @example
197
- * ```ts
198
- * import utils from '@eventcatalog/utils';
199
- *
200
- * const { addFileToCommand } = utils('/path/to/eventcatalog');
201
- *
202
- * // adds a file to the latest UpdateInventory command
203
- * await addFileToCommand('UpdateInventory', { content: 'Hello world', fileName: 'hello.txt' });
204
- *
205
- * // adds a file to a specific version of the UpdateInventory command
206
- * await addFileToCommand('UpdateInventory', { content: 'Hello world', fileName: 'hello.txt' }, '0.0.1');
207
- *
208
- * ```
209
- */
210
- declare const addFileToCommand: (directory: string) => (id: string, file: {
211
- content: string;
212
- fileName: string;
213
- }, version?: string, options?: {
214
- path?: string;
215
- }) => Promise<void>;
216
- /**
217
- * Add a schema to a command by it's id.
218
- *
219
- * Optionally specify a version to add a schema to a specific version of the command.
220
- *
221
- * @example
222
- * ```ts
223
- * import utils from '@eventcatalog/utils';
224
- *
225
- * const { addSchemaToCommand } = utils('/path/to/eventcatalog');
226
- *
227
- * // JSON schema example
228
- * const schema = {
229
- * "$schema": "http://json-schema.org/draft-07/schema#",
230
- * "type": "object",
231
- * "properties": {
232
- * "name": {
233
- * "type": "string"
234
- * },
235
- * "age": {
236
- * "type": "number"
237
- * }
238
- * },
239
- * "required": ["name", "age"]
240
- * };
241
- *
242
- * // adds a schema to the latest UpdateInventory command
243
- * await addSchemaToCommand('UpdateInventory', { schema, fileName: 'schema.json' });
244
- *
245
- * // adds a file to a specific version of the UpdateInventory command
246
- * await addSchemaToCommand('UpdateInventory', { schema, fileName: 'schema.json' }, '0.0.1');
247
- *
248
- * ```
249
- */
250
- declare const addSchemaToCommand: (directory: string) => (id: string, schema: {
251
- schema: string;
252
- fileName: string;
253
- }, version?: string, options?: {
254
- path?: string;
255
- }) => Promise<void>;
256
- /**
257
- * Check to see if the catalog has a version for the given command.
258
- *
259
- * @example
260
- * ```ts
261
- * import utils from '@eventcatalog/utils';
262
- *
263
- * const { commandHasVersion } = utils('/path/to/eventcatalog');
264
- *
265
- * // returns true if version is found for the given event and version (supports semver)
266
- * await commandHasVersion('InventoryAdjusted', '0.0.1');
267
- * await commandHasVersion('InventoryAdjusted', 'latest');
268
- * await commandHasVersion('InventoryAdjusted', '0.0.x');*
269
- *
270
- * ```
271
- */
272
- declare const commandHasVersion: (directory: string) => (id: string, version?: string) => Promise<boolean>;
273
-
274
- export { addFileToCommand, addSchemaToCommand, commandHasVersion, getCommand, getCommands, rmCommand, rmCommandById, versionCommand, writeCommand, writeCommandToService };