@chatu-ai/builder-sdk 0.7.7 → 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 +45 -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;
|
|
@@ -267,6 +308,10 @@ export interface BuilderClient {
|
|
|
267
308
|
deployStream(conversationId: string, input: DeployInput, opts?: {
|
|
268
309
|
signal?: AbortSignal;
|
|
269
310
|
}): AsyncIterable<DeployStreamEvent>;
|
|
311
|
+
/** 部署到函数计算(阿里云 FC / 腾讯 SCF / 火山 veFaaS):SSE 进度 + 结果 */
|
|
312
|
+
deployFunctionStream(conversationId: string, input: FunctionDeployInput, opts?: {
|
|
313
|
+
signal?: AbortSignal;
|
|
314
|
+
}): AsyncIterable<FunctionDeployStreamEvent>;
|
|
270
315
|
};
|
|
271
316
|
/** 平台数据能力接入信息(技术方案 15):线上部署所需环境变量;apiKey 为服务端密钥 */
|
|
272
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: {
|