@byok-sdk/cloud-dataplane 0.4.2 → 0.6.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/README.md +81 -5
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1090 -289
- package/dist/index.js.map +1 -1
- package/dist/migrate.d.ts +42 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +493 -247
- package/dist/runtime.js.map +1 -1
- package/dist/sql/0008_device_assertion_replay.sql +17 -0
- package/dist/sql/0009_task_cancellation.sql +6 -0
- package/dist/sql/0010_tenant_readiness.sql +21 -0
- package/dist/sql/0011_tenant_erasure.sql +46 -0
- package/dist/stores/core/mailbox.d.ts +13 -0
- package/dist/stores/device-assertion-replay.d.ts +10 -0
- package/dist/stores/devices.d.ts +3 -2
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/r2-blobs.d.ts +1 -1
- package/dist/stores/task-attempts.d.ts +14 -0
- package/dist/stores/task-cancellations.d.ts +9 -0
- package/dist/tenant-erasure.d.ts +77 -0
- package/package.json +4 -4
package/dist/migrate.d.ts
CHANGED
|
@@ -13,6 +13,39 @@ export interface MigrationResult {
|
|
|
13
13
|
readonly applied: readonly string[];
|
|
14
14
|
readonly alreadyApplied: readonly string[];
|
|
15
15
|
}
|
|
16
|
+
/** The exact package-owned row returned after a successful ledger readback. */
|
|
17
|
+
export interface MigrationVerificationRow {
|
|
18
|
+
readonly version: string;
|
|
19
|
+
readonly checksum: string;
|
|
20
|
+
}
|
|
21
|
+
export type MigrationStateIssue = {
|
|
22
|
+
readonly kind: 'missing';
|
|
23
|
+
readonly version: string;
|
|
24
|
+
readonly expectedChecksum: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'unexpected';
|
|
27
|
+
readonly version: string;
|
|
28
|
+
readonly actualChecksum: string;
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: 'checksum_mismatch';
|
|
31
|
+
readonly version: string;
|
|
32
|
+
readonly expectedChecksum: string;
|
|
33
|
+
readonly actualChecksum: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: 'ledger_missing';
|
|
36
|
+
readonly table: 'byok_schema_migration';
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The database's migration state does not exactly match this package's files.
|
|
40
|
+
*
|
|
41
|
+
* This is deliberately aggregate and fail-closed: a host can report every
|
|
42
|
+
* drift fact in one readiness result, but it cannot continue as though a
|
|
43
|
+
* partially matching schema were usable.
|
|
44
|
+
*/
|
|
45
|
+
export declare class MigrationStateMismatchError extends Error {
|
|
46
|
+
readonly issues: readonly MigrationStateIssue[];
|
|
47
|
+
constructor(issues: readonly MigrationStateIssue[], options?: ErrorOptions);
|
|
48
|
+
}
|
|
16
49
|
/**
|
|
17
50
|
* A published migration file changed after it was applied.
|
|
18
51
|
*
|
|
@@ -41,6 +74,15 @@ export declare class MigrationFilenameError extends Error {
|
|
|
41
74
|
* dropped in this directory is how a migration goes missing.
|
|
42
75
|
*/
|
|
43
76
|
export declare function readMigrationFiles(directory: string): Promise<readonly MigrationFile[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Reads the package migration files and the existing ledger, then requires an
|
|
79
|
+
* exact version/checksum match.
|
|
80
|
+
*
|
|
81
|
+
* The default directory is the migration projection shipped by this package.
|
|
82
|
+
* This function only reads state: it never creates the ledger, applies a
|
|
83
|
+
* migration, or synthesizes a compatible result for a missing/changed row.
|
|
84
|
+
*/
|
|
85
|
+
export declare function verifyMigrations(pool: Pool, directory?: string): Promise<readonly MigrationVerificationRow[]>;
|
|
44
86
|
/**
|
|
45
87
|
* Applies every pending migration in `directory`, in prefix order.
|
|
46
88
|
*
|
package/dist/runtime.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export { createByokPool } from './pool';
|
|
28
28
|
export type { ByokPoolOptions } from './pool';
|
|
29
|
-
export { PostgresDeviceDirectory, PostgresInboundDedupStore, PostgresNonceStore, PostgresPairingCodeStore, PostgresProofRequestReceiptStore, PostgresRequestReceiptStore, PostgresTaskAttemptStore, PostgresActivityStore, PostgresApprovalTimelineStore, createPostgresCloudStores, } from './stores/index';
|
|
29
|
+
export { PostgresDeviceDirectory, PostgresInboundDedupStore, PostgresNonceStore, PostgresPairingCodeStore, PostgresProofRequestReceiptStore, PostgresRequestReceiptStore, PostgresTaskAttemptStore, PostgresTaskCancellationStore, PostgresActivityStore, PostgresApprovalTimelineStore, PostgresDeviceAssertionReplayAuthority, createPostgresCloudStores, } from './stores/index';
|
|
30
30
|
export type { PostgresCloudStoreOptions, PostgresCloudStores, PostgresObjectStorageOptions, } from './stores/index';
|
|
31
31
|
export { DEFAULT_MAX_ATTEMPTS, DEFAULT_PRESIGN_TTL_SECONDS, DEFAULT_RETRY_DELAY_MS, MAX_PRESIGN_TTL_SECONDS, MIN_PRESIGN_TTL_SECONDS, ObjectStoreRequestError, R2_BLOB_ERROR_CODES, R2BlobStoreError, R2CloudBlobStore, R2ObjectMaintenanceStore, } from './stores/index';
|
|
32
32
|
export type { ObjectStoreFetch, R2BlobErrorCode, R2BlobStoreOptions } from './stores/index';
|