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