@eventcatalog/sdk 2.9.2 → 2.9.5
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/README.md +1 -1
- package/dist/channels.mjs +20 -27
- package/dist/channels.mjs.map +1 -1
- package/dist/commands.mjs +18 -19
- package/dist/commands.mjs.map +1 -1
- package/dist/containers.mjs +18 -19
- package/dist/containers.mjs.map +1 -1
- package/dist/custom-docs.mjs +15 -19
- package/dist/custom-docs.mjs.map +1 -1
- package/dist/data-stores.mjs +18 -19
- package/dist/data-stores.mjs.map +1 -1
- package/dist/domains.mjs +25 -26
- package/dist/domains.mjs.map +1 -1
- package/dist/entities.mjs +18 -19
- package/dist/entities.mjs.map +1 -1
- package/dist/eventcatalog.js +2 -2
- package/dist/eventcatalog.js.map +1 -1
- package/dist/eventcatalog.mjs +37 -37
- package/dist/eventcatalog.mjs.map +1 -1
- package/dist/events.mjs +18 -19
- package/dist/events.mjs.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -38
- package/dist/index.mjs.map +1 -1
- package/dist/messages.mjs +14 -19
- package/dist/messages.mjs.map +1 -1
- package/dist/queries.mjs +18 -19
- package/dist/queries.mjs.map +1 -1
- package/dist/services.mjs +31 -32
- package/dist/services.mjs.map +1 -1
- package/dist/teams.mjs +16 -21
- package/dist/teams.mjs.map +1 -1
- package/dist/users.mjs +6 -7
- package/dist/users.mjs.map +1 -1
- package/package.json +5 -1
package/dist/eventcatalog.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// src/eventcatalog.ts
|
|
2
2
|
import fs12 from "fs";
|
|
3
|
-
import path5, { join as join16 } from "path";
|
|
3
|
+
import path5, { join as join16 } from "node:path";
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
|
-
import { join as join15 } from "path";
|
|
6
|
+
import { join as join15 } from "node:path";
|
|
7
7
|
|
|
8
8
|
// src/events.ts
|
|
9
|
-
import fs2 from "fs/promises";
|
|
10
|
-
import { join as join3 } from "path";
|
|
9
|
+
import fs2 from "node:fs/promises";
|
|
10
|
+
import { join as join3 } from "node:path";
|
|
11
11
|
|
|
12
12
|
// src/internal/utils.ts
|
|
13
13
|
import { globSync } from "glob";
|
|
14
|
-
import fsSync from "fs";
|
|
14
|
+
import fsSync from "node:fs";
|
|
15
15
|
import { copy } from "fs-extra";
|
|
16
|
-
import { join, dirname, normalize, resolve, relative } from "path";
|
|
16
|
+
import { join, dirname, normalize, resolve, relative } from "node:path";
|
|
17
17
|
import matter from "gray-matter";
|
|
18
18
|
import { satisfies, validRange } from "semver";
|
|
19
19
|
var versionExists = async (catalogDir, id, version) => {
|
|
@@ -127,12 +127,12 @@ var uniqueVersions = (messages) => {
|
|
|
127
127
|
// src/internal/resources.ts
|
|
128
128
|
import { dirname as dirname2, join as join2 } from "path";
|
|
129
129
|
import matter2 from "gray-matter";
|
|
130
|
-
import fs from "fs/promises";
|
|
131
|
-
import fsSync2 from "fs";
|
|
130
|
+
import fs from "node:fs/promises";
|
|
131
|
+
import fsSync2 from "node:fs";
|
|
132
132
|
import { satisfies as satisfies2 } from "semver";
|
|
133
133
|
import { lock, unlock } from "proper-lockfile";
|
|
134
|
-
import { basename as basename2 } from "path";
|
|
135
|
-
import path from "path";
|
|
134
|
+
import { basename as basename2 } from "node:path";
|
|
135
|
+
import path from "node:path";
|
|
136
136
|
var versionResource = async (catalogDir, id) => {
|
|
137
137
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
138
138
|
const matchedFiles = await searchFilesForId(files, id);
|
|
@@ -378,8 +378,8 @@ var eventHasVersion = (directory) => async (id, version) => {
|
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
// src/commands.ts
|
|
381
|
-
import fs3 from "fs/promises";
|
|
382
|
-
import { join as join4 } from "path";
|
|
381
|
+
import fs3 from "node:fs/promises";
|
|
382
|
+
import { join as join4 } from "node:path";
|
|
383
383
|
var getCommand = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "command", ...options });
|
|
384
384
|
var getCommands = (directory) => async (options) => getResources(directory, { type: "commands", ...options });
|
|
385
385
|
var writeCommand = (directory) => async (command, options = {
|
|
@@ -412,8 +412,8 @@ var commandHasVersion = (directory) => async (id, version) => {
|
|
|
412
412
|
};
|
|
413
413
|
|
|
414
414
|
// src/queries.ts
|
|
415
|
-
import fs4 from "fs/promises";
|
|
416
|
-
import { join as join5 } from "path";
|
|
415
|
+
import fs4 from "node:fs/promises";
|
|
416
|
+
import { join as join5 } from "node:path";
|
|
417
417
|
var getQuery = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "query", ...options });
|
|
418
418
|
var writeQuery = (directory) => async (query, options = {
|
|
419
419
|
path: "",
|
|
@@ -448,8 +448,8 @@ var queryHasVersion = (directory) => async (id, version) => {
|
|
|
448
448
|
};
|
|
449
449
|
|
|
450
450
|
// src/services.ts
|
|
451
|
-
import fs5 from "fs/promises";
|
|
452
|
-
import { join as join6, dirname as dirname4, extname, relative as relative2 } from "path";
|
|
451
|
+
import fs5 from "node:fs/promises";
|
|
452
|
+
import { join as join6, dirname as dirname4, extname, relative as relative2 } from "node:path";
|
|
453
453
|
var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
|
|
454
454
|
var getServiceByPath = (directory) => async (path6) => {
|
|
455
455
|
const service = await getResource(directory, void 0, void 0, { type: "service" }, path6);
|
|
@@ -626,9 +626,9 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
|
|
|
626
626
|
};
|
|
627
627
|
|
|
628
628
|
// src/domains.ts
|
|
629
|
-
import fs6 from "fs/promises";
|
|
630
|
-
import path2, { join as join7 } from "path";
|
|
631
|
-
import fsSync3 from "fs";
|
|
629
|
+
import fs6 from "node:fs/promises";
|
|
630
|
+
import path2, { join as join7 } from "node:path";
|
|
631
|
+
import fsSync3 from "node:fs";
|
|
632
632
|
import matter3 from "gray-matter";
|
|
633
633
|
var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
|
|
634
634
|
var getDomains = (directory) => async (options) => getResources(directory, {
|
|
@@ -724,8 +724,8 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
|
|
|
724
724
|
};
|
|
725
725
|
|
|
726
726
|
// src/channels.ts
|
|
727
|
-
import fs7 from "fs/promises";
|
|
728
|
-
import { join as join8, extname as extname2 } from "path";
|
|
727
|
+
import fs7 from "node:fs/promises";
|
|
728
|
+
import { join as join8, extname as extname2 } from "node:path";
|
|
729
729
|
var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
|
|
730
730
|
var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
|
|
731
731
|
var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
|
|
@@ -778,7 +778,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
778
778
|
};
|
|
779
779
|
|
|
780
780
|
// src/messages.ts
|
|
781
|
-
import { dirname as dirname5 } from "path";
|
|
781
|
+
import { dirname as dirname5 } from "node:path";
|
|
782
782
|
import matter4 from "gray-matter";
|
|
783
783
|
import { satisfies as satisfies3, validRange as validRange2 } from "semver";
|
|
784
784
|
var getMessageBySchemaPath = (directory) => async (path6, options) => {
|
|
@@ -874,9 +874,9 @@ var getProducersOfSchema = (directory) => async (path6) => {
|
|
|
874
874
|
};
|
|
875
875
|
|
|
876
876
|
// src/custom-docs.ts
|
|
877
|
-
import path3, { join as join10 } from "path";
|
|
878
|
-
import fsSync4 from "fs";
|
|
879
|
-
import fs8 from "fs/promises";
|
|
877
|
+
import path3, { join as join10 } from "node:path";
|
|
878
|
+
import fsSync4 from "node:fs";
|
|
879
|
+
import fs8 from "node:fs/promises";
|
|
880
880
|
import matter5 from "gray-matter";
|
|
881
881
|
import slugify from "slugify";
|
|
882
882
|
var getCustomDoc = (directory) => async (filePath) => {
|
|
@@ -910,15 +910,15 @@ var rmCustomDoc = (directory) => async (filePath) => {
|
|
|
910
910
|
};
|
|
911
911
|
|
|
912
912
|
// src/teams.ts
|
|
913
|
-
import fs9 from "fs/promises";
|
|
914
|
-
import fsSync6 from "fs";
|
|
915
|
-
import { join as join12 } from "path";
|
|
913
|
+
import fs9 from "node:fs/promises";
|
|
914
|
+
import fsSync6 from "node:fs";
|
|
915
|
+
import { join as join12 } from "node:path";
|
|
916
916
|
import matter7 from "gray-matter";
|
|
917
|
-
import path4 from "path";
|
|
917
|
+
import path4 from "node:path";
|
|
918
918
|
|
|
919
919
|
// src/users.ts
|
|
920
|
-
import fsSync5 from "fs";
|
|
921
|
-
import { join as join11 } from "path";
|
|
920
|
+
import fsSync5 from "node:fs";
|
|
921
|
+
import { join as join11 } from "node:path";
|
|
922
922
|
import matter6 from "gray-matter";
|
|
923
923
|
var getUser = (catalogDir) => async (id) => {
|
|
924
924
|
const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
|
|
@@ -1024,8 +1024,8 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
|
|
|
1024
1024
|
};
|
|
1025
1025
|
|
|
1026
1026
|
// src/entities.ts
|
|
1027
|
-
import fs10 from "fs/promises";
|
|
1028
|
-
import { join as join13 } from "path";
|
|
1027
|
+
import fs10 from "node:fs/promises";
|
|
1028
|
+
import { join as join13 } from "node:path";
|
|
1029
1029
|
var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
|
|
1030
1030
|
var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
|
|
1031
1031
|
var writeEntity = (directory) => async (entity, options = {
|
|
@@ -1046,8 +1046,8 @@ var entityHasVersion = (directory) => async (id, version) => {
|
|
|
1046
1046
|
};
|
|
1047
1047
|
|
|
1048
1048
|
// src/containers.ts
|
|
1049
|
-
import fs11 from "fs/promises";
|
|
1050
|
-
import { join as join14 } from "path";
|
|
1049
|
+
import fs11 from "node:fs/promises";
|
|
1050
|
+
import { join as join14 } from "node:path";
|
|
1051
1051
|
var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
|
|
1052
1052
|
var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
|
|
1053
1053
|
var writeContainer = (directory) => async (data, options = {
|
|
@@ -1089,7 +1089,7 @@ var addFileToDataStore = addFileToContainer;
|
|
|
1089
1089
|
var writeDataStoreToService = writeContainerToService;
|
|
1090
1090
|
|
|
1091
1091
|
// src/index.ts
|
|
1092
|
-
var
|
|
1092
|
+
var src_default = (path6) => {
|
|
1093
1093
|
return {
|
|
1094
1094
|
/**
|
|
1095
1095
|
* Returns an events from EventCatalog
|
|
@@ -2046,7 +2046,7 @@ var getEventCatalogConfigurationFile = (directory) => async () => {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
};
|
|
2048
2048
|
var dumpCatalog = (directory) => async (options) => {
|
|
2049
|
-
const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers3 } =
|
|
2049
|
+
const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers3 } = src_default(directory);
|
|
2050
2050
|
const { includeMarkdown = true } = options || {};
|
|
2051
2051
|
const domains = await getDomains2();
|
|
2052
2052
|
const services = await getServices2();
|