@stoker-platform/types 0.5.68 → 0.5.70
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 +5 -5
- package/src/types/app.ts +195 -5
- package/src/types/schema.ts +688 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/types",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.70",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"main": "src/main.ts",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"npm": "11"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@fullcalendar/core": "^6.1.
|
|
26
|
-
"@google-cloud/storage": "^
|
|
27
|
-
"firebase": "^12.
|
|
28
|
-
"firebase-admin": "^
|
|
25
|
+
"@fullcalendar/core": "^6.1.21",
|
|
26
|
+
"@google-cloud/storage": "^8.0.1",
|
|
27
|
+
"firebase": "^12.18.0",
|
|
28
|
+
"firebase-admin": "^14.3.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/types/app.ts
CHANGED
|
@@ -32,40 +32,96 @@ import type { AppCheck } from "firebase/app-check"
|
|
|
32
32
|
import type { FieldValue, Firestore as AdminFirestore } from "firebase-admin/firestore"
|
|
33
33
|
import { FirebaseError } from "firebase-admin"
|
|
34
34
|
|
|
35
|
+
/** Auth config for the app */
|
|
35
36
|
export interface AuthConfig {
|
|
37
|
+
/** An array of roles. App users with these roles will have the option to enable multi factor auth (using an Authenticator app) */
|
|
36
38
|
enableMultiFactorAuth: boolean | StokerRole[]
|
|
39
|
+
/**
|
|
40
|
+
* The auth persistence strategy for your app.
|
|
41
|
+
* "LOCAL": Auth state is persisted across sessions. The user will stay logged in even when the window is closed or refreshed.
|
|
42
|
+
* "SESSION": Auth state is persisted within the same session. The user will be logged out when the window is closed.
|
|
43
|
+
* "NONE": Auth state is not persisted. The user will be logged out when the window is closed or refreshed
|
|
44
|
+
*/
|
|
37
45
|
authPersistenceType:
|
|
38
|
-
| "LOCAL"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
"LOCAL" | "SESSION" | "NONE" | (() => "LOCAL" | "SESSION" | "NONE" | Promise<"LOCAL" | "SESSION" | "NONE">)
|
|
47
|
+
/**
|
|
48
|
+
* Set to `true` to sign out a user when their permissions are changed. If falsy, the Admin UI
|
|
49
|
+
* will attempt to reload data affected by the permissions change
|
|
50
|
+
*/
|
|
42
51
|
signOutOnPermissionsChange?: boolean
|
|
52
|
+
/**
|
|
53
|
+
* Only relevant if `offlinePersistenceType` is set to "ALL" or "WRITE".
|
|
54
|
+
* Set to `true` to clear offline persistence data from IndexedDB on sign out.
|
|
55
|
+
* Warning: the Firebase team does not recommend relying on this method for security purposes
|
|
56
|
+
*/
|
|
43
57
|
clearPersistenceOnSignOut?: boolean
|
|
58
|
+
/**
|
|
59
|
+
* The offline persistence strategy for your app.
|
|
60
|
+
* "ALL": All data read and written is stored in IndexedDB and persisted across sessions. Offline writes will be retried when the connection is restored, even if the window is closed while still offline. Warning: creates a security risk on public computers.
|
|
61
|
+
* "WRITE": Writes are persisted across sessions. `enableWriteLog` must be set to `true` for offline persistent writes to work for a collection.
|
|
62
|
+
* "NONE": No offline persistence. Offline writes will fail if the window is closed before the connection is restored
|
|
63
|
+
*/
|
|
44
64
|
offlinePersistenceType:
|
|
45
65
|
| "ALL"
|
|
46
66
|
| "WRITE"
|
|
47
67
|
| "NONE"
|
|
48
68
|
| ((user: User, claims: ParsedToken) => "ALL" | "WRITE" | "NONE" | Promise<"ALL" | "WRITE" | "NONE">)
|
|
69
|
+
/**
|
|
70
|
+
* Only relevant if `offlinePersistenceType` is set to "ALL" or "WRITE".
|
|
71
|
+
* Whether to use offline persisted data across tabs. If set to "SINGLE", offline persistence
|
|
72
|
+
* will only be available in the first tab opened. Defaults to "MULTI"
|
|
73
|
+
*/
|
|
49
74
|
tabManager?: "SINGLE" | "MULTI"
|
|
75
|
+
/**
|
|
76
|
+
* Only relevant if `offlinePersistenceType` is set to "WRITE" or "NONE".
|
|
77
|
+
* The garbage collection strategy to use for in-memory data. We highly recommend using "LRU".
|
|
78
|
+
* Defaults to "LRU"
|
|
79
|
+
*/
|
|
50
80
|
garbageCollectionStrategy?: "LRU" | "EAGER"
|
|
81
|
+
/**
|
|
82
|
+
* The maximum cache size for in-memory ("LRU" only) and persisted ("ALL" or "WRITE" only) caches.
|
|
83
|
+
* Use `-1` to set an unlimited cache size. Defaults to `-1`
|
|
84
|
+
*/
|
|
51
85
|
maxCacheSize?: number
|
|
86
|
+
/** Overwrites `maxCacheSize` for the write database instance only. Use `-1` to set an unlimited cache size. Defaults to `-1` */
|
|
52
87
|
maxWriteCacheSize?: number
|
|
53
88
|
}
|
|
54
89
|
|
|
90
|
+
/** Firebase config for the app */
|
|
55
91
|
export interface FirebaseConfig {
|
|
92
|
+
/** Enable or disable the Firebase Emulators. */
|
|
56
93
|
enableEmulators?: boolean | (() => boolean | Promise<boolean>)
|
|
94
|
+
/** Disable individual Firebase Emulators */
|
|
57
95
|
disableIndividualEmulators?: ("Auth" | "Database" | "Firestore" | "Storage" | "Functions")[]
|
|
96
|
+
/** The settable config flag for GDPR opt-in/opt-out */
|
|
58
97
|
GDPRSettings?: boolean | (() => boolean | Promise<boolean>)
|
|
98
|
+
/** Enable or disable Google Analytics for your app */
|
|
59
99
|
enableAnalytics?: boolean | (() => boolean | Promise<boolean>)
|
|
100
|
+
/** Google Analytics config */
|
|
60
101
|
analyticsSettings?: AnalyticsSettings | (() => AnalyticsSettings | Promise<AnalyticsSettings>)
|
|
102
|
+
/** Google Analytics consent config */
|
|
61
103
|
analyticsConsentSettings?: ConsentSettings | (() => ConsentSettings | Promise<ConsentSettings>)
|
|
104
|
+
/** The Firebase log levels for development and production mode */
|
|
62
105
|
logLevel?: {
|
|
106
|
+
/** The Firebase log level for development mode */
|
|
63
107
|
dev?: "debug" | "verbose" | "info" | "warn" | "error" | "silent"
|
|
108
|
+
/** The Firebase log level for production mode */
|
|
64
109
|
prod?: "debug" | "verbose" | "info" | "warn" | "error" | "silent"
|
|
65
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Exempt the user permissions collection from Firestore indexing. We recommend setting this to
|
|
113
|
+
* `true` for performance reasons, however you will need to set it to falsy in order to query
|
|
114
|
+
* the permissions collection by specific fields
|
|
115
|
+
*/
|
|
66
116
|
permissionsIndexExemption?: boolean
|
|
117
|
+
/** Exempt individual fields from the write log. We recommend leaving this as an empty array unless you have a good reason to exempt fields */
|
|
67
118
|
writeLogIndexExemption?: string[]
|
|
119
|
+
/**
|
|
120
|
+
* If set, this is the number of days after which write log entries will be deleted.
|
|
121
|
+
* We recommend leaving it out in order to keep records of write activity indefinitely
|
|
122
|
+
*/
|
|
68
123
|
writeLogTTL?: number
|
|
124
|
+
/** The strategy to use for Firestore server timestamps. We recommend setting this to "estimate". Defaults to "none" */
|
|
69
125
|
serverTimestampOptions?:
|
|
70
126
|
| "none"
|
|
71
127
|
| "estimate"
|
|
@@ -73,12 +129,24 @@ export interface FirebaseConfig {
|
|
|
73
129
|
| (() => "none" | "estimate" | "previous" | Promise<"none" | "estimate" | "previous">)
|
|
74
130
|
}
|
|
75
131
|
|
|
132
|
+
/** Preload cache config, defining the order in which collections are preloaded on app startup */
|
|
76
133
|
export interface PreloadConfig {
|
|
134
|
+
/**
|
|
135
|
+
* An array of collection names that have the preload cache enabled. These collections will be
|
|
136
|
+
* preloaded synchronously while the async collections also load. Collections not listed in
|
|
137
|
+
* `async` or `sync` will load synchronously after the collections in this list
|
|
138
|
+
*/
|
|
77
139
|
sync?: StokerCollection[] | (() => StokerCollection[] | Promise<StokerCollection[]>)
|
|
140
|
+
/** An array of collection names that have the preload cache enabled. These collections will be preloaded first, in parallel */
|
|
78
141
|
async?: StokerCollection[] | (() => StokerCollection[] | Promise<StokerCollection[]>)
|
|
79
142
|
}
|
|
80
143
|
|
|
144
|
+
/** Mail config for the app */
|
|
81
145
|
export interface MailConfig {
|
|
146
|
+
/**
|
|
147
|
+
* Customize the email address verification email sent out to your app's users.
|
|
148
|
+
* Receives the verification link and app name, and returns the subject and html message to send
|
|
149
|
+
*/
|
|
82
150
|
emailVerification?: (
|
|
83
151
|
verificationLink: string,
|
|
84
152
|
appName?: string,
|
|
@@ -88,72 +156,120 @@ export interface MailConfig {
|
|
|
88
156
|
}
|
|
89
157
|
}
|
|
90
158
|
|
|
159
|
+
/** A menu group defining the menu structure for the user roles in your system */
|
|
91
160
|
export interface MenuGroup {
|
|
161
|
+
/** The title for the menu group */
|
|
92
162
|
title: string
|
|
163
|
+
/** The position of the group in the menu */
|
|
93
164
|
position: number
|
|
165
|
+
/** The collections in the menu group */
|
|
94
166
|
collections: StokerCollection[]
|
|
167
|
+
/** The roles that can see this menu group */
|
|
95
168
|
roles?: StokerRole[]
|
|
96
169
|
}
|
|
97
170
|
|
|
171
|
+
/** A meta tag icon for the app's home page, i.e. `<link rel="icon" type="image/png" href="./favicon.ico" />` */
|
|
98
172
|
export interface MetaIcon {
|
|
99
173
|
rel: string
|
|
100
174
|
type: string
|
|
101
175
|
url: string
|
|
102
176
|
}
|
|
103
177
|
|
|
178
|
+
/** Display a metric (numerical counter) on the Dashboard */
|
|
104
179
|
export interface DashboardMetric {
|
|
105
180
|
kind: "metric"
|
|
181
|
+
/** The collection to aggregate */
|
|
106
182
|
collection: StokerCollection
|
|
183
|
+
/** The metric type */
|
|
107
184
|
type: "sum" | "average" | "count"
|
|
185
|
+
/** The field to aggregate. Not required for `count` */
|
|
108
186
|
field?: string
|
|
187
|
+
/** Limit which user roles can view the metric */
|
|
109
188
|
roles?: StokerRole[]
|
|
189
|
+
/** The title shown above the metric */
|
|
110
190
|
title?: string
|
|
191
|
+
/** Maximum decimal places to display */
|
|
111
192
|
decimal?: number
|
|
193
|
+
/** Prefix text, for example a currency symbol */
|
|
112
194
|
prefix?: string
|
|
195
|
+
/** Suffix text, for example units */
|
|
113
196
|
suffix?: string
|
|
197
|
+
/** Tailwind text size for the metric value */
|
|
114
198
|
textSize?: "text-xl" | "text-2xl" | "text-3xl"
|
|
199
|
+
/** Firestore constraints to apply to the metric query */
|
|
115
200
|
constraints?: [string, WhereFilterOp, unknown][]
|
|
201
|
+
/** Force metric data to be loaded from the server */
|
|
116
202
|
forceServer?: boolean
|
|
117
203
|
}
|
|
204
|
+
/** Display a chart on the Dashboard */
|
|
118
205
|
export interface DashboardChart {
|
|
119
206
|
kind: "chart"
|
|
207
|
+
/** The collection to chart */
|
|
120
208
|
collection: StokerCollection
|
|
209
|
+
/** The chart type */
|
|
121
210
|
type: "area"
|
|
211
|
+
/** The date field used to group points */
|
|
122
212
|
dateField: string
|
|
213
|
+
/** First metric field */
|
|
123
214
|
metricField1?: string
|
|
215
|
+
/** Optional second metric field */
|
|
124
216
|
metricField2?: string
|
|
217
|
+
/** Custom calculation for the first metric */
|
|
125
218
|
formula1?: (record: StokerRecord) => number
|
|
219
|
+
/** Custom calculation for the second metric */
|
|
126
220
|
formula2?: (record: StokerRecord) => number
|
|
221
|
+
/** The label for the first metric */
|
|
127
222
|
label1?: string | (() => string)
|
|
223
|
+
/** The label for the second metric */
|
|
128
224
|
label2?: string | (() => string)
|
|
225
|
+
/** Show or hide the y-axis */
|
|
129
226
|
yAxis?: { show?: boolean | (() => boolean) }
|
|
227
|
+
/** Limit which user roles can view the chart */
|
|
130
228
|
roles?: StokerRole[]
|
|
229
|
+
/** Title shown above the chart */
|
|
131
230
|
title?: string
|
|
231
|
+
/** Firestore constraints to apply to the chart query */
|
|
132
232
|
constraints?: [string, WhereFilterOp, unknown][]
|
|
233
|
+
/** The interval to group points by */
|
|
133
234
|
interval?: "day" | "month" | "year"
|
|
235
|
+
/** The number of intervals to display */
|
|
134
236
|
numberOfIntervals?: number
|
|
237
|
+
/** Offset the intervals by this amount */
|
|
135
238
|
offset?: number
|
|
239
|
+
/** Animate the chart */
|
|
136
240
|
animate?: boolean
|
|
241
|
+
/** Currency symbol to display */
|
|
137
242
|
currency?: string | (() => string)
|
|
138
243
|
}
|
|
139
244
|
|
|
245
|
+
/** Display a reminder (a list of pertinent records) on the Dashboard */
|
|
140
246
|
export interface DashboardReminder {
|
|
141
247
|
kind: "reminder"
|
|
248
|
+
/** The collection to show records from */
|
|
142
249
|
collection: StokerCollection
|
|
250
|
+
/** Which columns to show in the list */
|
|
143
251
|
columns: string[]
|
|
252
|
+
/** The title shown above the reminder */
|
|
144
253
|
title?: string
|
|
254
|
+
/** Limit which user roles can view the reminder */
|
|
145
255
|
roles?: StokerRole[]
|
|
256
|
+
/** Firestore constraints to apply to the reminder query */
|
|
146
257
|
constraints?: [string, WhereFilterOp, unknown][]
|
|
258
|
+
/** The field and direction to sort records by */
|
|
147
259
|
sort?: {
|
|
148
260
|
field: string
|
|
149
261
|
direction: "asc" | "desc"
|
|
150
262
|
}
|
|
263
|
+
/** Force the reminder records to be loaded from the server */
|
|
151
264
|
forceServer?: boolean
|
|
265
|
+
/** Filter which records are displayed */
|
|
152
266
|
filter?: (record: StokerRecord) => boolean
|
|
153
267
|
}
|
|
154
268
|
|
|
269
|
+
/** An item shown on the Dashboard. Items will be laid out in a grid */
|
|
155
270
|
export type DashboardItem = DashboardMetric | DashboardChart | DashboardReminder
|
|
156
271
|
|
|
272
|
+
/** Background properties of the `body` for light and dark mode */
|
|
157
273
|
export interface Background {
|
|
158
274
|
light?: {
|
|
159
275
|
color: string
|
|
@@ -165,24 +281,38 @@ export interface Background {
|
|
|
165
281
|
}
|
|
166
282
|
}
|
|
167
283
|
|
|
284
|
+
/** Admin UI config for the app */
|
|
168
285
|
export interface AdminConfig {
|
|
286
|
+
/**
|
|
287
|
+
* If defined, only the roles listed will be able to see the Admin UI. Warning: this access
|
|
288
|
+
* restriction is only enforced on the client. Users can still log in, but they won't see anything
|
|
289
|
+
*/
|
|
169
290
|
access?: StokerRole[] | (() => StokerRole[])
|
|
291
|
+
/** Background objects for light and dark mode. This lets you control the background properties of the `body` */
|
|
170
292
|
background?: Background | (() => Background)
|
|
293
|
+
/** Image urls to be used for the navbar title and the login page. If not provided, the icons in your `icons` directory will be used */
|
|
171
294
|
logo?: {
|
|
172
295
|
navbar?: string
|
|
173
296
|
login?: string
|
|
174
297
|
}
|
|
298
|
+
/** The menu structures for the user roles in your system */
|
|
175
299
|
menu?: {
|
|
176
300
|
groups?: MenuGroup[]
|
|
177
301
|
}
|
|
302
|
+
/** The Luxon date format to display dates in */
|
|
178
303
|
dateFormat?: string | (() => string)
|
|
304
|
+
/** The meta tag description and icons for your app's home page */
|
|
179
305
|
meta?: {
|
|
180
306
|
description?: string
|
|
181
307
|
icons?: MetaIcon[]
|
|
182
308
|
}
|
|
309
|
+
/** Items shown on the Dashboard, laid out in a grid. We recommend that each row contains 1-2 metrics and a chart, 1 reminder and a chart, or 3 reminders */
|
|
183
310
|
dashboard?: DashboardItem[]
|
|
311
|
+
/**
|
|
312
|
+
* Key/value pairs defining user roles and the collection that will act as their homepage.
|
|
313
|
+
* If the user role has access to the Dashboard, that will take precedence
|
|
314
|
+
*/
|
|
184
315
|
homePage?: Record<StokerRole, StokerCollection> | (() => Record<StokerRole, StokerCollection>)
|
|
185
|
-
searchAll?: boolean | (() => boolean)
|
|
186
316
|
}
|
|
187
317
|
|
|
188
318
|
export interface GenerateGlobalConfigParams {
|
|
@@ -223,19 +353,47 @@ export type Region =
|
|
|
223
353
|
| "us-west3"
|
|
224
354
|
| "us-west4"
|
|
225
355
|
|
|
356
|
+
/** Project-wide config for your app, defined in the global config file at src/main.ts */
|
|
226
357
|
export type GlobalConfig = {
|
|
358
|
+
/**
|
|
359
|
+
* This is the big one. Name the access roles that will be used in your app.
|
|
360
|
+
* Each role will have its own permissions, i.e. `["Manager", "Supervisor", "Staff Member", "Client"]`
|
|
361
|
+
*/
|
|
227
362
|
roles: StokerRole[]
|
|
363
|
+
/** An array of collection names that will be disabled in your app (on the next `stoker deploy`) */
|
|
228
364
|
disabledCollections?: StokerCollection[]
|
|
365
|
+
/** The name of your app. Shorter is better, as this will be used for page titles etc */
|
|
229
366
|
appName: string | (() => string | Promise<string>)
|
|
367
|
+
/** Your app will be based in this timezone. Must be a valid IANA timezone */
|
|
230
368
|
timezone?: string | (() => string | Promise<string>)
|
|
369
|
+
/** Auth config for the app */
|
|
231
370
|
auth: AuthConfig
|
|
371
|
+
/** Firebase config for the app */
|
|
232
372
|
firebase?: FirebaseConfig
|
|
373
|
+
/** Preload cache config, defining the order in which collections are preloaded on app startup */
|
|
233
374
|
preload?: PreloadConfig
|
|
375
|
+
/**
|
|
376
|
+
* Whether to log the user's ID in the client whenever Firebase prints logs. This can be useful
|
|
377
|
+
* for debugging, but may cause privacy concerns in some scenarios. Disabled by default
|
|
378
|
+
*/
|
|
234
379
|
enableUserIDLogging?: boolean | (() => boolean | Promise<boolean>)
|
|
380
|
+
/** Mail config for the app */
|
|
235
381
|
mail?: MailConfig
|
|
382
|
+
/**
|
|
383
|
+
* Fires before the user is logged in, prior to any other authentication logic being processed.
|
|
384
|
+
* You may block the sign in by returning `false`. Warning: this logic is client-side and is
|
|
385
|
+
* skippable. Use Firebase Auth Blocking Cloud Functions for secure sign-in-blocking operations
|
|
386
|
+
*/
|
|
236
387
|
preLogin?: (user: User) => boolean | void | Promise<boolean | void>
|
|
388
|
+
/** Fires after the user has successfully logged in */
|
|
237
389
|
postLogin?: (user?: User, error?: unknown) => void | Promise<void>
|
|
390
|
+
/** Fires when the user attempts to log out. You may block the sign out by returning `false` */
|
|
238
391
|
preLogout?: (user: User) => boolean | void | Promise<boolean | void>
|
|
392
|
+
/**
|
|
393
|
+
* Fires when the user has logged out. If an error is encountered during sign out, additional
|
|
394
|
+
* information is provided describing which Firestore instances encountered the error, the
|
|
395
|
+
* operation that encountered the error, and the error itself
|
|
396
|
+
*/
|
|
239
397
|
postLogout?: (errorDetails: {
|
|
240
398
|
error: boolean
|
|
241
399
|
instances: {
|
|
@@ -244,27 +402,59 @@ export type GlobalConfig = {
|
|
|
244
402
|
error: unknown
|
|
245
403
|
}[]
|
|
246
404
|
}) => void | Promise<void>
|
|
405
|
+
/**
|
|
406
|
+
* Fires when the schema version is updated. Note: if `refresh` is `true` for the schema update,
|
|
407
|
+
* the page will automatically refresh and this hook will not fire
|
|
408
|
+
*/
|
|
247
409
|
onVersionUpdate?: (versionInfo: VersionInfo, numberOfUpdates: number) => void | Promise<void>
|
|
410
|
+
/** Fires when maintenance mode is engaged / disengaged */
|
|
248
411
|
onMaintenanceUpdate?: (status: "on" | "off") => void | Promise<void>
|
|
412
|
+
/** Fires when the app goes online / offline. `first` will be true for the initial value read on app startup */
|
|
249
413
|
onConnectionStatusChange?: (status: "Online" | "Offline", first: boolean) => void | Promise<void>
|
|
414
|
+
/** Fires when Cloud Firestore detects a slow internet connection */
|
|
250
415
|
onFirestoreSlowConnection?: () => void | Promise<void>
|
|
416
|
+
/** Fires when Cloud Firestore experiences a read failure, usually due to excessive contention on documents or exceeded quotas */
|
|
251
417
|
onFirestoreLoadFailure?: () => void | Promise<void>
|
|
418
|
+
/** Fires in rare cases where Firestore IndexedDB persistence fails */
|
|
252
419
|
onIndexedDBConnectionLost?: () => void | Promise<void>
|
|
420
|
+
/** Fires when App Check token refresh fails */
|
|
253
421
|
onAppCheckTokenFailure?: (error: FirebaseError) => void | Promise<void>
|
|
422
|
+
/** Fires before all read and write operations. Return `false` to cancel the operation */
|
|
254
423
|
preOperation?: PreOperationHook
|
|
424
|
+
/** Fires before all read operations */
|
|
255
425
|
preRead?: PreReadHook
|
|
426
|
+
/** Fires after all read operations */
|
|
256
427
|
postRead?: PostReadHook
|
|
428
|
+
/** Fires before all duplicate operations in the Admin UI. Return `false` to cancel the operation */
|
|
257
429
|
preDuplicate?: PreDuplicateHook
|
|
430
|
+
/**
|
|
431
|
+
* Fires at write validation time for all write operations. This is where you can define custom
|
|
432
|
+
* validation logic. Return an object with a boolean indicating whether validation passed, and
|
|
433
|
+
* a message to display to the user if validation has failed
|
|
434
|
+
*/
|
|
258
435
|
preValidate?: PreValidateHook
|
|
436
|
+
/** Fires before all write operations. Return `false` to cancel the operation */
|
|
259
437
|
preWrite?: PreWriteHook
|
|
438
|
+
/** Fires after all write operations */
|
|
260
439
|
postWrite?: PostWriteHook
|
|
440
|
+
/**
|
|
441
|
+
* Fires when a write operation encounters an error. This hook may fire multiple times per write,
|
|
442
|
+
* so be sure to write idempotent code
|
|
443
|
+
*/
|
|
261
444
|
postWriteError?: PostWriteErrorHook
|
|
445
|
+
/** Fires after all read and write operations */
|
|
262
446
|
postOperation?: PostOperationHook
|
|
447
|
+
/** Fires before a file is uploaded. Return `false` to cancel the operation */
|
|
263
448
|
preFileAdd?: PreFileAddHook
|
|
449
|
+
/** Fires before a file is updated. Return `false` to cancel the operation */
|
|
264
450
|
preFileUpdate?: PreFileUpdateHook
|
|
451
|
+
/** Fires after a file is uploaded */
|
|
265
452
|
postFileAdd?: PostFileAddHook
|
|
453
|
+
/** Fires when a file upload fails */
|
|
266
454
|
postFileAddError?: PostFileAddErrorHook
|
|
455
|
+
/** Fires after a file is updated */
|
|
267
456
|
postFileUpdate?: PostFileUpdateHook
|
|
457
|
+
/** Admin UI config for the app */
|
|
268
458
|
admin?: AdminConfig
|
|
269
459
|
}
|
|
270
460
|
|