@chipmobilesdk/rn-local-db 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +160 -1
- package/README.md +99 -19
- 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/skills/sdk-rn-local-db/SKILL.md +1 -1
- package/src/adapter/budgets.ts +1 -10
- package/src/adapter/collection.ts +38 -66
- package/src/adapter/deletion.ts +48 -0
- package/src/adapter/handle.ts +311 -0
- package/src/adapter/lifecycle.ts +10 -338
- package/src/adapter/schema-sync.ts +155 -0
- package/src/artifacts/cascade.ts +0 -14
- package/src/artifacts/store.ts +60 -10
- package/src/contract/attachment.ts +24 -3
- package/src/contract/migration.ts +4 -1
- package/src/crypto/provider.ts +7 -3
- package/src/diagnostics/dev-log.ts +5 -1
- package/src/migration/executor.ts +27 -6
- package/src/migration/ledger.ts +18 -27
- package/src/platform/fs.ts +2 -8
- package/src/platform/location.ts +0 -3
- package/src/query/budgets.ts +32 -5
- package/src/schema/validate-config.ts +3 -53
- package/src/sqlite/batch.ts +40 -51
- package/src/sqlite/connection.ts +0 -9
- package/src/sqlite/row-codec.ts +5 -2
- package/src/sqlite/statements.ts +74 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/memory-adapter/attachments.ts +146 -0
- package/src/testing/memory-adapter/index.ts +13 -111
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createSqlCollection = createSqlCollection;
|
|
7
|
+
var _errors = require("../contract/errors.js");
|
|
8
|
+
var _errors2 = require("../diagnostics/errors.js");
|
|
9
|
+
var _faults = require("../diagnostics/faults.js");
|
|
10
|
+
var _cursor = require("../query/cursor.js");
|
|
11
|
+
var _paginate = require("../query/paginate.js");
|
|
12
|
+
var _sort = require("../query/sort.js");
|
|
13
|
+
var _validate = require("../query/validate.js");
|
|
14
|
+
var _declare = require("../schema/declare.js");
|
|
15
|
+
var _rowCodec = require("../sqlite/row-codec.js");
|
|
16
|
+
var _sqlBuilder = require("../sqlite/sql-builder.js");
|
|
17
|
+
var _statements = require("../sqlite/statements.js");
|
|
18
|
+
var _budgets = require("./budgets.js");
|
|
19
|
+
/**
|
|
20
|
+
* Collection operations against a SQLite executor.
|
|
21
|
+
*
|
|
22
|
+
* The executor is either the connection or the transaction in flight on it,
|
|
23
|
+
* which is what gives read-your-own-writes for free (FR-043): a read inside a
|
|
24
|
+
* transaction runs on the same handle that made the writes, so it sees them,
|
|
25
|
+
* and a reader outside does not.
|
|
26
|
+
*
|
|
27
|
+
* Every semantic decision that could differ between the two adapters —
|
|
28
|
+
* which operators mean what, how nulls sort, what a cursor points at — is
|
|
29
|
+
* delegated to `query/`. This file decides only how to say it in SQL.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const LIVE = 'deleted_at IS NULL';
|
|
33
|
+
function notFound(collection, id) {
|
|
34
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.RECORD_NOT_FOUND, {
|
|
35
|
+
message: 'record not found',
|
|
36
|
+
detail: {
|
|
37
|
+
collection,
|
|
38
|
+
recordId: id
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function createSqlCollection(context) {
|
|
43
|
+
const {
|
|
44
|
+
schema
|
|
45
|
+
} = context;
|
|
46
|
+
const table = `"${(0, _declare.collectionTable)(schema.name)}"`;
|
|
47
|
+
const selectColumns = ['id', 'payload', 'created_at', 'updated_at', 'deleted_at'].join(', ');
|
|
48
|
+
async function rowById(id, includeDeleted = false) {
|
|
49
|
+
const result = await context.executor().execute(`SELECT ${selectColumns} FROM ${table} WHERE id = ?${includeDeleted ? '' : ` AND ${LIVE}`}`, [id]);
|
|
50
|
+
return result.rows[0];
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
async insert(record) {
|
|
54
|
+
context.assertUsable();
|
|
55
|
+
(0, _faults.throwIfFaulted)('write');
|
|
56
|
+
const payload = (0, _budgets.assertRecordWithinBudget)(schema.name, record.data);
|
|
57
|
+
|
|
58
|
+
// One statement: a row that is already there is left untouched and
|
|
59
|
+
// reported, instead of a SELECT first and an INSERT after (LDB-08). The
|
|
60
|
+
// failure stays boring — nothing was written, and no engine error
|
|
61
|
+
// surfaces from inside a transaction.
|
|
62
|
+
const result = await context.executor().execute(...(0, _statements.insertStatement)(schema, record.id, record.data, context.now(), payload, 'ignore'));
|
|
63
|
+
if (result.rowsAffected === 0) {
|
|
64
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.RECORD_CONFLICT, {
|
|
65
|
+
message: 'record already exists',
|
|
66
|
+
detail: {
|
|
67
|
+
collection: schema.name,
|
|
68
|
+
recordId: record.id
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
operation: 'created',
|
|
74
|
+
id: record.id
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
async update(id, record) {
|
|
78
|
+
context.assertUsable();
|
|
79
|
+
(0, _faults.throwIfFaulted)('write');
|
|
80
|
+
const payload = (0, _budgets.assertRecordWithinBudget)(schema.name, record.data);
|
|
81
|
+
const result = await context.executor().execute(...(0, _statements.updateStatement)(schema, id, record.data, context.now(), payload, {
|
|
82
|
+
liveOnly: true
|
|
83
|
+
}));
|
|
84
|
+
if (result.rowsAffected === 0) {
|
|
85
|
+
// Creating the record instead would be a silent write to an id
|
|
86
|
+
// the caller believed already existed.
|
|
87
|
+
notFound(schema.name, id);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
operation: 'updated',
|
|
91
|
+
id
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
async upsert(record) {
|
|
95
|
+
context.assertUsable();
|
|
96
|
+
(0, _faults.throwIfFaulted)('write');
|
|
97
|
+
const payload = (0, _budgets.assertRecordWithinBudget)(schema.name, record.data);
|
|
98
|
+
const now = context.now();
|
|
99
|
+
|
|
100
|
+
// An upsert over a soft-deleted record brings it back: the caller
|
|
101
|
+
// asked for this id to hold this data.
|
|
102
|
+
const update = async () => {
|
|
103
|
+
const result = await context.executor().execute(...(0, _statements.updateStatement)(schema, record.id, record.data, now, payload, {
|
|
104
|
+
restore: true
|
|
105
|
+
}));
|
|
106
|
+
return result.rowsAffected > 0;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// The update is tried first: one round-trip for a record that exists,
|
|
110
|
+
// with no SELECT before it (LDB-08).
|
|
111
|
+
if (await update()) {
|
|
112
|
+
return {
|
|
113
|
+
operation: 'updated',
|
|
114
|
+
id: record.id
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const inserted = await context.executor().execute(...(0, _statements.insertStatement)(schema, record.id, record.data, now, payload, 'ignore'));
|
|
118
|
+
if (inserted.rowsAffected > 0) {
|
|
119
|
+
return {
|
|
120
|
+
operation: 'created',
|
|
121
|
+
id: record.id
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// Another write created the row between the two statements.
|
|
125
|
+
await update();
|
|
126
|
+
return {
|
|
127
|
+
operation: 'updated',
|
|
128
|
+
id: record.id
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
async get(id) {
|
|
132
|
+
context.assertUsable();
|
|
133
|
+
(0, _faults.throwIfFaulted)('read');
|
|
134
|
+
const row = await rowById(id);
|
|
135
|
+
if (!row) {
|
|
136
|
+
notFound(schema.name, id);
|
|
137
|
+
}
|
|
138
|
+
return (0, _rowCodec.decodeRow)(schema, row);
|
|
139
|
+
},
|
|
140
|
+
async find(id) {
|
|
141
|
+
context.assertUsable();
|
|
142
|
+
(0, _faults.throwIfFaulted)('read');
|
|
143
|
+
const row = await rowById(id);
|
|
144
|
+
return row ? (0, _rowCodec.decodeRow)(schema, row) : null;
|
|
145
|
+
},
|
|
146
|
+
async delete(id) {
|
|
147
|
+
context.assertUsable();
|
|
148
|
+
(0, _faults.throwIfFaulted)('write');
|
|
149
|
+
const result = await context.executor().execute(`DELETE FROM ${table} WHERE id = ?`, [id]);
|
|
150
|
+
if (result.rowsAffected === 0) {
|
|
151
|
+
notFound(schema.name, id);
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
operation: 'deleted',
|
|
155
|
+
id
|
|
156
|
+
};
|
|
157
|
+
},
|
|
158
|
+
async softDelete(id) {
|
|
159
|
+
context.assertUsable();
|
|
160
|
+
(0, _faults.throwIfFaulted)('write');
|
|
161
|
+
if (!(0, _declare.hasSoftDelete)(schema)) {
|
|
162
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.CONFIG_INVALID, {
|
|
163
|
+
message: 'collection does not declare soft delete',
|
|
164
|
+
detail: {
|
|
165
|
+
collection: schema.name
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const result = await context.executor().execute(`UPDATE ${table} SET deleted_at = ? WHERE id = ? AND ${LIVE}`, [context.now(), id]);
|
|
170
|
+
if (result.rowsAffected === 0) {
|
|
171
|
+
notFound(schema.name, id);
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
operation: 'deleted',
|
|
175
|
+
id
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
async restore(id) {
|
|
179
|
+
context.assertUsable();
|
|
180
|
+
(0, _faults.throwIfFaulted)('write');
|
|
181
|
+
if (!(0, _declare.hasSoftDelete)(schema)) {
|
|
182
|
+
(0, _errors2.raise)(_errors.DiagnosticCodes.CONFIG_INVALID, {
|
|
183
|
+
message: 'collection does not declare soft delete',
|
|
184
|
+
detail: {
|
|
185
|
+
collection: schema.name
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
const result = await context.executor().execute(`UPDATE ${table} SET deleted_at = NULL WHERE id = ? AND deleted_at IS NOT NULL`, [id]);
|
|
190
|
+
if (result.rowsAffected === 0) {
|
|
191
|
+
notFound(schema.name, id);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
operation: 'restored',
|
|
195
|
+
id
|
|
196
|
+
};
|
|
197
|
+
},
|
|
198
|
+
async list(query) {
|
|
199
|
+
context.assertUsable();
|
|
200
|
+
(0, _faults.throwIfFaulted)('read');
|
|
201
|
+
(0, _validate.validateQuery)(schema, query);
|
|
202
|
+
const sort = (0, _sort.withStableTiebreaker)(query?.sort);
|
|
203
|
+
const size = (0, _paginate.resolvePageSize)(query?.page);
|
|
204
|
+
const filter = (0, _sqlBuilder.buildFilter)(query?.filter);
|
|
205
|
+
const clauses = [filter.sql];
|
|
206
|
+
const params = [...filter.params];
|
|
207
|
+
if (query?.includeSoftDeleted !== true) {
|
|
208
|
+
clauses.push(LIVE);
|
|
209
|
+
}
|
|
210
|
+
if (query?.page?.cursor) {
|
|
211
|
+
const keyset = (0, _sqlBuilder.buildKeysetPredicate)(sort, (0, _cursor.decodeCursor)(query.page.cursor, sort));
|
|
212
|
+
clauses.push(keyset.sql);
|
|
213
|
+
params.push(...keyset.params);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// One row past the page, so `hasMore` is answered without a second
|
|
217
|
+
// query that could disagree with the first under a concurrent write.
|
|
218
|
+
const limit = (0, _paginate.fetchLimitFor)(size);
|
|
219
|
+
const result = await context.executor().execute(`SELECT ${selectColumns} FROM ${table} WHERE ${clauses.join(' AND ')} ORDER BY ${(0, _sqlBuilder.buildOrderBy)(sort)} LIMIT ?`, [...params, limit]);
|
|
220
|
+
return (0, _paginate.buildPage)(result.rows.map(row => (0, _rowCodec.decodeRow)(schema, row)), sort, size);
|
|
221
|
+
},
|
|
222
|
+
async count(filter) {
|
|
223
|
+
context.assertUsable();
|
|
224
|
+
(0, _faults.throwIfFaulted)('read');
|
|
225
|
+
if (filter) {
|
|
226
|
+
(0, _validate.validateQuery)(schema, {
|
|
227
|
+
filter
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
const built = (0, _sqlBuilder.buildFilter)(filter);
|
|
231
|
+
const result = await context.executor().execute(`SELECT count(*) AS total FROM ${table} WHERE ${built.sql} AND ${LIVE}`, built.params);
|
|
232
|
+
return Number(result.rows[0]?.total ?? 0);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_errors","require","_errors2","_faults","_cursor","_paginate","_sort","_validate","_declare","_rowCodec","_sqlBuilder","_statements","_budgets","LIVE","notFound","collection","id","raise","DiagnosticCodes","RECORD_NOT_FOUND","message","detail","recordId","createSqlCollection","context","schema","table","collectionTable","name","selectColumns","join","rowById","includeDeleted","result","executor","execute","rows","insert","record","assertUsable","throwIfFaulted","payload","assertRecordWithinBudget","data","insertStatement","now","rowsAffected","RECORD_CONFLICT","operation","update","updateStatement","liveOnly","upsert","restore","inserted","get","row","decodeRow","find","delete","softDelete","hasSoftDelete","CONFIG_INVALID","list","query","validateQuery","sort","withStableTiebreaker","size","resolvePageSize","page","filter","buildFilter","clauses","sql","params","includeSoftDeleted","push","cursor","keyset","buildKeysetPredicate","decodeCursor","limit","fetchLimitFor","buildOrderBy","buildPage","map","count","built","Number","total"],"sourceRoot":"../../../src","sources":["adapter/collection.ts"],"mappings":";;;;;;AAaA,IAAAA,OAAA,GAAAC,OAAA;AAUA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,O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AC,uBAAa,EAACf,IAAI,CAAC;MACjC,MAAMnC,MAAM,GAAG,MAAMT,OAAO,CAC1BU,QAAQ,CAAC,CAAC,CACVC,OAAO,CACP,UAAUN,aAAa,SAASH,KAAK,UAAU+C,OAAO,CAAC3C,IAAI,CAC1D,OACD,CAAC,aAAa,IAAAsD,wBAAY,EAAClB,IAAI,CAAC,UAAU,EAC1C,CAAC,GAAGS,MAAM,EAAEO,KAAK,CAClB,CAAC;MAEF,OAAO,IAAAG,mBAAS,EACfpD,MAAM,CAACG,IAAI,CAACkD,GAAG,CAAC9B,GAAG,IAAI,IAAAC,mBAAS,EAAIhC,MAAM,EAAE+B,GAAG,CAAC,CAAC,EACjDU,IAAI,EACJE,IACD,CAAC;IACF,CAAC;IAED,MAAMmB,KAAKA,CAAChB,MAAmB,EAAmB;MACjD/C,OAAO,CAACe,YAAY,CAAC,CAAC;MACtB,IAAAC,sBAAc,EAAC,MAAM,CAAC;MACtB,IAAI+B,MAAM,EAAE;QACX,IAAAN,uBAAa,EAACxC,MAAM,EAAE;UAAE8C;QAAO,CAAC,CAAC;MAClC;MACA,MAAMiB,KAAK,GAAG,IAAAhB,uBAAW,EAACD,MAAM,CAAC;MACjC,MAAMtC,MAAM,GAAG,MAAMT,OAAO,CAC1BU,QAAQ,CAAC,CAAC,CACVC,OAAO,CACP,iCAAiCT,KAAK,UAAU8D,KAAK,CAACd,GAAG,QAAQ7D,IAAI,EAAE,EACvE2E,KAAK,CAACb,MACP,CAAC;MACF,OAAOc,MAAM,CAACxD,MAAM,CAACG,IAAI,CAAC,CAAC,CAAC,EAAEsD,KAAK,IAAI,CAAC,CAAC;IAC1C;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearAllInvalidations = clearAllInvalidations;
|
|
7
|
+
exports.clearScopeInvalidation = clearScopeInvalidation;
|
|
8
|
+
exports.deleteDatabase = deleteDatabase;
|
|
9
|
+
exports.deleteScopeData = deleteScopeData;
|
|
10
|
+
exports.emptyOutcome = emptyOutcome;
|
|
11
|
+
exports.isScopeInvalidated = isScopeInvalidated;
|
|
12
|
+
exports.markScopeInvalidated = markScopeInvalidated;
|
|
13
|
+
exports.registerOpenHandle = registerOpenHandle;
|
|
14
|
+
exports.resetScope = resetScope;
|
|
15
|
+
var _fs = require("../platform/fs.js");
|
|
16
|
+
var _location = require("../platform/location.js");
|
|
17
|
+
var _paths = require("../artifacts/paths.js");
|
|
18
|
+
var _keyProvider = require("../crypto/key-provider.js");
|
|
19
|
+
var _compare = require("../query/compare.js");
|
|
20
|
+
var _validate = require("../scope/validate.js");
|
|
21
|
+
var _catalog = require("../sqlite/catalog.js");
|
|
22
|
+
var _connection = require("../sqlite/connection.js");
|
|
23
|
+
var _values = require("../sqlite/values.js");
|
|
24
|
+
/**
|
|
25
|
+
* Deletion, and the ordering that makes an interrupted one visible.
|
|
26
|
+
*
|
|
27
|
+
* These are module-level functions rather than handle methods because they
|
|
28
|
+
* must work whether or not a handle is open on the target (FR-059) — a
|
|
29
|
+
* sign-out that already closed the handle still has to be able to delete, and
|
|
30
|
+
* an app recovering from a crash has no handle to call a method on.
|
|
31
|
+
*
|
|
32
|
+
* The order is: **mark `deleting` first, clear the catalog row last**
|
|
33
|
+
* (FR-061, FR-063). A crash at any point in between leaves the flag set, so
|
|
34
|
+
* the next open reports a scope mid-deletion rather than presenting it as
|
|
35
|
+
* complete. Clearing the row first would be the natural way to write this and
|
|
36
|
+
* would produce exactly the failure FR-063 exists to prevent: an
|
|
37
|
+
* interruption that looks like a success, leaving a user's data on disk after
|
|
38
|
+
* they asked for it to be gone.
|
|
39
|
+
*
|
|
40
|
+
* Nothing here ever runs on its own. No expiry, no sweep, no deletion on
|
|
41
|
+
* close or on app upgrade (FR-058) — the package deletes when asked, where
|
|
42
|
+
* asked, and not otherwise.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Scopes deleted beneath a handle that is still open.
|
|
47
|
+
*
|
|
48
|
+
* FR-059a wants the handle to report `SCOPE_DELETED` rather than keep
|
|
49
|
+
* answering from a database that no longer exists — and wants the deletion to
|
|
50
|
+
* proceed rather than wait for the handle to be closed. A shared set is the
|
|
51
|
+
* whole mechanism: the deleter records, the handle checks.
|
|
52
|
+
*/
|
|
53
|
+
const invalidated = new Set();
|
|
54
|
+
function invalidationKey(name, scopeKey) {
|
|
55
|
+
return `${name}:${scopeKey}`;
|
|
56
|
+
}
|
|
57
|
+
function markScopeInvalidated(name, scopeKey) {
|
|
58
|
+
invalidated.add(invalidationKey(name, scopeKey));
|
|
59
|
+
}
|
|
60
|
+
function clearScopeInvalidation(name, scopeKey) {
|
|
61
|
+
invalidated.delete(invalidationKey(name, scopeKey));
|
|
62
|
+
}
|
|
63
|
+
function isScopeInvalidated(name, scopeKey) {
|
|
64
|
+
return invalidated.has(invalidationKey(name, scopeKey));
|
|
65
|
+
}
|
|
66
|
+
function clearAllInvalidations() {
|
|
67
|
+
invalidated.clear();
|
|
68
|
+
openHandles.clear();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Handles open on a scope, so a deletion can take their connection away
|
|
73
|
+
* (LDB-14). Marking alone left the native connection and its handle slot held
|
|
74
|
+
* until the app closed a handle it had been told was dead: eight sign-outs
|
|
75
|
+
* later every open failed, with the unlinked file still pinned by its
|
|
76
|
+
* descriptor.
|
|
77
|
+
*/
|
|
78
|
+
const openHandles = new Map();
|
|
79
|
+
|
|
80
|
+
/** Returns the function that takes the handle out of the registry again. */
|
|
81
|
+
function registerOpenHandle(name, scopeKey, revoke) {
|
|
82
|
+
const key = invalidationKey(name, scopeKey);
|
|
83
|
+
const handles = openHandles.get(key) ?? new Set();
|
|
84
|
+
handles.add(revoke);
|
|
85
|
+
openHandles.set(key, handles);
|
|
86
|
+
return () => {
|
|
87
|
+
handles.delete(revoke);
|
|
88
|
+
if (handles.size === 0) {
|
|
89
|
+
openHandles.delete(key);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Every handle on the scope, or on any scope of the database when none is named. */
|
|
95
|
+
async function revokeHandles(name, scopeKey) {
|
|
96
|
+
const prefix = `${name}:`;
|
|
97
|
+
for (const [key, handles] of [...openHandles]) {
|
|
98
|
+
const matches = scopeKey === undefined ? key.startsWith(prefix) : key === invalidationKey(name, scopeKey);
|
|
99
|
+
if (!matches) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
openHandles.delete(key);
|
|
103
|
+
for (const revoke of handles) {
|
|
104
|
+
// A connection that will not close does not get to stop a deletion.
|
|
105
|
+
await revoke().catch(() => undefined);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Deleting a scope that holds nothing is success, not an error (FR-062). */
|
|
111
|
+
function emptyOutcome(scope) {
|
|
112
|
+
return {
|
|
113
|
+
...(scope ? {
|
|
114
|
+
scopeKey: scope.key
|
|
115
|
+
} : {}),
|
|
116
|
+
removedRecords: 0,
|
|
117
|
+
removedArtifacts: [],
|
|
118
|
+
orphanedReferences: [],
|
|
119
|
+
failedRemovals: []
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* How many records the scope held, best effort.
|
|
125
|
+
*
|
|
126
|
+
* Best effort because an encrypted scope whose caller supplied no key cannot
|
|
127
|
+
* be opened to be counted — and refusing to delete it on that basis would be
|
|
128
|
+
* the worst possible answer to a deletion request. The files come off disk
|
|
129
|
+
* either way; only the number in the report is unavailable.
|
|
130
|
+
*/
|
|
131
|
+
async function countRecords(layout, scopeKey, encryptionKey) {
|
|
132
|
+
let connection = null;
|
|
133
|
+
try {
|
|
134
|
+
connection = await (0, _connection.openConnection)({
|
|
135
|
+
path: layout.scopeDataPath(scopeKey),
|
|
136
|
+
...(encryptionKey ? {
|
|
137
|
+
encryptionKey
|
|
138
|
+
} : {})
|
|
139
|
+
});
|
|
140
|
+
const tables = await connection.execute("SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE 'c!_%' ESCAPE '!'");
|
|
141
|
+
let total = 0;
|
|
142
|
+
for (const row of tables.rows) {
|
|
143
|
+
const table = (0, _values.text)(row.name);
|
|
144
|
+
const counted = await connection.execute(`SELECT count(*) AS total FROM "${table}"`);
|
|
145
|
+
total += (0, _values.num)(counted.rows[0]?.total ?? 0);
|
|
146
|
+
}
|
|
147
|
+
return total;
|
|
148
|
+
} catch {
|
|
149
|
+
// Unknown, not zero: a report that said "0 records" about a scope it
|
|
150
|
+
// could not open would understate what was deleted.
|
|
151
|
+
return undefined;
|
|
152
|
+
} finally {
|
|
153
|
+
await connection?.close();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async function artifactIdsOnDisk(layout, scopeKey) {
|
|
157
|
+
try {
|
|
158
|
+
return (await (0, _fs.fileSystem)().readdir((0, _paths.artifactsDirectory)(layout, scopeKey))).sort(_compare.byteOrder);
|
|
159
|
+
} catch {
|
|
160
|
+
return [];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The one implementation behind `deleteScopeData` and `resetScope`.
|
|
166
|
+
*
|
|
167
|
+
* They do the same thing to disk and mean entirely different things to the
|
|
168
|
+
* caller: one is a lifecycle operation an app performs on request, the other
|
|
169
|
+
* is an admission that a database is broken and is being discarded to recover
|
|
170
|
+
* from it (FR-057a). Keeping them as two exported names with two docstrings
|
|
171
|
+
* is what stops the destructive one from being reached by accident — there is
|
|
172
|
+
* no path from `openDatabase` to either.
|
|
173
|
+
*/
|
|
174
|
+
async function removeScope(config) {
|
|
175
|
+
const scope = (0, _validate.resolveScope)(config.scope);
|
|
176
|
+
const layout = (0, _location.layoutFor)(config.name);
|
|
177
|
+
const catalog = await (0, _connection.openConnection)({
|
|
178
|
+
path: layout.catalogPath
|
|
179
|
+
});
|
|
180
|
+
try {
|
|
181
|
+
await (0, _catalog.ensureCatalog)(catalog);
|
|
182
|
+
const entry = await (0, _catalog.readEntry)(catalog, scope.key);
|
|
183
|
+
|
|
184
|
+
// Mark first. Everything after this point is recoverable-in-principle;
|
|
185
|
+
// this flag is what makes an interruption visible rather than silent.
|
|
186
|
+
if (entry) {
|
|
187
|
+
await (0, _catalog.markDeleting)(catalog, scope.key);
|
|
188
|
+
}
|
|
189
|
+
markScopeInvalidated(config.name, scope.key);
|
|
190
|
+
// Before the files go: a connection still open on them pins them.
|
|
191
|
+
await revokeHandles(config.name, scope.key);
|
|
192
|
+
const removedArtifacts = await artifactIdsOnDisk(layout, scope.key);
|
|
193
|
+
|
|
194
|
+
// The key is needed to count what is being removed, not to remove it,
|
|
195
|
+
// so a key provider that fails — or a key already destroyed for this
|
|
196
|
+
// identity, which FR-104 encourages — costs the count, never the
|
|
197
|
+
// deletion. Until 0.2.0 it failed the whole call after the scope was
|
|
198
|
+
// already marked, leaving it stuck in `deleting`.
|
|
199
|
+
let keyHandle = null;
|
|
200
|
+
if (config.encryption?.enabled) {
|
|
201
|
+
try {
|
|
202
|
+
keyHandle = await (0, _keyProvider.acquireKey)(config.encryption, scope);
|
|
203
|
+
} catch {
|
|
204
|
+
keyHandle = null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
let counted;
|
|
208
|
+
try {
|
|
209
|
+
counted = config.encryption?.enabled && keyHandle === null ? undefined : await countRecords(layout, scope.key, keyHandle?.value());
|
|
210
|
+
} finally {
|
|
211
|
+
keyHandle?.release();
|
|
212
|
+
}
|
|
213
|
+
const failedRemovals = [];
|
|
214
|
+
if (!(await (0, _fs.removeIfPresent)(layout.scopePath(scope.key))) && entry) {
|
|
215
|
+
// The directory was there and would not go. Reporting it is the
|
|
216
|
+
// point: an app that told the user "deleted" would be wrong.
|
|
217
|
+
const stillThere = await (0, _fs.fileSystem)().exists(layout.scopePath(scope.key)).catch(() => false);
|
|
218
|
+
if (stillThere) {
|
|
219
|
+
failedRemovals.push(scope.key);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (failedRemovals.length === 0) {
|
|
223
|
+
// Cleared last, on purpose.
|
|
224
|
+
await (0, _catalog.clearScope)(catalog, scope.key);
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
scopeKey: scope.key,
|
|
228
|
+
removedRecords: counted ?? 0,
|
|
229
|
+
...(counted === undefined ? {
|
|
230
|
+
recordCountUnavailable: true
|
|
231
|
+
} : {}),
|
|
232
|
+
removedArtifacts,
|
|
233
|
+
orphanedReferences: [],
|
|
234
|
+
failedRemovals
|
|
235
|
+
};
|
|
236
|
+
} finally {
|
|
237
|
+
await catalog.close();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Remove one scope's data. Every collection in that scope, and nothing
|
|
243
|
+
* outside it (FR-059, SC-012).
|
|
244
|
+
*/
|
|
245
|
+
function deleteScopeData(config) {
|
|
246
|
+
return removeScope(config);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Discard one scope and leave it ready for a clean first-run migration
|
|
251
|
+
* (FR-057a).
|
|
252
|
+
*
|
|
253
|
+
* Destructive, separately named, and never reachable from `openDatabase`. An
|
|
254
|
+
* automatic fallback here would turn a bad migration shipped to production
|
|
255
|
+
* into silent data loss for every user who launched the app.
|
|
256
|
+
*/
|
|
257
|
+
function resetScope(config) {
|
|
258
|
+
return removeScope(config);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Remove the whole database directory: catalog, every scope, every artifact. */
|
|
262
|
+
async function deleteDatabase(config) {
|
|
263
|
+
const layout = (0, _location.layoutFor)(config.name);
|
|
264
|
+
let scopeKeys = [];
|
|
265
|
+
try {
|
|
266
|
+
const catalog = await (0, _connection.openConnection)({
|
|
267
|
+
path: layout.catalogPath
|
|
268
|
+
});
|
|
269
|
+
try {
|
|
270
|
+
await (0, _catalog.ensureCatalog)(catalog);
|
|
271
|
+
scopeKeys = (await (0, _catalog.listEntries)(catalog)).map(entry => entry.scopeKey);
|
|
272
|
+
} finally {
|
|
273
|
+
await catalog.close();
|
|
274
|
+
}
|
|
275
|
+
} catch {
|
|
276
|
+
// No catalog means nothing was ever registered here. The directory
|
|
277
|
+
// removal below is still the right thing to attempt.
|
|
278
|
+
}
|
|
279
|
+
for (const scopeKey of scopeKeys) {
|
|
280
|
+
markScopeInvalidated(config.name, scopeKey);
|
|
281
|
+
}
|
|
282
|
+
await revokeHandles(config.name);
|
|
283
|
+
const removed = await (0, _fs.removeIfPresent)(layout.root);
|
|
284
|
+
return {
|
|
285
|
+
removedRecords: 0,
|
|
286
|
+
removedArtifacts: [],
|
|
287
|
+
orphanedReferences: [],
|
|
288
|
+
failedRemovals: removed || scopeKeys.length === 0 ? [] : scopeKeys
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=deletion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_fs","require","_location","_paths","_keyProvider","_compare","_validate","_catalog","_connection","_values","invalidated","Set","invalidationKey","name","scopeKey","markScopeInvalidated","add","clearScopeInvalidation","delete","isScopeInvalidated","has","clearAllInvalidations","clear","openHandles","Map","registerOpenHandle","revoke","key","handles","get","set","size","revokeHandles","prefix","matches","undefined","startsWith","catch","emptyOutcome","scope","removedRecords","removedArtifacts","orphanedReferences","failedRemovals","countRecords","layout","encryptionKey","connection","openConnection","path","scopeDataPath","tables","execute","total","row","rows","table","text","counted","num","close","artifactIdsOnDisk","fileSystem","readdir","artifactsDirectory","sort","byteOrder","removeScope","config","resolveScope","layoutFor","catalog","catalogPath","ensureCatalog","entry","readEntry","markDeleting","keyHandle","encryption","enabled","acquireKey","value","release","removeIfPresent","scopePath","stillThere","exists","push","length","clearScope","recordCountUnavailable","deleteScopeData","resetScope","deleteDatabase","scopeKeys","listEntries","map","removed","root"],"sourceRoot":"../../../src","sources":["adapter/deletion.ts"],"mappings":";;;;;;;;;;;;;;AAwBA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAhCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMS,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;AAErC,SAASC,eAAeA,CAACC,IAAY,EAAEC,QAAgB,EAAU;EAChE,OAAO,GAAGD,IAAI,IAAIC,QAAQ,EAAE;AAC7B;AAEO,SAASC,oBAAoBA,CAACF,IAAY,EAAEC,QAAgB,EAAQ;EAC1EJ,WAAW,CAACM,GAAG,CAACJ,eAAe,CAACC,IAAI,EAAEC,QAAQ,CAAC,CAAC;AACjD;AAEO,SAASG,sBAAsBA,CAACJ,IAAY,EAAEC,QAAgB,EAAQ;EAC5EJ,WAAW,CAACQ,MAAM,CAACN,eAAe,CAACC,IAAI,EAAEC,QAAQ,CAAC,CAAC;AACpD;AAEO,SAASK,kBAAkBA,CAACN,IAAY,EAAEC,QAAgB,EAAW;EAC3E,OAAOJ,WAAW,CAACU,GAAG,CAACR,eAAe,CAACC,IAAI,EAAEC,QAAQ,CAAC,CAAC;AACxD;AAEO,SAASO,qBAAqBA,CAAA,EAAS;EAC7CX,WAAW,CAACY,KAAK,CAAC,CAAC;EACnBC,WAAW,CAACD,KAAK,CAAC,CAAC;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA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