@eventcatalog/sdk 2.10.0 → 2.12.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.
Files changed (108) 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} +691 -347
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/{eventcatalog.mjs → cli/index.mjs} +765 -401
  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 +1513 -0
  11. package/dist/cli-docs.js.map +1 -0
  12. package/dist/cli-docs.mjs +1485 -0
  13. package/dist/cli-docs.mjs.map +1 -0
  14. package/dist/index.d.mts +504 -4
  15. package/dist/index.d.ts +504 -4
  16. package/dist/index.js +325 -108
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +325 -108
  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-stores.d.mts +0 -179
  46. package/dist/data-stores.d.ts +0 -179
  47. package/dist/data-stores.js +0 -401
  48. package/dist/data-stores.js.map +0 -1
  49. package/dist/data-stores.mjs +0 -356
  50. package/dist/data-stores.mjs.map +0 -1
  51. package/dist/domains.d.mts +0 -297
  52. package/dist/domains.d.ts +0 -297
  53. package/dist/domains.js +0 -480
  54. package/dist/domains.js.map +0 -1
  55. package/dist/domains.mjs +0 -433
  56. package/dist/domains.mjs.map +0 -1
  57. package/dist/entities.d.mts +0 -174
  58. package/dist/entities.d.ts +0 -174
  59. package/dist/entities.js +0 -348
  60. package/dist/entities.js.map +0 -1
  61. package/dist/entities.mjs +0 -307
  62. package/dist/entities.mjs.map +0 -1
  63. package/dist/eventcatalog.d.mts +0 -21
  64. package/dist/eventcatalog.d.ts +0 -21
  65. package/dist/eventcatalog.js.map +0 -1
  66. package/dist/eventcatalog.mjs.map +0 -1
  67. package/dist/events.d.mts +0 -276
  68. package/dist/events.d.ts +0 -276
  69. package/dist/events.js +0 -393
  70. package/dist/events.js.map +0 -1
  71. package/dist/events.mjs +0 -349
  72. package/dist/events.mjs.map +0 -1
  73. package/dist/messages.d.mts +0 -65
  74. package/dist/messages.d.ts +0 -65
  75. package/dist/messages.js +0 -312
  76. package/dist/messages.js.map +0 -1
  77. package/dist/messages.mjs +0 -269
  78. package/dist/messages.mjs.map +0 -1
  79. package/dist/queries.d.mts +0 -276
  80. package/dist/queries.d.ts +0 -276
  81. package/dist/queries.js +0 -394
  82. package/dist/queries.js.map +0 -1
  83. package/dist/queries.mjs +0 -350
  84. package/dist/queries.mjs.map +0 -1
  85. package/dist/services.d.mts +0 -384
  86. package/dist/services.d.ts +0 -384
  87. package/dist/services.js +0 -577
  88. package/dist/services.js.map +0 -1
  89. package/dist/services.mjs +0 -526
  90. package/dist/services.mjs.map +0 -1
  91. package/dist/teams.d.mts +0 -90
  92. package/dist/teams.d.ts +0 -90
  93. package/dist/teams.js +0 -246
  94. package/dist/teams.js.map +0 -1
  95. package/dist/teams.mjs +0 -202
  96. package/dist/teams.mjs.map +0 -1
  97. package/dist/types.d.d.mts +0 -304
  98. package/dist/types.d.d.ts +0 -304
  99. package/dist/types.d.js +0 -19
  100. package/dist/types.d.js.map +0 -1
  101. package/dist/types.d.mjs +0 -1
  102. package/dist/types.d.mjs.map +0 -1
  103. package/dist/users.d.mts +0 -83
  104. package/dist/users.d.ts +0 -83
  105. package/dist/users.js +0 -127
  106. package/dist/users.js.map +0 -1
  107. package/dist/users.mjs +0 -88
  108. package/dist/users.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- import { join as join16 } from "node:path";
2
+ import { join as join17 } from "node:path";
3
3
 
4
4
  // src/events.ts
5
5
  import fs2 from "node:fs/promises";
@@ -651,6 +651,15 @@ var writeDomain = (directory) => async (domain, options = {
651
651
  if (Array.isArray(domain.domains)) {
652
652
  resource.domains = uniqueVersions(domain.domains);
653
653
  }
654
+ if (Array.isArray(domain.sends)) {
655
+ resource.sends = uniqueVersions(domain.sends);
656
+ }
657
+ if (Array.isArray(domain.receives)) {
658
+ resource.receives = uniqueVersions(domain.receives);
659
+ }
660
+ if (Array.isArray(domain.dataProducts)) {
661
+ resource.dataProducts = uniqueVersions(domain.dataProducts);
662
+ }
654
663
  return await writeResource(directory, resource, { ...options, type: "domain" });
655
664
  };
656
665
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
@@ -724,6 +733,60 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
724
733
  await rmDomainById(directory)(id, version, true);
725
734
  await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
726
735
  };
736
+ var addDataProductToDomain = (directory) => async (id, dataProduct, version) => {
737
+ let domain = await getDomain(directory)(id, version);
738
+ const domainPath = await getResourcePath(directory, id, version);
739
+ const extension = path2.extname(domainPath?.fullPath || "");
740
+ if (domain.dataProducts === void 0) {
741
+ domain.dataProducts = [];
742
+ }
743
+ const dataProductExistsInList = domain.dataProducts.some(
744
+ (dp) => dp.id === dataProduct.id && dp.version === dataProduct.version
745
+ );
746
+ if (dataProductExistsInList) {
747
+ return;
748
+ }
749
+ domain.dataProducts.push(dataProduct);
750
+ await rmDomainById(directory)(id, version, true);
751
+ await writeDomain(directory)(domain, { format: extension === ".md" ? "md" : "mdx" });
752
+ };
753
+ var addMessageToDomain = (directory) => async (id, direction, message, version) => {
754
+ let domain = await getDomain(directory)(id, version);
755
+ const domainPath = await getResourcePath(directory, id, version);
756
+ const extension = path2.extname(domainPath?.fullPath || "");
757
+ if (direction === "sends") {
758
+ if (domain.sends === void 0) {
759
+ domain.sends = [];
760
+ }
761
+ for (let i = 0; i < domain.sends.length; i++) {
762
+ if (domain.sends[i].id === message.id && domain.sends[i].version === message.version) {
763
+ return;
764
+ }
765
+ }
766
+ domain.sends.push({ id: message.id, version: message.version });
767
+ } else if (direction === "receives") {
768
+ if (domain.receives === void 0) {
769
+ domain.receives = [];
770
+ }
771
+ for (let i = 0; i < domain.receives.length; i++) {
772
+ if (domain.receives[i].id === message.id && domain.receives[i].version === message.version) {
773
+ return;
774
+ }
775
+ }
776
+ domain.receives.push({ id: message.id, version: message.version });
777
+ } else {
778
+ throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
779
+ }
780
+ const existingResource = await findFileById(directory, id, version);
781
+ if (!existingResource) {
782
+ throw new Error(`Cannot find domain ${id} in the catalog`);
783
+ }
784
+ const normalizedPath = existingResource.replace(/\\/g, "/");
785
+ const lastDomainsIndex = normalizedPath.lastIndexOf("/domains/");
786
+ const pathToResource = existingResource.substring(0, lastDomainsIndex + "/domains".length);
787
+ await rmDomainById(directory)(id, version, true);
788
+ await writeDomain(pathToResource)(domain, { format: extension === ".md" ? "md" : "mdx" });
789
+ };
727
790
 
728
791
  // src/channels.ts
729
792
  import fs7 from "node:fs/promises";
@@ -1187,6 +1250,34 @@ var dataStoreHasVersion = containerHasVersion;
1187
1250
  var addFileToDataStore = addFileToContainer;
1188
1251
  var writeDataStoreToService = writeContainerToService;
1189
1252
 
1253
+ // src/data-products.ts
1254
+ import fs13 from "node:fs/promises";
1255
+ import { join as join16 } from "node:path";
1256
+ var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
1257
+ var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
1258
+ var writeDataProduct = (directory) => async (dataProduct, options = {
1259
+ path: "",
1260
+ override: false,
1261
+ format: "mdx"
1262
+ }) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
1263
+ var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
1264
+ let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
1265
+ pathForDataProduct = join16(pathForDataProduct, dataProduct.id);
1266
+ await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
1267
+ };
1268
+ var rmDataProduct = (directory) => async (path6) => {
1269
+ await fs13.rm(join16(directory, path6), { recursive: true });
1270
+ };
1271
+ var rmDataProductById = (directory) => async (id, version, persistFiles) => {
1272
+ await rmResourceById(directory, id, version, { type: "data-product", persistFiles });
1273
+ };
1274
+ var versionDataProduct = (directory) => async (id) => versionResource(directory, id);
1275
+ var dataProductHasVersion = (directory) => async (id, version) => {
1276
+ const file = await findFileById(directory, id, version);
1277
+ return !!file;
1278
+ };
1279
+ var addFileToDataProduct = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
1280
+
1190
1281
  // src/index.ts
1191
1282
  var src_default = (path6) => {
1192
1283
  return {
@@ -1196,13 +1287,13 @@ var src_default = (path6) => {
1196
1287
  * @param version - Optional id of the version to get (supports semver)
1197
1288
  * @returns Event|Undefined
1198
1289
  */
1199
- getEvent: getEvent(join16(path6)),
1290
+ getEvent: getEvent(join17(path6)),
1200
1291
  /**
1201
1292
  * Returns all events from EventCatalog
1202
1293
  * @param latestOnly - optional boolean, set to true to get only latest versions
1203
1294
  * @returns Event[]|Undefined
1204
1295
  */
1205
- getEvents: getEvents(join16(path6)),
1296
+ getEvents: getEvents(join17(path6)),
1206
1297
  /**
1207
1298
  * Adds an event to EventCatalog
1208
1299
  *
@@ -1210,7 +1301,7 @@ var src_default = (path6) => {
1210
1301
  * @param options - Optional options to write the event
1211
1302
  *
1212
1303
  */
1213
- writeEvent: writeEvent(join16(path6, "events")),
1304
+ writeEvent: writeEvent(join17(path6, "events")),
1214
1305
  /**
1215
1306
  * Adds an event to a service in EventCatalog
1216
1307
  *
@@ -1219,26 +1310,26 @@ var src_default = (path6) => {
1219
1310
  * @param options - Optional options to write the event
1220
1311
  *
1221
1312
  */
1222
- writeEventToService: writeEventToService(join16(path6)),
1313
+ writeEventToService: writeEventToService(join17(path6)),
1223
1314
  /**
1224
1315
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
1225
1316
  *
1226
1317
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
1227
1318
  *
1228
1319
  */
1229
- rmEvent: rmEvent(join16(path6, "events")),
1320
+ rmEvent: rmEvent(join17(path6, "events")),
1230
1321
  /**
1231
1322
  * Remove an event by an Event id
1232
1323
  *
1233
1324
  * @param id - The id of the event you want to remove
1234
1325
  *
1235
1326
  */
1236
- rmEventById: rmEventById(join16(path6)),
1327
+ rmEventById: rmEventById(join17(path6)),
1237
1328
  /**
1238
1329
  * Moves a given event id to the version directory
1239
1330
  * @param directory
1240
1331
  */
1241
- versionEvent: versionEvent(join16(path6)),
1332
+ versionEvent: versionEvent(join17(path6)),
1242
1333
  /**
1243
1334
  * Adds a file to the given event
1244
1335
  * @param id - The id of the event to add the file to
@@ -1246,7 +1337,7 @@ var src_default = (path6) => {
1246
1337
  * @param version - Optional version of the event to add the file to
1247
1338
  * @returns
1248
1339
  */
1249
- addFileToEvent: addFileToEvent(join16(path6)),
1340
+ addFileToEvent: addFileToEvent(join17(path6)),
1250
1341
  /**
1251
1342
  * Adds a schema to the given event
1252
1343
  * @param id - The id of the event to add the schema to
@@ -1254,14 +1345,14 @@ var src_default = (path6) => {
1254
1345
  * @param version - Optional version of the event to add the schema to
1255
1346
  * @returns
1256
1347
  */
1257
- addSchemaToEvent: addSchemaToEvent(join16(path6)),
1348
+ addSchemaToEvent: addSchemaToEvent(join17(path6)),
1258
1349
  /**
1259
1350
  * Check to see if an event version exists
1260
1351
  * @param id - The id of the event
1261
1352
  * @param version - The version of the event (supports semver)
1262
1353
  * @returns
1263
1354
  */
1264
- eventHasVersion: eventHasVersion(join16(path6)),
1355
+ eventHasVersion: eventHasVersion(join17(path6)),
1265
1356
  /**
1266
1357
  * ================================
1267
1358
  * Commands
@@ -1273,13 +1364,13 @@ var src_default = (path6) => {
1273
1364
  * @param version - Optional id of the version to get (supports semver)
1274
1365
  * @returns Command|Undefined
1275
1366
  */
1276
- getCommand: getCommand(join16(path6)),
1367
+ getCommand: getCommand(join17(path6)),
1277
1368
  /**
1278
1369
  * Returns all commands from EventCatalog
1279
1370
  * @param latestOnly - optional boolean, set to true to get only latest versions
1280
1371
  * @returns Command[]|Undefined
1281
1372
  */
1282
- getCommands: getCommands(join16(path6)),
1373
+ getCommands: getCommands(join17(path6)),
1283
1374
  /**
1284
1375
  * Adds an command to EventCatalog
1285
1376
  *
@@ -1287,7 +1378,7 @@ var src_default = (path6) => {
1287
1378
  * @param options - Optional options to write the command
1288
1379
  *
1289
1380
  */
1290
- writeCommand: writeCommand(join16(path6, "commands")),
1381
+ writeCommand: writeCommand(join17(path6, "commands")),
1291
1382
  /**
1292
1383
  * Adds a command to a service in EventCatalog
1293
1384
  *
@@ -1296,26 +1387,26 @@ var src_default = (path6) => {
1296
1387
  * @param options - Optional options to write the command
1297
1388
  *
1298
1389
  */
1299
- writeCommandToService: writeCommandToService(join16(path6)),
1390
+ writeCommandToService: writeCommandToService(join17(path6)),
1300
1391
  /**
1301
1392
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
1302
1393
  *
1303
1394
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
1304
1395
  *
1305
1396
  */
1306
- rmCommand: rmCommand(join16(path6, "commands")),
1397
+ rmCommand: rmCommand(join17(path6, "commands")),
1307
1398
  /**
1308
1399
  * Remove an command by an Event id
1309
1400
  *
1310
1401
  * @param id - The id of the command you want to remove
1311
1402
  *
1312
1403
  */
1313
- rmCommandById: rmCommandById(join16(path6)),
1404
+ rmCommandById: rmCommandById(join17(path6)),
1314
1405
  /**
1315
1406
  * Moves a given command id to the version directory
1316
1407
  * @param directory
1317
1408
  */
1318
- versionCommand: versionCommand(join16(path6)),
1409
+ versionCommand: versionCommand(join17(path6)),
1319
1410
  /**
1320
1411
  * Adds a file to the given command
1321
1412
  * @param id - The id of the command to add the file to
@@ -1323,7 +1414,7 @@ var src_default = (path6) => {
1323
1414
  * @param version - Optional version of the command to add the file to
1324
1415
  * @returns
1325
1416
  */
1326
- addFileToCommand: addFileToCommand(join16(path6)),
1417
+ addFileToCommand: addFileToCommand(join17(path6)),
1327
1418
  /**
1328
1419
  * Adds a schema to the given command
1329
1420
  * @param id - The id of the command to add the schema to
@@ -1331,14 +1422,14 @@ var src_default = (path6) => {
1331
1422
  * @param version - Optional version of the command to add the schema to
1332
1423
  * @returns
1333
1424
  */
1334
- addSchemaToCommand: addSchemaToCommand(join16(path6)),
1425
+ addSchemaToCommand: addSchemaToCommand(join17(path6)),
1335
1426
  /**
1336
1427
  * Check to see if a command version exists
1337
1428
  * @param id - The id of the command
1338
1429
  * @param version - The version of the command (supports semver)
1339
1430
  * @returns
1340
1431
  */
1341
- commandHasVersion: commandHasVersion(join16(path6)),
1432
+ commandHasVersion: commandHasVersion(join17(path6)),
1342
1433
  /**
1343
1434
  * ================================
1344
1435
  * Queries
@@ -1350,13 +1441,13 @@ var src_default = (path6) => {
1350
1441
  * @param version - Optional id of the version to get (supports semver)
1351
1442
  * @returns Query|Undefined
1352
1443
  */
1353
- getQuery: getQuery(join16(path6)),
1444
+ getQuery: getQuery(join17(path6)),
1354
1445
  /**
1355
1446
  * Returns all queries from EventCatalog
1356
1447
  * @param latestOnly - optional boolean, set to true to get only latest versions
1357
1448
  * @returns Query[]|Undefined
1358
1449
  */
1359
- getQueries: getQueries(join16(path6)),
1450
+ getQueries: getQueries(join17(path6)),
1360
1451
  /**
1361
1452
  * Adds a query to EventCatalog
1362
1453
  *
@@ -1364,7 +1455,7 @@ var src_default = (path6) => {
1364
1455
  * @param options - Optional options to write the event
1365
1456
  *
1366
1457
  */
1367
- writeQuery: writeQuery(join16(path6, "queries")),
1458
+ writeQuery: writeQuery(join17(path6, "queries")),
1368
1459
  /**
1369
1460
  * Adds a query to a service in EventCatalog
1370
1461
  *
@@ -1373,26 +1464,26 @@ var src_default = (path6) => {
1373
1464
  * @param options - Optional options to write the query
1374
1465
  *
1375
1466
  */
1376
- writeQueryToService: writeQueryToService(join16(path6)),
1467
+ writeQueryToService: writeQueryToService(join17(path6)),
1377
1468
  /**
1378
1469
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
1379
1470
  *
1380
1471
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
1381
1472
  *
1382
1473
  */
1383
- rmQuery: rmQuery(join16(path6, "queries")),
1474
+ rmQuery: rmQuery(join17(path6, "queries")),
1384
1475
  /**
1385
1476
  * Remove a query by a Query id
1386
1477
  *
1387
1478
  * @param id - The id of the query you want to remove
1388
1479
  *
1389
1480
  */
1390
- rmQueryById: rmQueryById(join16(path6)),
1481
+ rmQueryById: rmQueryById(join17(path6)),
1391
1482
  /**
1392
1483
  * Moves a given query id to the version directory
1393
1484
  * @param directory
1394
1485
  */
1395
- versionQuery: versionQuery(join16(path6)),
1486
+ versionQuery: versionQuery(join17(path6)),
1396
1487
  /**
1397
1488
  * Adds a file to the given query
1398
1489
  * @param id - The id of the query to add the file to
@@ -1400,7 +1491,7 @@ var src_default = (path6) => {
1400
1491
  * @param version - Optional version of the query to add the file to
1401
1492
  * @returns
1402
1493
  */
1403
- addFileToQuery: addFileToQuery(join16(path6)),
1494
+ addFileToQuery: addFileToQuery(join17(path6)),
1404
1495
  /**
1405
1496
  * Adds a schema to the given query
1406
1497
  * @param id - The id of the query to add the schema to
@@ -1408,14 +1499,14 @@ var src_default = (path6) => {
1408
1499
  * @param version - Optional version of the query to add the schema to
1409
1500
  * @returns
1410
1501
  */
1411
- addSchemaToQuery: addSchemaToQuery(join16(path6)),
1502
+ addSchemaToQuery: addSchemaToQuery(join17(path6)),
1412
1503
  /**
1413
1504
  * Check to see if an query version exists
1414
1505
  * @param id - The id of the query
1415
1506
  * @param version - The version of the query (supports semver)
1416
1507
  * @returns
1417
1508
  */
1418
- queryHasVersion: queryHasVersion(join16(path6)),
1509
+ queryHasVersion: queryHasVersion(join17(path6)),
1419
1510
  /**
1420
1511
  * ================================
1421
1512
  * Channels
@@ -1427,13 +1518,13 @@ var src_default = (path6) => {
1427
1518
  * @param version - Optional id of the version to get (supports semver)
1428
1519
  * @returns Channel|Undefined
1429
1520
  */
1430
- getChannel: getChannel(join16(path6)),
1521
+ getChannel: getChannel(join17(path6)),
1431
1522
  /**
1432
1523
  * Returns all channels from EventCatalog
1433
1524
  * @param latestOnly - optional boolean, set to true to get only latest versions
1434
1525
  * @returns Channel[]|Undefined
1435
1526
  */
1436
- getChannels: getChannels(join16(path6)),
1527
+ getChannels: getChannels(join17(path6)),
1437
1528
  /**
1438
1529
  * Adds an channel to EventCatalog
1439
1530
  *
@@ -1441,33 +1532,33 @@ var src_default = (path6) => {
1441
1532
  * @param options - Optional options to write the channel
1442
1533
  *
1443
1534
  */
1444
- writeChannel: writeChannel(join16(path6, "channels")),
1535
+ writeChannel: writeChannel(join17(path6, "channels")),
1445
1536
  /**
1446
1537
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
1447
1538
  *
1448
1539
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
1449
1540
  *
1450
1541
  */
1451
- rmChannel: rmChannel(join16(path6, "channels")),
1542
+ rmChannel: rmChannel(join17(path6, "channels")),
1452
1543
  /**
1453
1544
  * Remove an channel by an Event id
1454
1545
  *
1455
1546
  * @param id - The id of the channel you want to remove
1456
1547
  *
1457
1548
  */
1458
- rmChannelById: rmChannelById(join16(path6)),
1549
+ rmChannelById: rmChannelById(join17(path6)),
1459
1550
  /**
1460
1551
  * Moves a given channel id to the version directory
1461
1552
  * @param directory
1462
1553
  */
1463
- versionChannel: versionChannel(join16(path6)),
1554
+ versionChannel: versionChannel(join17(path6)),
1464
1555
  /**
1465
1556
  * Check to see if a channel version exists
1466
1557
  * @param id - The id of the channel
1467
1558
  * @param version - The version of the channel (supports semver)
1468
1559
  * @returns
1469
1560
  */
1470
- channelHasVersion: channelHasVersion(join16(path6)),
1561
+ channelHasVersion: channelHasVersion(join17(path6)),
1471
1562
  /**
1472
1563
  * Add a channel to an event
1473
1564
  *
@@ -1484,7 +1575,7 @@ var src_default = (path6) => {
1484
1575
  *
1485
1576
  * ```
1486
1577
  */
1487
- addEventToChannel: addMessageToChannel(join16(path6), "events"),
1578
+ addEventToChannel: addMessageToChannel(join17(path6), "events"),
1488
1579
  /**
1489
1580
  * Add a channel to an command
1490
1581
  *
@@ -1501,7 +1592,7 @@ var src_default = (path6) => {
1501
1592
  *
1502
1593
  * ```
1503
1594
  */
1504
- addCommandToChannel: addMessageToChannel(join16(path6), "commands"),
1595
+ addCommandToChannel: addMessageToChannel(join17(path6), "commands"),
1505
1596
  /**
1506
1597
  * Add a channel to an query
1507
1598
  *
@@ -1518,7 +1609,7 @@ var src_default = (path6) => {
1518
1609
  *
1519
1610
  * ```
1520
1611
  */
1521
- addQueryToChannel: addMessageToChannel(join16(path6), "queries"),
1612
+ addQueryToChannel: addMessageToChannel(join17(path6), "queries"),
1522
1613
  /**
1523
1614
  * ================================
1524
1615
  * SERVICES
@@ -1531,14 +1622,14 @@ var src_default = (path6) => {
1531
1622
  * @param options - Optional options to write the event
1532
1623
  *
1533
1624
  */
1534
- writeService: writeService(join16(path6, "services")),
1625
+ writeService: writeService(join17(path6, "services")),
1535
1626
  /**
1536
1627
  * Adds a versioned service to EventCatalog
1537
1628
  *
1538
1629
  * @param service - The service to write
1539
1630
  *
1540
1631
  */
1541
- writeVersionedService: writeVersionedService(join16(path6, "services")),
1632
+ writeVersionedService: writeVersionedService(join17(path6, "services")),
1542
1633
  /**
1543
1634
  * Adds a service to a domain in EventCatalog
1544
1635
  *
@@ -1547,45 +1638,45 @@ var src_default = (path6) => {
1547
1638
  * @param options - Optional options to write the event
1548
1639
  *
1549
1640
  */
1550
- writeServiceToDomain: writeServiceToDomain(join16(path6, "domains")),
1641
+ writeServiceToDomain: writeServiceToDomain(join17(path6, "domains")),
1551
1642
  /**
1552
1643
  * Returns a service from EventCatalog
1553
1644
  * @param id - The id of the service to retrieve
1554
1645
  * @param version - Optional id of the version to get (supports semver)
1555
1646
  * @returns Service|Undefined
1556
1647
  */
1557
- getService: getService(join16(path6)),
1648
+ getService: getService(join17(path6)),
1558
1649
  /**
1559
1650
  * Returns a service from EventCatalog by it's path.
1560
1651
  * @param path - The path to the service to retrieve
1561
1652
  * @returns Service|Undefined
1562
1653
  */
1563
- getServiceByPath: getServiceByPath(join16(path6)),
1654
+ getServiceByPath: getServiceByPath(join17(path6)),
1564
1655
  /**
1565
1656
  * Returns all services from EventCatalog
1566
1657
  * @param latestOnly - optional boolean, set to true to get only latest versions
1567
1658
  * @returns Service[]|Undefined
1568
1659
  */
1569
- getServices: getServices(join16(path6)),
1660
+ getServices: getServices(join17(path6)),
1570
1661
  /**
1571
1662
  * Moves a given service id to the version directory
1572
1663
  * @param directory
1573
1664
  */
1574
- versionService: versionService(join16(path6)),
1665
+ versionService: versionService(join17(path6)),
1575
1666
  /**
1576
1667
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
1577
1668
  *
1578
1669
  * @param path - The path to your service, e.g. `/InventoryService`
1579
1670
  *
1580
1671
  */
1581
- rmService: rmService(join16(path6, "services")),
1672
+ rmService: rmService(join17(path6, "services")),
1582
1673
  /**
1583
1674
  * Remove an service by an service id
1584
1675
  *
1585
1676
  * @param id - The id of the service you want to remove
1586
1677
  *
1587
1678
  */
1588
- rmServiceById: rmServiceById(join16(path6)),
1679
+ rmServiceById: rmServiceById(join17(path6)),
1589
1680
  /**
1590
1681
  * Adds a file to the given service
1591
1682
  * @param id - The id of the service to add the file to
@@ -1593,21 +1684,21 @@ var src_default = (path6) => {
1593
1684
  * @param version - Optional version of the service to add the file to
1594
1685
  * @returns
1595
1686
  */
1596
- addFileToService: addFileToService(join16(path6)),
1687
+ addFileToService: addFileToService(join17(path6)),
1597
1688
  /**
1598
1689
  * Returns the specifications for a given service
1599
1690
  * @param id - The id of the service to retrieve the specifications for
1600
1691
  * @param version - Optional version of the service
1601
1692
  * @returns
1602
1693
  */
1603
- getSpecificationFilesForService: getSpecificationFilesForService(join16(path6)),
1694
+ getSpecificationFilesForService: getSpecificationFilesForService(join17(path6)),
1604
1695
  /**
1605
1696
  * Check to see if a service version exists
1606
1697
  * @param id - The id of the service
1607
1698
  * @param version - The version of the service (supports semver)
1608
1699
  * @returns
1609
1700
  */
1610
- serviceHasVersion: serviceHasVersion(join16(path6)),
1701
+ serviceHasVersion: serviceHasVersion(join17(path6)),
1611
1702
  /**
1612
1703
  * Add an event to a service by it's id.
1613
1704
  *
@@ -1627,7 +1718,7 @@ var src_default = (path6) => {
1627
1718
  *
1628
1719
  * ```
1629
1720
  */
1630
- addEventToService: addMessageToService(join16(path6)),
1721
+ addEventToService: addMessageToService(join17(path6)),
1631
1722
  /**
1632
1723
  * Add a data store to a service by it's id.
1633
1724
  *
@@ -1644,7 +1735,7 @@ var src_default = (path6) => {
1644
1735
  *
1645
1736
  * ```
1646
1737
  */
1647
- addDataStoreToService: addDataStoreToService(join16(path6)),
1738
+ addDataStoreToService: addDataStoreToService(join17(path6)),
1648
1739
  /**
1649
1740
  * Add a command to a service by it's id.
1650
1741
  *
@@ -1664,7 +1755,7 @@ var src_default = (path6) => {
1664
1755
  *
1665
1756
  * ```
1666
1757
  */
1667
- addCommandToService: addMessageToService(join16(path6)),
1758
+ addCommandToService: addMessageToService(join17(path6)),
1668
1759
  /**
1669
1760
  * Add a query to a service by it's id.
1670
1761
  *
@@ -1684,7 +1775,7 @@ var src_default = (path6) => {
1684
1775
  *
1685
1776
  * ```
1686
1777
  */
1687
- addQueryToService: addMessageToService(join16(path6)),
1778
+ addQueryToService: addMessageToService(join17(path6)),
1688
1779
  /**
1689
1780
  * Add an entity to a service by its id.
1690
1781
  *
@@ -1702,7 +1793,7 @@ var src_default = (path6) => {
1702
1793
  *
1703
1794
  * ```
1704
1795
  */
1705
- addEntityToService: addEntityToService(join16(path6)),
1796
+ addEntityToService: addEntityToService(join17(path6)),
1706
1797
  /**
1707
1798
  * Check to see if a service exists by it's path.
1708
1799
  *
@@ -1719,13 +1810,13 @@ var src_default = (path6) => {
1719
1810
  * @param path - The path to the service to check
1720
1811
  * @returns boolean
1721
1812
  */
1722
- isService: isService(join16(path6)),
1813
+ isService: isService(join17(path6)),
1723
1814
  /**
1724
1815
  * Converts a file to a service.
1725
1816
  * @param file - The file to convert to a service.
1726
1817
  * @returns The service.
1727
1818
  */
1728
- toService: toService(join16(path6)),
1819
+ toService: toService(join17(path6)),
1729
1820
  /**
1730
1821
  * ================================
1731
1822
  * Domains
@@ -1738,39 +1829,39 @@ var src_default = (path6) => {
1738
1829
  * @param options - Optional options to write the event
1739
1830
  *
1740
1831
  */
1741
- writeDomain: writeDomain(join16(path6, "domains")),
1832
+ writeDomain: writeDomain(join17(path6, "domains")),
1742
1833
  /**
1743
1834
  * Returns a domain from EventCatalog
1744
1835
  * @param id - The id of the domain to retrieve
1745
1836
  * @param version - Optional id of the version to get (supports semver)
1746
1837
  * @returns Domain|Undefined
1747
1838
  */
1748
- getDomain: getDomain(join16(path6, "domains")),
1839
+ getDomain: getDomain(join17(path6, "domains")),
1749
1840
  /**
1750
1841
  * Returns all domains from EventCatalog
1751
1842
  * @param latestOnly - optional boolean, set to true to get only latest versions
1752
1843
  * @returns Domain[]|Undefined
1753
1844
  */
1754
- getDomains: getDomains(join16(path6)),
1845
+ getDomains: getDomains(join17(path6)),
1755
1846
  /**
1756
1847
  * Moves a given domain id to the version directory
1757
1848
  * @param directory
1758
1849
  */
1759
- versionDomain: versionDomain(join16(path6, "domains")),
1850
+ versionDomain: versionDomain(join17(path6, "domains")),
1760
1851
  /**
1761
1852
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
1762
1853
  *
1763
1854
  * @param path - The path to your domain, e.g. `/Payment`
1764
1855
  *
1765
1856
  */
1766
- rmDomain: rmDomain(join16(path6, "domains")),
1857
+ rmDomain: rmDomain(join17(path6, "domains")),
1767
1858
  /**
1768
1859
  * Remove an service by an domain id
1769
1860
  *
1770
1861
  * @param id - The id of the domain you want to remove
1771
1862
  *
1772
1863
  */
1773
- rmDomainById: rmDomainById(join16(path6, "domains")),
1864
+ rmDomainById: rmDomainById(join17(path6, "domains")),
1774
1865
  /**
1775
1866
  * Adds a file to the given domain
1776
1867
  * @param id - The id of the domain to add the file to
@@ -1778,28 +1869,28 @@ var src_default = (path6) => {
1778
1869
  * @param version - Optional version of the domain to add the file to
1779
1870
  * @returns
1780
1871
  */
1781
- addFileToDomain: addFileToDomain(join16(path6, "domains")),
1872
+ addFileToDomain: addFileToDomain(join17(path6, "domains")),
1782
1873
  /**
1783
1874
  * Adds an ubiquitous language dictionary to a domain
1784
1875
  * @param id - The id of the domain to add the ubiquitous language to
1785
1876
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
1786
1877
  * @param version - Optional version of the domain to add the ubiquitous language to
1787
1878
  */
1788
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join16(path6, "domains")),
1879
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain(join17(path6, "domains")),
1789
1880
  /**
1790
1881
  * Get the ubiquitous language dictionary from a domain
1791
1882
  * @param id - The id of the domain to get the ubiquitous language from
1792
1883
  * @param version - Optional version of the domain to get the ubiquitous language from
1793
1884
  * @returns
1794
1885
  */
1795
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join16(path6, "domains")),
1886
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain(join17(path6, "domains")),
1796
1887
  /**
1797
1888
  * Check to see if a domain version exists
1798
1889
  * @param id - The id of the domain
1799
1890
  * @param version - The version of the domain (supports semver)
1800
1891
  * @returns
1801
1892
  */
1802
- domainHasVersion: domainHasVersion(join16(path6)),
1893
+ domainHasVersion: domainHasVersion(join17(path6)),
1803
1894
  /**
1804
1895
  * Adds a given service to a domain
1805
1896
  * @param id - The id of the domain
@@ -1807,7 +1898,7 @@ var src_default = (path6) => {
1807
1898
  * @param version - (Optional) The version of the domain to add the service to
1808
1899
  * @returns
1809
1900
  */
1810
- addServiceToDomain: addServiceToDomain(join16(path6, "domains")),
1901
+ addServiceToDomain: addServiceToDomain(join17(path6, "domains")),
1811
1902
  /**
1812
1903
  * Adds a given subdomain to a domain
1813
1904
  * @param id - The id of the domain
@@ -1815,7 +1906,7 @@ var src_default = (path6) => {
1815
1906
  * @param version - (Optional) The version of the domain to add the subdomain to
1816
1907
  * @returns
1817
1908
  */
1818
- addSubDomainToDomain: addSubDomainToDomain(join16(path6, "domains")),
1909
+ addSubDomainToDomain: addSubDomainToDomain(join17(path6, "domains")),
1819
1910
  /**
1820
1911
  * Adds an entity to a domain
1821
1912
  * @param id - The id of the domain
@@ -1823,7 +1914,61 @@ var src_default = (path6) => {
1823
1914
  * @param version - (Optional) The version of the domain to add the entity to
1824
1915
  * @returns
1825
1916
  */
1826
- addEntityToDomain: addEntityToDomain(join16(path6, "domains")),
1917
+ addEntityToDomain: addEntityToDomain(join17(path6, "domains")),
1918
+ /**
1919
+ * Add an event to a domain by its id.
1920
+ *
1921
+ * @example
1922
+ * ```ts
1923
+ * import utils from '@eventcatalog/utils';
1924
+ *
1925
+ * const { addEventToDomain } = utils('/path/to/eventcatalog');
1926
+ *
1927
+ * // adds a new event (OrderCreated) that the Orders domain will send
1928
+ * await addEventToDomain('Orders', 'sends', { id: 'OrderCreated', version: '2.0.0' });
1929
+ *
1930
+ * // adds a new event (PaymentProcessed) that the Orders domain will receive
1931
+ * await addEventToDomain('Orders', 'receives', { id: 'PaymentProcessed', version: '2.0.0' });
1932
+ *
1933
+ * ```
1934
+ */
1935
+ addEventToDomain: addMessageToDomain(join17(path6, "domains")),
1936
+ /**
1937
+ * Add a command to a domain by its id.
1938
+ *
1939
+ * @example
1940
+ * ```ts
1941
+ * import utils from '@eventcatalog/utils';
1942
+ *
1943
+ * const { addCommandToDomain } = utils('/path/to/eventcatalog');
1944
+ *
1945
+ * // adds a new command (ProcessOrder) that the Orders domain will send
1946
+ * await addCommandToDomain('Orders', 'sends', { id: 'ProcessOrder', version: '2.0.0' });
1947
+ *
1948
+ * // adds a new command (CancelOrder) that the Orders domain will receive
1949
+ * await addCommandToDomain('Orders', 'receives', { id: 'CancelOrder', version: '2.0.0' });
1950
+ *
1951
+ * ```
1952
+ */
1953
+ addCommandToDomain: addMessageToDomain(join17(path6, "domains")),
1954
+ /**
1955
+ * Add a query to a domain by its id.
1956
+ *
1957
+ * @example
1958
+ * ```ts
1959
+ * import utils from '@eventcatalog/utils';
1960
+ *
1961
+ * const { addQueryToDomain } = utils('/path/to/eventcatalog');
1962
+ *
1963
+ * // adds a new query (GetOrderStatus) that the Orders domain will send
1964
+ * await addQueryToDomain('Orders', 'sends', { id: 'GetOrderStatus', version: '2.0.0' });
1965
+ *
1966
+ * // adds a new query (GetInventory) that the Orders domain will receive
1967
+ * await addQueryToDomain('Orders', 'receives', { id: 'GetInventory', version: '2.0.0' });
1968
+ *
1969
+ * ```
1970
+ */
1971
+ addQueryToDomain: addMessageToDomain(join17(path6, "domains")),
1827
1972
  /**
1828
1973
  * ================================
1829
1974
  * Teams
@@ -1836,25 +1981,25 @@ var src_default = (path6) => {
1836
1981
  * @param options - Optional options to write the team
1837
1982
  *
1838
1983
  */
1839
- writeTeam: writeTeam(join16(path6, "teams")),
1984
+ writeTeam: writeTeam(join17(path6, "teams")),
1840
1985
  /**
1841
1986
  * Returns a team from EventCatalog
1842
1987
  * @param id - The id of the team to retrieve
1843
1988
  * @returns Team|Undefined
1844
1989
  */
1845
- getTeam: getTeam(join16(path6, "teams")),
1990
+ getTeam: getTeam(join17(path6, "teams")),
1846
1991
  /**
1847
1992
  * Returns all teams from EventCatalog
1848
1993
  * @returns Team[]|Undefined
1849
1994
  */
1850
- getTeams: getTeams(join16(path6, "teams")),
1995
+ getTeams: getTeams(join17(path6, "teams")),
1851
1996
  /**
1852
1997
  * Remove a team by the team id
1853
1998
  *
1854
1999
  * @param id - The id of the team you want to remove
1855
2000
  *
1856
2001
  */
1857
- rmTeamById: rmTeamById(join16(path6, "teams")),
2002
+ rmTeamById: rmTeamById(join17(path6, "teams")),
1858
2003
  /**
1859
2004
  * ================================
1860
2005
  * Users
@@ -1867,25 +2012,25 @@ var src_default = (path6) => {
1867
2012
  * @param options - Optional options to write the user
1868
2013
  *
1869
2014
  */
1870
- writeUser: writeUser(join16(path6, "users")),
2015
+ writeUser: writeUser(join17(path6, "users")),
1871
2016
  /**
1872
2017
  * Returns a user from EventCatalog
1873
2018
  * @param id - The id of the user to retrieve
1874
2019
  * @returns User|Undefined
1875
2020
  */
1876
- getUser: getUser(join16(path6, "users")),
2021
+ getUser: getUser(join17(path6, "users")),
1877
2022
  /**
1878
2023
  * Returns all user from EventCatalog
1879
2024
  * @returns User[]|Undefined
1880
2025
  */
1881
- getUsers: getUsers(join16(path6)),
2026
+ getUsers: getUsers(join17(path6)),
1882
2027
  /**
1883
2028
  * Remove a user by the user id
1884
2029
  *
1885
2030
  * @param id - The id of the user you want to remove
1886
2031
  *
1887
2032
  */
1888
- rmUserById: rmUserById(join16(path6, "users")),
2033
+ rmUserById: rmUserById(join17(path6, "users")),
1889
2034
  /**
1890
2035
  * ================================
1891
2036
  * Custom Docs
@@ -1896,32 +2041,32 @@ var src_default = (path6) => {
1896
2041
  * @param path - The path to the custom doc to retrieve
1897
2042
  * @returns CustomDoc|Undefined
1898
2043
  */
1899
- getCustomDoc: getCustomDoc(join16(path6, "docs")),
2044
+ getCustomDoc: getCustomDoc(join17(path6, "docs")),
1900
2045
  /**
1901
2046
  * Returns all custom docs from EventCatalog
1902
2047
  * @param options - Optional options to get custom docs from a specific path
1903
2048
  * @returns CustomDoc[]|Undefined
1904
2049
  */
1905
- getCustomDocs: getCustomDocs(join16(path6, "docs")),
2050
+ getCustomDocs: getCustomDocs(join17(path6, "docs")),
1906
2051
  /**
1907
2052
  * Writes a custom doc to EventCatalog
1908
2053
  * @param customDoc - The custom doc to write
1909
2054
  * @param options - Optional options to write the custom doc
1910
2055
  *
1911
2056
  */
1912
- writeCustomDoc: writeCustomDoc(join16(path6, "docs")),
2057
+ writeCustomDoc: writeCustomDoc(join17(path6, "docs")),
1913
2058
  /**
1914
2059
  * Removes a custom doc from EventCatalog
1915
2060
  * @param path - The path to the custom doc to remove
1916
2061
  *
1917
2062
  */
1918
- rmCustomDoc: rmCustomDoc(join16(path6, "docs")),
2063
+ rmCustomDoc: rmCustomDoc(join17(path6, "docs")),
1919
2064
  /**
1920
2065
  * Dumps the catalog to a JSON file.
1921
2066
  * @param directory - The directory to dump the catalog to
1922
2067
  * @returns A JSON file with the catalog
1923
2068
  */
1924
- dumpCatalog: dumpCatalog(join16(path6)),
2069
+ dumpCatalog: dumpCatalog(join17(path6)),
1925
2070
  /**
1926
2071
  * Returns the event catalog configuration file.
1927
2072
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -1929,7 +2074,7 @@ var src_default = (path6) => {
1929
2074
  * @param directory - The directory of the catalog.
1930
2075
  * @returns A JSON object with the configuration for the event catalog.
1931
2076
  */
1932
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join16(path6)),
2077
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile(join17(path6)),
1933
2078
  /**
1934
2079
  * ================================
1935
2080
  * Resources Utils
@@ -1954,33 +2099,33 @@ var src_default = (path6) => {
1954
2099
  * @param path - The path to the message to retrieve
1955
2100
  * @returns Message|Undefined
1956
2101
  */
1957
- getMessageBySchemaPath: getMessageBySchemaPath(join16(path6)),
2102
+ getMessageBySchemaPath: getMessageBySchemaPath(join17(path6)),
1958
2103
  /**
1959
2104
  * Returns the producers and consumers (services) for a given message
1960
2105
  * @param id - The id of the message to get the producers and consumers for
1961
2106
  * @param version - Optional version of the message
1962
2107
  * @returns { producers: Service[], consumers: Service[] }
1963
2108
  */
1964
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join16(path6)),
2109
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage(join17(path6)),
1965
2110
  /**
1966
2111
  * Returns the consumers of a given schema path
1967
2112
  * @param path - The path to the schema to get the consumers for
1968
2113
  * @returns Service[]
1969
2114
  */
1970
- getConsumersOfSchema: getConsumersOfSchema(join16(path6)),
2115
+ getConsumersOfSchema: getConsumersOfSchema(join17(path6)),
1971
2116
  /**
1972
2117
  * Returns the producers of a given schema path
1973
2118
  * @param path - The path to the schema to get the producers for
1974
2119
  * @returns Service[]
1975
2120
  */
1976
- getProducersOfSchema: getProducersOfSchema(join16(path6)),
2121
+ getProducersOfSchema: getProducersOfSchema(join17(path6)),
1977
2122
  /**
1978
2123
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
1979
2124
  * @param id - The id of the resource to get the owners for
1980
2125
  * @param version - Optional version of the resource
1981
2126
  * @returns { owners: User[] }
1982
2127
  */
1983
- getOwnersForResource: getOwnersForResource(join16(path6)),
2128
+ getOwnersForResource: getOwnersForResource(join17(path6)),
1984
2129
  /**
1985
2130
  * ================================
1986
2131
  * Entities
@@ -1992,13 +2137,13 @@ var src_default = (path6) => {
1992
2137
  * @param version - Optional id of the version to get (supports semver)
1993
2138
  * @returns Entity|Undefined
1994
2139
  */
1995
- getEntity: getEntity(join16(path6)),
2140
+ getEntity: getEntity(join17(path6)),
1996
2141
  /**
1997
2142
  * Returns all entities from EventCatalog
1998
2143
  * @param latestOnly - optional boolean, set to true to get only latest versions
1999
2144
  * @returns Entity[]|Undefined
2000
2145
  */
2001
- getEntities: getEntities(join16(path6)),
2146
+ getEntities: getEntities(join17(path6)),
2002
2147
  /**
2003
2148
  * Adds an entity to EventCatalog
2004
2149
  *
@@ -2006,33 +2151,33 @@ var src_default = (path6) => {
2006
2151
  * @param options - Optional options to write the entity
2007
2152
  *
2008
2153
  */
2009
- writeEntity: writeEntity(join16(path6, "entities")),
2154
+ writeEntity: writeEntity(join17(path6, "entities")),
2010
2155
  /**
2011
2156
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
2012
2157
  *
2013
2158
  * @param path - The path to your entity, e.g. `/User`
2014
2159
  *
2015
2160
  */
2016
- rmEntity: rmEntity(join16(path6, "entities")),
2161
+ rmEntity: rmEntity(join17(path6, "entities")),
2017
2162
  /**
2018
2163
  * Remove an entity by an entity id
2019
2164
  *
2020
2165
  * @param id - The id of the entity you want to remove
2021
2166
  *
2022
2167
  */
2023
- rmEntityById: rmEntityById(join16(path6)),
2168
+ rmEntityById: rmEntityById(join17(path6)),
2024
2169
  /**
2025
2170
  * Moves a given entity id to the version directory
2026
2171
  * @param id - The id of the entity to version
2027
2172
  */
2028
- versionEntity: versionEntity(join16(path6)),
2173
+ versionEntity: versionEntity(join17(path6)),
2029
2174
  /**
2030
2175
  * Check to see if an entity version exists
2031
2176
  * @param id - The id of the entity
2032
2177
  * @param version - The version of the entity (supports semver)
2033
2178
  * @returns
2034
2179
  */
2035
- entityHasVersion: entityHasVersion(join16(path6)),
2180
+ entityHasVersion: entityHasVersion(join17(path6)),
2036
2181
  /**
2037
2182
  * ================================
2038
2183
  * Data Stores
@@ -2044,42 +2189,42 @@ var src_default = (path6) => {
2044
2189
  * @param options - Optional options to write the data store
2045
2190
  *
2046
2191
  */
2047
- writeDataStore: writeDataStore(join16(path6, "containers")),
2192
+ writeDataStore: writeDataStore(join17(path6, "containers")),
2048
2193
  /**
2049
2194
  * Returns a data store from EventCatalog
2050
2195
  * @param id - The id of the data store to retrieve
2051
2196
  * @param version - Optional id of the version to get (supports semver)
2052
2197
  * @returns Container|Undefined
2053
2198
  */
2054
- getDataStore: getDataStore(join16(path6)),
2199
+ getDataStore: getDataStore(join17(path6)),
2055
2200
  /**
2056
2201
  * Returns all data stores from EventCatalog
2057
2202
  * @param latestOnly - optional boolean, set to true to get only latest versions
2058
2203
  * @returns Container[]|Undefined
2059
2204
  */
2060
- getDataStores: getDataStores(join16(path6)),
2205
+ getDataStores: getDataStores(join17(path6)),
2061
2206
  /**
2062
2207
  * Version a data store by its id
2063
2208
  * @param id - The id of the data store to version
2064
2209
  */
2065
- versionDataStore: versionDataStore(join16(path6, "containers")),
2210
+ versionDataStore: versionDataStore(join17(path6, "containers")),
2066
2211
  /**
2067
2212
  * Remove a data store by its path
2068
2213
  * @param path - The path to the data store to remove
2069
2214
  */
2070
- rmDataStore: rmDataStore(join16(path6, "containers")),
2215
+ rmDataStore: rmDataStore(join17(path6, "containers")),
2071
2216
  /**
2072
2217
  * Remove a data store by its id
2073
2218
  * @param id - The id of the data store to remove
2074
2219
  */
2075
- rmDataStoreById: rmDataStoreById(join16(path6)),
2220
+ rmDataStoreById: rmDataStoreById(join17(path6)),
2076
2221
  /**
2077
2222
  * Check to see if a data store version exists
2078
2223
  * @param id - The id of the data store
2079
2224
  * @param version - The version of the data store (supports semver)
2080
2225
  * @returns
2081
2226
  */
2082
- dataStoreHasVersion: dataStoreHasVersion(join16(path6)),
2227
+ dataStoreHasVersion: dataStoreHasVersion(join17(path6)),
2083
2228
  /**
2084
2229
  * Adds a file to a data store by its id
2085
2230
  * @param id - The id of the data store to add the file to
@@ -2087,14 +2232,86 @@ var src_default = (path6) => {
2087
2232
  * @param version - Optional version of the data store to add the file to
2088
2233
  * @returns
2089
2234
  */
2090
- addFileToDataStore: addFileToDataStore(join16(path6)),
2235
+ addFileToDataStore: addFileToDataStore(join17(path6)),
2091
2236
  /**
2092
2237
  * Writes a data store to a service by its id
2093
2238
  * @param dataStore - The data store to write
2094
2239
  * @param service - The service to write the data store to
2095
2240
  * @returns
2096
2241
  */
2097
- writeDataStoreToService: writeDataStoreToService(join16(path6))
2242
+ writeDataStoreToService: writeDataStoreToService(join17(path6)),
2243
+ /**
2244
+ * ================================
2245
+ * Data Products
2246
+ * ================================
2247
+ */
2248
+ /**
2249
+ * Adds a data product to EventCatalog
2250
+ * @param dataProduct - The data product to write
2251
+ * @param options - Optional options to write the data product
2252
+ *
2253
+ */
2254
+ writeDataProduct: writeDataProduct(join17(path6, "data-products")),
2255
+ /**
2256
+ * Writes a data product to a domain in EventCatalog
2257
+ * @param dataProduct - The data product to write
2258
+ * @param domain - The domain to write the data product to
2259
+ * @param options - Optional options to write the data product
2260
+ *
2261
+ */
2262
+ writeDataProductToDomain: writeDataProductToDomain(join17(path6, "domains")),
2263
+ /**
2264
+ * Returns a data product from EventCatalog
2265
+ * @param id - The id of the data product to retrieve
2266
+ * @param version - Optional id of the version to get (supports semver)
2267
+ * @returns DataProduct|Undefined
2268
+ */
2269
+ getDataProduct: getDataProduct(join17(path6)),
2270
+ /**
2271
+ * Returns all data products from EventCatalog
2272
+ * @param latestOnly - optional boolean, set to true to get only latest versions
2273
+ * @returns DataProduct[]|Undefined
2274
+ */
2275
+ getDataProducts: getDataProducts(join17(path6)),
2276
+ /**
2277
+ * Version a data product by its id
2278
+ * @param id - The id of the data product to version
2279
+ */
2280
+ versionDataProduct: versionDataProduct(join17(path6)),
2281
+ /**
2282
+ * Remove a data product by its path
2283
+ * @param path - The path to the data product to remove
2284
+ */
2285
+ rmDataProduct: rmDataProduct(join17(path6, "data-products")),
2286
+ /**
2287
+ * Remove a data product by its id
2288
+ * @param id - The id of the data product to remove
2289
+ * @param version - Optional version of the data product to remove
2290
+ */
2291
+ rmDataProductById: rmDataProductById(join17(path6)),
2292
+ /**
2293
+ * Check to see if a data product version exists
2294
+ * @param id - The id of the data product
2295
+ * @param version - The version of the data product (supports semver)
2296
+ * @returns
2297
+ */
2298
+ dataProductHasVersion: dataProductHasVersion(join17(path6)),
2299
+ /**
2300
+ * Adds a file to a data product by its id
2301
+ * @param id - The id of the data product to add the file to
2302
+ * @param file - File contents to add including the content and the file name
2303
+ * @param version - Optional version of the data product to add the file to
2304
+ * @returns
2305
+ */
2306
+ addFileToDataProduct: addFileToDataProduct(join17(path6)),
2307
+ /**
2308
+ * Adds a data product to a domain
2309
+ * @param id - The id of the domain
2310
+ * @param dataProduct - The id and version of the data product to add
2311
+ * @param version - (Optional) The version of the domain to add the data product to
2312
+ * @returns
2313
+ */
2314
+ addDataProductToDomain: addDataProductToDomain(join17(path6, "domains"))
2098
2315
  };
2099
2316
  };
2100
2317
  export {