@epam/ai-dial-usage-dashboard 1.1.0-dev.479 → 1.1.0-dev.481
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/components/ModelLimitsSection/ModelLimitsRow.d.ts.map +1 -1
- package/components/ModelLimitsSection/ModelLimitsSection.d.ts +1 -1
- package/components/ModelLimitsSection/ModelLimitsSection.d.ts.map +1 -1
- package/components/ModelLimitsSection/PeriodCell.d.ts +2 -1
- package/components/ModelLimitsSection/PeriodCell.d.ts.map +1 -1
- package/components/UsageLimitCard/UsageLimitCard.d.ts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +490 -415
- package/models/model-limits-props.d.ts +30 -19
- package/models/model-limits-props.d.ts.map +1 -1
- package/models/usage-limit-card-props.d.ts +9 -1
- package/models/usage-limit-card-props.d.ts.map +1 -1
- package/package.json +3 -3
- package/utils/map-usage-data-to-dashboard.d.ts +26 -8
- package/utils/map-usage-data-to-dashboard.d.ts.map +1 -1
- package/utils/map-user-usage-to-model-limits.d.ts +7 -2
- package/utils/map-user-usage-to-model-limits.d.ts.map +1 -1
|
@@ -37,27 +37,36 @@ export interface ModelLimitMetricCell {
|
|
|
37
37
|
/** Accessible text describing the cell's full value, present regardless of `kind` (e.g. `'12,345 of 50,000 tokens used'` or `'Not available'`). */
|
|
38
38
|
ariaLabel: string;
|
|
39
39
|
}
|
|
40
|
-
/** Normalized overall Cost status
|
|
40
|
+
/** Normalized overall Cost status, optional explanatory tooltip, and optional reset time for one period header. */
|
|
41
41
|
export interface ModelLimitPeriodStatus {
|
|
42
42
|
/** Host-derived status of the matching overall Cost limit. */
|
|
43
43
|
status: ModelLimitStatus;
|
|
44
44
|
/** Complete tooltip/accessibility text for warning and error indicators. */
|
|
45
45
|
tooltipLabel?: string;
|
|
46
|
+
/** Visible reset line, e.g. `'Resets Sep 16, 2026, 2:00 AM GMT+2'`. */
|
|
47
|
+
resetLabel?: string;
|
|
48
|
+
/** Machine-readable instant for the reset line's `<time dateTime>` attribute, e.g. `'2026-09-16T00:00:00Z'`. */
|
|
49
|
+
resetIsoValue?: string;
|
|
50
|
+
/** Accessible expansion of the reset line, applied as its `aria-label` when supplied. */
|
|
51
|
+
resetAriaLabel?: string;
|
|
46
52
|
}
|
|
47
|
-
/** Overall Cost statuses aligned with the three fixed
|
|
53
|
+
/** Overall Cost statuses aligned with the three fixed calendar-period columns. */
|
|
48
54
|
export interface ModelLimitPeriodStatuses {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
/** Overall Cost status for the current UTC day. */
|
|
56
|
+
day: ModelLimitPeriodStatus;
|
|
57
|
+
/** Overall Cost status for the current UTC week. */
|
|
58
|
+
week: ModelLimitPeriodStatus;
|
|
59
|
+
/** Overall Cost status for the current UTC month. */
|
|
60
|
+
month: ModelLimitPeriodStatus;
|
|
52
61
|
}
|
|
53
|
-
/** Preformatted Cost and Tokens values for one
|
|
62
|
+
/** Preformatted Cost and Tokens values for one calendar-period column. */
|
|
54
63
|
export interface ModelLimitPeriodCell {
|
|
55
64
|
/** Tokens usage and limit for the period. */
|
|
56
65
|
tokens: ModelLimitMetricCell;
|
|
57
66
|
/** Attributed cost for the period. */
|
|
58
67
|
cost: ModelLimitMetricCell;
|
|
59
68
|
}
|
|
60
|
-
/** One row of the Model tokens limits table: model identity, three
|
|
69
|
+
/** One row of the Model tokens limits table: model identity, three calendar-period comparisons, and overall status. */
|
|
61
70
|
export interface ModelLimitRow {
|
|
62
71
|
/** Stable identifier for the row, e.g. the deployment ID. */
|
|
63
72
|
id: string;
|
|
@@ -67,12 +76,12 @@ export interface ModelLimitRow {
|
|
|
67
76
|
version?: string;
|
|
68
77
|
/** Image URL for the model's avatar. When absent, an initials-based fallback derived from `name` is shown. */
|
|
69
78
|
avatarSrc?: string;
|
|
70
|
-
/** Cost and Tokens metrics for the
|
|
71
|
-
|
|
72
|
-
/** Cost and Tokens metrics for the
|
|
73
|
-
|
|
74
|
-
/** Cost and Tokens metrics for the
|
|
75
|
-
|
|
79
|
+
/** Cost and Tokens metrics for the current UTC day. */
|
|
80
|
+
day: ModelLimitPeriodCell;
|
|
81
|
+
/** Cost and Tokens metrics for the current UTC week. */
|
|
82
|
+
week: ModelLimitPeriodCell;
|
|
83
|
+
/** Cost and Tokens metrics for the current UTC month. */
|
|
84
|
+
month: ModelLimitPeriodCell;
|
|
76
85
|
/** Host-derived overall status across all model-token and overall Cost limit periods. */
|
|
77
86
|
status: ModelLimitStatus;
|
|
78
87
|
}
|
|
@@ -82,12 +91,12 @@ export interface ModelLimitsLabels {
|
|
|
82
91
|
headingLabel: string;
|
|
83
92
|
/** Column header text for the Item (identity) column. */
|
|
84
93
|
itemColumnLabel: string;
|
|
85
|
-
/** Column header text for the
|
|
86
|
-
|
|
87
|
-
/** Column header text for the
|
|
88
|
-
|
|
89
|
-
/** Column header text for the
|
|
90
|
-
|
|
94
|
+
/** Column header text for the current UTC day. */
|
|
95
|
+
dayColumnLabel: string;
|
|
96
|
+
/** Column header text for the current UTC week. */
|
|
97
|
+
weekColumnLabel: string;
|
|
98
|
+
/** Column header text for the current UTC month. */
|
|
99
|
+
monthColumnLabel: string;
|
|
91
100
|
/** Column header text for the Status column. */
|
|
92
101
|
statusColumnLabel: string;
|
|
93
102
|
/** Non-visual accessible label for Tokens values inside every period cell. */
|
|
@@ -170,6 +179,8 @@ export interface ModelLimitsTypography {
|
|
|
170
179
|
headingCountClassName?: string;
|
|
171
180
|
/** CSS class for column headers. Defaults to `'dial-caption-lead-semi-text'`. */
|
|
172
181
|
columnHeaderClassName?: string;
|
|
182
|
+
/** CSS class for a period header's reset-time line. Defaults to `'dial-tiny-text'`. */
|
|
183
|
+
resetLabelClassName?: string;
|
|
173
184
|
/** CSS class for the model name. Defaults to `'dial-small-semi-text'`. */
|
|
174
185
|
nameClassName?: string;
|
|
175
186
|
/** CSS class for the model entity type. Defaults to `'dial-caption-lead-semi-text'`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-limits-props.d.ts","sourceRoot":"","sources":["../../src/models/model-limits-props.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,oBAAY,gBAAgB;IAC1B,4GAA4G;IAC5G,YAAY,kBAAkB;IAC9B,qHAAqH;IACrH,UAAU,gBAAgB;IAC1B,6EAA6E;IAC7E,YAAY,kBAAkB;IAC9B,kGAAkG;IAClG,OAAO,aAAa;IACpB,+GAA+G;IAC/G,WAAW,gBAAgB;CAC5B;AAED,6EAA6E;AAC7E,oBAAY,oBAAoB;IAC9B,0EAA0E;IAC1E,MAAM,WAAW;IACjB,qHAAqH;IACrH,SAAS,cAAc;IACvB,mGAAmG;IACnG,WAAW,gBAAgB;CAC5B;AAED,iFAAiF;AACjF,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,IAAI,EAAE,oBAAoB,CAAC;IAC3B,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gLAAgL;IAChL,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kGAAkG;IAClG,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,2GAA2G;IAC3G,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mJAAmJ;IACnJ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,
|
|
1
|
+
{"version":3,"file":"model-limits-props.d.ts","sourceRoot":"","sources":["../../src/models/model-limits-props.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,oBAAY,gBAAgB;IAC1B,4GAA4G;IAC5G,YAAY,kBAAkB;IAC9B,qHAAqH;IACrH,UAAU,gBAAgB;IAC1B,6EAA6E;IAC7E,YAAY,kBAAkB;IAC9B,kGAAkG;IAClG,OAAO,aAAa;IACpB,+GAA+G;IAC/G,WAAW,gBAAgB;CAC5B;AAED,6EAA6E;AAC7E,oBAAY,oBAAoB;IAC9B,0EAA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WAAW,qBAAqB;IACpC,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gGAAgG;IAChG,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iFAAiF;IACjF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yHAAyH;IACzH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kCAAkC;IAClC,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED,sCAAsC;AACtC,MAAM,WAAW,uBAAuB;IACtC,uEAAuE;IACvE,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,mEAAmE;IACnE,MAAM,EAAE,iBAAiB,CAAC;IAC1B,sFAAsF;IACtF,cAAc,EAAE,wBAAwB,CAAC;IACzC,uFAAuF;IACvF,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
|
|
@@ -11,7 +11,7 @@ export declare enum UsageLimitStatus {
|
|
|
11
11
|
export interface UsageLimitCardData {
|
|
12
12
|
/** Card title, e.g. `'Today'` / `'This week'` / `'This month'`. */
|
|
13
13
|
title: string;
|
|
14
|
-
/** Accessible description of the
|
|
14
|
+
/** Accessible description of the calendar period, e.g. `'Today'`, appended to the card's accessible group name. */
|
|
15
15
|
periodDescription: string;
|
|
16
16
|
/** Raw used amount, already clamped to `>= 0` by the host. Used only to drive `progressAriaLabel`/text — the library never recomputes it. */
|
|
17
17
|
used: number;
|
|
@@ -31,6 +31,12 @@ export interface UsageLimitCardData {
|
|
|
31
31
|
status: UsageLimitStatus;
|
|
32
32
|
/** Accessible value text for the progress bar (`aria-valuetext`), e.g. `'$3.60 of $4.00, 90% used'`. */
|
|
33
33
|
progressAriaLabel: string;
|
|
34
|
+
/** Visible reset line, e.g. `'Resets Sep 16, 2026, 2:00 AM GMT+2'`. */
|
|
35
|
+
resetLabel?: string;
|
|
36
|
+
/** Machine-readable instant for the reset line's `<time dateTime>` attribute, e.g. `'2026-09-16T00:00:00Z'`. */
|
|
37
|
+
resetIsoValue?: string;
|
|
38
|
+
/** Accessible expansion of the reset line, applied as its `aria-label` when supplied. */
|
|
39
|
+
resetAriaLabel?: string;
|
|
34
40
|
}
|
|
35
41
|
/** Localized strings shared by every card in a `UsageLimitCardGroup`/`UsageLimitCard`, independent of any single card's data. */
|
|
36
42
|
export interface UsageLimitCardGroupLabels {
|
|
@@ -102,6 +108,8 @@ export interface UsageLimitCardGroupTypography {
|
|
|
102
108
|
badgeClassName?: string;
|
|
103
109
|
/** CSS class for the trailing used-percent label. Defaults to `'dial-small-text'`. */
|
|
104
110
|
usedPercentLabelClassName?: string;
|
|
111
|
+
/** CSS class for the reset-time line. Defaults to `'dial-tiny-text'`. */
|
|
112
|
+
resetLabelClassName?: string;
|
|
105
113
|
}
|
|
106
114
|
/** Style overrides accepted by `UsageLimitCardGroup` and `UsageLimitCard`. */
|
|
107
115
|
export interface UsageLimitCardGroupStyles {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-limit-card-props.d.ts","sourceRoot":"","sources":["../../src/models/usage-limit-card-props.ts"],"names":[],"mappings":"AAAA,uIAAuI;AACvI,oBAAY,gBAAgB;IAC1B,4GAA4G;IAC5G,OAAO,YAAY;IACnB,qHAAqH;IACrH,UAAU,eAAe;IACzB,6EAA6E;IAC7E,YAAY,iBAAiB;CAC9B;AAED,iKAAiK;AACjK,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"usage-limit-card-props.d.ts","sourceRoot":"","sources":["../../src/models/usage-limit-card-props.ts"],"names":[],"mappings":"AAAA,uIAAuI;AACvI,oBAAY,gBAAgB;IAC1B,4GAA4G;IAC5G,OAAO,YAAY;IACnB,qHAAqH;IACrH,UAAU,eAAe;IACzB,6EAA6E;IAC7E,YAAY,iBAAiB;CAC9B;AAED,iKAAiK;AACjK,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,mHAAmH;IACnH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6IAA6I;IAC7I,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,4HAA4H;IAC5H,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qIAAqI;IACrI,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kKAAkK;IAClK,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4OAA4O;IAC5O,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,MAAM,EAAE,gBAAgB,CAAC;IACzB,wGAAwG;IACxG,iBAAiB,EAAE,MAAM,CAAC;IAQ1B,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gHAAgH;IAChH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,iIAAiI;AACjI,MAAM,WAAW,yBAAyB;IACxC,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qFAAqF;IACrF,sBAAsB,E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AC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,6EAA6E;AAC7E,MAAM,WAAW,6BAA6B;IAC5C,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kHAAkH;IAClH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sFAAsF;IACtF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,8EAA8E;AAC9E,MAAM,WAAW,yBAAyB;IACxC,wDAAwD;IACxD,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,kCAAkC;IAClC,UAAU,CAAC,EAAE,6BAA6B,CAAC;CAC5C;AAED,uCAAuC;AACvC,MAAM,WAAW,wBAAwB;IACvC,kKAAkK;IAClK,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,8CAA8C;IAC9C,MAAM,EAAE,yBAAyB,CAAC;IAClC,uFAAuF;IACvF,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC;AAED,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,IAAI,EAAE,kBAAkB,CAAC;IACzB,8CAA8C;IAC9C,MAAM,EAAE,yBAAyB,CAAC;IAClC,uFAAuF;IACvF,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-usage-dashboard",
|
|
3
3
|
"description": "Presentational aggregate cost-limit cards for the Usage settings dashboard",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.481",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-chat-api-client": "1.1.0-dev.
|
|
21
|
+
"@epam/ai-dial-chat-api-client": "1.1.0-dev.481"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
24
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.481",
|
|
25
25
|
"@epam/ai-dial-ui-kit": "^0.14.2",
|
|
26
26
|
"react": "^19.2.8"
|
|
27
27
|
},
|
|
@@ -2,23 +2,40 @@ import { UserLimitStatsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
|
2
2
|
import { UsageLimitCardData } from '../models/usage-limit-card-props';
|
|
3
3
|
/** A translate function compatible with i18next's `TFunction`. */
|
|
4
4
|
type Translate = (key: string, options?: Record<string, unknown>) => string;
|
|
5
|
+
/**
|
|
6
|
+
* One reset time, already parsed and formatted by the host. Declared
|
|
7
|
+
* structurally here so the library never imports an application type; the host
|
|
8
|
+
* passes a value that satisfies this shape.
|
|
9
|
+
*/
|
|
10
|
+
export interface ResetTimeDisplayLike {
|
|
11
|
+
/** Exclusive end of the period as an epoch ms value, for the host's boundary scheduling. */
|
|
12
|
+
resetsAtMs: number;
|
|
13
|
+
/** Machine-readable instant for a `<time dateTime>` attribute. */
|
|
14
|
+
isoValue: string;
|
|
15
|
+
/** Visible reset line. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Accessible expansion of the reset line. */
|
|
18
|
+
ariaLabel: string;
|
|
19
|
+
}
|
|
20
|
+
/** Formats a raw `resetsAt` into display strings, or returns `undefined` when it cannot be formatted. */
|
|
21
|
+
export type FormatResetTime = (resetsAt: string | undefined) => ResetTimeDisplayLike | undefined;
|
|
5
22
|
/**
|
|
6
23
|
* i18n key strings that the consuming app's translation bundle must define for
|
|
7
24
|
* `mapUsageDataToDashboard` to produce correctly translated strings. The
|
|
8
25
|
* values are the default key paths used by AI DIAL Chat.
|
|
9
26
|
*/
|
|
10
27
|
export declare const USAGE_DATA_I18N_KEYS: {
|
|
11
|
-
/** Title for the
|
|
28
|
+
/** Title for the current-UTC-day card (e.g. `'Today'`). */
|
|
12
29
|
readonly todayTitle: "usage.todayTitle";
|
|
13
|
-
/**
|
|
30
|
+
/** Accessible period description for the current-UTC-day card. */
|
|
14
31
|
readonly todayPeriodDescription: "usage.todayPeriodDescription";
|
|
15
|
-
/** Title for the
|
|
32
|
+
/** Title for the current-UTC-week card (e.g. `'This week'`). */
|
|
16
33
|
readonly thisWeekTitle: "usage.thisWeekTitle";
|
|
17
|
-
/**
|
|
34
|
+
/** Accessible period description for the current-UTC-week card. */
|
|
18
35
|
readonly thisWeekPeriodDescription: "usage.thisWeekPeriodDescription";
|
|
19
|
-
/** Title for the
|
|
36
|
+
/** Title for the current-UTC-month card (e.g. `'This month'`). */
|
|
20
37
|
readonly thisMonthTitle: "usage.thisMonthTitle";
|
|
21
|
-
/**
|
|
38
|
+
/** Accessible period description for the current-UTC-month card. */
|
|
22
39
|
readonly thisMonthPeriodDescription: "usage.thisMonthPeriodDescription";
|
|
23
40
|
/** Aria label when there is no limit. Receives `{ used: string }`. */
|
|
24
41
|
readonly unlimitedProgressAriaLabel: "usage.unlimitedProgressAriaLabel";
|
|
@@ -28,8 +45,9 @@ export declare const USAGE_DATA_I18N_KEYS: {
|
|
|
28
45
|
/**
|
|
29
46
|
* Maps a `UserLimitStatsResponseDto` into `UsageLimitCardGroup`'s `cards` prop,
|
|
30
47
|
* in Today / This week / This month order. A period is omitted entirely when
|
|
31
|
-
* the response carries no usable stat for it.
|
|
48
|
+
* the response carries no usable stat for it. Each card's reset trio comes from
|
|
49
|
+
* `formatResetTime`, and is absent when that callback returns `undefined`.
|
|
32
50
|
*/
|
|
33
|
-
export declare const mapUsageDataToDashboard: (usage: UserLimitStatsResponseDto | undefined, t: Translate) => UsageLimitCardData[];
|
|
51
|
+
export declare const mapUsageDataToDashboard: (usage: UserLimitStatsResponseDto | undefined, t: Translate, formatResetTime: FormatResetTime) => UsageLimitCardData[];
|
|
34
52
|
export {};
|
|
35
53
|
//# sourceMappingURL=map-usage-data-to-dashboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-usage-data-to-dashboard.d.ts","sourceRoot":"","sources":["../../src/utils/map-usage-data-to-dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E,kEAAkE;AAClE,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"map-usage-data-to-dashboard.d.ts","sourceRoot":"","sources":["../../src/utils/map-usage-data-to-dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E,kEAAkE;AAClE,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yGAAyG;AACzG,MAAM,MAAM,eAAe,GAAG,CAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,KACzB,oBAAoB,GAAG,SAAS,CAAC;AA8FtC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;IAC/B,2DAA2D;;IAE3D,kEAAkE;;IAElE,gEAAgE;;IAEhE,mEAAmE;;IAEnE,kEAAkE;;IAElE,oEAAoE;;IAEpE,sEAAsE;;IAEtE,sHAAsH;;CAE9G,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,yBAAyB,GAAG,SAAS,EAC5C,GAAG,SAAS,EACZ,iBAAiB,eAAe,KAC/B,kBAAkB,EAoCpB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DeploymentItemDto, UserLimitStatsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
2
|
import { ModelLimitPeriodStatuses, ModelLimitRow } from '../models/model-limits-props';
|
|
3
|
+
import { FormatResetTime } from './map-usage-data-to-dashboard';
|
|
3
4
|
/** A translate function compatible with i18next's `TFunction`. */
|
|
4
5
|
type Translate = (key: string, options?: Record<string, unknown>) => string;
|
|
5
6
|
/** A callback that resolves an icon URL from a deployment's raw `iconUrl` field. */
|
|
@@ -37,8 +38,12 @@ export declare const USAGE_MODEL_LIMITS_I18N_KEYS: {
|
|
|
37
38
|
/** Label for the spent-cost cell. Receives `{ amount: string }`. */
|
|
38
39
|
readonly spentLabel: "usage.spentLabel";
|
|
39
40
|
};
|
|
40
|
-
/**
|
|
41
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Maps the same top-level Cost budgets used by the aggregate cards into table-header state.
|
|
43
|
+
*
|
|
44
|
+
* @param formatResetTime - Formats each period's top-level `resetsAt` into the header's reset trio. Omit it to produce statuses with no reset fields.
|
|
45
|
+
*/
|
|
46
|
+
export declare const mapOverallCostLimitsToPeriodStatuses: (usage: UserLimitStatsResponseDto | undefined, activeLocale: string, t: Translate, formatResetTime?: FormatResetTime) => ModelLimitPeriodStatuses;
|
|
42
47
|
/**
|
|
43
48
|
* Maps `usage.deployments` into `ModelLimitsSection`'s `rows` prop, joined with model identity
|
|
44
49
|
* from `deploymentItems`. Rows are included only when any displayed period stat has nonzero usage.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-user-usage-to-model-limits.d.ts","sourceRoot":"","sources":["../../src/utils/map-user-usage-to-model-limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAGjB,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAIV,wBAAwB,EACxB,aAAa,EACd,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"map-user-usage-to-model-limits.d.ts","sourceRoot":"","sources":["../../src/utils/map-user-usage-to-model-limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAGjB,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAIV,wBAAwB,EACxB,aAAa,EACd,MAAM,8BAA8B,CAAC;AAKtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,kEAAkE;AAClE,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAE5E,oFAAoF;AACpF,KAAK,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;AAE1E,2EAA2E;AAC3E,KAAK,kBAAkB,GAAG,CACxB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI,EACxD,MAAM,EAAE,MAAM,KACX,MAAM,CAAC;AAmBZ;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;IACvC,oEAAoE;;IAEpE,oEAAoE;;IAEpE,oEAA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