@tachybase/module-multi-app 1.6.0 → 1.6.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.
Files changed (105) hide show
  1. package/README.md +34 -34
  2. package/README.zh-CN.md +34 -34
  3. package/client.d.ts +1 -1
  4. package/client.js +1 -1
  5. package/dist/externalVersion.js +5 -5
  6. package/dist/locale/en-US.json +48 -48
  7. package/dist/locale/es-ES.json +9 -9
  8. package/dist/locale/ko_KR.json +11 -11
  9. package/dist/locale/pt-BR.json +9 -9
  10. package/dist/locale/zh-CN.json +58 -58
  11. package/dist/node_modules/mariadb/callback.js +43 -8
  12. package/dist/node_modules/mariadb/check-node.js +30 -0
  13. package/dist/node_modules/mariadb/lib/cluster-callback.js +84 -0
  14. package/dist/node_modules/mariadb/lib/cluster.js +446 -0
  15. package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +576 -177
  16. package/dist/node_modules/mariadb/lib/cmd/change-user.js +54 -44
  17. package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +3 -2
  18. package/dist/node_modules/mariadb/lib/cmd/class/prepare-cache-wrapper.js +46 -0
  19. package/dist/node_modules/mariadb/lib/cmd/class/prepare-result-packet.js +141 -0
  20. package/dist/node_modules/mariadb/lib/cmd/class/prepare-wrapper.js +70 -0
  21. package/dist/node_modules/mariadb/lib/cmd/close-prepare.js +38 -0
  22. package/dist/node_modules/mariadb/lib/cmd/column-definition.js +145 -47
  23. package/dist/node_modules/mariadb/lib/cmd/command.js +41 -75
  24. package/dist/node_modules/mariadb/lib/cmd/decoder/binary-decoder.js +282 -0
  25. package/dist/node_modules/mariadb/lib/cmd/decoder/text-decoder.js +210 -0
  26. package/dist/node_modules/mariadb/lib/cmd/{common-binary-cmd.js → encoder/binary-encoder.js} +34 -77
  27. package/dist/node_modules/mariadb/lib/cmd/encoder/text-encoder.js +311 -0
  28. package/dist/node_modules/mariadb/lib/cmd/execute-stream.js +61 -0
  29. package/dist/node_modules/mariadb/lib/cmd/execute.js +338 -0
  30. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +25 -62
  31. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +39 -6
  32. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +48 -16
  33. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/handshake.js +198 -0
  34. package/dist/node_modules/mariadb/lib/cmd/handshake/{initial-handshake.js → auth/initial-handshake.js} +10 -8
  35. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +22 -9
  36. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +9 -4
  37. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/parsec-auth.js +115 -0
  38. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +12 -5
  39. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +44 -33
  40. package/dist/node_modules/mariadb/lib/cmd/handshake/authentication.js +335 -0
  41. package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +20 -19
  42. package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +6 -3
  43. package/dist/node_modules/mariadb/lib/cmd/parser.js +861 -0
  44. package/dist/node_modules/mariadb/lib/cmd/ping.js +17 -18
  45. package/dist/node_modules/mariadb/lib/cmd/prepare.js +170 -0
  46. package/dist/node_modules/mariadb/lib/cmd/query.js +281 -144
  47. package/dist/node_modules/mariadb/lib/cmd/quit.js +9 -6
  48. package/dist/node_modules/mariadb/lib/cmd/reset.js +15 -19
  49. package/dist/node_modules/mariadb/lib/cmd/stream.js +21 -6
  50. package/dist/node_modules/mariadb/lib/config/cluster-options.js +23 -0
  51. package/dist/node_modules/mariadb/lib/config/connection-options.js +196 -132
  52. package/dist/node_modules/mariadb/lib/config/pool-options.js +27 -19
  53. package/dist/node_modules/mariadb/lib/connection-callback.js +492 -120
  54. package/dist/node_modules/mariadb/lib/connection-promise.js +372 -0
  55. package/dist/node_modules/mariadb/lib/connection.js +1739 -1016
  56. package/dist/node_modules/mariadb/lib/const/capabilities.js +36 -30
  57. package/dist/node_modules/mariadb/lib/const/collations.js +972 -36
  58. package/dist/node_modules/mariadb/lib/const/connection_status.js +3 -0
  59. package/dist/node_modules/mariadb/lib/const/error-code.js +35 -11
  60. package/dist/node_modules/mariadb/lib/const/field-detail.js +3 -0
  61. package/dist/node_modules/mariadb/lib/const/field-type.js +7 -4
  62. package/dist/node_modules/mariadb/lib/const/server-status.js +4 -1
  63. package/dist/node_modules/mariadb/lib/const/state-change.js +3 -0
  64. package/dist/node_modules/mariadb/lib/filtered-cluster-callback.js +136 -0
  65. package/dist/node_modules/mariadb/lib/filtered-cluster.js +118 -0
  66. package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +14 -13
  67. package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +21 -18
  68. package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +75 -64
  69. package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +13 -9
  70. package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +12 -10
  71. package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +402 -134
  72. package/dist/node_modules/mariadb/lib/io/packet.js +287 -202
  73. package/dist/node_modules/mariadb/lib/lru-prepare-cache.js +84 -0
  74. package/dist/node_modules/mariadb/lib/misc/connection-information.js +15 -32
  75. package/dist/node_modules/mariadb/lib/misc/errors.js +68 -25
  76. package/dist/node_modules/mariadb/lib/misc/parse.js +207 -711
  77. package/dist/node_modules/mariadb/lib/misc/utils.js +34 -62
  78. package/dist/node_modules/mariadb/lib/pool-callback.js +213 -174
  79. package/dist/node_modules/mariadb/lib/pool-promise.js +228 -94
  80. package/dist/node_modules/mariadb/lib/pool.js +951 -0
  81. package/dist/node_modules/mariadb/package.json +1 -1
  82. package/dist/node_modules/mariadb/promise.js +1 -34
  83. package/dist/node_modules/mariadb/types/callback.d.ts +207 -0
  84. package/dist/node_modules/mariadb/types/index.d.ts +94 -674
  85. package/dist/node_modules/mariadb/types/share.d.ts +804 -0
  86. package/dist/node_modules/qs/package.json +1 -1
  87. package/dist/server/actions/apps.js +2 -2
  88. package/dist/server/app-lifecycle.d.ts +1 -1
  89. package/dist/server/app-lifecycle.js +4 -4
  90. package/dist/server/models/application.d.ts +1 -1
  91. package/package.json +7 -7
  92. package/server.d.ts +2 -2
  93. package/server.js +1 -1
  94. package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
  95. package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
  96. package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
  97. package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
  98. package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
  99. package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
  100. package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
  101. package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
  102. package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
  103. package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
  104. package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
  105. package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
package/README.md CHANGED
@@ -1,34 +1,34 @@
1
- # multi-app-manager
2
-
3
- English | [中文](./README.zh-CN.md)
4
-
5
- 多应用管理插件。
6
-
7
- ## 安装激活
8
-
9
- ```bash
10
- yarn pm enable multi-app-manager
11
- ```
12
-
13
- ## 使用方法
14
-
15
- 注意目前仅支持部分在应用启动时传入的环境变量,具体列表如下:
16
-
17
- ```ini
18
- APP_KEY=test-key
19
- API_BASE_PATH=/api/
20
- DB_DIALECT=sqlite
21
- DB_STORAGE=storage/db/tachybase.sqlite
22
- DB_TABLE_PREFIX=
23
- DB_HOST=localhost
24
- DB_PORT=5432
25
- DB_DATABASE=postgres
26
- DB_USER=tachybase
27
- DB_PASSWORD=tachybase
28
- DB_UNDERSCORED=false
29
- DB_TIMEZONE=+08:00
30
- DB_SCHEMA=
31
- CACHE_DEFAULT_STORE=memory
32
- CACHE_MEMORY_MAX=2000
33
- ```
34
-
1
+ # multi-app-manager
2
+
3
+ English | [中文](./README.zh-CN.md)
4
+
5
+ 多应用管理插件。
6
+
7
+ ## 安装激活
8
+
9
+ ```bash
10
+ yarn pm enable multi-app-manager
11
+ ```
12
+
13
+ ## 使用方法
14
+
15
+ 注意目前仅支持部分在应用启动时传入的环境变量,具体列表如下:
16
+
17
+ ```ini
18
+ APP_KEY=test-key
19
+ API_BASE_PATH=/api/
20
+ DB_DIALECT=sqlite
21
+ DB_STORAGE=storage/db/tachybase.sqlite
22
+ DB_TABLE_PREFIX=
23
+ DB_HOST=localhost
24
+ DB_PORT=5432
25
+ DB_DATABASE=postgres
26
+ DB_USER=tachybase
27
+ DB_PASSWORD=tachybase
28
+ DB_UNDERSCORED=false
29
+ DB_TIMEZONE=+08:00
30
+ DB_SCHEMA=
31
+ CACHE_DEFAULT_STORE=memory
32
+ CACHE_MEMORY_MAX=2000
33
+ ```
34
+
package/README.zh-CN.md CHANGED
@@ -1,34 +1,34 @@
1
- # multi-app-manager
2
-
3
- [English](./README.md) | 中文
4
-
5
- 多应用管理插件。
6
-
7
- ## 安装激活
8
-
9
- ```bash
10
- yarn pm enable multi-app-manager
11
- ```
12
-
13
- ## 使用方法
14
-
15
- 注意目前仅支持部分在应用启动时传入的环境变量,具体列表如下:
16
-
17
- ```ini
18
- APP_KEY=test-key
19
- API_BASE_PATH=/api/
20
- DB_DIALECT=sqlite
21
- DB_STORAGE=storage/db/tachybase.sqlite
22
- DB_TABLE_PREFIX=
23
- DB_HOST=localhost
24
- DB_PORT=5432
25
- DB_DATABASE=postgres
26
- DB_USER=tachybase
27
- DB_PASSWORD=tachybase
28
- DB_UNDERSCORED=false
29
- DB_TIMEZONE=+08:00
30
- DB_SCHEMA=
31
- CACHE_DEFAULT_STORE=memory
32
- CACHE_MEMORY_MAX=2000
33
- ```
34
-
1
+ # multi-app-manager
2
+
3
+ [English](./README.md) | 中文
4
+
5
+ 多应用管理插件。
6
+
7
+ ## 安装激活
8
+
9
+ ```bash
10
+ yarn pm enable multi-app-manager
11
+ ```
12
+
13
+ ## 使用方法
14
+
15
+ 注意目前仅支持部分在应用启动时传入的环境变量,具体列表如下:
16
+
17
+ ```ini
18
+ APP_KEY=test-key
19
+ API_BASE_PATH=/api/
20
+ DB_DIALECT=sqlite
21
+ DB_STORAGE=storage/db/tachybase.sqlite
22
+ DB_TABLE_PREFIX=
23
+ DB_HOST=localhost
24
+ DB_PORT=5432
25
+ DB_DATABASE=postgres
26
+ DB_USER=tachybase
27
+ DB_PASSWORD=tachybase
28
+ DB_UNDERSCORED=false
29
+ DB_TIMEZONE=+08:00
30
+ DB_SCHEMA=
31
+ CACHE_DEFAULT_STORE=memory
32
+ CACHE_MEMORY_MAX=2000
33
+ ```
34
+
package/client.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/client/index';
1
+ export * from './dist/client/index';
package/client.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/client/index.js');
1
+ module.exports = require('./dist/client/index.js');
@@ -1,14 +1,14 @@
1
1
  module.exports = {
2
2
  "react-i18next": "16.2.1",
3
- "@tachybase/client": "1.6.0",
4
- "@tego/server": "1.3.52",
3
+ "@tachybase/client": "1.6.1",
4
+ "@tego/server": "1.6.0",
5
5
  "lodash": "4.17.21",
6
6
  "mysql2": "3.14.3",
7
7
  "pg": "8.16.3",
8
8
  "react": "18.3.1",
9
- "@tachybase/schema": "1.3.52",
9
+ "@tachybase/schema": "1.6.0",
10
10
  "antd": "5.22.5",
11
11
  "react-router-dom": "6.28.1",
12
- "@tego/client": "1.3.52",
13
- "@ant-design/icons": "5.6.1"
12
+ "@tego/client": "1.6.0",
13
+ "@ant-design/icons": "6.1.0"
14
14
  };
@@ -1,48 +1,48 @@
1
- {
2
- "All sub-applications have stopped serving, unless you reopen them": "All sub-applications have stopped serving, unless you reopen them",
3
- "App ID": "App ID",
4
- "App display name": "App display name",
5
- "App is already running": "App is already running",
6
- "App is not running": "App is not running",
7
- "App status": "App status",
8
- "Applications": "Applications",
9
- "Auto start": "Auto start",
10
- "Can be empty, or selected from the template library or personal applications": "Can be empty, or selected from the template library or personal applications",
11
- "Commanding": "Commanding",
12
- "Custom domain": "Custom domain",
13
- "Custom domain prefix": "Custom domain prefix",
14
- "Custom domain prefix must be 1-63 characters, lowercase letters, numbers, or hyphens (-), and cannot start or end with a hyphen (-)": "Custom domain prefix must be 1-63 characters, lowercase letters, numbers, or hyphens (-), and cannot start or end with a hyphen (-)",
15
- "Error": "Error",
16
- "Failed to start app": "Failed to start app",
17
- "Initialized": "Initialized",
18
- "Initializing": "Initializing",
19
- "Is template": "Is template",
20
- "Manage applications": "Manage applications",
21
- "Multi-app display": "Multi-app display",
22
- "Multi-app manager": "Multi-app manager",
23
- "Not found": "Not found",
24
- "Pin to menu": "Pin to menu",
25
- "Please enter a valid custom domain prefix": "Please enter a valid custom domain prefix",
26
- "Preset": "Preset",
27
- "Processing...": "Processing...",
28
- "Refresh": "Refresh",
29
- "Running": "Running",
30
- "Standalone deployment": "Standalone deployment",
31
- "Start": "Start",
32
- "Start all": "Start all",
33
- "Start count": "Start count",
34
- "Start environment variables": "Start environment variables",
35
- "Start mode": "Start mode",
36
- "Start on first visit": "Start on first visit",
37
- "Start with main application": "Start with main application",
38
- "Starting all sub-applications may cause lag. The more applications you have, the longer the waiting time": "All sub-applications have stopped serving, unless you reopen them",
39
- "Stop": "Stop",
40
- "Stop all": "Stop all",
41
- "Stop count": "Stop count",
42
- "Stopped": "Stopped",
43
- "Template": "Template",
44
- "Template is in use": "Template is in use",
45
- "Template not exists": "Template not exists",
46
- "This database does not support to create application using template": "This database does not support to create application using template",
47
- "View": "View"
48
- }
1
+ {
2
+ "All sub-applications have stopped serving, unless you reopen them": "All sub-applications have stopped serving, unless you reopen them",
3
+ "App ID": "App ID",
4
+ "App display name": "App display name",
5
+ "App is already running": "App is already running",
6
+ "App is not running": "App is not running",
7
+ "App status": "App status",
8
+ "Applications": "Applications",
9
+ "Auto start": "Auto start",
10
+ "Can be empty, or selected from the template library or personal applications": "Can be empty, or selected from the template library or personal applications",
11
+ "Commanding": "Commanding",
12
+ "Custom domain": "Custom domain",
13
+ "Custom domain prefix": "Custom domain prefix",
14
+ "Custom domain prefix must be 1-63 characters, lowercase letters, numbers, or hyphens (-), and cannot start or end with a hyphen (-)": "Custom domain prefix must be 1-63 characters, lowercase letters, numbers, or hyphens (-), and cannot start or end with a hyphen (-)",
15
+ "Error": "Error",
16
+ "Failed to start app": "Failed to start app",
17
+ "Initialized": "Initialized",
18
+ "Initializing": "Initializing",
19
+ "Is template": "Is template",
20
+ "Manage applications": "Manage applications",
21
+ "Multi-app display": "Multi-app display",
22
+ "Multi-app manager": "Multi-app manager",
23
+ "Not found": "Not found",
24
+ "Pin to menu": "Pin to menu",
25
+ "Please enter a valid custom domain prefix": "Please enter a valid custom domain prefix",
26
+ "Preset": "Preset",
27
+ "Processing...": "Processing...",
28
+ "Refresh": "Refresh",
29
+ "Running": "Running",
30
+ "Standalone deployment": "Standalone deployment",
31
+ "Start": "Start",
32
+ "Start all": "Start all",
33
+ "Start count": "Start count",
34
+ "Start environment variables": "Start environment variables",
35
+ "Start mode": "Start mode",
36
+ "Start on first visit": "Start on first visit",
37
+ "Start with main application": "Start with main application",
38
+ "Starting all sub-applications may cause lag. The more applications you have, the longer the waiting time": "All sub-applications have stopped serving, unless you reopen them",
39
+ "Stop": "Stop",
40
+ "Stop all": "Stop all",
41
+ "Stop count": "Stop count",
42
+ "Stopped": "Stopped",
43
+ "Template": "Template",
44
+ "Template is in use": "Template is in use",
45
+ "Template not exists": "Template not exists",
46
+ "This database does not support to create application using template": "This database does not support to create application using template",
47
+ "View": "View"
48
+ }
@@ -1,9 +1,9 @@
1
- {
2
- "App ID": "ID de aplicación",
3
- "App display name": "Mostrar nombre de aplicación",
4
- "Applications": "Aplicaciones",
5
- "Custom domain": "Dominio personalizado",
6
- "Manage applications": "Gestionar aplicaciones",
7
- "Multi-app manager": "Gestor de aplicaciones múltiples",
8
- "Pin to menu": " Fijar al menú"
9
- }
1
+ {
2
+ "App ID": "ID de aplicación",
3
+ "App display name": "Mostrar nombre de aplicación",
4
+ "Applications": "Aplicaciones",
5
+ "Custom domain": "Dominio personalizado",
6
+ "Manage applications": "Gestionar aplicaciones",
7
+ "Multi-app manager": "Gestor de aplicaciones múltiples",
8
+ "Pin to menu": " Fijar al menú"
9
+ }
@@ -1,11 +1,11 @@
1
- {
2
- "App ID": "앱 식별자",
3
- "App display name": "앱 표시 이름",
4
- "Applications": "앱",
5
- "Auto start": "자동 시작",
6
- "Custom domain": "사용자 정의 도메인",
7
- "Manage applications": "앱 관리",
8
- "Multi-app manager": "다중 앱 관리",
9
- "Pin to menu": "메뉴에 고정",
10
- "Standalone deployment": "독립형 배포"
11
- }
1
+ {
2
+ "App ID": "앱 식별자",
3
+ "App display name": "앱 표시 이름",
4
+ "Applications": "앱",
5
+ "Auto start": "자동 시작",
6
+ "Custom domain": "사용자 정의 도메인",
7
+ "Manage applications": "앱 관리",
8
+ "Multi-app manager": "다중 앱 관리",
9
+ "Pin to menu": "메뉴에 고정",
10
+ "Standalone deployment": "독립형 배포"
11
+ }
@@ -1,9 +1,9 @@
1
- {
2
- "App ID": "ID do aplicativo",
3
- "App display name": "Nome de exibição do aplicativo",
4
- "Applications": "Aplicativos",
5
- "Custom domain": "Domínio personalizado",
6
- "Manage applications": "Gerenciar aplicativos",
7
- "Multi-app manager": "Gerenciador de aplicativos múltiplos",
8
- "Pin to menu": "Fixar no menu"
9
- }
1
+ {
2
+ "App ID": "ID do aplicativo",
3
+ "App display name": "Nome de exibição do aplicativo",
4
+ "Applications": "Aplicativos",
5
+ "Custom domain": "Domínio personalizado",
6
+ "Manage applications": "Gerenciar aplicativos",
7
+ "Multi-app manager": "Gerenciador de aplicativos múltiplos",
8
+ "Pin to menu": "Fixar no menu"
9
+ }
@@ -1,58 +1,58 @@
1
- {
2
- "Add by Phone Number": "通过手机添加",
3
- "Add partners": "添加协作者",
4
- "Add user": "添加用户",
5
- "All sub-applications have stopped serving, unless you restart them": "所有子应用停止服务,除非你重新打开",
6
- "App ID": "应用标识",
7
- "App already started": "应用已启动",
8
- "App already stopped": "应用已关闭",
9
- "App display name": "应用名称",
10
- "App is already running": "应用已启动",
11
- "App is not running": "应用未启动, 需要先在<系统-多应用管理>里启动应用",
12
- "App status": "应用状态",
13
- "Applications": "应用",
14
- "Auto start": "自动启动",
15
- "Can be empty, or selected from the template library or personal applications": "可以为空,或从模板库和个人应用中选择",
16
- "Collaborator": "协作者",
17
- "Commanding": "命令中",
18
- "Custom domain": "自定义域名",
19
- "Custom domain prefix": "自定义域名前缀",
20
- "Custom domain prefix must be 1-63 characters, lowercase letters, numbers, or hyphens (-), and cannot start or end with a hyphen (-)": "自定义域名前缀必须为1-63位小写字母、数字或短横线(-),且不能以短横线(-)开头或结尾",
21
- "Enter phone number please": "请输入手机号",
22
- "Error": "错误",
23
- "Failed to start app": "启动应用失败",
24
- "Initialized": "初始化完成",
25
- "Initializing": "初始化",
26
- "Is template": "是否模板",
27
- "Manage applications": "管理应用",
28
- "Multi-app display": "多应用展示",
29
- "Multi-app manager": "多应用管理",
30
- "Not a valid cellphone number, please re-enter": "不是有效的手机号,请重新输入",
31
- "Not found": "未找到",
32
- "PhoneNumber not found": "未找到该手机用户",
33
- "Pin to menu": "在菜单上显示",
34
- "Please enter a valid custom domain prefix": "请输入有效的自定义域名前缀",
35
- "Preset": "预设",
36
- "Processing...": "处理中...",
37
- "Refresh": "刷新",
38
- "Running": "运行中",
39
- "Standalone deployment": "独立部署",
40
- "Start": "启动",
41
- "Start all": "启动所有",
42
- "Start count": "启动数量",
43
- "Start environment variables": "启动环境变量",
44
- "Start mode": "启动方式",
45
- "Start on first visit": "首次访问时启动",
46
- "Start with main application": "随主应用一同启动",
47
- "Starting all sub-applications may cause lag. The more applications you have, the longer the waiting time": "启动所有子应用,可能会造成卡顿,你的应用越多等待时间越长",
48
- "Stop": "停止",
49
- "Stop all": "关闭所有",
50
- "Stop count": "关闭数量",
51
- "Stopped": "已停止",
52
- "Template": "模板",
53
- "Template is in use": "模板正在使用",
54
- "Template not exists": "模板不存在",
55
- "This database does not support to create application using template": "该数据库不支持使用模板创建应用程序",
56
- "User already exist": "用户已存在",
57
- "View": "访问"
58
- }
1
+ {
2
+ "Add by Phone Number": "通过手机添加",
3
+ "Add partners": "添加协作者",
4
+ "Add user": "添加用户",
5
+ "All sub-applications have stopped serving, unless you restart them": "所有子应用停止服务,除非你重新打开",
6
+ "App ID": "应用标识",
7
+ "App already started": "应用已启动",
8
+ "App already stopped": "应用已关闭",
9
+ "App display name": "应用名称",
10
+ "App is already running": "应用已启动",
11
+ "App is not running": "应用未启动, 需要先在<系统-多应用管理>里启动应用",
12
+ "App status": "应用状态",
13
+ "Applications": "应用",
14
+ "Auto start": "自动启动",
15
+ "Can be empty, or selected from the template library or personal applications": "可以为空,或从模板库和个人应用中选择",
16
+ "Collaborator": "协作者",
17
+ "Commanding": "命令中",
18
+ "Custom domain": "自定义域名",
19
+ "Custom domain prefix": "自定义域名前缀",
20
+ "Custom domain prefix must be 1-63 characters, lowercase letters, numbers, or hyphens (-), and cannot start or end with a hyphen (-)": "自定义域名前缀必须为1-63位小写字母、数字或短横线(-),且不能以短横线(-)开头或结尾",
21
+ "Enter phone number please": "请输入手机号",
22
+ "Error": "错误",
23
+ "Failed to start app": "启动应用失败",
24
+ "Initialized": "初始化完成",
25
+ "Initializing": "初始化",
26
+ "Is template": "是否模板",
27
+ "Manage applications": "管理应用",
28
+ "Multi-app display": "多应用展示",
29
+ "Multi-app manager": "多应用管理",
30
+ "Not a valid cellphone number, please re-enter": "不是有效的手机号,请重新输入",
31
+ "Not found": "未找到",
32
+ "PhoneNumber not found": "未找到该手机用户",
33
+ "Pin to menu": "在菜单上显示",
34
+ "Please enter a valid custom domain prefix": "请输入有效的自定义域名前缀",
35
+ "Preset": "预设",
36
+ "Processing...": "处理中...",
37
+ "Refresh": "刷新",
38
+ "Running": "运行中",
39
+ "Standalone deployment": "独立部署",
40
+ "Start": "启动",
41
+ "Start all": "启动所有",
42
+ "Start count": "启动数量",
43
+ "Start environment variables": "启动环境变量",
44
+ "Start mode": "启动方式",
45
+ "Start on first visit": "首次访问时启动",
46
+ "Start with main application": "随主应用一同启动",
47
+ "Starting all sub-applications may cause lag. The more applications you have, the longer the waiting time": "启动所有子应用,可能会造成卡顿,你的应用越多等待时间越长",
48
+ "Stop": "停止",
49
+ "Stop all": "关闭所有",
50
+ "Stop count": "关闭数量",
51
+ "Stopped": "已停止",
52
+ "Template": "模板",
53
+ "Template is in use": "模板正在使用",
54
+ "Template not exists": "模板不存在",
55
+ "This database does not support to create application using template": "该数据库不支持使用模板创建应用程序",
56
+ "User already exist": "用户已存在",
57
+ "View": "访问"
58
+ }
@@ -1,14 +1,18 @@
1
+ // SPDX-License-Identifier: LGPL-2.1-or-later
2
+ // Copyright (c) 2015-2024 MariaDB Corporation Ab
3
+
1
4
  'use strict';
2
- const pkg = require('./package.json');
3
- require('please-upgrade-node')(pkg);
5
+
6
+ require('./check-node');
4
7
 
5
8
  const ConnectionCallback = require('./lib/connection-callback');
6
- const PoolClusterCallback = require('./lib/pool-cluster-callback');
9
+ const ClusterCallback = require('./lib/cluster-callback');
7
10
  const PoolCallback = require('./lib/pool-callback');
8
11
 
9
12
  const ConnOptions = require('./lib/config/connection-options');
10
13
  const PoolOptions = require('./lib/config/pool-options');
11
- const PoolClusterOptions = require('./lib/config/pool-cluster-options');
14
+ const ClusterOptions = require('./lib/config/cluster-options');
15
+ const Connection = require('./lib/connection');
12
16
 
13
17
  module.exports.version = require('./package.json').version;
14
18
  module.exports.SqlError = require('./lib/misc/errors').SqlError;
@@ -25,17 +29,48 @@ module.exports.defaultOptions = function defaultOptions(opts) {
25
29
  };
26
30
 
27
31
  module.exports.createConnection = function createConnection(opts) {
28
- return new ConnectionCallback(new ConnOptions(opts));
32
+ const conn = new Connection(new ConnOptions(opts));
33
+ const connCallback = new ConnectionCallback(conn);
34
+ conn
35
+ .connect()
36
+ .then(
37
+ function () {
38
+ conn.emit('connect');
39
+ }.bind(conn)
40
+ )
41
+ .catch(conn.emit.bind(conn, 'connect'));
42
+ return connCallback;
29
43
  };
30
44
 
31
45
  exports.createPool = function createPool(opts) {
32
46
  const options = new PoolOptions(opts);
33
47
  const pool = new PoolCallback(options);
34
- pool.initialize();
48
+ // adding a default error handler to avoid exiting application on connection error.
49
+ pool.on('error', (err) => {});
35
50
  return pool;
36
51
  };
37
52
 
38
53
  exports.createPoolCluster = function createPoolCluster(opts) {
39
- const options = new PoolClusterOptions(opts);
40
- return new PoolClusterCallback(options);
54
+ const options = new ClusterOptions(opts);
55
+ return new ClusterCallback(options);
56
+ };
57
+
58
+ module.exports.importFile = function importFile(opts, callback) {
59
+ const cb = callback ? callback : () => {};
60
+ try {
61
+ const options = new ConnOptions(opts);
62
+ const conn = new Connection(options);
63
+ conn
64
+ .connect()
65
+ .then(() => {
66
+ return new Promise(conn.importFile.bind(conn, Object.assign({ skipDbCheck: true }, opts)));
67
+ })
68
+ .then(() => cb())
69
+ .catch((err) => cb(err))
70
+ .finally(() => {
71
+ new Promise(conn.end.bind(conn, {})).catch(console.log);
72
+ });
73
+ } catch (err) {
74
+ cb(err);
75
+ }
41
76
  };
@@ -0,0 +1,30 @@
1
+ // SPDX-License-Identifier: LGPL-2.1-or-later
2
+ // Copyright (c) 2015-2024 MariaDB Corporation Ab
3
+
4
+ 'use strict';
5
+
6
+ const hasMinVersion = function (nodeVersionStr, connectorRequirement) {
7
+ const versNode = nodeVersionStr.split('.');
8
+ const versReq = connectorRequirement.split('.');
9
+
10
+ const majorNode = Number(versNode[0]);
11
+ const majorReq = Number(versReq[0]);
12
+ if (majorNode > majorReq) return true;
13
+ if (majorNode < majorReq) return false;
14
+
15
+ if (versReq.length === 1) return true;
16
+
17
+ const minorNode = Number(versNode[1]);
18
+ const minorReq = Number(versReq[1]);
19
+ return minorNode >= minorReq;
20
+ };
21
+
22
+ module.exports.hasMinVersion = hasMinVersion;
23
+
24
+ const requirement = require('./package.json').engines.node;
25
+ const connectorRequirement = requirement.replace('>=', '').trim();
26
+ const currentNodeVersion = process.version.replace('v', '');
27
+ if (!hasMinVersion(currentNodeVersion, connectorRequirement)) {
28
+ console.error(`please upgrade node: mariadb requires at least version ${connectorRequirement}`);
29
+ process.exit(1);
30
+ }
@@ -0,0 +1,84 @@
1
+ // SPDX-License-Identifier: LGPL-2.1-or-later
2
+ // Copyright (c) 2015-2024 MariaDB Corporation Ab
3
+
4
+ 'use strict';
5
+
6
+ const Cluster = require('./cluster');
7
+
8
+ /**
9
+ * Create a new Cluster.
10
+ * Cluster handle pools with patterns and handle failover / distributed load
11
+ * according to selectors (round-robin / random / ordered )
12
+ *
13
+ * @param args cluster arguments. see pool-cluster-options.
14
+ * @constructor
15
+ */
16
+ class ClusterCallback {
17
+ #cluster;
18
+ constructor(args) {
19
+ this.#cluster = new Cluster(args);
20
+ this.#cluster._setCallback();
21
+ this.on = this.#cluster.on.bind(this.#cluster);
22
+ this.once = this.#cluster.once.bind(this.#cluster);
23
+ }
24
+
25
+ /**
26
+ * End cluster (and underlying pools).
27
+ *
28
+ * @param callback - not mandatory
29
+ */
30
+ end(callback) {
31
+ if (callback && typeof callback !== 'function') {
32
+ throw new Error('callback parameter must be a function');
33
+ }
34
+ const endingFct = callback ? callback : () => {};
35
+
36
+ this.#cluster
37
+ .end()
38
+ .then(() => {
39
+ endingFct();
40
+ })
41
+ .catch(endingFct);
42
+ }
43
+
44
+ /**
45
+ * Get connection from an available pools matching pattern, according to selector
46
+ *
47
+ * @param pattern pattern filter (not mandatory)
48
+ * @param selector node selector ('RR','RANDOM' or 'ORDER')
49
+ * @param callback callback function
50
+ */
51
+ getConnection(pattern, selector, callback) {
52
+ let pat = pattern,
53
+ sel = selector,
54
+ cal = callback;
55
+ if (typeof pattern === 'function') {
56
+ pat = null;
57
+ sel = null;
58
+ cal = pattern;
59
+ } else if (typeof selector === 'function') {
60
+ sel = null;
61
+ cal = selector;
62
+ }
63
+ const endingFct = cal ? cal : (err, conn) => {};
64
+ this.#cluster.getConnection(pat, sel, endingFct);
65
+ }
66
+
67
+ add(id, config) {
68
+ this.#cluster.add(id, config);
69
+ }
70
+
71
+ of(pattern, selector) {
72
+ return this.#cluster.of(pattern, selector);
73
+ }
74
+
75
+ remove(pattern) {
76
+ this.#cluster.remove(pattern);
77
+ }
78
+
79
+ get __tests() {
80
+ return this.#cluster.__tests;
81
+ }
82
+ }
83
+
84
+ module.exports = ClusterCallback;