@yongdall/user 0.3.0 → 0.4.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/hooks.yongdall.mjs +7 -1
- package/hooks.yongdall.mjs.map +1 -1
- package/package.json +9 -9
package/hooks.yongdall.mjs
CHANGED
|
@@ -29,7 +29,13 @@ const userManager = {
|
|
|
29
29
|
return Boolean(await loadUserInfo(userId).then((u) => login ? u?.enabled : u));
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
const enumerations = { page: [{
|
|
33
|
+
page: "@yongdall/user#password",
|
|
34
|
+
label: "修改用户密码",
|
|
35
|
+
type: "configuration",
|
|
36
|
+
applicationPage: "configuration"
|
|
37
|
+
}] };
|
|
32
38
|
|
|
33
39
|
//#endregion
|
|
34
|
-
export { migrationModels, models, userManager };
|
|
40
|
+
export { enumerations, migrationModels, models, userManager };
|
|
35
41
|
//# sourceMappingURL=hooks.yongdall.mjs.map
|
package/hooks.yongdall.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.yongdall.mjs","names":["User","UserAccount","UserPassword"],"sources":["../../plugins/user/hooks.yongdall.mjs"],"sourcesContent":["/** @import { Hooks } from '@yongdall/core' */\nimport { getUser } from '@yongdall/core';\nimport { User, UserAccount, UserPassword, loadUserInfo, findUser, verifyPassword, getPasswordHash, setPassword } from './index.mjs';\n\n/** @type {Hooks.Define['models']} */\nexport const models = {\n\tuser: User,\n};\n\n/** @type {Hooks.Define['migrationModels']} */\nexport const migrationModels = [\n\tUser,\n\tUserAccount,\n\tUserPassword,\n];\n\n/** @type {Partial<Hooks['userManager']>} */\nexport const userManager = {\n\tfind(account, types) {\n\t\tif (typeof account !== 'string') { return ''; }\n\t\treturn findUser(account, types);\n\t},\n\tverify: {\n\t\tpassword(userId, password) {\n\t\t\treturn verifyPassword(userId, password);\n\t\t}\n\t},\n\tsetVerify: {\n\t\tpassword(userId, password, deadline) {\n\t\t\treturn setPassword(userId, password, deadline);\n\t\t}\n\n\t},\n\tasync load(userId) {\n\t\treturn await loadUserInfo(userId) || {};\n\t},\n\tasync exist(userId, login) {\n\t\treturn Boolean(await loadUserInfo(userId).then(u => login ? u?.enabled : u));\n\t}\n};\n"],"mappings":";;;;;AAKA,MAAa,SAAS,EACrB,MAAMA,cACN;;AAGD,MAAa,kBAAkB;CAC9BA;CACAC;CACAC;CACA;;AAGD,MAAa,cAAc;CAC1B,KAAK,SAAS,OAAO;AACpB,MAAI,OAAO,YAAY,SAAY,QAAO;AAC1C,SAAO,SAAS,SAAS,MAAM;;CAEhC,QAAQ,EACP,SAAS,QAAQ,UAAU;AAC1B,SAAO,eAAe,QAAQ,SAAS;IAExC;CACD,WAAW,EACV,SAAS,QAAQ,UAAU,UAAU;AACpC,SAAO,YAAY,QAAQ,UAAU,SAAS;IAG/C;CACD,MAAM,KAAK,QAAQ;AAClB,SAAO,MAAM,aAAa,OAAO,IAAI,EAAE;;CAExC,MAAM,MAAM,QAAQ,OAAO;AAC1B,SAAO,QAAQ,MAAM,aAAa,OAAO,CAAC,MAAK,MAAK,QAAQ,GAAG,UAAU,EAAE,CAAC;;CAE7E"}
|
|
1
|
+
{"version":3,"file":"hooks.yongdall.mjs","names":["User","UserAccount","UserPassword"],"sources":["../../plugins/user/hooks.yongdall.mjs"],"sourcesContent":["/** @import { Hooks } from '@yongdall/core' */\nimport { getUser } from '@yongdall/core';\nimport { User, UserAccount, UserPassword, loadUserInfo, findUser, verifyPassword, getPasswordHash, setPassword } from './index.mjs';\n\n/** @type {Hooks.Define['models']} */\nexport const models = {\n\tuser: User,\n};\n\n/** @type {Hooks.Define['migrationModels']} */\nexport const migrationModels = [\n\tUser,\n\tUserAccount,\n\tUserPassword,\n];\n\n/** @type {Partial<Hooks['userManager']>} */\nexport const userManager = {\n\tfind(account, types) {\n\t\tif (typeof account !== 'string') { return ''; }\n\t\treturn findUser(account, types);\n\t},\n\tverify: {\n\t\tpassword(userId, password) {\n\t\t\treturn verifyPassword(userId, password);\n\t\t}\n\t},\n\tsetVerify: {\n\t\tpassword(userId, password, deadline) {\n\t\t\treturn setPassword(userId, password, deadline);\n\t\t}\n\n\t},\n\tasync load(userId) {\n\t\treturn await loadUserInfo(userId) || {};\n\t},\n\tasync exist(userId, login) {\n\t\treturn Boolean(await loadUserInfo(userId).then(u => login ? u?.enabled : u));\n\t}\n};\n\nexport const enumerations = {\n\tpage: [\n\t\t{ page: '@yongdall/user#password', label: '修改用户密码', type: 'configuration', applicationPage: 'configuration' },\n\t]\n};\n"],"mappings":";;;;;AAKA,MAAa,SAAS,EACrB,MAAMA,cACN;;AAGD,MAAa,kBAAkB;CAC9BA;CACAC;CACAC;CACA;;AAGD,MAAa,cAAc;CAC1B,KAAK,SAAS,OAAO;AACpB,MAAI,OAAO,YAAY,SAAY,QAAO;AAC1C,SAAO,SAAS,SAAS,MAAM;;CAEhC,QAAQ,EACP,SAAS,QAAQ,UAAU;AAC1B,SAAO,eAAe,QAAQ,SAAS;IAExC;CACD,WAAW,EACV,SAAS,QAAQ,UAAU,UAAU;AACpC,SAAO,YAAY,QAAQ,UAAU,SAAS;IAG/C;CACD,MAAM,KAAK,QAAQ;AAClB,SAAO,MAAM,aAAa,OAAO,IAAI,EAAE;;CAExC,MAAM,MAAM,QAAQ,OAAO;AAC1B,SAAO,QAAQ,MAAM,aAAa,OAAO,CAAC,MAAK,MAAK,QAAQ,GAAG,UAAU,EAAE,CAAC;;CAE7E;AAED,MAAa,eAAe,EAC3B,MAAM,CACL;CAAE,MAAM;CAA2B,OAAO;CAAU,MAAM;CAAiB,iBAAiB;CAAiB,CAC7G,EACD"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yongdall/user",
|
|
3
|
+
"version": "0.4.0",
|
|
3
4
|
"type": "module",
|
|
4
5
|
"main": "./index.mjs",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": "./index.mjs",
|
|
7
8
|
"./assets": "./assets/index.mjs"
|
|
8
9
|
},
|
|
9
|
-
"version": "0.3.0",
|
|
10
10
|
"description": "",
|
|
11
11
|
"keywords": [],
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@yongdall/connection": "^0.
|
|
16
|
-
"@yongdall/context": "^0.
|
|
17
|
-
"@yongdall/model": "^0.
|
|
18
|
-
"@yongdall/core": "^0.
|
|
19
|
-
"@yongdall/http": "^0.
|
|
15
|
+
"@yongdall/connection": "^0.4.0",
|
|
16
|
+
"@yongdall/context": "^0.4.0",
|
|
17
|
+
"@yongdall/model": "^0.4.0",
|
|
18
|
+
"@yongdall/core": "^0.4.0",
|
|
19
|
+
"@yongdall/http": "^0.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@yongdall/web": "^0.
|
|
23
|
-
"@yongdall/types": "^0.
|
|
22
|
+
"@yongdall/web": "^0.4.0",
|
|
23
|
+
"@yongdall/types": "^0.4.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@yongdall/web": "^0.
|
|
26
|
+
"@yongdall/web": "^0.4.0"
|
|
27
27
|
}
|
|
28
28
|
}
|