@stoker-platform/types 0.5.64 → 0.5.65

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/types",
3
- "version": "0.5.64",
3
+ "version": "0.5.65",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "src/main.ts",
@@ -997,6 +997,42 @@ export interface SingleFieldExemption {
997
997
  arrayConfig?: "CONTAINS" | "CONTAINS_ANY"
998
998
  }
999
999
 
1000
+ export interface FieldAccessCondition {
1001
+ /** All roles that this field group CAN apply to */
1002
+ applicableRoles: StokerRole[]
1003
+ match?: "any" | "all"
1004
+ /** Require collection auth access to equal this value for the current user */
1005
+ collectionAuth?: boolean
1006
+ /** The current user's role must be one of these */
1007
+ roles?: StokerRole[]
1008
+ /** How to combine the provided checks */
1009
+ /**
1010
+ * Auth token claim checks. A scalar value requires equality.
1011
+ * An array requires the claim value to be one of the listed values.
1012
+ * All entries must match.
1013
+ */
1014
+ claims?: Record<string, string | number | boolean | (string | number | boolean)[]>
1015
+ /**
1016
+ * Required state of this collection's permission restrictions for the current user.
1017
+ * All entries must match.
1018
+ */
1019
+ restrictions?: {
1020
+ /** collection recordOwner restriction must equal this */
1021
+ recordOwner?: boolean
1022
+ /** collection recordUser restriction must equal this */
1023
+ recordUser?: boolean
1024
+ /** collection recordProperty restriction must equal this */
1025
+ recordProperty?: boolean
1026
+ /** collection restrictEntities restriction must equal this */
1027
+ restrictEntities?: boolean
1028
+ }
1029
+ }
1030
+
1031
+ export interface FieldAccessGroupReference {
1032
+ /** Key of a fieldAccessGroups entry on the collection */
1033
+ group: string
1034
+ }
1035
+
1000
1036
  export interface StandardField {
1001
1037
  name: string
1002
1038
  description?: string | (() => string | Promise<string>)
@@ -1014,9 +1050,9 @@ export interface StandardField {
1014
1050
 
1015
1051
  saveToAuthToken?: boolean
1016
1052
 
1017
- access?: StokerRole[]
1018
- restrictCreate?: StokerRole[] | boolean
1019
- restrictUpdate?: StokerRole[] | boolean
1053
+ access?: StokerRole[] | FieldAccessGroupReference
1054
+ restrictCreate?: StokerRole[] | boolean | FieldAccessCondition
1055
+ restrictUpdate?: StokerRole[] | boolean | FieldAccessCondition
1020
1056
  skipRulesValidation?: boolean
1021
1057
 
1022
1058
  custom?: FieldCustom
@@ -1147,6 +1183,12 @@ export interface CollectionSchema {
1147
1183
  singleton?: boolean
1148
1184
  parentCollection?: StokerCollection
1149
1185
 
1186
+ /**
1187
+ * Named conditional field access groups. Fields reference a group with
1188
+ * access: { group }.
1189
+ */
1190
+ fieldAccessGroups?: Record<string, FieldAccessCondition>
1191
+
1150
1192
  preloadCache?: PreloadCache
1151
1193
  softDelete?: {
1152
1194
  archivedField: string