@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.
Files changed (157) 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.js +1 -1
  40. package/app/dist/index.js.map +1 -1
  41. package/app/dist/index.node.d.ts +6 -0
  42. package/app/dist/index.node.esm.js +1 -1
  43. package/app/dist/index.node.esm.js.map +1 -1
  44. package/app/dist/index.node.js +1 -1
  45. package/app/dist/index.node.js.map +1 -1
  46. package/app/dist/libs/adapter-node/constants.d.ts +33 -0
  47. package/app/dist/libs/adapter-node/context.d.ts +18 -0
  48. package/app/dist/libs/adapter-node/index.d.ts +26 -0
  49. package/app/dist/libs/adapter-node/metadata.d.ts +14 -0
  50. package/app/dist/libs/adapter-node/optional-require.d.ts +1 -0
  51. package/app/dist/libs/adapter-node/request.d.ts +44 -0
  52. package/app/dist/libs/adapter-node/tool.d.ts +2 -0
  53. package/app/dist/libs/adapter-node/types.d.ts +103 -0
  54. package/app/dist/libs/adapter-node/utils.d.ts +37 -0
  55. package/app/dist/libs/adapter-node/wx.d.ts +39 -0
  56. package/app/dist/libs/adapter.d.ts +3 -0
  57. package/app/dist/libs/cache.d.ts +6 -0
  58. package/app/dist/libs/component.d.ts +3 -0
  59. package/app/dist/libs/lang.d.ts +23 -0
  60. package/app/dist/libs/request.d.ts +62 -0
  61. package/auth/dist/adapter.d.ts +2 -0
  62. package/auth/dist/index.d.ts +271 -2
  63. package/auth/dist/index.esm.js +1 -1
  64. package/auth/dist/index.esm.js.map +1 -1
  65. package/auth/dist/index.js +1 -1
  66. package/auth/dist/index.js.map +1 -1
  67. package/auth/dist/type.d.ts +295 -0
  68. package/auth/dist/utilities.d.ts +7 -0
  69. package/auth/dist/utils.d.ts +5 -0
  70. package/auth/dist/v1-compat.d.ts +77 -0
  71. package/cloudrun/dist/index.d.ts +4 -1
  72. package/container/dist/constants/index.d.ts +1 -0
  73. package/container/dist/go_wams_exec.d.ts +2 -0
  74. package/container/dist/index.d.ts +13 -2
  75. package/container/dist/utils/index.d.ts +3 -0
  76. package/container/dist/utils/loader.d.ts +8 -0
  77. package/container/dist/utils/request.d.ts +12 -0
  78. package/core.d.ts +84 -81
  79. package/database/dist/index.d.ts +1 -1
  80. package/dist/index.cjs.js +1 -1
  81. package/dist/index.cjs.js.map +1 -1
  82. package/dist/index.esm.js +1 -1
  83. package/dist/index.esm.js.map +1 -1
  84. package/dist/index.node.cjs.js +1 -1
  85. package/dist/index.node.cjs.js.map +1 -1
  86. package/dist/index.node.esm.js +1 -1
  87. package/dist/index.node.esm.js.map +1 -1
  88. package/functions/dist/index.d.ts +2 -2
  89. package/miniprogram_dist/ai/index.d.ts +1 -1
  90. package/miniprogram_dist/apis/index.d.ts +1 -1
  91. package/miniprogram_dist/app/index.d.ts +5 -5
  92. package/miniprogram_dist/auth/index.d.ts +7 -7
  93. package/miniprogram_dist/auth/index.js +1 -1
  94. package/miniprogram_dist/cloudrun/index.d.ts +2 -2
  95. package/miniprogram_dist/container/index.d.ts +2 -2
  96. package/miniprogram_dist/database/index.d.ts +1 -1
  97. package/miniprogram_dist/functions/index.d.ts +1 -1
  98. package/miniprogram_dist/index.js +1 -1
  99. package/miniprogram_dist/model/index.d.ts +1 -1
  100. package/miniprogram_dist/mysql/index.d.ts +1 -1
  101. package/miniprogram_dist/realtime/index.d.ts +1 -1
  102. package/miniprogram_dist/storage/index.d.ts +1 -1
  103. package/model/dist/index.d.ts +5 -1
  104. package/mysql/dist/index.d.ts +4 -1
  105. package/oauth/dist/auth/apis.d.ts +143 -0
  106. package/oauth/dist/auth/auth-error.d.ts +32 -0
  107. package/oauth/dist/auth/consts.d.ts +165 -0
  108. package/oauth/dist/auth/models.d.ts +557 -0
  109. package/oauth/dist/captcha/captcha-dom.d.ts +3 -0
  110. package/oauth/dist/captcha/captcha.d.ts +42 -0
  111. package/oauth/dist/index.d.ts +22 -1
  112. package/oauth/dist/oauth2client/consts.d.ts +20 -0
  113. package/oauth/dist/oauth2client/interface.d.ts +15 -0
  114. package/oauth/dist/oauth2client/models.d.ts +75 -0
  115. package/oauth/dist/oauth2client/oauth2client.d.ts +154 -0
  116. package/oauth/dist/utils/base64.d.ts +9 -0
  117. package/oauth/dist/utils/encrypt.d.ts +4 -0
  118. package/oauth/dist/utils/encryptlong/index.d.ts +546 -0
  119. package/oauth/dist/utils/function/single-promise.d.ts +10 -0
  120. package/oauth/dist/utils/index.d.ts +2 -0
  121. package/oauth/dist/utils/mp.d.ts +2 -0
  122. package/oauth/dist/utils/urlSearchParams.d.ts +13 -0
  123. package/oauth/dist/utils/uuid.d.ts +1 -0
  124. package/package.json +20 -3
  125. package/realtime/dist/common.d.ts +4 -0
  126. package/realtime/dist/error.d.ts +36 -0
  127. package/realtime/dist/index.d.ts +4 -2
  128. package/realtime/dist/listener.d.ts +14 -0
  129. package/realtime/dist/message.d.ts +3 -0
  130. package/realtime/dist/snapshot.d.ts +17 -0
  131. package/realtime/dist/utils.d.ts +1 -0
  132. package/realtime/dist/virtual-websocket-client.d.ts +62 -0
  133. package/realtime/dist/websocket-client.d.ts +78 -0
  134. package/realtime/dist/ws-event.d.ts +126 -0
  135. package/storage/dist/cloudbase-storage.d.ts +58 -0
  136. package/storage/dist/download-builder.d.ts +24 -0
  137. package/storage/dist/encoding.d.ts +3 -0
  138. package/storage/dist/http.d.ts +38 -0
  139. package/storage/dist/index.d.ts +13 -2
  140. package/storage/dist/node-types.d.ts +6 -0
  141. package/storage/dist/storage-bucket-api-neo.d.ts +15 -0
  142. package/storage/dist/storage-file-api-classic.d.ts +80 -0
  143. package/storage/dist/storage-file-api-neo.d.ts +48 -0
  144. package/storage/dist/supabase/errors.d.ts +20 -0
  145. package/storage/dist/supabase/types.d.ts +63 -0
  146. package/storage/dist/types.d.ts +142 -0
  147. package/storage/dist/validation.d.ts +2 -0
  148. package/types/auth.d.ts +1 -1
  149. package/types/index.d.ts +3 -2
  150. package/types/package.json +1 -1
  151. package/utilities/dist/cjs/libs/cache.d.ts +2 -2
  152. package/utilities/dist/cjs/libs/events.d.ts +1 -1
  153. package/utilities/dist/cjs/libs/util.d.ts +1 -1
  154. package/utilities/dist/esm/libs/cache.d.ts +2 -2
  155. package/utilities/dist/esm/libs/events.d.ts +1 -1
  156. package/utilities/dist/esm/libs/util.d.ts +1 -1
  157. package/utilities/package.json +1 -1
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export declare function isValidBucketId(bucketId: unknown): bucketId is string;
2
+ export declare function assertValidBucketId(bucketId: unknown, caller: string): asserts bucketId is string;
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 { cloudbase } from '../cloudbase/index'
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
- init: (config: ICloudbaseConfig & { lang?: LANGS }) => cloudbase.app
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>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/types",
3
- "version": "3.7.1",
3
+ "version": "3.7.2-beta.0",
4
4
  "description": "cloudbase javascript sdk types",
5
5
  "main": "dist/index.js",
6
6
  "types": "./index.d.ts",
@@ -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,4 +1,4 @@
1
- import { ICloudbaseEventEmitter } from '@cloudbase/types/events';
1
+ import { ICloudbaseEventEmitter } from '@cloudbase/js-sdk/types/events';
2
2
  interface IEvent {
3
3
  name: string;
4
4
  target: any;
@@ -1,4 +1,4 @@
1
- import { KV } from '@cloudbase/types';
1
+ import { KV } from '@cloudbase/js-sdk/types';
2
2
  export declare function isArray(val: any): boolean;
3
3
  export declare function isString(val: any): boolean;
4
4
  export declare function isUndefined(val: any): boolean;
@@ -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,4 +1,4 @@
1
- import { ICloudbaseEventEmitter } from '@cloudbase/types/events';
1
+ import { ICloudbaseEventEmitter } from '@cloudbase/js-sdk/types/events';
2
2
  interface IEvent {
3
3
  name: string;
4
4
  target: any;
@@ -1,4 +1,4 @@
1
- import { KV } from '@cloudbase/types';
1
+ import { KV } from '@cloudbase/js-sdk/types';
2
2
  export declare function isArray(val: any): boolean;
3
3
  export declare function isString(val: any): boolean;
4
4
  export declare function isUndefined(val: any): boolean;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/utilities",
3
- "version": "3.7.1",
3
+ "version": "3.7.2-beta.0",
4
4
  "description": "cloudbase javascript sdk utilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",