@carlonicora/nextjs-jsonapi 3.27.3 → 3.28.0
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/{BlockNoteEditor-OPIE2D56.js → BlockNoteEditor-ATZVHS6X.js} +9 -9
- package/dist/{BlockNoteEditor-OPIE2D56.js.map → BlockNoteEditor-ATZVHS6X.js.map} +1 -1
- package/dist/{BlockNoteEditor-ZFMCSQ5X.mjs → BlockNoteEditor-CWW2D3SG.mjs} +2 -2
- package/dist/billing/index.js +335 -335
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-CIFCO74X.mjs → chunk-2IMQ5IKA.mjs} +8 -6
- package/dist/chunk-2IMQ5IKA.mjs.map +1 -0
- package/dist/{chunk-GA6RXWN7.js → chunk-YDPDJIJF.js} +5 -3
- package/dist/chunk-YDPDJIJF.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/analytics/index.js +88 -88
- package/dist/features/analytics/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/features/notification/components/notifications/NotificationIcon.tsx +3 -1
- package/dist/chunk-CIFCO74X.mjs.map +0 -1
- package/dist/chunk-GA6RXWN7.js.map +0 -1
- /package/dist/{BlockNoteEditor-ZFMCSQ5X.mjs.map → BlockNoteEditor-CWW2D3SG.mjs.map} +0 -0
|
@@ -37,7 +37,7 @@ var _chunkGKDHYB2Rjs = require('../../chunk-GKDHYB2R.js');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkYDPDJIJFjs = require('../../chunk-YDPDJIJF.js');
|
|
41
41
|
require('../../chunk-4Z45NYPR.js');
|
|
42
42
|
|
|
43
43
|
|
|
@@ -81,7 +81,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
81
81
|
};
|
|
82
82
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
83
83
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-md:w-full max-md:[&_#date]:w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
84
|
-
|
|
84
|
+
_chunkYDPDJIJFjs.DateRangeSelector,
|
|
85
85
|
{
|
|
86
86
|
onDateChange: (range) => {
|
|
87
87
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -116,16 +116,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
119
|
-
|
|
119
|
+
_chunkYDPDJIJFjs.Select,
|
|
120
120
|
{
|
|
121
121
|
items: companyItems,
|
|
122
122
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
123
123
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
124
124
|
children: [
|
|
125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
126
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
128
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
126
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.SelectContent, { children: [
|
|
127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
128
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
129
129
|
] })
|
|
130
130
|
]
|
|
131
131
|
}
|
|
@@ -148,7 +148,7 @@ function Segmented({
|
|
|
148
148
|
children: options.map((option) => {
|
|
149
149
|
const selected = option.value === value;
|
|
150
150
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
151
|
-
|
|
151
|
+
_chunkYDPDJIJFjs.Button,
|
|
152
152
|
{
|
|
153
153
|
type: "button",
|
|
154
154
|
size: "sm",
|
|
@@ -230,7 +230,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
230
230
|
pageUrl = TOKEN_USAGE_ADMIN_PAGE_URL
|
|
231
231
|
}) => {
|
|
232
232
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
233
|
-
const generateUrl =
|
|
233
|
+
const generateUrl = _chunkYDPDJIJFjs.usePageUrlGenerator.call(void 0, );
|
|
234
234
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
235
235
|
const range = defaultRange();
|
|
236
236
|
return {
|
|
@@ -348,7 +348,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
348
348
|
error
|
|
349
349
|
]
|
|
350
350
|
);
|
|
351
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
351
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
352
352
|
}, "TokenUsageAdminProvider");
|
|
353
353
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
354
354
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -445,7 +445,7 @@ function LeadTile({
|
|
|
445
445
|
previousLabel,
|
|
446
446
|
decimal
|
|
447
447
|
}) {
|
|
448
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
448
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.CardContent, { className: "grid gap-1", children: [
|
|
449
449
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
450
450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -462,7 +462,7 @@ function SupportingTile({
|
|
|
462
462
|
delta,
|
|
463
463
|
decimal
|
|
464
464
|
}) {
|
|
465
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
465
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.CardContent, { className: "grid gap-1", children: [
|
|
466
466
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
467
467
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
468
468
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -559,8 +559,8 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
559
559
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
560
560
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
561
561
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
562
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
563
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
562
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Table, { children: [
|
|
563
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableHead, { className: _chunkCAKOFJZDjs.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
564
564
|
"button",
|
|
565
565
|
{
|
|
566
566
|
type: "button",
|
|
@@ -575,20 +575,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
575
575
|
]
|
|
576
576
|
}
|
|
577
577
|
) }, column.key)) }) }),
|
|
578
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableBody, { children: sortedRows.map((row) => {
|
|
579
579
|
const value = _chunkGKDHYB2Rjs.metricValue.call(void 0, row, metric);
|
|
580
580
|
const share = total > 0 ? value / total * 100 : 0;
|
|
581
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
582
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
583
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
585
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
586
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
587
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
588
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
589
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
591
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
582
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
584
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
|
|
586
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
|
|
587
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
|
|
588
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(_chunkGKDHYB2Rjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn)) }),
|
|
589
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
|
|
590
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
|
|
591
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
|
|
592
592
|
] }, row.id);
|
|
593
593
|
}) })
|
|
594
594
|
] }) })
|
|
@@ -756,7 +756,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
756
756
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
|
|
757
757
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
758
758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
759
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
759
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.ChartContainer, { config: chartConfig, className: "aspect-auto h-72 w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _recharts.BarChart, { accessibilityLayer: true, data: chartData, margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
|
|
760
760
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
761
761
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
762
762
|
_recharts.XAxis,
|
|
@@ -780,10 +780,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
780
780
|
}
|
|
781
781
|
),
|
|
782
782
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
783
|
-
|
|
783
|
+
_chunkYDPDJIJFjs.ChartTooltip,
|
|
784
784
|
{
|
|
785
785
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
786
|
-
|
|
786
|
+
_chunkYDPDJIJFjs.ChartTooltipContent,
|
|
787
787
|
{
|
|
788
788
|
labelFormatter: (value) => bucketDate(String(value), granularity),
|
|
789
789
|
valueFormatter: (value) => formatValue(Number(value), metric),
|
|
@@ -792,7 +792,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
792
792
|
)
|
|
793
793
|
}
|
|
794
794
|
),
|
|
795
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
795
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.ChartLegendContent, {}) }) : null,
|
|
796
796
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
797
797
|
_recharts.Bar,
|
|
798
798
|
{
|
|
@@ -844,19 +844,19 @@ function TokenUsageAdminContainer() {
|
|
|
844
844
|
[t]
|
|
845
845
|
);
|
|
846
846
|
if (error) {
|
|
847
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
847
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
848
848
|
}
|
|
849
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
849
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
850
850
|
const emptyLabel = t("token_usage.admin.no_data");
|
|
851
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
851
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
852
852
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
|
|
853
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
854
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
855
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
856
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
853
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
854
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: [
|
|
855
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
856
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
857
857
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
|
|
858
858
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
859
|
-
|
|
859
|
+
_chunkYDPDJIJFjs.Select,
|
|
860
860
|
{
|
|
861
861
|
items: stackByItems,
|
|
862
862
|
value: filters.stackBy,
|
|
@@ -864,29 +864,29 @@ function TokenUsageAdminContainer() {
|
|
|
864
864
|
if (value) setFilters({ stackBy: value });
|
|
865
865
|
},
|
|
866
866
|
children: [
|
|
867
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
868
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
867
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectValue, {}) }),
|
|
868
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SelectItem, { value, children: stackByItems[value] }, value)) })
|
|
869
869
|
]
|
|
870
870
|
}
|
|
871
871
|
)
|
|
872
872
|
] }) })
|
|
873
873
|
] }),
|
|
874
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
874
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
|
|
875
875
|
] }),
|
|
876
876
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
877
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
878
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
879
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
877
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
878
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
879
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
|
|
880
880
|
] }),
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
882
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
883
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
882
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
883
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
|
|
884
884
|
] })
|
|
885
885
|
] }),
|
|
886
886
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkCAKOFJZDjs.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
|
|
887
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
888
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
889
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
887
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
888
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
889
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
890
890
|
TokenUsageRankedBar,
|
|
891
891
|
{
|
|
892
892
|
rows: byCustomerOperation,
|
|
@@ -896,9 +896,9 @@ function TokenUsageAdminContainer() {
|
|
|
896
896
|
}
|
|
897
897
|
) })
|
|
898
898
|
] }),
|
|
899
|
-
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
900
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
901
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
899
|
+
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
900
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
901
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
902
902
|
TokenUsageRankedBar,
|
|
903
903
|
{
|
|
904
904
|
rows: byOperation,
|
|
@@ -909,9 +909,9 @@ function TokenUsageAdminContainer() {
|
|
|
909
909
|
) })
|
|
910
910
|
] })
|
|
911
911
|
] }),
|
|
912
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
913
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
914
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
912
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
914
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
915
915
|
] })
|
|
916
916
|
] }) });
|
|
917
917
|
}
|
|
@@ -1032,7 +1032,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
|
|
|
1032
1032
|
|
|
1033
1033
|
function TokenUsageReportFilterBar({ onChange }) {
|
|
1034
1034
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-help": "tokenusage.filters", className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1035
|
-
|
|
1035
|
+
_chunkYDPDJIJFjs.DateRangeSelector,
|
|
1036
1036
|
{
|
|
1037
1037
|
onDateChange: (range) => {
|
|
1038
1038
|
if (!_optionalChain([range, 'optionalAccess', _5 => _5.from]) || !_optionalChain([range, 'optionalAccess', _6 => _6.to])) return;
|
|
@@ -1065,7 +1065,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1065
1065
|
pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
|
|
1066
1066
|
}) => {
|
|
1067
1067
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1068
|
-
const generateUrl =
|
|
1068
|
+
const generateUrl = _chunkYDPDJIJFjs.usePageUrlGenerator.call(void 0, );
|
|
1069
1069
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
1070
1070
|
const range = defaultRange2();
|
|
1071
1071
|
return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
|
|
@@ -1129,7 +1129,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1129
1129
|
() => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
|
|
1130
1130
|
[summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
|
|
1131
1131
|
);
|
|
1132
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1132
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
|
|
1133
1133
|
}, "TokenUsageReportProvider");
|
|
1134
1134
|
var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1135
1135
|
const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
|
|
@@ -1157,7 +1157,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1157
1157
|
const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
|
|
1158
1158
|
const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
|
|
1159
1159
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
1160
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1160
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.CardContent, { className: "grid gap-1", children: [
|
|
1161
1161
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
|
|
1162
1162
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(_chunkGKDHYB2Rjs.metricValue.call(void 0, current, metric), metric) }),
|
|
1163
1163
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -1173,7 +1173,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1173
1173
|
] })
|
|
1174
1174
|
] }) }),
|
|
1175
1175
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1176
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1176
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.CardContent, { className: "grid gap-1", children: [
|
|
1177
1177
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
|
|
1178
1178
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
|
|
1179
1179
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunkCAKOFJZDjs.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
|
|
@@ -1183,11 +1183,11 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1183
1183
|
] })
|
|
1184
1184
|
] })
|
|
1185
1185
|
] }) }),
|
|
1186
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1186
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.CardContent, { className: "grid gap-1", children: [
|
|
1187
1187
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
|
|
1188
1188
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
|
|
1189
1189
|
] }) }),
|
|
1190
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.CardContent, { className: "grid gap-1", children: [
|
|
1191
1191
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
|
|
1192
1192
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
|
|
1193
1193
|
] }) })
|
|
@@ -1229,21 +1229,21 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1229
1229
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1230
1230
|
const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
|
|
1231
1231
|
if (error) {
|
|
1232
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1232
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
1233
1233
|
}
|
|
1234
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1234
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
1235
1235
|
const emptyLabel = t("token_usage.report.no_data");
|
|
1236
1236
|
const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
|
|
1237
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1237
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
1238
1238
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
|
|
1239
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1240
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1241
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1239
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
1240
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
|
|
1241
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
|
|
1242
1242
|
] }),
|
|
1243
1243
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkCAKOFJZDjs.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
|
|
1244
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1245
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1246
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1244
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
1245
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: t("token_usage.report.by_operation") }) }),
|
|
1246
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1247
1247
|
TokenUsageRankedBar,
|
|
1248
1248
|
{
|
|
1249
1249
|
rows: byOperation,
|
|
@@ -1253,9 +1253,9 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
) })
|
|
1255
1255
|
] }),
|
|
1256
|
-
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1257
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1258
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1256
|
+
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkYDPDJIJFjs.Card, { children: [
|
|
1257
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardTitle, { children: targetTitle }) }),
|
|
1258
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYDPDJIJFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
|
|
1259
1259
|
] })
|
|
1260
1260
|
] })
|
|
1261
1261
|
] }) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { AudioLinesIcon, BellIcon, LucideIcon } from "lucide-react";
|
|
3
|
+
import { ArchiveIcon, AudioLinesIcon, BellIcon, LucideIcon } from "lucide-react";
|
|
4
4
|
import { cn } from "../../../../utils";
|
|
5
5
|
|
|
6
6
|
type IconTone = "muted" | "warning" | "destructive";
|
|
@@ -10,6 +10,8 @@ type IconTone = "muted" | "warning" | "destructive";
|
|
|
10
10
|
not listed here fall back to the bell. */
|
|
11
11
|
const notificationIcons: Record<string, { icon: LucideIcon; tone: IconTone }> = {
|
|
12
12
|
transcript_ready: { icon: AudioLinesIcon, tone: "muted" },
|
|
13
|
+
data_export_ready: { icon: ArchiveIcon, tone: "muted" },
|
|
14
|
+
data_export_failed: { icon: ArchiveIcon, tone: "destructive" },
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
const toneClasses: Record<IconTone, string> = {
|