directus 9.4.0 → 9.4.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/controllers/shares.js +2 -2
- package/dist/database/migrations/20211211A-add-shares.js +3 -2
- package/dist/database/system-data/fields/_defaults.yaml +2 -0
- package/dist/database/system-data/fields/settings.yaml +9 -0
- package/dist/database/system-data/fields/shares.yaml +4 -0
- package/dist/env.js +1 -1
- package/dist/services/authentication.js +3 -3
- package/dist/services/graphql.js +4 -0
- package/dist/services/shares.js +2 -2
- package/dist/utils/get-default-value.js +3 -1
- package/example.env +1 -1
- package/package.json +13 -13
|
@@ -104,7 +104,7 @@ router.get(`/info/:pk(${constants_1.UUID_REGEX})`, (0, async_handler_1.default)(
|
|
|
104
104
|
_or: [
|
|
105
105
|
{
|
|
106
106
|
date_start: {
|
|
107
|
-
_lte:
|
|
107
|
+
_lte: new Date().toISOString(),
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
{
|
|
@@ -118,7 +118,7 @@ router.get(`/info/:pk(${constants_1.UUID_REGEX})`, (0, async_handler_1.default)(
|
|
|
118
118
|
_or: [
|
|
119
119
|
{
|
|
120
120
|
date_end: {
|
|
121
|
-
_gte:
|
|
121
|
+
_gte: new Date().toISOString(),
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
124
|
{
|
|
@@ -11,8 +11,9 @@ async function up(knex) {
|
|
|
11
11
|
table.string('password');
|
|
12
12
|
table.uuid('user_created').references('id').inTable('directus_users').onDelete('SET NULL');
|
|
13
13
|
table.timestamp('date_created').defaultTo(knex.fn.now());
|
|
14
|
-
|
|
15
|
-
table.timestamp('
|
|
14
|
+
// This was changed after the migration went live to retroactively fix mysql5, see #10693
|
|
15
|
+
table.timestamp('date_start').nullable().defaultTo(null);
|
|
16
|
+
table.timestamp('date_end').nullable().defaultTo(null);
|
|
16
17
|
table.integer('times_used').defaultTo(0);
|
|
17
18
|
table.integer('max_uses');
|
|
18
19
|
});
|
|
@@ -343,3 +343,12 @@ fields:
|
|
|
343
343
|
type:
|
|
344
344
|
_neq: 'raster'
|
|
345
345
|
hidden: true
|
|
346
|
+
- field: attribution
|
|
347
|
+
name: $t:fields.directus_settings.attribution
|
|
348
|
+
type: string
|
|
349
|
+
schema:
|
|
350
|
+
is_nullable: true
|
|
351
|
+
meta:
|
|
352
|
+
interface: input
|
|
353
|
+
options:
|
|
354
|
+
placeholder: $t:fields.directus_settings.attribution_placeholder
|
|
@@ -32,15 +32,19 @@ fields:
|
|
|
32
32
|
iconRight: lock
|
|
33
33
|
masked: true
|
|
34
34
|
width: half
|
|
35
|
+
note: $t:shared_leave_blank_for_unlimited
|
|
35
36
|
|
|
36
37
|
- field: date_start
|
|
37
38
|
width: half
|
|
39
|
+
note: $t:shared_leave_blank_for_unlimited
|
|
38
40
|
|
|
39
41
|
- field: date_end
|
|
40
42
|
width: half
|
|
43
|
+
note: $t:shared_leave_blank_for_unlimited
|
|
41
44
|
|
|
42
45
|
- field: max_uses
|
|
43
46
|
width: half
|
|
47
|
+
note: $t:shared_leave_blank_for_unlimited
|
|
44
48
|
|
|
45
49
|
- field: times_used
|
|
46
50
|
width: half
|
package/dist/env.js
CHANGED
|
@@ -20,7 +20,7 @@ const defaults = {
|
|
|
20
20
|
PORT: 8055,
|
|
21
21
|
PUBLIC_URL: '/',
|
|
22
22
|
MAX_PAYLOAD_SIZE: '100kb',
|
|
23
|
-
DB_EXCLUDE_TABLES: 'spatial_ref_sys',
|
|
23
|
+
DB_EXCLUDE_TABLES: 'spatial_ref_sys,sysdiagrams',
|
|
24
24
|
STORAGE_LOCATIONS: 'local',
|
|
25
25
|
STORAGE_LOCAL_DRIVER: 'local',
|
|
26
26
|
STORAGE_LOCAL_ROOT: './uploads',
|
|
@@ -206,12 +206,12 @@ class AuthenticationService {
|
|
|
206
206
|
.leftJoin('directus_shares AS d', 's.share', 'd.id')
|
|
207
207
|
.joinRaw('LEFT JOIN directus_roles AS r ON r.id IN (u.role, d.role)')
|
|
208
208
|
.where('s.token', refreshToken)
|
|
209
|
-
.andWhere('s.expires', '>=',
|
|
209
|
+
.andWhere('s.expires', '>=', new Date())
|
|
210
210
|
.andWhere((subQuery) => {
|
|
211
|
-
subQuery.whereNull('d.date_end').orWhere('d.date_end', '>=',
|
|
211
|
+
subQuery.whereNull('d.date_end').orWhere('d.date_end', '>=', new Date());
|
|
212
212
|
})
|
|
213
213
|
.andWhere((subQuery) => {
|
|
214
|
-
subQuery.whereNull('d.date_start').orWhere('d.date_start', '<=',
|
|
214
|
+
subQuery.whereNull('d.date_start').orWhere('d.date_start', '<=', new Date());
|
|
215
215
|
})
|
|
216
216
|
.first();
|
|
217
217
|
if (!record || (!record.share_id && !record.user_id)) {
|
package/dist/services/graphql.js
CHANGED
|
@@ -334,6 +334,8 @@ class GraphQLService {
|
|
|
334
334
|
}
|
|
335
335
|
for (const relation of schema[action].relations) {
|
|
336
336
|
if (relation.related_collection) {
|
|
337
|
+
if (SYSTEM_DENY_LIST.includes(relation.related_collection))
|
|
338
|
+
continue;
|
|
337
339
|
(_a = CollectionTypes[relation.collection]) === null || _a === void 0 ? void 0 : _a.addFields({
|
|
338
340
|
[relation.field]: {
|
|
339
341
|
type: CollectionTypes[relation.related_collection],
|
|
@@ -768,6 +770,8 @@ class GraphQLService {
|
|
|
768
770
|
}
|
|
769
771
|
for (const relation of schema.read.relations) {
|
|
770
772
|
if (relation.related_collection) {
|
|
773
|
+
if (SYSTEM_DENY_LIST.includes(relation.related_collection))
|
|
774
|
+
continue;
|
|
771
775
|
(_a = ReadableCollectionFilterTypes[relation.collection]) === null || _a === void 0 ? void 0 : _a.addFields({
|
|
772
776
|
[relation.field]: ReadableCollectionFilterTypes[relation.related_collection],
|
|
773
777
|
});
|
package/dist/services/shares.js
CHANGED
|
@@ -46,10 +46,10 @@ class SharesService extends items_1.ItemsService {
|
|
|
46
46
|
.from('directus_shares')
|
|
47
47
|
.where('id', payload.share)
|
|
48
48
|
.andWhere((subQuery) => {
|
|
49
|
-
subQuery.whereNull('date_end').orWhere('date_end', '>=',
|
|
49
|
+
subQuery.whereNull('date_end').orWhere('date_end', '>=', new Date());
|
|
50
50
|
})
|
|
51
51
|
.andWhere((subQuery) => {
|
|
52
|
-
subQuery.whereNull('date_start').orWhere('date_start', '<=',
|
|
52
|
+
subQuery.whereNull('date_start').orWhere('date_start', '<=', new Date());
|
|
53
53
|
})
|
|
54
54
|
.andWhere((subQuery) => {
|
|
55
55
|
subQuery.whereNull('max_uses').orWhere('max_uses', '>=', this.knex.ref('times_used'));
|
|
@@ -16,12 +16,14 @@ function getDefaultValue(column) {
|
|
|
16
16
|
return null;
|
|
17
17
|
if (defaultValue === 'NULL')
|
|
18
18
|
return null;
|
|
19
|
-
// Check if the default is wrapped in an extra pair of quotes, this happens in SQLite
|
|
19
|
+
// Check if the default is wrapped in an extra pair of quotes, this happens in SQLite / MariaDB
|
|
20
20
|
if (typeof defaultValue === 'string' &&
|
|
21
21
|
((defaultValue.startsWith(`'`) && defaultValue.endsWith(`'`)) ||
|
|
22
22
|
(defaultValue.startsWith(`"`) && defaultValue.endsWith(`"`)))) {
|
|
23
23
|
defaultValue = defaultValue.slice(1, -1);
|
|
24
24
|
}
|
|
25
|
+
if (defaultValue === '0000-00-00 00:00:00')
|
|
26
|
+
return null;
|
|
25
27
|
switch (type) {
|
|
26
28
|
case 'bigInteger':
|
|
27
29
|
case 'integer':
|
package/example.env
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "directus",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.1",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"homepage": "https://github.com/directus/directus#readme",
|
|
6
6
|
"description": "Directus is a real-time API and App dashboard for managing SQL database content.",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"prebuild": "npm run cleanup",
|
|
61
61
|
"build": "tsc --build && copyfiles \"src/**/*.*\" -e \"src/**/*.ts\" -u 1 dist",
|
|
62
62
|
"cleanup": "rimraf dist",
|
|
63
|
-
"dev": "cross-env NODE_ENV=development SERVE_APP=false ts-node-dev --files --transpile-only --respawn --watch \".env\" --inspect --exit-child -- src/start.ts",
|
|
63
|
+
"dev": "cross-env NODE_ENV=development SERVE_APP=false ts-node-dev --files --transpile-only --respawn --watch \".env\" --inspect=0 --exit-child -- src/start.ts",
|
|
64
64
|
"cli": "cross-env NODE_ENV=development SERVE_APP=false ts-node --script-mode --transpile-only src/cli/run.ts",
|
|
65
65
|
"test": "jest --coverage",
|
|
66
66
|
"test:watch": "jest --watchAll"
|
|
@@ -76,16 +76,16 @@
|
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@aws-sdk/client-ses": "^3.40.0",
|
|
79
|
-
"@directus/app": "9.4.
|
|
80
|
-
"@directus/drive": "9.4.
|
|
81
|
-
"@directus/drive-azure": "9.4.
|
|
82
|
-
"@directus/drive-gcs": "9.4.
|
|
83
|
-
"@directus/drive-s3": "9.4.
|
|
84
|
-
"@directus/extensions-sdk": "9.4.
|
|
85
|
-
"@directus/format-title": "9.4.
|
|
86
|
-
"@directus/schema": "9.4.
|
|
87
|
-
"@directus/shared": "9.4.
|
|
88
|
-
"@directus/specs": "9.4.
|
|
79
|
+
"@directus/app": "9.4.1",
|
|
80
|
+
"@directus/drive": "9.4.1",
|
|
81
|
+
"@directus/drive-azure": "9.4.1",
|
|
82
|
+
"@directus/drive-gcs": "9.4.1",
|
|
83
|
+
"@directus/drive-s3": "9.4.1",
|
|
84
|
+
"@directus/extensions-sdk": "9.4.1",
|
|
85
|
+
"@directus/format-title": "9.4.1",
|
|
86
|
+
"@directus/schema": "9.4.1",
|
|
87
|
+
"@directus/shared": "9.4.1",
|
|
88
|
+
"@directus/specs": "9.4.1",
|
|
89
89
|
"@godaddy/terminus": "^4.9.0",
|
|
90
90
|
"@rollup/plugin-alias": "^3.1.2",
|
|
91
91
|
"@rollup/plugin-virtual": "^2.0.3",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"sqlite3": "^5.0.2",
|
|
170
170
|
"tedious": "^13.0.0"
|
|
171
171
|
},
|
|
172
|
-
"gitHead": "
|
|
172
|
+
"gitHead": "4991ba858bdde8bdf03aee475d77a218da6e46ab",
|
|
173
173
|
"devDependencies": {
|
|
174
174
|
"@types/async": "3.2.10",
|
|
175
175
|
"@types/atob": "2.1.2",
|