@xyo-network/event-kit-node 1.0.0 → 1.0.1
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/filesystemCursorStore.d.ts.map +1 -1
- package/dist/node/filesystemPublisherEndpointChallengeStore.d.ts.map +1 -1
- package/dist/node/handshake.mjs +4 -7
- package/dist/node/handshake.mjs.map +2 -2
- package/dist/node/index.mjs +15 -27
- package/dist/node/index.mjs.map +2 -2
- package/dist/node/runtime/httpsTransport.d.ts.map +1 -1
- package/dist/node/runtime/publisherRuntime.d.ts.map +1 -1
- package/dist/node/runtime.mjs +10 -16
- package/dist/node/runtime.mjs.map +2 -2
- package/package.json +24 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystemCursorStore.d.ts","sourceRoot":"","sources":["../../src/filesystemCursorStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAExE,MAAM,WAAW,4BAA4B;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAMD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"filesystemCursorStore.d.ts","sourceRoot":"","sources":["../../src/filesystemCursorStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAExE,MAAM,WAAW,4BAA4B;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAMD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,oBAAoB,CAmBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystemPublisherEndpointChallengeStore.d.ts","sourceRoot":"","sources":["../../src/filesystemPublisherEndpointChallengeStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,+BAA+B,EAChC,MAAM,iCAAiC,CAAA;AAYxC,MAAM,WAAW,gDAAgD;IAC/D,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAID;;;;GAIG;AACH,wBAAgB,+CAA+C,CAC7D,OAAO,EAAE,gDAAgD,GACxD,+BAA+B,
|
|
1
|
+
{"version":3,"file":"filesystemPublisherEndpointChallengeStore.d.ts","sourceRoot":"","sources":["../../src/filesystemPublisherEndpointChallengeStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,+BAA+B,EAChC,MAAM,iCAAiC,CAAA;AAYxC,MAAM,WAAW,gDAAgD;IAC/D,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAID;;;;GAIG;AACH,wBAAgB,+CAA+C,CAC7D,OAAO,EAAE,gDAAgD,GACxD,+BAA+B,CAqGjC"}
|
package/dist/node/handshake.mjs
CHANGED
|
@@ -111,10 +111,7 @@ function replaceJsonValue(_key, candidate) {
|
|
|
111
111
|
return typeof candidate === "bigint" ? { $eventKitBigInt: candidate.toString() } : candidate;
|
|
112
112
|
}
|
|
113
113
|
function reviveJson(_key, candidate) {
|
|
114
|
-
|
|
115
|
-
return BigInt(candidate.$eventKitBigInt);
|
|
116
|
-
}
|
|
117
|
-
return candidate;
|
|
114
|
+
return typeof candidate === "object" && candidate !== null && Object.keys(candidate).length === 1 && "$eventKitBigInt" in candidate && typeof candidate.$eventKitBigInt === "string" && /^(?:0|[1-9][0-9]*)$/u.test(candidate.$eventKitBigInt) ? BigInt(candidate.$eventKitBigInt) : candidate;
|
|
118
115
|
}
|
|
119
116
|
async function unlinkIfMissing(path) {
|
|
120
117
|
try {
|
|
@@ -706,7 +703,7 @@ function createFilesystemPublisherEndpointChallengeStore(options) {
|
|
|
706
703
|
if (await publish(attempted)) return { kind: "started", record: attempted };
|
|
707
704
|
const winner = await current(challengeHash);
|
|
708
705
|
if (winner === void 0) throw new Error("challenge attempt winner vanished");
|
|
709
|
-
return winner.state === "verified" ?
|
|
706
|
+
return { kind: winner.state === "verified" ? "verified" : "already-attempted", record: winner };
|
|
710
707
|
},
|
|
711
708
|
async completeVerified(input) {
|
|
712
709
|
const challengeHash = HashZod3.parse(input.challengeHash);
|
|
@@ -715,7 +712,7 @@ function createFilesystemPublisherEndpointChallengeStore(options) {
|
|
|
715
712
|
const observed = await current(challengeHash);
|
|
716
713
|
if (observed === void 0) return { kind: "missing" };
|
|
717
714
|
if (observed.state === "verified") {
|
|
718
|
-
return observed.responseHash === responseHash ?
|
|
715
|
+
return { kind: observed.responseHash === responseHash ? "duplicate" : "collision", record: observed };
|
|
719
716
|
}
|
|
720
717
|
if (observed.state !== "attempted") return { kind: "not-attempted", record: observed };
|
|
721
718
|
if (!isLive(observed, input.nowSeconds)) return { kind: "expired", record: observed };
|
|
@@ -727,7 +724,7 @@ function createFilesystemPublisherEndpointChallengeStore(options) {
|
|
|
727
724
|
if (await publish(verified)) return { kind: "verified", record: verified };
|
|
728
725
|
const winner = await readState(challengeHash, "verified");
|
|
729
726
|
if (winner === void 0) throw new Error("verified challenge winner vanished");
|
|
730
|
-
return winner.responseHash === responseHash ?
|
|
727
|
+
return { kind: winner.responseHash === responseHash ? "duplicate" : "collision", record: winner };
|
|
731
728
|
},
|
|
732
729
|
get: async (rawHash) => await current(HashZod3.parse(rawHash)),
|
|
733
730
|
async issue(input) {
|