@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.
- package/CHANGELOG.md +137 -0
- package/README.md +69 -8
- package/lib/commonjs/adapter/budgets.js +79 -0
- package/lib/commonjs/adapter/budgets.js.map +1 -0
- package/lib/commonjs/adapter/collection.js +236 -0
- package/lib/commonjs/adapter/collection.js.map +1 -0
- package/lib/commonjs/adapter/deletion.js +291 -0
- package/lib/commonjs/adapter/deletion.js.map +1 -0
- package/lib/commonjs/adapter/handle.js +259 -0
- package/lib/commonjs/adapter/handle.js.map +1 -0
- package/lib/commonjs/adapter/index.js +67 -0
- package/lib/commonjs/adapter/index.js.map +1 -0
- package/lib/commonjs/adapter/lifecycle.js +176 -0
- package/lib/commonjs/adapter/lifecycle.js.map +1 -0
- package/lib/commonjs/adapter/schema-sync.js +124 -0
- package/lib/commonjs/adapter/schema-sync.js.map +1 -0
- package/lib/commonjs/adapter/transaction.js +58 -0
- package/lib/commonjs/adapter/transaction.js.map +1 -0
- package/lib/commonjs/artifacts/availability.js +90 -0
- package/lib/commonjs/artifacts/availability.js.map +1 -0
- package/lib/commonjs/artifacts/cascade.js +80 -0
- package/lib/commonjs/artifacts/cascade.js.map +1 -0
- package/lib/commonjs/artifacts/paths.js +31 -0
- package/lib/commonjs/artifacts/paths.js.map +1 -0
- package/lib/commonjs/artifacts/reconcile.js +55 -0
- package/lib/commonjs/artifacts/reconcile.js.map +1 -0
- package/lib/commonjs/artifacts/store.js +300 -0
- package/lib/commonjs/artifacts/store.js.map +1 -0
- package/lib/commonjs/contract/adapter.js +6 -0
- package/lib/commonjs/contract/adapter.js.map +1 -0
- package/lib/commonjs/contract/attachment.js +2 -0
- package/lib/commonjs/contract/attachment.js.map +1 -0
- package/lib/commonjs/contract/backup.js +2 -0
- package/lib/commonjs/contract/backup.js.map +1 -0
- package/lib/commonjs/contract/config.js +31 -0
- package/lib/commonjs/contract/config.js.map +1 -0
- package/lib/commonjs/contract/encryption.js +6 -0
- package/lib/commonjs/contract/encryption.js.map +1 -0
- package/lib/commonjs/contract/errors.js +64 -0
- package/lib/commonjs/contract/errors.js.map +1 -0
- package/lib/commonjs/contract/migration.js +6 -0
- package/lib/commonjs/contract/migration.js.map +1 -0
- package/lib/commonjs/contract/query.js +6 -0
- package/lib/commonjs/contract/query.js.map +1 -0
- package/lib/commonjs/contract/record.js +6 -0
- package/lib/commonjs/contract/record.js.map +1 -0
- package/lib/commonjs/contract/schema.js +2 -0
- package/lib/commonjs/contract/schema.js.map +1 -0
- package/lib/commonjs/contract/scope.js +2 -0
- package/lib/commonjs/contract/scope.js.map +1 -0
- package/lib/commonjs/contract/transaction.js +6 -0
- package/lib/commonjs/contract/transaction.js.map +1 -0
- package/lib/commonjs/crypto/chunked-cipher.js +147 -0
- package/lib/commonjs/crypto/chunked-cipher.js.map +1 -0
- package/lib/commonjs/crypto/derive.js +61 -0
- package/lib/commonjs/crypto/derive.js.map +1 -0
- package/lib/commonjs/crypto/key-provider.js +70 -0
- package/lib/commonjs/crypto/key-provider.js.map +1 -0
- package/lib/commonjs/crypto/provider.js +54 -0
- package/lib/commonjs/crypto/provider.js.map +1 -0
- package/lib/commonjs/diagnostics/dev-log.js +127 -0
- package/lib/commonjs/diagnostics/dev-log.js.map +1 -0
- package/lib/commonjs/diagnostics/errors.js +57 -0
- package/lib/commonjs/diagnostics/errors.js.map +1 -0
- package/lib/commonjs/diagnostics/faults.js +54 -0
- package/lib/commonjs/diagnostics/faults.js.map +1 -0
- package/lib/commonjs/diagnostics/map-native.js +98 -0
- package/lib/commonjs/diagnostics/map-native.js.map +1 -0
- package/lib/commonjs/diagnostics/redact.js +110 -0
- package/lib/commonjs/diagnostics/redact.js.map +1 -0
- package/lib/commonjs/index.js +70 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/migration/executor.js +136 -0
- package/lib/commonjs/migration/executor.js.map +1 -0
- package/lib/commonjs/migration/ledger.js +64 -0
- package/lib/commonjs/migration/ledger.js.map +1 -0
- package/lib/commonjs/migration/validate-chain.js +76 -0
- package/lib/commonjs/migration/validate-chain.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/platform/backup-android-verify.js +76 -0
- package/lib/commonjs/platform/backup-android-verify.js.map +1 -0
- package/lib/commonjs/platform/backup-ios.js +50 -0
- package/lib/commonjs/platform/backup-ios.js.map +1 -0
- package/lib/commonjs/platform/bytes.js +158 -0
- package/lib/commonjs/platform/bytes.js.map +1 -0
- package/lib/commonjs/platform/fs.js +59 -0
- package/lib/commonjs/platform/fs.js.map +1 -0
- package/lib/commonjs/platform/location.js +129 -0
- package/lib/commonjs/platform/location.js.map +1 -0
- package/lib/commonjs/query/budgets.js +95 -0
- package/lib/commonjs/query/budgets.js.map +1 -0
- package/lib/commonjs/query/compare.js +97 -0
- package/lib/commonjs/query/compare.js.map +1 -0
- package/lib/commonjs/query/cursor.js +97 -0
- package/lib/commonjs/query/cursor.js.map +1 -0
- package/lib/commonjs/query/filter.js +82 -0
- package/lib/commonjs/query/filter.js.map +1 -0
- package/lib/commonjs/query/paginate.js +48 -0
- package/lib/commonjs/query/paginate.js.map +1 -0
- package/lib/commonjs/query/sort.js +61 -0
- package/lib/commonjs/query/sort.js.map +1 -0
- package/lib/commonjs/query/validate.js +180 -0
- package/lib/commonjs/query/validate.js.map +1 -0
- package/lib/commonjs/schema/declare.js +47 -0
- package/lib/commonjs/schema/declare.js.map +1 -0
- package/lib/commonjs/schema/validate-config.js +115 -0
- package/lib/commonjs/schema/validate-config.js.map +1 -0
- package/lib/commonjs/scope/hash.js +107 -0
- package/lib/commonjs/scope/hash.js.map +1 -0
- package/lib/commonjs/scope/normalize.js +73 -0
- package/lib/commonjs/scope/normalize.js.map +1 -0
- package/lib/commonjs/scope/validate.js +81 -0
- package/lib/commonjs/scope/validate.js.map +1 -0
- package/lib/commonjs/sqlite/adapter.js +31 -0
- package/lib/commonjs/sqlite/adapter.js.map +1 -0
- package/lib/commonjs/sqlite/batch.js +218 -0
- package/lib/commonjs/sqlite/batch.js.map +1 -0
- package/lib/commonjs/sqlite/catalog.js +81 -0
- package/lib/commonjs/sqlite/catalog.js.map +1 -0
- package/lib/commonjs/sqlite/connection.js +210 -0
- package/lib/commonjs/sqlite/connection.js.map +1 -0
- package/lib/commonjs/sqlite/index-coverage.js +42 -0
- package/lib/commonjs/sqlite/index-coverage.js.map +1 -0
- package/lib/commonjs/sqlite/native.js +54 -0
- package/lib/commonjs/sqlite/native.js.map +1 -0
- package/lib/commonjs/sqlite/row-codec.js +192 -0
- package/lib/commonjs/sqlite/row-codec.js.map +1 -0
- package/lib/commonjs/sqlite/sql-builder.js +253 -0
- package/lib/commonjs/sqlite/sql-builder.js.map +1 -0
- package/lib/commonjs/sqlite/statements.js +54 -0
- package/lib/commonjs/sqlite/statements.js.map +1 -0
- package/lib/commonjs/sqlite/transaction-queue.js +79 -0
- package/lib/commonjs/sqlite/transaction-queue.js.map +1 -0
- package/lib/commonjs/sqlite/transactions.js +33 -0
- package/lib/commonjs/sqlite/transactions.js.map +1 -0
- package/lib/commonjs/sqlite/values.js +31 -0
- package/lib/commonjs/sqlite/values.js.map +1 -0
- package/lib/commonjs/testing/conformance/attachments.js +180 -0
- package/lib/commonjs/testing/conformance/attachments.js.map +1 -0
- package/lib/commonjs/testing/conformance/encryption.js +187 -0
- package/lib/commonjs/testing/conformance/encryption.js.map +1 -0
- package/lib/commonjs/testing/conformance/index.js +103 -0
- package/lib/commonjs/testing/conformance/index.js.map +1 -0
- package/lib/commonjs/testing/conformance/lifecycle.js +134 -0
- package/lib/commonjs/testing/conformance/lifecycle.js.map +1 -0
- package/lib/commonjs/testing/conformance/migrations.js +167 -0
- package/lib/commonjs/testing/conformance/migrations.js.map +1 -0
- package/lib/commonjs/testing/conformance/queries.js +278 -0
- package/lib/commonjs/testing/conformance/queries.js.map +1 -0
- package/lib/commonjs/testing/conformance/records.js +224 -0
- package/lib/commonjs/testing/conformance/records.js.map +1 -0
- package/lib/commonjs/testing/conformance/scopes.js +107 -0
- package/lib/commonjs/testing/conformance/scopes.js.map +1 -0
- package/lib/commonjs/testing/conformance/transactions.js +228 -0
- package/lib/commonjs/testing/conformance/transactions.js.map +1 -0
- package/lib/commonjs/testing/faults.js +38 -0
- package/lib/commonjs/testing/faults.js.map +1 -0
- package/lib/commonjs/testing/index.js +59 -0
- package/lib/commonjs/testing/index.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/attachments.js +145 -0
- package/lib/commonjs/testing/memory-adapter/attachments.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/collection.js +224 -0
- package/lib/commonjs/testing/memory-adapter/collection.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/index.js +366 -0
- package/lib/commonjs/testing/memory-adapter/index.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/migrations.js +126 -0
- package/lib/commonjs/testing/memory-adapter/migrations.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/reset.js +49 -0
- package/lib/commonjs/testing/memory-adapter/reset.js.map +1 -0
- package/lib/commonjs/testing/memory-adapter/store.js +107 -0
- package/lib/commonjs/testing/memory-adapter/store.js.map +1 -0
- package/lib/module/adapter/budgets.js +51 -0
- package/lib/module/adapter/budgets.js.map +1 -0
- package/lib/module/adapter/collection.js +232 -0
- package/lib/module/adapter/collection.js.map +1 -0
- package/lib/module/adapter/deletion.js +280 -0
- package/lib/module/adapter/deletion.js.map +1 -0
- package/lib/module/adapter/handle.js +254 -0
- package/lib/module/adapter/handle.js.map +1 -0
- package/lib/module/adapter/index.js +59 -0
- package/lib/module/adapter/index.js.map +1 -0
- package/lib/module/adapter/lifecycle.js +172 -0
- package/lib/module/adapter/lifecycle.js.map +1 -0
- package/lib/module/adapter/schema-sync.js +121 -0
- package/lib/module/adapter/schema-sync.js.map +1 -0
- package/lib/module/adapter/transaction.js +54 -0
- package/lib/module/adapter/transaction.js.map +1 -0
- package/lib/module/artifacts/availability.js +86 -0
- package/lib/module/artifacts/availability.js.map +1 -0
- package/lib/module/artifacts/cascade.js +75 -0
- package/lib/module/artifacts/cascade.js.map +1 -0
- package/lib/module/artifacts/paths.js +26 -0
- package/lib/module/artifacts/paths.js.map +1 -0
- package/lib/module/artifacts/reconcile.js +51 -0
- package/lib/module/artifacts/reconcile.js.map +1 -0
- package/lib/module/artifacts/store.js +289 -0
- package/lib/module/artifacts/store.js.map +1 -0
- package/lib/module/contract/adapter.js +4 -0
- package/lib/module/contract/adapter.js.map +1 -0
- package/lib/module/contract/attachment.js +2 -0
- package/lib/module/contract/attachment.js.map +1 -0
- package/lib/module/contract/backup.js +2 -0
- package/lib/module/contract/backup.js.map +1 -0
- package/lib/module/contract/config.js +27 -0
- package/lib/module/contract/config.js.map +1 -0
- package/lib/module/contract/encryption.js +4 -0
- package/lib/module/contract/encryption.js.map +1 -0
- package/lib/module/contract/errors.js +60 -0
- package/lib/module/contract/errors.js.map +1 -0
- package/lib/module/contract/migration.js +4 -0
- package/lib/module/contract/migration.js.map +1 -0
- package/lib/module/contract/query.js +4 -0
- package/lib/module/contract/query.js.map +1 -0
- package/lib/module/contract/record.js +4 -0
- package/lib/module/contract/record.js.map +1 -0
- package/lib/module/contract/schema.js +2 -0
- package/lib/module/contract/schema.js.map +1 -0
- package/lib/module/contract/scope.js +2 -0
- package/lib/module/contract/scope.js.map +1 -0
- package/lib/module/contract/transaction.js +4 -0
- package/lib/module/contract/transaction.js.map +1 -0
- package/lib/module/crypto/chunked-cipher.js +134 -0
- package/lib/module/crypto/chunked-cipher.js.map +1 -0
- package/lib/module/crypto/derive.js +56 -0
- package/lib/module/crypto/derive.js.map +1 -0
- package/lib/module/crypto/key-provider.js +67 -0
- package/lib/module/crypto/key-provider.js.map +1 -0
- package/lib/module/crypto/provider.js +49 -0
- package/lib/module/crypto/provider.js.map +1 -0
- package/lib/module/diagnostics/dev-log.js +120 -0
- package/lib/module/diagnostics/dev-log.js.map +1 -0
- package/lib/module/diagnostics/errors.js +44 -0
- package/lib/module/diagnostics/errors.js.map +1 -0
- package/lib/module/diagnostics/faults.js +47 -0
- package/lib/module/diagnostics/faults.js.map +1 -0
- package/lib/module/diagnostics/map-native.js +93 -0
- package/lib/module/diagnostics/map-native.js.map +1 -0
- package/lib/module/diagnostics/redact.js +102 -0
- package/lib/module/diagnostics/redact.js.map +1 -0
- package/lib/module/index.js +28 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/migration/executor.js +132 -0
- package/lib/module/migration/executor.js.map +1 -0
- package/lib/module/migration/ledger.js +57 -0
- package/lib/module/migration/ledger.js.map +1 -0
- package/lib/module/migration/validate-chain.js +70 -0
- package/lib/module/migration/validate-chain.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/platform/backup-android-verify.js +69 -0
- package/lib/module/platform/backup-android-verify.js.map +1 -0
- package/lib/module/platform/backup-ios.js +44 -0
- package/lib/module/platform/backup-ios.js.map +1 -0
- package/lib/module/platform/bytes.js +148 -0
- package/lib/module/platform/bytes.js.map +1 -0
- package/lib/module/platform/fs.js +54 -0
- package/lib/module/platform/fs.js.map +1 -0
- package/lib/module/platform/location.js +120 -0
- package/lib/module/platform/location.js.map +1 -0
- package/lib/module/query/budgets.js +88 -0
- package/lib/module/query/budgets.js.map +1 -0
- package/lib/module/query/compare.js +90 -0
- package/lib/module/query/compare.js.map +1 -0
- package/lib/module/query/cursor.js +91 -0
- package/lib/module/query/cursor.js.map +1 -0
- package/lib/module/query/filter.js +78 -0
- package/lib/module/query/filter.js.map +1 -0
- package/lib/module/query/paginate.js +40 -0
- package/lib/module/query/paginate.js.map +1 -0
- package/lib/module/query/sort.js +53 -0
- package/lib/module/query/sort.js.map +1 -0
- package/lib/module/query/validate.js +173 -0
- package/lib/module/query/validate.js.map +1 -0
- package/lib/module/schema/declare.js +37 -0
- package/lib/module/schema/declare.js.map +1 -0
- package/lib/module/schema/validate-config.js +111 -0
- package/lib/module/schema/validate-config.js.map +1 -0
- package/lib/module/scope/hash.js +102 -0
- package/lib/module/scope/hash.js.map +1 -0
- package/lib/module/scope/normalize.js +67 -0
- package/lib/module/scope/normalize.js.map +1 -0
- package/lib/module/scope/validate.js +76 -0
- package/lib/module/scope/validate.js.map +1 -0
- package/lib/module/sqlite/adapter.js +27 -0
- package/lib/module/sqlite/adapter.js.map +1 -0
- package/lib/module/sqlite/batch.js +214 -0
- package/lib/module/sqlite/batch.js.map +1 -0
- package/lib/module/sqlite/catalog.js +72 -0
- package/lib/module/sqlite/catalog.js.map +1 -0
- package/lib/module/sqlite/connection.js +206 -0
- package/lib/module/sqlite/connection.js.map +1 -0
- package/lib/module/sqlite/index-coverage.js +38 -0
- package/lib/module/sqlite/index-coverage.js.map +1 -0
- package/lib/module/sqlite/native.js +48 -0
- package/lib/module/sqlite/native.js.map +1 -0
- package/lib/module/sqlite/row-codec.js +176 -0
- package/lib/module/sqlite/row-codec.js.map +1 -0
- package/lib/module/sqlite/sql-builder.js +247 -0
- package/lib/module/sqlite/sql-builder.js.map +1 -0
- package/lib/module/sqlite/statements.js +49 -0
- package/lib/module/sqlite/statements.js.map +1 -0
- package/lib/module/sqlite/transaction-queue.js +75 -0
- package/lib/module/sqlite/transaction-queue.js.map +1 -0
- package/lib/module/sqlite/transactions.js +29 -0
- package/lib/module/sqlite/transactions.js.map +1 -0
- package/lib/module/sqlite/values.js +24 -0
- package/lib/module/sqlite/values.js.map +1 -0
- package/lib/module/testing/conformance/attachments.js +176 -0
- package/lib/module/testing/conformance/attachments.js.map +1 -0
- package/lib/module/testing/conformance/encryption.js +183 -0
- package/lib/module/testing/conformance/encryption.js.map +1 -0
- package/lib/module/testing/conformance/index.js +97 -0
- package/lib/module/testing/conformance/index.js.map +1 -0
- package/lib/module/testing/conformance/lifecycle.js +130 -0
- package/lib/module/testing/conformance/lifecycle.js.map +1 -0
- package/lib/module/testing/conformance/migrations.js +163 -0
- package/lib/module/testing/conformance/migrations.js.map +1 -0
- package/lib/module/testing/conformance/queries.js +274 -0
- package/lib/module/testing/conformance/queries.js.map +1 -0
- package/lib/module/testing/conformance/records.js +220 -0
- package/lib/module/testing/conformance/records.js.map +1 -0
- package/lib/module/testing/conformance/scopes.js +103 -0
- package/lib/module/testing/conformance/scopes.js.map +1 -0
- package/lib/module/testing/conformance/transactions.js +224 -0
- package/lib/module/testing/conformance/transactions.js.map +1 -0
- package/lib/module/testing/faults.js +16 -0
- package/lib/module/testing/faults.js.map +1 -0
- package/lib/module/testing/index.js +16 -0
- package/lib/module/testing/index.js.map +1 -0
- package/lib/module/testing/memory-adapter/attachments.js +142 -0
- package/lib/module/testing/memory-adapter/attachments.js.map +1 -0
- package/lib/module/testing/memory-adapter/collection.js +220 -0
- package/lib/module/testing/memory-adapter/collection.js.map +1 -0
- package/lib/module/testing/memory-adapter/index.js +351 -0
- package/lib/module/testing/memory-adapter/index.js.map +1 -0
- package/lib/module/testing/memory-adapter/migrations.js +122 -0
- package/lib/module/testing/memory-adapter/migrations.js.map +1 -0
- package/lib/module/testing/memory-adapter/reset.js +44 -0
- package/lib/module/testing/memory-adapter/reset.js.map +1 -0
- package/lib/module/testing/memory-adapter/store.js +94 -0
- package/lib/module/testing/memory-adapter/store.js.map +1 -0
- package/lib/typescript/commonjs/adapter/budgets.d.ts +19 -0
- package/lib/typescript/commonjs/adapter/budgets.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/collection.d.ts +25 -0
- package/lib/typescript/commonjs/adapter/collection.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/deletion.d.ts +48 -0
- package/lib/typescript/commonjs/adapter/deletion.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/handle.d.ts +30 -0
- package/lib/typescript/commonjs/adapter/handle.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/index.d.ts +30 -0
- package/lib/typescript/commonjs/adapter/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/lifecycle.d.ts +25 -0
- package/lib/typescript/commonjs/adapter/lifecycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/schema-sync.d.ts +19 -0
- package/lib/typescript/commonjs/adapter/schema-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/adapter/transaction.d.ts +32 -0
- package/lib/typescript/commonjs/adapter/transaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/availability.d.ts +19 -0
- package/lib/typescript/commonjs/artifacts/availability.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/cascade.d.ts +26 -0
- package/lib/typescript/commonjs/artifacts/cascade.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/paths.d.ts +16 -0
- package/lib/typescript/commonjs/artifacts/paths.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/reconcile.d.ts +23 -0
- package/lib/typescript/commonjs/artifacts/reconcile.d.ts.map +1 -0
- package/lib/typescript/commonjs/artifacts/store.d.ts +45 -0
- package/lib/typescript/commonjs/artifacts/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/adapter.d.ts +55 -0
- package/lib/typescript/commonjs/contract/adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/attachment.d.ts +84 -0
- package/lib/typescript/commonjs/contract/attachment.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/backup.d.ts +26 -0
- package/lib/typescript/commonjs/contract/backup.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/config.d.ts +50 -0
- package/lib/typescript/commonjs/contract/config.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/encryption.d.ts +31 -0
- package/lib/typescript/commonjs/contract/encryption.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/errors.d.ts +50 -0
- package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/migration.d.ts +37 -0
- package/lib/typescript/commonjs/contract/migration.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/query.d.ts +79 -0
- package/lib/typescript/commonjs/contract/query.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/record.d.ts +43 -0
- package/lib/typescript/commonjs/contract/record.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/schema.d.ts +33 -0
- package/lib/typescript/commonjs/contract/schema.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/scope.d.ts +33 -0
- package/lib/typescript/commonjs/contract/scope.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/transaction.d.ts +66 -0
- package/lib/typescript/commonjs/contract/transaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/chunked-cipher.d.ts +57 -0
- package/lib/typescript/commonjs/crypto/chunked-cipher.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/derive.d.ts +28 -0
- package/lib/typescript/commonjs/crypto/derive.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/key-provider.d.ts +30 -0
- package/lib/typescript/commonjs/crypto/key-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/crypto/provider.d.ts +35 -0
- package/lib/typescript/commonjs/crypto/provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/dev-log.d.ts +35 -0
- package/lib/typescript/commonjs/diagnostics/dev-log.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts +34 -0
- package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/faults.d.ts +26 -0
- package/lib/typescript/commonjs/diagnostics/faults.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/map-native.d.ts +31 -0
- package/lib/typescript/commonjs/diagnostics/map-native.d.ts.map +1 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts +70 -0
- package/lib/typescript/commonjs/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +30 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/migration/executor.d.ts +40 -0
- package/lib/typescript/commonjs/migration/executor.d.ts.map +1 -0
- package/lib/typescript/commonjs/migration/ledger.d.ts +34 -0
- package/lib/typescript/commonjs/migration/ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/migration/validate-chain.d.ts +20 -0
- package/lib/typescript/commonjs/migration/validate-chain.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/platform/backup-android-verify.d.ts +30 -0
- package/lib/typescript/commonjs/platform/backup-android-verify.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/backup-ios.d.ts +26 -0
- package/lib/typescript/commonjs/platform/backup-ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/bytes.d.ts +36 -0
- package/lib/typescript/commonjs/platform/bytes.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/fs.d.ts +47 -0
- package/lib/typescript/commonjs/platform/fs.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/location.d.ts +53 -0
- package/lib/typescript/commonjs/platform/location.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/budgets.d.ts +23 -0
- package/lib/typescript/commonjs/query/budgets.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/compare.d.ts +42 -0
- package/lib/typescript/commonjs/query/compare.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/cursor.d.ts +27 -0
- package/lib/typescript/commonjs/query/cursor.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/filter.d.ts +11 -0
- package/lib/typescript/commonjs/query/filter.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/paginate.d.ts +15 -0
- package/lib/typescript/commonjs/query/paginate.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/sort.d.ts +19 -0
- package/lib/typescript/commonjs/query/sort.d.ts.map +1 -0
- package/lib/typescript/commonjs/query/validate.d.ts +15 -0
- package/lib/typescript/commonjs/query/validate.d.ts.map +1 -0
- package/lib/typescript/commonjs/schema/declare.d.ts +20 -0
- package/lib/typescript/commonjs/schema/declare.d.ts.map +1 -0
- package/lib/typescript/commonjs/schema/validate-config.d.ts +11 -0
- package/lib/typescript/commonjs/schema/validate-config.d.ts.map +1 -0
- package/lib/typescript/commonjs/scope/hash.d.ts +24 -0
- package/lib/typescript/commonjs/scope/hash.d.ts.map +1 -0
- package/lib/typescript/commonjs/scope/normalize.d.ts +46 -0
- package/lib/typescript/commonjs/scope/normalize.d.ts.map +1 -0
- package/lib/typescript/commonjs/scope/validate.d.ts +15 -0
- package/lib/typescript/commonjs/scope/validate.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/adapter.d.ts +16 -0
- package/lib/typescript/commonjs/sqlite/adapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/batch.d.ts +25 -0
- package/lib/typescript/commonjs/sqlite/batch.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/catalog.d.ts +34 -0
- package/lib/typescript/commonjs/sqlite/catalog.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/connection.d.ts +58 -0
- package/lib/typescript/commonjs/sqlite/connection.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/index-coverage.d.ts +18 -0
- package/lib/typescript/commonjs/sqlite/index-coverage.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/native.d.ts +48 -0
- package/lib/typescript/commonjs/sqlite/native.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/row-codec.d.ts +69 -0
- package/lib/typescript/commonjs/sqlite/row-codec.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/sql-builder.d.ts +34 -0
- package/lib/typescript/commonjs/sqlite/sql-builder.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/statements.d.ts +26 -0
- package/lib/typescript/commonjs/sqlite/statements.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/transaction-queue.d.ts +31 -0
- package/lib/typescript/commonjs/sqlite/transaction-queue.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/transactions.d.ts +26 -0
- package/lib/typescript/commonjs/sqlite/transactions.d.ts.map +1 -0
- package/lib/typescript/commonjs/sqlite/values.d.ts +13 -0
- package/lib/typescript/commonjs/sqlite/values.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/attachments.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/attachments.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/encryption.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/encryption.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts +58 -0
- package/lib/typescript/commonjs/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/lifecycle.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/lifecycle.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/migrations.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/migrations.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/queries.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/queries.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/records.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/records.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/scopes.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/scopes.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/conformance/transactions.d.ts +4 -0
- package/lib/typescript/commonjs/testing/conformance/transactions.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/faults.d.ts +13 -0
- package/lib/typescript/commonjs/testing/faults.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/index.d.ts +13 -0
- package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/attachments.d.ts +23 -0
- package/lib/typescript/commonjs/testing/memory-adapter/attachments.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/collection.d.ts +19 -0
- package/lib/typescript/commonjs/testing/memory-adapter/collection.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/index.d.ts +22 -0
- package/lib/typescript/commonjs/testing/memory-adapter/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/migrations.d.ts +11 -0
- package/lib/typescript/commonjs/testing/memory-adapter/migrations.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/reset.d.ts +23 -0
- package/lib/typescript/commonjs/testing/memory-adapter/reset.d.ts.map +1 -0
- package/lib/typescript/commonjs/testing/memory-adapter/store.d.ts +54 -0
- package/lib/typescript/commonjs/testing/memory-adapter/store.d.ts.map +1 -0
- package/lib/typescript/module/adapter/budgets.d.ts +19 -0
- package/lib/typescript/module/adapter/budgets.d.ts.map +1 -0
- package/lib/typescript/module/adapter/collection.d.ts +25 -0
- package/lib/typescript/module/adapter/collection.d.ts.map +1 -0
- package/lib/typescript/module/adapter/deletion.d.ts +48 -0
- package/lib/typescript/module/adapter/deletion.d.ts.map +1 -0
- package/lib/typescript/module/adapter/handle.d.ts +30 -0
- package/lib/typescript/module/adapter/handle.d.ts.map +1 -0
- package/lib/typescript/module/adapter/index.d.ts +30 -0
- package/lib/typescript/module/adapter/index.d.ts.map +1 -0
- package/lib/typescript/module/adapter/lifecycle.d.ts +25 -0
- package/lib/typescript/module/adapter/lifecycle.d.ts.map +1 -0
- package/lib/typescript/module/adapter/schema-sync.d.ts +19 -0
- package/lib/typescript/module/adapter/schema-sync.d.ts.map +1 -0
- package/lib/typescript/module/adapter/transaction.d.ts +32 -0
- package/lib/typescript/module/adapter/transaction.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/availability.d.ts +19 -0
- package/lib/typescript/module/artifacts/availability.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/cascade.d.ts +26 -0
- package/lib/typescript/module/artifacts/cascade.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/paths.d.ts +16 -0
- package/lib/typescript/module/artifacts/paths.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/reconcile.d.ts +23 -0
- package/lib/typescript/module/artifacts/reconcile.d.ts.map +1 -0
- package/lib/typescript/module/artifacts/store.d.ts +45 -0
- package/lib/typescript/module/artifacts/store.d.ts.map +1 -0
- package/lib/typescript/module/contract/adapter.d.ts +55 -0
- package/lib/typescript/module/contract/adapter.d.ts.map +1 -0
- package/lib/typescript/module/contract/attachment.d.ts +84 -0
- package/lib/typescript/module/contract/attachment.d.ts.map +1 -0
- package/lib/typescript/module/contract/backup.d.ts +26 -0
- package/lib/typescript/module/contract/backup.d.ts.map +1 -0
- package/lib/typescript/module/contract/config.d.ts +50 -0
- package/lib/typescript/module/contract/config.d.ts.map +1 -0
- package/lib/typescript/module/contract/encryption.d.ts +31 -0
- package/lib/typescript/module/contract/encryption.d.ts.map +1 -0
- package/lib/typescript/module/contract/errors.d.ts +50 -0
- package/lib/typescript/module/contract/errors.d.ts.map +1 -0
- package/lib/typescript/module/contract/migration.d.ts +37 -0
- package/lib/typescript/module/contract/migration.d.ts.map +1 -0
- package/lib/typescript/module/contract/query.d.ts +79 -0
- package/lib/typescript/module/contract/query.d.ts.map +1 -0
- package/lib/typescript/module/contract/record.d.ts +43 -0
- package/lib/typescript/module/contract/record.d.ts.map +1 -0
- package/lib/typescript/module/contract/schema.d.ts +33 -0
- package/lib/typescript/module/contract/schema.d.ts.map +1 -0
- package/lib/typescript/module/contract/scope.d.ts +33 -0
- package/lib/typescript/module/contract/scope.d.ts.map +1 -0
- package/lib/typescript/module/contract/transaction.d.ts +66 -0
- package/lib/typescript/module/contract/transaction.d.ts.map +1 -0
- package/lib/typescript/module/crypto/chunked-cipher.d.ts +57 -0
- package/lib/typescript/module/crypto/chunked-cipher.d.ts.map +1 -0
- package/lib/typescript/module/crypto/derive.d.ts +28 -0
- package/lib/typescript/module/crypto/derive.d.ts.map +1 -0
- package/lib/typescript/module/crypto/key-provider.d.ts +30 -0
- package/lib/typescript/module/crypto/key-provider.d.ts.map +1 -0
- package/lib/typescript/module/crypto/provider.d.ts +35 -0
- package/lib/typescript/module/crypto/provider.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/dev-log.d.ts +35 -0
- package/lib/typescript/module/diagnostics/dev-log.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/errors.d.ts +34 -0
- package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/faults.d.ts +26 -0
- package/lib/typescript/module/diagnostics/faults.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/map-native.d.ts +31 -0
- package/lib/typescript/module/diagnostics/map-native.d.ts.map +1 -0
- package/lib/typescript/module/diagnostics/redact.d.ts +70 -0
- package/lib/typescript/module/diagnostics/redact.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +30 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/migration/executor.d.ts +40 -0
- package/lib/typescript/module/migration/executor.d.ts.map +1 -0
- package/lib/typescript/module/migration/ledger.d.ts +34 -0
- package/lib/typescript/module/migration/ledger.d.ts.map +1 -0
- package/lib/typescript/module/migration/validate-chain.d.ts +20 -0
- package/lib/typescript/module/migration/validate-chain.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/platform/backup-android-verify.d.ts +30 -0
- package/lib/typescript/module/platform/backup-android-verify.d.ts.map +1 -0
- package/lib/typescript/module/platform/backup-ios.d.ts +26 -0
- package/lib/typescript/module/platform/backup-ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/bytes.d.ts +36 -0
- package/lib/typescript/module/platform/bytes.d.ts.map +1 -0
- package/lib/typescript/module/platform/fs.d.ts +47 -0
- package/lib/typescript/module/platform/fs.d.ts.map +1 -0
- package/lib/typescript/module/platform/location.d.ts +53 -0
- package/lib/typescript/module/platform/location.d.ts.map +1 -0
- package/lib/typescript/module/query/budgets.d.ts +23 -0
- package/lib/typescript/module/query/budgets.d.ts.map +1 -0
- package/lib/typescript/module/query/compare.d.ts +42 -0
- package/lib/typescript/module/query/compare.d.ts.map +1 -0
- package/lib/typescript/module/query/cursor.d.ts +27 -0
- package/lib/typescript/module/query/cursor.d.ts.map +1 -0
- package/lib/typescript/module/query/filter.d.ts +11 -0
- package/lib/typescript/module/query/filter.d.ts.map +1 -0
- package/lib/typescript/module/query/paginate.d.ts +15 -0
- package/lib/typescript/module/query/paginate.d.ts.map +1 -0
- package/lib/typescript/module/query/sort.d.ts +19 -0
- package/lib/typescript/module/query/sort.d.ts.map +1 -0
- package/lib/typescript/module/query/validate.d.ts +15 -0
- package/lib/typescript/module/query/validate.d.ts.map +1 -0
- package/lib/typescript/module/schema/declare.d.ts +20 -0
- package/lib/typescript/module/schema/declare.d.ts.map +1 -0
- package/lib/typescript/module/schema/validate-config.d.ts +11 -0
- package/lib/typescript/module/schema/validate-config.d.ts.map +1 -0
- package/lib/typescript/module/scope/hash.d.ts +24 -0
- package/lib/typescript/module/scope/hash.d.ts.map +1 -0
- package/lib/typescript/module/scope/normalize.d.ts +46 -0
- package/lib/typescript/module/scope/normalize.d.ts.map +1 -0
- package/lib/typescript/module/scope/validate.d.ts +15 -0
- package/lib/typescript/module/scope/validate.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/adapter.d.ts +16 -0
- package/lib/typescript/module/sqlite/adapter.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/batch.d.ts +25 -0
- package/lib/typescript/module/sqlite/batch.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/catalog.d.ts +34 -0
- package/lib/typescript/module/sqlite/catalog.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/connection.d.ts +58 -0
- package/lib/typescript/module/sqlite/connection.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/index-coverage.d.ts +18 -0
- package/lib/typescript/module/sqlite/index-coverage.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/native.d.ts +48 -0
- package/lib/typescript/module/sqlite/native.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/row-codec.d.ts +69 -0
- package/lib/typescript/module/sqlite/row-codec.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/sql-builder.d.ts +34 -0
- package/lib/typescript/module/sqlite/sql-builder.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/statements.d.ts +26 -0
- package/lib/typescript/module/sqlite/statements.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/transaction-queue.d.ts +31 -0
- package/lib/typescript/module/sqlite/transaction-queue.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/transactions.d.ts +26 -0
- package/lib/typescript/module/sqlite/transactions.d.ts.map +1 -0
- package/lib/typescript/module/sqlite/values.d.ts +13 -0
- package/lib/typescript/module/sqlite/values.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/attachments.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/attachments.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/encryption.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/encryption.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/index.d.ts +58 -0
- package/lib/typescript/module/testing/conformance/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/lifecycle.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/lifecycle.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/migrations.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/migrations.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/queries.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/queries.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/records.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/records.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/scopes.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/scopes.d.ts.map +1 -0
- package/lib/typescript/module/testing/conformance/transactions.d.ts +4 -0
- package/lib/typescript/module/testing/conformance/transactions.d.ts.map +1 -0
- package/lib/typescript/module/testing/faults.d.ts +13 -0
- package/lib/typescript/module/testing/faults.d.ts.map +1 -0
- package/lib/typescript/module/testing/index.d.ts +13 -0
- package/lib/typescript/module/testing/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/attachments.d.ts +23 -0
- package/lib/typescript/module/testing/memory-adapter/attachments.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/collection.d.ts +19 -0
- package/lib/typescript/module/testing/memory-adapter/collection.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/index.d.ts +22 -0
- package/lib/typescript/module/testing/memory-adapter/index.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/migrations.d.ts +11 -0
- package/lib/typescript/module/testing/memory-adapter/migrations.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/reset.d.ts +23 -0
- package/lib/typescript/module/testing/memory-adapter/reset.d.ts.map +1 -0
- package/lib/typescript/module/testing/memory-adapter/store.d.ts +54 -0
- package/lib/typescript/module/testing/memory-adapter/store.d.ts.map +1 -0
- package/package.json +51 -16
- package/src/crypto/provider.ts +7 -3
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.runMigrations = runMigrations;
|
|
7
|
+
var _errors = require("../../contract/errors.js");
|
|
8
|
+
var _errors2 = require("../../diagnostics/errors.js");
|
|
9
|
+
var _faults = require("../faults.js");
|
|
10
|
+
/**
|
|
11
|
+
* Migration execution for the in-memory adapter.
|
|
12
|
+
*
|
|
13
|
+
* Mirrors the on-device rules exactly, because migration behaviour is the
|
|
14
|
+
* thing consumers most need to test without a device: ordered, at most once
|
|
15
|
+
* per scope, atomic per step, and loud on failure (FR-047 to FR-057).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
async function runMigrations(store, config, now) {
|
|
19
|
+
const migrations = [...(config.migrations ?? [])].sort((a, b) => a.version - b.version);
|
|
20
|
+
if (store.schemaVersion > config.schemaVersion) {
|
|
21
|
+
// Opening anyway would mean a newer database read by older code, which
|
|
22
|
+
// silently drops whatever the newer schema added.
|
|
23
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.SCHEMA_DOWNGRADE, {
|
|
24
|
+
message: 'recorded schema version is newer than the declared one',
|
|
25
|
+
detail: {
|
|
26
|
+
recordedVersion: store.schemaVersion,
|
|
27
|
+
version: config.schemaVersion
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
for (const migration of migrations) {
|
|
32
|
+
if (migration.version <= store.schemaVersion) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const snapshot = new Map([...store.collections].map(([name, rows]) => [name, new Map(rows)]));
|
|
36
|
+
try {
|
|
37
|
+
(0, _faults.throwIfFaulted)('migration');
|
|
38
|
+
// A migration gets collection access but no handle-level surface:
|
|
39
|
+
// it must not open another scope or start a nested transaction.
|
|
40
|
+
const context = {
|
|
41
|
+
collection: name => {
|
|
42
|
+
if (!store.collections.has(name)) {
|
|
43
|
+
store.collections.set(name, new Map());
|
|
44
|
+
}
|
|
45
|
+
return migrationCollection(store, name);
|
|
46
|
+
},
|
|
47
|
+
abort: async () => {
|
|
48
|
+
throw new Error('migration aborted');
|
|
49
|
+
},
|
|
50
|
+
execute: async () => {
|
|
51
|
+
// The memory adapter has no SQL. Documented divergence.
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
await migration.migrate(context);
|
|
55
|
+
store.schemaVersion = migration.version;
|
|
56
|
+
store.ledger.set(migration.version, {
|
|
57
|
+
version: migration.version,
|
|
58
|
+
attemptedAt: now(),
|
|
59
|
+
outcome: 'applied'
|
|
60
|
+
});
|
|
61
|
+
} catch (error) {
|
|
62
|
+
// Leave the recorded version untouched so the next open retries
|
|
63
|
+
// from the same place rather than skipping ahead (FR-051).
|
|
64
|
+
store.collections = snapshot;
|
|
65
|
+
store.ledger.set(migration.version, {
|
|
66
|
+
version: migration.version,
|
|
67
|
+
attemptedAt: now(),
|
|
68
|
+
outcome: 'failed',
|
|
69
|
+
failureCode: error.code ?? _errors.DiagnosticCodes.MIGRATION_FAILED
|
|
70
|
+
});
|
|
71
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.MIGRATION_FAILED, {
|
|
72
|
+
message: 'migration failed',
|
|
73
|
+
migration: {
|
|
74
|
+
recordedVersion: store.schemaVersion,
|
|
75
|
+
failingVersion: migration.version,
|
|
76
|
+
outcome: 'failed'
|
|
77
|
+
},
|
|
78
|
+
cause: error
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (migrations.length === 0) {
|
|
83
|
+
store.schemaVersion = config.schemaVersion;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function migrationCollection(store, name) {
|
|
87
|
+
const rows = store.collections.get(name);
|
|
88
|
+
return {
|
|
89
|
+
async insert(record) {
|
|
90
|
+
rows.set(record.id, {
|
|
91
|
+
id: record.id,
|
|
92
|
+
payload: JSON.stringify(record.data)
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
operation: 'created',
|
|
96
|
+
id: record.id
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
async upsert(record) {
|
|
100
|
+
const existed = rows.has(record.id);
|
|
101
|
+
rows.set(record.id, {
|
|
102
|
+
id: record.id,
|
|
103
|
+
payload: JSON.stringify(record.data)
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
operation: existed ? 'updated' : 'created',
|
|
107
|
+
id: record.id
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
async delete(id) {
|
|
111
|
+
rows.delete(id);
|
|
112
|
+
return {
|
|
113
|
+
operation: 'deleted',
|
|
114
|
+
id
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
async find(id) {
|
|
118
|
+
const row = rows.get(id);
|
|
119
|
+
return row ? {
|
|
120
|
+
id: row.id,
|
|
121
|
+
data: JSON.parse(row.payload)
|
|
122
|
+
} : null;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","require","_errors2","_faults","runMigrations","store","config","now","migrations","sort","a","b","version","schemaVersion","raise","DiagnosticCodes","SCHEMA_DOWNGRADE","message","detail","recordedVersion","migration","snapshot","Map","collections","map","name","rows","throwIfFaulted","context","collection","has","set","migrationCollection","abort","Error","execute","migrate","ledger","attemptedAt","outcome","error","failureCode","code","MIGRATION_FAILED","failingVersion","cause","length","get","insert","record","id","payload","JSON","stringify","data","operation","upsert","existed","delete","find","row","parse"],"sourceRoot":"../../../../src","sources":["testing/memory-adapter/migrations.ts"],"mappings":";;;;;;AASA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;;AASO,eAAeG,aAAaA,CAClCC,KAAuB,EACvBC,MAAsB,EACtBC,GAAiB,EACD;EAChB,MAAMC,UAAU,GAAG,CAAC,IAAIF,MAAM,CAACE,UAAU,IAAI,EAAE,CAAC,CAAC,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,OAAO,GAAGD,CAAC,CAACC,OAAO,CAAC;EAEvF,IAAIP,KAAK,CAACQ,aAAa,GAAGP,MAAM,CAACO,aAAa,EAAE;IAC/C;IACA;IACA,IAAAC,cAAK,EAACC,uBAAe,CAACC,gBAAgB,EAAE;MACvCC,OAAO,EAAE,wDAAwD;MACjEC,MAAM,EAAE;QACPC,eAAe,EAAEd,KAAK,CAACQ,aAAa;QACpCD,OAAO,EAAEN,MAAM,CAACO;MACjB;IACD,CAAC,CAAC;EACH;EAEA,KAAK,MAAMO,SAAS,IAAIZ,UAAU,EAAE;IACnC,IAAIY,SAAS,CAACR,OAAO,IAAIP,KAAK,CAACQ,aAAa,EAAE;MAC7C;IACD;IAEA,MAAMQ,QAAQ,GAAG,IAAIC,GAAG,CAAC,CAAC,GAAGjB,KAAK,CAACkB,WAAW,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,IAAI,EAAEC,I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AAM,CAACC;MAAG,CAAC;IAC3F,CAAC;IACD,MAAMQ,MAAMA,CAACR,EAAU,EAAE;MACxBxB,IAAI,CAACgC,MAAM,CAACR,EAAE,CAAC;MACf,OAAO;QAAEK,SAAS,EAAE,SAAkB;QAAEL;MAAG,CAAC;IAC7C,CAAC;IACD,MAAMS,IAAIA,CAACT,EAAU,EAAE;MACtB,MAAMU,GAAG,GAAGlC,IAAI,CAACqB,GAAG,CAACG,EAAE,CAAC;MACxB,OAAOU,GAAG,GAAG;QAAEV,EAAE,EAAEU,GAAG,CAACV,EAAE;QAAEI,IAAI,EAAEF,IAAI,CAACS,KAAK,CAACD,GAAG,CAACT,OAAO;MAAE,CAAC,GAAG,IAAI;IAClE;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.memoryConformanceHooks = void 0;
|
|
7
|
+
exports.resetMemoryAdapter = resetMemoryAdapter;
|
|
8
|
+
exports.seedRecords = seedRecords;
|
|
9
|
+
var _faults = require("../faults.js");
|
|
10
|
+
var _store = require("./store.js");
|
|
11
|
+
/**
|
|
12
|
+
* Test lifecycle helpers.
|
|
13
|
+
*
|
|
14
|
+
* `seedRecords` deliberately goes through the same write operations
|
|
15
|
+
* production code uses (FR-094). Seeding by poking the store directly would
|
|
16
|
+
* skip budget checks and timestamp handling, so tests would pass against data
|
|
17
|
+
* the package would have refused to store.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The conformance suite's "reach past the package" hooks, implemented for the
|
|
22
|
+
* in-memory store. On device the equivalent unlinks the file directly.
|
|
23
|
+
*/
|
|
24
|
+
const memoryConformanceHooks = exports.memoryConformanceHooks = {
|
|
25
|
+
async removeArtifactBehindTheScenes(scopeKey, attachmentId) {
|
|
26
|
+
(0, _store.existingScopeStore)('conformance', scopeKey)?.artifacts.delete(attachmentId);
|
|
27
|
+
},
|
|
28
|
+
async removeReferenceBehindTheScenes(scopeKey, attachmentId) {
|
|
29
|
+
(0, _store.existingScopeStore)('conformance', scopeKey)?.attachments.delete(attachmentId);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** Return every in-memory database to a known-empty state (FR-093). */
|
|
34
|
+
async function resetMemoryAdapter(_adapter) {
|
|
35
|
+
(0, _store.resetAllMemoryStores)();
|
|
36
|
+
(0, _faults.clearFaults)();
|
|
37
|
+
}
|
|
38
|
+
async function seedRecords(adapter, config, collection, records) {
|
|
39
|
+
const handle = await adapter.open(config);
|
|
40
|
+
try {
|
|
41
|
+
const ops = handle.collection(collection);
|
|
42
|
+
for (const record of records) {
|
|
43
|
+
await ops.upsert(record);
|
|
44
|
+
}
|
|
45
|
+
} finally {
|
|
46
|
+
await handle.close();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=reset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_faults","require","_store","memoryConformanceHooks","exports","removeArtifactBehindTheScenes","scopeKey","attachmentId","existingScopeStore","artifacts","delete","removeReferenceBehindTheScenes","attachments","resetMemoryAdapter","_adapter","resetAllMemoryStores","clearFaults","seedRecords","adapter","config","collection","records","handle","open","ops","record","upsert","close"],"sourceRoot":"../../../../src","sources":["testing/memory-adapter/reset.ts"],"mappings":";;;;;;;;AAYA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACO,MAAME,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EACrC,MAAME,6BAA6BA,CAACC,QAAgB,EAAEC,YAAoB,EAAiB;IAC1F,IAAAC,yBAAkB,EAAC,aAAa,EAAEF,QAAQ,CAAC,EAAEG,SAAS,CAACC,MAAM,CAACH,YAAY,CAAC;EAC5E,CAAC;EACD,MAAMI,8BAA8BA,CAACL,QAAgB,EAAEC,YAAoB,EAAiB;IAC3F,IAAAC,yBAAkB,EAAC,aAAa,EAAEF,QAAQ,CAAC,EAAEM,WAAW,CAACF,MAAM,CAACH,YAAY,CAAC;EAC9E;AACD,CAAC;;AAED;AACO,eAAeM,kBAAkBA,CAACC,QAAyB,EAAiB;EAClF,IAAAC,2BAAoB,EAAC,CAAC;EACtB,IAAAC,mBAAW,EAAC,CAAC;AACd;AAEO,eAAeC,WAAWA,CAChCC,OAAuB,EACvBC,MAAsB,EACtBC,UAAkB,EAClBC,OAAyB,EACT;EAChB,MAAMC,MAAM,GAAG,MAAMJ,OAAO,CAACK,IAAI,CAACJ,MAAM,CAAC;EACzC,IAAI;IACH,MAAMK,GAAG,GAAGF,MAAM,CAACF,UAAU,CAAIA,UAAU,CAAC;IAC5C,KAAK,MAAMK,MAAM,IAAIJ,OAAO,EAAE;MAC7B,MAAMG,GAAG,CAACE,MAAM,CAACD,MAAM,CAAC;IACzB;EACD,CAAC,SAAS;IACT,MAAMH,MAAM,CAACK,KAAK,CAAC,CAAC;EACrB;AACD","ignoreList":[]}
|
|
@@ -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"],"mapp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C;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,E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