@glodon-aiot/dataset-annotation 3.19.0-alpha.19 → 3.19.0-alpha.21

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.
@@ -1,127 +1,146 @@
1
- var U = Object.defineProperty, _ = Object.defineProperties;
2
- var x = Object.getOwnPropertyDescriptors;
3
- var f = Object.getOwnPropertySymbols;
4
- var E = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
5
- var v = (e, r, o) => r in e ? U(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, s = (e, r) => {
1
+ var F = Object.defineProperty, H = Object.defineProperties;
2
+ var B = Object.getOwnPropertyDescriptors;
3
+ var d = Object.getOwnPropertySymbols;
4
+ var A = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
5
+ var h = (e, r, o) => r in e ? F(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, l = (e, r) => {
6
6
  for (var o in r || (r = {}))
7
- E.call(r, o) && v(e, o, r[o]);
8
- if (f)
9
- for (var o of f(r))
10
- T.call(r, o) && v(e, o, r[o]);
7
+ A.call(r, o) && h(e, o, r[o]);
8
+ if (d)
9
+ for (var o of d(r))
10
+ S.call(r, o) && h(e, o, r[o]);
11
11
  return e;
12
- }, k = (e, r) => _(e, x(r));
13
- var D = (e, r) => {
12
+ }, M = (e, r) => H(e, B(r));
13
+ var b = (e, r) => {
14
14
  var o = {};
15
15
  for (var t in e)
16
- E.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
17
- if (e != null && f)
18
- for (var t of f(e))
19
- r.indexOf(t) < 0 && T.call(e, t) && (o[t] = e[t]);
16
+ A.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
17
+ if (e != null && d)
18
+ for (var t of d(e))
19
+ r.indexOf(t) < 0 && S.call(e, t) && (o[t] = e[t]);
20
20
  return o;
21
21
  };
22
- import { defaultApiUrl as y } from "../constant.mjs";
23
- import { CVForceDatahubApi as F, ModelServiceApi as H } from "@glodon-aiot/apis";
24
- import { isExpired as B } from "../utils/index.mjs";
25
- import { notification as g } from "antd";
26
- import L from "axios";
27
- import $ from "lodash/merge";
28
- import { VIEW_MODE_FEATURES as V, LABEL_MODE_FEATURES as z, MANAGE_MODE_FEATURES as G } from "../featuresConfig.mjs";
29
- import N from "../createDetectionDatasetAnnotation/index.mjs";
30
- import W from "../createOcrDatasetAnnotation/index.mjs";
31
- function j(e) {
22
+ var w = (e, r, o) => new Promise((t, a) => {
23
+ var T = (s) => {
24
+ try {
25
+ m(o.next(s));
26
+ } catch (u) {
27
+ a(u);
28
+ }
29
+ }, v = (s) => {
30
+ try {
31
+ m(o.throw(s));
32
+ } catch (u) {
33
+ a(u);
34
+ }
35
+ }, m = (s) => s.done ? t(s.value) : Promise.resolve(s.value).then(T, v);
36
+ m((o = o.apply(e, r)).next());
37
+ });
38
+ import { defaultApiUrl as L } from "../constant.mjs";
39
+ import { CVForceDatahubApi as $, ModelServiceApi as V } from "@glodon-aiot/apis";
40
+ import { isExpired as z, createTokenResolver as G } from "../utils/index.mjs";
41
+ import { notification as I } from "antd";
42
+ import N from "axios";
43
+ import W from "lodash/merge";
44
+ import { VIEW_MODE_FEATURES as j, LABEL_MODE_FEATURES as J, MANAGE_MODE_FEATURES as K } from "../featuresConfig.mjs";
45
+ import P from "../createDetectionDatasetAnnotation/index.mjs";
46
+ import Q from "../createOcrDatasetAnnotation/index.mjs";
47
+ function X(e) {
32
48
  switch (e) {
33
49
  case "manage":
34
- return s({}, G);
50
+ return l({}, K);
35
51
  case "label":
36
- return s({}, z);
52
+ return l({}, J);
37
53
  case "view":
38
- return s({}, V);
54
+ return l({}, j);
39
55
  default:
40
56
  return null;
41
57
  }
42
58
  }
43
- const ae = (e) => {
44
- const u = e, {
59
+ const fe = (e) => {
60
+ const k = e, {
45
61
  getContainer: r = () => document.createElement("div"),
46
62
  token: o,
47
- errorHandlers: t,
48
- apiUrl: h = y,
49
- datasetId: A,
50
- versionId: J,
51
- mode: S = "label"
52
- } = u, M = D(u, [
63
+ getToken: t,
64
+ errorHandlers: a,
65
+ apiUrl: T = L,
66
+ datasetId: v,
67
+ versionId: m,
68
+ mode: s = "label"
69
+ } = k, u = b(k, [
53
70
  "getContainer",
54
71
  "token",
72
+ "getToken",
55
73
  "errorHandlers",
56
74
  "apiUrl",
57
75
  "datasetId",
58
76
  "versionId",
59
77
  "mode"
60
- ]), b = s({}, j(S));
61
- $(b, M), r(), (() => {
62
- const c = h, I = (n) => {
78
+ ]), C = l({}, X(s));
79
+ W(C, u), r(), (() => {
80
+ const p = T, R = G(o, t), y = (n) => w(void 0, null, function* () {
63
81
  var i;
64
- if (!o)
82
+ const c = yield R();
83
+ if (!c)
65
84
  return n;
66
- if (B(o)) {
67
- const a = "aiotToken is timeout";
68
- t.aiotToken ? typeof t.aiotToken == "function" ? t.aiotToken(
85
+ if (z(c)) {
86
+ const f = "aiotToken is timeout";
87
+ a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
69
88
  // @ts-ignore
70
- new Error(a, {
89
+ new Error(f, {
71
90
  cause: {
72
91
  status: 401,
73
- message: a
92
+ message: f
74
93
  }
75
94
  })
76
- ) : console.error("errorHandlers.aiotToken is not a function") : console.error(a);
95
+ ) : console.error("errorHandlers.aiotToken is not a function") : console.error(f);
77
96
  }
78
- return n.headers = (i = n.headers) != null ? i : {}, n.headers = k(s({}, n.headers), {
79
- Authorization: o ? `Bearer ${o}` : ""
97
+ return n.headers = (i = n.headers) != null ? i : {}, n.headers = M(l({}, n.headers), {
98
+ Authorization: c ? `Bearer ${c}` : ""
80
99
  }), n;
81
- };
82
- function l(n, i = !0) {
83
- const a = `${c}${n}`, d = L.create({
84
- baseURL: a
100
+ });
101
+ function E(n, c = !0) {
102
+ const i = `${p}${n}`, f = N.create({
103
+ baseURL: i
85
104
  });
86
- return i && d.interceptors.request.use(I), d;
105
+ return c && f.interceptors.request.use(y), f;
87
106
  }
88
- const m = (n, i) => {
89
- n !== 10001 && n !== 10215 && (g.config({
107
+ const g = (n, c) => {
108
+ n !== 10001 && n !== 10215 && (I.config({
90
109
  getContainer: r
91
- }), g.error({
92
- message: i
110
+ }), I.error({
111
+ message: c
93
112
  }));
94
- }, p = (n, i) => {
113
+ }, D = (n, c) => {
95
114
  if (n === 401) {
96
- const a = "aiotToken is invalid";
97
- t.aiotToken ? typeof t.aiotToken == "function" ? t.aiotToken(
115
+ const i = "aiotToken is invalid";
116
+ a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
98
117
  // @ts-ignore
99
- new Error(a, {
118
+ new Error(i, {
100
119
  cause: {
101
120
  status: 401,
102
- message: a
121
+ message: i
103
122
  }
104
123
  })
105
- ) : console.error("errorHandlers.aiotToken is not a function") : console.error(a);
124
+ ) : console.error("errorHandlers.aiotToken is not a function") : console.error(i);
106
125
  }
107
- }, w = l("/datahub/v1"), C = new F(w, {
108
- onHttpStatusError: p,
109
- onAppStatusError: m
110
- }), O = l("/mlopsdeploy/v1"), R = new H(O, {
111
- onHttpStatusError: p,
112
- onAppStatusError: m
126
+ }, O = E("/datahub/v1"), U = new $(O, {
127
+ onHttpStatusError: D,
128
+ onAppStatusError: g
129
+ }), _ = E("/mlopsdeploy/v1"), x = new V(_, {
130
+ onHttpStatusError: D,
131
+ onAppStatusError: g
113
132
  });
114
133
  return {
115
- cvforceDatahub: C,
116
- cvforceModelService: R
134
+ cvforceDatahub: U,
135
+ cvforceModelService: x
117
136
  };
118
- })().cvforceDatahub.getDatasetsId(A).then((c) => {
119
- switch (c.markType) {
137
+ })().cvforceDatahub.getDatasetsId(v).then((p) => {
138
+ switch (p.markType) {
120
139
  case "detection":
121
- N(e);
140
+ P(e);
122
141
  return;
123
142
  case "ocr":
124
- c.ocrMarkTmpl === "DetectionOCR" ? W(e) : console.error("ocr类型下只支持DetectionOCR类型,请检查数据集ocrMarkTmpl类型。");
143
+ p.ocrMarkTmpl === "DetectionOCR" ? Q(e) : console.error("ocr类型下只支持DetectionOCR类型,请检查数据集ocrMarkTmpl类型。");
125
144
  return;
126
145
  default:
127
146
  console.error("只支持detection、ocr两种类型,请检查数据集markType类型。");
@@ -129,5 +148,5 @@ const ae = (e) => {
129
148
  });
130
149
  };
131
150
  export {
132
- ae as default
151
+ fe as default
133
152
  };
@@ -1,133 +1,152 @@
1
- var y = Object.defineProperty, B = Object.defineProperties;
2
- var L = Object.getOwnPropertyDescriptors;
3
- var c = Object.getOwnPropertySymbols;
4
- var v = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
- var E = (e, t, o) => t in e ? y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, s = (e, t) => {
1
+ var $ = Object.defineProperty, V = Object.defineProperties;
2
+ var j = Object.getOwnPropertyDescriptors;
3
+ var p = Object.getOwnPropertySymbols;
4
+ var S = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
5
+ var h = (e, t, o) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, f = (e, t) => {
6
6
  for (var o in t || (t = {}))
7
- v.call(t, o) && E(e, o, t[o]);
8
- if (c)
9
- for (var o of c(t))
10
- A.call(t, o) && E(e, o, t[o]);
7
+ S.call(t, o) && h(e, o, t[o]);
8
+ if (p)
9
+ for (var o of p(t))
10
+ D.call(t, o) && h(e, o, t[o]);
11
11
  return e;
12
- }, g = (e, t) => B(e, L(t));
13
- var h = (e, t) => {
12
+ }, I = (e, t) => V(e, j(t));
13
+ var w = (e, t) => {
14
14
  var o = {};
15
15
  for (var r in e)
16
- v.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
17
- if (e != null && c)
18
- for (var r of c(e))
19
- t.indexOf(r) < 0 && A.call(e, r) && (o[r] = e[r]);
16
+ S.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
17
+ if (e != null && p)
18
+ for (var r of p(e))
19
+ t.indexOf(r) < 0 && D.call(e, r) && (o[r] = e[r]);
20
20
  return o;
21
21
  };
22
- import { jsx as $ } from "react/jsx-runtime";
23
- import V from "react-dom";
24
- import { defaultApiUrl as j } from "../constant.mjs";
25
- import z from "../components/DetectionAnnotation/index.mjs";
26
- import { CVForceDatahubApi as G, ModelServiceApi as N, AIShopApi as W } from "@glodon-aiot/apis";
27
- import { isExpired as J } from "../utils/index.mjs";
28
- import { notification as S } from "antd";
29
- import K from "axios";
30
- import P from "lodash/merge";
31
- import { VIEW_MODE_FEATURES as Q, LABEL_MODE_FEATURES as X, MANAGE_MODE_FEATURES as Y } from "../featuresConfig.mjs";
32
- function Z(e) {
22
+ var M = (e, t, o) => new Promise((r, a) => {
23
+ var d = (i) => {
24
+ try {
25
+ l(o.next(i));
26
+ } catch (m) {
27
+ a(m);
28
+ }
29
+ }, v = (i) => {
30
+ try {
31
+ l(o.throw(i));
32
+ } catch (m) {
33
+ a(m);
34
+ }
35
+ }, l = (i) => i.done ? r(i.value) : Promise.resolve(i.value).then(d, v);
36
+ l((o = o.apply(e, t)).next());
37
+ });
38
+ import { jsx as z } from "react/jsx-runtime";
39
+ import G from "react-dom";
40
+ import { defaultApiUrl as N } from "../constant.mjs";
41
+ import W from "../components/DetectionAnnotation/index.mjs";
42
+ import { CVForceDatahubApi as J, ModelServiceApi as K, AIShopApi as P } from "@glodon-aiot/apis";
43
+ import { isExpired as Q, createTokenResolver as X } from "../utils/index.mjs";
44
+ import { notification as b } from "antd";
45
+ import Y from "axios";
46
+ import Z from "lodash/merge";
47
+ import { VIEW_MODE_FEATURES as q, LABEL_MODE_FEATURES as ee, MANAGE_MODE_FEATURES as oe } from "../featuresConfig.mjs";
48
+ function te(e) {
33
49
  switch (e) {
34
50
  case "manage":
35
- return s({}, Y);
51
+ return f({}, oe);
36
52
  case "label":
37
- return s({}, X);
53
+ return f({}, ee);
38
54
  case "view":
39
- return s({}, Q);
55
+ return f({}, q);
40
56
  default:
41
57
  return null;
42
58
  }
43
59
  }
44
- const le = (e) => {
45
- const p = e, {
60
+ const ve = (e) => {
61
+ const A = e, {
46
62
  getContainer: t = () => document.createElement("div"),
47
63
  token: o,
48
- errorHandlers: r,
49
- apiUrl: T = j,
50
- datasetId: k,
51
- versionId: D,
52
- mode: I = "label"
53
- } = p, M = h(p, [
64
+ getToken: r,
65
+ errorHandlers: a,
66
+ apiUrl: d = N,
67
+ datasetId: v,
68
+ versionId: l,
69
+ mode: i = "label"
70
+ } = A, m = w(A, [
54
71
  "getContainer",
55
72
  "token",
73
+ "getToken",
56
74
  "errorHandlers",
57
75
  "apiUrl",
58
76
  "datasetId",
59
77
  "versionId",
60
78
  "mode"
61
- ]), m = s({}, Z(I));
62
- P(m, M);
63
- const b = t(), w = (() => {
64
- const U = T, _ = (n) => {
65
- var a;
66
- if (!o)
79
+ ]), k = f({}, te(i));
80
+ Z(k, m);
81
+ const R = t(), U = (() => {
82
+ const _ = d, x = X(o, r), C = (n) => M(void 0, null, function* () {
83
+ var c;
84
+ const s = yield x();
85
+ if (!s)
67
86
  return n;
68
- if (J(o)) {
69
- const i = "aiotToken is timeout";
70
- r.aiotToken ? typeof r.aiotToken == "function" ? r.aiotToken(
87
+ if (Q(s)) {
88
+ const u = "aiotToken is timeout";
89
+ a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
71
90
  // @ts-ignore
72
- new Error(i, {
91
+ new Error(u, {
73
92
  cause: {
74
93
  status: 401,
75
- message: i
94
+ message: u
76
95
  }
77
96
  })
78
- ) : console.error("errorHandlers.aiotToken is not a function") : console.error(i);
97
+ ) : console.error("errorHandlers.aiotToken is not a function") : console.error(u);
79
98
  }
80
- return n.headers = (a = n.headers) != null ? a : {}, n.headers = g(s({}, n.headers), {
81
- Authorization: o ? `Bearer ${o}` : ""
99
+ return n.headers = (c = n.headers) != null ? c : {}, n.headers = I(f({}, n.headers), {
100
+ Authorization: s ? `Bearer ${s}` : ""
82
101
  }), n;
83
- };
84
- function f(n, a = !0) {
85
- const i = `${U}${n}`, d = K.create({
86
- baseURL: i
102
+ });
103
+ function E(n, s = !0) {
104
+ const c = `${_}${n}`, u = Y.create({
105
+ baseURL: c
87
106
  });
88
- return a && d.interceptors.request.use(_), d;
107
+ return s && u.interceptors.request.use(C), u;
89
108
  }
90
- const u = (n, a) => {
91
- n !== 10001 && n !== 10215 && (S.config({
109
+ const T = (n, s) => {
110
+ n !== 10001 && n !== 10215 && (b.config({
92
111
  getContainer: t
93
- }), S.error({
94
- message: a
112
+ }), b.error({
113
+ message: s
95
114
  }));
96
- }, l = (n, a) => {
115
+ }, g = (n, s) => {
97
116
  if (n === 401) {
98
- const i = "aiotToken is invalid";
99
- r.aiotToken ? typeof r.aiotToken == "function" ? r.aiotToken(
117
+ const c = "aiotToken is invalid";
118
+ a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
100
119
  // @ts-ignore
101
- new Error(i, {
120
+ new Error(c, {
102
121
  cause: {
103
122
  status: 401,
104
- message: i
123
+ message: c
105
124
  }
106
125
  })
107
- ) : console.error("errorHandlers.aiotToken is not a function") : console.error(i);
126
+ ) : console.error("errorHandlers.aiotToken is not a function") : console.error(c);
108
127
  }
109
- }, x = f("/datahub/v1"), C = new G(x, {
110
- onHttpStatusError: l,
111
- onAppStatusError: u
112
- }), R = f("/mlopsdeploy/v1"), F = new N(R, {
113
- onHttpStatusError: l,
114
- onAppStatusError: u
115
- }), H = f("/aishop"), O = new W(H, {
116
- onHttpStatusError: l,
117
- onAppStatusError: u
128
+ }, y = E("/datahub/v1"), F = new J(y, {
129
+ onHttpStatusError: g,
130
+ onAppStatusError: T
131
+ }), H = E("/mlopsdeploy/v1"), O = new K(H, {
132
+ onHttpStatusError: g,
133
+ onAppStatusError: T
134
+ }), B = E("/aishop"), L = new P(B, {
135
+ onHttpStatusError: g,
136
+ onAppStatusError: T
118
137
  });
119
138
  return {
120
- cvforceDatahub: C,
121
- cvforceModelService: F,
122
- aiShop: O
139
+ cvforceDatahub: F,
140
+ cvforceModelService: O,
141
+ aiShop: L
123
142
  };
124
143
  })();
125
- V.render(/* @__PURE__ */ $(z, s({
126
- services: w,
127
- datasetId: k,
128
- versionId: D
129
- }, m)), b);
144
+ G.render(/* @__PURE__ */ z(W, f({
145
+ services: U,
146
+ datasetId: v,
147
+ versionId: l
148
+ }, k)), R);
130
149
  };
131
150
  export {
132
- le as default
151
+ ve as default
133
152
  };