@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
@@ -1 +1 @@
1
- {"version":3,"file":"access.js","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAWvC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAmB,EACnB,eAAgC,EAChC,aAA8B,EAC9B,IAAgB,EAChB,aAA6B;IAE7B,IAAI,eAAe,IAAI,eAAe,KAAK,aAAa;QAAE,OAAO,IAAI,CAAC;IAEtE,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC;IAEjC,4BAA4B;IAC5B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAE/C,K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F,IAAI,YAAY;QAAE,OAAO,IAAI,CAAC;IAC9B,OAAO;QACL,GAAG,IAAI;QACP,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;KACxF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAoE,EACpE,aAAuB;IAEvB,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;IAC1F,OAAO,WAAW,KAAK,aAAa,IAAI,KAAK,CAAC,SAAS,KAAK,aAAa,CAAC;AAC5E,CAAC"}
@@ -1,4 +1,11 @@
1
- import type { StackAdapter, StackRecordAdapter, StackBlobAdapter } from './types.js';
1
+ /**
2
+ * Combining adapters
3
+ * -------------------------------------------------------
4
+ * A full StackAdapter assembled from a record half and a blob half, so a
5
+ * deployment can keep records and bytes in different backends without
6
+ * either adapter knowing about the other.
7
+ */
8
+ import type { StackAdapter, StackRecordAdapter, StackBlobAdapter } from '../types/index.js';
2
9
  /**
3
10
  * Compose a StackRecordAdapter and a StackBlobAdapter into a single StackAdapter.
4
11
  * Use this when you want different backends for records and blobs, e.g.:
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combine.d.ts","sourceRoot":"","sources":["../../src/adapter/combine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAGV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,gBAAgB,CAAC;CACxB,GAAG,YAAY,CA8Ef"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Combining adapters
3
+ * -------------------------------------------------------
4
+ * A full StackAdapter assembled from a record half and a blob half, so a
5
+ * deployment can keep records and bytes in different backends without
6
+ * either adapter knowing about the other.
7
+ */
1
8
  /**
2
9
  * Compose a StackRecordAdapter and a StackBlobAdapter into a single StackAdapter.
3
10
  * Use this when you want different backends for records and blobs, e.g.:
@@ -18,11 +25,16 @@ export function combineAdapters(parts) {
18
25
  },
19
26
  createRecord: (r, opts) => parts.record.createRecord(r, opts),
20
27
  getRecord: (id) => parts.record.getRecord(id),
21
- mutateRecord: (id, changes, opts) => parts.record.mutateRecord(id, changes, opts),
28
+ patchContent: (id, patch, opts) => parts.record.patchContent(id, patch, opts),
22
29
  deleteRecord: (id, opts) => parts.record.deleteRecord(id, opts),
23
30
  undeleteRecord: (id, opts) => parts.record.undeleteRecord(id, opts),
24
31
  queryRecords: (q) => parts.record.queryRecords(q),
25
- amendAssociations: (id, changes, opts) => parts.record.amendAssociations(id, changes, opts),
32
+ setParent: (id, parentId, opts) => parts.record.setParent(id, parentId, opts),
33
+ setUnlisted: (id, unlisted, opts) => parts.record.setUnlisted(id, unlisted, opts),
34
+ editAssociations: (id, edits, opts) => parts.record.editAssociations(id, edits, opts),
35
+ setAssociations: (id, list, opts) => parts.record.setAssociations(id, list, opts),
36
+ editAccess: (id, edits, opts) => parts.record.editAccess(id, edits, opts),
37
+ setAccess: (id, list, opts) => parts.record.setAccess(id, list, opts),
26
38
  getVersions: (id, query) => parts.record.getVersions(id, query),
27
39
  getVersion: (id, v) => parts.record.getVersion(id, v),
28
40
  saveVersion: (id, v) => parts.record.saveVersion(id, v),
@@ -36,7 +48,10 @@ export function combineAdapters(parts) {
36
48
  // absent on the combined adapter, rather than silently becoming
37
49
  // "supported" via a wrapper that forwards to a missing method.
38
50
  ...(parts.record.deleteUnreferencedAttachmentRecords && {
39
- deleteUnreferencedAttachmentRecords: (fileId, metadataTypeIds) => parts.record.deleteUnreferencedAttachmentRecords(fileId, metadataTypeIds),
51
+ deleteUnreferencedAttachmentRecords: (fileId, metadataBaseId) => parts.record.deleteUnreferencedAttachmentRecords(fileId, metadataBaseId),
52
+ }),
53
+ ...(parts.record.queryReadable && {
54
+ queryReadable: (q, reach) => parts.record.queryReadable(q, reach),
40
55
  }),
41
56
  // Forwarded on the same terms, and it decides more than it looks:
42
57
  // Stack.relaysChanges reads its presence, so dropping it here would
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combine.js","sourceRoot":"","sources":["../../src/adapter/combine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH;;;;;;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,QAAQ,CAAC;QAC/B,CAAC;QAED,YAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC;QAC7D,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7C,YAAY,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC;QAC7E,YAAY,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC;QAC/D,cAAc,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,I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CAAC;SACxF,CAAC;QAEF,kEAAkE;QAClE,oEAAoE;QACpE,sEAAsE;QACtE,4CAA4C;QAC5C,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,gBAAgB,IAAI;YACnC,gBAAgB,EAAE,CAAC,IAAsB,EAAE,OAAuC,EAAE,EAAE,CACpF,KAAK,CAAC,MAAM,CAAC,gBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC;SAChD,CAAC;QAEF,+DAA+D;QAC/D,uEAAuE;QACvE,mEAAmE;QACnE,2DAA2D;QAC3D,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAC3C,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7C,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"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @haverstack/core/adapter
3
+ * -------------------------------------------------------
4
+ * The interfaces a storage adapter implements — the full StackAdapter,
5
+ * its record and blob halves, and the options Stack hands them — plus the
6
+ * helpers adapters share. Audience: adapter implementers (see the in-repo
7
+ * adapters). Types an app reads too, such as StackCapabilities, live in
8
+ * the root entry point instead: every export has exactly one home.
9
+ */
10
+ export type { AdapterQuery, PlainQuery, AdapterSort, StackAdapter, StackRecordAdapter, StackBlobAdapter, BlobInfo, SnapshotOptions, JournalEntryInput, JournalOptions, MutateOptions, AspectWriteOptions, ElementWriteOptions, Reach, } from '../types/index.js';
11
+ export { sameAssociationSet } from '../associations/identity.js';
12
+ export { ElementSetMovedError, OwnerMismatchError, softDeletedRefusal } from '../errors.js';
13
+ export { combineAdapters } from './combine.js';
14
+ export { inReach } from './reach.js';
15
+ export type { ReachedRecord } from './reach.js';
16
+ export { assertQueryCapabilities, assertValidSort, resolveQuery, assertValidAssociationFilters, assertValidJournalQuery, assertValidVersionsQuery, filtersContent, parseContentFilterKey, } from '../query-validation.js';
17
+ export { contentSortEntry, contentSortKey, compareSortEntries, constantSortEntry, sortConstant, } from './sort.js';
18
+ export type { SortEntry } from './sort.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @haverstack/core/adapter
3
+ * -------------------------------------------------------
4
+ * The interfaces a storage adapter implements — the full StackAdapter,
5
+ * its record and blob halves, and the options Stack hands them — plus the
6
+ * helpers adapters share. Audience: adapter implementers (see the in-repo
7
+ * adapters). Types an app reads too, such as StackCapabilities, live in
8
+ * the root entry point instead: every export has exactly one home.
9
+ */
10
+ export { sameAssociationSet } from '../associations/identity.js';
11
+ export { ElementSetMovedError, OwnerMismatchError, softDeletedRefusal } from '../errors.js';
12
+ export { combineAdapters } from './combine.js';
13
+ export { inReach } from './reach.js';
14
+ export { assertQueryCapabilities, assertValidSort, resolveQuery, assertValidAssociationFilters, assertValidJournalQuery, assertValidVersionsQuery, filtersContent, parseContentFilterKey, } from '../query-validation.js';
15
+ export { contentSortEntry, contentSortKey, compareSortEntries, constantSortEntry, sortConstant, } from './sort.js';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,WAAW,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Matching a Reach in memory
3
+ * -------------------------------------------------------
4
+ * The one reading of a reach in JavaScript: MemoryAdapter matches a query
5
+ * with it, and ScopedStack asks it of each Record a verb would act on. A
6
+ * SQL adapter states the same conditions in its own query language. See
7
+ * docs/spec/access-control.md § Reach.
8
+ */
9
+ import type { Reach, StackRecord } from '../types/index.js';
10
+ /** What a reach asks of a Record — all a record yet to be created has to show. */
11
+ export type ReachedRecord = Pick<StackRecord, 'typeId' | 'createdBy' | 'permissions'>;
12
+ /** Whether `record` is inside the reach, matched by its family. */
13
+ export declare function inReach(record: ReachedRecord, reach: Reach): boolean;
14
+ //# sourceMappingURL=reach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../../src/adapter/reach.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC,CAAC;AAEtF,mEAAmE;AACnE,wBAAgB,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAmBpE"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Matching a Reach in memory
3
+ * -------------------------------------------------------
4
+ * The one reading of a reach in JavaScript: MemoryAdapter matches a query
5
+ * with it, and ScopedStack asks it of each Record a verb would act on. A
6
+ * SQL adapter states the same conditions in its own query language. See
7
+ * docs/spec/access-control.md § Reach.
8
+ */
9
+ import { associationKey } from '../associations/identity.js';
10
+ import { baseIdOf } from '../schema.js';
11
+ /** Whether `record` is inside the reach, matched by its family. */
12
+ export function inReach(record, reach) {
13
+ const family = baseIdOf(record.typeId);
14
+ if (reach.fence && !reach.fence.includes(family))
15
+ return false;
16
+ const within = reach.within;
17
+ if (!within)
18
+ return true;
19
+ if (within.baseIds.includes(family))
20
+ return true;
21
+ const authored = within.authored;
22
+ if (authored &&
23
+ authored.baseIds.includes(family) &&
24
+ record.createdBy?.subjectId === authored.subjectId) {
25
+ return true;
26
+ }
27
+ const held = new Set((record.permissions ?? []).map(associationKey));
28
+ held.delete(undefined);
29
+ return within.permissions.some((set) => set.length > 0 && set.every((element) => held.has(associationKey(element))));
30
+ }
31
+ //# sourceMappingURL=reach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reach.js","sourceRoot":"","sources":["../../src/adapter/reach.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMxC,mEAAmE;AACnE,MAAM,UAAU,OAAO,CAAC,MAAqB,EAAE,KAAY;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,IACE,QAAQ;QACR,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjC,MAAM,CAAC,SAAS,EAAE,SAAS,KAAK,QAAQ,CAAC,SAAS,EAClD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;IACrE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAC5B,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CACrF,CAAC;AACJ,CAAC"}
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * See docs/spec/data-model.md § Sorting by a content field.
12
12
  */
13
- import type { ScalarFieldKind } from './types.js';
13
+ import type { ScalarFieldKind } from '../types/index.js';
14
14
  /**
15
15
  * A field's value reduced to something ordered: a number, or text plus
16
16
  * the key its ordering actually uses (see contentSortKey).
@@ -24,30 +24,30 @@ export type SortEntry = {
24
24
  key: string;
25
25
  };
26
26
  /**
27
- * Fold text into the key it sorts by: compatibility-decompose, drop
28
- * combining marks, lowercase. `Émile` files with `emile` and `Zebra` with
29
- * `zebra`, which is what a person reading a list expects and what raw
30
- * code-point order gets wrong.
31
- *
32
- * `toLowerCase()`, never `toLocaleLowerCase()` — a locale-sensitive fold
33
- * would order Turkish `İstanbul` differently from every other runtime's,
34
- * and the key is stored, so the divergence would be baked into an index.
35
- * What this deliberately does not promise is in
36
- * docs/spec/data-model.md § Text ordering.
27
+ * Fold text into the key it sorts by — decompose, drop combining marks,
28
+ * lowercase — so `Émile` files with `emile`. `toLowerCase()`, never the
29
+ * locale form: the key is stored, so a locale-sensitive fold would bake one
30
+ * runtime's order into the index. See docs/spec/data-model.md § Text ordering.
37
31
  */
38
32
  export declare const contentSortKey: (value: string) => string;
39
33
  /**
40
- * The ordered form of `value` held in a field of the declared `kind`, or
41
- * null when there is nothing to order by. The kind comes from the schema
42
- * rather than from the value's runtime type: a field that is numeric on
43
- * the records that carry it must not order as text on the ones that
44
- * spell it differently.
45
- *
46
- * `date` normalizes to epoch milliseconds so a date field orders the way
47
- * `createdAt` does instead of by ISO string collation, and `boolean` to
48
- * 0/1 so false precedes true.
34
+ * The ordered form of `value` in a field of the declared `kind`, or null
35
+ * when there is nothing to order by. The kind comes from the schema, not
36
+ * the value, so a field orders one way on every record. `date` orders as
37
+ * epoch ms like `createdAt`, `boolean` as 0/1, and an enum as text, since
38
+ * its declaration order is not part of the schema.
49
39
  */
50
40
  export declare function contentSortEntry(kind: ScalarFieldKind, value: unknown): SortEntry | null;
41
+ /**
42
+ * A constant a `contentFieldByType` key orders by, reduced from a value of
43
+ * `kind` to what it orders as: a number, text, or null for no value. The
44
+ * reduction happens before the query is sent, so an adapter orders it
45
+ * without knowing the kind. See docs/spec/data-model.md § Sorting by a
46
+ * content field.
47
+ */
48
+ export declare function sortConstant(kind: ScalarFieldKind, value: unknown): string | number | null;
49
+ /** The entry a reduced constant orders as; see sortConstant(). */
50
+ export declare function constantSortEntry(value: string | number | null): SortEntry | null;
51
51
  /**
52
52
  * Order two records by one sort field, absent values last. `direction`
53
53
  * reverses the order between values but never moves absence: a record
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/adapter/sort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnG;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MACe,CAAC;AAU/D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAsBxF;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1F;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAIjF;AA+BD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,SAAS,GAAG,IAAI,EACnB,CAAC,EAAE,SAAS,GAAG,IAAI,EACnB,SAAS,EAAE,KAAK,GAAG,MAAM,GACxB,MAAM,CAGR"}
@@ -11,38 +11,25 @@
11
11
  * See docs/spec/data-model.md § Sorting by a content field.
12
12
  */
13
13
  /**
14
- * Fold text into the key it sorts by: compatibility-decompose, drop
15
- * combining marks, lowercase. `Émile` files with `emile` and `Zebra` with
16
- * `zebra`, which is what a person reading a list expects and what raw
17
- * code-point order gets wrong.
18
- *
19
- * `toLowerCase()`, never `toLocaleLowerCase()` — a locale-sensitive fold
20
- * would order Turkish `İstanbul` differently from every other runtime's,
21
- * and the key is stored, so the divergence would be baked into an index.
22
- * What this deliberately does not promise is in
23
- * docs/spec/data-model.md § Text ordering.
14
+ * Fold text into the key it sorts by — decompose, drop combining marks,
15
+ * lowercase — so `Émile` files with `emile`. `toLowerCase()`, never the
16
+ * locale form: the key is stored, so a locale-sensitive fold would bake one
17
+ * runtime's order into the index. See docs/spec/data-model.md § Text ordering.
24
18
  */
25
19
  export const contentSortKey = (value) => value.normalize('NFKD').replace(/\p{M}/gu, '').toLowerCase();
26
20
  /**
27
- * A `date` field may hold an offset-less date-time — the offset is
28
- * optional in the shape validate.ts pins — and bare `Date.parse` resolves
29
- * one of those in the *host's* zone. The stored index value and a cursor
30
- * value re-derived elsewhere would then disagree, skipping or repeating a
31
- * record at a page boundary, and two adapters in two zones would answer
32
- * one query in two orders. A zone-less date-time is read as UTC, which is
33
- * what `Date.parse` already does for a date-only string.
21
+ * A zone-less date-time, read as UTC as `Date.parse` already reads a
22
+ * date-only string. Read in the host's zone, a stored index value and a
23
+ * cursor re-derived elsewhere would disagree at a page boundary, and two
24
+ * adapters in two zones would order one query two ways.
34
25
  */
35
26
  const ZONELESS_DATE_TIME_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?$/;
36
27
  /**
37
- * The ordered form of `value` held in a field of the declared `kind`, or
38
- * null when there is nothing to order by. The kind comes from the schema
39
- * rather than from the value's runtime type: a field that is numeric on
40
- * the records that carry it must not order as text on the ones that
41
- * spell it differently.
42
- *
43
- * `date` normalizes to epoch milliseconds so a date field orders the way
44
- * `createdAt` does instead of by ISO string collation, and `boolean` to
45
- * 0/1 so false precedes true.
28
+ * The ordered form of `value` in a field of the declared `kind`, or null
29
+ * when there is nothing to order by. The kind comes from the schema, not
30
+ * the value, so a field orders one way on every record. `date` orders as
31
+ * epoch ms like `createdAt`, `boolean` as 0/1, and an enum as text, since
32
+ * its declaration order is not part of the schema.
46
33
  */
47
34
  export function contentSortEntry(kind, value) {
48
35
  switch (kind) {
@@ -58,12 +45,35 @@ export function contentSortEntry(kind, value) {
58
45
  const ms = Date.parse(ZONELESS_DATE_TIME_RE.test(value) ? `${value}Z` : value);
59
46
  return Number.isNaN(ms) ? null : { kind: 'num', num: ms };
60
47
  }
61
- default:
48
+ case 'string':
49
+ case 'text':
50
+ case 'record-ref':
51
+ case 'file-ref':
52
+ case 'enum':
62
53
  return typeof value === 'string'
63
54
  ? { kind: 'text', text: value, key: contentSortKey(value) }
64
55
  : null;
65
56
  }
66
57
  }
58
+ /**
59
+ * A constant a `contentFieldByType` key orders by, reduced from a value of
60
+ * `kind` to what it orders as: a number, text, or null for no value. The
61
+ * reduction happens before the query is sent, so an adapter orders it
62
+ * without knowing the kind. See docs/spec/data-model.md § Sorting by a
63
+ * content field.
64
+ */
65
+ export function sortConstant(kind, value) {
66
+ const entry = contentSortEntry(kind, value);
67
+ return entry === null ? null : entry.kind === 'num' ? entry.num : entry.text;
68
+ }
69
+ /** The entry a reduced constant orders as; see sortConstant(). */
70
+ export function constantSortEntry(value) {
71
+ if (typeof value === 'number')
72
+ return Number.isFinite(value) ? { kind: 'num', num: value } : null;
73
+ if (typeof value === 'string')
74
+ return { kind: 'text', text: value, key: contentSortKey(value) };
75
+ return null;
76
+ }
67
77
  /**
68
78
  * Order two strings by code point. JS `<` compares UTF-16 code units,
69
79
  * which files every supplementary character (U+10000 and above, stored as
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.js","sourceRoot":"","sources":["../../src/adapter/sort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE,CACtD,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,+CAA+C,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAqB,EAAE,KAAc;IACpE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;gBACxD,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EA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AAE,CAAC,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Association identity and edits
3
+ * -------------------------------------------------------
4
+ * When two associations are the same one, what a list of edits leaves
5
+ * behind, and what it moved. Identity is asked by every layer that touches
6
+ * an association — the no-op decision, the journal's delta, an adapter
7
+ * applying edits, the feed — so they answer it with one comparison and
8
+ * can never disagree. See docs/spec/data-model.md § Associations.
9
+ */
10
+ import type { Association, AssociationChange, AssociationEdit, AuthorityAssociation, DataAssociation, Grantee, RelationshipTarget } from '../types/index.js';
11
+ /**
12
+ * Association identity — what a remove edit matches and a repeat add
13
+ * collides with; the SQLite adapter's primary key. An attachment's
14
+ * `attachmentRecordId` annotates a reference rather than naming one, so it
15
+ * is outside; a group grantee's `role` names a different set of people, so
16
+ * it is inside. See docs/spec/data-model.md § Associations.
17
+ */
18
+ export declare function associationKey(a: Association): string | undefined;
19
+ /** Whether two associations are the same one — see associationKey(). */
20
+ export declare function associationEqual(a: Association, b: Association): boolean;
21
+ export declare function granteeEqual(a: Grantee, b: Grantee): boolean;
22
+ /** Structural equality per target arm — what a remove edit matches on. */
23
+ export declare function targetEqual(a: RelationshipTarget, b: RelationshipTarget): boolean;
24
+ /**
25
+ * Identity plus every annotation outside it, so a write that only re-points
26
+ * an attachment association's `attachmentRecordId` still counts as a
27
+ * change. Identity alone decides which stored association a write lands on;
28
+ * this decides whether it says anything new.
29
+ */
30
+ export declare function associationIdentical(a: Association, b: Association): boolean;
31
+ /**
32
+ * Whether an association carries authority rather than data — the partition
33
+ * `StackRecord.permissions` and `StackRecord.associations` project, and the
34
+ * line the association verbs refuse to cross.
35
+ * See docs/spec/access-control.md § Record-level permissions.
36
+ */
37
+ export declare function isAuthorityAssociation(a: Association): a is AuthorityAssociation;
38
+ /**
39
+ * What replacing a record's set with `after` moves, one tagged edit each.
40
+ * An entry matching an existing identity displaced it: a `repoint`,
41
+ * carrying the prior association in full as `previous` — the only place
42
+ * an overwritten `attachmentRecordId` survives.
43
+ * See docs/spec/journal.md § The entry.
44
+ */
45
+ export declare function associationDelta(before: readonly Association[], after: readonly Association[]): AssociationChange[];
46
+ /**
47
+ * Whether two sets hold the same elements, annotations included, in any
48
+ * order — what an element-set write's `expectSet` is compared by.
49
+ */
50
+ export declare function sameAssociationSet(a: readonly Association[], b: readonly Association[]): boolean;
51
+ /**
52
+ * The two flat lists a change frame carries, derived from the tagged list.
53
+ * The feed reports what is true now, so a `repoint` appears only under its
54
+ * new value and a `remove` by identity alone — the prior state the journal
55
+ * keeps has no place on a notification. The data half alone: `reshare` is
56
+ * what announces an ACL move. See docs/spec/events.md § The event shape.
57
+ */
58
+ export declare function feedAssociationDelta(changes: AssociationChange[]): {
59
+ added: DataAssociation[];
60
+ removed: DataAssociation[];
61
+ };
62
+ /** The elements an edit list adds. */
63
+ export declare function addsOf(edits: readonly AssociationEdit[]): Association[];
64
+ /**
65
+ * The set a list of edits leaves behind, an add landing on an identity
66
+ * already held in place. See docs/spec/adapters.md § Editing associations.
67
+ */
68
+ export declare function applyAssociationEdits(current: Association[], changes: readonly AssociationEdit[]): Association[];
69
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/associations/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,OAAO,EACP,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAajE;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAGxE;AAYD,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAG5D;AAUD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAGjF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAM5E;AAoBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,oBAAoB,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,KAAK,EAAE,SAAS,WAAW,EAAE,GAC5B,iBAAiB,EAAE,CAcrB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,SAAS,WAAW,EAAE,EAAE,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAEhG;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG;IAClE,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAYA;AAED,sCAAsC;AACtC,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,WAAW,EAAE,CAEvE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,WAAW,EAAE,CAWf"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Association identity and edits
3
+ * -------------------------------------------------------
4
+ * When two associations are the same one, what a list of edits leaves
5
+ * behind, and what it moved. Identity is asked by every layer that touches
6
+ * an association — the no-op decision, the journal's delta, an adapter
7
+ * applying edits, the feed — so they answer it with one comparison and
8
+ * can never disagree. See docs/spec/data-model.md § Associations.
9
+ */
10
+ /**
11
+ * Association identity — what a remove edit matches and a repeat add
12
+ * collides with; the SQLite adapter's primary key. An attachment's
13
+ * `attachmentRecordId` annotates a reference rather than naming one, so it
14
+ * is outside; a group grantee's `role` names a different set of people, so
15
+ * it is inside. See docs/spec/data-model.md § Associations.
16
+ */
17
+ export function associationKey(a) {
18
+ // No key, so never "the same one": naming a malformed association is
19
+ // validateAssociation()'s job, which this must reach without throwing.
20
+ if (!a)
21
+ return undefined;
22
+ const arm = a.kind === 'attachment'
23
+ ? [a.fileId]
24
+ : a.kind === 'relationship'
25
+ ? targetParts(a.target)
26
+ : a.kind === 'permission'
27
+ ? granteeParts(a.grantee)
28
+ : [];
29
+ return arm && JSON.stringify([a.kind, a.label, ...arm]);
30
+ }
31
+ /** Whether two associations are the same one — see associationKey(). */
32
+ export function associationEqual(a, b) {
33
+ const key = associationKey(a);
34
+ return key !== undefined && key === associationKey(b);
35
+ }
36
+ /**
37
+ * A grantee's identity, per arm. `role` is required, so there is no
38
+ * absent-means-any spelling to normalize.
39
+ */
40
+ function granteeParts(g) {
41
+ if (g?.kind === 'entity')
42
+ return [g.kind, g.entityId];
43
+ if (g?.kind === 'group')
44
+ return [g.kind, g.groupId, g.role];
45
+ return undefined;
46
+ }
47
+ export function granteeEqual(a, b) {
48
+ const parts = granteeParts(a);
49
+ return parts !== undefined && JSON.stringify(parts) === JSON.stringify(granteeParts(b));
50
+ }
51
+ /** A target's identity, per arm — an absent `stackUrl` is this stack, as an empty one is. */
52
+ function targetParts(t) {
53
+ if (t?.kind === 'record')
54
+ return [t.kind, t.recordId, t.stackUrl ?? ''];
55
+ if (t?.kind === 'entity')
56
+ return [t.kind, t.entityId];
57
+ if (t?.kind === 'external')
58
+ return [t.kind, t.ns, t.id];
59
+ return undefined;
60
+ }
61
+ /** Structural equality per target arm — what a remove edit matches on. */
62
+ export function targetEqual(a, b) {
63
+ const parts = targetParts(a);
64
+ return parts !== undefined && JSON.stringify(parts) === JSON.stringify(targetParts(b));
65
+ }
66
+ /**
67
+ * Identity plus every annotation outside it, so a write that only re-points
68
+ * an attachment association's `attachmentRecordId` still counts as a
69
+ * change. Identity alone decides which stored association a write lands on;
70
+ * this decides whether it says anything new.
71
+ */
72
+ export function associationIdentical(a, b) {
73
+ if (!associationEqual(a, b))
74
+ return false;
75
+ if (a.kind === 'attachment' && b.kind === 'attachment') {
76
+ return (a.attachmentRecordId ?? '') === (b.attachmentRecordId ?? '');
77
+ }
78
+ return true;
79
+ }
80
+ /**
81
+ * An association's identity alone, its annotation dropped — what a change
82
+ * event reports for an association that's gone, as a `purged` frame names
83
+ * a destroyed record without repeating its content.
84
+ * See docs/spec/events.md § The event shape.
85
+ */
86
+ function stripAssociationAnnotation(association) {
87
+ if (association.kind !== 'attachment')
88
+ return association;
89
+ const { attachmentRecordId: _attachmentRecordId, ...identity } = association;
90
+ return identity;
91
+ }
92
+ /** The association kinds that carry authority. Every other kind is data. */
93
+ const AUTHORITY_ASSOCIATION_KINDS = [
94
+ 'permission',
95
+ 'anyone',
96
+ ];
97
+ /**
98
+ * Whether an association carries authority rather than data — the partition
99
+ * `StackRecord.permissions` and `StackRecord.associations` project, and the
100
+ * line the association verbs refuse to cross.
101
+ * See docs/spec/access-control.md § Record-level permissions.
102
+ */
103
+ export function isAuthorityAssociation(a) {
104
+ return AUTHORITY_ASSOCIATION_KINDS.includes(a.kind);
105
+ }
106
+ /**
107
+ * What replacing a record's set with `after` moves, one tagged edit each.
108
+ * An entry matching an existing identity displaced it: a `repoint`,
109
+ * carrying the prior association in full as `previous` — the only place
110
+ * an overwritten `attachmentRecordId` survives.
111
+ * See docs/spec/journal.md § The entry.
112
+ */
113
+ export function associationDelta(before, after) {
114
+ const changes = after
115
+ .filter((a) => !before.some((b) => associationIdentical(a, b)))
116
+ .map((association) => {
117
+ const previous = before.find((b) => associationEqual(b, association));
118
+ return previous
119
+ ? { op: 'repoint', association, previous }
120
+ : { op: 'add', association };
121
+ });
122
+ return changes.concat(before
123
+ .filter((b) => !after.some((a) => associationEqual(a, b)))
124
+ .map((association) => ({ op: 'remove', association })));
125
+ }
126
+ /**
127
+ * Whether two sets hold the same elements, annotations included, in any
128
+ * order — what an element-set write's `expectSet` is compared by.
129
+ */
130
+ export function sameAssociationSet(a, b) {
131
+ return associationDelta(a, b).length === 0;
132
+ }
133
+ /**
134
+ * The two flat lists a change frame carries, derived from the tagged list.
135
+ * The feed reports what is true now, so a `repoint` appears only under its
136
+ * new value and a `remove` by identity alone — the prior state the journal
137
+ * keeps has no place on a notification. The data half alone: `reshare` is
138
+ * what announces an ACL move. See docs/spec/events.md § The event shape.
139
+ */
140
+ export function feedAssociationDelta(changes) {
141
+ const added = [];
142
+ const removed = [];
143
+ for (const c of changes) {
144
+ if (c.op === 'remove') {
145
+ const identity = stripAssociationAnnotation(c.association);
146
+ if (!isAuthorityAssociation(identity))
147
+ removed.push(identity);
148
+ }
149
+ else if (!isAuthorityAssociation(c.association)) {
150
+ added.push(c.association);
151
+ }
152
+ }
153
+ return { added, removed };
154
+ }
155
+ /** The elements an edit list adds. */
156
+ export function addsOf(edits) {
157
+ return edits.flatMap((e) => (e.op === 'add' ? [e.association] : []));
158
+ }
159
+ /**
160
+ * The set a list of edits leaves behind, an add landing on an identity
161
+ * already held in place. See docs/spec/adapters.md § Editing associations.
162
+ */
163
+ export function applyAssociationEdits(current, changes) {
164
+ let next = current.filter((a) => !changes.some((c) => c.op === 'remove' && associationEqual(c.association, a)));
165
+ for (const c of changes) {
166
+ if (c.op !== 'add')
167
+ continue;
168
+ next = next.some((a) => associationEqual(a, c.association))
169
+ ? next.map((a) => (associationEqual(a, c.association) ? c.association : a))
170
+ : [...next, c.association];
171
+ }
172
+ return next;
173
+ }
174
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/associations/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,CAAc;IAC3C,qEAAqE;IACrE,uEA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