@lpdjs/firestore-repo-service 3.0.16 → 3.0.17
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/{create-servers-DSXdPM6o.d.ts → create-servers-BQ7pxnG0.d.ts} +2 -2
- package/dist/{create-servers-BMpE8oAc.d.cts → create-servers-DKg5Yg2d.d.cts} +2 -2
- package/dist/effects-B8aIXMZ2.d.ts +158 -0
- package/dist/effects-CqJSneNZ.d.cts +158 -0
- package/dist/index.cjs +92 -92
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +92 -92
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +110 -2
- package/dist/llms.txt +1 -1
- package/dist/servers/admin/index.d.cts +1 -1
- package/dist/servers/admin/index.d.ts +1 -1
- package/dist/servers/crud/index.cjs +2 -2
- package/dist/servers/crud/index.cjs.map +1 -1
- package/dist/servers/crud/index.d.cts +4 -5
- package/dist/servers/crud/index.d.ts +4 -5
- package/dist/servers/crud/index.js +2 -2
- package/dist/servers/crud/index.js.map +1 -1
- package/dist/servers/index.cjs +101 -101
- package/dist/servers/index.cjs.map +1 -1
- package/dist/servers/index.d.cts +4 -5
- package/dist/servers/index.d.ts +4 -5
- package/dist/servers/index.js +101 -101
- package/dist/servers/index.js.map +1 -1
- package/dist/{types-mKcJozu4.d.cts → types-DgzPoPvx.d.cts} +282 -2
- package/dist/{types-CaCBG76r.d.ts → types-wMBgnYjH.d.ts} +282 -2
- package/package.json +1 -1
- package/dist/openapi-CKTuB2Yz.d.ts +0 -70
- package/dist/openapi-Cb3QMU0Q.d.cts +0 -70
- package/dist/rules-DY5f_wPw.d.ts +0 -30
- package/dist/rules-DhNUzbIl.d.cts +0 -30
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { b as AuthUser } from './firebase-auth-nG3prKoj.cjs';
|
|
2
2
|
import { H as HonoServerOptions, O as OpenAPIConfig } from './types-BDTx8VPg.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { Context } from 'hono';
|
|
4
5
|
import { HttpsOptions } from 'firebase-functions/v2/https';
|
|
5
6
|
import { H as HistoryMethods } from './read-Dfah1PPl.cjs';
|
|
6
7
|
import { DocumentSnapshot, Query, CollectionReference, WriteBatch, Transaction, DocumentReference } from 'firebase-admin/firestore';
|
|
@@ -729,6 +730,27 @@ interface CrudRepoConfig<TRepo extends ConfiguredRepository<any> = ConfiguredRep
|
|
|
729
730
|
* ```
|
|
730
731
|
*/
|
|
731
732
|
rules?: CrudRules<TRepo>;
|
|
733
|
+
/**
|
|
734
|
+
* Post-write lifecycle hooks executed **after** Firestore writes commit and
|
|
735
|
+
* `await`ed before the HTTP response is sent.
|
|
736
|
+
*
|
|
737
|
+
* Unlike `rules` (which govern pre-write authorization and `preWrite`
|
|
738
|
+
* mutations), `hooks` are dedicated to side effects (recalculations,
|
|
739
|
+
* notifications, cascading writes). Errors thrown by hooks are caught and
|
|
740
|
+
* forwarded to `onHookError` (or the server logger) so a committed write
|
|
741
|
+
* never returns a misleading HTTP 500.
|
|
742
|
+
*
|
|
743
|
+
* @example
|
|
744
|
+
* ```ts
|
|
745
|
+
* hooks: {
|
|
746
|
+
* afterCreate: async ({ doc, id, user }) => { ... },
|
|
747
|
+
* afterUpdate: async ({ before, after, diff, pathArgs }) => { ... },
|
|
748
|
+
* afterDelete: async ({ doc, id }) => { ... },
|
|
749
|
+
* afterBatch: async ({ created, updated, deleted }) => { ... },
|
|
750
|
+
* }
|
|
751
|
+
* ```
|
|
752
|
+
*/
|
|
753
|
+
hooks?: CrudHooks<TRepo>;
|
|
732
754
|
}
|
|
733
755
|
/** Return type of a diff computation comparing before and after states. */
|
|
734
756
|
interface DeepDiffReturn<T> {
|
|
@@ -820,6 +842,252 @@ interface CrudRules<TRepo extends ConfiguredRepository<any> = ConfiguredReposito
|
|
|
820
842
|
}
|
|
821
843
|
/** Erased rules type stored on the runtime registry entry. */
|
|
822
844
|
type AnyCrudRules = CrudRules<any>;
|
|
845
|
+
/** Write operations that support pre-write mutations. */
|
|
846
|
+
type CrudWriteOperation = "create" | "update";
|
|
847
|
+
/** Context passed to each pre-write mutation entry. */
|
|
848
|
+
interface MutationContext<T> {
|
|
849
|
+
/** Validated payload mutated by reference before writing to Firestore. */
|
|
850
|
+
body: Partial<T>;
|
|
851
|
+
/** Existing document (`null` on `create`). */
|
|
852
|
+
doc: T | null;
|
|
853
|
+
/** Current diff (on `create`: `before = {}`, `changes = body`). */
|
|
854
|
+
diff: DeepDiffReturn<T>;
|
|
855
|
+
/** Triggering field key, or `"*"` for global mutations executed on every write. */
|
|
856
|
+
key: keyof T | "*";
|
|
857
|
+
operation: CrudWriteOperation;
|
|
858
|
+
user?: AuthUser;
|
|
859
|
+
}
|
|
860
|
+
/** Bare pre-write mutation callback. */
|
|
861
|
+
type PreWriteMutationFn<T> = (ctx: MutationContext<T>) => void | Promise<void>;
|
|
862
|
+
/** Declarative pre-write mutation rule with description and optional operation filter. */
|
|
863
|
+
interface MutationRule<T> {
|
|
864
|
+
description: string;
|
|
865
|
+
/** Restrict execution to `"create"` or `"update"` (default: both). */
|
|
866
|
+
operations?: CrudWriteOperation[];
|
|
867
|
+
mutation: PreWriteMutationFn<T>;
|
|
868
|
+
}
|
|
869
|
+
/** A single pre-write mutation entry (either a bare function or a structured rule). */
|
|
870
|
+
type PreWriteMutation<T> = MutationRule<T> | PreWriteMutationFn<T>;
|
|
871
|
+
/**
|
|
872
|
+
* Map of pre-write mutations indexed by model field key, plus an optional `"*"`
|
|
873
|
+
* wildcard bucket executed on every write after per-field mutations.
|
|
874
|
+
*/
|
|
875
|
+
type MutationsMap<T> = Partial<Record<keyof T, PreWriteMutation<T>[]>> & {
|
|
876
|
+
"*"?: PreWriteMutation<T>[];
|
|
877
|
+
};
|
|
878
|
+
/** Operations that can trigger reactive effects. */
|
|
879
|
+
type CrudEffectOperation = "create" | "update" | "delete";
|
|
880
|
+
/** Arguments passed to a {@link RuleEffect.rule} predicate. */
|
|
881
|
+
interface EffectPredicateArgs<T> {
|
|
882
|
+
diff: DeepDiffReturn<T>;
|
|
883
|
+
key: keyof T | "*";
|
|
884
|
+
operation?: CrudEffectOperation;
|
|
885
|
+
user?: AuthUser;
|
|
886
|
+
}
|
|
887
|
+
/** A reactive post-write effect attached to a field (or `"*"`). */
|
|
888
|
+
interface RuleEffect<T, TContext> {
|
|
889
|
+
description: string;
|
|
890
|
+
rule: (args: EffectPredicateArgs<T>) => boolean | void | Promise<boolean | void>;
|
|
891
|
+
/** May return corrective fields (`Partial<T>`) to patch onto the current document. */
|
|
892
|
+
handler: (ctx: TContext) => Promise<void | Partial<T>> | void | Partial<T>;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Map of post-write effects indexed by model field key, plus an optional `"*"`
|
|
896
|
+
* wildcard bucket executed after per-field effects (e.g. cross-field recalculations).
|
|
897
|
+
*/
|
|
898
|
+
type EffectsMap<T, TContext> = Partial<Record<keyof T, RuleEffect<T, TContext>[]>> & {
|
|
899
|
+
"*"?: RuleEffect<T, TContext>[];
|
|
900
|
+
};
|
|
901
|
+
/** Execution outcome for a single {@link RuleEffect}. */
|
|
902
|
+
interface EffectExecutionResult {
|
|
903
|
+
key: string;
|
|
904
|
+
description: string;
|
|
905
|
+
isCalled: boolean;
|
|
906
|
+
error: null | unknown;
|
|
907
|
+
}
|
|
908
|
+
/** Aggregated result returned by {@link applyEffects}. */
|
|
909
|
+
interface ApplyEffectsResult<T> {
|
|
910
|
+
results: EffectExecutionResult[];
|
|
911
|
+
changesNeeded: Partial<T>;
|
|
912
|
+
hasErrors: boolean;
|
|
913
|
+
}
|
|
914
|
+
/** Context passed to {@link CrudHooks.beforeCreate}. */
|
|
915
|
+
interface CrudBeforeCreateContext<T = Record<string, unknown>> {
|
|
916
|
+
user: AuthUser;
|
|
917
|
+
/** Validated payload mutated by reference before persisting to Firestore. */
|
|
918
|
+
body: Partial<T>;
|
|
919
|
+
params: Record<string, string>;
|
|
920
|
+
/** Hono request context (headers, auth, etc.). */
|
|
921
|
+
c: Context;
|
|
922
|
+
}
|
|
923
|
+
/** Context passed to {@link CrudHooks.beforeUpdate}. */
|
|
924
|
+
interface CrudBeforeUpdateContext<T = Record<string, unknown>> {
|
|
925
|
+
user: AuthUser;
|
|
926
|
+
/** Existing document snapshot before update. */
|
|
927
|
+
doc: T;
|
|
928
|
+
/** Validated payload mutated by reference before persisting to Firestore. */
|
|
929
|
+
body: Partial<T>;
|
|
930
|
+
/** Current diff before `beforeUpdate` mutations. */
|
|
931
|
+
diff: DeepDiffReturn<T>;
|
|
932
|
+
params: Record<string, string>;
|
|
933
|
+
/** Hono request context (headers, auth, etc.). */
|
|
934
|
+
c: Context;
|
|
935
|
+
}
|
|
936
|
+
/** Context passed to {@link CrudHooks.afterCreate}. */
|
|
937
|
+
interface CrudAfterCreateContext<T = Record<string, unknown>> {
|
|
938
|
+
user: AuthUser;
|
|
939
|
+
/** Created document as persisted in Firestore. */
|
|
940
|
+
doc: T;
|
|
941
|
+
/** Created document ID. */
|
|
942
|
+
id: string;
|
|
943
|
+
/** Positional Firestore document path arguments (e.g. `[docId]` or `[workshopId, docId]`). */
|
|
944
|
+
pathArgs: string[];
|
|
945
|
+
params: Record<string, string>;
|
|
946
|
+
/** Hono request context (headers, auth, etc.). */
|
|
947
|
+
c: Context;
|
|
948
|
+
}
|
|
949
|
+
/** Context passed to {@link CrudHooks.afterUpdate}. */
|
|
950
|
+
interface CrudAfterUpdateContext<T = Record<string, unknown>> {
|
|
951
|
+
user: AuthUser;
|
|
952
|
+
/** Existing document snapshot BEFORE write. */
|
|
953
|
+
before: T;
|
|
954
|
+
/** Document returned AFTER write (including `preWrite` mutations). */
|
|
955
|
+
after: T;
|
|
956
|
+
/** Final persisted payload (after `rules.update` / `preWrite` mutations). */
|
|
957
|
+
body: Partial<T>;
|
|
958
|
+
/** Diff recomputed AFTER `rules.update` (`preWrite`) so mutated fields are captured. */
|
|
959
|
+
diff: DeepDiffReturn<T>;
|
|
960
|
+
id: string;
|
|
961
|
+
/** Positional Firestore document path arguments (e.g. `[docId]` or `[workshopId, eventId]`). */
|
|
962
|
+
pathArgs: string[];
|
|
963
|
+
params: Record<string, string>;
|
|
964
|
+
/** Hono request context (headers, auth, etc.). */
|
|
965
|
+
c: Context;
|
|
966
|
+
}
|
|
967
|
+
/** Context passed to {@link CrudHooks.afterDelete}. */
|
|
968
|
+
interface CrudAfterDeleteContext<T = Record<string, unknown>> {
|
|
969
|
+
user: AuthUser;
|
|
970
|
+
/** Deleted document snapshot captured before deletion. */
|
|
971
|
+
doc: T;
|
|
972
|
+
id: string;
|
|
973
|
+
/** Positional Firestore document path arguments. */
|
|
974
|
+
pathArgs: string[];
|
|
975
|
+
params: Record<string, string>;
|
|
976
|
+
/** Hono request context (headers, auth, etc.). */
|
|
977
|
+
c: Context;
|
|
978
|
+
}
|
|
979
|
+
/** Created item metadata passed inside {@link CrudAfterBatchContext.created}. */
|
|
980
|
+
interface CrudAfterBatchCreatedItem<T = Record<string, unknown>> {
|
|
981
|
+
id: string;
|
|
982
|
+
pathArgs: string[];
|
|
983
|
+
doc: T;
|
|
984
|
+
}
|
|
985
|
+
/** Updated item metadata passed inside {@link CrudAfterBatchContext.updated}. */
|
|
986
|
+
interface CrudAfterBatchUpdatedItem<T = Record<string, unknown>> {
|
|
987
|
+
id: string;
|
|
988
|
+
pathArgs: string[];
|
|
989
|
+
before: T;
|
|
990
|
+
/** Projected state after applying the final payload (including `preWrite` mutations). */
|
|
991
|
+
after: T;
|
|
992
|
+
body: Partial<T>;
|
|
993
|
+
/** Diff recomputed AFTER `rules.update` (`preWrite`). */
|
|
994
|
+
diff: DeepDiffReturn<T>;
|
|
995
|
+
}
|
|
996
|
+
/** Deleted item metadata passed inside {@link CrudAfterBatchContext.deleted}. */
|
|
997
|
+
interface CrudAfterBatchDeletedItem<T = Record<string, unknown>> {
|
|
998
|
+
id: string;
|
|
999
|
+
pathArgs: string[];
|
|
1000
|
+
doc: T;
|
|
1001
|
+
}
|
|
1002
|
+
/** Context passed to {@link CrudHooks.afterBatch}. */
|
|
1003
|
+
interface CrudAfterBatchContext<T = Record<string, unknown>> {
|
|
1004
|
+
user: AuthUser;
|
|
1005
|
+
created: Array<CrudAfterBatchCreatedItem<T>>;
|
|
1006
|
+
updated: Array<CrudAfterBatchUpdatedItem<T>>;
|
|
1007
|
+
deleted: Array<CrudAfterBatchDeletedItem<T>>;
|
|
1008
|
+
params: Record<string, string>;
|
|
1009
|
+
/** Hono request context (headers, auth, etc.). */
|
|
1010
|
+
c: Context;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Per-repo post-write lifecycle hooks.
|
|
1014
|
+
*
|
|
1015
|
+
* All hooks are `await`ed before sending the HTTP response (critical on
|
|
1016
|
+
* Cloud Functions v2 where CPU is throttled once the response finishes) while
|
|
1017
|
+
* the `actorResolver` `AsyncLocalStorage` scope is still active.
|
|
1018
|
+
*
|
|
1019
|
+
* @template TRepo - The configured repository (used to type `doc`, `before`, `after`, `body`, `diff`).
|
|
1020
|
+
*/
|
|
1021
|
+
interface CrudHooks<TRepo extends ConfiguredRepository<any> = ConfiguredRepository<any>> {
|
|
1022
|
+
/**
|
|
1023
|
+
* Called after schema validation and `rules.create` pass, right before
|
|
1024
|
+
* persisting the new document (`POST /:repoName` and batch `create`).
|
|
1025
|
+
* Mutate `ctx.body` in place to normalize or inject server-derived fields.
|
|
1026
|
+
*/
|
|
1027
|
+
beforeCreate?: (ctx: CrudBeforeCreateContext<RepoModelType<TRepo>>) => void | Promise<void>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Called after schema validation and `rules.update` pass, right before
|
|
1030
|
+
* persisting the update (`PUT/PATCH /:repoName/:id` and batch `update`).
|
|
1031
|
+
* Mutate `ctx.body` in place; `diff` is recomputed afterward for `afterUpdate` / `afterBatch`.
|
|
1032
|
+
*/
|
|
1033
|
+
beforeUpdate?: (ctx: CrudBeforeUpdateContext<RepoModelType<TRepo>>) => void | Promise<void>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Called after a document is created (`POST /:repoName`).
|
|
1036
|
+
* Returning a non-empty `Partial<T>` patches the newly created document via
|
|
1037
|
+
* `repo.update(...pathArgs, changes)` and returns the updated document in the response.
|
|
1038
|
+
*/
|
|
1039
|
+
afterCreate?: (ctx: CrudAfterCreateContext<RepoModelType<TRepo>>) => Promise<void | Partial<RepoModelType<TRepo>>> | void | Partial<RepoModelType<TRepo>>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Called after a document is updated (`PUT/PATCH /:repoName/:id`).
|
|
1042
|
+
* Returning a non-empty `Partial<T>` patches the updated document via
|
|
1043
|
+
* `repo.update(...pathArgs, changes)` and returns the final document in the response.
|
|
1044
|
+
*/
|
|
1045
|
+
afterUpdate?: (ctx: CrudAfterUpdateContext<RepoModelType<TRepo>>) => Promise<void | Partial<RepoModelType<TRepo>>> | void | Partial<RepoModelType<TRepo>>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Called after a document is deleted (`DELETE /:repoName/:id`).
|
|
1048
|
+
*/
|
|
1049
|
+
afterDelete?: (ctx: CrudAfterDeleteContext<RepoModelType<TRepo>>) => Promise<void> | void;
|
|
1050
|
+
/**
|
|
1051
|
+
* Called ONCE after `batch.commit()` (`POST /:repoName/batch`).
|
|
1052
|
+
* When omitted, the server falls back to calling `afterCreate` / `afterUpdate` /
|
|
1053
|
+
* `afterDelete` sequentially on each committed item.
|
|
1054
|
+
*/
|
|
1055
|
+
afterBatch?: (ctx: CrudAfterBatchContext<RepoModelType<TRepo>>) => Promise<void> | void;
|
|
1056
|
+
/**
|
|
1057
|
+
* Per-repo error callback for `after*` hooks (and follow-up `changesNeeded`
|
|
1058
|
+
* patches), since the primary Firestore write has already committed.
|
|
1059
|
+
*/
|
|
1060
|
+
onAfterError?: (err: unknown, phase: CrudHookName) => void | Promise<void>;
|
|
1061
|
+
}
|
|
1062
|
+
/** Erased hooks type stored on the runtime registry entry. */
|
|
1063
|
+
type AnyCrudHooks = CrudHooks<any>;
|
|
1064
|
+
/** Hook name reported to {@link CrudHookErrorCallback}. */
|
|
1065
|
+
type CrudHookName = "afterCreate" | "afterUpdate" | "afterDelete" | "afterBatch";
|
|
1066
|
+
/** Context provided to {@link CrudServerOptions.onHookError} when a post-write hook throws. */
|
|
1067
|
+
interface CrudHookErrorContext {
|
|
1068
|
+
/** Hook that threw (or whose follow-up `changesNeeded` update failed). */
|
|
1069
|
+
hook: CrudHookName;
|
|
1070
|
+
/** Repository name in the CRUD registry. */
|
|
1071
|
+
repoName: string;
|
|
1072
|
+
/** Firestore collection path. */
|
|
1073
|
+
path: string;
|
|
1074
|
+
/** Document ID (present for single-doc hooks and batch fallback; undefined for `afterBatch`). */
|
|
1075
|
+
id?: string;
|
|
1076
|
+
/** Positional path args (present for single-doc hooks and batch fallback; undefined for `afterBatch`). */
|
|
1077
|
+
pathArgs?: string[];
|
|
1078
|
+
/** Authenticated user (or `null` when auth is off). */
|
|
1079
|
+
user: AuthUser | null;
|
|
1080
|
+
/** The thrown error. */
|
|
1081
|
+
error: unknown;
|
|
1082
|
+
/** Hono request context. */
|
|
1083
|
+
c: Context;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Callback invoked when a CRUD post-write hook throws an error.
|
|
1087
|
+
* Because the primary Firestore write is already committed, the HTTP request
|
|
1088
|
+
* still succeeds and this callback lets you log / alert without returning a 500.
|
|
1089
|
+
*/
|
|
1090
|
+
type CrudHookErrorCallback = (ctx: CrudHookErrorContext) => void | Promise<void>;
|
|
823
1091
|
/**
|
|
824
1092
|
* Internal repo entry for the CRUD server.
|
|
825
1093
|
*/
|
|
@@ -855,6 +1123,8 @@ interface CrudRepoEntry {
|
|
|
855
1123
|
validate?: (data: any, operation: "create" | "update") => string | undefined | Promise<string | undefined>;
|
|
856
1124
|
/** Per-operation authorization rules (see {@link CrudRules}). */
|
|
857
1125
|
rules?: AnyCrudRules;
|
|
1126
|
+
/** Post-write lifecycle hooks (see {@link CrudHooks}). */
|
|
1127
|
+
hooks?: AnyCrudHooks;
|
|
858
1128
|
}
|
|
859
1129
|
type CrudRepoRegistry = Record<string, CrudRepoEntry>;
|
|
860
1130
|
/**
|
|
@@ -943,6 +1213,16 @@ interface CrudServerOptions<TRepos extends Record<string, ConfiguredRepository<a
|
|
|
943
1213
|
* Alias for {@link indexesError}.
|
|
944
1214
|
*/
|
|
945
1215
|
onIndexError?: IndexErrorCallback;
|
|
1216
|
+
/**
|
|
1217
|
+
* Callback invoked when a post-write lifecycle hook (`afterCreate`,
|
|
1218
|
+
* `afterUpdate`, `afterDelete`, `afterBatch`) or its optional `changesNeeded`
|
|
1219
|
+
* follow-up update throws.
|
|
1220
|
+
*
|
|
1221
|
+
* Because the primary Firestore write has already committed, hook errors are
|
|
1222
|
+
* caught so the client does not receive a misleading HTTP 500. When omitted,
|
|
1223
|
+
* errors are logged via the server `logger` (if configured) or `console.error`.
|
|
1224
|
+
*/
|
|
1225
|
+
onHookError?: CrudHookErrorCallback;
|
|
946
1226
|
}
|
|
947
1227
|
/**
|
|
948
1228
|
* Context provided to the `indexesError` callback when a Firestore query fails due to a missing composite index.
|
|
@@ -1080,5 +1360,5 @@ interface QueryRequestBody {
|
|
|
1080
1360
|
withTotal?: boolean;
|
|
1081
1361
|
}
|
|
1082
1362
|
|
|
1083
|
-
export {
|
|
1084
|
-
export type {
|
|
1363
|
+
export { DEFAULT_HTML_CSP as a0, securityHeaders as a1, createPaginationIterator as ad, executePaginatedQuery as ae };
|
|
1364
|
+
export type { QueryError as $, AnyCrudHooks as A, MutationRule as B, ConfiguredRepository as C, DeepDiffReturn as D, EffectExecutionResult as E, FieldRole as F, MutationsMap as G, PreWriteMutationFn as H, IndexErrorCallback as I, RepoRelationKeys as J, Rule as K, ListResponseData as L, MutationContext as M, RuleEffect as N, OpenAPISpecOptions as O, PreWriteMutation as P, QueryRequestBody as Q, RepoFieldPath as R, RuleResult as S, RulesMap as T, UserFieldPath as U, RelationalFieldMeta as V, SecurityHeadersOptions as W, PageOptions as X, ColumnMeta as Y, FilterState as Z, SortState as _, CrudServerOptions as a, PaginationOptions as a2, GenerateGetMethods as a3, GenerateQueryMethods as a4, IncludeConfigTyped as a5, PaginationResult as a6, PaginationWithIncludeOptionsTyped as a7, PopulateOptionsTyped as a8, SystemBackfillFailure as a9, SystemBackfillOptions as aa, SystemBackfillResult as ab, UpdatableData as ac, ApiResponse as b, ApplyEffectsResult as c, CrudAfterBatchContext as d, CrudAfterBatchCreatedItem as e, CrudAfterBatchDeletedItem as f, CrudAfterBatchUpdatedItem as g, CrudAfterCreateContext as h, CrudAfterDeleteContext as i, CrudAfterUpdateContext as j, CrudBeforeCreateContext as k, CrudBeforeUpdateContext as l, CrudEffectOperation as m, CrudHookErrorCallback as n, CrudHookErrorContext as o, CrudHookName as p, CrudHooks as q, CrudRepoConfig as r, CrudRepoEntry as s, CrudRepoRegistry as t, CrudRules as u, CrudUpdateRuleContext as v, CrudWriteOperation as w, EffectPredicateArgs as x, EffectsMap as y, IndexErrorContext as z };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { b as AuthUser } from './firebase-auth-nG3prKoj.js';
|
|
2
2
|
import { H as HonoServerOptions, O as OpenAPIConfig } from './types-w1rEqs0Z.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { Context } from 'hono';
|
|
4
5
|
import { HttpsOptions } from 'firebase-functions/v2/https';
|
|
5
6
|
import { H as HistoryMethods } from './read-BPov7lws.js';
|
|
6
7
|
import { DocumentSnapshot, Query, CollectionReference, WriteBatch, Transaction, DocumentReference } from 'firebase-admin/firestore';
|
|
@@ -729,6 +730,27 @@ interface CrudRepoConfig<TRepo extends ConfiguredRepository<any> = ConfiguredRep
|
|
|
729
730
|
* ```
|
|
730
731
|
*/
|
|
731
732
|
rules?: CrudRules<TRepo>;
|
|
733
|
+
/**
|
|
734
|
+
* Post-write lifecycle hooks executed **after** Firestore writes commit and
|
|
735
|
+
* `await`ed before the HTTP response is sent.
|
|
736
|
+
*
|
|
737
|
+
* Unlike `rules` (which govern pre-write authorization and `preWrite`
|
|
738
|
+
* mutations), `hooks` are dedicated to side effects (recalculations,
|
|
739
|
+
* notifications, cascading writes). Errors thrown by hooks are caught and
|
|
740
|
+
* forwarded to `onHookError` (or the server logger) so a committed write
|
|
741
|
+
* never returns a misleading HTTP 500.
|
|
742
|
+
*
|
|
743
|
+
* @example
|
|
744
|
+
* ```ts
|
|
745
|
+
* hooks: {
|
|
746
|
+
* afterCreate: async ({ doc, id, user }) => { ... },
|
|
747
|
+
* afterUpdate: async ({ before, after, diff, pathArgs }) => { ... },
|
|
748
|
+
* afterDelete: async ({ doc, id }) => { ... },
|
|
749
|
+
* afterBatch: async ({ created, updated, deleted }) => { ... },
|
|
750
|
+
* }
|
|
751
|
+
* ```
|
|
752
|
+
*/
|
|
753
|
+
hooks?: CrudHooks<TRepo>;
|
|
732
754
|
}
|
|
733
755
|
/** Return type of a diff computation comparing before and after states. */
|
|
734
756
|
interface DeepDiffReturn<T> {
|
|
@@ -820,6 +842,252 @@ interface CrudRules<TRepo extends ConfiguredRepository<any> = ConfiguredReposito
|
|
|
820
842
|
}
|
|
821
843
|
/** Erased rules type stored on the runtime registry entry. */
|
|
822
844
|
type AnyCrudRules = CrudRules<any>;
|
|
845
|
+
/** Write operations that support pre-write mutations. */
|
|
846
|
+
type CrudWriteOperation = "create" | "update";
|
|
847
|
+
/** Context passed to each pre-write mutation entry. */
|
|
848
|
+
interface MutationContext<T> {
|
|
849
|
+
/** Validated payload mutated by reference before writing to Firestore. */
|
|
850
|
+
body: Partial<T>;
|
|
851
|
+
/** Existing document (`null` on `create`). */
|
|
852
|
+
doc: T | null;
|
|
853
|
+
/** Current diff (on `create`: `before = {}`, `changes = body`). */
|
|
854
|
+
diff: DeepDiffReturn<T>;
|
|
855
|
+
/** Triggering field key, or `"*"` for global mutations executed on every write. */
|
|
856
|
+
key: keyof T | "*";
|
|
857
|
+
operation: CrudWriteOperation;
|
|
858
|
+
user?: AuthUser;
|
|
859
|
+
}
|
|
860
|
+
/** Bare pre-write mutation callback. */
|
|
861
|
+
type PreWriteMutationFn<T> = (ctx: MutationContext<T>) => void | Promise<void>;
|
|
862
|
+
/** Declarative pre-write mutation rule with description and optional operation filter. */
|
|
863
|
+
interface MutationRule<T> {
|
|
864
|
+
description: string;
|
|
865
|
+
/** Restrict execution to `"create"` or `"update"` (default: both). */
|
|
866
|
+
operations?: CrudWriteOperation[];
|
|
867
|
+
mutation: PreWriteMutationFn<T>;
|
|
868
|
+
}
|
|
869
|
+
/** A single pre-write mutation entry (either a bare function or a structured rule). */
|
|
870
|
+
type PreWriteMutation<T> = MutationRule<T> | PreWriteMutationFn<T>;
|
|
871
|
+
/**
|
|
872
|
+
* Map of pre-write mutations indexed by model field key, plus an optional `"*"`
|
|
873
|
+
* wildcard bucket executed on every write after per-field mutations.
|
|
874
|
+
*/
|
|
875
|
+
type MutationsMap<T> = Partial<Record<keyof T, PreWriteMutation<T>[]>> & {
|
|
876
|
+
"*"?: PreWriteMutation<T>[];
|
|
877
|
+
};
|
|
878
|
+
/** Operations that can trigger reactive effects. */
|
|
879
|
+
type CrudEffectOperation = "create" | "update" | "delete";
|
|
880
|
+
/** Arguments passed to a {@link RuleEffect.rule} predicate. */
|
|
881
|
+
interface EffectPredicateArgs<T> {
|
|
882
|
+
diff: DeepDiffReturn<T>;
|
|
883
|
+
key: keyof T | "*";
|
|
884
|
+
operation?: CrudEffectOperation;
|
|
885
|
+
user?: AuthUser;
|
|
886
|
+
}
|
|
887
|
+
/** A reactive post-write effect attached to a field (or `"*"`). */
|
|
888
|
+
interface RuleEffect<T, TContext> {
|
|
889
|
+
description: string;
|
|
890
|
+
rule: (args: EffectPredicateArgs<T>) => boolean | void | Promise<boolean | void>;
|
|
891
|
+
/** May return corrective fields (`Partial<T>`) to patch onto the current document. */
|
|
892
|
+
handler: (ctx: TContext) => Promise<void | Partial<T>> | void | Partial<T>;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Map of post-write effects indexed by model field key, plus an optional `"*"`
|
|
896
|
+
* wildcard bucket executed after per-field effects (e.g. cross-field recalculations).
|
|
897
|
+
*/
|
|
898
|
+
type EffectsMap<T, TContext> = Partial<Record<keyof T, RuleEffect<T, TContext>[]>> & {
|
|
899
|
+
"*"?: RuleEffect<T, TContext>[];
|
|
900
|
+
};
|
|
901
|
+
/** Execution outcome for a single {@link RuleEffect}. */
|
|
902
|
+
interface EffectExecutionResult {
|
|
903
|
+
key: string;
|
|
904
|
+
description: string;
|
|
905
|
+
isCalled: boolean;
|
|
906
|
+
error: null | unknown;
|
|
907
|
+
}
|
|
908
|
+
/** Aggregated result returned by {@link applyEffects}. */
|
|
909
|
+
interface ApplyEffectsResult<T> {
|
|
910
|
+
results: EffectExecutionResult[];
|
|
911
|
+
changesNeeded: Partial<T>;
|
|
912
|
+
hasErrors: boolean;
|
|
913
|
+
}
|
|
914
|
+
/** Context passed to {@link CrudHooks.beforeCreate}. */
|
|
915
|
+
interface CrudBeforeCreateContext<T = Record<string, unknown>> {
|
|
916
|
+
user: AuthUser;
|
|
917
|
+
/** Validated payload mutated by reference before persisting to Firestore. */
|
|
918
|
+
body: Partial<T>;
|
|
919
|
+
params: Record<string, string>;
|
|
920
|
+
/** Hono request context (headers, auth, etc.). */
|
|
921
|
+
c: Context;
|
|
922
|
+
}
|
|
923
|
+
/** Context passed to {@link CrudHooks.beforeUpdate}. */
|
|
924
|
+
interface CrudBeforeUpdateContext<T = Record<string, unknown>> {
|
|
925
|
+
user: AuthUser;
|
|
926
|
+
/** Existing document snapshot before update. */
|
|
927
|
+
doc: T;
|
|
928
|
+
/** Validated payload mutated by reference before persisting to Firestore. */
|
|
929
|
+
body: Partial<T>;
|
|
930
|
+
/** Current diff before `beforeUpdate` mutations. */
|
|
931
|
+
diff: DeepDiffReturn<T>;
|
|
932
|
+
params: Record<string, string>;
|
|
933
|
+
/** Hono request context (headers, auth, etc.). */
|
|
934
|
+
c: Context;
|
|
935
|
+
}
|
|
936
|
+
/** Context passed to {@link CrudHooks.afterCreate}. */
|
|
937
|
+
interface CrudAfterCreateContext<T = Record<string, unknown>> {
|
|
938
|
+
user: AuthUser;
|
|
939
|
+
/** Created document as persisted in Firestore. */
|
|
940
|
+
doc: T;
|
|
941
|
+
/** Created document ID. */
|
|
942
|
+
id: string;
|
|
943
|
+
/** Positional Firestore document path arguments (e.g. `[docId]` or `[workshopId, docId]`). */
|
|
944
|
+
pathArgs: string[];
|
|
945
|
+
params: Record<string, string>;
|
|
946
|
+
/** Hono request context (headers, auth, etc.). */
|
|
947
|
+
c: Context;
|
|
948
|
+
}
|
|
949
|
+
/** Context passed to {@link CrudHooks.afterUpdate}. */
|
|
950
|
+
interface CrudAfterUpdateContext<T = Record<string, unknown>> {
|
|
951
|
+
user: AuthUser;
|
|
952
|
+
/** Existing document snapshot BEFORE write. */
|
|
953
|
+
before: T;
|
|
954
|
+
/** Document returned AFTER write (including `preWrite` mutations). */
|
|
955
|
+
after: T;
|
|
956
|
+
/** Final persisted payload (after `rules.update` / `preWrite` mutations). */
|
|
957
|
+
body: Partial<T>;
|
|
958
|
+
/** Diff recomputed AFTER `rules.update` (`preWrite`) so mutated fields are captured. */
|
|
959
|
+
diff: DeepDiffReturn<T>;
|
|
960
|
+
id: string;
|
|
961
|
+
/** Positional Firestore document path arguments (e.g. `[docId]` or `[workshopId, eventId]`). */
|
|
962
|
+
pathArgs: string[];
|
|
963
|
+
params: Record<string, string>;
|
|
964
|
+
/** Hono request context (headers, auth, etc.). */
|
|
965
|
+
c: Context;
|
|
966
|
+
}
|
|
967
|
+
/** Context passed to {@link CrudHooks.afterDelete}. */
|
|
968
|
+
interface CrudAfterDeleteContext<T = Record<string, unknown>> {
|
|
969
|
+
user: AuthUser;
|
|
970
|
+
/** Deleted document snapshot captured before deletion. */
|
|
971
|
+
doc: T;
|
|
972
|
+
id: string;
|
|
973
|
+
/** Positional Firestore document path arguments. */
|
|
974
|
+
pathArgs: string[];
|
|
975
|
+
params: Record<string, string>;
|
|
976
|
+
/** Hono request context (headers, auth, etc.). */
|
|
977
|
+
c: Context;
|
|
978
|
+
}
|
|
979
|
+
/** Created item metadata passed inside {@link CrudAfterBatchContext.created}. */
|
|
980
|
+
interface CrudAfterBatchCreatedItem<T = Record<string, unknown>> {
|
|
981
|
+
id: string;
|
|
982
|
+
pathArgs: string[];
|
|
983
|
+
doc: T;
|
|
984
|
+
}
|
|
985
|
+
/** Updated item metadata passed inside {@link CrudAfterBatchContext.updated}. */
|
|
986
|
+
interface CrudAfterBatchUpdatedItem<T = Record<string, unknown>> {
|
|
987
|
+
id: string;
|
|
988
|
+
pathArgs: string[];
|
|
989
|
+
before: T;
|
|
990
|
+
/** Projected state after applying the final payload (including `preWrite` mutations). */
|
|
991
|
+
after: T;
|
|
992
|
+
body: Partial<T>;
|
|
993
|
+
/** Diff recomputed AFTER `rules.update` (`preWrite`). */
|
|
994
|
+
diff: DeepDiffReturn<T>;
|
|
995
|
+
}
|
|
996
|
+
/** Deleted item metadata passed inside {@link CrudAfterBatchContext.deleted}. */
|
|
997
|
+
interface CrudAfterBatchDeletedItem<T = Record<string, unknown>> {
|
|
998
|
+
id: string;
|
|
999
|
+
pathArgs: string[];
|
|
1000
|
+
doc: T;
|
|
1001
|
+
}
|
|
1002
|
+
/** Context passed to {@link CrudHooks.afterBatch}. */
|
|
1003
|
+
interface CrudAfterBatchContext<T = Record<string, unknown>> {
|
|
1004
|
+
user: AuthUser;
|
|
1005
|
+
created: Array<CrudAfterBatchCreatedItem<T>>;
|
|
1006
|
+
updated: Array<CrudAfterBatchUpdatedItem<T>>;
|
|
1007
|
+
deleted: Array<CrudAfterBatchDeletedItem<T>>;
|
|
1008
|
+
params: Record<string, string>;
|
|
1009
|
+
/** Hono request context (headers, auth, etc.). */
|
|
1010
|
+
c: Context;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Per-repo post-write lifecycle hooks.
|
|
1014
|
+
*
|
|
1015
|
+
* All hooks are `await`ed before sending the HTTP response (critical on
|
|
1016
|
+
* Cloud Functions v2 where CPU is throttled once the response finishes) while
|
|
1017
|
+
* the `actorResolver` `AsyncLocalStorage` scope is still active.
|
|
1018
|
+
*
|
|
1019
|
+
* @template TRepo - The configured repository (used to type `doc`, `before`, `after`, `body`, `diff`).
|
|
1020
|
+
*/
|
|
1021
|
+
interface CrudHooks<TRepo extends ConfiguredRepository<any> = ConfiguredRepository<any>> {
|
|
1022
|
+
/**
|
|
1023
|
+
* Called after schema validation and `rules.create` pass, right before
|
|
1024
|
+
* persisting the new document (`POST /:repoName` and batch `create`).
|
|
1025
|
+
* Mutate `ctx.body` in place to normalize or inject server-derived fields.
|
|
1026
|
+
*/
|
|
1027
|
+
beforeCreate?: (ctx: CrudBeforeCreateContext<RepoModelType<TRepo>>) => void | Promise<void>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Called after schema validation and `rules.update` pass, right before
|
|
1030
|
+
* persisting the update (`PUT/PATCH /:repoName/:id` and batch `update`).
|
|
1031
|
+
* Mutate `ctx.body` in place; `diff` is recomputed afterward for `afterUpdate` / `afterBatch`.
|
|
1032
|
+
*/
|
|
1033
|
+
beforeUpdate?: (ctx: CrudBeforeUpdateContext<RepoModelType<TRepo>>) => void | Promise<void>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Called after a document is created (`POST /:repoName`).
|
|
1036
|
+
* Returning a non-empty `Partial<T>` patches the newly created document via
|
|
1037
|
+
* `repo.update(...pathArgs, changes)` and returns the updated document in the response.
|
|
1038
|
+
*/
|
|
1039
|
+
afterCreate?: (ctx: CrudAfterCreateContext<RepoModelType<TRepo>>) => Promise<void | Partial<RepoModelType<TRepo>>> | void | Partial<RepoModelType<TRepo>>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Called after a document is updated (`PUT/PATCH /:repoName/:id`).
|
|
1042
|
+
* Returning a non-empty `Partial<T>` patches the updated document via
|
|
1043
|
+
* `repo.update(...pathArgs, changes)` and returns the final document in the response.
|
|
1044
|
+
*/
|
|
1045
|
+
afterUpdate?: (ctx: CrudAfterUpdateContext<RepoModelType<TRepo>>) => Promise<void | Partial<RepoModelType<TRepo>>> | void | Partial<RepoModelType<TRepo>>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Called after a document is deleted (`DELETE /:repoName/:id`).
|
|
1048
|
+
*/
|
|
1049
|
+
afterDelete?: (ctx: CrudAfterDeleteContext<RepoModelType<TRepo>>) => Promise<void> | void;
|
|
1050
|
+
/**
|
|
1051
|
+
* Called ONCE after `batch.commit()` (`POST /:repoName/batch`).
|
|
1052
|
+
* When omitted, the server falls back to calling `afterCreate` / `afterUpdate` /
|
|
1053
|
+
* `afterDelete` sequentially on each committed item.
|
|
1054
|
+
*/
|
|
1055
|
+
afterBatch?: (ctx: CrudAfterBatchContext<RepoModelType<TRepo>>) => Promise<void> | void;
|
|
1056
|
+
/**
|
|
1057
|
+
* Per-repo error callback for `after*` hooks (and follow-up `changesNeeded`
|
|
1058
|
+
* patches), since the primary Firestore write has already committed.
|
|
1059
|
+
*/
|
|
1060
|
+
onAfterError?: (err: unknown, phase: CrudHookName) => void | Promise<void>;
|
|
1061
|
+
}
|
|
1062
|
+
/** Erased hooks type stored on the runtime registry entry. */
|
|
1063
|
+
type AnyCrudHooks = CrudHooks<any>;
|
|
1064
|
+
/** Hook name reported to {@link CrudHookErrorCallback}. */
|
|
1065
|
+
type CrudHookName = "afterCreate" | "afterUpdate" | "afterDelete" | "afterBatch";
|
|
1066
|
+
/** Context provided to {@link CrudServerOptions.onHookError} when a post-write hook throws. */
|
|
1067
|
+
interface CrudHookErrorContext {
|
|
1068
|
+
/** Hook that threw (or whose follow-up `changesNeeded` update failed). */
|
|
1069
|
+
hook: CrudHookName;
|
|
1070
|
+
/** Repository name in the CRUD registry. */
|
|
1071
|
+
repoName: string;
|
|
1072
|
+
/** Firestore collection path. */
|
|
1073
|
+
path: string;
|
|
1074
|
+
/** Document ID (present for single-doc hooks and batch fallback; undefined for `afterBatch`). */
|
|
1075
|
+
id?: string;
|
|
1076
|
+
/** Positional path args (present for single-doc hooks and batch fallback; undefined for `afterBatch`). */
|
|
1077
|
+
pathArgs?: string[];
|
|
1078
|
+
/** Authenticated user (or `null` when auth is off). */
|
|
1079
|
+
user: AuthUser | null;
|
|
1080
|
+
/** The thrown error. */
|
|
1081
|
+
error: unknown;
|
|
1082
|
+
/** Hono request context. */
|
|
1083
|
+
c: Context;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Callback invoked when a CRUD post-write hook throws an error.
|
|
1087
|
+
* Because the primary Firestore write is already committed, the HTTP request
|
|
1088
|
+
* still succeeds and this callback lets you log / alert without returning a 500.
|
|
1089
|
+
*/
|
|
1090
|
+
type CrudHookErrorCallback = (ctx: CrudHookErrorContext) => void | Promise<void>;
|
|
823
1091
|
/**
|
|
824
1092
|
* Internal repo entry for the CRUD server.
|
|
825
1093
|
*/
|
|
@@ -855,6 +1123,8 @@ interface CrudRepoEntry {
|
|
|
855
1123
|
validate?: (data: any, operation: "create" | "update") => string | undefined | Promise<string | undefined>;
|
|
856
1124
|
/** Per-operation authorization rules (see {@link CrudRules}). */
|
|
857
1125
|
rules?: AnyCrudRules;
|
|
1126
|
+
/** Post-write lifecycle hooks (see {@link CrudHooks}). */
|
|
1127
|
+
hooks?: AnyCrudHooks;
|
|
858
1128
|
}
|
|
859
1129
|
type CrudRepoRegistry = Record<string, CrudRepoEntry>;
|
|
860
1130
|
/**
|
|
@@ -943,6 +1213,16 @@ interface CrudServerOptions<TRepos extends Record<string, ConfiguredRepository<a
|
|
|
943
1213
|
* Alias for {@link indexesError}.
|
|
944
1214
|
*/
|
|
945
1215
|
onIndexError?: IndexErrorCallback;
|
|
1216
|
+
/**
|
|
1217
|
+
* Callback invoked when a post-write lifecycle hook (`afterCreate`,
|
|
1218
|
+
* `afterUpdate`, `afterDelete`, `afterBatch`) or its optional `changesNeeded`
|
|
1219
|
+
* follow-up update throws.
|
|
1220
|
+
*
|
|
1221
|
+
* Because the primary Firestore write has already committed, hook errors are
|
|
1222
|
+
* caught so the client does not receive a misleading HTTP 500. When omitted,
|
|
1223
|
+
* errors are logged via the server `logger` (if configured) or `console.error`.
|
|
1224
|
+
*/
|
|
1225
|
+
onHookError?: CrudHookErrorCallback;
|
|
946
1226
|
}
|
|
947
1227
|
/**
|
|
948
1228
|
* Context provided to the `indexesError` callback when a Firestore query fails due to a missing composite index.
|
|
@@ -1080,5 +1360,5 @@ interface QueryRequestBody {
|
|
|
1080
1360
|
withTotal?: boolean;
|
|
1081
1361
|
}
|
|
1082
1362
|
|
|
1083
|
-
export {
|
|
1084
|
-
export type {
|
|
1363
|
+
export { DEFAULT_HTML_CSP as a0, securityHeaders as a1, createPaginationIterator as ad, executePaginatedQuery as ae };
|
|
1364
|
+
export type { QueryError as $, AnyCrudHooks as A, MutationRule as B, ConfiguredRepository as C, DeepDiffReturn as D, EffectExecutionResult as E, FieldRole as F, MutationsMap as G, PreWriteMutationFn as H, IndexErrorCallback as I, RepoRelationKeys as J, Rule as K, ListResponseData as L, MutationContext as M, RuleEffect as N, OpenAPISpecOptions as O, PreWriteMutation as P, QueryRequestBody as Q, RepoFieldPath as R, RuleResult as S, RulesMap as T, UserFieldPath as U, RelationalFieldMeta as V, SecurityHeadersOptions as W, PageOptions as X, ColumnMeta as Y, FilterState as Z, SortState as _, CrudServerOptions as a, PaginationOptions as a2, GenerateGetMethods as a3, GenerateQueryMethods as a4, IncludeConfigTyped as a5, PaginationResult as a6, PaginationWithIncludeOptionsTyped as a7, PopulateOptionsTyped as a8, SystemBackfillFailure as a9, SystemBackfillOptions as aa, SystemBackfillResult as ab, UpdatableData as ac, ApiResponse as b, ApplyEffectsResult as c, CrudAfterBatchContext as d, CrudAfterBatchCreatedItem as e, CrudAfterBatchDeletedItem as f, CrudAfterBatchUpdatedItem as g, CrudAfterCreateContext as h, CrudAfterDeleteContext as i, CrudAfterUpdateContext as j, CrudBeforeCreateContext as k, CrudBeforeUpdateContext as l, CrudEffectOperation as m, CrudHookErrorCallback as n, CrudHookErrorContext as o, CrudHookName as p, CrudHooks as q, CrudRepoConfig as r, CrudRepoEntry as s, CrudRepoRegistry as t, CrudRules as u, CrudUpdateRuleContext as v, CrudWriteOperation as w, EffectPredicateArgs as x, EffectsMap as y, IndexErrorContext as z };
|