@tinycloud/node-sdk 3.8.0-beta.14 → 3.8.0-beta.16
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/core.cjs +16 -3
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +20 -5
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +16 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/share-receive.cjs +775 -0
- package/dist/share-receive.cjs.map +1 -0
- package/dist/share-receive.d.cts +32 -0
- package/dist/share-receive.d.ts +32 -0
- package/dist/share-receive.js +777 -0
- package/dist/share-receive.js.map +1 -0
- package/package.json +11 -4
package/dist/core.cjs
CHANGED
|
@@ -1101,7 +1101,8 @@ var NodeUserAuthorization = class {
|
|
|
1101
1101
|
return true;
|
|
1102
1102
|
}
|
|
1103
1103
|
const parsed = entry.path.includes("/") ? (0, import_resource.parseEncryptionResource)(entry.path) : { ...(0, import_sdk_services2.parseNetworkId)(entry.path), kind: "network" };
|
|
1104
|
-
|
|
1104
|
+
const sharePrefix = parsed.kind === "prefix" && parsed.network === "default" && parsed.prefix === "share" && entry.actions.length === 1 && entry.actions[0] === DECRYPT_ACTION && didPrincipalMatches(parsed.ownerDid, currentDid);
|
|
1105
|
+
if (parsed.kind !== "network" && !sharePrefix) {
|
|
1105
1106
|
throw new import_sdk_core5.ManifestValidationError("named keys go in manifest.keys");
|
|
1106
1107
|
}
|
|
1107
1108
|
for (const action of entry.actions) {
|
|
@@ -7306,7 +7307,7 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
7306
7307
|
graph.assertActive();
|
|
7307
7308
|
const signed = await this.signRawNetworkAuthorization({
|
|
7308
7309
|
targetNode: input.targetNode,
|
|
7309
|
-
networkId: input.networkId
|
|
7310
|
+
networkId: input.body.keyPath === void 0 ? input.networkId : `${input.networkId}/${input.body.keyPath}`,
|
|
7310
7311
|
action: DECRYPT_ACTION2,
|
|
7311
7312
|
facts: input.facts
|
|
7312
7313
|
}, { graph, session });
|
|
@@ -8896,7 +8897,19 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
8896
8897
|
"delegateTo requires a non-empty permissions array"
|
|
8897
8898
|
);
|
|
8898
8899
|
}
|
|
8899
|
-
const expandedEntries =
|
|
8900
|
+
const expandedEntries = (0, import_sdk_core11.expandDelegationPermissionEntries)(permissions);
|
|
8901
|
+
const namedKeyEntries = expandedEntries.filter((entry) => entry.service === import_sdk_core11.ENCRYPTION_PERMISSION_SERVICE && entry.path.includes("/"));
|
|
8902
|
+
if (namedKeyEntries.length > 0) {
|
|
8903
|
+
if (expandedEntries.some((entry) => entry.service === import_sdk_core11.ENCRYPTION_PERMISSION_SERVICE && !entry.path.includes("/"))) {
|
|
8904
|
+
throw new import_sdk_core11.ManifestValidationError("named-key delegation cannot include bare-network permissions");
|
|
8905
|
+
}
|
|
8906
|
+
if (options?.forceWalletSign) {
|
|
8907
|
+
throw new import_sdk_core11.ManifestValidationError("named-key delegation requires a signed session grant");
|
|
8908
|
+
}
|
|
8909
|
+
const granted = this.projectSignedRecapCapabilities(session.siwe);
|
|
8910
|
+
const { subset, missing } = this.signedCapabilitySubset(namedKeyEntries, granted);
|
|
8911
|
+
if (!subset) throw new import_sdk_core11.PermissionNotInManifestError(missing, granted);
|
|
8912
|
+
}
|
|
8900
8913
|
const now = /* @__PURE__ */ new Date();
|
|
8901
8914
|
const expiryMs = resolveExpiryMs(options?.expiry);
|
|
8902
8915
|
const expirationTime = new Date(now.getTime() + expiryMs);
|