prisma-flare 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/dist/cli/db-migrate.cjs +119 -49
- package/dist/cli/db-migrate.js +125 -49
- package/dist/cli/db-reset.cjs +119 -49
- package/dist/cli/db-reset.js +125 -49
- package/dist/cli/index.cjs +119 -49
- package/dist/cli/index.js +125 -49
- package/dist/core/flareBuilder.d.cts +17 -45
- package/dist/core/flareBuilder.d.ts +17 -45
- package/dist/core/hooks.cjs +44 -22
- package/dist/core/hooks.d.cts +8 -8
- package/dist/core/hooks.d.ts +8 -8
- package/dist/core/hooks.js +44 -22
- package/dist/{hookRegistry-CjujesJK.d.cts → hookRegistry-B8oyCNJ9.d.cts} +14 -2
- package/dist/{hookRegistry--2l0ARPy.d.ts → hookRegistry-C2bTS4YN.d.ts} +14 -2
- package/dist/hooks.cjs +44 -22
- package/dist/hooks.d.cts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +44 -22
- package/dist/index.cjs +30 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +30 -8
- package/dist/{prisma.types-CIEFXVL-.d.cts → prisma.types-WBv5kOSl.d.cts} +18 -1
- package/dist/{prisma.types-CIEFXVL-.d.ts → prisma.types-WBv5kOSl.d.ts} +18 -1
- package/package.json +2 -2
package/dist/cli/db-migrate.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
+
}) : x)(function(x) {
|
|
5
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
2
8
|
|
|
3
9
|
// src/cli/db-migrate.ts
|
|
4
10
|
import { execSync } from "child_process";
|
|
@@ -209,11 +215,32 @@ function getPrismaProvider(rootDir) {
|
|
|
209
215
|
}
|
|
210
216
|
function parseModelRelations(schemaContent) {
|
|
211
217
|
const models = [];
|
|
212
|
-
const
|
|
218
|
+
const modelStartRegex = /model\s+(\w+)\s*\{/g;
|
|
213
219
|
let modelMatch;
|
|
214
|
-
while ((modelMatch =
|
|
220
|
+
while ((modelMatch = modelStartRegex.exec(schemaContent)) !== null) {
|
|
215
221
|
const modelName = modelMatch[1];
|
|
216
|
-
const
|
|
222
|
+
const bodyStart = modelMatch.index + modelMatch[0].length;
|
|
223
|
+
let depth = 1;
|
|
224
|
+
let i = bodyStart;
|
|
225
|
+
let inString = false;
|
|
226
|
+
let stringChar = "";
|
|
227
|
+
while (i < schemaContent.length && depth > 0) {
|
|
228
|
+
const ch = schemaContent[i];
|
|
229
|
+
if (inString) {
|
|
230
|
+
if (ch === stringChar && schemaContent[i - 1] !== "\\") inString = false;
|
|
231
|
+
} else {
|
|
232
|
+
if (ch === '"' || ch === "'") {
|
|
233
|
+
inString = true;
|
|
234
|
+
stringChar = ch;
|
|
235
|
+
} else if (ch === "{") {
|
|
236
|
+
depth++;
|
|
237
|
+
} else if (ch === "}") {
|
|
238
|
+
depth--;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
i++;
|
|
242
|
+
}
|
|
243
|
+
const modelBody = schemaContent.slice(bodyStart, i - 1);
|
|
217
244
|
const relations = [];
|
|
218
245
|
const lines = modelBody.split("\n");
|
|
219
246
|
for (const line of lines) {
|
|
@@ -273,13 +300,33 @@ ${entries.join(",\n")}
|
|
|
273
300
|
};`;
|
|
274
301
|
}
|
|
275
302
|
function getRelationModelMap(rootDir) {
|
|
303
|
+
const dmmfResult = getRelationModelMapFromDMMF(rootDir);
|
|
304
|
+
if (dmmfResult) return dmmfResult;
|
|
276
305
|
const resolution = resolveSchemaPath(rootDir);
|
|
277
|
-
if (!resolution)
|
|
278
|
-
return null;
|
|
279
|
-
}
|
|
306
|
+
if (!resolution) return null;
|
|
280
307
|
const models = parseModelRelations(resolution.content);
|
|
281
308
|
return generateRelationModelMap(models);
|
|
282
309
|
}
|
|
310
|
+
function getRelationModelMapFromDMMF(rootDir) {
|
|
311
|
+
try {
|
|
312
|
+
const clientPath = getPrismaClientPath(rootDir);
|
|
313
|
+
const resolvedPath = clientPath.startsWith("/") ? clientPath : __require.resolve(clientPath, { paths: [rootDir] });
|
|
314
|
+
const prismaModule = __require(resolvedPath);
|
|
315
|
+
const dmmf = prismaModule?.Prisma?.dmmf ?? prismaModule?.dmmf;
|
|
316
|
+
if (!dmmf?.datamodel?.models) return null;
|
|
317
|
+
const models = dmmf.datamodel.models.map((model) => ({
|
|
318
|
+
name: model.name,
|
|
319
|
+
relations: model.fields.filter((f) => f.kind === "object").map((f) => ({
|
|
320
|
+
fieldName: f.name,
|
|
321
|
+
targetModel: f.type,
|
|
322
|
+
isArray: f.isList
|
|
323
|
+
}))
|
|
324
|
+
}));
|
|
325
|
+
return generateRelationModelMap(models);
|
|
326
|
+
} catch {
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
283
330
|
|
|
284
331
|
// src/cli/templates/type-helpers.ts
|
|
285
332
|
function generateTypeHelpers(options = {}) {
|
|
@@ -525,6 +572,11 @@ ${exportKeyword}type ColumnChangeCallback<T extends ModelName = ModelName> = (
|
|
|
525
572
|
/**
|
|
526
573
|
* Options for column change hooks (afterChange)
|
|
527
574
|
*/
|
|
575
|
+
${exportKeyword}interface HookOptions {
|
|
576
|
+
/** Tag to group hooks. Tagged hooks can be disabled/enabled via hookRegistry.disable(tag)/enable(tag). */
|
|
577
|
+
tag?: string;
|
|
578
|
+
}
|
|
579
|
+
|
|
528
580
|
${exportKeyword}interface ColumnChangeOptions<T extends ModelName = ModelName> {
|
|
529
581
|
/**
|
|
530
582
|
* Additional fields to include when fetching records for this hook.
|
|
@@ -532,6 +584,8 @@ ${exportKeyword}interface ColumnChangeOptions<T extends ModelName = ModelName> {
|
|
|
532
584
|
* Use this when your callback needs access to other fields.
|
|
533
585
|
*/
|
|
534
586
|
includeFields?: FieldName<T>[];
|
|
587
|
+
/** Tag to group hooks. Tagged hooks can be disabled/enabled via hookRegistry.disable(tag)/enable(tag). */
|
|
588
|
+
tag?: string;
|
|
535
589
|
}
|
|
536
590
|
`.trimStart();
|
|
537
591
|
}
|
|
@@ -541,53 +595,53 @@ var FLARE_BUILDER_METHODS = {
|
|
|
541
595
|
whereConditions: [
|
|
542
596
|
{
|
|
543
597
|
name: "where",
|
|
544
|
-
signature: "(condition: WhereInput<T>):
|
|
598
|
+
signature: "(condition: WhereInput<T>): this"
|
|
545
599
|
},
|
|
546
600
|
{
|
|
547
601
|
name: "andWhere",
|
|
548
|
-
signature: "(condition: WhereInput<T>):
|
|
602
|
+
signature: "(condition: WhereInput<T>): this"
|
|
549
603
|
},
|
|
550
604
|
{
|
|
551
605
|
name: "orWhere",
|
|
552
|
-
signature: "(condition: WhereInput<T>):
|
|
606
|
+
signature: "(condition: WhereInput<T>): this"
|
|
553
607
|
},
|
|
554
608
|
{
|
|
555
609
|
name: "whereGroup",
|
|
556
|
-
signature: "(callback: (builder: FlareBuilder<T, Record<string, never>>) => FlareBuilder<T, any>, mode?: 'AND' | 'OR'):
|
|
610
|
+
signature: "(callback: (builder: FlareBuilder<T, Record<string, never>>) => FlareBuilder<T, any>, mode?: 'AND' | 'OR'): this"
|
|
557
611
|
},
|
|
558
612
|
{
|
|
559
613
|
name: "orWhereGroup",
|
|
560
|
-
signature: "(callback: (builder: FlareBuilder<T, Record<string, never>>) => FlareBuilder<T, any>):
|
|
614
|
+
signature: "(callback: (builder: FlareBuilder<T, Record<string, never>>) => FlareBuilder<T, any>): this"
|
|
561
615
|
},
|
|
562
616
|
{
|
|
563
617
|
name: "withId",
|
|
564
|
-
signature: "(id: number | string):
|
|
618
|
+
signature: "(id: number | string): this"
|
|
565
619
|
}
|
|
566
620
|
],
|
|
567
621
|
orderingAndLimiting: [
|
|
568
622
|
{
|
|
569
623
|
name: "order",
|
|
570
|
-
signature: "(orderBy: OrderByInput<T>):
|
|
624
|
+
signature: "(orderBy: OrderByInput<T>): this"
|
|
571
625
|
},
|
|
572
626
|
{
|
|
573
627
|
name: "first",
|
|
574
|
-
signature: "(key?: keyof RecordType<T> | string):
|
|
628
|
+
signature: "(key?: keyof RecordType<T> | string): this"
|
|
575
629
|
},
|
|
576
630
|
{
|
|
577
631
|
name: "last",
|
|
578
|
-
signature: "(key?: keyof RecordType<T> | string):
|
|
632
|
+
signature: "(key?: keyof RecordType<T> | string): this"
|
|
579
633
|
},
|
|
580
634
|
{
|
|
581
635
|
name: "limit",
|
|
582
|
-
signature: "(count: number):
|
|
636
|
+
signature: "(count: number): this"
|
|
583
637
|
},
|
|
584
638
|
{
|
|
585
639
|
name: "skip",
|
|
586
|
-
signature: "(count: number):
|
|
640
|
+
signature: "(count: number): this"
|
|
587
641
|
},
|
|
588
642
|
{
|
|
589
643
|
name: "distinct",
|
|
590
|
-
signature: "(fields: DistinctInput<T>):
|
|
644
|
+
signature: "(fields: DistinctInput<T>): this"
|
|
591
645
|
}
|
|
592
646
|
],
|
|
593
647
|
selection: [
|
|
@@ -699,7 +753,7 @@ var FLARE_BUILDER_METHODS = {
|
|
|
699
753
|
pagination: [
|
|
700
754
|
{
|
|
701
755
|
name: "paginate",
|
|
702
|
-
signature:
|
|
756
|
+
signature: (ns, useFlareResult) => useFlareResult ? `(page?: number, perPage?: number): Promise<PaginatedResult<FlareResult<T, Args>>>` : `(page?: number, perPage?: number): Promise<PaginatedResult<${ns}.Result<ModelDelegate<T>, Args, 'findFirstOrThrow'>>>`
|
|
703
757
|
}
|
|
704
758
|
],
|
|
705
759
|
existence: [
|
|
@@ -711,11 +765,11 @@ var FLARE_BUILDER_METHODS = {
|
|
|
711
765
|
utilities: [
|
|
712
766
|
{
|
|
713
767
|
name: "when",
|
|
714
|
-
signature: "(condition: boolean | (() => boolean), callback: (qb:
|
|
768
|
+
signature: "(condition: boolean | (() => boolean), callback: (qb: this) => void): this"
|
|
715
769
|
},
|
|
716
770
|
{
|
|
717
771
|
name: "chunk",
|
|
718
|
-
signature:
|
|
772
|
+
signature: (ns, useFlareResult) => useFlareResult ? `(size: number, callback: (results: FlareResultMany<T, Args>) => Promise<void> | void): Promise<void>` : `(size: number, callback: (results: ${ns}.Result<ModelDelegate<T>, Args, 'findMany'>) => Promise<void> | void): Promise<void>`
|
|
719
773
|
},
|
|
720
774
|
{
|
|
721
775
|
name: "clone",
|
|
@@ -914,9 +968,10 @@ import {
|
|
|
914
968
|
*/
|
|
915
969
|
export function beforeCreate<T extends ModelName>(
|
|
916
970
|
model: T,
|
|
917
|
-
callback: BeforeHookCallback<T
|
|
971
|
+
callback: BeforeHookCallback<T>,
|
|
972
|
+
options?: HookOptions
|
|
918
973
|
): void {
|
|
919
|
-
_beforeCreate(model as any, callback as any);
|
|
974
|
+
_beforeCreate(model as any, callback as any, options);
|
|
920
975
|
}
|
|
921
976
|
|
|
922
977
|
/**
|
|
@@ -924,9 +979,10 @@ export function beforeCreate<T extends ModelName>(
|
|
|
924
979
|
*/
|
|
925
980
|
export function afterCreate<T extends ModelName>(
|
|
926
981
|
model: T,
|
|
927
|
-
callback: AfterHookCallback<T
|
|
982
|
+
callback: AfterHookCallback<T>,
|
|
983
|
+
options?: HookOptions
|
|
928
984
|
): void {
|
|
929
|
-
_afterCreate(model as any, callback as any);
|
|
985
|
+
_afterCreate(model as any, callback as any, options);
|
|
930
986
|
}
|
|
931
987
|
|
|
932
988
|
/**
|
|
@@ -934,9 +990,10 @@ export function afterCreate<T extends ModelName>(
|
|
|
934
990
|
*/
|
|
935
991
|
export function beforeUpdate<T extends ModelName>(
|
|
936
992
|
model: T,
|
|
937
|
-
callback: BeforeHookCallback<T
|
|
993
|
+
callback: BeforeHookCallback<T>,
|
|
994
|
+
options?: HookOptions
|
|
938
995
|
): void {
|
|
939
|
-
_beforeUpdate(model as any, callback as any);
|
|
996
|
+
_beforeUpdate(model as any, callback as any, options);
|
|
940
997
|
}
|
|
941
998
|
|
|
942
999
|
/**
|
|
@@ -944,9 +1001,10 @@ export function beforeUpdate<T extends ModelName>(
|
|
|
944
1001
|
*/
|
|
945
1002
|
export function afterUpdate<T extends ModelName>(
|
|
946
1003
|
model: T,
|
|
947
|
-
callback: AfterHookCallback<T
|
|
1004
|
+
callback: AfterHookCallback<T>,
|
|
1005
|
+
options?: HookOptions
|
|
948
1006
|
): void {
|
|
949
|
-
_afterUpdate(model as any, callback as any);
|
|
1007
|
+
_afterUpdate(model as any, callback as any, options);
|
|
950
1008
|
}
|
|
951
1009
|
|
|
952
1010
|
/**
|
|
@@ -954,9 +1012,10 @@ export function afterUpdate<T extends ModelName>(
|
|
|
954
1012
|
*/
|
|
955
1013
|
export function beforeDelete<T extends ModelName>(
|
|
956
1014
|
model: T,
|
|
957
|
-
callback: BeforeHookCallback<T
|
|
1015
|
+
callback: BeforeHookCallback<T>,
|
|
1016
|
+
options?: HookOptions
|
|
958
1017
|
): void {
|
|
959
|
-
_beforeDelete(model as any, callback as any);
|
|
1018
|
+
_beforeDelete(model as any, callback as any, options);
|
|
960
1019
|
}
|
|
961
1020
|
|
|
962
1021
|
/**
|
|
@@ -964,9 +1023,10 @@ export function beforeDelete<T extends ModelName>(
|
|
|
964
1023
|
*/
|
|
965
1024
|
export function afterDelete<T extends ModelName>(
|
|
966
1025
|
model: T,
|
|
967
|
-
callback: AfterHookCallback<T
|
|
1026
|
+
callback: AfterHookCallback<T>,
|
|
1027
|
+
options?: HookOptions
|
|
968
1028
|
): void {
|
|
969
|
-
_afterDelete(model as any, callback as any);
|
|
1029
|
+
_afterDelete(model as any, callback as any, options);
|
|
970
1030
|
}
|
|
971
1031
|
|
|
972
1032
|
/**
|
|
@@ -986,9 +1046,10 @@ export function afterChange<T extends ModelName>(
|
|
|
986
1046
|
*/
|
|
987
1047
|
export function afterUpsert<T extends ModelName>(
|
|
988
1048
|
model: T,
|
|
989
|
-
callback: AfterHookCallback<T
|
|
1049
|
+
callback: AfterHookCallback<T>,
|
|
1050
|
+
options?: HookOptions
|
|
990
1051
|
): void {
|
|
991
|
-
_afterUpsert(model as any, callback as any);
|
|
1052
|
+
_afterUpsert(model as any, callback as any, options);
|
|
992
1053
|
}
|
|
993
1054
|
|
|
994
1055
|
// Re-export hookRegistry for advanced use cases
|
|
@@ -1068,7 +1129,8 @@ import {
|
|
|
1068
1129
|
*/
|
|
1069
1130
|
export declare function beforeCreate<T extends ModelName>(
|
|
1070
1131
|
model: T,
|
|
1071
|
-
callback: BeforeHookCallback<T
|
|
1132
|
+
callback: BeforeHookCallback<T>,
|
|
1133
|
+
options?: HookOptions
|
|
1072
1134
|
): void;
|
|
1073
1135
|
|
|
1074
1136
|
/**
|
|
@@ -1076,7 +1138,8 @@ export declare function beforeCreate<T extends ModelName>(
|
|
|
1076
1138
|
*/
|
|
1077
1139
|
export declare function afterCreate<T extends ModelName>(
|
|
1078
1140
|
model: T,
|
|
1079
|
-
callback: AfterHookCallback<T
|
|
1141
|
+
callback: AfterHookCallback<T>,
|
|
1142
|
+
options?: HookOptions
|
|
1080
1143
|
): void;
|
|
1081
1144
|
|
|
1082
1145
|
/**
|
|
@@ -1084,7 +1147,8 @@ export declare function afterCreate<T extends ModelName>(
|
|
|
1084
1147
|
*/
|
|
1085
1148
|
export declare function beforeUpdate<T extends ModelName>(
|
|
1086
1149
|
model: T,
|
|
1087
|
-
callback: BeforeHookCallback<T
|
|
1150
|
+
callback: BeforeHookCallback<T>,
|
|
1151
|
+
options?: HookOptions
|
|
1088
1152
|
): void;
|
|
1089
1153
|
|
|
1090
1154
|
/**
|
|
@@ -1092,7 +1156,8 @@ export declare function beforeUpdate<T extends ModelName>(
|
|
|
1092
1156
|
*/
|
|
1093
1157
|
export declare function afterUpdate<T extends ModelName>(
|
|
1094
1158
|
model: T,
|
|
1095
|
-
callback: AfterHookCallback<T
|
|
1159
|
+
callback: AfterHookCallback<T>,
|
|
1160
|
+
options?: HookOptions
|
|
1096
1161
|
): void;
|
|
1097
1162
|
|
|
1098
1163
|
/**
|
|
@@ -1100,7 +1165,8 @@ export declare function afterUpdate<T extends ModelName>(
|
|
|
1100
1165
|
*/
|
|
1101
1166
|
export declare function beforeDelete<T extends ModelName>(
|
|
1102
1167
|
model: T,
|
|
1103
|
-
callback: BeforeHookCallback<T
|
|
1168
|
+
callback: BeforeHookCallback<T>,
|
|
1169
|
+
options?: HookOptions
|
|
1104
1170
|
): void;
|
|
1105
1171
|
|
|
1106
1172
|
/**
|
|
@@ -1108,7 +1174,8 @@ export declare function beforeDelete<T extends ModelName>(
|
|
|
1108
1174
|
*/
|
|
1109
1175
|
export declare function afterDelete<T extends ModelName>(
|
|
1110
1176
|
model: T,
|
|
1111
|
-
callback: AfterHookCallback<T
|
|
1177
|
+
callback: AfterHookCallback<T>,
|
|
1178
|
+
options?: HookOptions
|
|
1112
1179
|
): void;
|
|
1113
1180
|
|
|
1114
1181
|
/**
|
|
@@ -1126,7 +1193,8 @@ export declare function afterChange<T extends ModelName>(
|
|
|
1126
1193
|
*/
|
|
1127
1194
|
export declare function afterUpsert<T extends ModelName>(
|
|
1128
1195
|
model: T,
|
|
1129
|
-
callback: AfterHookCallback<T
|
|
1196
|
+
callback: AfterHookCallback<T>,
|
|
1197
|
+
options?: HookOptions
|
|
1130
1198
|
): void;
|
|
1131
1199
|
|
|
1132
1200
|
// Re-export hookRegistry for advanced use cases
|
|
@@ -1250,6 +1318,7 @@ import type {
|
|
|
1250
1318
|
AfterHookCallback,
|
|
1251
1319
|
ColumnChangeCallback,
|
|
1252
1320
|
ColumnChangeOptions,
|
|
1321
|
+
HookOptions,
|
|
1253
1322
|
FieldName,
|
|
1254
1323
|
HookConfig
|
|
1255
1324
|
} from 'prisma-flare';
|
|
@@ -1298,7 +1367,8 @@ export declare class FlareClient extends BasePrismaClient {
|
|
|
1298
1367
|
*/
|
|
1299
1368
|
export declare function beforeCreate<T extends ModelName>(
|
|
1300
1369
|
model: T,
|
|
1301
|
-
callback: BeforeHookCallback<T
|
|
1370
|
+
callback: BeforeHookCallback<T>,
|
|
1371
|
+
options?: HookOptions
|
|
1302
1372
|
): void;
|
|
1303
1373
|
|
|
1304
1374
|
/**
|
|
@@ -1306,7 +1376,8 @@ export declare function beforeCreate<T extends ModelName>(
|
|
|
1306
1376
|
*/
|
|
1307
1377
|
export declare function afterCreate<T extends ModelName>(
|
|
1308
1378
|
model: T,
|
|
1309
|
-
callback: AfterHookCallback<T
|
|
1379
|
+
callback: AfterHookCallback<T>,
|
|
1380
|
+
options?: HookOptions
|
|
1310
1381
|
): void;
|
|
1311
1382
|
|
|
1312
1383
|
/**
|
|
@@ -1314,7 +1385,8 @@ export declare function afterCreate<T extends ModelName>(
|
|
|
1314
1385
|
*/
|
|
1315
1386
|
export declare function beforeUpdate<T extends ModelName>(
|
|
1316
1387
|
model: T,
|
|
1317
|
-
callback: BeforeHookCallback<T
|
|
1388
|
+
callback: BeforeHookCallback<T>,
|
|
1389
|
+
options?: HookOptions
|
|
1318
1390
|
): void;
|
|
1319
1391
|
|
|
1320
1392
|
/**
|
|
@@ -1322,7 +1394,8 @@ export declare function beforeUpdate<T extends ModelName>(
|
|
|
1322
1394
|
*/
|
|
1323
1395
|
export declare function afterUpdate<T extends ModelName>(
|
|
1324
1396
|
model: T,
|
|
1325
|
-
callback: AfterHookCallback<T
|
|
1397
|
+
callback: AfterHookCallback<T>,
|
|
1398
|
+
options?: HookOptions
|
|
1326
1399
|
): void;
|
|
1327
1400
|
|
|
1328
1401
|
/**
|
|
@@ -1330,7 +1403,8 @@ export declare function afterUpdate<T extends ModelName>(
|
|
|
1330
1403
|
*/
|
|
1331
1404
|
export declare function beforeDelete<T extends ModelName>(
|
|
1332
1405
|
model: T,
|
|
1333
|
-
callback: BeforeHookCallback<T
|
|
1406
|
+
callback: BeforeHookCallback<T>,
|
|
1407
|
+
options?: HookOptions
|
|
1334
1408
|
): void;
|
|
1335
1409
|
|
|
1336
1410
|
/**
|
|
@@ -1338,7 +1412,8 @@ export declare function beforeDelete<T extends ModelName>(
|
|
|
1338
1412
|
*/
|
|
1339
1413
|
export declare function afterDelete<T extends ModelName>(
|
|
1340
1414
|
model: T,
|
|
1341
|
-
callback: AfterHookCallback<T
|
|
1415
|
+
callback: AfterHookCallback<T>,
|
|
1416
|
+
options?: HookOptions
|
|
1342
1417
|
): void;
|
|
1343
1418
|
|
|
1344
1419
|
/**
|
|
@@ -1356,7 +1431,8 @@ export declare function afterChange<T extends ModelName>(
|
|
|
1356
1431
|
*/
|
|
1357
1432
|
export declare function afterUpsert<T extends ModelName>(
|
|
1358
1433
|
model: T,
|
|
1359
|
-
callback: AfterHookCallback<T
|
|
1434
|
+
callback: AfterHookCallback<T>,
|
|
1435
|
+
options?: HookOptions
|
|
1360
1436
|
): void;
|
|
1361
1437
|
|
|
1362
1438
|
// Re-export hookRegistry for advanced use cases
|