@xuda.io/xuda-worker-bundle-min 1.3.317 → 1.3.318
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/index.js +30 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1781,8 +1781,25 @@ func.datasource.execute = async function (
|
|
|
1781
1781
|
break;
|
|
1782
1782
|
}
|
|
1783
1783
|
case "url": {
|
|
1784
|
+
debugger;
|
|
1785
|
+
|
|
1786
|
+
const response = await fetch(
|
|
1787
|
+
`https://${_session.domain}/cpi/get_utc_ts`,
|
|
1788
|
+
{
|
|
1789
|
+
method: "POST",
|
|
1790
|
+
headers: {
|
|
1791
|
+
Accept: "application/json",
|
|
1792
|
+
"Content-Type": "application/json",
|
|
1793
|
+
},
|
|
1794
|
+
body: JSON.stringify({}),
|
|
1795
|
+
}
|
|
1796
|
+
);
|
|
1797
|
+
const json = await response.json();
|
|
1798
|
+
return json.data;
|
|
1799
|
+
|
|
1784
1800
|
break;
|
|
1785
1801
|
}
|
|
1802
|
+
|
|
1786
1803
|
default:
|
|
1787
1804
|
break;
|
|
1788
1805
|
}
|
|
@@ -1927,7 +1944,7 @@ func.datasource.execute = async function (
|
|
|
1927
1944
|
|
|
1928
1945
|
case "array": {
|
|
1929
1946
|
let data = await get_data_from_source();
|
|
1930
|
-
|
|
1947
|
+
|
|
1931
1948
|
if (!_ds.v.raw_data) {
|
|
1932
1949
|
_ds.v.raw_data = { rows: [] };
|
|
1933
1950
|
}
|
|
@@ -1939,8 +1956,19 @@ func.datasource.execute = async function (
|
|
|
1939
1956
|
break;
|
|
1940
1957
|
}
|
|
1941
1958
|
|
|
1942
|
-
case "json":
|
|
1959
|
+
case "json": {
|
|
1960
|
+
let data = await get_data_from_source();
|
|
1961
|
+
console.log("data", data);
|
|
1962
|
+
if (!_ds.v.raw_data) {
|
|
1963
|
+
_ds.v.raw_data = { rows: [] };
|
|
1964
|
+
}
|
|
1965
|
+
let _KEY = 0;
|
|
1966
|
+
for (const _VAL of data) {
|
|
1967
|
+
_ds.v.raw_data.rows[_KEY] = { id: _KEY, value: { _KEY, _VAL } };
|
|
1968
|
+
_KEY++;
|
|
1969
|
+
}
|
|
1943
1970
|
break;
|
|
1971
|
+
}
|
|
1944
1972
|
|
|
1945
1973
|
case "csv":
|
|
1946
1974
|
break;
|