@xyo-network/event-kit-node 1.0.1 → 2.1.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/node/handshake.mjs +12 -0
- package/dist/node/handshake.mjs.map +2 -2
- package/dist/node/handshakeClients.d.ts +5 -1
- package/dist/node/handshakeClients.d.ts.map +1 -1
- package/dist/node/handshakeMutationIntent.d.ts +128 -66
- package/dist/node/handshakeMutationIntent.d.ts.map +1 -1
- package/dist/node/index.mjs +277 -93
- package/dist/node/index.mjs.map +4 -4
- package/dist/node/runtime/handshakeDiscovery.d.ts +4 -0
- package/dist/node/runtime/handshakeDiscovery.d.ts.map +1 -1
- package/dist/node/runtime/publisherDeliveryState.d.ts +107 -0
- package/dist/node/runtime/publisherDeliveryState.d.ts.map +1 -0
- package/dist/node/runtime/publisherRuntime.d.ts +17 -1
- package/dist/node/runtime/publisherRuntime.d.ts.map +1 -1
- package/dist/node/runtime/sourceSigner.d.ts +1 -0
- package/dist/node/runtime/sourceSigner.d.ts.map +1 -1
- package/dist/node/runtime/sqliteHandshakeStores.d.ts +3 -1
- package/dist/node/runtime/sqliteHandshakeStores.d.ts.map +1 -1
- package/dist/node/runtime.mjs +265 -93
- package/dist/node/runtime.mjs.map +4 -4
- package/package.json +8 -8
package/dist/node/handshake.mjs
CHANGED
|
@@ -982,6 +982,8 @@ async function persistMutationIntent(store, intent) {
|
|
|
982
982
|
}
|
|
983
983
|
async function publisherServiceRequestFingerprint(input) {
|
|
984
984
|
return await handshakeMutationRequestFingerprint({
|
|
985
|
+
deliveryMode: input.deliveryMode,
|
|
986
|
+
bestEffort: input.bestEffort ?? null,
|
|
985
987
|
expiresAtBlock: input.expiresAtBlock ?? null,
|
|
986
988
|
maxPositionsPerWake: input.maxPositionsPerWake,
|
|
987
989
|
sources: input.sources,
|
|
@@ -1001,6 +1003,8 @@ async function publisherRotationRequestFingerprint(input) {
|
|
|
1001
1003
|
}
|
|
1002
1004
|
async function subscriberSubscriptionRequestFingerprint(input) {
|
|
1003
1005
|
return await handshakeMutationRequestFingerprint({
|
|
1006
|
+
deliveryMode: input.deliveryMode,
|
|
1007
|
+
bestEffort: input.bestEffort ?? null,
|
|
1004
1008
|
audience: input.audience,
|
|
1005
1009
|
challengeSecret: input.challengeSecret,
|
|
1006
1010
|
deploymentId: input.deploymentId,
|
|
@@ -1387,6 +1391,8 @@ function createPublisherHandshakeClient(options) {
|
|
|
1387
1391
|
validFromBlock
|
|
1388
1392
|
};
|
|
1389
1393
|
const service = createPublisherService({
|
|
1394
|
+
deliveryMode: input.deliveryMode,
|
|
1395
|
+
...input.bestEffort === void 0 ? {} : { bestEffort: input.bestEffort },
|
|
1390
1396
|
...serviceInput,
|
|
1391
1397
|
authorizationChainId: options.reader.chainId,
|
|
1392
1398
|
sources: input.sources,
|
|
@@ -1506,6 +1512,8 @@ function createPublisherHandshakeClient(options) {
|
|
|
1506
1512
|
validFromBlock
|
|
1507
1513
|
};
|
|
1508
1514
|
const service = createPublisherService({
|
|
1515
|
+
deliveryMode: selected.service.body.deliveryMode,
|
|
1516
|
+
...selected.service.body.bestEffort === void 0 ? {} : { bestEffort: selected.service.body.bestEffort },
|
|
1509
1517
|
...serviceInput,
|
|
1510
1518
|
authorizationChainId: options.reader.chainId,
|
|
1511
1519
|
sources: selected.service.body.events.map((event) => event.source),
|
|
@@ -1799,6 +1807,8 @@ function createSubscriberHandshakeClient(options) {
|
|
|
1799
1807
|
return Object.freeze(client);
|
|
1800
1808
|
}
|
|
1801
1809
|
function subscriberPlaintext(service, input, maxPositionsPerWake) {
|
|
1810
|
+
if (input.deliveryMode !== service.deliveryMode || canonicalJson(input.bestEffort ?? null) !== canonicalJson(service.bestEffort ?? null))
|
|
1811
|
+
throw new Error("Requested delivery terms do not match exact selected service");
|
|
1802
1812
|
const plaintextInput = {
|
|
1803
1813
|
audience: input.audience,
|
|
1804
1814
|
challengeSecret: input.challengeSecret,
|
|
@@ -1811,6 +1821,8 @@ function subscriberPlaintext(service, input, maxPositionsPerWake) {
|
|
|
1811
1821
|
throw new Error("Requested source is not advertised by the selected service");
|
|
1812
1822
|
}
|
|
1813
1823
|
return createWakeSubscriptionPlaintext({
|
|
1824
|
+
deliveryMode: input.deliveryMode,
|
|
1825
|
+
...input.bestEffort === void 0 ? {} : { bestEffort: input.bestEffort },
|
|
1814
1826
|
...plaintextInput,
|
|
1815
1827
|
source,
|
|
1816
1828
|
fromPosition: input.fromPosition,
|