@haverstack/core 0.41.0 → 0.43.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 (317) hide show
  1. package/README.md +124 -64
  2. package/dist/access.d.ts +43 -47
  3. package/dist/access.d.ts.map +1 -1
  4. package/dist/access.js +66 -101
  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} +18 -3
  9. package/dist/adapter/combine.js.map +1 -0
  10. package/dist/adapter/index.d.ts +19 -0
  11. package/dist/adapter/index.d.ts.map +1 -0
  12. package/dist/adapter/index.js +16 -0
  13. package/dist/adapter/index.js.map +1 -0
  14. package/dist/adapter/reach.d.ts +14 -0
  15. package/dist/adapter/reach.d.ts.map +1 -0
  16. package/dist/adapter/reach.js +31 -0
  17. package/dist/adapter/reach.js.map +1 -0
  18. package/dist/{sort.d.ts → adapter/sort.d.ts} +20 -20
  19. package/dist/adapter/sort.d.ts.map +1 -0
  20. package/dist/{sort.js → adapter/sort.js} +37 -27
  21. package/dist/adapter/sort.js.map +1 -0
  22. package/dist/associations/identity.d.ts +69 -0
  23. package/dist/associations/identity.d.ts.map +1 -0
  24. package/dist/associations/identity.js +174 -0
  25. package/dist/associations/identity.js.map +1 -0
  26. package/dist/associations/validation.d.ts +83 -0
  27. package/dist/associations/validation.d.ts.map +1 -0
  28. package/dist/associations/validation.js +312 -0
  29. package/dist/associations/validation.js.map +1 -0
  30. package/dist/attachment-records.d.ts +48 -0
  31. package/dist/attachment-records.d.ts.map +1 -0
  32. package/dist/attachment-records.js +52 -0
  33. package/dist/attachment-records.js.map +1 -0
  34. package/dist/collection.d.ts +178 -0
  35. package/dist/collection.d.ts.map +1 -0
  36. package/dist/collection.js +397 -0
  37. package/dist/collection.js.map +1 -0
  38. package/dist/content-match.d.ts +25 -0
  39. package/dist/content-match.d.ts.map +1 -0
  40. package/dist/content-match.js +51 -0
  41. package/dist/content-match.js.map +1 -0
  42. package/dist/content-translation.d.ts +42 -0
  43. package/dist/content-translation.d.ts.map +1 -0
  44. package/dist/content-translation.js +108 -0
  45. package/dist/content-translation.js.map +1 -0
  46. package/dist/did/did.d.ts.map +1 -0
  47. package/dist/{did.js → did/did.js} +3 -4
  48. package/dist/did/did.js.map +1 -0
  49. package/dist/{did-entry.d.ts → did/index.d.ts} +1 -1
  50. package/dist/did/index.d.ts.map +1 -0
  51. package/dist/{did-entry.js → did/index.js} +3 -3
  52. package/dist/did/index.js.map +1 -0
  53. package/dist/errors.d.ts +54 -66
  54. package/dist/errors.d.ts.map +1 -1
  55. package/dist/errors.js +58 -62
  56. package/dist/errors.js.map +1 -1
  57. package/dist/grants.d.ts +20 -44
  58. package/dist/grants.d.ts.map +1 -1
  59. package/dist/grants.js +69 -151
  60. package/dist/grants.js.map +1 -1
  61. package/dist/id.d.ts +13 -31
  62. package/dist/id.d.ts.map +1 -1
  63. package/dist/id.js +13 -31
  64. package/dist/id.js.map +1 -1
  65. package/dist/index.d.ts +13 -9
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +9 -6
  68. package/dist/index.js.map +1 -1
  69. package/dist/install.d.ts +3 -6
  70. package/dist/install.d.ts.map +1 -1
  71. package/dist/install.js +6 -10
  72. package/dist/install.js.map +1 -1
  73. package/dist/lazy.d.ts +13 -0
  74. package/dist/lazy.d.ts.map +1 -0
  75. package/dist/lazy.js +27 -0
  76. package/dist/lazy.js.map +1 -0
  77. package/dist/merge.d.ts +1 -1
  78. package/dist/merge.d.ts.map +1 -1
  79. package/dist/merge.js +6 -12
  80. package/dist/merge.js.map +1 -1
  81. package/dist/migration-steps.d.ts +102 -0
  82. package/dist/migration-steps.d.ts.map +1 -0
  83. package/dist/migration-steps.js +293 -0
  84. package/dist/migration-steps.js.map +1 -0
  85. package/dist/query-validation.d.ts +68 -121
  86. package/dist/query-validation.d.ts.map +1 -1
  87. package/dist/query-validation.js +214 -380
  88. package/dist/query-validation.js.map +1 -1
  89. package/dist/record-changes.d.ts +11 -150
  90. package/dist/record-changes.d.ts.map +1 -1
  91. package/dist/record-changes.js +14 -305
  92. package/dist/record-changes.js.map +1 -1
  93. package/dist/schema.d.ts +18 -7
  94. package/dist/schema.d.ts.map +1 -1
  95. package/dist/schema.js +59 -30
  96. package/dist/schema.js.map +1 -1
  97. package/dist/scoped-stack/authority-snapshot.d.ts +37 -0
  98. package/dist/scoped-stack/authority-snapshot.d.ts.map +1 -0
  99. package/dist/scoped-stack/authority-snapshot.js +49 -0
  100. package/dist/scoped-stack/authority-snapshot.js.map +1 -0
  101. package/dist/scoped-stack/authority.d.ts +169 -0
  102. package/dist/scoped-stack/authority.d.ts.map +1 -0
  103. package/dist/scoped-stack/authority.js +408 -0
  104. package/dist/scoped-stack/authority.js.map +1 -0
  105. package/dist/scoped-stack/family-policy.d.ts +59 -0
  106. package/dist/scoped-stack/family-policy.d.ts.map +1 -0
  107. package/dist/scoped-stack/family-policy.js +68 -0
  108. package/dist/scoped-stack/family-policy.js.map +1 -0
  109. package/dist/scoped-stack/scoped-stack.d.ts +318 -0
  110. package/dist/scoped-stack/scoped-stack.d.ts.map +1 -0
  111. package/dist/scoped-stack/scoped-stack.js +695 -0
  112. package/dist/scoped-stack/scoped-stack.js.map +1 -0
  113. package/dist/scoped-stack/subscription.d.ts +36 -0
  114. package/dist/scoped-stack/subscription.d.ts.map +1 -0
  115. package/dist/scoped-stack/subscription.js +69 -0
  116. package/dist/scoped-stack/subscription.js.map +1 -0
  117. package/dist/stack/arguments.d.ts +27 -0
  118. package/dist/stack/arguments.d.ts.map +1 -0
  119. package/dist/stack/arguments.js +53 -0
  120. package/dist/stack/arguments.js.map +1 -0
  121. package/dist/stack/attachments.d.ts +24 -0
  122. package/dist/stack/attachments.d.ts.map +1 -0
  123. package/dist/stack/attachments.js +113 -0
  124. package/dist/stack/attachments.js.map +1 -0
  125. package/dist/{changes.d.ts → stack/changes.d.ts} +30 -72
  126. package/dist/stack/changes.d.ts.map +1 -0
  127. package/dist/{changes.js → stack/changes.js} +40 -74
  128. package/dist/stack/changes.js.map +1 -0
  129. package/dist/stack/client.d.ts +247 -0
  130. package/dist/stack/client.d.ts.map +1 -0
  131. package/dist/stack/client.js +9 -0
  132. package/dist/stack/client.js.map +1 -0
  133. package/dist/stack/identity-bindings.d.ts.map +1 -0
  134. package/dist/{identity-bindings.js → stack/identity-bindings.js} +5 -14
  135. package/dist/stack/identity-bindings.js.map +1 -0
  136. package/dist/stack/install-app.d.ts +22 -0
  137. package/dist/stack/install-app.d.ts.map +1 -0
  138. package/dist/stack/install-app.js +262 -0
  139. package/dist/stack/install-app.js.map +1 -0
  140. package/dist/stack/integrity.d.ts +94 -0
  141. package/dist/stack/integrity.d.ts.map +1 -0
  142. package/dist/stack/integrity.js +268 -0
  143. package/dist/stack/integrity.js.map +1 -0
  144. package/dist/{limits.d.ts → stack/limits.d.ts} +2 -5
  145. package/dist/stack/limits.d.ts.map +1 -0
  146. package/dist/{limits.js → stack/limits.js} +3 -6
  147. package/dist/stack/limits.js.map +1 -0
  148. package/dist/stack/migrations.d.ts +59 -0
  149. package/dist/stack/migrations.d.ts.map +1 -0
  150. package/dist/stack/migrations.js +141 -0
  151. package/dist/stack/migrations.js.map +1 -0
  152. package/dist/stack/reads.d.ts +69 -0
  153. package/dist/stack/reads.d.ts.map +1 -0
  154. package/dist/stack/reads.js +141 -0
  155. package/dist/stack/reads.js.map +1 -0
  156. package/dist/stack/record-id.d.ts +35 -0
  157. package/dist/stack/record-id.d.ts.map +1 -0
  158. package/dist/stack/record-id.js +82 -0
  159. package/dist/stack/record-id.js.map +1 -0
  160. package/dist/stack/stack.d.ts +444 -0
  161. package/dist/stack/stack.d.ts.map +1 -0
  162. package/dist/stack/stack.js +1339 -0
  163. package/dist/stack/stack.js.map +1 -0
  164. package/dist/stack/system-types.d.ts +16 -0
  165. package/dist/stack/system-types.d.ts.map +1 -0
  166. package/dist/stack/system-types.js +111 -0
  167. package/dist/stack/system-types.js.map +1 -0
  168. package/dist/stack/type-grants.d.ts +20 -0
  169. package/dist/stack/type-grants.d.ts.map +1 -0
  170. package/dist/stack/type-grants.js +69 -0
  171. package/dist/stack/type-grants.js.map +1 -0
  172. package/dist/stack/write-expectation.d.ts +79 -0
  173. package/dist/stack/write-expectation.d.ts.map +1 -0
  174. package/dist/stack/write-expectation.js +71 -0
  175. package/dist/stack/write-expectation.js.map +1 -0
  176. package/dist/stack/write-gate.d.ts +23 -0
  177. package/dist/stack/write-gate.d.ts.map +1 -0
  178. package/dist/stack/write-gate.js +17 -0
  179. package/dist/stack/write-gate.js.map +1 -0
  180. package/dist/testing.d.ts +44 -33
  181. package/dist/testing.d.ts.map +1 -1
  182. package/dist/testing.js +180 -176
  183. package/dist/testing.js.map +1 -1
  184. package/dist/type-handle.d.ts +67 -78
  185. package/dist/type-handle.d.ts.map +1 -1
  186. package/dist/type-handle.js +44 -111
  187. package/dist/type-handle.js.map +1 -1
  188. package/dist/types/adapter.d.ts +282 -0
  189. package/dist/types/adapter.d.ts.map +1 -0
  190. package/dist/types/adapter.js +5 -0
  191. package/dist/types/adapter.js.map +1 -0
  192. package/dist/types/associations.d.ts +140 -0
  193. package/dist/types/associations.d.ts.map +1 -0
  194. package/dist/types/associations.js +6 -0
  195. package/dist/types/associations.js.map +1 -0
  196. package/dist/types/capabilities.d.ts +89 -0
  197. package/dist/types/capabilities.d.ts.map +1 -0
  198. package/dist/types/capabilities.js +5 -0
  199. package/dist/types/capabilities.js.map +1 -0
  200. package/dist/types/events.d.ts +150 -0
  201. package/dist/types/events.d.ts.map +1 -0
  202. package/dist/types/events.js +5 -0
  203. package/dist/types/events.js.map +1 -0
  204. package/dist/types/ids.d.ts +43 -0
  205. package/dist/types/ids.d.ts.map +1 -0
  206. package/dist/types/ids.js +5 -0
  207. package/dist/types/ids.js.map +1 -0
  208. package/dist/types/index.d.ts +19 -0
  209. package/dist/types/index.d.ts.map +1 -0
  210. package/dist/types/index.js +19 -0
  211. package/dist/types/index.js.map +1 -0
  212. package/dist/types/journal.d.ts +47 -0
  213. package/dist/types/journal.d.ts.map +1 -0
  214. package/dist/types/journal.js +5 -0
  215. package/dist/types/journal.js.map +1 -0
  216. package/dist/types/query.d.ts +185 -0
  217. package/dist/types/query.d.ts.map +1 -0
  218. package/dist/types/query.js +10 -0
  219. package/dist/types/query.js.map +1 -0
  220. package/dist/types/records.d.ts +76 -0
  221. package/dist/types/records.d.ts.map +1 -0
  222. package/dist/types/records.js +5 -0
  223. package/dist/types/records.js.map +1 -0
  224. package/dist/types/schema.d.ts +74 -0
  225. package/dist/types/schema.d.ts.map +1 -0
  226. package/dist/types/schema.js +5 -0
  227. package/dist/types/schema.js.map +1 -0
  228. package/dist/types/system.d.ts +161 -0
  229. package/dist/types/system.d.ts.map +1 -0
  230. package/dist/types/system.js +32 -0
  231. package/dist/types/system.js.map +1 -0
  232. package/dist/types/tokens.d.ts +39 -0
  233. package/dist/types/tokens.d.ts.map +1 -0
  234. package/dist/types/tokens.js +5 -0
  235. package/dist/types/tokens.js.map +1 -0
  236. package/dist/validate.d.ts +31 -70
  237. package/dist/validate.d.ts.map +1 -1
  238. package/dist/validate.js +52 -92
  239. package/dist/validate.js.map +1 -1
  240. package/dist/{attachment-download.d.ts → wire/attachment-download.d.ts} +0 -57
  241. package/dist/wire/attachment-download.d.ts.map +1 -0
  242. package/dist/{attachment-download.js → wire/attachment-download.js} +0 -61
  243. package/dist/wire/attachment-download.js.map +1 -0
  244. package/dist/{auth.d.ts → wire/auth.d.ts} +5 -8
  245. package/dist/wire/auth.d.ts.map +1 -0
  246. package/dist/{auth.js → wire/auth.js} +5 -8
  247. package/dist/wire/auth.js.map +1 -0
  248. package/dist/{wire-body.d.ts → wire/body.d.ts} +35 -12
  249. package/dist/wire/body.d.ts.map +1 -0
  250. package/dist/{wire-body.js → wire/body.js} +74 -13
  251. package/dist/wire/body.js.map +1 -0
  252. package/dist/{wire-entry.d.ts → wire/index.d.ts} +12 -12
  253. package/dist/wire/index.d.ts.map +1 -0
  254. package/dist/{wire-entry.js → wire/index.js} +13 -17
  255. package/dist/wire/index.js.map +1 -0
  256. package/dist/wire/record.d.ts +31 -0
  257. package/dist/wire/record.d.ts.map +1 -0
  258. package/dist/{wire-record.js → wire/record.js} +7 -67
  259. package/dist/wire/record.js.map +1 -0
  260. package/dist/{wire-request.d.ts → wire/request.d.ts} +32 -49
  261. package/dist/wire/request.d.ts.map +1 -0
  262. package/dist/{wire-request.js → wire/request.js} +113 -83
  263. package/dist/wire/request.js.map +1 -0
  264. package/package.json +7 -7
  265. package/dist/adapter-entry.d.ts +0 -16
  266. package/dist/adapter-entry.d.ts.map +0 -1
  267. package/dist/adapter-entry.js +0 -14
  268. package/dist/adapter-entry.js.map +0 -1
  269. package/dist/attachment-download.d.ts.map +0 -1
  270. package/dist/attachment-download.js.map +0 -1
  271. package/dist/auth.d.ts.map +0 -1
  272. package/dist/auth.js.map +0 -1
  273. package/dist/changes.d.ts.map +0 -1
  274. package/dist/changes.js.map +0 -1
  275. package/dist/combine.d.ts.map +0 -1
  276. package/dist/combine.js.map +0 -1
  277. package/dist/did-entry.d.ts.map +0 -1
  278. package/dist/did-entry.js.map +0 -1
  279. package/dist/did.d.ts.map +0 -1
  280. package/dist/did.js.map +0 -1
  281. package/dist/identity-bindings.d.ts.map +0 -1
  282. package/dist/identity-bindings.js.map +0 -1
  283. package/dist/limits.d.ts.map +0 -1
  284. package/dist/limits.js.map +0 -1
  285. package/dist/record-id.d.ts +0 -70
  286. package/dist/record-id.d.ts.map +0 -1
  287. package/dist/record-id.js +0 -127
  288. package/dist/record-id.js.map +0 -1
  289. package/dist/scoped-stack.d.ts +0 -549
  290. package/dist/scoped-stack.d.ts.map +0 -1
  291. package/dist/scoped-stack.js +0 -1301
  292. package/dist/scoped-stack.js.map +0 -1
  293. package/dist/sort.d.ts.map +0 -1
  294. package/dist/sort.js.map +0 -1
  295. package/dist/stack-reads.d.ts +0 -38
  296. package/dist/stack-reads.d.ts.map +0 -1
  297. package/dist/stack-reads.js +0 -79
  298. package/dist/stack-reads.js.map +0 -1
  299. package/dist/stack.d.ts +0 -1032
  300. package/dist/stack.d.ts.map +0 -1
  301. package/dist/stack.js +0 -2337
  302. package/dist/stack.js.map +0 -1
  303. package/dist/types.d.ts +0 -1278
  304. package/dist/types.d.ts.map +0 -1
  305. package/dist/types.js +0 -51
  306. package/dist/types.js.map +0 -1
  307. package/dist/wire-body.d.ts.map +0 -1
  308. package/dist/wire-body.js.map +0 -1
  309. package/dist/wire-entry.d.ts.map +0 -1
  310. package/dist/wire-entry.js.map +0 -1
  311. package/dist/wire-record.d.ts +0 -50
  312. package/dist/wire-record.d.ts.map +0 -1
  313. package/dist/wire-record.js.map +0 -1
  314. package/dist/wire-request.d.ts.map +0 -1
  315. package/dist/wire-request.js.map +0 -1
  316. /package/dist/{did.d.ts → did/did.d.ts} +0 -0
  317. /package/dist/{identity-bindings.d.ts → stack/identity-bindings.d.ts} +0 -0
@@ -0,0 +1,444 @@
1
+ /**
2
+ * Stack — Core Stack Class
3
+ * -------------------------------------------------------
4
+ * The Stack class is the primary interface for apps. It sits
5
+ * on top of a StackAdapter and adds:
6
+ *
7
+ * - ID generation, and validation of every caller-supplied field
8
+ * - Type definition, schema hashing and drift detection
9
+ * - Content validation on write, and the integrity rules in integrity.ts
10
+ * - Migrations: the registry, commitMigration() and owner-driven migrateAll()
11
+ * - Version snapshots, the change journal, soft delete and purge
12
+ * - Association and permission edits, and the change feed
13
+ * - Attachments, type-level grants and app installs, whose bodies live
14
+ * beside this file
15
+ * - asEntity()/asActor(), the scoped views that enforce access control
16
+ *
17
+ * Apps should never talk to a StackAdapter directly.
18
+ */
19
+ import type { StackRecord, StackType, TypeSchema, TypeId, BaseId, StackAdapter, StackQuery, QueryResult, AssociationEdit, AuthorityAssociation, DataAssociation, RecordVersion, StackCapabilities, IfVersionOptions, GrantContent, TypeGrant, PutAttachmentOptions, AttachmentContent, FileId, EntityId, AppId, InstallContent, RecordId, Actor, ActorOptions, RecordChange, SubscribeOptions, Unsubscribe, JournalQuery, VersionsQuery, RecordJournalEntry } from '../types/index.js';
20
+ import type { GrantQuery } from '../grants.js';
21
+ import type { AppManifest, InstallPlan } from '../install.js';
22
+ import { ScopedStack } from '../scoped-stack/scoped-stack.js';
23
+ import type { BackdatableCreateRecordOptions, CollectAttachmentGarbageOptions, CollectAttachmentGarbageResult, DefineTypeOptions, DeleteRecordOptions, DeleteResult, GetRecordOptions, MigrateAllOptions, StackClient, StackOptions } from './client.js';
24
+ import type { ExpectationOptions } from './write-expectation.js';
25
+ import type { GateOptions } from './write-gate.js';
26
+ import type { ContentOf, ReadonlyTypeSchema, TypeHandle } from '../type-handle.js';
27
+ import type { Collection } from '../collection.js';
28
+ export declare class Stack implements StackClient {
29
+ private readonly adapter;
30
+ private readonly idTimestampSkewMsValue;
31
+ private readonly migrations;
32
+ /**
33
+ * Types this instance has fetched or defined, keyed by versioned id. A
34
+ * Type's schema is immutable once defined, so entries are never
35
+ * invalidated, only added; listTypes() refreshes wholesale. See
36
+ * docs/spec/data-model.md § Type cache.
37
+ */
38
+ private readonly typeCache;
39
+ /** Set by close(). See docs/spec/adapters.md § Lifecycle. */
40
+ private closed;
41
+ /**
42
+ * Every change made through this Stack. `ScopedStack` filters this same
43
+ * stream rather than opening its own, so no scoped view can observe a
44
+ * change the stack did not emit. See docs/spec/events.md.
45
+ */
46
+ private readonly changes;
47
+ private constructor();
48
+ /**
49
+ * Announce a mutation that has already been persisted. Called after the
50
+ * adapter write resolves and before the mutating method settles, so
51
+ * `await stack.patchContent(...)` guarantees subscribers have been notified —
52
+ * and nothing about work they deferred. A handler cannot fail the write:
53
+ * there is nothing left to fail. See docs/spec/events.md § Handlers.
54
+ */
55
+ private announce;
56
+ /**
57
+ * The actor for a `create` journal entry, read off the record as just
58
+ * built. Create is the one journaled write that stamps the requester
59
+ * onto the row itself, so the record in hand is authoritative — and it
60
+ * carries `appId`, which ActorOptions has no field for.
61
+ */
62
+ private static createActor;
63
+ private getTypeCached;
64
+ /**
65
+ * Open a Stack over an adapter. Reads ownerEntityId and timezone from the adapter.
66
+ */
67
+ static open(adapter: StackAdapter, opts?: StackOptions): Promise<Stack>;
68
+ /**
69
+ * Idempotent bootstrap for StackOptions.ownerProfile. Its probe sees every
70
+ * card the binding rules do, deleted and migrated ones included, or it
71
+ * would mint one they then refuse and the stack would not reopen.
72
+ * See docs/spec/identity.md § Entity.
73
+ */
74
+ private ensureOwnerEntity;
75
+ get ownerEntityId(): EntityId;
76
+ getEntityByDid(did: EntityId): Promise<StackRecord | null>;
77
+ getOwnerEntity(): Promise<StackRecord | null>;
78
+ get timezone(): string | undefined;
79
+ get capabilities(): StackCapabilities;
80
+ /**
81
+ * Get a permission-scoped view of this Stack, as if requests came from
82
+ * the given entity acting as itself (null = anonymous). Plain Stack
83
+ * methods are unscoped; use asEntity() when one Stack serves multiple,
84
+ * possibly untrusted, entities. See
85
+ * docs/spec/access-control.md § Enforcement: Stack.asEntity().
86
+ */
87
+ asEntity(entityId: EntityId | null): ScopedStack;
88
+ /**
89
+ * Scope to an Actor — a delegated app acting for its user, or a
90
+ * TokenSession as StackTokenStore.lookupToken() returns it, which is what
91
+ * a server should pass at its request boundary.
92
+ * See docs/spec/access-control.md § Delegation: principal and subject.
93
+ */
94
+ asActor(actor: Actor): ScopedStack;
95
+ /**
96
+ * A scoped view needs a stack that owns its storage: one whose adapter
97
+ * queries within a reach and relays no changes from elsewhere. A
98
+ * server-backed stack is scoped by the session that opened it instead.
99
+ * See docs/spec/access-control.md § Enforcement: Stack.asEntity().
100
+ */
101
+ private scope;
102
+ collection<S extends ReadonlyTypeSchema>(handle: TypeHandle<S>): Collection<ContentOf<S>>;
103
+ /**
104
+ * Define and persist a Type; call at app startup before creating records
105
+ * of the type. Redefining an existing typeId is checked against the
106
+ * stored schema: identical is a no-op, a name-only change persists, and
107
+ * anything beyond additive evolution throws StackSchemaDriftError. See
108
+ * docs/spec/data-model.md § Schema drift detection.
109
+ */
110
+ defineType({ id, name, schema: declared, migratesFrom, }: DefineTypeOptions): Promise<StackType>;
111
+ getType(id: TypeId): Promise<StackType | null>;
112
+ /** Refreshes typeCache wholesale — the explicit way to see a rename made by another writer. */
113
+ listTypes(): Promise<StackType[]>;
114
+ /**
115
+ * Check whether a record's type is compatible with a required schema.
116
+ * Useful for duck-typed consumption across types.
117
+ */
118
+ typeIsCompatible(typeId: TypeId, requiredSchema: TypeSchema): Promise<boolean>;
119
+ /**
120
+ * Migrate every record of a family, deleted ones included, to the latest
121
+ * version, aborting on the first that fails validation. `sweep: 'listed'`
122
+ * is for a contained app that cannot see unlisted or deleted content.
123
+ * See docs/spec/data-model.md § Type migrations.
124
+ */
125
+ migrateAll(baseId: BaseId, opts?: MigrateAllOptions): Promise<{
126
+ migrated: number;
127
+ skipped: number;
128
+ }>;
129
+ /**
130
+ * Create a record, validated against its type's schema. The one site that
131
+ * stamps a `_group`'s author as its first `admin`, for scoped creates too.
132
+ * Backdating is accepted unconditionally here; ScopedStack decides who may.
133
+ * See docs/spec/data-model.md § Backdating on import.
134
+ */
135
+ create<T extends Record<string, unknown> = Record<string, unknown>>(typeId: TypeId, input: T, opts?: BackdatableCreateRecordOptions): Promise<StackRecord & {
136
+ content: T;
137
+ }>;
138
+ /**
139
+ * Get a record by ID, exactly as stored — no implicit migration. Pass
140
+ * { presentAt: 'latest' } to migrate in memory; only migrateAll()
141
+ * commits migrations to disk. A soft-deleted record answers `null` unless
142
+ * { includeDeleted: true } is passed.
143
+ */
144
+ get(id: RecordId, opts?: GetRecordOptions): Promise<StackRecord | null>;
145
+ /**
146
+ * Merge a patch into a record's content, checked against its current
147
+ * stored type. A patch the content already satisfies writes nothing.
148
+ * See docs/spec/data-model.md § Mutations.
149
+ */
150
+ patchContent(id: RecordId, patch: Record<string, unknown | null>, opts?: IfVersionOptions & ActorOptions & ExpectationOptions): Promise<StackRecord>;
151
+ /**
152
+ * Every check a content patch owes, all before anything is written.
153
+ * Returns the merged content, which the caller compares to decide whether
154
+ * content moved.
155
+ */
156
+ private validatePatch;
157
+ /**
158
+ * Move a record under another, or to the root with `null`. The
159
+ * destination is checked only when it changes: it has to exist, and the
160
+ * move must not make the record its own ancestor.
161
+ * See docs/spec/data-model.md § Reparenting.
162
+ */
163
+ setParent(id: RecordId, parentId: RecordId | null, opts?: IfVersionOptions & ActorOptions & ExpectationOptions): Promise<StackRecord>;
164
+ /**
165
+ * Withhold a record from enumeration, or restore it. Restating the
166
+ * current state writes nothing, so `unlistedAt` is never dragged forward.
167
+ * See docs/spec/unlisted.md.
168
+ */
169
+ setUnlisted(id: RecordId, unlisted: boolean, opts?: IfVersionOptions & ActorOptions & ExpectationOptions): Promise<StackRecord>;
170
+ /**
171
+ * Apply adds and removes to a record's data associations: one adapter
172
+ * write, one journal entry carrying each element in full, so the entry is
173
+ * as undoable as a single-element one. An add naming a held identity with
174
+ * a new `attachmentRecordId` re-points it — see docs/spec/attachments.md
175
+ * § Naming the upload a reference came from.
176
+ */
177
+ editAssociations(id: RecordId, edits: AssociationEdit[], opts?: IfVersionOptions & ActorOptions & ExpectationOptions & GateOptions): Promise<StackRecord>;
178
+ /**
179
+ * Make a record's data associations exactly `associations`. Its
180
+ * permissions are another aspect, which this never reads or writes.
181
+ */
182
+ setAssociations(id: RecordId, associations: DataAssociation[], opts?: IfVersionOptions & ActorOptions & ExpectationOptions & GateOptions): Promise<StackRecord>;
183
+ /**
184
+ * The shared half of the two data-association writes, from the set the
185
+ * write would leave: nothing moved writes nothing, a roster keeps an
186
+ * admin, and every new attachment pointer names its own upload.
187
+ */
188
+ private writeAssociations;
189
+ /**
190
+ * Apply adds and removes to who reaches a record. The write-implies-read
191
+ * invariant is asked once, of the set the whole list produces, so a
192
+ * downgrade is one call. See docs/spec/access-control.md § Write implies read.
193
+ */
194
+ editAccess(id: RecordId, edits: AssociationEdit[], opts?: IfVersionOptions & ActorOptions & ExpectationOptions & GateOptions): Promise<StackRecord>;
195
+ /** Make who reaches a record exactly `permissions`; `[]` is private. */
196
+ setAccess(id: RecordId, permissions: AuthorityAssociation[], opts?: IfVersionOptions & ActorOptions & ExpectationOptions & GateOptions): Promise<StackRecord>;
197
+ private writeAccess;
198
+ /**
199
+ * Run an element-set write from its read onward, again from a fresh read
200
+ * each time the adapter finds the set moved since the last one, so the
201
+ * rules over the resulting set are asked of the set the write lands on.
202
+ * Unbounded: each refusal means another write landed.
203
+ * See docs/spec/versioning.md § Element-set writes compare the set they read.
204
+ */
205
+ private untilSetHolds;
206
+ /**
207
+ * Land a write that never bumps. Its precondition and journal entry
208
+ * travel together here, so no aspect verb can drop either.
209
+ */
210
+ private writeAspect;
211
+ /**
212
+ * Hold a permission set to the cross-element invariant — see
213
+ * validatePermissions() in access.ts for why it reads the post-state.
214
+ */
215
+ private assertPermissionSet;
216
+ /**
217
+ * A soft-deleted record has no current state to edit, so the verbs that
218
+ * edit one refuse it; undelete() and commitMigration() do not call this.
219
+ * Asked after the record is found and, under ScopedStack, after the
220
+ * authority decision. See docs/spec/versioning.md § Mutations are refused,
221
+ * not applied to a tombstone.
222
+ */
223
+ private refuseIfDeleted;
224
+ /**
225
+ * The record a write addresses, past every refusal owed before
226
+ * validation: missing, another family, a caller's gate, soft-deleted,
227
+ * then a stale `ifVersion` — before validation, so a caller that lost the
228
+ * race hears that first, and before any no-op, so a write that moved
229
+ * nothing never satisfies a precondition.
230
+ */
231
+ private requireWritable;
232
+ /**
233
+ * A by-id read straight from the adapter, for the integrity checks a write
234
+ * runs once it is under way: they read past the open-check, as the write
235
+ * they belong to was admitted before any close() began.
236
+ */
237
+ private readonly readRecord;
238
+ /** The record, or the not-found refusal every mutating verb owes. */
239
+ private requireRecord;
240
+ /**
241
+ * Soft-delete a record, or purge it with its history, reporting the
242
+ * record as the write left it — or as a purge destroyed it — captured in
243
+ * the same write, so nothing lands unseen between a read and the delete.
244
+ * See docs/spec/versioning.md § Deletion and docs/spec/attachments.md
245
+ * § A purge strands the bytes it referenced.
246
+ */
247
+ delete(id: RecordId, opts?: DeleteRecordOptions & ActorOptions & ExpectationOptions): Promise<DeleteResult>;
248
+ /**
249
+ * The files a record references, by the same definition
250
+ * deleteAttachment() and the garbage sweep use: attachment associations
251
+ * and top-level `file-ref` content fields. An `_attachment` record's own
252
+ * `fileId` is a plain string by design and is not one, which is why
253
+ * purging a metadata record reports nothing — see systemTypeDefinitions().
254
+ */
255
+ private referencedFileIds;
256
+ /**
257
+ * Reverse a soft delete. Idempotent — undeleting a record that isn't
258
+ * deleted returns it unchanged. Purged records are gone, so this
259
+ * throws StackNotFoundError for them just like any other missing record.
260
+ * Snapshots and bumps version, same as delete().
261
+ */
262
+ undelete(id: RecordId, opts?: IfVersionOptions & ActorOptions & ExpectationOptions): Promise<StackRecord>;
263
+ /**
264
+ * Query records. filter.baseId matches every version of a type family.
265
+ * Results come back exactly as stored; pass presentAt: 'latest' to
266
+ * migrate in memory. See docs/spec/data-model.md § Queries.
267
+ */
268
+ query(query?: StackQuery): Promise<QueryResult>;
269
+ /**
270
+ * Everything query() does around the adapter call once the query is
271
+ * split and checked: the migration on the way out. `read` is the call,
272
+ * so a scoped query within a reach gets the same treatment as any other.
273
+ */
274
+ private dispatchQuery;
275
+ getVersions(id: RecordId, query?: VersionsQuery): Promise<RecordVersion[]>;
276
+ /**
277
+ * A record's change journal, oldest first, ungated. A missing or purged
278
+ * record is StackNotFoundError, since a destroyed log and an empty one
279
+ * are not the same answer. See docs/spec/journal.md § Reading it.
280
+ */
281
+ getJournal(id: RecordId, query?: JournalQuery): Promise<RecordJournalEntry[]>;
282
+ getVersion(id: RecordId, version: number): Promise<RecordVersion | null>;
283
+ /**
284
+ * Restore a record to a previous version by creating a new version —
285
+ * never rewrites history. The snapshot is validated against its own
286
+ * stored typeId, and puts back `content` and `typeId` alone: a snapshot
287
+ * carries nothing else. See docs/spec/versioning.md § Restore semantics.
288
+ */
289
+ restoreVersion(id: RecordId, version: number, opts?: IfVersionOptions & ActorOptions & ExpectationOptions): Promise<StackRecord>;
290
+ /**
291
+ * Commit a per-record migration with caller-supplied content. Create-shaped
292
+ * at the destination and update-shaped over the record, so it owes both
293
+ * sets of integrity checks. See docs/spec/data-model.md § Type migrations.
294
+ */
295
+ commitMigration(id: RecordId, toTypeId: TypeId, content: Record<string, unknown>, opts?: IfVersionOptions & ActorOptions): Promise<StackRecord>;
296
+ /**
297
+ * The checked migration write behind commitMigration() and migrateAll(),
298
+ * taking the record in hand so a batch pass needs no re-read. A Migration
299
+ * function is held to the same checks as a request body: app code is no
300
+ * trust boundary here.
301
+ */
302
+ private commitMigrationChecked;
303
+ /**
304
+ * Store bytes and create their `_attachment@1` metadata record, returning
305
+ * it: `content.fileId` addresses the bytes, `id` the metadata. Uses the
306
+ * adapter's atomic putAttachmentWithMetadata() where there is one.
307
+ * See docs/spec/wire-format.md § Attachments.
308
+ */
309
+ putAttachment(data: Uint8Array, opts: PutAttachmentOptions): Promise<StackRecord & {
310
+ content: AttachmentContent;
311
+ }>;
312
+ getAttachment(fileId: FileId): Promise<Uint8Array>;
313
+ /**
314
+ * Every `_attachment` record describing `fileId`, earliest-recorded first.
315
+ * Not on StackClient: it presents an access decision already made, which
316
+ * a scoped version would only check a second, different way. See
317
+ * docs/spec/attachments.md § Finding a `fileId`'s metadata records.
318
+ */
319
+ getAttachmentRecords(fileId: FileId): Promise<(StackRecord & {
320
+ content: AttachmentContent;
321
+ })[]>;
322
+ /**
323
+ * Delete an attachment's bytes and every _attachment metadata record for
324
+ * it, family-wide. Throws StackConflictError if any record in the stack
325
+ * still references the file, StackNotFoundError if neither metadata
326
+ * records nor bytes exist.
327
+ */
328
+ deleteAttachment(fileId: FileId, opts?: ActorOptions): Promise<void>;
329
+ /**
330
+ * Sweep for attachment bytes unreachable from any record — live or
331
+ * soft-deleted — and delete bytes + metadata. Deletion goes through
332
+ * deleteAttachment(), so a file re-referenced by sweep time is skipped,
333
+ * not a failure. See docs/spec/attachments.md § Garbage collection.
334
+ */
335
+ collectAttachmentGarbage(opts?: CollectAttachmentGarbageOptions & ActorOptions): Promise<CollectAttachmentGarbageResult>;
336
+ /**
337
+ * Observe every change made through this Stack, unfiltered. Async so a
338
+ * remote stack resolves once its feed is live, making subscribe-then-query
339
+ * gap-free. See docs/spec/events.md § Subscribing.
340
+ */
341
+ subscribe(handler: (change: RecordChange) => void, opts?: SubscribeOptions): Promise<Unsubscribe>;
342
+ /**
343
+ * Ask the adapter to relay changes made elsewhere, if it can. One relay
344
+ * per subscription, carrying its filter to the far end, which holds the
345
+ * records that filter needs. See docs/spec/events.md § Where events come
346
+ * from.
347
+ */
348
+ private openRelay;
349
+ /** Whether changes reach this stack from elsewhere. */
350
+ private get relaysChanges();
351
+ /**
352
+ * Flush pending writes to the underlying storage. A no-op for adapters
353
+ * that commit on every call (SQLite, the API adapter); meaningful for
354
+ * ones that buffer, and for checkpointing a stack that stays open —
355
+ * close() covers the teardown case on its own.
356
+ */
357
+ flush(): Promise<void>;
358
+ /**
359
+ * Flush, then release any resources the adapter holds (connections, file
360
+ * handles, lock files). A failed flush still releases them before it
361
+ * propagates: an unwritable stack must not also leak a lock file.
362
+ * See docs/spec/adapters.md § Lifecycle.
363
+ */
364
+ close(): Promise<void>;
365
+ /** Throws once close() has run. */
366
+ private assertOpen;
367
+ /**
368
+ * Create a `_grant` authorizing `grantee` to take `actions` on `baseId`'s
369
+ * family. An app's `-own` is read as the bare verb when it acts for
370
+ * someone, so grant it the types it needs, not the narrowest-looking
371
+ * suffix. See docs/spec/access-control.md § Type-level grants.
372
+ */
373
+ grantType(baseId: BaseId, grant: TypeGrant): Promise<StackRecord & {
374
+ content: GrantContent;
375
+ }>;
376
+ /**
377
+ * List `_grant` records: all of them, or those `grantType()` would have
378
+ * written for the same grantee. The `entity` arm instead lists what
379
+ * currently applies to that entity, so it is not a preview of what
380
+ * `revokeType()` would withdraw. See docs/spec/access-control.md § Listing
381
+ * and revoking.
382
+ */
383
+ listTypeGrants(query?: GrantQuery): Promise<(StackRecord & {
384
+ content: GrantContent;
385
+ })[]>;
386
+ /**
387
+ * The inverse of grantType(): soft-deletes the matching `_grant` records,
388
+ * grantee and actions matched exactly, and returns them. Matching nothing
389
+ * is not an error, so re-running a revocation stays safe.
390
+ * See docs/spec/access-control.md § Listing and revoking.
391
+ */
392
+ revokeType(baseId: BaseId, grant: TypeGrant): Promise<(StackRecord & {
393
+ content: GrantContent;
394
+ })[]>;
395
+ /**
396
+ * What applying `manifest` for the key `did` would change, for the owner
397
+ * to review before installApp(). Writes nothing. Refuses outright what no
398
+ * approval could make valid: a type outside the app's own namespace and
399
+ * the commons, a request the grant rules refuse, or a `did` already
400
+ * registered to a different app. See docs/spec/apps.md § Plan, then apply.
401
+ */
402
+ planInstall(submitted: AppManifest, opts: {
403
+ did: EntityId;
404
+ }): Promise<InstallPlan>;
405
+ /**
406
+ * Apply an approved plan: types, the key's `_app` card, the `_install`
407
+ * Record and every linked key's grants. A plan the stack has moved on
408
+ * from is a StackConflictError, so what lands is what was approved.
409
+ * See docs/spec/apps.md § Plan, then apply.
410
+ */
411
+ installApp(plan: InstallPlan): Promise<StackRecord & {
412
+ content: InstallContent;
413
+ }>;
414
+ /**
415
+ * Withdraw every grant an install produced and soft-delete it. The app's
416
+ * records and `_app` cards stay: the data is the owner's, and the cards
417
+ * are what its records' attribution resolves through. Returns the
418
+ * install's tombstone. See docs/spec/apps.md § Uninstalling.
419
+ */
420
+ uninstallApp(appId: AppId): Promise<StackRecord & {
421
+ content: InstallContent;
422
+ }>;
423
+ /**
424
+ * Fast-fail for the ifVersion precondition using the already-fetched
425
+ * record. The adapter re-checks atomically at write time (the source of
426
+ * truth for concurrent writers) — this just skips validation and
427
+ * snapshotting work when the mismatch is already visible.
428
+ */
429
+ private checkIfVersion;
430
+ /**
431
+ * The options every version-bumping adapter write carries — precondition,
432
+ * prior-state snapshot and actor — taken together so a new verb cannot
433
+ * omit one. See docs/spec/versioning.md § Version history.
434
+ */
435
+ private writeOptions;
436
+ /**
437
+ * A record's prior state for the version it is about to leave: `content`
438
+ * and the `typeId` it is read under, which only a snapshot keeps. The
439
+ * journal keeps everything else. See docs/spec/versioning.md § Version
440
+ * history.
441
+ */
442
+ private buildVersionSnapshot;
443
+ }
444
+ //# sourceMappingURL=stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../src/stack/stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA4BH,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,MAAM,EACN,MAAM,EACN,YAAY,EACZ,UAAU,EAEV,WAAW,EAEX,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,MAAM,EAEN,QAAQ,EAER,KAAK,EACL,cAAc,EACd,QAAQ,EACR,KAAK,EACL,YAAY,EAEZ,YAAY,EAGZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAqC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAgB9D,OAAO,EAAE,WAAW,EAAc,MAAM,iCAAiC,CAAC;AAmB1E,OAAO,KAAK,EACV,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,EAC9B,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACb,MAAM,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,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