@eventcatalog/sdk 2.6.8 → 2.7.0
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 +0 -16
- package/dist/domains.d.mts +22 -1
- package/dist/domains.d.ts +22 -1
- package/dist/domains.js +17 -0
- package/dist/domains.js.map +1 -1
- package/dist/domains.mjs +16 -0
- package/dist/domains.mjs.map +1 -1
- package/dist/entities.d.mts +174 -0
- package/dist/entities.d.ts +174 -0
- package/dist/entities.js +318 -0
- package/dist/entities.js.map +1 -0
- package/dist/entities.mjs +277 -0
- package/dist/entities.mjs.map +1 -0
- package/dist/eventcatalog.js +230 -93
- package/dist/eventcatalog.js.map +1 -1
- package/dist/eventcatalog.mjs +232 -95
- package/dist/eventcatalog.mjs.map +1 -1
- package/dist/index.d.mts +120 -5
- package/dist/index.d.ts +120 -5
- package/dist/index.js +226 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +226 -89
- package/dist/index.mjs.map +1 -1
- package/dist/messages.js.map +1 -1
- package/dist/messages.mjs.map +1 -1
- package/dist/services.d.mts +22 -1
- package/dist/services.d.ts +22 -1
- package/dist/services.js +24 -0
- package/dist/services.js.map +1 -1
- package/dist/services.mjs +23 -0
- package/dist/services.mjs.map +1 -1
- package/dist/types.d.d.mts +31 -1
- package/dist/types.d.d.ts +31 -1
- package/dist/types.d.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { join as
|
|
2
|
+
import { join as join15 } from "path";
|
|
3
3
|
|
|
4
4
|
// src/events.ts
|
|
5
5
|
import fs2 from "fs/promises";
|
|
@@ -518,6 +518,28 @@ var isService = (directory) => async (path5) => {
|
|
|
518
518
|
return !!service && segments.includes("services");
|
|
519
519
|
};
|
|
520
520
|
var toService = (directory) => async (file) => toResource(directory, file);
|
|
521
|
+
var addEntityToService = (directory) => async (id, entity, version) => {
|
|
522
|
+
let service = await getService(directory)(id, version);
|
|
523
|
+
const servicePath = await getResourcePath(directory, id, version);
|
|
524
|
+
const extension = extname(servicePath?.fullPath || "");
|
|
525
|
+
if (service.entities === void 0) {
|
|
526
|
+
service.entities = [];
|
|
527
|
+
}
|
|
528
|
+
for (let i = 0; i < service.entities.length; i++) {
|
|
529
|
+
if (service.entities[i].id === entity.id && service.entities[i].version === entity.version) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
service.entities.push({ id: entity.id, version: entity.version });
|
|
534
|
+
const existingResource = await findFileById(directory, id, version);
|
|
535
|
+
if (!existingResource) {
|
|
536
|
+
throw new Error(`Cannot find service ${id} in the catalog`);
|
|
537
|
+
}
|
|
538
|
+
const path5 = existingResource.split(/[\\/]+services/)[0];
|
|
539
|
+
const pathToResource = join6(path5, "services");
|
|
540
|
+
await rmServiceById(directory)(id, version);
|
|
541
|
+
await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
|
|
542
|
+
};
|
|
521
543
|
|
|
522
544
|
// src/domains.ts
|
|
523
545
|
import fs6 from "fs/promises";
|
|
@@ -601,6 +623,21 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
|
|
|
601
623
|
await rmDomainById(directory)(id, version, true);
|
|
602
624
|
await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
603
625
|
};
|
|
626
|
+
var addEntityToDomain = (directory) => async (id, entity, version) => {
|
|
627
|
+
let domain = await getDomain(directory)(id, version);
|
|
628
|
+
const domainPath = await getResourcePath(directory, id, version);
|
|
629
|
+
const extension = path.extname(domainPath?.fullPath || "");
|
|
630
|
+
if (domain.entities === void 0) {
|
|
631
|
+
domain.entities = [];
|
|
632
|
+
}
|
|
633
|
+
const entityExistsInList = domain.entities.some((e) => e.id === entity.id && e.version === entity.version);
|
|
634
|
+
if (entityExistsInList) {
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
domain.entities.push(entity);
|
|
638
|
+
await rmDomainById(directory)(id, version, true);
|
|
639
|
+
await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
|
|
640
|
+
};
|
|
604
641
|
|
|
605
642
|
// src/channels.ts
|
|
606
643
|
import fs7 from "fs/promises";
|
|
@@ -999,6 +1036,28 @@ var dumpCatalog = (directory) => async (options) => {
|
|
|
999
1036
|
};
|
|
1000
1037
|
};
|
|
1001
1038
|
|
|
1039
|
+
// src/entities.ts
|
|
1040
|
+
import fs11 from "fs/promises";
|
|
1041
|
+
import { join as join14 } from "path";
|
|
1042
|
+
var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
|
|
1043
|
+
var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
|
|
1044
|
+
var writeEntity = (directory) => async (entity, options = {
|
|
1045
|
+
path: "",
|
|
1046
|
+
override: false,
|
|
1047
|
+
format: "mdx"
|
|
1048
|
+
}) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
|
|
1049
|
+
var rmEntity = (directory) => async (path5) => {
|
|
1050
|
+
await fs11.rm(join14(directory, path5), { recursive: true });
|
|
1051
|
+
};
|
|
1052
|
+
var rmEntityById = (directory) => async (id, version, persistFiles) => {
|
|
1053
|
+
await rmResourceById(directory, id, version, { type: "entity", persistFiles });
|
|
1054
|
+
};
|
|
1055
|
+
var versionEntity = (directory) => async (id) => versionResource(directory, id);
|
|
1056
|
+
var entityHasVersion = (directory) => async (id, version) => {
|
|
1057
|
+
const file = await findFileById(directory, id, version);
|
|
1058
|
+
return !!file;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1002
1061
|
// src/index.ts
|
|
1003
1062
|
var index_default = (path5) => {
|
|
1004
1063
|
return {
|
|
@@ -1008,13 +1067,13 @@ var index_default = (path5) => {
|
|
|
1008
1067
|
* @param version - Optional id of the version to get (supports semver)
|
|
1009
1068
|
* @returns Event|Undefined
|
|
1010
1069
|
*/
|
|
1011
|
-
getEvent: getEvent(
|
|
1070
|
+
getEvent: getEvent(join15(path5)),
|
|
1012
1071
|
/**
|
|
1013
1072
|
* Returns all events from EventCatalog
|
|
1014
1073
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1015
1074
|
* @returns Event[]|Undefined
|
|
1016
1075
|
*/
|
|
1017
|
-
getEvents: getEvents(
|
|
1076
|
+
getEvents: getEvents(join15(path5)),
|
|
1018
1077
|
/**
|
|
1019
1078
|
* Adds an event to EventCatalog
|
|
1020
1079
|
*
|
|
@@ -1022,7 +1081,7 @@ var index_default = (path5) => {
|
|
|
1022
1081
|
* @param options - Optional options to write the event
|
|
1023
1082
|
*
|
|
1024
1083
|
*/
|
|
1025
|
-
writeEvent: writeEvent(
|
|
1084
|
+
writeEvent: writeEvent(join15(path5, "events")),
|
|
1026
1085
|
/**
|
|
1027
1086
|
* Adds an event to a service in EventCatalog
|
|
1028
1087
|
*
|
|
@@ -1031,26 +1090,26 @@ var index_default = (path5) => {
|
|
|
1031
1090
|
* @param options - Optional options to write the event
|
|
1032
1091
|
*
|
|
1033
1092
|
*/
|
|
1034
|
-
writeEventToService: writeEventToService(
|
|
1093
|
+
writeEventToService: writeEventToService(join15(path5)),
|
|
1035
1094
|
/**
|
|
1036
1095
|
* Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1037
1096
|
*
|
|
1038
1097
|
* @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
|
|
1039
1098
|
*
|
|
1040
1099
|
*/
|
|
1041
|
-
rmEvent: rmEvent(
|
|
1100
|
+
rmEvent: rmEvent(join15(path5, "events")),
|
|
1042
1101
|
/**
|
|
1043
1102
|
* Remove an event by an Event id
|
|
1044
1103
|
*
|
|
1045
1104
|
* @param id - The id of the event you want to remove
|
|
1046
1105
|
*
|
|
1047
1106
|
*/
|
|
1048
|
-
rmEventById: rmEventById(
|
|
1107
|
+
rmEventById: rmEventById(join15(path5)),
|
|
1049
1108
|
/**
|
|
1050
1109
|
* Moves a given event id to the version directory
|
|
1051
1110
|
* @param directory
|
|
1052
1111
|
*/
|
|
1053
|
-
versionEvent: versionEvent(
|
|
1112
|
+
versionEvent: versionEvent(join15(path5)),
|
|
1054
1113
|
/**
|
|
1055
1114
|
* Adds a file to the given event
|
|
1056
1115
|
* @param id - The id of the event to add the file to
|
|
@@ -1058,7 +1117,7 @@ var index_default = (path5) => {
|
|
|
1058
1117
|
* @param version - Optional version of the event to add the file to
|
|
1059
1118
|
* @returns
|
|
1060
1119
|
*/
|
|
1061
|
-
addFileToEvent: addFileToEvent(
|
|
1120
|
+
addFileToEvent: addFileToEvent(join15(path5)),
|
|
1062
1121
|
/**
|
|
1063
1122
|
* Adds a schema to the given event
|
|
1064
1123
|
* @param id - The id of the event to add the schema to
|
|
@@ -1066,14 +1125,14 @@ var index_default = (path5) => {
|
|
|
1066
1125
|
* @param version - Optional version of the event to add the schema to
|
|
1067
1126
|
* @returns
|
|
1068
1127
|
*/
|
|
1069
|
-
addSchemaToEvent: addSchemaToEvent(
|
|
1128
|
+
addSchemaToEvent: addSchemaToEvent(join15(path5)),
|
|
1070
1129
|
/**
|
|
1071
1130
|
* Check to see if an event version exists
|
|
1072
1131
|
* @param id - The id of the event
|
|
1073
1132
|
* @param version - The version of the event (supports semver)
|
|
1074
1133
|
* @returns
|
|
1075
1134
|
*/
|
|
1076
|
-
eventHasVersion: eventHasVersion(
|
|
1135
|
+
eventHasVersion: eventHasVersion(join15(path5)),
|
|
1077
1136
|
/**
|
|
1078
1137
|
* ================================
|
|
1079
1138
|
* Commands
|
|
@@ -1085,13 +1144,13 @@ var index_default = (path5) => {
|
|
|
1085
1144
|
* @param version - Optional id of the version to get (supports semver)
|
|
1086
1145
|
* @returns Command|Undefined
|
|
1087
1146
|
*/
|
|
1088
|
-
getCommand: getCommand(
|
|
1147
|
+
getCommand: getCommand(join15(path5)),
|
|
1089
1148
|
/**
|
|
1090
1149
|
* Returns all commands from EventCatalog
|
|
1091
1150
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1092
1151
|
* @returns Command[]|Undefined
|
|
1093
1152
|
*/
|
|
1094
|
-
getCommands: getCommands(
|
|
1153
|
+
getCommands: getCommands(join15(path5)),
|
|
1095
1154
|
/**
|
|
1096
1155
|
* Adds an command to EventCatalog
|
|
1097
1156
|
*
|
|
@@ -1099,7 +1158,7 @@ var index_default = (path5) => {
|
|
|
1099
1158
|
* @param options - Optional options to write the command
|
|
1100
1159
|
*
|
|
1101
1160
|
*/
|
|
1102
|
-
writeCommand: writeCommand(
|
|
1161
|
+
writeCommand: writeCommand(join15(path5, "commands")),
|
|
1103
1162
|
/**
|
|
1104
1163
|
* Adds a command to a service in EventCatalog
|
|
1105
1164
|
*
|
|
@@ -1108,26 +1167,26 @@ var index_default = (path5) => {
|
|
|
1108
1167
|
* @param options - Optional options to write the command
|
|
1109
1168
|
*
|
|
1110
1169
|
*/
|
|
1111
|
-
writeCommandToService: writeCommandToService(
|
|
1170
|
+
writeCommandToService: writeCommandToService(join15(path5)),
|
|
1112
1171
|
/**
|
|
1113
1172
|
* Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1114
1173
|
*
|
|
1115
1174
|
* @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
|
|
1116
1175
|
*
|
|
1117
1176
|
*/
|
|
1118
|
-
rmCommand: rmCommand(
|
|
1177
|
+
rmCommand: rmCommand(join15(path5, "commands")),
|
|
1119
1178
|
/**
|
|
1120
1179
|
* Remove an command by an Event id
|
|
1121
1180
|
*
|
|
1122
1181
|
* @param id - The id of the command you want to remove
|
|
1123
1182
|
*
|
|
1124
1183
|
*/
|
|
1125
|
-
rmCommandById: rmCommandById(
|
|
1184
|
+
rmCommandById: rmCommandById(join15(path5)),
|
|
1126
1185
|
/**
|
|
1127
1186
|
* Moves a given command id to the version directory
|
|
1128
1187
|
* @param directory
|
|
1129
1188
|
*/
|
|
1130
|
-
versionCommand: versionCommand(
|
|
1189
|
+
versionCommand: versionCommand(join15(path5)),
|
|
1131
1190
|
/**
|
|
1132
1191
|
* Adds a file to the given command
|
|
1133
1192
|
* @param id - The id of the command to add the file to
|
|
@@ -1135,7 +1194,7 @@ var index_default = (path5) => {
|
|
|
1135
1194
|
* @param version - Optional version of the command to add the file to
|
|
1136
1195
|
* @returns
|
|
1137
1196
|
*/
|
|
1138
|
-
addFileToCommand: addFileToCommand(
|
|
1197
|
+
addFileToCommand: addFileToCommand(join15(path5)),
|
|
1139
1198
|
/**
|
|
1140
1199
|
* Adds a schema to the given command
|
|
1141
1200
|
* @param id - The id of the command to add the schema to
|
|
@@ -1143,14 +1202,14 @@ var index_default = (path5) => {
|
|
|
1143
1202
|
* @param version - Optional version of the command to add the schema to
|
|
1144
1203
|
* @returns
|
|
1145
1204
|
*/
|
|
1146
|
-
addSchemaToCommand: addSchemaToCommand(
|
|
1205
|
+
addSchemaToCommand: addSchemaToCommand(join15(path5)),
|
|
1147
1206
|
/**
|
|
1148
1207
|
* Check to see if a command version exists
|
|
1149
1208
|
* @param id - The id of the command
|
|
1150
1209
|
* @param version - The version of the command (supports semver)
|
|
1151
1210
|
* @returns
|
|
1152
1211
|
*/
|
|
1153
|
-
commandHasVersion: commandHasVersion(
|
|
1212
|
+
commandHasVersion: commandHasVersion(join15(path5)),
|
|
1154
1213
|
/**
|
|
1155
1214
|
* ================================
|
|
1156
1215
|
* Queries
|
|
@@ -1162,13 +1221,13 @@ var index_default = (path5) => {
|
|
|
1162
1221
|
* @param version - Optional id of the version to get (supports semver)
|
|
1163
1222
|
* @returns Query|Undefined
|
|
1164
1223
|
*/
|
|
1165
|
-
getQuery: getQuery(
|
|
1224
|
+
getQuery: getQuery(join15(path5)),
|
|
1166
1225
|
/**
|
|
1167
1226
|
* Returns all queries from EventCatalog
|
|
1168
1227
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1169
1228
|
* @returns Query[]|Undefined
|
|
1170
1229
|
*/
|
|
1171
|
-
getQueries: getQueries(
|
|
1230
|
+
getQueries: getQueries(join15(path5)),
|
|
1172
1231
|
/**
|
|
1173
1232
|
* Adds a query to EventCatalog
|
|
1174
1233
|
*
|
|
@@ -1176,7 +1235,7 @@ var index_default = (path5) => {
|
|
|
1176
1235
|
* @param options - Optional options to write the event
|
|
1177
1236
|
*
|
|
1178
1237
|
*/
|
|
1179
|
-
writeQuery: writeQuery(
|
|
1238
|
+
writeQuery: writeQuery(join15(path5, "queries")),
|
|
1180
1239
|
/**
|
|
1181
1240
|
* Adds a query to a service in EventCatalog
|
|
1182
1241
|
*
|
|
@@ -1185,26 +1244,26 @@ var index_default = (path5) => {
|
|
|
1185
1244
|
* @param options - Optional options to write the query
|
|
1186
1245
|
*
|
|
1187
1246
|
*/
|
|
1188
|
-
writeQueryToService: writeQueryToService(
|
|
1247
|
+
writeQueryToService: writeQueryToService(join15(path5)),
|
|
1189
1248
|
/**
|
|
1190
1249
|
* Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1191
1250
|
*
|
|
1192
1251
|
* @param path - The path to your query, e.g. `/Orders/GetOrder`
|
|
1193
1252
|
*
|
|
1194
1253
|
*/
|
|
1195
|
-
rmQuery: rmQuery(
|
|
1254
|
+
rmQuery: rmQuery(join15(path5, "queries")),
|
|
1196
1255
|
/**
|
|
1197
1256
|
* Remove a query by a Query id
|
|
1198
1257
|
*
|
|
1199
1258
|
* @param id - The id of the query you want to remove
|
|
1200
1259
|
*
|
|
1201
1260
|
*/
|
|
1202
|
-
rmQueryById: rmQueryById(
|
|
1261
|
+
rmQueryById: rmQueryById(join15(path5)),
|
|
1203
1262
|
/**
|
|
1204
1263
|
* Moves a given query id to the version directory
|
|
1205
1264
|
* @param directory
|
|
1206
1265
|
*/
|
|
1207
|
-
versionQuery: versionQuery(
|
|
1266
|
+
versionQuery: versionQuery(join15(path5)),
|
|
1208
1267
|
/**
|
|
1209
1268
|
* Adds a file to the given query
|
|
1210
1269
|
* @param id - The id of the query to add the file to
|
|
@@ -1212,7 +1271,7 @@ var index_default = (path5) => {
|
|
|
1212
1271
|
* @param version - Optional version of the query to add the file to
|
|
1213
1272
|
* @returns
|
|
1214
1273
|
*/
|
|
1215
|
-
addFileToQuery: addFileToQuery(
|
|
1274
|
+
addFileToQuery: addFileToQuery(join15(path5)),
|
|
1216
1275
|
/**
|
|
1217
1276
|
* Adds a schema to the given query
|
|
1218
1277
|
* @param id - The id of the query to add the schema to
|
|
@@ -1220,14 +1279,14 @@ var index_default = (path5) => {
|
|
|
1220
1279
|
* @param version - Optional version of the query to add the schema to
|
|
1221
1280
|
* @returns
|
|
1222
1281
|
*/
|
|
1223
|
-
addSchemaToQuery: addSchemaToQuery(
|
|
1282
|
+
addSchemaToQuery: addSchemaToQuery(join15(path5)),
|
|
1224
1283
|
/**
|
|
1225
1284
|
* Check to see if an query version exists
|
|
1226
1285
|
* @param id - The id of the query
|
|
1227
1286
|
* @param version - The version of the query (supports semver)
|
|
1228
1287
|
* @returns
|
|
1229
1288
|
*/
|
|
1230
|
-
queryHasVersion: queryHasVersion(
|
|
1289
|
+
queryHasVersion: queryHasVersion(join15(path5)),
|
|
1231
1290
|
/**
|
|
1232
1291
|
* ================================
|
|
1233
1292
|
* Channels
|
|
@@ -1239,13 +1298,13 @@ var index_default = (path5) => {
|
|
|
1239
1298
|
* @param version - Optional id of the version to get (supports semver)
|
|
1240
1299
|
* @returns Channel|Undefined
|
|
1241
1300
|
*/
|
|
1242
|
-
getChannel: getChannel(
|
|
1301
|
+
getChannel: getChannel(join15(path5)),
|
|
1243
1302
|
/**
|
|
1244
1303
|
* Returns all channels from EventCatalog
|
|
1245
1304
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1246
1305
|
* @returns Channel[]|Undefined
|
|
1247
1306
|
*/
|
|
1248
|
-
getChannels: getChannels(
|
|
1307
|
+
getChannels: getChannels(join15(path5)),
|
|
1249
1308
|
/**
|
|
1250
1309
|
* Adds an channel to EventCatalog
|
|
1251
1310
|
*
|
|
@@ -1253,33 +1312,33 @@ var index_default = (path5) => {
|
|
|
1253
1312
|
* @param options - Optional options to write the channel
|
|
1254
1313
|
*
|
|
1255
1314
|
*/
|
|
1256
|
-
writeChannel: writeChannel(
|
|
1315
|
+
writeChannel: writeChannel(join15(path5, "channels")),
|
|
1257
1316
|
/**
|
|
1258
1317
|
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1259
1318
|
*
|
|
1260
1319
|
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1261
1320
|
*
|
|
1262
1321
|
*/
|
|
1263
|
-
rmChannel: rmChannel(
|
|
1322
|
+
rmChannel: rmChannel(join15(path5, "channels")),
|
|
1264
1323
|
/**
|
|
1265
1324
|
* Remove an channel by an Event id
|
|
1266
1325
|
*
|
|
1267
1326
|
* @param id - The id of the channel you want to remove
|
|
1268
1327
|
*
|
|
1269
1328
|
*/
|
|
1270
|
-
rmChannelById: rmChannelById(
|
|
1329
|
+
rmChannelById: rmChannelById(join15(path5)),
|
|
1271
1330
|
/**
|
|
1272
1331
|
* Moves a given channel id to the version directory
|
|
1273
1332
|
* @param directory
|
|
1274
1333
|
*/
|
|
1275
|
-
versionChannel: versionChannel(
|
|
1334
|
+
versionChannel: versionChannel(join15(path5)),
|
|
1276
1335
|
/**
|
|
1277
1336
|
* Check to see if a channel version exists
|
|
1278
1337
|
* @param id - The id of the channel
|
|
1279
1338
|
* @param version - The version of the channel (supports semver)
|
|
1280
1339
|
* @returns
|
|
1281
1340
|
*/
|
|
1282
|
-
channelHasVersion: channelHasVersion(
|
|
1341
|
+
channelHasVersion: channelHasVersion(join15(path5)),
|
|
1283
1342
|
/**
|
|
1284
1343
|
* Add a channel to an event
|
|
1285
1344
|
*
|
|
@@ -1296,7 +1355,7 @@ var index_default = (path5) => {
|
|
|
1296
1355
|
*
|
|
1297
1356
|
* ```
|
|
1298
1357
|
*/
|
|
1299
|
-
addEventToChannel: addMessageToChannel(
|
|
1358
|
+
addEventToChannel: addMessageToChannel(join15(path5), "events"),
|
|
1300
1359
|
/**
|
|
1301
1360
|
* Add a channel to an command
|
|
1302
1361
|
*
|
|
@@ -1313,7 +1372,7 @@ var index_default = (path5) => {
|
|
|
1313
1372
|
*
|
|
1314
1373
|
* ```
|
|
1315
1374
|
*/
|
|
1316
|
-
addCommandToChannel: addMessageToChannel(
|
|
1375
|
+
addCommandToChannel: addMessageToChannel(join15(path5), "commands"),
|
|
1317
1376
|
/**
|
|
1318
1377
|
* Add a channel to an query
|
|
1319
1378
|
*
|
|
@@ -1330,7 +1389,7 @@ var index_default = (path5) => {
|
|
|
1330
1389
|
*
|
|
1331
1390
|
* ```
|
|
1332
1391
|
*/
|
|
1333
|
-
addQueryToChannel: addMessageToChannel(
|
|
1392
|
+
addQueryToChannel: addMessageToChannel(join15(path5), "queries"),
|
|
1334
1393
|
/**
|
|
1335
1394
|
* ================================
|
|
1336
1395
|
* SERVICES
|
|
@@ -1343,14 +1402,14 @@ var index_default = (path5) => {
|
|
|
1343
1402
|
* @param options - Optional options to write the event
|
|
1344
1403
|
*
|
|
1345
1404
|
*/
|
|
1346
|
-
writeService: writeService(
|
|
1405
|
+
writeService: writeService(join15(path5, "services")),
|
|
1347
1406
|
/**
|
|
1348
1407
|
* Adds a versioned service to EventCatalog
|
|
1349
1408
|
*
|
|
1350
1409
|
* @param service - The service to write
|
|
1351
1410
|
*
|
|
1352
1411
|
*/
|
|
1353
|
-
writeVersionedService: writeVersionedService(
|
|
1412
|
+
writeVersionedService: writeVersionedService(join15(path5, "services")),
|
|
1354
1413
|
/**
|
|
1355
1414
|
* Adds a service to a domain in EventCatalog
|
|
1356
1415
|
*
|
|
@@ -1359,45 +1418,45 @@ var index_default = (path5) => {
|
|
|
1359
1418
|
* @param options - Optional options to write the event
|
|
1360
1419
|
*
|
|
1361
1420
|
*/
|
|
1362
|
-
writeServiceToDomain: writeServiceToDomain(
|
|
1421
|
+
writeServiceToDomain: writeServiceToDomain(join15(path5, "domains")),
|
|
1363
1422
|
/**
|
|
1364
1423
|
* Returns a service from EventCatalog
|
|
1365
1424
|
* @param id - The id of the service to retrieve
|
|
1366
1425
|
* @param version - Optional id of the version to get (supports semver)
|
|
1367
1426
|
* @returns Service|Undefined
|
|
1368
1427
|
*/
|
|
1369
|
-
getService: getService(
|
|
1428
|
+
getService: getService(join15(path5)),
|
|
1370
1429
|
/**
|
|
1371
1430
|
* Returns a service from EventCatalog by it's path.
|
|
1372
1431
|
* @param path - The path to the service to retrieve
|
|
1373
1432
|
* @returns Service|Undefined
|
|
1374
1433
|
*/
|
|
1375
|
-
getServiceByPath: getServiceByPath(
|
|
1434
|
+
getServiceByPath: getServiceByPath(join15(path5)),
|
|
1376
1435
|
/**
|
|
1377
1436
|
* Returns all services from EventCatalog
|
|
1378
1437
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1379
1438
|
* @returns Service[]|Undefined
|
|
1380
1439
|
*/
|
|
1381
|
-
getServices: getServices(
|
|
1440
|
+
getServices: getServices(join15(path5)),
|
|
1382
1441
|
/**
|
|
1383
1442
|
* Moves a given service id to the version directory
|
|
1384
1443
|
* @param directory
|
|
1385
1444
|
*/
|
|
1386
|
-
versionService: versionService(
|
|
1445
|
+
versionService: versionService(join15(path5)),
|
|
1387
1446
|
/**
|
|
1388
1447
|
* Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1389
1448
|
*
|
|
1390
1449
|
* @param path - The path to your service, e.g. `/InventoryService`
|
|
1391
1450
|
*
|
|
1392
1451
|
*/
|
|
1393
|
-
rmService: rmService(
|
|
1452
|
+
rmService: rmService(join15(path5, "services")),
|
|
1394
1453
|
/**
|
|
1395
1454
|
* Remove an service by an service id
|
|
1396
1455
|
*
|
|
1397
1456
|
* @param id - The id of the service you want to remove
|
|
1398
1457
|
*
|
|
1399
1458
|
*/
|
|
1400
|
-
rmServiceById: rmServiceById(
|
|
1459
|
+
rmServiceById: rmServiceById(join15(path5)),
|
|
1401
1460
|
/**
|
|
1402
1461
|
* Adds a file to the given service
|
|
1403
1462
|
* @param id - The id of the service to add the file to
|
|
@@ -1405,21 +1464,21 @@ var index_default = (path5) => {
|
|
|
1405
1464
|
* @param version - Optional version of the service to add the file to
|
|
1406
1465
|
* @returns
|
|
1407
1466
|
*/
|
|
1408
|
-
addFileToService: addFileToService(
|
|
1467
|
+
addFileToService: addFileToService(join15(path5)),
|
|
1409
1468
|
/**
|
|
1410
1469
|
* Returns the specifications for a given service
|
|
1411
1470
|
* @param id - The id of the service to retrieve the specifications for
|
|
1412
1471
|
* @param version - Optional version of the service
|
|
1413
1472
|
* @returns
|
|
1414
1473
|
*/
|
|
1415
|
-
getSpecificationFilesForService: getSpecificationFilesForService(
|
|
1474
|
+
getSpecificationFilesForService: getSpecificationFilesForService(join15(path5)),
|
|
1416
1475
|
/**
|
|
1417
1476
|
* Check to see if a service version exists
|
|
1418
1477
|
* @param id - The id of the service
|
|
1419
1478
|
* @param version - The version of the service (supports semver)
|
|
1420
1479
|
* @returns
|
|
1421
1480
|
*/
|
|
1422
|
-
serviceHasVersion: serviceHasVersion(
|
|
1481
|
+
serviceHasVersion: serviceHasVersion(join15(path5)),
|
|
1423
1482
|
/**
|
|
1424
1483
|
* Add an event to a service by it's id.
|
|
1425
1484
|
*
|
|
@@ -1439,7 +1498,7 @@ var index_default = (path5) => {
|
|
|
1439
1498
|
*
|
|
1440
1499
|
* ```
|
|
1441
1500
|
*/
|
|
1442
|
-
addEventToService: addMessageToService(
|
|
1501
|
+
addEventToService: addMessageToService(join15(path5)),
|
|
1443
1502
|
/**
|
|
1444
1503
|
* Add a command to a service by it's id.
|
|
1445
1504
|
*
|
|
@@ -1459,7 +1518,7 @@ var index_default = (path5) => {
|
|
|
1459
1518
|
*
|
|
1460
1519
|
* ```
|
|
1461
1520
|
*/
|
|
1462
|
-
addCommandToService: addMessageToService(
|
|
1521
|
+
addCommandToService: addMessageToService(join15(path5)),
|
|
1463
1522
|
/**
|
|
1464
1523
|
* Add a query to a service by it's id.
|
|
1465
1524
|
*
|
|
@@ -1479,7 +1538,25 @@ var index_default = (path5) => {
|
|
|
1479
1538
|
*
|
|
1480
1539
|
* ```
|
|
1481
1540
|
*/
|
|
1482
|
-
addQueryToService: addMessageToService(
|
|
1541
|
+
addQueryToService: addMessageToService(join15(path5)),
|
|
1542
|
+
/**
|
|
1543
|
+
* Add an entity to a service by its id.
|
|
1544
|
+
*
|
|
1545
|
+
* @example
|
|
1546
|
+
* ```ts
|
|
1547
|
+
* import utils from '@eventcatalog/utils';
|
|
1548
|
+
*
|
|
1549
|
+
* const { addEntityToService } = utils('/path/to/eventcatalog');
|
|
1550
|
+
*
|
|
1551
|
+
* // adds a new entity (User) to the InventoryService
|
|
1552
|
+
* await addEntityToService('InventoryService', { id: 'User', version: '1.0.0' });
|
|
1553
|
+
*
|
|
1554
|
+
* // adds a new entity (Product) to a specific version of the InventoryService
|
|
1555
|
+
* await addEntityToService('InventoryService', { id: 'Product', version: '1.0.0' }, '2.0.0');
|
|
1556
|
+
*
|
|
1557
|
+
* ```
|
|
1558
|
+
*/
|
|
1559
|
+
addEntityToService: addEntityToService(join15(path5)),
|
|
1483
1560
|
/**
|
|
1484
1561
|
* Check to see if a service exists by it's path.
|
|
1485
1562
|
*
|
|
@@ -1496,13 +1573,13 @@ var index_default = (path5) => {
|
|
|
1496
1573
|
* @param path - The path to the service to check
|
|
1497
1574
|
* @returns boolean
|
|
1498
1575
|
*/
|
|
1499
|
-
isService: isService(
|
|
1576
|
+
isService: isService(join15(path5)),
|
|
1500
1577
|
/**
|
|
1501
1578
|
* Converts a file to a service.
|
|
1502
1579
|
* @param file - The file to convert to a service.
|
|
1503
1580
|
* @returns The service.
|
|
1504
1581
|
*/
|
|
1505
|
-
toService: toService(
|
|
1582
|
+
toService: toService(join15(path5)),
|
|
1506
1583
|
/**
|
|
1507
1584
|
* ================================
|
|
1508
1585
|
* Domains
|
|
@@ -1515,39 +1592,39 @@ var index_default = (path5) => {
|
|
|
1515
1592
|
* @param options - Optional options to write the event
|
|
1516
1593
|
*
|
|
1517
1594
|
*/
|
|
1518
|
-
writeDomain: writeDomain(
|
|
1595
|
+
writeDomain: writeDomain(join15(path5, "domains")),
|
|
1519
1596
|
/**
|
|
1520
1597
|
* Returns a domain from EventCatalog
|
|
1521
1598
|
* @param id - The id of the domain to retrieve
|
|
1522
1599
|
* @param version - Optional id of the version to get (supports semver)
|
|
1523
1600
|
* @returns Domain|Undefined
|
|
1524
1601
|
*/
|
|
1525
|
-
getDomain: getDomain(
|
|
1602
|
+
getDomain: getDomain(join15(path5, "domains")),
|
|
1526
1603
|
/**
|
|
1527
1604
|
* Returns all domains from EventCatalog
|
|
1528
1605
|
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1529
1606
|
* @returns Domain[]|Undefined
|
|
1530
1607
|
*/
|
|
1531
|
-
getDomains: getDomains(
|
|
1608
|
+
getDomains: getDomains(join15(path5)),
|
|
1532
1609
|
/**
|
|
1533
1610
|
* Moves a given domain id to the version directory
|
|
1534
1611
|
* @param directory
|
|
1535
1612
|
*/
|
|
1536
|
-
versionDomain: versionDomain(
|
|
1613
|
+
versionDomain: versionDomain(join15(path5, "domains")),
|
|
1537
1614
|
/**
|
|
1538
1615
|
* Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1539
1616
|
*
|
|
1540
1617
|
* @param path - The path to your domain, e.g. `/Payment`
|
|
1541
1618
|
*
|
|
1542
1619
|
*/
|
|
1543
|
-
rmDomain: rmDomain(
|
|
1620
|
+
rmDomain: rmDomain(join15(path5, "domains")),
|
|
1544
1621
|
/**
|
|
1545
1622
|
* Remove an service by an domain id
|
|
1546
1623
|
*
|
|
1547
1624
|
* @param id - The id of the domain you want to remove
|
|
1548
1625
|
*
|
|
1549
1626
|
*/
|
|
1550
|
-
rmDomainById: rmDomainById(
|
|
1627
|
+
rmDomainById: rmDomainById(join15(path5, "domains")),
|
|
1551
1628
|
/**
|
|
1552
1629
|
* Adds a file to the given domain
|
|
1553
1630
|
* @param id - The id of the domain to add the file to
|
|
@@ -1555,28 +1632,28 @@ var index_default = (path5) => {
|
|
|
1555
1632
|
* @param version - Optional version of the domain to add the file to
|
|
1556
1633
|
* @returns
|
|
1557
1634
|
*/
|
|
1558
|
-
addFileToDomain: addFileToDomain(
|
|
1635
|
+
addFileToDomain: addFileToDomain(join15(path5, "domains")),
|
|
1559
1636
|
/**
|
|
1560
1637
|
* Adds an ubiquitous language dictionary to a domain
|
|
1561
1638
|
* @param id - The id of the domain to add the ubiquitous language to
|
|
1562
1639
|
* @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
|
|
1563
1640
|
* @param version - Optional version of the domain to add the ubiquitous language to
|
|
1564
1641
|
*/
|
|
1565
|
-
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(
|
|
1642
|
+
addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join15(path5, "domains")),
|
|
1566
1643
|
/**
|
|
1567
1644
|
* Get the ubiquitous language dictionary from a domain
|
|
1568
1645
|
* @param id - The id of the domain to get the ubiquitous language from
|
|
1569
1646
|
* @param version - Optional version of the domain to get the ubiquitous language from
|
|
1570
1647
|
* @returns
|
|
1571
1648
|
*/
|
|
1572
|
-
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(
|
|
1649
|
+
getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join15(path5, "domains")),
|
|
1573
1650
|
/**
|
|
1574
1651
|
* Check to see if a domain version exists
|
|
1575
1652
|
* @param id - The id of the domain
|
|
1576
1653
|
* @param version - The version of the domain (supports semver)
|
|
1577
1654
|
* @returns
|
|
1578
1655
|
*/
|
|
1579
|
-
domainHasVersion: domainHasVersion(
|
|
1656
|
+
domainHasVersion: domainHasVersion(join15(path5)),
|
|
1580
1657
|
/**
|
|
1581
1658
|
* Adds a given service to a domain
|
|
1582
1659
|
* @param id - The id of the domain
|
|
@@ -1584,7 +1661,7 @@ var index_default = (path5) => {
|
|
|
1584
1661
|
* @param version - (Optional) The version of the domain to add the service to
|
|
1585
1662
|
* @returns
|
|
1586
1663
|
*/
|
|
1587
|
-
addServiceToDomain: addServiceToDomain(
|
|
1664
|
+
addServiceToDomain: addServiceToDomain(join15(path5, "domains")),
|
|
1588
1665
|
/**
|
|
1589
1666
|
* Adds a given subdomain to a domain
|
|
1590
1667
|
* @param id - The id of the domain
|
|
@@ -1592,7 +1669,15 @@ var index_default = (path5) => {
|
|
|
1592
1669
|
* @param version - (Optional) The version of the domain to add the subdomain to
|
|
1593
1670
|
* @returns
|
|
1594
1671
|
*/
|
|
1595
|
-
addSubDomainToDomain: addSubDomainToDomain(
|
|
1672
|
+
addSubDomainToDomain: addSubDomainToDomain(join15(path5, "domains")),
|
|
1673
|
+
/**
|
|
1674
|
+
* Adds an entity to a domain
|
|
1675
|
+
* @param id - The id of the domain
|
|
1676
|
+
* @param entity - The id and version of the entity to add
|
|
1677
|
+
* @param version - (Optional) The version of the domain to add the entity to
|
|
1678
|
+
* @returns
|
|
1679
|
+
*/
|
|
1680
|
+
addEntityToDomain: addEntityToDomain(join15(path5, "domains")),
|
|
1596
1681
|
/**
|
|
1597
1682
|
* ================================
|
|
1598
1683
|
* Teams
|
|
@@ -1605,25 +1690,25 @@ var index_default = (path5) => {
|
|
|
1605
1690
|
* @param options - Optional options to write the team
|
|
1606
1691
|
*
|
|
1607
1692
|
*/
|
|
1608
|
-
writeTeam: writeTeam(
|
|
1693
|
+
writeTeam: writeTeam(join15(path5, "teams")),
|
|
1609
1694
|
/**
|
|
1610
1695
|
* Returns a team from EventCatalog
|
|
1611
1696
|
* @param id - The id of the team to retrieve
|
|
1612
1697
|
* @returns Team|Undefined
|
|
1613
1698
|
*/
|
|
1614
|
-
getTeam: getTeam(
|
|
1699
|
+
getTeam: getTeam(join15(path5, "teams")),
|
|
1615
1700
|
/**
|
|
1616
1701
|
* Returns all teams from EventCatalog
|
|
1617
1702
|
* @returns Team[]|Undefined
|
|
1618
1703
|
*/
|
|
1619
|
-
getTeams: getTeams(
|
|
1704
|
+
getTeams: getTeams(join15(path5, "teams")),
|
|
1620
1705
|
/**
|
|
1621
1706
|
* Remove a team by the team id
|
|
1622
1707
|
*
|
|
1623
1708
|
* @param id - The id of the team you want to remove
|
|
1624
1709
|
*
|
|
1625
1710
|
*/
|
|
1626
|
-
rmTeamById: rmTeamById(
|
|
1711
|
+
rmTeamById: rmTeamById(join15(path5, "teams")),
|
|
1627
1712
|
/**
|
|
1628
1713
|
* ================================
|
|
1629
1714
|
* Users
|
|
@@ -1636,25 +1721,25 @@ var index_default = (path5) => {
|
|
|
1636
1721
|
* @param options - Optional options to write the user
|
|
1637
1722
|
*
|
|
1638
1723
|
*/
|
|
1639
|
-
writeUser: writeUser(
|
|
1724
|
+
writeUser: writeUser(join15(path5, "users")),
|
|
1640
1725
|
/**
|
|
1641
1726
|
* Returns a user from EventCatalog
|
|
1642
1727
|
* @param id - The id of the user to retrieve
|
|
1643
1728
|
* @returns User|Undefined
|
|
1644
1729
|
*/
|
|
1645
|
-
getUser: getUser(
|
|
1730
|
+
getUser: getUser(join15(path5, "users")),
|
|
1646
1731
|
/**
|
|
1647
1732
|
* Returns all user from EventCatalog
|
|
1648
1733
|
* @returns User[]|Undefined
|
|
1649
1734
|
*/
|
|
1650
|
-
getUsers: getUsers(
|
|
1735
|
+
getUsers: getUsers(join15(path5)),
|
|
1651
1736
|
/**
|
|
1652
1737
|
* Remove a user by the user id
|
|
1653
1738
|
*
|
|
1654
1739
|
* @param id - The id of the user you want to remove
|
|
1655
1740
|
*
|
|
1656
1741
|
*/
|
|
1657
|
-
rmUserById: rmUserById(
|
|
1742
|
+
rmUserById: rmUserById(join15(path5, "users")),
|
|
1658
1743
|
/**
|
|
1659
1744
|
* ================================
|
|
1660
1745
|
* Custom Docs
|
|
@@ -1665,32 +1750,32 @@ var index_default = (path5) => {
|
|
|
1665
1750
|
* @param path - The path to the custom doc to retrieve
|
|
1666
1751
|
* @returns CustomDoc|Undefined
|
|
1667
1752
|
*/
|
|
1668
|
-
getCustomDoc: getCustomDoc(
|
|
1753
|
+
getCustomDoc: getCustomDoc(join15(path5, "docs")),
|
|
1669
1754
|
/**
|
|
1670
1755
|
* Returns all custom docs from EventCatalog
|
|
1671
1756
|
* @param options - Optional options to get custom docs from a specific path
|
|
1672
1757
|
* @returns CustomDoc[]|Undefined
|
|
1673
1758
|
*/
|
|
1674
|
-
getCustomDocs: getCustomDocs(
|
|
1759
|
+
getCustomDocs: getCustomDocs(join15(path5, "docs")),
|
|
1675
1760
|
/**
|
|
1676
1761
|
* Writes a custom doc to EventCatalog
|
|
1677
1762
|
* @param customDoc - The custom doc to write
|
|
1678
1763
|
* @param options - Optional options to write the custom doc
|
|
1679
1764
|
*
|
|
1680
1765
|
*/
|
|
1681
|
-
writeCustomDoc: writeCustomDoc(
|
|
1766
|
+
writeCustomDoc: writeCustomDoc(join15(path5, "docs")),
|
|
1682
1767
|
/**
|
|
1683
1768
|
* Removes a custom doc from EventCatalog
|
|
1684
1769
|
* @param path - The path to the custom doc to remove
|
|
1685
1770
|
*
|
|
1686
1771
|
*/
|
|
1687
|
-
rmCustomDoc: rmCustomDoc(
|
|
1772
|
+
rmCustomDoc: rmCustomDoc(join15(path5, "docs")),
|
|
1688
1773
|
/**
|
|
1689
1774
|
* Dumps the catalog to a JSON file.
|
|
1690
1775
|
* @param directory - The directory to dump the catalog to
|
|
1691
1776
|
* @returns A JSON file with the catalog
|
|
1692
1777
|
*/
|
|
1693
|
-
dumpCatalog: dumpCatalog(
|
|
1778
|
+
dumpCatalog: dumpCatalog(join15(path5)),
|
|
1694
1779
|
/**
|
|
1695
1780
|
* Returns the event catalog configuration file.
|
|
1696
1781
|
* The event catalog configuration file is the file that contains the configuration for the event catalog.
|
|
@@ -1698,7 +1783,7 @@ var index_default = (path5) => {
|
|
|
1698
1783
|
* @param directory - The directory of the catalog.
|
|
1699
1784
|
* @returns A JSON object with the configuration for the event catalog.
|
|
1700
1785
|
*/
|
|
1701
|
-
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(
|
|
1786
|
+
getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join15(path5)),
|
|
1702
1787
|
/**
|
|
1703
1788
|
* ================================
|
|
1704
1789
|
* Resources Utils
|
|
@@ -1719,33 +1804,85 @@ var index_default = (path5) => {
|
|
|
1719
1804
|
* @param path - The path to the message to retrieve
|
|
1720
1805
|
* @returns Message|Undefined
|
|
1721
1806
|
*/
|
|
1722
|
-
getMessageBySchemaPath: getMessageBySchemaPath(
|
|
1807
|
+
getMessageBySchemaPath: getMessageBySchemaPath(join15(path5)),
|
|
1723
1808
|
/**
|
|
1724
1809
|
* Returns the producers and consumers (services) for a given message
|
|
1725
1810
|
* @param id - The id of the message to get the producers and consumers for
|
|
1726
1811
|
* @param version - Optional version of the message
|
|
1727
1812
|
* @returns { producers: Service[], consumers: Service[] }
|
|
1728
1813
|
*/
|
|
1729
|
-
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(
|
|
1814
|
+
getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join15(path5)),
|
|
1730
1815
|
/**
|
|
1731
1816
|
* Returns the consumers of a given schema path
|
|
1732
1817
|
* @param path - The path to the schema to get the consumers for
|
|
1733
1818
|
* @returns Service[]
|
|
1734
1819
|
*/
|
|
1735
|
-
getConsumersOfSchema: getConsumersOfSchema(
|
|
1820
|
+
getConsumersOfSchema: getConsumersOfSchema(join15(path5)),
|
|
1736
1821
|
/**
|
|
1737
1822
|
* Returns the producers of a given schema path
|
|
1738
1823
|
* @param path - The path to the schema to get the producers for
|
|
1739
1824
|
* @returns Service[]
|
|
1740
1825
|
*/
|
|
1741
|
-
getProducersOfSchema: getProducersOfSchema(
|
|
1826
|
+
getProducersOfSchema: getProducersOfSchema(join15(path5)),
|
|
1742
1827
|
/**
|
|
1743
1828
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
1744
1829
|
* @param id - The id of the resource to get the owners for
|
|
1745
1830
|
* @param version - Optional version of the resource
|
|
1746
1831
|
* @returns { owners: User[] }
|
|
1747
1832
|
*/
|
|
1748
|
-
getOwnersForResource: getOwnersForResource(
|
|
1833
|
+
getOwnersForResource: getOwnersForResource(join15(path5)),
|
|
1834
|
+
/**
|
|
1835
|
+
* ================================
|
|
1836
|
+
* Entities
|
|
1837
|
+
* ================================
|
|
1838
|
+
*/
|
|
1839
|
+
/**
|
|
1840
|
+
* Returns an entity from EventCatalog
|
|
1841
|
+
* @param id - The id of the entity to retrieve
|
|
1842
|
+
* @param version - Optional id of the version to get (supports semver)
|
|
1843
|
+
* @returns Entity|Undefined
|
|
1844
|
+
*/
|
|
1845
|
+
getEntity: getEntity(join15(path5)),
|
|
1846
|
+
/**
|
|
1847
|
+
* Returns all entities from EventCatalog
|
|
1848
|
+
* @param latestOnly - optional boolean, set to true to get only latest versions
|
|
1849
|
+
* @returns Entity[]|Undefined
|
|
1850
|
+
*/
|
|
1851
|
+
getEntities: getEntities(join15(path5)),
|
|
1852
|
+
/**
|
|
1853
|
+
* Adds an entity to EventCatalog
|
|
1854
|
+
*
|
|
1855
|
+
* @param entity - The entity to write
|
|
1856
|
+
* @param options - Optional options to write the entity
|
|
1857
|
+
*
|
|
1858
|
+
*/
|
|
1859
|
+
writeEntity: writeEntity(join15(path5, "entities")),
|
|
1860
|
+
/**
|
|
1861
|
+
* Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
|
|
1862
|
+
*
|
|
1863
|
+
* @param path - The path to your entity, e.g. `/User`
|
|
1864
|
+
*
|
|
1865
|
+
*/
|
|
1866
|
+
rmEntity: rmEntity(join15(path5, "entities")),
|
|
1867
|
+
/**
|
|
1868
|
+
* Remove an entity by an entity id
|
|
1869
|
+
*
|
|
1870
|
+
* @param id - The id of the entity you want to remove
|
|
1871
|
+
*
|
|
1872
|
+
*/
|
|
1873
|
+
rmEntityById: rmEntityById(join15(path5)),
|
|
1874
|
+
/**
|
|
1875
|
+
* Moves a given entity id to the version directory
|
|
1876
|
+
* @param id - The id of the entity to version
|
|
1877
|
+
*/
|
|
1878
|
+
versionEntity: versionEntity(join15(path5)),
|
|
1879
|
+
/**
|
|
1880
|
+
* Check to see if an entity version exists
|
|
1881
|
+
* @param id - The id of the entity
|
|
1882
|
+
* @param version - The version of the entity (supports semver)
|
|
1883
|
+
* @returns
|
|
1884
|
+
*/
|
|
1885
|
+
entityHasVersion: entityHasVersion(join15(path5))
|
|
1749
1886
|
};
|
|
1750
1887
|
};
|
|
1751
1888
|
export {
|