@asaidimu/anansi 1.2.3 → 1.3.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/index.cjs +33 -33
- package/index.d.cts +125 -113
- package/index.d.ts +125 -113
- package/index.js +33 -33
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -102,6 +102,8 @@ interface ConstraintGroup<T extends FieldType> {
|
|
|
102
102
|
* @template T The type of the field.
|
|
103
103
|
*/
|
|
104
104
|
interface FieldDefinition<T> {
|
|
105
|
+
/** The name of the field. */
|
|
106
|
+
name: string;
|
|
105
107
|
/** The type of the field. */
|
|
106
108
|
type: FieldType;
|
|
107
109
|
/** Whether the field is required. */
|
|
@@ -194,14 +196,14 @@ interface SchemaDefinition {
|
|
|
194
196
|
*/
|
|
195
197
|
type SchemaChange<T> = {
|
|
196
198
|
type: "addField";
|
|
197
|
-
|
|
199
|
+
id: string;
|
|
198
200
|
definition: FieldDefinition<T>;
|
|
199
201
|
} | {
|
|
200
202
|
type: "removeField";
|
|
201
|
-
|
|
203
|
+
id: string;
|
|
202
204
|
} | {
|
|
203
205
|
type: "modifyField";
|
|
204
|
-
|
|
206
|
+
id: string;
|
|
205
207
|
changes: Partial<FieldDefinition<T>>;
|
|
206
208
|
} | {
|
|
207
209
|
type: "addIndex";
|
|
@@ -225,7 +227,7 @@ type SchemaChange<T> = {
|
|
|
225
227
|
changes: Partial<SchemaConstraint<any> | Constraint<any>>;
|
|
226
228
|
} | {
|
|
227
229
|
type: "deprecateField";
|
|
228
|
-
|
|
230
|
+
id: string;
|
|
229
231
|
};
|
|
230
232
|
/**
|
|
231
233
|
* Defines a transform function for data migration.
|
|
@@ -819,6 +821,16 @@ interface SchemaRegistry {
|
|
|
819
821
|
history(name: string): Promise<SchemaDefinition[]>;
|
|
820
822
|
}
|
|
821
823
|
|
|
824
|
+
/**
|
|
825
|
+
* Creates and returns a new SchemaRegistry instance.
|
|
826
|
+
* @returns {Promise<SchemaRegistry>} A promise that resolves to the SchemaRegistry instance.
|
|
827
|
+
*/
|
|
828
|
+
declare function createRegistry(credentials: {
|
|
829
|
+
username: string;
|
|
830
|
+
password: string;
|
|
831
|
+
repository: string;
|
|
832
|
+
}, dir?: string, proxy?: string): Promise<SchemaRegistry>;
|
|
833
|
+
|
|
822
834
|
/**
|
|
823
835
|
* @fileoverview Provides a MigrationEngine class that handles schema migrations,
|
|
824
836
|
* including validation, checksum generation, and migration application.
|
|
@@ -1055,36 +1067,36 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1055
1067
|
schemaVersion: z.ZodString;
|
|
1056
1068
|
changes: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
1057
1069
|
type: z.ZodLiteral<"addField">;
|
|
1058
|
-
|
|
1070
|
+
id: z.ZodString;
|
|
1059
1071
|
definition: any;
|
|
1060
1072
|
}, "strip", z.ZodTypeAny, {
|
|
1061
1073
|
type: "addField";
|
|
1062
|
-
|
|
1074
|
+
id: string;
|
|
1063
1075
|
definition?: any;
|
|
1064
1076
|
}, {
|
|
1065
1077
|
type: "addField";
|
|
1066
|
-
|
|
1078
|
+
id: string;
|
|
1067
1079
|
definition?: any;
|
|
1068
1080
|
}>, z.ZodObject<{
|
|
1069
1081
|
type: z.ZodLiteral<"removeField">;
|
|
1070
|
-
|
|
1082
|
+
id: z.ZodString;
|
|
1071
1083
|
}, "strip", z.ZodTypeAny, {
|
|
1072
1084
|
type: "removeField";
|
|
1073
|
-
|
|
1085
|
+
id: string;
|
|
1074
1086
|
}, {
|
|
1075
1087
|
type: "removeField";
|
|
1076
|
-
|
|
1088
|
+
id: string;
|
|
1077
1089
|
}>, z.ZodObject<{
|
|
1078
1090
|
type: z.ZodLiteral<"modifyField">;
|
|
1079
|
-
|
|
1091
|
+
id: z.ZodString;
|
|
1080
1092
|
changes: any;
|
|
1081
1093
|
}, "strip", z.ZodTypeAny, {
|
|
1082
1094
|
type: "modifyField";
|
|
1083
|
-
|
|
1095
|
+
id: string;
|
|
1084
1096
|
changes?: any;
|
|
1085
1097
|
}, {
|
|
1086
1098
|
type: "modifyField";
|
|
1087
|
-
|
|
1099
|
+
id: string;
|
|
1088
1100
|
changes?: any;
|
|
1089
1101
|
}>, z.ZodObject<{
|
|
1090
1102
|
type: z.ZodLiteral<"addIndex">;
|
|
@@ -1100,18 +1112,18 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1100
1112
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1101
1113
|
fields: string[];
|
|
1102
1114
|
unique?: boolean | undefined;
|
|
1115
|
+
name?: string | undefined;
|
|
1103
1116
|
description?: string | undefined;
|
|
1104
1117
|
partial?: any;
|
|
1105
1118
|
order?: "asc" | "desc" | undefined;
|
|
1106
|
-
name?: string | undefined;
|
|
1107
1119
|
}, {
|
|
1108
1120
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1109
1121
|
fields: string[];
|
|
1110
1122
|
unique?: boolean | undefined;
|
|
1123
|
+
name?: string | undefined;
|
|
1111
1124
|
description?: string | undefined;
|
|
1112
1125
|
partial?: any;
|
|
1113
1126
|
order?: "asc" | "desc" | undefined;
|
|
1114
|
-
name?: string | undefined;
|
|
1115
1127
|
}>;
|
|
1116
1128
|
}, "strip", z.ZodTypeAny, {
|
|
1117
1129
|
type: "addIndex";
|
|
@@ -1119,10 +1131,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1119
1131
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1120
1132
|
fields: string[];
|
|
1121
1133
|
unique?: boolean | undefined;
|
|
1134
|
+
name?: string | undefined;
|
|
1122
1135
|
description?: string | undefined;
|
|
1123
1136
|
partial?: any;
|
|
1124
1137
|
order?: "asc" | "desc" | undefined;
|
|
1125
|
-
name?: string | undefined;
|
|
1126
1138
|
};
|
|
1127
1139
|
}, {
|
|
1128
1140
|
type: "addIndex";
|
|
@@ -1130,20 +1142,20 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1130
1142
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1131
1143
|
fields: string[];
|
|
1132
1144
|
unique?: boolean | undefined;
|
|
1145
|
+
name?: string | undefined;
|
|
1133
1146
|
description?: string | undefined;
|
|
1134
1147
|
partial?: any;
|
|
1135
1148
|
order?: "asc" | "desc" | undefined;
|
|
1136
|
-
name?: string | undefined;
|
|
1137
1149
|
};
|
|
1138
1150
|
}>, z.ZodObject<{
|
|
1139
1151
|
type: z.ZodLiteral<"removeIndex">;
|
|
1140
1152
|
name: z.ZodString;
|
|
1141
1153
|
}, "strip", z.ZodTypeAny, {
|
|
1142
|
-
type: "removeIndex";
|
|
1143
1154
|
name: string;
|
|
1144
|
-
}, {
|
|
1145
1155
|
type: "removeIndex";
|
|
1156
|
+
}, {
|
|
1146
1157
|
name: string;
|
|
1158
|
+
type: "removeIndex";
|
|
1147
1159
|
}>, z.ZodObject<{
|
|
1148
1160
|
type: z.ZodLiteral<"modifyIndex">;
|
|
1149
1161
|
name: z.ZodString;
|
|
@@ -1157,44 +1169,44 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1157
1169
|
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1158
1170
|
}, "strip", z.ZodTypeAny, {
|
|
1159
1171
|
unique?: boolean | undefined;
|
|
1172
|
+
name?: string | undefined;
|
|
1160
1173
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1161
1174
|
description?: string | undefined;
|
|
1162
1175
|
fields?: string[] | undefined;
|
|
1163
1176
|
partial?: any;
|
|
1164
1177
|
order?: "asc" | "desc" | undefined;
|
|
1165
|
-
name?: string | undefined;
|
|
1166
1178
|
}, {
|
|
1167
1179
|
unique?: boolean | undefined;
|
|
1180
|
+
name?: string | undefined;
|
|
1168
1181
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1169
1182
|
description?: string | undefined;
|
|
1170
1183
|
fields?: string[] | undefined;
|
|
1171
1184
|
partial?: any;
|
|
1172
1185
|
order?: "asc" | "desc" | undefined;
|
|
1173
|
-
name?: string | undefined;
|
|
1174
1186
|
}>;
|
|
1175
1187
|
}, "strip", z.ZodTypeAny, {
|
|
1176
|
-
type: "modifyIndex";
|
|
1177
1188
|
name: string;
|
|
1189
|
+
type: "modifyIndex";
|
|
1178
1190
|
changes: {
|
|
1179
1191
|
unique?: boolean | undefined;
|
|
1192
|
+
name?: string | undefined;
|
|
1180
1193
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1181
1194
|
description?: string | undefined;
|
|
1182
1195
|
fields?: string[] | undefined;
|
|
1183
1196
|
partial?: any;
|
|
1184
1197
|
order?: "asc" | "desc" | undefined;
|
|
1185
|
-
name?: string | undefined;
|
|
1186
1198
|
};
|
|
1187
1199
|
}, {
|
|
1188
|
-
type: "modifyIndex";
|
|
1189
1200
|
name: string;
|
|
1201
|
+
type: "modifyIndex";
|
|
1190
1202
|
changes: {
|
|
1191
1203
|
unique?: boolean | undefined;
|
|
1204
|
+
name?: string | undefined;
|
|
1192
1205
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1193
1206
|
description?: string | undefined;
|
|
1194
1207
|
fields?: string[] | undefined;
|
|
1195
1208
|
partial?: any;
|
|
1196
1209
|
order?: "asc" | "desc" | undefined;
|
|
1197
|
-
name?: string | undefined;
|
|
1198
1210
|
};
|
|
1199
1211
|
}>, z.ZodObject<{
|
|
1200
1212
|
type: z.ZodLiteral<"addConstraint">;
|
|
@@ -1233,11 +1245,11 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1233
1245
|
type: z.ZodLiteral<"removeConstraint">;
|
|
1234
1246
|
name: z.ZodString;
|
|
1235
1247
|
}, "strip", z.ZodTypeAny, {
|
|
1236
|
-
type: "removeConstraint";
|
|
1237
1248
|
name: string;
|
|
1238
|
-
}, {
|
|
1239
1249
|
type: "removeConstraint";
|
|
1250
|
+
}, {
|
|
1240
1251
|
name: string;
|
|
1252
|
+
type: "removeConstraint";
|
|
1241
1253
|
}>, z.ZodObject<{
|
|
1242
1254
|
type: z.ZodLiteral<"modifyConstraint">;
|
|
1243
1255
|
name: z.ZodString;
|
|
@@ -1250,41 +1262,41 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1250
1262
|
field: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1251
1263
|
errorMessage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1252
1264
|
}, "strip", z.ZodTypeAny, {
|
|
1265
|
+
name?: string | undefined;
|
|
1253
1266
|
type?: string | undefined;
|
|
1254
1267
|
description?: string | undefined;
|
|
1255
|
-
name?: string | undefined;
|
|
1256
1268
|
predicate?: string | undefined;
|
|
1257
1269
|
field?: string | undefined;
|
|
1258
1270
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1259
1271
|
errorMessage?: string | undefined;
|
|
1260
1272
|
}, {
|
|
1273
|
+
name?: string | undefined;
|
|
1261
1274
|
type?: string | undefined;
|
|
1262
1275
|
description?: string | undefined;
|
|
1263
|
-
name?: string | undefined;
|
|
1264
1276
|
predicate?: string | undefined;
|
|
1265
1277
|
field?: string | undefined;
|
|
1266
1278
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1267
1279
|
errorMessage?: string | undefined;
|
|
1268
1280
|
}>;
|
|
1269
1281
|
}, "strip", z.ZodTypeAny, {
|
|
1270
|
-
type: "modifyConstraint";
|
|
1271
1282
|
name: string;
|
|
1283
|
+
type: "modifyConstraint";
|
|
1272
1284
|
changes: {
|
|
1285
|
+
name?: string | undefined;
|
|
1273
1286
|
type?: string | undefined;
|
|
1274
1287
|
description?: string | undefined;
|
|
1275
|
-
name?: string | undefined;
|
|
1276
1288
|
predicate?: string | undefined;
|
|
1277
1289
|
field?: string | undefined;
|
|
1278
1290
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1279
1291
|
errorMessage?: string | undefined;
|
|
1280
1292
|
};
|
|
1281
1293
|
}, {
|
|
1282
|
-
type: "modifyConstraint";
|
|
1283
1294
|
name: string;
|
|
1295
|
+
type: "modifyConstraint";
|
|
1284
1296
|
changes: {
|
|
1297
|
+
name?: string | undefined;
|
|
1285
1298
|
type?: string | undefined;
|
|
1286
1299
|
description?: string | undefined;
|
|
1287
|
-
name?: string | undefined;
|
|
1288
1300
|
predicate?: string | undefined;
|
|
1289
1301
|
field?: string | undefined;
|
|
1290
1302
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1292,48 +1304,48 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1292
1304
|
};
|
|
1293
1305
|
}>, z.ZodObject<{
|
|
1294
1306
|
type: z.ZodLiteral<"deprecateField">;
|
|
1295
|
-
|
|
1307
|
+
id: z.ZodString;
|
|
1296
1308
|
}, "strip", z.ZodTypeAny, {
|
|
1297
1309
|
type: "deprecateField";
|
|
1298
|
-
|
|
1310
|
+
id: string;
|
|
1299
1311
|
}, {
|
|
1300
1312
|
type: "deprecateField";
|
|
1301
|
-
|
|
1313
|
+
id: string;
|
|
1302
1314
|
}>]>, "many">;
|
|
1303
1315
|
description: z.ZodString;
|
|
1304
1316
|
status: z.ZodEnum<["pending", "applied", "failed"]>;
|
|
1305
1317
|
rollback: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
1306
1318
|
type: z.ZodLiteral<"addField">;
|
|
1307
|
-
|
|
1319
|
+
id: z.ZodString;
|
|
1308
1320
|
definition: any;
|
|
1309
1321
|
}, "strip", z.ZodTypeAny, {
|
|
1310
1322
|
type: "addField";
|
|
1311
|
-
|
|
1323
|
+
id: string;
|
|
1312
1324
|
definition?: any;
|
|
1313
1325
|
}, {
|
|
1314
1326
|
type: "addField";
|
|
1315
|
-
|
|
1327
|
+
id: string;
|
|
1316
1328
|
definition?: any;
|
|
1317
1329
|
}>, z.ZodObject<{
|
|
1318
1330
|
type: z.ZodLiteral<"removeField">;
|
|
1319
|
-
|
|
1331
|
+
id: z.ZodString;
|
|
1320
1332
|
}, "strip", z.ZodTypeAny, {
|
|
1321
1333
|
type: "removeField";
|
|
1322
|
-
|
|
1334
|
+
id: string;
|
|
1323
1335
|
}, {
|
|
1324
1336
|
type: "removeField";
|
|
1325
|
-
|
|
1337
|
+
id: string;
|
|
1326
1338
|
}>, z.ZodObject<{
|
|
1327
1339
|
type: z.ZodLiteral<"modifyField">;
|
|
1328
|
-
|
|
1340
|
+
id: z.ZodString;
|
|
1329
1341
|
changes: any;
|
|
1330
1342
|
}, "strip", z.ZodTypeAny, {
|
|
1331
1343
|
type: "modifyField";
|
|
1332
|
-
|
|
1344
|
+
id: string;
|
|
1333
1345
|
changes?: any;
|
|
1334
1346
|
}, {
|
|
1335
1347
|
type: "modifyField";
|
|
1336
|
-
|
|
1348
|
+
id: string;
|
|
1337
1349
|
changes?: any;
|
|
1338
1350
|
}>, z.ZodObject<{
|
|
1339
1351
|
type: z.ZodLiteral<"addIndex">;
|
|
@@ -1349,18 +1361,18 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1349
1361
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1350
1362
|
fields: string[];
|
|
1351
1363
|
unique?: boolean | undefined;
|
|
1364
|
+
name?: string | undefined;
|
|
1352
1365
|
description?: string | undefined;
|
|
1353
1366
|
partial?: any;
|
|
1354
1367
|
order?: "asc" | "desc" | undefined;
|
|
1355
|
-
name?: string | undefined;
|
|
1356
1368
|
}, {
|
|
1357
1369
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1358
1370
|
fields: string[];
|
|
1359
1371
|
unique?: boolean | undefined;
|
|
1372
|
+
name?: string | undefined;
|
|
1360
1373
|
description?: string | undefined;
|
|
1361
1374
|
partial?: any;
|
|
1362
1375
|
order?: "asc" | "desc" | undefined;
|
|
1363
|
-
name?: string | undefined;
|
|
1364
1376
|
}>;
|
|
1365
1377
|
}, "strip", z.ZodTypeAny, {
|
|
1366
1378
|
type: "addIndex";
|
|
@@ -1368,10 +1380,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1368
1380
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1369
1381
|
fields: string[];
|
|
1370
1382
|
unique?: boolean | undefined;
|
|
1383
|
+
name?: string | undefined;
|
|
1371
1384
|
description?: string | undefined;
|
|
1372
1385
|
partial?: any;
|
|
1373
1386
|
order?: "asc" | "desc" | undefined;
|
|
1374
|
-
name?: string | undefined;
|
|
1375
1387
|
};
|
|
1376
1388
|
}, {
|
|
1377
1389
|
type: "addIndex";
|
|
@@ -1379,20 +1391,20 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1379
1391
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1380
1392
|
fields: string[];
|
|
1381
1393
|
unique?: boolean | undefined;
|
|
1394
|
+
name?: string | undefined;
|
|
1382
1395
|
description?: string | undefined;
|
|
1383
1396
|
partial?: any;
|
|
1384
1397
|
order?: "asc" | "desc" | undefined;
|
|
1385
|
-
name?: string | undefined;
|
|
1386
1398
|
};
|
|
1387
1399
|
}>, z.ZodObject<{
|
|
1388
1400
|
type: z.ZodLiteral<"removeIndex">;
|
|
1389
1401
|
name: z.ZodString;
|
|
1390
1402
|
}, "strip", z.ZodTypeAny, {
|
|
1391
|
-
type: "removeIndex";
|
|
1392
1403
|
name: string;
|
|
1393
|
-
}, {
|
|
1394
1404
|
type: "removeIndex";
|
|
1405
|
+
}, {
|
|
1395
1406
|
name: string;
|
|
1407
|
+
type: "removeIndex";
|
|
1396
1408
|
}>, z.ZodObject<{
|
|
1397
1409
|
type: z.ZodLiteral<"modifyIndex">;
|
|
1398
1410
|
name: z.ZodString;
|
|
@@ -1406,44 +1418,44 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1406
1418
|
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1407
1419
|
}, "strip", z.ZodTypeAny, {
|
|
1408
1420
|
unique?: boolean | undefined;
|
|
1421
|
+
name?: string | undefined;
|
|
1409
1422
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1410
1423
|
description?: string | undefined;
|
|
1411
1424
|
fields?: string[] | undefined;
|
|
1412
1425
|
partial?: any;
|
|
1413
1426
|
order?: "asc" | "desc" | undefined;
|
|
1414
|
-
name?: string | undefined;
|
|
1415
1427
|
}, {
|
|
1416
1428
|
unique?: boolean | undefined;
|
|
1429
|
+
name?: string | undefined;
|
|
1417
1430
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1418
1431
|
description?: string | undefined;
|
|
1419
1432
|
fields?: string[] | undefined;
|
|
1420
1433
|
partial?: any;
|
|
1421
1434
|
order?: "asc" | "desc" | undefined;
|
|
1422
|
-
name?: string | undefined;
|
|
1423
1435
|
}>;
|
|
1424
1436
|
}, "strip", z.ZodTypeAny, {
|
|
1425
|
-
type: "modifyIndex";
|
|
1426
1437
|
name: string;
|
|
1438
|
+
type: "modifyIndex";
|
|
1427
1439
|
changes: {
|
|
1428
1440
|
unique?: boolean | undefined;
|
|
1441
|
+
name?: string | undefined;
|
|
1429
1442
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1430
1443
|
description?: string | undefined;
|
|
1431
1444
|
fields?: string[] | undefined;
|
|
1432
1445
|
partial?: any;
|
|
1433
1446
|
order?: "asc" | "desc" | undefined;
|
|
1434
|
-
name?: string | undefined;
|
|
1435
1447
|
};
|
|
1436
1448
|
}, {
|
|
1437
|
-
type: "modifyIndex";
|
|
1438
1449
|
name: string;
|
|
1450
|
+
type: "modifyIndex";
|
|
1439
1451
|
changes: {
|
|
1440
1452
|
unique?: boolean | undefined;
|
|
1453
|
+
name?: string | undefined;
|
|
1441
1454
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1442
1455
|
description?: string | undefined;
|
|
1443
1456
|
fields?: string[] | undefined;
|
|
1444
1457
|
partial?: any;
|
|
1445
1458
|
order?: "asc" | "desc" | undefined;
|
|
1446
|
-
name?: string | undefined;
|
|
1447
1459
|
};
|
|
1448
1460
|
}>, z.ZodObject<{
|
|
1449
1461
|
type: z.ZodLiteral<"addConstraint">;
|
|
@@ -1482,11 +1494,11 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1482
1494
|
type: z.ZodLiteral<"removeConstraint">;
|
|
1483
1495
|
name: z.ZodString;
|
|
1484
1496
|
}, "strip", z.ZodTypeAny, {
|
|
1485
|
-
type: "removeConstraint";
|
|
1486
1497
|
name: string;
|
|
1487
|
-
}, {
|
|
1488
1498
|
type: "removeConstraint";
|
|
1499
|
+
}, {
|
|
1489
1500
|
name: string;
|
|
1501
|
+
type: "removeConstraint";
|
|
1490
1502
|
}>, z.ZodObject<{
|
|
1491
1503
|
type: z.ZodLiteral<"modifyConstraint">;
|
|
1492
1504
|
name: z.ZodString;
|
|
@@ -1499,41 +1511,41 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1499
1511
|
field: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1500
1512
|
errorMessage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1501
1513
|
}, "strip", z.ZodTypeAny, {
|
|
1514
|
+
name?: string | undefined;
|
|
1502
1515
|
type?: string | undefined;
|
|
1503
1516
|
description?: string | undefined;
|
|
1504
|
-
name?: string | undefined;
|
|
1505
1517
|
predicate?: string | undefined;
|
|
1506
1518
|
field?: string | undefined;
|
|
1507
1519
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1508
1520
|
errorMessage?: string | undefined;
|
|
1509
1521
|
}, {
|
|
1522
|
+
name?: string | undefined;
|
|
1510
1523
|
type?: string | undefined;
|
|
1511
1524
|
description?: string | undefined;
|
|
1512
|
-
name?: string | undefined;
|
|
1513
1525
|
predicate?: string | undefined;
|
|
1514
1526
|
field?: string | undefined;
|
|
1515
1527
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1516
1528
|
errorMessage?: string | undefined;
|
|
1517
1529
|
}>;
|
|
1518
1530
|
}, "strip", z.ZodTypeAny, {
|
|
1519
|
-
type: "modifyConstraint";
|
|
1520
1531
|
name: string;
|
|
1532
|
+
type: "modifyConstraint";
|
|
1521
1533
|
changes: {
|
|
1534
|
+
name?: string | undefined;
|
|
1522
1535
|
type?: string | undefined;
|
|
1523
1536
|
description?: string | undefined;
|
|
1524
|
-
name?: string | undefined;
|
|
1525
1537
|
predicate?: string | undefined;
|
|
1526
1538
|
field?: string | undefined;
|
|
1527
1539
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1528
1540
|
errorMessage?: string | undefined;
|
|
1529
1541
|
};
|
|
1530
1542
|
}, {
|
|
1531
|
-
type: "modifyConstraint";
|
|
1532
1543
|
name: string;
|
|
1544
|
+
type: "modifyConstraint";
|
|
1533
1545
|
changes: {
|
|
1546
|
+
name?: string | undefined;
|
|
1534
1547
|
type?: string | undefined;
|
|
1535
1548
|
description?: string | undefined;
|
|
1536
|
-
name?: string | undefined;
|
|
1537
1549
|
predicate?: string | undefined;
|
|
1538
1550
|
field?: string | undefined;
|
|
1539
1551
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1541,13 +1553,13 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1541
1553
|
};
|
|
1542
1554
|
}>, z.ZodObject<{
|
|
1543
1555
|
type: z.ZodLiteral<"deprecateField">;
|
|
1544
|
-
|
|
1556
|
+
id: z.ZodString;
|
|
1545
1557
|
}, "strip", z.ZodTypeAny, {
|
|
1546
1558
|
type: "deprecateField";
|
|
1547
|
-
|
|
1559
|
+
id: string;
|
|
1548
1560
|
}, {
|
|
1549
1561
|
type: "deprecateField";
|
|
1550
|
-
|
|
1562
|
+
id: string;
|
|
1551
1563
|
}>]>, "many">>;
|
|
1552
1564
|
transform: z.ZodUnknown;
|
|
1553
1565
|
createdAt: z.ZodString;
|
|
@@ -1556,14 +1568,14 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1556
1568
|
description: string;
|
|
1557
1569
|
changes: ({
|
|
1558
1570
|
type: "addField";
|
|
1559
|
-
|
|
1571
|
+
id: string;
|
|
1560
1572
|
definition?: any;
|
|
1561
1573
|
} | {
|
|
1562
1574
|
type: "removeField";
|
|
1563
|
-
|
|
1575
|
+
id: string;
|
|
1564
1576
|
} | {
|
|
1565
1577
|
type: "modifyField";
|
|
1566
|
-
|
|
1578
|
+
id: string;
|
|
1567
1579
|
changes?: any;
|
|
1568
1580
|
} | {
|
|
1569
1581
|
type: "addIndex";
|
|
@@ -1571,39 +1583,39 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1571
1583
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1572
1584
|
fields: string[];
|
|
1573
1585
|
unique?: boolean | undefined;
|
|
1586
|
+
name?: string | undefined;
|
|
1574
1587
|
description?: string | undefined;
|
|
1575
1588
|
partial?: any;
|
|
1576
1589
|
order?: "asc" | "desc" | undefined;
|
|
1577
|
-
name?: string | undefined;
|
|
1578
1590
|
};
|
|
1579
1591
|
} | {
|
|
1580
|
-
type: "removeIndex";
|
|
1581
1592
|
name: string;
|
|
1593
|
+
type: "removeIndex";
|
|
1582
1594
|
} | {
|
|
1583
|
-
type: "modifyIndex";
|
|
1584
1595
|
name: string;
|
|
1596
|
+
type: "modifyIndex";
|
|
1585
1597
|
changes: {
|
|
1586
1598
|
unique?: boolean | undefined;
|
|
1599
|
+
name?: string | undefined;
|
|
1587
1600
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1588
1601
|
description?: string | undefined;
|
|
1589
1602
|
fields?: string[] | undefined;
|
|
1590
1603
|
partial?: any;
|
|
1591
1604
|
order?: "asc" | "desc" | undefined;
|
|
1592
|
-
name?: string | undefined;
|
|
1593
1605
|
};
|
|
1594
1606
|
} | {
|
|
1595
1607
|
type: "addConstraint";
|
|
1596
1608
|
constraint?: any;
|
|
1597
1609
|
} | {
|
|
1598
|
-
type: "removeConstraint";
|
|
1599
1610
|
name: string;
|
|
1611
|
+
type: "removeConstraint";
|
|
1600
1612
|
} | {
|
|
1601
|
-
type: "modifyConstraint";
|
|
1602
1613
|
name: string;
|
|
1614
|
+
type: "modifyConstraint";
|
|
1603
1615
|
changes: {
|
|
1616
|
+
name?: string | undefined;
|
|
1604
1617
|
type?: string | undefined;
|
|
1605
1618
|
description?: string | undefined;
|
|
1606
|
-
name?: string | undefined;
|
|
1607
1619
|
predicate?: string | undefined;
|
|
1608
1620
|
field?: string | undefined;
|
|
1609
1621
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1611,7 +1623,7 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1611
1623
|
};
|
|
1612
1624
|
} | {
|
|
1613
1625
|
type: "deprecateField";
|
|
1614
|
-
|
|
1626
|
+
id: string;
|
|
1615
1627
|
})[];
|
|
1616
1628
|
status: "pending" | "applied" | "failed";
|
|
1617
1629
|
id: string;
|
|
@@ -1619,14 +1631,14 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1619
1631
|
createdAt: string;
|
|
1620
1632
|
rollback?: ({
|
|
1621
1633
|
type: "addField";
|
|
1622
|
-
|
|
1634
|
+
id: string;
|
|
1623
1635
|
definition?: any;
|
|
1624
1636
|
} | {
|
|
1625
1637
|
type: "removeField";
|
|
1626
|
-
|
|
1638
|
+
id: string;
|
|
1627
1639
|
} | {
|
|
1628
1640
|
type: "modifyField";
|
|
1629
|
-
|
|
1641
|
+
id: string;
|
|
1630
1642
|
changes?: any;
|
|
1631
1643
|
} | {
|
|
1632
1644
|
type: "addIndex";
|
|
@@ -1634,39 +1646,39 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1634
1646
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1635
1647
|
fields: string[];
|
|
1636
1648
|
unique?: boolean | undefined;
|
|
1649
|
+
name?: string | undefined;
|
|
1637
1650
|
description?: string | undefined;
|
|
1638
1651
|
partial?: any;
|
|
1639
1652
|
order?: "asc" | "desc" | undefined;
|
|
1640
|
-
name?: string | undefined;
|
|
1641
1653
|
};
|
|
1642
1654
|
} | {
|
|
1643
|
-
type: "removeIndex";
|
|
1644
1655
|
name: string;
|
|
1656
|
+
type: "removeIndex";
|
|
1645
1657
|
} | {
|
|
1646
|
-
type: "modifyIndex";
|
|
1647
1658
|
name: string;
|
|
1659
|
+
type: "modifyIndex";
|
|
1648
1660
|
changes: {
|
|
1649
1661
|
unique?: boolean | undefined;
|
|
1662
|
+
name?: string | undefined;
|
|
1650
1663
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1651
1664
|
description?: string | undefined;
|
|
1652
1665
|
fields?: string[] | undefined;
|
|
1653
1666
|
partial?: any;
|
|
1654
1667
|
order?: "asc" | "desc" | undefined;
|
|
1655
|
-
name?: string | undefined;
|
|
1656
1668
|
};
|
|
1657
1669
|
} | {
|
|
1658
1670
|
type: "addConstraint";
|
|
1659
1671
|
constraint?: any;
|
|
1660
1672
|
} | {
|
|
1661
|
-
type: "removeConstraint";
|
|
1662
1673
|
name: string;
|
|
1674
|
+
type: "removeConstraint";
|
|
1663
1675
|
} | {
|
|
1664
|
-
type: "modifyConstraint";
|
|
1665
1676
|
name: string;
|
|
1677
|
+
type: "modifyConstraint";
|
|
1666
1678
|
changes: {
|
|
1679
|
+
name?: string | undefined;
|
|
1667
1680
|
type?: string | undefined;
|
|
1668
1681
|
description?: string | undefined;
|
|
1669
|
-
name?: string | undefined;
|
|
1670
1682
|
predicate?: string | undefined;
|
|
1671
1683
|
field?: string | undefined;
|
|
1672
1684
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1674,7 +1686,7 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1674
1686
|
};
|
|
1675
1687
|
} | {
|
|
1676
1688
|
type: "deprecateField";
|
|
1677
|
-
|
|
1689
|
+
id: string;
|
|
1678
1690
|
})[] | undefined;
|
|
1679
1691
|
transform?: unknown;
|
|
1680
1692
|
checksum?: string | undefined;
|
|
@@ -1682,14 +1694,14 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1682
1694
|
description: string;
|
|
1683
1695
|
changes: ({
|
|
1684
1696
|
type: "addField";
|
|
1685
|
-
|
|
1697
|
+
id: string;
|
|
1686
1698
|
definition?: any;
|
|
1687
1699
|
} | {
|
|
1688
1700
|
type: "removeField";
|
|
1689
|
-
|
|
1701
|
+
id: string;
|
|
1690
1702
|
} | {
|
|
1691
1703
|
type: "modifyField";
|
|
1692
|
-
|
|
1704
|
+
id: string;
|
|
1693
1705
|
changes?: any;
|
|
1694
1706
|
} | {
|
|
1695
1707
|
type: "addIndex";
|
|
@@ -1697,39 +1709,39 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1697
1709
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1698
1710
|
fields: string[];
|
|
1699
1711
|
unique?: boolean | undefined;
|
|
1712
|
+
name?: string | undefined;
|
|
1700
1713
|
description?: string | undefined;
|
|
1701
1714
|
partial?: any;
|
|
1702
1715
|
order?: "asc" | "desc" | undefined;
|
|
1703
|
-
name?: string | undefined;
|
|
1704
1716
|
};
|
|
1705
1717
|
} | {
|
|
1706
|
-
type: "removeIndex";
|
|
1707
1718
|
name: string;
|
|
1719
|
+
type: "removeIndex";
|
|
1708
1720
|
} | {
|
|
1709
|
-
type: "modifyIndex";
|
|
1710
1721
|
name: string;
|
|
1722
|
+
type: "modifyIndex";
|
|
1711
1723
|
changes: {
|
|
1712
1724
|
unique?: boolean | undefined;
|
|
1725
|
+
name?: string | undefined;
|
|
1713
1726
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1714
1727
|
description?: string | undefined;
|
|
1715
1728
|
fields?: string[] | undefined;
|
|
1716
1729
|
partial?: any;
|
|
1717
1730
|
order?: "asc" | "desc" | undefined;
|
|
1718
|
-
name?: string | undefined;
|
|
1719
1731
|
};
|
|
1720
1732
|
} | {
|
|
1721
1733
|
type: "addConstraint";
|
|
1722
1734
|
constraint?: any;
|
|
1723
1735
|
} | {
|
|
1724
|
-
type: "removeConstraint";
|
|
1725
1736
|
name: string;
|
|
1737
|
+
type: "removeConstraint";
|
|
1726
1738
|
} | {
|
|
1727
|
-
type: "modifyConstraint";
|
|
1728
1739
|
name: string;
|
|
1740
|
+
type: "modifyConstraint";
|
|
1729
1741
|
changes: {
|
|
1742
|
+
name?: string | undefined;
|
|
1730
1743
|
type?: string | undefined;
|
|
1731
1744
|
description?: string | undefined;
|
|
1732
|
-
name?: string | undefined;
|
|
1733
1745
|
predicate?: string | undefined;
|
|
1734
1746
|
field?: string | undefined;
|
|
1735
1747
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1737,7 +1749,7 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1737
1749
|
};
|
|
1738
1750
|
} | {
|
|
1739
1751
|
type: "deprecateField";
|
|
1740
|
-
|
|
1752
|
+
id: string;
|
|
1741
1753
|
})[];
|
|
1742
1754
|
status: "pending" | "applied" | "failed";
|
|
1743
1755
|
id: string;
|
|
@@ -1745,14 +1757,14 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1745
1757
|
createdAt: string;
|
|
1746
1758
|
rollback?: ({
|
|
1747
1759
|
type: "addField";
|
|
1748
|
-
|
|
1760
|
+
id: string;
|
|
1749
1761
|
definition?: any;
|
|
1750
1762
|
} | {
|
|
1751
1763
|
type: "removeField";
|
|
1752
|
-
|
|
1764
|
+
id: string;
|
|
1753
1765
|
} | {
|
|
1754
1766
|
type: "modifyField";
|
|
1755
|
-
|
|
1767
|
+
id: string;
|
|
1756
1768
|
changes?: any;
|
|
1757
1769
|
} | {
|
|
1758
1770
|
type: "addIndex";
|
|
@@ -1760,39 +1772,39 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1760
1772
|
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1761
1773
|
fields: string[];
|
|
1762
1774
|
unique?: boolean | undefined;
|
|
1775
|
+
name?: string | undefined;
|
|
1763
1776
|
description?: string | undefined;
|
|
1764
1777
|
partial?: any;
|
|
1765
1778
|
order?: "asc" | "desc" | undefined;
|
|
1766
|
-
name?: string | undefined;
|
|
1767
1779
|
};
|
|
1768
1780
|
} | {
|
|
1769
|
-
type: "removeIndex";
|
|
1770
1781
|
name: string;
|
|
1782
|
+
type: "removeIndex";
|
|
1771
1783
|
} | {
|
|
1772
|
-
type: "modifyIndex";
|
|
1773
1784
|
name: string;
|
|
1785
|
+
type: "modifyIndex";
|
|
1774
1786
|
changes: {
|
|
1775
1787
|
unique?: boolean | undefined;
|
|
1788
|
+
name?: string | undefined;
|
|
1776
1789
|
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1777
1790
|
description?: string | undefined;
|
|
1778
1791
|
fields?: string[] | undefined;
|
|
1779
1792
|
partial?: any;
|
|
1780
1793
|
order?: "asc" | "desc" | undefined;
|
|
1781
|
-
name?: string | undefined;
|
|
1782
1794
|
};
|
|
1783
1795
|
} | {
|
|
1784
1796
|
type: "addConstraint";
|
|
1785
1797
|
constraint?: any;
|
|
1786
1798
|
} | {
|
|
1787
|
-
type: "removeConstraint";
|
|
1788
1799
|
name: string;
|
|
1800
|
+
type: "removeConstraint";
|
|
1789
1801
|
} | {
|
|
1790
|
-
type: "modifyConstraint";
|
|
1791
1802
|
name: string;
|
|
1803
|
+
type: "modifyConstraint";
|
|
1792
1804
|
changes: {
|
|
1805
|
+
name?: string | undefined;
|
|
1793
1806
|
type?: string | undefined;
|
|
1794
1807
|
description?: string | undefined;
|
|
1795
|
-
name?: string | undefined;
|
|
1796
1808
|
predicate?: string | undefined;
|
|
1797
1809
|
field?: string | undefined;
|
|
1798
1810
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1800,7 +1812,7 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1800
1812
|
};
|
|
1801
1813
|
} | {
|
|
1802
1814
|
type: "deprecateField";
|
|
1803
|
-
|
|
1815
|
+
id: string;
|
|
1804
1816
|
})[] | undefined;
|
|
1805
1817
|
transform?: unknown;
|
|
1806
1818
|
checksum?: string | undefined;
|
|
@@ -1880,4 +1892,4 @@ declare function docgen(schema: SchemaDefinition, options?: {
|
|
|
1880
1892
|
faker?: Faker;
|
|
1881
1893
|
}): string;
|
|
1882
1894
|
|
|
1883
|
-
export { type Constraint, type ConstraintGroup, type ConstraintParameters, type ConstraintsMap, type DataTransform, type FieldDefinition, type FieldType, type FunctionMap, type IndexDefinition, type IndexType, JsonPatchError, type LogicalOperator, type Migration, MigrationEngine, type MigrationEngineInterface, MigrationError, MigrationErrorCode, type MigrationMetadata, MigrationSchema, type PartialIndexCondition, type PatchOperation, type Persistence, type PersistenceCollection, type PersistenceEvent, type PersistenceEventType, type PersistenceTransaction, type Predicate, type PredicateMap, type PredicateName, type PredicateParameters, type RegistryLock, type RegistryMetadata, type Schema, type SchemaChange, type SchemaConstraint, type SchemaDefinition, type SchemaEvent, type SchemaEventType, type SchemaIndex, type SchemaMetadata, type SchemaMigrationHelper, type SchemaRegistry, type SchemaVersion, type TransformFunction, applyPatch, calculateNextVersion, compareSemanticVersions, createPatch, createSchemaMigrationHelper, createStandardSchemaValidator, deepMerge, docgen, generateSHA256Hash, normalizePath, schemaChangeToPatch, schemaToTypes, sortSemanticVars, validate, validateMigration, validateSchemaChange, validateSchemaDefinition };
|
|
1895
|
+
export { type Constraint, type ConstraintGroup, type ConstraintParameters, type ConstraintsMap, type DataTransform, type FieldDefinition, type FieldType, type FunctionMap, type IndexDefinition, type IndexType, JsonPatchError, type LogicalOperator, type Migration, MigrationEngine, type MigrationEngineInterface, MigrationError, MigrationErrorCode, type MigrationMetadata, MigrationSchema, type PartialIndexCondition, type PatchOperation, type Persistence, type PersistenceCollection, type PersistenceEvent, type PersistenceEventType, type PersistenceTransaction, type Predicate, type PredicateMap, type PredicateName, type PredicateParameters, type RegistryLock, type RegistryMetadata, type Schema, type SchemaChange, type SchemaConstraint, type SchemaDefinition, type SchemaEvent, type SchemaEventType, type SchemaIndex, type SchemaMetadata, type SchemaMigrationHelper, type SchemaRegistry, type SchemaVersion, type TransformFunction, applyPatch, calculateNextVersion, compareSemanticVersions, createPatch, createRegistry, createSchemaMigrationHelper, createStandardSchemaValidator, deepMerge, docgen, generateSHA256Hash, normalizePath, schemaChangeToPatch, schemaToTypes, sortSemanticVars, validate, validateMigration, validateSchemaChange, validateSchemaDefinition };
|