@drax/identity-back 0.22.0 → 0.24.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.
@@ -5,7 +5,7 @@ declare class UserController extends AbstractFastifyController<IUser, IUserCreat
5
5
  protected service: UserService;
6
6
  constructor();
7
7
  auth(request: any, reply: any): Promise<{
8
- accessToken: string;
8
+ accessToken: any;
9
9
  }>;
10
10
  me(request: any, reply: any): Promise<IUser>;
11
11
  paginate(request: any, reply: any): Promise<import("@drax/crud-share").IDraxPaginateResult<IUser>>;
@@ -1 +1 @@
1
- {"version":3,"file":"UserController.d.ts","sourceRoot":"","sources":["../../src/controllers/UserController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAC,yBAAyB,EAAC,MAAM,iBAAiB,CAAC;AAY1D,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAarD,cAAM,cAAe,SAAQ,yBAAyB,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC;IAEnF,SAAS,CAAC,OAAO,EAAE,WAAW,CAAA;;IAMxB,IAAI,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;;;IAiBnB,EAAE,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAiBjB,QAAQ,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAyBvB,MAAM,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAerB,QAAQ,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;;;;IA6CvB,WAAW,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAc1B,WAAW,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAU1B,MAAM,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAmBrB,MAAM,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAkBrB,MAAM,CAAC,OAAO,KAAA,EAAE,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kBrB,MAAM,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IA0BrB,uBAAuB,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IAiCtC,wBAAwB,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;IA6BvC,gBAAgB,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;;;IAgB/B,cAAc,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;;;IAiB7B,YAAY,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;;;;;;IAiC3B,SAAS,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA;CAcjC;AAED,eAAe,cAAc,CAAC;AAC9B,OAAO,EACH,cAAc,EACjB,CAAA"}
@@ -19,7 +19,7 @@ declare const _default: {
19
19
  auth: (_: any, { input }: {
20
20
  input: any;
21
21
  }) => Promise<{
22
- accessToken: string;
22
+ accessToken: any;
23
23
  }>;
24
24
  createUser: (_: any, { input }: {
25
25
  input: any;
@@ -6,15 +6,15 @@ declare const RegisterBodyRequestSchema: z.ZodObject<{
6
6
  phone: z.ZodOptional<z.ZodString>;
7
7
  password: z.ZodString;
8
8
  }, "strip", z.ZodTypeAny, {
9
+ name?: string;
9
10
  username?: string;
10
11
  email?: string;
11
- name?: string;
12
12
  phone?: string;
13
13
  password?: string;
14
14
  }, {
15
+ name?: string;
15
16
  username?: string;
16
17
  email?: string;
17
- name?: string;
18
18
  phone?: string;
19
19
  password?: string;
20
20
  }>;
@@ -37,30 +37,30 @@ declare const RoleSchema: import("zod").ZodObject<import("zod").objectUtil.exten
37
37
  updatedAt: import("zod").ZodOptional<import("zod").ZodDate>;
38
38
  }>, "strip", import("zod").ZodTypeAny, {
39
39
  name?: string;
40
+ _id?: string;
41
+ id?: string;
42
+ createdAt?: Date;
43
+ updatedAt?: Date;
40
44
  permissions?: string[];
41
45
  childRoles?: {
42
46
  name?: string;
43
47
  _id?: string;
44
48
  id?: string;
45
49
  }[];
50
+ readonly?: boolean;
51
+ }, {
52
+ name?: string;
46
53
  _id?: string;
47
54
  id?: string;
48
- readonly?: boolean;
49
55
  createdAt?: Date;
50
56
  updatedAt?: Date;
51
- }, {
52
- name?: string;
53
57
  permissions?: string[];
54
58
  childRoles?: {
55
59
  name?: string;
56
60
  _id?: string;
57
61
  id?: string;
58
62
  }[];
59
- _id?: string;
60
- id?: string;
61
63
  readonly?: boolean;
62
- createdAt?: Date;
63
- updatedAt?: Date;
64
64
  }>;
65
65
  export default RoleSchema;
66
66
  export { RoleSchema, RoleBaseSchema };
@@ -15,16 +15,16 @@ declare const TenantSchema: import("zod").ZodObject<import("zod").objectUtil.ext
15
15
  updatedAt: import("zod").ZodDate;
16
16
  }>, "strip", import("zod").ZodTypeAny, {
17
17
  name?: string;
18
+ custom?: Record<string, any>;
18
19
  _id?: string;
19
20
  id?: string;
20
- custom?: Record<string, any>;
21
21
  createdAt?: Date;
22
22
  updatedAt?: Date;
23
23
  }, {
24
24
  name?: string;
25
+ custom?: Record<string, any>;
25
26
  _id?: string;
26
27
  id?: string;
27
- custom?: Record<string, any>;
28
28
  createdAt?: Date;
29
29
  updatedAt?: Date;
30
30
  }>;
@@ -20,18 +20,18 @@ declare const UserApiKeySchema: import("zod").ZodObject<import("zod").objectUtil
20
20
  id: import("zod").ZodOptional<import("zod").ZodString>;
21
21
  createdBy: import("zod").ZodString;
22
22
  }>, "strip", import("zod").ZodTypeAny, {
23
- _id?: string;
24
- id?: string;
25
23
  name?: string;
26
24
  ipv4?: string[];
27
25
  ipv6?: string[];
28
- createdBy?: string;
29
- }, {
30
26
  _id?: string;
31
27
  id?: string;
28
+ createdBy?: string;
29
+ }, {
32
30
  name?: string;
33
31
  ipv4?: string[];
34
32
  ipv6?: string[];
33
+ _id?: string;
34
+ id?: string;
35
35
  createdBy?: string;
36
36
  }>;
37
37
  export default UserApiKeyBaseSchema;
@@ -111,14 +111,14 @@ declare const UserSchema: import("zod").ZodObject<import("zod").objectUtil.exten
111
111
  custom: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
112
112
  }, "strip", import("zod").ZodTypeAny, {
113
113
  name?: string;
114
+ custom?: Record<string, any>;
114
115
  _id?: string;
115
116
  id?: string;
116
- custom?: Record<string, any>;
117
117
  }, {
118
118
  name?: string;
119
+ custom?: Record<string, any>;
119
120
  _id?: string;
120
121
  id?: string;
121
- custom?: Record<string, any>;
122
122
  }>>>;
123
123
  createdAt: import("zod").ZodOptional<import("zod").ZodDate>;
124
124
  avatar: import("zod").ZodOptional<import("zod").ZodString>;
@@ -136,13 +136,13 @@ declare const UserSchema: import("zod").ZodObject<import("zod").objectUtil.exten
136
136
  };
137
137
  tenant?: {
138
138
  name?: string;
139
+ custom?: Record<string, any>;
139
140
  _id?: string;
140
141
  id?: string;
141
- custom?: Record<string, any>;
142
142
  };
143
143
  _id?: string;
144
- createdAt?: Date;
145
144
  avatar?: string;
145
+ createdAt?: Date;
146
146
  }, {
147
147
  name?: string;
148
148
  username?: string;
@@ -157,13 +157,13 @@ declare const UserSchema: import("zod").ZodObject<import("zod").objectUtil.exten
157
157
  };
158
158
  tenant?: {
159
159
  name?: string;
160
+ custom?: Record<string, any>;
160
161
  _id?: string;
161
162
  id?: string;
162
- custom?: Record<string, any>;
163
163
  };
164
164
  _id?: string;
165
- createdAt?: Date;
166
165
  avatar?: string;
166
+ createdAt?: Date;
167
167
  }>;
168
168
  export { UserBaseSchema, UserSchema, UserCreateSchema, UserUpdateSchema, };
169
169
  //# sourceMappingURL=UserSchema.d.ts.map
@@ -6,10 +6,10 @@ declare class UserService extends AbstractService<IUser, IUserCreate, IUserUpdat
6
6
  _repository: IUserRepository;
7
7
  constructor(userRepository: IUserRepository);
8
8
  auth(username: string, password: string): Promise<{
9
- accessToken: string;
9
+ accessToken: any;
10
10
  }>;
11
11
  authByEmail(email: string, createIfNotFound: boolean, userData: IUserCreate): Promise<{
12
- accessToken: string;
12
+ accessToken: any;
13
13
  }>;
14
14
  changeUserPassword(userId: string, newPassword: string): Promise<boolean>;
15
15
  changeOwnPassword(userId: string, currentPassword: string, newPassword: string): Promise<boolean>;
@@ -1,11 +1,10 @@
1
- import jsonwebtoken from "jsonwebtoken";
2
1
  import type { IJwtUser } from "@drax/identity-share";
3
2
  declare class AuthUtils {
4
- static verifyToken(token: string): string | jsonwebtoken.Jwt | jsonwebtoken.JwtPayload;
3
+ static verifyToken(token: string): any;
5
4
  static hashPassword(password: string): string;
6
5
  static checkPassword(password: string, hashPassword: string): boolean;
7
6
  static tokenSignPayload(userId: string, username: string, roleId: string, tenantId: string, session: string): IJwtUser;
8
- static generateToken(userId: string, username: string, roleId: string, tenantId: string, session: string): string;
7
+ static generateToken(userId: string, username: string, roleId: string, tenantId: string, session: string): any;
9
8
  static generateHMAC(secret: string, apikey: string): string;
10
9
  }
11
10
  export default AuthUtils;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthUtils.d.ts","sourceRoot":"","sources":["../../src/utils/AuthUtils.ts"],"names":[],"mappings":"AACA,OAAO,YAA0C,MAAM,cAAc,CAAC;AAItE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAEnD,cAAM,SAAS;IAEX,MAAM,CAAC,WAAW,CAAC,KAAK,EAAG,MAAM;IAWjC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAG,MAAM,GAAG,MAAM;IAU9C,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAG,MAAM,EAAE,YAAY,EAAG,MAAM;IAI7D,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAG,MAAM,GAAG,QAAQ;IAUxH,MAAM,CAAC,aAAa,CAAC,MAAM,EAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAG,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAG,MAAM;IA4B3G,MAAM,CAAC,YAAY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