@haverstack/core 0.41.0 → 0.42.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.
Files changed (287) hide show
  1. package/README.md +121 -59
  2. package/dist/access.d.ts +34 -36
  3. package/dist/access.d.ts.map +1 -1
  4. package/dist/access.js +65 -42
  5. package/dist/access.js.map +1 -1
  6. package/dist/{combine.d.ts → adapter/combine.d.ts} +8 -1
  7. package/dist/adapter/combine.d.ts.map +1 -0
  8. package/dist/{combine.js → adapter/combine.js} +7 -0
  9. package/dist/adapter/combine.js.map +1 -0
  10. package/dist/{adapter-entry.d.ts → adapter/index.d.ts} +6 -5
  11. package/dist/adapter/index.d.ts.map +1 -0
  12. package/dist/{adapter-entry.js → adapter/index.js} +5 -4
  13. package/dist/adapter/index.js.map +1 -0
  14. package/dist/{sort.d.ts → adapter/sort.d.ts} +20 -20
  15. package/dist/adapter/sort.d.ts.map +1 -0
  16. package/dist/{sort.js → adapter/sort.js} +37 -27
  17. package/dist/adapter/sort.js.map +1 -0
  18. package/dist/associations/identity.d.ts +93 -0
  19. package/dist/associations/identity.d.ts.map +1 -0
  20. package/dist/associations/identity.js +198 -0
  21. package/dist/associations/identity.js.map +1 -0
  22. package/dist/associations/validation.d.ts +90 -0
  23. package/dist/associations/validation.d.ts.map +1 -0
  24. package/dist/associations/validation.js +339 -0
  25. package/dist/associations/validation.js.map +1 -0
  26. package/dist/attachment-records.d.ts +48 -0
  27. package/dist/attachment-records.d.ts.map +1 -0
  28. package/dist/attachment-records.js +52 -0
  29. package/dist/attachment-records.js.map +1 -0
  30. package/dist/collection.d.ts +182 -0
  31. package/dist/collection.d.ts.map +1 -0
  32. package/dist/collection.js +407 -0
  33. package/dist/collection.js.map +1 -0
  34. package/dist/content-match.d.ts +25 -0
  35. package/dist/content-match.d.ts.map +1 -0
  36. package/dist/content-match.js +51 -0
  37. package/dist/content-match.js.map +1 -0
  38. package/dist/content-translation.d.ts +42 -0
  39. package/dist/content-translation.d.ts.map +1 -0
  40. package/dist/content-translation.js +108 -0
  41. package/dist/content-translation.js.map +1 -0
  42. package/dist/did/did.d.ts.map +1 -0
  43. package/dist/{did.js → did/did.js} +3 -4
  44. package/dist/did/did.js.map +1 -0
  45. package/dist/{did-entry.d.ts → did/index.d.ts} +1 -1
  46. package/dist/did/index.d.ts.map +1 -0
  47. package/dist/{did-entry.js → did/index.js} +3 -3
  48. package/dist/did/index.js.map +1 -0
  49. package/dist/errors.d.ts +36 -63
  50. package/dist/errors.d.ts.map +1 -1
  51. package/dist/errors.js +35 -58
  52. package/dist/errors.js.map +1 -1
  53. package/dist/grants.d.ts +18 -42
  54. package/dist/grants.d.ts.map +1 -1
  55. package/dist/grants.js +68 -133
  56. package/dist/grants.js.map +1 -1
  57. package/dist/id.d.ts +13 -31
  58. package/dist/id.d.ts.map +1 -1
  59. package/dist/id.js +13 -31
  60. package/dist/id.js.map +1 -1
  61. package/dist/index.d.ts +12 -8
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +8 -5
  64. package/dist/index.js.map +1 -1
  65. package/dist/install.d.ts +3 -6
  66. package/dist/install.d.ts.map +1 -1
  67. package/dist/install.js +6 -10
  68. package/dist/install.js.map +1 -1
  69. package/dist/merge.d.ts.map +1 -1
  70. package/dist/merge.js +5 -11
  71. package/dist/merge.js.map +1 -1
  72. package/dist/migration-steps.d.ts +102 -0
  73. package/dist/migration-steps.d.ts.map +1 -0
  74. package/dist/migration-steps.js +293 -0
  75. package/dist/migration-steps.js.map +1 -0
  76. package/dist/query-validation.d.ts +28 -94
  77. package/dist/query-validation.d.ts.map +1 -1
  78. package/dist/query-validation.js +156 -336
  79. package/dist/query-validation.js.map +1 -1
  80. package/dist/record-changes.d.ts +2 -117
  81. package/dist/record-changes.d.ts.map +1 -1
  82. package/dist/record-changes.js +10 -212
  83. package/dist/record-changes.js.map +1 -1
  84. package/dist/schema.d.ts +18 -7
  85. package/dist/schema.d.ts.map +1 -1
  86. package/dist/schema.js +59 -30
  87. package/dist/schema.js.map +1 -1
  88. package/dist/scoped-stack/authority.d.ts +156 -0
  89. package/dist/scoped-stack/authority.d.ts.map +1 -0
  90. package/dist/scoped-stack/authority.js +384 -0
  91. package/dist/scoped-stack/authority.js.map +1 -0
  92. package/dist/scoped-stack/scoped-stack.d.ts +338 -0
  93. package/dist/scoped-stack/scoped-stack.d.ts.map +1 -0
  94. package/dist/scoped-stack/scoped-stack.js +776 -0
  95. package/dist/scoped-stack/scoped-stack.js.map +1 -0
  96. package/dist/scoped-stack/subscription.d.ts +55 -0
  97. package/dist/scoped-stack/subscription.d.ts.map +1 -0
  98. package/dist/scoped-stack/subscription.js +110 -0
  99. package/dist/scoped-stack/subscription.js.map +1 -0
  100. package/dist/stack/attachments.d.ts +24 -0
  101. package/dist/stack/attachments.d.ts.map +1 -0
  102. package/dist/stack/attachments.js +113 -0
  103. package/dist/stack/attachments.js.map +1 -0
  104. package/dist/{changes.d.ts → stack/changes.d.ts} +29 -65
  105. package/dist/stack/changes.d.ts.map +1 -0
  106. package/dist/{changes.js → stack/changes.js} +32 -66
  107. package/dist/stack/changes.js.map +1 -0
  108. package/dist/stack/client.d.ts +271 -0
  109. package/dist/stack/client.d.ts.map +1 -0
  110. package/dist/stack/client.js +9 -0
  111. package/dist/stack/client.js.map +1 -0
  112. package/dist/stack/identity-bindings.d.ts.map +1 -0
  113. package/dist/{identity-bindings.js → stack/identity-bindings.js} +5 -14
  114. package/dist/stack/identity-bindings.js.map +1 -0
  115. package/dist/stack/install-app.d.ts +22 -0
  116. package/dist/stack/install-app.d.ts.map +1 -0
  117. package/dist/stack/install-app.js +260 -0
  118. package/dist/stack/install-app.js.map +1 -0
  119. package/dist/stack/integrity.d.ts +94 -0
  120. package/dist/stack/integrity.d.ts.map +1 -0
  121. package/dist/stack/integrity.js +268 -0
  122. package/dist/stack/integrity.js.map +1 -0
  123. package/dist/{limits.d.ts → stack/limits.d.ts} +2 -5
  124. package/dist/stack/limits.d.ts.map +1 -0
  125. package/dist/{limits.js → stack/limits.js} +3 -6
  126. package/dist/stack/limits.js.map +1 -0
  127. package/dist/stack/migrations.d.ts +59 -0
  128. package/dist/stack/migrations.d.ts.map +1 -0
  129. package/dist/stack/migrations.js +141 -0
  130. package/dist/stack/migrations.js.map +1 -0
  131. package/dist/{stack-reads.d.ts → stack/reads.d.ts} +33 -6
  132. package/dist/stack/reads.d.ts.map +1 -0
  133. package/dist/{stack-reads.js → stack/reads.js} +49 -7
  134. package/dist/stack/reads.js.map +1 -0
  135. package/dist/stack/record-id.d.ts +35 -0
  136. package/dist/stack/record-id.d.ts.map +1 -0
  137. package/dist/stack/record-id.js +82 -0
  138. package/dist/stack/record-id.js.map +1 -0
  139. package/dist/stack/stack.d.ts +438 -0
  140. package/dist/stack/stack.d.ts.map +1 -0
  141. package/dist/stack/stack.js +1366 -0
  142. package/dist/stack/stack.js.map +1 -0
  143. package/dist/stack/system-types.d.ts +16 -0
  144. package/dist/stack/system-types.d.ts.map +1 -0
  145. package/dist/stack/system-types.js +111 -0
  146. package/dist/stack/system-types.js.map +1 -0
  147. package/dist/stack/type-grants.d.ts +20 -0
  148. package/dist/stack/type-grants.d.ts.map +1 -0
  149. package/dist/stack/type-grants.js +69 -0
  150. package/dist/stack/type-grants.js.map +1 -0
  151. package/dist/stack/write-expectation.d.ts +78 -0
  152. package/dist/stack/write-expectation.d.ts.map +1 -0
  153. package/dist/stack/write-expectation.js +71 -0
  154. package/dist/stack/write-expectation.js.map +1 -0
  155. package/dist/testing.d.ts +21 -26
  156. package/dist/testing.d.ts.map +1 -1
  157. package/dist/testing.js +50 -70
  158. package/dist/testing.js.map +1 -1
  159. package/dist/type-handle.d.ts +67 -78
  160. package/dist/type-handle.d.ts.map +1 -1
  161. package/dist/type-handle.js +44 -111
  162. package/dist/type-handle.js.map +1 -1
  163. package/dist/types/adapter.d.ts +223 -0
  164. package/dist/types/adapter.d.ts.map +1 -0
  165. package/dist/types/adapter.js +5 -0
  166. package/dist/types/adapter.js.map +1 -0
  167. package/dist/types/associations.d.ts +156 -0
  168. package/dist/types/associations.d.ts.map +1 -0
  169. package/dist/types/associations.js +13 -0
  170. package/dist/types/associations.js.map +1 -0
  171. package/dist/types/capabilities.d.ts +89 -0
  172. package/dist/types/capabilities.d.ts.map +1 -0
  173. package/dist/types/capabilities.js +5 -0
  174. package/dist/types/capabilities.js.map +1 -0
  175. package/dist/types/events.d.ts +155 -0
  176. package/dist/types/events.d.ts.map +1 -0
  177. package/dist/types/events.js +5 -0
  178. package/dist/types/events.js.map +1 -0
  179. package/dist/types/ids.d.ts +43 -0
  180. package/dist/types/ids.d.ts.map +1 -0
  181. package/dist/types/ids.js +5 -0
  182. package/dist/types/ids.js.map +1 -0
  183. package/dist/types/index.d.ts +19 -0
  184. package/dist/types/index.d.ts.map +1 -0
  185. package/dist/types/index.js +19 -0
  186. package/dist/types/index.js.map +1 -0
  187. package/dist/types/journal.d.ts +47 -0
  188. package/dist/types/journal.d.ts.map +1 -0
  189. package/dist/types/journal.js +5 -0
  190. package/dist/types/journal.js.map +1 -0
  191. package/dist/types/query.d.ts +185 -0
  192. package/dist/types/query.d.ts.map +1 -0
  193. package/dist/types/query.js +10 -0
  194. package/dist/types/query.js.map +1 -0
  195. package/dist/types/records.d.ts +76 -0
  196. package/dist/types/records.d.ts.map +1 -0
  197. package/dist/types/records.js +5 -0
  198. package/dist/types/records.js.map +1 -0
  199. package/dist/types/schema.d.ts +74 -0
  200. package/dist/types/schema.d.ts.map +1 -0
  201. package/dist/types/schema.js +5 -0
  202. package/dist/types/schema.js.map +1 -0
  203. package/dist/types/system.d.ts +161 -0
  204. package/dist/types/system.d.ts.map +1 -0
  205. package/dist/types/system.js +32 -0
  206. package/dist/types/system.js.map +1 -0
  207. package/dist/types/tokens.d.ts +39 -0
  208. package/dist/types/tokens.d.ts.map +1 -0
  209. package/dist/types/tokens.js +5 -0
  210. package/dist/types/tokens.js.map +1 -0
  211. package/dist/validate.d.ts +29 -70
  212. package/dist/validate.d.ts.map +1 -1
  213. package/dist/validate.js +50 -91
  214. package/dist/validate.js.map +1 -1
  215. package/dist/{attachment-download.d.ts → wire/attachment-download.d.ts} +0 -57
  216. package/dist/wire/attachment-download.d.ts.map +1 -0
  217. package/dist/{attachment-download.js → wire/attachment-download.js} +0 -61
  218. package/dist/wire/attachment-download.js.map +1 -0
  219. package/dist/{auth.d.ts → wire/auth.d.ts} +5 -8
  220. package/dist/wire/auth.d.ts.map +1 -0
  221. package/dist/{auth.js → wire/auth.js} +5 -8
  222. package/dist/wire/auth.js.map +1 -0
  223. package/dist/{wire-body.d.ts → wire/body.d.ts} +4 -4
  224. package/dist/wire/body.d.ts.map +1 -0
  225. package/dist/{wire-body.js → wire/body.js} +5 -5
  226. package/dist/wire/body.js.map +1 -0
  227. package/dist/{wire-entry.d.ts → wire/index.d.ts} +12 -12
  228. package/dist/wire/index.d.ts.map +1 -0
  229. package/dist/{wire-entry.js → wire/index.js} +13 -17
  230. package/dist/wire/index.js.map +1 -0
  231. package/dist/{wire-record.d.ts → wire/record.d.ts} +10 -22
  232. package/dist/wire/record.d.ts.map +1 -0
  233. package/dist/{wire-record.js → wire/record.js} +12 -24
  234. package/dist/wire/record.js.map +1 -0
  235. package/dist/{wire-request.d.ts → wire/request.d.ts} +20 -37
  236. package/dist/wire/request.d.ts.map +1 -0
  237. package/dist/{wire-request.js → wire/request.js} +79 -54
  238. package/dist/wire/request.js.map +1 -0
  239. package/package.json +7 -7
  240. package/dist/adapter-entry.d.ts.map +0 -1
  241. package/dist/adapter-entry.js.map +0 -1
  242. package/dist/attachment-download.d.ts.map +0 -1
  243. package/dist/attachment-download.js.map +0 -1
  244. package/dist/auth.d.ts.map +0 -1
  245. package/dist/auth.js.map +0 -1
  246. package/dist/changes.d.ts.map +0 -1
  247. package/dist/changes.js.map +0 -1
  248. package/dist/combine.d.ts.map +0 -1
  249. package/dist/combine.js.map +0 -1
  250. package/dist/did-entry.d.ts.map +0 -1
  251. package/dist/did-entry.js.map +0 -1
  252. package/dist/did.d.ts.map +0 -1
  253. package/dist/did.js.map +0 -1
  254. package/dist/identity-bindings.d.ts.map +0 -1
  255. package/dist/identity-bindings.js.map +0 -1
  256. package/dist/limits.d.ts.map +0 -1
  257. package/dist/limits.js.map +0 -1
  258. package/dist/record-id.d.ts +0 -70
  259. package/dist/record-id.d.ts.map +0 -1
  260. package/dist/record-id.js +0 -127
  261. package/dist/record-id.js.map +0 -1
  262. package/dist/scoped-stack.d.ts +0 -549
  263. package/dist/scoped-stack.d.ts.map +0 -1
  264. package/dist/scoped-stack.js +0 -1301
  265. package/dist/scoped-stack.js.map +0 -1
  266. package/dist/sort.d.ts.map +0 -1
  267. package/dist/sort.js.map +0 -1
  268. package/dist/stack-reads.d.ts.map +0 -1
  269. package/dist/stack-reads.js.map +0 -1
  270. package/dist/stack.d.ts +0 -1032
  271. package/dist/stack.d.ts.map +0 -1
  272. package/dist/stack.js +0 -2337
  273. package/dist/stack.js.map +0 -1
  274. package/dist/types.d.ts +0 -1278
  275. package/dist/types.d.ts.map +0 -1
  276. package/dist/types.js +0 -51
  277. package/dist/types.js.map +0 -1
  278. package/dist/wire-body.d.ts.map +0 -1
  279. package/dist/wire-body.js.map +0 -1
  280. package/dist/wire-entry.d.ts.map +0 -1
  281. package/dist/wire-entry.js.map +0 -1
  282. package/dist/wire-record.d.ts.map +0 -1
  283. package/dist/wire-record.js.map +0 -1
  284. package/dist/wire-request.d.ts.map +0 -1
  285. package/dist/wire-request.js.map +0 -1
  286. /package/dist/{did.d.ts → did/did.d.ts} +0 -0
  287. /package/dist/{identity-bindings.d.ts → stack/identity-bindings.d.ts} +0 -0
@@ -1,549 +0,0 @@
1
- /**
2
- * ScopedStack — the permission-enforcing view
3
- * -------------------------------------------------------
4
- * A `Stack` answers every question; a `ScopedStack` answers only the ones a
5
- * particular requester is entitled to. It wraps a Stack rather than an
6
- * adapter, so every invariant the Stack layer holds is already in force by
7
- * the time a check here runs, and the gates below only ever narrow.
8
- *
9
- * Two identities, one rule: **the principal governs authority, the subject
10
- * governs attribution.** Both are DIDs and both are often equal, which is
11
- * what makes them easy to confuse — so the split is stated on every gate
12
- * that depends on it.
13
- *
14
- * Also holds the feed side of the same rule: a subscription's deliveries
15
- * run through the same canRead() a get() answers with, so a feed can never
16
- * disagree with a read about what a session sees.
17
- *
18
- * See docs/spec/access-control.md and docs/spec/events.md § Permission scoping.
19
- */
20
- import { ChangeEmitter } from './changes.js';
21
- import type { PutAttachmentOptions, AssociationEdit, AttachmentContent, AuthorityAssociation, DataAssociation, EntityId, FileId, QueryResult, RecordChange, RecordId, RecordVersion, RecordJournalEntry, JournalQuery, VersionsQuery, StackAdapter, StackCapabilities, IfVersionOptions, StackQuery, StackRecord, SubscribeOptions, TypeId, Unsubscribe, RecordChangeSet } from './types.js';
22
- import type { ContentOf, PatchOf, ReadonlyTypeSchema, TypedChange, TypedChangeSet, TypedQuery, TypedSubscribeOptions, TypedRecord, TypeHandle } from './type-handle.js';
23
- import type { Stack, BackdatableCreateRecordOptions, CollectAttachmentGarbageOptions, CollectAttachmentGarbageResult, DeleteAndReturnResult, DeleteRecordOptions, DeleteResult, GetRecordOptions, StackClient } from './stack.js';
24
- /**
25
- * Held by Stack alone: the index re-exports ScopedStack but not this, so
26
- * asEntity()/asActor() stay the only way to one, and the actor
27
- * normalization and open-check they run can't be skipped.
28
- */
29
- export declare const scopeToken: unique symbol;
30
- /** Everything a ScopedStack borrows from the Stack that scoped it. */
31
- export type ScopedStackInit = {
32
- stack: Stack;
33
- principalId: EntityId | null;
34
- subjectId: EntityId | null;
35
- idTimestampSkewMs: number | null;
36
- /**
37
- * Bytes-storage primitive for putAttachment(), which composes bytes with
38
- * its own create() so the record carries the subject and principal as
39
- * `createdBy` — neither of which the adapter-level atomic capability takes.
40
- */
41
- adapter: StackAdapter;
42
- /** The stack's own unfiltered stream, which subscribe() narrows. */
43
- changes: ChangeEmitter;
44
- assertOpen: () => void;
45
- /** Whether changes reach the stack from elsewhere — see subscribe(). */
46
- relaysChanges: boolean;
47
- };
48
- /**
49
- * A permission-enforcing view of a Stack for a single (principal, subject)
50
- * pair, obtained via `stack.asEntity(entityId)`. A record the request
51
- * cannot read answers exactly as a missing one does — null on reads,
52
- * StackNotFoundError on the verbs that name one — so only a requester who
53
- * could have read it is told a refusal was about access.
54
- * See docs/spec/disclosure.md § Which refusal a Record answers with.
55
- *
56
- * Which identity each gate keys on follows the module comment's rule.
57
- * Grant lookup and the privilege-bearing gates no grant reaches
58
- * (resharing, group management, purge, widening access at create
59
- * time) key on `principalId`; authorship, `-own` matching,
60
- * record-level permission resolution and "files I uploaded" lookups key on
61
- * `subjectId`. Unconditional owner access splits the same way: an
62
- * owner subject resolves past every permission check, an owner principal
63
- * is not bounded by grants, and under delegation both halves apply.
64
- */
65
- export declare class ScopedStack implements StackClient {
66
- #private;
67
- private readonly stack;
68
- private readonly idTimestampSkewMs;
69
- private readonly adapter;
70
- private readonly changes;
71
- private readonly assertStackOpen;
72
- private readonly relaysChanges;
73
- /** Not callable from outside the package — see ScopedStackInit. */
74
- constructor(token: typeof scopeToken, init: ScopedStackInit);
75
- /**
76
- * The identity whose authority this view acts with; `null` when
77
- * anonymous. See docs/spec/access-control.md § Delegation: principal and subject.
78
- */
79
- get principalId(): EntityId | null;
80
- /**
81
- * The identity this view acts for and attributes writes to; `null` when
82
- * anonymous. Equal to `principalId` unless an app is acting for a user.
83
- */
84
- get subjectId(): EntityId | null;
85
- get capabilities(): StackCapabilities;
86
- private resolveRecord;
87
- /** Every `_grant` Record — see loadGrantRecords(). */
88
- private loadGrants;
89
- /** Whether a delegated app is acting for someone other than itself. */
90
- private get delegated();
91
- /**
92
- * Whether any grant could name this request — the one question every
93
- * prefetch asks before scanning the `_grant` family, since an anonymous
94
- * requester is reached by none. Both identities are read: `asEntity()`
95
- * refuses an anonymous principal acting for a subject, so they are null
96
- * together, and saying so costs nothing.
97
- */
98
- private get identified();
99
- /**
100
- * Who this request is, for stamping onto whatever it mutates. Attribution
101
- * follows record-level authorship: the subject is the actor, and the
102
- * principal is named beside it only when the two differ.
103
- * See docs/spec/data-model.md § Authorship and attribution.
104
- */
105
- private get requester();
106
- private get actor();
107
- /**
108
- * Whether unconditional owner authority applies — the owner acting as
109
- * itself. The verbs that rest on it are irreversible or disclose the
110
- * sharing graph, so delegation never carries one to a subject, whichever
111
- * side the owner is on. Shared with the predicate a server applies to a
112
- * session, which decides the same tier one step earlier. See
113
- * docs/spec/access-control.md § Delegation: principal and subject.
114
- */
115
- private get ownerActingAlone();
116
- /** Refuse anything but the owner acting as itself — see ownerActingAlone. */
117
- private requireOwnerActingAlone;
118
- private checkRead;
119
- private checkWrite;
120
- /**
121
- * Whether `grantee` holds a _grant covering one of `actions` for the
122
- * type's family (grants match by baseId, so a version bump never orphans
123
- * one). -own actions additionally require the author to be `grantee`,
124
- * unless `matchOwn` is false — on the principal side of a delegated
125
- * request the suffix reads as the bare verb, since which records are
126
- * reachable is the subject's business. `allowDefault` decides whether a
127
- * grant naming nobody counts.
128
- *
129
- * Reached only through subjectAllows()/principalAllows(), which fix those
130
- * two flags per side. Call one of those instead.
131
- */
132
- private hasGrant;
133
- /**
134
- * The principal half of a delegated request's authority: does the app
135
- * hold any grant permitting these verbs on this type at all. Bounds what
136
- * the subject's own authority can reach through it, so a powerful app
137
- * can never lend its reach to a weaker subject — nor the reverse.
138
- * Vacuously true when there's no delegation, where the principal and
139
- * subject checks would be the same question asked twice.
140
- *
141
- * Neither default nor group-targeted grants count here. "Any
142
- * authenticated entity" is about people who turn up, not software the
143
- * owner installed; and a roster is editable by any of the group's admins,
144
- * so authority reaching a principal through one would let someone other
145
- * than the owner name an app to a type.
146
- */
147
- private principalAllows;
148
- /**
149
- * The subject half: which records are reachable, answered with `-own`
150
- * matching and default grants both in force — the ordinary reading of a
151
- * grant, since the subject is the entity a grant is written about.
152
- *
153
- * Paired with principalAllows() so that the two halves of the
154
- * intersection are the only callers of hasGrant(): its flags differ per
155
- * side and mean nothing on their own, so no call site sets them by hand.
156
- */
157
- private subjectAllows;
158
- /**
159
- * How to refuse a record this request addressed by ID. A requester who
160
- * can read the record is told it exists and the verb was refused;
161
- * everyone else is told what a missing ID is told, so no one learns an ID
162
- * is live who could not have learned it by reading. `message` therefore
163
- * only ever reaches someone holding the record already.
164
- * See docs/spec/disclosure.md § Which refusal a Record answers with.
165
- */
166
- private denialFor;
167
- private canRead;
168
- private checkCreateGrant;
169
- /**
170
- * `_group` records are managed, not merely written: only the owner or an
171
- * `admin` roster holder may mutate them — ordinary write permissions and
172
- * grants don't apply. Asked of both identities under delegation, like
173
- * a reshare. See docs/spec/identity.md § Group.
174
- */
175
- private isGroupManager;
176
- /** Whether one identity, on its own, manages `record` — see isGroupManager(). */
177
- private managesGroup;
178
- /**
179
- * Fetch a record the subject can reach and the principal holds `update` on
180
- * (via permissions or an update grant), or throw. `mutating: false` marks
181
- * the history readers, which borrow this gate without changing anything —
182
- * the one way through it a `_grant` Record stays open to.
183
- */
184
- private requireUpdatable;
185
- /**
186
- * The write gate both requireUpdatable() and requireDeletable() are: the
187
- * subject can reach the record (record-level permission or a grant) and
188
- * the principal holds the same verb, intersected — or, for a `_group`, the
189
- * stricter management rule that no grant reaches.
190
- * See docs/spec/access-control.md § Delegation: principal and subject.
191
- */
192
- private requireVerb;
193
- /**
194
- * Fetch a record the subject can reach and the principal holds `delete` on
195
- * (via permissions or a delete grant), or throw.
196
- */
197
- private requireDeletable;
198
- /**
199
- * Whether this request may reference `recordId` (as a parentId or
200
- * relationship target). Missing and unreadable both return false —
201
- * indistinguishable, so this can't probe for a record's existence.
202
- *
203
- * The owner acting alone passes without the lookup: there is no record in
204
- * their own stack they may not read, so the gate could only refuse them
205
- * for absence — which is `Stack`'s to answer, with a conflict that names
206
- * the problem. See docs/spec/access-control.md § Reference-creation gating.
207
- */
208
- private canReadReferent;
209
- /**
210
- * Whether this request can read some record referencing `fileId` —
211
- * shared by canAccessFile() and the non-owner _attachment@1 create()
212
- * carve-out, which deliberately excludes the uploader clause.
213
- * `_attachment@1` records never match: the carve-out has to be satisfied
214
- * by some *other* record referencing the file, or one successful guess
215
- * would unlock unlimited further metadata records for the same fileId.
216
- * See docs/spec/attachments.md § Creating `_attachment@1` records directly.
217
- */
218
- private hasReadableReference;
219
- /**
220
- * Whether this request may reference or download `fileId` — the dual of
221
- * getAttachment()'s access rule. Nonexistent and inaccessible are
222
- * indistinguishable (both false), so no confirmation oracle for guessed
223
- * hashes. See docs/spec/access-control.md § Reference-creation gating.
224
- */
225
- private canAccessFile;
226
- /** Names of the type's top-level file-ref fields — the content-reference half of referencesFileId matching. */
227
- private fileRefFieldNames;
228
- /**
229
- * Gates file-ref content fields on file access, mirroring the
230
- * attachment-association gate — a file-ref field conveys attachment
231
- * access exactly like an `attachment` association. Only fields present
232
- * in `content` are checked (a content patch is a merge patch; untouched fields
233
- * carry no new reference).
234
- */
235
- private requireFileRefAccess;
236
- /**
237
- * Reference-creation gate for one association: `attachment` requires
238
- * file access, and a `relationship` naming a record in this stack
239
- * requires read access to it. `tag` is unchecked, and `_group` roster
240
- * associations are gated by the stricter isGroupManager() instead.
241
- *
242
- * The other target arms are ungated because the gate's purpose —
243
- * refusing a reference that would convey access to, or confirm the
244
- * existence of, an unreadable record — has nothing to bite on: core
245
- * never resolves them, so no access flows through one.
246
- * See docs/spec/access-control.md § Reference-creation gating.
247
- */
248
- private requireAssociationAccess;
249
- /**
250
- * Create a record on behalf of the subject: create grant required,
251
- * anonymous denied, `createdBy` set to the requester, client IDs skew-checked,
252
- * reference-creating options gated, and non-owner `_attachment@1`
253
- * creation refused save one carve-out. A scoped create always stamps
254
- * authorship — an absent `createdBy` means an unscoped `Stack` wrote it.
255
- * `createdAt`/`updatedAt` are refused to everyone but the owner acting
256
- * alone, rather than dropped, so an app never believes it published
257
- * something it didn't. See docs/spec/access-control.md and
258
- * docs/spec/data-model.md § Record IDs.
259
- */
260
- create<S extends ReadonlyTypeSchema>(handle: TypeHandle<S>, content: ContentOf<S>, opts?: BackdatableCreateRecordOptions): Promise<TypedRecord<S>>;
261
- create<T extends Record<string, unknown> = Record<string, unknown>>(typeId: TypeId, content: T, opts?: BackdatableCreateRecordOptions): Promise<StackRecord & {
262
- content: T;
263
- }>;
264
- /**
265
- * Whether this request may decide who else reaches a record — the rule
266
- * a reshare enforces, asked at create time too so the reach it
267
- * withholds can't be taken one step earlier while authoring. A delegated
268
- * app is denied it: widening access is the one thing containment most
269
- * needs to hold. Refused rather than silently ignored, so an app never
270
- * believes it published something it didn't. Not `ownerActingAlone`:
271
- * the record is the subject's own, so an owner principal grants it no
272
- * reach the subject lacks.
273
- * See docs/spec/access-control.md § Delegation: principal and subject.
274
- */
275
- private mayGrantAccess;
276
- /**
277
- * Whether one identity, on its own, may decide who else reaches `record`
278
- * — the owner-or-creator rule a reshare enforces, asked of one
279
- * side at a time. See
280
- * docs/spec/access-control.md § Delegation: principal and subject.
281
- */
282
- private mayReshare;
283
- /**
284
- * A record this request may read, or null. Never throws
285
- * StackPermissionError: an unreadable record answers exactly as a missing
286
- * one does, so a caller learns only what it may read.
287
- * See docs/spec/disclosure.md § Which refusal a Record answers with.
288
- */
289
- get<S extends ReadonlyTypeSchema>(handle: TypeHandle<S>, id: RecordId): Promise<TypedRecord<S> | null>;
290
- get(id: RecordId, opts?: GetRecordOptions): Promise<StackRecord | null>;
291
- /**
292
- * Runs through this.query(), so canRead() still applies — this answers a
293
- * question the caller asks on its own behalf. includeUnlisted is passed
294
- * only when the request is the owner acting alone, per
295
- * docs/spec/identity.md § DID bindings.
296
- */
297
- getEntityByDid(did: EntityId): Promise<StackRecord | null>;
298
- getOwnerEntity(): Promise<StackRecord | null>;
299
- /**
300
- * Query records, filtered to those this request can read. Pages are
301
- * filtered then refilled, so a page may slightly overshoot `limit` but
302
- * never skips a record. Grants are prefetched once, cursor-walked to
303
- * exhaustion.
304
- */
305
- query<S extends ReadonlyTypeSchema>(handle: TypeHandle<S>, query?: TypedQuery): Promise<{
306
- records: TypedRecord<S>[];
307
- cursor: string | null;
308
- }>;
309
- query(query?: StackQuery): Promise<QueryResult>;
310
- /**
311
- * Apply a change set on behalf of the subject. Authority is resolved
312
- * **per key** and every gate reads the record as it stands, never as the
313
- * change set would leave it: a widened `permissions` never satisfies the
314
- * read check on a `parentId` named in the same call, and a `_group`
315
- * roster never satisfies the admin check that same call has to pass.
316
- * One refused key refuses the whole call, so nothing is partially
317
- * applied and no key is silently dropped.
318
- * See docs/spec/access-control.md § Composing a change set.
319
- */
320
- mutate<S extends ReadonlyTypeSchema>(handle: TypeHandle<S>, id: RecordId, changes: TypedChangeSet<S>, opts?: IfVersionOptions): Promise<TypedRecord<S>>;
321
- mutate(id: RecordId, changes: RecordChangeSet, opts?: IfVersionOptions): Promise<StackRecord>;
322
- patchContent<S extends ReadonlyTypeSchema>(handle: TypeHandle<S>, id: RecordId, patch: PatchOf<S>, opts?: IfVersionOptions): Promise<TypedRecord<S>>;
323
- patchContent(id: RecordId, patch: Record<string, unknown | null>, opts?: IfVersionOptions): Promise<StackRecord>;
324
- /**
325
- * The record, having established that this request may decide who else
326
- * reaches it — the owner-or-creator rule, asked of both sides of a
327
- * delegation, or a Group's admin rule for a `_group`. The gate the
328
- * `permissions` and `unlisted` keys carry, which the write bit
329
- * deliberately does not confer.
330
- */
331
- private requireReshareable;
332
- /**
333
- * Whether a change set's `permissions` key actually moves the ACL. Read
334
- * off the computed delta rather than the elements the caller supplied:
335
- * a gate that inspected only what was named would miss the wholesale
336
- * replacement that drops everything, which names nothing at all. Any
337
- * add, remove or repoint in either direction is a reshare.
338
- * See docs/spec/access-control.md § Record-level permissions.
339
- */
340
- private permissionsMove;
341
- /** The reshare decision alone, for a record already read and write-gated. */
342
- private requireReshareOf;
343
- /**
344
- * Whether this request may decide who else reaches `record` — the
345
- * decision requireReshareOf() refuses on, without the refusal, for the
346
- * read paths that project on it rather than throw.
347
- *
348
- * A `_group` asks management, not authorship: a creator later demoted
349
- * from the admin roster shouldn't retain a side door to reassign who can
350
- * read or write the group record. Everything else is intersected like
351
- * every other authority here, or an owner principal would carry its
352
- * subject to records the subject cannot touch.
353
- */
354
- private canReshare;
355
- /**
356
- * Naming the software behind a key is the trust decision the `_app`
357
- * registry exists to record, so both halves of that binding — `did` and
358
- * `appId` — belong to the owner alone. Without this, record-level `write`
359
- * on a card would be a second way in: one carrying no DID yet could be
360
- * pointed at a write-holder's own key, or relabelled to claim another
361
- * app's `appId`. `name` and `version` stay writable — display, not lookup.
362
- *
363
- * Owner *acting alone*, in both directions, or the same route reopens
364
- * from the subject's side. `_entity` deliberately does not get this rule:
365
- * naming people is what a contacts app does, so its cards stay writable
366
- * by grant. See docs/spec/identity.md § DID bindings.
367
- */
368
- private requireOwnerForAppIdentity;
369
- /**
370
- * A self-reported `appId` must agree with the `_app` card naming the
371
- * principal's DID, where the owner registered one: `principalId` is
372
- * verified, so letting the pair disagree would leave a verified principal
373
- * claiming a name the owner gave different software. A principal with no
374
- * card keeps `appId` as the bare self-report it is for every undelegated
375
- * writer. See docs/spec/identity.md § Attribution and what can be trusted.
376
- */
377
- private requireAppIdMatchesPrincipal;
378
- /**
379
- * The owner's own DID is the one `_entity` binding a grantee may not claim.
380
- * `ownerProfile` adopts whichever card holds it, so a card minted by
381
- * someone else becomes the stack's own profile, and uniqueness then makes
382
- * that permanent. Every other DID stays open to a contacts app, which is
383
- * the reach `_entity` is grantable for.
384
- * See docs/spec/identity.md § DID bindings.
385
- */
386
- private requireOwnerForOwnerDid;
387
- /**
388
- * A `_grant` Record *is* authority, so rewriting one is the escalation
389
- * UNGRANTABLE_SYSTEM_TYPES refuses at evaluation, reached by editing an
390
- * existing grant rather than minting a fresh one. An `_install` decides
391
- * grants and migration authority, so it is fenced the same way. The verbs
392
- * that write either live on `Stack`, never `StackClient`, so no scoped
393
- * write is lost. Writes only: reading one and its history stays on the
394
- * ordinary gate. See docs/spec/access-control.md § Type-level grants.
395
- */
396
- private requireOwnerForGrantRecord;
397
- /**
398
- * Gated on the write bit alone, which is why the list is held to its
399
- * rules first: authority reached through this verb would be exactly the
400
- * escalation the partition exists to stop, decided before any record is
401
- * read so it cannot depend on who is asking.
402
- */
403
- associate(id: RecordId, associations: DataAssociation[]): Promise<StackRecord>;
404
- /** See associate() — the same write gate, the same kind refusal. */
405
- dissociate(id: RecordId, associations: DataAssociation[]): Promise<StackRecord>;
406
- /**
407
- * The write gate, plus the per-element reference gate on each add: what a
408
- * remove names is already on the record, so it is gated by the write bit
409
- * alone. See associate().
410
- */
411
- amendAssociations(id: RecordId, changes: AssociationEdit[], surface?: string): Promise<StackRecord>;
412
- /**
413
- * Extend who reaches a record — the reshare gate's own verb, on the
414
- * owner-or-creator rule the `permissions` key carries. The write bit
415
- * does not confer it: a write-holder who could grant would escalate to
416
- * deciding who else reaches the record, which is the whole of what
417
- * scoping access is for.
418
- * See docs/spec/access-control.md § Record-level permissions.
419
- */
420
- grantAccess(id: RecordId, permissions: AuthorityAssociation[]): Promise<StackRecord>;
421
- /** Withdraw elements of who reaches a record — see grantAccess(). */
422
- revokeAccess(id: RecordId, permissions: AuthorityAssociation[]): Promise<StackRecord>;
423
- /** The reshare gate over an edit list — see grantAccess(). */
424
- amendAccess(id: RecordId, changes: AssociationEdit[], surface?: string): Promise<StackRecord>;
425
- /**
426
- * Purge is owner-only: it is irreversible and destroys version
427
- * history, so neither the write bit nor delete-own/delete-any grants
428
- * reach it, and delegation doesn't carry it either. Everyone else is
429
- * limited to soft delete.
430
- */
431
- delete(id: RecordId, opts?: DeleteRecordOptions): Promise<DeleteResult>;
432
- /**
433
- * delete(), plus the record it acted on. Gated identically — the
434
- * existence/visibility check that produces a 404 ahead of the 403
435
- * permission gate still runs via requireDeletable() before either kind
436
- * of delete, so this changes what a successful call reports, not the
437
- * disclosure ordering a refused one follows.
438
- */
439
- deleteAndReturn(id: RecordId, opts?: DeleteRecordOptions): Promise<DeleteAndReturnResult>;
440
- /**
441
- * Reverse a soft delete. Gated the same as delete() — undelete is the
442
- * inverse of soft delete, so granting one direction without the other
443
- * would be backwards. Idempotent, per Stack.undelete().
444
- */
445
- undelete(id: RecordId, opts?: IfVersionOptions): Promise<StackRecord>;
446
- /**
447
- * History is the mutation/recovery surface, not a read surface — gated
448
- * like patchContent(). Reading it changes nothing, so it is the one path
449
- * the `_grant` write fence leaves alone: seeing how a Record you can
450
- * already read got that way is not the escalation that fence exists to
451
- * stop. See docs/spec/versioning.md § History access.
452
- */
453
- getVersions(id: RecordId, query?: VersionsQuery): Promise<RecordVersion[]>;
454
- /**
455
- * See getVersions() — the same mutate-surface gate, for the same reason.
456
- *
457
- * The journal is where a Record's sharing history lives, and that half
458
- * is the resharer's: a reader who could not have moved the ACL is served
459
- * the `reshare` op without the elements beneath it, so the entry
460
- * still names that it moved. Asked of both identities, so delegation is
461
- * no route to it either. See docs/spec/journal.md § Reading it.
462
- */
463
- getJournal(id: RecordId, query?: JournalQuery): Promise<RecordJournalEntry[]>;
464
- /** See getVersions() — the same mutate-surface gate. */
465
- getVersion(id: RecordId, version: number): Promise<RecordVersion | null>;
466
- /**
467
- * Re-runs the reference-creation checks against the snapshot, so a
468
- * restore can't re-convey access to a file the subject can no longer
469
- * reach today. Only the owner acting alone is exempt: under delegation
470
- * the checks resolve against the subject, which is whose reach the
471
- * restore would widen. See docs/spec/versioning.md § Restore semantics.
472
- */
473
- restoreVersion(id: RecordId, version: number, opts?: IfVersionOptions): Promise<StackRecord>;
474
- /**
475
- * Commit a per-record migration — **the owner acting alone**, the same
476
- * restriction the bulk `migrateAll()` carries by living on `Stack`, with
477
- * one exception: an installed app migrating within its own families (see
478
- * installMayMigrate()).
479
- *
480
- * Migrate replaces `content` and `typeId` wholesale, so a grant-based
481
- * version would have to re-derive every gate `create()` applies at the
482
- * destination *and* every gate `mutate()` applies over the existing
483
- * content, reopening each one it missed. The sharpest is create()'s
484
- * non-owner `_attachment@1` refusal: without it, a requester could
485
- * migrate a record they authored into the family naming any `fileId` and
486
- * read the bytes through canAccessFile()'s uploader clause. Ordinary
487
- * write access to a record is not consent to move it between families.
488
- * See docs/spec/data-model.md § Type migrations.
489
- */
490
- commitMigration(id: RecordId, toTypeId: TypeId, content: Record<string, unknown>, opts?: IfVersionOptions): Promise<StackRecord>;
491
- /**
492
- * Whether this request is an installed app migrating a record within its
493
- * own families: the app acting as itself, its key linked to the one live
494
- * install claiming both families in its own namespace, `toTypeId` a version the owner
495
- * approved, and an `update-any` grant on each family made out to the key
496
- * directly. Read as data, so a family two installs claim — however that
497
- * came to be — confers nothing.
498
- *
499
- * The reasons migration is otherwise owner-only do not reach this case:
500
- * no install can claim a system family, so neither an `_attachment` nor
501
- * a DID binding is in reach, and the owner's approval of the version is
502
- * the consent. See docs/spec/apps.md § Migrating an installed app's types.
503
- */
504
- private installMayMigrate;
505
- /**
506
- * Store bytes and create an _attachment@1 metadata record (create grant
507
- * on `_attachment@1` required; anonymous denied), returning that record.
508
- * Authorship and principal are stamped exactly as create() does.
509
- */
510
- putAttachment(data: Uint8Array, opts: PutAttachmentOptions): Promise<StackRecord & {
511
- content: AttachmentContent;
512
- }>;
513
- /**
514
- * Download attachment bytes. Accessible to the owner, a reader of any
515
- * referencing record, or the uploader pre-association — the same
516
- * predicate as the reference-creation gate (canAccessFile).
517
- */
518
- getAttachment(fileId: FileId): Promise<Uint8Array>;
519
- /**
520
- * Delete an attachment. Only the stack owner may delete attachments.
521
- * Delegates to Stack.deleteAttachment(), which enforces the "not referenced" check.
522
- */
523
- deleteAttachment(fileId: FileId): Promise<void>;
524
- /**
525
- * Sweep for unreferenced attachment bytes and delete them. Only the stack
526
- * owner may run this. Delegates to Stack.collectAttachmentGarbage().
527
- */
528
- collectAttachmentGarbage(opts?: CollectAttachmentGarbageOptions): Promise<CollectAttachmentGarbageResult>;
529
- /**
530
- * Observe the changes this request may read. The predicate is canRead
531
- * applied per event — the same one get() and query() answer with, so a
532
- * feed can't disagree with them about what this session sees.
533
- *
534
- * A record the subscriber cannot read produces no event at all, rather
535
- * than an empty or redacted one: the existence of a change is itself a
536
- * disclosure, the same reasoning that keeps a count of the whole match
537
- * off a query result. See docs/spec/events.md § Permission scoping.
538
- */
539
- subscribe<S extends ReadonlyTypeSchema>(handle: TypeHandle<S>, handler: (change: TypedChange<S>) => void, opts?: TypedSubscribeOptions): Promise<Unsubscribe>;
540
- subscribe(handler: (change: RecordChange) => void, opts?: SubscribeOptions): Promise<Unsubscribe>;
541
- /**
542
- * canRead for one event, through the subscription's own cache. Grants
543
- * are prefetched once and refilled after an invalidation rather than
544
- * re-queried per event, which would be a `_grant` scan for every change
545
- * the stack makes.
546
- */
547
- private canReadCached;
548
- }
549
- //# sourceMappingURL=scoped-stack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scoped-stack.d.ts","sourceRoot":"","sources":["../src/scoped-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EACL,aAAa,EAKd,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAMV,oBAAoB,EAEpB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,MAAM,EAIN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,eAAe,EAChB,MAAM,YAAY,CAAC;AAwDpB,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,UAAU,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,KAAK,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,EAC9B,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAC;AA4GpB;;;;GAIG;AACH,eAAO,MAAM,UAAU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