@chatu-ai/builder-sdk 0.3.0 → 0.4.0
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 +40 -0
- package/dist/client.js +2 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -94,6 +94,42 @@ export interface GitPushResult {
|
|
|
94
94
|
webUrl?: string;
|
|
95
95
|
credentialId?: string | null;
|
|
96
96
|
}
|
|
97
|
+
export interface DataUsageEnv {
|
|
98
|
+
raw: Record<string, number>;
|
|
99
|
+
points: number;
|
|
100
|
+
}
|
|
101
|
+
export interface DataUsage {
|
|
102
|
+
ok: boolean;
|
|
103
|
+
month?: string;
|
|
104
|
+
readOnly?: boolean;
|
|
105
|
+
dev?: DataUsageEnv;
|
|
106
|
+
prod?: DataUsageEnv;
|
|
107
|
+
rates?: Record<string, number>;
|
|
108
|
+
error?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface DeployInput {
|
|
111
|
+
provider: 'edgeone';
|
|
112
|
+
projectName: string;
|
|
113
|
+
credentialId?: string;
|
|
114
|
+
token?: string;
|
|
115
|
+
save?: boolean;
|
|
116
|
+
label?: string;
|
|
117
|
+
env?: 'production' | 'preview';
|
|
118
|
+
includeAppEnv?: boolean;
|
|
119
|
+
includeDataAccess?: boolean;
|
|
120
|
+
}
|
|
121
|
+
export interface DeployResult {
|
|
122
|
+
ok: boolean;
|
|
123
|
+
error?: string;
|
|
124
|
+
state?: string;
|
|
125
|
+
projectName?: string;
|
|
126
|
+
env?: string;
|
|
127
|
+
url?: string;
|
|
128
|
+
output?: string;
|
|
129
|
+
envVarsApplied?: number;
|
|
130
|
+
envVarsFailed?: string[];
|
|
131
|
+
credentialId?: string | null;
|
|
132
|
+
}
|
|
97
133
|
export interface BuilderClient {
|
|
98
134
|
chat: {
|
|
99
135
|
stream(conversationId: string, prompt: string, opts?: {
|
|
@@ -158,6 +194,8 @@ export interface BuilderClient {
|
|
|
158
194
|
}): Promise<DeploySettingView>;
|
|
159
195
|
/** 推送到用户 Git 仓库;沙箱未运行时 ok=false, error='SANDBOX_NOT_RUNNING' */
|
|
160
196
|
pushGit(conversationId: string, input: GitPushInput): Promise<GitPushResult>;
|
|
197
|
+
/** 一键部署(P1:EdgeOne Pages);沙箱未运行时 ok=false, error='SANDBOX_NOT_RUNNING' */
|
|
198
|
+
deploy(conversationId: string, input: DeployInput): Promise<DeployResult>;
|
|
161
199
|
};
|
|
162
200
|
/** 平台数据能力接入信息(技术方案 15):线上部署所需环境变量;apiKey 为服务端密钥 */
|
|
163
201
|
data: {
|
|
@@ -167,6 +205,8 @@ export interface BuilderClient {
|
|
|
167
205
|
envs: string[];
|
|
168
206
|
envVars: Record<string, string | null>;
|
|
169
207
|
}>;
|
|
208
|
+
/** 本月用量:dev/prod 原始计量与折算点数估算、只读状态、单价 */
|
|
209
|
+
usage(conversationId: string): Promise<DataUsage>;
|
|
170
210
|
};
|
|
171
211
|
export: {
|
|
172
212
|
/**
|
package/dist/client.js
CHANGED
|
@@ -85,9 +85,11 @@ export function createBuilderClient(options) {
|
|
|
85
85
|
settings: id => req(`/${id}/deploy-settings`),
|
|
86
86
|
saveSetting: (id, input) => req(`/${id}/deploy-settings`, { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(input) }),
|
|
87
87
|
pushGit: (id, input) => req(`/${id}/export/git`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(input) }),
|
|
88
|
+
deploy: (id, input) => req(`/${id}/export/deploy`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(input) }),
|
|
88
89
|
},
|
|
89
90
|
data: {
|
|
90
91
|
access: id => req(`/${id}/data-access`),
|
|
92
|
+
usage: id => req(`/${id}/data-usage`),
|
|
91
93
|
},
|
|
92
94
|
export: {
|
|
93
95
|
zip: async (id) => {
|