@tinycloud/sdk-core 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/{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 +11 -8
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.js +3 -0
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +319 -289
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +42 -12
- 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/package.json +4 -4
|
@@ -426,6 +426,7 @@ interface UnifiedContentSource {
|
|
|
426
426
|
readonly kvResource: string;
|
|
427
427
|
readonly selector: UnifiedResourceSelector;
|
|
428
428
|
readonly encryptionNetwork: string;
|
|
429
|
+
readonly encryptionKeyPath?: string;
|
|
429
430
|
readonly encryptedSymmetricKeyDigestHex: string;
|
|
430
431
|
readonly keyVersion: number;
|
|
431
432
|
readonly mode: "mutable" | "immutable";
|
|
@@ -426,6 +426,7 @@ interface UnifiedContentSource {
|
|
|
426
426
|
readonly kvResource: string;
|
|
427
427
|
readonly selector: UnifiedResourceSelector;
|
|
428
428
|
readonly encryptionNetwork: string;
|
|
429
|
+
readonly encryptionKeyPath?: string;
|
|
429
430
|
readonly encryptedSymmetricKeyDigestHex: string;
|
|
430
431
|
readonly keyVersion: number;
|
|
431
432
|
readonly mode: "mutable" | "immutable";
|
|
@@ -1301,6 +1301,7 @@ function validateSharingServiceConfig(data) {
|
|
|
1301
1301
|
var import_ms = __toESM(require("ms"), 1);
|
|
1302
1302
|
var import_bootstrap = require("@tinycloud/bootstrap");
|
|
1303
1303
|
var import_sdk_services = require("@tinycloud/sdk-services");
|
|
1304
|
+
var import_resource = require("@tinycloud/sdk-services/encryption/resource");
|
|
1304
1305
|
var SERVICE_SHORT_TO_LONG = Object.freeze({
|
|
1305
1306
|
kv: "tinycloud.kv",
|
|
1306
1307
|
space: "tinycloud.space",
|
|
@@ -1385,6 +1386,7 @@ function principalDid(didUrl) {
|
|
|
1385
1386
|
}
|
|
1386
1387
|
|
|
1387
1388
|
// src/capabilities.ts
|
|
1389
|
+
var import_resource2 = require("@tinycloud/sdk-services/encryption/resource");
|
|
1388
1390
|
var CaveatedDelegationUnsupportedError = class extends Error {
|
|
1389
1391
|
constructor(entries) {
|
|
1390
1392
|
super(
|
|
@@ -2610,7 +2612,7 @@ var hashes = { ...sha2_browser_exports, ...identity_exports2 };
|
|
|
2610
2612
|
var import_ed255194 = require("@noble/curves/ed25519");
|
|
2611
2613
|
|
|
2612
2614
|
// src/delegations/ShareRecipientClient.ts
|
|
2613
|
-
var
|
|
2615
|
+
var import_sdk_services4 = require("@tinycloud/sdk-services");
|
|
2614
2616
|
var import_ed255193 = require("@noble/curves/ed25519");
|
|
2615
2617
|
var import_sha2564 = require("@noble/hashes/sha256");
|
|
2616
2618
|
|
|
@@ -3691,6 +3693,7 @@ var import_sha2563 = require("@noble/hashes/sha256");
|
|
|
3691
3693
|
var import_blake32 = require("@noble/hashes/blake3");
|
|
3692
3694
|
var import_ed255192 = require("@noble/curves/ed25519");
|
|
3693
3695
|
var import_zod4 = require("zod");
|
|
3696
|
+
var import_sdk_services3 = require("@tinycloud/sdk-services");
|
|
3694
3697
|
|
|
3695
3698
|
// src/policy/errors.ts
|
|
3696
3699
|
var SignedObjectProfileError = class extends Error {
|
|
@@ -4237,9 +4240,9 @@ function redactedCode(error) {
|
|
|
4237
4240
|
if (error instanceof ShareConflict) return error.code;
|
|
4238
4241
|
const code3 = error && typeof error === "object" && "code" in error ? error.code : void 0;
|
|
4239
4242
|
if (typeof code3 !== "string") return "SHARE_INVALID";
|
|
4240
|
-
if (code3 ===
|
|
4241
|
-
if (code3 ===
|
|
4242
|
-
if (code3 ===
|
|
4243
|
+
if (code3 === import_sdk_services4.ErrorCodes.KV_PRECONDITION_FAILED || code3 === "412") return "SHARE_CONFLICT";
|
|
4244
|
+
if (code3 === import_sdk_services4.ErrorCodes.NODE_BUSY || code3 === import_sdk_services4.ErrorCodes.REQUEST_TIMEOUT) return "SHARE_OFFLINE";
|
|
4245
|
+
if (code3 === import_sdk_services4.ErrorCodes.OUTCOME_UNKNOWN) return "SHARE_WRITE_FAILED";
|
|
4243
4246
|
if (code3 === "KV_NOT_FOUND" || code3 === "NOT_FOUND" || code3 === "404") return "SHARE_NOT_FOUND";
|
|
4244
4247
|
if (code3.includes("EXPIRED") || code3 === "expired") return "SHARE_EXPIRED";
|
|
4245
4248
|
if (code3.includes("REVOK")) return "SHARE_REVOKED";
|
|
@@ -4478,7 +4481,7 @@ var ShareRecipientClient = class {
|
|
|
4478
4481
|
if (portableDelegation !== void 0 && kv !== void 0) {
|
|
4479
4482
|
const result2 = await kv.put(resolvedPath, bytes2, { contentType: input.contentType ?? envelope.content.mimeType, ifMatch: input.etag });
|
|
4480
4483
|
if (!result2.ok) {
|
|
4481
|
-
if (result2.error.code ===
|
|
4484
|
+
if (result2.error.code === import_sdk_services4.ErrorCodes.KV_PRECONDITION_FAILED) throw new ShareConflict(resolvedPath, result2.error.meta?.etag);
|
|
4482
4485
|
throw result2.error;
|
|
4483
4486
|
}
|
|
4484
4487
|
return { etag: result2.data.headers.etag };
|
|
@@ -4486,7 +4489,7 @@ var ShareRecipientClient = class {
|
|
|
4486
4489
|
if (policySession !== void 0) return this.nativeSave(envelope, policySession, resolvedPath, bytes2, input);
|
|
4487
4490
|
const result = await kv.put(resolvedPath, bytes2, { contentType: input.contentType ?? envelope.content.mimeType, ifMatch: input.etag });
|
|
4488
4491
|
if (!result.ok) {
|
|
4489
|
-
if (result.error.code ===
|
|
4492
|
+
if (result.error.code === import_sdk_services4.ErrorCodes.KV_PRECONDITION_FAILED) throw new ShareConflict(resolvedPath, result.error.meta?.etag);
|
|
4490
4493
|
throw result.error;
|
|
4491
4494
|
}
|
|
4492
4495
|
return { etag: result.data.headers.etag };
|
|
@@ -4570,8 +4573,8 @@ var ShareRecipientClient = class {
|
|
|
4570
4573
|
if (this.options.createKVService !== void 0) {
|
|
4571
4574
|
return this.options.createKVService({ hosts: [origin], session, invoke, fetch: this.fetchFn });
|
|
4572
4575
|
}
|
|
4573
|
-
const context = new
|
|
4574
|
-
const service = new
|
|
4576
|
+
const context = new import_sdk_services4.ServiceContext({ hosts: [origin], session, invoke, fetch: this.fetchFn });
|
|
4577
|
+
const service = new import_sdk_services4.KVService({ prefix: "" });
|
|
4575
4578
|
context.registerService("kv", service);
|
|
4576
4579
|
service.initialize(context);
|
|
4577
4580
|
return service;
|