@cloudbase/oauth 2.5.49-beta.8 → 2.6.4-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.
- package/dist/cjs/auth/apis.d.ts +3 -1
- package/dist/cjs/auth/apis.js +58 -1
- package/dist/cjs/auth/consts.d.ts +2 -1
- package/dist/cjs/auth/consts.js +2 -1
- package/dist/cjs/auth/models.d.ts +25 -6
- package/dist/cjs/auth/models.js +1 -1
- package/dist/cjs/oauth2client/oauth2client.js +3 -4
- package/dist/cjs/utils/encrypt.d.ts +1 -1
- package/dist/cjs/utils/encrypt.js +2 -2
- package/dist/esm/auth/apis.d.ts +3 -1
- package/dist/esm/auth/apis.js +37 -0
- package/dist/esm/auth/consts.d.ts +2 -1
- package/dist/esm/auth/consts.js +1 -0
- package/dist/esm/auth/models.d.ts +25 -6
- package/dist/esm/oauth2client/oauth2client.js +3 -2
- package/dist/esm/utils/encrypt.d.ts +1 -1
- package/dist/esm/utils/encrypt.js +1 -1
- package/dist/miniprogram/index.js +1 -1
- package/package.json +2 -3
- package/src/auth/apis.ts +56 -0
- package/src/auth/consts.ts +1 -1
- package/src/auth/models.ts +319 -300
- package/src/oauth2client/oauth2client.ts +1 -1
- package/src/utils/encrypt.ts +2 -2
package/src/auth/models.ts
CHANGED
|
@@ -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
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 }
|
|
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,477 +101,496 @@ 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
|
|
135
|
-
sub?: string
|
|
136
|
-
uid?: 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
|
+
sub?: string
|
|
136
|
+
uid?: string
|
|
137
137
|
address?: {
|
|
138
|
-
formatted?: string
|
|
139
|
-
street_address?: string
|
|
140
|
-
locality?: string
|
|
141
|
-
region?: string
|
|
142
|
-
postal_code?: string
|
|
143
|
-
country?: string
|
|
144
|
-
}
|
|
145
|
-
nickName?: string
|
|
146
|
-
province?: string
|
|
147
|
-
country?: string
|
|
148
|
-
city?: string
|
|
138
|
+
formatted?: string
|
|
139
|
+
street_address?: string
|
|
140
|
+
locality?: string
|
|
141
|
+
region?: string
|
|
142
|
+
postal_code?: string
|
|
143
|
+
country?: string
|
|
144
|
+
}
|
|
145
|
+
nickName?: string // TODO:
|
|
146
|
+
province?: string // TODO:
|
|
147
|
+
country?: string // TODO:
|
|
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
|
|
156
|
-
name?: string
|
|
157
|
-
picture?: string
|
|
158
|
-
email?: string
|
|
154
|
+
provider_id: string
|
|
155
|
+
phone_number?: string
|
|
156
|
+
name?: string
|
|
157
|
+
picture?: string
|
|
158
|
+
email?: string
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
export interface TransByProviderRequest {
|
|
162
|
-
provider_token: string
|
|
162
|
+
provider_token: string
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
export interface GrantTokenRequest extends BaseRequest {
|
|
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
|
|
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
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
export interface UnbindProviderRequest extends BaseRequest {
|
|
176
|
-
provider_id: string
|
|
176
|
+
provider_id: string
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
export interface CheckPasswordrRequest extends BaseRequest {
|
|
180
|
-
password: string
|
|
180
|
+
password: string
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
export interface BindPhoneRequest extends BaseRequest {
|
|
184
|
-
phone_number: string
|
|
185
|
-
sudo_token: string
|
|
186
|
-
verification_token: string
|
|
184
|
+
phone_number: string
|
|
185
|
+
sudo_token: string
|
|
186
|
+
verification_token: string
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
export interface SetPasswordRequest extends BaseRequest {
|
|
190
|
-
new_password: string
|
|
191
|
-
sudo_token: string
|
|
190
|
+
new_password: string
|
|
191
|
+
sudo_token: string
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
export interface
|
|
195
|
-
trans_token: string
|
|
196
|
-
provider_id: string
|
|
194
|
+
export interface ChangeBindedProviderRequest extends BaseRequest {
|
|
195
|
+
trans_token: string
|
|
196
|
+
provider_id: string
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
export interface QueryUserProfileReq extends BaseRequest {
|
|
200
|
-
appended_params: string
|
|
200
|
+
appended_params: string
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
export interface SignInWithProviderRequest {
|
|
204
|
-
provider_token: string
|
|
205
|
-
provider_id?: string
|
|
204
|
+
provider_token: string
|
|
205
|
+
provider_id?: string
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
export interface SignUpRequest {
|
|
209
|
-
phone_number?: string
|
|
210
|
-
email?: string
|
|
209
|
+
phone_number?: string
|
|
210
|
+
email?: string
|
|
211
211
|
|
|
212
|
-
verification_code?: string
|
|
213
|
-
verification_token?: string
|
|
214
|
-
provider_token?: string
|
|
212
|
+
verification_code?: string
|
|
213
|
+
verification_token?: string
|
|
214
|
+
provider_token?: string
|
|
215
215
|
|
|
216
|
-
password?: string
|
|
217
|
-
name?: string
|
|
218
|
-
gender?: string
|
|
219
|
-
picture?: string
|
|
220
|
-
locale?: string
|
|
216
|
+
password?: string
|
|
217
|
+
name?: string
|
|
218
|
+
gender?: string
|
|
219
|
+
picture?: string
|
|
220
|
+
locale?: string
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
export interface GetVerificationRequest {
|
|
224
|
-
phone_number?: string
|
|
225
|
-
email?: string
|
|
224
|
+
phone_number?: string
|
|
225
|
+
email?: string
|
|
226
226
|
// 可选 ANY,USER,NOT_USER, CUR_USER;
|
|
227
|
-
target?: string | 'ANY'
|
|
228
|
-
usage?: string
|
|
227
|
+
target?: string | 'ANY'
|
|
228
|
+
usage?: string
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
export interface GetVerificationResponse {
|
|
232
|
-
verification_id?: string
|
|
233
|
-
is_user?: boolean | false
|
|
232
|
+
verification_id?: string
|
|
233
|
+
is_user?: boolean | false
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
export interface VerifyResponse {
|
|
237
|
-
verification_token?: string
|
|
237
|
+
verification_token?: string
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
export interface VerifyRequest {
|
|
241
|
-
verification_code: string
|
|
242
|
-
verification_id?: string
|
|
243
|
-
verification_token?: string
|
|
244
|
-
version?: string
|
|
241
|
+
verification_code: string
|
|
242
|
+
verification_id?: string
|
|
243
|
+
verification_token?: string
|
|
244
|
+
version?: string
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
export interface ProviderBindRequest {
|
|
248
|
-
provider_token: string
|
|
248
|
+
provider_token: string
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
export interface GrantProviderTokenRequest {
|
|
252
|
-
provider_id: string
|
|
253
|
-
provider_redirect_uri?: string
|
|
254
|
-
provider_code?: string
|
|
255
|
-
provider_access_token?: string
|
|
256
|
-
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
|
|
257
257
|
provider_params?: {
|
|
258
|
-
provider_code_type?: string
|
|
259
|
-
appid?: string
|
|
260
|
-
}
|
|
258
|
+
provider_code_type?: string
|
|
259
|
+
appid?: string
|
|
260
|
+
}
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
export interface GrantProviderTokenResponse {
|
|
264
|
-
provider_token: string
|
|
265
|
-
expires_in: number
|
|
266
|
-
code?: string
|
|
264
|
+
provider_token: string
|
|
265
|
+
expires_in: number
|
|
266
|
+
code?: string
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
export interface PatchProviderTokenRequest {
|
|
270
|
-
provider_token: string
|
|
271
|
-
provider_id?: string
|
|
270
|
+
provider_token: string
|
|
271
|
+
provider_id?: string
|
|
272
272
|
provider_params: {
|
|
273
|
-
encryptedData?: string
|
|
274
|
-
iv?: string
|
|
275
|
-
code?: string
|
|
276
|
-
provider_code_type?: string
|
|
277
|
-
}
|
|
273
|
+
encryptedData?: string
|
|
274
|
+
iv?: string
|
|
275
|
+
code?: string
|
|
276
|
+
provider_code_type?: string
|
|
277
|
+
}
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
export interface PatchProviderTokenResponse {
|
|
281
|
-
provider_token: string
|
|
282
|
-
expires_in: number
|
|
283
|
-
provider_profile: ProviderProfile
|
|
281
|
+
provider_token: string
|
|
282
|
+
expires_in: number
|
|
283
|
+
provider_profile: ProviderProfile
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
export interface GenProviderRedirectUriRequest {
|
|
287
|
-
provider_id: string
|
|
288
|
-
provider_redirect_uri: string
|
|
289
|
-
state: string
|
|
287
|
+
provider_id: string
|
|
288
|
+
provider_redirect_uri: string
|
|
289
|
+
state: string
|
|
290
290
|
other_params?: {
|
|
291
|
-
[key: string]: string
|
|
292
|
-
}
|
|
291
|
+
[key: string]: string
|
|
292
|
+
}
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
export interface GenProviderRedirectUriResponse {
|
|
296
|
-
uri: string
|
|
297
|
-
signout_uri?: string
|
|
296
|
+
uri: string
|
|
297
|
+
signout_uri?: string
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
export interface BindWithProviderRequest {
|
|
301
|
-
provider_token: string
|
|
301
|
+
provider_token: string
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
export interface BindWithProviderRequest {
|
|
305
|
-
provider_token: string
|
|
305
|
+
provider_token: string
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
export interface UserProfileProvider {
|
|
309
|
-
id?: string
|
|
310
|
-
provider_user_id?: string
|
|
311
|
-
name?: string
|
|
309
|
+
id?: string
|
|
310
|
+
provider_user_id?: string
|
|
311
|
+
name?: string
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
export interface UserProfile {
|
|
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
|
|
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
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
export interface ProviderProfile {
|
|
330
|
-
provider_id: string
|
|
331
|
-
phone_number?: string
|
|
330
|
+
provider_id: string
|
|
331
|
+
phone_number?: string
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
export interface TransByProviderRequest {
|
|
335
|
-
provider_token: string
|
|
335
|
+
provider_token: string
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
export interface GrantTokenRequest {
|
|
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
|
|
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
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
export interface UnbindProviderRequest {
|
|
349
|
-
provider_id: string
|
|
349
|
+
provider_id: string
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
export interface CheckPasswordrRequest {
|
|
353
|
-
password: string
|
|
353
|
+
password: string
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
export interface EditContactRequest {
|
|
357
|
-
phone_number?: string
|
|
358
|
-
email?: string
|
|
359
|
-
sudo_token: string
|
|
360
|
-
verification_token: string
|
|
357
|
+
phone_number?: string
|
|
358
|
+
email?: string
|
|
359
|
+
sudo_token: string
|
|
360
|
+
verification_token: string
|
|
361
361
|
// 冲突解决方案
|
|
362
362
|
// 可选:DEFAULT, 默认解决方案:提示用户该手机号已被其他人绑定
|
|
363
363
|
// DELETE_ACCOUNT_TRANSFER,标记原来的账号为已注销,并将手机换绑给自己
|
|
364
364
|
// TRANSFER 仅换绑手机号,不注销原有账号。(原有账号无法登录情况下,则自动标记为注销)
|
|
365
|
-
conflict_resolution?: string
|
|
365
|
+
conflict_resolution?: string
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
export interface BindPhoneRequest {
|
|
369
|
-
phone_number: string
|
|
370
|
-
sudo_token: string
|
|
371
|
-
verification_token: string
|
|
372
|
-
conflict_resolution: string
|
|
369
|
+
phone_number: string
|
|
370
|
+
sudo_token: string
|
|
371
|
+
verification_token: string
|
|
372
|
+
conflict_resolution: string
|
|
373
373
|
// 1. DEFAULT 0, 默认提示用户手机号已被绑定
|
|
374
374
|
// 2. DELETE_ACCOUNT_TRANSFER 1, 标记原账号已被注销,并将手机换绑给自己
|
|
375
375
|
// 3. TRANSFER 2, 仅换绑手机号,不注销原有账号(换绑后原账号无法登录时,则自动注销原账号)
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
export interface BindEmailRequest {
|
|
379
|
-
email: string
|
|
380
|
-
sudo_token: string
|
|
381
|
-
verification_token: string
|
|
379
|
+
email: string
|
|
380
|
+
sudo_token: string
|
|
381
|
+
verification_token: string
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
export interface SetPasswordRequest {
|
|
385
|
-
new_password: string
|
|
386
|
-
sudo_token: string
|
|
385
|
+
new_password: string
|
|
386
|
+
sudo_token: string
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
export interface SetPasswordRequest {
|
|
390
|
-
new_password: string
|
|
391
|
-
sudo_token: string
|
|
390
|
+
new_password: string
|
|
391
|
+
sudo_token: string
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
export interface UpdatePasswordRequest {
|
|
395
|
-
old_password: string
|
|
396
|
-
new_password: string
|
|
395
|
+
old_password: string
|
|
396
|
+
new_password: string
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
// password 和 verification_token 而选一,如果绑定了手机号,则必须使用verification_token 进行sudo
|
|
400
400
|
export interface SudoRequest {
|
|
401
|
-
password?: string
|
|
402
|
-
verification_token?: string
|
|
401
|
+
password?: string
|
|
402
|
+
verification_token?: string
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
export interface SudoResponse {
|
|
406
|
-
sudo_token?: string
|
|
406
|
+
sudo_token?: string
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
export interface WithSudoRequest {
|
|
410
|
-
sudo_token: string
|
|
411
|
-
version?: string
|
|
410
|
+
sudo_token: string
|
|
411
|
+
version?: string
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
export interface ChangeBoundProviderRequest {
|
|
415
|
-
trans_token: string
|
|
416
|
-
provider_id: string
|
|
415
|
+
trans_token: string
|
|
416
|
+
provider_id: string
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
export interface ChangeBoundProviderResponse {
|
|
420
|
-
client_id: string
|
|
420
|
+
client_id: string
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
export interface QueryUserProfileRequest {
|
|
424
|
-
id?: [string]
|
|
425
|
-
username?: string
|
|
426
|
-
email?: string
|
|
427
|
-
phone_number?: string
|
|
424
|
+
id?: [string]
|
|
425
|
+
username?: string
|
|
426
|
+
email?: string
|
|
427
|
+
phone_number?: string
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
export interface QueryUserProfileResponse {
|
|
431
|
-
total: string
|
|
432
|
-
data: SimpleUserProfile[]
|
|
431
|
+
total: string
|
|
432
|
+
data: SimpleUserProfile[]
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
export interface ResetPasswordRequest extends BaseRequest {
|
|
436
|
-
email: string
|
|
437
|
-
phone_number: string
|
|
438
|
-
new_password: string
|
|
439
|
-
verification_token: string
|
|
436
|
+
email: string
|
|
437
|
+
phone_number: string
|
|
438
|
+
new_password: string
|
|
439
|
+
verification_token: string
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
export interface DeviceAuthorizeRequest extends BaseRequest {
|
|
443
|
-
scope?: string
|
|
443
|
+
scope?: string
|
|
444
444
|
}
|
|
445
445
|
|
|
446
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
|
|
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
454
|
}
|
|
455
455
|
|
|
456
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
|
|
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
464
|
}
|
|
465
465
|
|
|
466
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
|
|
467
|
+
response_type?: string
|
|
468
|
+
redirect_uri?: string
|
|
469
|
+
state?: string
|
|
470
|
+
scope?: string
|
|
471
|
+
sign_out_uri?: string
|
|
472
|
+
locale?: string
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
interface Scope {
|
|
476
|
-
id: string
|
|
477
|
-
name: string
|
|
478
|
-
description?: string
|
|
479
|
-
picture?: string
|
|
480
|
-
url?: string
|
|
481
|
-
children?: Scope[]
|
|
476
|
+
id: string
|
|
477
|
+
name: string
|
|
478
|
+
description?: string
|
|
479
|
+
picture?: string
|
|
480
|
+
url?: string
|
|
481
|
+
children?: Scope[]
|
|
482
482
|
}
|
|
483
483
|
export interface AuthorizeInfoResponse {
|
|
484
484
|
client: {
|
|
485
|
-
id: string
|
|
486
|
-
name: string
|
|
487
|
-
description?: string
|
|
488
|
-
picture?: string
|
|
489
|
-
url?: string
|
|
490
|
-
}
|
|
491
|
-
scopes?: Scope[]
|
|
485
|
+
id: string
|
|
486
|
+
name: string
|
|
487
|
+
description?: string
|
|
488
|
+
picture?: string
|
|
489
|
+
url?: string
|
|
490
|
+
}
|
|
491
|
+
scopes?: Scope[]
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
export interface AuthorizeDeviceRequest extends BaseRequest {
|
|
495
|
-
user_code: string
|
|
496
|
-
scope?: string
|
|
497
|
-
state?: string
|
|
495
|
+
user_code: string
|
|
496
|
+
scope?: string
|
|
497
|
+
state?: string
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
export interface DeviceAuthorizeResponse {
|
|
501
|
-
device_code: string
|
|
502
|
-
user_code: string
|
|
503
|
-
expires_in: number
|
|
504
|
-
interval: number
|
|
505
|
-
verification_url: string
|
|
506
|
-
verification_uri_complete: string
|
|
501
|
+
device_code: string
|
|
502
|
+
user_code: string
|
|
503
|
+
expires_in: number
|
|
504
|
+
interval: number
|
|
505
|
+
verification_url: string
|
|
506
|
+
verification_uri_complete: string
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
// 简化版用户信息
|
|
510
510
|
export interface SimpleUserProfile {
|
|
511
|
-
sub: string
|
|
512
|
-
name: string
|
|
513
|
-
picture?: string
|
|
514
|
-
gender?: string
|
|
515
|
-
locale?: string
|
|
516
|
-
email?: string
|
|
517
|
-
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
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
export interface CheckUsernameRequest {
|
|
521
|
-
username: string
|
|
521
|
+
username: string
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
export interface CheckIfUserExistRequest {
|
|
525
|
-
username: string
|
|
525
|
+
username: string
|
|
526
526
|
}
|
|
527
527
|
|
|
528
528
|
export interface CheckIfUserExistResponse {
|
|
529
|
-
exist: boolean
|
|
529
|
+
exist: boolean
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
export interface PublicKey {
|
|
533
|
-
public_key: string
|
|
534
|
-
public_key_thumbprint: string
|
|
533
|
+
public_key: string // 加密的公钥
|
|
534
|
+
public_key_thumbprint: string // 加密的公钥指纹
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
export interface EncryptParams {
|
|
538
|
-
isEncrypt?: boolean
|
|
539
|
-
public_key_thumbprint?: string
|
|
540
|
-
params?: string
|
|
538
|
+
isEncrypt?: boolean // 是否需要加密
|
|
539
|
+
public_key_thumbprint?: string // 加密的公钥指纹
|
|
540
|
+
params?: string // 加密的数据
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
export interface ProviderSubType {
|
|
544
|
-
id: string
|
|
545
|
-
provider_sub_type: 'NO_AUTH_LOGIN' | ''
|
|
544
|
+
id: string
|
|
545
|
+
provider_sub_type: 'NO_AUTH_LOGIN' | '' // NO_AUTH_LOGIN-免密登录
|
|
546
546
|
}
|
|
547
547
|
|
|
548
548
|
export interface GetMiniProgramQrCodeRequest {
|
|
549
|
-
envId: string
|
|
550
|
-
wxAppId: string
|
|
549
|
+
envId: string
|
|
550
|
+
wxAppId: string
|
|
551
551
|
}
|
|
552
552
|
|
|
553
553
|
export interface GetMiniProgramQrCodeResponse {
|
|
554
|
-
qr_code: string
|
|
555
|
-
qr_code_id: string
|
|
556
|
-
expires_in: number
|
|
554
|
+
qr_code: string
|
|
555
|
+
qr_code_id: string
|
|
556
|
+
expires_in: number
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
export interface GetMiniProgramQrCodeStatusRequest {
|
|
560
|
-
qrCodeId: string
|
|
561
|
-
envId: string
|
|
562
|
-
wxAppId: string
|
|
560
|
+
qrCodeId: string
|
|
561
|
+
envId: string
|
|
562
|
+
wxAppId: string
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
export interface GetMiniProgramQrCodeStatusResponse {
|
|
566
|
-
status: string
|
|
567
|
-
provider_token: string
|
|
568
|
-
expires_in: number
|
|
566
|
+
status: string
|
|
567
|
+
provider_token: string
|
|
568
|
+
expires_in: number
|
|
569
569
|
}
|
|
570
570
|
|
|
571
571
|
export interface ModifyUserBasicInfoRequest {
|
|
572
|
-
user_id
|
|
573
|
-
nickname
|
|
574
|
-
username
|
|
575
|
-
description
|
|
576
|
-
avatar_url
|
|
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 }
|
|
577
596
|
}
|