@directus/api 17.0.0 → 17.0.1

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.
Files changed (74) hide show
  1. package/dist/controllers/items.js +8 -7
  2. package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.d.ts +1 -1
  3. package/dist/flows.js +2 -1
  4. package/dist/middleware/collection-exists.js +6 -6
  5. package/dist/operations/request/index.js +5 -5
  6. package/dist/request/agent-with-ip-validation.d.ts +11 -0
  7. package/dist/request/agent-with-ip-validation.js +34 -0
  8. package/dist/request/index.js +6 -5
  9. package/dist/request/is-denied-ip.d.ts +1 -0
  10. package/dist/request/{validate-ip.js → is-denied-ip.js} +10 -12
  11. package/dist/services/collections.d.ts +3 -2
  12. package/dist/services/collections.js +1 -1
  13. package/dist/services/fields.js +2 -1
  14. package/dist/services/files.js +4 -3
  15. package/dist/services/graphql/index.js +3 -2
  16. package/dist/services/import-export.js +2 -1
  17. package/dist/services/items.js +2 -1
  18. package/dist/services/permissions.js +1 -1
  19. package/dist/services/relations.js +1 -1
  20. package/dist/services/specifications.js +4 -3
  21. package/dist/services/utils.js +1 -1
  22. package/dist/telemetry/utils/get-user-item-count.js +2 -1
  23. package/dist/types/collection.d.ts +2 -13
  24. package/dist/utils/get-field-system-rows.d.ts +2 -0
  25. package/dist/utils/get-field-system-rows.js +17 -0
  26. package/dist/utils/get-permissions.js +1 -1
  27. package/dist/utils/get-schema.js +3 -2
  28. package/dist/utils/merge-permissions-for-share.js +1 -1
  29. package/dist/utils/should-skip-cache.js +1 -1
  30. package/dist/websocket/handlers/items.js +2 -1
  31. package/dist/websocket/messages.d.ts +18 -18
  32. package/package.json +34 -33
  33. package/dist/database/system-data/app-access-permissions/app-access-permissions.yaml +0 -107
  34. package/dist/database/system-data/app-access-permissions/index.d.ts +0 -3
  35. package/dist/database/system-data/app-access-permissions/index.js +0 -17
  36. package/dist/database/system-data/app-access-permissions/schema-access-permissions.yaml +0 -17
  37. package/dist/database/system-data/collections/collections.yaml +0 -103
  38. package/dist/database/system-data/collections/index.d.ts +0 -2
  39. package/dist/database/system-data/collections/index.js +0 -9
  40. package/dist/database/system-data/fields/_defaults.yaml +0 -16
  41. package/dist/database/system-data/fields/activity.yaml +0 -83
  42. package/dist/database/system-data/fields/collections.yaml +0 -249
  43. package/dist/database/system-data/fields/dashboards.yaml +0 -20
  44. package/dist/database/system-data/fields/extensions.yaml +0 -10
  45. package/dist/database/system-data/fields/fields.yaml +0 -104
  46. package/dist/database/system-data/fields/files.yaml +0 -160
  47. package/dist/database/system-data/fields/flows.yaml +0 -26
  48. package/dist/database/system-data/fields/folders.yaml +0 -14
  49. package/dist/database/system-data/fields/index.d.ts +0 -2
  50. package/dist/database/system-data/fields/index.js +0 -33
  51. package/dist/database/system-data/fields/migrations.yaml +0 -10
  52. package/dist/database/system-data/fields/notifications.yaml +0 -15
  53. package/dist/database/system-data/fields/operations.yaml +0 -23
  54. package/dist/database/system-data/fields/panels.yaml +0 -29
  55. package/dist/database/system-data/fields/permissions.yaml +0 -37
  56. package/dist/database/system-data/fields/presets.yaml +0 -56
  57. package/dist/database/system-data/fields/relations.yaml +0 -34
  58. package/dist/database/system-data/fields/revisions.yaml +0 -30
  59. package/dist/database/system-data/fields/roles.yaml +0 -61
  60. package/dist/database/system-data/fields/sessions.yaml +0 -16
  61. package/dist/database/system-data/fields/settings.yaml +0 -471
  62. package/dist/database/system-data/fields/shares.yaml +0 -83
  63. package/dist/database/system-data/fields/translations.yaml +0 -27
  64. package/dist/database/system-data/fields/users.yaml +0 -224
  65. package/dist/database/system-data/fields/versions.yaml +0 -38
  66. package/dist/database/system-data/fields/webhooks.yaml +0 -141
  67. package/dist/database/system-data/relations/index.d.ts +0 -2
  68. package/dist/database/system-data/relations/index.js +0 -9
  69. package/dist/database/system-data/relations/relations.yaml +0 -197
  70. package/dist/request/request-interceptor.d.ts +0 -2
  71. package/dist/request/request-interceptor.js +0 -28
  72. package/dist/request/response-interceptor.d.ts +0 -2
  73. package/dist/request/response-interceptor.js +0 -5
  74. package/dist/request/validate-ip.d.ts +0 -1
@@ -1,37 +0,0 @@
1
- # directus_permissions isn't surfaced in the app
2
- table: directus_permissions
3
-
4
- fields:
5
- - field: permissions
6
- hidden: true
7
- special:
8
- - cast-json
9
- width: half
10
-
11
- - field: presets
12
- hidden: true
13
- special:
14
- - cast-json
15
- width: half
16
-
17
- - field: role
18
- width: half
19
-
20
- - field: collection
21
- width: half
22
-
23
- - field: id
24
- width: half
25
-
26
- - field: fields
27
- width: half
28
- special:
29
- - cast-csv
30
-
31
- - field: action
32
- width: half
33
-
34
- - field: validation
35
- width: half
36
- special:
37
- - cast-json
@@ -1,56 +0,0 @@
1
- table: directus_presets
2
-
3
- fields:
4
- - field: filter
5
- hidden: true
6
- special:
7
- - cast-json
8
-
9
- - field: layout_query
10
- hidden: true
11
- special:
12
- - cast-json
13
-
14
- - field: layout_options
15
- hidden: true
16
- special:
17
- - cast-json
18
-
19
- - field: role
20
- width: half
21
- special:
22
- - m2o
23
- display: related-values
24
- display_options:
25
- template: '{{ name }}'
26
-
27
- - field: user
28
- width: half
29
- special:
30
- - m2o
31
- display: related-values
32
- display_options:
33
- template: '{{ email }}'
34
-
35
- - field: id
36
- width: half
37
-
38
- - field: bookmark
39
- width: half
40
-
41
- - field: icon
42
- width: half
43
-
44
- - field: color
45
- width: half
46
-
47
- - field: search
48
- width: half
49
-
50
- - field: collection
51
- width: half
52
-
53
- - field: layout
54
- width: half
55
-
56
- - field: refresh_interval
@@ -1,34 +0,0 @@
1
- table: directus_relations
2
-
3
- fields:
4
- - field: id
5
- width: half
6
-
7
- - field: many_collection
8
- width: half
9
-
10
- - field: many_field
11
- width: half
12
-
13
- - field: one_collection
14
- width: half
15
-
16
- - field: one_field
17
- width: half
18
-
19
- - field: one_collection_field
20
- width: half
21
-
22
- - field: one_allowed_collections
23
- special:
24
- - cast-csv
25
- width: half
26
-
27
- - field: junction_field
28
- width: half
29
-
30
- - field: sort_field
31
- width: half
32
-
33
- - field: one_deselect_action
34
- width: half
@@ -1,30 +0,0 @@
1
- table: directus_revisions
2
-
3
- fields:
4
- - field: id
5
- width: half
6
-
7
- - field: activity
8
- width: half
9
-
10
- - field: collection
11
- width: half
12
-
13
- - field: item
14
- width: half
15
-
16
- - field: data
17
- hidden: true
18
- special:
19
- - cast-json
20
-
21
- - field: delta
22
- hidden: true
23
- special:
24
- - cast-json
25
-
26
- - field: parent
27
- width: half
28
-
29
- - field: version
30
- width: half
@@ -1,61 +0,0 @@
1
- table: directus_roles
2
-
3
- fields:
4
- - field: id
5
- hidden: true
6
- interface: input
7
- special:
8
- - uuid
9
-
10
- - field: name
11
- interface: input
12
- options:
13
- placeholder: $t:field_options.directus_roles.name
14
- width: half
15
-
16
- - field: icon
17
- interface: select-icon
18
- display: icon
19
- width: half
20
-
21
- - field: description
22
- interface: input
23
- options:
24
- placeholder: $t:field_options.directus_roles.description
25
- width: full
26
-
27
- - field: app_access
28
- interface: boolean
29
- special:
30
- - cast-boolean
31
- width: half
32
-
33
- - field: admin_access
34
- interface: boolean
35
- special:
36
- - cast-boolean
37
- width: half
38
-
39
- - field: ip_access
40
- interface: tags
41
- options:
42
- placeholder: $t:field_options.directus_roles.ip_access
43
- special:
44
- - cast-csv
45
- width: full
46
-
47
- - field: enforce_tfa
48
- interface: boolean
49
- special:
50
- - cast-boolean
51
- width: half
52
-
53
- - field: users
54
- interface: list-o2m
55
- special:
56
- - o2m
57
- options:
58
- fields:
59
- - first_name
60
- - last_name
61
- width: full
@@ -1,16 +0,0 @@
1
- table: directus_sessions
2
-
3
- fields:
4
- - field: token
5
- width: half
6
- - field: user
7
- width: half
8
- - field: expires
9
- width: half
10
- - field: ip
11
- width: half
12
- - field: user_agent
13
- width: half
14
- - field: origin
15
- width: half
16
- - field: share
@@ -1,471 +0,0 @@
1
- table: directus_settings
2
-
3
- fields:
4
- - field: id
5
- hidden: true
6
-
7
- - field: project_name
8
- interface: input
9
- options:
10
- iconRight: title
11
- placeholder: $t:field_options.directus_settings.project_name_placeholder
12
- width: half
13
-
14
- - field: project_descriptor
15
- interface: input
16
- options:
17
- iconRight: title
18
- placeholder: $t:field_options.directus_settings.project_name_placeholder
19
- width: half
20
-
21
- - field: project_url
22
- interface: input
23
- options:
24
- iconRight: link
25
- placeholder: https://example.com
26
- width: half
27
-
28
- - field: default_language
29
- interface: system-language
30
- options:
31
- iconRight: language
32
- placeholder: en-US
33
- width: half
34
-
35
- - field: theming_group
36
- interface: group-raw
37
- special:
38
- - alias
39
- - no-data
40
- - group
41
-
42
- - field: branding_divider
43
- interface: presentation-divider
44
- options:
45
- icon: palette
46
- title: $t:fields.directus_settings.branding
47
- special:
48
- - alias
49
- - no-data
50
- width: full
51
- group: theming_group
52
-
53
- - field: project_color
54
- interface: select-color
55
- note: $t:field_options.directus_settings.project_color_note
56
- width: half
57
- group: theming_group
58
-
59
- - field: project_logo
60
- interface: file
61
- note: $t:field_options.directus_settings.project_logo_note
62
- width: half
63
- group: theming_group
64
-
65
- - field: public_foreground
66
- interface: file
67
- width: half
68
- group: theming_group
69
-
70
- - field: public_background
71
- interface: file
72
- width: half
73
- group: theming_group
74
-
75
- - field: public_favicon
76
- interface: file
77
- note: $t:field_options.directus_settings.project_favicon_note
78
- width: half
79
- group: theming_group
80
-
81
- - field: public_note
82
- interface: input
83
- options:
84
- placeholder: $t:field_options.directus_settings.public_note_placeholder
85
- iconRight: info
86
- width: half
87
- group: theming_group
88
-
89
- - field: theming_divider
90
- interface: presentation-divider
91
- options:
92
- icon: palette
93
- title: $t:fields.directus_settings.theming
94
- special:
95
- - alias
96
- - no-data
97
- width: full
98
- group: theming_group
99
-
100
- - field: default_appearance
101
- interface: select-dropdown
102
- width: half
103
- options:
104
- choices:
105
- - value: auto
106
- text: $t:appearance_auto
107
- - value: light
108
- text: $t:appearance_light
109
- - value: dark
110
- text: $t:appearance_dark
111
- group: theming_group
112
-
113
- - field: default_theme_light
114
- width: full
115
- interface: system-theme
116
- options:
117
- appearance: light
118
- group: theming_group
119
-
120
- - field: theme_light_overrides
121
- width: full
122
- interface: system-theme-overrides
123
- options:
124
- appearance: light
125
- group: theming_group
126
- special:
127
- - cast-json
128
-
129
- - field: default_theme_dark
130
- width: full
131
- interface: system-theme
132
- options:
133
- appearance: dark
134
- group: theming_group
135
-
136
- - field: theme_dark_overrides
137
- width: full
138
- interface: system-theme-overrides
139
- options:
140
- appearance: dark
141
- group: theming_group
142
- special:
143
- - cast-json
144
-
145
- - field: custom_css
146
- interface: input-code
147
- options:
148
- language: css
149
- lineNumber: true
150
- template: |
151
- #app, #main-content, body {
152
- --v-button-background-color: #6644FF !important;
153
- --v-button-background-color-hover: #5E41EC !important;
154
- }
155
- width: full
156
- group: theming_group
157
-
158
- - field: modules_divider
159
- interface: presentation-divider
160
- options:
161
- icon: menu_open
162
- title: $t:modules
163
- special:
164
- - alias
165
- - no-data
166
- width: full
167
-
168
- - field: module_bar
169
- interface: system-modules
170
- special:
171
- - cast-json
172
-
173
- - field: security_divider
174
- interface: presentation-divider
175
- options:
176
- icon: shield
177
- title: $t:security
178
- special:
179
- - alias
180
- - no-data
181
- width: full
182
-
183
- - field: auth_password_policy
184
- interface: select-dropdown
185
- options:
186
- choices:
187
- - value: null
188
- text: $t:field_options.directus_settings.auth_password_policy.none_text
189
- - value: '/^.{8,}$/'
190
- text: $t:field_options.directus_settings.auth_password_policy.weak_text
191
- - value: "/(?=^.{8,}$)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+}{';'?>.<,])(?!.*\\s).*$/"
192
- text: $t:field_options.directus_settings.auth_password_policy.strong_text
193
- allowOther: true
194
- width: half
195
-
196
- - field: auth_login_attempts
197
- interface: input
198
- options:
199
- iconRight: lock
200
- placeholder: $t:unlimited
201
- width: half
202
-
203
- - field: files_divider
204
- interface: presentation-divider
205
- options:
206
- icon: folder
207
- title: $t:fields.directus_settings.files_and_thumbnails
208
- special:
209
- - alias
210
- - no-data
211
- width: full
212
-
213
- - field: storage_asset_transform
214
- interface: select-dropdown
215
- options:
216
- choices:
217
- - value: all
218
- text: $t:fields.directus_settings.transformations_all
219
- - value: none
220
- text: $t:fields.directus_settings.transformations_none
221
- - value: presets
222
- text: $t:fields.directus_settings.transformations_presets
223
- width: half
224
-
225
- - field: storage_default_folder
226
- interface: system-folder
227
- width: half
228
- note: $t:interfaces.system-folder.field_hint
229
-
230
- - field: storage_asset_presets
231
- interface: list
232
- options:
233
- fields:
234
- - field: key
235
- name: $t:key
236
- type: string
237
- schema:
238
- is_nullable: false
239
- meta:
240
- interface: input
241
- options:
242
- slug: true
243
- onlyOnCreate: false
244
- width: full
245
- required: true
246
- - field: fit
247
- name: $t:field_options.directus_settings.storage_asset_presets.fit_label
248
- type: string
249
- schema:
250
- is_nullable: false
251
- meta:
252
- interface: select-dropdown
253
- options:
254
- choices:
255
- - value: contain
256
- text: $t:field_options.directus_settings.storage_asset_presets.fit.contain_text
257
- - value: cover
258
- text: $t:field_options.directus_settings.storage_asset_presets.fit.cover_text
259
- - value: inside
260
- text: $t:field_options.directus_settings.storage_asset_presets.fit.fit_text
261
- - value: outside
262
- text: $t:field_options.directus_settings.storage_asset_presets.fit.outside_text
263
- width: half
264
- - field: width
265
- name: $t:width
266
- type: integer
267
- schema:
268
- is_nullable: false
269
- meta:
270
- interface: input
271
- width: half
272
- - field: height
273
- name: $t:height
274
- type: integer
275
- schema:
276
- is_nullable: false
277
- meta:
278
- interface: input
279
- width: half
280
- - field: quality
281
- type: integer
282
- name: $t:quality
283
- schema:
284
- default_value: 80
285
- is_nullable: false
286
- meta:
287
- interface: slider
288
- options:
289
- max: 100
290
- min: 0
291
- step: 1
292
- width: half
293
- - field: withoutEnlargement
294
- name: $t:field_options.directus_settings.storage_asset_presets.upscaling
295
- type: boolean
296
- schema:
297
- default_value: false
298
- meta:
299
- interface: boolean
300
- width: half
301
- options:
302
- label: $t:no_upscale
303
- - field: format
304
- name: $t:format
305
- type: string
306
- schema:
307
- is_nullable: false
308
- default_value: ''
309
- meta:
310
- interface: select-dropdown
311
- options:
312
- allowNone: true
313
- choices:
314
- - value: 'auto'
315
- text: 'Auto'
316
- - value: jpeg
317
- text: JPEG
318
- - value: png
319
- text: PNG
320
- - value: webp
321
- text: WebP
322
- - value: tiff
323
- text: Tiff
324
- - value: avif
325
- text: AVIF
326
- width: half
327
- - field: transforms
328
- name: $t:field_options.directus_settings.additional_transforms
329
- type: json
330
- schema:
331
- is_nullable: false
332
- default_value: []
333
- meta:
334
- note: $t:field_options.directus_settings.transforms_note
335
-
336
- interface: json
337
- options:
338
- template: >
339
- [
340
- ["blur", 45],
341
- ["grayscale"],
342
- ["extend", { "right": 500, "background": "rgb(255, 0, 0)" }]
343
- ]
344
- placeholder: >
345
- [
346
- ["blur", 45],
347
- ["grayscale"],
348
- ["extend", { "right": 500, "background": "rgb(255, 0, 0)" }]
349
- ]
350
- width: full
351
- template: '{{key}}'
352
- special:
353
- - cast-json
354
- width: full
355
-
356
- - field: map_divider
357
- interface: presentation-divider
358
- options:
359
- icon: map
360
- title: $t:fields.directus_settings.mapping
361
- special:
362
- - alias
363
- - no-data
364
- width: full
365
-
366
- - field: mapbox_key
367
- interface: input
368
- options:
369
- icon: key
370
- title: $t:field_options.directus_settings.mapbox_key
371
- placeholder: $t:field_options.directus_settings.mapbox_placeholder
372
- iconLeft: vpn_key
373
- font: monospace
374
- width: full
375
-
376
- - field: basemaps
377
- interface: list
378
- special:
379
- - cast-json
380
- options:
381
- template: '{{name}}'
382
- fields:
383
- - field: name
384
- name: $t:name
385
- schema:
386
- is_nullable: false
387
- meta:
388
- interface: text-input
389
- required: true
390
- options:
391
- placeholder: $t:field_options.directus_settings.basemaps_name_placeholder
392
- - field: type
393
- name: $t:type
394
- meta:
395
- interface: select-dropdown
396
- options:
397
- choices:
398
- - value: raster
399
- text: $t:field_options.directus_settings.basemaps_raster
400
- - value: tile
401
- text: $t:field_options.directus_settings.basemaps_tile
402
- - value: style
403
- text: $t:field_options.directus_settings.basemaps_style
404
- - field: url
405
- name: $t:url
406
- schema:
407
- is_nullable: false
408
- meta:
409
- interface: text-input
410
- options:
411
- placeholder: http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png
412
- - field: tileSize
413
- name: $t:tile_size
414
- type: integer
415
- schema:
416
- is_nullable: true
417
- meta:
418
- interface: input
419
- options:
420
- placeholder: '512'
421
- conditions:
422
- - name: typeNeqRaster
423
- rule:
424
- type:
425
- _neq: 'raster'
426
- hidden: true
427
- - field: attribution
428
- name: $t:fields.directus_settings.attribution
429
- type: string
430
- schema:
431
- is_nullable: true
432
- meta:
433
- interface: input
434
- options:
435
- placeholder: $t:fields.directus_settings.attribution_placeholder
436
-
437
- - field: image_editor
438
- interface: presentation-divider
439
- options:
440
- icon: image
441
- title: $t:fields.directus_settings.image_editor
442
- special:
443
- - alias
444
- - no-data
445
- width: full
446
-
447
- - field: custom_aspect_ratios
448
- interface: list
449
- special:
450
- - cast-json
451
- options:
452
- template: '{{text}}'
453
- fields:
454
- - field: text
455
- name: $t:text
456
- type: string
457
- meta:
458
- interface: text-input
459
- width: half
460
- required: true
461
- options:
462
- placeholder: $t:text
463
- - field: value
464
- name: $t:value
465
- type: float
466
- meta:
467
- interface: input
468
- width: half
469
- required: true
470
- options:
471
- placeholder: $t:value