@cloudbase/oauth 2.6.3-beta.0 → 2.6.5-beta.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.
Files changed (68) hide show
  1. package/dist/cjs/auth/apis.d.ts +17 -8
  2. package/dist/cjs/auth/apis.js +166 -23
  3. package/dist/cjs/auth/consts.d.ts +39 -4
  4. package/dist/cjs/auth/consts.js +38 -3
  5. package/dist/cjs/auth/models.d.ts +83 -6
  6. package/dist/cjs/auth/models.js +1 -1
  7. package/dist/cjs/index.d.ts +5 -8
  8. package/dist/cjs/index.js +3 -17
  9. package/dist/cjs/oauth2client/consts.d.ts +1 -48
  10. package/dist/cjs/oauth2client/consts.js +4 -51
  11. package/dist/cjs/oauth2client/models.d.ts +1 -0
  12. package/dist/cjs/oauth2client/models.js +1 -1
  13. package/dist/cjs/oauth2client/oauth2client.d.ts +5 -0
  14. package/dist/cjs/oauth2client/oauth2client.js +24 -18
  15. package/dist/cjs/utils/base64.d.ts +4 -0
  16. package/dist/cjs/utils/base64.js +99 -0
  17. package/dist/cjs/utils/cloudbase-adapter-wx_mp.d.ts +1 -0
  18. package/dist/cjs/utils/cloudbase-adapter-wx_mp.js +40 -0
  19. package/dist/cjs/utils/encrypt.d.ts +2 -2
  20. package/dist/cjs/utils/encrypt.js +5 -5
  21. package/dist/cjs/utils/encryptlong/index.d.ts +537 -145
  22. package/dist/cjs/utils/encryptlong/index.js +2712 -3765
  23. package/dist/esm/auth/apis.d.ts +17 -8
  24. package/dist/esm/auth/apis.js +468 -722
  25. package/dist/esm/auth/consts.d.ts +39 -4
  26. package/dist/esm/auth/consts.js +37 -3
  27. package/dist/esm/auth/models.d.ts +83 -6
  28. package/dist/esm/auth/models.js +0 -1
  29. package/dist/esm/captcha/captcha.js +155 -258
  30. package/dist/esm/index.d.ts +5 -8
  31. package/dist/esm/index.js +17 -31
  32. package/dist/esm/oauth2client/consts.d.ts +1 -48
  33. package/dist/esm/oauth2client/consts.js +1 -50
  34. package/dist/esm/oauth2client/interface.js +2 -7
  35. package/dist/esm/oauth2client/models.d.ts +1 -0
  36. package/dist/esm/oauth2client/models.js +0 -1
  37. package/dist/esm/oauth2client/oauth2client.d.ts +5 -0
  38. package/dist/esm/oauth2client/oauth2client.js +365 -631
  39. package/dist/esm/utils/base64.d.ts +4 -0
  40. package/dist/esm/utils/base64.js +91 -0
  41. package/dist/esm/utils/cloudbase-adapter-wx_mp.d.ts +1 -0
  42. package/dist/esm/utils/cloudbase-adapter-wx_mp.js +35 -0
  43. package/dist/esm/utils/encrypt.d.ts +2 -2
  44. package/dist/esm/utils/encrypt.js +5 -7
  45. package/dist/esm/utils/encryptlong/index.d.ts +537 -145
  46. package/dist/esm/utils/encryptlong/index.js +2605 -3687
  47. package/dist/esm/utils/function/single-promise.js +26 -89
  48. package/dist/esm/utils/index.js +7 -8
  49. package/dist/esm/utils/mp.js +2 -3
  50. package/dist/esm/utils/uuid.js +3 -4
  51. package/dist/miniprogram/index.js +1 -0
  52. package/package.json +11 -6
  53. package/src/auth/apis.ts +179 -36
  54. package/src/auth/consts.ts +37 -3
  55. package/src/auth/models.ts +318 -234
  56. package/src/index.ts +5 -29
  57. package/src/oauth2client/consts.ts +1 -51
  58. package/src/oauth2client/models.ts +1 -0
  59. package/src/oauth2client/oauth2client.ts +31 -17
  60. package/src/utils/base64.ts +100 -0
  61. package/src/utils/cloudbase-adapter-wx_mp.ts +42 -0
  62. package/src/utils/encrypt.ts +8 -6
  63. package/src/utils/encryptlong/index.js +2843 -4895
  64. package/tsconfig.esm.json +8 -19
  65. package/tsconfig.json +5 -16
  66. package/webpack/web.prod.js +100 -0
  67. package/webpack/webpack.miniprogram.js +23 -0
  68. package/src/index.d.ts +0 -1
@@ -1,94 +1,94 @@
1
1
  interface BaseRequest {
2
- client_id?: string;
2
+ client_id?: string
3
3
  }
4
4
 
5
- export type GetCustomSignTicketFn = () => Promise<string>;
5
+ export type GetCustomSignTicketFn = () => Promise<string>
6
6
 
7
- export interface SignInRequest extends BaseRequest, EncryptParams {
8
- username?: string;
9
- password?: string;
10
- verification_token?: string;
11
- version?: string;
12
- query?: { with_department?: boolean, with_role?: boolean }
7
+ export interface SignInRequest extends BaseRequest, EncryptParams {
8
+ username?: string
9
+ password?: string
10
+ verification_token?: string
11
+ version?: string
12
+ query?: { with_department?: boolean; with_role?: boolean }
13
13
  }
14
14
 
15
15
  export interface SignInWithProviderRequest extends BaseRequest {
16
- provider_token: string;
17
- version?: string;
16
+ provider_token: string
17
+ version?: string
18
18
  }
19
19
 
20
20
  export interface SignUpRequest extends BaseRequest {
21
- phone_number?: string;
22
- email?: string;
21
+ phone_number?: string
22
+ email?: string
23
23
 
24
- verification_code?: string;
25
- verification_token?: string;
26
- provider_token?: string;
24
+ verification_code?: string
25
+ verification_token?: string
26
+ provider_token?: string
27
27
 
28
- password?: string;
29
- name?: string;
30
- gender?: string;
31
- picture?: string;
32
- locale?: string;
28
+ password?: string
29
+ name?: string
30
+ gender?: string
31
+ picture?: string
32
+ locale?: string
33
33
  }
34
34
 
35
35
  export interface GetVerificationRequest extends BaseRequest {
36
- phone_number?: string;
37
- email?: string;
38
- target?: string | 'ANY';
39
- usage?: string;
36
+ phone_number?: string
37
+ email?: string
38
+ target?: string | 'ANY'
39
+ usage?: string
40
40
  }
41
41
 
42
42
  export interface GetVerificationResponse {
43
- verification_id?: string;
44
- is_user?: boolean | false;
43
+ verification_id?: string
44
+ is_user?: boolean | false
45
45
  }
46
46
 
47
47
  export interface VerifyResponse {
48
- verification_token?: string;
48
+ verification_token?: string
49
49
  }
50
50
 
51
51
  export interface VerifyRequest extends BaseRequest {
52
- verification_code: string;
53
- verification_id?: string;
54
- verification_token?: string;
55
- version?: string;
52
+ verification_code: string
53
+ verification_id?: string
54
+ verification_token?: string
55
+ version?: string
56
56
  }
57
57
 
58
58
  export interface ProviderBindRequest {
59
- provider_token: string;
59
+ provider_token: string
60
60
  }
61
61
 
62
62
  export interface GrantProviderTokenRequest extends BaseRequest {
63
- provider_id: string;
64
- provider_redirect_uri?: string;
65
- provider_code?: string;
66
- provider_access_token?: string;
67
- provider_id_token?: string;
63
+ provider_id: string
64
+ provider_redirect_uri?: string
65
+ provider_code?: string
66
+ provider_access_token?: string
67
+ provider_id_token?: string
68
68
  }
69
69
 
70
70
  export interface GrantProviderTokenResponse {
71
- provider_token: string;
72
- expires_in: number;
73
- code?: string;
74
- error_code?: string;
71
+ provider_token: string
72
+ expires_in: number
73
+ code?: string
74
+ error_code?: string
75
75
  }
76
76
 
77
77
  export interface PatchProviderTokenRequest extends BaseRequest {
78
- provider_id?: string;
79
- provider_token: string;
78
+ provider_id?: string
79
+ provider_token: string
80
80
  provider_params: {
81
- encryptedData?: string;
82
- iv?: string;
83
- code?: string;
84
- provider_code_type?: string;
85
- };
81
+ encryptedData?: string
82
+ iv?: string
83
+ code?: string
84
+ provider_code_type?: string
85
+ }
86
86
  }
87
87
 
88
88
  export interface PatchProviderTokenResponse {
89
- provider_token: string;
90
- expires_in: number;
91
- provider_profile: ProviderProfile;
89
+ provider_token: string
90
+ expires_in: number
91
+ provider_profile: ProviderProfile
92
92
  }
93
93
 
94
94
  // export interface GenProviderRedirectUriRequest {
@@ -101,45 +101,45 @@ export interface PatchProviderTokenResponse {
101
101
  // }
102
102
 
103
103
  export interface GenProviderRedirectUriResponse {
104
- uri: string;
105
- signout_uri?: string;
104
+ uri: string
105
+ signout_uri?: string
106
106
  }
107
107
 
108
108
  export interface BindWithProviderRequest extends BaseRequest {
109
- provider_token: string;
109
+ provider_token: string
110
110
  }
111
111
 
112
112
  export interface BindWithProviderRequest {
113
- provider_token: string;
113
+ provider_token: string
114
114
  }
115
115
 
116
116
  export interface UserProfileProvider {
117
- id?: string;
118
- provider_user_id?: string;
119
- name?: string;
117
+ id?: string
118
+ provider_user_id?: string
119
+ name?: string
120
120
  }
121
121
 
122
122
  export interface UserProfile {
123
- name?: string;
124
- picture?: string;
125
- username?: string;
126
- email?: string;
127
- email_verified?: boolean;
128
- phone_number?: string;
129
- providers?: [UserProfileProvider];
130
- gender?: string;
131
- birthdate?: string;
132
- zoneinfo?: string;
133
- locale?: string;
134
- created_from?: string;
123
+ name?: string
124
+ picture?: string
125
+ username?: string
126
+ email?: string
127
+ email_verified?: boolean
128
+ phone_number?: string
129
+ providers?: [UserProfileProvider]
130
+ gender?: string
131
+ birthdate?: string
132
+ zoneinfo?: string
133
+ locale?: string
134
+ created_from?: string
135
135
  sub?: string
136
136
  uid?: string
137
137
  address?: {
138
- formatted?: string,
139
- street_address?: string,
140
- locality?: string,
141
- region?: string,
142
- postal_code?: string,
138
+ formatted?: string
139
+ street_address?: string
140
+ locality?: string
141
+ region?: string
142
+ postal_code?: string
143
143
  country?: string
144
144
  }
145
145
  nickName?: string // TODO:
@@ -148,214 +148,227 @@ export interface UserProfile {
148
148
  city?: string // TODO:
149
149
  }
150
150
 
151
- export type UserInfo = UserProfile;
151
+ export type UserInfo = UserProfile
152
152
 
153
153
  export interface ProviderProfile {
154
- provider_id: string;
155
- phone_number?: string;
154
+ provider_id: string
155
+ phone_number?: string
156
+ name?: string
157
+ picture?: string
158
+ email?: string
156
159
  }
157
160
 
158
161
  export interface TransByProviderRequest {
159
- provider_token: string;
162
+ provider_token: string
160
163
  }
161
164
 
162
165
  export interface GrantTokenRequest extends BaseRequest {
163
- client_secret?: string;
164
- code?: string;
165
- grant_type?: string;
166
- redirect_uri?: string;
167
- nonce?: string;
168
- refresh_token?: string;
169
- scope?: string;
166
+ client_secret?: string
167
+ code?: string
168
+ grant_type?: string
169
+ redirect_uri?: string
170
+ nonce?: string
171
+ refresh_token?: string
172
+ scope?: string
170
173
  }
171
174
 
172
175
  export interface UnbindProviderRequest extends BaseRequest {
173
- provider_id: string;
176
+ provider_id: string
174
177
  }
175
178
 
176
179
  export interface CheckPasswordrRequest extends BaseRequest {
177
- password: string;
180
+ password: string
178
181
  }
179
182
 
180
183
  export interface BindPhoneRequest extends BaseRequest {
181
- phone_number: string;
182
- sudo_token: string;
183
- verification_token: string;
184
+ phone_number: string
185
+ sudo_token: string
186
+ verification_token: string
184
187
  }
185
188
 
186
189
  export interface SetPasswordRequest extends BaseRequest {
187
- new_password: string;
188
- sudo_token: string;
190
+ new_password: string
191
+ sudo_token: string
189
192
  }
190
193
 
191
194
  export interface ChangeBindedProviderRequest extends BaseRequest {
192
- trans_token: string;
193
- provider_id: string;
195
+ trans_token: string
196
+ provider_id: string
194
197
  }
195
198
 
196
- export type ChangeBindedProviderResponse = BaseRequest
197
-
198
199
  export interface QueryUserProfileReq extends BaseRequest {
199
- appended_params: string;
200
+ appended_params: string
200
201
  }
201
202
 
202
203
  export interface SignInWithProviderRequest {
203
- provider_token: string;
204
- provider_id?: string;
204
+ provider_token: string
205
+ provider_id?: string
205
206
  }
206
207
 
207
208
  export interface SignUpRequest {
208
- phone_number?: string;
209
- email?: string;
209
+ phone_number?: string
210
+ email?: string
210
211
 
211
- verification_code?: string;
212
- verification_token?: string;
213
- provider_token?: string;
212
+ verification_code?: string
213
+ verification_token?: string
214
+ provider_token?: string
214
215
 
215
- password?: string;
216
- name?: string;
217
- gender?: string;
218
- picture?: string;
219
- locale?: string;
216
+ password?: string
217
+ name?: string
218
+ gender?: string
219
+ picture?: string
220
+ locale?: string
220
221
  }
221
222
 
222
223
  export interface GetVerificationRequest {
223
- phone_number?: string;
224
- email?: string;
224
+ phone_number?: string
225
+ email?: string
225
226
  // 可选 ANY,USER,NOT_USER, CUR_USER;
226
- target?: string | 'ANY';
227
- usage?: string;
227
+ target?: string | 'ANY'
228
+ usage?: string
228
229
  }
229
230
 
230
231
  export interface GetVerificationResponse {
231
- verification_id?: string;
232
- is_user?: boolean | false;
232
+ verification_id?: string
233
+ is_user?: boolean | false
233
234
  }
234
235
 
235
236
  export interface VerifyResponse {
236
- verification_token?: string;
237
+ verification_token?: string
237
238
  }
238
239
 
239
240
  export interface VerifyRequest {
240
- verification_code: string;
241
- verification_id?: string;
242
- verification_token?: string;
243
- version?: string;
241
+ verification_code: string
242
+ verification_id?: string
243
+ verification_token?: string
244
+ version?: string
244
245
  }
245
246
 
246
247
  export interface ProviderBindRequest {
247
- provider_token: string;
248
+ provider_token: string
248
249
  }
249
250
 
250
251
  export interface GrantProviderTokenRequest {
251
- provider_id: string;
252
- provider_redirect_uri?: string;
253
- provider_code?: string;
254
- provider_access_token?: string;
255
- provider_id_token?: string;
252
+ provider_id: string
253
+ provider_redirect_uri?: string
254
+ provider_code?: string
255
+ provider_access_token?: string
256
+ provider_id_token?: string
256
257
  provider_params?: {
257
- provider_code_type?: string;
258
- appid?: string;
258
+ provider_code_type?: string
259
+ appid?: string
259
260
  }
260
261
  }
261
262
 
262
263
  export interface GrantProviderTokenResponse {
263
- provider_token: string;
264
- expires_in: number;
265
- code?: string;
264
+ provider_token: string
265
+ expires_in: number
266
+ code?: string
266
267
  }
267
268
 
268
269
  export interface PatchProviderTokenRequest {
269
- provider_token: string;
270
- provider_id?: string;
270
+ provider_token: string
271
+ provider_id?: string
271
272
  provider_params: {
272
- encryptedData?: string;
273
- iv?: string;
274
- code?: string;
275
- provider_code_type?: string;
276
- };
273
+ encryptedData?: string
274
+ iv?: string
275
+ code?: string
276
+ provider_code_type?: string
277
+ }
277
278
  }
278
279
 
279
280
  export interface PatchProviderTokenResponse {
280
- provider_token: string;
281
- expires_in: number;
282
- provider_profile: ProviderProfile;
281
+ provider_token: string
282
+ expires_in: number
283
+ provider_profile: ProviderProfile
283
284
  }
284
285
 
285
286
  export interface GenProviderRedirectUriRequest {
286
- provider_id: string;
287
- provider_redirect_uri: string;
288
- state: string;
287
+ provider_id: string
288
+ provider_redirect_uri: string
289
+ state: string
289
290
  other_params?: {
290
291
  [key: string]: string
291
- };
292
+ }
292
293
  }
293
294
 
294
295
  export interface GenProviderRedirectUriResponse {
295
- uri: string;
296
- signout_uri?: string;
296
+ uri: string
297
+ signout_uri?: string
297
298
  }
298
299
 
299
300
  export interface BindWithProviderRequest {
300
- provider_token: string;
301
+ provider_token: string
301
302
  }
302
303
 
303
304
  export interface BindWithProviderRequest {
304
- provider_token: string;
305
+ provider_token: string
305
306
  }
306
307
 
307
308
  export interface UserProfileProvider {
308
- id?: string;
309
- provider_user_id?: string;
310
- name?: string;
309
+ id?: string
310
+ provider_user_id?: string
311
+ name?: string
311
312
  }
312
313
 
313
314
  export interface UserProfile {
314
- name?: string;
315
- picture?: string;
316
- username?: string;
317
- email?: string;
318
- email_verified?: boolean;
319
- phone_number?: string;
320
- providers?: [UserProfileProvider];
321
- gender?: string;
322
- birthdate?: string;
323
- zoneinfo?: string;
324
- locale?: string;
325
- created_from?: string;
315
+ name?: string
316
+ picture?: string
317
+ username?: string
318
+ email?: string
319
+ email_verified?: boolean
320
+ phone_number?: string
321
+ providers?: [UserProfileProvider]
322
+ gender?: string
323
+ birthdate?: string
324
+ zoneinfo?: string
325
+ locale?: string
326
+ created_from?: string
326
327
  }
327
328
 
328
329
  export interface ProviderProfile {
329
- provider_id: string;
330
- phone_number?: string;
330
+ provider_id: string
331
+ phone_number?: string
331
332
  }
332
333
 
333
334
  export interface TransByProviderRequest {
334
- provider_token: string;
335
+ provider_token: string
335
336
  }
336
337
 
337
338
  export interface GrantTokenRequest {
338
- client_secret?: string;
339
- code?: string;
340
- grant_type?: string;
341
- redirect_uri?: string;
342
- nonce?: string;
343
- refresh_token?: string;
344
- scope?: string;
339
+ client_secret?: string
340
+ code?: string
341
+ grant_type?: string
342
+ redirect_uri?: string
343
+ nonce?: string
344
+ refresh_token?: string
345
+ scope?: string
345
346
  }
346
347
 
347
348
  export interface UnbindProviderRequest {
348
- provider_id: string;
349
+ provider_id: string
349
350
  }
350
351
 
351
352
  export interface CheckPasswordrRequest {
352
- password: string;
353
+ password: string
354
+ }
355
+
356
+ export interface EditContactRequest {
357
+ phone_number?: string
358
+ email?: string
359
+ sudo_token: string
360
+ verification_token: string
361
+ // 冲突解决方案
362
+ // 可选:DEFAULT, 默认解决方案:提示用户该手机号已被其他人绑定
363
+ // DELETE_ACCOUNT_TRANSFER,标记原来的账号为已注销,并将手机换绑给自己
364
+ // TRANSFER 仅换绑手机号,不注销原有账号。(原有账号无法登录情况下,则自动标记为注销)
365
+ conflict_resolution?: string
353
366
  }
354
367
 
355
368
  export interface BindPhoneRequest {
356
- phone_number: string;
357
- sudo_token: string;
358
- verification_token: string;
369
+ phone_number: string
370
+ sudo_token: string
371
+ verification_token: string
359
372
  conflict_resolution: string
360
373
  // 1. DEFAULT 0, 默认提示用户手机号已被绑定
361
374
  // 2. DELETE_ACCOUNT_TRANSFER 1, 标记原账号已被注销,并将手机换绑给自己
@@ -363,30 +376,29 @@ export interface BindPhoneRequest {
363
376
  }
364
377
 
365
378
  export interface BindEmailRequest {
366
- email: string;
367
- sudo_token: string;
368
- verification_token: string;
379
+ email: string
380
+ sudo_token: string
381
+ verification_token: string
369
382
  }
370
383
 
371
384
  export interface SetPasswordRequest {
372
- new_password: string;
373
- sudo_token: string;
385
+ new_password: string
386
+ sudo_token: string
374
387
  }
375
388
 
376
-
377
389
  export interface SetPasswordRequest {
378
- new_password: string;
379
- sudo_token: string;
390
+ new_password: string
391
+ sudo_token: string
380
392
  }
381
393
 
382
394
  export interface UpdatePasswordRequest {
383
- old_password: string;
384
- new_password: string;
395
+ old_password: string
396
+ new_password: string
385
397
  }
386
398
 
387
399
  // password 和 verification_token 而选一,如果绑定了手机号,则必须使用verification_token 进行sudo
388
400
  export interface SudoRequest {
389
- password?: string;
401
+ password?: string
390
402
  verification_token?: string
391
403
  }
392
404
 
@@ -395,29 +407,28 @@ export interface SudoResponse {
395
407
  }
396
408
 
397
409
  export interface WithSudoRequest {
398
- sudo_token: string;
399
- version?: string;
410
+ sudo_token: string
411
+ version?: string
400
412
  }
401
413
 
402
-
403
414
  export interface ChangeBoundProviderRequest {
404
- trans_token: string;
405
- provider_id: string;
415
+ trans_token: string
416
+ provider_id: string
406
417
  }
407
418
 
408
419
  export interface ChangeBoundProviderResponse {
409
- client_id: string;
420
+ client_id: string
410
421
  }
411
422
 
412
423
  export interface QueryUserProfileRequest {
413
- id?: [string];
414
- username?: string;
415
- email?: string;
416
- phone_number?: string;
424
+ id?: [string]
425
+ username?: string
426
+ email?: string
427
+ phone_number?: string
417
428
  }
418
429
 
419
430
  export interface QueryUserProfileResponse {
420
- total: string;
431
+ total: string
421
432
  data: SimpleUserProfile[]
422
433
  }
423
434
 
@@ -432,6 +443,60 @@ export interface DeviceAuthorizeRequest extends BaseRequest {
432
443
  scope?: string
433
444
  }
434
445
 
446
+ export interface AuthorizeRequest extends BaseRequest {
447
+ response_type?: string
448
+ redirect_uri?: string
449
+ state?: string
450
+ scope?: string
451
+ code_challenge?: string
452
+ code_challenge_method?: string
453
+ sign_out_uri?: string
454
+ }
455
+
456
+ export interface AuthorizeResponse {
457
+ code?: string
458
+ access_token?: string
459
+ id_token?: string
460
+ token_type?: string
461
+ scope?: string
462
+ state?: string
463
+ expires_in?: number
464
+ }
465
+
466
+ export interface AuthorizeInfoRequest extends BaseRequest {
467
+ response_type?: string
468
+ redirect_uri?: string
469
+ state?: string
470
+ scope?: string
471
+ sign_out_uri?: string
472
+ locale?: string
473
+ }
474
+
475
+ interface Scope {
476
+ id: string
477
+ name: string
478
+ description?: string
479
+ picture?: string
480
+ url?: string
481
+ children?: Scope[]
482
+ }
483
+ export interface AuthorizeInfoResponse {
484
+ client: {
485
+ id: string
486
+ name: string
487
+ description?: string
488
+ picture?: string
489
+ url?: string
490
+ }
491
+ scopes?: Scope[]
492
+ }
493
+
494
+ export interface AuthorizeDeviceRequest extends BaseRequest {
495
+ user_code: string
496
+ scope?: string
497
+ state?: string
498
+ }
499
+
435
500
  export interface DeviceAuthorizeResponse {
436
501
  device_code: string
437
502
  user_code: string
@@ -443,13 +508,13 @@ export interface DeviceAuthorizeResponse {
443
508
 
444
509
  // 简化版用户信息
445
510
  export interface SimpleUserProfile {
446
- sub: string;
447
- name: string;
448
- picture?: string;
449
- gender?: string;
450
- locale?: string;
451
- email?: string;
452
- phone_number?: string;
511
+ sub: string
512
+ name: string
513
+ picture?: string
514
+ gender?: string
515
+ locale?: string
516
+ email?: string
517
+ phone_number?: string
453
518
  }
454
519
 
455
520
  export interface CheckUsernameRequest {
@@ -457,56 +522,75 @@ export interface CheckUsernameRequest {
457
522
  }
458
523
 
459
524
  export interface CheckIfUserExistRequest {
460
- username: string;
525
+ username: string
461
526
  }
462
527
 
463
528
  export interface CheckIfUserExistResponse {
464
- exist: boolean;
529
+ exist: boolean
465
530
  }
466
531
 
467
532
  export interface PublicKey {
468
- public_key: string; // 加密的公钥
469
- public_key_thumbprint: string; // 加密的公钥指纹
533
+ public_key: string // 加密的公钥
534
+ public_key_thumbprint: string // 加密的公钥指纹
470
535
  }
471
536
 
472
537
  export interface EncryptParams {
473
- isEncrypt?: boolean; // 是否需要加密
474
- public_key_thumbprint?: string; // 加密的公钥指纹
475
- params?: string; // 加密的数据
538
+ isEncrypt?: boolean // 是否需要加密
539
+ public_key_thumbprint?: string // 加密的公钥指纹
540
+ params?: string // 加密的数据
476
541
  }
477
542
 
478
543
  export interface ProviderSubType {
479
- id: string;
480
- provider_sub_type: 'NO_AUTH_LOGIN' | ''; // NO_AUTH_LOGIN-免密登录
544
+ id: string
545
+ provider_sub_type: 'NO_AUTH_LOGIN' | '' // NO_AUTH_LOGIN-免密登录
481
546
  }
482
547
 
483
548
  export interface GetMiniProgramQrCodeRequest {
484
- envId: string;
485
- wxAppId: string;
549
+ envId: string
550
+ wxAppId: string
486
551
  }
487
552
 
488
553
  export interface GetMiniProgramQrCodeResponse {
489
- qr_code: string;
490
- qr_code_id: string;
491
- expires_in: number;
554
+ qr_code: string
555
+ qr_code_id: string
556
+ expires_in: number
492
557
  }
493
558
 
494
559
  export interface GetMiniProgramQrCodeStatusRequest {
495
- qrCodeId: string;
496
- envId: string;
497
- wxAppId: string;
560
+ qrCodeId: string
561
+ envId: string
562
+ wxAppId: string
498
563
  }
499
564
 
500
565
  export interface GetMiniProgramQrCodeStatusResponse {
501
- status: string;
502
- provider_token: string;
503
- expires_in: number;
566
+ status: string
567
+ provider_token: string
568
+ expires_in: number
504
569
  }
505
570
 
506
571
  export interface ModifyUserBasicInfoRequest {
507
- user_id: string;
508
- nickname: string;
509
- username: string;
510
- description: string;
511
- avatar_url: string;
572
+ user_id?: string
573
+ nickname?: string
574
+ username?: string
575
+ description?: string
576
+ avatar_url?: string
577
+ gender?: 'MALE' | 'FEMALE'
578
+ password?: string // 旧密码
579
+ new_password?: string // 新密码
580
+ }
581
+
582
+ export interface GetUserBehaviorLog {
583
+ type: 'LOGIN' | 'MODIFY' // LOGIN-登录日志,MODIFY-修改登录方式日志
584
+ limit: number // 每页查询数量
585
+ page_token?: string
586
+ }
587
+
588
+ export interface GetUserBehaviorLogRes {
589
+ id: string
590
+ ip: string
591
+ user_agent: string
592
+ client_id: string
593
+ device_id: string
594
+ created_at: string
595
+ meta: { from: string }
512
596
  }