@datarecce/ui 0.1.21 → 0.1.23

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.
Files changed (82) hide show
  1. package/dist/RecceCheckContext-DIQjrvH8.mjs +228 -0
  2. package/dist/RecceCheckContext-DIQjrvH8.mjs.map +1 -0
  3. package/dist/RecceCheckContext-_xzNlnbJ.js +302 -0
  4. package/dist/RecceCheckContext-_xzNlnbJ.js.map +1 -0
  5. package/dist/api.d.mts +2 -102
  6. package/dist/api.d.ts +2 -102
  7. package/dist/api.js +59 -497
  8. package/dist/api.mjs +5 -437
  9. package/dist/components-CfY72Lq2.mjs +11686 -0
  10. package/dist/components-CfY72Lq2.mjs.map +1 -0
  11. package/dist/{styles-JV3V5MVO.css → components-D2DRqJsz.css} +28 -0
  12. package/dist/components-D2DRqJsz.css.map +1 -0
  13. package/dist/components-DXbVq9Cw.js +14038 -0
  14. package/dist/components-DXbVq9Cw.js.map +1 -0
  15. package/dist/components-dVXbmdqd.css +70 -0
  16. package/dist/components-dVXbmdqd.css.map +1 -0
  17. package/dist/components.d.mts +2 -471
  18. package/dist/components.d.ts +2 -471
  19. package/dist/components.js +85 -27392
  20. package/dist/components.mjs +8 -27250
  21. package/dist/hooks-C4jkoryM.js +40 -0
  22. package/dist/hooks-C4jkoryM.js.map +1 -0
  23. package/dist/hooks-C8pyX9m_.mjs +34 -0
  24. package/dist/hooks-C8pyX9m_.mjs.map +1 -0
  25. package/dist/hooks.d.mts +2 -296
  26. package/dist/hooks.d.ts +2 -296
  27. package/dist/hooks.js +33 -7583
  28. package/dist/hooks.mjs +6 -7521
  29. package/dist/html2canvas-pro.esm-BR5xeFe-.mjs +7249 -0
  30. package/dist/html2canvas-pro.esm-BR5xeFe-.mjs.map +1 -0
  31. package/dist/html2canvas-pro.esm-CVOsBdk0.js +7250 -0
  32. package/dist/html2canvas-pro.esm-CVOsBdk0.js.map +1 -0
  33. package/dist/index-CVPmrztP.d.ts +1825 -0
  34. package/dist/index-CVPmrztP.d.ts.map +1 -0
  35. package/dist/index-DIHuswfP.d.mts +1827 -0
  36. package/dist/index-DIHuswfP.d.mts.map +1 -0
  37. package/dist/index.d.mts +2 -29
  38. package/dist/index.d.ts +2 -29
  39. package/dist/index.js +177 -28784
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +16 -28555
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/state-AeoqV9ja.js +9176 -0
  44. package/dist/state-AeoqV9ja.js.map +1 -0
  45. package/dist/state-BbgVwFV2.mjs +8204 -0
  46. package/dist/state-BbgVwFV2.mjs.map +1 -0
  47. package/dist/{style-466WWZLM.css → state-IA7HWYOs.css} +81 -0
  48. package/dist/state-IA7HWYOs.css.map +1 -0
  49. package/dist/state-eEsMhIy4.css +215 -0
  50. package/dist/state-eEsMhIy4.css.map +1 -0
  51. package/dist/tooltipMessage-CrXjOmVM.mjs +7 -0
  52. package/dist/tooltipMessage-CrXjOmVM.mjs.map +1 -0
  53. package/dist/tooltipMessage-Dbi1kkfi.js +13 -0
  54. package/dist/tooltipMessage-Dbi1kkfi.js.map +1 -0
  55. package/dist/types.d.mts +2 -32
  56. package/dist/types.d.ts +2 -32
  57. package/dist/types.js +8 -24
  58. package/dist/types.mjs +4 -18
  59. package/dist/urls-D7PrPolY.mjs +16 -0
  60. package/dist/urls-D7PrPolY.mjs.map +1 -0
  61. package/dist/urls-SazAekCZ.js +34 -0
  62. package/dist/urls-SazAekCZ.js.map +1 -0
  63. package/dist/version-C2NU3xyx.mjs +89 -0
  64. package/dist/version-C2NU3xyx.mjs.map +1 -0
  65. package/dist/version-MxW9vrDY.js +137 -0
  66. package/dist/version-MxW9vrDY.js.map +1 -0
  67. package/package.json +7 -7
  68. package/dist/LineageViewContext-DEa54ZNF.d.mts +0 -103
  69. package/dist/LineageViewContext-DPVC8ak8.d.ts +0 -103
  70. package/dist/agGridStyles-VYALGSJU.css +0 -55
  71. package/dist/api.js.map +0 -1
  72. package/dist/api.mjs.map +0 -1
  73. package/dist/components.js.map +0 -1
  74. package/dist/components.mjs.map +0 -1
  75. package/dist/hooks.js.map +0 -1
  76. package/dist/hooks.mjs.map +0 -1
  77. package/dist/lineagecheck-BQaKAQzn.d.mts +0 -597
  78. package/dist/lineagecheck-BQaKAQzn.d.ts +0 -597
  79. package/dist/styles-QUPOR3LM.css +0 -24
  80. package/dist/styles-TU5BYTIL.css +0 -21
  81. package/dist/types.js.map +0 -1
  82. package/dist/types.mjs.map +0 -1
package/dist/api.mjs CHANGED
@@ -1,438 +1,6 @@
1
- import { QueryClient, useQuery } from '@tanstack/react-query';
2
- import axios, { AxiosError, isAxiosError } from 'axios';
3
- import '@amplitude/unified';
4
- import { useState, useEffect } from 'react';
1
+ "use client"
2
+ import { An as getServerInfo, At as submitQuery, Bt as waitRun, Dn as getLineageDiff, Dt as submitValueDiffDetail, En as getLineage, Et as submitValueDiff, Ft as getRun, It as listRuns, Lt as searchRuns, Mn as reactQueryClient, Mt as submitQueryDiff, Nt as aggregateRuns, On as getLineageWithError, Ot as submitProfileDiff, Pt as cancelRun, Q as queryRowCount, Rt as submitRun, Tn as getCll, X as fetchModelRowCount, Y as submitRowCountDiff, Z as queryModelRowCount, a as saveAs, c as createCheckByRun, d as getCheck, f as listChecks, ft as getServerFlag, g as useChecks, h as updateCheck, i as rename, jn as axiosClient, jt as submitQueryBase, kn as getModelInfo, kt as createLineageDiffCheck, l as createSimpleCheck, m as reorderChecks, mt as markRelaunchHintCompleted, n as importState, o as shareState, p as markAsPresetCheck, pt as markOnboardingCompleted, r as isStateSyncing, s as syncState, t as exportState, u as deleteCheck, zt as submitRunFromCheck } from "./state-BbgVwFV2.mjs";
3
+ import "./urls-D7PrPolY.mjs";
4
+ import { a as localStorageKeys, c as createSchemaDiffCheck, i as connectToCloud, n as fetchGitHubAvatar, o as sessionStorageKeys, r as fetchUser, s as select, t as useVersionNumber } from "./version-C2NU3xyx.mjs";
5
5
 
6
- // recce-source/js/src/lib/const.ts
7
- var apiUrl = process.env.NEXT_PUBLIC_API_URL;
8
- apiUrl ??= typeof window !== "undefined" ? window.location.origin : "";
9
- var PUBLIC_API_URL = apiUrl;
10
- process.env.NEXT_PUBLIC_CLOUD_WEB_URL;
11
-
12
- // recce-source/js/src/lib/api/axiosClient.ts
13
- var axiosClient = axios.create({
14
- baseURL: PUBLIC_API_URL
15
- });
16
- var reactQueryClient = new QueryClient();
17
-
18
- // recce-source/js/src/lib/api/types.ts
19
- function isQueryRun(run) {
20
- return run.type === "query";
21
- }
22
-
23
- // recce-source/js/src/lib/api/runs.ts
24
- function mutateAddKey(run) {
25
- if (run.result == null) {
26
- return run;
27
- }
28
- if (isQueryRun(run)) {
29
- run.result.columns = run.result.columns.map((c) => {
30
- if (c.key) {
31
- return c;
32
- }
33
- c.key = c.name;
34
- return c;
35
- });
36
- }
37
- return run;
38
- }
39
- async function submitRun(type, params, options) {
40
- const track_props = options?.trackProps ? { ...options.trackProps } : {};
41
- const response = await axiosClient.post("/api/runs", {
42
- type,
43
- params,
44
- nowait: options?.nowait,
45
- track_props
46
- });
47
- return response.data;
48
- }
49
- async function getRun(runId) {
50
- const response = await axiosClient.get(
51
- `/api/runs/${runId}`
52
- );
53
- return response.data;
54
- }
55
- async function waitRun(runId, timeout) {
56
- const response = await axiosClient.get(
57
- `/api/runs/${runId}/wait`,
58
- {
59
- params: {
60
- timeout
61
- }
62
- }
63
- );
64
- return mutateAddKey(response.data);
65
- }
66
- async function cancelRun(runId) {
67
- return await axiosClient.post(
68
- `/api/runs/${runId}/cancel`
69
- );
70
- }
71
- async function submitRunFromCheck(checkId, options) {
72
- const response = await axiosClient.post(`/api/checks/${checkId}/run`, {
73
- nowait: options?.nowait
74
- });
75
- return response.data;
76
- }
77
- async function searchRuns(type, params, limit) {
78
- const response = await axiosClient.post(
79
- `/api/runs/search`,
80
- {
81
- type,
82
- params,
83
- limit
84
- }
85
- );
86
- return response.data;
87
- }
88
- async function listRuns() {
89
- const response = await axiosClient.get(
90
- "/api/runs"
91
- );
92
- return response.data;
93
- }
94
- async function aggregateRuns(client = axiosClient) {
95
- const response = await client.post(
96
- `/api/runs/aggregate`,
97
- {}
98
- );
99
- return response.data;
100
- }
101
-
102
- // recce-source/js/src/lib/api/adhocQuery.ts
103
- async function submitQuery(params, options) {
104
- return await submitRun("query", params, options);
105
- }
106
- async function submitQueryBase(params, options) {
107
- return await submitRun("query_base", params, options);
108
- }
109
- async function submitQueryDiff(params, options) {
110
- return await submitRun("query_diff", params, options);
111
- }
112
-
113
- // recce-source/js/src/lib/api/cacheKeys.ts
114
- var cacheKeys = {
115
- rowCount: (model) => ["row_count", model],
116
- lineage: () => ["lineage"],
117
- checks: () => ["checks", "list"],
118
- check: (checkId) => ["checks", checkId],
119
- checkEvents: (checkId) => ["checks", checkId, "events"],
120
- runs: () => ["runs"],
121
- run: (runId) => ["runs", runId],
122
- runsAggregated: () => ["runs_aggregated"],
123
- flag: () => ["flag"],
124
- instanceInfo: () => ["instance_info"],
125
- user: () => ["user"]
126
- };
127
-
128
- // recce-source/js/src/lib/api/checks.ts
129
- async function createSimpleCheck() {
130
- const response = await axiosClient.post("/api/checks", {
131
- type: "simple"
132
- });
133
- return response.data;
134
- }
135
- async function createCheckByRun(runId, viewOptions) {
136
- const track_props = {};
137
- const response = await axiosClient.post("/api/checks", {
138
- run_id: runId,
139
- view_options: viewOptions,
140
- track_props
141
- });
142
- return response.data;
143
- }
144
- async function listChecks() {
145
- return (await axiosClient.get("/api/checks")).data;
146
- }
147
- function useChecks(enabled) {
148
- return useQuery({
149
- queryKey: cacheKeys.checks(),
150
- queryFn: listChecks,
151
- enabled
152
- });
153
- }
154
- async function getCheck(checkId) {
155
- const response = await axiosClient.get(`/api/checks/${checkId}`);
156
- return response.data;
157
- }
158
- async function updateCheck(checkId, payload) {
159
- const response = await axiosClient.patch(`/api/checks/${checkId}`, payload);
160
- return response.data;
161
- }
162
- async function deleteCheck(checkId) {
163
- const response = await axiosClient.delete(`/api/checks/${checkId}`);
164
- return response.data;
165
- }
166
- async function reorderChecks(order) {
167
- return await axiosClient.post("/api/checks/reorder", order);
168
- }
169
- async function markAsPresetCheck(checkId) {
170
- await axiosClient.post(`/api/checks/${checkId}/mark-as-preset`);
171
- }
172
-
173
- // recce-source/js/src/lib/api/cll.ts
174
- async function getCll(input) {
175
- const response = await axiosClient.post("/api/cll", input);
176
- return response.data;
177
- }
178
-
179
- // recce-source/js/src/lib/api/connectToCloud.ts
180
- async function connectToCloud() {
181
- const data = await axiosClient.post("/api/connect");
182
- return data.data;
183
- }
184
-
185
- // recce-source/js/src/lib/api/flag.ts
186
- async function getServerFlag(client = axiosClient) {
187
- return (await client.get("/api/flag")).data;
188
- }
189
- async function markOnboardingCompleted(client = axiosClient) {
190
- try {
191
- await client.post("/api/onboarding/completed");
192
- } catch (_error) {
193
- }
194
- }
195
- async function markRelaunchHintCompleted(client = axiosClient) {
196
- try {
197
- await client.post(
198
- "/api/relaunch-hint/completed"
199
- );
200
- } catch (_error) {
201
- }
202
- }
203
- async function getLineage(base = false) {
204
- const response = await axiosClient.get(
205
- `/api/lineage?base=${base}`
206
- );
207
- return response.data;
208
- }
209
- async function getLineageWithError(base = false) {
210
- try {
211
- const data = await getLineage(base);
212
- return { data };
213
- } catch (err) {
214
- if (err instanceof AxiosError) {
215
- const data = err.response?.data;
216
- const detail = data?.detail;
217
- if (detail) {
218
- return { error: detail };
219
- } else {
220
- return { error: err.message };
221
- }
222
- } else if (err instanceof Error) {
223
- return { error: err.message };
224
- } else {
225
- return { error: "An unknown error occurred" };
226
- }
227
- }
228
- }
229
- async function getLineageDiff() {
230
- const [base, current] = await Promise.all([
231
- getLineageWithError(true),
232
- getLineageWithError(false)
233
- ]);
234
- return {
235
- base: base.data,
236
- current: current.data,
237
- base_error: base.error,
238
- current_error: current.error
239
- };
240
- }
241
- async function getServerInfo(client = axiosClient) {
242
- return (await client.get(`/api/info`)).data;
243
- }
244
- async function getModelInfo(model) {
245
- return (await axiosClient.get(
246
- `/api/model/${model}`
247
- )).data;
248
- }
249
-
250
- // recce-source/js/src/lib/api/lineagecheck.ts
251
- async function createLineageDiffCheck(viewOptions) {
252
- const response = await axiosClient.post("/api/checks", {
253
- type: "lineage_diff",
254
- params: {},
255
- view_options: viewOptions
256
- });
257
- return response.data;
258
- }
259
-
260
- // recce-source/js/src/lib/api/rowcount.ts
261
- async function submitRowCountDiff(params, options) {
262
- return await submitRun("row_count_diff", params, options);
263
- }
264
-
265
- // recce-source/js/src/lib/api/models.ts
266
- async function fetchModelRowCount(modelName) {
267
- const response = await axiosClient.get(
268
- `/api/models/${modelName}/row_count`
269
- );
270
- return response.data;
271
- }
272
- async function queryModelRowCount(modelName) {
273
- const { result } = await queryRowCount([modelName]);
274
- return result[modelName];
275
- }
276
- async function queryRowCount(modelNames) {
277
- if (modelNames.length === 0) {
278
- throw new Error("No model names provided");
279
- }
280
- const { run_id } = await submitRowCountDiff(
281
- { node_names: modelNames },
282
- { nowait: true }
283
- );
284
- const run = await waitRun(run_id);
285
- return {
286
- runId: run_id,
287
- result: run.result
288
- };
289
- }
290
-
291
- // recce-source/js/src/lib/api/profile.ts
292
- async function submitProfileDiff(params, options) {
293
- return await submitRun("profile_diff", params, options);
294
- }
295
-
296
- // recce-source/js/src/lib/api/schemacheck.ts
297
- async function createSchemaDiffCheck(params) {
298
- const response = await axiosClient.post("/api/checks", {
299
- type: "schema_diff",
300
- params
301
- });
302
- return response.data;
303
- }
304
-
305
- // recce-source/js/src/lib/api/select.ts
306
- async function select(input) {
307
- return (await axiosClient.post(
308
- `/api/select`,
309
- input
310
- )).data;
311
- }
312
- async function saveAs(input) {
313
- return (await axiosClient.post(
314
- "/api/save-as",
315
- input
316
- )).data;
317
- }
318
- async function rename(input) {
319
- return (await axiosClient.post(
320
- "/api/rename",
321
- input
322
- )).data;
323
- }
324
- async function exportState() {
325
- return (await axiosClient.post("/api/export")).data;
326
- }
327
- async function importState(file, checksOnly) {
328
- const formData = new FormData();
329
- formData.append("file", file);
330
- formData.append("checks_only", (!!checksOnly).toString());
331
- return (await axiosClient.post(
332
- "/api/import",
333
- formData
334
- )).data;
335
- }
336
- async function isStateSyncing() {
337
- const response = await axiosClient.get(
338
- "/api/sync"
339
- );
340
- return response.status === 208;
341
- }
342
- async function syncState(input) {
343
- try {
344
- const response = await axiosClient.post("/api/sync", input);
345
- if (response.status === 202) {
346
- return {
347
- status: "accepted"
348
- };
349
- }
350
- if (response.status === 208) {
351
- return {
352
- status: "syncing"
353
- };
354
- }
355
- } catch (error) {
356
- if (isAxiosError(error)) {
357
- if (error.response?.status === 409) {
358
- return { status: "conflict" };
359
- }
360
- }
361
- }
362
- throw new Error("Failed to sync state");
363
- }
364
- async function shareState() {
365
- return (await axiosClient.post(
366
- "/api/share"
367
- )).data;
368
- }
369
- async function fetchUser() {
370
- try {
371
- const response = await axiosClient.get(
372
- "/api/users"
373
- );
374
- return response.data;
375
- } catch (error) {
376
- console.error("Error fetching user data:", error);
377
- throw error;
378
- }
379
- }
380
- async function fetchGitHubAvatar(userId) {
381
- try {
382
- const response = await axios.get(
383
- `https://api.github.com/user/${userId}`
384
- );
385
- return response.data.avatar_url;
386
- } catch (error) {
387
- console.warn("Failed to fetch GitHub avatar:", error);
388
- return null;
389
- }
390
- }
391
-
392
- // recce-source/js/src/lib/api/valuediff.ts
393
- async function submitValueDiff(params, options) {
394
- return await submitRun("value_diff", params, options);
395
- }
396
- async function submitValueDiffDetail(params, options) {
397
- return await submitRun("value_diff_detail", params, options);
398
- }
399
- function useVersionNumber() {
400
- const [version, setVersion] = useState("");
401
- const [latestVersion, setLatestVersion] = useState("");
402
- useEffect(() => {
403
- async function fetchVersion() {
404
- try {
405
- const { version: version2, latestVersion: latestVersion2 } = (await axiosClient.get(
406
- "/api/version"
407
- )).data;
408
- setVersion(version2);
409
- setLatestVersion(latestVersion2);
410
- } catch (error) {
411
- console.error("Error fetching version number:", error);
412
- }
413
- }
414
- void fetchVersion();
415
- }, []);
416
- return { version, latestVersion };
417
- }
418
-
419
- // recce-source/js/src/lib/api/localStorageKeys.ts
420
- var prefix = "recce-";
421
- var localStorageKeys = {
422
- bypassSaveOverwrite: `${prefix}-bypass-save-overwrite`,
423
- previewChangeFeedbackID: `${prefix}-preview-change-feedback`,
424
- prepareEnvGuideID: `${prefix}-prepare-env`
425
- };
426
-
427
- // recce-source/js/src/lib/api/sessionStorageKeys.ts
428
- var prefix2 = "recce";
429
- var sessionStorageKeys = {
430
- recommendationIgnored: `${prefix2}-recommendation-ignored`,
431
- recommendationShowed: `${prefix2}-recommendation-showed`,
432
- prevRefreshTimeStamp: `${prefix2}-prev-refresh-timestamp`,
433
- lineageNotificationDismissed: `${prefix2}-lineage-notification-dismissed`
434
- };
435
-
436
- export { aggregateRuns, axiosClient, cancelRun, connectToCloud, createCheckByRun, createLineageDiffCheck, createSchemaDiffCheck, createSimpleCheck, deleteCheck, exportState, fetchGitHubAvatar, fetchModelRowCount, fetchUser, getCheck, getCll, getLineage, getLineageDiff, getLineageWithError, getModelInfo, getRun, getServerFlag, getServerInfo, importState, isStateSyncing, listChecks, listRuns, localStorageKeys, markAsPresetCheck, markOnboardingCompleted, markRelaunchHintCompleted, queryModelRowCount, queryRowCount, reactQueryClient, rename, reorderChecks, saveAs, searchRuns, select, sessionStorageKeys, shareState, submitProfileDiff, submitQuery, submitQueryBase, submitQueryDiff, submitRowCountDiff, submitRun, submitRunFromCheck, submitValueDiff, submitValueDiffDetail, syncState, updateCheck, useChecks, useVersionNumber, waitRun };
437
- //# sourceMappingURL=api.mjs.map
438
- //# sourceMappingURL=api.mjs.map
6
+ export { aggregateRuns, axiosClient, cancelRun, connectToCloud, createCheckByRun, createLineageDiffCheck, createSchemaDiffCheck, createSimpleCheck, deleteCheck, exportState, fetchGitHubAvatar, fetchModelRowCount, fetchUser, getCheck, getCll, getLineage, getLineageDiff, getLineageWithError, getModelInfo, getRun, getServerFlag, getServerInfo, importState, isStateSyncing, listChecks, listRuns, localStorageKeys, markAsPresetCheck, markOnboardingCompleted, markRelaunchHintCompleted, queryModelRowCount, queryRowCount, reactQueryClient, rename, reorderChecks, saveAs, searchRuns, select, sessionStorageKeys, shareState, submitProfileDiff, submitQuery, submitQueryBase, submitQueryDiff, submitRowCountDiff, submitRun, submitRunFromCheck, submitValueDiff, submitValueDiffDetail, syncState, updateCheck, useChecks, useVersionNumber, waitRun };