react-semaphor 0.1.381 → 0.1.383

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 (86) hide show
  1. package/DATA_APP_SDK.md +238 -0
  2. package/README.md +7 -0
  3. package/dist/analytics-protocol/index.cjs +1 -1
  4. package/dist/analytics-protocol/index.js +45 -41
  5. package/dist/brand-studio/index.cjs +4 -4
  6. package/dist/brand-studio/index.js +28 -28
  7. package/dist/chunks/analyze-result-contract-CtXfp3nv.js +1 -0
  8. package/dist/chunks/analyze-result-contract-DuhlklhI.js +102 -0
  9. package/dist/chunks/{braces-DOxxfERN.js → braces--20GzUQh.js} +1 -1
  10. package/dist/chunks/{braces-BT-ZyB-g.js → braces-C0Vh_Mft.js} +1 -1
  11. package/dist/chunks/{calendar-preferences-dialog-Dsgs8WDv.js → calendar-preferences-dialog-B-VsxhsA.js} +4 -4
  12. package/dist/chunks/calendar-preferences-dialog-DE67Z3oQ.js +1 -0
  13. package/dist/chunks/catalog-field-grounding-Bnx-3tE0.js +1 -0
  14. package/dist/chunks/catalog-field-grounding-CJKAqtiC.js +100 -0
  15. package/dist/chunks/{dashboard-briefing-launcher-Coks66cV.js → dashboard-briefing-launcher-BIj3X7b3.js} +108 -107
  16. package/dist/chunks/dashboard-briefing-launcher-Czx6BcXW.js +80 -0
  17. package/dist/chunks/dashboard-controls-BP-DcPFs.js +52 -0
  18. package/dist/chunks/{dashboard-controls-BfkcnIdy.js → dashboard-controls-BXxucM4f.js} +115 -114
  19. package/dist/chunks/dashboard-json-BNwshkK2.js +1 -0
  20. package/dist/chunks/{dashboard-json-DjXi4cI6.js → dashboard-json-C6oZuipD.js} +9 -9
  21. package/dist/chunks/edit-dashboard-visual-BAprin3J.js +178 -0
  22. package/dist/chunks/{edit-dashboard-visual-DOW1Ap1N.js → edit-dashboard-visual-CmfrI_L3.js} +1278 -1277
  23. package/dist/chunks/{index-CkoRCh3g.js → index-4W_ElSBJ.js} +219 -239
  24. package/dist/chunks/{index-DlprYjr6.js → index-icb12JV1.js} +900 -952
  25. package/dist/chunks/{layout-grid-DccceHv4.js → layout-grid-B7-klXiK.js} +1 -1
  26. package/dist/chunks/{layout-grid-DTbOIOsE.js → layout-grid-DV89AC9_.js} +1 -1
  27. package/dist/chunks/operators-C8TxpM4C.js +48 -0
  28. package/dist/chunks/operators-DrTQsJXv.js +1 -0
  29. package/dist/chunks/{palette-DCzLwqIw.js → palette-5IwhMbSF.js} +1 -1
  30. package/dist/chunks/{palette-SimHJELn.js → palette-Dj-dgPYh.js} +1 -1
  31. package/dist/chunks/{save-zNVYH02T.js → save-16C6YSW2.js} +1 -1
  32. package/dist/chunks/{save-D2O96E5A.js → save-C5fwVdTF.js} +1 -1
  33. package/dist/chunks/search-0LmWwZzW.js +57 -0
  34. package/dist/chunks/search-Dq1Mbb03.js +21 -0
  35. package/dist/chunks/{source-identity-Dj3dryN9.js → source-identity-CN4xiyKJ.js} +5 -5
  36. package/dist/chunks/{switch-DMPsMpHW.js → switch-DUdaHFZQ.js} +2328 -2414
  37. package/dist/chunks/{switch-Jhyl63RF.js → switch-bdJp0Bkw.js} +29 -54
  38. package/dist/chunks/use-create-flow-overlay-state-BIHKf_XK.js +21 -0
  39. package/dist/chunks/{use-create-flow-overlay-state-r5JKyXU8.js → use-create-flow-overlay-state-YvqCp6Zo.js} +75 -75
  40. package/dist/chunks/{validators-CtNmgsvG.js → validators-CHPH6ORs.js} +641 -498
  41. package/dist/chunks/validators-lWo8m0Q7.js +1 -0
  42. package/dist/chunks/x-B_cx7LwM.js +26 -0
  43. package/dist/chunks/x-IdR_js6f.js +139 -0
  44. package/dist/dashboard/index.cjs +1 -1
  45. package/dist/dashboard/index.js +1 -1
  46. package/dist/dashboard-authoring/index.cjs +3 -3
  47. package/dist/dashboard-authoring/index.js +105 -92
  48. package/dist/data-app-builder/index.cjs +23 -23
  49. package/dist/data-app-builder/index.js +17 -15
  50. package/dist/data-app-sdk/index.cjs +68 -1
  51. package/dist/data-app-sdk/index.js +2731 -384
  52. package/dist/data-app-sdk-adapters/index.cjs +1 -0
  53. package/dist/data-app-sdk-adapters/index.js +383 -0
  54. package/dist/data-app-sdk-validation/index.cjs +1 -1
  55. package/dist/data-app-sdk-validation/index.js +1073 -6
  56. package/dist/index.cjs +1 -1
  57. package/dist/index.js +15 -15
  58. package/dist/surfboard/index.cjs +1 -1
  59. package/dist/surfboard/index.js +2 -2
  60. package/dist/types/analytics-protocol.d.ts +58 -31
  61. package/dist/types/dashboard-assistant.d.ts +40 -15
  62. package/dist/types/dashboard-authoring.d.ts +36 -16
  63. package/dist/types/dashboard.d.ts +8 -8
  64. package/dist/types/data-app-builder.d.ts +35 -11
  65. package/dist/types/data-app-sdk-adapters.d.ts +733 -0
  66. package/dist/types/data-app-sdk-validation.d.ts +85 -25
  67. package/dist/types/data-app-sdk.d.ts +217 -147
  68. package/dist/types/main.d.ts +35 -11
  69. package/dist/types/shared.d.ts +8 -8
  70. package/dist/types/surfboard.d.ts +8 -8
  71. package/dist/types/types.d.ts +8 -8
  72. package/package.json +9 -2
  73. package/src/data-app-sdk/README.md +240 -0
  74. package/dist/chunks/calendar-preferences-dialog-iZs8XqyH.js +0 -1
  75. package/dist/chunks/catalog-field-grounding-8L9I0zdg.js +0 -1
  76. package/dist/chunks/catalog-field-grounding-BK4BX8sZ.js +0 -200
  77. package/dist/chunks/dashboard-briefing-launcher-B5vPTl8P.js +0 -80
  78. package/dist/chunks/dashboard-controls-Dyqye6fh.js +0 -52
  79. package/dist/chunks/dashboard-json-CV_LnO9x.js +0 -1
  80. package/dist/chunks/edit-dashboard-visual-yinO0yU-.js +0 -178
  81. package/dist/chunks/index-BxM99sFL.js +0 -1
  82. package/dist/chunks/index-CuHybtft.js +0 -51
  83. package/dist/chunks/use-create-flow-overlay-state-NsqFPwdB.js +0 -21
  84. package/dist/chunks/validation-BM3-ShHV.js +0 -1003
  85. package/dist/chunks/validation-BVpqRFar.js +0 -1
  86. package/dist/chunks/validators-jpoYhpHh.js +0 -1
@@ -1,200 +0,0 @@
1
- const o = {
2
- answerSummary: "string",
3
- responseDetail: "responseDetail",
4
- mode: "string",
5
- comparisonType: "string",
6
- executionResult: "unknown",
7
- compiledQuery: "unknown",
8
- data: "unknown",
9
- resultSets: "record",
10
- columns: "unknownArray",
11
- records: "recordArray",
12
- rowCount: "number",
13
- rowLimitExceeded: "boolean",
14
- output: "string",
15
- querySpec: "unknown",
16
- metadata: "record",
17
- validation: "unknown",
18
- coverage: "unknown",
19
- diagnosticFeedback: "unknown",
20
- missingFields: "stringArray",
21
- warnings: "unknownArray",
22
- comparison: "unknown",
23
- population: "unknown",
24
- comparisons: "recordArray",
25
- fieldsUsed: "unknown",
26
- changes: "recordArray",
27
- largestNegativeChanges: "recordArray",
28
- largestPositiveChanges: "recordArray",
29
- drivers: "recordArray",
30
- absoluteDeltaDrivers: "recordArray",
31
- largestNegativeDrivers: "recordArray",
32
- largestPositiveDrivers: "recordArray",
33
- periodRows: "recordArray",
34
- sql: "unknown",
35
- omitted: "stringArray"
36
- }, g = new Set(
37
- Object.keys(o)
38
- ), w = /* @__PURE__ */ new Set([
39
- "compact",
40
- "standard",
41
- "debug"
42
- ]);
43
- function _() {
44
- return Object.keys(
45
- o
46
- );
47
- }
48
- function h(e) {
49
- return g.has(e);
50
- }
51
- function E(e) {
52
- if (!e || typeof e != "object" || Array.isArray(e))
53
- throw new Error("Semaphor analyze result must be an object.");
54
- const n = e, r = Object.keys(n).filter(
55
- (t) => !h(t)
56
- );
57
- if (r.length)
58
- throw new Error(
59
- `Semaphor analyze result contains unsupported top-level field(s): ${r.join(", ")}.`
60
- );
61
- for (const [t, a] of Object.entries(n)) {
62
- if (a === void 0)
63
- continue;
64
- const i = o[t];
65
- if (!b(a, i))
66
- throw new Error(
67
- `Semaphor analyze result field "${t}" does not match contract kind "${i}".`
68
- );
69
- }
70
- return n;
71
- }
72
- function b(e, n) {
73
- switch (n) {
74
- case "boolean":
75
- return typeof e == "boolean";
76
- case "number":
77
- return typeof e == "number" && Number.isFinite(e);
78
- case "record":
79
- return d(e);
80
- case "recordArray":
81
- return Array.isArray(e) && e.every(d);
82
- case "responseDetail":
83
- return typeof e == "string" && w.has(e);
84
- case "string":
85
- return typeof e == "string";
86
- case "stringArray":
87
- return Array.isArray(e) && e.every((r) => typeof r == "string");
88
- case "unknown":
89
- return !0;
90
- case "unknownArray":
91
- return Array.isArray(e);
92
- }
93
- }
94
- function d(e) {
95
- return !!(e && typeof e == "object" && !Array.isArray(e));
96
- }
97
- function c(e) {
98
- return typeof e == "string" ? e.trim().toLowerCase() : "";
99
- }
100
- function k(e) {
101
- return String(e.column_name || e.name || e.qualifiedFieldName || "");
102
- }
103
- function S(e) {
104
- return Array.from(
105
- new Set(
106
- [
107
- e.column_name,
108
- e.name,
109
- e.qualifiedFieldName,
110
- e.alias
111
- ].filter(
112
- (n) => typeof n == "string" && n.trim().length > 0
113
- ).map((n) => n.trim())
114
- )
115
- );
116
- }
117
- function y(e) {
118
- const n = C(e);
119
- return n ? n.includes("int") || n.includes("uint") || n.includes("bigint") || n.includes("smallint") || n.includes("tinyint") || n.includes("numeric") || n.includes("decimal") || n.includes("double") || n.includes("float") || n.includes("number") || n.includes("real") || n.includes("money") || n.includes("currency") || n.includes("percent") ? "number" : n.includes("timestamp") || n.includes("datetime") || n.startsWith("time") ? "datetime" : n.includes("date") ? "date" : n.includes("bool") ? "boolean" : "string" : "unknown";
120
- }
121
- function C(e) {
122
- let n = c(e), r = "";
123
- for (; n && n !== r; )
124
- r = n, n = u(n, "nullable"), n = u(n, "lowcardinality");
125
- return n;
126
- }
127
- function u(e, n) {
128
- const r = `${n}(`;
129
- return !e.startsWith(r) || !e.endsWith(")") ? e : e.slice(r.length, -1).trim();
130
- }
131
- function D(e) {
132
- const n = y(e);
133
- return n === "date" || n === "datetime";
134
- }
135
- function m(e) {
136
- return D(e.dataType || e.data_type);
137
- }
138
- function f(e) {
139
- const n = p(e);
140
- return n === "id" || n === "row_id";
141
- }
142
- function l(e) {
143
- const n = p(e);
144
- return f(e) || n.endsWith("_id") || n.endsWith("_key") || n.endsWith("_number");
145
- }
146
- function p(e) {
147
- return c(
148
- k(e) || e.name || e.alias
149
- ).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
150
- }
151
- function A(e, n = {}) {
152
- const r = c(e.role);
153
- return r === "metric" || r === "measure" ? !n.excludeIdentifiers || !l(e) : r === "groupby" || r === "dimension" || r === "date" || r === "id" ? !1 : y(
154
- e.dataType || e.data_type
155
- ) === "number" && (!n.excludeIdentifiers || !l(e));
156
- }
157
- function F(e) {
158
- return !A(e) && !m(e);
159
- }
160
- function T(e) {
161
- const n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
162
- for (const a of e) {
163
- if (f(a))
164
- continue;
165
- const i = S(a);
166
- if (i.length !== 0) {
167
- if (m(a)) {
168
- i.forEach((s) => r.add(s));
169
- continue;
170
- }
171
- if (A(a, { excludeIdentifiers: !0 })) {
172
- i.forEach((s) => n.add(s));
173
- continue;
174
- }
175
- i.forEach((s) => t.add(s));
176
- }
177
- }
178
- return {
179
- validMetricCandidates: Array.from(n).sort(),
180
- validDateCandidates: Array.from(r).sort(),
181
- validDimensionCandidates: Array.from(t).sort()
182
- };
183
- }
184
- export {
185
- o as S,
186
- k as a,
187
- S as b,
188
- y as c,
189
- D as d,
190
- m as e,
191
- f,
192
- _ as g,
193
- l as h,
194
- h as i,
195
- A as j,
196
- F as k,
197
- T as l,
198
- c as n,
199
- E as p
200
- };