@nocobase/cli 2.2.0-beta.14 → 2.2.0-beta.16

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.
@@ -1,12 +1,14 @@
1
1
  add_header Cache-Control "public" always;
2
+ add_header Content-Security-Policy "sandbox" always;
2
3
  add_header X-Content-Type-Options "nosniff" always;
3
4
 
4
5
  access_log off;
5
6
  autoindex off;
6
7
 
7
8
  # Force potentially renderable uploaded files to download.
8
- location ~* \.(?:htm|html|svg|svgz|xhtml)$ {
9
+ location ~* \.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt)$ {
9
10
  add_header Cache-Control "public" always;
11
+ add_header Content-Security-Policy "sandbox" always;
10
12
  add_header X-Content-Type-Options "nosniff" always;
11
13
  add_header Content-Disposition "attachment" always;
12
14
  }
@@ -16,6 +18,7 @@ location ~* \.md$ {
16
18
  default_type text/markdown;
17
19
 
18
20
  add_header Cache-Control "public" always;
21
+ add_header Content-Security-Policy "sandbox" always;
19
22
  add_header X-Content-Type-Options "nosniff" always;
20
23
  add_header Content-Disposition "inline" always;
21
24
  }
@@ -199,6 +199,13 @@ async function createMultipartBody(flags, operation) {
199
199
  if (value === undefined) {
200
200
  continue;
201
201
  }
202
+ if (Array.isArray(value)) {
203
+ for (const item of value) {
204
+ formData.append(parameter.name, typeof item === 'object' ? JSON.stringify(item) : String(item));
205
+ }
206
+ hasValues = hasValues || value.length > 0;
207
+ continue;
208
+ }
202
209
  formData.append(parameter.name, typeof value === 'object' ? JSON.stringify(value) : String(value));
203
210
  hasValues = true;
204
211
  }
@@ -1015,15 +1015,17 @@ function renderNginxLocationTemplate(context) {
1015
1015
  default_type text/markdown;
1016
1016
  add_header Cache-Control "public";
1017
1017
  add_header Content-Disposition "inline";
1018
+ add_header Content-Security-Policy "sandbox" always;
1018
1019
  add_header X-Content-Type-Options "nosniff" always;
1019
1020
  access_log off;
1020
1021
  autoindex off;
1021
1022
  }
1022
1023
 
1023
- location ~* ^${context.appPublicPath}storage/uploads/(.*\\.(?:htm|html|svg|svgz|xhtml|pdf))$ {
1024
+ location ~* ^${context.appPublicPath}storage/uploads/(.*\\.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt))$ {
1024
1025
  alias ${context.uploadsPath}/$1;
1025
1026
  add_header Cache-Control "public";
1026
1027
  add_header Content-Disposition "attachment" always;
1028
+ add_header Content-Security-Policy "sandbox" always;
1027
1029
  add_header X-Content-Type-Options "nosniff" always;
1028
1030
  access_log off;
1029
1031
  autoindex off;
@@ -1032,6 +1034,7 @@ function renderNginxLocationTemplate(context) {
1032
1034
  location ${context.appPublicPath}storage/uploads/ {
1033
1035
  alias ${context.uploadsPath}/;
1034
1036
  add_header Cache-Control "public";
1037
+ add_header Content-Security-Policy "sandbox" always;
1035
1038
  add_header X-Content-Type-Options "nosniff" always;
1036
1039
  access_log off;
1037
1040
  autoindex off;
@@ -1152,10 +1155,14 @@ function renderCaddyAppTemplate(siteAddress, context, publicDir) {
1152
1155
  `${siteAddress} {`,
1153
1156
  ` encode zstd gzip${rootRedirectBlock}${appPublicPathRedirectBlock}${modernClientRedirectBlock}${shorthandModernClientRedirectBlock}`,
1154
1157
  '',
1158
+ ' @activeUploadedContent path_regexp activeUploadedContent (?i)\\.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt)$',
1159
+ '',
1155
1160
  ` handle_path ${uploadsPathMatcher} {`,
1156
1161
  ` root * ${context.uploadsPath}`,
1157
1162
  ' header Cache-Control public',
1163
+ ' header Content-Security-Policy sandbox',
1158
1164
  ' header X-Content-Type-Options nosniff',
1165
+ ' header @activeUploadedContent Content-Disposition attachment',
1159
1166
  ' file_server',
1160
1167
  ' }',
1161
1168
  '',
@@ -1,6 +1,15 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import path from 'node:path';
2
10
  export function toKebabCase(value) {
3
11
  return value
12
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
4
13
  .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
5
14
  .replace(/[^a-zA-Z0-9]+/g, '-')
6
15
  .replace(/-+/g, '-')
@@ -202,6 +202,117 @@
202
202
  }
203
203
  }
204
204
  },
205
+ "ai": {
206
+ "name": "ai",
207
+ "description": "Discover LLM providers and manage LLM services and AI employees.",
208
+ "include": true,
209
+ "resources": {
210
+ "includes": ["ai", "llmServices", "aiEmployees"],
211
+ "excludes": [],
212
+ "overrides": {
213
+ "ai": {
214
+ "name": "llm-providers",
215
+ "description": "Discover providers and models and test unsaved LLM settings.",
216
+ "topLevel": false,
217
+ "operations": {
218
+ "includes": [
219
+ "ai:listLLMProviders",
220
+ "ai:listProviderModels",
221
+ "ai:testFlight",
222
+ "ai:listModels",
223
+ "ai:listLLMServices"
224
+ ]
225
+ }
226
+ },
227
+ "llmServices": {
228
+ "name": "llm-services",
229
+ "description": "Manage saved LLM service configurations.",
230
+ "topLevel": false,
231
+ "operations": {
232
+ "includes": [
233
+ "llmServices:list",
234
+ "llmServices:get",
235
+ "llmServices:create",
236
+ "llmServices:update",
237
+ "llmServices:destroy"
238
+ ]
239
+ }
240
+ },
241
+ "aiEmployees": {
242
+ "name": "employees",
243
+ "description": "Manage AI employees.",
244
+ "topLevel": false,
245
+ "operations": {
246
+ "includes": [
247
+ "aiEmployees:list",
248
+ "aiEmployees:get",
249
+ "aiEmployees:create",
250
+ "aiEmployees:update",
251
+ "aiEmployees:destroy"
252
+ ]
253
+ }
254
+ }
255
+ }
256
+ }
257
+ },
258
+ "kb": {
259
+ "name": "kb",
260
+ "description": "Manage vector databases, knowledge bases, documents, vectorization, and retrieval tests.",
261
+ "include": true,
262
+ "resources": {
263
+ "includes": ["aiVectorDatabases", "aiKnowledgeBase", "aiKnowledgeBaseDocs"],
264
+ "excludes": [],
265
+ "overrides": {
266
+ "aiVectorDatabases": {
267
+ "name": "vector-databases",
268
+ "description": "Manage vector database connections.",
269
+ "topLevel": false,
270
+ "operations": {
271
+ "includes": [
272
+ "aiVectorDatabases:listProviders",
273
+ "aiVectorDatabases:testConnection",
274
+ "aiVectorDatabases:list",
275
+ "aiVectorDatabases:get",
276
+ "aiVectorDatabases:create",
277
+ "aiVectorDatabases:update",
278
+ "aiVectorDatabases:destroy"
279
+ ]
280
+ }
281
+ },
282
+ "aiKnowledgeBase": {
283
+ "name": "kb",
284
+ "segments": ["kb"],
285
+ "description": "Manage knowledge bases and retrieval tests.",
286
+ "topLevel": true,
287
+ "operations": {
288
+ "includes": [
289
+ "aiKnowledgeBase:list",
290
+ "aiKnowledgeBase:get",
291
+ "aiKnowledgeBase:create",
292
+ "aiKnowledgeBase:update",
293
+ "aiKnowledgeBase:destroy",
294
+ "aiKnowledgeBase:runHitTest",
295
+ "aiKnowledgeBase:listExternalVectorStoreProviders"
296
+ ]
297
+ }
298
+ },
299
+ "aiKnowledgeBaseDocs": {
300
+ "name": "documents",
301
+ "description": "Manage knowledge base documents and vectorization.",
302
+ "topLevel": false,
303
+ "operations": {
304
+ "includes": [
305
+ "aiKnowledgeBaseDocs:list",
306
+ "aiKnowledgeBaseDocs:get",
307
+ "aiKnowledgeBaseDocs:upload",
308
+ "aiKnowledgeBaseDocs:vectorization",
309
+ "aiKnowledgeBaseDocs:destroy"
310
+ ]
311
+ }
312
+ }
313
+ }
314
+ }
315
+ },
205
316
  "flow-engine": {
206
317
  "name": "flow-engine",
207
318
  "description": "Manage flow surface composition, configuration, layout, and mutation APIs.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "2.2.0-beta.14",
3
+ "version": "2.2.0-beta.16",
4
4
  "description": "NocoBase Command Line Tool",
5
5
  "type": "module",
6
6
  "main": "dist/generated/command-registry.js",
@@ -144,5 +144,5 @@
144
144
  "type": "git",
145
145
  "url": "git+https://github.com/nocobase/nocobase.git"
146
146
  },
147
- "gitHead": "1ef021f3ce0a84469e40f181a19551a50b6f850c"
147
+ "gitHead": "49d9bd2e21122eab9435f128375828b8c5bb4c07"
148
148
  }