@cpzxrobot/sdk 1.3.119 → 1.3.120

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/aiform_gateway.ts CHANGED
@@ -67,6 +67,35 @@ export class AiformGateway extends Object {
67
67
  return res.data;
68
68
  });
69
69
  },
70
+
71
+ /**
72
+ * 上传表格图片提炼模板提示词
73
+ * POST /api/v2/aiform/template/upload
74
+ * @param templateId 模板ID
75
+ * @param file 图片文件
76
+ */
77
+ uploadTemplateImage: async (templateId: number, file: File): Promise<any> => {
78
+ const axios = await this.context.ready;
79
+
80
+ if (!templateId) {
81
+ throw new Error('模板ID不能为空');
82
+ }
83
+
84
+ const formData = new FormData();
85
+ formData.append('file', file);
86
+ formData.append('templateId', String(templateId));
87
+
88
+ return axios.post('/api/v2/aiform/template/upload', formData, {
89
+ headers: {
90
+ 'Content-Type': 'multipart/form-data'
91
+ }
92
+ }).then((res) => {
93
+ if (res.data.code !== 200) {
94
+ throw new Error(res.data.message || '上传图片失败');
95
+ }
96
+ return res.data;
97
+ });
98
+ },
70
99
  };
71
100
  }
72
101
 
@@ -61,6 +61,31 @@ class AiformGateway extends Object {
61
61
  return res.data;
62
62
  });
63
63
  }),
64
+ /**
65
+ * 上传表格图片提炼模板提示词
66
+ * POST /api/v2/aiform/template/upload
67
+ * @param templateId 模板ID
68
+ * @param file 图片文件
69
+ */
70
+ uploadTemplateImage: (templateId, file) => __awaiter(this, void 0, void 0, function* () {
71
+ const axios = yield this.context.ready;
72
+ if (!templateId) {
73
+ throw new Error('模板ID不能为空');
74
+ }
75
+ const formData = new FormData();
76
+ formData.append('file', file);
77
+ formData.append('templateId', String(templateId));
78
+ return axios.post('/api/v2/aiform/template/upload', formData, {
79
+ headers: {
80
+ 'Content-Type': 'multipart/form-data'
81
+ }
82
+ }).then((res) => {
83
+ if (res.data.code !== 200) {
84
+ throw new Error(res.data.message || '上传图片失败');
85
+ }
86
+ return res.data;
87
+ });
88
+ }),
64
89
  };
65
90
  }
66
91
  get record() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.119",
3
+ "version": "1.3.120",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/types.d.ts CHANGED
@@ -817,6 +817,8 @@ interface AiformTemplate {
817
817
  name: string;
818
818
  /** 模板内容 */
819
819
  content: string;
820
+ /** 是否包含水印 */
821
+ watermark?: boolean;
820
822
  /** 注意事项 */
821
823
  attention?: string;
822
824
  }
@@ -845,6 +847,8 @@ interface AiformTemplateSaveRequest {
845
847
  name: string;
846
848
  /** 模板内容 */
847
849
  content: string;
850
+ /** 是否包含水印 */
851
+ watermark?: boolean;
848
852
  /** 注意事项 */
849
853
  attention?: string;
850
854
  }