@rpcbase/migrations 0.0.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.
@@ -0,0 +1,3 @@
1
+ import { CompiledMigrationRegistry, MigrationDatabaseProvider, MigrationPlan, MigrationPlanOptions } from './types';
2
+ export declare const assertMigrationsCurrent: (registry: CompiledMigrationRegistry, provider: MigrationDatabaseProvider, options?: MigrationPlanOptions) => Promise<MigrationPlan>;
3
+ //# sourceMappingURL=assertCurrent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertCurrent.d.ts","sourceRoot":"","sources":["../src/assertCurrent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,uBAAuB,GAClC,UAAU,yBAAyB,EACnC,UAAU,yBAAyB,EACnC,UAAS,oBAAyB,KACjC,OAAO,CAAC,aAAa,CAYvB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare const canonicalStringify: (value: unknown) => string;
2
+ export declare const sha256: (value: string | Uint8Array) => string;
3
+ export declare const canonicalChecksum: (value: unknown) => string;
4
+ //# sourceMappingURL=canonical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,MAA+C,CAAA;AAEnG,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,GAAG,UAAU,KAAG,MACF,CAAA;AAElD,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,MAA2C,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { Db, MongoClient } from 'mongodb';
2
+ import { MigrationDatabaseProvider } from './types';
3
+ export type CreateMigrationDatabaseProviderOptions = {
4
+ client: MongoClient;
5
+ appName: string;
6
+ tenantCollection?: string;
7
+ filesystemRequired?: (tenantId: string, signal: AbortSignal) => boolean | Promise<boolean>;
8
+ };
9
+ export declare const createMigrationDatabaseProvider: (options: CreateMigrationDatabaseProviderOptions) => MigrationDatabaseProvider;
10
+ export declare const getMigrationDatabaseName: (db: Db) => string;
11
+ //# sourceMappingURL=databaseProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"databaseProvider.d.ts","sourceRoot":"","sources":["../src/databaseProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAiBxD,MAAM,MAAM,sCAAsC,GAAG;IACnD,MAAM,EAAE,WAAW,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC3F,CAAA;AAED,eAAO,MAAM,+BAA+B,GAC1C,SAAS,sCAAsC,KAC9C,yBAuCF,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,IAAI,EAAE,KAAG,MAAyB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { MongoResources, MongoResourcesDiff } from './types';
2
+ export declare const diffMongoResources: (before: MongoResources, after: MongoResources) => MongoResourcesDiff;
3
+ //# sourceMappingURL=diffResources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diffResources.d.ts","sourceRoot":"","sources":["../src/diffResources.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAKV,cAAc,EACd,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAwChB,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,cAAc,EACtB,OAAO,cAAc,KACpB,kBAoBF,CAAA"}
@@ -0,0 +1,13 @@
1
+ export declare class MigrationIntegrityError extends Error {
2
+ readonly code = "RB_MIGRATION_INTEGRITY";
3
+ constructor(message: string);
4
+ }
5
+ export declare class MigrationLockUnavailableError extends Error {
6
+ readonly code = "RB_MIGRATION_LOCK_UNAVAILABLE";
7
+ constructor(message: string);
8
+ }
9
+ export declare class MigrationLockLostError extends Error {
10
+ readonly code = "RB_MIGRATION_LOCK_LOST";
11
+ constructor(message: string);
12
+ }
13
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,4BAA2B;gBAE5B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,QAAQ,CAAC,IAAI,mCAAkC;gBAEnC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,4BAA2B;gBAE5B,OAAO,EAAE,MAAM;CAI5B"}
@@ -0,0 +1,8 @@
1
+ import { Db } from 'mongodb';
2
+ import { MigrationHelpers } from './types';
3
+ export type CreateMigrationHelpersOptions = {
4
+ searchTimeoutMs?: number;
5
+ searchPollIntervalMs?: number;
6
+ };
7
+ export declare const createMigrationHelpers: (db: Db, signal: AbortSignal, options?: CreateMigrationHelpersOptions) => MigrationHelpers;
8
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAY,MAAM,SAAS,CAAA;AAI3C,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,SAAS,CAAA;AAwC/D,MAAM,MAAM,6BAA6B,GAAG;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,IAAI,EAAE,EACN,QAAQ,WAAW,EACnB,UAAS,6BAAkC,KAC1C,gBAoJF,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Db } from 'mongodb';
2
+ import { MigrationHistoryRecord } from './types';
3
+ export declare const MIGRATIONS_COLLECTION = "rbmigrations";
4
+ export declare const readMigrationHistory: (db: Db) => Promise<MigrationHistoryRecord[]>;
5
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAEjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAGrD,eAAO,MAAM,qBAAqB,iBAAiB,CAAA;AAEnD,eAAO,MAAM,oBAAoB,GAAU,IAAI,EAAE,KAAG,OAAO,CAAC,sBAAsB,EAAE,CAItE,CAAA"}
@@ -0,0 +1,17 @@
1
+ export * from './types';
2
+ export * from './canonical';
3
+ export * from './resources';
4
+ export * from './diffResources';
5
+ export * from './registry';
6
+ export * from './inspectResources';
7
+ export * from './helpers';
8
+ export * from './errors';
9
+ export * from './history';
10
+ export * from './databaseProvider';
11
+ export * from './planner';
12
+ export * from './lock';
13
+ export * from './runner';
14
+ export * from './assertCurrent';
15
+ export * from './integrity';
16
+ export * from './testHarness';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}