@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/changes.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* to remember. See docs/spec/events.md.
|
|
15
15
|
*/
|
|
16
16
|
import { StackQueryError } from './errors.js';
|
|
17
|
-
import { bumpsVersion, feedAssociationDelta } from './record-changes.js';
|
|
17
|
+
import { bumpsVersion, feedAssociationDelta, movesAuthority } from './record-changes.js';
|
|
18
18
|
/** The `baseId@version` split, as grants and query filters read it. */
|
|
19
19
|
const baseIdOf = (typeId) => typeId.split('@')[0];
|
|
20
20
|
/**
|
|
@@ -51,15 +51,10 @@ export function matchesFilter(emitted, filter) {
|
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Whether an emission passes the unlisted-enumeration boundary for one
|
|
54
|
-
* subscription.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* otherwise failing this very check. Without that exception a subscriber
|
|
59
|
-
* who already knows the record would never be told to drop it. Every other
|
|
60
|
-
* transition (create-unlisted, an edit while already unlisted, a purge of
|
|
61
|
-
* a record that was never listed, the `list` transition itself) needs no
|
|
62
|
-
* special-casing: it falls out of checking the record's current state.
|
|
54
|
+
* subscription. The `unlist` transition is the one exception to the
|
|
55
|
+
* default exclusion: without it a subscriber who already knows the record
|
|
56
|
+
* would never be told to drop it. Every other transition falls out of
|
|
57
|
+
* checking the record's current state.
|
|
63
58
|
* See docs/spec/events.md § The unlisted transition.
|
|
64
59
|
*/
|
|
65
60
|
export function passesUnlistedBoundary(emitted, includeUnlisted) {
|
|
@@ -78,9 +73,7 @@ export function passesUnlistedBoundary(emitted, includeUnlisted) {
|
|
|
78
73
|
* nothing.
|
|
79
74
|
*
|
|
80
75
|
* The record rides by reference, shared across every frame projected from
|
|
81
|
-
* one emission: handlers are contractually read-only over it
|
|
82
|
-
* per subscriber would charge every consumer for a defect none of them
|
|
83
|
-
* have. See docs/spec/events.md § The event shape.
|
|
76
|
+
* one emission: handlers are contractually read-only over it.
|
|
84
77
|
*/
|
|
85
78
|
export function emitted(emission, includeRecords) {
|
|
86
79
|
const { change, record } = emission;
|
|
@@ -108,12 +101,7 @@ export class Subscription {
|
|
|
108
101
|
close() {
|
|
109
102
|
this.closed = true;
|
|
110
103
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Hand a frame to the handler. A handler that throws cannot fail the
|
|
113
|
-
* write it is being told about — the write is already durable — so the
|
|
114
|
-
* error goes to onError, or is rethrown asynchronously so that it
|
|
115
|
-
* surfaces as an unhandled error rather than vanishing.
|
|
116
|
-
*/
|
|
104
|
+
/** Hand a frame to the handler; anything it throws goes to reportError(). */
|
|
117
105
|
deliver(emission) {
|
|
118
106
|
if (this.closed)
|
|
119
107
|
return;
|
|
@@ -129,10 +117,11 @@ export class Subscription {
|
|
|
129
117
|
}
|
|
130
118
|
}
|
|
131
119
|
/**
|
|
132
|
-
* Where a handler's error goes.
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
120
|
+
* Where a handler's error goes. Never into the call stack of the mutation
|
|
121
|
+
* that produced the event — that write is already durable, so a handler
|
|
122
|
+
* cannot fail it. Without an onError the error is rethrown asynchronously,
|
|
123
|
+
* surfacing as an unhandled error rather than vanishing.
|
|
124
|
+
* See docs/spec/events.md § Handlers.
|
|
136
125
|
*/
|
|
137
126
|
function reportError(err, opts) {
|
|
138
127
|
if (opts.onError) {
|
|
@@ -140,8 +129,7 @@ function reportError(err, opts) {
|
|
|
140
129
|
opts.onError(err);
|
|
141
130
|
}
|
|
142
131
|
catch {
|
|
143
|
-
// An onError that throws has nowhere left to report to.
|
|
144
|
-
// better than letting it escape into a mutation's call stack.
|
|
132
|
+
// An onError that throws has nowhere left to report to.
|
|
145
133
|
}
|
|
146
134
|
return;
|
|
147
135
|
}
|
|
@@ -246,16 +234,12 @@ export class PendingChange {
|
|
|
246
234
|
* The live half, built from the record the write produced — for a purge,
|
|
247
235
|
* from the record as it stood immediately before destruction.
|
|
248
236
|
*
|
|
249
|
-
* The actor is read off the record for every version-bumping op,
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
* Hard delete leaves nothing to read at all, and its frame also drops
|
|
256
|
-
* `parentId` and the create-time `appId`: it says that a record of some
|
|
257
|
-
* type was destroyed and nothing further about whose it was. See
|
|
258
|
-
* docs/spec/events.md § Purged records carry nothing.
|
|
237
|
+
* The actor is read off the record for every version-bumping op, so it
|
|
238
|
+
* agrees with what was persisted by construction. A no-bump op stamps
|
|
239
|
+
* nothing, so the requester travels here instead — reading the record
|
|
240
|
+
* would report whoever's last version-bumping write this is. A purged
|
|
241
|
+
* frame drops `parentId` and the create-time `appId` too: it says a
|
|
242
|
+
* record of some type was destroyed and nothing about whose it was.
|
|
259
243
|
*/
|
|
260
244
|
emission(record, at) {
|
|
261
245
|
if (this.kind === 'purged') {
|
|
@@ -294,9 +278,14 @@ export class PendingChange {
|
|
|
294
278
|
/**
|
|
295
279
|
* The frame's two flat lists, flattened out of the one the journal
|
|
296
280
|
* takes. Present only where non-empty.
|
|
281
|
+
*
|
|
282
|
+
* The data half alone: the `permissions` op is what announces an ACL
|
|
283
|
+
* move, so a subscriber watching tags is never handed the sharing graph
|
|
284
|
+
* as a side effect of the partition sharing one delta.
|
|
285
|
+
* See docs/spec/events.md § The event shape.
|
|
297
286
|
*/
|
|
298
287
|
associationDeltas() {
|
|
299
|
-
const { added, removed } = feedAssociationDelta(this.moved.associations ?? []);
|
|
288
|
+
const { added, removed } = feedAssociationDelta((this.moved.associations ?? []).filter((c) => !movesAuthority(c)));
|
|
300
289
|
return {
|
|
301
290
|
...(added.length && { associationsAdded: added }),
|
|
302
291
|
...(removed.length && { associationsRemoved: removed }),
|
|
@@ -350,16 +339,13 @@ export class ChangeEmitter {
|
|
|
350
339
|
this.subscriptions.clear();
|
|
351
340
|
}
|
|
352
341
|
}
|
|
353
|
-
/** The kind each op produces. See docs/spec/events.md § The event shape. */
|
|
354
342
|
/**
|
|
355
343
|
* The kind a set of ops resolves to: the most conservative entry wins.
|
|
356
344
|
* `unlist` beats everything a change set can carry beside it, because a
|
|
357
|
-
* subscriber holding the record still has to drop it — announcing an
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* transitions that are always emitted alone
|
|
361
|
-
* `changed` unless it unlists.
|
|
362
|
-
* See docs/spec/events.md § The event shape.
|
|
345
|
+
* subscriber holding the record still has to drop it — announcing an edit
|
|
346
|
+
* bundled with an unlist as an upsert would leave a stale copy behind.
|
|
347
|
+
* Nothing else competes: `created` and `purged` name whole-record
|
|
348
|
+
* transitions that are always emitted alone.
|
|
363
349
|
*/
|
|
364
350
|
function resolveKind(ops) {
|
|
365
351
|
if (ops.includes('unlist'))
|
|
@@ -368,6 +354,7 @@ function resolveKind(ops) {
|
|
|
368
354
|
return CHANGE_KINDS[ops[0]];
|
|
369
355
|
return 'changed';
|
|
370
356
|
}
|
|
357
|
+
/** The kind each op produces. See docs/spec/events.md § The event shape. */
|
|
371
358
|
export const CHANGE_KINDS = {
|
|
372
359
|
create: 'created',
|
|
373
360
|
patch: 'changed',
|
|
@@ -397,11 +384,10 @@ const SEQ_FORMAT = /^[A-Za-z0-9_-]+$/;
|
|
|
397
384
|
* caller believe it resumed when it did not, so a stack that cannot honor
|
|
398
385
|
* `since` refuses it rather than ignoring it.
|
|
399
386
|
*
|
|
400
|
-
* Its shape is checked here rather than left to the adapter, so
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
* docs/spec/events.md § Subscribing.
|
|
387
|
+
* Its shape is checked here rather than left to the adapter, so a malformed
|
|
388
|
+
* cursor is the same error whoever is underneath. The value stays opaque:
|
|
389
|
+
* this asks whether it is framable, never what it means.
|
|
390
|
+
* See docs/spec/events.md § Subscribing.
|
|
405
391
|
*/
|
|
406
392
|
export function assertSinceUsable(since, relaysChanges) {
|
|
407
393
|
if (since === undefined)
|
package/dist/changes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../src/chang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,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,CAAC;IACnD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAiC;IACxD,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,QAAQ;IACvB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAyB,EAAE,aAAsB;IACjF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAChC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,eAAe,CACvB,yFAAyF;YACvF,sFAAsF;YACtF,qEAAqE,CACxE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,eAAe,CACvB,6CAA6C,KAAK,wCAAwC;YACxF,sFAAsF;YACtF,6DAA6D,CAChE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/combine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combine.d.ts","sourceRoot":"","sources":["../src/combine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"combine.d.ts","sourceRoot":"","sources":["../src/combine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAEjB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,gBAAgB,CAAC;CACxB,GAAG,YAAY,CAuEf"}
|
package/dist/combine.js
CHANGED
|
@@ -39,6 +39,13 @@ export function combineAdapters(parts) {
|
|
|
39
39
|
...(parts.record.deleteUnreferencedAttachmentRecords && {
|
|
40
40
|
deleteUnreferencedAttachmentRecords: (fileId, metadataTypeIds) => parts.record.deleteUnreferencedAttachmentRecords(fileId, metadataTypeIds),
|
|
41
41
|
}),
|
|
42
|
+
// Forwarded on the same terms, and it decides more than it looks:
|
|
43
|
+
// Stack.relaysChanges reads its presence, so dropping it here would
|
|
44
|
+
// leave a combined stack quietly emitting only its own writes while a
|
|
45
|
+
// remote record backend's feed went unread.
|
|
46
|
+
...(parts.record.subscribeChanges && {
|
|
47
|
+
subscribeChanges: (opts, handler) => parts.record.subscribeChanges(opts, handler),
|
|
48
|
+
}),
|
|
42
49
|
// StackAdapter.putAttachmentWithMetadata is deliberately never
|
|
43
50
|
// synthesized here: glued backends have no shared transaction to honor
|
|
44
51
|
// its atomicity promise (docs/spec/adapters.md § Interface split).
|
package/dist/combine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combine.js","sourceRoot":"","sources":["../src/combine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combine.js","sourceRoot":"","sources":["../src/combine.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAG/B;IACC,OAAO;QACL,IAAI,YAAY;YACd,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;QACnC,CAAC;QACD,IAAI,aAAa;YACf,OAAO,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC;QACpC,CAAC;QACD,IAAI,QAAQ;YACV,OAAO,KAAK,CAAC,MAAM,CAAC,QA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AAE,EAAE,CAC3F,KAAK,CAAC,MAAM,CAAC,gBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC;SAChD,CAAC;QAEF,+DAA+D;QAC/D,uEAAuE;QACvE,mEAAmE;QACnE,2DAA2D;QAC3D,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;QACvD,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QACnD,gBAAgB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI;YAC1B,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAU,EAAE;SACzC,CAAC;QAEF,KAAK,CAAC,KAAK;YACT,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;YAC7B,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QAC7B,CAAC;QACD,KAAK,CAAC,KAAK;YACT,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;YAC7B,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QAC7B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/grants.d.ts
CHANGED
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* See docs/spec/access-control.md § Type-level grants.
|
|
10
10
|
*/
|
|
11
11
|
import type { GroupRole } from './access.js';
|
|
12
|
-
import type { EntityId, GrantAction, GrantContent, QueryResult, RecordId, StackQuery, StackRecord } from './types.js';
|
|
12
|
+
import type { EntityId, GrantAction, GrantContent, GrantGrantee, QueryResult, RecordId, StackQuery, StackRecord, TypeId } from './types.js';
|
|
13
|
+
import type { ValidationError } from './validate.js';
|
|
13
14
|
/**
|
|
14
|
-
* Valid GrantAction values, for runtime validation in Stack.grant().
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Valid GrantAction values, for runtime validation in Stack.grant(). Built
|
|
16
|
+
* from GRANT_ACTIONS, which GrantAction itself derives from, so the set and
|
|
17
|
+
* the type cannot drift.
|
|
17
18
|
*/
|
|
18
19
|
export declare const GRANT_ACTION_SET: ReadonlySet<GrantAction>;
|
|
19
20
|
/**
|
|
@@ -27,37 +28,79 @@ export declare const GRANT_ACTION_SET: ReadonlySet<GrantAction>;
|
|
|
27
28
|
export declare const READ_COMPANIONS: ReadonlyMap<GrantAction, readonly GrantAction[]>;
|
|
28
29
|
/**
|
|
29
30
|
* Whether one grant's action list conveys `action`. The companion has to
|
|
30
|
-
* sit in the same `_grant` Record
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* sit in the same `_grant` Record: a grant is revoked whole, so a rule
|
|
32
|
+
* satisfied across two records would let revoking the read one leave a
|
|
33
|
+
* mutate-without-read grant standing.
|
|
34
|
+
*
|
|
35
|
+
* Takes the list grantReach() produced, never a stored field: `includes()`
|
|
36
|
+
* over a string is substring matching, so one would answer for every verb
|
|
37
|
+
* spelled inside it.
|
|
35
38
|
*/
|
|
36
|
-
export declare function grantConveys(actions: readonly
|
|
39
|
+
export declare function grantConveys(actions: readonly GrantAction[], action: GrantAction): boolean;
|
|
37
40
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
41
|
+
* What a stored `_grant` reaches, or null where it names nothing the
|
|
42
|
+
* evaluator recognizes. Read as data, like the grantee beside it: a grant
|
|
43
|
+
* Record can arrive from an import, a direct adapter write or a foreign
|
|
44
|
+
* server, where no schema saw it, so both fields are asked for their shape
|
|
45
|
+
* rather than taken from the type. An unknown action is dropped from the
|
|
46
|
+
* list, on the same terms an unknown grantee `kind` confers nothing.
|
|
47
|
+
* See docs/spec/access-control.md § Refused at the write, and again at evaluation.
|
|
42
48
|
*/
|
|
43
|
-
export
|
|
44
|
-
|
|
49
|
+
export declare function grantReach(content: unknown): {
|
|
50
|
+
familyId: string;
|
|
51
|
+
actions: GrantAction[];
|
|
45
52
|
} | null;
|
|
46
|
-
/** Direct (non-roster) match between a stored _grant's content and a GrantTarget. */
|
|
47
|
-
export declare function matchesGrantTarget(content: GrantContent, target: GrantTarget): boolean;
|
|
48
53
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
54
|
+
* Who a grant() / revoke() / listGrants() call targets — the same union a
|
|
55
|
+
* stored grant carries, so a target is the grantee it writes.
|
|
56
|
+
* `{ kind: 'authenticated' }` is the default grant, and the default-only
|
|
57
|
+
* listing.
|
|
58
|
+
*/
|
|
59
|
+
export type GrantTarget = GrantGrantee;
|
|
60
|
+
/**
|
|
61
|
+
* What listGrants() accepts: a GrantTarget, widened so a group listing can
|
|
62
|
+
* ask for every role at once. `role: 'any'` is not a role an entity can
|
|
63
|
+
* hold and never reaches storage — a query can say it, a grantee cannot.
|
|
64
|
+
*/
|
|
65
|
+
export type GrantQuery = {
|
|
66
|
+
kind: 'entity';
|
|
67
|
+
entityId: EntityId;
|
|
68
|
+
} | {
|
|
69
|
+
kind: 'group';
|
|
70
|
+
groupId: RecordId;
|
|
71
|
+
role: 'member' | 'admin' | 'any';
|
|
72
|
+
} | {
|
|
73
|
+
kind: 'authenticated';
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Direct (non-roster) match between a stored _grant's content and a target:
|
|
77
|
+
* the whole grantee, `role` included. A target is the identity grant()
|
|
78
|
+
* wrote, so a revoke aimed at a group's admins leaves the members' grant
|
|
79
|
+
* standing. A query's `role: 'any'` is the one widening, and it is spelled.
|
|
53
80
|
*/
|
|
54
|
-
export declare function
|
|
81
|
+
export declare function matchesGrantTarget(content: GrantContent, target: GrantQuery): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Reject a grant target that names no tier, or whose tier names nobody. An
|
|
84
|
+
* empty groupId or entityId reaches no one, so storing it would leave a
|
|
85
|
+
* grant that can only ever deny while looking like a share that worked.
|
|
86
|
+
* Read as data, not as the type: a target reaching Stack from a request
|
|
87
|
+
* body or an import has whatever shape it arrived with. `allowAny` admits
|
|
88
|
+
* the listing-only `role: 'any'`, which grant() and revoke() refuse.
|
|
89
|
+
*/
|
|
90
|
+
export declare function validateGrantTarget(target: GrantQuery, allowAny?: boolean): void;
|
|
91
|
+
/**
|
|
92
|
+
* The fields each grantee arm must carry, asked of a `_grant`'s content on
|
|
93
|
+
* every write. The schema cannot ask it — a closed `object` field holds one
|
|
94
|
+
* `properties` set, so only `kind` is required there — and an arm missing
|
|
95
|
+
* its own field would otherwise store, answer 200, then deny forever.
|
|
96
|
+
*/
|
|
97
|
+
export declare function validateGrantee(typeId: TypeId, content: unknown): ValidationError[];
|
|
55
98
|
/**
|
|
56
99
|
* Whether a stored _grant covers `grantee`: a direct DID match, roster
|
|
57
|
-
* membership when `allowGroup`, or
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
100
|
+
* membership when `allowGroup`, or the authenticated tier when
|
|
101
|
+
* `allowDefault`. The grantee's own `kind` decides which question is asked
|
|
102
|
+
* — every tier is affirmative, and none is reachable by omission, so a
|
|
103
|
+
* grant carrying nothing recognizable confers nothing.
|
|
61
104
|
*/
|
|
62
105
|
export declare function grantCoversGrantee(c: GrantContent, grantee: EntityId, opts: {
|
|
63
106
|
allowDefault: boolean;
|
|
@@ -68,17 +111,19 @@ export declare function grantCoversGrantee(c: GrantContent, grantee: EntityId, o
|
|
|
68
111
|
/**
|
|
69
112
|
* System type families grant() refuses to target: a grant on any of them
|
|
70
113
|
* would let the grantee mint their own grants, touch stack config, or
|
|
71
|
-
* register an app card claiming a DID that isn't theirs — the last of
|
|
72
|
-
*
|
|
73
|
-
* docs/spec/access-control.md § Type-level grants.
|
|
114
|
+
* register an app card claiming a DID that isn't theirs — the last of which
|
|
115
|
+
* is what verified app attribution rests on.
|
|
74
116
|
*/
|
|
75
117
|
export declare const UNGRANTABLE_SYSTEM_TYPES: ReadonlySet<string>;
|
|
76
118
|
/**
|
|
77
119
|
* Every `_grant` Record, cursor-walked. Read through an unscoped query at
|
|
78
120
|
* every call site: a grant is what decides who may read, so it can never
|
|
79
|
-
* itself sit behind a read check.
|
|
80
|
-
*
|
|
81
|
-
*
|
|
121
|
+
* itself sit behind a read check.
|
|
122
|
+
*
|
|
123
|
+
* `includeUnlisted`, because withholding a Record from enumeration decides
|
|
124
|
+
* nothing about what it confers. Deleted grants are excluded on the
|
|
125
|
+
* opposite grounds — a soft delete is how revoke() withdraws one.
|
|
126
|
+
* See docs/spec/unlisted.md.
|
|
82
127
|
*/
|
|
83
128
|
export declare function loadGrantRecords(query: (q: StackQuery) => Promise<QueryResult>): Promise<StackRecord[]>;
|
|
84
129
|
//# sourceMappingURL=grants.d.ts.map
|
package/dist/grants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../src/grants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,WAAW,
|
|
1
|
+
{"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../src/grants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,WAAW,EACX,MAAM,EACP,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,E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