@directus/api 14.1.1 → 14.1.2

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.
@@ -120,6 +120,8 @@ fields:
120
120
  - field: theme_light_overrides
121
121
  width: full
122
122
  interface: system-theme-overrides
123
+ options:
124
+ appearance: light
123
125
  group: theming_group
124
126
  special:
125
127
  - cast-json
@@ -134,6 +136,8 @@ fields:
134
136
  - field: theme_dark_overrides
135
137
  width: full
136
138
  interface: system-theme-overrides
139
+ options:
140
+ appearance: dark
137
141
  group: theming_group
138
142
  special:
139
143
  - cast-json
@@ -124,6 +124,8 @@ fields:
124
124
  - field: theme_light_overrides
125
125
  width: full
126
126
  interface: system-theme-overrides
127
+ options:
128
+ appearance: light
127
129
  special:
128
130
  - cast-json
129
131
 
@@ -137,6 +139,8 @@ fields:
137
139
  - field: theme_dark_overrides
138
140
  width: full
139
141
  interface: system-theme-overrides
142
+ options:
143
+ appearance: dark
140
144
  special:
141
145
  - cast-json
142
146
 
@@ -86,9 +86,6 @@ function parsePermissions(permissions) {
86
86
  if (permission.permissions && typeof permission.permissions === 'string') {
87
87
  permission.permissions = parseJSON(permission.permissions);
88
88
  }
89
- else if (permission.permissions === null) {
90
- permission.permissions = {};
91
- }
92
89
  if (permission.validation && typeof permission.validation === 'string') {
93
90
  permission.validation = parseJSON(permission.validation);
94
91
  }
@@ -55,7 +55,8 @@ export function getSnapshotDiff(current, after) {
55
55
  }),
56
56
  ...after.relations
57
57
  .filter((afterRelation) => {
58
- const currentRelation = current.relations.find((currentRelation) => currentRelation.collection === afterRelation.collection && afterRelation.field === currentRelation.field);
58
+ const currentRelation = current.relations.find((currentRelation) => currentRelation.collection === afterRelation.collection &&
59
+ afterRelation.field === currentRelation.field);
59
60
  return !!currentRelation === false;
60
61
  })
61
62
  .map((afterRelation) => ({
@@ -1,4 +1,4 @@
1
- import { flatten, intersection, isEmpty, merge, omit } from 'lodash-es';
1
+ import { flatten, intersection, isEqual, merge, omit } from 'lodash-es';
2
2
  export function mergePermissions(strategy, ...permissions) {
3
3
  const allPermissions = flatten(permissions);
4
4
  const mergedPermissions = allPermissions
@@ -27,11 +27,15 @@ export function mergePermission(strategy, currentPerm, newPerm) {
27
27
  };
28
28
  }
29
29
  else if (currentPerm.permissions) {
30
- permissions = {
31
- [logicalKey]: strategy === 'or'
32
- ? [currentPerm.permissions, newPerm.permissions].filter((p) => !isEmpty(p))
33
- : [currentPerm.permissions, newPerm.permissions],
34
- };
30
+ // Empty {} supersedes other permissions in _OR merge
31
+ if (strategy === 'or' && (isEqual(currentPerm.permissions, {}) || isEqual(newPerm.permissions, {}))) {
32
+ permissions = {};
33
+ }
34
+ else {
35
+ permissions = {
36
+ [logicalKey]: [currentPerm.permissions, newPerm.permissions],
37
+ };
38
+ }
35
39
  }
36
40
  else {
37
41
  permissions = {
@@ -49,11 +53,15 @@ export function mergePermission(strategy, currentPerm, newPerm) {
49
53
  };
50
54
  }
51
55
  else if (currentPerm.validation) {
52
- validation = {
53
- [logicalKey]: strategy === 'or'
54
- ? [currentPerm.validation, newPerm.validation].filter((p) => !isEmpty(p))
55
- : [currentPerm.validation, newPerm.validation],
56
- };
56
+ // Empty {} supersedes other validations in _OR merge
57
+ if (strategy === 'or' && (isEqual(currentPerm.validation, {}) || isEqual(newPerm.validation, {}))) {
58
+ validation = {};
59
+ }
60
+ else {
61
+ validation = {
62
+ [logicalKey]: [currentPerm.validation, newPerm.validation],
63
+ };
64
+ }
57
65
  }
58
66
  else {
59
67
  validation = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/api",
3
- "version": "14.1.1",
3
+ "version": "14.1.2",
4
4
  "description": "Directus is a real-time API and App dashboard for managing SQL database content",
5
5
  "keywords": [
6
6
  "directus",
@@ -138,28 +138,28 @@
138
138
  "stream-json": "1.7.5",
139
139
  "strip-bom-stream": "5.0.0",
140
140
  "tinypool": "0.8.1",
141
- "tsx": "3.12.7",
141
+ "tsx": "4.1.4",
142
142
  "uuid": "9.0.0",
143
143
  "uuid-validate": "0.0.3",
144
144
  "wellknown": "0.5.0",
145
145
  "ws": "8.14.2",
146
146
  "zod": "3.22.4",
147
147
  "zod-validation-error": "1.0.1",
148
- "@directus/app": "10.13.1",
148
+ "@directus/app": "10.13.2",
149
+ "@directus/errors": "0.2.0",
149
150
  "@directus/constants": "11.0.1",
150
151
  "@directus/extensions": "0.2.0",
151
152
  "@directus/extensions-sdk": "10.2.0",
152
- "@directus/errors": "0.2.0",
153
153
  "@directus/pressure": "1.0.13",
154
154
  "@directus/schema": "11.0.0",
155
- "@directus/storage": "10.0.7",
156
- "@directus/specs": "10.2.3",
155
+ "@directus/specs": "10.2.4",
157
156
  "@directus/storage-driver-azure": "10.0.14",
158
- "@directus/storage-driver-local": "10.0.14",
159
157
  "@directus/storage-driver-cloudinary": "10.0.14",
160
- "@directus/storage-driver-s3": "10.0.14",
161
158
  "@directus/storage-driver-gcs": "10.0.14",
159
+ "@directus/storage": "10.0.7",
160
+ "@directus/storage-driver-local": "10.0.14",
162
161
  "@directus/storage-driver-supabase": "1.0.6",
162
+ "@directus/storage-driver-s3": "10.0.14",
163
163
  "@directus/utils": "11.0.2",
164
164
  "@directus/validation": "0.0.9"
165
165
  },
@@ -202,13 +202,13 @@
202
202
  "@types/uuid-validate": "0.0.1",
203
203
  "@types/wellknown": "0.5.4",
204
204
  "@types/ws": "8.5.8",
205
- "@vitest/coverage-c8": "0.31.1",
205
+ "@vitest/coverage-v8": "0.34.6",
206
206
  "copyfiles": "2.4.1",
207
207
  "form-data": "4.0.0",
208
208
  "knex-mock-client": "2.0.0",
209
209
  "supertest": "6.3.3",
210
210
  "typescript": "5.2.2",
211
- "vitest": "0.31.1",
211
+ "vitest": "0.34.6",
212
212
  "@directus/random": "0.2.3",
213
213
  "@directus/tsconfig": "1.0.1",
214
214
  "@directus/types": "11.0.2"