@directus/api 33.1.0 → 33.1.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.
@@ -25,6 +25,7 @@ function formatVisualElement(att) {
25
25
  const display = escapeAngleBrackets(att.display);
26
26
  return `### ${collection}/${item} — "${display}"
27
27
  Editable fields: ${fields}
28
+ To update: items tool with collection="${collection}", keys=["${item}"], action="update"
28
29
  \`\`\`json
29
30
  ${escapeAngleBrackets(JSON.stringify(att.snapshot, null, 2))}
30
31
  \`\`\``;
@@ -106,6 +107,10 @@ ${itemLines}`);
106
107
  ## Selected Elements
107
108
  The user selected these elements for editing in the visual editor.
108
109
 
110
+ IMPORTANT: For visual editor elements, ALWAYS use the items tool:
111
+ - To UPDATE: items tool with action: 'update', collection, keys, and data
112
+ - NEVER use form-values tools for visual editor elements
113
+
109
114
  ${elementLines}
110
115
  </visual_editing>`);
111
116
  }
package/dist/app.js CHANGED
@@ -103,7 +103,10 @@ export default async function createApp() {
103
103
  const app = express();
104
104
  app.disable('x-powered-by');
105
105
  app.set('trust proxy', env['IP_TRUST_PROXY']);
106
- app.set('query parser', (str) => qs.parse(str, { depth: Number(env['QUERYSTRING_MAX_PARSE_DEPTH']) }));
106
+ app.set('query parser', (str) => qs.parse(str, {
107
+ depth: Number(env['QUERYSTRING_MAX_PARSE_DEPTH']),
108
+ arrayLimit: Number(env['QUERYSTRING_ARRAY_LIMIT']),
109
+ }));
107
110
  if (env['PRESSURE_LIMITER_ENABLED']) {
108
111
  const sampleInterval = Number(env['PRESSURE_LIMITER_SAMPLE_INTERVAL']);
109
112
  if (Number.isNaN(sampleInterval) === true || Number.isFinite(sampleInterval) === false) {
@@ -80,10 +80,15 @@ function sanitizeFields(rawFields) {
80
80
  if (!rawFields)
81
81
  return null;
82
82
  let fields = [];
83
- if (typeof rawFields === 'string')
83
+ if (typeof rawFields === 'string') {
84
84
  fields = rawFields.split(',');
85
- else if (Array.isArray(rawFields))
85
+ }
86
+ else if (Array.isArray(rawFields)) {
86
87
  fields = rawFields;
88
+ }
89
+ else {
90
+ throw new InvalidQueryError({ reason: '"fields" must be a string or array' });
91
+ }
87
92
  // Case where array item includes CSV (fe fields[]=id,name):
88
93
  fields = flatten(fields.map((field) => (field.includes(',') ? field.split(',') : field)));
89
94
  fields = fields.map((field) => field.trim());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/api",
3
- "version": "33.1.0",
3
+ "version": "33.1.1",
4
4
  "description": "Directus is a real-time API and App dashboard for managing SQL database content",
5
5
  "keywords": [
6
6
  "directus",
@@ -161,30 +161,30 @@
161
161
  "zod": "4.1.12",
162
162
  "zod-validation-error": "4.0.2",
163
163
  "@directus/ai": "1.1.0",
164
- "@directus/app": "15.1.0",
165
- "@directus/env": "5.5.0",
166
- "@directus/extensions": "3.0.17",
164
+ "@directus/app": "15.1.1",
167
165
  "@directus/constants": "14.0.0",
166
+ "@directus/env": "5.5.1",
167
+ "@directus/extensions": "3.0.17",
168
168
  "@directus/errors": "2.2.0",
169
+ "@directus/extensions-sdk": "17.0.7",
169
170
  "@directus/extensions-registry": "3.0.17",
170
171
  "@directus/memory": "3.1.0",
171
172
  "@directus/format-title": "12.1.1",
172
173
  "@directus/pressure": "3.0.15",
173
174
  "@directus/schema": "13.0.5",
174
- "@directus/extensions-sdk": "17.0.6",
175
175
  "@directus/schema-builder": "0.0.12",
176
176
  "@directus/specs": "12.0.0",
177
177
  "@directus/storage": "12.0.3",
178
178
  "@directus/storage-driver-azure": "12.0.15",
179
- "@directus/storage-driver-s3": "12.1.1",
180
- "@directus/storage-driver-gcs": "12.0.15",
179
+ "@directus/storage-driver-cloudinary": "12.0.15",
181
180
  "@directus/storage-driver-local": "12.0.3",
181
+ "@directus/storage-driver-s3": "12.1.1",
182
182
  "@directus/storage-driver-supabase": "3.0.15",
183
- "@directus/system-data": "4.1.0",
183
+ "@directus/storage-driver-gcs": "12.0.15",
184
184
  "@directus/utils": "13.2.0",
185
- "directus": "11.15.0",
185
+ "@directus/system-data": "4.1.0",
186
186
  "@directus/validation": "2.0.15",
187
- "@directus/storage-driver-cloudinary": "12.0.15"
187
+ "directus": "11.15.1"
188
188
  },
189
189
  "devDependencies": {
190
190
  "@directus/tsconfig": "3.0.0",