@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,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createMemoryCollection = createMemoryCollection;
|
|
7
|
+
var _errors = require("../../contract/errors.js");
|
|
8
|
+
var _errors2 = require("../../diagnostics/errors.js");
|
|
9
|
+
var _faults = require("../../diagnostics/faults.js");
|
|
10
|
+
var _budgets = require("../../query/budgets.js");
|
|
11
|
+
var _filter = require("../../query/filter.js");
|
|
12
|
+
var _paginate = require("../../query/paginate.js");
|
|
13
|
+
var _sort = require("../../query/sort.js");
|
|
14
|
+
var _validate = require("../../query/validate.js");
|
|
15
|
+
var _declare = require("../../schema/declare.js");
|
|
16
|
+
var _store = require("./store.js");
|
|
17
|
+
/**
|
|
18
|
+
* Collection operations over the in-memory store.
|
|
19
|
+
*
|
|
20
|
+
* Every semantic decision — filtering, sorting, paging — is delegated to
|
|
21
|
+
* `query/`, the module the SQLite adapter also validates through. Anything
|
|
22
|
+
* decided here instead would be a place the two adapters could drift.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
function notFound(collection, id) {
|
|
26
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.RECORD_NOT_FOUND, {
|
|
27
|
+
message: 'record not found',
|
|
28
|
+
detail: {
|
|
29
|
+
collection,
|
|
30
|
+
recordId: id
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function createMemoryCollection(context) {
|
|
35
|
+
const {
|
|
36
|
+
schema
|
|
37
|
+
} = context;
|
|
38
|
+
const rows = () => (0, _store.collectionMap)(context.store, schema.name);
|
|
39
|
+
const readable = includeSoftDeleted => {
|
|
40
|
+
const out = [];
|
|
41
|
+
for (const row of rows().values()) {
|
|
42
|
+
if (!includeSoftDeleted && row.deletedAt != null) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
out.push((0, _store.toStoredRecord)(row));
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
async insert(record) {
|
|
51
|
+
context.assertOpen();
|
|
52
|
+
(0, _faults.throwIfFaulted)('write');
|
|
53
|
+
(0, _budgets.assertRecordWithinBudget)(schema.name, record.data);
|
|
54
|
+
if (rows().has(record.id)) {
|
|
55
|
+
// Overwriting silently is how a caller loses data without ever
|
|
56
|
+
// seeing a failure.
|
|
57
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.RECORD_CONFLICT, {
|
|
58
|
+
message: 'record already exists',
|
|
59
|
+
detail: {
|
|
60
|
+
collection: schema.name,
|
|
61
|
+
recordId: record.id
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const now = context.now();
|
|
66
|
+
rows().set(record.id, {
|
|
67
|
+
id: record.id,
|
|
68
|
+
payload: (0, _store.encodePayload)(record.data),
|
|
69
|
+
createdAt: (0, _declare.hasTimestamps)(schema) ? now : undefined,
|
|
70
|
+
updatedAt: (0, _declare.hasTimestamps)(schema) ? now : undefined,
|
|
71
|
+
deletedAt: (0, _declare.hasSoftDelete)(schema) ? null : undefined
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
operation: 'created',
|
|
75
|
+
id: record.id
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
async update(id, record) {
|
|
79
|
+
context.assertOpen();
|
|
80
|
+
(0, _faults.throwIfFaulted)('write');
|
|
81
|
+
(0, _budgets.assertRecordWithinBudget)(schema.name, record.data);
|
|
82
|
+
const existing = rows().get(id);
|
|
83
|
+
if (!existing || existing.deletedAt != null) {
|
|
84
|
+
notFound(schema.name, id);
|
|
85
|
+
}
|
|
86
|
+
existing.payload = (0, _store.encodePayload)(record.data);
|
|
87
|
+
if ((0, _declare.hasTimestamps)(schema)) {
|
|
88
|
+
existing.updatedAt = context.now();
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
operation: 'updated',
|
|
92
|
+
id
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
async upsert(record) {
|
|
96
|
+
context.assertOpen();
|
|
97
|
+
(0, _faults.throwIfFaulted)('write');
|
|
98
|
+
(0, _budgets.assertRecordWithinBudget)(schema.name, record.data);
|
|
99
|
+
const existing = rows().get(record.id);
|
|
100
|
+
const now = context.now();
|
|
101
|
+
if (existing) {
|
|
102
|
+
existing.payload = (0, _store.encodePayload)(record.data);
|
|
103
|
+
if ((0, _declare.hasTimestamps)(schema)) {
|
|
104
|
+
existing.updatedAt = now;
|
|
105
|
+
}
|
|
106
|
+
existing.deletedAt = (0, _declare.hasSoftDelete)(schema) ? null : undefined;
|
|
107
|
+
return {
|
|
108
|
+
operation: 'updated',
|
|
109
|
+
id: record.id
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
rows().set(record.id, {
|
|
113
|
+
id: record.id,
|
|
114
|
+
payload: (0, _store.encodePayload)(record.data),
|
|
115
|
+
createdAt: (0, _declare.hasTimestamps)(schema) ? now : undefined,
|
|
116
|
+
updatedAt: (0, _declare.hasTimestamps)(schema) ? now : undefined,
|
|
117
|
+
deletedAt: (0, _declare.hasSoftDelete)(schema) ? null : undefined
|
|
118
|
+
});
|
|
119
|
+
return {
|
|
120
|
+
operation: 'created',
|
|
121
|
+
id: record.id
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
async get(id) {
|
|
125
|
+
context.assertOpen();
|
|
126
|
+
(0, _faults.throwIfFaulted)('read');
|
|
127
|
+
const row = rows().get(id);
|
|
128
|
+
if (!row || row.deletedAt != null) {
|
|
129
|
+
notFound(schema.name, id);
|
|
130
|
+
}
|
|
131
|
+
return (0, _store.toStoredRecord)(row);
|
|
132
|
+
},
|
|
133
|
+
async find(id) {
|
|
134
|
+
context.assertOpen();
|
|
135
|
+
(0, _faults.throwIfFaulted)('read');
|
|
136
|
+
const row = rows().get(id);
|
|
137
|
+
if (!row || row.deletedAt != null) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
return (0, _store.toStoredRecord)(row);
|
|
141
|
+
},
|
|
142
|
+
async delete(id) {
|
|
143
|
+
context.assertOpen();
|
|
144
|
+
(0, _faults.throwIfFaulted)('write');
|
|
145
|
+
if (!rows().delete(id)) {
|
|
146
|
+
notFound(schema.name, id);
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
operation: 'deleted',
|
|
150
|
+
id
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
async softDelete(id) {
|
|
154
|
+
context.assertOpen();
|
|
155
|
+
(0, _faults.throwIfFaulted)('write');
|
|
156
|
+
if (!(0, _declare.hasSoftDelete)(schema)) {
|
|
157
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.CONFIG_INVALID, {
|
|
158
|
+
message: 'collection does not declare soft delete',
|
|
159
|
+
detail: {
|
|
160
|
+
collection: schema.name
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
const row = rows().get(id);
|
|
165
|
+
if (!row || row.deletedAt != null) {
|
|
166
|
+
notFound(schema.name, id);
|
|
167
|
+
}
|
|
168
|
+
row.deletedAt = context.now();
|
|
169
|
+
return {
|
|
170
|
+
operation: 'deleted',
|
|
171
|
+
id
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
async restore(id) {
|
|
175
|
+
context.assertOpen();
|
|
176
|
+
(0, _faults.throwIfFaulted)('write');
|
|
177
|
+
if (!(0, _declare.hasSoftDelete)(schema)) {
|
|
178
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.CONFIG_INVALID, {
|
|
179
|
+
message: 'collection does not declare soft delete',
|
|
180
|
+
detail: {
|
|
181
|
+
collection: schema.name
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
const row = rows().get(id);
|
|
186
|
+
if (!row || row.deletedAt == null) {
|
|
187
|
+
notFound(schema.name, id);
|
|
188
|
+
}
|
|
189
|
+
row.deletedAt = null;
|
|
190
|
+
return {
|
|
191
|
+
operation: 'restored',
|
|
192
|
+
id
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
async list(query) {
|
|
196
|
+
context.assertOpen();
|
|
197
|
+
(0, _faults.throwIfFaulted)('read');
|
|
198
|
+
(0, _validate.validateQuery)(schema, query);
|
|
199
|
+
const sort = (0, _sort.withStableTiebreaker)(query?.sort);
|
|
200
|
+
const size = (0, _paginate.resolvePageSize)(query?.page);
|
|
201
|
+
let matched = readable(query?.includeSoftDeleted === true);
|
|
202
|
+
if (query?.filter) {
|
|
203
|
+
matched = matched.filter(record => (0, _filter.evaluateFilter)(record.data, query.filter));
|
|
204
|
+
}
|
|
205
|
+
const ordered = (0, _paginate.applyCursor)((0, _sort.sortRecords)(matched, sort), sort, query?.page?.cursor);
|
|
206
|
+
return (0, _paginate.buildPage)(ordered.slice(0, size + 1), sort, size);
|
|
207
|
+
},
|
|
208
|
+
async count(filter) {
|
|
209
|
+
context.assertOpen();
|
|
210
|
+
(0, _faults.throwIfFaulted)('read');
|
|
211
|
+
if (filter) {
|
|
212
|
+
(0, _validate.validateQuery)(schema, {
|
|
213
|
+
filter
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
const matched = readable(false);
|
|
217
|
+
if (!filter) {
|
|
218
|
+
return matched.length;
|
|
219
|
+
}
|
|
220
|
+
return matched.filter(record => (0, _filter.evaluateFilter)(record.data, filter)).length;
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","require","_errors2","_faults","_budgets","_filter","_paginate","_sort","_validate","_declare","_store","notFound","collection","id","raise","DiagnosticCodes","RECORD_NOT_FOUND","message","detail","recordId","createMemoryCollection","context","schema","rows","collectionMap","store","name","readable","includeSoftDeleted","out","row","values","deletedAt","push","toStoredRecord","insert","record","assertOpen","throwIfFaulted","assertRecordWithinBudget","data","has","RECORD_CONFLICT","now","set","payload","encodePayload","createdAt","hasTimestamps","undefined","updatedAt","hasSoftDelete","operation","update","existing","get","upsert","find","delete","softDelete","CONFIG_INVALID","restore","list","query","validateQuery","sort","withStableTiebreaker","size","resolvePageSize","page","matched","filter","evaluateFilter","ordered","applyCursor","sortRecords","cursor","buildPage","slice","count","length"],"sourceRoot":"../../../../src","sources":["testing/memory-adapter/collection.ts"],"mappings":";;;;;;AAQA,IAAAA,OAAA,GAAAC,OAAA;AAUA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AA1BA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6BA,SAASU,QAAQA,CAACC,UAAkB,EAAEC,EAAU,EAAS;EACxD,IAAAC,cAAK,EAACC,uBAAe,CAACC,gBAAgB,EAAE;IACvCC,OAA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ACC,MAAM,CAACnC,MAAM,IAAI,IAAAoC,sBAAc,EAACpC,MAAM,CAACI,IAAI,EAAE+B,MAAM,CAAC,CAAC,CAACS,MAAM;IAC5E;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Budgets", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _config.Budgets;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "activeFaults", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _faults.activeFaults;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.createMemoryAdapter = createMemoryAdapter;
|
|
19
|
+
var _transactionQueue = require("../../sqlite/transaction-queue.js");
|
|
20
|
+
var _errors = require("../../contract/errors.js");
|
|
21
|
+
var _keyProvider = require("../../crypto/key-provider.js");
|
|
22
|
+
var _devLog = require("../../diagnostics/dev-log.js");
|
|
23
|
+
var _errors2 = require("../../diagnostics/errors.js");
|
|
24
|
+
var _budgets = require("../../query/budgets.js");
|
|
25
|
+
var _validateConfig = require("../../schema/validate-config.js");
|
|
26
|
+
var _validate = require("../../scope/validate.js");
|
|
27
|
+
var _migrations = require("./migrations.js");
|
|
28
|
+
var _collection = require("./collection.js");
|
|
29
|
+
var _store = require("./store.js");
|
|
30
|
+
var _attachments = require("./attachments.js");
|
|
31
|
+
var _faults = require("../faults.js");
|
|
32
|
+
var _config = require("../../contract/config.js");
|
|
33
|
+
/**
|
|
34
|
+
* The in-memory adapter.
|
|
35
|
+
*
|
|
36
|
+
* Not a convenience: op-sqlite is native and unreachable from Jest, so this
|
|
37
|
+
* is the only way the package's own guarantees are testable in CI
|
|
38
|
+
* (research.md R8). Documented divergences are listed in the package README.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
function schemaIndex(collections) {
|
|
42
|
+
return new Map(collections.map(collection => [collection.name, collection]));
|
|
43
|
+
}
|
|
44
|
+
function cloneCollections(store) {
|
|
45
|
+
const copy = new Map();
|
|
46
|
+
for (const [name, rows] of store.collections) {
|
|
47
|
+
copy.set(name, new Map([...rows].map(([id, row]) => [id, {
|
|
48
|
+
...row
|
|
49
|
+
}])));
|
|
50
|
+
}
|
|
51
|
+
return copy;
|
|
52
|
+
}
|
|
53
|
+
function createMemoryAdapter(options = {}) {
|
|
54
|
+
const now = options.now ?? (() => Date.now());
|
|
55
|
+
async function open(config) {
|
|
56
|
+
(0, _validateConfig.validateConfig)(config);
|
|
57
|
+
(0, _faults.throwIfFaulted)('open');
|
|
58
|
+
const scope = (0, _validate.resolveScope)(config.scope);
|
|
59
|
+
const existing = (0, _store.existingScopeStore)(config.name, scope.key);
|
|
60
|
+
if (existing?.deletionState === 'deleting') {
|
|
61
|
+
// A deletion that was interrupted must never look complete.
|
|
62
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.SCOPE_DELETED, {
|
|
63
|
+
message: 'scope deletion was interrupted',
|
|
64
|
+
detail: {
|
|
65
|
+
scopeKey: scope.key
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const store = (0, _store.scopeStoreFor)(config.name, scope.key);
|
|
70
|
+
const encryptionRequested = config.encryption?.enabled === true;
|
|
71
|
+
if (store.schemaVersion > 0 && store.encrypted !== encryptionRequested) {
|
|
72
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.ENCRYPTION_MISMATCH, {
|
|
73
|
+
message: 'encryption posture does not match the stored database'
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (encryptionRequested) {
|
|
77
|
+
// The same acquisition path the on-device adapter uses, so a locked
|
|
78
|
+
// keychain and a provider returning nothing stay as distinguishable
|
|
79
|
+
// here as they are on a phone (SC-020b). Released immediately: the
|
|
80
|
+
// in-memory store has nothing to encrypt with it.
|
|
81
|
+
const key = await (0, _keyProvider.acquireKey)(config.encryption, scope);
|
|
82
|
+
key.release();
|
|
83
|
+
}
|
|
84
|
+
store.encrypted = encryptionRequested;
|
|
85
|
+
store.backupIncluded = config.backup?.includeInPlatformBackup === true;
|
|
86
|
+
const schemas = schemaIndex(config.collections);
|
|
87
|
+
for (const collection of config.collections) {
|
|
88
|
+
(0, _store.collectionMap)(store, collection.name);
|
|
89
|
+
}
|
|
90
|
+
await (0, _migrations.runMigrations)(store, config, now);
|
|
91
|
+
let closed = false;
|
|
92
|
+
const assertOpen = () => {
|
|
93
|
+
if (closed) {
|
|
94
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.CLOSED_HANDLE, {
|
|
95
|
+
message: 'handle is closed'
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (store.deletionState === 'deleting') {
|
|
99
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.SCOPE_DELETED, {
|
|
100
|
+
message: 'scope was deleted beneath this handle',
|
|
101
|
+
detail: {
|
|
102
|
+
scopeKey: scope.key
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The same isolation the SQLite connection gives: a transaction holds the
|
|
110
|
+
* handle until it settles, and work through the handle meanwhile waits
|
|
111
|
+
* rather than landing inside the transaction's snapshot and vanishing
|
|
112
|
+
* with its rollback. Only what the transaction hands out runs inside it.
|
|
113
|
+
*/
|
|
114
|
+
const queue = (0, _transactionQueue.createTransactionQueue)();
|
|
115
|
+
const queued = ops => Object.fromEntries(Object.entries(ops).map(([key, value]) => [key, typeof value === 'function' ? (...args) => queue.run(() => value(...args)) : value]));
|
|
116
|
+
|
|
117
|
+
/** Artifact deletions held back until the transaction that caused them commits. */
|
|
118
|
+
|
|
119
|
+
/** FR-070 for the memory adapter, with the SQLite adapter's ordering and reporting. */
|
|
120
|
+
const cascadeFor = (collection, id, deferred) => {
|
|
121
|
+
const removedArtifacts = [];
|
|
122
|
+
for (const reference of [...store.attachments.values()]) {
|
|
123
|
+
if (reference.owner?.collection !== collection || reference.owner?.id !== id) continue;
|
|
124
|
+
store.attachments.delete(reference.id);
|
|
125
|
+
if (deferred) {
|
|
126
|
+
deferred.add(reference.id);
|
|
127
|
+
} else {
|
|
128
|
+
store.artifacts.delete(reference.id);
|
|
129
|
+
}
|
|
130
|
+
removedArtifacts.push(reference.id);
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
removedRecords: 0,
|
|
134
|
+
removedArtifacts,
|
|
135
|
+
orphanedReferences: [],
|
|
136
|
+
failedRemovals: []
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
const rawCollectionFor = (name, deferred) => {
|
|
140
|
+
assertOpen();
|
|
141
|
+
const schema = schemas.get(name);
|
|
142
|
+
if (!schema) {
|
|
143
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.CONFIG_INVALID, {
|
|
144
|
+
message: 'collection is not declared',
|
|
145
|
+
detail: {
|
|
146
|
+
collection: name
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
const ops = (0, _devLog.instrument)(name, 'memory', (0, _collection.createMemoryCollection)({
|
|
151
|
+
store,
|
|
152
|
+
schema,
|
|
153
|
+
now,
|
|
154
|
+
assertOpen
|
|
155
|
+
}));
|
|
156
|
+
if (config.cascadeAttachments !== true) {
|
|
157
|
+
return ops;
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
...ops,
|
|
161
|
+
async delete(id) {
|
|
162
|
+
const outcome = await ops.delete(id);
|
|
163
|
+
return {
|
|
164
|
+
...outcome,
|
|
165
|
+
cascade: cascadeFor(name, id, deferred)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
const collectionFor = name => queued(rawCollectionFor(name));
|
|
171
|
+
const backupPosture = {
|
|
172
|
+
requested: store.backupIncluded ? 'included' : 'excluded',
|
|
173
|
+
observed: store.backupIncluded ? 'included' : 'excluded',
|
|
174
|
+
enforcedBy: 'package'
|
|
175
|
+
};
|
|
176
|
+
const rawAttachments = (0, _attachments.createMemoryAttachments)({
|
|
177
|
+
store,
|
|
178
|
+
options,
|
|
179
|
+
now,
|
|
180
|
+
assertOpen
|
|
181
|
+
});
|
|
182
|
+
const attachments = queued(rawAttachments());
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* One transaction against the store. Snapshot-and-restore rather than a
|
|
186
|
+
* write log: simpler to reason about, and rollback fidelity is what US4
|
|
187
|
+
* tests. Runs only inside `exclusive`, so the snapshot never captures,
|
|
188
|
+
* nor its restore erases, a write made from outside.
|
|
189
|
+
*/
|
|
190
|
+
const runTransaction = async fn => {
|
|
191
|
+
const snapshot = cloneCollections(store);
|
|
192
|
+
const attachmentSnapshot = new Map(store.attachments);
|
|
193
|
+
const pendingArtifactRemovals = [];
|
|
194
|
+
const deferred = {
|
|
195
|
+
add: id => pendingArtifactRemovals.push(id)
|
|
196
|
+
};
|
|
197
|
+
let settled = false;
|
|
198
|
+
const assertLive = () => {
|
|
199
|
+
if (settled) {
|
|
200
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.TRANSACTION_STATE, {
|
|
201
|
+
message: 'transaction already settled'
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const rollback = () => {
|
|
206
|
+
store.collections = snapshot;
|
|
207
|
+
store.attachments = attachmentSnapshot;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// A collection taken from the transaction keeps refusing once it
|
|
211
|
+
// settles, as the SQLite executor does; otherwise a write after abort
|
|
212
|
+
// would land straight in the store.
|
|
213
|
+
const live = ops => Object.fromEntries(Object.entries(ops).map(([key, value]) => [key, typeof value === 'function' ?
|
|
214
|
+
// Async so a refusal rejects, as the SQLite executor's does.
|
|
215
|
+
async (...args) => {
|
|
216
|
+
assertLive();
|
|
217
|
+
return value(...args);
|
|
218
|
+
} : value]));
|
|
219
|
+
const tx = {
|
|
220
|
+
collection: name => {
|
|
221
|
+
assertLive();
|
|
222
|
+
return live(rawCollectionFor(name, deferred));
|
|
223
|
+
},
|
|
224
|
+
attachments: () => {
|
|
225
|
+
assertLive();
|
|
226
|
+
return rawAttachments(deferred);
|
|
227
|
+
},
|
|
228
|
+
async abort() {
|
|
229
|
+
assertLive();
|
|
230
|
+
settled = true;
|
|
231
|
+
rollback();
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
try {
|
|
235
|
+
const result = await fn(tx);
|
|
236
|
+
if (!settled) {
|
|
237
|
+
(0, _faults.throwIfFaulted)('commit');
|
|
238
|
+
settled = true;
|
|
239
|
+
// Committed: the artifacts whose references went may go too.
|
|
240
|
+
for (const id of pendingArtifactRemovals) {
|
|
241
|
+
store.artifacts.delete(id);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return result;
|
|
245
|
+
} catch (error) {
|
|
246
|
+
if (!settled) {
|
|
247
|
+
settled = true;
|
|
248
|
+
rollback();
|
|
249
|
+
}
|
|
250
|
+
throw error;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
const handle = {
|
|
254
|
+
scopeKey: scope.key,
|
|
255
|
+
schemaVersion: store.schemaVersion,
|
|
256
|
+
backupPosture,
|
|
257
|
+
isEncrypted: store.encrypted,
|
|
258
|
+
collection: collectionFor,
|
|
259
|
+
transaction(fn) {
|
|
260
|
+
assertOpen();
|
|
261
|
+
return queue.runTransaction(() => runTransaction(fn));
|
|
262
|
+
},
|
|
263
|
+
batch(operations) {
|
|
264
|
+
assertOpen();
|
|
265
|
+
(0, _budgets.assertBatchWithinBudget)(operations.length);
|
|
266
|
+
return queue.runTransaction(() => runTransaction(async tx => {
|
|
267
|
+
const outcomes = [];
|
|
268
|
+
for (const operation of operations) {
|
|
269
|
+
const ops = tx.collection(operation.collection);
|
|
270
|
+
switch (operation.type) {
|
|
271
|
+
case 'insert':
|
|
272
|
+
outcomes.push(await ops.insert(operation.record));
|
|
273
|
+
break;
|
|
274
|
+
case 'update':
|
|
275
|
+
outcomes.push(await ops.update(operation.id, {
|
|
276
|
+
data: operation.data
|
|
277
|
+
}));
|
|
278
|
+
break;
|
|
279
|
+
case 'upsert':
|
|
280
|
+
outcomes.push(await ops.upsert(operation.record));
|
|
281
|
+
break;
|
|
282
|
+
case 'delete':
|
|
283
|
+
outcomes.push(await ops.delete(operation.id));
|
|
284
|
+
break;
|
|
285
|
+
case 'softDelete':
|
|
286
|
+
outcomes.push(await ops.softDelete(operation.id));
|
|
287
|
+
break;
|
|
288
|
+
default:
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return {
|
|
293
|
+
applied: outcomes.length,
|
|
294
|
+
outcomes
|
|
295
|
+
};
|
|
296
|
+
}));
|
|
297
|
+
},
|
|
298
|
+
attachments: () => attachments,
|
|
299
|
+
async explain(collection, _query) {
|
|
300
|
+
assertOpen();
|
|
301
|
+
// Documented divergence: index declarations are validated but
|
|
302
|
+
// have no performance effect in memory (FR-096).
|
|
303
|
+
return {
|
|
304
|
+
collection,
|
|
305
|
+
usesIndex: false,
|
|
306
|
+
detail: 'memory adapter does not use indexes'
|
|
307
|
+
};
|
|
308
|
+
},
|
|
309
|
+
async close() {
|
|
310
|
+
closed = true;
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
return handle;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Backs both `deleteScopeData` and `resetScope`. They differ in intent and
|
|
318
|
+
* in what they let a consumer conclude, not in what they do to the store —
|
|
319
|
+
* keeping them as separate exported names is what makes the destructive one
|
|
320
|
+
* impossible to call by accident.
|
|
321
|
+
*/
|
|
322
|
+
async function removeScope(config) {
|
|
323
|
+
const scope = (0, _validate.resolveScope)(config.scope);
|
|
324
|
+
const store = (0, _store.existingScopeStore)(config.name, scope.key);
|
|
325
|
+
if (!store) {
|
|
326
|
+
// Deleting nothing is success, not an error (FR-062).
|
|
327
|
+
return {
|
|
328
|
+
scopeKey: scope.key,
|
|
329
|
+
removedRecords: 0,
|
|
330
|
+
removedArtifacts: [],
|
|
331
|
+
orphanedReferences: [],
|
|
332
|
+
failedRemovals: []
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
store.deletionState = 'deleting';
|
|
336
|
+
let removedRecords = 0;
|
|
337
|
+
for (const rows of store.collections.values()) {
|
|
338
|
+
removedRecords += rows.size;
|
|
339
|
+
}
|
|
340
|
+
const removedArtifacts = [...store.artifacts.keys()];
|
|
341
|
+
(0, _store.dropScope)(config.name, scope.key);
|
|
342
|
+
return {
|
|
343
|
+
scopeKey: scope.key,
|
|
344
|
+
removedRecords,
|
|
345
|
+
removedArtifacts,
|
|
346
|
+
orphanedReferences: [],
|
|
347
|
+
failedRemovals: []
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
name: 'memory',
|
|
352
|
+
open,
|
|
353
|
+
deleteScopeData: config => removeScope(config),
|
|
354
|
+
resetScope: config => removeScope(config),
|
|
355
|
+
async deleteDatabase(config) {
|
|
356
|
+
(0, _store.dropDatabase)(config.name);
|
|
357
|
+
return {
|
|
358
|
+
removedRecords: 0,
|
|
359
|
+
removedArtifacts: [],
|
|
360
|
+
orphanedReferences: [],
|
|
361
|
+
failedRemovals: []
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_transactionQueue","require","_errors","_keyProvider","_devLog","_errors2","_budgets","_validateConfig","_validate","_migrations","_collection","_store","_attachments","_faults","_config","schemaIndex","collections","Map","map","collection","name","cloneCollections","store","copy","rows","set","id","row","createMemoryAdapter","options","now","Date","open","config","validateConfig","throwIfFaulted","scope","resolveScope","existing","existingScopeStore","key","deletionState","raise","DiagnosticCodes","SCOPE_DELETED","message","detail","scopeKey","scopeStoreFor","encryptionRequested","encryption","enabled","schemaVersion","encrypted","ENCRYPTION_MISMATCH","acquireKey","release","backupIncluded","backup","includeInPlatformBackup","schemas","collectionMap","runMigrations","closed","assertOpen","CLOSED_HANDLE","queue","createTransactionQueue","queued","ops","Object","fromEntries","entries","value","args","run","cascadeFor","deferred","removedArtifacts","reference","attachments","values","owner","delete","add","artifacts","push","removedRecords","orphanedReferences","failedRemovals","rawCollectionFor","schema","get","CONFIG_INVALID","instrument","createMemoryCollection","cascadeAttachments","outcome","cascade","collectionFor","backupPosture","requested","observed","enforcedBy","rawAttachments","createMemoryAttachments","runTransaction","fn","snapshot","attachmentSnapshot","pendingArtifactRemovals","settled","assertLive","TRANSACTION_STATE","rollback","live","tx","abort","result","error","handle","isEncrypted","transaction","batch","operations","assertBatchWithinBudget","length","outcomes","operation","type","insert","record","update","data","upsert","softDelete","applied","explain","_query","usesIndex","close","removeScope","size","keys","dropScope","deleteScopeData","resetScope","deleteDatabase","dropDatabase"],"sourceRoot":"../../../../src","sources":["testing/memory-adapter/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,IAAAA,iBAAA,GAAAC,OAAA;AAQA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAQA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AA+WA,IAAAa,OAAA,GAAAb,OAAA;AA3ZA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmDA,SAASc,WAAWA,CAACC,WAA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