@shjjs/visual-ui 3.0.3 → 3.0.5
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/es/commons/plugins/datasource/index.mjs +2 -2
- package/es/commons/plugins/datasource/sources/api.mjs +61 -40
- package/es/commons/plugins/datasource/utils/mappingData.mjs +20 -19
- package/es/commons/plugins/datasource/utils/utils.mjs +93 -239
- package/es/packages/commons/plugins/datasource/sources/api.d.ts +1 -1
- package/es/packages/commons/plugins/datasource/utils/mappingData.d.ts +6 -0
- package/es/packages/commons/plugins/datasource/utils/utils.d.ts +6 -96
- package/package.json +1 -1
- package/umd/index.js +361 -361
|
@@ -207,8 +207,8 @@ const c = class c {
|
|
|
207
207
|
const o = this.timerPool.get(t.id);
|
|
208
208
|
if (o && (clearInterval(o), this.timerPool.delete(t.id)), t.source.isAutoUpdate) {
|
|
209
209
|
const n = setInterval(() => {
|
|
210
|
-
this.executeTask(t, a, r, (s) => {
|
|
211
|
-
i(s);
|
|
210
|
+
this.markDataSourceExecuting(t.id), this.executeTask(t, a, r, (s) => {
|
|
211
|
+
i(s), this.markDataSourceCompleted(t.id);
|
|
212
212
|
});
|
|
213
213
|
}, t.source.autoUpdateTime * 1e3);
|
|
214
214
|
this.timerPool.set(t.id, n);
|
|
@@ -1,51 +1,72 @@
|
|
|
1
|
-
import { SHJDatasourceV2 as
|
|
2
|
-
import { httpRequest as
|
|
3
|
-
import { DataSourceUtils as
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { SHJDatasourceV2 as k } from "../index.mjs";
|
|
2
|
+
import { httpRequest as o } from "../utils/request.mjs";
|
|
3
|
+
import { DataSourceUtils as n } from "../utils/utils.mjs";
|
|
4
|
+
const L = async (t, P, l) => {
|
|
5
|
+
var m;
|
|
6
|
+
const e = t == null ? void 0 : t.id, p = (m = t == null ? void 0 : t.source) == null ? void 0 : m.api, a = (c) => {
|
|
7
|
+
l(n.noneData(c));
|
|
8
|
+
};
|
|
9
|
+
if (!p || !e)
|
|
10
|
+
return a(e || "");
|
|
11
|
+
const {
|
|
12
|
+
isHeaders: U,
|
|
13
|
+
isBody: u,
|
|
14
|
+
headers: v,
|
|
15
|
+
contentType: d,
|
|
16
|
+
url: D,
|
|
17
|
+
postParam: E,
|
|
18
|
+
type: y,
|
|
19
|
+
isUseEnv: T = !0
|
|
20
|
+
} = p;
|
|
6
21
|
try {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
).then((D) => {
|
|
18
|
-
D && n(D);
|
|
19
|
-
}).catch(() => n(t.noneData(e.id)));
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
n(t.noneData(e.id));
|
|
23
|
-
}).catch(() => {
|
|
24
|
-
n(t.noneData(e.id));
|
|
25
|
-
});
|
|
26
|
-
}, p = i.isUseEnv ? E.envBaseUrl : "";
|
|
27
|
-
a = t.replaceURLVariables(a), a = t.replaceStringVariables(a), c && (s = t.replaceObjectVariables(s)), y && (r = t.replaceObjectVariables(r)), i.type === "GET" && o(f.get(p + a, { headers: r })), i.type === "POST" && o(
|
|
28
|
-
f.post(
|
|
29
|
-
p + a,
|
|
22
|
+
const S = n.getEnvironments().envBaseUrl ?? "", V = T ? S : "", g = n.replaceStringVariables(D), i = U ? n.replaceObjectVariables(v) : {}, f = u ? n.replaceObjectVariables(E) : {}, s = V + g;
|
|
23
|
+
if (!s)
|
|
24
|
+
return a(e);
|
|
25
|
+
let r;
|
|
26
|
+
switch (y) {
|
|
27
|
+
case "GET":
|
|
28
|
+
r = o.get(s, { headers: i });
|
|
29
|
+
break;
|
|
30
|
+
case "POST":
|
|
31
|
+
r = o.post(
|
|
30
32
|
s,
|
|
31
|
-
|
|
33
|
+
f,
|
|
34
|
+
{ headers: i },
|
|
32
35
|
d
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
);
|
|
37
|
+
break;
|
|
38
|
+
case "PUT":
|
|
39
|
+
r = o.put(
|
|
37
40
|
s,
|
|
38
|
-
|
|
41
|
+
f,
|
|
42
|
+
{ headers: i },
|
|
39
43
|
d
|
|
40
|
-
)
|
|
41
|
-
|
|
44
|
+
);
|
|
45
|
+
break;
|
|
46
|
+
case "DELETE":
|
|
47
|
+
r = o.delete(s, {
|
|
48
|
+
headers: i
|
|
49
|
+
});
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
return a(e);
|
|
53
|
+
}
|
|
54
|
+
const b = await r;
|
|
55
|
+
if (b.status === 200) {
|
|
56
|
+
const h = await k.processData(
|
|
57
|
+
t.source,
|
|
58
|
+
b.data,
|
|
59
|
+
e,
|
|
60
|
+
P
|
|
61
|
+
);
|
|
62
|
+
h ? l(h) : a(e);
|
|
42
63
|
} else
|
|
43
|
-
|
|
64
|
+
a(e);
|
|
44
65
|
} catch {
|
|
45
|
-
|
|
66
|
+
a(e);
|
|
46
67
|
}
|
|
47
68
|
};
|
|
48
69
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
70
|
+
o as httpRequest,
|
|
71
|
+
L as parseAPIPort
|
|
51
72
|
};
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { isArray as
|
|
2
|
-
const m = (
|
|
3
|
-
if (!
|
|
4
|
-
return
|
|
1
|
+
import { isArray as c } from "lodash";
|
|
2
|
+
const m = (n, s, e, a) => {
|
|
3
|
+
if (!c(n))
|
|
4
|
+
return n;
|
|
5
5
|
let l = null;
|
|
6
|
-
return l =
|
|
6
|
+
return l = n.map((r, p) => {
|
|
7
7
|
const i = {};
|
|
8
|
-
return e &&
|
|
9
|
-
const t =
|
|
10
|
-
t.alias ? i[t.alias] =
|
|
11
|
-
}),
|
|
8
|
+
return e && p === 0 && (s = f(r, s)), Object.keys(s).forEach((o) => {
|
|
9
|
+
const t = s[o];
|
|
10
|
+
t.alias ? i[t.alias] = r[t.mapping] : i[t.name] = r[t.mapping];
|
|
11
|
+
}), a && (i.userdata = r), i;
|
|
12
12
|
}), l;
|
|
13
|
-
}, f = (
|
|
13
|
+
}, f = (n, s) => {
|
|
14
14
|
const e = [];
|
|
15
|
-
return Object.keys(
|
|
16
|
-
const l =
|
|
15
|
+
return n ?? (n = []), Object.keys(n).forEach((a) => {
|
|
16
|
+
const l = s.find((r) => r.name === a);
|
|
17
17
|
l ? e.push({
|
|
18
18
|
alias: l.alias,
|
|
19
|
-
name:
|
|
20
|
-
label:
|
|
19
|
+
name: a,
|
|
20
|
+
label: a,
|
|
21
21
|
mapping: l.mapping
|
|
22
22
|
}) : e.push({
|
|
23
|
-
alias:
|
|
24
|
-
name:
|
|
25
|
-
label:
|
|
26
|
-
mapping:
|
|
23
|
+
alias: a,
|
|
24
|
+
name: a,
|
|
25
|
+
label: a,
|
|
26
|
+
mapping: a
|
|
27
27
|
});
|
|
28
|
-
}),
|
|
28
|
+
}), e;
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
|
+
f as dynamicMappingData,
|
|
31
32
|
m as mappingData
|
|
32
33
|
};
|
|
@@ -1,283 +1,137 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { cloneDeep as
|
|
5
|
-
import { SHJDatasourceV2 as
|
|
6
|
-
import { storageData as
|
|
2
|
+
var b = (l, a, e) => a in l ? f(l, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[a] = e;
|
|
3
|
+
var d = (l, a, e) => b(l, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
+
import { cloneDeep as g } from "lodash";
|
|
5
|
+
import { SHJDatasourceV2 as u } from "../index.mjs";
|
|
6
|
+
import { storageData as V } from "./storageData.mjs";
|
|
7
7
|
import "../../event/actions/fullScreenAction.mjs";
|
|
8
|
-
import { EventUtils as
|
|
9
|
-
const
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
continue;
|
|
20
|
-
const o = r.getNestedValue(
|
|
21
|
-
n._value,
|
|
22
|
-
i.substring(s.length)
|
|
23
|
-
);
|
|
24
|
-
e = e.replaceAll(a[t], o);
|
|
8
|
+
import { EventUtils as m } from "../../event/utils/utils.mjs";
|
|
9
|
+
const i = class i {
|
|
10
|
+
static executeAllVariable(a) {
|
|
11
|
+
a.forEach((e) => {
|
|
12
|
+
e.sources.isVariable = !0;
|
|
13
|
+
}), i.setVariables(a), a.forEach((e) => {
|
|
14
|
+
u.parse({
|
|
15
|
+
sources: [e.sources],
|
|
16
|
+
noUseMapping: !0,
|
|
17
|
+
callback: (t) => {
|
|
18
|
+
i.setVariableById(e, t, !1);
|
|
25
19
|
}
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
return e;
|
|
29
|
-
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
30
22
|
}
|
|
31
|
-
static replaceObjectVariables(
|
|
32
|
-
const
|
|
33
|
-
return JSON.parse(
|
|
23
|
+
static replaceObjectVariables(a) {
|
|
24
|
+
const e = this.replaceStringVariables(JSON.stringify(a));
|
|
25
|
+
return JSON.parse(e);
|
|
34
26
|
}
|
|
35
|
-
static replaceStringVariables(
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
49
|
-
e = e.replaceAll(a[t], o);
|
|
27
|
+
static replaceStringVariables(a) {
|
|
28
|
+
return a.replace(/\$g\{([^}]+)\}/g, (e, t) => {
|
|
29
|
+
const { varName: r, propPath: n } = this.parseVariablePath(t), c = this.getVariables().find((o) => o.name === r);
|
|
30
|
+
if (!c)
|
|
31
|
+
return e;
|
|
32
|
+
let s = c._value;
|
|
33
|
+
try {
|
|
34
|
+
for (const o of n) {
|
|
35
|
+
if (s == null) {
|
|
36
|
+
s = void 0;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
s = s[o];
|
|
50
40
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return e;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
static getURLVariableNames(e) {
|
|
57
|
-
const a = [], t = e.match(/\${(.*?)}/g);
|
|
58
|
-
if (t)
|
|
59
|
-
for (let i = 0; i < t.length; i++) {
|
|
60
|
-
const s = t[i].substring(2, t[i].length - 1), n = r.extractVariableName(s);
|
|
61
|
-
a.push(n);
|
|
41
|
+
} catch {
|
|
42
|
+
return "undefined";
|
|
62
43
|
}
|
|
63
|
-
|
|
44
|
+
return typeof s == "object" ? JSON.stringify(s) : s === void 0 ? "undefined" : String(s);
|
|
45
|
+
});
|
|
64
46
|
}
|
|
65
|
-
static getObjectVariableNames(
|
|
66
|
-
return this.getStringVariableNames(JSON.stringify(
|
|
47
|
+
static getObjectVariableNames(a) {
|
|
48
|
+
return this.getStringVariableNames(JSON.stringify(a));
|
|
67
49
|
}
|
|
68
|
-
static getStringVariableNames(
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
static getStringVariableNames(a) {
|
|
51
|
+
const e = /* @__PURE__ */ new Set(), t = /\$g\{([^}]+)\}/g;
|
|
52
|
+
for (const r of a.matchAll(t)) {
|
|
53
|
+
const n = r[1], { varName: c } = this.parseVariablePath(n);
|
|
54
|
+
c && e.add(c);
|
|
55
|
+
}
|
|
56
|
+
return Array.from(e);
|
|
57
|
+
}
|
|
58
|
+
static parseVariablePath(a) {
|
|
59
|
+
const t = a.replace(/\[/g, ".").replace(/\]/g, "").split("."), r = t[0], n = t.slice(1);
|
|
60
|
+
return { varName: r, propPath: n };
|
|
76
61
|
}
|
|
77
|
-
/**
|
|
78
|
-
* 获取环境变量
|
|
79
|
-
* @returns 环境变量
|
|
80
|
-
*/
|
|
81
62
|
static getEnvironments() {
|
|
82
63
|
return window._apiEnvironment;
|
|
83
64
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const a = e.find((t) => t.selected);
|
|
90
|
-
a && (window._apiEnvironment = {
|
|
91
|
-
envName: a.envName,
|
|
92
|
-
envBaseUrl: a.envBaseUrl
|
|
65
|
+
static setEnvironments(a) {
|
|
66
|
+
const e = a.find((t) => t.selected);
|
|
67
|
+
e && (window._apiEnvironment = {
|
|
68
|
+
envName: e.envName,
|
|
69
|
+
envBaseUrl: e.envBaseUrl
|
|
93
70
|
});
|
|
94
71
|
}
|
|
95
|
-
/**
|
|
96
|
-
* 获取变量数据
|
|
97
|
-
* @returns 变量数据
|
|
98
|
-
*/
|
|
99
72
|
static getVariables() {
|
|
100
73
|
return window._variables || [];
|
|
101
74
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*/
|
|
106
|
-
static setVariables(e) {
|
|
107
|
-
window._variables = h(e), window._variables.forEach((a) => {
|
|
108
|
-
a._callbacks ?? (a._callbacks = /* @__PURE__ */ new Map());
|
|
75
|
+
static setVariables(a) {
|
|
76
|
+
window._variables = g(a), window._variables.forEach((e) => {
|
|
77
|
+
e._callbacks ?? (e._callbacks = /* @__PURE__ */ new Map());
|
|
109
78
|
});
|
|
110
79
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
*/
|
|
116
|
-
static getVariableById(e) {
|
|
117
|
-
return window._variables.find((a) => a.id === e);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
*
|
|
121
|
-
* @param name
|
|
122
|
-
* @returns
|
|
123
|
-
*/
|
|
124
|
-
static getVariableByName(e) {
|
|
125
|
-
return window._variables.find((a) => a.name === e);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* @param name
|
|
130
|
-
* @returns
|
|
131
|
-
*/
|
|
132
|
-
static getVariableValueByName(e) {
|
|
133
|
-
const a = window._variables.find((t) => t.name === e);
|
|
134
|
-
return a ? a._value : null;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
*
|
|
138
|
-
* @param name
|
|
139
|
-
* @returns
|
|
140
|
-
*/
|
|
141
|
-
static getVariableInitialStateByName(e) {
|
|
142
|
-
const a = window._variables.find((t) => t.name === e);
|
|
143
|
-
return a ? a._initialState : null;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* 设置变量数据
|
|
147
|
-
* @param id 变量 ID
|
|
148
|
-
* @param variable 变量数据
|
|
149
|
-
*/
|
|
150
|
-
static setVariableById(e, a, t = !0) {
|
|
151
|
-
const i = this.getVariableById(e.id);
|
|
152
|
-
if (i) {
|
|
153
|
-
i._value = a, i._initialState ?? (i._initialState = !0);
|
|
80
|
+
static setVariableById(a, e, t = !0) {
|
|
81
|
+
const r = this.getVariableById(a.id);
|
|
82
|
+
if (r) {
|
|
83
|
+
r._value = e, r._initialState ?? (r._initialState = !0);
|
|
154
84
|
try {
|
|
155
|
-
|
|
85
|
+
V(a.sources.source.storage, e);
|
|
156
86
|
} catch {
|
|
157
87
|
}
|
|
158
|
-
|
|
159
|
-
(
|
|
160
|
-
), t &&
|
|
88
|
+
r._callbacks ?? (r._callbacks = /* @__PURE__ */ new Map()), r._callbacks.forEach(
|
|
89
|
+
(n) => n(a._value)
|
|
90
|
+
), t && m.updateWidgetVariableData(r);
|
|
161
91
|
}
|
|
162
92
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
* @param wsInstances WebSocket 实例
|
|
166
|
-
* @param tId WebSocket 实例的 ID
|
|
167
|
-
* @param sourceId WebSocket 实例的源 ID
|
|
168
|
-
* @returns 是否有效
|
|
169
|
-
*/
|
|
170
|
-
static hasValidWebSocket(e, a, t) {
|
|
171
|
-
const i = e.get(a);
|
|
172
|
-
if (!i) return !1;
|
|
173
|
-
for (const s of i)
|
|
174
|
-
if (s.getId() === t && s.isConnected())
|
|
175
|
-
return !0;
|
|
176
|
-
return !1;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* 只在必要时清理 WebSocket 连接
|
|
180
|
-
* @param wsInstances WebSocket 实例
|
|
181
|
-
* @param sourceIds 源 ID
|
|
182
|
-
* @param tId WebSocket 实例的 ID
|
|
183
|
-
*/
|
|
184
|
-
static cleanupPreviousWebSockets(e, a, t) {
|
|
185
|
-
const i = e.get(t);
|
|
186
|
-
i && (i.forEach((s) => {
|
|
187
|
-
a.includes(s.getId()) || (s.disconnect(), i.delete(s));
|
|
188
|
-
}), i.size === 0 && e.delete(t));
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* 使用 Function 构造函数获取对象中的嵌套值(更简洁但安全性较低)
|
|
192
|
-
* @param obj 源对象
|
|
193
|
-
* @param path 路径字符串,例如 ".a[0].value"
|
|
194
|
-
* @returns 获取到的值,如果路径不存在则返回 undefined
|
|
195
|
-
*/
|
|
196
|
-
static getNestedValue(e, a) {
|
|
197
|
-
try {
|
|
198
|
-
return a ? new Function("obj", `return obj${a}`)(e) : e;
|
|
199
|
-
} catch {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
93
|
+
static getVariableById(a) {
|
|
94
|
+
return window._variables.find((e) => e.id === a);
|
|
202
95
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
* @param path 路径字符串,例如 "测试.test" 或 "333[0].aa"
|
|
206
|
-
* @returns 提取出的变量名
|
|
207
|
-
*/
|
|
208
|
-
static extractVariableName(e) {
|
|
209
|
-
const a = e.match(
|
|
210
|
-
/^([\u4e00-\u9fa5a-zA-Z0-9_][\u4e00-\u9fa5a-zA-Z0-9_]*)/
|
|
211
|
-
);
|
|
212
|
-
return a ? a[1] : "";
|
|
96
|
+
static getVariableByName(a) {
|
|
97
|
+
return window._variables.find((e) => e.name === a);
|
|
213
98
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
* @returns
|
|
218
|
-
*/
|
|
219
|
-
static executeAllVariable(e) {
|
|
220
|
-
e.forEach((a) => {
|
|
221
|
-
a.sources.isVariable = !0;
|
|
222
|
-
}), r.setVariables(e), e.forEach((a) => {
|
|
223
|
-
b.parse({
|
|
224
|
-
sources: [a.sources],
|
|
225
|
-
noUseMapping: !0,
|
|
226
|
-
callback: (t) => {
|
|
227
|
-
r.setVariableById(a, t, !1);
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
});
|
|
99
|
+
static getVariableValueByName(a) {
|
|
100
|
+
const e = window._variables.find((t) => t.name === a);
|
|
101
|
+
return e ? e._value : null;
|
|
231
102
|
}
|
|
232
|
-
|
|
233
|
-
* 返回空数据
|
|
234
|
-
* @param id 数据源 ID
|
|
235
|
-
* @returns 空数据
|
|
236
|
-
*/
|
|
237
|
-
static noneData(e) {
|
|
103
|
+
static noneData(a) {
|
|
238
104
|
return {
|
|
239
|
-
id:
|
|
240
|
-
finalKeyData: { id:
|
|
241
|
-
finalUserData: { id:
|
|
105
|
+
id: a,
|
|
106
|
+
finalKeyData: { id: a, data: null },
|
|
107
|
+
finalUserData: { id: a, data: null },
|
|
242
108
|
filteredData: null,
|
|
243
109
|
rawData: null,
|
|
244
110
|
noMappingData: null
|
|
245
111
|
};
|
|
246
112
|
}
|
|
247
113
|
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
*/
|
|
252
|
-
c(r, "addVariable", (e) => {
|
|
253
|
-
b.parse({
|
|
254
|
-
sources: [e.sources],
|
|
114
|
+
d(i, "addVariable", (a) => {
|
|
115
|
+
u.parse({
|
|
116
|
+
sources: [a.sources],
|
|
255
117
|
noUseMapping: !0,
|
|
256
|
-
callback: (
|
|
257
|
-
|
|
118
|
+
callback: (e) => {
|
|
119
|
+
i.getVariables().push(a), i.setVariableById(a, e, !1);
|
|
258
120
|
}
|
|
259
121
|
});
|
|
260
|
-
}),
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
*/
|
|
264
|
-
c(r, "updateVariable", (e) => {
|
|
265
|
-
b.parse({
|
|
266
|
-
sources: [e.sources],
|
|
122
|
+
}), d(i, "updateVariable", (a) => {
|
|
123
|
+
u.parse({
|
|
124
|
+
sources: [a.sources],
|
|
267
125
|
noUseMapping: !0,
|
|
268
|
-
callback: (
|
|
269
|
-
|
|
126
|
+
callback: (e) => {
|
|
127
|
+
i.setVariableById(a, e, !1);
|
|
270
128
|
}
|
|
271
129
|
});
|
|
272
|
-
}),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
*/
|
|
276
|
-
c(r, "deleteVariableById", (e) => {
|
|
277
|
-
const a = window._variables.findIndex((t) => t.id === e);
|
|
278
|
-
a > -1 && window._variables.splice(a, 1);
|
|
130
|
+
}), d(i, "deleteVariableById", (a) => {
|
|
131
|
+
const e = window._variables.findIndex((t) => t.id === a);
|
|
132
|
+
e > -1 && window._variables.splice(e, 1);
|
|
279
133
|
});
|
|
280
|
-
let
|
|
134
|
+
let p = i;
|
|
281
135
|
export {
|
|
282
|
-
|
|
136
|
+
p as DataSourceUtils
|
|
283
137
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { httpRequest } from "../utils/request";
|
|
2
|
-
export declare const parseAPIPort: (source: any, noUseMapping: boolean, callback: (data: any) => void) => void;
|
|
3
2
|
export { httpRequest };
|
|
3
|
+
export declare const parseAPIPort: (source: any, noUseMapping: boolean, callback: (data: any) => void) => Promise<void>;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { IMapping } from "../types";
|
|
2
2
|
export declare const mappingData: (data: any[], mapping: IMapping[], dynamicMapping: boolean, isUserdata: boolean) => any;
|
|
3
|
+
export declare const dynamicMappingData: (item: any, mapping: IMapping[]) => {
|
|
4
|
+
alias: string;
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
mapping: string;
|
|
8
|
+
}[];
|