@quicdata/analytics 0.0.3 → 0.0.4

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 (73) hide show
  1. package/core/auth.d.ts +19 -0
  2. package/core/auth.d.ts.map +1 -0
  3. package/core/auth.js +34 -0
  4. package/core/fetch-data.d.ts +115 -0
  5. package/core/fetch-data.d.ts.map +1 -0
  6. package/core/fetch-data.js +210 -0
  7. package/core/index.d.ts +8 -1
  8. package/core/index.d.ts.map +1 -1
  9. package/core/index.js +4 -3
  10. package/core/types.d.ts +250 -0
  11. package/core/types.d.ts.map +1 -0
  12. package/core/types.js +1 -0
  13. package/core/viewport-observer.d.ts +26 -0
  14. package/core/viewport-observer.d.ts.map +1 -0
  15. package/core/viewport-observer.js +38 -0
  16. package/core/widget-transform-runner.d.ts +22 -0
  17. package/core/widget-transform-runner.d.ts.map +1 -0
  18. package/core/widget-transform-runner.js +102 -0
  19. package/dashboard/dashboard-container.d.ts +100 -0
  20. package/dashboard/dashboard-container.d.ts.map +1 -0
  21. package/dashboard/dashboard-container.js +315 -0
  22. package/dashboard/index.d.ts +4 -0
  23. package/dashboard/index.d.ts.map +1 -0
  24. package/dashboard/index.js +2 -0
  25. package/designer/analytics-designer.d.ts +40 -0
  26. package/designer/analytics-designer.d.ts.map +1 -0
  27. package/designer/analytics-designer.js +267 -0
  28. package/designer/index.d.ts +5 -0
  29. package/designer/index.d.ts.map +1 -0
  30. package/designer/index.js +3 -0
  31. package/filters/filter-bar.d.ts +34 -0
  32. package/filters/filter-bar.d.ts.map +1 -0
  33. package/filters/filter-bar.js +233 -0
  34. package/filters/filter-button.d.ts +22 -0
  35. package/filters/filter-button.d.ts.map +1 -0
  36. package/filters/filter-button.js +86 -0
  37. package/filters/index.d.ts +7 -0
  38. package/filters/index.d.ts.map +1 -0
  39. package/filters/index.js +6 -0
  40. package/filters/widget-toolbar.d.ts +24 -0
  41. package/filters/widget-toolbar.d.ts.map +1 -0
  42. package/filters/widget-toolbar.js +216 -0
  43. package/index.d.ts +9 -1
  44. package/index.d.ts.map +1 -1
  45. package/index.js +6 -1
  46. package/package.json +14 -8
  47. package/widgets/analytics-report.d.ts +49 -0
  48. package/widgets/analytics-report.d.ts.map +1 -0
  49. package/widgets/analytics-report.js +306 -0
  50. package/widgets/analytics-widget.d.ts +39 -0
  51. package/widgets/analytics-widget.d.ts.map +1 -0
  52. package/widgets/analytics-widget.js +230 -0
  53. package/widgets/bar-chart.d.ts +13 -0
  54. package/widgets/bar-chart.d.ts.map +1 -0
  55. package/widgets/bar-chart.js +77 -0
  56. package/widgets/base-chart.d.ts +94 -0
  57. package/widgets/base-chart.d.ts.map +1 -0
  58. package/widgets/base-chart.js +535 -0
  59. package/widgets/index.d.ts +13 -1
  60. package/widgets/index.d.ts.map +1 -1
  61. package/widgets/index.js +14 -3
  62. package/widgets/line-chart.d.ts +13 -0
  63. package/widgets/line-chart.d.ts.map +1 -0
  64. package/widgets/line-chart.js +71 -0
  65. package/widgets/pie-chart.d.ts +13 -0
  66. package/widgets/pie-chart.d.ts.map +1 -0
  67. package/widgets/pie-chart.js +55 -0
  68. package/widgets/table.d.ts +101 -0
  69. package/widgets/table.d.ts.map +1 -0
  70. package/widgets/table.js +740 -0
  71. package/workers/widget-transform.worker.d.ts +21 -0
  72. package/workers/widget-transform.worker.d.ts.map +1 -0
  73. package/workers/widget-transform.worker.js +30 -0
package/core/auth.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Analytics API auth: Bearer token for all requests (reports, widgets, datasets).
3
+ * Set once via setAnalyticsApiKey(); every fetch in this package will include it.
4
+ */
5
+ /**
6
+ * Set the API key (Bearer token) for all subsequent analytics API requests.
7
+ * Pass null or '' to clear. Used by report, chart widget, and table widget requests.
8
+ */
9
+ export declare function setAnalyticsApiKey(key: string | null): void;
10
+ /**
11
+ * Get the current API key (for tests or inspection). Prefer setAnalyticsApiKey for configuration.
12
+ */
13
+ export declare function getAnalyticsApiKey(): string | null;
14
+ /**
15
+ * Request init options for fetch: credentials and optional Authorization header.
16
+ * Use in all analytics fetch() calls so Bearer token is applied when set.
17
+ */
18
+ export declare function getAnalyticsRequestInit(init?: RequestInit): RequestInit;
19
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../libs/analytics/src/core/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAElD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,CAWvE"}
package/core/auth.js ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Analytics API auth: Bearer token for all requests (reports, widgets, datasets).
3
+ * Set once via setAnalyticsApiKey(); every fetch in this package will include it.
4
+ */
5
+ let apiKey = null;
6
+ /**
7
+ * Set the API key (Bearer token) for all subsequent analytics API requests.
8
+ * Pass null or '' to clear. Used by report, chart widget, and table widget requests.
9
+ */
10
+ export function setAnalyticsApiKey(key) {
11
+ apiKey = key && String(key).trim() ? String(key).trim() : null;
12
+ }
13
+ /**
14
+ * Get the current API key (for tests or inspection). Prefer setAnalyticsApiKey for configuration.
15
+ */
16
+ export function getAnalyticsApiKey() {
17
+ return apiKey;
18
+ }
19
+ /**
20
+ * Request init options for fetch: credentials and optional Authorization header.
21
+ * Use in all analytics fetch() calls so Bearer token is applied when set.
22
+ */
23
+ export function getAnalyticsRequestInit(init) {
24
+ const base = {
25
+ credentials: 'same-origin',
26
+ ...init,
27
+ };
28
+ if (apiKey) {
29
+ const headers = new Headers(init?.headers);
30
+ headers.set('Authorization', `Bearer ${apiKey}`);
31
+ return { ...base, headers };
32
+ }
33
+ return base;
34
+ }
@@ -0,0 +1,115 @@
1
+ import type { AnalyticsDataResponse, FilterDefinition } from './types.js';
2
+ /** Build widget data URL from API base (host + prefix) and widget id. Path: /widgets/{id}/data */
3
+ export declare function buildWidgetDataUrl(apiUrl: string, widgetId: string | number): string;
4
+ /** Build widget definition URL. Path: /widgets/{id} (no data). */
5
+ export declare function buildWidgetDefinitionUrl(apiUrl: string, widgetId: string | number): string;
6
+ /** Build report definition URL. GET /reports/definitions/{id} */
7
+ export declare function buildReportDefinitionUrl(apiUrl: string, reportId: string | number): string;
8
+ /** Build report filters URL (with optional query params for context). GET /reports/definitions/{id}/filters */
9
+ export declare function buildReportFiltersUrl(apiUrl: string, reportId: string | number, params?: AnalyticsRequestParams): string;
10
+ /** Build report data URL (JSON, same shape as widget/data). GET /reports/definitions/{id}/data */
11
+ export declare function buildReportDataUrl(apiUrl: string, reportId: string | number, params?: AnalyticsRequestParams): string;
12
+ /** Build report preview URL (HTML). GET /reports/definitions/{id}/preview */
13
+ export declare function buildReportPreviewUrl(apiUrl: string, reportId: string | number, params?: AnalyticsRequestParams): string;
14
+ /** Build report PDF download URL. GET /reports/definitions/{id}/pdf */
15
+ export declare function buildReportPdfUrl(apiUrl: string, reportId: string | number, params?: AnalyticsRequestParams): string;
16
+ /** Build report Excel download URL. GET /reports/definitions/{id}/excel */
17
+ export declare function buildReportExcelUrl(apiUrl: string, reportId: string | number, params?: AnalyticsRequestParams): string;
18
+ /** Append query params to a base URL (e.g. from definition preview_url). */
19
+ export declare function appendParamsToUrl(baseUrl: string, params?: Record<string, string | number | boolean>): string;
20
+ /** Report definition API response (GET /reports/definitions/{id}). */
21
+ export interface ReportDefinitionApiResponse {
22
+ id?: number;
23
+ name?: string;
24
+ definition?: Record<string, unknown>;
25
+ /** Resolved filters (with options for presets); use when present instead of definition.filters. */
26
+ resolved_filters?: FilterDefinition[];
27
+ /** URLs from definition model (preview, PDF, Excel). Use these when present. */
28
+ preview_url?: string;
29
+ download_pdf_url?: string;
30
+ download_excel_url?: string;
31
+ data?: {
32
+ id?: number;
33
+ name?: string;
34
+ definition?: Record<string, unknown>;
35
+ resolved_filters?: FilterDefinition[];
36
+ preview_url?: string;
37
+ download_pdf_url?: string;
38
+ download_excel_url?: string;
39
+ };
40
+ }
41
+ /** Result of fetchReportDefinition: name, filters, and optional export URLs from definition. */
42
+ export interface ReportDefinitionResult {
43
+ name: string;
44
+ /** Filter definitions from definition.filters (same shape as FilterDefinition). */
45
+ filters: FilterDefinition[];
46
+ /** When present, use for toolbar links (append current params as query). */
47
+ preview_url?: string;
48
+ download_pdf_url?: string;
49
+ download_excel_url?: string;
50
+ }
51
+ /** Fetch report definition (name, filters) from GET /reports/definitions/{id}. No separate filters API call. */
52
+ export declare function fetchReportDefinition(apiUrl: string, reportId: string | number): Promise<ReportDefinitionResult>;
53
+ /** Fetch resolved report filters (with options) from GET /reports/definitions/{id}/filters. */
54
+ export declare function fetchReportFilters(apiUrl: string, reportId: string | number, params?: AnalyticsRequestParams): Promise<{
55
+ filters: FilterDefinition[];
56
+ }>;
57
+ /** Chart type from API: Bar, BarHorizontal, Line, Pie, Donut, Number, Table. */
58
+ export type WidgetChartType = 'Bar' | 'BarHorizontal' | 'Line' | 'Pie' | 'Donut' | 'Number' | 'Table';
59
+ /** Definition subset passed from analytics-widget to inner chart/table to avoid refetching. */
60
+ export interface WidgetDefinitionSubset {
61
+ title: string;
62
+ filters: FilterDefinition[];
63
+ hide_filter: boolean;
64
+ }
65
+ /** Widget definition response (GET /widgets/{id}): definition.title, definition.chart_type, definition.filters, etc. */
66
+ export interface WidgetDefinitionApiResponse {
67
+ definition?: {
68
+ title?: string;
69
+ chart_type?: string;
70
+ filters?: FilterDefinition[];
71
+ hide_filter?: boolean;
72
+ refresh_rate?: number;
73
+ };
74
+ /** Top-level name when response is not wrapped in data (e.g. from some backends). */
75
+ name?: string;
76
+ }
77
+ /**
78
+ * Fetch widget definition (no data) from Laravel GET /widgets/{id}. Use first so filters (and default_value) are available before fetching data.
79
+ */
80
+ export declare function fetchWidgetDefinition(apiUrl: string, widgetId: string | number): Promise<{
81
+ title: string;
82
+ chart_type: WidgetChartType;
83
+ filters: FilterDefinition[];
84
+ hide_filter: boolean;
85
+ refresh_rate: number;
86
+ }>;
87
+ /** Params for analytics request. dashboard_params is sent as nested query keys (dashboard_params[key]=value). */
88
+ export type AnalyticsRequestParams = Record<string, string | number | boolean | Record<string, string | number | boolean>>;
89
+ /**
90
+ * Fetch widget/dataset data from Laravel analytics API.
91
+ * @param dataUrl Full URL (e.g. /api/analytics/widgets/1/data) or path; optional params appended.
92
+ * @param params Query params merged into URL. Use dashboard_params key for dashboard-level filters (sent as dashboard_params[key]=value).
93
+ * @returns Parsed { data, meta } from API.
94
+ */
95
+ export declare function fetchAnalyticsData(dataUrl: string, params?: AnalyticsRequestParams): Promise<AnalyticsDataResponse>;
96
+ /** Full widget/data response shape from Laravel (widgetData, data, meta, filters, refresh_rate, hide_filter). */
97
+ export interface WidgetDataApiResponse {
98
+ data?: Record<string, unknown>[];
99
+ meta?: {
100
+ columns: Record<string, {
101
+ type?: string;
102
+ }>;
103
+ };
104
+ widgetData?: unknown;
105
+ filters?: FilterDefinition[];
106
+ refresh_rate?: number;
107
+ /** When true, widget filter toolbar is hidden and widget filter params are not sent. */
108
+ hide_filter?: boolean;
109
+ }
110
+ /**
111
+ * Fetch widget data from Laravel widget/data endpoint. Returns full response including filters and refresh_rate.
112
+ * Use for widgets that need filter definitions from the API (e.g. per-widget filter bar).
113
+ */
114
+ export declare function fetchWidgetData(dataUrl: string, params?: AnalyticsRequestParams): Promise<WidgetDataApiResponse>;
115
+ //# sourceMappingURL=fetch-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-data.d.ts","sourceRoot":"","sources":["../../../../libs/analytics/src/core/fetch-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG1E,kGAAkG;AAClG,wBAAgB,kBAAkB,C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C9B,OAAO,CAAC,qBAAqB,CAAC,CAehC;AAED,iHAAiH;AACjH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACjC,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAmBhC"}
@@ -0,0 +1,210 @@
1
+ import { getAnalyticsRequestInit } from './auth.js';
2
+ /** Build widget data URL from API base (host + prefix) and widget id. Path: /widgets/{id}/data */
3
+ export function buildWidgetDataUrl(apiUrl, widgetId) {
4
+ const base = (apiUrl || '').replace(/\/$/, '');
5
+ return `${base}/widgets/${widgetId}/data`;
6
+ }
7
+ /** Build widget definition URL. Path: /widgets/{id} (no data). */
8
+ export function buildWidgetDefinitionUrl(apiUrl, widgetId) {
9
+ const base = (apiUrl || '').replace(/\/$/, '');
10
+ return `${base}/widgets/${widgetId}`;
11
+ }
12
+ /** Report definition base path. Path: /reports/definitions/{id} */
13
+ function reportDefinitionBase(apiUrl, reportId) {
14
+ const base = (apiUrl || '').replace(/\/$/, '');
15
+ return `${base}/reports/definitions/${reportId}`;
16
+ }
17
+ /** Build report definition URL. GET /reports/definitions/{id} */
18
+ export function buildReportDefinitionUrl(apiUrl, reportId) {
19
+ return reportDefinitionBase(apiUrl, reportId);
20
+ }
21
+ /** Build report filters URL (with optional query params for context). GET /reports/definitions/{id}/filters */
22
+ export function buildReportFiltersUrl(apiUrl, reportId, params) {
23
+ const url = new URL(reportDefinitionBase(apiUrl, reportId) + '/filters', typeof window !== 'undefined' ? window.location.origin : undefined);
24
+ if (params) {
25
+ const flat = flattenParams(params);
26
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, v));
27
+ }
28
+ return url.toString();
29
+ }
30
+ /** Build report data URL (JSON, same shape as widget/data). GET /reports/definitions/{id}/data */
31
+ export function buildReportDataUrl(apiUrl, reportId, params) {
32
+ const url = new URL(reportDefinitionBase(apiUrl, reportId) + '/data', typeof window !== 'undefined' ? window.location.origin : undefined);
33
+ if (params) {
34
+ const flat = flattenParams(params);
35
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, v));
36
+ }
37
+ return url.toString();
38
+ }
39
+ /** Build report preview URL (HTML). GET /reports/definitions/{id}/preview */
40
+ export function buildReportPreviewUrl(apiUrl, reportId, params) {
41
+ const url = new URL(reportDefinitionBase(apiUrl, reportId) + '/preview', typeof window !== 'undefined' ? window.location.origin : undefined);
42
+ if (params) {
43
+ const flat = flattenParams(params);
44
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, v));
45
+ }
46
+ return url.toString();
47
+ }
48
+ /** Build report PDF download URL. GET /reports/definitions/{id}/pdf */
49
+ export function buildReportPdfUrl(apiUrl, reportId, params) {
50
+ const url = new URL(reportDefinitionBase(apiUrl, reportId) + '/pdf', typeof window !== 'undefined' ? window.location.origin : undefined);
51
+ if (params) {
52
+ const flat = flattenParams(params);
53
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, v));
54
+ }
55
+ return url.toString();
56
+ }
57
+ /** Build report Excel download URL. GET /reports/definitions/{id}/excel */
58
+ export function buildReportExcelUrl(apiUrl, reportId, params) {
59
+ const url = new URL(reportDefinitionBase(apiUrl, reportId) + '/excel', typeof window !== 'undefined' ? window.location.origin : undefined);
60
+ if (params) {
61
+ const flat = flattenParams(params);
62
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, v));
63
+ }
64
+ return url.toString();
65
+ }
66
+ /** Append query params to a base URL (e.g. from definition preview_url). */
67
+ export function appendParamsToUrl(baseUrl, params) {
68
+ if (!params || Object.keys(params).length === 0)
69
+ return baseUrl;
70
+ try {
71
+ const url = new URL(baseUrl, typeof window !== 'undefined' ? window.location.origin : undefined);
72
+ const flat = flattenParams(params);
73
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, String(v)));
74
+ return url.toString();
75
+ }
76
+ catch {
77
+ const sep = baseUrl.includes('?') ? '&' : '?';
78
+ const qs = new URLSearchParams(Object.entries(flattenParams(params))).toString();
79
+ return qs ? `${baseUrl}${sep}${qs}` : baseUrl;
80
+ }
81
+ }
82
+ /** Fetch report definition (name, filters) from GET /reports/definitions/{id}. No separate filters API call. */
83
+ export async function fetchReportDefinition(apiUrl, reportId) {
84
+ const url = buildReportDefinitionUrl(apiUrl, reportId);
85
+ const res = await fetch(url, getAnalyticsRequestInit());
86
+ if (!res.ok) {
87
+ throw new Error(`Report definition failed: ${res.status} ${res.statusText}`);
88
+ }
89
+ const json = (await res.json());
90
+ const data = json.data ?? json;
91
+ const name = (data && typeof data === 'object' && 'name' in data && data.name != null)
92
+ ? String(data.name)
93
+ : (json.name != null ? String(json.name) : '');
94
+ const def = (data && typeof data === 'object' && 'definition' in data && data.definition) ?? json.definition;
95
+ const rawDef = def && typeof def === 'object' ? def : null;
96
+ const rawFiltersArr = rawDef && Array.isArray(rawDef.filters) ? rawDef.filters : [];
97
+ const resolved = (data && typeof data === 'object' && 'resolved_filters' in data && data.resolved_filters)
98
+ ?? json.resolved_filters;
99
+ const filters = (Array.isArray(resolved) ? resolved : rawFiltersArr);
100
+ const previewUrl = (data && typeof data === 'object' && 'preview_url' in data && data.preview_url) ?? json.preview_url;
101
+ const downloadPdfUrl = (data && typeof data === 'object' && 'download_pdf_url' in data && data.download_pdf_url) ?? json.download_pdf_url;
102
+ const downloadExcelUrl = (data && typeof data === 'object' && 'download_excel_url' in data && data.download_excel_url) ?? json.download_excel_url;
103
+ return {
104
+ name,
105
+ filters,
106
+ ...(typeof previewUrl === 'string' && previewUrl && { preview_url: previewUrl }),
107
+ ...(typeof downloadPdfUrl === 'string' && downloadPdfUrl && { download_pdf_url: downloadPdfUrl }),
108
+ ...(typeof downloadExcelUrl === 'string' && downloadExcelUrl && { download_excel_url: downloadExcelUrl }),
109
+ };
110
+ }
111
+ /** Fetch resolved report filters (with options) from GET /reports/definitions/{id}/filters. */
112
+ export async function fetchReportFilters(apiUrl, reportId, params) {
113
+ const url = buildReportFiltersUrl(apiUrl, reportId, params);
114
+ const res = await fetch(url, getAnalyticsRequestInit());
115
+ if (!res.ok) {
116
+ throw new Error(`Report filters failed: ${res.status} ${res.statusText}`);
117
+ }
118
+ const json = (await res.json());
119
+ return { filters: json.filters ?? [] };
120
+ }
121
+ /**
122
+ * Fetch widget definition (no data) from Laravel GET /widgets/{id}. Use first so filters (and default_value) are available before fetching data.
123
+ */
124
+ export async function fetchWidgetDefinition(apiUrl, widgetId) {
125
+ const url = buildWidgetDefinitionUrl(apiUrl, widgetId);
126
+ const res = await fetch(url.toString(), getAnalyticsRequestInit());
127
+ if (!res.ok) {
128
+ throw new Error(`Widget definition failed: ${res.status} ${res.statusText}`);
129
+ }
130
+ const json = (await res.json());
131
+ const def = json.definition ?? json.data?.definition ?? {};
132
+ const title = (def.title != null && def.title !== '')
133
+ ? String(def.title)
134
+ : (json.data?.name != null ? String(json.data.name) : json.name != null ? String(json.name) : '');
135
+ const rawChartType = def.chart_type ?? '';
136
+ const chart_type = ['Bar', 'BarHorizontal', 'Line', 'Pie', 'Donut', 'Number', 'Table'].includes(rawChartType)
137
+ ? rawChartType
138
+ : 'Table';
139
+ return {
140
+ title: title ?? '',
141
+ chart_type,
142
+ filters: def.filters ?? [],
143
+ hide_filter: def.hide_filter ?? false,
144
+ refresh_rate: def.refresh_rate ?? 0,
145
+ };
146
+ }
147
+ function flattenParams(params) {
148
+ const out = {};
149
+ for (const [k, v] of Object.entries(params)) {
150
+ if (v === undefined || v === null || v === '')
151
+ continue;
152
+ if (k === 'dashboard_params' && typeof v === 'object' && v !== null && !Array.isArray(v)) {
153
+ for (const [dk, dv] of Object.entries(v)) {
154
+ if (dv !== undefined && dv !== null && dv !== '') {
155
+ out[`dashboard_params[${dk}]`] = String(dv);
156
+ }
157
+ }
158
+ }
159
+ else {
160
+ out[k] = String(v);
161
+ }
162
+ }
163
+ return out;
164
+ }
165
+ /**
166
+ * Fetch widget/dataset data from Laravel analytics API.
167
+ * @param dataUrl Full URL (e.g. /api/analytics/widgets/1/data) or path; optional params appended.
168
+ * @param params Query params merged into URL. Use dashboard_params key for dashboard-level filters (sent as dashboard_params[key]=value).
169
+ * @returns Parsed { data, meta } from API.
170
+ */
171
+ export async function fetchAnalyticsData(dataUrl, params) {
172
+ const url = new URL(dataUrl, typeof window !== 'undefined' ? window.location.origin : undefined);
173
+ if (params) {
174
+ const flat = flattenParams(params);
175
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, v));
176
+ }
177
+ const res = await fetch(url.toString(), getAnalyticsRequestInit());
178
+ if (!res.ok) {
179
+ throw new Error(`Analytics data failed: ${res.status} ${res.statusText}`);
180
+ }
181
+ const json = (await res.json());
182
+ return {
183
+ data: json.data ?? [],
184
+ meta: json.meta ?? { columns: {} },
185
+ };
186
+ }
187
+ /**
188
+ * Fetch widget data from Laravel widget/data endpoint. Returns full response including filters and refresh_rate.
189
+ * Use for widgets that need filter definitions from the API (e.g. per-widget filter bar).
190
+ */
191
+ export async function fetchWidgetData(dataUrl, params) {
192
+ const url = new URL(dataUrl, typeof window !== 'undefined' ? window.location.origin : undefined);
193
+ if (params) {
194
+ const flat = flattenParams(params);
195
+ Object.entries(flat).forEach(([k, v]) => url.searchParams.set(k, v));
196
+ }
197
+ const res = await fetch(url.toString(), getAnalyticsRequestInit());
198
+ if (!res.ok) {
199
+ throw new Error(`Widget data failed: ${res.status} ${res.statusText}`);
200
+ }
201
+ const json = (await res.json());
202
+ return {
203
+ data: json.data ?? [],
204
+ meta: json.meta ?? { columns: {} },
205
+ widgetData: json.widgetData,
206
+ filters: json.filters ?? [],
207
+ refresh_rate: json.refresh_rate,
208
+ hide_filter: json.hide_filter ?? false,
209
+ };
210
+ }
package/core/index.d.ts CHANGED
@@ -1,2 +1,9 @@
1
- export declare function core(): string;
1
+ export { setAnalyticsApiKey, getAnalyticsApiKey, getAnalyticsRequestInit } from './auth.js';
2
+ export { buildWidgetDataUrl, buildWidgetDefinitionUrl, fetchAnalyticsData, fetchWidgetData, fetchWidgetDefinition, buildReportDefinitionUrl, buildReportFiltersUrl, buildReportPreviewUrl, buildReportPdfUrl, buildReportExcelUrl, fetchReportDefinition, fetchReportFilters, } from './fetch-data.js';
3
+ export type { AnalyticsRequestParams, WidgetDataApiResponse, WidgetChartType, WidgetDefinitionApiResponse, WidgetDefinitionSubset, ReportDefinitionApiResponse, ReportDefinitionResult, } from './fetch-data.js';
4
+ export type { AnalyticsDataResponse, AnalyticsDataMeta, WidgetDataResponse, WidgetDataOptions, DatetimeGranularity, DimensionRef, MeasureRef, FilterItem, FilterDefinition, FilterOption, CommonChartConfig, BarChartConfig, LineChartConfig, DonutPieChartConfig, NumberKpiChartConfig, TableChartConfig, ChartType, WidgetDefinitionConfig, LazyWidgetOptions, WorkerWidgetOptions, } from './types.js';
5
+ export { observeViewport } from './viewport-observer.js';
6
+ export type { ViewportObserverOptions, ViewportObserverCallbacks } from './viewport-observer.js';
7
+ export { runWidgetTransform } from './widget-transform-runner.js';
8
+ export type { WidgetTransformInput, WidgetTransformOptions } from './widget-transform-runner.js';
2
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/analytics/src/core/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,IAAI,MAAM,CAE7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/analytics/src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAC5F,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC"}
package/core/index.js CHANGED
@@ -1,3 +1,4 @@
1
- export function core() {
2
- return 'core';
3
- }
1
+ export { setAnalyticsApiKey, getAnalyticsApiKey, getAnalyticsRequestInit } from './auth.js';
2
+ export { buildWidgetDataUrl, buildWidgetDefinitionUrl, fetchAnalyticsData, fetchWidgetData, fetchWidgetDefinition, buildReportDefinitionUrl, buildReportFiltersUrl, buildReportPreviewUrl, buildReportPdfUrl, buildReportExcelUrl, fetchReportDefinition, fetchReportFilters, } from './fetch-data.js';
3
+ export { observeViewport } from './viewport-observer.js';
4
+ export { runWidgetTransform } from './widget-transform-runner.js';
@@ -0,0 +1,250 @@
1
+ /**
2
+ * API response shape from Laravel analytics dataset/widget data endpoints.
3
+ * KoolReport returns { data: rows, meta: { columns: Record<string, { type: string }> } }.
4
+ */
5
+ export interface AnalyticsDataMeta {
6
+ columns: Record<string, {
7
+ type?: string;
8
+ }>;
9
+ }
10
+ export interface AnalyticsDataResponse {
11
+ data: Record<string, unknown>[];
12
+ meta: AnalyticsDataMeta;
13
+ }
14
+ /** Full widget/data API response: widgetData, data, meta, filters, refresh_rate. */
15
+ export interface WidgetDataResponse extends AnalyticsDataResponse {
16
+ widgetData?: unknown;
17
+ filters?: FilterDefinition[];
18
+ refresh_rate?: number;
19
+ }
20
+ export interface WidgetDataOptions {
21
+ /** Base URL for API (e.g. /api/analytics). */
22
+ baseUrl?: string;
23
+ /** Query params to append (e.g. date_from, date_to). */
24
+ params?: Record<string, string | number | boolean>;
25
+ }
26
+ /**
27
+ * Insights-inspired widget config types.
28
+ * Emphasis on granularity for datetime dimensions (year, month, quarter, day, week).
29
+ */
30
+ /** Supported granularity for datetime columns. */
31
+ export type DatetimeGranularity = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour';
32
+ export interface DimensionRef {
33
+ column_name: string;
34
+ data_type: string;
35
+ dimension_name?: string;
36
+ label?: string;
37
+ value?: string;
38
+ /** Only for datetime columns. */
39
+ granularity?: DatetimeGranularity;
40
+ }
41
+ export interface MeasureRef {
42
+ aggregation: 'count' | 'sum' | 'avg' | 'min' | 'max';
43
+ column_name: string;
44
+ data_type: string;
45
+ measure_name?: string;
46
+ }
47
+ export interface FilterItem {
48
+ column?: string;
49
+ operator?: string;
50
+ value?: unknown;
51
+ }
52
+ export interface CommonChartConfig {
53
+ filters?: {
54
+ filters: FilterItem[];
55
+ logical_operator: 'And' | 'Or';
56
+ };
57
+ limit?: string;
58
+ order_by?: Array<{
59
+ column: {
60
+ column_name: string;
61
+ type: string;
62
+ };
63
+ direction: 'asc' | 'desc';
64
+ }>;
65
+ }
66
+ export interface BarChartConfig extends CommonChartConfig {
67
+ x_axis: {
68
+ dimension: DimensionRef;
69
+ };
70
+ y_axis: {
71
+ series: Array<{
72
+ measure: MeasureRef;
73
+ }>;
74
+ stack?: boolean;
75
+ overlap?: boolean;
76
+ normalize?: boolean;
77
+ show_axis_label?: boolean;
78
+ show_data_labels?: boolean;
79
+ show_scrollbar?: boolean;
80
+ };
81
+ split_by?: {
82
+ dimension: DimensionRef;
83
+ max_split_values?: string;
84
+ };
85
+ }
86
+ export interface LineChartConfig extends CommonChartConfig {
87
+ x_axis: {
88
+ dimension: DimensionRef;
89
+ };
90
+ y_axis: {
91
+ series: Array<{
92
+ measure: MeasureRef;
93
+ }>;
94
+ stack?: boolean;
95
+ show_axis_label?: boolean;
96
+ show_data_labels?: boolean;
97
+ };
98
+ split_by?: {
99
+ dimension: DimensionRef;
100
+ max_split_values?: string;
101
+ };
102
+ }
103
+ export interface DonutPieChartConfig extends CommonChartConfig {
104
+ label_column: {
105
+ dimension: DimensionRef;
106
+ };
107
+ value_column: {
108
+ measure: MeasureRef;
109
+ };
110
+ label_position?: 'left' | 'right' | 'top' | 'bottom';
111
+ legend_position?: 'left' | 'right' | 'top' | 'bottom';
112
+ max_slices?: string;
113
+ show_inline_labels?: boolean;
114
+ }
115
+ export interface NumberKpiChartConfig extends CommonChartConfig {
116
+ number_columns: Array<{
117
+ measure: MeasureRef;
118
+ }>;
119
+ number_column_options?: Array<{
120
+ decimal?: string;
121
+ prefix?: string;
122
+ suffix?: string;
123
+ }>;
124
+ date_column?: {
125
+ dimension: DimensionRef;
126
+ };
127
+ comparison?: boolean;
128
+ shorten_numbers?: boolean;
129
+ sparkline?: boolean;
130
+ }
131
+ export interface TableChartConfig extends CommonChartConfig {
132
+ columns?: Array<{
133
+ column_name: string;
134
+ label?: string;
135
+ format?: string;
136
+ type?: string;
137
+ }>;
138
+ page_size?: number;
139
+ }
140
+ export type ChartType = 'Bar' | 'BarHorizontal' | 'Line' | 'Donut' | 'Pie' | 'Number' | 'Table';
141
+ export interface WidgetDefinitionConfig {
142
+ chart_type: ChartType;
143
+ config: BarChartConfig | LineChartConfig | DonutPieChartConfig | NumberKpiChartConfig | TableChartConfig;
144
+ }
145
+ /**
146
+ * Transformed widget data shapes for easier rendering by chart type.
147
+ * Produced by WidgetDataTransformer from originalData + widget definition.
148
+ */
149
+ export interface BarWidgetData {
150
+ chartType: 'Bar' | 'BarHorizontal';
151
+ categories: string[];
152
+ series: Array<{
153
+ name: string;
154
+ data: number[];
155
+ }>;
156
+ stack?: boolean;
157
+ }
158
+ export interface LineWidgetData {
159
+ chartType: 'Line';
160
+ categories: string[];
161
+ series: Array<{
162
+ name: string;
163
+ data: number[];
164
+ }>;
165
+ stack?: boolean;
166
+ }
167
+ export interface PieWidgetData {
168
+ chartType: 'Pie' | 'Donut';
169
+ items: Array<{
170
+ name: string;
171
+ value: number;
172
+ }>;
173
+ }
174
+ export interface NumberKpiWidgetData {
175
+ chartType: 'Number';
176
+ values: number[];
177
+ labels: string[];
178
+ options?: Array<{
179
+ decimal?: string;
180
+ prefix?: string;
181
+ suffix?: string;
182
+ }>;
183
+ }
184
+ /** Single header cell: key maps to data column; missing key = presentational only. */
185
+ export interface TableHeaderCell {
186
+ key?: string;
187
+ label: string;
188
+ colspan?: number;
189
+ rowspan?: number;
190
+ hide?: boolean;
191
+ }
192
+ /** Column definition from backend (order, visibility, label, align, format, rowspan). */
193
+ export interface TableColumnDef {
194
+ key: string;
195
+ label: string;
196
+ hide?: boolean;
197
+ align?: string | null;
198
+ format?: string | null;
199
+ rowspan?: boolean;
200
+ }
201
+ export interface TableWidgetData {
202
+ chartType: 'Table';
203
+ /** Column keys in display order (body cells). */
204
+ columns: string[];
205
+ /** Full column definitions (labels, align, format, rowspan, hide). When present, use for headers and styling. */
206
+ columnDefs?: TableColumnDef[];
207
+ /** Multi-row header: array of rows, each row array of cells. When present, use instead of single row from columns. */
208
+ header_rows?: TableHeaderCell[][];
209
+ /** Body rows. Prefer over raw API `data` when widgetData is from backend. */
210
+ rows: Record<string, unknown>[];
211
+ /** Per-column rowspan runs: key -> array of length rows; 0 = merged with above, N = rowspan count. */
212
+ rowSpanRuns?: Record<string, number[]>;
213
+ /** Optional font size for table (e.g. '0.75rem', '12px') to adjust for table complexity. */
214
+ font_size?: string;
215
+ /** When true, the summary/totals row is sticky (stays visible when scrolling). */
216
+ totals_sticky?: boolean;
217
+ /** When totals_sticky is true, 'top' or 'bottom' – where the totals row sticks. */
218
+ totals_position?: 'top' | 'bottom';
219
+ }
220
+ export type WidgetData = BarWidgetData | LineWidgetData | PieWidgetData | NumberKpiWidgetData | TableWidgetData;
221
+ /** Filter option from API (preset or static options). */
222
+ export interface FilterOption {
223
+ value: string | number;
224
+ label?: string;
225
+ }
226
+ /** Filter definition from dashboard or widget API (param_name, type, label, options, default_value). */
227
+ export interface FilterDefinition {
228
+ param_name: string;
229
+ type: string;
230
+ /** UI label (e.g. "Year", "Month"); falls back to param_name if omitted. */
231
+ label?: string;
232
+ options?: FilterOption[];
233
+ /** Default value when none selected; sent as param value if user has not chosen a value. */
234
+ default_value?: string | number | boolean;
235
+ }
236
+ /** Options for lazy viewport-based rendering of widgets. */
237
+ export interface LazyWidgetOptions {
238
+ /** When true, only fetch/render when widget enters viewport; pause refresh when out of viewport. */
239
+ lazy?: boolean;
240
+ /** CSS margin around viewport to trigger visibility earlier (e.g. '200px'). Used as IntersectionObserver rootMargin. */
241
+ prefetch_margin?: string;
242
+ }
243
+ /** Options for offloading heavy transforms to a Web Worker. */
244
+ export interface WorkerWidgetOptions {
245
+ /** When true, attempt to run dataset transform (pivot/aggregation) in a worker. Fallback to main thread if unsupported or data small. */
246
+ use_worker?: boolean;
247
+ /** Minimum row count to use worker (below this, main thread is used). Default 500. */
248
+ worker_min_rows?: number;
249
+ }
250
+ //# sourceMappingURL=types.d.ts.map