@cpzxrobot/sdk 1.3.123 → 1.3.125
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 +9 -8
- package/dist/aiform_gateway.js +7 -7
- package/package.json +1 -1
- package/types.d.ts +31 -2
package/aiform_gateway.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
AiformTemplateHistoryResponse,
|
|
10
10
|
AiformTemplatePublishResponse,
|
|
11
11
|
AiformReplyResponse,
|
|
12
|
+
AiformReplyDetailResponse,
|
|
12
13
|
AiformConfirmResponse,
|
|
13
14
|
AiformReplyListResponse,
|
|
14
15
|
} from ".";
|
|
@@ -246,11 +247,13 @@ export class AiformGateway extends Object {
|
|
|
246
247
|
},
|
|
247
248
|
|
|
248
249
|
/**
|
|
249
|
-
*
|
|
250
|
+
* 按 replyId 轮询结果
|
|
251
|
+
* GET /api/v2/aiform/file/detail/reply/{replyId}
|
|
250
252
|
* @param replyId reply记录ID
|
|
251
|
-
* @returns Promise
|
|
253
|
+
* @returns Promise 包含 replyId、status、result 和 accessUrl
|
|
254
|
+
* 注意:用于轮询 reply 的处理状态,status=1 处理中,status=2 成功,status=0 失败
|
|
252
255
|
*/
|
|
253
|
-
getReplyDetail: async (replyId: number): Promise<
|
|
256
|
+
getReplyDetail: async (replyId: number): Promise<AiformReplyDetailResponse> => {
|
|
254
257
|
const axios = await this.context.ready;
|
|
255
258
|
|
|
256
259
|
if (!replyId) {
|
|
@@ -267,9 +270,11 @@ export class AiformGateway extends Object {
|
|
|
267
270
|
|
|
268
271
|
/**
|
|
269
272
|
* 根据解析结果提交反馈(reply)
|
|
273
|
+
* POST /api/v2/aiform/file/reply
|
|
270
274
|
* @param code 文件业务编码
|
|
271
275
|
* @param reply 用户的修改意见/反馈内容
|
|
272
|
-
* @returns Promise
|
|
276
|
+
* @returns Promise 包含 replyId、status 和 accessUrl
|
|
277
|
+
* 注意:接口为异步,立即返回 replyId 与 status=1,需使用 getReplyDetail 按 replyId 轮询直至 status=2 或 0
|
|
273
278
|
*/
|
|
274
279
|
reply: async (code: string, reply: string): Promise<AiformReplyResponse> => {
|
|
275
280
|
const axios = await this.context.ready;
|
|
@@ -284,10 +289,6 @@ export class AiformGateway extends Object {
|
|
|
284
289
|
return axios.post(`/api/v2/aiform/file/reply`, {
|
|
285
290
|
code,
|
|
286
291
|
reply
|
|
287
|
-
}, {
|
|
288
|
-
headers: {
|
|
289
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
290
|
-
}
|
|
291
292
|
}).then((res) => {
|
|
292
293
|
if (res.data.code !== 200) {
|
|
293
294
|
throw new Error(res.data.message || '提交反馈失败');
|
package/dist/aiform_gateway.js
CHANGED
|
@@ -209,9 +209,11 @@ class AiformGateway extends Object {
|
|
|
209
209
|
});
|
|
210
210
|
}),
|
|
211
211
|
/**
|
|
212
|
-
*
|
|
212
|
+
* 按 replyId 轮询结果
|
|
213
|
+
* GET /api/v2/aiform/file/detail/reply/{replyId}
|
|
213
214
|
* @param replyId reply记录ID
|
|
214
|
-
* @returns Promise
|
|
215
|
+
* @returns Promise 包含 replyId、status、result 和 accessUrl
|
|
216
|
+
* 注意:用于轮询 reply 的处理状态,status=1 处理中,status=2 成功,status=0 失败
|
|
215
217
|
*/
|
|
216
218
|
getReplyDetail: (replyId) => __awaiter(this, void 0, void 0, function* () {
|
|
217
219
|
const axios = yield this.context.ready;
|
|
@@ -227,9 +229,11 @@ class AiformGateway extends Object {
|
|
|
227
229
|
}),
|
|
228
230
|
/**
|
|
229
231
|
* 根据解析结果提交反馈(reply)
|
|
232
|
+
* POST /api/v2/aiform/file/reply
|
|
230
233
|
* @param code 文件业务编码
|
|
231
234
|
* @param reply 用户的修改意见/反馈内容
|
|
232
|
-
* @returns Promise
|
|
235
|
+
* @returns Promise 包含 replyId、status 和 accessUrl
|
|
236
|
+
* 注意:接口为异步,立即返回 replyId 与 status=1,需使用 getReplyDetail 按 replyId 轮询直至 status=2 或 0
|
|
233
237
|
*/
|
|
234
238
|
reply: (code, reply) => __awaiter(this, void 0, void 0, function* () {
|
|
235
239
|
const axios = yield this.context.ready;
|
|
@@ -242,10 +246,6 @@ class AiformGateway extends Object {
|
|
|
242
246
|
return axios.post(`/api/v2/aiform/file/reply`, {
|
|
243
247
|
code,
|
|
244
248
|
reply
|
|
245
|
-
}, {
|
|
246
|
-
headers: {
|
|
247
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
|
248
|
-
}
|
|
249
249
|
}).then((res) => {
|
|
250
250
|
if (res.data.code !== 200) {
|
|
251
251
|
throw new Error(res.data.message || '提交反馈失败');
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -933,8 +933,36 @@ interface AiformReplyResponse {
|
|
|
933
933
|
code: number;
|
|
934
934
|
/** 提示信息 */
|
|
935
935
|
message: string;
|
|
936
|
-
/**
|
|
937
|
-
data:
|
|
936
|
+
/** 提交结果 */
|
|
937
|
+
data: {
|
|
938
|
+
/** 新建 aiform_reply.id,用于轮询 */
|
|
939
|
+
replyId: number;
|
|
940
|
+
/** 提交后恒为 1 */
|
|
941
|
+
status: number;
|
|
942
|
+
/** 原图预签名链接(便于前端展示) */
|
|
943
|
+
accessUrl: string;
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Reply轮询响应接口
|
|
949
|
+
*/
|
|
950
|
+
interface AiformReplyDetailResponse {
|
|
951
|
+
/** 响应码 */
|
|
952
|
+
code: number;
|
|
953
|
+
/** 提示信息 */
|
|
954
|
+
message: string;
|
|
955
|
+
/** 轮询结果 */
|
|
956
|
+
data: {
|
|
957
|
+
/** 本条 reply 主键 */
|
|
958
|
+
replyId: number;
|
|
959
|
+
/** 状态:1处理中,2成功,0失败 */
|
|
960
|
+
status: number;
|
|
961
|
+
/** 仅 status=2 且已落库时有值 */
|
|
962
|
+
result?: AiformParseResultVO;
|
|
963
|
+
/** 原图预签名链接 */
|
|
964
|
+
accessUrl: string;
|
|
965
|
+
};
|
|
938
966
|
}
|
|
939
967
|
|
|
940
968
|
/**
|
|
@@ -1235,6 +1263,7 @@ declare module "@cpzxrobot/sdk" {
|
|
|
1235
1263
|
AiformFileListResponse,
|
|
1236
1264
|
AiformFileDetailResponse,
|
|
1237
1265
|
AiformReplyResponse,
|
|
1266
|
+
AiformReplyDetailResponse,
|
|
1238
1267
|
AiformConfirmResponse,
|
|
1239
1268
|
AiformRecordReply,
|
|
1240
1269
|
AiformReplyListResponse,
|