@cloudbase/js-sdk 3.8.2-beta.1 → 3.8.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 (153) hide show
  1. package/ai/dist/AI.d.ts +29 -0
  2. package/ai/dist/bot/index.d.ts +41 -0
  3. package/ai/dist/bot/types.d.ts +144 -0
  4. package/ai/dist/errors.d.ts +10 -0
  5. package/ai/dist/eventsource_parser/index.d.ts +2 -0
  6. package/ai/dist/eventsource_parser/parse.d.ts +2 -0
  7. package/ai/dist/eventsource_parser/stream.d.ts +5 -0
  8. package/ai/dist/eventsource_parser/types.d.ts +16 -0
  9. package/ai/dist/index.d.ts +42 -1
  10. package/ai/dist/models/Ark/index.d.ts +10 -0
  11. package/ai/dist/models/Ark/type.d.ts +71 -0
  12. package/ai/dist/models/DashScope/index.d.ts +10 -0
  13. package/ai/dist/models/DashScope/type.d.ts +74 -0
  14. package/ai/dist/models/DeepSeek/index.d.ts +10 -0
  15. package/ai/dist/models/Default/index.d.ts +10 -0
  16. package/ai/dist/models/HunYuan/index.d.ts +10 -0
  17. package/ai/dist/models/HunYuan/type.d.ts +74 -0
  18. package/ai/dist/models/HunYuan/util.d.ts +4 -0
  19. package/ai/dist/models/HunYuanBeta/index.d.ts +10 -0
  20. package/ai/dist/models/HunYuanExp/index.d.ts +10 -0
  21. package/ai/dist/models/HunYuanOpen/index.d.ts +10 -0
  22. package/ai/dist/models/Moonshot/index.d.ts +10 -0
  23. package/ai/dist/models/Moonshot/type.d.ts +85 -0
  24. package/ai/dist/models/Yi/index.d.ts +10 -0
  25. package/ai/dist/models/Yi/type.d.ts +75 -0
  26. package/ai/dist/models/ZhiPu/index.d.ts +10 -0
  27. package/ai/dist/models/ZhiPu/type.d.ts +71 -0
  28. package/ai/dist/models/image-model.d.ts +19 -0
  29. package/ai/dist/models/index.d.ts +26 -0
  30. package/ai/dist/models/model.d.ts +40 -0
  31. package/ai/dist/type.d.ts +192 -0
  32. package/ai/dist/utils.d.ts +38 -0
  33. package/apis/dist/callApis.d.ts +20 -0
  34. package/apis/dist/index.d.ts +5 -1
  35. package/apis/dist/type.d.ts +14 -0
  36. package/app/dist/constants/common.d.ts +38 -0
  37. package/app/dist/index.d.ts +66 -7
  38. package/app/dist/index.esm.js +1 -1
  39. package/app/dist/index.esm.js.map +1 -1
  40. package/app/dist/index.js +1 -1
  41. package/app/dist/index.js.map +1 -1
  42. package/app/dist/index.node.d.ts +6 -0
  43. package/app/dist/index.node.esm.js +1 -1
  44. package/app/dist/index.node.esm.js.map +1 -1
  45. package/app/dist/index.node.js +1 -1
  46. package/app/dist/index.node.js.map +1 -1
  47. package/app/dist/libs/adapter-node/constants.d.ts +33 -0
  48. package/app/dist/libs/adapter-node/context.d.ts +18 -0
  49. package/app/dist/libs/adapter-node/index.d.ts +26 -0
  50. package/app/dist/libs/adapter-node/metadata.d.ts +14 -0
  51. package/app/dist/libs/adapter-node/optional-require.d.ts +1 -0
  52. package/app/dist/libs/adapter-node/request.d.ts +44 -0
  53. package/app/dist/libs/adapter-node/tool.d.ts +2 -0
  54. package/app/dist/libs/adapter-node/types.d.ts +103 -0
  55. package/app/dist/libs/adapter-node/utils.d.ts +37 -0
  56. package/app/dist/libs/adapter-node/wx.d.ts +39 -0
  57. package/app/dist/libs/adapter.d.ts +3 -0
  58. package/app/dist/libs/cache.d.ts +6 -0
  59. package/app/dist/libs/component.d.ts +3 -0
  60. package/app/dist/libs/lang.d.ts +23 -0
  61. package/app/dist/libs/request.d.ts +62 -0
  62. package/auth/dist/adapter.d.ts +2 -0
  63. package/auth/dist/index.d.ts +271 -2
  64. package/auth/dist/type.d.ts +295 -0
  65. package/auth/dist/utilities.d.ts +7 -0
  66. package/auth/dist/utils.d.ts +5 -0
  67. package/auth/dist/v1-compat.d.ts +77 -0
  68. package/cloudrun/dist/index.d.ts +4 -1
  69. package/container/dist/constants/index.d.ts +1 -0
  70. package/container/dist/go_wams_exec.d.ts +2 -0
  71. package/container/dist/index.d.ts +13 -2
  72. package/container/dist/utils/index.d.ts +3 -0
  73. package/container/dist/utils/loader.d.ts +8 -0
  74. package/container/dist/utils/request.d.ts +12 -0
  75. package/core.d.ts +84 -81
  76. package/database/dist/index.d.ts +1 -1
  77. package/dist/index.cjs.js +1 -1
  78. package/dist/index.cjs.js.map +1 -1
  79. package/dist/index.esm.js +1 -1
  80. package/dist/index.esm.js.map +1 -1
  81. package/dist/index.node.cjs.js +1 -1
  82. package/dist/index.node.cjs.js.map +1 -1
  83. package/dist/index.node.esm.js +1 -1
  84. package/dist/index.node.esm.js.map +1 -1
  85. package/functions/dist/index.d.ts +2 -2
  86. package/miniprogram_dist/ai/index.d.ts +1 -1
  87. package/miniprogram_dist/apis/index.d.ts +1 -1
  88. package/miniprogram_dist/app/index.d.ts +5 -5
  89. package/miniprogram_dist/auth/index.d.ts +7 -7
  90. package/miniprogram_dist/cloudrun/index.d.ts +2 -2
  91. package/miniprogram_dist/container/index.d.ts +2 -2
  92. package/miniprogram_dist/database/index.d.ts +1 -1
  93. package/miniprogram_dist/functions/index.d.ts +1 -1
  94. package/miniprogram_dist/index.js +1 -1
  95. package/miniprogram_dist/model/index.d.ts +1 -1
  96. package/miniprogram_dist/mysql/index.d.ts +1 -1
  97. package/miniprogram_dist/realtime/index.d.ts +1 -1
  98. package/miniprogram_dist/storage/index.d.ts +1 -1
  99. package/model/dist/index.d.ts +5 -1
  100. package/mysql/dist/index.d.ts +4 -1
  101. package/oauth/dist/auth/apis.d.ts +143 -0
  102. package/oauth/dist/auth/auth-error.d.ts +32 -0
  103. package/oauth/dist/auth/consts.d.ts +165 -0
  104. package/oauth/dist/auth/models.d.ts +557 -0
  105. package/oauth/dist/captcha/captcha-dom.d.ts +3 -0
  106. package/oauth/dist/captcha/captcha.d.ts +42 -0
  107. package/oauth/dist/index.d.ts +22 -1
  108. package/oauth/dist/oauth2client/consts.d.ts +20 -0
  109. package/oauth/dist/oauth2client/interface.d.ts +15 -0
  110. package/oauth/dist/oauth2client/models.d.ts +75 -0
  111. package/oauth/dist/oauth2client/oauth2client.d.ts +154 -0
  112. package/oauth/dist/utils/base64.d.ts +9 -0
  113. package/oauth/dist/utils/encrypt.d.ts +4 -0
  114. package/oauth/dist/utils/encryptlong/index.d.ts +546 -0
  115. package/oauth/dist/utils/function/single-promise.d.ts +10 -0
  116. package/oauth/dist/utils/index.d.ts +2 -0
  117. package/oauth/dist/utils/mp.d.ts +2 -0
  118. package/oauth/dist/utils/urlSearchParams.d.ts +13 -0
  119. package/oauth/dist/utils/uuid.d.ts +1 -0
  120. package/package.json +24 -4
  121. package/realtime/dist/common.d.ts +4 -0
  122. package/realtime/dist/error.d.ts +36 -0
  123. package/realtime/dist/index.d.ts +4 -2
  124. package/realtime/dist/listener.d.ts +14 -0
  125. package/realtime/dist/message.d.ts +3 -0
  126. package/realtime/dist/snapshot.d.ts +17 -0
  127. package/realtime/dist/utils.d.ts +1 -0
  128. package/realtime/dist/virtual-websocket-client.d.ts +62 -0
  129. package/realtime/dist/websocket-client.d.ts +78 -0
  130. package/realtime/dist/ws-event.d.ts +126 -0
  131. package/storage/dist/cloudbase-storage.d.ts +58 -0
  132. package/storage/dist/download-builder.d.ts +24 -0
  133. package/storage/dist/encoding.d.ts +3 -0
  134. package/storage/dist/http.d.ts +38 -0
  135. package/storage/dist/index.d.ts +13 -2
  136. package/storage/dist/node-types.d.ts +6 -0
  137. package/storage/dist/storage-bucket-api-neo.d.ts +15 -0
  138. package/storage/dist/storage-file-api-classic.d.ts +80 -0
  139. package/storage/dist/storage-file-api-neo.d.ts +48 -0
  140. package/storage/dist/supabase/errors.d.ts +20 -0
  141. package/storage/dist/supabase/types.d.ts +63 -0
  142. package/storage/dist/types.d.ts +142 -0
  143. package/storage/dist/validation.d.ts +2 -0
  144. package/types/auth.d.ts +1 -1
  145. package/types/index.d.ts +3 -2
  146. package/types/package.json +1 -1
  147. package/utilities/dist/cjs/libs/cache.d.ts +2 -2
  148. package/utilities/dist/cjs/libs/events.d.ts +1 -1
  149. package/utilities/dist/cjs/libs/util.d.ts +1 -1
  150. package/utilities/dist/esm/libs/cache.d.ts +2 -2
  151. package/utilities/dist/esm/libs/events.d.ts +1 -1
  152. package/utilities/dist/esm/libs/util.d.ts +1 -1
  153. package/utilities/package.json +1 -1
@@ -0,0 +1,33 @@
1
+ export declare const ERROR: {
2
+ INVALID_PARAM: {
3
+ code: string;
4
+ message: string;
5
+ };
6
+ SYS_ERR: {
7
+ code: string;
8
+ message: string;
9
+ };
10
+ STORAGE_REQUEST_FAIL: {
11
+ code: string;
12
+ message: string;
13
+ };
14
+ STORAGE_FILE_NONEXIST: {
15
+ code: string;
16
+ message: string;
17
+ };
18
+ TCB_CLS_UNOPEN: {
19
+ code: string;
20
+ message: string;
21
+ };
22
+ INVALID_CONTEXT: {
23
+ code: string;
24
+ message: string;
25
+ };
26
+ };
27
+ export declare const ADMIN_PATH = "/admin";
28
+ export declare const CLIENT_AUTH_PATH = "/auth/v1/token/clientCredential";
29
+ export declare const checkCustomUserIdRegex: RegExp;
30
+ export declare enum SECRET_TYPE {
31
+ 'SECRET' = "SECRET",
32
+ 'SESSION_SECRET' = "SESSION_SECRET"
33
+ }
@@ -0,0 +1,18 @@
1
+ import type { IContextParam, ICompleteCloudbaseContext } from './types';
2
+ import { ICloudbaseConfig } from '@cloudbase/js-sdk/types';
3
+ export declare function parseContext(context: IContextParam): any;
4
+ export declare const getCloudbaseContext: (context?: IContextParam) => ICompleteCloudbaseContext;
5
+ export declare function getTcbContextConfig(): any;
6
+ export declare function getServerInjectUrl(): string;
7
+ export declare function getGatewayUrl(): string;
8
+ export declare let INIT_CONFIG: ICloudbaseConfig;
9
+ export declare const getSecretInfo: (config?: ICloudbaseConfig) => {
10
+ env: string;
11
+ secretId: any;
12
+ secretKey: any;
13
+ sessionToken: any;
14
+ accessKey: string;
15
+ secretType: string;
16
+ credentials: any;
17
+ context: any;
18
+ };
@@ -0,0 +1,26 @@
1
+ import { SDKAdapterInterface } from '@cloudbase/adapter-interface';
2
+ import { ICloudbaseConfig } from '@cloudbase/js-sdk/types';
3
+ export { NodeRequest } from './request';
4
+ export { parseQueryString, createWebStreamFromNodeReadableStream, E, TcbError, SYMBOL_CURRENT_ENV, SYMBOL_DEFAULT_ENV, isValidEnvFormat, isPageModuleName, filterValue, filterUndefined, processReturn, setThrowOnCode } from './utils';
5
+ export { getCloudbaseContext, parseContext, getSecretInfo, getServerInjectUrl, getGatewayUrl, getTcbContextConfig } from './context';
6
+ export { getWxCloudToken, buildAdminUrl, sendWxRequest, sendWxFormDataRequest, callWxOpenApi, callCompatibleWxOpenApi, callWxPayApi, wxCallContainerApi, getWxOptions } from './wx';
7
+ export type { ICreateTicketOpts, IGetUserInfoResult, IGetEndUserInfoResult, IUserInfoQuery, IContextParam, ICompleteCloudbaseContext, ISCFContext, ICallWxOpenApiOptions, ICallWxOpenApiResult, ITemplateNotifyReq, Extension, } from './types';
8
+ declare function isMatch(): boolean;
9
+ declare function genAdapter(options: any): SDKAdapterInterface & {
10
+ getSecretInfo: (config?: ICloudbaseConfig) => {
11
+ env: string;
12
+ secretId: string;
13
+ secretKey: string;
14
+ sessionToken: string;
15
+ accessKey: string;
16
+ secretType: string;
17
+ credentials?: string;
18
+ };
19
+ nodeTool: (app: any, config: ICloudbaseConfig) => void;
20
+ };
21
+ declare const adapter: {
22
+ genAdapter: typeof genAdapter;
23
+ isMatch: typeof isMatch;
24
+ runtime: string;
25
+ };
26
+ export default adapter;
@@ -0,0 +1,14 @@
1
+ export declare const kMetadataBaseUrl = "http://metadata.tencentyun.com";
2
+ export declare const kAppIdPath = "meta-data/app-id";
3
+ export declare const kSecurityCredentialsPath = "meta-data/cam/security-credentials";
4
+ export declare enum kMetadataVersions {
5
+ 'v20170919' = "2017-09-19",
6
+ 'v1.0' = "1.0",
7
+ 'latest' = "latest"
8
+ }
9
+ export declare function isAppId(appIdStr: string): boolean;
10
+ export declare function lookup(path: string, options?: {
11
+ timeout?: number;
12
+ }): Promise<string>;
13
+ export declare function lookupAppId(): Promise<string>;
14
+ export declare function lookupCredentials(ruleName: string): Promise<string>;
@@ -0,0 +1 @@
1
+ export declare function optionalRequire<T = any>(moduleNameParts: string[], installHint?: string): T | null;
@@ -0,0 +1,44 @@
1
+ import { IFetchOptions, IRequestConfig, IRequestOptions, ResponseObject, SDKRequestInterface } from '@cloudbase/adapter-interface';
2
+ import type { ICustomReqOpts } from './types';
3
+ import { ICloudbaseConfig } from '@cloudbase/js-sdk/types';
4
+ export declare class NodeRequest implements SDKRequestInterface {
5
+ config: IRequestConfig & ICloudbaseConfig;
6
+ private readonly timeout;
7
+ private readonly restrictedMethods;
8
+ constructor(config: IRequestConfig & ICloudbaseConfig);
9
+ getClientCredential(opts: {
10
+ origin: string;
11
+ }): Promise<any>;
12
+ getRealUrl(url: string, headers: Record<string, any>, body: any): string;
13
+ getReqOptions: (url: string, options: {
14
+ method?: any;
15
+ headers: any;
16
+ body?: any;
17
+ credentials?: string;
18
+ withCredentials?: boolean;
19
+ signal?: AbortSignal;
20
+ url?: any;
21
+ }) => Promise<{
22
+ method?: any;
23
+ headers: any;
24
+ body?: any;
25
+ credentials?: string;
26
+ withCredentials?: boolean;
27
+ signal?: AbortSignal;
28
+ url?: any;
29
+ }>;
30
+ get: (options: IRequestOptions) => Promise<ResponseObject>;
31
+ post: (options: IRequestOptions) => Promise<ResponseObject>;
32
+ put: (options: IRequestOptions) => Promise<ResponseObject>;
33
+ upload: (options: IRequestOptions) => Promise<ResponseObject>;
34
+ download: (options: IRequestOptions) => Promise<unknown>;
35
+ fetch: (options: Omit<IFetchOptions, "signal"> & {
36
+ signal?: AbortSignal;
37
+ customReqOpts?: ICustomReqOpts;
38
+ }) => Promise<ResponseObject>;
39
+ request: (options: IRequestOptions, enableAbort?: boolean) => Promise<ResponseObject>;
40
+ private getFetchFn;
41
+ private createAbortController;
42
+ private applyDuplexIfNeeded;
43
+ private isNpmFormData;
44
+ }
@@ -0,0 +1,2 @@
1
+ import { ICloudbaseConfig } from '@cloudbase/js-sdk/types';
2
+ export declare const nodeTool: (app: any, config: ICloudbaseConfig) => void;
@@ -0,0 +1,103 @@
1
+ export interface ICreateTicketOpts {
2
+ refresh?: number;
3
+ expire?: number;
4
+ }
5
+ export interface IGetUserInfoResult {
6
+ openId: string;
7
+ appId: string;
8
+ uid: string;
9
+ customUserId: string;
10
+ isAnonymous: boolean;
11
+ }
12
+ export interface IContextParam {
13
+ memory_limit_in_mb: number;
14
+ time_limit_in_ms: number;
15
+ request_id: string;
16
+ environ?: string;
17
+ environment?: string;
18
+ function_version: string;
19
+ function_name: string;
20
+ namespace: string;
21
+ }
22
+ export interface IUserInfoQuery {
23
+ platform?: string;
24
+ platformId?: string;
25
+ uid?: string;
26
+ }
27
+ export interface ICompleteCloudbaseContext {
28
+ _SCF_TCB_LOG?: string;
29
+ LOGINTYPE?: string;
30
+ QQ_APPID?: string;
31
+ QQ_OPENID?: string;
32
+ SCF_NAMESPACE: string;
33
+ TCB_CONTEXT_CNFG?: string;
34
+ TCB_CONTEXT_KEYS: string[];
35
+ TCB_CUSTOM_USER_ID?: string;
36
+ TCB_ENV: string;
37
+ TCB_HTTP_CONTEXT?: string;
38
+ TCB_ISANONYMOUS_USER?: string;
39
+ TCB_ROUTE_KEY?: string;
40
+ TCB_SEQID: string;
41
+ TCB_SESSIONTOKEN?: string;
42
+ TCB_SOURCE_IP?: string;
43
+ TCB_SOURCE?: string;
44
+ TCB_TRACELOG?: string;
45
+ TCB_UUID?: string;
46
+ TENCENTCLOUD_RUNENV: string;
47
+ TENCENTCLOUD_SECRETID: string;
48
+ TENCENTCLOUD_SECRETKEY: string;
49
+ TENCENTCLOUD_SESSIONTOKEN: string;
50
+ CLOUDBASE_APIKEY: string;
51
+ TRIGGER_SRC: string;
52
+ WX_API_TOKEN?: string;
53
+ WX_APPID?: string;
54
+ WX_CLIENTIP?: string;
55
+ WX_CLIENTIPV6?: string;
56
+ WX_CLOUDBASE_ACCESSTOKEN?: string;
57
+ WX_CONTEXT_KEYS: string[];
58
+ WX_OPENID?: string;
59
+ WX_TRIGGER_API_TOKEN_V0?: string;
60
+ WX_UNIONID?: string;
61
+ }
62
+ export interface IGetEndUserInfoResult {
63
+ userInfo?: {
64
+ openId: string;
65
+ appId: string;
66
+ uid: string;
67
+ customUserId: string;
68
+ isAnonymous: boolean;
69
+ };
70
+ requestId?: string;
71
+ }
72
+ export interface ICustomReqOpts {
73
+ timeout?: number;
74
+ }
75
+ export interface ITemplateNotifyReq {
76
+ notifyId: string;
77
+ data?: Record<string, unknown>;
78
+ url?: string;
79
+ }
80
+ export interface ISCFContext {
81
+ memoryLimitInMb: number;
82
+ timeLimitIns: number;
83
+ requestId: string;
84
+ functionVersion: string;
85
+ namespace: string;
86
+ functionName: string;
87
+ environ?: any;
88
+ environment?: any;
89
+ }
90
+ export interface ICallWxOpenApiOptions {
91
+ apiName: string;
92
+ apiOptions?: any;
93
+ cgiName?: string;
94
+ requestData: any;
95
+ }
96
+ export interface ICallWxOpenApiResult {
97
+ requestId?: string;
98
+ result?: any;
99
+ }
100
+ export interface Extension {
101
+ name: string;
102
+ invoke<T>(options: T, cloudbase: any): any;
103
+ }
@@ -0,0 +1,37 @@
1
+ /// <reference types="node" />
2
+ import { ReadableStream } from 'web-streams-polyfill';
3
+ export declare const isFormData: (obj: unknown) => boolean, toQueryString: (data: Record<string, any>) => string;
4
+ export declare function getEnv(): Record<string, string | undefined>;
5
+ export declare function getEnv(key: string): string | undefined;
6
+ export declare const checkIsInScf: () => boolean;
7
+ export declare function checkIsInCBR(): boolean;
8
+ export declare function checkIsInSumeru(): boolean;
9
+ export declare function checkIsInTencentCloud(): Promise<boolean>;
10
+ export declare const getCurrRunEnvTag: () => Promise<string>;
11
+ export declare const validateUid: (uid: string) => void;
12
+ export declare function safeParseJson(text: string): any;
13
+ export declare function obj2StrRecord(obj: object): Record<string, string>;
14
+ export declare function headersInit2Indexable(h: HeadersInit): Record<string, string> | [string, string][];
15
+ export declare function parseQueryString(search: string): Record<string, string | string[]>;
16
+ export declare function createWebStreamFromNodeReadableStream(stream: NodeJS.ReadableStream): ReadableStream;
17
+ interface IErrorInfo {
18
+ requestId?: string;
19
+ code?: string;
20
+ message?: string;
21
+ }
22
+ export declare class TcbError extends Error {
23
+ readonly code: string;
24
+ readonly message: string;
25
+ readonly requestId: string;
26
+ constructor(error: IErrorInfo);
27
+ }
28
+ export declare function E(errObj: IErrorInfo): TcbError;
29
+ export declare function filterValue(o: any, value: any): void;
30
+ export declare function filterUndefined(o: any): void;
31
+ export declare function setThrowOnCode(value: boolean): void;
32
+ export declare function processReturn(result: any): any;
33
+ export declare function isPageModuleName(envId?: string): boolean;
34
+ export declare function isValidEnvFormat(env?: string): boolean;
35
+ export declare const SYMBOL_CURRENT_ENV: unique symbol;
36
+ export declare const SYMBOL_DEFAULT_ENV: unique symbol;
37
+ export {};
@@ -0,0 +1,39 @@
1
+ import type { ICustomReqOpts } from './types';
2
+ export declare function getWxCloudToken(): {
3
+ wxCloudApiToken: string;
4
+ wxCloudbaseAccesstoken?: string;
5
+ };
6
+ export declare function buildAdminUrl(config: any, scfContext?: any, serviceUrl?: string): string;
7
+ export interface ISendWxRequestOptions {
8
+ requestInstance: any;
9
+ config: any;
10
+ scfContext?: any;
11
+ serviceUrl?: string;
12
+ }
13
+ export declare function sendWxRequest(options: ISendWxRequestOptions, action: string, params: any, reqOpts?: ICustomReqOpts): Promise<any>;
14
+ export declare function sendWxFormDataRequest(options: ISendWxRequestOptions, action: string, params: any, reqOpts?: ICustomReqOpts): Promise<any>;
15
+ export declare function getWxOptions(config: any, scfContext: any, serviceUrl: string, requestInstance: any): ISendWxRequestOptions;
16
+ export declare function callWxOpenApi(wxOptions: ISendWxRequestOptions, { apiName, apiOptions, cgiName, requestData }: {
17
+ apiName: string;
18
+ apiOptions?: any;
19
+ cgiName?: string;
20
+ requestData: any;
21
+ }, opts?: ICustomReqOpts): Promise<any>;
22
+ export declare const callCompatibleWxOpenApi: (wxOptions: ISendWxRequestOptions, apiOpts: {
23
+ apiName: string;
24
+ apiOptions?: any;
25
+ cgiName?: string;
26
+ requestData: any;
27
+ }, opts?: ICustomReqOpts) => Promise<any>;
28
+ export declare const callWxPayApi: (wxOptions: ISendWxRequestOptions, apiOpts: {
29
+ apiName: string;
30
+ apiOptions?: any;
31
+ cgiName?: string;
32
+ requestData: any;
33
+ }, opts?: ICustomReqOpts) => Promise<any>;
34
+ export declare const wxCallContainerApi: (wxOptions: ISendWxRequestOptions, apiOpts: {
35
+ apiName: string;
36
+ apiOptions?: any;
37
+ cgiName?: string;
38
+ requestData: any;
39
+ }, opts?: ICustomReqOpts) => Promise<any>;
@@ -0,0 +1,3 @@
1
+ import { ICloudbasePlatformInfo } from '@cloudbase/js-sdk/types';
2
+ export declare const Platform: ICloudbasePlatformInfo;
3
+ export declare const getWxDefaultAdapter: () => any;
@@ -0,0 +1,6 @@
1
+ import { ICloudbaseCache, ICacheConfig } from '@cloudbase/js-sdk/types/cache';
2
+ export declare function initCache(config: ICacheConfig & {
3
+ env: string;
4
+ }): void;
5
+ export declare function getCacheByEnvId(env: string): ICloudbaseCache;
6
+ export declare function getLocalCache(env: string): ICloudbaseCache;
@@ -0,0 +1,3 @@
1
+ import { ICloudbaseComponent, ICloudbaseHook } from '@cloudbase/js-sdk/types/component';
2
+ export declare function registerComponent(app: any, component: ICloudbaseComponent): void;
3
+ export declare function registerHook(app: any, hook: ICloudbaseHook): void;
@@ -0,0 +1,23 @@
1
+ export declare enum LANGS {
2
+ ZH = "zh-CN",
3
+ EN = "en-US"
4
+ }
5
+ export declare const LANG_HEADER_KEY = "Accept-Language";
6
+ export declare const langMap: {
7
+ "en-US": {
8
+ '\u8BF7\u68C0\u67E5\u8C03\u7528\u65B9\u5F0F\uFF0C\u6216\u524D\u5F80\u4E91\u5F00\u53D1 AI+ \u9996\u9875\u67E5\u770B\u6587\u6863': string;
9
+ 'AI+ \u8BF7\u6C42\u51FA\u9519\uFF0C\u9519\u8BEF\u7801': string;
10
+ 错误信息: string;
11
+ 未实现: string;
12
+ '\u5C0F\u7A0B\u5E8F\u4E0D\u652F\u6301 wasm \u52A0\u8F7D': string;
13
+ '\u5C0F\u7A0B\u5E8F\u4E0D\u652F\u6301\u52A8\u6001 js \u52A0\u8F7D': string;
14
+ 请求超时: string;
15
+ '\u7F3A\u5C11 privatelink sdk \u5730\u5740': string;
16
+ };
17
+ };
18
+ export declare const t: (text: string, lang: LANGS) => any;
19
+ export declare const i18nProxy: (platform: any, config: any) => {
20
+ t: (text: string) => any;
21
+ LANG_HEADER_KEY: string;
22
+ lang: any;
23
+ };
@@ -0,0 +1,62 @@
1
+ import { IRequestOptions, ResponseObject, IUploadRequestOptions, IFetchOptions } from '@cloudbase/adapter-interface';
2
+ import { EndPointKey, KV, ICloudbaseConfig } from '@cloudbase/js-sdk/types';
3
+ import { ICustomReqOpts } from '@cloudbase/js-sdk/types/functions';
4
+ import { IGetAccessTokenResult, ICloudbaseRequestConfig } from '@cloudbase/js-sdk/types/request';
5
+ export interface IGateWayOptions {
6
+ name?: string;
7
+ data?: any;
8
+ path?: string;
9
+ method: string;
10
+ header?: {};
11
+ url?: string;
12
+ }
13
+ export interface ICloudbaseRequest {
14
+ post: (options: IRequestOptions) => Promise<ResponseObject>;
15
+ upload: (options: IUploadRequestOptions) => Promise<ResponseObject>;
16
+ download: (options: IRequestOptions) => Promise<ResponseObject>;
17
+ request: (action: string, params: KV<any>, options?: KV<any>) => Promise<ResponseObject>;
18
+ send: (action: string, data: KV<any>) => Promise<any>;
19
+ fetch: (options: IFetchOptions) => Promise<ResponseObject>;
20
+ }
21
+ export declare class CloudbaseRequest implements ICloudbaseRequest {
22
+ config: ICloudbaseRequestConfig;
23
+ private reqClass;
24
+ private throwWhenRequestFail;
25
+ private localCache;
26
+ constructor(config: ICloudbaseRequestConfig & {
27
+ throw?: boolean;
28
+ });
29
+ getAccessToken(token?: any): Promise<any>;
30
+ getDefaultHeaders(): {
31
+ [x: string]: string;
32
+ 'X-SDK-Version': string;
33
+ };
34
+ post(options: IRequestOptions, customReqOpts?: ICustomReqOpts): Promise<ResponseObject>;
35
+ upload(options: IUploadRequestOptions): Promise<ResponseObject>;
36
+ download(options: IRequestOptions): Promise<ResponseObject>;
37
+ getBaseEndPoint(endPointKey?: EndPointKey): string;
38
+ getOauthAccessTokenV2(oauthClient: any): Promise<IGetAccessTokenResult>;
39
+ request(action: string, params: KV<any>, options?: {
40
+ onUploadProgress?: Function;
41
+ pathname?: string;
42
+ parse?: boolean;
43
+ inQuery?: KV<any>;
44
+ search?: string;
45
+ defaultQuery?: KV<any>;
46
+ headers?: KV<string>;
47
+ endPointMode?: 'CLOUD_API' | 'GATEWAY';
48
+ }, customReqOpts?: ICustomReqOpts): Promise<ResponseObject>;
49
+ fetch(options: IFetchOptions & {
50
+ token?: string;
51
+ withCredentials?: boolean;
52
+ customReqOpts?: ICustomReqOpts;
53
+ }): Promise<ResponseObject>;
54
+ send(action: string, data?: KV<any>, options?: KV<any>, customReqOpts?: ICustomReqOpts): Promise<any>;
55
+ gateWay(options: IGateWayOptions, customReqOpts?: ICustomReqOpts): Promise<{
56
+ data: any;
57
+ statusCode?: number;
58
+ requestId: string;
59
+ }>;
60
+ }
61
+ export declare function initRequest(config: ICloudbaseRequestConfig & Partial<ICloudbaseConfig>): CloudbaseRequest;
62
+ export declare function getRequestByEnvId(env: string): CloudbaseRequest;
@@ -0,0 +1,2 @@
1
+ import type { AuthOptions } from '@cloudbase/js-sdk/oauth';
2
+ export declare const useAuthAdapter: (config: AuthOptions) => any;