@nocobase/plugin-data-source-main 2.0.0-alpha.9 → 2.1.0-alpha.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.
Files changed (33) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/externalVersion.js +8 -6
  3. package/dist/locale/de-DE.json +46 -2
  4. package/dist/locale/en-US.json +46 -2
  5. package/dist/locale/es-ES.json +48 -0
  6. package/dist/locale/fr-FR.json +48 -0
  7. package/dist/locale/hu-HU.json +48 -0
  8. package/dist/locale/id-ID.json +48 -0
  9. package/dist/locale/it-IT.json +46 -2
  10. package/dist/locale/ja-JP.json +45 -1
  11. package/dist/locale/ko-KR.json +48 -0
  12. package/dist/locale/nl-NL.json +46 -2
  13. package/dist/locale/pt-BR.json +48 -0
  14. package/dist/locale/ru-RU.json +48 -0
  15. package/dist/locale/tr-TR.json +48 -0
  16. package/dist/locale/uk-UA.json +48 -0
  17. package/dist/locale/vi-VN.json +48 -0
  18. package/dist/locale/zh-CN.json +46 -2
  19. package/dist/locale/zh-TW.json +48 -0
  20. package/dist/server/{hooks/afterCreateForReverseField.d.ts → constants.d.ts} +1 -4
  21. package/dist/server/{hooks/afterCreateForReverseField.js → constants.js} +6 -16
  22. package/dist/server/hooks/afterCreateForForeignKeyField.js +5 -3
  23. package/dist/server/hooks/index.d.ts +0 -1
  24. package/dist/server/hooks/index.js +0 -2
  25. package/dist/server/migrations/20251214100636-id2integer.d.ts +14 -0
  26. package/dist/server/migrations/20251214100636-id2integer.js +48 -0
  27. package/dist/server/models/collection.js +16 -10
  28. package/dist/server/resourcers/main-data-source.d.ts +17 -0
  29. package/dist/server/resourcers/main-data-source.js +52 -0
  30. package/dist/server/resourcers/views.js +1 -1
  31. package/dist/server/server.d.ts +1 -0
  32. package/dist/server/server.js +138 -52
  33. package/package.json +5 -2
@@ -0,0 +1,48 @@
1
+ {
2
+ "any.required": "{{label}} is required",
3
+ "date.base": "{{label}} must be a valid date",
4
+ "date.format": "{{label}} must be in {{format}} format",
5
+ "date.greater": "{{label}} must be greater than {{limit}}",
6
+ "date.less": "{{label}} must be less than {{limit}}",
7
+ "date.max": "{{label}} must be less than or equal to {{limit}}",
8
+ "date.min": "{{label}} must be greater than or equal to {{limit}}",
9
+ "field-is-depended-on-by-other": "Can not delete field \"{{fieldName}}\" in \"{{fieldCollectionName}}\", it is used by field \"{{dependedFieldName}}\" in \"{{dependedFieldCollectionName}}\" as \"{{dependedFieldAs}}\"",
10
+ "field-name-exists": "Field name \"{{name}}\" already exists in collection \"{{collectionName}}\"",
11
+ "number.base": "{{label}} must be a number",
12
+ "number.float": "{{label}} must be a float or double",
13
+ "number.greater": "{{label}} must be greater than {{limit}}",
14
+ "number.integer": "{{label}} must be an integer",
15
+ "number.less": "{{label}} must be less than {{limit}}",
16
+ "number.max": "{{label}} must be less than or equal to {{limit}}",
17
+ "number.min": "{{label}} must be greater than or equal to {{limit}}",
18
+ "number.multiple": "{{label}} must be a multiple of {{multiple}}",
19
+ "number.negative": "{{label}} must be a negative number",
20
+ "number.port": "{{label}} must be a valid port",
21
+ "number.positive": "{{label}} must be a positive number",
22
+ "number.precision": "{{label}} must not have more than {{limit}} decimal places",
23
+ "number.unsafe": "{{label}} must be a safe number",
24
+ "string.alphanum": "{{label}} must only contain alpha-numeric characters",
25
+ "string.base": "{{label}} must be a string",
26
+ "string.creditCard": "{{label}} must be a credit card",
27
+ "string.email": "{{label}} email address doesn’t meet the required format",
28
+ "string.empty": "{{label}} is not allowed to be empty",
29
+ "string.guid": "{{label}} must be a valid UUID",
30
+ "string.hex": "{{label}} must only contain hexadecimal characters",
31
+ "string.hostname": "{{label}} must be a valid hostname",
32
+ "string.isoDate": "{{label}} must be a valid ISO 8601 date",
33
+ "string.length": "{{label}} length must be {{limit}} characters long",
34
+ "string.lowercase": "{{label}} must only contain lowercase characters",
35
+ "string.max": "{{label}} length must be less than or equal to {{limit}} characters long",
36
+ "string.min": "{{label}} length must be at least {{limit}} characters long",
37
+ "string.pattern.base": "{{label}} with value \"{{value}}\" fails to match the required pattern: {{regex}}",
38
+ "string.pattern.invert.base": "{{label}} with value \"{{value}}\" matches the inverted pattern",
39
+ "string.pattern.invert.name": "{{label}} with value \"{{value}}\" matches the inverted {{name}} pattern",
40
+ "string.pattern.name": "{{label}} with value \"{{value}}\" fails to match the {{name}} pattern",
41
+ "string.regex": "{{label}} with value {{value}} fails to match the required pattern",
42
+ "string.token": "{{label}} must only contain alpha-numeric and underscore characters",
43
+ "string.trim": "{{label}} must not have leading or trailing whitespace",
44
+ "string.uppercase": "{{label}} must only contain uppercase characters",
45
+ "string.uri": "{{label}} must be a valid uri",
46
+ "string.uriCustomScheme": "{{label}} must be a valid uri with a scheme matching the {{scheme}} pattern",
47
+ "string.uriRelativeOnly": "{{label}} must be a valid relative uri"
48
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "any.required": "{{label}} is required",
3
+ "date.base": "{{label}} must be a valid date",
4
+ "date.format": "{{label}} must be in {{format}} format",
5
+ "date.greater": "{{label}} must be greater than {{limit}}",
6
+ "date.less": "{{label}} must be less than {{limit}}",
7
+ "date.max": "{{label}} must be less than or equal to {{limit}}",
8
+ "date.min": "{{label}} must be greater than or equal to {{limit}}",
9
+ "field-is-depended-on-by-other": "Невозможно удалить поле \"{{fieldName}}\" в \"{{fieldCollectionName}}\", оно используется полем \"{{dependedFieldName}}\" в \"{{dependedFieldCollectionName}}\" как \"{{dependedFieldAs}}\"",
10
+ "field-name-exists": "Имя поля \"{{name}}\" уже существует в коллекции \"{{collectionName}}\"",
11
+ "number.base": "{{label}} must be a number",
12
+ "number.float": "{{label}} must be a float or double",
13
+ "number.greater": "{{label}} must be greater than {{limit}}",
14
+ "number.integer": "{{label}} must be an integer",
15
+ "number.less": "{{label}} must be less than {{limit}}",
16
+ "number.max": "{{label}} must be less than or equal to {{limit}}",
17
+ "number.min": "{{label}} must be greater than or equal to {{limit}}",
18
+ "number.multiple": "{{label}} must be a multiple of {{multiple}}",
19
+ "number.negative": "{{label}} must be a negative number",
20
+ "number.port": "{{label}} must be a valid port",
21
+ "number.positive": "{{label}} must be a positive number",
22
+ "number.precision": "{{label}} must not have more than {{limit}} decimal places",
23
+ "number.unsafe": "{{label}} must be a safe number",
24
+ "string.alphanum": "{{label}} must only contain alpha-numeric characters",
25
+ "string.base": "{{label}} must be a string",
26
+ "string.creditCard": "{{label}} must be a credit card",
27
+ "string.email": "{{label}} email address doesn’t meet the required format",
28
+ "string.empty": "{{label}} is not allowed to be empty",
29
+ "string.guid": "{{label}} must be a valid UUID",
30
+ "string.hex": "{{label}} must only contain hexadecimal characters",
31
+ "string.hostname": "{{label}} must be a valid hostname",
32
+ "string.isoDate": "{{label}} must be a valid ISO 8601 date",
33
+ "string.length": "{{label}} length must be {{limit}} characters long",
34
+ "string.lowercase": "{{label}} must only contain lowercase characters",
35
+ "string.max": "{{label}} length must be less than or equal to {{limit}} characters long",
36
+ "string.min": "{{label}} length must be at least {{limit}} characters long",
37
+ "string.pattern.base": "{{label}} with value \"{{value}}\" fails to match the required pattern: {{regex}}",
38
+ "string.pattern.invert.base": "{{label}} with value \"{{value}}\" matches the inverted pattern",
39
+ "string.pattern.invert.name": "{{label}} with value \"{{value}}\" matches the inverted {{name}} pattern",
40
+ "string.pattern.name": "{{label}} with value \"{{value}}\" fails to match the {{name}} pattern",
41
+ "string.regex": "{{label}} with value {{value}} fails to match the required pattern",
42
+ "string.token": "{{label}} must only contain alpha-numeric and underscore characters",
43
+ "string.trim": "{{label}} must not have leading or trailing whitespace",
44
+ "string.uppercase": "{{label}} must only contain uppercase characters",
45
+ "string.uri": "{{label}} must be a valid uri",
46
+ "string.uriCustomScheme": "{{label}} must be a valid uri with a scheme matching the {{scheme}} pattern",
47
+ "string.uriRelativeOnly": "{{label}} must be a valid relative uri"
48
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "any.required": "{{label}} is required",
3
+ "date.base": "{{label}} must be a valid date",
4
+ "date.format": "{{label}} must be in {{format}} format",
5
+ "date.greater": "{{label}} must be greater than {{limit}}",
6
+ "date.less": "{{label}} must be less than {{limit}}",
7
+ "date.max": "{{label}} must be less than or equal to {{limit}}",
8
+ "date.min": "{{label}} must be greater than or equal to {{limit}}",
9
+ "field-is-depended-on-by-other": "Can not delete field \"{{fieldName}}\" in \"{{fieldCollectionName}}\", it is used by field \"{{dependedFieldName}}\" in \"{{dependedFieldCollectionName}}\" as \"{{dependedFieldAs}}\"",
10
+ "field-name-exists": "Field name \"{{name}}\" already exists in collection \"{{collectionName}}\"",
11
+ "number.base": "{{label}} must be a number",
12
+ "number.float": "{{label}} must be a float or double",
13
+ "number.greater": "{{label}} must be greater than {{limit}}",
14
+ "number.integer": "{{label}} must be an integer",
15
+ "number.less": "{{label}} must be less than {{limit}}",
16
+ "number.max": "{{label}} must be less than or equal to {{limit}}",
17
+ "number.min": "{{label}} must be greater than or equal to {{limit}}",
18
+ "number.multiple": "{{label}} must be a multiple of {{multiple}}",
19
+ "number.negative": "{{label}} must be a negative number",
20
+ "number.port": "{{label}} must be a valid port",
21
+ "number.positive": "{{label}} must be a positive number",
22
+ "number.precision": "{{label}} must not have more than {{limit}} decimal places",
23
+ "number.unsafe": "{{label}} must be a safe number",
24
+ "string.alphanum": "{{label}} must only contain alpha-numeric characters",
25
+ "string.base": "{{label}} must be a string",
26
+ "string.creditCard": "{{label}} must be a credit card",
27
+ "string.email": "{{label}} email address doesn’t meet the required format",
28
+ "string.empty": "{{label}} is not allowed to be empty",
29
+ "string.guid": "{{label}} must be a valid UUID",
30
+ "string.hex": "{{label}} must only contain hexadecimal characters",
31
+ "string.hostname": "{{label}} must be a valid hostname",
32
+ "string.isoDate": "{{label}} must be a valid ISO 8601 date",
33
+ "string.length": "{{label}} length must be {{limit}} characters long",
34
+ "string.lowercase": "{{label}} must only contain lowercase characters",
35
+ "string.max": "{{label}} length must be less than or equal to {{limit}} characters long",
36
+ "string.min": "{{label}} length must be at least {{limit}} characters long",
37
+ "string.pattern.base": "{{label}} with value \"{{value}}\" fails to match the required pattern: {{regex}}",
38
+ "string.pattern.invert.base": "{{label}} with value \"{{value}}\" matches the inverted pattern",
39
+ "string.pattern.invert.name": "{{label}} with value \"{{value}}\" matches the inverted {{name}} pattern",
40
+ "string.pattern.name": "{{label}} with value \"{{value}}\" fails to match the {{name}} pattern",
41
+ "string.regex": "{{label}} with value {{value}} fails to match the required pattern",
42
+ "string.token": "{{label}} must only contain alpha-numeric and underscore characters",
43
+ "string.trim": "{{label}} must not have leading or trailing whitespace",
44
+ "string.uppercase": "{{label}} must only contain uppercase characters",
45
+ "string.uri": "{{label}} must be a valid uri",
46
+ "string.uriCustomScheme": "{{label}} must be a valid uri with a scheme matching the {{scheme}} pattern",
47
+ "string.uriRelativeOnly": "{{label}} must be a valid relative uri"
48
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "any.required": "{{label}} is required",
3
+ "date.base": "{{label}} must be a valid date",
4
+ "date.format": "{{label}} must be in {{format}} format",
5
+ "date.greater": "{{label}} must be greater than {{limit}}",
6
+ "date.less": "{{label}} must be less than {{limit}}",
7
+ "date.max": "{{label}} must be less than or equal to {{limit}}",
8
+ "date.min": "{{label}} must be greater than or equal to {{limit}}",
9
+ "field-is-depended-on-by-other": "Can not delete field \"{{fieldName}}\" in \"{{fieldCollectionName}}\", it is used by field \"{{dependedFieldName}}\" in \"{{dependedFieldCollectionName}}\" as \"{{dependedFieldAs}}\"",
10
+ "field-name-exists": "Field name \"{{name}}\" already exists in collection \"{{collectionName}}\"",
11
+ "number.base": "{{label}} must be a number",
12
+ "number.float": "{{label}} must be a float or double",
13
+ "number.greater": "{{label}} must be greater than {{limit}}",
14
+ "number.integer": "{{label}} must be an integer",
15
+ "number.less": "{{label}} must be less than {{limit}}",
16
+ "number.max": "{{label}} must be less than or equal to {{limit}}",
17
+ "number.min": "{{label}} must be greater than or equal to {{limit}}",
18
+ "number.multiple": "{{label}} must be a multiple of {{multiple}}",
19
+ "number.negative": "{{label}} must be a negative number",
20
+ "number.port": "{{label}} must be a valid port",
21
+ "number.positive": "{{label}} must be a positive number",
22
+ "number.precision": "{{label}} must not have more than {{limit}} decimal places",
23
+ "number.unsafe": "{{label}} must be a safe number",
24
+ "string.alphanum": "{{label}} must only contain alpha-numeric characters",
25
+ "string.base": "{{label}} must be a string",
26
+ "string.creditCard": "{{label}} must be a credit card",
27
+ "string.email": "{{label}} email address doesn’t meet the required format",
28
+ "string.empty": "{{label}} is not allowed to be empty",
29
+ "string.guid": "{{label}} must be a valid UUID",
30
+ "string.hex": "{{label}} must only contain hexadecimal characters",
31
+ "string.hostname": "{{label}} must be a valid hostname",
32
+ "string.isoDate": "{{label}} must be a valid ISO 8601 date",
33
+ "string.length": "{{label}} length must be {{limit}} characters long",
34
+ "string.lowercase": "{{label}} must only contain lowercase characters",
35
+ "string.max": "{{label}} length must be less than or equal to {{limit}} characters long",
36
+ "string.min": "{{label}} length must be at least {{limit}} characters long",
37
+ "string.pattern.base": "{{label}} with value \"{{value}}\" fails to match the required pattern: {{regex}}",
38
+ "string.pattern.invert.base": "{{label}} with value \"{{value}}\" matches the inverted pattern",
39
+ "string.pattern.invert.name": "{{label}} with value \"{{value}}\" matches the inverted {{name}} pattern",
40
+ "string.pattern.name": "{{label}} with value \"{{value}}\" fails to match the {{name}} pattern",
41
+ "string.regex": "{{label}} with value {{value}} fails to match the required pattern",
42
+ "string.token": "{{label}} must only contain alpha-numeric and underscore characters",
43
+ "string.trim": "{{label}} must not have leading or trailing whitespace",
44
+ "string.uppercase": "{{label}} must only contain uppercase characters",
45
+ "string.uri": "{{label}} must be a valid uri",
46
+ "string.uriCustomScheme": "{{label}} must be a valid uri with a scheme matching the {{scheme}} pattern",
47
+ "string.uriRelativeOnly": "{{label}} must be a valid relative uri"
48
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "any.required": "{{label}} is required",
3
+ "date.base": "{{label}} must be a valid date",
4
+ "date.format": "{{label}} must be in {{format}} format",
5
+ "date.greater": "{{label}} must be greater than {{limit}}",
6
+ "date.less": "{{label}} must be less than {{limit}}",
7
+ "date.max": "{{label}} must be less than or equal to {{limit}}",
8
+ "date.min": "{{label}} must be greater than or equal to {{limit}}",
9
+ "field-is-depended-on-by-other": "Can not delete field \"{{fieldName}}\" in \"{{fieldCollectionName}}\", it is used by field \"{{dependedFieldName}}\" in \"{{dependedFieldCollectionName}}\" as \"{{dependedFieldAs}}\"",
10
+ "field-name-exists": "Field name \"{{name}}\" already exists in collection \"{{collectionName}}\"",
11
+ "number.base": "{{label}} must be a number",
12
+ "number.float": "{{label}} must be a float or double",
13
+ "number.greater": "{{label}} must be greater than {{limit}}",
14
+ "number.integer": "{{label}} must be an integer",
15
+ "number.less": "{{label}} must be less than {{limit}}",
16
+ "number.max": "{{label}} must be less than or equal to {{limit}}",
17
+ "number.min": "{{label}} must be greater than or equal to {{limit}}",
18
+ "number.multiple": "{{label}} must be a multiple of {{multiple}}",
19
+ "number.negative": "{{label}} must be a negative number",
20
+ "number.port": "{{label}} must be a valid port",
21
+ "number.positive": "{{label}} must be a positive number",
22
+ "number.precision": "{{label}} must not have more than {{limit}} decimal places",
23
+ "number.unsafe": "{{label}} must be a safe number",
24
+ "string.alphanum": "{{label}} must only contain alpha-numeric characters",
25
+ "string.base": "{{label}} must be a string",
26
+ "string.creditCard": "{{label}} must be a credit card",
27
+ "string.email": "{{label}} email address doesn’t meet the required format",
28
+ "string.empty": "{{label}} is not allowed to be empty",
29
+ "string.guid": "{{label}} must be a valid UUID",
30
+ "string.hex": "{{label}} must only contain hexadecimal characters",
31
+ "string.hostname": "{{label}} must be a valid hostname",
32
+ "string.isoDate": "{{label}} must be a valid ISO 8601 date",
33
+ "string.length": "{{label}} length must be {{limit}} characters long",
34
+ "string.lowercase": "{{label}} must only contain lowercase characters",
35
+ "string.max": "{{label}} length must be less than or equal to {{limit}} characters long",
36
+ "string.min": "{{label}} length must be at least {{limit}} characters long",
37
+ "string.pattern.base": "{{label}} with value \"{{value}}\" fails to match the required pattern: {{regex}}",
38
+ "string.pattern.invert.base": "{{label}} with value \"{{value}}\" matches the inverted pattern",
39
+ "string.pattern.invert.name": "{{label}} with value \"{{value}}\" matches the inverted {{name}} pattern",
40
+ "string.pattern.name": "{{label}} with value \"{{value}}\" fails to match the {{name}} pattern",
41
+ "string.regex": "{{label}} with value {{value}} fails to match the required pattern",
42
+ "string.token": "{{label}} must only contain alpha-numeric and underscore characters",
43
+ "string.trim": "{{label}} must not have leading or trailing whitespace",
44
+ "string.uppercase": "{{label}} must only contain uppercase characters",
45
+ "string.uri": "{{label}} must be a valid uri",
46
+ "string.uriCustomScheme": "{{label}} must be a valid uri with a scheme matching the {{scheme}} pattern",
47
+ "string.uriRelativeOnly": "{{label}} must be a valid relative uri"
48
+ }
@@ -1,4 +1,48 @@
1
1
  {
2
+ "any.required": "{{label}} 是必填项",
3
+ "date.base": "{{label}} 必须是有效日期",
4
+ "date.format": "{{label}} 必须是 {{format}} 格式",
5
+ "date.greater": "{{label}} 必须大于 {{limit}}",
6
+ "date.less": "{{label}} 必须小于 {{limit}}",
7
+ "date.max": "{{label}} 必须小于或等于 {{limit}}",
8
+ "date.min": "{{label}} 必须大于或等于 {{limit}}",
9
+ "field-is-depended-on-by-other": "无法删除 \"{{fieldCollectionName}}\" 中的 \"{{fieldName}}\" 字段,它被 \"{{dependedFieldCollectionName}}\" 中的 \"{{dependedFieldName}}\" 字段用作 \"{{dependedFieldAs}}\"",
2
10
  "field-name-exists": "字段标识 \"{{name}}\" 已存在",
3
- "field-is-depended-on-by-other": "无法删除 \"{{fieldCollectionName}}\" 中的 \"{{fieldName}}\" 字段,它被 \"{{dependedFieldCollectionName}}\" 中的 \"{{dependedFieldName}}\" 字段用作 \"{{dependedFieldAs}}\""
4
- }
11
+ "number.base": "{{label}} 必须是数字",
12
+ "number.float": "{{label}} 必须是浮点数",
13
+ "number.greater": "{{label}} 必须大于 {{limit}}",
14
+ "number.integer": "{{label}} 必须是整数",
15
+ "number.less": "{{label}} 必须小于 {{limit}}",
16
+ "number.max": "{{label}} 必须小于或等于 {{limit}}",
17
+ "number.min": "{{label}} 必须大于或等于 {{limit}}",
18
+ "number.multiple": "{{label}} 必须是 {{multiple}} 的倍数",
19
+ "number.negative": "{{label}} 必须是负数",
20
+ "number.port": "{{label}} 必须是有效的端口号",
21
+ "number.positive": "{{label}} 必须是正数",
22
+ "number.precision": "{{label}} 精度不能超过 {{limit}} 位小数",
23
+ "number.unsafe": "{{label}} 必须是安全整数",
24
+ "string.alphanum": "{{label}} 只能包含字母和数字",
25
+ "string.base": "{{label}} 必须是字符串",
26
+ "string.creditCard": "{{label}} 必须是有效的信用卡号",
27
+ "string.email": "{{label}} 邮箱地址不符合要求的格式",
28
+ "string.empty": "{{label}} 不能为空字符串",
29
+ "string.guid": "{{label}} 必须是有效的UUID",
30
+ "string.hex": "{{label}} 必须是有效的十六进制字符串",
31
+ "string.hostname": "{{label}} 必须是有效的主机名",
32
+ "string.isoDate": "{{label}} 必须是有效的ISO日期",
33
+ "string.length": "{{label}} 长度必须为 {{limit}} 个字符",
34
+ "string.lowercase": "{{label}} 必须是小写",
35
+ "string.max": "{{label}} 长度不能超过 {{limit}} 个字符",
36
+ "string.min": "{{label}} 长度不能少于 {{limit}} 个字符",
37
+ "string.pattern.base": "{{label}} 值 \"{{value}}\" 格式不符合要求:{{regex}}",
38
+ "string.pattern.invert.base": "{{label}} 值 \"{{value}}\" 包含不允许的字符",
39
+ "string.pattern.invert.name": "{{label}} 值 \"{{value}}\" 不能符合 {{name}} 格式",
40
+ "string.pattern.name": "{{label}} 值 \"{{value}}\" 不符合 {{name}} 格式",
41
+ "string.regex": "{{label}} 值 {{value}} 格式不正确",
42
+ "string.token": "{{label}} 只能包含字母、数字和下划线",
43
+ "string.trim": "{{label}} 不能包含前后空白字符",
44
+ "string.uppercase": "{{label}} 必须是大写",
45
+ "string.uri": "{{label}} 必须是有效的URI",
46
+ "string.uriCustomScheme": "{{label}} 必须是符合 {{scheme}} 模式的有效URI",
47
+ "string.uriRelativeOnly": "{{label}} 必须是有效的相对路径"
48
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "any.required": "{{label}} is required",
3
+ "date.base": "{{label}} must be a valid date",
4
+ "date.format": "{{label}} must be in {{format}} format",
5
+ "date.greater": "{{label}} must be greater than {{limit}}",
6
+ "date.less": "{{label}} must be less than {{limit}}",
7
+ "date.max": "{{label}} must be less than or equal to {{limit}}",
8
+ "date.min": "{{label}} must be greater than or equal to {{limit}}",
9
+ "field-is-depended-on-by-other": "Can not delete field \"{{fieldName}}\" in \"{{fieldCollectionName}}\", it is used by field \"{{dependedFieldName}}\" in \"{{dependedFieldCollectionName}}\" as \"{{dependedFieldAs}}\"",
10
+ "field-name-exists": "Field name \"{{name}}\" already exists in collection \"{{collectionName}}\"",
11
+ "number.base": "{{label}} must be a number",
12
+ "number.float": "{{label}} must be a float or double",
13
+ "number.greater": "{{label}} must be greater than {{limit}}",
14
+ "number.integer": "{{label}} must be an integer",
15
+ "number.less": "{{label}} must be less than {{limit}}",
16
+ "number.max": "{{label}} must be less than or equal to {{limit}}",
17
+ "number.min": "{{label}} must be greater than or equal to {{limit}}",
18
+ "number.multiple": "{{label}} must be a multiple of {{multiple}}",
19
+ "number.negative": "{{label}} must be a negative number",
20
+ "number.port": "{{label}} must be a valid port",
21
+ "number.positive": "{{label}} must be a positive number",
22
+ "number.precision": "{{label}} must not have more than {{limit}} decimal places",
23
+ "number.unsafe": "{{label}} must be a safe number",
24
+ "string.alphanum": "{{label}} must only contain alpha-numeric characters",
25
+ "string.base": "{{label}} must be a string",
26
+ "string.creditCard": "{{label}} must be a credit card",
27
+ "string.email": "{{label}} email address doesn’t meet the required format",
28
+ "string.empty": "{{label}} is not allowed to be empty",
29
+ "string.guid": "{{label}} must be a valid UUID",
30
+ "string.hex": "{{label}} must only contain hexadecimal characters",
31
+ "string.hostname": "{{label}} must be a valid hostname",
32
+ "string.isoDate": "{{label}} must be a valid ISO 8601 date",
33
+ "string.length": "{{label}} length must be {{limit}} characters long",
34
+ "string.lowercase": "{{label}} must only contain lowercase characters",
35
+ "string.max": "{{label}} length must be less than or equal to {{limit}} characters long",
36
+ "string.min": "{{label}} length must be at least {{limit}} characters long",
37
+ "string.pattern.base": "{{label}} with value \"{{value}}\" fails to match the required pattern: {{regex}}",
38
+ "string.pattern.invert.base": "{{label}} with value \"{{value}}\" matches the inverted pattern",
39
+ "string.pattern.invert.name": "{{label}} with value \"{{value}}\" matches the inverted {{name}} pattern",
40
+ "string.pattern.name": "{{label}} with value \"{{value}}\" fails to match the {{name}} pattern",
41
+ "string.regex": "{{label}} with value {{value}} fails to match the required pattern",
42
+ "string.token": "{{label}} must only contain alpha-numeric and underscore characters",
43
+ "string.trim": "{{label}} must not have leading or trailing whitespace",
44
+ "string.uppercase": "{{label}} must only contain uppercase characters",
45
+ "string.uri": "{{label}} must be a valid uri",
46
+ "string.uriCustomScheme": "{{label}} must be a valid uri with a scheme matching the {{scheme}} pattern",
47
+ "string.uriRelativeOnly": "{{label}} must be a valid relative uri"
48
+ }
@@ -6,7 +6,4 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import Database from '@nocobase/database';
10
- export declare function afterCreateForReverseField(db: Database): (model: any, { transaction }: {
11
- transaction: any;
12
- }) => Promise<void>;
9
+ export declare const PRESET_FIELDS_INTERFACES: string[];
@@ -24,23 +24,13 @@ var __copyProps = (to, from, except, desc) => {
24
24
  return to;
25
25
  };
26
26
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var afterCreateForReverseField_exports = {};
28
- __export(afterCreateForReverseField_exports, {
29
- afterCreateForReverseField: () => afterCreateForReverseField
27
+ var constants_exports = {};
28
+ __export(constants_exports, {
29
+ PRESET_FIELDS_INTERFACES: () => PRESET_FIELDS_INTERFACES
30
30
  });
31
- module.exports = __toCommonJS(afterCreateForReverseField_exports);
32
- function afterCreateForReverseField(db) {
33
- return async (model, { transaction }) => {
34
- const Field = db.getCollection("fields");
35
- const reverseKey = model.get("reverseKey");
36
- if (!reverseKey) {
37
- return;
38
- }
39
- const reverse = await Field.model.findByPk(reverseKey, { transaction });
40
- await reverse.update({ reverseKey: model.get("key") }, { hooks: false, transaction });
41
- };
42
- }
31
+ module.exports = __toCommonJS(constants_exports);
32
+ const PRESET_FIELDS_INTERFACES = ["id", "createdAt", "updatedAt", "createdBy", "updatedBy"];
43
33
  // Annotate the CommonJS export names for ESM import in node:
44
34
  0 && (module.exports = {
45
- afterCreateForReverseField
35
+ PRESET_FIELDS_INTERFACES
46
36
  });
@@ -103,6 +103,7 @@ function afterCreateForForeignKeyField(db) {
103
103
  instance.set("sort", 1);
104
104
  instance.set("isForeignKey", true);
105
105
  await instance.save({ transaction });
106
+ await instance.load({ transaction });
106
107
  } else {
107
108
  const createOptions = {
108
109
  values: {
@@ -114,9 +115,10 @@ function afterCreateForForeignKeyField(db) {
114
115
  if (interfaceType === "m2o") {
115
116
  createOptions["context"] = {};
116
117
  }
117
- const creatInstance = await r.create(createOptions);
118
- creatInstance.set("sort", 1);
119
- await creatInstance.save({ transaction });
118
+ const createdInstance = await r.create(createOptions);
119
+ createdInstance.set("sort", 1);
120
+ await createdInstance.save({ transaction });
121
+ await createdInstance.load({ transaction });
120
122
  }
121
123
  await r.update({
122
124
  filter: {
@@ -7,7 +7,6 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  export * from './afterCreateForForeignKeyField';
10
- export * from './afterCreateForReverseField';
11
10
  export * from './beforeCreateForReverseField';
12
11
  export * from './beforeDestroyForeignKey';
13
12
  export * from './beforeInitOptions';
@@ -24,14 +24,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
24
24
  var hooks_exports = {};
25
25
  module.exports = __toCommonJS(hooks_exports);
26
26
  __reExport(hooks_exports, require("./afterCreateForForeignKeyField"), module.exports);
27
- __reExport(hooks_exports, require("./afterCreateForReverseField"), module.exports);
28
27
  __reExport(hooks_exports, require("./beforeCreateForReverseField"), module.exports);
29
28
  __reExport(hooks_exports, require("./beforeDestroyForeignKey"), module.exports);
30
29
  __reExport(hooks_exports, require("./beforeInitOptions"), module.exports);
31
30
  // Annotate the CommonJS export names for ESM import in node:
32
31
  0 && (module.exports = {
33
32
  ...require("./afterCreateForForeignKeyField"),
34
- ...require("./afterCreateForReverseField"),
35
33
  ...require("./beforeCreateForReverseField"),
36
34
  ...require("./beforeDestroyForeignKey"),
37
35
  ...require("./beforeInitOptions")
@@ -0,0 +1,14 @@
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
+ */
9
+ import { Migration } from '@nocobase/server';
10
+ export default class extends Migration {
11
+ on: string;
12
+ appVersion: string;
13
+ up(): Promise<void>;
14
+ }
@@ -0,0 +1,48 @@
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
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var id2integer_exports = {};
28
+ __export(id2integer_exports, {
29
+ default: () => id2integer_default
30
+ });
31
+ module.exports = __toCommonJS(id2integer_exports);
32
+ var import_server = require("@nocobase/server");
33
+ class id2integer_default extends import_server.Migration {
34
+ on = "afterLoad";
35
+ // 'beforeLoad' or 'afterLoad'
36
+ appVersion = "<2.0.0";
37
+ async up() {
38
+ const repo = this.db.getRepository("fields");
39
+ await repo.update({
40
+ values: {
41
+ interface: "integer"
42
+ },
43
+ filter: {
44
+ interface: "id"
45
+ }
46
+ });
47
+ }
48
+ }
@@ -88,6 +88,9 @@ class CollectionModel extends import_database.MagicAttributeModel {
88
88
  if (!collectionOptions.dumpRules) {
89
89
  import_lodash.default.set(collectionOptions, "dumpRules.group", "custom");
90
90
  }
91
+ const fieldRepo = this.db.getRepository("collections.fields", name);
92
+ const fieldModels = await fieldRepo.find({ transaction });
93
+ collectionOptions["fieldModels"] = fieldModels;
91
94
  collection = this.db.collection(collectionOptions);
92
95
  }
93
96
  if (!skipField) {
@@ -134,6 +137,9 @@ class CollectionModel extends import_database.MagicAttributeModel {
134
137
  return 0;
135
138
  });
136
139
  for (const instance of instances) {
140
+ if (!instance.get("collectionName")) {
141
+ instance.set("collectionName", this.get("name"));
142
+ }
137
143
  await instance.load(options);
138
144
  }
139
145
  }
@@ -170,17 +176,17 @@ class CollectionModel extends import_database.MagicAttributeModel {
170
176
  collectionName: field.get("collectionName")
171
177
  };
172
178
  });
173
- const beforePendingFields = getPendingField();
174
- const collection = await this.load({
175
- transaction: options == null ? void 0 : options.transaction
176
- });
177
- const afterPendingFields = getPendingField();
178
- const resolvedPendingFields = import_lodash.default.differenceWith(beforePendingFields, afterPendingFields, import_lodash.default.isEqual);
179
- const resolvedPendingFieldsCollections = import_lodash.default.uniq(resolvedPendingFields.map((field) => field.collectionName));
180
- if (Object.keys(collection.model.tableAttributes).length == 0 && !this.db.inDialect("postgres")) {
181
- return;
182
- }
183
179
  try {
180
+ const beforePendingFields = getPendingField();
181
+ const collection = await this.load({
182
+ transaction: options == null ? void 0 : options.transaction
183
+ });
184
+ const afterPendingFields = getPendingField();
185
+ const resolvedPendingFields = import_lodash.default.differenceWith(beforePendingFields, afterPendingFields, import_lodash.default.isEqual);
186
+ const resolvedPendingFieldsCollections = import_lodash.default.uniq(resolvedPendingFields.map((field) => field.collectionName));
187
+ if (Object.keys(collection.model.tableAttributes).length == 0 && !this.db.inDialect("postgres")) {
188
+ return;
189
+ }
184
190
  const syncOptions = {
185
191
  force: false,
186
192
  alter: {
@@ -0,0 +1,17 @@
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
+ */
9
+ import { Context, Next } from '@nocobase/actions';
10
+ declare const _default: {
11
+ name: string;
12
+ actions: {
13
+ refresh(ctx: Context, next: Next): Promise<void>;
14
+ syncFields(ctx: Context, next: Next): Promise<void>;
15
+ };
16
+ };
17
+ export default _default;
@@ -0,0 +1,52 @@
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
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var main_data_source_exports = {};
28
+ __export(main_data_source_exports, {
29
+ default: () => main_data_source_default
30
+ });
31
+ module.exports = __toCommonJS(main_data_source_exports);
32
+ var main_data_source_default = {
33
+ name: "mainDataSource",
34
+ actions: {
35
+ async refresh(ctx, next) {
36
+ const plugin = ctx.app.pm.get("data-source-main");
37
+ const mainDataSource = ctx.app.dataSourceManager.get("main");
38
+ if (mainDataSource.status === "loaded") {
39
+ await plugin.loadCollections();
40
+ }
41
+ await next();
42
+ },
43
+ async syncFields(ctx, next) {
44
+ const { collections } = ctx.action.params.values || {};
45
+ const mainDataSource = ctx.app.dataSourceManager.get("main");
46
+ if (mainDataSource.status === "loaded") {
47
+ await mainDataSource.syncFieldsFromDatabase(ctx, collections);
48
+ }
49
+ await next();
50
+ }
51
+ }
52
+ };
@@ -65,7 +65,7 @@ var views_default = {
65
65
  var _a;
66
66
  const db = ctx.app.db;
67
67
  const dbViews = await db.queryInterface.listViews({
68
- schema: ((_a = db.options) == null ? void 0 : _a.schema) || process.env.DB_SCHEMA || process.env.COLLECTION_MANAGER_SCHEMA || "public"
68
+ schema: process.env.COLLECTION_MANAGER_SCHEMA || ((_a = db.options) == null ? void 0 : _a.schema) || process.env.DB_SCHEMA || "public"
69
69
  });
70
70
  const viewCollections = Array.from(db.collections.values()).filter((collection) => collection.isView());
71
71
  ctx.body = dbViews.map((dbView) => {