@cloudbase/js-sdk 3.8.2-beta.0 → 3.8.2-beta.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.
- package/ai/dist/AI.d.ts +29 -0
- package/ai/dist/bot/index.d.ts +41 -0
- package/ai/dist/bot/types.d.ts +144 -0
- package/ai/dist/errors.d.ts +10 -0
- package/ai/dist/eventsource_parser/index.d.ts +2 -0
- package/ai/dist/eventsource_parser/parse.d.ts +2 -0
- package/ai/dist/eventsource_parser/stream.d.ts +5 -0
- package/ai/dist/eventsource_parser/types.d.ts +16 -0
- package/ai/dist/index.d.ts +42 -1
- package/ai/dist/models/Ark/index.d.ts +10 -0
- package/ai/dist/models/Ark/type.d.ts +71 -0
- package/ai/dist/models/DashScope/index.d.ts +10 -0
- package/ai/dist/models/DashScope/type.d.ts +74 -0
- package/ai/dist/models/DeepSeek/index.d.ts +10 -0
- package/ai/dist/models/Default/index.d.ts +10 -0
- package/ai/dist/models/HunYuan/index.d.ts +10 -0
- package/ai/dist/models/HunYuan/type.d.ts +74 -0
- package/ai/dist/models/HunYuan/util.d.ts +4 -0
- package/ai/dist/models/HunYuanBeta/index.d.ts +10 -0
- package/ai/dist/models/HunYuanExp/index.d.ts +10 -0
- package/ai/dist/models/HunYuanOpen/index.d.ts +10 -0
- package/ai/dist/models/Moonshot/index.d.ts +10 -0
- package/ai/dist/models/Moonshot/type.d.ts +85 -0
- package/ai/dist/models/Yi/index.d.ts +10 -0
- package/ai/dist/models/Yi/type.d.ts +75 -0
- package/ai/dist/models/ZhiPu/index.d.ts +10 -0
- package/ai/dist/models/ZhiPu/type.d.ts +71 -0
- package/ai/dist/models/image-model.d.ts +19 -0
- package/ai/dist/models/index.d.ts +26 -0
- package/ai/dist/models/model.d.ts +40 -0
- package/ai/dist/type.d.ts +192 -0
- package/ai/dist/utils.d.ts +38 -0
- package/apis/dist/callApis.d.ts +20 -0
- package/apis/dist/index.d.ts +5 -1
- package/apis/dist/type.d.ts +14 -0
- package/app/dist/constants/common.d.ts +38 -0
- package/app/dist/index.d.ts +66 -7
- package/app/dist/index.esm.js +1 -1
- package/app/dist/index.js +1 -1
- package/app/dist/index.js.map +1 -1
- package/app/dist/index.node.d.ts +6 -0
- package/app/dist/index.node.esm.js +1 -1
- package/app/dist/index.node.esm.js.map +1 -1
- package/app/dist/index.node.js +1 -1
- package/app/dist/index.node.js.map +1 -1
- package/app/dist/libs/adapter-node/constants.d.ts +33 -0
- package/app/dist/libs/adapter-node/context.d.ts +18 -0
- package/app/dist/libs/adapter-node/index.d.ts +26 -0
- package/app/dist/libs/adapter-node/metadata.d.ts +14 -0
- package/app/dist/libs/adapter-node/optional-require.d.ts +1 -0
- package/app/dist/libs/adapter-node/request.d.ts +44 -0
- package/app/dist/libs/adapter-node/tool.d.ts +2 -0
- package/app/dist/libs/adapter-node/types.d.ts +103 -0
- package/app/dist/libs/adapter-node/utils.d.ts +37 -0
- package/app/dist/libs/adapter-node/wx.d.ts +39 -0
- package/app/dist/libs/adapter.d.ts +3 -0
- package/app/dist/libs/cache.d.ts +6 -0
- package/app/dist/libs/component.d.ts +3 -0
- package/app/dist/libs/lang.d.ts +23 -0
- package/app/dist/libs/request.d.ts +62 -0
- package/auth/dist/adapter.d.ts +2 -0
- package/auth/dist/index.d.ts +271 -2
- package/auth/dist/index.esm.js +1 -1
- package/auth/dist/index.esm.js.map +1 -1
- package/auth/dist/index.js +1 -1
- package/auth/dist/index.js.map +1 -1
- package/auth/dist/type.d.ts +295 -0
- package/auth/dist/utilities.d.ts +7 -0
- package/auth/dist/utils.d.ts +5 -0
- package/auth/dist/v1-compat.d.ts +77 -0
- package/cloudrun/dist/index.d.ts +4 -1
- package/container/dist/constants/index.d.ts +1 -0
- package/container/dist/go_wams_exec.d.ts +2 -0
- package/container/dist/index.d.ts +13 -2
- package/container/dist/utils/index.d.ts +3 -0
- package/container/dist/utils/loader.d.ts +8 -0
- package/container/dist/utils/request.d.ts +12 -0
- package/core.d.ts +84 -81
- package/database/dist/index.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +1 -1
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.esm.js +1 -1
- package/dist/index.node.esm.js.map +1 -1
- package/functions/dist/index.d.ts +2 -2
- package/miniprogram_dist/ai/index.d.ts +1 -1
- package/miniprogram_dist/apis/index.d.ts +1 -1
- package/miniprogram_dist/app/index.d.ts +5 -5
- package/miniprogram_dist/auth/index.d.ts +7 -7
- package/miniprogram_dist/auth/index.js +1 -1
- package/miniprogram_dist/cloudrun/index.d.ts +2 -2
- package/miniprogram_dist/container/index.d.ts +2 -2
- package/miniprogram_dist/database/index.d.ts +1 -1
- package/miniprogram_dist/functions/index.d.ts +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/miniprogram_dist/model/index.d.ts +1 -1
- package/miniprogram_dist/mysql/index.d.ts +1 -1
- package/miniprogram_dist/realtime/index.d.ts +1 -1
- package/miniprogram_dist/storage/index.d.ts +1 -1
- package/model/dist/index.d.ts +5 -1
- package/mysql/dist/index.d.ts +4 -1
- package/oauth/dist/auth/apis.d.ts +143 -0
- package/oauth/dist/auth/auth-error.d.ts +32 -0
- package/oauth/dist/auth/consts.d.ts +165 -0
- package/oauth/dist/auth/models.d.ts +557 -0
- package/oauth/dist/captcha/captcha-dom.d.ts +3 -0
- package/oauth/dist/captcha/captcha.d.ts +42 -0
- package/oauth/dist/index.d.ts +22 -1
- package/oauth/dist/oauth2client/consts.d.ts +20 -0
- package/oauth/dist/oauth2client/interface.d.ts +15 -0
- package/oauth/dist/oauth2client/models.d.ts +75 -0
- package/oauth/dist/oauth2client/oauth2client.d.ts +154 -0
- package/oauth/dist/utils/base64.d.ts +9 -0
- package/oauth/dist/utils/encrypt.d.ts +4 -0
- package/oauth/dist/utils/encryptlong/index.d.ts +546 -0
- package/oauth/dist/utils/function/single-promise.d.ts +10 -0
- package/oauth/dist/utils/index.d.ts +2 -0
- package/oauth/dist/utils/mp.d.ts +2 -0
- package/oauth/dist/utils/urlSearchParams.d.ts +13 -0
- package/oauth/dist/utils/uuid.d.ts +1 -0
- package/package.json +20 -3
- package/realtime/dist/common.d.ts +4 -0
- package/realtime/dist/error.d.ts +36 -0
- package/realtime/dist/index.d.ts +4 -2
- package/realtime/dist/listener.d.ts +14 -0
- package/realtime/dist/message.d.ts +3 -0
- package/realtime/dist/snapshot.d.ts +17 -0
- package/realtime/dist/utils.d.ts +1 -0
- package/realtime/dist/virtual-websocket-client.d.ts +62 -0
- package/realtime/dist/websocket-client.d.ts +78 -0
- package/realtime/dist/ws-event.d.ts +126 -0
- package/storage/dist/cloudbase-storage.d.ts +58 -0
- package/storage/dist/download-builder.d.ts +24 -0
- package/storage/dist/encoding.d.ts +3 -0
- package/storage/dist/http.d.ts +38 -0
- package/storage/dist/index.d.ts +13 -2
- package/storage/dist/node-types.d.ts +6 -0
- package/storage/dist/storage-bucket-api-neo.d.ts +15 -0
- package/storage/dist/storage-file-api-classic.d.ts +80 -0
- package/storage/dist/storage-file-api-neo.d.ts +48 -0
- package/storage/dist/supabase/errors.d.ts +20 -0
- package/storage/dist/supabase/types.d.ts +63 -0
- package/storage/dist/types.d.ts +142 -0
- package/storage/dist/validation.d.ts +2 -0
- package/types/auth.d.ts +1 -1
- package/types/index.d.ts +3 -2
- package/types/package.json +1 -1
- package/utilities/dist/cjs/libs/cache.d.ts +2 -2
- package/utilities/dist/cjs/libs/events.d.ts +1 -1
- package/utilities/dist/cjs/libs/util.d.ts +1 -1
- package/utilities/dist/esm/libs/cache.d.ts +2 -2
- package/utilities/dist/esm/libs/events.d.ts +1 -1
- package/utilities/dist/esm/libs/util.d.ts +1 -1
- package/utilities/package.json +1 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import type { authModels, OAUTH_TYPE } from '@cloudbase/js-sdk/oauth';
|
|
2
|
+
import { AuthError, AuthErrorCategory, AuthErrorCode } from '@cloudbase/js-sdk/oauth';
|
|
3
|
+
export { AuthErrorCategory, AuthErrorCode };
|
|
4
|
+
export type AuthResult<D extends object> = {
|
|
5
|
+
data: D;
|
|
6
|
+
error: null;
|
|
7
|
+
} | {
|
|
8
|
+
data: {
|
|
9
|
+
[K in keyof D]: null;
|
|
10
|
+
};
|
|
11
|
+
error: AuthError;
|
|
12
|
+
};
|
|
13
|
+
export interface SignInAnonymouslyCredentials {
|
|
14
|
+
provider_token?: string;
|
|
15
|
+
}
|
|
16
|
+
export type SignInAnonymouslyReq = SignInAnonymouslyCredentials;
|
|
17
|
+
export declare type User = {
|
|
18
|
+
id: any;
|
|
19
|
+
aud: string;
|
|
20
|
+
role: string[];
|
|
21
|
+
email: any;
|
|
22
|
+
email_confirmed_at: string;
|
|
23
|
+
phone: any;
|
|
24
|
+
phone_confirmed_at: string;
|
|
25
|
+
confirmed_at: string;
|
|
26
|
+
last_sign_in_at: string;
|
|
27
|
+
app_metadata: {
|
|
28
|
+
provider: any;
|
|
29
|
+
providers: any[];
|
|
30
|
+
};
|
|
31
|
+
user_metadata: {
|
|
32
|
+
name: any;
|
|
33
|
+
picture: any;
|
|
34
|
+
username: any;
|
|
35
|
+
gender: any;
|
|
36
|
+
locale: any;
|
|
37
|
+
uid: any;
|
|
38
|
+
nickName: any;
|
|
39
|
+
avatarUrl: any;
|
|
40
|
+
location: any;
|
|
41
|
+
hasPassword: any;
|
|
42
|
+
};
|
|
43
|
+
identities: any;
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
is_anonymous: boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare type Session = {
|
|
49
|
+
access_token?: string;
|
|
50
|
+
refresh_token?: string;
|
|
51
|
+
expires_in?: number;
|
|
52
|
+
token_type?: string;
|
|
53
|
+
user: User;
|
|
54
|
+
};
|
|
55
|
+
export type SignInWithPasswordCredentials = PasswordCredentialsBase & {
|
|
56
|
+
is_encrypt?: boolean;
|
|
57
|
+
options?: {
|
|
58
|
+
is_encrypt?: boolean;
|
|
59
|
+
captchaToken?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type PasswordCredentialsBase = {
|
|
63
|
+
email: string;
|
|
64
|
+
password: string;
|
|
65
|
+
} | {
|
|
66
|
+
phone: string;
|
|
67
|
+
password: string;
|
|
68
|
+
} | {
|
|
69
|
+
username: string;
|
|
70
|
+
password: string;
|
|
71
|
+
};
|
|
72
|
+
export type SignInWithPasswordReq = SignInWithPasswordCredentials;
|
|
73
|
+
export type CommonRes = AuthResult<{}>;
|
|
74
|
+
export type SignInRes = AuthResult<{
|
|
75
|
+
user?: User | null;
|
|
76
|
+
session?: Session | null;
|
|
77
|
+
}>;
|
|
78
|
+
export type AuthResponse = SignInRes;
|
|
79
|
+
export type AuthTokenResponsePassword = SignInRes;
|
|
80
|
+
export type GetUserRes = AuthResult<{
|
|
81
|
+
user?: User | null;
|
|
82
|
+
}>;
|
|
83
|
+
export type UserResponse = GetUserRes;
|
|
84
|
+
export interface UpdateUserVerifyOtpParams {
|
|
85
|
+
email?: string;
|
|
86
|
+
phone?: string;
|
|
87
|
+
token: string | number;
|
|
88
|
+
}
|
|
89
|
+
declare type UpdateUserVerifyCallback = (params: UpdateUserVerifyOtpParams) => Promise<GetUserRes>;
|
|
90
|
+
export type UpdateUserWithVerificationRes = AuthResult<{
|
|
91
|
+
verifyOtp?: UpdateUserVerifyCallback;
|
|
92
|
+
messageId?: string;
|
|
93
|
+
}>;
|
|
94
|
+
export interface SignInWithIdTokenReq {
|
|
95
|
+
provider?: string;
|
|
96
|
+
token: string;
|
|
97
|
+
}
|
|
98
|
+
export interface SignInWithOAuthCredentials {
|
|
99
|
+
provider: string;
|
|
100
|
+
options?: {
|
|
101
|
+
redirectTo?: string;
|
|
102
|
+
skipBrowserRedirect?: boolean;
|
|
103
|
+
state?: string;
|
|
104
|
+
queryParams?: Record<string, string>;
|
|
105
|
+
type?: (typeof OAUTH_TYPE)[keyof typeof OAUTH_TYPE];
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export type SignInWithOAuthReq = SignInWithOAuthCredentials;
|
|
109
|
+
export type SignInOAuthRes = AuthResult<{
|
|
110
|
+
url?: string | null;
|
|
111
|
+
provider?: string | null;
|
|
112
|
+
scopes?: string;
|
|
113
|
+
}>;
|
|
114
|
+
export type OAuthResponse = SignInOAuthRes;
|
|
115
|
+
export type GetClaimsRes = AuthResult<{
|
|
116
|
+
claims?: {
|
|
117
|
+
iss: string;
|
|
118
|
+
sub: string;
|
|
119
|
+
aud: string;
|
|
120
|
+
exp: number;
|
|
121
|
+
iat: number;
|
|
122
|
+
at_hash: string;
|
|
123
|
+
name: string;
|
|
124
|
+
picture?: string;
|
|
125
|
+
email?: string;
|
|
126
|
+
phone_number?: string;
|
|
127
|
+
scope: string;
|
|
128
|
+
project_id: string;
|
|
129
|
+
provider?: string;
|
|
130
|
+
provider_type?: string;
|
|
131
|
+
groups?: string[];
|
|
132
|
+
meta?: {
|
|
133
|
+
wxOpenId?: string;
|
|
134
|
+
wxUnionId?: string;
|
|
135
|
+
};
|
|
136
|
+
user_id: string;
|
|
137
|
+
roles: string[];
|
|
138
|
+
user_type: string;
|
|
139
|
+
client_type: string;
|
|
140
|
+
is_system_admin: boolean;
|
|
141
|
+
};
|
|
142
|
+
header?: {
|
|
143
|
+
alg: string;
|
|
144
|
+
kid: string;
|
|
145
|
+
};
|
|
146
|
+
signature?: string | null;
|
|
147
|
+
}>;
|
|
148
|
+
export interface UserAttributes extends authModels.ModifyUserBasicInfoRequest {
|
|
149
|
+
email?: string;
|
|
150
|
+
phone?: string;
|
|
151
|
+
username?: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
avatar_url?: string;
|
|
154
|
+
nickname?: string;
|
|
155
|
+
gender?: 'MALE' | 'FEMALE';
|
|
156
|
+
password?: never;
|
|
157
|
+
new_password?: never;
|
|
158
|
+
}
|
|
159
|
+
export type UpdateUserReq = UserAttributes;
|
|
160
|
+
export type GetUserIdentitiesRes = AuthResult<{
|
|
161
|
+
identities?: Array<{
|
|
162
|
+
id: string;
|
|
163
|
+
name: string;
|
|
164
|
+
picture: string;
|
|
165
|
+
}> | null;
|
|
166
|
+
}>;
|
|
167
|
+
export interface LinkIdentityReq {
|
|
168
|
+
provider: string;
|
|
169
|
+
}
|
|
170
|
+
export interface UnlinkIdentityReq {
|
|
171
|
+
provider: string;
|
|
172
|
+
}
|
|
173
|
+
export type LinkIdentityRes = AuthResult<{
|
|
174
|
+
provider?: string | null;
|
|
175
|
+
type?: (typeof OAUTH_TYPE)[keyof typeof OAUTH_TYPE];
|
|
176
|
+
}>;
|
|
177
|
+
export declare type OnAuthStateChangeEvent = 'SIGNED_OUT' | 'SIGNED_IN' | 'INITIAL_SESSION' | 'PASSWORD_RECOVERY' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | 'BIND_IDENTITY';
|
|
178
|
+
export declare type OnAuthStateChangeCallback = (event: OnAuthStateChangeEvent, session: Session, info?: Record<string, any>) => void;
|
|
179
|
+
export type MobileOtpType = 'sms' | 'phone_change' | (string & {});
|
|
180
|
+
export type EmailOtpType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change' | 'email' | (string & {});
|
|
181
|
+
export interface VerifyMobileOtpParams {
|
|
182
|
+
phone: string;
|
|
183
|
+
token: string | number;
|
|
184
|
+
type?: MobileOtpType | EmailOtpType;
|
|
185
|
+
messageId?: string;
|
|
186
|
+
}
|
|
187
|
+
export interface VerifyEmailOtpParams {
|
|
188
|
+
email: string;
|
|
189
|
+
token: string | number;
|
|
190
|
+
type?: MobileOtpType | EmailOtpType;
|
|
191
|
+
messageId?: string;
|
|
192
|
+
}
|
|
193
|
+
export type VerifyOtpParams = VerifyMobileOtpParams | VerifyEmailOtpParams;
|
|
194
|
+
export type VerifyOtpReq = VerifyOtpParams;
|
|
195
|
+
export type SignInWithPasswordlessCredentials = {
|
|
196
|
+
email: string;
|
|
197
|
+
options?: {
|
|
198
|
+
shouldCreateUser?: boolean;
|
|
199
|
+
emailRedirectTo?: string;
|
|
200
|
+
captchaToken?: string;
|
|
201
|
+
};
|
|
202
|
+
} | {
|
|
203
|
+
phone: string;
|
|
204
|
+
options?: {
|
|
205
|
+
shouldCreateUser?: boolean;
|
|
206
|
+
captchaToken?: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
export type SignInWithOtpReq = SignInWithPasswordlessCredentials;
|
|
210
|
+
export interface VerifyOtpCallbackParams {
|
|
211
|
+
token: string | number;
|
|
212
|
+
messageId?: string;
|
|
213
|
+
}
|
|
214
|
+
declare type OtpCallback = (params: VerifyOtpCallbackParams) => Promise<SignInRes>;
|
|
215
|
+
export type SignInWithOtpRes = AuthResult<{
|
|
216
|
+
user?: User | null;
|
|
217
|
+
session?: Session | null;
|
|
218
|
+
verifyOtp?: OtpCallback;
|
|
219
|
+
}>;
|
|
220
|
+
export type AuthOtpResponse = SignInWithOtpRes;
|
|
221
|
+
export type SignUpRes = AuthResult<{
|
|
222
|
+
user?: User;
|
|
223
|
+
session?: Session;
|
|
224
|
+
verifyOtp?: OtpCallback;
|
|
225
|
+
}>;
|
|
226
|
+
export type SignUpWithPasswordCredentials = {
|
|
227
|
+
email: string;
|
|
228
|
+
password?: string;
|
|
229
|
+
options?: {
|
|
230
|
+
data?: Record<string, any>;
|
|
231
|
+
emailRedirectTo?: string;
|
|
232
|
+
captchaToken?: string;
|
|
233
|
+
};
|
|
234
|
+
} | {
|
|
235
|
+
phone: string;
|
|
236
|
+
password?: string;
|
|
237
|
+
options?: {
|
|
238
|
+
data?: Record<string, any>;
|
|
239
|
+
channel?: 'sms' | 'whatsapp';
|
|
240
|
+
captchaToken?: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
export interface ResendParamsBase {
|
|
244
|
+
type: 'signup' | 'email_change' | 'phone_change' | 'sms';
|
|
245
|
+
}
|
|
246
|
+
export type ResendParams = {
|
|
247
|
+
type?: 'signup' | 'email_change';
|
|
248
|
+
email: string;
|
|
249
|
+
phone?: never;
|
|
250
|
+
} | {
|
|
251
|
+
type?: 'sms' | 'phone_change';
|
|
252
|
+
phone: string;
|
|
253
|
+
email?: never;
|
|
254
|
+
};
|
|
255
|
+
export type ResendReq = ResendParams;
|
|
256
|
+
export type ResendRes = AuthResult<{
|
|
257
|
+
messageId?: string | null;
|
|
258
|
+
}>;
|
|
259
|
+
export interface GetAccessTokenRes {
|
|
260
|
+
accessToken: string;
|
|
261
|
+
env: string;
|
|
262
|
+
}
|
|
263
|
+
export interface VerifyOAuthReq {
|
|
264
|
+
code?: string;
|
|
265
|
+
state?: string;
|
|
266
|
+
provider?: string;
|
|
267
|
+
}
|
|
268
|
+
export interface UpdateUserAttributes {
|
|
269
|
+
nonce: string;
|
|
270
|
+
password: string;
|
|
271
|
+
}
|
|
272
|
+
export type ResetPasswordForEmailRes = AuthResult<{
|
|
273
|
+
updateUser?: ((attributes: UpdateUserAttributes) => Promise<SignInRes>) | null;
|
|
274
|
+
}>;
|
|
275
|
+
export type ReauthenticateRes = AuthResult<{
|
|
276
|
+
updateUser?: ((attributes: UpdateUserAttributes) => Promise<SignInRes>) | null;
|
|
277
|
+
}>;
|
|
278
|
+
export interface SetSessionReq {
|
|
279
|
+
access_token: string;
|
|
280
|
+
refresh_token: string;
|
|
281
|
+
}
|
|
282
|
+
export interface DeleteMeReq {
|
|
283
|
+
password: string;
|
|
284
|
+
}
|
|
285
|
+
export interface ResetPasswordForOldReq {
|
|
286
|
+
old_password: string;
|
|
287
|
+
new_password: string;
|
|
288
|
+
}
|
|
289
|
+
export type VerifyOAuthRes = AuthResult<{
|
|
290
|
+
user?: User;
|
|
291
|
+
session?: Session;
|
|
292
|
+
redirectUrl?: string;
|
|
293
|
+
provider?: string;
|
|
294
|
+
type?: (typeof OAUTH_TYPE)[keyof typeof OAUTH_TYPE];
|
|
295
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { printWarn, throwError } from '@cloudbase/js-sdk/utilities/dist/cjs/libs/util';
|
|
2
|
+
export { ERRORS, COMMUNITY_SITE_URL } from '@cloudbase/js-sdk/utilities/dist/cjs/constants/index';
|
|
3
|
+
export { catchErrorsDecorator } from '@cloudbase/js-sdk/utilities/dist/cjs/helpers/index';
|
|
4
|
+
export { CloudbaseEventEmitter } from '@cloudbase/js-sdk/utilities/dist/cjs/libs/events';
|
|
5
|
+
export { CloudbaseCache } from '@cloudbase/js-sdk/utilities/dist/cjs/libs/cache';
|
|
6
|
+
export { default as adapterForWxMp } from '@cloudbase/adapter-wx_mp';
|
|
7
|
+
export { useDefaultAdapter } from '@cloudbase/js-sdk/utilities/dist/cjs/adapters/index';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function saveToBrowserSession(key: string, value: Record<string, any>): void;
|
|
2
|
+
export declare function getBrowserSession(key: string): any;
|
|
3
|
+
export declare function removeBrowserSession(key: string): boolean;
|
|
4
|
+
export declare function addUrlSearch(search: Location['search'], hash?: Location['hash']): string;
|
|
5
|
+
export declare function removeUrlParams(params: string[]): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { authModels } from '@cloudbase/js-sdk/oauth';
|
|
2
|
+
import type { SignUpRes } from './type';
|
|
3
|
+
export declare class WeixinAuthProvider {
|
|
4
|
+
constructor(_options: {
|
|
5
|
+
authInstance: any;
|
|
6
|
+
appid: string;
|
|
7
|
+
scope: string;
|
|
8
|
+
});
|
|
9
|
+
signInWithRedirect(): void;
|
|
10
|
+
getRedirectResult(_options?: {
|
|
11
|
+
createUser?: boolean;
|
|
12
|
+
syncUserInfo?: boolean;
|
|
13
|
+
}): Promise<any>;
|
|
14
|
+
getLinkRedirectResult(_options?: {
|
|
15
|
+
withUnionId?: boolean;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare class CustomAuthProvider {
|
|
19
|
+
private authInstance;
|
|
20
|
+
constructor(options: {
|
|
21
|
+
authInstance: any;
|
|
22
|
+
});
|
|
23
|
+
signIn(ticket: string): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare class AnonymousAuthProvider {
|
|
26
|
+
private authInstance;
|
|
27
|
+
constructor(options: {
|
|
28
|
+
authInstance: any;
|
|
29
|
+
});
|
|
30
|
+
signIn(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare abstract class AuthV1Compat {
|
|
33
|
+
abstract readonly config: any;
|
|
34
|
+
weixinAuthProvider(options: {
|
|
35
|
+
appid: string;
|
|
36
|
+
scope: string;
|
|
37
|
+
}): WeixinAuthProvider;
|
|
38
|
+
customAuthProvider(): CustomAuthProvider;
|
|
39
|
+
anonymousAuthProvider(): AnonymousAuthProvider;
|
|
40
|
+
signUpWithEmailAndPassword(email: string, password: string): Promise<SignUpRes>;
|
|
41
|
+
signInWithEmailAndPassword(email: string, password: string): Promise<any>;
|
|
42
|
+
sendPasswordResetEmail(email: string): Promise<void>;
|
|
43
|
+
signInWithUsernameAndPassword(username: string, password: string): Promise<any>;
|
|
44
|
+
sendPhoneCode(phoneNumber: string): Promise<boolean>;
|
|
45
|
+
signUpWithPhoneCode(phoneNumber: string, phoneCode: string, password?: string): Promise<any>;
|
|
46
|
+
signInWithPhoneCodeOrPassword(params: {
|
|
47
|
+
phoneNumber: string;
|
|
48
|
+
phoneCode?: string;
|
|
49
|
+
password?: string;
|
|
50
|
+
}): Promise<any>;
|
|
51
|
+
forceResetPwdByPhoneCode(params: {
|
|
52
|
+
phoneNumber: string;
|
|
53
|
+
phoneCode: string;
|
|
54
|
+
password: string;
|
|
55
|
+
}): Promise<any>;
|
|
56
|
+
shouldRefreshAccessToken(_callback: () => boolean): void;
|
|
57
|
+
onLoginStateExpired(callback: Function): void;
|
|
58
|
+
onAccessTokenRefreshed(callback: Function): void;
|
|
59
|
+
onAnonymousConverted(callback: Function): void;
|
|
60
|
+
onLoginTypeChanged(callback: Function): void;
|
|
61
|
+
abstract signIn(params: authModels.SignInRequest): Promise<any>;
|
|
62
|
+
abstract signUp(params: authModels.SignUpRequest & {
|
|
63
|
+
phone?: string;
|
|
64
|
+
}): Promise<SignUpRes>;
|
|
65
|
+
abstract signInWithCustomTicket(getTickFn?: authModels.GetCustomSignTicketFn): Promise<any>;
|
|
66
|
+
abstract signInAnonymously(params: any): Promise<any>;
|
|
67
|
+
abstract getVerification(params: any, options?: any): Promise<authModels.GetVerificationResponse>;
|
|
68
|
+
abstract resetPassword(params: authModels.ResetPasswordRequest): Promise<void>;
|
|
69
|
+
abstract onLoginStateChanged(callback: Function): Promise<void>;
|
|
70
|
+
abstract onAuthStateChange(callback: any): any;
|
|
71
|
+
abstract createLoginState(params?: any, options?: any): Promise<any>;
|
|
72
|
+
abstract signInWithOAuth(params: any): Promise<any>;
|
|
73
|
+
abstract grantProviderToken(params: authModels.GrantProviderTokenRequest): Promise<authModels.GrantProviderTokenResponse>;
|
|
74
|
+
abstract bindWithProvider(params: authModels.BindWithProviderRequest): Promise<void>;
|
|
75
|
+
protected abstract formatPhone(phone: string): string;
|
|
76
|
+
}
|
|
77
|
+
export declare function applyUserV1Compat(UserClass: any): void;
|
package/cloudrun/dist/index.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { ICloudbase } from '@cloudbase/js-sdk/types';
|
|
2
|
+
import { ICallFunctionOptions, ICustomReqOpts } from '@cloudbase/js-sdk/types/functions';
|
|
3
|
+
export declare function requestContainer(this: any, options: ICallFunctionOptions, customReqOpts?: ICustomReqOpts): Promise<any>;
|
|
4
|
+
export declare function registerCloudrun(app: Pick<ICloudbase, 'registerComponent'>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COMPONENT_NAME = "container";
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import { ICloudbase } from '@cloudbase/types';
|
|
2
|
-
|
|
1
|
+
import { ICloudbase } from '@cloudbase/js-sdk/types';
|
|
2
|
+
import { ICallContainerOptions, IContianerConfig } from '@cloudbase/js-sdk/types/container';
|
|
3
|
+
export declare let t: (str: any) => any;
|
|
4
|
+
export declare class CloudbaseContainers {
|
|
5
|
+
private readonly config;
|
|
6
|
+
private wasm;
|
|
7
|
+
private containerInitPromise;
|
|
8
|
+
private defaultHeaders;
|
|
9
|
+
constructor(config: IContianerConfig);
|
|
10
|
+
callContainer(options: ICallContainerOptions, callback?: Function): Promise<any>;
|
|
11
|
+
initContainer(config: Omit<IContianerConfig, 'wasmUrl' | 'jsUrl'>): Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
export declare function registerContainers(app: Pick<ICloudbase, 'registerComponent'>): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function getExportFunction(url: any, module: any, mode?: string): Promise<WebAssembly.Exports | {
|
|
2
|
+
callContainer: any;
|
|
3
|
+
initContainer: any;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function loadJSExportFunction(config?: {
|
|
6
|
+
vm: string;
|
|
7
|
+
vender?: string;
|
|
8
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface IRequestPorps {
|
|
2
|
+
url: string;
|
|
3
|
+
data?: string | object | ArrayBuffer;
|
|
4
|
+
header?: Record<string, string>;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
method?: string;
|
|
7
|
+
dataType?: 'json' | string;
|
|
8
|
+
responseType?: 'text' | 'arrayBuffer';
|
|
9
|
+
mode?: 'cors' | 'no-cors' | 'same-origin';
|
|
10
|
+
}
|
|
11
|
+
export declare function request({ url, method, header, data, timeout, dataType, responseType, mode, }: IRequestPorps): Promise<any>;
|
|
12
|
+
export {};
|
package/core.d.ts
CHANGED
|
@@ -35,92 +35,93 @@ declare namespace cloudbase {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// ===== 外部依赖类型别名(内联 import 类型,避免顶层 import 使本文件成为模块)=====
|
|
38
|
-
type OrmClient = import('@cloudbase/model').OrmClient
|
|
39
|
-
type OrmRawQueryClient = import('@cloudbase/model').OrmRawQueryClient
|
|
40
|
-
type IMySqlClient = import('@cloudbase/mysql').IMySqlClient
|
|
41
|
-
type AI = import('@cloudbase/ai').AI
|
|
38
|
+
type OrmClient = import('@cloudbase/js-sdk/model').OrmClient
|
|
39
|
+
type OrmRawQueryClient = import('@cloudbase/js-sdk/model').OrmRawQueryClient
|
|
40
|
+
type IMySqlClient = import('@cloudbase/js-sdk/mysql').IMySqlClient
|
|
41
|
+
type AI = import('@cloudbase/js-sdk/ai').AI
|
|
42
42
|
type CloudbaseAdapter = import('@cloudbase/adapter-interface').CloudbaseAdapter
|
|
43
43
|
type ResponseObject = import('@cloudbase/adapter-interface').ResponseObject
|
|
44
|
-
type ICloudbaseUpgradedConfig = import('@cloudbase/types').ICloudbaseUpgradedConfig
|
|
45
|
-
type ICloudbase = import('@cloudbase/types').ICloudbase
|
|
46
|
-
type Persistence = import('@cloudbase/types').Persistence
|
|
47
|
-
type LANGS = import('@cloudbase/types').LANGS
|
|
48
|
-
type ICustomReqOpts = import('@cloudbase/types/functions').ICustomReqOpts
|
|
44
|
+
type ICloudbaseUpgradedConfig = import('@cloudbase/js-sdk/types').ICloudbaseUpgradedConfig
|
|
45
|
+
type ICloudbase = import('@cloudbase/js-sdk/types').ICloudbase
|
|
46
|
+
type Persistence = import('@cloudbase/js-sdk/types').Persistence
|
|
47
|
+
type LANGS = import('@cloudbase/js-sdk/types').LANGS
|
|
48
|
+
type ICustomReqOpts = import('@cloudbase/js-sdk/types/functions').ICustomReqOpts
|
|
49
49
|
|
|
50
50
|
// ===== @cloudbase/auth 相关类型别名 =====
|
|
51
|
-
type SignInRes = import('@cloudbase/auth').SignInRes
|
|
52
|
-
type GetUserRes = import('@cloudbase/auth').GetUserRes
|
|
53
|
-
type CommonRes = import('@cloudbase/auth').CommonRes
|
|
54
|
-
type SignInWithOtpRes = import('@cloudbase/auth').SignInWithOtpRes
|
|
55
|
-
type SignInOAuthRes = import('@cloudbase/auth').SignInOAuthRes
|
|
56
|
-
type GetClaimsRes = import('@cloudbase/auth').GetClaimsRes
|
|
57
|
-
type ResetPasswordForEmailRes = import('@cloudbase/auth').ResetPasswordForEmailRes
|
|
58
|
-
type GetUserIdentitiesRes = import('@cloudbase/auth').GetUserIdentitiesRes
|
|
59
|
-
type LinkIdentityRes = import('@cloudbase/auth').LinkIdentityRes
|
|
60
|
-
type ReauthenticateRes = import('@cloudbase/auth').ReauthenticateRes
|
|
61
|
-
type ResendRes = import('@cloudbase/auth').ResendRes
|
|
62
|
-
type UpdateUserWithVerificationRes = import('@cloudbase/auth').UpdateUserWithVerificationRes
|
|
63
|
-
type OnAuthStateChangeCallback = import('@cloudbase/auth').OnAuthStateChangeCallback
|
|
64
|
-
type SignInWithPasswordReq = import('@cloudbase/auth').SignInWithPasswordReq
|
|
65
|
-
type SignInWithIdTokenReq = import('@cloudbase/auth').SignInWithIdTokenReq
|
|
66
|
-
type SignInWithOAuthReq = import('@cloudbase/auth').SignInWithOAuthReq
|
|
67
|
-
type VerifyOAuthReq = import('@cloudbase/auth').VerifyOAuthReq
|
|
68
|
-
type VerifyOtpReq = import('@cloudbase/auth').VerifyOtpReq
|
|
69
|
-
type LinkIdentityReq = import('@cloudbase/auth').LinkIdentityReq
|
|
70
|
-
type UnlinkIdentityReq = import('@cloudbase/auth').UnlinkIdentityReq
|
|
71
|
-
type UpdateUserReq = import('@cloudbase/auth').UpdateUserReq
|
|
72
|
-
type SignInWithOtpReq = import('@cloudbase/auth').SignInWithOtpReq
|
|
73
|
-
type ResetPasswordForOldReq = import('@cloudbase/auth').ResetPasswordForOldReq
|
|
74
|
-
type ResendReq = import('@cloudbase/auth').ResendReq
|
|
75
|
-
type SetSessionReq = import('@cloudbase/auth').SetSessionReq
|
|
76
|
-
type DeleteMeReq = import('@cloudbase/auth').DeleteMeReq
|
|
77
|
-
type SignUpRes = import('@cloudbase/auth').SignUpRes
|
|
51
|
+
type SignInRes = import('@cloudbase/js-sdk/auth').SignInRes
|
|
52
|
+
type GetUserRes = import('@cloudbase/js-sdk/auth').GetUserRes
|
|
53
|
+
type CommonRes = import('@cloudbase/js-sdk/auth').CommonRes
|
|
54
|
+
type SignInWithOtpRes = import('@cloudbase/js-sdk/auth').SignInWithOtpRes
|
|
55
|
+
type SignInOAuthRes = import('@cloudbase/js-sdk/auth').SignInOAuthRes
|
|
56
|
+
type GetClaimsRes = import('@cloudbase/js-sdk/auth').GetClaimsRes
|
|
57
|
+
type ResetPasswordForEmailRes = import('@cloudbase/js-sdk/auth').ResetPasswordForEmailRes
|
|
58
|
+
type GetUserIdentitiesRes = import('@cloudbase/js-sdk/auth').GetUserIdentitiesRes
|
|
59
|
+
type LinkIdentityRes = import('@cloudbase/js-sdk/auth').LinkIdentityRes
|
|
60
|
+
type ReauthenticateRes = import('@cloudbase/js-sdk/auth').ReauthenticateRes
|
|
61
|
+
type ResendRes = import('@cloudbase/js-sdk/auth').ResendRes
|
|
62
|
+
type UpdateUserWithVerificationRes = import('@cloudbase/js-sdk/auth').UpdateUserWithVerificationRes
|
|
63
|
+
type OnAuthStateChangeCallback = import('@cloudbase/js-sdk/auth').OnAuthStateChangeCallback
|
|
64
|
+
type SignInWithPasswordReq = import('@cloudbase/js-sdk/auth').SignInWithPasswordReq
|
|
65
|
+
type SignInWithIdTokenReq = import('@cloudbase/js-sdk/auth').SignInWithIdTokenReq
|
|
66
|
+
type SignInWithOAuthReq = import('@cloudbase/js-sdk/auth').SignInWithOAuthReq
|
|
67
|
+
type VerifyOAuthReq = import('@cloudbase/js-sdk/auth').VerifyOAuthReq
|
|
68
|
+
type VerifyOtpReq = import('@cloudbase/js-sdk/auth').VerifyOtpReq
|
|
69
|
+
type LinkIdentityReq = import('@cloudbase/js-sdk/auth').LinkIdentityReq
|
|
70
|
+
type UnlinkIdentityReq = import('@cloudbase/js-sdk/auth').UnlinkIdentityReq
|
|
71
|
+
type UpdateUserReq = import('@cloudbase/js-sdk/auth').UpdateUserReq
|
|
72
|
+
type SignInWithOtpReq = import('@cloudbase/js-sdk/auth').SignInWithOtpReq
|
|
73
|
+
type ResetPasswordForOldReq = import('@cloudbase/js-sdk/auth').ResetPasswordForOldReq
|
|
74
|
+
type ResendReq = import('@cloudbase/js-sdk/auth').ResendReq
|
|
75
|
+
type SetSessionReq = import('@cloudbase/js-sdk/auth').SetSessionReq
|
|
76
|
+
type DeleteMeReq = import('@cloudbase/js-sdk/auth').DeleteMeReq
|
|
77
|
+
type SignUpRes = import('@cloudbase/js-sdk/auth').SignUpRes
|
|
78
78
|
|
|
79
79
|
// ===== @cloudbase/oauth authModels 命名空间别名 =====
|
|
80
80
|
namespace authModels {
|
|
81
|
-
type BindPhoneRequest = import('@cloudbase/oauth').authModels.BindPhoneRequest
|
|
82
|
-
type BindEmailRequest = import('@cloudbase/oauth').authModels.BindEmailRequest
|
|
83
|
-
type UnbindProviderRequest = import('@cloudbase/oauth').authModels.UnbindProviderRequest
|
|
84
|
-
type VerifyRequest = import('@cloudbase/oauth').authModels.VerifyRequest
|
|
85
|
-
type VerifyResponse = import('@cloudbase/oauth').authModels.VerifyResponse
|
|
86
|
-
type GetVerificationRequest = import('@cloudbase/oauth').authModels.GetVerificationRequest
|
|
87
|
-
type GetVerificationResponse = import('@cloudbase/oauth').authModels.GetVerificationResponse
|
|
88
|
-
type GetCustomSignTicketFn = import('@cloudbase/oauth').authModels.GetCustomSignTicketFn
|
|
89
|
-
type SetPasswordRequest = import('@cloudbase/oauth').authModels.SetPasswordRequest
|
|
90
|
-
type ModifyUserBasicInfoRequest = import('@cloudbase/oauth').authModels.ModifyUserBasicInfoRequest
|
|
91
|
-
type BindWithProviderRequest = import('@cloudbase/oauth').authModels.BindWithProviderRequest
|
|
92
|
-
type QueryUserProfileRequest = import('@cloudbase/oauth').authModels.QueryUserProfileRequest
|
|
93
|
-
type QueryUserProfileResponse = import('@cloudbase/oauth').authModels.QueryUserProfileResponse
|
|
94
|
-
type GrantProviderTokenRequest = import('@cloudbase/oauth').authModels.GrantProviderTokenRequest
|
|
95
|
-
type GrantProviderTokenResponse = import('@cloudbase/oauth').authModels.GrantProviderTokenResponse
|
|
96
|
-
type PatchProviderTokenRequest = import('@cloudbase/oauth').authModels.PatchProviderTokenRequest
|
|
97
|
-
type PatchProviderTokenResponse = import('@cloudbase/oauth').authModels.PatchProviderTokenResponse
|
|
98
|
-
type SignInWithProviderRequest = import('@cloudbase/oauth').authModels.SignInWithProviderRequest
|
|
99
|
-
type GrantTokenRequest = import('@cloudbase/oauth').authModels.GrantTokenRequest
|
|
100
|
-
type GenProviderRedirectUriRequest = import('@cloudbase/oauth').authModels.GenProviderRedirectUriRequest
|
|
101
|
-
type GenProviderRedirectUriResponse = import('@cloudbase/oauth').authModels.GenProviderRedirectUriResponse
|
|
102
|
-
type ResetPasswordRequest = import('@cloudbase/oauth').authModels.ResetPasswordRequest
|
|
103
|
-
type DeviceAuthorizeRequest = import('@cloudbase/oauth').authModels.DeviceAuthorizeRequest
|
|
104
|
-
type DeviceAuthorizeResponse = import('@cloudbase/oauth').authModels.DeviceAuthorizeResponse
|
|
105
|
-
type SudoRequest = import('@cloudbase/oauth').authModels.SudoRequest
|
|
106
|
-
type SudoResponse = import('@cloudbase/oauth').authModels.SudoResponse
|
|
107
|
-
type WithSudoRequest = import('@cloudbase/oauth').authModels.WithSudoRequest
|
|
108
|
-
type UserProfile = import('@cloudbase/oauth').authModels.UserProfile
|
|
109
|
-
type UserProfileProvider = import('@cloudbase/oauth').authModels.UserProfileProvider
|
|
110
|
-
|
|
111
|
-
type
|
|
112
|
-
type
|
|
113
|
-
type
|
|
114
|
-
type
|
|
115
|
-
type
|
|
116
|
-
type
|
|
117
|
-
type
|
|
118
|
-
type
|
|
119
|
-
type
|
|
120
|
-
type
|
|
121
|
-
type
|
|
122
|
-
type
|
|
123
|
-
type
|
|
81
|
+
type BindPhoneRequest = import('@cloudbase/js-sdk/oauth').authModels.BindPhoneRequest
|
|
82
|
+
type BindEmailRequest = import('@cloudbase/js-sdk/oauth').authModels.BindEmailRequest
|
|
83
|
+
type UnbindProviderRequest = import('@cloudbase/js-sdk/oauth').authModels.UnbindProviderRequest
|
|
84
|
+
type VerifyRequest = import('@cloudbase/js-sdk/oauth').authModels.VerifyRequest
|
|
85
|
+
type VerifyResponse = import('@cloudbase/js-sdk/oauth').authModels.VerifyResponse
|
|
86
|
+
type GetVerificationRequest = import('@cloudbase/js-sdk/oauth').authModels.GetVerificationRequest
|
|
87
|
+
type GetVerificationResponse = import('@cloudbase/js-sdk/oauth').authModels.GetVerificationResponse
|
|
88
|
+
type GetCustomSignTicketFn = import('@cloudbase/js-sdk/oauth').authModels.GetCustomSignTicketFn
|
|
89
|
+
type SetPasswordRequest = import('@cloudbase/js-sdk/oauth').authModels.SetPasswordRequest
|
|
90
|
+
type ModifyUserBasicInfoRequest = import('@cloudbase/js-sdk/oauth').authModels.ModifyUserBasicInfoRequest
|
|
91
|
+
type BindWithProviderRequest = import('@cloudbase/js-sdk/oauth').authModels.BindWithProviderRequest
|
|
92
|
+
type QueryUserProfileRequest = import('@cloudbase/js-sdk/oauth').authModels.QueryUserProfileRequest
|
|
93
|
+
type QueryUserProfileResponse = import('@cloudbase/js-sdk/oauth').authModels.QueryUserProfileResponse
|
|
94
|
+
type GrantProviderTokenRequest = import('@cloudbase/js-sdk/oauth').authModels.GrantProviderTokenRequest
|
|
95
|
+
type GrantProviderTokenResponse = import('@cloudbase/js-sdk/oauth').authModels.GrantProviderTokenResponse
|
|
96
|
+
type PatchProviderTokenRequest = import('@cloudbase/js-sdk/oauth').authModels.PatchProviderTokenRequest
|
|
97
|
+
type PatchProviderTokenResponse = import('@cloudbase/js-sdk/oauth').authModels.PatchProviderTokenResponse
|
|
98
|
+
type SignInWithProviderRequest = import('@cloudbase/js-sdk/oauth').authModels.SignInWithProviderRequest
|
|
99
|
+
type GrantTokenRequest = import('@cloudbase/js-sdk/oauth').authModels.GrantTokenRequest
|
|
100
|
+
type GenProviderRedirectUriRequest = import('@cloudbase/js-sdk/oauth').authModels.GenProviderRedirectUriRequest
|
|
101
|
+
type GenProviderRedirectUriResponse = import('@cloudbase/js-sdk/oauth').authModels.GenProviderRedirectUriResponse
|
|
102
|
+
type ResetPasswordRequest = import('@cloudbase/js-sdk/oauth').authModels.ResetPasswordRequest
|
|
103
|
+
type DeviceAuthorizeRequest = import('@cloudbase/js-sdk/oauth').authModels.DeviceAuthorizeRequest
|
|
104
|
+
type DeviceAuthorizeResponse = import('@cloudbase/js-sdk/oauth').authModels.DeviceAuthorizeResponse
|
|
105
|
+
type SudoRequest = import('@cloudbase/js-sdk/oauth').authModels.SudoRequest
|
|
106
|
+
type SudoResponse = import('@cloudbase/js-sdk/oauth').authModels.SudoResponse
|
|
107
|
+
type WithSudoRequest = import('@cloudbase/js-sdk/oauth').authModels.WithSudoRequest
|
|
108
|
+
type UserProfile = import('@cloudbase/js-sdk/oauth').authModels.UserProfile
|
|
109
|
+
type UserProfileProvider = import('@cloudbase/js-sdk/oauth').authModels.UserProfileProvider
|
|
110
|
+
// Credentials 定义在 oauth2client/models 并从 @cloudbase/oauth 顶层导出(authModels 命名空间中不存在)
|
|
111
|
+
type Credentials = import('@cloudbase/js-sdk/oauth').Credentials
|
|
112
|
+
type ProviderSubType = import('@cloudbase/js-sdk/oauth').authModels.ProviderSubType
|
|
113
|
+
type ModifyPasswordWithoutLoginRequest = import('@cloudbase/js-sdk/oauth').authModels.ModifyPasswordWithoutLoginRequest
|
|
114
|
+
type GetUserBehaviorLog = import('@cloudbase/js-sdk/oauth').authModels.GetUserBehaviorLog
|
|
115
|
+
type GetUserBehaviorLogRes = import('@cloudbase/js-sdk/oauth').authModels.GetUserBehaviorLogRes
|
|
116
|
+
type GetMiniProgramQrCodeRequest = import('@cloudbase/js-sdk/oauth').authModels.GetMiniProgramQrCodeRequest
|
|
117
|
+
type GetMiniProgramQrCodeResponse = import('@cloudbase/js-sdk/oauth').authModels.GetMiniProgramQrCodeResponse
|
|
118
|
+
type GetMiniProgramQrCodeStatusRequest = import('@cloudbase/js-sdk/oauth').authModels.GetMiniProgramQrCodeStatusRequest
|
|
119
|
+
type GetMiniProgramQrCodeStatusResponse = import('@cloudbase/js-sdk/oauth').authModels.GetMiniProgramQrCodeStatusResponse
|
|
120
|
+
type ToDefaultLoginPage = import('@cloudbase/js-sdk/oauth').authModels.ToDefaultLoginPage
|
|
121
|
+
type SignoutRequest = import('@cloudbase/js-sdk/oauth').authModels.SignoutRequest
|
|
122
|
+
type SignoutResponse = import('@cloudbase/js-sdk/oauth').authModels.SignoutResponse
|
|
123
|
+
type SignInRequest = import('@cloudbase/js-sdk/oauth').authModels.SignInRequest
|
|
124
|
+
type SignUpRequest = import('@cloudbase/js-sdk/oauth').authModels.SignUpRequest
|
|
124
125
|
}
|
|
125
126
|
interface SimpleStorage {
|
|
126
127
|
getItem: (key: string) => Promise<string | null>
|
|
@@ -385,7 +386,9 @@ declare namespace cloudbase {
|
|
|
385
386
|
*/
|
|
386
387
|
function registerHook(hook: ICloudbaseHook): void
|
|
387
388
|
|
|
388
|
-
|
|
389
|
+
// 交叉类型而非 interface extends:OrmClient 带 [modelName: string] 索引签名,
|
|
390
|
+
// 与 OrmRawQueryClient 的 $runSQL/$runSQLRaw 方法在 interface 继承下触发 TS2411
|
|
391
|
+
export type models = OrmClient & OrmRawQueryClient
|
|
389
392
|
}
|
|
390
393
|
/**
|
|
391
394
|
* instance
|
|
@@ -1221,7 +1224,7 @@ declare namespace cloudbase.auth {
|
|
|
1221
1224
|
*/
|
|
1222
1225
|
loginScope(): Promise<string>
|
|
1223
1226
|
loginGroups(): Promise<string[]>
|
|
1224
|
-
onLoginStateChanged(callback: Function)
|
|
1227
|
+
onLoginStateChanged(callback: Function): void
|
|
1225
1228
|
createLoginState(
|
|
1226
1229
|
params?: { version?: string; query?: any },
|
|
1227
1230
|
options?: { asyncRefreshUser?: boolean; userInfo?: any },
|
package/database/dist/index.d.ts
CHANGED