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