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