@stoker-platform/types 0.5.67 → 0.5.68
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/package.json +1 -1
- package/src/types/schema.ts +18 -7
package/package.json
CHANGED
package/src/types/schema.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Timestamp, WhereFilterOp, WriteBatch } from "firebase/firestore"
|
|
|
3
3
|
import { NodeUtilities, WebUtilities } from "./app"
|
|
4
4
|
import { CalendarOptions } from "@fullcalendar/core"
|
|
5
5
|
import { SearchOptions } from "minisearch"
|
|
6
|
+
import { UserRecord } from "firebase-admin/auth"
|
|
6
7
|
|
|
7
8
|
export type StokerRole = string
|
|
8
9
|
export type StokerCollection = string
|
|
@@ -453,10 +454,15 @@ export interface PreloadCacheInitial {
|
|
|
453
454
|
|
|
454
455
|
export interface CollectionCustom extends Hooks {
|
|
455
456
|
serverAccess?: {
|
|
456
|
-
read?: (
|
|
457
|
-
create?: (
|
|
458
|
-
update?: (
|
|
459
|
-
|
|
457
|
+
read?: (permissions: StokerPermissions, user: UserRecord, record?: StokerRecord) => boolean | Promise<boolean>
|
|
458
|
+
create?: (permissions: StokerPermissions, user: UserRecord, record: StokerRecord) => boolean | Promise<boolean>
|
|
459
|
+
update?: (
|
|
460
|
+
permissions: StokerPermissions,
|
|
461
|
+
user: UserRecord,
|
|
462
|
+
record: StokerRecord,
|
|
463
|
+
originalRecord?: StokerRecord,
|
|
464
|
+
) => boolean | Promise<boolean>
|
|
465
|
+
delete?: (permissions: StokerPermissions, user: UserRecord, record: StokerRecord) => boolean | Promise<boolean>
|
|
460
466
|
}
|
|
461
467
|
preloadCacheConstraints?:
|
|
462
468
|
| [string, WhereFilterOp, unknown][]
|
|
@@ -904,9 +910,14 @@ export interface CollectionAdminCache {
|
|
|
904
910
|
export interface FieldCustom extends Hooks {
|
|
905
911
|
initialValue?: unknown | ((record?: StokerRecord) => unknown | Promise<unknown>)
|
|
906
912
|
serverAccess?: {
|
|
907
|
-
read?: (
|
|
908
|
-
create?: (
|
|
909
|
-
update?: (
|
|
913
|
+
read?: (permissions: StokerPermissions, user: UserRecord, record?: StokerRecord) => boolean | Promise<boolean>
|
|
914
|
+
create?: (permissions: StokerPermissions, user: UserRecord, record: StokerRecord) => boolean | Promise<boolean>
|
|
915
|
+
update?: (
|
|
916
|
+
permissions: StokerPermissions,
|
|
917
|
+
user: UserRecord,
|
|
918
|
+
record: StokerRecord,
|
|
919
|
+
originalRecord?: StokerRecord,
|
|
920
|
+
) => boolean | Promise<boolean>
|
|
910
921
|
}
|
|
911
922
|
}
|
|
912
923
|
|