@chatu-ai/builder-sdk 0.3.1 → 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 CHANGED
@@ -107,6 +107,29 @@ export interface DataUsage {
107
107
  rates?: Record<string, number>;
108
108
  error?: string;
109
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
+ }
110
133
  export interface BuilderClient {
111
134
  chat: {
112
135
  stream(conversationId: string, prompt: string, opts?: {
@@ -171,6 +194,8 @@ export interface BuilderClient {
171
194
  }): Promise<DeploySettingView>;
172
195
  /** 推送到用户 Git 仓库;沙箱未运行时 ok=false, error='SANDBOX_NOT_RUNNING' */
173
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>;
174
199
  };
175
200
  /** 平台数据能力接入信息(技术方案 15):线上部署所需环境变量;apiKey 为服务端密钥 */
176
201
  data: {
package/dist/client.js CHANGED
@@ -85,6 +85,7 @@ 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`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "ChatU Builder client SDK core: REST + streaming client, zod event schemas, seq resume",
5
5
  "license": "MIT",
6
6
  "type": "module",