@cloudbase/oauth 2.22.1 → 2.22.2

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 (48) hide show
  1. package/dist/cjs/auth/apis.js +1 -1
  2. package/dist/cjs/captcha/captcha.js +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/oauth2client/oauth2client.js +1 -1
  5. package/dist/cjs/utils/index.js +1 -1
  6. package/dist/cjs/utils/urlSearchParams.js +1 -1
  7. package/package.json +4 -4
  8. package/src/auth/apis.ts +8 -0
  9. package/src/captcha/captcha.ts +1 -0
  10. package/src/index.ts +1 -0
  11. package/src/oauth2client/oauth2client.ts +1 -0
  12. package/src/utils/index.ts +1 -0
  13. package/src/utils/urlSearchParams.ts +2 -0
  14. package/tsconfig.json +3 -1
  15. package/dist/esm/auth/apis.d.ts +0 -123
  16. package/dist/esm/auth/consts.d.ts +0 -110
  17. package/dist/esm/auth/models.d.ts +0 -542
  18. package/dist/esm/captcha/captcha.d.ts +0 -40
  19. package/dist/esm/index.d.ts +0 -13
  20. package/dist/esm/oauth2client/consts.d.ts +0 -20
  21. package/dist/esm/oauth2client/interface.d.ts +0 -15
  22. package/dist/esm/oauth2client/models.d.ts +0 -60
  23. package/dist/esm/oauth2client/oauth2client.d.ts +0 -71
  24. package/dist/esm/utils/base64.d.ts +0 -4
  25. package/dist/esm/utils/encrypt.d.ts +0 -4
  26. package/dist/esm/utils/encryptlong/index.d.ts +0 -546
  27. package/dist/esm/utils/function/single-promise.d.ts +0 -6
  28. package/dist/esm/utils/index.d.ts +0 -2
  29. package/dist/esm/utils/mp.d.ts +0 -2
  30. package/dist/esm/utils/urlSearchParams.d.ts +0 -13
  31. package/dist/esm/utils/uuid.d.ts +0 -1
  32. /package/dist/{cjs → types}/auth/apis.d.ts +0 -0
  33. /package/dist/{cjs → types}/auth/consts.d.ts +0 -0
  34. /package/dist/{cjs → types}/auth/models.d.ts +0 -0
  35. /package/dist/{cjs → types}/captcha/captcha.d.ts +0 -0
  36. /package/dist/{cjs → types}/index.d.ts +0 -0
  37. /package/dist/{cjs → types}/oauth2client/consts.d.ts +0 -0
  38. /package/dist/{cjs → types}/oauth2client/interface.d.ts +0 -0
  39. /package/dist/{cjs → types}/oauth2client/models.d.ts +0 -0
  40. /package/dist/{cjs → types}/oauth2client/oauth2client.d.ts +0 -0
  41. /package/dist/{cjs → types}/utils/base64.d.ts +0 -0
  42. /package/dist/{cjs → types}/utils/encrypt.d.ts +0 -0
  43. /package/dist/{cjs → types}/utils/encryptlong/index.d.ts +0 -0
  44. /package/dist/{cjs → types}/utils/function/single-promise.d.ts +0 -0
  45. /package/dist/{cjs → types}/utils/index.d.ts +0 -0
  46. /package/dist/{cjs → types}/utils/mp.d.ts +0 -0
  47. /package/dist/{cjs → types}/utils/urlSearchParams.d.ts +0 -0
  48. /package/dist/{cjs → types}/utils/uuid.d.ts +0 -0
@@ -1,110 +0,0 @@
1
- export declare const AUTH_API_PREFIX = "/auth";
2
- export declare enum ApiUrls {
3
- AUTH_SIGN_UP_URL = "/v1/signup",
4
- AUTH_TOKEN_URL = "/v1/token",
5
- AUTH_REVOKE_URL = "/v1/revoke",
6
- WEDA_USER_URL = "/v1/plugin/weda/userinfo",
7
- AUTH_RESET_PASSWORD = "/v1/reset",
8
- AUTH_GET_DEVICE_CODE = "/v1/device/code",
9
- CHECK_USERNAME = "/v1/checkUsername",
10
- CHECK_IF_USER_EXIST = "/v1/checkIfUserExist",
11
- GET_PROVIDER_TYPE = "/v1/mgr/provider/providerSubType",
12
- AUTH_SIGN_IN_URL = "/v1/signin",
13
- AUTH_SIGN_IN_ANONYMOUSLY_URL = "/v1/signin/anonymously",
14
- AUTH_SIGN_IN_WITH_PROVIDER_URL = "/v1/signin/with/provider",
15
- AUTH_SIGN_IN_WITH_WECHAT_URL = "/v1/signin/wechat/noauth",
16
- AUTH_SIGN_IN_CUSTOM = "/v1/signin/custom",
17
- PROVIDER_TOKEN_URL = "/v1/provider/token",
18
- PROVIDER_URI_URL = "/v1/provider/uri",
19
- USER_ME_URL = "/v1/user/me",
20
- AUTH_SIGNOUT_URL = "/v1/user/signout",
21
- USER_QUERY_URL = "/v1/user/query",
22
- USER_PRIFILE_URL = "/v1/user/profile",
23
- USER_BASIC_EDIT_URL = "/v1/user/basic/edit",
24
- USER_TRANS_BY_PROVIDER_URL = "/v1/user/trans/by/provider",
25
- PROVIDER_LIST = "/v1/user/provider",
26
- PROVIDER_BIND_URL = "/v1/user/provider/bind",
27
- PROVIDER_UNBIND_URL = "/v1/user/provider",
28
- CHECK_PWD_URL = "/v1/user/sudo",
29
- SUDO_URL = "/v1/user/sudo",
30
- BIND_CONTACT_URL = "/v1/user/contact",
31
- AUTH_SET_PASSWORD = "/v1/user/password",
32
- AUTHORIZE_DEVICE_URL = "/v1/user/device/authorize",
33
- AUTHORIZE_URL = "/v1/user/authorize",
34
- AUTHORIZE_INFO_URL = "/v1/user/authorize/info",
35
- AUTHORIZED_DEVICES_DELETE_URL = "/v1/user/authorized/devices/",
36
- AUTH_REVOKE_ALL_URL = "/v1/user/revoke/all",
37
- GET_USER_BEHAVIOR_LOG = "/v1/user/security/history",
38
- VERIFICATION_URL = "/v1/verification",
39
- VERIFY_URL = "/v1/verification/verify",
40
- CAPTCHA_DATA_URL = "/v1/captcha/data",
41
- VERIFY_CAPTCHA_DATA_URL = "/v1/captcha/data/verify",
42
- GET_CAPTCHA_URL = "/v1/captcha/init",
43
- GET_MINIPROGRAM_QRCODE = "/v1/qrcode/generate",
44
- GET_MINIPROGRAM_QRCODE_STATUS = "/v1/qrcode/get/status"
45
- }
46
- export declare enum ApiUrlsV2 {
47
- AUTH_SIGN_IN_URL = "/v2/signin/username",
48
- AUTH_TOKEN_URL = "/v2/token",
49
- USER_ME_URL = "/v2/user/me",
50
- VERIFY_URL = "/v2/signin/verificationcode",
51
- AUTH_SIGN_IN_WITH_PROVIDER_URL = "/v2/signin/with/provider",
52
- AUTH_PUBLIC_KEY = "/v2/signin/publichkey",
53
- AUTH_RESET_PASSWORD = "/v2/signin/password/update"
54
- }
55
- export declare enum VerificationUsages {
56
- REGISTER = "REGISTER",
57
- SIGN_IN = "SIGN_IN",
58
- PASSWORD_RESET = "PASSWORD_RESET",
59
- EMAIL_ADDRESS_CHANGE = "EMAIL_ADDRESS_CHANGE",
60
- PHONE_NUMBER_CHANGE = "PHONE_NUMBER_CHANGE"
61
- }
62
- export declare enum ErrorType {
63
- UNREACHABLE = "unreachable",
64
- LOCAL = "local",
65
- CANCELLED = "cancelled",
66
- UNKNOWN = "unknown",
67
- UNAUTHENTICATED = "unauthenticated",
68
- RESOURCE_EXHAUSTED = "resource_exhausted",
69
- FAILED_PRECONDITION = "failed_precondition",
70
- INVALID_ARGUMENT = "invalid_argument",
71
- DEADLINE_EXCEEDED = "deadline_exceeded",
72
- NOT_FOUND = "not_found",
73
- ALREADY_EXISTS = "already_exists",
74
- PERMISSION_DENIED = "permission_denied",
75
- ABORTED = "aborted",
76
- OUT_OF_RANGE = "out_of_range",
77
- UNIMPLEMENTED = "unimplemented",
78
- INTERNAL = "internal",
79
- UNAVAILABLE = "unavailable",
80
- DATA_LOSS = "data_loss",
81
- INVALID_PASSWORD = "invalid_password",
82
- PASSWORD_NOT_SET = "password_not_set",
83
- INVALID_STATUS = "invalid_status",
84
- USER_PENDING = "user_pending",
85
- USER_BLOCKED = "user_blocked",
86
- INVALID_VERIFICATION_CODE = "invalid_verification_code",
87
- TWO_FACTOR_REQUIRED = "two_factor_required",
88
- INVALID_TWO_FACTOR = "invalid_two_factor",
89
- INVALID_TWO_FACTOR_RECOVERY = "invalid_two_factor_recovery",
90
- UNDER_REVIEW = "under_review",
91
- INVALID_REQUEST = "invalid_request",
92
- UNAUTHORIZED_CLIENT = "unauthorized_client",
93
- ACCESS_DENIED = "access_denied",
94
- UNSUPPORTED_RESPONSE_TYPE = "unsupported_response_type",
95
- INVALID_SCOPE = "invalid_scope",
96
- INVALID_GRANT = "invalid_grant",
97
- SERVER_ERROR = "server_error",
98
- TEMPORARILY_UNAVAILABLE = "temporarily_unavailable",
99
- INTERACTION_REQUIRED = "interaction_required",
100
- LOGIN_REQUIRED = "login_required",
101
- ACCOUNT_SELECTION_REQUIRED = "account_selection_required",
102
- CONSENT_REQUIRED = "consent_required",
103
- INVALID_REQUEST_URI = "invalid_request_uri",
104
- INVALID_REQUEST_OBJECT = "invalid_request_object",
105
- REQUEST_NOT_SUPPORTED = "request_not_supported",
106
- REQUEST_URI_NOT_SUPPORTED = "request_uri_not_supported",
107
- REGISTRATION_NOT_SUPPORTED = "registration_not_supported",
108
- CAPTCHA_REQUIRED = "captcha_required",
109
- CAPTCHA_INVALID = "captcha_invalid"
110
- }
@@ -1,542 +0,0 @@
1
- interface BaseRequest {
2
- client_id?: string;
3
- }
4
- export type GetCustomSignTicketFn = () => Promise<string>;
5
- export interface SignInRequest extends BaseRequest, EncryptParams {
6
- username?: string;
7
- password?: string;
8
- verification_token?: string;
9
- version?: string;
10
- query?: {
11
- with_department?: boolean;
12
- with_role?: boolean;
13
- };
14
- }
15
- export interface SignInWithProviderRequest extends BaseRequest {
16
- provider_token: string;
17
- version?: string;
18
- }
19
- export interface SignUpRequest extends BaseRequest {
20
- phone_number?: string;
21
- email?: string;
22
- verification_code?: string;
23
- verification_token?: string;
24
- provider_token?: string;
25
- password?: string;
26
- name?: string;
27
- gender?: string;
28
- picture?: string;
29
- locale?: string;
30
- }
31
- export interface GetVerificationRequest extends BaseRequest {
32
- phone_number?: string;
33
- email?: string;
34
- target?: string | 'ANY';
35
- usage?: string;
36
- }
37
- export interface GetVerificationResponse {
38
- verification_id?: string;
39
- is_user?: boolean | false;
40
- }
41
- export interface VerifyResponse {
42
- verification_token?: string;
43
- }
44
- export interface VerifyRequest extends BaseRequest {
45
- verification_code: string;
46
- verification_id?: string;
47
- verification_token?: string;
48
- version?: string;
49
- }
50
- export interface ProviderBindRequest {
51
- provider_token: string;
52
- }
53
- export interface GrantProviderTokenRequest extends BaseRequest {
54
- provider_id: string;
55
- provider_redirect_uri?: string;
56
- provider_code?: string;
57
- provider_access_token?: string;
58
- provider_id_token?: string;
59
- }
60
- export interface GrantProviderTokenResponse {
61
- provider_token: string;
62
- expires_in: number;
63
- code?: string;
64
- error_code?: string;
65
- provider_profile?: ProviderProfile;
66
- }
67
- export interface PatchProviderTokenRequest extends BaseRequest {
68
- provider_id?: string;
69
- provider_token: string;
70
- provider_params: {
71
- encryptedData?: string;
72
- iv?: string;
73
- code?: string;
74
- provider_code_type?: string;
75
- };
76
- }
77
- export interface PatchProviderTokenResponse {
78
- provider_token: string;
79
- expires_in: number;
80
- provider_profile: ProviderProfile;
81
- }
82
- export interface GenProviderRedirectUriResponse {
83
- uri: string;
84
- signout_uri?: string;
85
- }
86
- export interface BindWithProviderRequest extends BaseRequest {
87
- provider_token: string;
88
- }
89
- export interface BindWithProviderRequest {
90
- provider_token: string;
91
- }
92
- export interface UserProfileProvider {
93
- id?: string;
94
- provider_user_id?: string;
95
- name?: string;
96
- }
97
- export interface UserProfile {
98
- name?: string;
99
- picture?: string;
100
- username?: string;
101
- email?: string;
102
- email_verified?: boolean;
103
- phone_number?: string;
104
- providers?: [UserProfileProvider];
105
- gender?: string;
106
- birthdate?: string;
107
- zoneinfo?: string;
108
- locale?: string;
109
- created_from?: string;
110
- sub?: string;
111
- uid?: string;
112
- address?: {
113
- formatted?: string;
114
- street_address?: string;
115
- locality?: string;
116
- region?: string;
117
- postal_code?: string;
118
- country?: string;
119
- };
120
- nickName?: string;
121
- province?: string;
122
- country?: string;
123
- city?: string;
124
- }
125
- export type UserInfo = UserProfile;
126
- export interface ProviderProfile {
127
- provider_id: string;
128
- phone_number?: string;
129
- name?: string;
130
- picture?: string;
131
- email?: string;
132
- }
133
- export interface TransByProviderRequest {
134
- provider_token: string;
135
- }
136
- export interface GrantTokenRequest extends BaseRequest {
137
- client_secret?: string;
138
- code?: string;
139
- grant_type?: string;
140
- redirect_uri?: string;
141
- nonce?: string;
142
- refresh_token?: string;
143
- scope?: string;
144
- }
145
- export interface UnbindProviderRequest extends BaseRequest {
146
- provider_id: string;
147
- }
148
- export interface BindPhoneRequest extends BaseRequest {
149
- phone_number: string;
150
- sudo_token: string;
151
- verification_token: string;
152
- }
153
- export interface SetPasswordRequest extends BaseRequest {
154
- new_password: string;
155
- sudo_token: string;
156
- }
157
- export interface ChangeBindedProviderRequest extends BaseRequest {
158
- trans_token: string;
159
- provider_id: string;
160
- }
161
- export interface QueryUserProfileReq extends BaseRequest {
162
- appended_params: string;
163
- }
164
- export interface SignInWithProviderRequest {
165
- provider_token: string;
166
- provider_id?: string;
167
- }
168
- export interface SignInCustomRequest {
169
- provider_id?: string;
170
- ticket: string;
171
- }
172
- export interface SignUpRequest {
173
- phone_number?: string;
174
- email?: string;
175
- verification_code?: string;
176
- verification_token?: string;
177
- provider_token?: string;
178
- username?: string;
179
- password?: string;
180
- name?: string;
181
- gender?: string;
182
- picture?: string;
183
- locale?: string;
184
- anonymous_token?: string;
185
- }
186
- export interface GetVerificationRequest {
187
- phone_number?: string;
188
- email?: string;
189
- target?: string | 'ANY';
190
- usage?: string;
191
- }
192
- export interface GetVerificationResponse {
193
- verification_id?: string;
194
- is_user?: boolean | false;
195
- }
196
- export interface VerifyResponse {
197
- verification_token?: string;
198
- expires_in: number;
199
- }
200
- export interface VerifyRequest {
201
- verification_code: string;
202
- verification_id?: string;
203
- verification_token?: string;
204
- version?: string;
205
- }
206
- export interface ProviderBindRequest {
207
- provider_token: string;
208
- expires_in: number;
209
- }
210
- export interface GrantProviderTokenRequest {
211
- provider_id: string;
212
- provider_redirect_uri?: string;
213
- provider_code?: string;
214
- provider_access_token?: string;
215
- provider_id_token?: string;
216
- provider_params?: {
217
- provider_code_type?: string;
218
- appid?: string;
219
- };
220
- }
221
- export interface PatchProviderTokenRequest {
222
- provider_token: string;
223
- provider_id?: string;
224
- provider_params: {
225
- encryptedData?: string;
226
- iv?: string;
227
- code?: string;
228
- provider_code_type?: string;
229
- };
230
- }
231
- export interface PatchProviderTokenResponse {
232
- provider_token: string;
233
- expires_in: number;
234
- provider_profile: ProviderProfile;
235
- }
236
- export interface GenProviderRedirectUriRequest {
237
- provider_id: string;
238
- redirect_uri: string;
239
- provider_redirect_uri?: string;
240
- state: string;
241
- scope?: string;
242
- response_type?: string;
243
- other_params?: {
244
- [key: string]: string;
245
- };
246
- }
247
- export interface GenProviderRedirectUriResponse {
248
- uri: string;
249
- signout_uri?: string;
250
- }
251
- export interface BindWithProviderRequest {
252
- provider_token: string;
253
- }
254
- export interface BindWithProviderRequest {
255
- provider_token: string;
256
- }
257
- export interface UserProfileProvider {
258
- id?: string;
259
- provider_user_id?: string;
260
- name?: string;
261
- }
262
- interface ProfileGroup {
263
- id: string;
264
- expires_at?: string;
265
- }
266
- export interface UserProfile {
267
- sub?: string;
268
- name?: string;
269
- picture?: string;
270
- username?: string;
271
- email?: string;
272
- email_verified?: boolean;
273
- phone_number?: string;
274
- groups?: [ProfileGroup];
275
- providers?: [UserProfileProvider];
276
- gender?: string;
277
- birthdate?: string;
278
- zoneinfo?: string;
279
- locale?: string;
280
- created_from?: string;
281
- }
282
- interface UserProvider {
283
- id: string;
284
- name: string;
285
- provider_user_name?: string;
286
- bind: boolean;
287
- }
288
- export interface ProvidersResponse {
289
- total: number;
290
- data: [UserProvider];
291
- }
292
- export interface ProviderProfile {
293
- provider_id: string;
294
- name?: string;
295
- picture?: string;
296
- phone_number?: string;
297
- email?: string;
298
- }
299
- export interface TransByProviderRequest {
300
- provider_token: string;
301
- }
302
- export interface GrantTokenRequest {
303
- client_secret?: string;
304
- code?: string;
305
- grant_type?: string;
306
- redirect_uri?: string;
307
- nonce?: string;
308
- refresh_token?: string;
309
- username?: string;
310
- password?: string;
311
- scope?: string;
312
- code_verifier?: string;
313
- device_code?: string;
314
- }
315
- export interface UnbindProviderRequest {
316
- provider_id: string;
317
- }
318
- export interface CheckPasswordRequest extends BaseRequest {
319
- password: string;
320
- }
321
- export interface EditContactRequest {
322
- phone_number?: string;
323
- email?: string;
324
- sudo_token: string;
325
- verification_token: string;
326
- conflict_resolution?: string;
327
- }
328
- export interface BindPhoneRequest {
329
- phone_number: string;
330
- sudo_token: string;
331
- verification_token: string;
332
- conflict_resolution: string;
333
- }
334
- export interface BindEmailRequest {
335
- email: string;
336
- sudo_token: string;
337
- verification_token: string;
338
- }
339
- export interface SetPasswordRequest {
340
- new_password: string;
341
- sudo_token: string;
342
- }
343
- export interface SetPasswordRequest {
344
- new_password: string;
345
- sudo_token: string;
346
- }
347
- export interface UpdatePasswordRequest {
348
- old_password: string;
349
- new_password: string;
350
- }
351
- export interface SudoRequest {
352
- password?: string;
353
- verification_token?: string;
354
- }
355
- export interface SudoResponse {
356
- sudo_token?: string;
357
- }
358
- export interface WithSudoRequest {
359
- sudo_token: string;
360
- version?: string;
361
- }
362
- export interface ChangeBoundProviderRequest {
363
- trans_token: string;
364
- provider_id: string;
365
- }
366
- export interface ChangeBoundProviderResponse {
367
- client_id: string;
368
- }
369
- export interface QueryUserProfileRequest {
370
- id?: [string];
371
- username?: string;
372
- email?: string;
373
- phone_number?: string;
374
- }
375
- export interface QueryUserProfileResponse {
376
- total: number;
377
- data?: [SimpleUserProfile];
378
- }
379
- export interface ResetPasswordRequest extends BaseRequest {
380
- email: string;
381
- phone_number: string;
382
- new_password: string;
383
- verification_token: string;
384
- }
385
- export interface DeviceAuthorizeRequest extends BaseRequest {
386
- scope?: string;
387
- }
388
- export interface AuthorizeRequest extends BaseRequest {
389
- response_type?: string;
390
- redirect_uri?: string;
391
- state?: string;
392
- scope?: string;
393
- code_challenge?: string;
394
- code_challenge_method?: string;
395
- sign_out_uri?: string;
396
- }
397
- export interface AuthorizeResponse {
398
- code?: string;
399
- access_token?: string;
400
- id_token?: string;
401
- token_type?: string;
402
- scope?: string;
403
- state?: string;
404
- expires_in?: number;
405
- }
406
- export interface AuthorizeInfoRequest extends BaseRequest {
407
- response_type?: string;
408
- redirect_uri?: string;
409
- state?: string;
410
- scope?: string;
411
- sign_out_uri?: string;
412
- locale?: string;
413
- }
414
- export interface Scope {
415
- id: string;
416
- name: string;
417
- description?: string;
418
- picture?: string;
419
- url?: string;
420
- children?: Scope[];
421
- }
422
- export interface AuthorizeInfoResponse {
423
- client: {
424
- id: string;
425
- name: string;
426
- description?: string;
427
- picture?: string;
428
- url?: string;
429
- };
430
- scopes?: Scope[];
431
- }
432
- export interface RevokeDeviceRequest {
433
- device_id: string;
434
- }
435
- export interface SignoutRequest {
436
- redirect_uri?: string;
437
- state?: string;
438
- }
439
- export interface SignoutReponse {
440
- redirect_uri?: string;
441
- }
442
- export interface AuthorizeDeviceRequest extends BaseRequest {
443
- user_code: string;
444
- scope?: string;
445
- state?: string;
446
- }
447
- export interface DeviceAuthorizeResponse {
448
- device_code: string;
449
- user_code?: string;
450
- expires_in: number;
451
- interval: number;
452
- verification_uri?: string;
453
- verification_uri_complete?: string;
454
- }
455
- export interface SimpleUserProfile {
456
- sub: string;
457
- name: string;
458
- picture?: string;
459
- gender?: string;
460
- locale?: string;
461
- email?: string;
462
- phone_number?: string;
463
- }
464
- export interface CheckUsernameRequest {
465
- username: string;
466
- }
467
- export interface CheckIfUserExistRequest {
468
- username: string;
469
- }
470
- export interface CheckIfUserExistResponse {
471
- exist: boolean;
472
- }
473
- export interface PublicKey {
474
- public_key: string;
475
- public_key_thumbprint: string;
476
- }
477
- export interface EncryptParams {
478
- isEncrypt?: boolean;
479
- public_key_thumbprint?: string;
480
- params?: string;
481
- }
482
- export interface ProviderSubType {
483
- id: string;
484
- provider_sub_type: 'NO_AUTH_LOGIN' | '';
485
- }
486
- export interface GetMiniProgramQrCodeRequest {
487
- envId: string;
488
- wxAppId: string;
489
- }
490
- export interface GetMiniProgramQrCodeResponse {
491
- qr_code: string;
492
- qr_code_id: string;
493
- expires_in: number;
494
- }
495
- export interface GetMiniProgramQrCodeStatusRequest {
496
- qrCodeId: string;
497
- envId: string;
498
- wxAppId: string;
499
- }
500
- export interface GetMiniProgramQrCodeStatusResponse {
501
- status: string;
502
- provider_token: string;
503
- expires_in: number;
504
- }
505
- export interface ModifyUserBasicInfoRequest {
506
- user_id?: string;
507
- nickname?: string;
508
- username?: string;
509
- description?: string;
510
- avatar_url?: string;
511
- gender?: 'MALE' | 'FEMALE';
512
- password?: string;
513
- new_password?: string;
514
- }
515
- export interface GetUserBehaviorLog {
516
- type: 'LOGIN' | 'MODIFY';
517
- limit: number;
518
- page_token?: string;
519
- }
520
- export interface GetUserBehaviorLogRes {
521
- id: string;
522
- ip: string;
523
- user_agent: string;
524
- client_id: string;
525
- device_id: string;
526
- created_at: string;
527
- meta: {
528
- from: string;
529
- };
530
- }
531
- export interface ModifyPasswordWithoutLoginRequest {
532
- username?: string;
533
- password?: string;
534
- new_password?: string;
535
- }
536
- export interface ToDefaultLoginPage {
537
- config_version?: 'env' | string;
538
- redirect_uri?: string;
539
- app_id?: string;
540
- query?: Record<string, any>;
541
- }
542
- export {};
@@ -1,40 +0,0 @@
1
- import { SimpleStorage, RequestFunction } from '../oauth2client/interface';
2
- import { AuthClientRequestOptions } from '../oauth2client/models';
3
- import { SDKAdapterInterface } from '@cloudbase/adapter-interface';
4
- export interface CaptchaOptions {
5
- clientId: string;
6
- request: RequestFunction;
7
- storage: SimpleStorage;
8
- openURIWithCallback?: OpenURIWithCallbackFuction;
9
- adapter?: SDKAdapterInterface & {
10
- isMatch?: () => boolean;
11
- };
12
- }
13
- type OpenURIWithCallbackFuction = (url: string) => Promise<CaptchaToken>;
14
- export interface CaptchaToken {
15
- captcha_token: string;
16
- expires_in: number;
17
- expires_at?: Date | null;
18
- }
19
- export interface CaptchaRequestOptions extends AuthClientRequestOptions {
20
- withCaptcha?: boolean;
21
- }
22
- export interface GetCaptchaResponse {
23
- captcha_token?: string;
24
- expires_in?: number;
25
- url?: string;
26
- }
27
- export declare class Captcha {
28
- private config;
29
- private tokenSectionName;
30
- constructor(opts: CaptchaOptions);
31
- isMatch(): boolean;
32
- request<T>(url: string, options?: CaptchaRequestOptions): Promise<T>;
33
- private getDefaultOpenURIWithCallback;
34
- private defaultOpenURIWithCallback;
35
- private getCaptchaToken;
36
- private appendCaptchaTokenToURL;
37
- private saveCaptchaToken;
38
- private findCaptchaToken;
39
- }
40
- export {};
@@ -1,13 +0,0 @@
1
- import { OAuth2Client } from './oauth2client/oauth2client';
2
- import { AuthOptions, Auth } from './auth/apis';
3
- export { Auth } from './auth/apis';
4
- export { AUTH_API_PREFIX } from './auth/consts';
5
- export * as authModels from './auth/models';
6
- export type { ProviderProfile } from './auth/models';
7
- export type { Credentials, OAuth2ClientOptions, ResponseError, AuthClientRequestOptions } from './oauth2client/models';
8
- export type { AuthOptions } from './auth/apis';
9
- export declare class CloudbaseOAuth {
10
- oauth2client: OAuth2Client;
11
- authApi: Auth;
12
- constructor(authOptions: AuthOptions);
13
- }