@chipmobilesdk/rn-local-db 0.4.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 (680) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/README.md +69 -8
  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/src/crypto/provider.ts +7 -3
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_errors2","_budgets","_declare","_statements","quoted","schema","collectionTable","name","conflict","id","raise","DiagnosticCodes","RECORD_CONFLICT","message","detail","collection","recordId","missing","RECORD_NOT_FOUND","resolveInsert","resolver","operation","now","payload","assertRecordWithinBudget","record","data","state","stage","command","insertStatement","outcome","resolveUpdate","updateStatement","restore","resolveUpsert","present","resolveDelete","resolveSoftDelete","hasSoftDelete","CONFIG_INVALID","resolveOperation","type","runBatch","context","operations","assertBatchWithinBudget","length","commands","outcomes","overlay","Map","known","idsByCollection","ids","get","Set","add","set","schemaFor","result","connection","execute","JSON","stringify","row","rows","String","deleted_at","undefined","key","resolved","push","executeBatch","applied"],"sourceRoot":"../../../src","sources":["sqlite/batch.ts"],"mappings":";;;;;;AAeA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA,SAASK,MAAMA,CAACC,MAAwB,EAAU;EACjD,OAAO,IAAI,IAAAC,wBAAe,EAACD,MAAM,CAACE,IAAI,CAAC,GAAG;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASC,QAAQA,CAACH,MAAwB,EAAEI,EAAU,EAAS;EAC9D,IAAAC,cAAK,EAACC,uBAAe,CAACC,eAAe,EAAE;IACtCC,OAAO,EAAE,uBAAuB;IAChCC,MAAM,EAAE;MAAEC,UAAU,EAAEV,MAAM,CAACE,IAAI;MAAES,QAAQ,EAAEP;IAAG;EACjD,CAAC,CAAC;AACH;AAEA,SAASQ,OAAOA,CAACZ,MAAwB,EAAEI,EAAU,EAAS;EAC7D,IAAAC,cAAK,EAACC,uBAAe,CAACO,gBAAgB,EAAE;IACvCL,OAAO,EAAE,kBAAkB;IAC3BC,MAAM,EAAE;MAAEC,UAAU,EAAEV,MAAM,CAACE,IAAI;MAAES,QAAQ,EAAEP;IAAG;EACjD,CAAC,CAAC;AACH;AAEA,eAAeU,aAAaA,CAC3BC,QAAkB,EAClBC,SAAsD,EAClC;EACpB,MAAM;IAAEhB,MAAM;IAAEiB;EAAI,CAAC,GAAGF,QAAQ;EAChC,MAAMG,OAAO,GAAG,IAAAC,iCAAwB,EAACnB,MAAM,CAACE,IAAI,EAAEc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AgB,CAACrB,QAAQ,EAAEC,SAAS,CAAC;IAC5D2B,QAAQ,CAACwB,IAAI,CAACD,QAAQ,CAAC1C,OAAO,CAAC;IAC/BoB,QAAQ,CAACuB,IAAI,CAACD,QAAQ,CAACxC,OAAO,CAAC;EAChC;EAEA,MAAMa,OAAO,CAACiB,UAAU,CAACY,YAAY,CAACzB,QAAQ,CAAC;EAC/C,OAAO;IAAE0B,OAAO,EAAEzB,QAAQ,CAACF,MAAM;IAAEE;EAAS,CAAC;AAC9C","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.clearScope = clearScope;
7
+ exports.ensureCatalog = ensureCatalog;
8
+ exports.listEntries = listEntries;
9
+ exports.markDeleting = markDeleting;
10
+ exports.readEntry = readEntry;
11
+ exports.registerScope = registerScope;
12
+ var _values = require("./values.js");
13
+ /**
14
+ * The catalog: one registry per logical database, listing the scopes that
15
+ * exist.
16
+ *
17
+ * This is the only structure that spans scopes, so it is deliberately the
18
+ * smallest thing that answers the questions the package must answer without
19
+ * opening every scope file. It holds a digest, timestamps, and two posture
20
+ * flags — **no raw scope components** (FR-014), so a device with full disk
21
+ * access cannot mine it for identities or tenant names even though the
22
+ * catalog itself is never encrypted.
23
+ *
24
+ * The `deleting` flag is the load-bearing part. It is written before a scope
25
+ * deletion begins and cleared last, so a crash at any point leaves the
26
+ * interruption visible on the next open. Clearing it first would make an
27
+ * interrupted deletion look complete — the exact failure FR-063 exists to
28
+ * prevent.
29
+ */
30
+
31
+ const CREATE_SCOPES = `CREATE TABLE IF NOT EXISTS scopes (
32
+ scope_key TEXT PRIMARY KEY,
33
+ created_at INTEGER NOT NULL,
34
+ deletion_state TEXT NOT NULL,
35
+ backup_posture TEXT NOT NULL,
36
+ encrypted INTEGER NOT NULL
37
+ )`;
38
+ async function ensureCatalog(connection) {
39
+ await connection.execute(CREATE_SCOPES);
40
+ }
41
+ async function readEntry(connection, scopeKey) {
42
+ const result = await connection.execute('SELECT scope_key, created_at, deletion_state, backup_posture, encrypted FROM scopes WHERE scope_key = ?', [scopeKey]);
43
+ const row = result.rows[0];
44
+ if (!row) {
45
+ return null;
46
+ }
47
+ return {
48
+ scopeKey: (0, _values.text)(row.scope_key),
49
+ createdAt: (0, _values.num)(row.created_at),
50
+ deletionState: (0, _values.text)(row.deletion_state),
51
+ backupPosture: (0, _values.text)(row.backup_posture),
52
+ encrypted: (0, _values.num)(row.encrypted) === 1
53
+ };
54
+ }
55
+ async function listEntries(connection) {
56
+ const result = await connection.execute('SELECT scope_key, created_at, deletion_state, backup_posture, encrypted FROM scopes');
57
+ return result.rows.map(row => ({
58
+ scopeKey: (0, _values.text)(row.scope_key),
59
+ createdAt: (0, _values.num)(row.created_at),
60
+ deletionState: (0, _values.text)(row.deletion_state),
61
+ backupPosture: (0, _values.text)(row.backup_posture),
62
+ encrypted: (0, _values.num)(row.encrypted) === 1
63
+ }));
64
+ }
65
+ async function registerScope(connection, entry) {
66
+ await connection.execute(`INSERT INTO scopes (scope_key, created_at, deletion_state, backup_posture, encrypted)
67
+ VALUES (?, ?, ?, ?, ?)
68
+ ON CONFLICT(scope_key) DO UPDATE SET
69
+ deletion_state = excluded.deletion_state,
70
+ backup_posture = excluded.backup_posture,
71
+ encrypted = excluded.encrypted`, [entry.scopeKey, entry.createdAt, entry.deletionState, entry.backupPosture, entry.encrypted ? 1 : 0]);
72
+ }
73
+ async function markDeleting(connection, scopeKey) {
74
+ await connection.execute('UPDATE scopes SET deletion_state = ? WHERE scope_key = ?', ['deleting', scopeKey]);
75
+ }
76
+
77
+ /** Cleared last, on purpose. See the note at the top of this file. */
78
+ async function clearScope(connection, scopeKey) {
79
+ await connection.execute('DELETE FROM scopes WHERE scope_key = ?', [scopeKey]);
80
+ }
81
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_values","require","CREATE_SCOPES","ensureCatalog","connection","execute","readEntry","scopeKey","result","row","rows","text","scope_key","createdAt","num","created_at","deletionState","deletion_state","backupPosture","backup_posture","encrypted","listEntries","map","registerScope","entry","markDeleting","clearScope"],"sourceRoot":"../../../src","sources":["sqlite/catalog.ts"],"mappings":";;;;;;;;;;;AAoBA,IAAAA,OAAA,GAAAC,OAAA;AApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,MAAMC,aAAa,GAAG;AACtB;AACA;AACA;AACA;AACA;AACA,EAAE;AAEK,eAAeC,aAAaA,CAACC,UAAsB,EAAiB;EAC1E,MAAMA,UAAU,CAACC,OAAO,CAACH,aAAa,CAAC;AACxC;AAEO,eAAeI,SAASA,CAC9BF,UAAsB,EACtBG,QAAgB,EACe;EAC/B,MAAMC,MAAM,GAAG,MAAMJ,UAAU,CAACC,OAAO,CACtC,yGAAyG,EACzG,CAACE,QAAQ,CACV,CAAC;EACD,MAAME,GAAG,GAAGD,MAAM,CAACE,IAAI,CAAC,CAAC,CAAC;EAC1B,IAAI,CAACD,GAAG,EAAE;IACT,OAAO,IAAI;EACZ;EACA,OAAO;IACNF,QAAQ,EAAE,IAAAI,YAAI,EAACF,GAAG,CAACG,SAAS,CAAC;IAC7BC,SAAS,EAAE,IAAAC,WAAG,EAACL,GAAG,CAACM,UAAU,CAAC;IAC9BC,aAAa,EAAE,IAAAL,YAAI,EAACF,GAAG,CAACQ,cAAc,CAAuB;IAC7DC,aAAa,EAAE,IAAAP,YAAI,EAACF,GAAG,CAACU,cAAc,CAA4B;IAClEC,SAAS,EAAE,IAAAN,WAAG,EAACL,GAAG,CAACW,SAAS,CAAC,KAAK;EACnC,CAAC;AACF;AAEO,eAAeC,WAAWA,CAACjB,UAAsB,EAA2B;EAClF,MAAMI,MAAM,GAAG,MAAMJ,UAAU,CAACC,OAAO,CACtC,qFACD,CAAC;EACD,OAAOG,MAAM,CAACE,IAAI,CAACY,GAAG,CAACb,GAAG,KAAK;IAC9BF,QAAQ,EAAE,IAAAI,YAAI,EAACF,GAAG,CAACG,SAAS,CAAC;IAC7BC,SAAS,EAAE,IAAAC,WAAG,EAACL,GAAG,CAACM,UAAU,CAAC;IAC9BC,aAAa,EAAE,IAAAL,YAAI,EAACF,GAAG,CAACQ,cAAc,CAAuB;IAC7DC,aAAa,EAAE,IAAAP,YAAI,EAACF,GAAG,CAACU,cAAc,CAA4B;IAClEC,SAAS,EAAE,IAAAN,WAAG,EAACL,GAAG,CAACW,SAAS,CAAC,KAAK;EACnC,CAAC,CAAC,CAAC;AACJ;AAEO,eAAeG,aAAaA,CAACnB,UAAsB,EAAEoB,KAAmB,EAAiB;EAC/F,MAAMpB,UAAU,CAACC,OAAO,CACvB;AACF;AACA;AACA;AACA;AACA,oCAAoC,EAClC,CACCmB,KAAK,CAACjB,QAAQ,EACdiB,KAAK,CAACX,SAAS,EACfW,KAAK,CAACR,aAAa,EACnBQ,KAAK,CAACN,aAAa,EACnBM,KAAK,CAACJ,SAAS,GAAG,CAAC,GAAG,CAAC,CAEzB,CAAC;AACF;AAEO,eAAeK,YAAYA,CAACrB,UAAsB,EAAEG,QAAgB,EAAiB;EAC3F,MAAMH,UAAU,CAACC,OAAO,CAAC,0DAA0D,EAAE,CACpF,UAAU,EACVE,QAAQ,CACR,CAAC;AACH;;AAEA;AACO,eAAemB,UAAUA,CAACtB,UAAsB,EAAEG,QAAgB,EAAiB;EACzF,MAAMH,UAAU,CAACC,OAAO,CAAC,wCAAwC,EAAE,CAACE,QAAQ,CAAC,CAAC;AAC/E","ignoreList":[]}
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.assertReadable = assertReadable;
7
+ exports.openConnection = openConnection;
8
+ var _errors = require("../contract/errors.js");
9
+ var _errors2 = require("../diagnostics/errors.js");
10
+ var _mapNative = require("../diagnostics/map-native.js");
11
+ var _fs = require("../platform/fs.js");
12
+ var _transactionQueue = require("./transaction-queue.js");
13
+ var _native = require("./native.js");
14
+ /**
15
+ * One connection per database file.
16
+ *
17
+ * Two things about this file carry design weight:
18
+ *
19
+ * **Scope isolation is the file boundary.** A connection is opened against
20
+ * one scope's `data.db`, whose directory is named by the scope digest and
21
+ * never by the components (FR-014). No SQL this package could generate — and
22
+ * none a future bug could generate — reaches another scope's rows, because
23
+ * they are in a file this connection never opened (research.md R2).
24
+ *
25
+ * **A transaction owns the connection while it runs, and only its own
26
+ * executor reaches it.** Every operation queues on the connection, and a
27
+ * transaction holds the queue until it settles. Work issued through the
28
+ * connection meanwhile — a background sync, a second screen — waits and then
29
+ * runs on its own, rather than joining the transaction and vanishing with its
30
+ * rollback. Until 0.2.0 `execute` routed into whatever transaction was in
31
+ * flight, which is how an unrelated write was lost. Work meant to be part of
32
+ * the transaction goes through the executor the transaction hands out
33
+ * (`tx.collection`, `tx.attachments`).
34
+ */
35
+
36
+ /**
37
+ * The executor a transaction body runs against, plus the one control it
38
+ * needs. `rollback` is handed to the body rather than returned from
39
+ * `transaction`, so an explicit abort cannot outlive the transaction it
40
+ * belongs to.
41
+ */
42
+
43
+ function splitPath(path) {
44
+ const index = path.lastIndexOf('/');
45
+ return index === -1 ? {
46
+ location: '',
47
+ name: path
48
+ } : {
49
+ location: path.slice(0, index),
50
+ name: path.slice(index + 1)
51
+ };
52
+ }
53
+ async function openConnection(options) {
54
+ const {
55
+ location,
56
+ name
57
+ } = splitPath(options.path);
58
+ const encrypted = options.encryptionKey !== undefined;
59
+ try {
60
+ await (0, _fs.fileSystem)().mkdir(location);
61
+ } catch (error) {
62
+ (0, _mapNative.raiseNative)(error, {
63
+ operation: 'open'
64
+ });
65
+ }
66
+ let database;
67
+ try {
68
+ database = (0, _native.engine)().open({
69
+ name,
70
+ location,
71
+ // Passing the key only when encryption is on keeps an unencrypted
72
+ // database from being opened as an encrypted one with an empty key,
73
+ // which SQLCipher accepts and which would produce a file neither
74
+ // posture can reopen.
75
+ ...(encrypted ? {
76
+ encryptionKey: options.encryptionKey
77
+ } : {})
78
+ });
79
+ } catch (error) {
80
+ (0, _mapNative.raiseNative)(error, {
81
+ operation: 'open',
82
+ encrypted
83
+ });
84
+ }
85
+ let closed = false;
86
+ let active = null;
87
+ const queue = (0, _transactionQueue.createTransactionQueue)();
88
+ const assertOpen = () => {
89
+ if (closed) {
90
+ (0, _errors2.raise)(_errors.DiagnosticCodes.CLOSED_HANDLE, {
91
+ message: 'connection is closed'
92
+ });
93
+ }
94
+ };
95
+ const classify = sql => /^\s*select|^\s*pragma|^\s*explain/i.test(sql) ? 'read' : 'write';
96
+ const connection = {
97
+ path: options.path,
98
+ encrypted,
99
+ execute(sql, params = []) {
100
+ assertOpen();
101
+ // Never into an in-flight transaction: queued behind it instead. See
102
+ // the note at the top of this file.
103
+ return queue.run(async () => {
104
+ try {
105
+ return await database.execute(sql, params);
106
+ } catch (error) {
107
+ (0, _mapNative.raiseNative)(error, {
108
+ operation: classify(sql),
109
+ encrypted
110
+ });
111
+ }
112
+ });
113
+ },
114
+ async transaction(fn) {
115
+ assertOpen();
116
+ if (active) {
117
+ // Nested transactions would need savepoints and would let a
118
+ // partial rollback look like a full one. Refused rather than
119
+ // queued: a body that opened a second transaction would otherwise
120
+ // wait on itself forever.
121
+ (0, _errors2.raise)(_errors.DiagnosticCodes.TRANSACTION_STATE, {
122
+ message: 'a transaction is already in flight on this connection'
123
+ });
124
+ }
125
+ return queue.runTransaction(async () => {
126
+ try {
127
+ return await database.transaction(async tx => {
128
+ active = tx;
129
+ let settled = false;
130
+ try {
131
+ return await fn({
132
+ execute: (sql, params = []) => {
133
+ if (settled) {
134
+ // After an explicit rollback the body is still running
135
+ // inside the engine's callback. Its remaining statements
136
+ // are refused, not run in autocommit (LDB-V1).
137
+ (0, _errors2.raise)(_errors.DiagnosticCodes.TRANSACTION_STATE, {
138
+ message: 'transaction already rolled back'
139
+ });
140
+ }
141
+ return tx.execute(sql, params);
142
+ },
143
+ rollback: async () => {
144
+ await tx.rollback();
145
+ settled = true;
146
+ }
147
+ });
148
+ } finally {
149
+ active = null;
150
+ }
151
+ });
152
+ } catch (error) {
153
+ (0, _mapNative.raiseNative)(error, {
154
+ operation: 'transaction',
155
+ encrypted
156
+ });
157
+ }
158
+ });
159
+ },
160
+ executeBatch(commands) {
161
+ assertOpen();
162
+ return queue.run(async () => {
163
+ try {
164
+ await database.executeBatch(commands);
165
+ } catch (error) {
166
+ (0, _mapNative.raiseNative)(error, {
167
+ operation: 'write',
168
+ encrypted
169
+ });
170
+ }
171
+ });
172
+ },
173
+ async close() {
174
+ if (closed) {
175
+ return;
176
+ }
177
+ closed = true;
178
+ try {
179
+ await database.close();
180
+ } catch {
181
+ // A close that fails leaves nothing for a caller to do, and
182
+ // reporting it would turn an orderly sign-out into an error.
183
+ }
184
+ }
185
+ };
186
+
187
+ // Write-ahead logging so a reader is not blocked by the writer — FR-045's
188
+ // "reads proceed while a write is in flight" is this pragma plus op-sqlite's
189
+ // single-writer serialization, not a lock this package maintains.
190
+ await connection.execute('PRAGMA journal_mode = WAL');
191
+ await connection.execute('PRAGMA foreign_keys = ON');
192
+ // Durability over speed: a half-written record after a crash is exactly
193
+ // what FR-039 promises never happens.
194
+ await connection.execute('PRAGMA synchronous = FULL');
195
+ return connection;
196
+ }
197
+
198
+ /**
199
+ * Confirm a freshly opened database is readable.
200
+ *
201
+ * Deliberately not `PRAGMA integrity_check`: that walks the whole file and
202
+ * would put open time far past the 150-millisecond budget on a large scope.
203
+ * One trivial read is enough to surface the failures that matter at open —
204
+ * a wrong key, a truncated file, a malformed header — because all three fail
205
+ * it, and the error mapping keeps them distinguishable (FR-076, FR-078).
206
+ */
207
+ async function assertReadable(connection) {
208
+ await connection.execute('SELECT count(*) AS n FROM sqlite_master');
209
+ }
210
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_errors2","_mapNative","_fs","_transactionQueue","_native","splitPath","path","index","lastIndexOf","location","name","slice","openConnection","options","encrypted","encryptionKey","undefined","fileSystem","mkdir","error","raiseNative","operation","database","engine","open","closed","active","queue","createTransactionQueue","assertOpen","raise","DiagnosticCodes","CLOSED_HANDLE","message","classify","sql","test","connection","execute","params","run","transaction","fn","TRANSACTION_STATE","runTransaction","tx","settled","rollback","executeBatch","commands","close","assertReadable"],"sourceRoot":"../../../src","sources":["sqlite/connection.ts"],"mappings":";;;;;;;AAsBA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,GAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AA3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAmBA,SAASM,SAASA,CAACC,IAAY,EAAsC;EACpE,MAAMC,KAAK,GAAGD,IAAI,CAACE,WAAW,CAAC,GAAG,CAAC;EACnC,OAAOD,KAAK,KAAK,CAAC,CAAC,GAChB;IAAEE,QAAQ,EAAE,EAAE;IAAEC,IAAI,EAAEJ;EAAK,CAAC,GAC5B;IAAEG,QAAQ,EAAEH,IAAI,CAACK,KAAK,CAAC,CAAC,EAAEJ,KAAK,CAAC;IAAEG,IAAI,EAAEJ,IAAI,CAACK,KAAK,CAACJ,KAAK,GAAG,CAAC;EAAE,CAAC;AACnE;AAEO,eAAeK,cAAcA,CAACC,OAA8B,EAAuB;EACzF,MAAM;IAAEJ,QAAQ;IAAEC;EAAK,CAAC,GAAGL,SAAS,CAACQ,OAAO,CAACP,IAAI,CAAC;EAClD,MAAMQ,SAAS,GAAGD,OAAO,CAACE,aAAa,KAAKC,SAAS;EAErD,IAAI;IACH,MAAM,IAAAC,cAAU,EAAC,CAAC,CAACC,KAAK,CAACT,QAAQ,CAAC;EACnC,CAAC,CAAC,OAA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,UAAU,CAAC,CAAC;MACZ,OAAOF,KAAK,CAACa,GAAG,CAAC,YAAY;QAC5B,IAAI;UACH,MAAMlB,QAAQ,CAAC0B,YAAY,CAACC,QAAQ,CAAC;QACtC,CAAC,CAAC,OAAO9B,KAAK,EAAE;UACf,IAAAC,sBAAW,EAACD,KAAK,EAAE;YAAEE,SAAS,EAAE,OAAO;YAAEP;UAAU,CAAC,CAAC;QACtD;MACD,CAAC,CAAC;IACH,CAAC;IAED,MAAMoC,KAAKA,CAAA,EAAG;MACb,IAAIzB,MAAM,EAAE;QACX;MACD;MACAA,MAAM,GAAG,IAAI;MACb,IAAI;QACH,MAAMH,QAAQ,CAAC4B,KAAK,CAAC,CAAC;MACvB,CAAC,CAAC,MAAM;QACP;QACA;MAAA;IAEF;EACD,CAAC;;EAED;EACA;EACA;EACA,MAAMb,UAAU,CAACC,OAAO,CAAC,2BAA2B,CAAC;EACrD,MAAMD,UAAU,CAACC,OAAO,CAAC,0BAA0B,CAAC;EACpD;EACA;EACA,MAAMD,UAAU,CAACC,OAAO,CAAC,2BAA2B,CAAC;EAErD,OAAOD,UAAU;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAec,cAAcA,CAACd,UAAsB,EAAiB;EAC3E,MAAMA,UAAU,CAACC,OAAO,CAAC,yCAAyC,CAAC;AACpE","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.explainQuery = explainQuery;
7
+ var _declare = require("../schema/declare.js");
8
+ var _sqlBuilder = require("./sql-builder.js");
9
+ var _rowCodec = require("./row-codec.js");
10
+ /**
11
+ * "Is this query covered by an index?", answered by the engine rather than by
12
+ * inspection of the declarations (FR-037).
13
+ *
14
+ * Reading the schema would answer what the developer intended; `EXPLAIN QUERY
15
+ * PLAN` answers what SQLite will actually do, and the two diverge exactly
16
+ * where it matters — a filter on an indexed field that the planner declines
17
+ * because of a type mismatch or a leading wildcard still reports as "indexed"
18
+ * if you only read declarations.
19
+ *
20
+ * Exposed as a development-mode diagnostic. It runs an extra statement, so an
21
+ * app calling it on every list would pay for it.
22
+ */
23
+
24
+ const SCAN = /\bSCAN\b/i;
25
+ const USING_INDEX = /USING\s+(COVERING\s+)?INDEX\s+"?([A-Za-z0-9_]+)"?/i;
26
+ async function explainQuery(executor, schema, query, sort) {
27
+ const filter = (0, _sqlBuilder.buildFilter)(query?.filter);
28
+ const table = (0, _declare.collectionTable)(schema.name);
29
+ const sql = `EXPLAIN QUERY PLAN SELECT id FROM "${table}" WHERE ${filter.sql} ORDER BY ${(0, _sqlBuilder.buildOrderBy)(sort)}`;
30
+ const result = await executor.execute(sql, filter.params);
31
+ const detail = result.rows.map(row => String(row.detail ?? row.DETAIL ?? '')).filter(Boolean).join('; ');
32
+ const match = USING_INDEX.exec(detail);
33
+ return {
34
+ collection: schema.name,
35
+ usesIndex: match !== null,
36
+ // Reported under the name the app declared, not the collection-scoped
37
+ // name it has in the file.
38
+ indexName: match?.[2] === undefined ? undefined : (0, _rowCodec.declaredIndexName)(schema, match[2]),
39
+ detail: detail || (SCAN.test(detail) ? 'full table scan' : 'the engine returned no plan for this query')
40
+ };
41
+ }
42
+ //# sourceMappingURL=index-coverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_declare","require","_sqlBuilder","_rowCodec","SCAN","USING_INDEX","explainQuery","executor","schema","query","sort","filter","buildFilter","table","collectionTable","name","sql","buildOrderBy","result","execute","params","detail","rows","map","row","String","DETAIL","Boolean","join","match","exec","collection","usesIndex","indexName","undefined","declaredIndexName","test"],"sourceRoot":"../../../src","sources":["sqlite/index-coverage.ts"],"mappings":";;;;;;AAgBA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;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
+ });
6
+ exports.engine = engine;
7
+ exports.isEncryptionAvailable = isEncryptionAvailable;
8
+ exports.setEngine = setEngine;
9
+ var _rnCore = require("@chipmobilesdk/rn-core");
10
+ var _errors = require("../contract/errors.js");
11
+ var _errors2 = require("../diagnostics/errors.js");
12
+ /**
13
+ * The storage engine peer, behind one lazy accessor.
14
+ *
15
+ * Every native call the package makes to SQLite passes through this type.
16
+ * Note what is missing: `executeSync`. op-sqlite ships it, and using it would
17
+ * put a database read on the interface thread — the one thing PERF-001's
18
+ * 16-millisecond rule cannot survive (research.md R9). A surface that cannot
19
+ * express the synchronous call is a stronger guarantee than a review comment.
20
+ */
21
+
22
+ /** Loaded on first use (rn-core's lazy peer); a missing peer is `OPEN_FAILED`. */
23
+ const sqlite = (0, _rnCore.lazyPeer)('@op-engineering/op-sqlite', () => {
24
+ // Inside `try`, so Metro bundles an app that leaves this optional peer out.
25
+ try {
26
+ return require('@op-engineering/op-sqlite');
27
+ } catch (cause) {
28
+ throw cause;
29
+ }
30
+ });
31
+
32
+ /** Swap the engine. Tests only; `null` goes back to the real one. */
33
+ function setEngine(next) {
34
+ sqlite.override(next ?? undefined);
35
+ }
36
+ function engine() {
37
+ return sqlite.require((_peer, cause) => new _errors2.StorageError(_errors.DiagnosticCodes.OPEN_FAILED, {
38
+ message: 'storage engine peer is not installed',
39
+ cause
40
+ }));
41
+ }
42
+
43
+ /**
44
+ * Whether SQLCipher is compiled into this build.
45
+ *
46
+ * A build flag in the consuming app, not a separate peer (research.md R1a).
47
+ * An app that enables encryption without it must fail loudly rather than
48
+ * write plaintext to a file it believes is encrypted.
49
+ */
50
+ function isEncryptionAvailable() {
51
+ const current = engine();
52
+ return typeof current.isSQLCipher === 'function' ? current.isSQLCipher() === true : false;
53
+ }
54
+ //# sourceMappingURL=native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_rnCore","require","_errors","_errors2","sqlite","lazyPeer","cause","setEngine","next","override","undefined","engine","_peer","StorageError","DiagnosticCodes","OPEN_FAILED","message","isEncryptionAvailable","current","isSQLCipher"],"sourceRoot":"../../../src","sources":["sqlite/native.ts"],"mappings":";;;;;;;;AAUA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwCA;AACA,MAAMG,MAAM,GAAG,IAAAC,gBAAQ,EAAC,2BAA2B,EAAE,MAAM;EAC1D;EACA,IAAI;IACH,OAAOJ,OAAO,CAAC,2BAA2B,CAAC;EAC5C,CAAC,CAAC,OAAOK,KAAK,EAAE;IACf,MAAMA,KAAK;EACZ;AACD,CAAC,CAAC;;AAEF;AACO,SAASC,SAASA,CAACC,IAAmB,EAAQ;EACpDJ,MAAM,CAACK,QAAQ,CAACD,IAAI,IAAIE,SAAS,CAAC;AACnC;AAEO,SAASC,MAAMA,CAAA,EAAW;EAChC,OAAOP,MAAM,CAACH,OAAO,CACpB,CAACW,KAAK,EAAEN,KAAK,KACZ,IAAIO,qBAAY,CAACC,uBAAe,CAACC,WAAW,EAAE;IAC7CC,OAAO,EAAE,sCAAsC;IAC/CV;EACD,CAAC,CACH,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASW,qBAAqBA,CAAA,EAAY;EAChD,MAAMC,OAAO,GAAGP,MAAM,CAAC,CAAC;EACxB,OAAO,OAAOO,OAAO,CAACC,WAAW,KAAK,UAAU,GAAGD,OAAO,CAACC,WAAW,CAAC,CAAC,KAAK,IAAI,GAAG,KAAK;AAC1F","ignoreList":[]}
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RESERVED_COLUMNS = void 0;
7
+ exports.addColumnSql = addColumnSql;
8
+ exports.createIndexSql = createIndexSql;
9
+ exports.createTableSql = createTableSql;
10
+ exports.declaredIndexName = declaredIndexName;
11
+ exports.decodeRow = decodeRow;
12
+ exports.encodePayload = encodePayload;
13
+ exports.insertColumns = insertColumns;
14
+ exports.physicalIndexName = physicalIndexName;
15
+ exports.projectValue = projectValue;
16
+ exports.projectedColumnNames = projectedColumnNames;
17
+ exports.projectedValues = projectedValues;
18
+ exports.updateAssignments = updateAssignments;
19
+ var _declare = require("../schema/declare.js");
20
+ var _values = require("./values.js");
21
+ /**
22
+ * Table shape, and the payload-as-truth rule.
23
+ *
24
+ * Every read reconstructs the record from `payload` alone. The projected
25
+ * `f_*` columns are written on every write and consulted only by `WHERE` and
26
+ * `ORDER BY` — never by a read path (research.md R6).
27
+ *
28
+ * That single rule is what makes two requirements structural rather than
29
+ * carefully maintained. FR-018's byte fidelity holds because nothing else is
30
+ * consulted to rebuild a record, and FR-019's explicit-null versus
31
+ * absent-field distinction holds because a NULL projected column cannot be
32
+ * ambiguous if no read ever looks at it.
33
+ */
34
+
35
+ const RESERVED_COLUMNS = exports.RESERVED_COLUMNS = ['id', 'payload', 'created_at', 'updated_at', 'deleted_at'];
36
+
37
+ /** SQLite affinity for a declared field type. */
38
+ function affinityOf(field) {
39
+ switch (field.type) {
40
+ case 'number':
41
+ case 'timestamp':
42
+ return 'REAL';
43
+ case 'boolean':
44
+ return 'INTEGER';
45
+ case 'string':
46
+ default:
47
+ return 'TEXT';
48
+ }
49
+ }
50
+ function createTableSql(schema) {
51
+ const columns = ['id TEXT PRIMARY KEY', 'payload TEXT NOT NULL', 'created_at INTEGER', 'updated_at INTEGER', 'deleted_at INTEGER', ...(schema.fields ?? []).map(field => `"${(0, _declare.projectedColumn)(field.name)}" ${affinityOf(field)}`)];
52
+ return `CREATE TABLE IF NOT EXISTS "${(0, _declare.collectionTable)(schema.name)}" (${columns.join(', ')})`;
53
+ }
54
+ function addColumnSql(schema, field) {
55
+ return `ALTER TABLE "${(0, _declare.collectionTable)(schema.name)}" ADD COLUMN "${(0, _declare.projectedColumn)(field.name)}" ${affinityOf(field)}`;
56
+ }
57
+
58
+ /**
59
+ * The name an index has in the database file.
60
+ *
61
+ * Index names are database-wide in SQLite, but declared per collection. Until
62
+ * 0.2.0 the declared name was used as is, so a second collection declaring an
63
+ * index of the same name hit `IF NOT EXISTS` and silently got no index — a
64
+ * UNIQUE constraint included. The double underscore keeps a declared name from
65
+ * colliding with the package's own `<table>_live` index.
66
+ */
67
+ function physicalIndexName(schema, declaredName) {
68
+ return `${(0, _declare.collectionTable)(schema.name)}__${declaredName}`;
69
+ }
70
+
71
+ /** The declared name back from a physical one, for reporting to the app. */
72
+ function declaredIndexName(schema, physicalName) {
73
+ const prefix = `${(0, _declare.collectionTable)(schema.name)}__`;
74
+ return physicalName.startsWith(prefix) ? physicalName.slice(prefix.length) : physicalName;
75
+ }
76
+ function createIndexSql(schema) {
77
+ const table = (0, _declare.collectionTable)(schema.name);
78
+ const statements = (schema.indexes ?? []).map(index => {
79
+ const columns = index.fields.map(field => `"${(0, _declare.projectedColumn)(field)}"`).join(', ');
80
+ return `CREATE ${index.unique ? 'UNIQUE ' : ''}INDEX IF NOT EXISTS "${physicalIndexName(schema, index.name)}" ON "${table}" (${columns})`;
81
+ });
82
+ if ((0, _declare.hasSoftDelete)(schema)) {
83
+ // Every default query carries `deleted_at IS NULL`, so without this the
84
+ // exclusion turns the cheapest possible filter into a full scan.
85
+ statements.push(`CREATE INDEX IF NOT EXISTS "${table}_live" ON "${table}" (deleted_at)`);
86
+ }
87
+ return statements;
88
+ }
89
+
90
+ /**
91
+ * Project a declared field for the WHERE and ORDER BY columns.
92
+ *
93
+ * Anything that is not a comparable primitive projects to NULL. A nested
94
+ * object has no defensible ordering, and inventing one would make a filter
95
+ * silently match records a consumer never meant to select.
96
+ */
97
+ function projectValue(data, field) {
98
+ if (!Object.prototype.hasOwnProperty.call(data, field.name)) {
99
+ return null;
100
+ }
101
+ const value = data[field.name];
102
+ if (value === null) {
103
+ return null;
104
+ }
105
+ switch (typeof value) {
106
+ case 'boolean':
107
+ return value ? 1 : 0;
108
+ case 'number':
109
+ return Number.isFinite(value) ? value : null;
110
+ case 'string':
111
+ return value;
112
+ default:
113
+ return null;
114
+ }
115
+ }
116
+ function projectedValues(schema, data) {
117
+ return (schema.fields ?? []).map(field => projectValue(data, field));
118
+ }
119
+ function projectedColumnNames(schema) {
120
+ return (schema.fields ?? []).map(field => (0, _declare.projectedColumn)(field.name));
121
+ }
122
+
123
+ /** Serialize on the way in, so a caller mutating its object cannot change
124
+ * what is stored (FR-022). */
125
+ function encodePayload(data) {
126
+ return JSON.stringify(data ?? {});
127
+ }
128
+ /**
129
+ * Rebuild a record from the payload column and nothing else.
130
+ *
131
+ * The timestamp and soft-delete fields are surfaced only when the collection
132
+ * declared them, so a consumer cannot come to depend on a field the schema
133
+ * never promised.
134
+ */
135
+ function decodeRow(schema, row) {
136
+ const record = {
137
+ id: (0, _values.text)(row.id),
138
+ data: JSON.parse((0, _values.text)(row.payload))
139
+ };
140
+ if ((0, _declare.hasTimestamps)(schema)) {
141
+ if (row.created_at != null) {
142
+ record.createdAt = (0, _values.num)(row.created_at);
143
+ }
144
+ if (row.updated_at != null) {
145
+ record.updatedAt = (0, _values.num)(row.updated_at);
146
+ }
147
+ }
148
+ if ((0, _declare.hasSoftDelete)(schema)) {
149
+ record.deletedAt = row.deleted_at == null ? null : (0, _values.num)(row.deleted_at);
150
+ }
151
+ return record;
152
+ }
153
+ function insertColumns(schema, id, data, now, /** The payload already serialized by the budget check, to avoid a second pass. */
154
+ payload = encodePayload(data)) {
155
+ const columns = ['id', 'payload'];
156
+ const values = [id, payload];
157
+ if ((0, _declare.hasTimestamps)(schema)) {
158
+ columns.push('created_at', 'updated_at');
159
+ values.push(now, now);
160
+ }
161
+ if ((0, _declare.hasSoftDelete)(schema)) {
162
+ columns.push('deleted_at');
163
+ values.push(null);
164
+ }
165
+ const projected = projectedValues(schema, data);
166
+ for (const [index, name] of projectedColumnNames(schema).entries()) {
167
+ columns.push(name);
168
+ values.push(projected[index]);
169
+ }
170
+ return {
171
+ columns,
172
+ values
173
+ };
174
+ }
175
+ function updateAssignments(schema, data, now, payload = encodePayload(data)) {
176
+ const columns = ['payload'];
177
+ const values = [payload];
178
+ if ((0, _declare.hasTimestamps)(schema)) {
179
+ columns.push('updated_at');
180
+ values.push(now);
181
+ }
182
+ const projected = projectedValues(schema, data);
183
+ for (const [index, name] of projectedColumnNames(schema).entries()) {
184
+ columns.push(name);
185
+ values.push(projected[index]);
186
+ }
187
+ return {
188
+ columns,
189
+ values
190
+ };
191
+ }
192
+ //# sourceMappingURL=row-codec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_declare","require","_values","RESERVED_COLUMNS","exports","affinityOf","field","type","createTableSql","schema","columns","fields","map","projectedColumn","name","collectionTable","join","addColumnSql","physicalIndexName","declaredName","declaredIndexName","physicalName","prefix","startsWith","slice","length","createIndexSql","table","statements","indexes","index","unique","hasSoftDelete","push","projectValue","data","Object","prototype","hasOwnProperty","call","value","Number","isFinite","projectedValues","projectedColumnNames","encodePayload","JSON","stringify","decodeRow","row","record","id","text","parse","payload","hasTimestamps","created_at","createdAt","num","updated_at","updatedAt","deletedAt","deleted_at","insertColumns","now","values","projected","entries","updateAssignments"],"sourceRoot":"../../../src","sources":["sqlite/row-codec.ts"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQO,MAAME,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;;AAE3F;AACA,SAASE,UAAUA,CAACC,KAAuB,EAAU;EACpD,QAAQA,KAAK,CAACC,IAAI;IACjB,KAAK,QAAQ;IACb,KAAK,WAAW;MACf,OAAO,MAAM;IACd,KAAK,SAAS;MACb,OAAO,SAAS;IACjB,KAAK,QAAQ;IACb;MACC,O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