@chipmobilesdk/rn-local-db 0.3.0 → 0.5.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 (705) hide show
  1. package/CHANGELOG.md +160 -1
  2. package/README.md +99 -19
  3. package/lib/commonjs/adapter/budgets.js +79 -0
  4. package/lib/commonjs/adapter/budgets.js.map +1 -0
  5. package/lib/commonjs/adapter/collection.js +236 -0
  6. package/lib/commonjs/adapter/collection.js.map +1 -0
  7. package/lib/commonjs/adapter/deletion.js +291 -0
  8. package/lib/commonjs/adapter/deletion.js.map +1 -0
  9. package/lib/commonjs/adapter/handle.js +259 -0
  10. package/lib/commonjs/adapter/handle.js.map +1 -0
  11. package/lib/commonjs/adapter/index.js +67 -0
  12. package/lib/commonjs/adapter/index.js.map +1 -0
  13. package/lib/commonjs/adapter/lifecycle.js +176 -0
  14. package/lib/commonjs/adapter/lifecycle.js.map +1 -0
  15. package/lib/commonjs/adapter/schema-sync.js +124 -0
  16. package/lib/commonjs/adapter/schema-sync.js.map +1 -0
  17. package/lib/commonjs/adapter/transaction.js +58 -0
  18. package/lib/commonjs/adapter/transaction.js.map +1 -0
  19. package/lib/commonjs/artifacts/availability.js +90 -0
  20. package/lib/commonjs/artifacts/availability.js.map +1 -0
  21. package/lib/commonjs/artifacts/cascade.js +80 -0
  22. package/lib/commonjs/artifacts/cascade.js.map +1 -0
  23. package/lib/commonjs/artifacts/paths.js +31 -0
  24. package/lib/commonjs/artifacts/paths.js.map +1 -0
  25. package/lib/commonjs/artifacts/reconcile.js +55 -0
  26. package/lib/commonjs/artifacts/reconcile.js.map +1 -0
  27. package/lib/commonjs/artifacts/store.js +300 -0
  28. package/lib/commonjs/artifacts/store.js.map +1 -0
  29. package/lib/commonjs/contract/adapter.js +6 -0
  30. package/lib/commonjs/contract/adapter.js.map +1 -0
  31. package/lib/commonjs/contract/attachment.js +2 -0
  32. package/lib/commonjs/contract/attachment.js.map +1 -0
  33. package/lib/commonjs/contract/backup.js +2 -0
  34. package/lib/commonjs/contract/backup.js.map +1 -0
  35. package/lib/commonjs/contract/config.js +31 -0
  36. package/lib/commonjs/contract/config.js.map +1 -0
  37. package/lib/commonjs/contract/encryption.js +6 -0
  38. package/lib/commonjs/contract/encryption.js.map +1 -0
  39. package/lib/commonjs/contract/errors.js +64 -0
  40. package/lib/commonjs/contract/errors.js.map +1 -0
  41. package/lib/commonjs/contract/migration.js +6 -0
  42. package/lib/commonjs/contract/migration.js.map +1 -0
  43. package/lib/commonjs/contract/query.js +6 -0
  44. package/lib/commonjs/contract/query.js.map +1 -0
  45. package/lib/commonjs/contract/record.js +6 -0
  46. package/lib/commonjs/contract/record.js.map +1 -0
  47. package/lib/commonjs/contract/schema.js +2 -0
  48. package/lib/commonjs/contract/schema.js.map +1 -0
  49. package/lib/commonjs/contract/scope.js +2 -0
  50. package/lib/commonjs/contract/scope.js.map +1 -0
  51. package/lib/commonjs/contract/transaction.js +6 -0
  52. package/lib/commonjs/contract/transaction.js.map +1 -0
  53. package/lib/commonjs/crypto/chunked-cipher.js +147 -0
  54. package/lib/commonjs/crypto/chunked-cipher.js.map +1 -0
  55. package/lib/commonjs/crypto/derive.js +61 -0
  56. package/lib/commonjs/crypto/derive.js.map +1 -0
  57. package/lib/commonjs/crypto/key-provider.js +70 -0
  58. package/lib/commonjs/crypto/key-provider.js.map +1 -0
  59. package/lib/commonjs/crypto/provider.js +54 -0
  60. package/lib/commonjs/crypto/provider.js.map +1 -0
  61. package/lib/commonjs/diagnostics/dev-log.js +127 -0
  62. package/lib/commonjs/diagnostics/dev-log.js.map +1 -0
  63. package/lib/commonjs/diagnostics/errors.js +57 -0
  64. package/lib/commonjs/diagnostics/errors.js.map +1 -0
  65. package/lib/commonjs/diagnostics/faults.js +54 -0
  66. package/lib/commonjs/diagnostics/faults.js.map +1 -0
  67. package/lib/commonjs/diagnostics/map-native.js +98 -0
  68. package/lib/commonjs/diagnostics/map-native.js.map +1 -0
  69. package/lib/commonjs/diagnostics/redact.js +110 -0
  70. package/lib/commonjs/diagnostics/redact.js.map +1 -0
  71. package/lib/commonjs/index.js +70 -0
  72. package/lib/commonjs/index.js.map +1 -0
  73. package/lib/commonjs/migration/executor.js +136 -0
  74. package/lib/commonjs/migration/executor.js.map +1 -0
  75. package/lib/commonjs/migration/ledger.js +64 -0
  76. package/lib/commonjs/migration/ledger.js.map +1 -0
  77. package/lib/commonjs/migration/validate-chain.js +76 -0
  78. package/lib/commonjs/migration/validate-chain.js.map +1 -0
  79. package/lib/commonjs/package.json +1 -0
  80. package/lib/commonjs/platform/backup-android-verify.js +76 -0
  81. package/lib/commonjs/platform/backup-android-verify.js.map +1 -0
  82. package/lib/commonjs/platform/backup-ios.js +50 -0
  83. package/lib/commonjs/platform/backup-ios.js.map +1 -0
  84. package/lib/commonjs/platform/bytes.js +158 -0
  85. package/lib/commonjs/platform/bytes.js.map +1 -0
  86. package/lib/commonjs/platform/fs.js +59 -0
  87. package/lib/commonjs/platform/fs.js.map +1 -0
  88. package/lib/commonjs/platform/location.js +129 -0
  89. package/lib/commonjs/platform/location.js.map +1 -0
  90. package/lib/commonjs/query/budgets.js +95 -0
  91. package/lib/commonjs/query/budgets.js.map +1 -0
  92. package/lib/commonjs/query/compare.js +97 -0
  93. package/lib/commonjs/query/compare.js.map +1 -0
  94. package/lib/commonjs/query/cursor.js +97 -0
  95. package/lib/commonjs/query/cursor.js.map +1 -0
  96. package/lib/commonjs/query/filter.js +82 -0
  97. package/lib/commonjs/query/filter.js.map +1 -0
  98. package/lib/commonjs/query/paginate.js +48 -0
  99. package/lib/commonjs/query/paginate.js.map +1 -0
  100. package/lib/commonjs/query/sort.js +61 -0
  101. package/lib/commonjs/query/sort.js.map +1 -0
  102. package/lib/commonjs/query/validate.js +180 -0
  103. package/lib/commonjs/query/validate.js.map +1 -0
  104. package/lib/commonjs/schema/declare.js +47 -0
  105. package/lib/commonjs/schema/declare.js.map +1 -0
  106. package/lib/commonjs/schema/validate-config.js +115 -0
  107. package/lib/commonjs/schema/validate-config.js.map +1 -0
  108. package/lib/commonjs/scope/hash.js +107 -0
  109. package/lib/commonjs/scope/hash.js.map +1 -0
  110. package/lib/commonjs/scope/normalize.js +73 -0
  111. package/lib/commonjs/scope/normalize.js.map +1 -0
  112. package/lib/commonjs/scope/validate.js +81 -0
  113. package/lib/commonjs/scope/validate.js.map +1 -0
  114. package/lib/commonjs/sqlite/adapter.js +31 -0
  115. package/lib/commonjs/sqlite/adapter.js.map +1 -0
  116. package/lib/commonjs/sqlite/batch.js +218 -0
  117. package/lib/commonjs/sqlite/batch.js.map +1 -0
  118. package/lib/commonjs/sqlite/catalog.js +81 -0
  119. package/lib/commonjs/sqlite/catalog.js.map +1 -0
  120. package/lib/commonjs/sqlite/connection.js +210 -0
  121. package/lib/commonjs/sqlite/connection.js.map +1 -0
  122. package/lib/commonjs/sqlite/index-coverage.js +42 -0
  123. package/lib/commonjs/sqlite/index-coverage.js.map +1 -0
  124. package/lib/commonjs/sqlite/native.js +54 -0
  125. package/lib/commonjs/sqlite/native.js.map +1 -0
  126. package/lib/commonjs/sqlite/row-codec.js +192 -0
  127. package/lib/commonjs/sqlite/row-codec.js.map +1 -0
  128. package/lib/commonjs/sqlite/sql-builder.js +253 -0
  129. package/lib/commonjs/sqlite/sql-builder.js.map +1 -0
  130. package/lib/commonjs/sqlite/statements.js +54 -0
  131. package/lib/commonjs/sqlite/statements.js.map +1 -0
  132. package/lib/commonjs/sqlite/transaction-queue.js +79 -0
  133. package/lib/commonjs/sqlite/transaction-queue.js.map +1 -0
  134. package/lib/commonjs/sqlite/transactions.js +33 -0
  135. package/lib/commonjs/sqlite/transactions.js.map +1 -0
  136. package/lib/commonjs/sqlite/values.js +31 -0
  137. package/lib/commonjs/sqlite/values.js.map +1 -0
  138. package/lib/commonjs/testing/conformance/attachments.js +180 -0
  139. package/lib/commonjs/testing/conformance/attachments.js.map +1 -0
  140. package/lib/commonjs/testing/conformance/encryption.js +187 -0
  141. package/lib/commonjs/testing/conformance/encryption.js.map +1 -0
  142. package/lib/commonjs/testing/conformance/index.js +103 -0
  143. package/lib/commonjs/testing/conformance/index.js.map +1 -0
  144. package/lib/commonjs/testing/conformance/lifecycle.js +134 -0
  145. package/lib/commonjs/testing/conformance/lifecycle.js.map +1 -0
  146. package/lib/commonjs/testing/conformance/migrations.js +167 -0
  147. package/lib/commonjs/testing/conformance/migrations.js.map +1 -0
  148. package/lib/commonjs/testing/conformance/queries.js +278 -0
  149. package/lib/commonjs/testing/conformance/queries.js.map +1 -0
  150. package/lib/commonjs/testing/conformance/records.js +224 -0
  151. package/lib/commonjs/testing/conformance/records.js.map +1 -0
  152. package/lib/commonjs/testing/conformance/scopes.js +107 -0
  153. package/lib/commonjs/testing/conformance/scopes.js.map +1 -0
  154. package/lib/commonjs/testing/conformance/transactions.js +228 -0
  155. package/lib/commonjs/testing/conformance/transactions.js.map +1 -0
  156. package/lib/commonjs/testing/faults.js +38 -0
  157. package/lib/commonjs/testing/faults.js.map +1 -0
  158. package/lib/commonjs/testing/index.js +59 -0
  159. package/lib/commonjs/testing/index.js.map +1 -0
  160. package/lib/commonjs/testing/memory-adapter/attachments.js +145 -0
  161. package/lib/commonjs/testing/memory-adapter/attachments.js.map +1 -0
  162. package/lib/commonjs/testing/memory-adapter/collection.js +224 -0
  163. package/lib/commonjs/testing/memory-adapter/collection.js.map +1 -0
  164. package/lib/commonjs/testing/memory-adapter/index.js +366 -0
  165. package/lib/commonjs/testing/memory-adapter/index.js.map +1 -0
  166. package/lib/commonjs/testing/memory-adapter/migrations.js +126 -0
  167. package/lib/commonjs/testing/memory-adapter/migrations.js.map +1 -0
  168. package/lib/commonjs/testing/memory-adapter/reset.js +49 -0
  169. package/lib/commonjs/testing/memory-adapter/reset.js.map +1 -0
  170. package/lib/commonjs/testing/memory-adapter/store.js +107 -0
  171. package/lib/commonjs/testing/memory-adapter/store.js.map +1 -0
  172. package/lib/module/adapter/budgets.js +51 -0
  173. package/lib/module/adapter/budgets.js.map +1 -0
  174. package/lib/module/adapter/collection.js +232 -0
  175. package/lib/module/adapter/collection.js.map +1 -0
  176. package/lib/module/adapter/deletion.js +280 -0
  177. package/lib/module/adapter/deletion.js.map +1 -0
  178. package/lib/module/adapter/handle.js +254 -0
  179. package/lib/module/adapter/handle.js.map +1 -0
  180. package/lib/module/adapter/index.js +59 -0
  181. package/lib/module/adapter/index.js.map +1 -0
  182. package/lib/module/adapter/lifecycle.js +172 -0
  183. package/lib/module/adapter/lifecycle.js.map +1 -0
  184. package/lib/module/adapter/schema-sync.js +121 -0
  185. package/lib/module/adapter/schema-sync.js.map +1 -0
  186. package/lib/module/adapter/transaction.js +54 -0
  187. package/lib/module/adapter/transaction.js.map +1 -0
  188. package/lib/module/artifacts/availability.js +86 -0
  189. package/lib/module/artifacts/availability.js.map +1 -0
  190. package/lib/module/artifacts/cascade.js +75 -0
  191. package/lib/module/artifacts/cascade.js.map +1 -0
  192. package/lib/module/artifacts/paths.js +26 -0
  193. package/lib/module/artifacts/paths.js.map +1 -0
  194. package/lib/module/artifacts/reconcile.js +51 -0
  195. package/lib/module/artifacts/reconcile.js.map +1 -0
  196. package/lib/module/artifacts/store.js +289 -0
  197. package/lib/module/artifacts/store.js.map +1 -0
  198. package/lib/module/contract/adapter.js +4 -0
  199. package/lib/module/contract/adapter.js.map +1 -0
  200. package/lib/module/contract/attachment.js +2 -0
  201. package/lib/module/contract/attachment.js.map +1 -0
  202. package/lib/module/contract/backup.js +2 -0
  203. package/lib/module/contract/backup.js.map +1 -0
  204. package/lib/module/contract/config.js +27 -0
  205. package/lib/module/contract/config.js.map +1 -0
  206. package/lib/module/contract/encryption.js +4 -0
  207. package/lib/module/contract/encryption.js.map +1 -0
  208. package/lib/module/contract/errors.js +60 -0
  209. package/lib/module/contract/errors.js.map +1 -0
  210. package/lib/module/contract/migration.js +4 -0
  211. package/lib/module/contract/migration.js.map +1 -0
  212. package/lib/module/contract/query.js +4 -0
  213. package/lib/module/contract/query.js.map +1 -0
  214. package/lib/module/contract/record.js +4 -0
  215. package/lib/module/contract/record.js.map +1 -0
  216. package/lib/module/contract/schema.js +2 -0
  217. package/lib/module/contract/schema.js.map +1 -0
  218. package/lib/module/contract/scope.js +2 -0
  219. package/lib/module/contract/scope.js.map +1 -0
  220. package/lib/module/contract/transaction.js +4 -0
  221. package/lib/module/contract/transaction.js.map +1 -0
  222. package/lib/module/crypto/chunked-cipher.js +134 -0
  223. package/lib/module/crypto/chunked-cipher.js.map +1 -0
  224. package/lib/module/crypto/derive.js +56 -0
  225. package/lib/module/crypto/derive.js.map +1 -0
  226. package/lib/module/crypto/key-provider.js +67 -0
  227. package/lib/module/crypto/key-provider.js.map +1 -0
  228. package/lib/module/crypto/provider.js +49 -0
  229. package/lib/module/crypto/provider.js.map +1 -0
  230. package/lib/module/diagnostics/dev-log.js +120 -0
  231. package/lib/module/diagnostics/dev-log.js.map +1 -0
  232. package/lib/module/diagnostics/errors.js +44 -0
  233. package/lib/module/diagnostics/errors.js.map +1 -0
  234. package/lib/module/diagnostics/faults.js +47 -0
  235. package/lib/module/diagnostics/faults.js.map +1 -0
  236. package/lib/module/diagnostics/map-native.js +93 -0
  237. package/lib/module/diagnostics/map-native.js.map +1 -0
  238. package/lib/module/diagnostics/redact.js +102 -0
  239. package/lib/module/diagnostics/redact.js.map +1 -0
  240. package/lib/module/index.js +28 -0
  241. package/lib/module/index.js.map +1 -0
  242. package/lib/module/migration/executor.js +132 -0
  243. package/lib/module/migration/executor.js.map +1 -0
  244. package/lib/module/migration/ledger.js +57 -0
  245. package/lib/module/migration/ledger.js.map +1 -0
  246. package/lib/module/migration/validate-chain.js +70 -0
  247. package/lib/module/migration/validate-chain.js.map +1 -0
  248. package/lib/module/package.json +1 -0
  249. package/lib/module/platform/backup-android-verify.js +69 -0
  250. package/lib/module/platform/backup-android-verify.js.map +1 -0
  251. package/lib/module/platform/backup-ios.js +44 -0
  252. package/lib/module/platform/backup-ios.js.map +1 -0
  253. package/lib/module/platform/bytes.js +148 -0
  254. package/lib/module/platform/bytes.js.map +1 -0
  255. package/lib/module/platform/fs.js +54 -0
  256. package/lib/module/platform/fs.js.map +1 -0
  257. package/lib/module/platform/location.js +120 -0
  258. package/lib/module/platform/location.js.map +1 -0
  259. package/lib/module/query/budgets.js +88 -0
  260. package/lib/module/query/budgets.js.map +1 -0
  261. package/lib/module/query/compare.js +90 -0
  262. package/lib/module/query/compare.js.map +1 -0
  263. package/lib/module/query/cursor.js +91 -0
  264. package/lib/module/query/cursor.js.map +1 -0
  265. package/lib/module/query/filter.js +78 -0
  266. package/lib/module/query/filter.js.map +1 -0
  267. package/lib/module/query/paginate.js +40 -0
  268. package/lib/module/query/paginate.js.map +1 -0
  269. package/lib/module/query/sort.js +53 -0
  270. package/lib/module/query/sort.js.map +1 -0
  271. package/lib/module/query/validate.js +173 -0
  272. package/lib/module/query/validate.js.map +1 -0
  273. package/lib/module/schema/declare.js +37 -0
  274. package/lib/module/schema/declare.js.map +1 -0
  275. package/lib/module/schema/validate-config.js +111 -0
  276. package/lib/module/schema/validate-config.js.map +1 -0
  277. package/lib/module/scope/hash.js +102 -0
  278. package/lib/module/scope/hash.js.map +1 -0
  279. package/lib/module/scope/normalize.js +67 -0
  280. package/lib/module/scope/normalize.js.map +1 -0
  281. package/lib/module/scope/validate.js +76 -0
  282. package/lib/module/scope/validate.js.map +1 -0
  283. package/lib/module/sqlite/adapter.js +27 -0
  284. package/lib/module/sqlite/adapter.js.map +1 -0
  285. package/lib/module/sqlite/batch.js +214 -0
  286. package/lib/module/sqlite/batch.js.map +1 -0
  287. package/lib/module/sqlite/catalog.js +72 -0
  288. package/lib/module/sqlite/catalog.js.map +1 -0
  289. package/lib/module/sqlite/connection.js +206 -0
  290. package/lib/module/sqlite/connection.js.map +1 -0
  291. package/lib/module/sqlite/index-coverage.js +38 -0
  292. package/lib/module/sqlite/index-coverage.js.map +1 -0
  293. package/lib/module/sqlite/native.js +48 -0
  294. package/lib/module/sqlite/native.js.map +1 -0
  295. package/lib/module/sqlite/row-codec.js +176 -0
  296. package/lib/module/sqlite/row-codec.js.map +1 -0
  297. package/lib/module/sqlite/sql-builder.js +247 -0
  298. package/lib/module/sqlite/sql-builder.js.map +1 -0
  299. package/lib/module/sqlite/statements.js +49 -0
  300. package/lib/module/sqlite/statements.js.map +1 -0
  301. package/lib/module/sqlite/transaction-queue.js +75 -0
  302. package/lib/module/sqlite/transaction-queue.js.map +1 -0
  303. package/lib/module/sqlite/transactions.js +29 -0
  304. package/lib/module/sqlite/transactions.js.map +1 -0
  305. package/lib/module/sqlite/values.js +24 -0
  306. package/lib/module/sqlite/values.js.map +1 -0
  307. package/lib/module/testing/conformance/attachments.js +176 -0
  308. package/lib/module/testing/conformance/attachments.js.map +1 -0
  309. package/lib/module/testing/conformance/encryption.js +183 -0
  310. package/lib/module/testing/conformance/encryption.js.map +1 -0
  311. package/lib/module/testing/conformance/index.js +97 -0
  312. package/lib/module/testing/conformance/index.js.map +1 -0
  313. package/lib/module/testing/conformance/lifecycle.js +130 -0
  314. package/lib/module/testing/conformance/lifecycle.js.map +1 -0
  315. package/lib/module/testing/conformance/migrations.js +163 -0
  316. package/lib/module/testing/conformance/migrations.js.map +1 -0
  317. package/lib/module/testing/conformance/queries.js +274 -0
  318. package/lib/module/testing/conformance/queries.js.map +1 -0
  319. package/lib/module/testing/conformance/records.js +220 -0
  320. package/lib/module/testing/conformance/records.js.map +1 -0
  321. package/lib/module/testing/conformance/scopes.js +103 -0
  322. package/lib/module/testing/conformance/scopes.js.map +1 -0
  323. package/lib/module/testing/conformance/transactions.js +224 -0
  324. package/lib/module/testing/conformance/transactions.js.map +1 -0
  325. package/lib/module/testing/faults.js +16 -0
  326. package/lib/module/testing/faults.js.map +1 -0
  327. package/lib/module/testing/index.js +16 -0
  328. package/lib/module/testing/index.js.map +1 -0
  329. package/lib/module/testing/memory-adapter/attachments.js +142 -0
  330. package/lib/module/testing/memory-adapter/attachments.js.map +1 -0
  331. package/lib/module/testing/memory-adapter/collection.js +220 -0
  332. package/lib/module/testing/memory-adapter/collection.js.map +1 -0
  333. package/lib/module/testing/memory-adapter/index.js +351 -0
  334. package/lib/module/testing/memory-adapter/index.js.map +1 -0
  335. package/lib/module/testing/memory-adapter/migrations.js +122 -0
  336. package/lib/module/testing/memory-adapter/migrations.js.map +1 -0
  337. package/lib/module/testing/memory-adapter/reset.js +44 -0
  338. package/lib/module/testing/memory-adapter/reset.js.map +1 -0
  339. package/lib/module/testing/memory-adapter/store.js +94 -0
  340. package/lib/module/testing/memory-adapter/store.js.map +1 -0
  341. package/lib/typescript/commonjs/adapter/budgets.d.ts +19 -0
  342. package/lib/typescript/commonjs/adapter/budgets.d.ts.map +1 -0
  343. package/lib/typescript/commonjs/adapter/collection.d.ts +25 -0
  344. package/lib/typescript/commonjs/adapter/collection.d.ts.map +1 -0
  345. package/lib/typescript/commonjs/adapter/deletion.d.ts +48 -0
  346. package/lib/typescript/commonjs/adapter/deletion.d.ts.map +1 -0
  347. package/lib/typescript/commonjs/adapter/handle.d.ts +30 -0
  348. package/lib/typescript/commonjs/adapter/handle.d.ts.map +1 -0
  349. package/lib/typescript/commonjs/adapter/index.d.ts +30 -0
  350. package/lib/typescript/commonjs/adapter/index.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/adapter/lifecycle.d.ts +25 -0
  352. package/lib/typescript/commonjs/adapter/lifecycle.d.ts.map +1 -0
  353. package/lib/typescript/commonjs/adapter/schema-sync.d.ts +19 -0
  354. package/lib/typescript/commonjs/adapter/schema-sync.d.ts.map +1 -0
  355. package/lib/typescript/commonjs/adapter/transaction.d.ts +32 -0
  356. package/lib/typescript/commonjs/adapter/transaction.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/artifacts/availability.d.ts +19 -0
  358. package/lib/typescript/commonjs/artifacts/availability.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/artifacts/cascade.d.ts +26 -0
  360. package/lib/typescript/commonjs/artifacts/cascade.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/artifacts/paths.d.ts +16 -0
  362. package/lib/typescript/commonjs/artifacts/paths.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/artifacts/reconcile.d.ts +23 -0
  364. package/lib/typescript/commonjs/artifacts/reconcile.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/artifacts/store.d.ts +45 -0
  366. package/lib/typescript/commonjs/artifacts/store.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/contract/adapter.d.ts +55 -0
  368. package/lib/typescript/commonjs/contract/adapter.d.ts.map +1 -0
  369. package/lib/typescript/commonjs/contract/attachment.d.ts +84 -0
  370. package/lib/typescript/commonjs/contract/attachment.d.ts.map +1 -0
  371. package/lib/typescript/commonjs/contract/backup.d.ts +26 -0
  372. package/lib/typescript/commonjs/contract/backup.d.ts.map +1 -0
  373. package/lib/typescript/commonjs/contract/config.d.ts +50 -0
  374. package/lib/typescript/commonjs/contract/config.d.ts.map +1 -0
  375. package/lib/typescript/commonjs/contract/encryption.d.ts +31 -0
  376. package/lib/typescript/commonjs/contract/encryption.d.ts.map +1 -0
  377. package/lib/typescript/commonjs/contract/errors.d.ts +50 -0
  378. package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
  379. package/lib/typescript/commonjs/contract/migration.d.ts +37 -0
  380. package/lib/typescript/commonjs/contract/migration.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/contract/query.d.ts +79 -0
  382. package/lib/typescript/commonjs/contract/query.d.ts.map +1 -0
  383. package/lib/typescript/commonjs/contract/record.d.ts +43 -0
  384. package/lib/typescript/commonjs/contract/record.d.ts.map +1 -0
  385. package/lib/typescript/commonjs/contract/schema.d.ts +33 -0
  386. package/lib/typescript/commonjs/contract/schema.d.ts.map +1 -0
  387. package/lib/typescript/commonjs/contract/scope.d.ts +33 -0
  388. package/lib/typescript/commonjs/contract/scope.d.ts.map +1 -0
  389. package/lib/typescript/commonjs/contract/transaction.d.ts +66 -0
  390. package/lib/typescript/commonjs/contract/transaction.d.ts.map +1 -0
  391. package/lib/typescript/commonjs/crypto/chunked-cipher.d.ts +57 -0
  392. package/lib/typescript/commonjs/crypto/chunked-cipher.d.ts.map +1 -0
  393. package/lib/typescript/commonjs/crypto/derive.d.ts +28 -0
  394. package/lib/typescript/commonjs/crypto/derive.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/crypto/key-provider.d.ts +30 -0
  396. package/lib/typescript/commonjs/crypto/key-provider.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/crypto/provider.d.ts +35 -0
  398. package/lib/typescript/commonjs/crypto/provider.d.ts.map +1 -0
  399. package/lib/typescript/commonjs/diagnostics/dev-log.d.ts +35 -0
  400. package/lib/typescript/commonjs/diagnostics/dev-log.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/diagnostics/errors.d.ts +34 -0
  402. package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/diagnostics/faults.d.ts +26 -0
  404. package/lib/typescript/commonjs/diagnostics/faults.d.ts.map +1 -0
  405. package/lib/typescript/commonjs/diagnostics/map-native.d.ts +31 -0
  406. package/lib/typescript/commonjs/diagnostics/map-native.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/diagnostics/redact.d.ts +70 -0
  408. package/lib/typescript/commonjs/diagnostics/redact.d.ts.map +1 -0
  409. package/lib/typescript/commonjs/index.d.ts +30 -0
  410. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  411. package/lib/typescript/commonjs/migration/executor.d.ts +40 -0
  412. package/lib/typescript/commonjs/migration/executor.d.ts.map +1 -0
  413. package/lib/typescript/commonjs/migration/ledger.d.ts +34 -0
  414. package/lib/typescript/commonjs/migration/ledger.d.ts.map +1 -0
  415. package/lib/typescript/commonjs/migration/validate-chain.d.ts +20 -0
  416. package/lib/typescript/commonjs/migration/validate-chain.d.ts.map +1 -0
  417. package/lib/typescript/commonjs/package.json +1 -0
  418. package/lib/typescript/commonjs/platform/backup-android-verify.d.ts +30 -0
  419. package/lib/typescript/commonjs/platform/backup-android-verify.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/platform/backup-ios.d.ts +26 -0
  421. package/lib/typescript/commonjs/platform/backup-ios.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/platform/bytes.d.ts +36 -0
  423. package/lib/typescript/commonjs/platform/bytes.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/platform/fs.d.ts +47 -0
  425. package/lib/typescript/commonjs/platform/fs.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/platform/location.d.ts +53 -0
  427. package/lib/typescript/commonjs/platform/location.d.ts.map +1 -0
  428. package/lib/typescript/commonjs/query/budgets.d.ts +23 -0
  429. package/lib/typescript/commonjs/query/budgets.d.ts.map +1 -0
  430. package/lib/typescript/commonjs/query/compare.d.ts +42 -0
  431. package/lib/typescript/commonjs/query/compare.d.ts.map +1 -0
  432. package/lib/typescript/commonjs/query/cursor.d.ts +27 -0
  433. package/lib/typescript/commonjs/query/cursor.d.ts.map +1 -0
  434. package/lib/typescript/commonjs/query/filter.d.ts +11 -0
  435. package/lib/typescript/commonjs/query/filter.d.ts.map +1 -0
  436. package/lib/typescript/commonjs/query/paginate.d.ts +15 -0
  437. package/lib/typescript/commonjs/query/paginate.d.ts.map +1 -0
  438. package/lib/typescript/commonjs/query/sort.d.ts +19 -0
  439. package/lib/typescript/commonjs/query/sort.d.ts.map +1 -0
  440. package/lib/typescript/commonjs/query/validate.d.ts +15 -0
  441. package/lib/typescript/commonjs/query/validate.d.ts.map +1 -0
  442. package/lib/typescript/commonjs/schema/declare.d.ts +20 -0
  443. package/lib/typescript/commonjs/schema/declare.d.ts.map +1 -0
  444. package/lib/typescript/commonjs/schema/validate-config.d.ts +11 -0
  445. package/lib/typescript/commonjs/schema/validate-config.d.ts.map +1 -0
  446. package/lib/typescript/commonjs/scope/hash.d.ts +24 -0
  447. package/lib/typescript/commonjs/scope/hash.d.ts.map +1 -0
  448. package/lib/typescript/commonjs/scope/normalize.d.ts +46 -0
  449. package/lib/typescript/commonjs/scope/normalize.d.ts.map +1 -0
  450. package/lib/typescript/commonjs/scope/validate.d.ts +15 -0
  451. package/lib/typescript/commonjs/scope/validate.d.ts.map +1 -0
  452. package/lib/typescript/commonjs/sqlite/adapter.d.ts +16 -0
  453. package/lib/typescript/commonjs/sqlite/adapter.d.ts.map +1 -0
  454. package/lib/typescript/commonjs/sqlite/batch.d.ts +25 -0
  455. package/lib/typescript/commonjs/sqlite/batch.d.ts.map +1 -0
  456. package/lib/typescript/commonjs/sqlite/catalog.d.ts +34 -0
  457. package/lib/typescript/commonjs/sqlite/catalog.d.ts.map +1 -0
  458. package/lib/typescript/commonjs/sqlite/connection.d.ts +58 -0
  459. package/lib/typescript/commonjs/sqlite/connection.d.ts.map +1 -0
  460. package/lib/typescript/commonjs/sqlite/index-coverage.d.ts +18 -0
  461. package/lib/typescript/commonjs/sqlite/index-coverage.d.ts.map +1 -0
  462. package/lib/typescript/commonjs/sqlite/native.d.ts +48 -0
  463. package/lib/typescript/commonjs/sqlite/native.d.ts.map +1 -0
  464. package/lib/typescript/commonjs/sqlite/row-codec.d.ts +69 -0
  465. package/lib/typescript/commonjs/sqlite/row-codec.d.ts.map +1 -0
  466. package/lib/typescript/commonjs/sqlite/sql-builder.d.ts +34 -0
  467. package/lib/typescript/commonjs/sqlite/sql-builder.d.ts.map +1 -0
  468. package/lib/typescript/commonjs/sqlite/statements.d.ts +26 -0
  469. package/lib/typescript/commonjs/sqlite/statements.d.ts.map +1 -0
  470. package/lib/typescript/commonjs/sqlite/transaction-queue.d.ts +31 -0
  471. package/lib/typescript/commonjs/sqlite/transaction-queue.d.ts.map +1 -0
  472. package/lib/typescript/commonjs/sqlite/transactions.d.ts +26 -0
  473. package/lib/typescript/commonjs/sqlite/transactions.d.ts.map +1 -0
  474. package/lib/typescript/commonjs/sqlite/values.d.ts +13 -0
  475. package/lib/typescript/commonjs/sqlite/values.d.ts.map +1 -0
  476. package/lib/typescript/commonjs/testing/conformance/attachments.d.ts +4 -0
  477. package/lib/typescript/commonjs/testing/conformance/attachments.d.ts.map +1 -0
  478. package/lib/typescript/commonjs/testing/conformance/encryption.d.ts +4 -0
  479. package/lib/typescript/commonjs/testing/conformance/encryption.d.ts.map +1 -0
  480. package/lib/typescript/commonjs/testing/conformance/index.d.ts +58 -0
  481. package/lib/typescript/commonjs/testing/conformance/index.d.ts.map +1 -0
  482. package/lib/typescript/commonjs/testing/conformance/lifecycle.d.ts +4 -0
  483. package/lib/typescript/commonjs/testing/conformance/lifecycle.d.ts.map +1 -0
  484. package/lib/typescript/commonjs/testing/conformance/migrations.d.ts +4 -0
  485. package/lib/typescript/commonjs/testing/conformance/migrations.d.ts.map +1 -0
  486. package/lib/typescript/commonjs/testing/conformance/queries.d.ts +4 -0
  487. package/lib/typescript/commonjs/testing/conformance/queries.d.ts.map +1 -0
  488. package/lib/typescript/commonjs/testing/conformance/records.d.ts +4 -0
  489. package/lib/typescript/commonjs/testing/conformance/records.d.ts.map +1 -0
  490. package/lib/typescript/commonjs/testing/conformance/scopes.d.ts +4 -0
  491. package/lib/typescript/commonjs/testing/conformance/scopes.d.ts.map +1 -0
  492. package/lib/typescript/commonjs/testing/conformance/transactions.d.ts +4 -0
  493. package/lib/typescript/commonjs/testing/conformance/transactions.d.ts.map +1 -0
  494. package/lib/typescript/commonjs/testing/faults.d.ts +13 -0
  495. package/lib/typescript/commonjs/testing/faults.d.ts.map +1 -0
  496. package/lib/typescript/commonjs/testing/index.d.ts +13 -0
  497. package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
  498. package/lib/typescript/commonjs/testing/memory-adapter/attachments.d.ts +23 -0
  499. package/lib/typescript/commonjs/testing/memory-adapter/attachments.d.ts.map +1 -0
  500. package/lib/typescript/commonjs/testing/memory-adapter/collection.d.ts +19 -0
  501. package/lib/typescript/commonjs/testing/memory-adapter/collection.d.ts.map +1 -0
  502. package/lib/typescript/commonjs/testing/memory-adapter/index.d.ts +22 -0
  503. package/lib/typescript/commonjs/testing/memory-adapter/index.d.ts.map +1 -0
  504. package/lib/typescript/commonjs/testing/memory-adapter/migrations.d.ts +11 -0
  505. package/lib/typescript/commonjs/testing/memory-adapter/migrations.d.ts.map +1 -0
  506. package/lib/typescript/commonjs/testing/memory-adapter/reset.d.ts +23 -0
  507. package/lib/typescript/commonjs/testing/memory-adapter/reset.d.ts.map +1 -0
  508. package/lib/typescript/commonjs/testing/memory-adapter/store.d.ts +54 -0
  509. package/lib/typescript/commonjs/testing/memory-adapter/store.d.ts.map +1 -0
  510. package/lib/typescript/module/adapter/budgets.d.ts +19 -0
  511. package/lib/typescript/module/adapter/budgets.d.ts.map +1 -0
  512. package/lib/typescript/module/adapter/collection.d.ts +25 -0
  513. package/lib/typescript/module/adapter/collection.d.ts.map +1 -0
  514. package/lib/typescript/module/adapter/deletion.d.ts +48 -0
  515. package/lib/typescript/module/adapter/deletion.d.ts.map +1 -0
  516. package/lib/typescript/module/adapter/handle.d.ts +30 -0
  517. package/lib/typescript/module/adapter/handle.d.ts.map +1 -0
  518. package/lib/typescript/module/adapter/index.d.ts +30 -0
  519. package/lib/typescript/module/adapter/index.d.ts.map +1 -0
  520. package/lib/typescript/module/adapter/lifecycle.d.ts +25 -0
  521. package/lib/typescript/module/adapter/lifecycle.d.ts.map +1 -0
  522. package/lib/typescript/module/adapter/schema-sync.d.ts +19 -0
  523. package/lib/typescript/module/adapter/schema-sync.d.ts.map +1 -0
  524. package/lib/typescript/module/adapter/transaction.d.ts +32 -0
  525. package/lib/typescript/module/adapter/transaction.d.ts.map +1 -0
  526. package/lib/typescript/module/artifacts/availability.d.ts +19 -0
  527. package/lib/typescript/module/artifacts/availability.d.ts.map +1 -0
  528. package/lib/typescript/module/artifacts/cascade.d.ts +26 -0
  529. package/lib/typescript/module/artifacts/cascade.d.ts.map +1 -0
  530. package/lib/typescript/module/artifacts/paths.d.ts +16 -0
  531. package/lib/typescript/module/artifacts/paths.d.ts.map +1 -0
  532. package/lib/typescript/module/artifacts/reconcile.d.ts +23 -0
  533. package/lib/typescript/module/artifacts/reconcile.d.ts.map +1 -0
  534. package/lib/typescript/module/artifacts/store.d.ts +45 -0
  535. package/lib/typescript/module/artifacts/store.d.ts.map +1 -0
  536. package/lib/typescript/module/contract/adapter.d.ts +55 -0
  537. package/lib/typescript/module/contract/adapter.d.ts.map +1 -0
  538. package/lib/typescript/module/contract/attachment.d.ts +84 -0
  539. package/lib/typescript/module/contract/attachment.d.ts.map +1 -0
  540. package/lib/typescript/module/contract/backup.d.ts +26 -0
  541. package/lib/typescript/module/contract/backup.d.ts.map +1 -0
  542. package/lib/typescript/module/contract/config.d.ts +50 -0
  543. package/lib/typescript/module/contract/config.d.ts.map +1 -0
  544. package/lib/typescript/module/contract/encryption.d.ts +31 -0
  545. package/lib/typescript/module/contract/encryption.d.ts.map +1 -0
  546. package/lib/typescript/module/contract/errors.d.ts +50 -0
  547. package/lib/typescript/module/contract/errors.d.ts.map +1 -0
  548. package/lib/typescript/module/contract/migration.d.ts +37 -0
  549. package/lib/typescript/module/contract/migration.d.ts.map +1 -0
  550. package/lib/typescript/module/contract/query.d.ts +79 -0
  551. package/lib/typescript/module/contract/query.d.ts.map +1 -0
  552. package/lib/typescript/module/contract/record.d.ts +43 -0
  553. package/lib/typescript/module/contract/record.d.ts.map +1 -0
  554. package/lib/typescript/module/contract/schema.d.ts +33 -0
  555. package/lib/typescript/module/contract/schema.d.ts.map +1 -0
  556. package/lib/typescript/module/contract/scope.d.ts +33 -0
  557. package/lib/typescript/module/contract/scope.d.ts.map +1 -0
  558. package/lib/typescript/module/contract/transaction.d.ts +66 -0
  559. package/lib/typescript/module/contract/transaction.d.ts.map +1 -0
  560. package/lib/typescript/module/crypto/chunked-cipher.d.ts +57 -0
  561. package/lib/typescript/module/crypto/chunked-cipher.d.ts.map +1 -0
  562. package/lib/typescript/module/crypto/derive.d.ts +28 -0
  563. package/lib/typescript/module/crypto/derive.d.ts.map +1 -0
  564. package/lib/typescript/module/crypto/key-provider.d.ts +30 -0
  565. package/lib/typescript/module/crypto/key-provider.d.ts.map +1 -0
  566. package/lib/typescript/module/crypto/provider.d.ts +35 -0
  567. package/lib/typescript/module/crypto/provider.d.ts.map +1 -0
  568. package/lib/typescript/module/diagnostics/dev-log.d.ts +35 -0
  569. package/lib/typescript/module/diagnostics/dev-log.d.ts.map +1 -0
  570. package/lib/typescript/module/diagnostics/errors.d.ts +34 -0
  571. package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
  572. package/lib/typescript/module/diagnostics/faults.d.ts +26 -0
  573. package/lib/typescript/module/diagnostics/faults.d.ts.map +1 -0
  574. package/lib/typescript/module/diagnostics/map-native.d.ts +31 -0
  575. package/lib/typescript/module/diagnostics/map-native.d.ts.map +1 -0
  576. package/lib/typescript/module/diagnostics/redact.d.ts +70 -0
  577. package/lib/typescript/module/diagnostics/redact.d.ts.map +1 -0
  578. package/lib/typescript/module/index.d.ts +30 -0
  579. package/lib/typescript/module/index.d.ts.map +1 -0
  580. package/lib/typescript/module/migration/executor.d.ts +40 -0
  581. package/lib/typescript/module/migration/executor.d.ts.map +1 -0
  582. package/lib/typescript/module/migration/ledger.d.ts +34 -0
  583. package/lib/typescript/module/migration/ledger.d.ts.map +1 -0
  584. package/lib/typescript/module/migration/validate-chain.d.ts +20 -0
  585. package/lib/typescript/module/migration/validate-chain.d.ts.map +1 -0
  586. package/lib/typescript/module/package.json +1 -0
  587. package/lib/typescript/module/platform/backup-android-verify.d.ts +30 -0
  588. package/lib/typescript/module/platform/backup-android-verify.d.ts.map +1 -0
  589. package/lib/typescript/module/platform/backup-ios.d.ts +26 -0
  590. package/lib/typescript/module/platform/backup-ios.d.ts.map +1 -0
  591. package/lib/typescript/module/platform/bytes.d.ts +36 -0
  592. package/lib/typescript/module/platform/bytes.d.ts.map +1 -0
  593. package/lib/typescript/module/platform/fs.d.ts +47 -0
  594. package/lib/typescript/module/platform/fs.d.ts.map +1 -0
  595. package/lib/typescript/module/platform/location.d.ts +53 -0
  596. package/lib/typescript/module/platform/location.d.ts.map +1 -0
  597. package/lib/typescript/module/query/budgets.d.ts +23 -0
  598. package/lib/typescript/module/query/budgets.d.ts.map +1 -0
  599. package/lib/typescript/module/query/compare.d.ts +42 -0
  600. package/lib/typescript/module/query/compare.d.ts.map +1 -0
  601. package/lib/typescript/module/query/cursor.d.ts +27 -0
  602. package/lib/typescript/module/query/cursor.d.ts.map +1 -0
  603. package/lib/typescript/module/query/filter.d.ts +11 -0
  604. package/lib/typescript/module/query/filter.d.ts.map +1 -0
  605. package/lib/typescript/module/query/paginate.d.ts +15 -0
  606. package/lib/typescript/module/query/paginate.d.ts.map +1 -0
  607. package/lib/typescript/module/query/sort.d.ts +19 -0
  608. package/lib/typescript/module/query/sort.d.ts.map +1 -0
  609. package/lib/typescript/module/query/validate.d.ts +15 -0
  610. package/lib/typescript/module/query/validate.d.ts.map +1 -0
  611. package/lib/typescript/module/schema/declare.d.ts +20 -0
  612. package/lib/typescript/module/schema/declare.d.ts.map +1 -0
  613. package/lib/typescript/module/schema/validate-config.d.ts +11 -0
  614. package/lib/typescript/module/schema/validate-config.d.ts.map +1 -0
  615. package/lib/typescript/module/scope/hash.d.ts +24 -0
  616. package/lib/typescript/module/scope/hash.d.ts.map +1 -0
  617. package/lib/typescript/module/scope/normalize.d.ts +46 -0
  618. package/lib/typescript/module/scope/normalize.d.ts.map +1 -0
  619. package/lib/typescript/module/scope/validate.d.ts +15 -0
  620. package/lib/typescript/module/scope/validate.d.ts.map +1 -0
  621. package/lib/typescript/module/sqlite/adapter.d.ts +16 -0
  622. package/lib/typescript/module/sqlite/adapter.d.ts.map +1 -0
  623. package/lib/typescript/module/sqlite/batch.d.ts +25 -0
  624. package/lib/typescript/module/sqlite/batch.d.ts.map +1 -0
  625. package/lib/typescript/module/sqlite/catalog.d.ts +34 -0
  626. package/lib/typescript/module/sqlite/catalog.d.ts.map +1 -0
  627. package/lib/typescript/module/sqlite/connection.d.ts +58 -0
  628. package/lib/typescript/module/sqlite/connection.d.ts.map +1 -0
  629. package/lib/typescript/module/sqlite/index-coverage.d.ts +18 -0
  630. package/lib/typescript/module/sqlite/index-coverage.d.ts.map +1 -0
  631. package/lib/typescript/module/sqlite/native.d.ts +48 -0
  632. package/lib/typescript/module/sqlite/native.d.ts.map +1 -0
  633. package/lib/typescript/module/sqlite/row-codec.d.ts +69 -0
  634. package/lib/typescript/module/sqlite/row-codec.d.ts.map +1 -0
  635. package/lib/typescript/module/sqlite/sql-builder.d.ts +34 -0
  636. package/lib/typescript/module/sqlite/sql-builder.d.ts.map +1 -0
  637. package/lib/typescript/module/sqlite/statements.d.ts +26 -0
  638. package/lib/typescript/module/sqlite/statements.d.ts.map +1 -0
  639. package/lib/typescript/module/sqlite/transaction-queue.d.ts +31 -0
  640. package/lib/typescript/module/sqlite/transaction-queue.d.ts.map +1 -0
  641. package/lib/typescript/module/sqlite/transactions.d.ts +26 -0
  642. package/lib/typescript/module/sqlite/transactions.d.ts.map +1 -0
  643. package/lib/typescript/module/sqlite/values.d.ts +13 -0
  644. package/lib/typescript/module/sqlite/values.d.ts.map +1 -0
  645. package/lib/typescript/module/testing/conformance/attachments.d.ts +4 -0
  646. package/lib/typescript/module/testing/conformance/attachments.d.ts.map +1 -0
  647. package/lib/typescript/module/testing/conformance/encryption.d.ts +4 -0
  648. package/lib/typescript/module/testing/conformance/encryption.d.ts.map +1 -0
  649. package/lib/typescript/module/testing/conformance/index.d.ts +58 -0
  650. package/lib/typescript/module/testing/conformance/index.d.ts.map +1 -0
  651. package/lib/typescript/module/testing/conformance/lifecycle.d.ts +4 -0
  652. package/lib/typescript/module/testing/conformance/lifecycle.d.ts.map +1 -0
  653. package/lib/typescript/module/testing/conformance/migrations.d.ts +4 -0
  654. package/lib/typescript/module/testing/conformance/migrations.d.ts.map +1 -0
  655. package/lib/typescript/module/testing/conformance/queries.d.ts +4 -0
  656. package/lib/typescript/module/testing/conformance/queries.d.ts.map +1 -0
  657. package/lib/typescript/module/testing/conformance/records.d.ts +4 -0
  658. package/lib/typescript/module/testing/conformance/records.d.ts.map +1 -0
  659. package/lib/typescript/module/testing/conformance/scopes.d.ts +4 -0
  660. package/lib/typescript/module/testing/conformance/scopes.d.ts.map +1 -0
  661. package/lib/typescript/module/testing/conformance/transactions.d.ts +4 -0
  662. package/lib/typescript/module/testing/conformance/transactions.d.ts.map +1 -0
  663. package/lib/typescript/module/testing/faults.d.ts +13 -0
  664. package/lib/typescript/module/testing/faults.d.ts.map +1 -0
  665. package/lib/typescript/module/testing/index.d.ts +13 -0
  666. package/lib/typescript/module/testing/index.d.ts.map +1 -0
  667. package/lib/typescript/module/testing/memory-adapter/attachments.d.ts +23 -0
  668. package/lib/typescript/module/testing/memory-adapter/attachments.d.ts.map +1 -0
  669. package/lib/typescript/module/testing/memory-adapter/collection.d.ts +19 -0
  670. package/lib/typescript/module/testing/memory-adapter/collection.d.ts.map +1 -0
  671. package/lib/typescript/module/testing/memory-adapter/index.d.ts +22 -0
  672. package/lib/typescript/module/testing/memory-adapter/index.d.ts.map +1 -0
  673. package/lib/typescript/module/testing/memory-adapter/migrations.d.ts +11 -0
  674. package/lib/typescript/module/testing/memory-adapter/migrations.d.ts.map +1 -0
  675. package/lib/typescript/module/testing/memory-adapter/reset.d.ts +23 -0
  676. package/lib/typescript/module/testing/memory-adapter/reset.d.ts.map +1 -0
  677. package/lib/typescript/module/testing/memory-adapter/store.d.ts +54 -0
  678. package/lib/typescript/module/testing/memory-adapter/store.d.ts.map +1 -0
  679. package/package.json +51 -16
  680. package/skills/sdk-rn-local-db/SKILL.md +1 -1
  681. package/src/adapter/budgets.ts +1 -10
  682. package/src/adapter/collection.ts +38 -66
  683. package/src/adapter/deletion.ts +48 -0
  684. package/src/adapter/handle.ts +311 -0
  685. package/src/adapter/lifecycle.ts +10 -338
  686. package/src/adapter/schema-sync.ts +155 -0
  687. package/src/artifacts/cascade.ts +0 -14
  688. package/src/artifacts/store.ts +60 -10
  689. package/src/contract/attachment.ts +24 -3
  690. package/src/contract/migration.ts +4 -1
  691. package/src/crypto/provider.ts +7 -3
  692. package/src/diagnostics/dev-log.ts +5 -1
  693. package/src/migration/executor.ts +27 -6
  694. package/src/migration/ledger.ts +18 -27
  695. package/src/platform/fs.ts +2 -8
  696. package/src/platform/location.ts +0 -3
  697. package/src/query/budgets.ts +32 -5
  698. package/src/schema/validate-config.ts +3 -53
  699. package/src/sqlite/batch.ts +40 -51
  700. package/src/sqlite/connection.ts +0 -9
  701. package/src/sqlite/row-codec.ts +5 -2
  702. package/src/sqlite/statements.ts +74 -0
  703. package/src/testing/index.ts +2 -0
  704. package/src/testing/memory-adapter/attachments.ts +146 -0
  705. package/src/testing/memory-adapter/index.ts +13 -111
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Artifacts: the file on disk and the reference to it.
3
+ *
4
+ * The reference lives in the scope's own database, so a reference created
5
+ * inside a transaction rolls back with it (FR-072) — no bookkeeping required,
6
+ * because the connection routes through the transaction in flight.
7
+ *
8
+ * The file does not roll back. A filesystem write is not part of a SQL
9
+ * transaction and cannot be made part of one, so a rolled-back transaction
10
+ * leaves an artifact on disk with nothing pointing at it. That is not a bug
11
+ * to be engineered away; it is why reconciliation exists (FR-073d), and why
12
+ * the write order is deliberate: **the file completes first, then the
13
+ * reference**. The reverse order would produce a reference to a file that
14
+ * does not exist, which is the failure a consumer cannot recover from — it
15
+ * looks like data the app has and does not.
16
+ */
17
+ import type { AttachmentInput, AttachmentOwner, AttachmentReference, ByteRange, DeletionOutcome } from '../contract/attachment.js';
18
+ import type { StorageLayout } from '../platform/location.js';
19
+ import type { Executor } from '../sqlite/connection.js';
20
+ export type ArtifactContext = {
21
+ executor(): Executor;
22
+ layout: StorageLayout;
23
+ scopeKey: string;
24
+ /** Null when the database is unencrypted. */
25
+ artifactKey(attachmentId: string): Uint8Array | null;
26
+ now(): number;
27
+ };
28
+ export declare function ensureAttachmentTable(executor: Executor): Promise<void>;
29
+ export declare function readReference(executor: Executor, id: string): Promise<AttachmentReference | null>;
30
+ export declare function listReferences(executor: Executor): Promise<AttachmentReference[]>;
31
+ export declare function listReferencesFor(executor: Executor, owner: AttachmentOwner): Promise<AttachmentReference[]>;
32
+ export declare function deleteReference(executor: Executor, id: string): Promise<boolean>;
33
+ export declare function writeArtifact(context: ArtifactContext, input: AttachmentInput): Promise<AttachmentReference>;
34
+ export declare function readArtifact(context: ArtifactContext, id: string, range?: ByteRange): Promise<string>;
35
+ /**
36
+ * Collects file removals until the transaction that deleted their references
37
+ * commits. A file unlinked inside the transaction is gone even if the
38
+ * transaction then rolls back and the reference returns — a dangling
39
+ * reference to data nobody can recover.
40
+ */
41
+ export type DeferredUnlinks = {
42
+ add(path: string): void;
43
+ };
44
+ export declare function removeArtifact(context: ArtifactContext, id: string, deferred?: DeferredUnlinks): Promise<DeletionOutcome>;
45
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/artifacts/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,MAAM,2BAAwB,CAAC;AAQhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAsB,CAAC;AAa1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAsB,CAAC;AAkBrD,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,IAAI,QAAQ,CAAC;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;IACrD,GAAG,IAAI,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7E;AAoBD,wBAAsB,aAAa,CAClC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,GACR,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAIrC;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAGvF;AAED,wBAAsB,iBAAiB,CACtC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,eAAe,GACpB,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAMhC;AA4BD,wBAAsB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGtF;AA+ED,wBAAsB,aAAa,CAClC,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,eAAe,GACpB,OAAO,CAAC,mBAAmB,CAAC,CA2C9B;AA6CD,wBAAsB,YAAY,CACjC,OAAO,EAAE,eAAe,EACxB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,GACf,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAsB,cAAc,CACnC,OAAO,EAAE,eAAe,EACxB,EAAE,EAAE,MAAM,EACV,QAAQ,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,eAAe,CAAC,CA2B1B"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The interface every storage implementation satisfies.
3
+ *
4
+ * Two implementations exist: op-sqlite on device, and a pure-TypeScript
5
+ * in-memory one for tests. The second is not a convenience — op-sqlite is
6
+ * native and unreachable from Jest, so without it the package's own
7
+ * guarantees would be untestable in CI (research.md R8).
8
+ */
9
+ import type { AttachmentAvailability, AttachmentInput, AttachmentReference, AttachmentOwner, ByteRange, DeletionOutcome, ReconciliationReport } from './attachment.js';
10
+ import type { EffectivePosture } from './backup.js';
11
+ import type { DatabaseConfig, DatabaseTargetConfig, ScopeTargetConfig } from './config.js';
12
+ import type { FilterNode, IndexCoverageReport, Query, ResultPage } from './query.js';
13
+ import type { RecordInput, StorableRecordData, StoredRecord, WriteOutcome } from './record.js';
14
+ import type { BatchOperation, BatchOutcome, CollectionOps, Transaction } from './transaction.js';
15
+ export type Attachments = {
16
+ write(input: AttachmentInput): Promise<AttachmentReference>;
17
+ read(id: string, range?: ByteRange): Promise<string>;
18
+ /** Never opens or decrypts the artifact (FR-073e, FR-107b). */
19
+ availability(id: string): Promise<AttachmentAvailability>;
20
+ remove(id: string): Promise<DeletionOutcome>;
21
+ listFor(owner: AttachmentOwner): Promise<AttachmentReference[]>;
22
+ /** App-triggered only; the package runs no background sweep. */
23
+ reconcile(options?: {
24
+ removeOrphans?: boolean;
25
+ }): Promise<ReconciliationReport>;
26
+ };
27
+ export type DatabaseHandle = {
28
+ /** The scope hash. Never the components (FR-014). */
29
+ readonly scopeKey: string;
30
+ readonly schemaVersion: number;
31
+ readonly backupPosture: EffectivePosture;
32
+ readonly isEncrypted: boolean;
33
+ collection<T extends StorableRecordData = StorableRecordData>(name: string): CollectionOps<T>;
34
+ transaction<R>(fn: (tx: Transaction) => Promise<R>): Promise<R>;
35
+ batch(operations: BatchOperation[]): Promise<BatchOutcome>;
36
+ attachments(): Attachments;
37
+ /** Development-mode index coverage answer (FR-037). */
38
+ explain(collection: string, query?: Query): Promise<IndexCoverageReport>;
39
+ close(): Promise<void>;
40
+ };
41
+ /**
42
+ * What an implementation must provide. Deliberately lower-level than the
43
+ * public surface: validation, budget checks, and error mapping happen once in
44
+ * `adapter/`, above this line, so both implementations share them.
45
+ */
46
+ export type StorageAdapter = {
47
+ readonly name: 'sqlite' | 'memory';
48
+ open(config: DatabaseConfig): Promise<DatabaseHandle>;
49
+ deleteScopeData(config: ScopeTargetConfig): Promise<DeletionOutcome>;
50
+ deleteDatabase(config: DatabaseTargetConfig): Promise<DeletionOutcome>;
51
+ /** The FR-057a recovery path. Never reachable from open(). */
52
+ resetScope(config: ScopeTargetConfig): Promise<DeletionOutcome>;
53
+ };
54
+ export type { CollectionOps, FilterNode, Query, RecordInput, ResultPage, StoredRecord, Transaction, WriteOutcome, };
55
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/contract/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,MAAM,iBAAc,CAAC;AACtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAU,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAU,CAAC;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAU,CAAC;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAe,CAAC;AAE9F,MAAM,MAAM,WAAW,GAAG;IACzB,KAAK,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC5D,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,+DAA+D;IAC/D,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7C,OAAO,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAChE,gEAAgE;IAChE,SAAS,CAAC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAChF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAE9B,UAAU,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAC9F,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAChE,KAAK,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3D,WAAW,IAAI,WAAW,CAAC;IAC3B,uDAAuD;IACvD,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACzE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAEnC,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACtD,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACrE,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACvE,8DAA8D;IAC9D,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAChE,CAAC;AAEF,YAAY,EACX,aAAa,EACb,UAAU,EACV,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,GACZ,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Attachment references and the artifacts behind them.
3
+ *
4
+ * This package owns both halves. The consequence is that a filesystem write
5
+ * cannot be rolled back by a database transaction, which is why
6
+ * reconciliation exists (FR-073d) rather than being a nicety.
7
+ */
8
+ export type AttachmentOwner = {
9
+ collection: string;
10
+ id: string;
11
+ };
12
+ type AttachmentDescription = {
13
+ id: string;
14
+ /** Absent means the attachment belongs to the scope rather than a record. */
15
+ owner?: AttachmentOwner | undefined;
16
+ contentType: string;
17
+ };
18
+ /**
19
+ * Where the bytes come from. Exactly one of the two.
20
+ *
21
+ * `sourcePath` is the one to use for anything large — a photo, a recording.
22
+ * The file is copied (or, when encrypted, read and encrypted 256 KB at a
23
+ * time), so memory does not grow with its size. `content` holds the whole
24
+ * payload in JS as base64 and is decoded in one piece: fine for a thumbnail,
25
+ * several times the file's size in memory for a video.
26
+ */
27
+ export type AttachmentInput = AttachmentDescription & ({
28
+ /** The complete content, base64. Held and decoded whole. */
29
+ content: string;
30
+ sourcePath?: undefined;
31
+ } | {
32
+ /** Absolute path of a file the app can read. A `file://` prefix is accepted. */
33
+ sourcePath: string;
34
+ content?: undefined;
35
+ });
36
+ export type AttachmentReference = {
37
+ id: string;
38
+ owner?: AttachmentOwner | undefined;
39
+ contentType: string;
40
+ /** Plaintext byte length, <= 100 MB (FR-088). */
41
+ size: number;
42
+ createdAt: number;
43
+ /** Present only for encrypted artifacts (research.md R4). */
44
+ chunkSize?: number;
45
+ chunkCount?: number;
46
+ };
47
+ /**
48
+ * `undecryptable` is deliberately distinct from `missing`: one is data loss
49
+ * for that artifact, the other is a wrong key or a tampered file (FR-107c).
50
+ */
51
+ export type AttachmentAvailabilityState = 'available' | 'missing' | 'inaccessible' | 'undecryptable';
52
+ export type AttachmentAvailability = {
53
+ id: string;
54
+ state: AttachmentAvailabilityState;
55
+ size?: number;
56
+ };
57
+ export type ByteRange = {
58
+ offset: number;
59
+ length: number;
60
+ };
61
+ /**
62
+ * Both directions of divergence between the database and the disk (FR-073d).
63
+ */
64
+ export type ReconciliationReport = {
65
+ orphanedArtifacts: string[];
66
+ danglingReferences: string[];
67
+ removedArtifacts: string[];
68
+ };
69
+ /** Never a bare success (FR-065, FR-071). */
70
+ export type DeletionOutcome = {
71
+ scopeKey?: string;
72
+ removedRecords: number;
73
+ /**
74
+ * True when the scope was deleted but its records could not be counted — an
75
+ * encrypted scope whose key was unavailable, or a file that would not open.
76
+ * `removedRecords` is then 0 and means "unknown". Added in 0.2.0.
77
+ */
78
+ recordCountUnavailable?: boolean;
79
+ removedArtifacts: string[];
80
+ orphanedReferences: string[];
81
+ failedRemovals: string[];
82
+ };
83
+ export {};
84
+ //# sourceMappingURL=attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../../src/contract/attachment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,KAAK,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAClD,CACG;IACA,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACA,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;CACnB,CACH,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GACtC,WAAW,GAAG,SAAS,GAAG,cAAc,GAAG,eAAe,CAAC;AAE5D,MAAM,MAAM,sBAAsB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,2BAA2B,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,cAAc,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Platform backup posture.
3
+ *
4
+ * The platforms are not symmetric, and this contract is where that becomes
5
+ * visible to the consumer rather than hidden. On iOS the package sets the
6
+ * exclusion attribute itself. On Android backup participation is declared in
7
+ * the app's manifest — build-time, app-owned, and unreachable from a library
8
+ * that authors no native code — so the package verifies and reports instead.
9
+ * See research.md R5.
10
+ */
11
+ export type BackupConfig = {
12
+ /** Default false: excluded unless the app asks otherwise (FR-109). */
13
+ includeInPlatformBackup: boolean;
14
+ };
15
+ export type BackupPostureValue = 'excluded' | 'included' | 'unknown';
16
+ export type EffectivePosture = {
17
+ /** What the app asked for. */
18
+ requested: Exclude<BackupPostureValue, 'unknown'>;
19
+ /** What the package can actually confirm on this platform. */
20
+ observed: BackupPostureValue;
21
+ /** iOS: the package. Android: the app's manifest. */
22
+ enforcedBy: 'package' | 'app-manifest';
23
+ /** Present when requested and observed disagree — the case that matters. */
24
+ warning?: string;
25
+ };
26
+ //# sourceMappingURL=backup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../../../src/contract/backup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,YAAY,GAAG;IAC1B,sEAAsE;IACtE,uBAAuB,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG;IAC9B,8BAA8B;IAC9B,SAAS,EAAE,OAAO,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAClD,8DAA8D;IAC9D,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,qDAAqD;IACrD,UAAU,EAAE,SAAS,GAAG,cAAc,CAAC;IACvC,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Database configuration: everything an app supplies at open time.
3
+ *
4
+ * Immutable for the handle's lifetime. Scope in particular is bound here and
5
+ * never changes (FR-008a) — there is no switchScope, and no operation takes a
6
+ * scope argument, which is what makes cross-scope leakage inexpressible
7
+ * rather than merely prevented.
8
+ */
9
+ import type { BackupConfig } from './backup.js';
10
+ import type { EncryptionConfig } from './encryption.js';
11
+ import type { Migration } from './migration.js';
12
+ import type { CollectionSchema } from './schema.js';
13
+ import type { ScopeDescriptor } from './scope.js';
14
+ /** Phase-one budgets (FR-088). Confirmed against the harness during validation. */
15
+ export declare const Budgets: {
16
+ readonly MAX_RECORDS_PER_COLLECTION: 100000;
17
+ readonly MAX_RECORD_BYTES: number;
18
+ readonly MAX_BATCH_OPERATIONS: 1000;
19
+ readonly MAX_PAGE_SIZE: 500;
20
+ readonly MAX_COLLECTIONS_PER_DATABASE: 50;
21
+ readonly MAX_ATTACHMENT_REFERENCES_PER_SCOPE: 50000;
22
+ readonly MAX_ARTIFACT_BYTES: number;
23
+ readonly MAX_OPEN_HANDLES: 8;
24
+ /** Plaintext chunk size for encrypted artifacts (research.md R4). */
25
+ readonly ARTIFACT_CHUNK_BYTES: number;
26
+ };
27
+ export type DatabaseConfig = {
28
+ name: string;
29
+ scope: ScopeDescriptor;
30
+ /** Must equal the highest version in `migrations` (FR-053). */
31
+ schemaVersion: number;
32
+ collections: CollectionSchema[];
33
+ migrations?: Migration[];
34
+ /** Absent means unencrypted (FR-097). */
35
+ encryption?: EncryptionConfig | undefined;
36
+ /** Absent means excluded from platform backup (FR-109). */
37
+ backup?: BackupConfig;
38
+ /** Governs whether deleting a record removes its artifacts (FR-070). */
39
+ cascadeAttachments?: boolean;
40
+ };
41
+ /** Names a scope for the operations that legitimately need to (FR-059). */
42
+ export type ScopeTargetConfig = {
43
+ name: string;
44
+ scope: ScopeDescriptor;
45
+ encryption?: EncryptionConfig | undefined;
46
+ };
47
+ export type DatabaseTargetConfig = {
48
+ name: string;
49
+ };
50
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/contract/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAc,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAU,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAS,CAAC;AAE/C,mFAAmF;AACnF,eAAO,MAAM,OAAO;;;;;;;;;IASnB,qEAAqE;;CAE5D,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,yCAAyC;IACzC,UAAU,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC1C,2DAA2D;IAC3D,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Opt-in encryption at rest under an app-supplied key.
3
+ *
4
+ * The package never generates, derives from its own material, persists,
5
+ * caches beyond the handle's lifetime, transmits, or returns a key (FR-098).
6
+ * Keeping key acquisition on the app side is also what keeps a keychain
7
+ * dependency out of this package entirely (LIB-004).
8
+ */
9
+ import type { ResolvedScope } from './scope.js';
10
+ /**
11
+ * Implemented by the consuming app. Receives the scope so an app can key per
12
+ * identity — which is what makes destroying one identity's key meaningful
13
+ * (FR-104).
14
+ */
15
+ export type KeyProvider = {
16
+ getKey(scope: ResolvedScope): Promise<string>;
17
+ };
18
+ export type EncryptionConfig = {
19
+ enabled: true;
20
+ keyProvider: KeyProvider;
21
+ };
22
+ /**
23
+ * What the package will say about its own at-rest posture. Reported so a
24
+ * consumer can make an accurate privacy disclosure rather than assume one.
25
+ */
26
+ export type EncryptionPosture = {
27
+ enabled: boolean;
28
+ /** Whether SQLCipher is actually compiled into the app (research.md R1a). */
29
+ available: boolean;
30
+ };
31
+ //# sourceMappingURL=encryption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../../../src/contract/encryption.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,IAAI,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Diagnostic codes.
3
+ *
4
+ * Stable identifiers so an app can choose a response without parsing a
5
+ * message (FR-074, FR-082). Disk-full, filesystem-access, and corruption stay
6
+ * distinct rather than collapsing into a generic write failure (FR-076) —
7
+ * an app frees space for one, retries after unlock for another, and offers a
8
+ * reset for the third.
9
+ *
10
+ * Full table with recommended recovery per code:
11
+ * specs/008-rn-local-db-package/contracts/errors.md
12
+ */
13
+ export declare const DiagnosticCodes: {
14
+ readonly CONFIG_INVALID: "CONFIG_INVALID";
15
+ readonly INVALID_SCOPE: "INVALID_SCOPE";
16
+ readonly MIGRATION_CONFIG_INVALID: "MIGRATION_CONFIG_INVALID";
17
+ readonly OPEN_FAILED: "OPEN_FAILED";
18
+ readonly CLOSED_HANDLE: "CLOSED_HANDLE";
19
+ readonly SCOPE_DELETED: "SCOPE_DELETED";
20
+ readonly CORRUPTION: "CORRUPTION";
21
+ readonly STORAGE_ACCESS: "STORAGE_ACCESS";
22
+ readonly MIGRATION_FAILED: "MIGRATION_FAILED";
23
+ readonly SCHEMA_DOWNGRADE: "SCHEMA_DOWNGRADE";
24
+ readonly RECORD_NOT_FOUND: "RECORD_NOT_FOUND";
25
+ readonly RECORD_CONFLICT: "RECORD_CONFLICT";
26
+ readonly RECORD_TOO_LARGE: "RECORD_TOO_LARGE";
27
+ readonly BATCH_TOO_LARGE: "BATCH_TOO_LARGE";
28
+ readonly DISK_FULL: "DISK_FULL";
29
+ readonly WRITE_FAILED: "WRITE_FAILED";
30
+ readonly QUERY_INVALID: "QUERY_INVALID";
31
+ readonly PAGE_SIZE_INVALID: "PAGE_SIZE_INVALID";
32
+ readonly CURSOR_INVALID: "CURSOR_INVALID";
33
+ readonly TRANSACTION_FAILED: "TRANSACTION_FAILED";
34
+ readonly TRANSACTION_STATE: "TRANSACTION_STATE";
35
+ readonly ATTACHMENT_MISSING: "ATTACHMENT_MISSING";
36
+ readonly ATTACHMENT_OUT_OF_BOUNDS: "ATTACHMENT_OUT_OF_BOUNDS";
37
+ readonly ATTACHMENT_WRITE_FAILED: "ATTACHMENT_WRITE_FAILED";
38
+ readonly ATTACHMENT_UNDECRYPTABLE: "ATTACHMENT_UNDECRYPTABLE";
39
+ readonly KEY_INVALID: "KEY_INVALID";
40
+ readonly KEY_PROVIDER_FAILED: "KEY_PROVIDER_FAILED";
41
+ readonly ENCRYPTION_MISMATCH: "ENCRYPTION_MISMATCH";
42
+ readonly ENCRYPTION_UNAVAILABLE: "ENCRYPTION_UNAVAILABLE";
43
+ };
44
+ export type DiagnosticCode = (typeof DiagnosticCodes)[keyof typeof DiagnosticCodes];
45
+ /**
46
+ * Codes worth retrying. `KEY_PROVIDER_FAILED` is here because a locked device
47
+ * is an expected condition, not a bug (FR-102).
48
+ */
49
+ export declare const RETRYABLE_CODES: ReadonlySet<DiagnosticCode>;
50
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/contract/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ClB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,cAAc,CAStD,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Versioned migrations.
3
+ *
4
+ * The package never writes a migration and never alters domain data except
5
+ * through one the domain supplied (FR-056).
6
+ */
7
+ import type { Transaction } from './transaction.js';
8
+ /** Low-level escape hatch for schema work a migration needs. */
9
+ /** A value SQLite can bind. */
10
+ export type SqlParameter = string | number | boolean | null;
11
+ export type MigrationContext = Omit<Transaction, 'attachments'> & {
12
+ /** Execute a raw statement against the scope's database. */
13
+ execute(sql: string, params?: SqlParameter[]): Promise<void>;
14
+ };
15
+ export type Migration = {
16
+ /** Unique, contiguous, and reaching the declared schemaVersion (FR-053). */
17
+ version: number;
18
+ migrate(context: MigrationContext): Promise<void>;
19
+ };
20
+ export type MigrationOutcome = 'applied' | 'failed';
21
+ export type MigrationLedgerEntry = {
22
+ version: number;
23
+ attemptedAt: number;
24
+ outcome: MigrationOutcome;
25
+ /** A diagnostic code only — never a message, which could carry payload. */
26
+ failureCode?: string;
27
+ };
28
+ /**
29
+ * Attached to a MIGRATION_FAILED error so an app can tell a transient failure
30
+ * from a permanent one and choose retry, reset, or asking the user (FR-057c).
31
+ */
32
+ export type MigrationFailureDetail = {
33
+ recordedVersion: number;
34
+ failingVersion: number;
35
+ outcome: MigrationOutcome;
36
+ };
37
+ //# sourceMappingURL=migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../../src/contract/migration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAe,CAAC;AAEjD,gEAAgE;AAGhE,+BAA+B;AAC/B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE5D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG;IACjE,4DAA4D;IAC5D,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACvB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpD,MAAM,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,gBAAgB,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Query contract.
3
+ *
4
+ * A query carries no scope, because it cannot address one — scope is bound to
5
+ * the handle and immutable (FR-008a). That absence is the isolation
6
+ * guarantee, not a convention.
7
+ */
8
+ import type { StorableRecordData, StoredRecord } from './record.js';
9
+ /** Values a filter may compare against. */
10
+ export type FilterValue = string | number | boolean | null;
11
+ export type ComparisonOperator = 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte' | 'in' | 'nin' | 'between' | 'isNull' | 'isNotNull' | 'exists';
12
+ export type ComparisonNode = {
13
+ op: 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte';
14
+ field: string;
15
+ value: FilterValue;
16
+ } | {
17
+ op: 'in' | 'nin';
18
+ field: string;
19
+ value: FilterValue[];
20
+ } | {
21
+ op: 'between';
22
+ field: string;
23
+ value: [FilterValue, FilterValue];
24
+ } | {
25
+ op: 'isNull' | 'isNotNull';
26
+ field: string;
27
+ }
28
+ /** Distinguishes an absent field from one holding null (FR-019). */
29
+ | {
30
+ op: 'exists';
31
+ field: string;
32
+ value: boolean;
33
+ };
34
+ export type LogicalNode = {
35
+ op: 'and';
36
+ nodes: FilterNode[];
37
+ } | {
38
+ op: 'or';
39
+ nodes: FilterNode[];
40
+ } | {
41
+ op: 'not';
42
+ node: FilterNode;
43
+ };
44
+ export type FilterNode = ComparisonNode | LogicalNode;
45
+ export type SortDirection = 'asc' | 'desc';
46
+ export type SortKey = {
47
+ field: string;
48
+ direction?: SortDirection;
49
+ };
50
+ export type PageRequest = {
51
+ /** 1..500 (FR-036, FR-088). */
52
+ size: number;
53
+ /** Opaque keyset cursor from a previous page. */
54
+ cursor?: string | undefined;
55
+ };
56
+ export type Query = {
57
+ filter?: FilterNode | undefined;
58
+ sort?: SortKey[] | undefined;
59
+ page?: PageRequest | undefined;
60
+ /** Soft-deleted records are excluded unless this is true (FR-021). */
61
+ includeSoftDeleted?: boolean;
62
+ };
63
+ export type ResultPage<T extends StorableRecordData = StorableRecordData> = {
64
+ records: StoredRecord<T>[];
65
+ /** Absent when there is no further page. */
66
+ cursor?: string | undefined;
67
+ hasMore: boolean;
68
+ };
69
+ /**
70
+ * Development-only answer to "is this query covered by an index?" (FR-037).
71
+ * Backed by EXPLAIN QUERY PLAN on the SQLite adapter.
72
+ */
73
+ export type IndexCoverageReport = {
74
+ collection: string;
75
+ usesIndex: boolean;
76
+ indexName?: string | undefined;
77
+ detail: string;
78
+ };
79
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/contract/query.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAU,CAAC;AAEjE,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAC3B,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,KAAK,GACL,SAAS,GACT,QAAQ,GACR,WAAW,GACX,QAAQ,CAAC;AAEZ,MAAM,MAAM,cAAc,GACvB;IAAE,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACpF;IAAE,EAAE,EAAE,IAAI,GAAG,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,GACzD;IAAE,EAAE,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;CAAE,GACnE;IAAE,EAAE,EAAE,QAAQ,GAAG,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAC/C,oEAAoE;GAClE;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnD,MAAM,MAAM,WAAW,GACpB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,GAClC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,GACjC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEnC,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,OAAO,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IACnB,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IAAI;IAC3E,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Records and the four value conditions.
3
+ *
4
+ * The distinction FR-019 requires — record absent, field explicitly null,
5
+ * field absent, record soft-deleted — is preserved because reads reconstruct
6
+ * from the stored payload alone and never from projected columns. See
7
+ * research.md R6.
8
+ */
9
+ import type { DeletionOutcome } from './attachment.js';
10
+ /** Anything the package will store and hand back unchanged. */
11
+ export type StorableValue = string | number | boolean | null | StorableValue[] | {
12
+ [key: string]: StorableValue;
13
+ };
14
+ export type StorableRecordData = {
15
+ [key: string]: StorableValue;
16
+ };
17
+ export type RecordInput<T extends StorableRecordData = StorableRecordData> = {
18
+ id: string;
19
+ data: T;
20
+ };
21
+ export type StoredRecord<T extends StorableRecordData = StorableRecordData> = {
22
+ id: string;
23
+ data: T;
24
+ /** Present only when the collection declares timestamps (FR-020). */
25
+ createdAt?: number;
26
+ updatedAt?: number;
27
+ /** Present only when soft-deleted (FR-021). */
28
+ deletedAt?: number | null;
29
+ };
30
+ export type WriteOperation = 'created' | 'updated' | 'deleted' | 'restored';
31
+ /** An upsert reports which it actually was (FR-026). */
32
+ export type WriteOutcome = {
33
+ operation: WriteOperation;
34
+ id: string;
35
+ /**
36
+ * Present on a delete when `cascadeAttachments` is on: which attachment files
37
+ * went with the record and which could not be removed (FR-071). Inside a
38
+ * transaction the files are removed once it commits, so `removedArtifacts`
39
+ * lists what was scheduled. Added in 0.2.0.
40
+ */
41
+ cascade?: DeletionOutcome;
42
+ };
43
+ //# sourceMappingURL=record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../src/contract/record.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAc,CAAC;AAEpD,+DAA+D;AAC/D,MAAM,MAAM,aAAa,GACxB,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,aAAa,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAEvF,MAAM,MAAM,kBAAkB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IAAI;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;CACR,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IAAI;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;IACR,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5E,wDAAwD;AACxD,MAAM,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,cAAc,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX;;;;;OAKG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Collection schema: structure only.
3
+ *
4
+ * Declaring a field makes it queryable and projectable. It does NOT restrict
5
+ * what a record may contain — undeclared fields are stored and returned
6
+ * faithfully, they are simply not filterable or sortable (FR-017, FR-034).
7
+ */
8
+ export type FieldType = 'string' | 'number' | 'boolean' | 'timestamp';
9
+ export type FieldDeclaration = {
10
+ name: string;
11
+ type: FieldType;
12
+ /** Whether the projected column tolerates SQL NULL. Purely a query concern. */
13
+ nullable?: boolean;
14
+ };
15
+ export type IndexDeclaration = {
16
+ name: string;
17
+ /** Must all reference declared fields (FR-006). */
18
+ fields: string[];
19
+ unique?: boolean;
20
+ };
21
+ export type CollectionSchema = {
22
+ name: string;
23
+ fields: FieldDeclaration[];
24
+ indexes?: IndexDeclaration[];
25
+ /**
26
+ * Opt-in per collection, off by default. When on, deleted rows are
27
+ * excluded from queries unless explicitly requested (FR-021).
28
+ */
29
+ softDelete?: boolean;
30
+ /** When on, the package maintains createdAt / updatedAt (FR-020). */
31
+ timestamps?: boolean;
32
+ };
33
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/contract/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEtE,MAAM,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qEAAqE;IACrE,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Storage scope: the isolation boundary for all data.
3
+ *
4
+ * Components are opaque values the consuming app supplies. The package
5
+ * composes, normalizes, and validates them but never interprets them, and
6
+ * never invents one of its own (FR-008, FR-009).
7
+ */
8
+ export type ScopeKind = 'guest' | 'identity' | 'tenant' | 'workspace' | 'custom';
9
+ /**
10
+ * What an app supplies to name a scope.
11
+ *
12
+ * Every component is treated as sensitive (FR-014): none of these values
13
+ * reaches disk, a log, or an error. Only the SHA-256 digest of the canonical
14
+ * form does.
15
+ */
16
+ export type ScopeDescriptor = {
17
+ kind: ScopeKind;
18
+ /** Required for every kind except `guest`. */
19
+ id?: string;
20
+ tenant?: string;
21
+ app?: string;
22
+ environment?: string;
23
+ namespace?: string;
24
+ };
25
+ /** The resolved scope: a hex digest, plus the kind it came from. */
26
+ export type ResolvedScope = {
27
+ /** SHA-256 hex of the canonical descriptor. Names the scope's directory. */
28
+ key: string;
29
+ kind: ScopeKind;
30
+ };
31
+ /** Where a scope sits in its lifecycle. Persisted in the catalog (FR-063). */
32
+ export type ScopeDeletionState = 'active' | 'deleting';
33
+ //# sourceMappingURL=scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../../src/contract/scope.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEjF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,8CAA8C;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,aAAa,GAAG;IAC3B,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;CAChB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,UAAU,CAAC"}