@tachybase/module-auth 0.23.8
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/.turbo/turbo-build.log +14 -0
- package/README.md +117 -0
- package/client.d.ts +2 -0
- package/client.js +65 -0
- package/dist/client/AuthProvider.d.ts +2 -0
- package/dist/client/authenticator.d.ts +12 -0
- package/dist/client/basic/Options.d.ts +2 -0
- package/dist/client/basic/SignInForm.d.ts +9 -0
- package/dist/client/basic/SignUpForm.d.ts +13 -0
- package/dist/client/basic/index.d.ts +3 -0
- package/dist/client/bind/AuthenticatorBind.d.ts +2 -0
- package/dist/client/bind/BindForm.d.ts +5 -0
- package/dist/client/bind/schemas/authenticators.d.ts +2 -0
- package/dist/client/index.d.ts +30 -0
- package/dist/client/index.js +22 -0
- package/dist/client/locale/index.d.ts +2 -0
- package/dist/client/pages/AuthLayout.d.ts +2 -0
- package/dist/client/pages/SignInPage.d.ts +13 -0
- package/dist/client/pages/SignUpPage.d.ts +20 -0
- package/dist/client/pages/index.d.ts +3 -0
- package/dist/client/settings/Authenticator.d.ts +2 -0
- package/dist/client/settings/Options.d.ts +4 -0
- package/dist/client/settings/authType.d.ts +15 -0
- package/dist/client/settings/schemas/authenticators.d.ts +3 -0
- package/dist/externalVersion.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +40 -0
- package/dist/locale/en-US.json +31 -0
- package/dist/locale/ko_KR.json +26 -0
- package/dist/locale/zh-CN.json +31 -0
- package/dist/node_modules/cron/LICENSE +8 -0
- package/dist/node_modules/cron/dist/constants.d.ts +74 -0
- package/dist/node_modules/cron/dist/constants.js +78 -0
- package/dist/node_modules/cron/dist/errors.d.ts +5 -0
- package/dist/node_modules/cron/dist/errors.js +13 -0
- package/dist/node_modules/cron/dist/index.d.ts +6 -0
- package/dist/node_modules/cron/dist/index.js +1 -0
- package/dist/node_modules/cron/dist/job.d.ts +30 -0
- package/dist/node_modules/cron/dist/job.js +222 -0
- package/dist/node_modules/cron/dist/time.d.ts +33 -0
- package/dist/node_modules/cron/dist/time.js +444 -0
- package/dist/node_modules/cron/dist/types/cron.types.d.ts +50 -0
- package/dist/node_modules/cron/dist/types/cron.types.js +3 -0
- package/dist/node_modules/cron/dist/types/utils.d.ts +3 -0
- package/dist/node_modules/cron/dist/types/utils.js +3 -0
- package/dist/node_modules/cron/dist/utils.d.ts +2 -0
- package/dist/node_modules/cron/dist/utils.js +8 -0
- package/dist/node_modules/cron/package.json +1 -0
- package/dist/preset.d.ts +3 -0
- package/dist/preset.js +34 -0
- package/dist/server/actions/auth.d.ts +8 -0
- package/dist/server/actions/auth.js +40 -0
- package/dist/server/actions/authenticators.d.ts +10 -0
- package/dist/server/actions/authenticators.js +153 -0
- package/dist/server/basic-auth.d.ts +10 -0
- package/dist/server/basic-auth.js +176 -0
- package/dist/server/collections/authenticators.d.ts +5 -0
- package/dist/server/collections/authenticators.js +117 -0
- package/dist/server/collections/token-blacklist.d.ts +2 -0
- package/dist/server/collections/token-blacklist.js +42 -0
- package/dist/server/collections/users-authenticators.d.ts +6 -0
- package/dist/server/collections/users-authenticators.js +85 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +42 -0
- package/dist/server/locale/en-US.d.ts +9 -0
- package/dist/server/locale/en-US.js +30 -0
- package/dist/server/locale/fr-FR.d.ts +9 -0
- package/dist/server/locale/fr-FR.js +30 -0
- package/dist/server/locale/index.d.ts +3 -0
- package/dist/server/locale/index.js +43 -0
- package/dist/server/locale/ja-JP.d.ts +5 -0
- package/dist/server/locale/ja-JP.js +26 -0
- package/dist/server/locale/pt-BR.d.ts +9 -0
- package/dist/server/locale/pt-BR.js +30 -0
- package/dist/server/locale/zh-CN.d.ts +11 -0
- package/dist/server/locale/zh-CN.js +32 -0
- package/dist/server/migrations/20230506152253-basic-authenticator.d.ts +6 -0
- package/dist/server/migrations/20230506152253-basic-authenticator.js +44 -0
- package/dist/server/migrations/20230607174500-update-basic.d.ts +6 -0
- package/dist/server/migrations/20230607174500-update-basic.js +47 -0
- package/dist/server/migrations/20231218132032-fix-allow-signup.d.ts +6 -0
- package/dist/server/migrations/20231218132032-fix-allow-signup.js +55 -0
- package/dist/server/model/authenticator.d.ts +10 -0
- package/dist/server/model/authenticator.js +81 -0
- package/dist/server/plugin.d.ts +11 -0
- package/dist/server/plugin.js +132 -0
- package/dist/server/storer.d.ts +16 -0
- package/dist/server/storer.js +69 -0
- package/dist/server/token-blacklist.d.ts +17 -0
- package/dist/server/token-blacklist.js +86 -0
- package/dist/swagger/index.d.ts +754 -0
- package/dist/swagger/index.js +787 -0
- package/package.json +34 -0
- package/server.d.ts +2 -0
- package/server.js +65 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var token_blacklist_exports = {};
|
|
19
|
+
__export(token_blacklist_exports, {
|
|
20
|
+
default: () => token_blacklist_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(token_blacklist_exports);
|
|
23
|
+
var import_database = require("@tachybase/database");
|
|
24
|
+
var token_blacklist_default = (0, import_database.defineCollection)({
|
|
25
|
+
dumpRules: {
|
|
26
|
+
group: "log"
|
|
27
|
+
},
|
|
28
|
+
shared: true,
|
|
29
|
+
name: "tokenBlacklist",
|
|
30
|
+
model: "TokenBlacklistModel",
|
|
31
|
+
fields: [
|
|
32
|
+
{
|
|
33
|
+
type: "string",
|
|
34
|
+
name: "token",
|
|
35
|
+
index: true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: "date",
|
|
39
|
+
name: "expiration"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var users_authenticators_exports = {};
|
|
19
|
+
__export(users_authenticators_exports, {
|
|
20
|
+
default: () => users_authenticators_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(users_authenticators_exports);
|
|
23
|
+
var import_database = require("@tachybase/database");
|
|
24
|
+
var users_authenticators_default = (0, import_database.defineCollection)({
|
|
25
|
+
dumpRules: {
|
|
26
|
+
group: "user"
|
|
27
|
+
},
|
|
28
|
+
shared: true,
|
|
29
|
+
name: "usersAuthenticators",
|
|
30
|
+
model: "UserAuthModel",
|
|
31
|
+
createdBy: true,
|
|
32
|
+
updatedBy: true,
|
|
33
|
+
logging: true,
|
|
34
|
+
fields: [
|
|
35
|
+
/**
|
|
36
|
+
* uuid:
|
|
37
|
+
* Unique user id of the authentication method, such as wechat openid, phone number, etc.
|
|
38
|
+
*/
|
|
39
|
+
{
|
|
40
|
+
name: "uuid",
|
|
41
|
+
interface: "input",
|
|
42
|
+
type: "string",
|
|
43
|
+
allowNull: false,
|
|
44
|
+
uiSchema: {
|
|
45
|
+
type: "string",
|
|
46
|
+
title: '{{t("UUID")}}',
|
|
47
|
+
"x-component": "Input",
|
|
48
|
+
required: true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
interface: "input",
|
|
53
|
+
type: "string",
|
|
54
|
+
name: "nickname",
|
|
55
|
+
allowNull: false,
|
|
56
|
+
defaultValue: "",
|
|
57
|
+
uiSchema: {
|
|
58
|
+
type: "string",
|
|
59
|
+
title: '{{t("Nickname")}}',
|
|
60
|
+
"x-component": "Input"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
interface: "attachment",
|
|
65
|
+
type: "string",
|
|
66
|
+
name: "avatar",
|
|
67
|
+
allowNull: false,
|
|
68
|
+
defaultValue: "",
|
|
69
|
+
uiSchema: {
|
|
70
|
+
type: "string",
|
|
71
|
+
title: '{{t("Avatar")}}',
|
|
72
|
+
"x-component": "Upload"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* meta:
|
|
77
|
+
* Metadata, some other information of the authentication method.
|
|
78
|
+
*/
|
|
79
|
+
{
|
|
80
|
+
type: "json",
|
|
81
|
+
name: "meta",
|
|
82
|
+
defaultValue: {}
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var server_exports = {};
|
|
29
|
+
__export(server_exports, {
|
|
30
|
+
AuthModel: () => import_authenticator.AuthModel,
|
|
31
|
+
BasicAuth: () => import_basic_auth.BasicAuth,
|
|
32
|
+
default: () => import_plugin.default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(server_exports);
|
|
35
|
+
var import_basic_auth = require("./basic-auth");
|
|
36
|
+
var import_authenticator = require("./model/authenticator");
|
|
37
|
+
var import_plugin = __toESM(require("./plugin"));
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
AuthModel,
|
|
41
|
+
BasicAuth
|
|
42
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'The email is incorrect, please re-enter': string;
|
|
3
|
+
'Please fill in your email address': string;
|
|
4
|
+
'The password is incorrect, please re-enter': string;
|
|
5
|
+
'Not a valid cellphone number, please re-enter': string;
|
|
6
|
+
'The phone number has been registered, please login directly': string;
|
|
7
|
+
'The phone number is not registered, please register first': string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var en_US_exports = {};
|
|
19
|
+
__export(en_US_exports, {
|
|
20
|
+
default: () => en_US_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(en_US_exports);
|
|
23
|
+
var en_US_default = {
|
|
24
|
+
"The email is incorrect, please re-enter": "The email is incorrect, please re-enter",
|
|
25
|
+
"Please fill in your email address": "Please fill in your email address",
|
|
26
|
+
"The password is incorrect, please re-enter": "The password is incorrect, please re-enter",
|
|
27
|
+
"Not a valid cellphone number, please re-enter": "Not a valid cellphone number, please re-enter",
|
|
28
|
+
"The phone number has been registered, please login directly": "The phone number has been registered, please login directly",
|
|
29
|
+
"The phone number is not registered, please register first": "The phone number is not registered, please register first"
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'The email is incorrect, please re-enter': string;
|
|
3
|
+
'Please fill in your email address': string;
|
|
4
|
+
'The password is incorrect, please re-enter': string;
|
|
5
|
+
'Not a valid cellphone number, please re-enter': string;
|
|
6
|
+
'The phone number has been registered, please login directly': string;
|
|
7
|
+
'The phone number is not registered, please register first': string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var fr_FR_exports = {};
|
|
19
|
+
__export(fr_FR_exports, {
|
|
20
|
+
default: () => fr_FR_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(fr_FR_exports);
|
|
23
|
+
var fr_FR_default = {
|
|
24
|
+
"The email is incorrect, please re-enter": "L'email est incorrect, veuillez le saisir \xE0 nouveau",
|
|
25
|
+
"Please fill in your email address": "Veuillez remplir votre adresse e-mail",
|
|
26
|
+
"The password is incorrect, please re-enter": "Le mot de passe est incorrect, veuillez le saisir \xE0 nouveau",
|
|
27
|
+
"Not a valid cellphone number, please re-enter": "Num\xE9ro de t\xE9l\xE9phone portable non valide, veuillez le saisir \xE0 nouveau",
|
|
28
|
+
"The phone number has been registered, please login directly": "Le num\xE9ro de t\xE9l\xE9phone a \xE9t\xE9 enregistr\xE9, veuillez vous connecter directement",
|
|
29
|
+
"The phone number is not registered, please register first": "Le num\xE9ro de t\xE9l\xE9phone n'est pas enregistr\xE9, veuillez vous inscrire d'abord"
|
|
30
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var locale_exports = {};
|
|
29
|
+
__export(locale_exports, {
|
|
30
|
+
enUS: () => import_en_US.default,
|
|
31
|
+
ptBR: () => import_pt_BR.default,
|
|
32
|
+
zhCN: () => import_zh_CN.default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(locale_exports);
|
|
35
|
+
var import_en_US = __toESM(require("./en-US"));
|
|
36
|
+
var import_zh_CN = __toESM(require("./zh-CN"));
|
|
37
|
+
var import_pt_BR = __toESM(require("./pt-BR"));
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
enUS,
|
|
41
|
+
ptBR,
|
|
42
|
+
zhCN
|
|
43
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var ja_JP_exports = {};
|
|
19
|
+
__export(ja_JP_exports, {
|
|
20
|
+
default: () => ja_JP_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(ja_JP_exports);
|
|
23
|
+
var ja_JP_default = {
|
|
24
|
+
"Please fill in your email address": "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
25
|
+
"The password is incorrect, please re-enter": "\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002\u518D\u5EA6\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'The email is incorrect, please re-enter': string;
|
|
3
|
+
'Please fill in your email address': string;
|
|
4
|
+
'The password is incorrect, please re-enter': string;
|
|
5
|
+
'Not a valid cellphone number, please re-enter': string;
|
|
6
|
+
'The phone number has been registered, please login directly': string;
|
|
7
|
+
'The phone number is not registered, please register first': string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var pt_BR_exports = {};
|
|
19
|
+
__export(pt_BR_exports, {
|
|
20
|
+
default: () => pt_BR_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pt_BR_exports);
|
|
23
|
+
var pt_BR_default = {
|
|
24
|
+
"The email is incorrect, please re-enter": "O e-mail est\xE1 incorreto, por favor, digite novamente",
|
|
25
|
+
"Please fill in your email address": "Por favor, preencha o seu endere\xE7o de e-mail",
|
|
26
|
+
"The password is incorrect, please re-enter": "A senha est\xE1 incorreta, por favor, digite novamente",
|
|
27
|
+
"Not a valid cellphone number, please re-enter": "N\xFAmero de celular inv\xE1lido, por favor, digite novamente",
|
|
28
|
+
"The phone number has been registered, please login directly": "O n\xFAmero de celular j\xE1 est\xE1 registrado, por favor, fa\xE7a login diretamente",
|
|
29
|
+
"The phone number is not registered, please register first": "O n\xFAmero de celular n\xE3o est\xE1 registrado, por favor, registre-se primeiro"
|
|
30
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'The username or email is incorrect, please re-enter': string;
|
|
3
|
+
'The password is incorrect, please re-enter': string;
|
|
4
|
+
'Not a valid cellphone number, please re-enter': string;
|
|
5
|
+
'The phone number has been registered, please login directly': string;
|
|
6
|
+
'The phone number is not registered, please register first': string;
|
|
7
|
+
'Please keep and enable at least one authenticator': string;
|
|
8
|
+
'Please enter your username or email': string;
|
|
9
|
+
'Please enter a valid username': string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var zh_CN_exports = {};
|
|
19
|
+
__export(zh_CN_exports, {
|
|
20
|
+
default: () => zh_CN_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(zh_CN_exports);
|
|
23
|
+
var zh_CN_default = {
|
|
24
|
+
"The username or email is incorrect, please re-enter": "\u7528\u6237\u540D\u6216\u90AE\u7BB1\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
|
|
25
|
+
"The password is incorrect, please re-enter": "\u5BC6\u7801\u6709\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
|
|
26
|
+
"Not a valid cellphone number, please re-enter": "\u4E0D\u662F\u6709\u6548\u7684\u624B\u673A\u53F7\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165",
|
|
27
|
+
"The phone number has been registered, please login directly": "\u624B\u673A\u53F7\u5DF2\u6CE8\u518C\uFF0C\u8BF7\u76F4\u63A5\u767B\u5F55",
|
|
28
|
+
"The phone number is not registered, please register first": "\u624B\u673A\u53F7\u672A\u6CE8\u518C\uFF0C\u8BF7\u5148\u6CE8\u518C",
|
|
29
|
+
"Please keep and enable at least one authenticator": "\u8BF7\u81F3\u5C11\u4FDD\u7559\u5E76\u542F\u7528\u4E00\u4E2A\u8BA4\u8BC1\u5668",
|
|
30
|
+
"Please enter your username or email": "\u8BF7\u8F93\u5165\u7528\u6237\u540D\u6216\u90AE\u7BB1",
|
|
31
|
+
"Please enter a valid username": "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7528\u6237\u540D"
|
|
32
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var basic_authenticator_exports = {};
|
|
19
|
+
__export(basic_authenticator_exports, {
|
|
20
|
+
default: () => AddBasicAuthMigration
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(basic_authenticator_exports);
|
|
23
|
+
var import_server = require("@tachybase/server");
|
|
24
|
+
var import_preset = require("../../preset");
|
|
25
|
+
class AddBasicAuthMigration extends import_server.Migration {
|
|
26
|
+
appVersion = "<0.14.0-alpha.1";
|
|
27
|
+
async up() {
|
|
28
|
+
const repo = this.context.db.getRepository("authenticators");
|
|
29
|
+
const existed = await repo.count();
|
|
30
|
+
if (existed) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
await repo.create({
|
|
34
|
+
values: {
|
|
35
|
+
name: import_preset.presetAuthenticator,
|
|
36
|
+
authType: import_preset.presetAuthType,
|
|
37
|
+
description: "Sign in with username/email.",
|
|
38
|
+
enabled: true
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async down() {
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var update_basic_exports = {};
|
|
19
|
+
__export(update_basic_exports, {
|
|
20
|
+
default: () => UpdateBasicAuthMigration
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(update_basic_exports);
|
|
23
|
+
var import_server = require("@tachybase/server");
|
|
24
|
+
var import_preset = require("../../preset");
|
|
25
|
+
class UpdateBasicAuthMigration extends import_server.Migration {
|
|
26
|
+
appVersion = "<0.14.0-alpha.1";
|
|
27
|
+
async up() {
|
|
28
|
+
const SystemSetting = this.context.db.getRepository("systemSettings");
|
|
29
|
+
const setting = await SystemSetting.findOne();
|
|
30
|
+
const allowSignUp = setting.get("allowSignUp") ? true : false;
|
|
31
|
+
const repo = this.context.db.getRepository("authenticators");
|
|
32
|
+
await repo.update({
|
|
33
|
+
values: {
|
|
34
|
+
options: {
|
|
35
|
+
public: {
|
|
36
|
+
allowSignUp
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
filter: {
|
|
41
|
+
name: import_preset.presetAuthenticator
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async down() {
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var fix_allow_signup_exports = {};
|
|
19
|
+
__export(fix_allow_signup_exports, {
|
|
20
|
+
default: () => FixAllowSignUpMigration
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(fix_allow_signup_exports);
|
|
23
|
+
var import_server = require("@tachybase/server");
|
|
24
|
+
var import_preset = require("../../preset");
|
|
25
|
+
class FixAllowSignUpMigration extends import_server.Migration {
|
|
26
|
+
appVersion = "<0.18.0-alpha.1";
|
|
27
|
+
async up() {
|
|
28
|
+
var _a;
|
|
29
|
+
const repo = this.context.db.getRepository("authenticators");
|
|
30
|
+
const authenticators = await repo.find({
|
|
31
|
+
filter: {
|
|
32
|
+
authType: import_preset.presetAuthType
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
for (const authenticator of authenticators) {
|
|
36
|
+
const options = authenticator.get("options");
|
|
37
|
+
const oldAllowSignUp = (_a = options == null ? void 0 : options.public) == null ? void 0 : _a.allowSignup;
|
|
38
|
+
if (oldAllowSignUp === void 0 || oldAllowSignUp === null) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
options.public.allowSignUp = oldAllowSignUp;
|
|
42
|
+
delete options.public.allowSignup;
|
|
43
|
+
await repo.update({
|
|
44
|
+
values: {
|
|
45
|
+
options
|
|
46
|
+
},
|
|
47
|
+
filter: {
|
|
48
|
+
name: authenticator.name
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async down() {
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Authenticator } from '@tachybase/auth';
|
|
2
|
+
import { Model } from '@tachybase/database';
|
|
3
|
+
export declare class AuthModel extends Model implements Authenticator {
|
|
4
|
+
authType: string;
|
|
5
|
+
options: any;
|
|
6
|
+
findUser(uuid: string): Promise<Model<any, any>>;
|
|
7
|
+
newUser(uuid: string, userValues?: any): Promise<Model<any, any>>;
|
|
8
|
+
findOrCreateUser(uuid: string, userValues?: any): Promise<Model<any, any>>;
|
|
9
|
+
bindUser(userId: number, uuid: string, info: Record<string, any>): Promise<void>;
|
|
10
|
+
}
|