@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,107 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.collectionMap = collectionMap;
7
+ exports.databaseFor = databaseFor;
8
+ exports.decodePayload = decodePayload;
9
+ exports.dropDatabase = dropDatabase;
10
+ exports.dropScope = dropScope;
11
+ exports.encodePayload = encodePayload;
12
+ exports.existingScopeStore = existingScopeStore;
13
+ exports.resetAllMemoryStores = resetAllMemoryStores;
14
+ exports.scopeStoreFor = scopeStoreFor;
15
+ exports.toStoredRecord = toStoredRecord;
16
+ /**
17
+ * The in-memory store behind the test adapter.
18
+ *
19
+ * Scope isolation is structural here for the same reason it is on device: one
20
+ * store per scope, held in a registry keyed by scope digest. A handle holds a
21
+ * reference to its own store and has no way to reach another (FR-011).
22
+ */
23
+
24
+ const databases = new Map();
25
+ function databaseFor(name) {
26
+ let database = databases.get(name);
27
+ if (!database) {
28
+ database = {
29
+ name,
30
+ scopes: new Map()
31
+ };
32
+ databases.set(name, database);
33
+ }
34
+ return database;
35
+ }
36
+ function scopeStoreFor(name, scopeKey) {
37
+ const database = databaseFor(name);
38
+ let store = database.scopes.get(scopeKey);
39
+ if (!store) {
40
+ store = {
41
+ scopeKey,
42
+ schemaVersion: 0,
43
+ ledger: new Map(),
44
+ collections: new Map(),
45
+ attachments: new Map(),
46
+ artifacts: new Map(),
47
+ deletionState: 'active',
48
+ encrypted: false,
49
+ backupIncluded: false
50
+ };
51
+ database.scopes.set(scopeKey, store);
52
+ }
53
+ return store;
54
+ }
55
+ function existingScopeStore(name, scopeKey) {
56
+ return databases.get(name)?.scopes.get(scopeKey);
57
+ }
58
+ function dropScope(name, scopeKey) {
59
+ databases.get(name)?.scopes.delete(scopeKey);
60
+ }
61
+ function dropDatabase(name) {
62
+ databases.delete(name);
63
+ }
64
+
65
+ /** Between tests (FR-093). */
66
+ function resetAllMemoryStores() {
67
+ databases.clear();
68
+ }
69
+ function collectionMap(store, collection) {
70
+ let rows = store.collections.get(collection);
71
+ if (!rows) {
72
+ rows = new Map();
73
+ store.collections.set(collection, rows);
74
+ }
75
+ return rows;
76
+ }
77
+
78
+ /**
79
+ * Deep copy through serialization on the way in and out.
80
+ *
81
+ * The same discipline as the SQLite adapter's payload column: a consumer that
82
+ * mutates the object it handed us must not change what is stored (FR-022),
83
+ * and what we hand back must not be a live reference into the store.
84
+ */
85
+ function encodePayload(data) {
86
+ return JSON.stringify(data ?? {});
87
+ }
88
+ function decodePayload(payload) {
89
+ return JSON.parse(payload);
90
+ }
91
+ function toStoredRecord(row) {
92
+ const record = {
93
+ id: row.id,
94
+ data: decodePayload(row.payload)
95
+ };
96
+ if (row.createdAt !== undefined) {
97
+ record.createdAt = row.createdAt;
98
+ }
99
+ if (row.updatedAt !== undefined) {
100
+ record.updatedAt = row.updatedAt;
101
+ }
102
+ if (row.deletedAt !== undefined) {
103
+ record.deletedAt = row.deletedAt;
104
+ }
105
+ return record;
106
+ }
107
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["databases","Map","databaseFor","name","database","get","scopes","set","scopeStoreFor","scopeKey","store","schemaVersion","ledger","collections","attachments","artifacts","deletionState","encrypted","backupIncluded","existingScopeStore","dropScope","delete","dropDatabase","resetAllMemoryStores","clear","collectionMap","collection","rows","encodePayload","data","JSON","stringify","decodePayload","payload","parse","toStoredRecord","row","record","id","createdAt","undefined","updatedAt","deletedAt"],"sourceRoot":"../../../../src","sources":["testing/memory-adapter/store.ts"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA,MAAMA,SAAS,GAAG,IAAIC,GAAG,CAAyB,CAAC;AAE5C,SAASC,WAAWA,CAACC,IAAY,EAAkB;EACzD,IAAIC,QAAQ,GAAGJ,SAAS,CAACK,GAAG,CAACF,IAAI,CAAC;EAClC,IAAI,CAACC,QAAQ,EAAE;IACdA,QAAQ,GAAG;MAAED,IAAI;MAAEG,MAAM,EAAE,IAAIL,GAAG,CAAC;IAAE,CAAC;IACtCD,SAAS,CAACO,GAAG,CAACJ,IAAI,EAAEC,QAAQ,CAAC;EAC9B;EACA,OAAOA,QAAQ;AAChB;AAEO,SAASI,aAAaA,CAACL,IAAY,EAAEM,QAAgB,EAAoB;EAC/E,MAAML,QAAQ,GAAGF,WAAW,CAACC,IAAI,CAAC;EAClC,IAAIO,KAAK,GAAGN,QAAQ,CAACE,MAAM,CAACD,GAAG,CAACI,QAAQ,CAAC;EACzC,IAAI,CAACC,KAAK,EAAE;IACXA,KAAK,GAAG;MACPD,QAAQ;MACRE,aAAa,EAAE,CAAC;MAChBC,MAAM,EAAE,IAAIX,GAAG,CAAC,CAAC;MACjBY,WAAW,EAAE,IAAIZ,GAAG,CAAC,CAAC;MACtBa,WAAW,EAAE,IAAIb,GAAG,CAAC,CAAC;MACtBc,SAAS,EAAE,IAAId,GAAG,CAAC,CAAC;MACpBe,aAAa,EAAE,QAAQ;MACvBC,SAAS,EAAE,KAAK;MAChBC,cAAc,EAAE;IACjB,CAAC;IACDd,QAAQ,CAACE,MAAM,CAACC,GAAG,CAACE,QAAQ,EAAEC,KAAK,CAAC;EACrC;EACA,OAAOA,KAAK;AACb;AAEO,SAASS,kBAAkBA,CAAChB,IAAY,EAAEM,QAAgB,EAAgC;EAChG,OAAOT,SAAS,CAACK,GAAG,CAACF,IAAI,CAAC,EAA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AS,KAAKD,SAAS,EAAE;IAChCH,MAAM,CAACI,SAAS,GAAGL,GAAG,CAACK,SAAS;EACjC;EACA,IAAIL,GAAG,CAACM,SAAS,KAAKF,SAAS,EAAE;IAChCH,MAAM,CAACK,SAAS,GAAGN,GAAG,CAACM,SAAS;EACjC;EACA,OAAOL,MAAM;AACd","ignoreList":[]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Where the FR-088 budgets are actually enforced.
5
+ *
6
+ * The checks live in `query/budgets.ts` so both adapters share them; this
7
+ * module is the adapter-layer entry point, and exists so there is one place
8
+ * to answer "which budgets are hard?" — per-record size, batch size, page
9
+ * size, and artifact size, each with a typed error (FR-088a).
10
+ *
11
+ * The rest are soft by design. Exceeding 100,000 records in a collection is
12
+ * slow, not an error, and refusing the 100,001st write would destroy data an
13
+ * app already holds. Degraded behavior is documented in the README instead.
14
+ */
15
+
16
+ import { Budgets } from "../contract/config.js";
17
+ import { DiagnosticCodes } from "../contract/errors.js";
18
+ import { raise } from "../diagnostics/errors.js";
19
+ import { assertArtifactWithinBudget, assertBatchWithinBudget, assertRecordWithinBudget, serializedSize } from "../query/budgets.js";
20
+ export { assertArtifactWithinBudget, assertBatchWithinBudget, assertRecordWithinBudget, serializedSize };
21
+
22
+ /**
23
+ * Concurrently open handles.
24
+ *
25
+ * Each one holds a native connection and its write-ahead log, so an app that
26
+ * leaks handles runs out of file descriptors rather than slowing down. Eight
27
+ * is generous for the multi-identity case FR-008b describes and low enough
28
+ * that a leak surfaces during development instead of in the field.
29
+ */
30
+ let openHandles = 0;
31
+ export function acquireHandleSlot() {
32
+ if (openHandles >= Budgets.MAX_OPEN_HANDLES) {
33
+ raise(DiagnosticCodes.OPEN_FAILED, {
34
+ message: 'too many database handles are open',
35
+ detail: {
36
+ count: openHandles,
37
+ limit: Budgets.MAX_OPEN_HANDLES
38
+ }
39
+ });
40
+ }
41
+ openHandles += 1;
42
+ }
43
+ export function releaseHandleSlot() {
44
+ openHandles = Math.max(0, openHandles - 1);
45
+ }
46
+
47
+ /** Between tests. */
48
+ export function resetHandleSlots() {
49
+ openHandles = 0;
50
+ }
51
+ //# sourceMappingURL=budgets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Budgets","DiagnosticCodes","raise","assertArtifactWithinBudget","assertBatchWithinBudget","assertRecordWithinBudget","serializedSize","openHandles","acquireHandleSlot","MAX_OPEN_HANDLES","OPEN_FAILED","message","detail","count","limit","releaseHandleSlot","Math","max","resetHandleSlots"],"sourceRoot":"../../../src","sources":["adapter/budgets.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,uBAAoB;AAC5C,SAASC,eAAe,QAAQ,uBAAoB;AACpD,SAASC,KAAK,QAAQ,0BAAuB;AAC7C,SACCC,0BAA0B,EAC1BC,uBAAuB,EACvBC,wBAAwB,EACxBC,cAAc,QACR,qBAAkB;AAEzB,SACCH,0BAA0B,EAC1BC,uBAAuB,EACvBC,wBAAwB,EACxBC,cAAc;;AAGf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,WAAW,GAAG,CAAC;AAEnB,OAAO,SAASC,iBAAiBA,CAAA,EAAS;EACzC,IAAID,WAAW,IAAIP,OAAO,CAACS,gBAAgB,EAAE;IAC5CP,KAAK,CAACD,eAAe,CAACS,WAAW,EAAE;MAClCC,OAAO,EAAE,oCAAoC;MAC7CC,MAAM,EAAE;QAAEC,KAAK,EAAEN,WAAW;QAAEO,KAAK,EAAEd,OAAO,CAACS;MAAiB;IAC/D,CAAC,CAAC;EACH;EACAF,WAAW,IAAI,CAAC;AACjB;AAEA,OAAO,SAASQ,iBAAiBA,CAAA,EAAS;EACzCR,WAAW,GAAGS,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEV,WAAW,GAAG,CAAC,CAAC;AAC3C;;AAEA;AACA,OAAO,SAASW,gBAAgBA,CAAA,EAAS;EACxCX,WAAW,GAAG,CAAC;AAChB","ignoreList":[]}
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Collection operations against a SQLite executor.
5
+ *
6
+ * The executor is either the connection or the transaction in flight on it,
7
+ * which is what gives read-your-own-writes for free (FR-043): a read inside a
8
+ * transaction runs on the same handle that made the writes, so it sees them,
9
+ * and a reader outside does not.
10
+ *
11
+ * Every semantic decision that could differ between the two adapters —
12
+ * which operators mean what, how nulls sort, what a cursor points at — is
13
+ * delegated to `query/`. This file decides only how to say it in SQL.
14
+ */
15
+
16
+ import { DiagnosticCodes } from "../contract/errors.js";
17
+ import { raise } from "../diagnostics/errors.js";
18
+ import { throwIfFaulted } from "../diagnostics/faults.js";
19
+ import { decodeCursor } from "../query/cursor.js";
20
+ import { buildPage, fetchLimitFor, resolvePageSize } from "../query/paginate.js";
21
+ import { withStableTiebreaker } from "../query/sort.js";
22
+ import { validateQuery } from "../query/validate.js";
23
+ import { collectionTable, hasSoftDelete } from "../schema/declare.js";
24
+ import { decodeRow } from "../sqlite/row-codec.js";
25
+ import { buildFilter, buildKeysetPredicate, buildOrderBy } from "../sqlite/sql-builder.js";
26
+ import { insertStatement, updateStatement } from "../sqlite/statements.js";
27
+ import { assertRecordWithinBudget } from "./budgets.js";
28
+ const LIVE = 'deleted_at IS NULL';
29
+ function notFound(collection, id) {
30
+ raise(DiagnosticCodes.RECORD_NOT_FOUND, {
31
+ message: 'record not found',
32
+ detail: {
33
+ collection,
34
+ recordId: id
35
+ }
36
+ });
37
+ }
38
+ export function createSqlCollection(context) {
39
+ const {
40
+ schema
41
+ } = context;
42
+ const table = `"${collectionTable(schema.name)}"`;
43
+ const selectColumns = ['id', 'payload', 'created_at', 'updated_at', 'deleted_at'].join(', ');
44
+ async function rowById(id, includeDeleted = false) {
45
+ const result = await context.executor().execute(`SELECT ${selectColumns} FROM ${table} WHERE id = ?${includeDeleted ? '' : ` AND ${LIVE}`}`, [id]);
46
+ return result.rows[0];
47
+ }
48
+ return {
49
+ async insert(record) {
50
+ context.assertUsable();
51
+ throwIfFaulted('write');
52
+ const payload = assertRecordWithinBudget(schema.name, record.data);
53
+
54
+ // One statement: a row that is already there is left untouched and
55
+ // reported, instead of a SELECT first and an INSERT after (LDB-08). The
56
+ // failure stays boring — nothing was written, and no engine error
57
+ // surfaces from inside a transaction.
58
+ const result = await context.executor().execute(...insertStatement(schema, record.id, record.data, context.now(), payload, 'ignore'));
59
+ if (result.rowsAffected === 0) {
60
+ raise(DiagnosticCodes.RECORD_CONFLICT, {
61
+ message: 'record already exists',
62
+ detail: {
63
+ collection: schema.name,
64
+ recordId: record.id
65
+ }
66
+ });
67
+ }
68
+ return {
69
+ operation: 'created',
70
+ id: record.id
71
+ };
72
+ },
73
+ async update(id, record) {
74
+ context.assertUsable();
75
+ throwIfFaulted('write');
76
+ const payload = assertRecordWithinBudget(schema.name, record.data);
77
+ const result = await context.executor().execute(...updateStatement(schema, id, record.data, context.now(), payload, {
78
+ liveOnly: true
79
+ }));
80
+ if (result.rowsAffected === 0) {
81
+ // Creating the record instead would be a silent write to an id
82
+ // the caller believed already existed.
83
+ notFound(schema.name, id);
84
+ }
85
+ return {
86
+ operation: 'updated',
87
+ id
88
+ };
89
+ },
90
+ async upsert(record) {
91
+ context.assertUsable();
92
+ throwIfFaulted('write');
93
+ const payload = assertRecordWithinBudget(schema.name, record.data);
94
+ const now = context.now();
95
+
96
+ // An upsert over a soft-deleted record brings it back: the caller
97
+ // asked for this id to hold this data.
98
+ const update = async () => {
99
+ const result = await context.executor().execute(...updateStatement(schema, record.id, record.data, now, payload, {
100
+ restore: true
101
+ }));
102
+ return result.rowsAffected > 0;
103
+ };
104
+
105
+ // The update is tried first: one round-trip for a record that exists,
106
+ // with no SELECT before it (LDB-08).
107
+ if (await update()) {
108
+ return {
109
+ operation: 'updated',
110
+ id: record.id
111
+ };
112
+ }
113
+ const inserted = await context.executor().execute(...insertStatement(schema, record.id, record.data, now, payload, 'ignore'));
114
+ if (inserted.rowsAffected > 0) {
115
+ return {
116
+ operation: 'created',
117
+ id: record.id
118
+ };
119
+ }
120
+ // Another write created the row between the two statements.
121
+ await update();
122
+ return {
123
+ operation: 'updated',
124
+ id: record.id
125
+ };
126
+ },
127
+ async get(id) {
128
+ context.assertUsable();
129
+ throwIfFaulted('read');
130
+ const row = await rowById(id);
131
+ if (!row) {
132
+ notFound(schema.name, id);
133
+ }
134
+ return decodeRow(schema, row);
135
+ },
136
+ async find(id) {
137
+ context.assertUsable();
138
+ throwIfFaulted('read');
139
+ const row = await rowById(id);
140
+ return row ? decodeRow(schema, row) : null;
141
+ },
142
+ async delete(id) {
143
+ context.assertUsable();
144
+ throwIfFaulted('write');
145
+ const result = await context.executor().execute(`DELETE FROM ${table} WHERE id = ?`, [id]);
146
+ if (result.rowsAffected === 0) {
147
+ notFound(schema.name, id);
148
+ }
149
+ return {
150
+ operation: 'deleted',
151
+ id
152
+ };
153
+ },
154
+ async softDelete(id) {
155
+ context.assertUsable();
156
+ throwIfFaulted('write');
157
+ if (!hasSoftDelete(schema)) {
158
+ raise(DiagnosticCodes.CONFIG_INVALID, {
159
+ message: 'collection does not declare soft delete',
160
+ detail: {
161
+ collection: schema.name
162
+ }
163
+ });
164
+ }
165
+ const result = await context.executor().execute(`UPDATE ${table} SET deleted_at = ? WHERE id = ? AND ${LIVE}`, [context.now(), id]);
166
+ if (result.rowsAffected === 0) {
167
+ notFound(schema.name, id);
168
+ }
169
+ return {
170
+ operation: 'deleted',
171
+ id
172
+ };
173
+ },
174
+ async restore(id) {
175
+ context.assertUsable();
176
+ throwIfFaulted('write');
177
+ if (!hasSoftDelete(schema)) {
178
+ raise(DiagnosticCodes.CONFIG_INVALID, {
179
+ message: 'collection does not declare soft delete',
180
+ detail: {
181
+ collection: schema.name
182
+ }
183
+ });
184
+ }
185
+ const result = await context.executor().execute(`UPDATE ${table} SET deleted_at = NULL WHERE id = ? AND deleted_at IS NOT NULL`, [id]);
186
+ if (result.rowsAffected === 0) {
187
+ notFound(schema.name, id);
188
+ }
189
+ return {
190
+ operation: 'restored',
191
+ id
192
+ };
193
+ },
194
+ async list(query) {
195
+ context.assertUsable();
196
+ throwIfFaulted('read');
197
+ validateQuery(schema, query);
198
+ const sort = withStableTiebreaker(query?.sort);
199
+ const size = resolvePageSize(query?.page);
200
+ const filter = buildFilter(query?.filter);
201
+ const clauses = [filter.sql];
202
+ const params = [...filter.params];
203
+ if (query?.includeSoftDeleted !== true) {
204
+ clauses.push(LIVE);
205
+ }
206
+ if (query?.page?.cursor) {
207
+ const keyset = buildKeysetPredicate(sort, decodeCursor(query.page.cursor, sort));
208
+ clauses.push(keyset.sql);
209
+ params.push(...keyset.params);
210
+ }
211
+
212
+ // One row past the page, so `hasMore` is answered without a second
213
+ // query that could disagree with the first under a concurrent write.
214
+ const limit = fetchLimitFor(size);
215
+ const result = await context.executor().execute(`SELECT ${selectColumns} FROM ${table} WHERE ${clauses.join(' AND ')} ORDER BY ${buildOrderBy(sort)} LIMIT ?`, [...params, limit]);
216
+ return buildPage(result.rows.map(row => decodeRow(schema, row)), sort, size);
217
+ },
218
+ async count(filter) {
219
+ context.assertUsable();
220
+ throwIfFaulted('read');
221
+ if (filter) {
222
+ validateQuery(schema, {
223
+ filter
224
+ });
225
+ }
226
+ const built = buildFilter(filter);
227
+ const result = await context.executor().execute(`SELECT count(*) AS total FROM ${table} WHERE ${built.sql} AND ${LIVE}`, built.params);
228
+ return Number(result.rows[0]?.total ?? 0);
229
+ }
230
+ };
231
+ }
232
+ //# sourceMappingURL=collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DiagnosticCodes","raise","throwIfFaulted","decodeCursor","buildPage","fetchLimitFor","resolvePageSize","withStableTiebreaker","validateQuery","collectionTable","hasSoftDelete","decodeRow","buildFilter","buildKeysetPredicate","buildOrderBy","insertStatement","updateStatement","assertRecordWithinBudget","LIVE","notFound","collection","id","RECORD_NOT_FOUND","message","detail","recordId","createSqlCollection","context","schema","table","name","selectColumns","join","rowById","includeDeleted","result","executor","execute","rows","insert","record","assertUsable","payload","data","now","rowsAffected","RECORD_CONFLICT","operation","update","liveOnly","upsert","restore","inserted","get","row","find","delete","softDelete","CONFIG_INVALID","list","query","sort","size","page","filter","clauses","sql","params","includeSoftDeleted","push","cursor","keyset","limit","map","count","built","Number","total"],"sourceRoot":"../../../src","sources":["adapter/collection.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,uBAAoB;AAUpD,SAASC,KAAK,QAAQ,0BAAuB;AAC7C,SAASC,cAAc,QAAQ,0BAAuB;AACtD,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SAASC,SAAS,EAAEC,aAAa,EAAEC,eAAe,QAAQ,sBAAmB;AAC7E,SAASC,oBAAoB,QAAQ,kBAAe;AACpD,SAASC,aAAa,QAAQ,sBAAmB;AACjD,SAASC,eAAe,EAAEC,aAAa,QAAQ,sBAAmB;AAGlE,SAASC,SAAS,QAAQ,wBAAqB;AAC/C,SAASC,WAAW,EAAEC,oBAAoB,EAAEC,YAAY,QAAQ,0BAAuB;AACvF,SAASC,eAAe,EAAEC,eAAe,QAAQ,yBAAsB;AACvE,SAASC,wBAAwB,QAAQ,cAAW;AAUpD,MAAMC,IAAI,GAAG,oBAAoB;AAEjC,SAASC,QAAQA,CAACC,UAAkB,EAAEC,EAAU,EAAS;EACxDpB,KAAK,CAACD,eAAe,CAACsB,gBAAgB,EAAE;IACvCC,OAAO,EAAE,kBAAkB;IAC3BC,MAAM,EAAE;MAAEJ,UAAU;MAAEK,QAAQ,EAAEJ;IAAG;EACpC,CAAC,CAAC;AACH;AAEA,OAAO,SAASK,mBAAmBA,CAClCC,OAA6B,EACV;EACnB,MAAM;IAAEC;EAAO,CAAC,GAAGD,OAAO;EAC1B,MAAME,KAAK,GAAG,IAAIpB,eAAe,CAACmB,MAAM,CAACE,IAAI,CAAC,GAAG;EAEjD,MAAMC,aAAa,GAAG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