@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.
- 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.esm.js.map +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/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/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 +24 -4
- 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,63 @@
|
|
|
1
|
+
import { MaybeNodeBuffer, NodeReadableStreamLike } from '../node-types';
|
|
2
|
+
export type FileBody = ArrayBuffer | ArrayBufferView | Blob | File | FormData | MaybeNodeBuffer | NodeReadableStreamLike | ReadableStream<Uint8Array> | URLSearchParams | string;
|
|
3
|
+
export type BucketType = 'STANDARD' | 'ANALYTICS';
|
|
4
|
+
export interface Bucket {
|
|
5
|
+
id: string;
|
|
6
|
+
type?: BucketType;
|
|
7
|
+
name: string;
|
|
8
|
+
owner: string;
|
|
9
|
+
file_size_limit?: number;
|
|
10
|
+
allowed_mime_types?: string[];
|
|
11
|
+
created_at: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
public: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface FileObject {
|
|
16
|
+
name: string;
|
|
17
|
+
bucket_id: string;
|
|
18
|
+
owner: string;
|
|
19
|
+
id: string;
|
|
20
|
+
updated_at: string;
|
|
21
|
+
created_at: string;
|
|
22
|
+
last_accessed_at: string;
|
|
23
|
+
metadata: Record<string, any>;
|
|
24
|
+
buckets: Bucket;
|
|
25
|
+
}
|
|
26
|
+
export interface FileObjectV2 {
|
|
27
|
+
id: string;
|
|
28
|
+
version: string;
|
|
29
|
+
name: string;
|
|
30
|
+
bucket_id: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
created_at: string;
|
|
33
|
+
last_accessed_at: string;
|
|
34
|
+
size?: number;
|
|
35
|
+
cache_control?: string;
|
|
36
|
+
content_type?: string;
|
|
37
|
+
etag?: string;
|
|
38
|
+
last_modified?: string;
|
|
39
|
+
metadata?: Record<string, any>;
|
|
40
|
+
}
|
|
41
|
+
export interface FileOptions {
|
|
42
|
+
cacheControl?: string;
|
|
43
|
+
contentType?: string;
|
|
44
|
+
upsert?: boolean;
|
|
45
|
+
duplex?: string;
|
|
46
|
+
metadata?: Record<string, any>;
|
|
47
|
+
headers?: Record<string, string>;
|
|
48
|
+
}
|
|
49
|
+
export interface DestinationOptions {
|
|
50
|
+
destinationBucket?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface TransformOptions {
|
|
53
|
+
width?: number;
|
|
54
|
+
height?: number;
|
|
55
|
+
resize?: 'cover' | 'contain' | 'fill';
|
|
56
|
+
quality?: number;
|
|
57
|
+
format?: 'origin';
|
|
58
|
+
}
|
|
59
|
+
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : S;
|
|
60
|
+
export type Camelize<T> = {
|
|
61
|
+
[K in keyof T as CamelCase<Extract<K, string>>]: T[K];
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { StorageError } from './supabase/errors';
|
|
2
|
+
import { MaybeNodeBuffer, NodeReadableStreamLike } from './node-types';
|
|
3
|
+
export type FileBody = ArrayBuffer | ArrayBufferView | Blob | File | FormData | MaybeNodeBuffer | NodeReadableStreamLike | ReadableStream<Uint8Array> | URLSearchParams | string;
|
|
4
|
+
export interface FileOptions {
|
|
5
|
+
cacheControl?: string;
|
|
6
|
+
contentType?: string;
|
|
7
|
+
upsert?: boolean;
|
|
8
|
+
duplex?: string;
|
|
9
|
+
metadata?: Record<string, any>;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export type UploadOptions = FileOptions;
|
|
13
|
+
export type Result<T> = {
|
|
14
|
+
data: T;
|
|
15
|
+
error: null;
|
|
16
|
+
} | {
|
|
17
|
+
data: null;
|
|
18
|
+
error: StorageError;
|
|
19
|
+
};
|
|
20
|
+
export interface FetchParameters {
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
cache?: 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached';
|
|
23
|
+
}
|
|
24
|
+
export interface MessageResponse {
|
|
25
|
+
message: string;
|
|
26
|
+
}
|
|
27
|
+
export interface UploadResult {
|
|
28
|
+
id: string;
|
|
29
|
+
path: string;
|
|
30
|
+
fullPath: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DownloadOptions {
|
|
33
|
+
download?: string | boolean;
|
|
34
|
+
cacheNonce?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ListOptions {
|
|
37
|
+
limit?: number;
|
|
38
|
+
cursor?: string;
|
|
39
|
+
withDelimiter?: boolean;
|
|
40
|
+
sortBy?: {
|
|
41
|
+
column?: 'name' | 'created_at' | 'updated_at';
|
|
42
|
+
order?: 'asc' | 'desc';
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface ListObjectsEntry {
|
|
46
|
+
key?: string | null;
|
|
47
|
+
name: string;
|
|
48
|
+
id?: string | null;
|
|
49
|
+
updated_at?: string | null;
|
|
50
|
+
created_at?: string | null;
|
|
51
|
+
last_accessed_at?: string | null;
|
|
52
|
+
metadata?: Record<string, any> | null;
|
|
53
|
+
}
|
|
54
|
+
export interface ListObjectsResponse {
|
|
55
|
+
folders: ListObjectsEntry[];
|
|
56
|
+
objects: ListObjectsEntry[];
|
|
57
|
+
hasNext: boolean;
|
|
58
|
+
nextCursor?: string;
|
|
59
|
+
nextCursorKey?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ObjectInfo {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
version?: string | null;
|
|
65
|
+
bucketId: string;
|
|
66
|
+
size?: number | null;
|
|
67
|
+
contentType?: string | null;
|
|
68
|
+
cacheControl?: string | null;
|
|
69
|
+
etag?: string | null;
|
|
70
|
+
metadata?: Record<string, any>;
|
|
71
|
+
lastModified?: string | null;
|
|
72
|
+
createdAt?: string | null;
|
|
73
|
+
}
|
|
74
|
+
export interface FullObject {
|
|
75
|
+
name: string;
|
|
76
|
+
bucket_id: string;
|
|
77
|
+
owner_id?: string | null;
|
|
78
|
+
version?: string | null;
|
|
79
|
+
id?: string | null;
|
|
80
|
+
updated_at?: string | null;
|
|
81
|
+
created_at?: string | null;
|
|
82
|
+
last_accessed_at?: string | null;
|
|
83
|
+
metadata?: Record<string, any>;
|
|
84
|
+
user_metadata?: Record<string, any>;
|
|
85
|
+
}
|
|
86
|
+
export interface DestinationOptions {
|
|
87
|
+
destinationBucket?: string;
|
|
88
|
+
upsert?: boolean;
|
|
89
|
+
copyMetadata?: boolean;
|
|
90
|
+
metadata?: Record<string, any>;
|
|
91
|
+
}
|
|
92
|
+
export interface SignedUrlOptions {
|
|
93
|
+
download?: string | boolean;
|
|
94
|
+
cacheNonce?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface PublicUrlOptions {
|
|
97
|
+
download?: string | boolean;
|
|
98
|
+
cacheNonce?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface SignedUrlResult {
|
|
101
|
+
fullSignedURL: string;
|
|
102
|
+
}
|
|
103
|
+
export interface SignedUrlsResultItem {
|
|
104
|
+
path: string;
|
|
105
|
+
fullSignedURL: string | null;
|
|
106
|
+
error: string | null;
|
|
107
|
+
}
|
|
108
|
+
export interface CreateSignedUploadUrlResult {
|
|
109
|
+
fullSignedURL: string;
|
|
110
|
+
token: string;
|
|
111
|
+
path: string;
|
|
112
|
+
}
|
|
113
|
+
export type BucketType = 'STANDARD';
|
|
114
|
+
export interface Bucket {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
owner_id?: string | null;
|
|
118
|
+
public: boolean;
|
|
119
|
+
type?: BucketType;
|
|
120
|
+
file_size_limit?: number | null;
|
|
121
|
+
allowed_mime_types?: string[] | null;
|
|
122
|
+
created_at: string;
|
|
123
|
+
updated_at: string;
|
|
124
|
+
}
|
|
125
|
+
export interface ListBucketOptions {
|
|
126
|
+
limit?: number;
|
|
127
|
+
offset?: number;
|
|
128
|
+
sortColumn?: 'id' | 'name' | 'created_at' | 'updated_at';
|
|
129
|
+
sortOrder?: 'asc' | 'desc';
|
|
130
|
+
search?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface CreateBucketOptions {
|
|
133
|
+
public?: boolean;
|
|
134
|
+
fileSizeLimit?: number | string | null;
|
|
135
|
+
allowedMimeTypes?: string[] | null;
|
|
136
|
+
type?: BucketType;
|
|
137
|
+
}
|
|
138
|
+
export interface UpdateBucketOptions {
|
|
139
|
+
public?: boolean;
|
|
140
|
+
fileSizeLimit?: number | string | null;
|
|
141
|
+
allowedMimeTypes?: string[] | null;
|
|
142
|
+
}
|
package/types/auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICloudbaseConfig, KV, ICloudbase } from '.'
|
|
2
|
-
import { authModels, UserInfo } from '@cloudbase/oauth'
|
|
2
|
+
import { authModels, UserInfo } from '@cloudbase/js-sdk/oauth'
|
|
3
3
|
import { ICloudbaseEventEmitter } from './events'
|
|
4
4
|
|
|
5
5
|
export type ICloudbaseAuthConfig = Pick<
|
package/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
ICloudbaseCopyFileParams,
|
|
17
17
|
ICloudbaseCopyFileResult,
|
|
18
18
|
} from './storage'
|
|
19
|
-
import
|
|
19
|
+
import cloudbase = require('@cloudbase/js-sdk')
|
|
20
20
|
|
|
21
21
|
// 统一返回判别联合与错误契约(可辨识联合范式)
|
|
22
22
|
export { Result, SafeResult } from './result'
|
|
@@ -127,7 +127,8 @@ export interface CloudbaseCore {
|
|
|
127
127
|
authInstance?: ICloudbaseAuth
|
|
128
128
|
oauthInstance?: any
|
|
129
129
|
apis: ICloudbaseApis
|
|
130
|
-
|
|
130
|
+
// cloudbase.app 是命名空间而非类型,需引用其中的 App 接口
|
|
131
|
+
init: (config: ICloudbaseConfig & { lang?: LANGS }) => cloudbase.app.App
|
|
131
132
|
updateConfig: (config: ICloudbaseUpgradedConfig) => void
|
|
132
133
|
registerExtension: (ext: ICloudbaseExtension) => void
|
|
133
134
|
invokeExtension: (name: string, opts: any) => Promise<any>
|
package/types/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICloudbaseCache, ICacheConfig } from '@cloudbase/types/cache';
|
|
2
|
-
import { KV, Persistence } from '@cloudbase/types';
|
|
1
|
+
import { ICloudbaseCache, ICacheConfig } from '@cloudbase/js-sdk/types/cache';
|
|
2
|
+
import { KV, Persistence } from '@cloudbase/js-sdk/types';
|
|
3
3
|
export declare class CloudbaseCache implements ICloudbaseCache {
|
|
4
4
|
keys: KV<string>;
|
|
5
5
|
private persistenceTag;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICloudbaseCache, ICacheConfig } from '@cloudbase/types/cache';
|
|
2
|
-
import { KV, Persistence } from '@cloudbase/types';
|
|
1
|
+
import { ICloudbaseCache, ICacheConfig } from '@cloudbase/js-sdk/types/cache';
|
|
2
|
+
import { KV, Persistence } from '@cloudbase/js-sdk/types';
|
|
3
3
|
export declare class CloudbaseCache implements ICloudbaseCache {
|
|
4
4
|
keys: KV<string>;
|
|
5
5
|
private persistenceTag;
|