@tinycloud/sdk-core 3.8.0-beta.2 → 3.8.0-beta.20
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/{credential-admission-Cg1M9uyV.d.cts → credential-admission-B7_F6Yb3.d.cts} +1 -0
- package/dist/{credential-admission-7I_ymo-C.d.ts → credential-admission-DCJhDFFv.d.ts} +1 -0
- package/dist/delegations/index.cjs +76 -14
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +4 -2
- package/dist/delegations/index.d.ts +4 -2
- package/dist/delegations/index.js +69 -7
- package/dist/delegations/index.js.map +1 -1
- package/dist/delegations/issued.cjs +697 -0
- package/dist/delegations/issued.cjs.map +1 -0
- package/dist/delegations/issued.d.cts +54 -0
- package/dist/delegations/issued.d.ts +54 -0
- package/dist/delegations/issued.js +674 -0
- package/dist/delegations/issued.js.map +1 -0
- package/dist/index.cjs +442 -294
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -5
- package/dist/index.d.ts +21 -5
- package/dist/index.js +171 -23
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +4 -6
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.d.cts +2 -2
- package/dist/policy/index.d.ts +2 -2
- package/dist/policy/index.js +4 -6
- package/dist/policy/index.js.map +1 -1
- package/dist/{recipient-types.schema-BApcOn1t.d.cts → recipient-types.schema-BIJcihno.d.cts} +42 -1741
- package/dist/{recipient-types.schema-BApcOn1t.d.ts → recipient-types.schema-Ebi5aliq.d.ts} +42 -1741
- package/dist/types.schema-BmN-OnCA.d.cts +1763 -0
- package/dist/types.schema-BmN-OnCA.d.ts +1763 -0
- package/package.json +9 -4
package/dist/policy/index.cjs
CHANGED
|
@@ -3325,6 +3325,7 @@ var import_sha256 = require("@noble/hashes/sha256");
|
|
|
3325
3325
|
var import_blake3 = require("@noble/hashes/blake3");
|
|
3326
3326
|
var import_ed255192 = require("@noble/curves/ed25519");
|
|
3327
3327
|
var import_zod = require("zod");
|
|
3328
|
+
var import_sdk_services2 = require("@tinycloud/sdk-services");
|
|
3328
3329
|
|
|
3329
3330
|
// src/http-error.ts
|
|
3330
3331
|
var import_sdk_services = require("@tinycloud/sdk-services");
|
|
@@ -3606,12 +3607,9 @@ function parseKvResource(resource) {
|
|
|
3606
3607
|
return { space, path };
|
|
3607
3608
|
}
|
|
3608
3609
|
function parseEncryptionResource(resource) {
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
const ownerDid = separator < 0 ? "" : rest.slice(0, separator);
|
|
3613
|
-
const network = separator < 0 ? "" : rest.slice(separator + 1);
|
|
3614
|
-
if (!ownerDid.startsWith("did:") || network.length === 0 || network.includes(":") || network.includes("/") || network.includes("%") || network.includes("?") || network.includes("#")) {
|
|
3610
|
+
try {
|
|
3611
|
+
if ((0, import_sdk_services2.parseEncryptionResource)(resource).keyPath?.endsWith("/")) throw new Error("prefix");
|
|
3612
|
+
} catch {
|
|
3615
3613
|
throw new Error("encryption capability is invalid");
|
|
3616
3614
|
}
|
|
3617
3615
|
}
|