You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,10 @@ Additional _optional_ annotation options at the _object_ level are:
52
52
*`dataApiFilterFields`: Fields to allow as simple filters for paginated GET requests (defaults to foreign keys, boolean and enum fields)
53
53
*`dataApiAllowIdInsert`: Whether or not to allow the ID field to be set during a POST operation to create a new record
54
54
*`dataApiQueueRelevantFields`: Fields that are relevant to trigger a record update to be queued. If not used, then any data change will be queued. If used then only the specified fields will be examined and in case of atomic-changes for the queue only the relevant field changes will be included in the queue item. Inserts and deletes are always queued, only during updates this annotation is evaluated.
55
+
*`dataApiSkipValidationOnInsert`: Whether or not to skip data validation when inserting new records (defaults to `false`)
56
+
*`dataApiSkipValidationOnUpdate`: Whether or not to skip data validation when updating records (defaults to `false`)
57
+
*`dataApiResponseTypeOnInsert`: Could be `record`, `idonly` or `empty` (defaults to `record`)
58
+
*`dataApiResponseTypeOnUpdate`: Could be `record`, `idonly` or `empty` (defaults to `record`)
55
59
56
60
### Property annotations
57
61
@@ -191,7 +195,7 @@ Fires before inserting data through the API. Receives the following keys in the
191
195
*`insertDataArgs`: Arguments that will be passed to the `insertData()` call
192
196
*`entity`: Name of the entity being operated on
193
197
*`record`: The data that will be inserted (struct)
194
-
198
+
*`responseType`: Whether the API response should be `empty`, contain the full `record` or `idonly`. Defaults to the API or object definition (or if not defined `record`), but can be overwritten here.
195
199
196
200
### `postDataApiInsertData`
197
201
@@ -201,7 +205,7 @@ Fires after inserting data through the API. Receives the following keys in the `
201
205
*`entity`: Name of the entity being operated on
202
206
*`record`: The data that will be inserted (struct)
203
207
*`newId`: Newly created record ID
204
-
208
+
*`responseType`: Whether the API response should be `empty`, contain the full `record` or `idonly`. Defaults to the API or object definition (or if not defined `record`), but can be overwritten here.
205
209
206
210
### `preDataApiUpdateData`
207
211
@@ -211,6 +215,7 @@ Fires before updating data through the API. Receives the following keys in the `
211
215
*`entity`: Name of the entity being operated on
212
216
*`recordId`: ID of the record to be updated
213
217
*`data`: The data that will be inserted (struct)
218
+
*`responseType`: Whether the API response should be `empty`, contain the full `record` or `idonly`. Defaults to the API or object definition (or if not defined `record`), but can be overwritten here.
214
219
215
220
### `postDataApiUpdateData`
216
221
@@ -220,6 +225,7 @@ Fires after updating data through the API. Receives the following keys in the `i
220
225
*`entity`: Name of the entity being operated on
221
226
*`recordId`: ID of the record to be updated
222
227
*`data`: The data that will be inserted (struct)
228
+
*`responseType`: Whether the API response should be `empty`, contain the full `record` or `idonly`. Defaults to the API or object definition (or if not defined `record`), but can be overwritten here.
223
229
224
230
### `preDataApiDeleteData`
225
231
@@ -237,6 +243,39 @@ Fires after deleting data through the API. Receives the following keys in the `i
237
243
*`entity`: Name of the entity being operated on
238
244
*`recordId`: ID of the record to be deleted
239
245
246
+
### `onDataApiUpdateRecordDataValidation`
247
+
248
+
Fires before starting data validation on updates. Receives the following keys in the `interceptData`:
249
+
250
+
*`entity`: Name of the entity being operated on
251
+
*`data`: The data to be validated
252
+
*`skipValidation`: Whether the whole validation should be skipped. Defaults to the API or object definition, but can be overwritte here.
253
+
254
+
### `onDataApiInsertRecordDataValidation`
255
+
256
+
Fires before starting data validation on inserts. Receives the following keys in the `interceptData`:
257
+
258
+
*`entity`: Name of the entity being operated on
259
+
*`data`: The data to be validated
260
+
*`skipValidation`: Whether the whole validation should be skipped. Defaults to the API or object definition, but can be overwritte here.
261
+
262
+
### `preDataApiBatchUpdateRecords`
263
+
264
+
Fires before batch updating multiple records. Receives the following keys in the `interceptData`:
265
+
266
+
*`entity`: Name of the entity being operated on
267
+
*`records`: Array of record data to be batch updated
268
+
*`responseType`: Whether the API response should be `empty`, contain the full `record` or `idonly`. Defaults to the API or object definition (or if not defined `record`), but can be overwritten here.
269
+
270
+
### `postDataApiBatchUpdateRecords`
271
+
272
+
Fires after multiple records have been batch updated. Receives the following keys in the `interceptData`:
273
+
274
+
*`entity`: Name of the entity being operated on
275
+
*`records`: Array of record data to be batch updated
276
+
*`responseType`: Whether the API response should be `empty`, contain the full `record` or `idonly`. Defaults to the API or object definition (or if not defined `record`), but can be overwritten here.
277
+
*`updated`: Array of the full record data that was updated (or empty array in case skipRecordResponse=true was already set in `preDataApiBatchUpdateRecords`)
278
+
240
279
## Data Change Queue(s)
241
280
242
281
By default, they system enables a queue feature: `settings.features.dataApiQueue`. When enabled, API users can be subscribed, through the admin UI, to listen for data changes to all, or a number, of entities in the system.
0 commit comments