@asaidimu/anansi 1.3.0 → 1.3.2
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 +60 -38
- package/index.d.cts +79 -57
- package/index.d.ts +79 -57
- package/index.js +60 -38
- package/package.json +1 -1
package/index.d.cts
CHANGED
|
@@ -195,6 +195,10 @@ interface SchemaDefinition {
|
|
|
195
195
|
* @template T The type of the field being changed.
|
|
196
196
|
*/
|
|
197
197
|
type SchemaChange<T> = {
|
|
198
|
+
type: "modifyProperty";
|
|
199
|
+
id: keyof Omit<SchemaDefinition, "fields" | "indexes" | "constraints">;
|
|
200
|
+
changes: Partial<Omit<SchemaDefinition, "fields" | "indexes" | "constraints">>;
|
|
201
|
+
} | {
|
|
198
202
|
type: "addField";
|
|
199
203
|
id: string;
|
|
200
204
|
definition: FieldDefinition<T>;
|
|
@@ -1109,16 +1113,16 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1109
1113
|
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
1110
1114
|
name: z.ZodOptional<z.ZodString>;
|
|
1111
1115
|
}, "strip", z.ZodTypeAny, {
|
|
1112
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1113
1116
|
fields: string[];
|
|
1117
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1114
1118
|
unique?: boolean | undefined;
|
|
1115
1119
|
name?: string | undefined;
|
|
1116
1120
|
description?: string | undefined;
|
|
1117
1121
|
partial?: any;
|
|
1118
1122
|
order?: "asc" | "desc" | undefined;
|
|
1119
1123
|
}, {
|
|
1120
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1121
1124
|
fields: string[];
|
|
1125
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1122
1126
|
unique?: boolean | undefined;
|
|
1123
1127
|
name?: string | undefined;
|
|
1124
1128
|
description?: string | undefined;
|
|
@@ -1128,8 +1132,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1128
1132
|
}, "strip", z.ZodTypeAny, {
|
|
1129
1133
|
type: "addIndex";
|
|
1130
1134
|
definition: {
|
|
1131
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1132
1135
|
fields: string[];
|
|
1136
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1133
1137
|
unique?: boolean | undefined;
|
|
1134
1138
|
name?: string | undefined;
|
|
1135
1139
|
description?: string | undefined;
|
|
@@ -1139,8 +1143,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1139
1143
|
}, {
|
|
1140
1144
|
type: "addIndex";
|
|
1141
1145
|
definition: {
|
|
1142
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1143
1146
|
fields: string[];
|
|
1147
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1144
1148
|
unique?: boolean | undefined;
|
|
1145
1149
|
name?: string | undefined;
|
|
1146
1150
|
description?: string | undefined;
|
|
@@ -1169,18 +1173,18 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1169
1173
|
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1170
1174
|
}, "strip", z.ZodTypeAny, {
|
|
1171
1175
|
unique?: boolean | undefined;
|
|
1176
|
+
fields?: string[] | undefined;
|
|
1172
1177
|
name?: string | undefined;
|
|
1173
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1174
1178
|
description?: string | undefined;
|
|
1175
|
-
|
|
1179
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1176
1180
|
partial?: any;
|
|
1177
1181
|
order?: "asc" | "desc" | undefined;
|
|
1178
1182
|
}, {
|
|
1179
1183
|
unique?: boolean | undefined;
|
|
1184
|
+
fields?: string[] | undefined;
|
|
1180
1185
|
name?: string | undefined;
|
|
1181
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1182
1186
|
description?: string | undefined;
|
|
1183
|
-
|
|
1187
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1184
1188
|
partial?: any;
|
|
1185
1189
|
order?: "asc" | "desc" | undefined;
|
|
1186
1190
|
}>;
|
|
@@ -1189,10 +1193,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1189
1193
|
type: "modifyIndex";
|
|
1190
1194
|
changes: {
|
|
1191
1195
|
unique?: boolean | undefined;
|
|
1196
|
+
fields?: string[] | undefined;
|
|
1192
1197
|
name?: string | undefined;
|
|
1193
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1194
1198
|
description?: string | undefined;
|
|
1195
|
-
|
|
1199
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1196
1200
|
partial?: any;
|
|
1197
1201
|
order?: "asc" | "desc" | undefined;
|
|
1198
1202
|
};
|
|
@@ -1201,10 +1205,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1201
1205
|
type: "modifyIndex";
|
|
1202
1206
|
changes: {
|
|
1203
1207
|
unique?: boolean | undefined;
|
|
1208
|
+
fields?: string[] | undefined;
|
|
1204
1209
|
name?: string | undefined;
|
|
1205
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1206
1210
|
description?: string | undefined;
|
|
1207
|
-
|
|
1211
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1208
1212
|
partial?: any;
|
|
1209
1213
|
order?: "asc" | "desc" | undefined;
|
|
1210
1214
|
};
|
|
@@ -1220,16 +1224,16 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1220
1224
|
errorMessage: z.ZodOptional<z.ZodString>;
|
|
1221
1225
|
}, "strip", z.ZodTypeAny, {
|
|
1222
1226
|
name: string;
|
|
1223
|
-
type?: string | undefined;
|
|
1224
1227
|
description?: string | undefined;
|
|
1228
|
+
type?: string | undefined;
|
|
1225
1229
|
predicate?: string | undefined;
|
|
1226
1230
|
field?: string | undefined;
|
|
1227
1231
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1228
1232
|
errorMessage?: string | undefined;
|
|
1229
1233
|
}, {
|
|
1230
1234
|
name: string;
|
|
1231
|
-
type?: string | undefined;
|
|
1232
1235
|
description?: string | undefined;
|
|
1236
|
+
type?: string | undefined;
|
|
1233
1237
|
predicate?: string | undefined;
|
|
1234
1238
|
field?: string | undefined;
|
|
1235
1239
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1263,16 +1267,16 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1263
1267
|
errorMessage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1264
1268
|
}, "strip", z.ZodTypeAny, {
|
|
1265
1269
|
name?: string | undefined;
|
|
1266
|
-
type?: string | undefined;
|
|
1267
1270
|
description?: string | undefined;
|
|
1271
|
+
type?: string | undefined;
|
|
1268
1272
|
predicate?: string | undefined;
|
|
1269
1273
|
field?: string | undefined;
|
|
1270
1274
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1271
1275
|
errorMessage?: string | undefined;
|
|
1272
1276
|
}, {
|
|
1273
1277
|
name?: string | undefined;
|
|
1274
|
-
type?: string | undefined;
|
|
1275
1278
|
description?: string | undefined;
|
|
1279
|
+
type?: string | undefined;
|
|
1276
1280
|
predicate?: string | undefined;
|
|
1277
1281
|
field?: string | undefined;
|
|
1278
1282
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1283,8 +1287,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1283
1287
|
type: "modifyConstraint";
|
|
1284
1288
|
changes: {
|
|
1285
1289
|
name?: string | undefined;
|
|
1286
|
-
type?: string | undefined;
|
|
1287
1290
|
description?: string | undefined;
|
|
1291
|
+
type?: string | undefined;
|
|
1288
1292
|
predicate?: string | undefined;
|
|
1289
1293
|
field?: string | undefined;
|
|
1290
1294
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1295,8 +1299,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1295
1299
|
type: "modifyConstraint";
|
|
1296
1300
|
changes: {
|
|
1297
1301
|
name?: string | undefined;
|
|
1298
|
-
type?: string | undefined;
|
|
1299
1302
|
description?: string | undefined;
|
|
1303
|
+
type?: string | undefined;
|
|
1300
1304
|
predicate?: string | undefined;
|
|
1301
1305
|
field?: string | undefined;
|
|
1302
1306
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1358,16 +1362,16 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1358
1362
|
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
1359
1363
|
name: z.ZodOptional<z.ZodString>;
|
|
1360
1364
|
}, "strip", z.ZodTypeAny, {
|
|
1361
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1362
1365
|
fields: string[];
|
|
1366
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1363
1367
|
unique?: boolean | undefined;
|
|
1364
1368
|
name?: string | undefined;
|
|
1365
1369
|
description?: string | undefined;
|
|
1366
1370
|
partial?: any;
|
|
1367
1371
|
order?: "asc" | "desc" | undefined;
|
|
1368
1372
|
}, {
|
|
1369
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1370
1373
|
fields: string[];
|
|
1374
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1371
1375
|
unique?: boolean | undefined;
|
|
1372
1376
|
name?: string | undefined;
|
|
1373
1377
|
description?: string | undefined;
|
|
@@ -1377,8 +1381,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1377
1381
|
}, "strip", z.ZodTypeAny, {
|
|
1378
1382
|
type: "addIndex";
|
|
1379
1383
|
definition: {
|
|
1380
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1381
1384
|
fields: string[];
|
|
1385
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1382
1386
|
unique?: boolean | undefined;
|
|
1383
1387
|
name?: string | undefined;
|
|
1384
1388
|
description?: string | undefined;
|
|
@@ -1388,8 +1392,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1388
1392
|
}, {
|
|
1389
1393
|
type: "addIndex";
|
|
1390
1394
|
definition: {
|
|
1391
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1392
1395
|
fields: string[];
|
|
1396
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1393
1397
|
unique?: boolean | undefined;
|
|
1394
1398
|
name?: string | undefined;
|
|
1395
1399
|
description?: string | undefined;
|
|
@@ -1418,18 +1422,18 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1418
1422
|
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1419
1423
|
}, "strip", z.ZodTypeAny, {
|
|
1420
1424
|
unique?: boolean | undefined;
|
|
1425
|
+
fields?: string[] | undefined;
|
|
1421
1426
|
name?: string | undefined;
|
|
1422
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1423
1427
|
description?: string | undefined;
|
|
1424
|
-
|
|
1428
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1425
1429
|
partial?: any;
|
|
1426
1430
|
order?: "asc" | "desc" | undefined;
|
|
1427
1431
|
}, {
|
|
1428
1432
|
unique?: boolean | undefined;
|
|
1433
|
+
fields?: string[] | undefined;
|
|
1429
1434
|
name?: string | undefined;
|
|
1430
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1431
1435
|
description?: string | undefined;
|
|
1432
|
-
|
|
1436
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1433
1437
|
partial?: any;
|
|
1434
1438
|
order?: "asc" | "desc" | undefined;
|
|
1435
1439
|
}>;
|
|
@@ -1438,10 +1442,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1438
1442
|
type: "modifyIndex";
|
|
1439
1443
|
changes: {
|
|
1440
1444
|
unique?: boolean | undefined;
|
|
1445
|
+
fields?: string[] | undefined;
|
|
1441
1446
|
name?: string | undefined;
|
|
1442
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1443
1447
|
description?: string | undefined;
|
|
1444
|
-
|
|
1448
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1445
1449
|
partial?: any;
|
|
1446
1450
|
order?: "asc" | "desc" | undefined;
|
|
1447
1451
|
};
|
|
@@ -1450,10 +1454,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1450
1454
|
type: "modifyIndex";
|
|
1451
1455
|
changes: {
|
|
1452
1456
|
unique?: boolean | undefined;
|
|
1457
|
+
fields?: string[] | undefined;
|
|
1453
1458
|
name?: string | undefined;
|
|
1454
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1455
1459
|
description?: string | undefined;
|
|
1456
|
-
|
|
1460
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1457
1461
|
partial?: any;
|
|
1458
1462
|
order?: "asc" | "desc" | undefined;
|
|
1459
1463
|
};
|
|
@@ -1469,16 +1473,16 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1469
1473
|
errorMessage: z.ZodOptional<z.ZodString>;
|
|
1470
1474
|
}, "strip", z.ZodTypeAny, {
|
|
1471
1475
|
name: string;
|
|
1472
|
-
type?: string | undefined;
|
|
1473
1476
|
description?: string | undefined;
|
|
1477
|
+
type?: string | undefined;
|
|
1474
1478
|
predicate?: string | undefined;
|
|
1475
1479
|
field?: string | undefined;
|
|
1476
1480
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1477
1481
|
errorMessage?: string | undefined;
|
|
1478
1482
|
}, {
|
|
1479
1483
|
name: string;
|
|
1480
|
-
type?: string | undefined;
|
|
1481
1484
|
description?: string | undefined;
|
|
1485
|
+
type?: string | undefined;
|
|
1482
1486
|
predicate?: string | undefined;
|
|
1483
1487
|
field?: string | undefined;
|
|
1484
1488
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1512,16 +1516,16 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1512
1516
|
errorMessage: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1513
1517
|
}, "strip", z.ZodTypeAny, {
|
|
1514
1518
|
name?: string | undefined;
|
|
1515
|
-
type?: string | undefined;
|
|
1516
1519
|
description?: string | undefined;
|
|
1520
|
+
type?: string | undefined;
|
|
1517
1521
|
predicate?: string | undefined;
|
|
1518
1522
|
field?: string | undefined;
|
|
1519
1523
|
parameters?: ((params: any) => boolean) | undefined;
|
|
1520
1524
|
errorMessage?: string | undefined;
|
|
1521
1525
|
}, {
|
|
1522
1526
|
name?: string | undefined;
|
|
1523
|
-
type?: string | undefined;
|
|
1524
1527
|
description?: string | undefined;
|
|
1528
|
+
type?: string | undefined;
|
|
1525
1529
|
predicate?: string | undefined;
|
|
1526
1530
|
field?: string | undefined;
|
|
1527
1531
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1532,8 +1536,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1532
1536
|
type: "modifyConstraint";
|
|
1533
1537
|
changes: {
|
|
1534
1538
|
name?: string | undefined;
|
|
1535
|
-
type?: string | undefined;
|
|
1536
1539
|
description?: string | undefined;
|
|
1540
|
+
type?: string | undefined;
|
|
1537
1541
|
predicate?: string | undefined;
|
|
1538
1542
|
field?: string | undefined;
|
|
1539
1543
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1544,8 +1548,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1544
1548
|
type: "modifyConstraint";
|
|
1545
1549
|
changes: {
|
|
1546
1550
|
name?: string | undefined;
|
|
1547
|
-
type?: string | undefined;
|
|
1548
1551
|
description?: string | undefined;
|
|
1552
|
+
type?: string | undefined;
|
|
1549
1553
|
predicate?: string | undefined;
|
|
1550
1554
|
field?: string | undefined;
|
|
1551
1555
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1580,8 +1584,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1580
1584
|
} | {
|
|
1581
1585
|
type: "addIndex";
|
|
1582
1586
|
definition: {
|
|
1583
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1584
1587
|
fields: string[];
|
|
1588
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1585
1589
|
unique?: boolean | undefined;
|
|
1586
1590
|
name?: string | undefined;
|
|
1587
1591
|
description?: string | undefined;
|
|
@@ -1596,10 +1600,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1596
1600
|
type: "modifyIndex";
|
|
1597
1601
|
changes: {
|
|
1598
1602
|
unique?: boolean | undefined;
|
|
1603
|
+
fields?: string[] | undefined;
|
|
1599
1604
|
name?: string | undefined;
|
|
1600
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1601
1605
|
description?: string | undefined;
|
|
1602
|
-
|
|
1606
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1603
1607
|
partial?: any;
|
|
1604
1608
|
order?: "asc" | "desc" | undefined;
|
|
1605
1609
|
};
|
|
@@ -1614,8 +1618,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1614
1618
|
type: "modifyConstraint";
|
|
1615
1619
|
changes: {
|
|
1616
1620
|
name?: string | undefined;
|
|
1617
|
-
type?: string | undefined;
|
|
1618
1621
|
description?: string | undefined;
|
|
1622
|
+
type?: string | undefined;
|
|
1619
1623
|
predicate?: string | undefined;
|
|
1620
1624
|
field?: string | undefined;
|
|
1621
1625
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1643,8 +1647,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1643
1647
|
} | {
|
|
1644
1648
|
type: "addIndex";
|
|
1645
1649
|
definition: {
|
|
1646
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1647
1650
|
fields: string[];
|
|
1651
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1648
1652
|
unique?: boolean | undefined;
|
|
1649
1653
|
name?: string | undefined;
|
|
1650
1654
|
description?: string | undefined;
|
|
@@ -1659,10 +1663,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1659
1663
|
type: "modifyIndex";
|
|
1660
1664
|
changes: {
|
|
1661
1665
|
unique?: boolean | undefined;
|
|
1666
|
+
fields?: string[] | undefined;
|
|
1662
1667
|
name?: string | undefined;
|
|
1663
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1664
1668
|
description?: string | undefined;
|
|
1665
|
-
|
|
1669
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1666
1670
|
partial?: any;
|
|
1667
1671
|
order?: "asc" | "desc" | undefined;
|
|
1668
1672
|
};
|
|
@@ -1677,8 +1681,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1677
1681
|
type: "modifyConstraint";
|
|
1678
1682
|
changes: {
|
|
1679
1683
|
name?: string | undefined;
|
|
1680
|
-
type?: string | undefined;
|
|
1681
1684
|
description?: string | undefined;
|
|
1685
|
+
type?: string | undefined;
|
|
1682
1686
|
predicate?: string | undefined;
|
|
1683
1687
|
field?: string | undefined;
|
|
1684
1688
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1706,8 +1710,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1706
1710
|
} | {
|
|
1707
1711
|
type: "addIndex";
|
|
1708
1712
|
definition: {
|
|
1709
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1710
1713
|
fields: string[];
|
|
1714
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1711
1715
|
unique?: boolean | undefined;
|
|
1712
1716
|
name?: string | undefined;
|
|
1713
1717
|
description?: string | undefined;
|
|
@@ -1722,10 +1726,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1722
1726
|
type: "modifyIndex";
|
|
1723
1727
|
changes: {
|
|
1724
1728
|
unique?: boolean | undefined;
|
|
1729
|
+
fields?: string[] | undefined;
|
|
1725
1730
|
name?: string | undefined;
|
|
1726
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1727
1731
|
description?: string | undefined;
|
|
1728
|
-
|
|
1732
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1729
1733
|
partial?: any;
|
|
1730
1734
|
order?: "asc" | "desc" | undefined;
|
|
1731
1735
|
};
|
|
@@ -1740,8 +1744,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1740
1744
|
type: "modifyConstraint";
|
|
1741
1745
|
changes: {
|
|
1742
1746
|
name?: string | undefined;
|
|
1743
|
-
type?: string | undefined;
|
|
1744
1747
|
description?: string | undefined;
|
|
1748
|
+
type?: string | undefined;
|
|
1745
1749
|
predicate?: string | undefined;
|
|
1746
1750
|
field?: string | undefined;
|
|
1747
1751
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1769,8 +1773,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1769
1773
|
} | {
|
|
1770
1774
|
type: "addIndex";
|
|
1771
1775
|
definition: {
|
|
1772
|
-
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1773
1776
|
fields: string[];
|
|
1777
|
+
type: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite";
|
|
1774
1778
|
unique?: boolean | undefined;
|
|
1775
1779
|
name?: string | undefined;
|
|
1776
1780
|
description?: string | undefined;
|
|
@@ -1785,10 +1789,10 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1785
1789
|
type: "modifyIndex";
|
|
1786
1790
|
changes: {
|
|
1787
1791
|
unique?: boolean | undefined;
|
|
1792
|
+
fields?: string[] | undefined;
|
|
1788
1793
|
name?: string | undefined;
|
|
1789
|
-
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1790
1794
|
description?: string | undefined;
|
|
1791
|
-
|
|
1795
|
+
type?: "normal" | "unique" | "btree" | "hash" | "spatial" | "fulltext" | "gi" | "expression" | "composite" | undefined;
|
|
1792
1796
|
partial?: any;
|
|
1793
1797
|
order?: "asc" | "desc" | undefined;
|
|
1794
1798
|
};
|
|
@@ -1803,8 +1807,8 @@ declare const MigrationSchema: z.ZodObject<{
|
|
|
1803
1807
|
type: "modifyConstraint";
|
|
1804
1808
|
changes: {
|
|
1805
1809
|
name?: string | undefined;
|
|
1806
|
-
type?: string | undefined;
|
|
1807
1810
|
description?: string | undefined;
|
|
1811
|
+
type?: string | undefined;
|
|
1808
1812
|
predicate?: string | undefined;
|
|
1809
1813
|
field?: string | undefined;
|
|
1810
1814
|
parameters?: ((params: any) => boolean) | undefined;
|
|
@@ -1839,11 +1843,29 @@ declare const generateSHA256Hash: (input: string) => Promise<string>;
|
|
|
1839
1843
|
declare function deepMerge<T extends object>(target: T, update: Partial<T>): T;
|
|
1840
1844
|
|
|
1841
1845
|
/**
|
|
1842
|
-
* Converts a
|
|
1843
|
-
*
|
|
1844
|
-
*
|
|
1846
|
+
* Converts a SchemaDefinition to TypeScript type definitions
|
|
1847
|
+
*
|
|
1848
|
+
* This function analyzes a schema definition and generates appropriate TypeScript
|
|
1849
|
+
* type declarations. It handles nested objects, arrays, references, and all primitive types
|
|
1850
|
+
* defined in the schema system.
|
|
1851
|
+
*
|
|
1852
|
+
* @param {SchemaDefinition} schema - The schema definition to convert to TypeScript types
|
|
1853
|
+
* @param {boolean} [includeComments=true] - Whether to include JSDoc comments from schema descriptions
|
|
1854
|
+
* @param {boolean} [exportTypes=true] - Whether to export the generated types
|
|
1855
|
+
* @returns {string} TypeScript type definitions as a string
|
|
1856
|
+
*/
|
|
1857
|
+
declare function schemaToTypes(schema: SchemaDefinition, includeComments?: boolean, exportTypes?: boolean): string;
|
|
1858
|
+
/**
|
|
1859
|
+
* Generates a TypeScript interface for validating schema data
|
|
1860
|
+
*
|
|
1861
|
+
* This function creates a validation interface with methods that
|
|
1862
|
+
* correspond to the schema constraints.
|
|
1863
|
+
*
|
|
1864
|
+
* @param {SchemaDefinition} schema - The schema definition
|
|
1865
|
+
* @param {boolean} [exportType=true] - Whether to export the generated interface
|
|
1866
|
+
* @returns {string} TypeScript interface definition for validation
|
|
1845
1867
|
*/
|
|
1846
|
-
declare function
|
|
1868
|
+
declare function generateValidationInterface(schema: SchemaDefinition, exportType?: boolean): string;
|
|
1847
1869
|
|
|
1848
1870
|
/**
|
|
1849
1871
|
* Creates a Standard Schema validator that conforms to the StandardSchemaV1 interface.
|
|
@@ -1892,4 +1914,4 @@ declare function docgen(schema: SchemaDefinition, options?: {
|
|
|
1892
1914
|
faker?: Faker;
|
|
1893
1915
|
}): string;
|
|
1894
1916
|
|
|
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 };
|
|
1917
|
+
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, generateValidationInterface, normalizePath, schemaChangeToPatch, schemaToTypes, sortSemanticVars, validate, validateMigration, validateSchemaChange, validateSchemaDefinition };
|