@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.
- package/dist/assertCurrent.d.ts +3 -0
- package/dist/assertCurrent.d.ts.map +1 -0
- package/dist/canonical.d.ts +4 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/databaseProvider.d.ts +11 -0
- package/dist/databaseProvider.d.ts.map +1 -0
- package/dist/diffResources.d.ts +3 -0
- package/dist/diffResources.d.ts.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/helpers.d.ts +8 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/history.d.ts +5 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1566 -0
- package/dist/index.js.map +1 -0
- package/dist/indexDefinition.d.ts +7 -0
- package/dist/indexDefinition.d.ts.map +1 -0
- package/dist/inspectResources.d.ts +8 -0
- package/dist/inspectResources.d.ts.map +1 -0
- package/dist/integrity.d.ts +16 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/lock.d.ts +19 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/planner.d.ts +6 -0
- package/dist/planner.d.ts.map +1 -0
- package/dist/registry.d.ts +5 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/resources.d.ts +5 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/runner.d.ts +4 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/testHarness.d.ts +27 -0
- package/dist/testHarness.d.ts.map +1 -0
- package/dist/types.d.ts +248 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +83 -0
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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"}
|
package/dist/errors.d.ts
ADDED
|
@@ -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"}
|
package/dist/index.d.ts
ADDED
|
@@ -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"}
|