@gaiot/apis
Version:
aiot apis
436 lines (435 loc) • 13 kB
JavaScript
var v = Object.defineProperty, I = Object.defineProperties;
var V = Object.getOwnPropertyDescriptors;
var g = Object.getOwnPropertySymbols;
var b = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
var S = (n, s, t) => s in n ? v(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t, h = (n, s) => {
for (var t in s || (s = {}))
b.call(s, t) && S(n, t, s[t]);
if (g)
for (var t of g(s))
D.call(s, t) && S(n, t, s[t]);
return n;
}, y = (n, s) => I(n, V(s));
var a = (n, s, t) => new Promise((e, r) => {
var l = (i) => {
try {
p(t.next(i));
} catch (d) {
r(d);
}
}, c = (i) => {
try {
p(t.throw(i));
} catch (d) {
r(d);
}
}, p = (i) => i.done ? e(i.value) : Promise.resolve(i.value).then(l, c);
p((t = t.apply(n, s)).next());
});
import L from "axios";
import { UploadZipsStatus as u } from "./model.mjs";
import { GenerateStatus as w, IDatasetLevel as z, PreLabelTaskStatus as E, SubsectionStatus as G } from "./model.mjs";
import { BaseApi as k } from "../base/index.mjs";
import "../node_modules/@gaiot/minio/dist/minio-zj.mjs";
import "dayjs";
import "../agentcliui/index.mjs";
import "../aecpilotui/index.mjs";
import { getUuid as T } from "../utils/index.mjs";
class F extends k {
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}`);
});
}
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) => y(h({}, r), {
labels: r.labels ? r.labels.map((l) => y(h({}, l), {
uuid: l.uuid || T()
})) : []
}));
});
}
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, l) {
return a(this, null, function* () {
return this.patch(`/datasets/${s}/versions/${t}/llmSamples/${e}/subsection/${r}`, l);
});
}
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);
});
}
checkFileResult(s, t, e, r = 1e3, l) {
return a(this, null, function* () {
return new Promise((c, p) => {
const i = () => {
s ? this.getUploadPicsZipResult(s, t, e).then((m) => {
const o = m[0];
if (o.state === u.Started || o.state === u.Pending) {
const $ = o.process || 0;
l && l($);
}
if (o.state === u.Success && (clearInterval(d), c(o.lastTaskResult)), o.state === u.Failure) {
clearInterval(d);
const $ = "该文件处理失败";
p(Error($, {
cause: {
code: -101,
message: $,
data: o.lastTaskResult
}
}));
}
o.state === u.Abort && (clearInterval(d), c(o.lastTaskResult));
}).catch((m) => {
clearInterval(d), p(m);
}) : c(null);
}, d = setInterval(i, r);
i();
});
});
}
getUploadPicsZipResult(s, t, e) {
return a(this, null, function* () {
return this.get(`/datasets/${s}/versions/${t}/uploadzip`, 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);
});
}
}
export {
F as CVForceDatahubApi,
w as GenerateStatus,
z as IDatasetLevel,
E as PreLabelTaskStatus,
G as SubsectionStatus,
u as UploadZipsStatus
};