@eventcatalog/sdk 2.9.1 → 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/types.d.d.mts +1 -0
- package/dist/types.d.d.ts +1 -0
- package/dist/types.d.js.map +1 -1
- package/dist/users.mjs +6 -7
- package/dist/users.mjs.map +1 -1
- package/package.json +5 -1
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { join as join16 } from "path";
|
|
2
|
+
import { join as join16 } from "node:path";
|
|
3
3
|
|
|
4
4
|
// src/events.ts
|
|
5
|
-
import fs2 from "fs/promises";
|
|
6
|
-
import { join as join3 } from "path";
|
|
5
|
+
import fs2 from "node:fs/promises";
|
|
6
|
+
import { join as join3 } from "node:path";
|
|
7
7
|
|
|
8
8
|
// src/internal/utils.ts
|
|
9
9
|
import { globSync } from "glob";
|
|
10
|
-
import fsSync from "fs";
|
|
10
|
+
import fsSync from "node:fs";
|
|
11
11
|
import { copy } from "fs-extra";
|
|
12
|
-
import { join, dirname, normalize, resolve, relative } from "path";
|
|
12
|
+
import { join, dirname, normalize, resolve, relative } from "node:path";
|
|
13
13
|
import matter from "gray-matter";
|
|
14
14
|
import { satisfies, validRange } from "semver";
|
|
15
15
|
var versionExists = async (catalogDir, id, version) => {
|
|
@@ -123,12 +123,12 @@ var uniqueVersions = (messages) => {
|
|
|
123
123
|
// src/internal/resources.ts
|
|
124
124
|
import { dirname as dirname2, join as join2 } from "path";
|
|
125
125
|
import matter2 from "gray-matter";
|
|
126
|
-
import fs from "fs/promises";
|
|
127
|
-
import fsSync2 from "fs";
|
|
126
|
+
import fs from "node:fs/promises";
|
|
127
|
+
import fsSync2 from "node:fs";
|
|
128
128
|
import { satisfies as satisfies2 } from "semver";
|
|
129
129
|
import { lock, unlock } from "proper-lockfile";
|
|
130
|
-
import { basename as basename2 } from "path";
|
|
131
|
-
import path from "path";
|
|
130
|
+
import { basename as basename2 } from "node:path";
|
|
131
|
+
import path from "node:path";
|
|
132
132
|
var versionResource = async (catalogDir, id) => {
|
|
133
133
|
const files = await getFiles(`${catalogDir}/**/index.{md,mdx}`);
|
|
134
134
|
const matchedFiles = await searchFilesForId(files, id);
|
|
@@ -374,8 +374,8 @@ var eventHasVersion = (directory) => async (id, version) => {
|
|
|
374
374
|
};
|
|
375
375
|
|
|
376
376
|
// src/commands.ts
|
|
377
|
-
import fs3 from "fs/promises";
|
|
378
|
-
import { join as join4 } from "path";
|
|
377
|
+
import fs3 from "node:fs/promises";
|
|
378
|
+
import { join as join4 } from "node:path";
|
|
379
379
|
var getCommand = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "command", ...options });
|
|
380
380
|
var getCommands = (directory) => async (options) => getResources(directory, { type: "commands", ...options });
|
|
381
381
|
var writeCommand = (directory) => async (command, options = {
|
|
@@ -408,8 +408,8 @@ var commandHasVersion = (directory) => async (id, version) => {
|
|
|
408
408
|
};
|
|
409
409
|
|
|
410
410
|
// src/queries.ts
|
|
411
|
-
import fs4 from "fs/promises";
|
|
412
|
-
import { join as join5 } from "path";
|
|
411
|
+
import fs4 from "node:fs/promises";
|
|
412
|
+
import { join as join5 } from "node:path";
|
|
413
413
|
var getQuery = (directory) => async (id, version, options) => getResource(directory, id, version, { type: "query", ...options });
|
|
414
414
|
var writeQuery = (directory) => async (query, options = {
|
|
415
415
|
path: "",
|
|
@@ -444,8 +444,8 @@ var queryHasVersion = (directory) => async (id, version) => {
|
|
|
444
444
|
};
|
|
445
445
|
|
|
446
446
|
// src/services.ts
|
|
447
|
-
import fs5 from "fs/promises";
|
|
448
|
-
import { join as join6, dirname as dirname4, extname, relative as relative2 } from "path";
|
|
447
|
+
import fs5 from "node:fs/promises";
|
|
448
|
+
import { join as join6, dirname as dirname4, extname, relative as relative2 } from "node:path";
|
|
449
449
|
var getService = (directory) => async (id, version) => getResource(directory, id, version, { type: "service" });
|
|
450
450
|
var getServiceByPath = (directory) => async (path6) => {
|
|
451
451
|
const service = await getResource(directory, void 0, void 0, { type: "service" }, path6);
|
|
@@ -622,9 +622,9 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
|
|
|
622
622
|
};
|
|
623
623
|
|
|
624
624
|
// src/domains.ts
|
|
625
|
-
import fs6 from "fs/promises";
|
|
626
|
-
import path2, { join as join7 } from "path";
|
|
627
|
-
import fsSync3 from "fs";
|
|
625
|
+
import fs6 from "node:fs/promises";
|
|
626
|
+
import path2, { join as join7 } from "node:path";
|
|
627
|
+
import fsSync3 from "node:fs";
|
|
628
628
|
import matter3 from "gray-matter";
|
|
629
629
|
var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
|
|
630
630
|
var getDomains = (directory) => async (options) => getResources(directory, {
|
|
@@ -720,8 +720,8 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
|
|
|
720
720
|
};
|
|
721
721
|
|
|
722
722
|
// src/channels.ts
|
|
723
|
-
import fs7 from "fs/promises";
|
|
724
|
-
import { join as join8, extname as extname2 } from "path";
|
|
723
|
+
import fs7 from "node:fs/promises";
|
|
724
|
+
import { join as join8, extname as extname2 } from "node:path";
|
|
725
725
|
var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
|
|
726
726
|
var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
|
|
727
727
|
var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
|
|
@@ -774,7 +774,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
|
|
|
774
774
|
};
|
|
775
775
|
|
|
776
776
|
// src/messages.ts
|
|
777
|
-
import { dirname as dirname5 } from "path";
|
|
777
|
+
import { dirname as dirname5 } from "node:path";
|
|
778
778
|
import matter4 from "gray-matter";
|
|
779
779
|
import { satisfies as satisfies3, validRange as validRange2 } from "semver";
|
|
780
780
|
var getMessageBySchemaPath = (directory) => async (path6, options) => {
|
|
@@ -870,9 +870,9 @@ var getProducersOfSchema = (directory) => async (path6) => {
|
|
|
870
870
|
};
|
|
871
871
|
|
|
872
872
|
// src/custom-docs.ts
|
|
873
|
-
import path3, { join as join10 } from "path";
|
|
874
|
-
import fsSync4 from "fs";
|
|
875
|
-
import fs8 from "fs/promises";
|
|
873
|
+
import path3, { join as join10 } from "node:path";
|
|
874
|
+
import fsSync4 from "node:fs";
|
|
875
|
+
import fs8 from "node:fs/promises";
|
|
876
876
|
import matter5 from "gray-matter";
|
|
877
877
|
import slugify from "slugify";
|
|
878
878
|
var getCustomDoc = (directory) => async (filePath) => {
|
|
@@ -906,15 +906,15 @@ var rmCustomDoc = (directory) => async (filePath) => {
|
|
|
906
906
|
};
|
|
907
907
|
|
|
908
908
|
// src/teams.ts
|
|
909
|
-
import fs9 from "fs/promises";
|
|
910
|
-
import fsSync6 from "fs";
|
|
911
|
-
import { join as join12 } from "path";
|
|
909
|
+
import fs9 from "node:fs/promises";
|
|
910
|
+
import fsSync6 from "node:fs";
|
|
911
|
+
import { join as join12 } from "node:path";
|
|
912
912
|
import matter7 from "gray-matter";
|
|
913
|
-
import path4 from "path";
|
|
913
|
+
import path4 from "node:path";
|
|
914
914
|
|
|
915
915
|
// src/users.ts
|
|
916
|
-
import fsSync5 from "fs";
|
|
917
|
-
import { join as join11 } from "path";
|
|
916
|
+
import fsSync5 from "node:fs";
|
|
917
|
+
import { join as join11 } from "node:path";
|
|
918
918
|
import matter6 from "gray-matter";
|
|
919
919
|
var getUser = (catalogDir) => async (id) => {
|
|
920
920
|
const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
|
|
@@ -1021,7 +1021,7 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
|
|
|
1021
1021
|
|
|
1022
1022
|
// src/eventcatalog.ts
|
|
1023
1023
|
import fs10 from "fs";
|
|
1024
|
-
import path5, { join as join13 } from "path";
|
|
1024
|
+
import path5, { join as join13 } from "node:path";
|
|
1025
1025
|
var DUMP_VERSION = "0.0.1";
|
|
1026
1026
|
var getEventCatalogVersion = async (catalogDir) => {
|
|
1027
1027
|
try {
|
|
@@ -1068,7 +1068,7 @@ var getEventCatalogConfigurationFile = (directory) => async () => {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
};
|
|
1070
1070
|
var dumpCatalog = (directory) => async (options) => {
|
|
1071
|
-
const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers3 } =
|
|
1071
|
+
const { getDomains: getDomains2, getServices: getServices2, getEvents: getEvents2, getQueries: getQueries2, getCommands: getCommands2, getChannels: getChannels2, getTeams: getTeams2, getUsers: getUsers3 } = src_default(directory);
|
|
1072
1072
|
const { includeMarkdown = true } = options || {};
|
|
1073
1073
|
const domains = await getDomains2();
|
|
1074
1074
|
const services = await getServices2();
|
|
@@ -1117,8 +1117,8 @@ var dumpCatalog = (directory) => async (options) => {
|
|
|
1117
1117
|
};
|
|
1118
1118
|
|
|
1119
1119
|
// src/entities.ts
|
|
1120
|
-
import fs11 from "fs/promises";
|
|
1121
|
-
import { join as join14 } from "path";
|
|
1120
|
+
import fs11 from "node:fs/promises";
|
|
1121
|
+
import { join as join14 } from "node:path";
|
|
1122
1122
|
var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
|
|
1123
1123
|
var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
|
|
1124
1124
|
var writeEntity = (directory) => async (entity, options = {
|
|
@@ -1139,8 +1139,8 @@ var entityHasVersion = (directory) => async (id, version) => {
|
|
|
1139
1139
|
};
|
|
1140
1140
|
|
|
1141
1141
|
// src/containers.ts
|
|
1142
|
-
import fs12 from "fs/promises";
|
|
1143
|
-
import { join as join15 } from "path";
|
|
1142
|
+
import fs12 from "node:fs/promises";
|
|
1143
|
+
import { join as join15 } from "node:path";
|
|
1144
1144
|
var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
|
|
1145
1145
|
var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
|
|
1146
1146
|
var writeContainer = (directory) => async (data, options = {
|
|
@@ -1182,7 +1182,7 @@ var addFileToDataStore = addFileToContainer;
|
|
|
1182
1182
|
var writeDataStoreToService = writeContainerToService;
|
|
1183
1183
|
|
|
1184
1184
|
// src/index.ts
|
|
1185
|
-
var
|
|
1185
|
+
var src_default = (path6) => {
|
|
1186
1186
|
return {
|
|
1187
1187
|
/**
|
|
1188
1188
|
* Returns an events from EventCatalog
|
|
@@ -2092,6 +2092,6 @@ var index_default = (path6) => {
|
|
|
2092
2092
|
};
|
|
2093
2093
|
};
|
|
2094
2094
|
export {
|
|
2095
|
-
|
|
2095
|
+
src_default as default
|
|
2096
2096
|
};
|
|
2097
2097
|
//# sourceMappingURL=index.mjs.map
|