@directus/api 17.0.0 → 17.1.0

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 (79) hide show
  1. package/dist/controllers/fields.js +0 -3
  2. package/dist/controllers/items.js +8 -7
  3. package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.d.ts +1 -1
  4. package/dist/flows.js +2 -1
  5. package/dist/middleware/collection-exists.js +6 -6
  6. package/dist/operations/item-update/index.js +4 -1
  7. package/dist/operations/request/index.js +5 -5
  8. package/dist/request/agent-with-ip-validation.d.ts +11 -0
  9. package/dist/request/agent-with-ip-validation.js +34 -0
  10. package/dist/request/index.js +6 -5
  11. package/dist/request/is-denied-ip.d.ts +1 -0
  12. package/dist/request/{validate-ip.js → is-denied-ip.js} +10 -12
  13. package/dist/services/collections.d.ts +3 -2
  14. package/dist/services/collections.js +1 -1
  15. package/dist/services/fields.js +8 -1
  16. package/dist/services/files.js +4 -3
  17. package/dist/services/graphql/index.js +3 -2
  18. package/dist/services/import-export.js +62 -26
  19. package/dist/services/items.js +2 -1
  20. package/dist/services/permissions.js +1 -1
  21. package/dist/services/relations.js +1 -1
  22. package/dist/services/roles.d.ts +9 -4
  23. package/dist/services/roles.js +50 -2
  24. package/dist/services/specifications.js +4 -3
  25. package/dist/services/utils.js +1 -1
  26. package/dist/telemetry/utils/get-user-item-count.js +2 -1
  27. package/dist/types/collection.d.ts +2 -13
  28. package/dist/utils/get-field-system-rows.d.ts +2 -0
  29. package/dist/utils/get-field-system-rows.js +17 -0
  30. package/dist/utils/get-permissions.js +1 -1
  31. package/dist/utils/get-schema.js +3 -2
  32. package/dist/utils/merge-permissions-for-share.js +1 -1
  33. package/dist/utils/should-skip-cache.js +1 -1
  34. package/dist/websocket/controllers/hooks.js +1 -1
  35. package/dist/websocket/handlers/items.js +2 -1
  36. package/dist/websocket/messages.d.ts +18 -18
  37. package/package.json +42 -41
  38. package/dist/database/system-data/app-access-permissions/app-access-permissions.yaml +0 -107
  39. package/dist/database/system-data/app-access-permissions/index.d.ts +0 -3
  40. package/dist/database/system-data/app-access-permissions/index.js +0 -17
  41. package/dist/database/system-data/app-access-permissions/schema-access-permissions.yaml +0 -17
  42. package/dist/database/system-data/collections/collections.yaml +0 -103
  43. package/dist/database/system-data/collections/index.d.ts +0 -2
  44. package/dist/database/system-data/collections/index.js +0 -9
  45. package/dist/database/system-data/fields/_defaults.yaml +0 -16
  46. package/dist/database/system-data/fields/activity.yaml +0 -83
  47. package/dist/database/system-data/fields/collections.yaml +0 -249
  48. package/dist/database/system-data/fields/dashboards.yaml +0 -20
  49. package/dist/database/system-data/fields/extensions.yaml +0 -10
  50. package/dist/database/system-data/fields/fields.yaml +0 -104
  51. package/dist/database/system-data/fields/files.yaml +0 -160
  52. package/dist/database/system-data/fields/flows.yaml +0 -26
  53. package/dist/database/system-data/fields/folders.yaml +0 -14
  54. package/dist/database/system-data/fields/index.d.ts +0 -2
  55. package/dist/database/system-data/fields/index.js +0 -33
  56. package/dist/database/system-data/fields/migrations.yaml +0 -10
  57. package/dist/database/system-data/fields/notifications.yaml +0 -15
  58. package/dist/database/system-data/fields/operations.yaml +0 -23
  59. package/dist/database/system-data/fields/panels.yaml +0 -29
  60. package/dist/database/system-data/fields/permissions.yaml +0 -37
  61. package/dist/database/system-data/fields/presets.yaml +0 -56
  62. package/dist/database/system-data/fields/relations.yaml +0 -34
  63. package/dist/database/system-data/fields/revisions.yaml +0 -30
  64. package/dist/database/system-data/fields/roles.yaml +0 -61
  65. package/dist/database/system-data/fields/sessions.yaml +0 -16
  66. package/dist/database/system-data/fields/settings.yaml +0 -471
  67. package/dist/database/system-data/fields/shares.yaml +0 -83
  68. package/dist/database/system-data/fields/translations.yaml +0 -27
  69. package/dist/database/system-data/fields/users.yaml +0 -224
  70. package/dist/database/system-data/fields/versions.yaml +0 -38
  71. package/dist/database/system-data/fields/webhooks.yaml +0 -141
  72. package/dist/database/system-data/relations/index.d.ts +0 -2
  73. package/dist/database/system-data/relations/index.js +0 -9
  74. package/dist/database/system-data/relations/relations.yaml +0 -197
  75. package/dist/request/request-interceptor.d.ts +0 -2
  76. package/dist/request/request-interceptor.js +0 -28
  77. package/dist/request/response-interceptor.d.ts +0 -2
  78. package/dist/request/response-interceptor.js +0 -5
  79. package/dist/request/validate-ip.d.ts +0 -1
@@ -1,104 +0,0 @@
1
- # directus_fields isn't surfaced in the app
2
- table: directus_fields
3
-
4
- fields:
5
- - collection: directus_fields
6
- field: id
7
- width: half
8
-
9
- - collection: directus_fields
10
- field: collection
11
- width: half
12
-
13
- - collection: directus_fields
14
- field: field
15
- width: half
16
-
17
- - collection: directus_fields
18
- field: special
19
- hidden: true
20
- special:
21
- - cast-csv
22
- width: half
23
-
24
- - collection: directus_fields
25
- field: interface
26
- width: half
27
-
28
- - collection: directus_fields
29
- field: options
30
- hidden: true
31
- special:
32
- - cast-json
33
- width: half
34
-
35
- - collection: directus_fields
36
- field: display
37
- width: half
38
-
39
- - collection: directus_fields
40
- field: display_options
41
- hidden: true
42
- special:
43
- - cast-json
44
- width: half
45
-
46
- - collection: directus_fields
47
- field: readonly
48
- hidden: true
49
- special:
50
- - cast-boolean
51
- width: half
52
-
53
- - collection: directus_fields
54
- field: hidden
55
- hidden: true
56
- special:
57
- - cast-boolean
58
- width: half
59
-
60
- - collection: directus_fields
61
- field: required
62
- hidden: true
63
- special:
64
- - cast-boolean
65
- width: half
66
-
67
- - collection: directus_fields
68
- field: sort
69
- width: half
70
-
71
- - collection: directus_fields
72
- field: width
73
- width: half
74
-
75
- - collection: directus_fields
76
- field: group
77
- width: half
78
-
79
- - collection: directus_fields
80
- field: translations
81
- hidden: true
82
- special:
83
- - cast-json
84
- width: half
85
-
86
- - collection: directus_fields
87
- field: note
88
- width: half
89
-
90
- - collection: directus_fields
91
- field: conditions
92
- hidden: true
93
- special:
94
- - cast-json
95
-
96
- - collection: directus_fields
97
- field: validation
98
- hidden: true
99
- special:
100
- - cast-json
101
-
102
- - collection: directus_fields
103
- field: validation_message
104
- hidden: true
@@ -1,160 +0,0 @@
1
- table: directus_files
2
-
3
- fields:
4
- - field: id
5
- hidden: true
6
- interface: input
7
- special:
8
- - uuid
9
-
10
- - field: title
11
- interface: input
12
- options:
13
- iconRight: title
14
- placeholder: $t:field_options.directus_files.title
15
- width: full
16
-
17
- - field: description
18
- interface: input-multiline
19
- width: full
20
- options:
21
- placeholder: $t:field_options.directus_files.description
22
-
23
- - field: tags
24
- interface: tags
25
- options:
26
- iconRight: local_offer
27
- special:
28
- - cast-json
29
- width: full
30
- display: labels
31
- display_options:
32
- choices: null
33
- format: false
34
-
35
- - field: location
36
- interface: input
37
- options:
38
- iconRight: place
39
- placeholder: $t:field_options.directus_files.location
40
- width: half
41
-
42
- - field: storage
43
- interface: input
44
- options:
45
- iconRight: storage
46
- width: half
47
- readonly: true
48
-
49
- - field: focal_point_divider
50
- interface: presentation-divider
51
- options:
52
- icon: image_search
53
- title: $t:field_options.directus_files.focal_point_divider
54
- special:
55
- - alias
56
- - no-data
57
- width: full
58
-
59
- - field: focal_point_x
60
- width: half
61
-
62
- - field: focal_point_y
63
- width: half
64
-
65
- - field: storage_divider
66
- interface: presentation-divider
67
- options:
68
- icon: insert_drive_file
69
- title: $t:field_options.directus_files.storage_divider
70
- special:
71
- - alias
72
- - no-data
73
- width: full
74
-
75
- - field: filename_disk
76
- interface: input
77
- options:
78
- iconRight: publish
79
- placeholder: $t:field_options.directus_files.filename_disk
80
- readonly: true
81
- width: half
82
-
83
- - field: filename_download
84
- interface: input
85
- options:
86
- iconRight: get_app
87
- placeholder: $t:field_options.directus_files.filename_download
88
- width: half
89
-
90
- - field: metadata
91
- hidden: true
92
- special:
93
- - cast-json
94
-
95
- - field: type
96
- display: mime-type
97
- readonly: true
98
-
99
- - field: filesize
100
- display: filesize
101
- readonly: true
102
-
103
- - field: modified_by
104
- interface: select-dropdown-m2o
105
- special:
106
- - user-updated
107
- width: half
108
- display: user
109
- readonly: true
110
- options:
111
- template: '{{avatar.$thumbnail}} {{first_name}} {{last_name}}'
112
-
113
- - field: modified_on
114
- interface: datetime
115
- special:
116
- - date-updated
117
- width: half
118
- display: datetime
119
- readonly: true
120
-
121
- - field: embed
122
- width: half
123
- hidden: true
124
-
125
- - field: uploaded_by
126
- display: user
127
- width: half
128
- hidden: true
129
- special:
130
- - user-created
131
-
132
- - field: uploaded_on
133
- display: datetime
134
- width: half
135
- hidden: true
136
-
137
- - field: folder
138
- width: half
139
- readonly: true
140
- special:
141
- - m2o
142
- display: related-values
143
- display_options:
144
- template: '{{ name }}'
145
-
146
- - field: width
147
- width: half
148
- readonly: true
149
-
150
- - field: height
151
- width: half
152
- readonly: true
153
-
154
- - field: charset
155
- width: half
156
- readonly: true
157
-
158
- - field: duration
159
- width: half
160
- readonly: true
@@ -1,26 +0,0 @@
1
- table: directus_flows
2
-
3
- fields:
4
- - field: id
5
- special:
6
- - uuid
7
- - field: name
8
- - field: icon
9
- - field: color
10
- - field: description
11
- - field: status
12
- - field: trigger
13
- - field: accountability
14
- - field: options
15
- special:
16
- - cast-json
17
- - field: operation
18
- - field: operations
19
- special:
20
- - o2m
21
- - field: date_created
22
- special:
23
- - date-created
24
- - field: user_created
25
- special:
26
- - user-created
@@ -1,14 +0,0 @@
1
- table: directus_folders
2
-
3
- fields:
4
- - field: id
5
- interface: input
6
- special:
7
- - uuid
8
- width: half
9
-
10
- - field: parent
11
- width: half
12
-
13
- - field: name
14
- width: full
@@ -1,2 +0,0 @@
1
- import type { FieldMeta } from '@directus/types';
2
- export declare const systemFieldRows: FieldMeta[];
@@ -1,33 +0,0 @@
1
- import fse from 'fs-extra';
2
- import { merge } from 'lodash-es';
3
- import path from 'path';
4
- import { getAuthProviders } from '../../../utils/get-auth-providers.js';
5
- import { requireYAML } from '../../../utils/require-yaml.js';
6
- import formatTitle from '@directus/format-title';
7
- import { fileURLToPath } from 'url';
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
- const defaults = requireYAML(path.join(__dirname, './_defaults.yaml'));
11
- const fieldData = fse.readdirSync(path.resolve(__dirname));
12
- export const systemFieldRows = [];
13
- for (const filepath of fieldData) {
14
- if (filepath.includes('_defaults') || filepath.includes('index'))
15
- continue;
16
- const systemFields = requireYAML(path.resolve(__dirname, filepath));
17
- systemFields['fields'].forEach((field, index) => {
18
- const systemField = merge({ system: true }, defaults, field, {
19
- collection: systemFields['table'],
20
- sort: index + 1,
21
- });
22
- // Dynamically populate auth providers field
23
- if (systemField.collection === 'directus_users' && systemField.field === 'provider') {
24
- getAuthProviders().forEach(({ name }) => {
25
- systemField.options?.['choices']?.push({
26
- text: formatTitle(name),
27
- value: name,
28
- });
29
- });
30
- }
31
- systemFieldRows.push(systemField);
32
- });
33
- }
@@ -1,10 +0,0 @@
1
- # directus_migrations isn't surfaced in the app, nor accessible from the API
2
- table: directus_migrations
3
-
4
- fields:
5
- - collection: directus_migrations
6
- field: version
7
- - collection: directus_migrations
8
- field: name
9
- - collection: directus_migrations
10
- field: timestamp
@@ -1,15 +0,0 @@
1
- table: directus_notifications
2
-
3
- fields:
4
- - field: id
5
- - field: timestamp
6
- special:
7
- - date-created
8
- - cast-timestamp
9
- - field: status
10
- - field: recipient
11
- - field: sender
12
- - field: subject
13
- - field: message
14
- - field: collection
15
- - field: item
@@ -1,23 +0,0 @@
1
- table: directus_operations
2
-
3
- fields:
4
- - field: id
5
- special:
6
- - uuid
7
- - field: name
8
- - field: key
9
- - field: type
10
- - field: position_x
11
- - field: position_y
12
- - field: options
13
- special:
14
- - cast-json
15
- - field: resolve
16
- - field: reject
17
- - field: flow
18
- - field: date_created
19
- special:
20
- - date-created
21
- - field: user_created
22
- special:
23
- - user-created
@@ -1,29 +0,0 @@
1
- table: directus_panels
2
-
3
- fields:
4
- - field: id
5
- special:
6
- - uuid
7
- - field: name
8
- - field: icon
9
- - field: color
10
- - field: note
11
- - field: type
12
- - field: show_header
13
- special:
14
- - cast-boolean
15
- - field: position_x
16
- - field: position_y
17
- - field: width
18
- - field: height
19
- - field: options
20
- special:
21
- - cast-json
22
- - field: date_created
23
- special:
24
- - date-created
25
- - cast-timestamp
26
- - field: user_created
27
- special:
28
- - user-created
29
- - field: dashboard
@@ -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