@eventcatalog/sdk 2.9.6 → 2.9.8
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/channels.js +1 -1
- package/dist/channels.js.map +1 -1
- package/dist/channels.mjs +15 -14
- package/dist/channels.mjs.map +1 -1
- package/dist/commands.d.mts +6 -2
- package/dist/commands.d.ts +6 -2
- package/dist/commands.js +17 -6
- package/dist/commands.js.map +1 -1
- package/dist/commands.mjs +29 -17
- package/dist/commands.mjs.map +1 -1
- package/dist/containers.js +14 -3
- package/dist/containers.js.map +1 -1
- package/dist/containers.mjs +26 -14
- package/dist/containers.mjs.map +1 -1
- package/dist/custom-docs.js.map +1 -1
- package/dist/custom-docs.mjs.map +1 -1
- package/dist/data-stores.js +14 -3
- package/dist/data-stores.js.map +1 -1
- package/dist/data-stores.mjs +26 -14
- package/dist/data-stores.mjs.map +1 -1
- package/dist/domains.js +14 -3
- package/dist/domains.js.map +1 -1
- package/dist/domains.mjs +33 -21
- package/dist/domains.mjs.map +1 -1
- package/dist/entities.js +1 -1
- package/dist/entities.js.map +1 -1
- package/dist/entities.mjs +13 -12
- package/dist/entities.mjs.map +1 -1
- package/dist/eventcatalog.js +23 -12
- package/dist/eventcatalog.js.map +1 -1
- package/dist/eventcatalog.mjs +23 -12
- package/dist/eventcatalog.mjs.map +1 -1
- package/dist/events.d.mts +6 -2
- package/dist/events.d.ts +6 -2
- package/dist/events.js +17 -6
- package/dist/events.js.map +1 -1
- package/dist/events.mjs +29 -17
- package/dist/events.mjs.map +1 -1
- package/dist/index.d.mts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +23 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -12
- package/dist/index.mjs.map +1 -1
- package/dist/messages.js.map +1 -1
- package/dist/messages.mjs.map +1 -1
- package/dist/queries.d.mts +6 -2
- package/dist/queries.d.ts +6 -2
- package/dist/queries.js +17 -6
- package/dist/queries.js.map +1 -1
- package/dist/queries.mjs +29 -17
- package/dist/queries.mjs.map +1 -1
- package/dist/services.js +14 -3
- package/dist/services.js.map +1 -1
- package/dist/services.mjs +39 -27
- package/dist/services.mjs.map +1 -1
- package/dist/teams.js.map +1 -1
- package/dist/teams.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -84,7 +84,9 @@ declare const _default: (path: string) => {
|
|
|
84
84
|
addFileToEvent: (id: string, file: {
|
|
85
85
|
content: string;
|
|
86
86
|
fileName: string;
|
|
87
|
-
}, version?: string
|
|
87
|
+
}, version?: string, options?: {
|
|
88
|
+
path?: string;
|
|
89
|
+
}) => Promise<void>;
|
|
88
90
|
/**
|
|
89
91
|
* Adds a schema to the given event
|
|
90
92
|
* @param id - The id of the event to add the schema to
|
|
@@ -95,7 +97,9 @@ declare const _default: (path: string) => {
|
|
|
95
97
|
addSchemaToEvent: (id: string, schema: {
|
|
96
98
|
schema: string;
|
|
97
99
|
fileName: string;
|
|
98
|
-
}, version?: string
|
|
100
|
+
}, version?: string, options?: {
|
|
101
|
+
path?: string;
|
|
102
|
+
}) => Promise<void>;
|
|
99
103
|
/**
|
|
100
104
|
* Check to see if an event version exists
|
|
101
105
|
* @param id - The id of the event
|
|
@@ -184,7 +188,9 @@ declare const _default: (path: string) => {
|
|
|
184
188
|
addFileToCommand: (id: string, file: {
|
|
185
189
|
content: string;
|
|
186
190
|
fileName: string;
|
|
187
|
-
}, version?: string
|
|
191
|
+
}, version?: string, options?: {
|
|
192
|
+
path?: string;
|
|
193
|
+
}) => Promise<void>;
|
|
188
194
|
/**
|
|
189
195
|
* Adds a schema to the given command
|
|
190
196
|
* @param id - The id of the command to add the schema to
|
|
@@ -195,7 +201,9 @@ declare const _default: (path: string) => {
|
|
|
195
201
|
addSchemaToCommand: (id: string, schema: {
|
|
196
202
|
schema: string;
|
|
197
203
|
fileName: string;
|
|
198
|
-
}, version?: string
|
|
204
|
+
}, version?: string, options?: {
|
|
205
|
+
path?: string;
|
|
206
|
+
}) => Promise<void>;
|
|
199
207
|
/**
|
|
200
208
|
* Check to see if a command version exists
|
|
201
209
|
* @param id - The id of the command
|
|
@@ -284,7 +292,9 @@ declare const _default: (path: string) => {
|
|
|
284
292
|
addFileToQuery: (id: string, file: {
|
|
285
293
|
content: string;
|
|
286
294
|
fileName: string;
|
|
287
|
-
}, version?: string
|
|
295
|
+
}, version?: string, options?: {
|
|
296
|
+
path?: string;
|
|
297
|
+
}) => Promise<void>;
|
|
288
298
|
/**
|
|
289
299
|
* Adds a schema to the given query
|
|
290
300
|
* @param id - The id of the query to add the schema to
|
|
@@ -295,7 +305,9 @@ declare const _default: (path: string) => {
|
|
|
295
305
|
addSchemaToQuery: (id: string, schema: {
|
|
296
306
|
schema: string;
|
|
297
307
|
fileName: string;
|
|
298
|
-
}, version?: string
|
|
308
|
+
}, version?: string, options?: {
|
|
309
|
+
path?: string;
|
|
310
|
+
}) => Promise<void>;
|
|
299
311
|
/**
|
|
300
312
|
* Check to see if an query version exists
|
|
301
313
|
* @param id - The id of the query
|
package/dist/index.d.ts
CHANGED
|
@@ -84,7 +84,9 @@ declare const _default: (path: string) => {
|
|
|
84
84
|
addFileToEvent: (id: string, file: {
|
|
85
85
|
content: string;
|
|
86
86
|
fileName: string;
|
|
87
|
-
}, version?: string
|
|
87
|
+
}, version?: string, options?: {
|
|
88
|
+
path?: string;
|
|
89
|
+
}) => Promise<void>;
|
|
88
90
|
/**
|
|
89
91
|
* Adds a schema to the given event
|
|
90
92
|
* @param id - The id of the event to add the schema to
|
|
@@ -95,7 +97,9 @@ declare const _default: (path: string) => {
|
|
|
95
97
|
addSchemaToEvent: (id: string, schema: {
|
|
96
98
|
schema: string;
|
|
97
99
|
fileName: string;
|
|
98
|
-
}, version?: string
|
|
100
|
+
}, version?: string, options?: {
|
|
101
|
+
path?: string;
|
|
102
|
+
}) => Promise<void>;
|
|
99
103
|
/**
|
|
100
104
|
* Check to see if an event version exists
|
|
101
105
|
* @param id - The id of the event
|
|
@@ -184,7 +188,9 @@ declare const _default: (path: string) => {
|
|
|
184
188
|
addFileToCommand: (id: string, file: {
|
|
185
189
|
content: string;
|
|
186
190
|
fileName: string;
|
|
187
|
-
}, version?: string
|
|
191
|
+
}, version?: string, options?: {
|
|
192
|
+
path?: string;
|
|
193
|
+
}) => Promise<void>;
|
|
188
194
|
/**
|
|
189
195
|
* Adds a schema to the given command
|
|
190
196
|
* @param id - The id of the command to add the schema to
|
|
@@ -195,7 +201,9 @@ declare const _default: (path: string) => {
|
|
|
195
201
|
addSchemaToCommand: (id: string, schema: {
|
|
196
202
|
schema: string;
|
|
197
203
|
fileName: string;
|
|
198
|
-
}, version?: string
|
|
204
|
+
}, version?: string, options?: {
|
|
205
|
+
path?: string;
|
|
206
|
+
}) => Promise<void>;
|
|
199
207
|
/**
|
|
200
208
|
* Check to see if a command version exists
|
|
201
209
|
* @param id - The id of the command
|
|
@@ -284,7 +292,9 @@ declare const _default: (path: string) => {
|
|
|
284
292
|
addFileToQuery: (id: string, file: {
|
|
285
293
|
content: string;
|
|
286
294
|
fileName: string;
|
|
287
|
-
}, version?: string
|
|
295
|
+
}, version?: string, options?: {
|
|
296
|
+
path?: string;
|
|
297
|
+
}) => Promise<void>;
|
|
288
298
|
/**
|
|
289
299
|
* Adds a schema to the given query
|
|
290
300
|
* @param id - The id of the query to add the schema to
|
|
@@ -295,7 +305,9 @@ declare const _default: (path: string) => {
|
|
|
295
305
|
addSchemaToQuery: (id: string, schema: {
|
|
296
306
|
schema: string;
|
|
297
307
|
fileName: string;
|
|
298
|
-
}, version?: string
|
|
308
|
+
}, version?: string, options?: {
|
|
309
|
+
path?: string;
|
|
310
|
+
}) => Promise<void>;
|
|
299
311
|
/**
|
|
300
312
|
* Check to see if an query version exists
|
|
301
313
|
* @param id - The id of the query
|
package/dist/index.js
CHANGED
|
@@ -170,7 +170,7 @@ var versionResource = async (catalogDir, id) => {
|
|
|
170
170
|
throw new Error(`No resource found with id: ${id}`);
|
|
171
171
|
}
|
|
172
172
|
const file = matchedFiles[0];
|
|
173
|
-
const sourceDirectory = (0, import_path.dirname)(file).replace(
|
|
173
|
+
const sourceDirectory = (0, import_path.dirname)(file).replace(/[/\\]versioned[/\\][^/\\]+[/\\]/, import_node_path3.default.sep);
|
|
174
174
|
const { data: { version = "0.0.1" } = {} } = import_gray_matter2.default.read(file);
|
|
175
175
|
const targetDirectory = getVersionedDirectory(sourceDirectory, version);
|
|
176
176
|
import_node_fs2.default.mkdirSync(targetDirectory, { recursive: true });
|
|
@@ -346,8 +346,19 @@ var waitForFileRemoval = async (path6, maxRetries = 50, delay = 10) => {
|
|
|
346
346
|
}
|
|
347
347
|
throw new Error(`File/directory ${path6} was not removed after ${maxRetries} attempts`);
|
|
348
348
|
};
|
|
349
|
-
var addFileToResource = async (catalogDir, id, file, version) => {
|
|
350
|
-
|
|
349
|
+
var addFileToResource = async (catalogDir, id, file, version, options) => {
|
|
350
|
+
let pathToResource;
|
|
351
|
+
if (options?.path) {
|
|
352
|
+
const mdxPath = (0, import_path.join)(catalogDir, options.path, "index.mdx");
|
|
353
|
+
const mdPath = (0, import_path.join)(catalogDir, options.path, "index.md");
|
|
354
|
+
if (import_node_fs2.default.existsSync(mdxPath)) {
|
|
355
|
+
pathToResource = mdxPath;
|
|
356
|
+
} else if (import_node_fs2.default.existsSync(mdPath)) {
|
|
357
|
+
pathToResource = mdPath;
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
pathToResource = await findFileById(catalogDir, id, version);
|
|
361
|
+
}
|
|
351
362
|
if (!pathToResource) throw new Error("Cannot find directory to write file to");
|
|
352
363
|
let fileContent = file.content.trim();
|
|
353
364
|
try {
|
|
@@ -398,9 +409,9 @@ var rmEventById = (directory) => async (id, version, persistFiles) => {
|
|
|
398
409
|
await rmResourceById(directory, id, version, { type: "event", persistFiles });
|
|
399
410
|
};
|
|
400
411
|
var versionEvent = (directory) => async (id) => versionResource(directory, id);
|
|
401
|
-
var addFileToEvent = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
402
|
-
var addSchemaToEvent = (directory) => async (id, schema, version) => {
|
|
403
|
-
await addFileToEvent(directory)(id, { content: schema.schema, fileName: schema.fileName }, version);
|
|
412
|
+
var addFileToEvent = (directory) => async (id, file, version, options) => addFileToResource(directory, id, file, version, options);
|
|
413
|
+
var addSchemaToEvent = (directory) => async (id, schema, version, options) => {
|
|
414
|
+
await addFileToEvent(directory)(id, { content: schema.schema, fileName: schema.fileName }, version, options);
|
|
404
415
|
};
|
|
405
416
|
var eventHasVersion = (directory) => async (id, version) => {
|
|
406
417
|
const file = await findFileById(directory, id, version);
|
|
@@ -432,9 +443,9 @@ var rmCommand = (directory) => async (path6) => {
|
|
|
432
443
|
};
|
|
433
444
|
var rmCommandById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "command", persistFiles });
|
|
434
445
|
var versionCommand = (directory) => async (id) => versionResource(directory, id);
|
|
435
|
-
var addFileToCommand = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
436
|
-
var addSchemaToCommand = (directory) => async (id, schema, version) => {
|
|
437
|
-
await addFileToCommand(directory)(id, { content: schema.schema, fileName: schema.fileName }, version);
|
|
446
|
+
var addFileToCommand = (directory) => async (id, file, version, options) => addFileToResource(directory, id, file, version, options);
|
|
447
|
+
var addSchemaToCommand = (directory) => async (id, schema, version, options) => {
|
|
448
|
+
await addFileToCommand(directory)(id, { content: schema.schema, fileName: schema.fileName }, version, options);
|
|
438
449
|
};
|
|
439
450
|
var commandHasVersion = (directory) => async (id, version) => {
|
|
440
451
|
const file = await findFileById(directory, id, version);
|
|
@@ -468,9 +479,9 @@ var rmQueryById = (directory) => async (id, version, persistFiles) => {
|
|
|
468
479
|
await rmResourceById(directory, id, version, { type: "query", persistFiles });
|
|
469
480
|
};
|
|
470
481
|
var versionQuery = (directory) => async (id) => versionResource(directory, id);
|
|
471
|
-
var addFileToQuery = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
|
|
472
|
-
var addSchemaToQuery = (directory) => async (id, schema, version) => {
|
|
473
|
-
await addFileToQuery(directory)(id, { content: schema.schema, fileName: schema.fileName }, version);
|
|
482
|
+
var addFileToQuery = (directory) => async (id, file, version, options) => addFileToResource(directory, id, file, version, options);
|
|
483
|
+
var addSchemaToQuery = (directory) => async (id, schema, version, options) => {
|
|
484
|
+
await addFileToQuery(directory)(id, { content: schema.schema, fileName: schema.fileName }, version, options);
|
|
474
485
|
};
|
|
475
486
|
var queryHasVersion = (directory) => async (id, version) => {
|
|
476
487
|
const file = await findFileById(directory, id, version);
|