@eventcatalog/sdk 2.17.4 → 2.18.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/dist/index.d.mts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -54,12 +54,14 @@ type ResourcePointer = {
|
|
|
54
54
|
type SendsPointer = {
|
|
55
55
|
id: string;
|
|
56
56
|
version?: string;
|
|
57
|
+
fields?: string[];
|
|
57
58
|
to?: ChannelPointer[];
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
type ReceivesPointer = {
|
|
61
62
|
id: string;
|
|
62
63
|
version?: string;
|
|
64
|
+
fields?: string[];
|
|
63
65
|
from?: ChannelPointer[];
|
|
64
66
|
};
|
|
65
67
|
|
|
@@ -103,6 +105,9 @@ interface MessageDetailsPanelProperty {
|
|
|
103
105
|
channels?: DetailPanelProperty;
|
|
104
106
|
versions?: DetailPanelProperty;
|
|
105
107
|
repository?: DetailPanelProperty;
|
|
108
|
+
owners?: DetailPanelProperty;
|
|
109
|
+
changelog?: DetailPanelProperty;
|
|
110
|
+
attachments?: DetailPanelProperty;
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
interface Event extends BaseSchema {
|
|
@@ -1047,6 +1052,12 @@ declare const _default: (path: string) => {
|
|
|
1047
1052
|
addEventToService: (id: string, direction: string, event: {
|
|
1048
1053
|
id: string;
|
|
1049
1054
|
version: string;
|
|
1055
|
+
fields? /**
|
|
1056
|
+
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1057
|
+
*
|
|
1058
|
+
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1059
|
+
*
|
|
1060
|
+
*/: string[];
|
|
1050
1061
|
}, version?: string) => Promise<void>;
|
|
1051
1062
|
/**
|
|
1052
1063
|
* Add a data store to a service by it's id.
|
|
@@ -1090,6 +1101,12 @@ declare const _default: (path: string) => {
|
|
|
1090
1101
|
addCommandToService: (id: string, direction: string, event: {
|
|
1091
1102
|
id: string;
|
|
1092
1103
|
version: string;
|
|
1104
|
+
fields? /**
|
|
1105
|
+
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1106
|
+
*
|
|
1107
|
+
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1108
|
+
*
|
|
1109
|
+
*/: string[];
|
|
1093
1110
|
}, version?: string) => Promise<void>;
|
|
1094
1111
|
/**
|
|
1095
1112
|
* Add a query to a service by it's id.
|
|
@@ -1113,6 +1130,12 @@ declare const _default: (path: string) => {
|
|
|
1113
1130
|
addQueryToService: (id: string, direction: string, event: {
|
|
1114
1131
|
id: string;
|
|
1115
1132
|
version: string;
|
|
1133
|
+
fields? /**
|
|
1134
|
+
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1135
|
+
*
|
|
1136
|
+
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1137
|
+
*
|
|
1138
|
+
*/: string[];
|
|
1116
1139
|
}, version?: string) => Promise<void>;
|
|
1117
1140
|
/**
|
|
1118
1141
|
* Add an entity to a service by its id.
|
|
@@ -1297,6 +1320,7 @@ declare const _default: (path: string) => {
|
|
|
1297
1320
|
addEventToDomain: (id: string, direction: string, message: {
|
|
1298
1321
|
id: string;
|
|
1299
1322
|
version: string;
|
|
1323
|
+
fields?: string[];
|
|
1300
1324
|
}, version?: string) => Promise<void>;
|
|
1301
1325
|
/**
|
|
1302
1326
|
* Add a command to a domain by its id.
|
|
@@ -1318,6 +1342,7 @@ declare const _default: (path: string) => {
|
|
|
1318
1342
|
addCommandToDomain: (id: string, direction: string, message: {
|
|
1319
1343
|
id: string;
|
|
1320
1344
|
version: string;
|
|
1345
|
+
fields?: string[];
|
|
1321
1346
|
}, version?: string) => Promise<void>;
|
|
1322
1347
|
/**
|
|
1323
1348
|
* Add a query to a domain by its id.
|
|
@@ -1339,6 +1364,7 @@ declare const _default: (path: string) => {
|
|
|
1339
1364
|
addQueryToDomain: (id: string, direction: string, message: {
|
|
1340
1365
|
id: string;
|
|
1341
1366
|
version: string;
|
|
1367
|
+
fields?: string[];
|
|
1342
1368
|
}, version?: string) => Promise<void>;
|
|
1343
1369
|
/**
|
|
1344
1370
|
* ================================
|
package/dist/index.d.ts
CHANGED
|
@@ -54,12 +54,14 @@ type ResourcePointer = {
|
|
|
54
54
|
type SendsPointer = {
|
|
55
55
|
id: string;
|
|
56
56
|
version?: string;
|
|
57
|
+
fields?: string[];
|
|
57
58
|
to?: ChannelPointer[];
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
type ReceivesPointer = {
|
|
61
62
|
id: string;
|
|
62
63
|
version?: string;
|
|
64
|
+
fields?: string[];
|
|
63
65
|
from?: ChannelPointer[];
|
|
64
66
|
};
|
|
65
67
|
|
|
@@ -103,6 +105,9 @@ interface MessageDetailsPanelProperty {
|
|
|
103
105
|
channels?: DetailPanelProperty;
|
|
104
106
|
versions?: DetailPanelProperty;
|
|
105
107
|
repository?: DetailPanelProperty;
|
|
108
|
+
owners?: DetailPanelProperty;
|
|
109
|
+
changelog?: DetailPanelProperty;
|
|
110
|
+
attachments?: DetailPanelProperty;
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
interface Event extends BaseSchema {
|
|
@@ -1047,6 +1052,12 @@ declare const _default: (path: string) => {
|
|
|
1047
1052
|
addEventToService: (id: string, direction: string, event: {
|
|
1048
1053
|
id: string;
|
|
1049
1054
|
version: string;
|
|
1055
|
+
fields? /**
|
|
1056
|
+
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1057
|
+
*
|
|
1058
|
+
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1059
|
+
*
|
|
1060
|
+
*/: string[];
|
|
1050
1061
|
}, version?: string) => Promise<void>;
|
|
1051
1062
|
/**
|
|
1052
1063
|
* Add a data store to a service by it's id.
|
|
@@ -1090,6 +1101,12 @@ declare const _default: (path: string) => {
|
|
|
1090
1101
|
addCommandToService: (id: string, direction: string, event: {
|
|
1091
1102
|
id: string;
|
|
1092
1103
|
version: string;
|
|
1104
|
+
fields? /**
|
|
1105
|
+
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1106
|
+
*
|
|
1107
|
+
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1108
|
+
*
|
|
1109
|
+
*/: string[];
|
|
1093
1110
|
}, version?: string) => Promise<void>;
|
|
1094
1111
|
/**
|
|
1095
1112
|
* Add a query to a service by it's id.
|
|
@@ -1113,6 +1130,12 @@ declare const _default: (path: string) => {
|
|
|
1113
1130
|
addQueryToService: (id: string, direction: string, event: {
|
|
1114
1131
|
id: string;
|
|
1115
1132
|
version: string;
|
|
1133
|
+
fields? /**
|
|
1134
|
+
* Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
|
|
1135
|
+
*
|
|
1136
|
+
* @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
|
|
1137
|
+
*
|
|
1138
|
+
*/: string[];
|
|
1116
1139
|
}, version?: string) => Promise<void>;
|
|
1117
1140
|
/**
|
|
1118
1141
|
* Add an entity to a service by its id.
|
|
@@ -1297,6 +1320,7 @@ declare const _default: (path: string) => {
|
|
|
1297
1320
|
addEventToDomain: (id: string, direction: string, message: {
|
|
1298
1321
|
id: string;
|
|
1299
1322
|
version: string;
|
|
1323
|
+
fields?: string[];
|
|
1300
1324
|
}, version?: string) => Promise<void>;
|
|
1301
1325
|
/**
|
|
1302
1326
|
* Add a command to a domain by its id.
|
|
@@ -1318,6 +1342,7 @@ declare const _default: (path: string) => {
|
|
|
1318
1342
|
addCommandToDomain: (id: string, direction: string, message: {
|
|
1319
1343
|
id: string;
|
|
1320
1344
|
version: string;
|
|
1345
|
+
fields?: string[];
|
|
1321
1346
|
}, version?: string) => Promise<void>;
|
|
1322
1347
|
/**
|
|
1323
1348
|
* Add a query to a domain by its id.
|
|
@@ -1339,6 +1364,7 @@ declare const _default: (path: string) => {
|
|
|
1339
1364
|
addQueryToDomain: (id: string, direction: string, message: {
|
|
1340
1365
|
id: string;
|
|
1341
1366
|
version: string;
|
|
1367
|
+
fields?: string[];
|
|
1342
1368
|
}, version?: string) => Promise<void>;
|
|
1343
1369
|
/**
|
|
1344
1370
|
* ================================
|
package/dist/index.js
CHANGED
|
@@ -862,6 +862,11 @@ var copyDir = async (catalogDir, source, target, filter) => {
|
|
|
862
862
|
});
|
|
863
863
|
import_node_fs.default.rmSync(tmpDirectory, { recursive: true });
|
|
864
864
|
};
|
|
865
|
+
var buildMessagePointer = (message) => {
|
|
866
|
+
const pointer = { id: message.id, version: message.version };
|
|
867
|
+
if (message.fields) pointer.fields = message.fields;
|
|
868
|
+
return pointer;
|
|
869
|
+
};
|
|
865
870
|
var uniqueVersions = (messages) => {
|
|
866
871
|
const uniqueSet = /* @__PURE__ */ new Set();
|
|
867
872
|
return messages.filter((message) => {
|
|
@@ -1364,7 +1369,7 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
1364
1369
|
return;
|
|
1365
1370
|
}
|
|
1366
1371
|
}
|
|
1367
|
-
service.sends.push(
|
|
1372
|
+
service.sends.push(buildMessagePointer(event));
|
|
1368
1373
|
} else if (direction === "receives") {
|
|
1369
1374
|
if (service.receives === void 0) {
|
|
1370
1375
|
service.receives = [];
|
|
@@ -1374,7 +1379,7 @@ var addMessageToService = (directory) => async (id, direction, event, version) =
|
|
|
1374
1379
|
return;
|
|
1375
1380
|
}
|
|
1376
1381
|
}
|
|
1377
|
-
service.receives.push(
|
|
1382
|
+
service.receives.push(buildMessagePointer(event));
|
|
1378
1383
|
} else {
|
|
1379
1384
|
throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
|
|
1380
1385
|
}
|
|
@@ -1594,7 +1599,7 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
|
|
|
1594
1599
|
return;
|
|
1595
1600
|
}
|
|
1596
1601
|
}
|
|
1597
|
-
domain.sends.push(
|
|
1602
|
+
domain.sends.push(buildMessagePointer(message));
|
|
1598
1603
|
} else if (direction === "receives") {
|
|
1599
1604
|
if (domain.receives === void 0) {
|
|
1600
1605
|
domain.receives = [];
|
|
@@ -1604,7 +1609,7 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
|
|
|
1604
1609
|
return;
|
|
1605
1610
|
}
|
|
1606
1611
|
}
|
|
1607
|
-
domain.receives.push(
|
|
1612
|
+
domain.receives.push(buildMessagePointer(message));
|
|
1608
1613
|
} else {
|
|
1609
1614
|
throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
|
|
1610
1615
|
}
|