@haverstack/core 0.34.0 → 0.36.0
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/README.md +1 -1
- package/dist/access.d.ts +39 -34
- package/dist/access.d.ts.map +1 -1
- package/dist/access.js +94 -68
- package/dist/access.js.map +1 -1
- package/dist/changes.d.ts +22 -33
- package/dist/changes.d.ts.map +1 -1
- package/dist/changes.js +34 -48
- package/dist/changes.js.map +1 -1
- package/dist/combine.d.ts.map +1 -1
- package/dist/combine.js +7 -0
- package/dist/combine.js.map +1 -1
- package/dist/grants.d.ts +78 -33
- package/dist/grants.d.ts.map +1 -1
- package/dist/grants.js +164 -72
- package/dist/grants.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/query-validation.d.ts +20 -1
- package/dist/query-validation.d.ts.map +1 -1
- package/dist/query-validation.js +107 -3
- package/dist/query-validation.js.map +1 -1
- package/dist/record-changes.d.ts +71 -63
- package/dist/record-changes.d.ts.map +1 -1
- package/dist/record-changes.js +129 -85
- package/dist/record-changes.js.map +1 -1
- package/dist/scoped-stack.d.ts +118 -116
- package/dist/scoped-stack.d.ts.map +1 -1
- package/dist/scoped-stack.js +210 -188
- package/dist/scoped-stack.js.map +1 -1
- package/dist/stack.d.ts +143 -160
- package/dist/stack.d.ts.map +1 -1
- package/dist/stack.js +271 -225
- package/dist/stack.js.map +1 -1
- package/dist/testing.d.ts +3 -8
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +42 -49
- package/dist/testing.js.map +1 -1
- package/dist/types.d.ts +128 -101
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +0 -2
- package/dist/validate.js.map +1 -1
- package/dist/wire-record.d.ts.map +1 -1
- package/dist/wire-record.js.map +1 -1
- package/package.json +1 -1
package/dist/scoped-stack.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* See docs/spec/access-control.md and docs/spec/events.md § Permission scoping.
|
|
19
19
|
*/
|
|
20
20
|
import { ChangeEmitter } from './changes.js';
|
|
21
|
-
import type { AppId,
|
|
21
|
+
import type { AppId, AttachmentContent, AuthorityAssociation, DataAssociation, EntityId, QueryResult, RecordChange, RecordVersion, RecordJournalEntry, JournalQuery, StackAdapter, StackFeatures, StackQuery, StackRecord, SubscribeOptions, TypeId, Unsubscribe, RecordChanges } from './types.js';
|
|
22
22
|
import type { Stack, BackdatableCreateRecordOptions, CollectAttachmentGarbageOptions, CollectAttachmentGarbageResult, DeleteRecordOptions, DeleteResult, GetRecordOptions, IfVersionOptions, StackClient } from './stack.js';
|
|
23
23
|
/**
|
|
24
24
|
* A permission-enforcing view of a Stack for a single (principal, subject)
|
|
@@ -26,21 +26,16 @@ import type { Stack, BackdatableCreateRecordOptions, CollectAttachmentGarbageOpt
|
|
|
26
26
|
* cannot read answers exactly as a missing one does — null on reads,
|
|
27
27
|
* StackNotFoundError on the verbs that name one — so only a requester who
|
|
28
28
|
* could have read it is told a refusal was about access.
|
|
29
|
-
* See docs/spec/
|
|
29
|
+
* See docs/spec/disclosure.md § Which refusal a Record answers with.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* identity: it answers *what data is reachable* for the subject (an owner
|
|
40
|
-
* subject resolves past every permission check) and *who may exercise a
|
|
41
|
-
* privileged verb* for the principal (an owner app is not bounded by
|
|
42
|
-
* grants). Under delegation both halves apply, and a mistake on the
|
|
43
|
-
* authority side is an escalation rather than a preference.
|
|
31
|
+
* Which identity each gate keys on follows the module comment's rule.
|
|
32
|
+
* Grant lookup and the privilege-bearing gates no grant reaches
|
|
33
|
+
* (resharing, group management, hard delete, widening access at create
|
|
34
|
+
* time) key on `principalEntityId`; authorship, `-own` matching,
|
|
35
|
+
* record-level permission resolution and "files I uploaded" lookups key on
|
|
36
|
+
* `subjectEntityId`. Unconditional owner access splits the same way: an
|
|
37
|
+
* owner subject resolves past every permission check, an owner principal
|
|
38
|
+
* is not bounded by grants, and under delegation both halves apply.
|
|
44
39
|
*/
|
|
45
40
|
export declare class ScopedStack implements StackClient {
|
|
46
41
|
private readonly stack;
|
|
@@ -56,6 +51,14 @@ export declare class ScopedStack implements StackClient {
|
|
|
56
51
|
private loadGrants;
|
|
57
52
|
/** Whether a delegated app is acting for someone other than itself. */
|
|
58
53
|
private get delegated();
|
|
54
|
+
/**
|
|
55
|
+
* Whether any grant could name this request — the one question every
|
|
56
|
+
* prefetch asks before scanning the `_grant` family, since an anonymous
|
|
57
|
+
* requester is reached by none. Both identities are read: `asEntity()`
|
|
58
|
+
* refuses an anonymous principal acting for a subject, so they are null
|
|
59
|
+
* together, and saying so costs nothing.
|
|
60
|
+
*/
|
|
61
|
+
private get identified();
|
|
59
62
|
/**
|
|
60
63
|
* Who this request is, for stamping onto whatever it mutates. Attribution
|
|
61
64
|
* follows record-level authorship: the subject is the actor, and the
|
|
@@ -72,11 +75,7 @@ export declare class ScopedStack implements StackClient {
|
|
|
72
75
|
* docs/spec/access-control.md § Delegation: principal and subject.
|
|
73
76
|
*/
|
|
74
77
|
private get ownerActingAlone();
|
|
75
|
-
/**
|
|
76
|
-
* Refuse anything but the owner acting as itself. The verbs resting on
|
|
77
|
-
* this tier are irreversible or disclose the sharing graph, so delegation
|
|
78
|
-
* never carries one to a subject — see ownerActingAlone.
|
|
79
|
-
*/
|
|
78
|
+
/** Refuse anything but the owner acting as itself — see ownerActingAlone. */
|
|
80
79
|
private requireOwnerActingAlone;
|
|
81
80
|
private checkRead;
|
|
82
81
|
private checkWrite;
|
|
@@ -85,13 +84,12 @@ export declare class ScopedStack implements StackClient {
|
|
|
85
84
|
* type's family (grants match by baseId, so a version bump never orphans
|
|
86
85
|
* one). -own actions additionally require record.entityId === grantee,
|
|
87
86
|
* unless `matchOwn` is false — on the principal side of a delegated
|
|
88
|
-
* request the suffix
|
|
87
|
+
* request the suffix reads as the bare verb, since which records are
|
|
89
88
|
* reachable is the subject's business. `allowDefault` decides whether a
|
|
90
|
-
* grant naming nobody counts.
|
|
89
|
+
* grant naming nobody counts.
|
|
91
90
|
*
|
|
92
91
|
* Reached only through subjectAllows()/principalAllows(), which fix those
|
|
93
|
-
* two flags per side
|
|
94
|
-
* See docs/spec/access-control.md § Type-level grants.
|
|
92
|
+
* two flags per side. Call one of those instead.
|
|
95
93
|
*/
|
|
96
94
|
private hasGrant;
|
|
97
95
|
/**
|
|
@@ -102,15 +100,11 @@ export declare class ScopedStack implements StackClient {
|
|
|
102
100
|
* Vacuously true when there's no delegation, where the principal and
|
|
103
101
|
* subject checks would be the same question asked twice.
|
|
104
102
|
*
|
|
105
|
-
*
|
|
106
|
-
* people who turn up, not software the
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* Group-targeted grants don't count here either, one step removed: a
|
|
111
|
-
* roster is editable by any of the group's admins, so authority reaching
|
|
112
|
-
* a principal through one would let someone other than the owner name an
|
|
113
|
-
* app to a type. See docs/spec/access-control.md § Type-level grants.
|
|
103
|
+
* Neither default nor group-targeted grants count here. "Any
|
|
104
|
+
* authenticated entity" is about people who turn up, not software the
|
|
105
|
+
* owner installed; and a roster is editable by any of the group's admins,
|
|
106
|
+
* so authority reaching a principal through one would let someone other
|
|
107
|
+
* than the owner name an app to a type.
|
|
114
108
|
*/
|
|
115
109
|
private principalAllows;
|
|
116
110
|
/**
|
|
@@ -129,7 +123,7 @@ export declare class ScopedStack implements StackClient {
|
|
|
129
123
|
* everyone else is told what a missing ID is told, so no one learns an ID
|
|
130
124
|
* is live who could not have learned it by reading. `message` therefore
|
|
131
125
|
* only ever reaches someone holding the record already.
|
|
132
|
-
* See docs/spec/
|
|
126
|
+
* See docs/spec/disclosure.md § Which refusal a Record answers with.
|
|
133
127
|
*/
|
|
134
128
|
private denialFor;
|
|
135
129
|
private canRead;
|
|
@@ -176,26 +170,19 @@ export declare class ScopedStack implements StackClient {
|
|
|
176
170
|
* relationship target). Missing and unreadable both return false —
|
|
177
171
|
* indistinguishable, so this can't probe for a record's existence.
|
|
178
172
|
*
|
|
179
|
-
* The owner acting alone passes without the lookup
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* refusal standing in for it. The anti-oracle property is unchanged for
|
|
184
|
-
* every other requester.
|
|
185
|
-
* See docs/spec/access-control.md § Reference-creation gating.
|
|
173
|
+
* The owner acting alone passes without the lookup: there is no record in
|
|
174
|
+
* their own stack they may not read, so the gate could only refuse them
|
|
175
|
+
* for absence — which is `Stack`'s to answer, with a conflict that names
|
|
176
|
+
* the problem. See docs/spec/access-control.md § Reference-creation gating.
|
|
186
177
|
*/
|
|
187
178
|
private canReadReferent;
|
|
188
179
|
/**
|
|
189
180
|
* Whether this request can read some record referencing `fileId` —
|
|
190
181
|
* shared by canAccessFile() and the non-owner _attachment@1 create()
|
|
191
|
-
* carve-out, which deliberately excludes the uploader clause.
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* file, never by the requester's own prior metadata record for it —
|
|
196
|
-
* allowing that would let one successful guess unlock unlimited further
|
|
197
|
-
* metadata records for the same fileId, reintroducing the circularity
|
|
198
|
-
* the carve-out's uploader-clause exclusion closes.
|
|
182
|
+
* carve-out, which deliberately excludes the uploader clause.
|
|
183
|
+
* `_attachment@1` records never match: the carve-out has to be satisfied
|
|
184
|
+
* by some *other* record referencing the file, or one successful guess
|
|
185
|
+
* would unlock unlimited further metadata records for the same fileId.
|
|
199
186
|
* See docs/spec/attachments.md § Creating `_attachment@1` records directly.
|
|
200
187
|
*/
|
|
201
188
|
private hasReadableReference;
|
|
@@ -236,8 +223,9 @@ export declare class ScopedStack implements StackClient {
|
|
|
236
223
|
* creation refused save one carve-out. A scoped create always stamps
|
|
237
224
|
* authorship — an absent entityId means an unscoped `Stack` wrote it.
|
|
238
225
|
* `createdAt`/`updatedAt` are refused to everyone but the owner acting
|
|
239
|
-
* alone
|
|
240
|
-
* See
|
|
226
|
+
* alone, rather than dropped, so an app never believes it published
|
|
227
|
+
* something it didn't. See docs/spec/access-control.md and
|
|
228
|
+
* docs/spec/data-model.md § Record IDs.
|
|
241
229
|
*/
|
|
242
230
|
create<T extends Record<string, unknown> = Record<string, unknown>>(typeId: TypeId, content: T, opts?: BackdatableCreateRecordOptions): Promise<StackRecord & {
|
|
243
231
|
content: T;
|
|
@@ -265,7 +253,7 @@ export declare class ScopedStack implements StackClient {
|
|
|
265
253
|
* A record this request may read, or null. Never throws
|
|
266
254
|
* StackPermissionError: an unreadable record answers exactly as a missing
|
|
267
255
|
* one does, so a caller learns only what it may read.
|
|
268
|
-
* See docs/spec/
|
|
256
|
+
* See docs/spec/disclosure.md § Which refusal a Record answers with.
|
|
269
257
|
*/
|
|
270
258
|
get(id: string, opts?: GetRecordOptions): Promise<StackRecord | null>;
|
|
271
259
|
/**
|
|
@@ -303,38 +291,50 @@ export declare class ScopedStack implements StackClient {
|
|
|
303
291
|
* deliberately does not confer.
|
|
304
292
|
*/
|
|
305
293
|
private requireReshareable;
|
|
294
|
+
/**
|
|
295
|
+
* Whether a change set's `permissions` key actually moves the ACL. Read
|
|
296
|
+
* off the computed delta rather than the elements the caller supplied:
|
|
297
|
+
* a gate that inspected only what was named would miss the wholesale
|
|
298
|
+
* replacement that drops everything, which names nothing at all. Any
|
|
299
|
+
* add, remove or repoint in either direction is a reshare.
|
|
300
|
+
* See docs/spec/access-control.md § Record-level permissions.
|
|
301
|
+
*/
|
|
302
|
+
private permissionsMove;
|
|
306
303
|
/** The reshare decision alone, for a record already read and write-gated. */
|
|
307
304
|
private requireReshareOf;
|
|
305
|
+
/**
|
|
306
|
+
* Whether this request may decide who else reaches `record` — the
|
|
307
|
+
* decision requireReshareOf() refuses on, without the refusal, for the
|
|
308
|
+
* read paths that project on it rather than throw.
|
|
309
|
+
*
|
|
310
|
+
* A `_group` asks management, not authorship: a creator later demoted
|
|
311
|
+
* from the admin roster shouldn't retain a side door to reassign who can
|
|
312
|
+
* read or write the group record. Everything else is intersected like
|
|
313
|
+
* every other authority here, or an owner principal would carry its
|
|
314
|
+
* subject to records the subject cannot touch.
|
|
315
|
+
*/
|
|
316
|
+
private canReshare;
|
|
308
317
|
/**
|
|
309
318
|
* Naming the software behind a key is the trust decision the `_app`
|
|
310
319
|
* registry exists to record, so both halves of that binding — `did` and
|
|
311
|
-
* `appId` — belong to the owner alone.
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
* pointed at a write-holder's own key while keeping the name the owner
|
|
316
|
-
* gave it, or relabelled to claim another app's `appId`. `name` and
|
|
317
|
-
* `version` stay writable — they are display, not lookup.
|
|
320
|
+
* `appId` — belong to the owner alone. Without this, record-level `write`
|
|
321
|
+
* on a card would be a second way in: one carrying no DID yet could be
|
|
322
|
+
* pointed at a write-holder's own key, or relabelled to claim another
|
|
323
|
+
* app's `appId`. `name` and `version` stay writable — display, not lookup.
|
|
318
324
|
*
|
|
319
|
-
* Owner *acting alone*, in both directions
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* `_entity` deliberately does not get this rule: naming people is what a
|
|
325
|
-
* contacts app does, so its cards stay writable by grant. Uniqueness and
|
|
326
|
-
* immutability still bind them. See docs/spec/identity.md § DID bindings.
|
|
325
|
+
* Owner *acting alone*, in both directions, or the same route reopens
|
|
326
|
+
* from the subject's side. `_entity` deliberately does not get this rule:
|
|
327
|
+
* naming people is what a contacts app does, so its cards stay writable
|
|
328
|
+
* by grant. See docs/spec/identity.md § DID bindings.
|
|
327
329
|
*/
|
|
328
330
|
private requireOwnerForAppIdentity;
|
|
329
331
|
/**
|
|
330
332
|
* A self-reported `appId` must agree with the `_app` card naming the
|
|
331
|
-
* principal's DID, where the owner registered one
|
|
333
|
+
* principal's DID, where the owner registered one: `principalId` is
|
|
332
334
|
* verified, so letting the pair disagree would leave a verified principal
|
|
333
|
-
* claiming a name the owner gave different software
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
* every undelegated writer.
|
|
337
|
-
* See docs/spec/identity.md § Attribution and what can be trusted.
|
|
335
|
+
* claiming a name the owner gave different software. A principal with no
|
|
336
|
+
* card keeps `appId` as the bare self-report it is for every undelegated
|
|
337
|
+
* writer. See docs/spec/identity.md § Attribution and what can be trusted.
|
|
338
338
|
*/
|
|
339
339
|
private requireAppIdMatchesPrincipal;
|
|
340
340
|
/**
|
|
@@ -355,8 +355,26 @@ export declare class ScopedStack implements StackClient {
|
|
|
355
355
|
* See docs/spec/access-control.md § Type-level grants.
|
|
356
356
|
*/
|
|
357
357
|
private requireOwnerForGrantRecord;
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Gated on the write bit alone, which is why the kind refusal comes
|
|
360
|
+
* first: authority reached through this verb would be exactly the
|
|
361
|
+
* escalation the partition exists to stop, decided before any record is
|
|
362
|
+
* read so it cannot depend on who is asking.
|
|
363
|
+
*/
|
|
364
|
+
associate(id: string, association: DataAssociation): Promise<StackRecord>;
|
|
365
|
+
/** See associate() — the same write gate, the same kind refusal. */
|
|
366
|
+
dissociate(id: string, association: DataAssociation): Promise<StackRecord>;
|
|
367
|
+
/**
|
|
368
|
+
* Extend who reaches a record — the reshare gate's own verb, on the
|
|
369
|
+
* owner-or-creator rule the `permissions` key carries. The write bit
|
|
370
|
+
* does not confer it: a write-holder who could grant would escalate to
|
|
371
|
+
* deciding who else reaches the record, which is the whole of what
|
|
372
|
+
* scoping access is for.
|
|
373
|
+
* See docs/spec/access-control.md § Record-level permissions.
|
|
374
|
+
*/
|
|
375
|
+
grantAccess(id: string, permission: AuthorityAssociation): Promise<StackRecord>;
|
|
376
|
+
/** Withdraw one element of who reaches a record — see grantAccess(). */
|
|
377
|
+
revokeAccess(id: string, permission: AuthorityAssociation): Promise<StackRecord>;
|
|
360
378
|
/**
|
|
361
379
|
* Hard delete is owner-only: it is irreversible and destroys version
|
|
362
380
|
* history, so neither the write bit nor delete-own/delete-any grants
|
|
@@ -372,61 +390,45 @@ export declare class ScopedStack implements StackClient {
|
|
|
372
390
|
undelete(id: string, opts?: IfVersionOptions): Promise<StackRecord>;
|
|
373
391
|
/**
|
|
374
392
|
* History is the mutation/recovery surface, not a read surface — gated
|
|
375
|
-
* like patchContent(),
|
|
376
|
-
* the
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
* alone: seeing how a Record you can already read got that way is not
|
|
380
|
-
* the escalation that fence exists to stop, and losing it would leave a
|
|
381
|
-
* write-holder unable to audit the Record they hold.
|
|
382
|
-
* See docs/spec/versioning.md § History access.
|
|
393
|
+
* like patchContent(). Reading it changes nothing, so it is the one path
|
|
394
|
+
* the `_grant` write fence leaves alone: seeing how a Record you can
|
|
395
|
+
* already read got that way is not the escalation that fence exists to
|
|
396
|
+
* stop. See docs/spec/versioning.md § History access.
|
|
383
397
|
*/
|
|
384
398
|
getVersions(id: string): Promise<RecordVersion[]>;
|
|
385
399
|
/**
|
|
386
400
|
* See getVersions() — the same mutate-surface gate, for the same reason.
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
401
|
+
*
|
|
402
|
+
* The journal is where a Record's sharing history lives, and that half
|
|
403
|
+
* is the resharer's: a reader who could not have moved the ACL is served
|
|
404
|
+
* the `permissions` op without the elements beneath it, so the entry
|
|
405
|
+
* still names that it moved. Asked of both identities, so delegation is
|
|
406
|
+
* no route to it either. See docs/spec/journal.md § Reading it.
|
|
390
407
|
*/
|
|
391
408
|
getJournal(id: string, query?: JournalQuery): Promise<RecordJournalEntry[]>;
|
|
392
|
-
/** See getVersions() — same mutate-surface gate
|
|
409
|
+
/** See getVersions() — the same mutate-surface gate. */
|
|
393
410
|
getVersion(id: string, version: number): Promise<RecordVersion | null>;
|
|
394
411
|
/**
|
|
395
412
|
* Re-runs the reference-creation checks against the snapshot, so a
|
|
396
|
-
* restore can't re-convey access to a file
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
* against the subject, which is whose reach the restore would widen.
|
|
401
|
-
* See docs/spec/versioning.md § Restore semantics.
|
|
413
|
+
* restore can't re-convey access to a file the subject can no longer
|
|
414
|
+
* reach today. Only the owner acting alone is exempt: under delegation
|
|
415
|
+
* the checks resolve against the subject, which is whose reach the
|
|
416
|
+
* restore would widen. See docs/spec/versioning.md § Restore semantics.
|
|
402
417
|
*/
|
|
403
418
|
restoreVersion(id: string, version: number, opts?: IfVersionOptions): Promise<StackRecord>;
|
|
404
419
|
/**
|
|
405
|
-
* Commit a per-record migration — **the owner acting alone, only
|
|
420
|
+
* Commit a per-record migration — **the owner acting alone, only**, the
|
|
421
|
+
* same restriction the bulk `migrateAll()` carries by living on `Stack`.
|
|
406
422
|
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
* same way `grant()`/`revoke()` are. This is its per-record counterpart
|
|
410
|
-
* and carries the same restriction, rather than inventing a grant model
|
|
411
|
-
* that the bulk path deliberately doesn't have.
|
|
412
|
-
*
|
|
413
|
-
* The restriction is what makes the verb safe to expose at all. Migrate
|
|
414
|
-
* replaces `content` and `typeId` wholesale, so a grant-based version
|
|
415
|
-
* would have to re-derive every gate `create()` applies at the
|
|
423
|
+
* Migrate replaces `content` and `typeId` wholesale, so a grant-based
|
|
424
|
+
* version would have to re-derive every gate `create()` applies at the
|
|
416
425
|
* destination *and* every gate `mutate()` applies over the existing
|
|
417
|
-
* content,
|
|
418
|
-
* non-owner `_attachment@1` refusal
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
* (see docs/spec/attachments.md § Creating `_attachment@1` records
|
|
424
|
-
* directly). Ordinary write access to a record is not consent to move it
|
|
425
|
-
* between families.
|
|
426
|
-
*
|
|
427
|
-
* A server implementing `POST /records/:id/migrate` therefore serves it
|
|
428
|
-
* to the stack owner and answers 403 otherwise. See
|
|
429
|
-
* docs/spec/data-model.md § Type migrations.
|
|
426
|
+
* content, reopening each one it missed. The sharpest is create()'s
|
|
427
|
+
* non-owner `_attachment@1` refusal: without it, a requester could
|
|
428
|
+
* migrate a record they authored into the family naming any `fileId` and
|
|
429
|
+
* read the bytes through canAccessFile()'s uploader clause. Ordinary
|
|
430
|
+
* write access to a record is not consent to move it between families.
|
|
431
|
+
* See docs/spec/data-model.md § Type migrations.
|
|
430
432
|
*/
|
|
431
433
|
commitMigration(id: string, toTypeId: TypeId, content: Record<string, unknown>, opts?: IfVersionOptions): Promise<StackRecord>;
|
|
432
434
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-stack.d.ts","sourceRoot":"","sources":["../src/scoped-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EACL,aAAa,EAKd,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAGV,KAAK,
|
|
1
|
+
{"version":3,"file":"scoped-stack.d.ts","sourceRoot":"","sources":["../src/scoped-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EACL,aAAa,EAKd,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAGV,KAAK,EAEL,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,QAAQ,EAGR,WAAW,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,aAAa,EACd,MAAM,YAAY,CAAC;AA6CpB,OAAO,KAAK,EACV,KAAK,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,EAC9B,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACZ,MAA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