UNPKG

@glodon-aiot/apis

Version:

aiot apis

489 lines (488 loc) 14.8 kB
var V = Object.defineProperty, I = Object.defineProperties; var b = Object.getOwnPropertyDescriptors; var S = Object.getOwnPropertySymbols; var D = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable; var v = (i, s, t) => s in i ? V(i, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[s] = t, y = (i, s) => { for (var t in s || (s = {})) D.call(s, t) && v(i, t, s[t]); if (S) for (var t of S(s)) k.call(s, t) && v(i, t, s[t]); return i; }, g = (i, s) => I(i, b(s)); var a = (i, s, t) => new Promise((e, r) => { var c = (l) => { try { d(t.next(l)); } catch (h) { r(h); } }, m = (l) => { try { d(t.throw(l)); } catch (h) { r(h); } }, d = (l) => l.done ? e(l.value) : Promise.resolve(l.value).then(c, m); d((t = t.apply(i, s)).next()); }); import L from "axios"; import { UploadZipsStatus as o } from "./model.mjs"; import { GenerateStatus as A, IDatasetLevel as O, PreLabelTaskStatus as z, SubsectionStatus as N } from "./model.mjs"; import { BaseApi as T } from "../base/index.mjs"; import { getUuid as f } from "../utils/index.mjs"; class M extends T { constructor(s, t) { super(s != null ? s : L.create(), t); } getDatasets(s) { return a(this, null, function* () { return this.get("/datasets", s); }); } postDatasets(s) { return a(this, null, function* () { return this.post("/datasets", s); }); } getDatasetsId(s) { return a(this, null, function* () { return this.get(`/datasets/${s}`); }); } delDatasetsId(s) { return a(this, null, function* () { return this.delete(`/datasets/${s}`); }); } patchDatasetsId(s, t) { return a(this, null, function* () { return this.patch(`/datasets/${s}`, t); }); } getDatasetsIdVersions(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions?pageNo=${t}&pageSize=${e}`); }); } getDatasetsIdVersionsVidNextno(s) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/nextno`); }); } getS3Iam(s, t) { return a(this, null, function* () { return this.post("/s3/iam", { datasetId: s, publicBucket: t }); }); } postDatasetsIdVersions(s, t) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions`, t); }); } patchDatasetsIdVersionsVid(s, t, e) { return a(this, null, function* () { return this.patch(`/datasets/${s}/versions/${t}`, e); }); } getDatasetsIdVersionsVid(s, t) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}`); }); } delDatasetsIdVersionsVid(s, t) { return a(this, null, function* () { return this.delete(`/datasets/${s}/versions/${t}`); }); } getDatasetsIdVersionsNo(s, t) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/no`, t); }); } listDatasetsIdLabels(s, t) { return a(this, null, function* () { return this.listPaged(`/datasets/${s}/labels`, t); }); } getDatasetsIdVersionsVidLabelcount(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/labelcount`, e); }); } getDatasetsIdVersionsVidSamples(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/samples`, e); }); } updateSamples(s, t, e, r) { return a(this, null, function* () { return this.patch(`/datasets/${s}/versions/${t}/samples`, { samples: e, confirmStatus: r }); }); } delDatasetsIdVersionsVidSamplesId(s, t, e) { return a(this, null, function* () { return this.delete(`/datasets/${s}/versions/${t}/samples/${e}`); }); } delDatasetsIdVersionsVidSamples(s, t, e) { return a(this, null, function* () { return this.delete(`/datasets/${s}/versions/${t}/samples`, { sampleIds: e }); }); } delDatasetsIdVersionsVidLlmSamplesId(s, t, e) { return a(this, null, function* () { return this.delete(`datasets/${s}/versions/${t}/llmSamples/${e}`); }); } getDatasetsIdVersionsVidSsamplesSid(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/samples/${e}`).then((r) => g(y({}, r), { labels: r.labels ? r.labels.map((c) => g(y({}, c), { uuid: c.uuid || f() })) : [] })); }); } getImportInfo() { return a(this, null, function* () { return this.get("/importInfo"); }); } getOptionsMarkType() { return a(this, null, function* () { return this.get("/options/markType"); }); } getOptionsOcrMarkTmpl() { return a(this, null, function* () { return this.get("/options/ocrMarkTmpl"); }); } getOptionsLlmMarkTmpl() { return a(this, null, function* () { return this.get("/options/llmMarkTmpl"); }); } getOptionsLlmResponseSort() { return a(this, null, function* () { return this.get("/options/llmResponseSort"); }); } getOptionsImgproxy() { return a(this, null, function* () { return this.get("/options/imgproxy"); }); } getDeduplication(s, t) { return a(this, null, function* () { return this.post("/files/deduplication", { md5s: s, datasetId: t }); }); } postDatasetsIdVersionsVidSamples(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/samples`, e); }); } patchDatasetsIdVersionsVidSamples(s, t, e) { return a(this, null, function* () { return this.patch(`/datasets/${s}/versions/${t}/samples`, e); }); } listCategory(s) { return a(this, null, function* () { return this.list(`/datasets/${s}/catagory`); }); } postCategory(s, t) { return a(this, null, function* () { return this.post(`/datasets/${s}/catagory`, { name: t }); }); } updateCategory(s, t, e) { return a(this, null, function* () { return this.patch(`/datasets/${s}/catagory/${t}`, { name: e }); }); } deleteCategory(s, t) { return a(this, null, function* () { return this.delete(`/datasets/${s}/catagory/${t}`); }); } postDatasetIdVersionIdFilesDeduplication(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/files/deduplication`, e); }); } postDatasetIdVersionIdLlmSamples(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/llmSamples`, e); }); } patchDatasetIdVersionIdLlmSampleId(s, t, e, r) { return a(this, null, function* () { return this.patch(`/datasets/${s}/versions/${t}/llmSamples/${e}`, r); }); } postLlmSamplesSubsection(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/llmSamples/subsection`, e); }); } generatellmSamplesSubsection(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/llmSamples/subsection`, e); }); } listSubsection(s, t, e, r) { return a(this, null, function* () { return this.listPaged(`/datasets/${s}/versions/${t}/llmSamples/${e}/subsection`, r); }); } postSubsection(s, t, e, r) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/llmSamples/${e}/subsection`, r); }); } updateSubsection(s, t, e, r, c) { return a(this, null, function* () { return this.patch(`/datasets/${s}/versions/${t}/llmSamples/${e}/subsection/${r}`, c); }); } deleteSubsection(s, t, e, r) { return a(this, null, function* () { return this.delete(`/datasets/${s}/versions/${t}/llmSamples/${e}/subsection/${r}`); }); } llmSupervisedRecordGenerate(s) { return a(this, null, function* () { return this.post("/llm/supervisedRecord/generatedata", s); }); } llmSupervisedRecordAbordTask(s) { return a(this, null, function* () { return this.post("/llm/supervisedRecord/abortTask", s); }); } llmSupervisedRecordPauseTask(s) { return a(this, null, function* () { return this.post("/llm/supervisedRecord/pauseTask", s); }); } getLlmSupervisedRecord(s) { return a(this, null, function* () { return this.get(`/llm/supervisedRecord/${s}`); }); } getDatasetsIdVersionsIdLlmSamplesV2(s, t, e) { return a(this, null, function* () { return this.listPaged(`/datasets/${s}/versions/${t}/llmSamplesV2`, e); }); } postDatasetsIdVersionsIdLlmSamplesV2(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/llmSamplesV2`, e); }); } getDatasetsIdVersionsIdLlmSamplesV2Sid(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/llmSamplesV2/${e}`); }); } patchDatasetsIdVersionsIdLlmSamplesV2Sid(s, t, e, r) { return a(this, null, function* () { return this.patch(`/datasets/${s}/versions/${t}/llmSamplesV2/${e}`, r); }); } delDatasetsIdVersionsIdLlmSamplesV2Sid(s, t, e) { return a(this, null, function* () { return this.delete(`/datasets/${s}/versions/${t}/llmSamplesV2/${e}`); }); } getDatasetsIdVersionsIdExportLLMSamples(s, t) { return a(this, null, function* () { return this.getNonStandard(`/datasets/${s}/versions/${t}/exportLLMSamples`, { responseType: "blob" }); }); } llmSamplesSubsectionView(s, t, e, r) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/llmSamples/${e}/previewSubsection`, r); }); } listLabels(s, t) { return a(this, null, function* () { return this.listPaged(`/datasets/${s}/labels`, t); }); } postLabels(s, t) { return a(this, null, function* () { return this.post(`/datasets/${s}/labels`, t); }); } patchLabel(s, t, e) { return a(this, null, function* () { return this.patch(`/datasets/${s}/labels/${t}`, e); }); } deleteLabel(s, t) { return a(this, null, function* () { return this.delete(`/datasets/${s}/labels/${t}`); }); } postUploadPicsZip(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/uploadzip`, e); }); } postVlmUploadPicsZip(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/vlmuploadzip`, e); }); } checkFileResult(s, t, e, r = 1e3, c, m) { return a(this, null, function* () { return new Promise((d, l) => { const h = () => { s ? c === "vlm" ? this.getUploadVlmPicsZipResult(s, t, e).then(($) => { const n = $[0]; if (n.state === o.Started || n.state === o.Pending) { const p = n.process || 0; m && m(p); } if (n.state === o.Success && (clearInterval(u), d(n.lastTaskResult)), n.state === o.Failure) { clearInterval(u); const p = "该文件处理失败"; l(Error(p, { cause: { code: -101, message: p, data: n.lastTaskResult } })); } n.state === o.Abort && (clearInterval(u), d(n.lastTaskResult)); }).catch(($) => { clearInterval(u), l($); }) : this.getUploadPicsZipResult(s, t, e).then(($) => { const n = $[0]; if (n.state === o.Started || n.state === o.Pending) { const p = n.process || 0; m && m(p); } if (n.state === o.Success && (clearInterval(u), d(n.lastTaskResult)), n.state === o.Failure) { clearInterval(u); const p = "该文件处理失败"; l(Error(p, { cause: { code: -101, message: p, data: n.lastTaskResult } })); } n.state === o.Abort && (clearInterval(u), d(n.lastTaskResult)); }).catch(($) => { clearInterval(u), l($); }) : d(null); }, u = setInterval(h, r); h(); }); }); } getUploadPicsZipResult(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/uploadzip`, e); }); } getUploadVlmPicsZipResult(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/vlmuploadzip`, e); }); } getUploadabort(s, t, e) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/uploadabort`, e); }); } postPreLabelTask(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/prelabeltask`, e); }); } getPreLabelTask(s, t) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/prelabeltask`); }); } delPreLabelTask(s, t, e) { return a(this, null, function* () { return this.delete(`/datasets/${s}/versions/${t}/prelabeltask/${e}`); }); } // 物体检测预标注一键保存 getAllConfirmSamples(s, t) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/confirm`); }); } getDataSetCopyTask(s, t) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/copyDataset`); }); } postDataSetCopyTask(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/copyDataset`, e); }); } deleteDatasetCopyTask(s, t, e) { return a(this, null, function* () { return this.delete(`/datasets/${s}/versions/${t}/copyDataset`, e); }); } getDatasetsIdVersionsVidConfigs(s, t) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/labels`); }); } saveVisionLabelConfigs(s, t, e) { return a(this, null, function* () { return this.patch(`/datasets/${s}/versions/${t}/labels`, e); }); } postGenerateVlmKieQa(s, t, e) { return a(this, null, function* () { return this.post(`/datasets/${s}/versions/${t}/samples/generator/vlm_kie_qa`, e); }); } getDefaultQaTemplates(s, t) { return a(this, null, function* () { return this.get(`/datasets/${s}/versions/${t}/defaultQaTemplates`); }); } } export { M as CVForceDatahubApi, A as GenerateStatus, O as IDatasetLevel, z as PreLabelTaskStatus, N as SubsectionStatus, o as UploadZipsStatus };