@mdbase-dev/sdk 0.1.19 → 0.1.21
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/app-grant/client.d.ts +2 -1
- package/dist/app-grant/client.js +17 -3
- package/dist/app-grant/client.js.map +1 -1
- package/dist/app-grant/setup.js +27 -23
- package/dist/app-grant/setup.js.map +1 -1
- package/dist/app-host/installation-sign-in.d.ts +1 -1
- package/dist/app-host/installation-sign-in.js +8 -6
- package/dist/app-host/installation-sign-in.js.map +1 -1
- package/dist/application/asset-pins.json +4 -4
- package/dist/application/private-collections.js +12 -1
- package/dist/application/private-collections.js.map +1 -1
- package/dist/application/worker.js +12 -11
- package/dist/browser/mdbase-sdk.js +73 -41
- package/dist/browser/mdbase-sdk.min.js +45 -45
- package/dist/client.d.ts +7 -0
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/native/provenance.json +5 -5
- package/dist/native/runtime.wasm +0 -0
- package/package.json +1 -1
|
@@ -15693,12 +15693,12 @@ function appReleaseTrust() {
|
|
|
15693
15693
|
// src/application/asset-pins.json
|
|
15694
15694
|
var asset_pins_default = {
|
|
15695
15695
|
runtime: {
|
|
15696
|
-
sha256: "
|
|
15697
|
-
bytes:
|
|
15698
|
-
maxBytes:
|
|
15696
|
+
sha256: "3c14689c6b0f38c3b151981c25a6a2b39129ae07f2a606ed5188442c631ad5b4",
|
|
15697
|
+
bytes: 3982455,
|
|
15698
|
+
maxBytes: 3982455,
|
|
15699
15699
|
source: {
|
|
15700
15700
|
repository: "mdbase-dev/mdbase-connect",
|
|
15701
|
-
commit: "
|
|
15701
|
+
commit: "a8eb987856eb3b76ff7310688aeea328d58b4f39"
|
|
15702
15702
|
}
|
|
15703
15703
|
},
|
|
15704
15704
|
sqlite: {
|
|
@@ -17251,7 +17251,7 @@ var AppProtectedInstallationSignIn = class _AppProtectedInstallationSignIn {
|
|
|
17251
17251
|
closed = false;
|
|
17252
17252
|
busy = false;
|
|
17253
17253
|
nativeAcknowledged = false;
|
|
17254
|
-
|
|
17254
|
+
closedPairing = null;
|
|
17255
17255
|
/** Definite authenticated pre-proof refusal only, never an HTTP unknown. */
|
|
17256
17256
|
wrongAccountRequestId = null;
|
|
17257
17257
|
lifetime = new AbortController();
|
|
@@ -17504,8 +17504,9 @@ var AppProtectedInstallationSignIn = class _AppProtectedInstallationSignIn {
|
|
|
17504
17504
|
if (!response2.ok) {
|
|
17505
17505
|
const error4 = value2.error;
|
|
17506
17506
|
if (!auth && response2.status === 404 && (path === "/v1/pairing-requests" || path === `/v1/pairing-requests/${this.state.requestId}/exchange` || path === `/v1/pairing-requests/${this.state.requestId}/attest`) && error4 && typeof error4 === "object" && !Array.isArray(error4) && (error4.code === "installation_pairing_expired" || error4.code === "installation_pairing_denied")) {
|
|
17507
|
-
|
|
17508
|
-
|
|
17507
|
+
const reason = error4.code === "installation_pairing_expired" ? "expired" : "refused";
|
|
17508
|
+
this.closedPairing = { requestId: this.state.requestId, reason };
|
|
17509
|
+
throw fail3(reason);
|
|
17509
17510
|
}
|
|
17510
17511
|
const server = appServerProblem(response2.status, value2, response2.headers);
|
|
17511
17512
|
const refusal2 = new AppInstallationSignInError(appServerOutcome(server) ?? "refused", server);
|
|
@@ -17545,7 +17546,7 @@ var AppProtectedInstallationSignIn = class _AppProtectedInstallationSignIn {
|
|
|
17545
17546
|
renewExpiredPairing() {
|
|
17546
17547
|
return this.exclusive(async () => {
|
|
17547
17548
|
const s = this.state;
|
|
17548
|
-
if (s.token || this.
|
|
17549
|
+
if (s.token || this.closedPairing?.requestId !== s.requestId) throw fail3("recovery_required");
|
|
17549
17550
|
const bytes10 = crypto.getRandomValues(new Uint8Array(32));
|
|
17550
17551
|
try {
|
|
17551
17552
|
const requestId = crypto.randomUUID(), secret = `pair_${btoa(String.fromCharCode(...bytes10)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")}`;
|
|
@@ -17553,7 +17554,7 @@ var AppProtectedInstallationSignIn = class _AppProtectedInstallationSignIn {
|
|
|
17553
17554
|
const { requestSent: _sent, ...unsent } = s;
|
|
17554
17555
|
const selection = s.selection ? withoutPortalMetadata(s.selection) : s.selection;
|
|
17555
17556
|
await this.save({ ...unsent, selection, requestId, secret, renewal: { requestId: s.requestId, secret: s.secret } });
|
|
17556
|
-
this.
|
|
17557
|
+
this.closedPairing = null;
|
|
17557
17558
|
return await this.startRequest();
|
|
17558
17559
|
} finally {
|
|
17559
17560
|
bytes10.fill(0);
|
|
@@ -17564,6 +17565,7 @@ var AppProtectedInstallationSignIn = class _AppProtectedInstallationSignIn {
|
|
|
17564
17565
|
if (this.state.token) return this.view();
|
|
17565
17566
|
const s = this.state;
|
|
17566
17567
|
if (s.recoveryFor && hint !== null && hint !== s.recoveryFor.collectionId) throw fail3("binding");
|
|
17568
|
+
if (this.closedPairing?.requestId === s.requestId) throw fail3(this.closedPairing.reason);
|
|
17567
17569
|
let reply;
|
|
17568
17570
|
try {
|
|
17569
17571
|
reply = await this.json("/v1/pairing-requests", false, { installation: { app_id: s.appId, request_id: s.requestId, pairing_secret: s.secret, installation_id: s.installationId, device_id: s.deviceId, kind: s.kind, requested_create_collections: s.requestedCreateCollections, ...s.requestedPrivateDevice === true ? { requested_private_device: true } : {}, ...s.recoveryFor ? { recovery_collection_id: s.recoveryFor.collectionId } : {}, ...s.renewal ? { renewal: { request_id: s.renewal.requestId, pairing_secret: s.renewal.secret } } : {} }, ...hint ? { collection_hint: hint } : {} });
|
|
@@ -17579,7 +17581,6 @@ var AppProtectedInstallationSignIn = class _AppProtectedInstallationSignIn {
|
|
|
17579
17581
|
this.assertRecoveryTarget(v);
|
|
17580
17582
|
const uri = verificationUri(v.verification_uri, `${s.cpOrigin}/pair/${s.requestId}`, hint);
|
|
17581
17583
|
if (v.pairing_id !== s.requestId || v.pairing_secret !== s.secret || uri === null || v.installation_device !== true || v.app_id !== s.appId || v.app_origin !== s.origin || v.app_name !== this.options.appName || !Number.isSafeInteger(v.expires_in) || v.expires_in < 0 || v.expires_in > 600) throw fail3("response");
|
|
17582
|
-
this.expiredRequestId = null;
|
|
17583
17584
|
if (this.state.requestSent !== s.requestId) await this.save({ ...this.state, requestSent: s.requestId });
|
|
17584
17585
|
return Object.freeze({ ...this.view(), verificationUri: uri });
|
|
17585
17586
|
}
|
|
@@ -25966,7 +25967,7 @@ var MdbaseClient = class _MdbaseClient {
|
|
|
25966
25967
|
listeners.delete(listener);
|
|
25967
25968
|
};
|
|
25968
25969
|
} });
|
|
25969
|
-
Object.defineProperties(watch, { state: { get: () => state }, error: { get: () => error4 } });
|
|
25970
|
+
Object.defineProperties(watch, { state: { get: () => state }, error: { get: () => error4 }, cursor: { get: () => last } });
|
|
25970
25971
|
return Object.freeze(watch);
|
|
25971
25972
|
}
|
|
25972
25973
|
/** Validate `o.refs`, or every record without them. Every record is validated a
|
|
@@ -8426,7 +8426,7 @@ var MdbaseSDK = (() => {
|
|
|
8426
8426
|
listeners.delete(listener);
|
|
8427
8427
|
};
|
|
8428
8428
|
} });
|
|
8429
|
-
Object.defineProperties(watch, { state: { get: () => state2 }, error: { get: () => error5 } });
|
|
8429
|
+
Object.defineProperties(watch, { state: { get: () => state2 }, error: { get: () => error5 }, cursor: { get: () => last } });
|
|
8430
8430
|
return Object.freeze(watch);
|
|
8431
8431
|
}
|
|
8432
8432
|
/** Validate `o.refs`, or every record without them. Every record is validated a
|
|
@@ -26990,7 +26990,7 @@ ${end.comment}` : end.comment;
|
|
|
26990
26990
|
closed = false;
|
|
26991
26991
|
busy = false;
|
|
26992
26992
|
nativeAcknowledged = false;
|
|
26993
|
-
|
|
26993
|
+
closedPairing = null;
|
|
26994
26994
|
/** Definite authenticated pre-proof refusal only, never an HTTP unknown. */
|
|
26995
26995
|
wrongAccountRequestId = null;
|
|
26996
26996
|
lifetime = new AbortController();
|
|
@@ -27243,8 +27243,9 @@ ${end.comment}` : end.comment;
|
|
|
27243
27243
|
if (!response2.ok) {
|
|
27244
27244
|
const error5 = value2.error;
|
|
27245
27245
|
if (!auth && response2.status === 404 && (path === "/v1/pairing-requests" || path === `/v1/pairing-requests/${this.state.requestId}/exchange` || path === `/v1/pairing-requests/${this.state.requestId}/attest`) && error5 && typeof error5 === "object" && !Array.isArray(error5) && (error5.code === "installation_pairing_expired" || error5.code === "installation_pairing_denied")) {
|
|
27246
|
-
|
|
27247
|
-
|
|
27246
|
+
const reason = error5.code === "installation_pairing_expired" ? "expired" : "refused";
|
|
27247
|
+
this.closedPairing = { requestId: this.state.requestId, reason };
|
|
27248
|
+
throw fail3(reason);
|
|
27248
27249
|
}
|
|
27249
27250
|
const server = appServerProblem(response2.status, value2, response2.headers);
|
|
27250
27251
|
const refusal2 = new AppInstallationSignInError(appServerOutcome(server) ?? "refused", server);
|
|
@@ -27284,7 +27285,7 @@ ${end.comment}` : end.comment;
|
|
|
27284
27285
|
renewExpiredPairing() {
|
|
27285
27286
|
return this.exclusive(async () => {
|
|
27286
27287
|
const s = this.state;
|
|
27287
|
-
if (s.token || this.
|
|
27288
|
+
if (s.token || this.closedPairing?.requestId !== s.requestId) throw fail3("recovery_required");
|
|
27288
27289
|
const bytes10 = crypto.getRandomValues(new Uint8Array(32));
|
|
27289
27290
|
try {
|
|
27290
27291
|
const requestId = crypto.randomUUID(), secret = `pair_${btoa(String.fromCharCode(...bytes10)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")}`;
|
|
@@ -27292,7 +27293,7 @@ ${end.comment}` : end.comment;
|
|
|
27292
27293
|
const { requestSent: _sent, ...unsent } = s;
|
|
27293
27294
|
const selection = s.selection ? withoutPortalMetadata(s.selection) : s.selection;
|
|
27294
27295
|
await this.save({ ...unsent, selection, requestId, secret, renewal: { requestId: s.requestId, secret: s.secret } });
|
|
27295
|
-
this.
|
|
27296
|
+
this.closedPairing = null;
|
|
27296
27297
|
return await this.startRequest();
|
|
27297
27298
|
} finally {
|
|
27298
27299
|
bytes10.fill(0);
|
|
@@ -27303,6 +27304,7 @@ ${end.comment}` : end.comment;
|
|
|
27303
27304
|
if (this.state.token) return this.view();
|
|
27304
27305
|
const s = this.state;
|
|
27305
27306
|
if (s.recoveryFor && hint !== null && hint !== s.recoveryFor.collectionId) throw fail3("binding");
|
|
27307
|
+
if (this.closedPairing?.requestId === s.requestId) throw fail3(this.closedPairing.reason);
|
|
27306
27308
|
let reply;
|
|
27307
27309
|
try {
|
|
27308
27310
|
reply = await this.json("/v1/pairing-requests", false, { installation: { app_id: s.appId, request_id: s.requestId, pairing_secret: s.secret, installation_id: s.installationId, device_id: s.deviceId, kind: s.kind, requested_create_collections: s.requestedCreateCollections, ...s.requestedPrivateDevice === true ? { requested_private_device: true } : {}, ...s.recoveryFor ? { recovery_collection_id: s.recoveryFor.collectionId } : {}, ...s.renewal ? { renewal: { request_id: s.renewal.requestId, pairing_secret: s.renewal.secret } } : {} }, ...hint ? { collection_hint: hint } : {} });
|
|
@@ -27318,7 +27320,6 @@ ${end.comment}` : end.comment;
|
|
|
27318
27320
|
this.assertRecoveryTarget(v);
|
|
27319
27321
|
const uri = verificationUri(v.verification_uri, `${s.cpOrigin}/pair/${s.requestId}`, hint);
|
|
27320
27322
|
if (v.pairing_id !== s.requestId || v.pairing_secret !== s.secret || uri === null || v.installation_device !== true || v.app_id !== s.appId || v.app_origin !== s.origin || v.app_name !== this.options.appName || !Number.isSafeInteger(v.expires_in) || v.expires_in < 0 || v.expires_in > 600) throw fail3("response");
|
|
27321
|
-
this.expiredRequestId = null;
|
|
27322
27323
|
if (this.state.requestSent !== s.requestId) await this.save({ ...this.state, requestSent: s.requestId });
|
|
27323
27324
|
return Object.freeze({ ...this.view(), verificationUri: uri });
|
|
27324
27325
|
}
|
|
@@ -37373,10 +37374,15 @@ ${end.comment}` : end.comment;
|
|
|
37373
37374
|
const plans = /* @__PURE__ */ new WeakMap();
|
|
37374
37375
|
const noops = /* @__PURE__ */ new WeakSet();
|
|
37375
37376
|
let busy2 = false;
|
|
37377
|
+
let release;
|
|
37376
37378
|
async function exclusive2(work) {
|
|
37377
37379
|
if (busy2) throw mdbaseError("rate_limited", "A setup operation is already running.");
|
|
37378
37380
|
busy2 = true;
|
|
37379
37381
|
try {
|
|
37382
|
+
if (release) {
|
|
37383
|
+
await release;
|
|
37384
|
+
release = void 0;
|
|
37385
|
+
}
|
|
37380
37386
|
return await work();
|
|
37381
37387
|
} finally {
|
|
37382
37388
|
busy2 = false;
|
|
@@ -37448,42 +37454,45 @@ ${end.comment}` : end.comment;
|
|
|
37448
37454
|
return Object.freeze({ ...result2, changes, summary: `This app will make ${changes.length} ${changes.length === 1 ? "change" : "changes"} to this collection.` });
|
|
37449
37455
|
}
|
|
37450
37456
|
const shown = (p, review) => JSON.stringify([p.status, p.canApply, p.summary, p.changes, p.conflicts, p.adoptable, p.packs, p.staged, p.records, p.refusal ?? null, review.promoted, review.retained]);
|
|
37457
|
+
async function plan(options) {
|
|
37458
|
+
await fence(void 0, options.signal);
|
|
37459
|
+
if (!declared) {
|
|
37460
|
+
if (input.operations.includes("apply_collection_setup") || input.operations.includes("assess_collection_setup")) throw unavailable4();
|
|
37461
|
+
const empty2 = setupPlan({ status: "current", assessmentDigest: `sha256:${"0".repeat(64)}`, review: { configuration: [], packs: [], staged: [] } }, { canManage: false, canCreateRecords: false, records: [] });
|
|
37462
|
+
noops.add(empty2);
|
|
37463
|
+
return empty2;
|
|
37464
|
+
}
|
|
37465
|
+
await reconcile(options.signal);
|
|
37466
|
+
const { s, review, options: original } = await native(options);
|
|
37467
|
+
const result2 = word(s, review);
|
|
37468
|
+
plans.set(result2, { session: s, review, options: original, consumed: false });
|
|
37469
|
+
return result2;
|
|
37470
|
+
}
|
|
37451
37471
|
const api = {
|
|
37452
|
-
|
|
37453
|
-
const p = await api.plan(options), bound = plans.get(p);
|
|
37454
|
-
if (bound) {
|
|
37455
|
-
await cancel(bound.session, bound.review.ticket);
|
|
37456
|
-
await fence(bound.session, options.signal);
|
|
37457
|
-
}
|
|
37458
|
-
return p.status === "current" ? "ready" : p.status === "conflict" ? "incompatible" : "setup_required";
|
|
37459
|
-
},
|
|
37460
|
-
async plan(options = {}) {
|
|
37472
|
+
assess(options = {}) {
|
|
37461
37473
|
return exclusive2(async () => {
|
|
37462
|
-
await
|
|
37463
|
-
if (
|
|
37464
|
-
|
|
37465
|
-
|
|
37466
|
-
|
|
37467
|
-
|
|
37468
|
-
}
|
|
37469
|
-
await reconcile(options.signal);
|
|
37470
|
-
const { s, review, options: original } = await native(options);
|
|
37471
|
-
const result2 = word(s, review);
|
|
37472
|
-
plans.set(result2, { session: s, review, options: original, consumed: false });
|
|
37473
|
-
return result2;
|
|
37474
|
+
const p = await plan(options), bound = plans.get(p);
|
|
37475
|
+
if (bound) {
|
|
37476
|
+
release = cancel(bound.session, bound.review.ticket);
|
|
37477
|
+
await fence(bound.session, options.signal);
|
|
37478
|
+
}
|
|
37479
|
+
return p.status === "current" ? "ready" : p.status === "conflict" ? "incompatible" : "setup_required";
|
|
37474
37480
|
});
|
|
37475
37481
|
},
|
|
37476
|
-
|
|
37482
|
+
plan(options = {}) {
|
|
37483
|
+
return exclusive2(() => plan(options));
|
|
37484
|
+
},
|
|
37485
|
+
async apply(plan2, options = {}) {
|
|
37477
37486
|
return exclusive2(async () => {
|
|
37478
|
-
if (noops.has(
|
|
37487
|
+
if (noops.has(plan2)) {
|
|
37479
37488
|
await fence(void 0, options.signal);
|
|
37480
37489
|
return "ready";
|
|
37481
37490
|
}
|
|
37482
|
-
let bound = plans.get(
|
|
37491
|
+
let bound = plans.get(plan2);
|
|
37483
37492
|
if (!bound) throw new TypeError("setup.apply needs the original plan returned by setup.plan");
|
|
37484
37493
|
if (bound.consumed) throw changed();
|
|
37485
|
-
if (
|
|
37486
|
-
if (
|
|
37494
|
+
if (plan2.refusal) throw mdbaseError(plan2.refusal.code === "setup_conflict" ? "conflict" : "forbidden", plan2.refusal.message, plan2.refusal.code);
|
|
37495
|
+
if (plan2.status === "current") {
|
|
37487
37496
|
await fence(bound.session, options.signal);
|
|
37488
37497
|
const after = await native({ signal: options.signal });
|
|
37489
37498
|
await cancel(after.s, after.review.ticket);
|
|
@@ -37526,7 +37535,7 @@ ${end.comment}` : end.comment;
|
|
|
37526
37535
|
const fresh = await native({ ...bound.options, signal: options.signal });
|
|
37527
37536
|
try {
|
|
37528
37537
|
await fence(fresh.s, options.signal);
|
|
37529
|
-
if (fresh.review.assessment.status !== "provision" || shown(word(fresh.s, fresh.review), fresh.review) !== shown(
|
|
37538
|
+
if (fresh.review.assessment.status !== "provision" || shown(word(fresh.s, fresh.review), fresh.review) !== shown(plan2, bound.review)) throw changed(mid, e);
|
|
37530
37539
|
} catch (error5) {
|
|
37531
37540
|
await cancel(fresh.s, fresh.review.ticket);
|
|
37532
37541
|
throw error5;
|
|
@@ -37998,6 +38007,7 @@ ${end.comment}` : end.comment;
|
|
|
37998
38007
|
storeValue;
|
|
37999
38008
|
registration = null;
|
|
38000
38009
|
tokens = /* @__PURE__ */ new Map();
|
|
38010
|
+
routeProbe;
|
|
38001
38011
|
refreshing = /* @__PURE__ */ new Map();
|
|
38002
38012
|
forgotten = /* @__PURE__ */ new Set();
|
|
38003
38013
|
/** Bumped by every whole-store wipe: work prepared under an older epoch
|
|
@@ -38466,8 +38476,14 @@ ${end.comment}` : end.comment;
|
|
|
38466
38476
|
/** The collection's availability now, from its route. Never throws for `unavailable`. */
|
|
38467
38477
|
async availability(collection2, options = {}) {
|
|
38468
38478
|
const id6 = collection2.toLowerCase();
|
|
38479
|
+
const probe = this.routeProbe = {};
|
|
38469
38480
|
try {
|
|
38470
|
-
|
|
38481
|
+
const { token, route: route2, availability } = await this.route(id6, options.signal);
|
|
38482
|
+
const credentials = this.tokens.get(id6);
|
|
38483
|
+
if (availability.state === "available" && !options.signal?.aborted && credentials?.access === token) {
|
|
38484
|
+
probe.ready = { credentials, route: route2, until: performance.now() + 3e3, signal: options.signal };
|
|
38485
|
+
}
|
|
38486
|
+
return availability;
|
|
38471
38487
|
} catch (e) {
|
|
38472
38488
|
const reason = isMdbaseError(e) ? fieldOf(e.details, "availability") : void 0;
|
|
38473
38489
|
if (typeof reason === "string") {
|
|
@@ -38505,7 +38521,7 @@ ${end.comment}` : end.comment;
|
|
|
38505
38521
|
}
|
|
38506
38522
|
}
|
|
38507
38523
|
/**
|
|
38508
|
-
* A connector for `connect()`:
|
|
38524
|
+
* A connector for `connect()`: each open uses a fresh route, refuses an
|
|
38509
38525
|
* unavailable collection with its reason, and opens a Noise IK session through the
|
|
38510
38526
|
* relay to a serving device (sticky while it stays listed). The first open pins
|
|
38511
38527
|
* its original consent/key identity; new consent requires a new connector.
|
|
@@ -38519,6 +38535,8 @@ ${end.comment}` : end.comment;
|
|
|
38519
38535
|
return registerNextRelayFence({
|
|
38520
38536
|
description: `app-grant:${id6}`,
|
|
38521
38537
|
open: async (hello, signal) => {
|
|
38538
|
+
const primed = original === void 0 ? this.routeProbe?.ready : void 0;
|
|
38539
|
+
this.routeProbe = void 0;
|
|
38522
38540
|
const grant = await (original ??= this.heldGrant(id6));
|
|
38523
38541
|
await this.assertCurrent(grant);
|
|
38524
38542
|
const connector = noiseConnector({
|
|
@@ -38526,7 +38544,7 @@ ${end.comment}` : end.comment;
|
|
|
38526
38544
|
staticKey: staticKeyOf2(grant),
|
|
38527
38545
|
target: async (s) => {
|
|
38528
38546
|
await this.assertCurrent(grant);
|
|
38529
|
-
const { token, route: route2, availability } = await this.route(id6, s);
|
|
38547
|
+
const { token, route: route2, availability } = primed && !primed.signal?.aborted && performance.now() < primed.until && primed.credentials === this.tokens.get(id6) && sameGrant(grant, primed.credentials) && primed.credentials.expiresAt > Date.now() ? { token: primed.credentials.access, route: primed.route, availability: { state: "available" } } : await this.route(id6, s);
|
|
38530
38548
|
await this.assertCurrent(grant);
|
|
38531
38549
|
if (availability.state === "unavailable") throw collectionUnavailableError(availability.reason);
|
|
38532
38550
|
if (!UUID10.test(route2.grant)) throw mdbaseError("unauthenticated", "the route names no grant", "route_mismatch");
|
|
@@ -38625,6 +38643,7 @@ ${end.comment}` : end.comment;
|
|
|
38625
38643
|
await store2.deleteGrant(id6);
|
|
38626
38644
|
this.forgotten.add(id6);
|
|
38627
38645
|
this.tokens.delete(id6);
|
|
38646
|
+
this.routeProbe = void 0;
|
|
38628
38647
|
});
|
|
38629
38648
|
}
|
|
38630
38649
|
/**
|
|
@@ -38643,6 +38662,7 @@ ${end.comment}` : end.comment;
|
|
|
38643
38662
|
* or runs after and fails its revision/epoch check instead of re-saving.
|
|
38644
38663
|
*/
|
|
38645
38664
|
async forgetAllGrants() {
|
|
38665
|
+
this.routeProbe = void 0;
|
|
38646
38666
|
this.epoch++;
|
|
38647
38667
|
const store2 = await this.store();
|
|
38648
38668
|
let ids = [];
|
|
@@ -50755,12 +50775,12 @@ ${end.comment}` : end.comment;
|
|
|
50755
50775
|
// src/application/asset-pins.json
|
|
50756
50776
|
var asset_pins_default = {
|
|
50757
50777
|
runtime: {
|
|
50758
|
-
sha256: "
|
|
50759
|
-
bytes:
|
|
50760
|
-
maxBytes:
|
|
50778
|
+
sha256: "3c14689c6b0f38c3b151981c25a6a2b39129ae07f2a606ed5188442c631ad5b4",
|
|
50779
|
+
bytes: 3982455,
|
|
50780
|
+
maxBytes: 3982455,
|
|
50761
50781
|
source: {
|
|
50762
50782
|
repository: "mdbase-dev/mdbase-connect",
|
|
50763
|
-
commit: "
|
|
50783
|
+
commit: "a8eb987856eb3b76ff7310688aeea328d58b4f39"
|
|
50764
50784
|
}
|
|
50765
50785
|
},
|
|
50766
50786
|
sqlite: {
|
|
@@ -52460,10 +52480,21 @@ ${end.comment}` : end.comment;
|
|
|
52460
52480
|
bind(account, grants) {
|
|
52461
52481
|
const next = grants.filter((c) => c.account_id === account);
|
|
52462
52482
|
if (this.bindingsAccount === account && JSON.stringify(next) === JSON.stringify(this.bindings)) return;
|
|
52483
|
+
const previous = this.bindings;
|
|
52463
52484
|
this.bindingsAccount = account;
|
|
52464
52485
|
this.bindings = Object.freeze([...next]);
|
|
52465
52486
|
this.settled = null;
|
|
52466
52487
|
this.listed = null;
|
|
52488
|
+
const open2 = this.open;
|
|
52489
|
+
if (open2) {
|
|
52490
|
+
const original = previous?.find((c) => c.collection_id === open2.id);
|
|
52491
|
+
const replacement = next.find((c) => c.collection_id === open2.id);
|
|
52492
|
+
if (!replacement || account !== open2.scope.account) this.close(false);
|
|
52493
|
+
else if (replacement.grant_id !== original?.grant_id || replacement.client_noise_public_key !== original?.client_noise_public_key) {
|
|
52494
|
+
void this.openCollection(open2.id, open2.scope).catch(() => {
|
|
52495
|
+
});
|
|
52496
|
+
}
|
|
52497
|
+
}
|
|
52467
52498
|
this.setList([]);
|
|
52468
52499
|
}
|
|
52469
52500
|
async nativeAuthorization(call2, portal, signal) {
|
|
@@ -52580,6 +52611,7 @@ ${end.comment}` : end.comment;
|
|
|
52580
52611
|
this.close(false);
|
|
52581
52612
|
const open2 = {
|
|
52582
52613
|
id: collectionId,
|
|
52614
|
+
scope,
|
|
52583
52615
|
life: new AbortController(),
|
|
52584
52616
|
client: null,
|
|
52585
52617
|
setup: null,
|