@chatu-ai/builder-sdk 0.7.6 → 0.7.8
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/dist/client.d.ts +47 -0
- package/dist/client.js +1 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -116,6 +116,47 @@ export interface DataUsage {
|
|
|
116
116
|
rates?: Record<string, number>;
|
|
117
117
|
error?: string;
|
|
118
118
|
}
|
|
119
|
+
export type FunctionProvider = 'aliyun-fc' | 'tencent-scf' | 'volc-vefaas';
|
|
120
|
+
/** 函数计算部署(技术方案 17):凭据二选一 credentialId(凭据库 aliyun/tencent/volcengine)或 accessKeyId+accessKeySecret */
|
|
121
|
+
export interface FunctionDeployInput {
|
|
122
|
+
provider: FunctionProvider;
|
|
123
|
+
/** 函数/应用名:字母开头,字母数字与短横线,2-63 位 */
|
|
124
|
+
name: string;
|
|
125
|
+
/** 地域,如 cn-hangzhou / ap-guangzhou / cn-beijing */
|
|
126
|
+
region: string;
|
|
127
|
+
credentialId?: string;
|
|
128
|
+
accessKeyId?: string;
|
|
129
|
+
accessKeySecret?: string;
|
|
130
|
+
save?: boolean;
|
|
131
|
+
label?: string;
|
|
132
|
+
/** volc-vefaas 新建应用时的 API 网关名 */
|
|
133
|
+
gatewayName?: string;
|
|
134
|
+
memoryMb?: number;
|
|
135
|
+
includeAppEnv?: boolean;
|
|
136
|
+
includeDataAccess?: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface FunctionDeployResult {
|
|
139
|
+
ok: boolean;
|
|
140
|
+
error?: string;
|
|
141
|
+
message?: string;
|
|
142
|
+
state?: string;
|
|
143
|
+
provider?: string;
|
|
144
|
+
name?: string;
|
|
145
|
+
region?: string;
|
|
146
|
+
url?: string;
|
|
147
|
+
consoleUrl?: string;
|
|
148
|
+
output?: string;
|
|
149
|
+
envVarsApplied?: number;
|
|
150
|
+
envVarsFailed?: string[];
|
|
151
|
+
credentialId?: string | null;
|
|
152
|
+
}
|
|
153
|
+
export type FunctionDeployStreamEvent = {
|
|
154
|
+
type: 'log';
|
|
155
|
+
line: string;
|
|
156
|
+
} | {
|
|
157
|
+
type: 'result';
|
|
158
|
+
result: FunctionDeployResult;
|
|
159
|
+
};
|
|
119
160
|
export type DeployStreamEvent = {
|
|
120
161
|
type: 'log';
|
|
121
162
|
line: string;
|
|
@@ -142,6 +183,8 @@ export interface DeployInput {
|
|
|
142
183
|
env?: 'production' | 'preview';
|
|
143
184
|
includeAppEnv?: boolean;
|
|
144
185
|
includeDataAccess?: boolean;
|
|
186
|
+
/** 线上数据驱动:platform(默认,平台托管 Data API)| edgeone(EdgeOne Pages Blob,写 CHATU_DATA_DRIVER=edgeone) */
|
|
187
|
+
dataDriver?: 'platform' | 'edgeone';
|
|
145
188
|
}
|
|
146
189
|
export interface DeployResult {
|
|
147
190
|
ok: boolean;
|
|
@@ -265,6 +308,10 @@ export interface BuilderClient {
|
|
|
265
308
|
deployStream(conversationId: string, input: DeployInput, opts?: {
|
|
266
309
|
signal?: AbortSignal;
|
|
267
310
|
}): AsyncIterable<DeployStreamEvent>;
|
|
311
|
+
/** 部署到函数计算(阿里云 FC / 腾讯 SCF / 火山 veFaaS):SSE 进度 + 结果 */
|
|
312
|
+
deployFunctionStream(conversationId: string, input: FunctionDeployInput, opts?: {
|
|
313
|
+
signal?: AbortSignal;
|
|
314
|
+
}): AsyncIterable<FunctionDeployStreamEvent>;
|
|
268
315
|
};
|
|
269
316
|
/** 平台数据能力接入信息(技术方案 15):线上部署所需环境变量;apiKey 为服务端密钥 */
|
|
270
317
|
data: {
|
package/dist/client.js
CHANGED
|
@@ -98,6 +98,7 @@ export function createBuilderClient(options) {
|
|
|
98
98
|
pushGit: (id, input) => req(`/${id}/export/git`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(input) }),
|
|
99
99
|
pushGitStream: (id, input, o) => readNamedSse(`${restBase}/${id}/export/git/stream`, auth.apply({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'text/event-stream' }, body: JSON.stringify(input), signal: o?.signal }), doFetch),
|
|
100
100
|
deploy: (id, input) => req(`/${id}/export/deploy`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(input) }),
|
|
101
|
+
deployFunctionStream: (id, input, o) => readNamedSse(`${restBase}/${id}/export/deploy-function/stream`, auth.apply({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'text/event-stream' }, body: JSON.stringify(input), signal: o?.signal }), doFetch),
|
|
101
102
|
deployStream: (id, input, o) => readNamedSse(`${restBase}/${id}/export/deploy/stream`, auth.apply({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'text/event-stream' }, body: JSON.stringify(input), signal: o?.signal }), doFetch),
|
|
102
103
|
},
|
|
103
104
|
data: {
|