@nocobase/plugin-verification 1.7.0-beta.8 → 1.7.0
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.
- package/dist/client/83b24f85ae99a175.js +10 -0
- package/dist/client/937c9eccebc38607.js +10 -0
- package/dist/client/{providerTypes/index.d.ts → VerificationMenu.d.ts} +5 -4
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.js +1 -1
- package/dist/client/locale/index.d.ts +1 -1
- package/dist/client/otp-verification/VerificationCode.d.ts +16 -0
- package/dist/client/otp-verification/sms/AdminSettingsForm.d.ts +12 -0
- package/dist/client/otp-verification/sms/BindForm.d.ts +11 -0
- package/dist/client/otp-verification/sms/VerificationForm.d.ts +11 -0
- package/dist/client/otp-verification/sms/index.d.ts +26 -0
- package/dist/client/otp-verification/sms/provider-manager.d.ts +19 -0
- package/dist/client/{VerificationProviders.d.ts → otp-verification/sms/providers/AliyunSettings.d.ts} +1 -1
- package/dist/{server/actions/index.d.ts → client/otp-verification/sms/providers/TencentSettings.d.ts} +2 -3
- package/dist/client/schemas/verifiers.d.ts +66 -0
- package/dist/client/verification-manager/index.d.ts +32 -0
- package/dist/client/{ProviderOptions.d.ts → verifiers/VerifierSelect.d.ts} +1 -2
- package/dist/client/verifiers/Verifiers.d.ts +12 -0
- package/dist/client/verifiers/verification-types.d.ts +24 -0
- package/dist/collections/verificators.d.ts +50 -0
- package/dist/collections/verificators.js +70 -0
- package/dist/collections/verifiers.d.ts +50 -0
- package/dist/collections/verifiers.js +70 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.js +42 -0
- package/dist/externalVersion.js +14 -13
- package/dist/locale/en-US.json +18 -1
- package/dist/locale/zh-CN.json +20 -2
- package/dist/node_modules/@alicloud/dysmsapi20170525/dist/client.js +2 -2
- package/dist/node_modules/@alicloud/dysmsapi20170525/package.json +1 -1
- package/dist/node_modules/@alicloud/openapi-client/dist/client.js +2 -2
- package/dist/node_modules/@alicloud/openapi-client/package.json +1 -1
- package/dist/node_modules/@alicloud/tea-util/dist/client.js +1 -1
- package/dist/node_modules/@alicloud/tea-util/package.json +1 -1
- package/dist/node_modules/tencentcloud-sdk-nodejs/package.json +1 -1
- package/dist/node_modules/tencentcloud-sdk-nodejs/tencentcloud/index.js +2 -2
- package/dist/server/Plugin.d.ts +8 -16
- package/dist/server/Plugin.js +68 -71
- package/dist/server/actions/verifiers.d.ts +18 -0
- package/dist/server/actions/verifiers.js +175 -0
- package/dist/server/{actions/verifications.d.ts → collections/otp-records.d.ts} +2 -2
- package/dist/server/collections/otp-records.js +75 -0
- package/dist/server/collections/users-verificators.d.ts +10 -0
- package/dist/server/collections/users-verificators.js +58 -0
- package/dist/server/collections/users-verifiers.d.ts +14 -0
- package/dist/server/collections/users-verifiers.js +58 -0
- package/dist/server/collections/verificators.d.ts +10 -0
- package/dist/server/{actions/index.js → collections/verificators.js} +10 -19
- package/dist/server/collections/verifiers.d.ts +10 -0
- package/dist/server/{providers/index.js → collections/verifiers.js} +10 -15
- package/dist/server/constants.d.ts +0 -2
- package/dist/server/constants.js +2 -8
- package/dist/server/index.d.ts +5 -2
- package/dist/server/index.js +12 -5
- package/dist/server/migrations/20250111192640-providers2verificators.d.ts +14 -0
- package/dist/server/migrations/20250111192640-providers2verificators.js +97 -0
- package/dist/server/migrations/20250507220644-fix-verifier-typo.d.ts +14 -0
- package/dist/server/migrations/20250507220644-fix-verifier-typo.js +86 -0
- package/dist/server/otp-verification/index.d.ts +26 -0
- package/dist/server/otp-verification/index.js +152 -0
- package/dist/server/otp-verification/sms/index.d.ts +37 -0
- package/dist/server/otp-verification/sms/index.js +87 -0
- package/dist/server/{providers/Provider.d.ts → otp-verification/sms/providers/index.d.ts} +2 -4
- package/dist/server/{providers/Provider.js → otp-verification/sms/providers/index.js} +8 -10
- package/dist/server/{providers → otp-verification/sms/providers}/sms-aliyun.d.ts +3 -3
- package/dist/server/{providers → otp-verification/sms/providers}/sms-aliyun.js +4 -4
- package/dist/server/{providers → otp-verification/sms/providers}/sms-tencent.d.ts +3 -3
- package/dist/server/{providers → otp-verification/sms/providers}/sms-tencent.js +4 -4
- package/dist/server/otp-verification/sms/resource/sms-otp-providers.d.ts +16 -0
- package/dist/server/otp-verification/sms/resource/sms-otp-providers.js +41 -0
- package/dist/server/otp-verification/sms/resource/sms-otp.d.ts +18 -0
- package/dist/server/otp-verification/sms/resource/sms-otp.js +141 -0
- package/dist/server/verification-manager.d.ts +68 -0
- package/dist/server/verification-manager.js +223 -0
- package/dist/server/verification.d.ts +70 -0
- package/dist/server/verification.js +70 -0
- package/package.json +8 -6
- package/dist/client/7551e1f2e04bca2f.js +0 -10
- package/dist/client/providerTypes/sms-aliyun.d.ts +0 -66
- package/dist/client/providerTypes/sms-tencent.d.ts +0 -66
- package/dist/server/actions/verifications.js +0 -146
- package/dist/server/providers/index.d.ts +0 -15
|
@@ -0,0 +1,70 @@
|
|
|
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 verifiers_exports = {};
|
|
28
|
+
__export(verifiers_exports, {
|
|
29
|
+
default: () => verifiers_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(verifiers_exports);
|
|
32
|
+
var verifiers_default = {
|
|
33
|
+
name: "verifiers",
|
|
34
|
+
autoGenId: false,
|
|
35
|
+
fields: [
|
|
36
|
+
{
|
|
37
|
+
type: "uid",
|
|
38
|
+
name: "name",
|
|
39
|
+
primaryKey: true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "string",
|
|
43
|
+
name: "title"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "string",
|
|
47
|
+
name: "verificationType"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: "string",
|
|
51
|
+
name: "description"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "jsonb",
|
|
55
|
+
name: "options"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
interface: "m2m",
|
|
59
|
+
type: "belongsToMany",
|
|
60
|
+
name: "users",
|
|
61
|
+
target: "users",
|
|
62
|
+
foreignKey: "verifier",
|
|
63
|
+
otherKey: "userId",
|
|
64
|
+
onDelete: "CASCADE",
|
|
65
|
+
sourceKey: "name",
|
|
66
|
+
targetKey: "id",
|
|
67
|
+
through: "usersVerifiers"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export declare const SMS_OTP_VERIFICATION_TYPE = "sms-otp";
|
|
10
|
+
export declare const PROVIDER_TYPE_SMS_ALIYUN = "sms-aliyun";
|
|
11
|
+
export declare const PROVIDER_TYPE_SMS_TENCENT = "sms-tencent";
|
|
@@ -0,0 +1,42 @@
|
|
|
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 constants_exports = {};
|
|
28
|
+
__export(constants_exports, {
|
|
29
|
+
PROVIDER_TYPE_SMS_ALIYUN: () => PROVIDER_TYPE_SMS_ALIYUN,
|
|
30
|
+
PROVIDER_TYPE_SMS_TENCENT: () => PROVIDER_TYPE_SMS_TENCENT,
|
|
31
|
+
SMS_OTP_VERIFICATION_TYPE: () => SMS_OTP_VERIFICATION_TYPE
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(constants_exports);
|
|
34
|
+
const SMS_OTP_VERIFICATION_TYPE = "sms-otp";
|
|
35
|
+
const PROVIDER_TYPE_SMS_ALIYUN = "sms-aliyun";
|
|
36
|
+
const PROVIDER_TYPE_SMS_TENCENT = "sms-tencent";
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
PROVIDER_TYPE_SMS_ALIYUN,
|
|
40
|
+
PROVIDER_TYPE_SMS_TENCENT,
|
|
41
|
+
SMS_OTP_VERIFICATION_TYPE
|
|
42
|
+
});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,19 +8,20 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@
|
|
12
|
-
"@formily/core": "2.3.0",
|
|
13
|
-
"@formily/react": "2.3.0",
|
|
14
|
-
"ahooks": "3.7.8",
|
|
11
|
+
"@nocobase/client": "1.7.0",
|
|
15
12
|
"react": "18.2.0",
|
|
16
|
-
"
|
|
17
|
-
"antd": "5.12.8",
|
|
18
|
-
"@nocobase/actions": "1.7.0-beta.8",
|
|
19
|
-
"@nocobase/database": "1.7.0-beta.8",
|
|
20
|
-
"@nocobase/resourcer": "1.7.0-beta.8",
|
|
21
|
-
"@nocobase/server": "1.7.0-beta.8",
|
|
22
|
-
"@nocobase/utils": "1.7.0-beta.8",
|
|
23
|
-
"react-i18next": "11.18.6",
|
|
13
|
+
"antd": "5.24.2",
|
|
24
14
|
"@formily/shared": "2.3.2",
|
|
25
|
-
"
|
|
15
|
+
"@formily/react": "2.3.0",
|
|
16
|
+
"@formily/core": "2.3.0",
|
|
17
|
+
"@nocobase/server": "1.7.0",
|
|
18
|
+
"@nocobase/utils": "1.7.0",
|
|
19
|
+
"@nocobase/cache": "1.7.0",
|
|
20
|
+
"@nocobase/actions": "1.7.0",
|
|
21
|
+
"@nocobase/database": "1.7.0",
|
|
22
|
+
"react-i18next": "11.18.6",
|
|
23
|
+
"react-router-dom": "6.28.1",
|
|
24
|
+
"@formily/antd-v5": "1.2.3",
|
|
25
|
+
"@ant-design/icons": "5.6.1",
|
|
26
|
+
"dayjs": "1.11.13"
|
|
26
27
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -18,5 +18,22 @@
|
|
|
18
18
|
"Not a valid cellphone number, please re-enter": "Not a valid cellphone number, please re-enter",
|
|
19
19
|
"Please don't retry in {{time}} seconds": "Please don't retry in {{time}} seconds",
|
|
20
20
|
"You are trying so frequently, please slow down": "You are trying so frequently, please slow down",
|
|
21
|
-
"Verification code is invalid": "Verification code is invalid"
|
|
21
|
+
"Verification code is invalid": "Verification code is invalid",
|
|
22
|
+
"SMS OTP": "SMS OTP",
|
|
23
|
+
"Get one-time codes sent to your phone via SMS to complete authentication requests.": "Get one-time codes sent to your phone via SMS to complete authentication requests.",
|
|
24
|
+
"Unbind": "Unbind",
|
|
25
|
+
"Bind": "Bind",
|
|
26
|
+
"Configured": "Configured",
|
|
27
|
+
"Unbind verifier": "Unbind verifier",
|
|
28
|
+
"Not configured": "Not configured",
|
|
29
|
+
"Unbound successfully": "Unbound successfully",
|
|
30
|
+
"Bound successfully": "Bound successfully",
|
|
31
|
+
"Verification type": "Verification type",
|
|
32
|
+
"Provider": "Provider",
|
|
33
|
+
"Verifier": "Verifier",
|
|
34
|
+
"Verifiers": "Verifiers",
|
|
35
|
+
"The following types of verifiers are available:": "The following types of verifiers are available: ",
|
|
36
|
+
"Go to": "Go to",
|
|
37
|
+
"create verifiers": "create verifiers",
|
|
38
|
+
"Too many failed attempts. Please request a new verification code.": "Too many failed attempts. Please request a new verification code."
|
|
22
39
|
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Verification": "
|
|
2
|
+
"Verification": "验证",
|
|
3
3
|
"Verification providers": "验证码提供商",
|
|
4
4
|
"Provider type": "提供商类型",
|
|
5
5
|
"Aliyun SMS": "阿里云短信服务",
|
|
6
|
+
"Tencent SMS": "腾讯云短信服务",
|
|
6
7
|
"Access Key ID": "Access Key ID",
|
|
7
8
|
"Access Key Secret": "Access Key Secret",
|
|
8
9
|
"Endpoint": "接入点",
|
|
@@ -18,5 +19,22 @@
|
|
|
18
19
|
"Not a valid cellphone number, please re-enter": "不是有效的手机号,请重新输入",
|
|
19
20
|
"Please don't retry in {{time}} seconds": "请 {{time}} 秒后再试",
|
|
20
21
|
"You are trying so frequently, please slow down": "您的操作太频繁,请稍后再试",
|
|
21
|
-
"Verification code is invalid": "无效的验证码"
|
|
22
|
+
"Verification code is invalid": "无效的验证码",
|
|
23
|
+
"SMS OTP": "短信验证码",
|
|
24
|
+
"Get one-time codes sent to your phone via SMS to complete authentication requests.": "获取一次性短信验证码,以完成身份验证请求。",
|
|
25
|
+
"Unbind": "解绑",
|
|
26
|
+
"Bind": "绑定",
|
|
27
|
+
"Configured": "已配置",
|
|
28
|
+
"Unbind verifier": "解绑验证器",
|
|
29
|
+
"Not configured": "未配置",
|
|
30
|
+
"Unbound successfully": "解绑成功",
|
|
31
|
+
"Bound successfully": "绑定成功",
|
|
32
|
+
"Verification type": "验证类型",
|
|
33
|
+
"Provider": "服务商",
|
|
34
|
+
"Verifier": "验证器",
|
|
35
|
+
"Verifiers": "验证器",
|
|
36
|
+
"The following types of verifiers are available:": "以下类型的验证器可选:",
|
|
37
|
+
"Go to": "前往",
|
|
38
|
+
"create verifiers": "创建验证器",
|
|
39
|
+
"Too many failed attempts. Please request a new verification code.": "验证失败次数过多,请重新获取验证码。"
|
|
22
40
|
}
|