directus 9.5.2 → 9.7.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.
- package/dist/app.js +3 -1
- package/dist/auth/drivers/ldap.d.ts +0 -1
- package/dist/auth/drivers/ldap.js +54 -60
- package/dist/auth/drivers/oauth2.js +3 -0
- package/dist/auth/drivers/openid.js +3 -0
- package/dist/cache.d.ts +4 -1
- package/dist/cache.js +27 -5
- package/dist/cli/commands/schema/apply.d.ts +1 -0
- package/dist/cli/commands/schema/apply.js +9 -5
- package/dist/cli/index.js +1 -0
- package/dist/cli/utils/create-env/env-stub.liquid +1 -0
- package/dist/controllers/assets.js +9 -1
- package/dist/controllers/utils.js +18 -1
- package/dist/database/index.js +0 -3
- package/dist/database/migrations/20220303A-remove-default-project-color.d.ts +3 -0
- package/dist/database/migrations/20220303A-remove-default-project-color.js +22 -0
- package/dist/database/migrations/20220314A-add-translation-strings.d.ts +3 -0
- package/dist/database/migrations/20220314A-add-translation-strings.js +15 -0
- package/dist/database/migrations/20220322A-rename-field-typecast-flags.d.ts +3 -0
- package/dist/database/migrations/20220322A-rename-field-typecast-flags.js +73 -0
- package/dist/database/migrations/run.js +1 -1
- package/dist/database/run-ast.d.ts +1 -1
- package/dist/database/run-ast.js +48 -35
- package/dist/database/system-data/fields/collections.yaml +4 -4
- package/dist/database/system-data/fields/fields.yaml +8 -8
- package/dist/database/system-data/fields/files.yaml +2 -2
- package/dist/database/system-data/fields/panels.yaml +2 -2
- package/dist/database/system-data/fields/permissions.yaml +4 -4
- package/dist/database/system-data/fields/presets.yaml +3 -3
- package/dist/database/system-data/fields/relations.yaml +1 -1
- package/dist/database/system-data/fields/revisions.yaml +2 -2
- package/dist/database/system-data/fields/roles.yaml +4 -4
- package/dist/database/system-data/fields/settings.yaml +25 -6
- package/dist/database/system-data/fields/users.yaml +2 -2
- package/dist/database/system-data/fields/webhooks.yaml +4 -4
- package/dist/env.js +9 -2
- package/dist/exceptions/database/dialects/mysql.js +23 -17
- package/dist/extensions.js +0 -2
- package/dist/middleware/authenticate.d.ts +5 -3
- package/dist/middleware/authenticate.js +22 -39
- package/dist/middleware/respond.js +7 -28
- package/dist/server.js +5 -2
- package/dist/services/authorization.js +60 -1
- package/dist/services/collections.js +6 -6
- package/dist/services/fields.js +3 -3
- package/dist/services/files.js +69 -3
- package/dist/services/graphql.js +2 -2
- package/dist/services/import-export.d.ts +34 -0
- package/dist/services/import-export.js +270 -0
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +2 -1
- package/dist/services/items.js +1 -0
- package/dist/services/mail/templates/base.liquid +2 -2
- package/dist/services/payload.js +3 -3
- package/dist/services/permissions.js +10 -10
- package/dist/services/relations.js +7 -4
- package/dist/services/utils.js +10 -0
- package/dist/utils/apply-query.js +2 -24
- package/dist/utils/get-date-formatted.d.ts +1 -0
- package/dist/utils/get-date-formatted.js +14 -0
- package/dist/utils/get-local-type.js +2 -2
- package/dist/utils/get-permissions.js +1 -1
- package/dist/utils/get-schema.js +1 -1
- package/dist/utils/is-directus-jwt.js +4 -21
- package/dist/utils/jwt.d.ts +2 -0
- package/dist/utils/jwt.js +49 -0
- package/dist/utils/merge-permissions.js +18 -6
- package/example.env +1 -0
- package/package.json +17 -18
- package/dist/__mocks__/cache.d.ts +0 -6
- package/dist/__mocks__/cache.js +0 -8
- package/dist/services/import.d.ts +0 -13
- package/dist/services/import.js +0 -118
package/dist/database/run-ast.js
CHANGED
|
@@ -3,15 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("@directus/shared/utils");
|
|
6
7
|
const lodash_1 = require("lodash");
|
|
8
|
+
const _1 = __importDefault(require("."));
|
|
9
|
+
const helpers_1 = require("../database/helpers");
|
|
10
|
+
const env_1 = __importDefault(require("../env"));
|
|
7
11
|
const payload_1 = require("../services/payload");
|
|
8
12
|
const apply_function_to_column_name_1 = require("../utils/apply-function-to-column-name");
|
|
9
13
|
const apply_query_1 = __importDefault(require("../utils/apply-query"));
|
|
10
14
|
const get_column_1 = require("../utils/get-column");
|
|
11
15
|
const strip_function_1 = require("../utils/strip-function");
|
|
12
|
-
const utils_1 = require("@directus/shared/utils");
|
|
13
|
-
const _1 = __importDefault(require("."));
|
|
14
|
-
const helpers_1 = require("../database/helpers");
|
|
15
16
|
/**
|
|
16
17
|
* Execute a given AST using Knex. Returns array of items based on requested AST.
|
|
17
18
|
*/
|
|
@@ -44,10 +45,33 @@ async function runAST(originalAST, schema, options) {
|
|
|
44
45
|
// Apply the `_in` filters to the nested collection batches
|
|
45
46
|
const nestedNodes = applyParentFilters(schema, nestedCollectionNodes, items);
|
|
46
47
|
for (const nestedNode of nestedNodes) {
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
let nestedItems = [];
|
|
49
|
+
if (nestedNode.type === 'o2m') {
|
|
50
|
+
let hasMore = true;
|
|
51
|
+
let batchCount = 0;
|
|
52
|
+
while (hasMore) {
|
|
53
|
+
const node = (0, lodash_1.merge)({}, nestedNode, {
|
|
54
|
+
query: { limit: env_1.default.RELATIONAL_BATCH_SIZE, offset: batchCount * env_1.default.RELATIONAL_BATCH_SIZE },
|
|
55
|
+
});
|
|
56
|
+
nestedItems = (await runAST(node, schema, { knex, nested: true }));
|
|
57
|
+
if (nestedItems) {
|
|
58
|
+
items = mergeWithParentItems(schema, nestedItems, items, nestedNode);
|
|
59
|
+
}
|
|
60
|
+
if (!nestedItems || nestedItems.length < env_1.default.RELATIONAL_BATCH_SIZE) {
|
|
61
|
+
hasMore = false;
|
|
62
|
+
}
|
|
63
|
+
batchCount++;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const node = (0, lodash_1.merge)({}, nestedNode, {
|
|
68
|
+
query: { limit: -1 },
|
|
69
|
+
});
|
|
70
|
+
nestedItems = (await runAST(node, schema, { knex, nested: true }));
|
|
71
|
+
if (nestedItems) {
|
|
72
|
+
// Merge all fetched nested records with the parent items
|
|
73
|
+
items = mergeWithParentItems(schema, nestedItems, items, nestedNode);
|
|
74
|
+
}
|
|
51
75
|
}
|
|
52
76
|
}
|
|
53
77
|
// During the fetching of data, we have to inject a couple of required fields for the child nesting
|
|
@@ -146,13 +170,7 @@ function applyParentFilters(schema, nestedCollectionNodes, parentItem) {
|
|
|
146
170
|
if (nestedNode.type === 'm2o') {
|
|
147
171
|
const foreignField = schema.collections[nestedNode.relation.related_collection].primary;
|
|
148
172
|
const foreignIds = (0, lodash_1.uniq)(parentItems.map((res) => res[nestedNode.relation.field])).filter((id) => id);
|
|
149
|
-
|
|
150
|
-
if (limit === -1) {
|
|
151
|
-
(0, lodash_1.merge)(nestedNode, { query: { filter: { [foreignField]: { _in: foreignIds } } } });
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
nestedNode.query.union = [foreignField, foreignIds];
|
|
155
|
-
}
|
|
173
|
+
(0, lodash_1.merge)(nestedNode, { query: { filter: { [foreignField]: { _in: foreignIds } } } });
|
|
156
174
|
}
|
|
157
175
|
else if (nestedNode.type === 'o2m') {
|
|
158
176
|
const relatedM2OisFetched = !!nestedNode.children.find((child) => {
|
|
@@ -174,13 +192,7 @@ function applyParentFilters(schema, nestedCollectionNodes, parentItem) {
|
|
|
174
192
|
}
|
|
175
193
|
const foreignField = nestedNode.relation.field;
|
|
176
194
|
const foreignIds = (0, lodash_1.uniq)(parentItems.map((res) => res[nestedNode.parentKey])).filter((id) => id);
|
|
177
|
-
|
|
178
|
-
if (limit === -1) {
|
|
179
|
-
(0, lodash_1.merge)(nestedNode, { query: { filter: { [foreignField]: { _in: foreignIds } } } });
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
nestedNode.query.union = [foreignField, foreignIds];
|
|
183
|
-
}
|
|
195
|
+
(0, lodash_1.merge)(nestedNode, { query: { filter: { [foreignField]: { _in: foreignIds } } } });
|
|
184
196
|
}
|
|
185
197
|
else if (nestedNode.type === 'a2o') {
|
|
186
198
|
const keysPerCollection = {};
|
|
@@ -193,20 +205,16 @@ function applyParentFilters(schema, nestedCollectionNodes, parentItem) {
|
|
|
193
205
|
for (const relatedCollection of nestedNode.names) {
|
|
194
206
|
const foreignField = nestedNode.relatedKey[relatedCollection];
|
|
195
207
|
const foreignIds = (0, lodash_1.uniq)(keysPerCollection[relatedCollection]);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
nestedNode.query[relatedCollection].union = [foreignField, foreignIds];
|
|
202
|
-
}
|
|
208
|
+
(0, lodash_1.merge)(nestedNode, {
|
|
209
|
+
query: { [relatedCollection]: { filter: { [foreignField]: { _in: foreignIds } } } },
|
|
210
|
+
});
|
|
203
211
|
}
|
|
204
212
|
}
|
|
205
213
|
}
|
|
206
214
|
return nestedCollectionNodes;
|
|
207
215
|
}
|
|
208
216
|
function mergeWithParentItems(schema, nestedItem, parentItem, nestedNode) {
|
|
209
|
-
var _a;
|
|
217
|
+
var _a, _b;
|
|
210
218
|
const nestedItems = (0, utils_1.toArray)(nestedItem);
|
|
211
219
|
const parentItems = (0, lodash_1.clone)((0, utils_1.toArray)(parentItem));
|
|
212
220
|
if (nestedNode.type === 'm2o') {
|
|
@@ -220,8 +228,9 @@ function mergeWithParentItems(schema, nestedItem, parentItem, nestedNode) {
|
|
|
220
228
|
}
|
|
221
229
|
else if (nestedNode.type === 'o2m') {
|
|
222
230
|
for (const parentItem of parentItems) {
|
|
223
|
-
|
|
224
|
-
.
|
|
231
|
+
if (!parentItem[nestedNode.fieldKey])
|
|
232
|
+
parentItem[nestedNode.fieldKey] = [];
|
|
233
|
+
const itemChildren = nestedItems.filter((nestedItem) => {
|
|
225
234
|
var _a;
|
|
226
235
|
if (nestedItem === null)
|
|
227
236
|
return false;
|
|
@@ -230,8 +239,13 @@ function mergeWithParentItems(schema, nestedItem, parentItem, nestedNode) {
|
|
|
230
239
|
return (nestedItem[nestedNode.relation.field] ==
|
|
231
240
|
parentItem[schema.collections[nestedNode.relation.related_collection].primary] ||
|
|
232
241
|
((_a = nestedItem[nestedNode.relation.field]) === null || _a === void 0 ? void 0 : _a[schema.collections[nestedNode.relation.related_collection].primary]) == parentItem[schema.collections[nestedNode.relation.related_collection].primary]);
|
|
233
|
-
})
|
|
234
|
-
|
|
242
|
+
});
|
|
243
|
+
parentItem[nestedNode.fieldKey].push(...itemChildren);
|
|
244
|
+
if (nestedNode.query.offset && nestedNode.query.offset >= 0) {
|
|
245
|
+
parentItem[nestedNode.fieldKey] = parentItem[nestedNode.fieldKey].slice(nestedNode.query.offset);
|
|
246
|
+
}
|
|
247
|
+
parentItem[nestedNode.fieldKey] = parentItem[nestedNode.fieldKey].slice(0, (_a = nestedNode.query.limit) !== null && _a !== void 0 ? _a : 100);
|
|
248
|
+
parentItem[nestedNode.fieldKey] = parentItem[nestedNode.fieldKey].sort((a, b) => {
|
|
235
249
|
// This is pre-filled in get-ast-from-query
|
|
236
250
|
const sortField = nestedNode.query.sort[0];
|
|
237
251
|
let column = sortField;
|
|
@@ -253,12 +267,11 @@ function mergeWithParentItems(schema, nestedItem, parentItem, nestedNode) {
|
|
|
253
267
|
return a[column] < b[column] ? 1 : -1;
|
|
254
268
|
}
|
|
255
269
|
});
|
|
256
|
-
parentItem[nestedNode.fieldKey] = itemChildren.length > 0 ? itemChildren : [];
|
|
257
270
|
}
|
|
258
271
|
}
|
|
259
272
|
else if (nestedNode.type === 'a2o') {
|
|
260
273
|
for (const parentItem of parentItems) {
|
|
261
|
-
if (!((
|
|
274
|
+
if (!((_b = nestedNode.relation.meta) === null || _b === void 0 ? void 0 : _b.one_collection_field)) {
|
|
262
275
|
parentItem[nestedNode.fieldKey] = null;
|
|
263
276
|
continue;
|
|
264
277
|
}
|
|
@@ -42,21 +42,21 @@ fields:
|
|
|
42
42
|
width: full
|
|
43
43
|
|
|
44
44
|
- field: hidden
|
|
45
|
-
special: boolean
|
|
45
|
+
special: cast-boolean
|
|
46
46
|
interface: boolean
|
|
47
47
|
options:
|
|
48
48
|
label: $t:field_options.directus_collections.hidden_label
|
|
49
49
|
width: half
|
|
50
50
|
|
|
51
51
|
- field: singleton
|
|
52
|
-
special: boolean
|
|
52
|
+
special: cast-boolean
|
|
53
53
|
interface: boolean
|
|
54
54
|
options:
|
|
55
55
|
label: $t:singleton_label
|
|
56
56
|
width: half
|
|
57
57
|
|
|
58
58
|
- field: translations
|
|
59
|
-
special: json
|
|
59
|
+
special: cast-json
|
|
60
60
|
interface: list
|
|
61
61
|
options:
|
|
62
62
|
template: '{{ translation }} ({{ language }})'
|
|
@@ -115,7 +115,7 @@ fields:
|
|
|
115
115
|
|
|
116
116
|
- field: archive_app_filter
|
|
117
117
|
interface: boolean
|
|
118
|
-
special: boolean
|
|
118
|
+
special: cast-boolean
|
|
119
119
|
options:
|
|
120
120
|
label: $t:field_options.directus_collections.archive_app_filter
|
|
121
121
|
width: half
|
|
@@ -17,7 +17,7 @@ fields:
|
|
|
17
17
|
- collection: directus_fields
|
|
18
18
|
field: special
|
|
19
19
|
hidden: true
|
|
20
|
-
special: csv
|
|
20
|
+
special: cast-csv
|
|
21
21
|
width: half
|
|
22
22
|
|
|
23
23
|
- collection: directus_fields
|
|
@@ -27,7 +27,7 @@ fields:
|
|
|
27
27
|
- collection: directus_fields
|
|
28
28
|
field: options
|
|
29
29
|
hidden: true
|
|
30
|
-
special: json
|
|
30
|
+
special: cast-json
|
|
31
31
|
width: half
|
|
32
32
|
|
|
33
33
|
- collection: directus_fields
|
|
@@ -37,25 +37,25 @@ fields:
|
|
|
37
37
|
- collection: directus_fields
|
|
38
38
|
field: display_options
|
|
39
39
|
hidden: true
|
|
40
|
-
special: json
|
|
40
|
+
special: cast-json
|
|
41
41
|
width: half
|
|
42
42
|
|
|
43
43
|
- collection: directus_fields
|
|
44
44
|
field: readonly
|
|
45
45
|
hidden: true
|
|
46
|
-
special: boolean
|
|
46
|
+
special: cast-boolean
|
|
47
47
|
width: half
|
|
48
48
|
|
|
49
49
|
- collection: directus_fields
|
|
50
50
|
field: hidden
|
|
51
51
|
hidden: true
|
|
52
|
-
special: boolean
|
|
52
|
+
special: cast-boolean
|
|
53
53
|
width: half
|
|
54
54
|
|
|
55
55
|
- collection: directus_fields
|
|
56
56
|
field: required
|
|
57
57
|
hidden: true
|
|
58
|
-
special: boolean
|
|
58
|
+
special: cast-boolean
|
|
59
59
|
width: half
|
|
60
60
|
|
|
61
61
|
- collection: directus_fields
|
|
@@ -73,7 +73,7 @@ fields:
|
|
|
73
73
|
- collection: directus_fields
|
|
74
74
|
field: translations
|
|
75
75
|
hidden: true
|
|
76
|
-
special: json
|
|
76
|
+
special: cast-json
|
|
77
77
|
width: half
|
|
78
78
|
|
|
79
79
|
- collection: directus_fields
|
|
@@ -83,4 +83,4 @@ fields:
|
|
|
83
83
|
- collection: directus_fields
|
|
84
84
|
field: conditions
|
|
85
85
|
hidden: true
|
|
86
|
-
special: json
|
|
86
|
+
special: cast-json
|
|
@@ -23,7 +23,7 @@ fields:
|
|
|
23
23
|
interface: tags
|
|
24
24
|
options:
|
|
25
25
|
iconRight: local_offer
|
|
26
|
-
special: json
|
|
26
|
+
special: cast-json
|
|
27
27
|
width: full
|
|
28
28
|
display: labels
|
|
29
29
|
display_options:
|
|
@@ -71,7 +71,7 @@ fields:
|
|
|
71
71
|
|
|
72
72
|
- field: metadata
|
|
73
73
|
hidden: true
|
|
74
|
-
special: json
|
|
74
|
+
special: cast-json
|
|
75
75
|
|
|
76
76
|
- field: type
|
|
77
77
|
display: mime-type
|
|
@@ -9,13 +9,13 @@ fields:
|
|
|
9
9
|
- field: note
|
|
10
10
|
- field: type
|
|
11
11
|
- field: show_header
|
|
12
|
-
special: boolean
|
|
12
|
+
special: cast-boolean
|
|
13
13
|
- field: position_x
|
|
14
14
|
- field: position_y
|
|
15
15
|
- field: width
|
|
16
16
|
- field: height
|
|
17
17
|
- field: options
|
|
18
|
-
special: json
|
|
18
|
+
special: cast-json
|
|
19
19
|
- field: date_created
|
|
20
20
|
special: date-created
|
|
21
21
|
- field: user_created
|
|
@@ -4,12 +4,12 @@ table: directus_permissions
|
|
|
4
4
|
fields:
|
|
5
5
|
- field: permissions
|
|
6
6
|
hidden: true
|
|
7
|
-
special: json
|
|
7
|
+
special: cast-json
|
|
8
8
|
width: half
|
|
9
9
|
|
|
10
10
|
- field: presets
|
|
11
11
|
hidden: true
|
|
12
|
-
special: json
|
|
12
|
+
special: cast-json
|
|
13
13
|
width: half
|
|
14
14
|
|
|
15
15
|
- field: role
|
|
@@ -23,11 +23,11 @@ fields:
|
|
|
23
23
|
|
|
24
24
|
- field: fields
|
|
25
25
|
width: half
|
|
26
|
-
special: csv
|
|
26
|
+
special: cast-csv
|
|
27
27
|
|
|
28
28
|
- field: action
|
|
29
29
|
width: half
|
|
30
30
|
|
|
31
31
|
- field: validation
|
|
32
32
|
width: half
|
|
33
|
-
special: json
|
|
33
|
+
special: cast-json
|
|
@@ -3,15 +3,15 @@ table: directus_presets
|
|
|
3
3
|
fields:
|
|
4
4
|
- field: filter
|
|
5
5
|
hidden: true
|
|
6
|
-
special: json
|
|
6
|
+
special: cast-json
|
|
7
7
|
|
|
8
8
|
- field: layout_query
|
|
9
9
|
hidden: true
|
|
10
|
-
special: json
|
|
10
|
+
special: cast-json
|
|
11
11
|
|
|
12
12
|
- field: layout_options
|
|
13
13
|
hidden: true
|
|
14
|
-
special: json
|
|
14
|
+
special: cast-json
|
|
15
15
|
|
|
16
16
|
- field: role
|
|
17
17
|
width: half
|
|
@@ -25,24 +25,24 @@ fields:
|
|
|
25
25
|
|
|
26
26
|
- field: app_access
|
|
27
27
|
interface: boolean
|
|
28
|
-
special: boolean
|
|
28
|
+
special: cast-boolean
|
|
29
29
|
width: half
|
|
30
30
|
|
|
31
31
|
- field: admin_access
|
|
32
32
|
interface: boolean
|
|
33
|
-
special: boolean
|
|
33
|
+
special: cast-boolean
|
|
34
34
|
width: half
|
|
35
35
|
|
|
36
36
|
- field: ip_access
|
|
37
37
|
interface: tags
|
|
38
38
|
options:
|
|
39
39
|
placeholder: $t:field_options.directus_roles.ip_access
|
|
40
|
-
special: csv
|
|
40
|
+
special: cast-csv
|
|
41
41
|
width: full
|
|
42
42
|
|
|
43
43
|
- field: enforce_tfa
|
|
44
44
|
interface: boolean
|
|
45
|
-
special: boolean
|
|
45
|
+
special: cast-boolean
|
|
46
46
|
width: half
|
|
47
47
|
|
|
48
48
|
- field: users
|
|
@@ -87,9 +87,25 @@ fields:
|
|
|
87
87
|
language: css
|
|
88
88
|
lineNumber: true
|
|
89
89
|
template: |
|
|
90
|
-
#app, #main-content {
|
|
91
|
-
--
|
|
92
|
-
--
|
|
90
|
+
#app, #main-content, body {
|
|
91
|
+
--primary-alt: #F0ECFF !important;
|
|
92
|
+
--primary-10: #F0ECFF !important;
|
|
93
|
+
--primary-25: #D9D0FF !important;
|
|
94
|
+
--primary-50: #B3A1FF !important;
|
|
95
|
+
--primary-75: #8C73FF !important;
|
|
96
|
+
--primary-90: #7557FF !important;
|
|
97
|
+
|
|
98
|
+
--primary: #6644FF !important;
|
|
99
|
+
|
|
100
|
+
--primary-110: #5E41EC !important;
|
|
101
|
+
--primary-125: #523DCF !important;
|
|
102
|
+
--primary-150: #3E369F !important;
|
|
103
|
+
--primary-175: #2B3070 !important;
|
|
104
|
+
--primary-190: #1F2C53 !important;
|
|
105
|
+
|
|
106
|
+
--v-button-background-color: #6644FF !important;
|
|
107
|
+
--v-button-background-color-hover: #5E41EC !important;
|
|
108
|
+
--sidebar-detail-color-active: #5E41EC !important;
|
|
93
109
|
}
|
|
94
110
|
width: full
|
|
95
111
|
|
|
@@ -105,7 +121,7 @@ fields:
|
|
|
105
121
|
|
|
106
122
|
- field: module_bar
|
|
107
123
|
interface: system-modules
|
|
108
|
-
special: json
|
|
124
|
+
special: cast-json
|
|
109
125
|
|
|
110
126
|
- field: security_divider
|
|
111
127
|
interface: presentation-divider
|
|
@@ -281,7 +297,7 @@ fields:
|
|
|
281
297
|
]
|
|
282
298
|
width: full
|
|
283
299
|
template: '{{key}}'
|
|
284
|
-
special: json
|
|
300
|
+
special: cast-json
|
|
285
301
|
width: full
|
|
286
302
|
|
|
287
303
|
- field: map_divider
|
|
@@ -306,7 +322,7 @@ fields:
|
|
|
306
322
|
|
|
307
323
|
- field: basemaps
|
|
308
324
|
interface: list
|
|
309
|
-
special: json
|
|
325
|
+
special: cast-json
|
|
310
326
|
options:
|
|
311
327
|
template: '{{name}}'
|
|
312
328
|
fields:
|
|
@@ -362,3 +378,6 @@ fields:
|
|
|
362
378
|
interface: input
|
|
363
379
|
options:
|
|
364
380
|
placeholder: $t:fields.directus_settings.attribution_placeholder
|
|
381
|
+
|
|
382
|
+
- field: translation_strings
|
|
383
|
+
hidden: true
|
|
@@ -50,7 +50,7 @@ fields:
|
|
|
50
50
|
|
|
51
51
|
- field: tags
|
|
52
52
|
interface: tags
|
|
53
|
-
special: json
|
|
53
|
+
special: cast-json
|
|
54
54
|
width: full
|
|
55
55
|
options:
|
|
56
56
|
iconRight: local_offer
|
|
@@ -93,7 +93,7 @@ fields:
|
|
|
93
93
|
- field: email_notifications
|
|
94
94
|
interface: boolean
|
|
95
95
|
width: half
|
|
96
|
-
special: boolean
|
|
96
|
+
special: cast-boolean
|
|
97
97
|
|
|
98
98
|
- field: admin_divider
|
|
99
99
|
interface: presentation-divider
|
|
@@ -60,12 +60,12 @@ fields:
|
|
|
60
60
|
interface: boolean
|
|
61
61
|
options:
|
|
62
62
|
label: $t:fields.directus_webhooks.data_label
|
|
63
|
-
special: boolean
|
|
63
|
+
special: cast-boolean
|
|
64
64
|
width: half
|
|
65
65
|
display: boolean
|
|
66
66
|
|
|
67
67
|
- field: headers
|
|
68
|
-
special: json
|
|
68
|
+
special: cast-json
|
|
69
69
|
interface: list
|
|
70
70
|
options:
|
|
71
71
|
template: '{{ header }}: {{ value }}'
|
|
@@ -105,7 +105,7 @@ fields:
|
|
|
105
105
|
value: update
|
|
106
106
|
- text: $t:delete_label
|
|
107
107
|
value: delete
|
|
108
|
-
special: csv
|
|
108
|
+
special: cast-csv
|
|
109
109
|
width: full
|
|
110
110
|
display: labels
|
|
111
111
|
display_options:
|
|
@@ -129,7 +129,7 @@ fields:
|
|
|
129
129
|
|
|
130
130
|
- field: collections
|
|
131
131
|
interface: system-collections
|
|
132
|
-
special: csv
|
|
132
|
+
special: cast-csv
|
|
133
133
|
width: full
|
|
134
134
|
display: labels
|
|
135
135
|
display_options:
|
package/dist/env.js
CHANGED
|
@@ -17,6 +17,7 @@ const utils_1 = require("@directus/shared/utils");
|
|
|
17
17
|
const acceptedEnvTypes = ['string', 'number', 'regex', 'array'];
|
|
18
18
|
const defaults = {
|
|
19
19
|
CONFIG_PATH: path_1.default.resolve(process.cwd(), '.env'),
|
|
20
|
+
HOST: '0.0.0.0',
|
|
20
21
|
PORT: 8055,
|
|
21
22
|
PUBLIC_URL: '/',
|
|
22
23
|
MAX_PAYLOAD_SIZE: '100kb',
|
|
@@ -34,8 +35,8 @@ const defaults = {
|
|
|
34
35
|
REFRESH_TOKEN_COOKIE_SAME_SITE: 'lax',
|
|
35
36
|
REFRESH_TOKEN_COOKIE_NAME: 'directus_refresh_token',
|
|
36
37
|
ROOT_REDIRECT: './admin',
|
|
37
|
-
CORS_ENABLED:
|
|
38
|
-
CORS_ORIGIN:
|
|
38
|
+
CORS_ENABLED: false,
|
|
39
|
+
CORS_ORIGIN: false,
|
|
39
40
|
CORS_METHODS: 'GET,POST,PATCH,DELETE',
|
|
40
41
|
CORS_ALLOWED_HEADERS: 'Content-Type,Authorization',
|
|
41
42
|
CORS_EXPOSED_HEADERS: 'Content-Range',
|
|
@@ -64,11 +65,15 @@ const defaults = {
|
|
|
64
65
|
ASSETS_TRANSFORM_MAX_OPERATIONS: 5,
|
|
65
66
|
IP_TRUST_PROXY: true,
|
|
66
67
|
IP_CUSTOM_HEADER: false,
|
|
68
|
+
IMPORT_IP_DENY_LIST: '0.0.0.0',
|
|
67
69
|
SERVE_APP: true,
|
|
70
|
+
RELATIONAL_BATCH_SIZE: 25000,
|
|
71
|
+
EXPORT_BATCH_SIZE: 5000,
|
|
68
72
|
};
|
|
69
73
|
// Allows us to force certain environment variable into a type, instead of relying
|
|
70
74
|
// on the auto-parsed type in processValues. ref #3705
|
|
71
75
|
const typeMap = {
|
|
76
|
+
HOST: 'string',
|
|
72
77
|
PORT: 'string',
|
|
73
78
|
DB_NAME: 'string',
|
|
74
79
|
DB_USER: 'string',
|
|
@@ -76,6 +81,7 @@ const typeMap = {
|
|
|
76
81
|
DB_DATABASE: 'string',
|
|
77
82
|
DB_PORT: 'number',
|
|
78
83
|
DB_EXCLUDE_TABLES: 'array',
|
|
84
|
+
IMPORT_IP_DENY_LIST: 'array',
|
|
79
85
|
};
|
|
80
86
|
let env = {
|
|
81
87
|
...defaults,
|
|
@@ -229,6 +235,7 @@ function processValues(env) {
|
|
|
229
235
|
}
|
|
230
236
|
if (String(value).includes(',')) {
|
|
231
237
|
env[key] = (0, utils_1.toArray)(value);
|
|
238
|
+
continue;
|
|
232
239
|
}
|
|
233
240
|
// Try converting the value to a JS object. This allows JSON objects to be passed for nested
|
|
234
241
|
// config flags, or custom param names (that aren't camelCased)
|