@bluecopa/core 0.1.4 → 0.1.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/dist/index.es.js CHANGED
@@ -97,11 +97,11 @@ async function getLoggedInUserDetails() {
97
97
  throw { message, status };
98
98
  }
99
99
  }
100
- const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
100
+ const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
101
  __proto__: null,
102
102
  getLoggedInUserDetails
103
103
  }, Symbol.toStringTag, { value: "Module" }));
104
- async function triggerHttpWorkflow({
104
+ async function triggerHttpWorkflowById({
105
105
  data,
106
106
  triggerId
107
107
  }) {
@@ -118,7 +118,7 @@ async function triggerHttpWorkflow({
118
118
  throw { message, status };
119
119
  }
120
120
  }
121
- async function triggerWorkflow({
121
+ async function triggerWorkflowById({
122
122
  parentId,
123
123
  triggerBy
124
124
  }) {
@@ -135,10 +135,33 @@ async function triggerWorkflow({
135
135
  throw { message, status };
136
136
  }
137
137
  }
138
- const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
138
+ var WorkflowStatus = /* @__PURE__ */ ((WorkflowStatus2) => {
139
+ WorkflowStatus2["Succeeded"] = "Succeeded";
140
+ WorkflowStatus2["Failed"] = "Failed";
141
+ WorkflowStatus2["Running"] = "Running";
142
+ WorkflowStatus2["NotFound"] = "NotFound";
143
+ return WorkflowStatus2;
144
+ })(WorkflowStatus || {});
145
+ const getWorkflowInstanceStatusById = async (request) => {
146
+ var _a, _b, _c;
147
+ try {
148
+ const response = await apiClient.post("/workflow/instances/status", request);
149
+ if (!response.data) {
150
+ throw { message: "Failed to fetch workflow statuses", status: 500 };
151
+ }
152
+ return response.data;
153
+ } catch (error) {
154
+ const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching workflow statuses";
155
+ const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
156
+ throw { message, status };
157
+ }
158
+ };
159
+ const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
139
160
  __proto__: null,
140
- triggerHttpWorkflow,
141
- triggerWorkflow
161
+ WorkflowStatus,
162
+ getWorkflowInstanceStatusById,
163
+ triggerHttpWorkflowById,
164
+ triggerWorkflowById
142
165
  }, Symbol.toStringTag, { value: "Module" }));
143
166
  async function getFileUrlByFileId({
144
167
  key,
@@ -158,7 +181,7 @@ async function getFileUrlByFileId({
158
181
  throw { message, status };
159
182
  }
160
183
  }
161
- const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
184
+ const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
162
185
  __proto__: null,
163
186
  getFileUrlByFileId
164
187
  }, Symbol.toStringTag, { value: "Module" }));
@@ -211,7 +234,7 @@ const runDefinition = async (props) => {
211
234
  { cancelToken: source == null ? void 0 : source.token }
212
235
  );
213
236
  };
214
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
237
+ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
215
238
  __proto__: null,
216
239
  runDefinition,
217
240
  runPublishedDefinition,
@@ -233,6 +256,27 @@ const getWorksheets = async (worksheetIds) => {
233
256
  throw { message, status };
234
257
  }
235
258
  };
259
+ const getWorksheetsByType = async (type) => {
260
+ var _a, _b, _c;
261
+ try {
262
+ const response = await apiClient.post("/worksheet/get-worksheets-by-type", {
263
+ type
264
+ });
265
+ if (!response.data) {
266
+ throw { message: "Failed to fetch worksheets", status: 500 };
267
+ }
268
+ return response.data;
269
+ } catch (error) {
270
+ const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching worksheets";
271
+ const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
272
+ throw { message, status };
273
+ }
274
+ };
275
+ const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
276
+ __proto__: null,
277
+ getWorksheets,
278
+ getWorksheetsByType
279
+ }, Symbol.toStringTag, { value: "Module" }));
236
280
  function formatDate(date) {
237
281
  return date.toISOString().split("T")[0];
238
282
  }
@@ -1313,7 +1357,7 @@ const inputTableDefinition = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Objec
1313
1357
  getMetricSeries,
1314
1358
  sortConfigFromValue
1315
1359
  }, Symbol.toStringTag, { value: "Module" }));
1316
- const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1360
+ const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1317
1361
  __proto__: null,
1318
1362
  formatDate,
1319
1363
  getMetricDefinition,
@@ -1499,7 +1543,7 @@ const getData$2 = async (metricSheetId, options) => {
1499
1543
  resultData = _.flatten(resultData);
1500
1544
  return { data: resultData };
1501
1545
  };
1502
- const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1546
+ const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1503
1547
  __proto__: null,
1504
1548
  getData: getData$2
1505
1549
  }, Symbol.toStringTag, { value: "Module" }));
@@ -1682,8 +1726,23 @@ const getSampleData = async ({
1682
1726
  throw { message, status };
1683
1727
  }
1684
1728
  };
1685
- const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1729
+ const getAllDatasets = async () => {
1730
+ var _a, _b, _c;
1731
+ try {
1732
+ const response = await apiClient.post("/datasets/get-datasets");
1733
+ if (!response.data) {
1734
+ throw { message: "Failed to fetch datasets", status: 500 };
1735
+ }
1736
+ return response.data;
1737
+ } catch (error) {
1738
+ const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching datasets";
1739
+ const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
1740
+ throw { message, status };
1741
+ }
1742
+ };
1743
+ const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1686
1744
  __proto__: null,
1745
+ getAllDatasets,
1687
1746
  getData: getData$1,
1688
1747
  getSampleData
1689
1748
  }, Symbol.toStringTag, { value: "Module" }));
@@ -1693,7 +1752,7 @@ const getPublishedWorkbookById = async ({
1693
1752
  }) => {
1694
1753
  var _a, _b, _c;
1695
1754
  try {
1696
- const response = await apiClient.post("/workbook/published", {
1755
+ const response = await apiClient.post("/workbook/get-published-workbook-by-id", {
1697
1756
  type,
1698
1757
  id
1699
1758
  });
@@ -1854,21 +1913,59 @@ const getData = async ({
1854
1913
  throw { message, status };
1855
1914
  }
1856
1915
  };
1857
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1916
+ const getInputTables = async () => {
1917
+ var _a, _b, _c;
1918
+ try {
1919
+ const response = await apiClient.get("/input-table/get-input-tables");
1920
+ if (!response.data) {
1921
+ throw { message: "Failed to fetch tables", status: 500 };
1922
+ }
1923
+ return response.data;
1924
+ } catch (error) {
1925
+ const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching tables";
1926
+ const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
1927
+ throw { message, status };
1928
+ }
1929
+ };
1930
+ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1858
1931
  __proto__: null,
1859
1932
  getData,
1933
+ getInputTables,
1860
1934
  getTableById
1861
1935
  }, Symbol.toStringTag, { value: "Module" }));
1936
+ const getWorkbooksByType = async (type) => {
1937
+ var _a, _b, _c;
1938
+ try {
1939
+ const response = await apiClient.post("/workbook/get-workbooks-by-type", {
1940
+ type
1941
+ });
1942
+ if (!response.data) {
1943
+ throw { message: "Failed to fetch workbooks", status: 500 };
1944
+ }
1945
+ return response.data;
1946
+ } catch (error) {
1947
+ const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while fetching workbooks by type";
1948
+ const status = ((_c = error.response) == null ? void 0 : _c.status) || 500;
1949
+ throw { message, status };
1950
+ }
1951
+ };
1952
+ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1953
+ __proto__: null,
1954
+ getPublishedWorkbookById,
1955
+ getWorkbooksByType
1956
+ }, Symbol.toStringTag, { value: "Module" }));
1862
1957
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1863
1958
  __proto__: null,
1864
1959
  apiClient,
1865
- dataset: index$2,
1866
- definition: index$5,
1867
- files: index$6,
1868
- inputTable: index$1,
1869
- metric: index$3,
1870
- user: index$8,
1871
- workflow: index$7
1960
+ dataset: index$3,
1961
+ definition: index$7,
1962
+ files: index$8,
1963
+ inputTable: index$2,
1964
+ metric: index$4,
1965
+ user: index$a,
1966
+ workbook: index$1,
1967
+ workflow: index$9,
1968
+ worksheet: index$6
1872
1969
  }, Symbol.toStringTag, { value: "Module" }));
1873
1970
  const bluecopaTailwindConfig = {
1874
1971
  darkMode: "class",
@@ -2032,6 +2129,6 @@ export {
2032
2129
  getConfig as copaGetConfig,
2033
2130
  setConfig as copaSetConfig,
2034
2131
  bluecopaTailwindConfig as copaTailwindConfig,
2035
- index$4 as copaUtils
2132
+ index$5 as copaUtils
2036
2133
  };
2037
2134
  //# sourceMappingURL=index.es.js.map