@kne/fastify-account 1.0.0-alpha.9 → 2.0.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 (44) hide show
  1. package/README.md +6 -2046
  2. package/index.js +34 -21
  3. package/libs/controllers/account.js +246 -173
  4. package/libs/controllers/admin-user.js +110 -0
  5. package/libs/controllers/admin.js +55 -146
  6. package/libs/controllers/user.js +7 -24
  7. package/libs/models/example._js +13 -0
  8. package/libs/models/user-account.js +13 -32
  9. package/libs/models/user.js +37 -36
  10. package/libs/models/verification-code.js +16 -21
  11. package/libs/services/account.js +124 -149
  12. package/libs/services/admin.js +21 -73
  13. package/libs/services/user.js +52 -58
  14. package/package.json +24 -28
  15. package/libs/controllers/adminPermission.js +0 -237
  16. package/libs/controllers/adminRole.js +0 -146
  17. package/libs/controllers/adminTenant.js +0 -464
  18. package/libs/controllers/tenant.js +0 -34
  19. package/libs/models/admin-role.js +0 -15
  20. package/libs/models/application.js +0 -42
  21. package/libs/models/login-log.js +0 -11
  22. package/libs/models/permission.js +0 -51
  23. package/libs/models/tenant-application.js +0 -26
  24. package/libs/models/tenant-org.js +0 -26
  25. package/libs/models/tenant-permission.js +0 -26
  26. package/libs/models/tenant-role-application.js +0 -37
  27. package/libs/models/tenant-role-permission.js +0 -34
  28. package/libs/models/tenant-role.js +0 -23
  29. package/libs/models/tenant-share-group-permission.js +0 -18
  30. package/libs/models/tenant-share-group.js +0 -18
  31. package/libs/models/tenant-source-user-share-group.js +0 -18
  32. package/libs/models/tenant-token.js +0 -30
  33. package/libs/models/tenant-user-org.js +0 -23
  34. package/libs/models/tenant-user-role.js +0 -23
  35. package/libs/models/tenant-user-share-group.js +0 -18
  36. package/libs/models/tenant-user.js +0 -75
  37. package/libs/models/tenant.js +0 -46
  38. package/libs/services/application.js +0 -151
  39. package/libs/services/permission.js +0 -367
  40. package/libs/services/tenant-invite.js +0 -62
  41. package/libs/services/tenant-org.js +0 -97
  42. package/libs/services/tenant-role.js +0 -108
  43. package/libs/services/tenant-user.js +0 -555
  44. package/libs/services/tenant.js +0 -132
@@ -1,69 +1,93 @@
1
1
  const fp = require('fastify-plugin');
2
- const dayjs = require('dayjs');
2
+ const crypto = require('node:crypto');
3
3
  const bcrypt = require('bcryptjs');
4
- const crypto = require('crypto');
4
+ const dayjs = require('dayjs');
5
5
 
6
- function generateRandom6DigitNumber() {
6
+ const generateRandom6DigitNumber = () => {
7
7
  const randomNumber = Math.random() * 1000000;
8
8
  return Math.floor(randomNumber).toString().padStart(6, '0');
9
- }
9
+ };
10
10
 
11
- function userNameIsEmail(username) {
11
+ const userNameIsEmail = username => {
12
12
  return /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(username);
13
- }
13
+ };
14
14
 
15
- module.exports = fp(async (fastify, options) => {
16
- const { models, services } = fastify.account;
17
- const login = async ({ username, password, ip }) => {
18
- const isEmail = userNameIsEmail(username);
19
- const user = await models.user.findOne({
20
- where: Object.assign(
21
- {},
22
- isEmail
23
- ? {
24
- email: username
25
- }
26
- : {
27
- phone: username
28
- },
29
- {
30
- status: {
31
- [fastify.sequelize.Sequelize.Op.or]: [0, 1]
32
- }
15
+ const md5 = value => {
16
+ const hash = crypto.createHash('md5');
17
+ hash.update(value);
18
+ return hash.digest('hex');
19
+ };
20
+
21
+ const accountService = fp(async (fastify, options) => {
22
+ const { models, services } = fastify[options.name];
23
+ const { Op } = fastify.sequelize.Sequelize;
24
+ const verificationCodeValidate = async ({ name, type, code }) => {
25
+ const verificationCode = await models.verificationCode.findOne({
26
+ where: {
27
+ name,
28
+ type,
29
+ code,
30
+ status: {
31
+ [fastify.sequelize.Sequelize.Op.or]: [0, 1]
33
32
  }
34
- )
33
+ }
35
34
  });
35
+ const isPass = !!(verificationCode && dayjs().isBefore(dayjs(verificationCode.createdAt).add(10, 'minute')));
36
36
 
37
- if (!user) {
38
- throw new Error('用户名或密码错误');
37
+ if (verificationCode) {
38
+ verificationCode.status = isPass ? 1 : 2;
39
+ await verificationCode.save();
39
40
  }
40
41
 
41
- await passwordAuthentication({ accountId: user.userAccountId, password });
42
+ return isPass;
43
+ };
42
44
 
43
- await models.loginLog.create({
44
- userId: user.uuid,
45
- ip
45
+ const generateVerificationCode = async ({ name, type }) => {
46
+ const code = generateRandom6DigitNumber();
47
+ await models.verificationCode.update(
48
+ {
49
+ status: 2
50
+ },
51
+ {
52
+ where: {
53
+ name,
54
+ type,
55
+ status: 0
56
+ }
57
+ }
58
+ );
59
+ await models.verificationCode.create({
60
+ name,
61
+ type,
62
+ code
46
63
  });
64
+ return code;
65
+ };
47
66
 
48
- return {
49
- token: fastify.jwt.sign({ payload: { id: user.uuid } }),
50
- user: Object.assign({}, user.get({ plain: true }), { id: user.uuid })
51
- };
67
+ const sendVerificationCode = async ({ name, type }) => {
68
+ // messageType: 0:短信验证码,1:邮件验证码 type: 0:注册,2:登录,4:验证租户管理员,5:忘记密码
69
+ const code = await generateVerificationCode({ name, type });
70
+ const isEmail = userNameIsEmail(name);
71
+ // 这里写发送逻辑
72
+ await options.sendMessage({ name, type, messageType: isEmail ? 1 : 0, props: { code } });
73
+ return code;
52
74
  };
53
75
 
54
- const passwordAuthentication = async ({ accountId, password }) => {
55
- const userAccount = await models.userAccount.findOne({
56
- where: {
57
- uuid: accountId
58
- }
59
- });
60
- if (!userAccount) {
61
- throw new Error('账号不存在');
62
- }
63
- const generatedHash = await bcrypt.hash(password + userAccount.salt, userAccount.salt);
64
- if (userAccount.password !== generatedHash) {
65
- throw new Error('用户名或密码错误');
76
+ const sendJWTVerificationCode = async ({ name, type }) => {
77
+ const code = await generateVerificationCode({ name, type });
78
+ const token = fastify.jwt.sign({ name, type, code });
79
+ const isEmail = userNameIsEmail(name);
80
+ // 这里写发送逻辑
81
+ await options.sendMessage({ name, type, messageType: isEmail ? 1 : 0, props: { token } });
82
+ return token;
83
+ };
84
+
85
+ const verificationJWTCodeValidate = async ({ token }) => {
86
+ const { iat, name, type, code } = fastify.jwt.decode(token);
87
+ if (!(await verificationCodeValidate({ name, type, code }))) {
88
+ throw new Error('验证码不正确或者已经过期');
66
89
  }
90
+ return { name, type, code };
67
91
  };
68
92
 
69
93
  const passwordEncryption = async password => {
@@ -77,45 +101,23 @@ module.exports = fp(async (fastify, options) => {
77
101
  };
78
102
  };
79
103
 
80
- const md5 = value => {
81
- const hash = crypto.createHash('md5');
82
- hash.update(value);
83
- return hash.digest('hex');
84
- };
85
-
86
- const resetPassword = async ({ userId, password }) => {
87
- const userInfo = await models.user.findOne({
88
- where: { uuid: userId }
89
- });
90
- if (!userInfo) {
91
- throw new Error('用户不存在');
104
+ const passwordAuthentication = async ({ accountId, password }) => {
105
+ const userAccount = await models.userAccount.findByPk(accountId);
106
+ if (!userAccount) {
107
+ throw new Error('账号不存在');
108
+ }
109
+ const generatedHash = await bcrypt.hash(password + userAccount.salt, userAccount.salt);
110
+ if (userAccount.password !== generatedHash) {
111
+ throw new Error('用户名或密码错误');
92
112
  }
93
- const account = await models.userAccount.create(
94
- Object.assign({}, await passwordEncryption(password), {
95
- belongToUserId: userId
96
- })
97
- );
98
-
99
- await userInfo.update({ userAccountId: account.uuid });
100
113
  };
101
114
 
102
- const register = async ({ avatar, nickname, gender, birthday, description, phone, email, code, password, status, invitationCode }) => {
115
+ const register = async ({ avatar, nickname, gender, birthday, description, phone, email, code, password, status }) => {
103
116
  const type = phone ? 0 : 1;
104
- const verificationCode = await models.verificationCode.findOne({
105
- where: {
106
- name: type === 0 ? phone : email,
107
- type,
108
- code,
109
- status: 1
110
- }
111
- });
112
- if (!verificationCode) {
117
+ if (!(await verificationCodeValidate({ name: type === 0 ? phone : email, type: 0, code }))) {
113
118
  throw new Error('验证码不正确或者已经过期');
114
119
  }
115
120
 
116
- verificationCode.status = 2;
117
- await verificationCode.save();
118
-
119
121
  return await services.user.addUser({
120
122
  avatar,
121
123
  nickname,
@@ -129,90 +131,63 @@ module.exports = fp(async (fastify, options) => {
129
131
  });
130
132
  };
131
133
 
132
- const sendEmailCode = async ({ email }) => {
133
- const code = generateRandom6DigitNumber();
134
-
135
- // 这里写发送逻辑
136
-
137
- await models.verificationCode.update(
138
- {
139
- status: 2
140
- },
141
- {
142
- where: {
143
- name: email,
144
- type: 1,
145
- status: 0
146
- }
134
+ const login = async ({ type, email, phone, password }) => {
135
+ const query = {
136
+ status: {
137
+ [Op.or]: [0, 1]
147
138
  }
148
- );
149
-
150
- await models.verificationCode.create({
151
- name: email,
152
- type: 1,
153
- code
154
- });
155
-
156
- return code;
157
- };
158
-
159
- const verificationCodeValidate = async ({ name, type, code }) => {
160
- const verificationCode = await models.verificationCode.findOne({
161
- where: {
162
- name,
163
- type,
164
- code,
165
- status: {
166
- [fastify.sequelize.Sequelize.Op.or]: [0, 1]
167
- }
139
+ };
140
+ (() => {
141
+ if (type === 'email') {
142
+ query.email = email;
143
+ return;
168
144
  }
145
+ if (type === 'phone') {
146
+ query.phone = phone;
147
+ return;
148
+ }
149
+
150
+ throw new Error('不支持的登录类型');
151
+ })();
152
+ const user = await models.user.findOne({
153
+ where: query
169
154
  });
170
- const isPass = !!(verificationCode && dayjs().isBefore(dayjs(verificationCode.createdAt).add(10, 'minute')));
171
155
 
172
- if (verificationCode) {
173
- verificationCode.status = isPass ? 1 : 2;
174
- await verificationCode.save();
156
+ if (!user) {
157
+ throw new Error('用户名或密码错误');
175
158
  }
176
159
 
177
- return isPass;
178
- };
179
-
180
- const sendSMSCode = async ({ phone }) => {
181
- const code = generateRandom6DigitNumber();
160
+ await passwordAuthentication({ accountId: user.userAccountId, password });
182
161
 
183
- // 这里写发送逻辑
162
+ return {
163
+ token: fastify.jwt.sign({ payload: { id: user.id } }),
164
+ user: Object.assign({}, user.get({ plain: true }), { id: user.id })
165
+ };
166
+ };
184
167
 
185
- await models.verificationCode.update(
186
- {
187
- status: 2
188
- },
189
- {
190
- where: {
191
- name: phone,
192
- type: 0,
193
- status: 0
194
- }
195
- }
168
+ const resetPassword = async ({ password, userId }) => {
169
+ const user = await services.user.getUserInstance({ id: userId });
170
+ const account = await models.userAccount.create(
171
+ Object.assign({}, await passwordEncryption(password), {
172
+ belongToUserId: user.id
173
+ })
196
174
  );
197
-
198
- await models.verificationCode.create({
199
- name: phone,
200
- type: 0,
201
- code
202
- });
203
-
204
- return code;
175
+ await user.update({ userAccountId: account.id });
205
176
  };
206
177
 
207
178
  services.account = {
208
- md5,
209
- login,
210
- register,
211
- sendEmailCode,
212
- sendSMSCode,
179
+ generateRandom6DigitNumber,
180
+ sendVerificationCode,
181
+ sendJWTVerificationCode,
213
182
  verificationCodeValidate,
183
+ verificationJWTCodeValidate,
214
184
  passwordEncryption,
215
- passwordAuthentication,
185
+ register,
186
+ login,
187
+ userNameIsEmail,
188
+ md5,
216
189
  resetPassword
217
190
  };
218
191
  });
192
+
193
+ module.exports = accountService;
@@ -1,79 +1,27 @@
1
1
  const fp = require('fastify-plugin');
2
2
 
3
- const ROLE = {
4
- SuperAdmin: 'SuperAdmin',
5
- TenantAdmin: 'TenantAdmin'
6
- };
7
-
8
- module.exports = fp(async (fastify, options) => {
9
- const { models, services } = fastify.account;
10
- const initSuperAdmin = async user => {
11
- if ((await models.adminRole.count()) > 0) {
12
- throw new Error('系统已经初始化完成,不能执行该操作');
13
- }
14
- await models.adminRole.create({
15
- userId: user.id,
16
- role: ROLE['SuperAdmin']
17
- });
18
- };
19
-
20
- const checkIsSuperAdmin = async user => {
21
- return (
22
- (await models.adminRole.count({
23
- where: {
24
- userId: user.id,
25
- role: ROLE['SuperAdmin']
26
- }
27
- })) === 0
28
- );
29
- };
30
-
31
- const addUser = async ({ avatar, nickname, phone, email, password, description }) => {
32
- return await services.user.addUser({
33
- avatar,
34
- nickname,
35
- phone,
36
- email,
37
- password,
38
- description,
39
- status: 1
40
- });
41
- };
42
-
43
- const setSuperAdmin = async targetUser => {
44
- const user = await services.user.getUserInfo(targetUser);
45
- if (
46
- (await models.adminRole.count({
47
- where: {
48
- userId: user.id,
49
- role: ROLE['SuperAdmin']
3
+ const adminService = fp(async (fastify, options) => {
4
+ const {models, services, global} = fastify[options.name];
5
+
6
+ const initSuperAdmin = async user => {
7
+ if ((await models.user.count({
8
+ where: {
9
+ isSuperAdmin: true
10
+ }
11
+ })) > 0) {
12
+ throw new Error('系统已经初始化完成,不能执行该操作');
50
13
  }
51
- })) > 0
52
- ) {
53
- throw new Error('当前用户已经是超级管理员');
54
- }
14
+ const currentUser = await services.user.getUserInstance({id: user.id});
15
+ currentUser.isSuperAdmin = true;
16
+ await currentUser.save();
17
+ };
55
18
 
56
- await models.adminRole.create({
57
- userId: user.id,
58
- role: ROLE['SuperAdmin']
59
- });
60
- };
19
+ const checkIsSuperAdmin = async (user) => {
20
+ const currentUser = await services.user.getUserInstance({id: user.id});
21
+ return currentUser.isSuperAdmin === true;
22
+ };
61
23
 
62
- const generateTenantAdminVerifyCode = async () => {};
63
-
64
- const verifyTenantAdmin = async () => {};
65
-
66
- const resetUserPassword = async ({ userId, password }) => {
67
- await services.account.resetPassword({ userId, password });
68
- };
69
-
70
- services.admin = {
71
- initSuperAdmin,
72
- setSuperAdmin,
73
- checkIsSuperAdmin,
74
- generateTenantAdminVerifyCode,
75
- verifyTenantAdmin,
76
- addUser,
77
- resetUserPassword
78
- };
24
+ services.admin = {initSuperAdmin, checkIsSuperAdmin};
79
25
  });
26
+
27
+ module.exports = adminService;
@@ -1,16 +1,15 @@
1
1
  const fp = require('fastify-plugin');
2
- const { Unauthorized } = require('http-errors');
3
- const get = require('lodash/get');
4
- const pick = require('lodash/pick');
5
- module.exports = fp(async (fastify, options) => {
6
- const { models, services } = fastify.account;
2
+ const { pick, get } = require('lodash');
3
+ const httpErrors = require('http-errors');
4
+
5
+ const { Unauthorized } = httpErrors;
6
+
7
+ const userService = fp(async (fastify, options) => {
8
+ const { models, services } = fastify[options.name];
9
+ const { Op } = fastify.sequelize.Sequelize;
7
10
 
8
11
  const getUserInstance = async ({ id }) => {
9
- const user = await models.user.findOne({
10
- where: {
11
- uuid: id
12
- }
13
- });
12
+ const user = await models.user.findByPk(id);
14
13
 
15
14
  if (!user) {
16
15
  throw new Error('用户不存在');
@@ -25,15 +24,13 @@ module.exports = fp(async (fastify, options) => {
25
24
  }
26
25
  const user = await models.user.findOne({
27
26
  where: {
28
- uuid: authenticatePayload.id
27
+ id: authenticatePayload.id
29
28
  }
30
29
  });
31
30
  if (!user) {
32
31
  throw new Unauthorized();
33
32
  }
34
- return Object.assign({}, pick(user, ['avatar', 'nickname', 'phone', 'email', 'gender', 'status', 'birthday', 'description', 'currentTenantId']), {
35
- id: user.uuid
36
- });
33
+ return Object.assign({}, pick(user, ['id', 'avatar', 'nickname', 'phone', 'email', 'gender', 'status', 'birthday', 'description']));
37
34
  };
38
35
 
39
36
  const accountIsExists = async ({ email, phone }, currentUser) => {
@@ -48,7 +45,7 @@ module.exports = fp(async (fastify, options) => {
48
45
  return (
49
46
  (await models.user.count({
50
47
  where: {
51
- [fastify.sequelize.Sequelize.Op.or]: query
48
+ [Op.or]: query
52
49
  }
53
50
  })) > 0
54
51
  );
@@ -71,15 +68,38 @@ module.exports = fp(async (fastify, options) => {
71
68
  phone,
72
69
  email,
73
70
  status,
74
- userAccountId: account.uuid
71
+ userAccountId: account.id
75
72
  });
76
- await account.update({ belongToUserId: user.uuid });
73
+ await account.update({ belongToUserId: user.id });
74
+
75
+ return Object.assign({}, user.get({ pain: true }));
76
+ };
77
+
78
+ const getUserList = async ({ filter, perPage, currentPage }) => {
79
+ const queryFilter = {};
77
80
 
78
- return Object.assign({}, user.get({ pain: true }), { id: user.uuid });
81
+ ['nickname'].forEach(key => {
82
+ if (filter && filter[key]) {
83
+ queryFilter[key] = {
84
+ [Op.like]: `%${filter[key]}%`
85
+ };
86
+ }
87
+ });
88
+ const { count, rows } = await models.user.findAndCountAll({
89
+ where: queryFilter,
90
+ offset: perPage * (currentPage - 1),
91
+ limit: perPage
92
+ });
93
+ return {
94
+ pageData: rows.map(item => {
95
+ return Object.assign({}, item.get({ pain: true }));
96
+ }),
97
+ totalCount: count
98
+ };
79
99
  };
80
100
 
81
101
  const saveUser = async ({ id, ...otherInfo }) => {
82
- const user = await getUserInstance({ id });
102
+ const user = await getUserInstance(id);
83
103
 
84
104
  if ((await accountIsExists({ phone: otherInfo.phone, email: otherInfo.email }, user)) > 0) {
85
105
  throw new Error('手机号或者邮箱都不能重复');
@@ -94,54 +114,28 @@ module.exports = fp(async (fastify, options) => {
94
114
  await user.save();
95
115
  };
96
116
 
97
- const closeUser = async ({ id }) => {
98
- const user = await getUserInstance({ id });
99
- user.status = 12;
117
+ const setSuperAdmin = async ({ userId, status }) => {
118
+ const user = await services.user.getUserInstance({ id: userId });
119
+ user.isSuperAdmin = status;
100
120
  await user.save();
101
121
  };
102
122
 
103
- const openUser = async ({ id }) => {
104
- const user = await getUserInstance({ id });
105
- user.status = 0;
123
+ const setUserStatus = async ({ userId, status }) => {
124
+ const user = await services.user.getUserInstance({ id: userId });
125
+ user.status = status;
106
126
  await user.save();
107
127
  };
108
128
 
109
- const setCurrentTenantId = async ({ id, tenantId }) => {
110
- await services.tenant.getTenant({ id: tenantId });
111
- const user = await getUserInstance({ id });
112
- user.currentTenantId = tenantId;
113
- await user.save();
114
- };
115
-
116
- const getAllUserList = async ({ filter, perPage, currentPage }) => {
117
- const { count, rows } = await models.user.findAndCountAll({
118
- include: [
119
- {
120
- attributes: ['role'],
121
- model: models.adminRole
122
- },
123
- {
124
- model: models.tenant
125
- }
126
- ]
127
- });
128
- return {
129
- pageData: rows.map(item => {
130
- return Object.assign({}, item.get({ pain: true }), { id: item.uuid });
131
- }),
132
- totalCount: count
133
- };
134
- };
135
-
136
129
  services.user = {
137
- getUser,
138
130
  getUserInstance,
131
+ getUser,
132
+ addUser,
139
133
  saveUser,
140
134
  accountIsExists,
141
- addUser,
142
- closeUser,
143
- openUser,
144
- setCurrentTenantId,
145
- getAllUserList
135
+ getUserList,
136
+ setSuperAdmin,
137
+ setUserStatus
146
138
  };
147
139
  });
140
+
141
+ module.exports = userService;
package/package.json CHANGED
@@ -1,23 +1,24 @@
1
1
  {
2
2
  "name": "@kne/fastify-account",
3
- "version": "1.0.0-alpha.9",
4
- "description": "fastify的用户管理账号等实现",
3
+ "version": "2.0.0-alpha.1",
4
+ "description": "用于用户注册登录认证.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "init": "husky",
8
- "dev": "npx fastify-cli start ./index.js",
9
- "start": "nodemon ./tests/server.js",
8
+ "dev": "nodemon ./index.js",
9
+ "start": "node ./index.js",
10
+ "doc": "node ./open-api.js",
10
11
  "build:md": "npx @kne/md-doc",
11
12
  "start:md": "npx @kne/md-doc --watch",
12
13
  "prettier": "prettier --config .prettierrc --write '{libs/**/*,index}.{js,jsx,ts,tsx,json,css,scss}'",
13
14
  "lint-staged": "npx lint-staged"
14
15
  },
15
16
  "lint-staged": {
16
- "{libs/**/*,index}.{js,jsx,ts,tsx,json,css,scss}": [
17
- "prettier --config .prettierrc --write",
17
+ "**/*.md": [
18
18
  "git add"
19
19
  ],
20
- "README.md": [
20
+ "{libs/**/*,index}.{js,jsx,ts,tsx,json,css,scss}": [
21
+ "prettier --config .prettierrc --write",
21
22
  "git add"
22
23
  ]
23
24
  },
@@ -27,36 +28,31 @@
27
28
  ],
28
29
  "repository": {
29
30
  "type": "git",
30
- "url": "git+https://github.com/kne-union/fastify-account.git"
31
+ "url": "git+https://github.com/kne-union/fastify-user.git"
31
32
  },
32
33
  "keywords": [],
33
34
  "author": "linzp",
34
35
  "license": "ISC",
35
36
  "bugs": {
36
- "url": "https://github.com/kne-union/fastify-account/issues"
37
+ "url": "https://github.com/kne-union/fastify-user/issues"
37
38
  },
38
- "homepage": "https://github.com/kne-union/fastify-account#readme",
39
- "devDependencies": {
40
- "@fastify/swagger": "^8.14.0",
41
- "@kne/fastify-file-manager": "^1.1.2",
42
- "@kne/fastify-response-data-format": "^0.1.0",
43
- "@kne/fastify-sequelize": "^2.0.2",
44
- "fastify": "^4.27.0",
45
- "husky": "^9.0.11",
46
- "nodemon": "^3.1.1",
47
- "prettier": "^3.2.5",
48
- "qs": "^6.12.1",
49
- "sqlite3": "^5.1.7",
50
- "widdershins": "^4.0.1"
39
+ "homepage": "https://github.com/kne-union/fastify-user#readme",
40
+ "peerDependencies": {
41
+ "@kne/fastify-namespace": "*",
42
+ "@kne/fastify-sequelize": "*",
43
+ "fastify-plugin": ">=5"
51
44
  },
52
45
  "dependencies": {
53
- "@fastify/jwt": "^8.0.1",
54
- "@kne/fastify-namespace": "^0.1.0",
55
- "bcryptjs": "^2.4.3",
56
- "dayjs": "^1.11.11",
57
- "fastify-ip": "^1.0.0",
58
- "fastify-plugin": "^4.5.1",
46
+ "@fastify/jwt": "^9.1.0",
47
+ "bcryptjs": "^3.0.2",
48
+ "dayjs": "^1.11.13",
49
+ "fs-extra": "^11.2.0",
59
50
  "http-errors": "^2.0.0",
60
51
  "lodash": "^4.17.21"
52
+ },
53
+ "devDependencies": {
54
+ "husky": "^9.0.11",
55
+ "nodemon": "^3.1.3",
56
+ "prettier": "^3.2.5"
61
57
  }
62
58
  }