@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
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { CollationOptions, Db, Document } from 'mongodb';
|
|
2
|
+
export type MigrationScope = "global" | "tenant" | "filesystem";
|
|
3
|
+
export type MigrationMode = "online" | "offline";
|
|
4
|
+
export type MigrationRollback = "compatible" | "incompatible";
|
|
5
|
+
export type MigrationResourceTransition = {
|
|
6
|
+
before: string | null;
|
|
7
|
+
after: string;
|
|
8
|
+
};
|
|
9
|
+
export type MigrationCheckpoint<T = unknown> = {
|
|
10
|
+
readonly value: T | undefined;
|
|
11
|
+
save(value: T): Promise<void>;
|
|
12
|
+
clear(): Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export type DuplicateKeyGroup = {
|
|
15
|
+
key: unknown;
|
|
16
|
+
count: number;
|
|
17
|
+
};
|
|
18
|
+
export type MigrationHelpers = {
|
|
19
|
+
ensureCollection(name: string, options?: Document): Promise<void>;
|
|
20
|
+
dropCollectionIfExists(name: string): Promise<void>;
|
|
21
|
+
ensureIndex(collection: string, key: Document, options: Document & {
|
|
22
|
+
name: string;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
dropIndexIfExists(collection: string, name: string): Promise<void>;
|
|
25
|
+
findDuplicateKeys(collection: string, key: Document, options?: {
|
|
26
|
+
filter?: Document;
|
|
27
|
+
collation?: CollationOptions;
|
|
28
|
+
limit?: number;
|
|
29
|
+
}): Promise<DuplicateKeyGroup[]>;
|
|
30
|
+
ensureSearchIndex(collection: string, name: string, definition: Document): Promise<void>;
|
|
31
|
+
dropSearchIndexIfExists(collection: string, name: string): Promise<void>;
|
|
32
|
+
setCollectionValidator(collection: string, validator: Document, options?: {
|
|
33
|
+
validationLevel?: string;
|
|
34
|
+
validationAction?: string;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
reconcileResources(resources: MongoResources): Promise<void>;
|
|
37
|
+
};
|
|
38
|
+
export type MigrationContext<TCheckpoint = unknown> = {
|
|
39
|
+
db: Db;
|
|
40
|
+
tenantId?: string;
|
|
41
|
+
checkpoint: MigrationCheckpoint<TCheckpoint>;
|
|
42
|
+
signal: AbortSignal;
|
|
43
|
+
helpers: MigrationHelpers;
|
|
44
|
+
resources?: {
|
|
45
|
+
before?: MongoResources;
|
|
46
|
+
after: MongoResources;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type MigrationDefinition<TCheckpoint = unknown> = {
|
|
50
|
+
id: string;
|
|
51
|
+
scope: MigrationScope;
|
|
52
|
+
mode: MigrationMode;
|
|
53
|
+
rollback?: MigrationRollback;
|
|
54
|
+
dependsOn?: readonly string[];
|
|
55
|
+
resources?: MigrationResourceTransition;
|
|
56
|
+
up(context: MigrationContext<TCheckpoint>): Promise<void>;
|
|
57
|
+
};
|
|
58
|
+
export type MongoCollectionResource = {
|
|
59
|
+
scope: MigrationScope;
|
|
60
|
+
name: string;
|
|
61
|
+
options?: Document;
|
|
62
|
+
};
|
|
63
|
+
export type MongoIndexResource = {
|
|
64
|
+
scope: MigrationScope;
|
|
65
|
+
collection: string;
|
|
66
|
+
name: string;
|
|
67
|
+
key: Document;
|
|
68
|
+
options?: Document;
|
|
69
|
+
};
|
|
70
|
+
export type MongoSearchIndexResource = {
|
|
71
|
+
scope: MigrationScope;
|
|
72
|
+
collection: string;
|
|
73
|
+
name: string;
|
|
74
|
+
definition: Document;
|
|
75
|
+
};
|
|
76
|
+
export type MongoCollectionValidatorResource = {
|
|
77
|
+
scope: MigrationScope;
|
|
78
|
+
collection: string;
|
|
79
|
+
validator: Document;
|
|
80
|
+
validationLevel?: string;
|
|
81
|
+
validationAction?: string;
|
|
82
|
+
};
|
|
83
|
+
export type MongoCollectionResourceInput = MongoCollectionResource & {
|
|
84
|
+
owner?: string;
|
|
85
|
+
};
|
|
86
|
+
export type MongoIndexResourceInput = MongoIndexResource & {
|
|
87
|
+
owner?: string;
|
|
88
|
+
};
|
|
89
|
+
export type MongoSearchIndexResourceInput = MongoSearchIndexResource & {
|
|
90
|
+
owner?: string;
|
|
91
|
+
};
|
|
92
|
+
export type MongoCollectionValidatorResourceInput = MongoCollectionValidatorResource & {
|
|
93
|
+
owner?: string;
|
|
94
|
+
};
|
|
95
|
+
export type MongoResourcesInput = {
|
|
96
|
+
collections?: readonly MongoCollectionResourceInput[];
|
|
97
|
+
indexes?: readonly MongoIndexResourceInput[];
|
|
98
|
+
searchIndexes?: readonly MongoSearchIndexResourceInput[];
|
|
99
|
+
collectionValidators?: readonly MongoCollectionValidatorResourceInput[];
|
|
100
|
+
};
|
|
101
|
+
export type MongoResources = {
|
|
102
|
+
checksum: string;
|
|
103
|
+
collections: readonly MongoCollectionResource[];
|
|
104
|
+
indexes: readonly MongoIndexResource[];
|
|
105
|
+
searchIndexes: readonly MongoSearchIndexResource[];
|
|
106
|
+
collectionValidators: readonly MongoCollectionValidatorResource[];
|
|
107
|
+
};
|
|
108
|
+
export type MongoResourceChange<T> = {
|
|
109
|
+
kind: "added";
|
|
110
|
+
after: T;
|
|
111
|
+
} | {
|
|
112
|
+
kind: "removed";
|
|
113
|
+
before: T;
|
|
114
|
+
} | {
|
|
115
|
+
kind: "changed";
|
|
116
|
+
before: T;
|
|
117
|
+
after: T;
|
|
118
|
+
};
|
|
119
|
+
export type MongoResourcesDiff = {
|
|
120
|
+
collections: readonly MongoResourceChange<MongoCollectionResource>[];
|
|
121
|
+
indexes: readonly MongoResourceChange<MongoIndexResource>[];
|
|
122
|
+
searchIndexes: readonly MongoResourceChange<MongoSearchIndexResource>[];
|
|
123
|
+
collectionValidators: readonly MongoResourceChange<MongoCollectionValidatorResource>[];
|
|
124
|
+
changed: boolean;
|
|
125
|
+
mode: MigrationMode;
|
|
126
|
+
};
|
|
127
|
+
export type MigrationSource = {
|
|
128
|
+
name: string;
|
|
129
|
+
migrations: readonly MigrationDefinition[];
|
|
130
|
+
resources?: MongoResources;
|
|
131
|
+
resourceSnapshots?: readonly MongoResources[];
|
|
132
|
+
checksums?: Readonly<Record<string, string>>;
|
|
133
|
+
};
|
|
134
|
+
export type CompiledMigration = Omit<MigrationDefinition, "dependsOn" | "rollback"> & {
|
|
135
|
+
qualifiedId: string;
|
|
136
|
+
source: string;
|
|
137
|
+
sourcePosition: number;
|
|
138
|
+
sourcePriority: number;
|
|
139
|
+
dependsOn: readonly string[];
|
|
140
|
+
rollback: MigrationRollback;
|
|
141
|
+
checksum: string;
|
|
142
|
+
sealed: boolean;
|
|
143
|
+
};
|
|
144
|
+
export type CompiledMigrationSource = Omit<MigrationSource, "migrations" | "resourceSnapshots"> & {
|
|
145
|
+
priority: number;
|
|
146
|
+
migrations: readonly CompiledMigration[];
|
|
147
|
+
resourceSnapshots: ReadonlyMap<string, MongoResources>;
|
|
148
|
+
};
|
|
149
|
+
export type CompiledMigrationRegistry = {
|
|
150
|
+
protocolVersion: 1;
|
|
151
|
+
sources: readonly CompiledMigrationSource[];
|
|
152
|
+
migrations: readonly CompiledMigration[];
|
|
153
|
+
migrationsById: ReadonlyMap<string, CompiledMigration>;
|
|
154
|
+
checksum: string;
|
|
155
|
+
};
|
|
156
|
+
export type DefineMigrationRegistryOptions = {
|
|
157
|
+
requireSealed?: boolean;
|
|
158
|
+
};
|
|
159
|
+
export type MongoResourceDivergenceCode = "missing_collection" | "collection_options_mismatch" | "missing_index" | "index_key_mismatch" | "index_options_mismatch" | "search_unavailable" | "missing_search_index" | "search_index_definition_mismatch" | "search_index_not_ready" | "collection_validator_mismatch";
|
|
160
|
+
export type MongoResourceDivergence = {
|
|
161
|
+
code: MongoResourceDivergenceCode;
|
|
162
|
+
scope: MigrationScope;
|
|
163
|
+
collection: string;
|
|
164
|
+
resource?: string;
|
|
165
|
+
expected?: unknown;
|
|
166
|
+
actual?: unknown;
|
|
167
|
+
message: string;
|
|
168
|
+
};
|
|
169
|
+
export type MigrationHistoryStatus = "running" | "applied" | "failed";
|
|
170
|
+
export type MigrationHistoryRecord = {
|
|
171
|
+
_id: string;
|
|
172
|
+
checksum: string;
|
|
173
|
+
source: string;
|
|
174
|
+
sourcePosition: number;
|
|
175
|
+
scope: MigrationScope;
|
|
176
|
+
mode: MigrationMode;
|
|
177
|
+
rollback: MigrationRollback;
|
|
178
|
+
status: MigrationHistoryStatus;
|
|
179
|
+
attempt: number;
|
|
180
|
+
checkpoint?: unknown;
|
|
181
|
+
resourcesBeforeHash?: string;
|
|
182
|
+
resourcesAfterHash?: string;
|
|
183
|
+
release?: string;
|
|
184
|
+
runId: string;
|
|
185
|
+
fence: number;
|
|
186
|
+
startedAt: Date;
|
|
187
|
+
heartbeatAt?: Date;
|
|
188
|
+
appliedAt?: Date;
|
|
189
|
+
durationMs?: number;
|
|
190
|
+
error?: string;
|
|
191
|
+
};
|
|
192
|
+
export type MigrationDatabaseProvider = {
|
|
193
|
+
global(): Db | Promise<Db>;
|
|
194
|
+
tenantIds(signal: AbortSignal): Promise<readonly string[]>;
|
|
195
|
+
tenantExists?(tenantId: string, signal: AbortSignal): boolean | Promise<boolean>;
|
|
196
|
+
tenant(tenantId: string): Db | Promise<Db>;
|
|
197
|
+
filesystemRequired?(tenantId: string, signal: AbortSignal): boolean | Promise<boolean>;
|
|
198
|
+
filesystem?(tenantId: string): Db | Promise<Db>;
|
|
199
|
+
};
|
|
200
|
+
export type MigrationDatabaseTarget = {
|
|
201
|
+
db: Db;
|
|
202
|
+
scope: MigrationScope;
|
|
203
|
+
tenantId?: string;
|
|
204
|
+
};
|
|
205
|
+
export type MigrationPlanItem = {
|
|
206
|
+
id: string;
|
|
207
|
+
checksum: string;
|
|
208
|
+
source: string;
|
|
209
|
+
scope: MigrationScope;
|
|
210
|
+
mode: MigrationMode;
|
|
211
|
+
rollback: MigrationRollback;
|
|
212
|
+
dependsOn: readonly string[];
|
|
213
|
+
};
|
|
214
|
+
export type MigrationDatabasePlan = {
|
|
215
|
+
database: string;
|
|
216
|
+
scope: MigrationScope;
|
|
217
|
+
tenantId?: string;
|
|
218
|
+
applied: readonly string[];
|
|
219
|
+
pending: readonly MigrationPlanItem[];
|
|
220
|
+
running: readonly string[];
|
|
221
|
+
failed: readonly string[];
|
|
222
|
+
unknown: readonly string[];
|
|
223
|
+
integrityErrors: readonly string[];
|
|
224
|
+
resourceDivergences: readonly MongoResourceDivergence[];
|
|
225
|
+
};
|
|
226
|
+
export type MigrationPlan = {
|
|
227
|
+
protocolVersion: 1;
|
|
228
|
+
registryChecksum: string;
|
|
229
|
+
databases: readonly MigrationDatabasePlan[];
|
|
230
|
+
hasPending: boolean;
|
|
231
|
+
hasOffline: boolean;
|
|
232
|
+
hasErrors: boolean;
|
|
233
|
+
};
|
|
234
|
+
export type MigrationPlanOptions = {
|
|
235
|
+
tenantId?: string;
|
|
236
|
+
rollback?: boolean;
|
|
237
|
+
signal?: AbortSignal;
|
|
238
|
+
};
|
|
239
|
+
export type RunMigrationsOptions = MigrationPlanOptions & {
|
|
240
|
+
allowOffline?: boolean;
|
|
241
|
+
concurrency?: number;
|
|
242
|
+
release?: string;
|
|
243
|
+
lockId?: string;
|
|
244
|
+
leaseMs?: number;
|
|
245
|
+
heartbeatMs?: number;
|
|
246
|
+
initializeTenant?: boolean;
|
|
247
|
+
};
|
|
248
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAG7D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAA;AAChD,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,cAAc,CAAA;AAE7D,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC7C,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,CAAA;IAC7B,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,KAAK,IAAI,O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E,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG;IACxD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rpcbase/migrations",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "wireit",
|
|
19
|
+
"test": "wireit",
|
|
20
|
+
"release": "wireit"
|
|
21
|
+
},
|
|
22
|
+
"wireit": {
|
|
23
|
+
"build": {
|
|
24
|
+
"command": "../../node_modules/.bin/vite build",
|
|
25
|
+
"dependencies": [],
|
|
26
|
+
"files": [
|
|
27
|
+
"src/**/*",
|
|
28
|
+
"../../tsconfig.json",
|
|
29
|
+
"../../scripts/tsconfig.pkg.json",
|
|
30
|
+
"./tsconfig.json",
|
|
31
|
+
"./vite.config.js",
|
|
32
|
+
"../../scripts/vite.config-pkg.js"
|
|
33
|
+
],
|
|
34
|
+
"output": [
|
|
35
|
+
"dist/"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"build-watch": {
|
|
39
|
+
"command": "../../node_modules/.bin/vite build --watch",
|
|
40
|
+
"service": {
|
|
41
|
+
"readyWhen": {
|
|
42
|
+
"lineMatches": "^(?:\\u001b\\[[0-9;]*m)*built in .*\\.(?:\\u001b\\[[0-9;]*m)*$"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"test": {
|
|
47
|
+
"command": "../../node_modules/.bin/vitest run --config ../../pkg/test/src/vitest.config.mjs",
|
|
48
|
+
"files": [
|
|
49
|
+
"src/**/*",
|
|
50
|
+
"tsconfig.json",
|
|
51
|
+
"../../scripts/tsconfig.pkg.json"
|
|
52
|
+
],
|
|
53
|
+
"dependencies": []
|
|
54
|
+
},
|
|
55
|
+
"release": {
|
|
56
|
+
"command": "../../scripts/publish.js",
|
|
57
|
+
"dependencies": [
|
|
58
|
+
"build"
|
|
59
|
+
],
|
|
60
|
+
"files": [
|
|
61
|
+
"../../scripts/publish.js",
|
|
62
|
+
"package.json",
|
|
63
|
+
"dist/**/*"
|
|
64
|
+
],
|
|
65
|
+
"output": [
|
|
66
|
+
"publish-output.txt"
|
|
67
|
+
],
|
|
68
|
+
"env": {
|
|
69
|
+
"NPM_RELEASE_CHANNEL": {
|
|
70
|
+
"external": true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"es-module-lexer": "2.2.0",
|
|
77
|
+
"mongodb": "7.5.0"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@types/node": "25.5.2",
|
|
81
|
+
"vitest": "4.1.2"
|
|
82
|
+
}
|
|
83
|
+
}
|