@cloudbase/js-sdk 2.25.5-alpha.1 → 2.25.5
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/database/dist/index.esm.js +3 -421
- package/database/dist/index.js +4 -422
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/index.d.ts +21 -37
- package/miniprogram_dist/app.js +1 -1
- package/miniprogram_dist/auth.js +1 -1
- package/miniprogram_dist/database.js +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/package.json +15 -15
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OrmClient, OrmRawQueryClient } from '@cloudbase/model'
|
|
2
|
-
import { IMySqlClient } from '@cloudbase/mysql'
|
|
3
|
-
import { authModels } from '@cloudbase/oauth'
|
|
1
|
+
import { OrmClient, OrmRawQueryClient } from '@cloudbase/model';
|
|
2
|
+
import { IMySqlClient } from '@cloudbase/mysql';
|
|
3
|
+
import { authModels } from '@cloudbase/oauth';
|
|
4
4
|
import type {
|
|
5
5
|
SignInRes,
|
|
6
6
|
GetUserRes,
|
|
@@ -28,9 +28,9 @@ import type {
|
|
|
28
28
|
ResendReq,
|
|
29
29
|
SetSessionReq,
|
|
30
30
|
DeleteMeReq,
|
|
31
|
-
SignUpRes
|
|
32
|
-
} from '@cloudbase/auth'
|
|
33
|
-
import { AI } from '@cloudbase/ai'
|
|
31
|
+
SignUpRes
|
|
32
|
+
} from '@cloudbase/auth';
|
|
33
|
+
import { AI } from '@cloudbase/ai';
|
|
34
34
|
import { CloudbaseAdapter, ResponseObject } from '@cloudbase/adapter-interface'
|
|
35
35
|
import { ICloudbaseUpgradedConfig, ICloudbase, Persistence } from '@cloudbase/types'
|
|
36
36
|
import { LANGS } from '@cloudbase/types'
|
|
@@ -42,6 +42,7 @@ type KV<T> = {
|
|
|
42
42
|
|
|
43
43
|
type ExcludeOf<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
|
|
44
44
|
|
|
45
|
+
|
|
45
46
|
declare type MethodType = 'request' | 'post' | 'get' | 'head' | 'patch' | 'delete' | 'put'
|
|
46
47
|
|
|
47
48
|
interface ICallApiOptions {
|
|
@@ -94,7 +95,7 @@ declare namespace cloudbase {
|
|
|
94
95
|
}
|
|
95
96
|
accessKey?: string
|
|
96
97
|
endPointMode?: EndPointKey
|
|
97
|
-
lang?: LANGS
|
|
98
|
+
lang?: LANGS
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
interface ICloudbaseExtension {
|
|
@@ -536,7 +537,7 @@ declare namespace cloudbase.app {
|
|
|
536
537
|
*
|
|
537
538
|
* @return 数据库实例
|
|
538
539
|
*/
|
|
539
|
-
database(dbConfig?:
|
|
540
|
+
database(dbConfig?: object): cloudbase.database.App
|
|
540
541
|
/**
|
|
541
542
|
* 调用扩展能力插件功能
|
|
542
543
|
*
|
|
@@ -583,24 +584,24 @@ declare namespace cloudbase.app {
|
|
|
583
584
|
|
|
584
585
|
/**
|
|
585
586
|
* MySQL 数据库
|
|
586
|
-
*
|
|
587
|
+
*
|
|
587
588
|
* @example
|
|
588
589
|
* ```javascript
|
|
589
590
|
* const app = cloudbase.init({
|
|
590
591
|
* env: "xxxx-yyy"
|
|
591
592
|
* });
|
|
592
|
-
*
|
|
593
|
+
*
|
|
593
594
|
* app.mysql().from('todos').select().then((res) => {
|
|
594
595
|
* console.log(res.data);
|
|
595
596
|
* });
|
|
596
597
|
* ```
|
|
597
598
|
*/
|
|
598
|
-
mysql: IMySqlClient
|
|
599
|
-
rdb: IMySqlClient
|
|
599
|
+
mysql: IMySqlClient;
|
|
600
|
+
rdb: IMySqlClient;
|
|
600
601
|
|
|
601
|
-
ai(): AI
|
|
602
|
+
ai(): AI;
|
|
602
603
|
|
|
603
|
-
apis: ICloudbaseApis
|
|
604
|
+
apis: ICloudbaseApis;
|
|
604
605
|
}
|
|
605
606
|
}
|
|
606
607
|
/**
|
|
@@ -789,10 +790,7 @@ declare namespace cloudbase.auth {
|
|
|
789
790
|
* @param params
|
|
790
791
|
* @param options
|
|
791
792
|
*/
|
|
792
|
-
getVerification(
|
|
793
|
-
params: authModels.GetVerificationRequest,
|
|
794
|
-
options?: { withCaptcha: boolean },
|
|
795
|
-
): Promise<authModels.GetVerificationResponse>
|
|
793
|
+
getVerification(params: authModels.GetVerificationRequest, options?: { withCaptcha: boolean }): Promise<authModels.GetVerificationResponse>
|
|
796
794
|
/**
|
|
797
795
|
* 匿名登录
|
|
798
796
|
*
|
|
@@ -998,10 +996,7 @@ declare namespace cloudbase.auth {
|
|
|
998
996
|
loginScope(): Promise<string>
|
|
999
997
|
loginGroups(): Promise<string[]>
|
|
1000
998
|
onLoginStateChanged(callback: Function)
|
|
1001
|
-
createLoginState(
|
|
1002
|
-
params?: { version?: string; query?: any },
|
|
1003
|
-
options?: { asyncRefreshUser?: boolean; userInfo?: any },
|
|
1004
|
-
): Promise<ILoginState>
|
|
999
|
+
createLoginState(params?: { version?: string; query?: any }, options?: { asyncRefreshUser?: boolean; userInfo?: any }): Promise<ILoginState>
|
|
1005
1000
|
/**
|
|
1006
1001
|
* 强制刷新token
|
|
1007
1002
|
*
|
|
@@ -1083,19 +1078,18 @@ declare namespace cloudbase.auth {
|
|
|
1083
1078
|
* @return Promise-用户是否被绑定
|
|
1084
1079
|
*/
|
|
1085
1080
|
isUsernameRegistered(username: string): Promise<boolean>
|
|
1086
|
-
getMiniProgramQrCode(
|
|
1087
|
-
params: authModels.GetMiniProgramQrCodeRequest,
|
|
1088
|
-
): Promise<authModels.GetMiniProgramQrCodeResponse>
|
|
1081
|
+
getMiniProgramQrCode(params: authModels.GetMiniProgramQrCodeRequest): Promise<authModels.GetMiniProgramQrCodeResponse>
|
|
1089
1082
|
getMiniProgramQrCodeStatus(
|
|
1090
1083
|
params: authModels.GetMiniProgramQrCodeStatusRequest,
|
|
1091
1084
|
): Promise<authModels.GetMiniProgramQrCodeStatusResponse>
|
|
1092
1085
|
/**
|
|
1093
1086
|
* 跳转到默认登录页
|
|
1094
1087
|
* 文档 {@link https://docs.cloudbase.net/api-reference/webv2/authentication#authtodefaultloginpage}
|
|
1095
|
-
* @param params
|
|
1088
|
+
* @param params
|
|
1096
1089
|
*/
|
|
1097
1090
|
toDefaultLoginPage(params?: authModels.ToDefaultLoginPage): Promise<CommonRes>
|
|
1098
1091
|
|
|
1092
|
+
|
|
1099
1093
|
/**
|
|
1100
1094
|
* 退出登录
|
|
1101
1095
|
*
|
|
@@ -1139,9 +1133,7 @@ declare namespace cloudbase.auth {
|
|
|
1139
1133
|
*
|
|
1140
1134
|
* @param callback
|
|
1141
1135
|
*/
|
|
1142
|
-
onAuthStateChange(callback: OnAuthStateChangeCallback): {
|
|
1143
|
-
data: { subscription: { id: string; callback: Function; unsubscribe: () => void } }
|
|
1144
|
-
}
|
|
1136
|
+
onAuthStateChange(callback: OnAuthStateChangeCallback): { data: { subscription: { id: string; callback: Function; unsubscribe: () => void } } }
|
|
1145
1137
|
/**
|
|
1146
1138
|
* 使用用户名和密码登录
|
|
1147
1139
|
*
|
|
@@ -2303,14 +2295,6 @@ declare namespace cloudbase.database {
|
|
|
2303
2295
|
* @return 集合的引用
|
|
2304
2296
|
*/
|
|
2305
2297
|
collection(name: string): ICollection
|
|
2306
|
-
|
|
2307
|
-
runCommands(params: IRunCommandsReq): Promise<{
|
|
2308
|
-
statusCode: number
|
|
2309
|
-
requestId: string
|
|
2310
|
-
list?: Object[][]
|
|
2311
|
-
code?: string
|
|
2312
|
-
message?: string
|
|
2313
|
-
}>
|
|
2314
2298
|
}
|
|
2315
2299
|
}
|
|
2316
2300
|
|