@panneau/protocol 5.0.0-alpha.39 → 5.0.0-alpha.41

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 (40) hide show
  1. package/dist/conformance/index.d.ts.map +1 -1
  2. package/dist/conformance/index.js +29 -7
  3. package/dist/conformance/index.js.map +1 -1
  4. package/dist/index.js +4 -4
  5. package/dist/lint.d.ts.map +1 -1
  6. package/dist/lint.js +176 -20
  7. package/dist/lint.js.map +1 -1
  8. package/dist/mock/index.js +2 -2
  9. package/dist/mock/index.js.map +1 -1
  10. package/dist/openapi.d.ts.map +1 -1
  11. package/dist/openapi.js +3 -1
  12. package/dist/openapi.js.map +1 -1
  13. package/dist/periods.d.ts +12 -0
  14. package/dist/periods.d.ts.map +1 -1
  15. package/dist/periods.js +38 -1
  16. package/dist/periods.js.map +1 -1
  17. package/dist/runtime/index.d.ts +2 -2
  18. package/dist/runtime/index.d.ts.map +1 -1
  19. package/dist/runtime/index.js +3 -3
  20. package/dist/schemas/definition.d.ts +930 -2
  21. package/dist/schemas/definition.d.ts.map +1 -1
  22. package/dist/schemas/index.d.ts +4158 -4
  23. package/dist/schemas/index.d.ts.map +1 -1
  24. package/dist/schemas/index.js +14 -3
  25. package/dist/schemas/index.js.map +1 -1
  26. package/dist/schemas/resource.d.ts +464 -0
  27. package/dist/schemas/resource.d.ts.map +1 -1
  28. package/dist/schemas/theme.d.ts +2 -2
  29. package/dist/schemas/widget.d.ts +4210 -0
  30. package/dist/schemas/widget.d.ts.map +1 -1
  31. package/dist/schemas/widget.js +184 -17
  32. package/dist/schemas/widget.js.map +1 -1
  33. package/dist/widgets.d.ts +158 -7
  34. package/dist/widgets.d.ts.map +1 -1
  35. package/dist/widgets.js +469 -40
  36. package/dist/widgets.js.map +1 -1
  37. package/package.json +1 -1
  38. package/schema/boot.schema.json +459 -0
  39. package/schema/definition.schema.json +459 -0
  40. package/schema/openapi.json +976 -5
@@ -1 +1 @@
1
- {"version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, WIDGET_FORMAT_STYLES, WIDGET_FORMAT_UNIT_DISPLAYS, WIDGET_GOOD_WHEN, WIDGET_SERIES_PERIODS, WIDGET_TABLE_ALIGNS, isWidgetUnit } from "../widgets.js";
2
3
  import { OVERVIEW_PERIODS } from "../periods.js";
3
4
  import { z } from "zod";
4
5
  //#region src/schemas/widget.ts
@@ -8,6 +9,61 @@ var QueryValue = z.union([
8
9
  z.number(),
9
10
  z.boolean()
10
11
  ]);
12
+ var WidgetQuery = z.record(z.string(), z.union([QueryValue, z.array(QueryValue)]));
13
+ var FractionDigits = z.number().int().min(0).max(20);
14
+ var WidgetNumberFormat = z.looseObject({
15
+ style: z.enum(WIDGET_FORMAT_STYLES).optional().meta({ description: "`decimal` (the default), `percent` (`0.12` is `12%`), `currency` (with `currency`) or `unit` (with `unit`)." }),
16
+ currency: z.enum(CURRENCY_CODES).optional().meta({ description: "With `style: \"currency\"`: an ISO 4217 code, `USD`." }),
17
+ currencyDisplay: z.enum(WIDGET_FORMAT_CURRENCY_DISPLAYS).optional(),
18
+ unit: z.string().refine(isWidgetUnit, { message: "A unit of `Intl.NumberFormat`: `byte`, `megabyte`, `kilometer-per-hour`." }).optional().meta({ description: "With `style: \"unit\"`: a unit of `Intl.NumberFormat` (`byte`, `kilobyte`, `megabyte`, `gigabyte`, `second`, `minute`, `hour`…), or two of them joined by `-per-`." }),
19
+ unitDisplay: z.enum(WIDGET_FORMAT_UNIT_DISPLAYS).optional(),
20
+ minimumFractionDigits: FractionDigits.optional(),
21
+ maximumFractionDigits: FractionDigits.optional(),
22
+ notation: z.enum(WIDGET_FORMAT_NOTATIONS).optional().meta({ description: "`compact` writes `1.2K` and `3.4M`." }),
23
+ signDisplay: z.enum(WIDGET_FORMAT_SIGN_DISPLAYS).optional()
24
+ }).superRefine((format, context) => {
25
+ if (format.style === "currency" && format.currency === void 0) context.addIssue({
26
+ code: "custom",
27
+ message: "A `currency` style needs a `currency`.",
28
+ path: ["currency"]
29
+ });
30
+ if (format.style === "unit" && format.unit === void 0) context.addIssue({
31
+ code: "custom",
32
+ message: "A `unit` style needs a `unit`.",
33
+ path: ["unit"]
34
+ });
35
+ if (format.minimumFractionDigits !== void 0 && format.maximumFractionDigits !== void 0 && format.minimumFractionDigits > format.maximumFractionDigits) context.addIssue({
36
+ code: "custom",
37
+ message: "`minimumFractionDigits` is above `maximumFractionDigits`.",
38
+ path: ["minimumFractionDigits"]
39
+ });
40
+ }).meta({ description: "How the numbers of a widget are written: options of `Intl.NumberFormat`, for the locale of the user (decision 0089). `{ \"style\": \"currency\", \"currency\": \"USD\" }` writes `9.08` as `$9.08`, `{ \"style\": \"unit\", \"unit\": \"megabyte\" }` as `9.08 MB`." });
41
+ var WidgetAlertSettings = z.looseObject({
42
+ query: WidgetQuery.meta({ description: "The filters of the items to count, as query parameters, on top of those of their source: `{ \"filter[status]\": \"failed\" }`." }),
43
+ label: z.string().min(1).meta({ description: "What they are, written after their count, translated: `failed`." }),
44
+ tone: ToneName.optional().meta({ description: "The tone of the count, when it is above 0. `danger` by default." })
45
+ }).meta({ description: "Items of a source that call for attention (decision 0089): counted with the same query and period, and shown as `4 failed` when there are some." });
46
+ var SourcePeriod = z.union([z.string().min(1), z.literal(false)]);
47
+ var WidgetSeriesSource = z.looseObject({
48
+ resource: z.string().min(1).meta({ description: "The resource it counts or sums." }),
49
+ label: z.string().min(1).meta({ description: "The name of its line, in the legend." }),
50
+ query: WidgetQuery.optional(),
51
+ measure: z.string().min(1).optional().meta({ description: "`count` (the default), or `sum:{field}`." }),
52
+ group: z.string().min(1).optional().meta({ description: "`{period}:{date field}`: `settings.group` of the widget by default." }),
53
+ period: SourcePeriod.optional().meta({ description: "The `date-range` filter of its list that gets the period of the overview: `settings.period` of the widget by default. `false`: it doesn't follow the period." }),
54
+ help: z.string().optional().meta({ description: "A line under its label in the legend." }),
55
+ tone: ToneName.optional().meta({ description: "The tone of its line, instead of a categorical color." }),
56
+ alert: WidgetAlertSettings.optional()
57
+ }).meta({ description: "A line of a `series` on resources (decision 0089): the count or the sum of a resource per period." });
58
+ var WidgetRowSource = z.looseObject({
59
+ resource: z.string().min(1).meta({ description: "The resource it counts or sums." }),
60
+ label: z.string().min(1).meta({ description: "The name of the row." }),
61
+ query: WidgetQuery.optional(),
62
+ measure: z.string().min(1).optional().meta({ description: "`count` (the default), or `sum:{field}`." }),
63
+ points: z.string().min(1).optional().meta({ description: "`{period}:{date field}`: the points of its trend. `settings.points` of the widget by default." }),
64
+ period: SourcePeriod.optional().meta({ description: "The `date-range` filter of its list that gets the period of the overview, and the previous one for its change: `settings.period` of the widget by default." }),
65
+ alert: WidgetAlertSettings.optional()
66
+ }).meta({ description: "A row of a `table` on resources (decision 0089): one subject, counted or summed over the period." });
11
67
  var WidgetSettings = z.looseObject({
12
68
  resource: z.string().min(1).optional().meta({ description: "Built-in types: the resource that feeds the widget. A `stat` counts the items of its list (`meta.total`), a `list` shows its first items, and a `series`, a `breakdown` and a `stat` with a `sum:` measure read `GET /resources/{resource}/aggregate` (decision 0084). Such a widget has no data at `GET /dashboard/widgets/{widget}`." }),
13
69
  query: z.record(z.string(), z.union([QueryValue, z.array(QueryValue)])).optional().meta({ description: "With `resource`: the query of the list, as its query parameters (`{ \"filter[status]\": \"to-judge\", \"sort\": \"-created_at\" }`), and of the link to the list. The client sets `page`, `perPage` and `cursor`." }),
@@ -15,15 +71,24 @@ var WidgetSettings = z.looseObject({
15
71
  group: z.string().min(1).optional().meta({ description: "With `resource`: for a `series`, `{period}:{date field}` (`day`, `week` or `month`, and a field of `dates` of the aggregates of the list); for a `breakdown`, a field of their `groupBy`." }),
16
72
  target: z.number().positive().optional().meta({ description: "With `resource`, for a `stat`: its `target` (a budget, a quota), in the unit of the value: minor units for a sum of `money`." }),
17
73
  period: z.union([z.string().min(1), z.literal(false)]).optional().meta({ description: "In an overview with a `period` (decision 0084). With `resource`: the id of the list's `date-range` filter that gets the days of the chosen period. `false`: the widget doesn't follow the period; a widget with data of its own then gets no `period` parameters." }),
18
- followsList: z.boolean().optional().meta({ description: "In the summary of a resource (decision 0084): `false` keeps the widget on the whole resource, without the list's current filters and search. Widgets on that resource, and widgets with data of their own, follow the list by default." })
19
- }).meta({ description: "The settings of a widget: `resource`, `query`, `measure`, `group` and `target` for the built-in types on a resource, `period` in an overview with a period, `followsList` in a summary, anything else for widgets of plugins." });
74
+ followsList: z.boolean().optional().meta({ description: "In the summary of a resource (decision 0084): `false` keeps the widget on the whole resource, without the list's current filters and search. Widgets on that resource, and widgets with data of their own, follow the list by default." }),
75
+ format: WidgetNumberFormat.optional().meta({ description: "Built-in types: how their numbers are written (decision 0089). It wins over the `format` of their data, key by key. A sum of `money` is written in its currency without it." }),
76
+ hideEmpty: z.boolean().optional().meta({ description: "Built-in types: `true` hides the widget when its data has nothing to show (a value of 0, no items, no rows), and the grid closes the gap (decision 0089)." }),
77
+ goodWhen: z.enum(WIDGET_GOOD_WHEN).optional().meta({ description: "A `metric` or a `table`: whether a rise (`up`) or a fall (`down`) is good news, so that its change from the previous period is colored `success` or `danger`. Neutral without it." }),
78
+ points: z.string().min(1).optional().meta({ description: "With `resource`, for a `metric`: `{period}:{date field}`, the points of its trend line. For a `table`, the default of its rows." }),
79
+ by: z.string().min(1).optional().meta({ description: "With `resource`, for a `metric`: a field of the `groupBy` of the aggregates of the list, whose largest parts are drawn under the number." }),
80
+ split: z.string().min(1).optional().meta({ description: `With \`resource\` and a \`group\` on a period, for a \`series\`: a field of the \`groupBy\` of the aggregates of the list with a filter of its own. A line per value, for the 5 largest, and the rest as "Other".` }),
81
+ sources: z.array(WidgetSeriesSource).min(1).max(5).optional().meta({ description: `A \`series\` without \`resource\`: a line per source, at most 5, each from a resource.` }),
82
+ stacked: z.boolean().optional().meta({ description: "A `series` with several lines: stacks them, as areas." }),
83
+ rows: z.array(WidgetRowSource).min(1).max(8).optional().meta({ description: `A \`table\` on resources: its rows, at most 8, each a count or a sum of a resource.` })
84
+ }).meta({ description: "The settings of a widget: `resource`, `query`, `measure`, `group`, `target`, `points`, `by` and `split` for the built-in types on a resource, `sources` and `rows` for those on several, `period` in an overview with a period, `followsList` in a summary, `format`, `hideEmpty` and `goodWhen` for how they are drawn, anything else for widgets of plugins." });
20
85
  var OverviewPeriod = z.looseObject({
21
86
  options: z.array(z.enum(OVERVIEW_PERIODS)).min(1).meta({ description: "The periods the user chooses from, in order: `7d`, `30d` and `90d`, the 7, 30 or 90 days ending today; `month`, the current calendar month, from its first day to today; `year`, the last 12 months, from the first day of the month 11 months ago to today. Days are those of the time zone of the browser." }),
22
87
  default: z.enum(OVERVIEW_PERIODS).optional().meta({ description: "The period the overview opens on, among `options`. Defaults to the first." })
23
88
  }).meta({ description: "One period for the widgets of a dashboard page or a summary, chosen in its header and kept in the URL (`?period=30d`, decision 0084)." });
24
89
  var Widget = z.looseObject({
25
90
  id: z.string().min(1).meta({ description: "Unique in its dashboard: the `{widget}` of its route." }),
26
- type: z.string().min(1).meta({ description: "Built-in: `stat` (a number), `series` (a line over days, weeks or months), `list` (a few items) and `breakdown` (the parts of a total). Other types are widgets of plugins." }),
91
+ type: z.string().min(1).meta({ description: "Built-in: `stat` (a number), `series` (lines over days, weeks or months), `list` (a few items), `breakdown` (the parts of a total), `metric` (a number with its change, its trend and its parts) and `table` (rows of numbers). Other types are widgets of plugins." }),
27
92
  label: z.string().optional(),
28
93
  width: z.number().int().min(1).max(12).optional().meta({ description: "Columns of a grid of 12. Defaults to 3 for a `stat`, 6 for others. One column on a phone." }),
29
94
  settings: WidgetSettings.optional()
@@ -37,30 +102,63 @@ var StatWidgetData = z.looseObject({
37
102
  help: z.string().nullable().optional().meta({ description: "A line under the number, translated: `3 more than last week`." }),
38
103
  tone: ToneName.nullable().optional().meta({ description: "A tone of the theme, only when the number calls for attention (`warning`, `danger`): neutral otherwise, and at 0." }),
39
104
  url: z.string().nullable().optional().meta({ description: "Where the widget links: the list of what it counts." }),
40
- target: z.number().positive().nullable().optional().meta({ description: "A target for the number (a budget, a quota), drawn as a meter under it. Past it, the meter takes `tone`, or `danger` without one (decision 0084)." })
105
+ target: z.number().positive().nullable().optional().meta({ description: "A target for the number (a budget, a quota), drawn as a meter under it. Past it, the meter takes `tone`, or `danger` without one (decision 0084)." }),
106
+ format: WidgetNumberFormat.nullable().optional()
41
107
  }).meta({ description: "The data of a `stat` widget: a number (decision 0064)." });
42
108
  var SeriesPoint = z.looseObject({
43
109
  date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).meta({ description: "The first day of the period: `2026-10-05`." }),
44
110
  value: z.number()
45
111
  });
46
- var SeriesWidgetData = z.looseObject({
47
- period: z.enum(WIDGET_SERIES_PERIODS).meta({ description: "The period of each point." }),
48
- points: z.array(SeriesPoint).meta({ description: "One point per period, the dates going up. Periods without a value are points at 0." }),
49
- total: z.number().nullable().optional().meta({ description: "The total over the points, shown with the line." })
50
- }).superRefine((data, context) => {
51
- data.points.forEach((point, index) => {
52
- const previous = data.points[index - 1];
112
+ /** The dates of points must go up: one point per period. */
113
+ function checkPointDates(points, path, context) {
114
+ (points ?? []).forEach((point, index) => {
115
+ const previous = points?.[index - 1];
53
116
  if (previous !== void 0 && point.date <= previous.date) context.addIssue({
54
117
  code: "custom",
55
118
  message: "The dates of the points must go up.",
56
119
  path: [
57
- "points",
120
+ ...path,
58
121
  index,
59
122
  "date"
60
123
  ]
61
124
  });
62
125
  });
63
- }).meta({ description: "The data of a `series` widget: a line of values per period (decision 0064)." });
126
+ }
127
+ var WidgetAlert = z.looseObject({
128
+ value: z.number().meta({ description: "How many items call for attention." }),
129
+ label: z.string().meta({ description: "What they are, written after their count, translated: `failed`." }),
130
+ tone: ToneName.nullable().optional().meta({ description: "The tone of the count, above 0. `danger` by default." })
131
+ }).meta({ description: "A count that calls for attention (decision 0089): `4 failed`, in its tone, shown when it is above 0." });
132
+ var SeriesWidgetSeries = z.looseObject({
133
+ key: z.union([
134
+ z.string(),
135
+ z.number(),
136
+ z.boolean()
137
+ ]).nullable().optional().meta({ description: "The value it is the line of, for a line per value of a field." }),
138
+ label: z.string().meta({ description: "Its name, in the legend." }),
139
+ points: z.array(SeriesPoint).meta({ description: "One point per period, the dates going up. A date missing is 0." }),
140
+ total: z.number().nullable().optional().meta({ description: "Its total over the points, in the legend." }),
141
+ tone: ToneName.nullable().optional().meta({ description: "The tone of its line, instead of a categorical color." }),
142
+ url: z.string().nullable().optional().meta({ description: "Where its legend links." }),
143
+ help: z.string().nullable().optional().meta({ description: "A line under its label in the legend." }),
144
+ alert: WidgetAlert.nullable().optional()
145
+ }).meta({ description: "A line of a `series` with several (decision 0089)." });
146
+ var SeriesWidgetData = z.looseObject({
147
+ period: z.enum(WIDGET_SERIES_PERIODS).meta({ description: "The period of each point." }),
148
+ points: z.array(SeriesPoint).meta({ description: "One point per period, the dates going up. Periods without a value are points at 0. With `series`, the total of the lines per period, or none (`[]`): clients that only draw one line draw it." }),
149
+ series: z.array(SeriesWidgetSeries).max(6).optional().meta({ description: `Several lines, at most 6, instead of \`points\` (decision 0089): one chart, with a legend of their labels, totals and help.` }),
150
+ total: z.number().nullable().optional().meta({ description: "The total over the points, shown with the line." }),
151
+ format: WidgetNumberFormat.nullable().optional()
152
+ }).superRefine((data, context) => {
153
+ checkPointDates(data.points, ["points"], context);
154
+ data.series?.forEach((series, index) => {
155
+ checkPointDates(series.points, [
156
+ "series",
157
+ index,
158
+ "points"
159
+ ], context);
160
+ });
161
+ }).meta({ description: "The data of a `series` widget: a line of values per period (decision 0064), or several (decision 0089)." });
64
162
  var ListWidgetItem = z.looseObject({
65
163
  title: z.string(),
66
164
  description: z.string().nullable().optional(),
@@ -87,16 +185,85 @@ var BreakdownWidgetItem = z.looseObject({
87
185
  var BreakdownWidgetData = z.looseObject({
88
186
  items: z.array(BreakdownWidgetItem).max(10).meta({ description: `The parts, at most 10: clients draw the largest first.` }),
89
187
  total: z.number().nullable().optional().meta({ description: "The total the parts are of. Items with several values count in each of their parts, and once in the total." }),
90
- other: z.number().nullable().optional().meta({ description: "The rest of the total, past the items: drawn last, as \"Other\"." })
188
+ other: z.number().nullable().optional().meta({ description: "The rest of the total, past the items: drawn last, as \"Other\"." }),
189
+ format: WidgetNumberFormat.nullable().optional()
91
190
  }).meta({ description: "The data of a `breakdown` widget: the parts of a total, as horizontal bars (decision 0084)." });
191
+ var MetricWidgetData = z.looseObject({
192
+ value: z.number().meta({ description: "The number, in large type." }),
193
+ previous: z.number().nullable().optional().meta({ description: "The same number over the previous period, of the same length (`getPreviousRange()`): the change from it is written under the number." }),
194
+ help: z.string().nullable().optional().meta({ description: "A line under the number, translated." }),
195
+ tone: ToneName.nullable().optional().meta({ description: "A tone of the theme, only when the number calls for attention." }),
196
+ url: z.string().nullable().optional().meta({ description: "Where the number links: the list of what it counts." }),
197
+ target: z.number().positive().nullable().optional().meta({ description: "A target for the number, drawn as a meter under it, as for a `stat`." }),
198
+ points: z.array(SeriesPoint).nullable().optional().meta({ description: "Its trend: one point per period, the dates going up, drawn as a small line." }),
199
+ period: z.enum(WIDGET_SERIES_PERIODS).nullable().optional().meta({ description: "The period of each point." }),
200
+ parts: z.array(BreakdownWidgetItem).max(10).nullable().optional().meta({ description: `Its largest parts, at most 10: clients draw the 5 largest as bars, and the rest with \`other\`.` }),
201
+ other: z.number().nullable().optional().meta({ description: "The rest of the value, past the parts: drawn last, as \"Other\"." }),
202
+ format: WidgetNumberFormat.nullable().optional()
203
+ }).superRefine((data, context) => {
204
+ checkPointDates(data.points, ["points"], context);
205
+ }).meta({ description: "The data of a `metric` widget: one subject in one card, its number, its change from the previous period, its trend and its parts (decision 0089)." });
206
+ var TableWidgetColumn = z.looseObject({
207
+ key: z.string().min(1).meta({ description: "The key of its cells in each row." }),
208
+ label: z.string().meta({ description: "Its header, translated." }),
209
+ align: z.enum(WIDGET_TABLE_ALIGNS).optional().meta({ description: "`end` (the default) for numbers, or `start`." }),
210
+ format: WidgetNumberFormat.nullable().optional().meta({ description: "How its numbers are written: the `format` of the widget by default." })
211
+ }).meta({ description: "A column of a `table` widget." });
212
+ var TableWidgetCell = z.union([
213
+ z.number(),
214
+ z.null(),
215
+ z.looseObject({
216
+ value: z.number().nullable().meta({ description: "The number, `null` for none." }),
217
+ tone: ToneName.nullable().optional().meta({ description: "A tone, only when the number calls for attention." }),
218
+ help: z.string().nullable().optional().meta({ description: "A word after the number, translated: `rejected` in `6 rejected`." }),
219
+ format: WidgetNumberFormat.nullable().optional().meta({ description: "How this number is written, instead of the format of its column." })
220
+ })
221
+ ]).meta({ description: "A cell of a `table` widget: a number, `null` for none, or a number with a tone and a word." });
222
+ var TableWidgetRow = z.looseObject({
223
+ label: z.string().meta({ description: "What the row is about, in its first column." }),
224
+ url: z.string().nullable().optional().meta({ description: "Where its label links." }),
225
+ cells: z.record(z.string(), TableWidgetCell).meta({ description: "Its cells, by the `key` of their column. A cell missing is empty." }),
226
+ points: z.array(SeriesPoint).nullable().optional().meta({ description: "Its trend, drawn as a small line in a last column: the dates going up." })
227
+ }).meta({ description: "A row of a `table` widget: one subject." });
228
+ var TableWidgetData = z.looseObject({
229
+ columns: z.array(TableWidgetColumn).min(1).max(6).meta({ description: `Its columns of numbers, at most 6, after the column of the labels.` }),
230
+ rows: z.array(TableWidgetRow).max(8).meta({ description: `Its rows, at most 8.` }),
231
+ period: z.enum(WIDGET_SERIES_PERIODS).nullable().optional().meta({ description: "The period of the points of the rows." }),
232
+ empty: z.string().nullable().optional().meta({ description: "The message without rows, translated." }),
233
+ url: z.string().nullable().optional().meta({ description: "Where \"See all\" links." }),
234
+ format: WidgetNumberFormat.nullable().optional()
235
+ }).superRefine((data, context) => {
236
+ const keys = /* @__PURE__ */ new Set();
237
+ data.columns.forEach((column, index) => {
238
+ if (keys.has(column.key)) context.addIssue({
239
+ code: "custom",
240
+ message: `Duplicate column key \`${column.key}\`.`,
241
+ path: [
242
+ "columns",
243
+ index,
244
+ "key"
245
+ ]
246
+ });
247
+ keys.add(column.key);
248
+ });
249
+ data.rows.forEach((row, index) => {
250
+ checkPointDates(row.points, [
251
+ "rows",
252
+ index,
253
+ "points"
254
+ ], context);
255
+ });
256
+ }).meta({ description: "The data of a `table` widget: rows of numbers, one per subject, with an optional trend (decision 0089)." });
92
257
  /** The schema of the data of each built-in widget type. */
93
258
  var widgetDataSchemas = {
94
259
  stat: StatWidgetData,
95
260
  series: SeriesWidgetData,
96
261
  list: ListWidgetData,
97
- breakdown: BreakdownWidgetData
262
+ breakdown: BreakdownWidgetData,
263
+ metric: MetricWidgetData,
264
+ table: TableWidgetData
98
265
  };
99
266
  //#endregion
100
- export { BreakdownWidgetData, BreakdownWidgetItem, ListWidgetData, ListWidgetItem, OverviewPeriod, SeriesPoint, SeriesWidgetData, StatWidgetData, Widget, WidgetBadge, WidgetSettings, widgetDataSchemas };
267
+ export { BreakdownWidgetData, BreakdownWidgetItem, ListWidgetData, ListWidgetItem, MetricWidgetData, OverviewPeriod, SeriesPoint, SeriesWidgetData, SeriesWidgetSeries, StatWidgetData, TableWidgetCell, TableWidgetColumn, TableWidgetData, TableWidgetRow, Widget, WidgetAlert, WidgetAlertSettings, WidgetBadge, WidgetNumberFormat, WidgetRowSource, WidgetSeriesSource, WidgetSettings, widgetDataSchemas };
101
268
 
102
269
  //# sourceMappingURL=widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"widget.js","names":[],"sources":["../../src/schemas/widget.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { OVERVIEW_PERIODS } from '../periods';\nimport {\n WIDGET_BREAKDOWN_MAX_ITEMS,\n WIDGET_LIST_MAX_ITEMS,\n WIDGET_SERIES_PERIODS,\n} from '../widgets';\n\nconst ToneName = z.string().regex(/^[a-z0-9-]+$/);\n\nconst QueryValue = z.union([z.string(), z.number(), z.boolean()]);\n\nexport const WidgetSettings = z\n .looseObject({\n resource: z.string().min(1).optional().meta({\n description:\n 'Built-in types: the resource that feeds the widget. A `stat` counts the items of its list (`meta.total`), a `list` shows its first items, and a `series`, a `breakdown` and a `stat` with a `sum:` measure read `GET /resources/{resource}/aggregate` (decision 0084). Such a widget has no data at `GET /dashboard/widgets/{widget}`.',\n }),\n query: z\n .record(z.string(), z.union([QueryValue, z.array(QueryValue)]))\n .optional()\n .meta({\n description:\n 'With `resource`: the query of the list, as its query parameters (`{ \"filter[status]\": \"to-judge\", \"sort\": \"-created_at\" }`), and of the link to the list. The client sets `page`, `perPage` and `cursor`.',\n }),\n measure: z.string().min(1).optional().meta({\n description:\n 'With `resource`, for a `stat`, a `series` and a `breakdown`: `count` (the default), or `sum:{field}` of a field of the `sum` of the aggregates of the list.',\n }),\n group: z.string().min(1).optional().meta({\n description:\n 'With `resource`: for a `series`, `{period}:{date field}` (`day`, `week` or `month`, and a field of `dates` of the aggregates of the list); for a `breakdown`, a field of their `groupBy`.',\n }),\n target: z.number().positive().optional().meta({\n description:\n 'With `resource`, for a `stat`: its `target` (a budget, a quota), in the unit of the value: minor units for a sum of `money`.',\n }),\n period: z\n .union([z.string().min(1), z.literal(false)])\n .optional()\n .meta({\n description:\n \"In an overview with a `period` (decision 0084). With `resource`: the id of the list's `date-range` filter that gets the days of the chosen period. `false`: the widget doesn't follow the period; a widget with data of its own then gets no `period` parameters.\",\n }),\n followsList: z.boolean().optional().meta({\n description:\n \"In the summary of a resource (decision 0084): `false` keeps the widget on the whole resource, without the list's current filters and search. Widgets on that resource, and widgets with data of their own, follow the list by default.\",\n }),\n })\n .meta({\n description:\n 'The settings of a widget: `resource`, `query`, `measure`, `group` and `target` for the built-in types on a resource, `period` in an overview with a period, `followsList` in a summary, anything else for widgets of plugins.',\n });\n\nexport const OverviewPeriod = z\n .looseObject({\n options: z.array(z.enum(OVERVIEW_PERIODS)).min(1).meta({\n description:\n 'The periods the user chooses from, in order: `7d`, `30d` and `90d`, the 7, 30 or 90 days ending today; `month`, the current calendar month, from its first day to today; `year`, the last 12 months, from the first day of the month 11 months ago to today. Days are those of the time zone of the browser.',\n }),\n default: z.enum(OVERVIEW_PERIODS).optional().meta({\n description:\n 'The period the overview opens on, among `options`. Defaults to the first.',\n }),\n })\n .meta({\n description:\n 'One period for the widgets of a dashboard page or a summary, chosen in its header and kept in the URL (`?period=30d`, decision 0084).',\n });\n\nexport const Widget = z.looseObject({\n id: z\n .string()\n .min(1)\n .meta({ description: 'Unique in its dashboard: the `{widget}` of its route.' }),\n type: z.string().min(1).meta({\n description:\n 'Built-in: `stat` (a number), `series` (a line over days, weeks or months), `list` (a few items) and `breakdown` (the parts of a total). Other types are widgets of plugins.',\n }),\n label: z.string().optional(),\n width: z.number().int().min(1).max(12).optional().meta({\n description:\n 'Columns of a grid of 12. Defaults to 3 for a `stat`, 6 for others. One column on a phone.',\n }),\n settings: WidgetSettings.optional(),\n});\n\nexport const WidgetBadge = z\n .looseObject({ label: z.string(), tone: ToneName.optional() })\n .meta({ description: 'A badge: a word, in a tone of the theme.' });\n\nexport const StatWidgetData = z\n .looseObject({\n value: z.number().meta({ description: 'The number, in large type.' }),\n help: z.string().nullable().optional().meta({\n description: 'A line under the number, translated: `3 more than last week`.',\n }),\n tone: ToneName.nullable().optional().meta({\n description:\n 'A tone of the theme, only when the number calls for attention (`warning`, `danger`): neutral otherwise, and at 0.',\n }),\n url: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'Where the widget links: the list of what it counts.' }),\n target: z.number().positive().nullable().optional().meta({\n description:\n 'A target for the number (a budget, a quota), drawn as a meter under it. Past it, the meter takes `tone`, or `danger` without one (decision 0084).',\n }),\n })\n .meta({ description: 'The data of a `stat` widget: a number (decision 0064).' });\n\nexport const SeriesPoint = z.looseObject({\n date: z\n .string()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/)\n .meta({ description: 'The first day of the period: `2026-10-05`.' }),\n value: z.number(),\n});\n\nexport const SeriesWidgetData = z\n .looseObject({\n period: z.enum(WIDGET_SERIES_PERIODS).meta({ description: 'The period of each point.' }),\n points: z.array(SeriesPoint).meta({\n description:\n 'One point per period, the dates going up. Periods without a value are points at 0.',\n }),\n total: z.number().nullable().optional().meta({\n description: 'The total over the points, shown with the line.',\n }),\n })\n .superRefine((data, context) => {\n data.points.forEach((point, index) => {\n const previous = data.points[index - 1];\n if (previous !== undefined && point.date <= previous.date) {\n context.addIssue({\n code: 'custom',\n message: 'The dates of the points must go up.',\n path: ['points', index, 'date'],\n });\n }\n });\n })\n .meta({\n description: 'The data of a `series` widget: a line of values per period (decision 0064).',\n });\n\nexport const ListWidgetItem = z.looseObject({\n title: z.string(),\n description: z.string().nullable().optional(),\n meta: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'A short fact at the end of the item: `12 answers`.' }),\n url: z.string().nullable().optional(),\n badge: WidgetBadge.nullable().optional(),\n});\n\nexport const ListWidgetData = z\n .looseObject({\n items: z\n .array(ListWidgetItem)\n .max(WIDGET_LIST_MAX_ITEMS)\n .meta({\n description: `At most ${WIDGET_LIST_MAX_ITEMS} items, the most useful first.`,\n }),\n empty: z.string().nullable().optional().meta({\n description: 'The message without items, translated: `No open contests.`',\n }),\n url: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'Where \"See all\" links, under the items.' }),\n })\n .meta({ description: 'The data of a `list` widget: a few items (decision 0064).' });\n\nexport const BreakdownWidgetItem = z.looseObject({\n label: z.string().meta({ description: 'What the part is, translated: `Failed`.' }),\n value: z.number().meta({ description: 'The count or the sum of the part.' }),\n tone: ToneName.nullable().optional().meta({\n description: 'A tone of the theme for its bar: the tone of an option of a `select`.',\n }),\n url: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'Where the bar links: the list of what it counts.' }),\n key: z.union([z.string(), z.number(), z.boolean()]).nullable().optional().meta({\n description:\n 'From `GET /resources/{resource}/aggregate`: the value of the field it groups, `null` for the items without one. The client links the bar to the list filtered by it.',\n }),\n});\n\nexport const BreakdownWidgetData = z\n .looseObject({\n items: z\n .array(BreakdownWidgetItem)\n .max(WIDGET_BREAKDOWN_MAX_ITEMS)\n .meta({\n description: `The parts, at most ${WIDGET_BREAKDOWN_MAX_ITEMS}: clients draw the largest first.`,\n }),\n total: z.number().nullable().optional().meta({\n description:\n 'The total the parts are of. Items with several values count in each of their parts, and once in the total.',\n }),\n other: z.number().nullable().optional().meta({\n description: 'The rest of the total, past the items: drawn last, as \"Other\".',\n }),\n })\n .meta({\n description:\n 'The data of a `breakdown` widget: the parts of a total, as horizontal bars (decision 0084).',\n });\n\n/** The schema of the data of each built-in widget type. */\nexport const widgetDataSchemas = {\n stat: StatWidgetData,\n series: SeriesWidgetData,\n list: ListWidgetData,\n breakdown: BreakdownWidgetData,\n} as const;\n\nexport type OverviewPeriod = z.infer<typeof OverviewPeriod>;\nexport type WidgetSettings = z.infer<typeof WidgetSettings>;\nexport type Widget = z.infer<typeof Widget>;\nexport type WidgetBadge = z.infer<typeof WidgetBadge>;\nexport type StatWidgetData = z.infer<typeof StatWidgetData>;\nexport type SeriesPoint = z.infer<typeof SeriesPoint>;\nexport type SeriesWidgetData = z.infer<typeof SeriesWidgetData>;\nexport type ListWidgetItem = z.infer<typeof ListWidgetItem>;\nexport type ListWidgetData = z.infer<typeof ListWidgetData>;\nexport type BreakdownWidgetItem = z.infer<typeof BreakdownWidgetItem>;\nexport type BreakdownWidgetData = z.infer<typeof BreakdownWidgetData>;\n"],"mappings":";;;;AASA,IAAM,WAAW,EAAE,OAAO,CAAC,CAAC,MAAM,cAAc;AAEhD,IAAM,aAAa,EAAE,MAAM;CAAC,EAAE,OAAO;CAAG,EAAE,OAAO;CAAG,EAAE,QAAQ;AAAC,CAAC;AAEhE,IAAa,iBAAiB,EACzB,YAAY;CACT,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACxC,aACI,yUACR,CAAC;CACD,OAAO,EACF,OAAO,EAAE,OAAO,GAAG,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,CAC9D,SAAS,CAAC,CACV,KAAK,EACF,aACI,oNACR,CAAC;CACL,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,E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CAAC,CACR,SAAS,CAAC,CACV,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,mDAAmD,CAAC;CAC7E,KAAK,EAAE,MAAM;EAAC,EAAE,OAAO;EAAG,EAAE,OAAO;EAAG,EAAE,QAAQ;CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAC3E,aACI,uKACR,CAAC;AACL,CAAC;AAED,IAAa,sBAAsB,EAC9B,YAAY;CACT,OAAO,EACF,MAAM,mBAAmB,CAAC,CAC1B,IAAA,EAA8B,CAAC,CAC/B,KAAK,EACF,aAAa,yDACjB,CAAC;CACL,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACzC,aACI,6GACR,CAAC;CACD,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACzC,aAAa,mEACjB,CAAC;AACL,CAAC,CAAC,CACD,KAAK,EACF,aACI,8FACR,CAAC;;AAGL,IAAa,oBAAoB;CAC7B,MAAM;CACN,QAAQ;CACR,MAAM;CACN,WAAW;AACf"}
1
+ {"version":3,"file":"widget.js","names":[],"sources":["../../src/schemas/widget.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { CURRENCY_CODES } from '../currencies';\nimport { OVERVIEW_PERIODS } from '../periods';\nimport {\n WIDGET_BREAKDOWN_MAX_ITEMS,\n WIDGET_FORMAT_CURRENCY_DISPLAYS,\n WIDGET_FORMAT_NOTATIONS,\n WIDGET_FORMAT_SIGN_DISPLAYS,\n WIDGET_FORMAT_STYLES,\n WIDGET_FORMAT_UNIT_DISPLAYS,\n WIDGET_GOOD_WHEN,\n WIDGET_LIST_MAX_ITEMS,\n WIDGET_SERIES_MAX_SERIES,\n WIDGET_SERIES_PERIODS,\n WIDGET_SOURCES_MAX,\n WIDGET_TABLE_ALIGNS,\n WIDGET_TABLE_MAX_COLUMNS,\n WIDGET_TABLE_MAX_ROWS,\n isWidgetUnit,\n} from '../widgets';\n\nconst ToneName = z.string().regex(/^[a-z0-9-]+$/);\n\nconst QueryValue = z.union([z.string(), z.number(), z.boolean()]);\n\nconst WidgetQuery = z.record(z.string(), z.union([QueryValue, z.array(QueryValue)]));\n\nconst FractionDigits = z.number().int().min(0).max(20);\n\nexport const WidgetNumberFormat = z\n .looseObject({\n style: z.enum(WIDGET_FORMAT_STYLES).optional().meta({\n description:\n '`decimal` (the default), `percent` (`0.12` is `12%`), `currency` (with `currency`) or `unit` (with `unit`).',\n }),\n currency: z\n .enum(CURRENCY_CODES)\n .optional()\n .meta({ description: 'With `style: \"currency\"`: an ISO 4217 code, `USD`.' }),\n currencyDisplay: z.enum(WIDGET_FORMAT_CURRENCY_DISPLAYS).optional(),\n unit: z\n .string()\n .refine(isWidgetUnit, {\n message: 'A unit of `Intl.NumberFormat`: `byte`, `megabyte`, `kilometer-per-hour`.',\n })\n .optional()\n .meta({\n description:\n 'With `style: \"unit\"`: a unit of `Intl.NumberFormat` (`byte`, `kilobyte`, `megabyte`, `gigabyte`, `second`, `minute`, `hour`…), or two of them joined by `-per-`.',\n }),\n unitDisplay: z.enum(WIDGET_FORMAT_UNIT_DISPLAYS).optional(),\n minimumFractionDigits: FractionDigits.optional(),\n maximumFractionDigits: FractionDigits.optional(),\n notation: z.enum(WIDGET_FORMAT_NOTATIONS).optional().meta({\n description: '`compact` writes `1.2K` and `3.4M`.',\n }),\n signDisplay: z.enum(WIDGET_FORMAT_SIGN_DISPLAYS).optional(),\n })\n .superRefine((format, context) => {\n if (format.style === 'currency' && format.currency === undefined) {\n context.addIssue({\n code: 'custom',\n message: 'A `currency` style needs a `currency`.',\n path: ['currency'],\n });\n }\n if (format.style === 'unit' && format.unit === undefined) {\n context.addIssue({\n code: 'custom',\n message: 'A `unit` style needs a `unit`.',\n path: ['unit'],\n });\n }\n if (\n format.minimumFractionDigits !== undefined &&\n format.maximumFractionDigits !== undefined &&\n format.minimumFractionDigits > format.maximumFractionDigits\n ) {\n context.addIssue({\n code: 'custom',\n message: '`minimumFractionDigits` is above `maximumFractionDigits`.',\n path: ['minimumFractionDigits'],\n });\n }\n })\n .meta({\n description:\n 'How the numbers of a widget are written: options of `Intl.NumberFormat`, for the locale of the user (decision 0089). `{ \"style\": \"currency\", \"currency\": \"USD\" }` writes `9.08` as `$9.08`, `{ \"style\": \"unit\", \"unit\": \"megabyte\" }` as `9.08 MB`.',\n });\n\nexport const WidgetAlertSettings = z\n .looseObject({\n query: WidgetQuery.meta({\n description:\n 'The filters of the items to count, as query parameters, on top of those of their source: `{ \"filter[status]\": \"failed\" }`.',\n }),\n label: z.string().min(1).meta({\n description: 'What they are, written after their count, translated: `failed`.',\n }),\n tone: ToneName.optional().meta({\n description: 'The tone of the count, when it is above 0. `danger` by default.',\n }),\n })\n .meta({\n description:\n 'Items of a source that call for attention (decision 0089): counted with the same query and period, and shown as `4 failed` when there are some.',\n });\n\nconst SourcePeriod = z.union([z.string().min(1), z.literal(false)]);\n\nexport const WidgetSeriesSource = z\n .looseObject({\n resource: z.string().min(1).meta({ description: 'The resource it counts or sums.' }),\n label: z.string().min(1).meta({ description: 'The name of its line, in the legend.' }),\n query: WidgetQuery.optional(),\n measure: z.string().min(1).optional().meta({\n description: '`count` (the default), or `sum:{field}`.',\n }),\n group: z.string().min(1).optional().meta({\n description: '`{period}:{date field}`: `settings.group` of the widget by default.',\n }),\n period: SourcePeriod.optional().meta({\n description:\n \"The `date-range` filter of its list that gets the period of the overview: `settings.period` of the widget by default. `false`: it doesn't follow the period.\",\n }),\n help: z.string().optional().meta({ description: 'A line under its label in the legend.' }),\n tone: ToneName.optional().meta({\n description: 'The tone of its line, instead of a categorical color.',\n }),\n alert: WidgetAlertSettings.optional(),\n })\n .meta({\n description:\n 'A line of a `series` on resources (decision 0089): the count or the sum of a resource per period.',\n });\n\nexport const WidgetRowSource = z\n .looseObject({\n resource: z.string().min(1).meta({ description: 'The resource it counts or sums.' }),\n label: z.string().min(1).meta({ description: 'The name of the row.' }),\n query: WidgetQuery.optional(),\n measure: z.string().min(1).optional().meta({\n description: '`count` (the default), or `sum:{field}`.',\n }),\n points: z.string().min(1).optional().meta({\n description:\n '`{period}:{date field}`: the points of its trend. `settings.points` of the widget by default.',\n }),\n period: SourcePeriod.optional().meta({\n description:\n 'The `date-range` filter of its list that gets the period of the overview, and the previous one for its change: `settings.period` of the widget by default.',\n }),\n alert: WidgetAlertSettings.optional(),\n })\n .meta({\n description:\n 'A row of a `table` on resources (decision 0089): one subject, counted or summed over the period.',\n });\n\nexport const WidgetSettings = z\n .looseObject({\n resource: z.string().min(1).optional().meta({\n description:\n 'Built-in types: the resource that feeds the widget. A `stat` counts the items of its list (`meta.total`), a `list` shows its first items, and a `series`, a `breakdown` and a `stat` with a `sum:` measure read `GET /resources/{resource}/aggregate` (decision 0084). Such a widget has no data at `GET /dashboard/widgets/{widget}`.',\n }),\n query: z\n .record(z.string(), z.union([QueryValue, z.array(QueryValue)]))\n .optional()\n .meta({\n description:\n 'With `resource`: the query of the list, as its query parameters (`{ \"filter[status]\": \"to-judge\", \"sort\": \"-created_at\" }`), and of the link to the list. The client sets `page`, `perPage` and `cursor`.',\n }),\n measure: z.string().min(1).optional().meta({\n description:\n 'With `resource`, for a `stat`, a `series` and a `breakdown`: `count` (the default), or `sum:{field}` of a field of the `sum` of the aggregates of the list.',\n }),\n group: z.string().min(1).optional().meta({\n description:\n 'With `resource`: for a `series`, `{period}:{date field}` (`day`, `week` or `month`, and a field of `dates` of the aggregates of the list); for a `breakdown`, a field of their `groupBy`.',\n }),\n target: z.number().positive().optional().meta({\n description:\n 'With `resource`, for a `stat`: its `target` (a budget, a quota), in the unit of the value: minor units for a sum of `money`.',\n }),\n period: z\n .union([z.string().min(1), z.literal(false)])\n .optional()\n .meta({\n description:\n \"In an overview with a `period` (decision 0084). With `resource`: the id of the list's `date-range` filter that gets the days of the chosen period. `false`: the widget doesn't follow the period; a widget with data of its own then gets no `period` parameters.\",\n }),\n followsList: z.boolean().optional().meta({\n description:\n \"In the summary of a resource (decision 0084): `false` keeps the widget on the whole resource, without the list's current filters and search. Widgets on that resource, and widgets with data of their own, follow the list by default.\",\n }),\n format: WidgetNumberFormat.optional().meta({\n description:\n 'Built-in types: how their numbers are written (decision 0089). It wins over the `format` of their data, key by key. A sum of `money` is written in its currency without it.',\n }),\n hideEmpty: z.boolean().optional().meta({\n description:\n 'Built-in types: `true` hides the widget when its data has nothing to show (a value of 0, no items, no rows), and the grid closes the gap (decision 0089).',\n }),\n goodWhen: z.enum(WIDGET_GOOD_WHEN).optional().meta({\n description:\n 'A `metric` or a `table`: whether a rise (`up`) or a fall (`down`) is good news, so that its change from the previous period is colored `success` or `danger`. Neutral without it.',\n }),\n points: z.string().min(1).optional().meta({\n description:\n 'With `resource`, for a `metric`: `{period}:{date field}`, the points of its trend line. For a `table`, the default of its rows.',\n }),\n by: z.string().min(1).optional().meta({\n description:\n 'With `resource`, for a `metric`: a field of the `groupBy` of the aggregates of the list, whose largest parts are drawn under the number.',\n }),\n split: z\n .string()\n .min(1)\n .optional()\n .meta({\n description: `With \\`resource\\` and a \\`group\\` on a period, for a \\`series\\`: a field of the \\`groupBy\\` of the aggregates of the list with a filter of its own. A line per value, for the ${WIDGET_SOURCES_MAX} largest, and the rest as \"Other\".`,\n }),\n sources: z\n .array(WidgetSeriesSource)\n .min(1)\n .max(WIDGET_SOURCES_MAX)\n .optional()\n .meta({\n description: `A \\`series\\` without \\`resource\\`: a line per source, at most ${WIDGET_SOURCES_MAX}, each from a resource.`,\n }),\n stacked: z.boolean().optional().meta({\n description: 'A `series` with several lines: stacks them, as areas.',\n }),\n rows: z\n .array(WidgetRowSource)\n .min(1)\n .max(WIDGET_TABLE_MAX_ROWS)\n .optional()\n .meta({\n description: `A \\`table\\` on resources: its rows, at most ${WIDGET_TABLE_MAX_ROWS}, each a count or a sum of a resource.`,\n }),\n })\n .meta({\n description:\n 'The settings of a widget: `resource`, `query`, `measure`, `group`, `target`, `points`, `by` and `split` for the built-in types on a resource, `sources` and `rows` for those on several, `period` in an overview with a period, `followsList` in a summary, `format`, `hideEmpty` and `goodWhen` for how they are drawn, anything else for widgets of plugins.',\n });\n\nexport const OverviewPeriod = z\n .looseObject({\n options: z.array(z.enum(OVERVIEW_PERIODS)).min(1).meta({\n description:\n 'The periods the user chooses from, in order: `7d`, `30d` and `90d`, the 7, 30 or 90 days ending today; `month`, the current calendar month, from its first day to today; `year`, the last 12 months, from the first day of the month 11 months ago to today. Days are those of the time zone of the browser.',\n }),\n default: z.enum(OVERVIEW_PERIODS).optional().meta({\n description:\n 'The period the overview opens on, among `options`. Defaults to the first.',\n }),\n })\n .meta({\n description:\n 'One period for the widgets of a dashboard page or a summary, chosen in its header and kept in the URL (`?period=30d`, decision 0084).',\n });\n\nexport const Widget = z.looseObject({\n id: z\n .string()\n .min(1)\n .meta({ description: 'Unique in its dashboard: the `{widget}` of its route.' }),\n type: z.string().min(1).meta({\n description:\n 'Built-in: `stat` (a number), `series` (lines over days, weeks or months), `list` (a few items), `breakdown` (the parts of a total), `metric` (a number with its change, its trend and its parts) and `table` (rows of numbers). Other types are widgets of plugins.',\n }),\n label: z.string().optional(),\n width: z.number().int().min(1).max(12).optional().meta({\n description:\n 'Columns of a grid of 12. Defaults to 3 for a `stat`, 6 for others. One column on a phone.',\n }),\n settings: WidgetSettings.optional(),\n});\n\nexport const WidgetBadge = z\n .looseObject({ label: z.string(), tone: ToneName.optional() })\n .meta({ description: 'A badge: a word, in a tone of the theme.' });\n\nexport const StatWidgetData = z\n .looseObject({\n value: z.number().meta({ description: 'The number, in large type.' }),\n help: z.string().nullable().optional().meta({\n description: 'A line under the number, translated: `3 more than last week`.',\n }),\n tone: ToneName.nullable().optional().meta({\n description:\n 'A tone of the theme, only when the number calls for attention (`warning`, `danger`): neutral otherwise, and at 0.',\n }),\n url: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'Where the widget links: the list of what it counts.' }),\n target: z.number().positive().nullable().optional().meta({\n description:\n 'A target for the number (a budget, a quota), drawn as a meter under it. Past it, the meter takes `tone`, or `danger` without one (decision 0084).',\n }),\n format: WidgetNumberFormat.nullable().optional(),\n })\n .meta({ description: 'The data of a `stat` widget: a number (decision 0064).' });\n\nexport const SeriesPoint = z.looseObject({\n date: z\n .string()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/)\n .meta({ description: 'The first day of the period: `2026-10-05`.' }),\n value: z.number(),\n});\n\n/** The dates of points must go up: one point per period. */\nfunction checkPointDates(\n points: readonly SeriesPoint[] | null | undefined,\n path: (string | number)[],\n context: z.RefinementCtx,\n) {\n (points ?? []).forEach((point, index) => {\n const previous = points?.[index - 1];\n if (previous !== undefined && point.date <= previous.date) {\n context.addIssue({\n code: 'custom',\n message: 'The dates of the points must go up.',\n path: [...path, index, 'date'],\n });\n }\n });\n}\n\nexport const WidgetAlert = z\n .looseObject({\n value: z.number().meta({ description: 'How many items call for attention.' }),\n label: z.string().meta({\n description: 'What they are, written after their count, translated: `failed`.',\n }),\n tone: ToneName.nullable().optional().meta({\n description: 'The tone of the count, above 0. `danger` by default.',\n }),\n })\n .meta({\n description:\n 'A count that calls for attention (decision 0089): `4 failed`, in its tone, shown when it is above 0.',\n });\n\nexport const SeriesWidgetSeries = z\n .looseObject({\n key: z.union([z.string(), z.number(), z.boolean()]).nullable().optional().meta({\n description: 'The value it is the line of, for a line per value of a field.',\n }),\n label: z.string().meta({ description: 'Its name, in the legend.' }),\n points: z.array(SeriesPoint).meta({\n description: 'One point per period, the dates going up. A date missing is 0.',\n }),\n total: z.number().nullable().optional().meta({\n description: 'Its total over the points, in the legend.',\n }),\n tone: ToneName.nullable().optional().meta({\n description: 'The tone of its line, instead of a categorical color.',\n }),\n url: z.string().nullable().optional().meta({ description: 'Where its legend links.' }),\n help: z.string().nullable().optional().meta({\n description: 'A line under its label in the legend.',\n }),\n alert: WidgetAlert.nullable().optional(),\n })\n .meta({ description: 'A line of a `series` with several (decision 0089).' });\n\nexport const SeriesWidgetData = z\n .looseObject({\n period: z.enum(WIDGET_SERIES_PERIODS).meta({ description: 'The period of each point.' }),\n points: z.array(SeriesPoint).meta({\n description:\n 'One point per period, the dates going up. Periods without a value are points at 0. With `series`, the total of the lines per period, or none (`[]`): clients that only draw one line draw it.',\n }),\n series: z\n .array(SeriesWidgetSeries)\n .max(WIDGET_SERIES_MAX_SERIES)\n .optional()\n .meta({\n description: `Several lines, at most ${WIDGET_SERIES_MAX_SERIES}, instead of \\`points\\` (decision 0089): one chart, with a legend of their labels, totals and help.`,\n }),\n total: z.number().nullable().optional().meta({\n description: 'The total over the points, shown with the line.',\n }),\n format: WidgetNumberFormat.nullable().optional(),\n })\n .superRefine((data, context) => {\n checkPointDates(data.points, ['points'], context);\n data.series?.forEach((series, index) => {\n checkPointDates(series.points, ['series', index, 'points'], context);\n });\n })\n .meta({\n description:\n 'The data of a `series` widget: a line of values per period (decision 0064), or several (decision 0089).',\n });\n\nexport const ListWidgetItem = z.looseObject({\n title: z.string(),\n description: z.string().nullable().optional(),\n meta: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'A short fact at the end of the item: `12 answers`.' }),\n url: z.string().nullable().optional(),\n badge: WidgetBadge.nullable().optional(),\n});\n\nexport const ListWidgetData = z\n .looseObject({\n items: z\n .array(ListWidgetItem)\n .max(WIDGET_LIST_MAX_ITEMS)\n .meta({\n description: `At most ${WIDGET_LIST_MAX_ITEMS} items, the most useful first.`,\n }),\n empty: z.string().nullable().optional().meta({\n description: 'The message without items, translated: `No open contests.`',\n }),\n url: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'Where \"See all\" links, under the items.' }),\n })\n .meta({ description: 'The data of a `list` widget: a few items (decision 0064).' });\n\nexport const BreakdownWidgetItem = z.looseObject({\n label: z.string().meta({ description: 'What the part is, translated: `Failed`.' }),\n value: z.number().meta({ description: 'The count or the sum of the part.' }),\n tone: ToneName.nullable().optional().meta({\n description: 'A tone of the theme for its bar: the tone of an option of a `select`.',\n }),\n url: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'Where the bar links: the list of what it counts.' }),\n key: z.union([z.string(), z.number(), z.boolean()]).nullable().optional().meta({\n description:\n 'From `GET /resources/{resource}/aggregate`: the value of the field it groups, `null` for the items without one. The client links the bar to the list filtered by it.',\n }),\n});\n\nexport const BreakdownWidgetData = z\n .looseObject({\n items: z\n .array(BreakdownWidgetItem)\n .max(WIDGET_BREAKDOWN_MAX_ITEMS)\n .meta({\n description: `The parts, at most ${WIDGET_BREAKDOWN_MAX_ITEMS}: clients draw the largest first.`,\n }),\n total: z.number().nullable().optional().meta({\n description:\n 'The total the parts are of. Items with several values count in each of their parts, and once in the total.',\n }),\n other: z.number().nullable().optional().meta({\n description: 'The rest of the total, past the items: drawn last, as \"Other\".',\n }),\n format: WidgetNumberFormat.nullable().optional(),\n })\n .meta({\n description:\n 'The data of a `breakdown` widget: the parts of a total, as horizontal bars (decision 0084).',\n });\n\nexport const MetricWidgetData = z\n .looseObject({\n value: z.number().meta({ description: 'The number, in large type.' }),\n previous: z.number().nullable().optional().meta({\n description:\n 'The same number over the previous period, of the same length (`getPreviousRange()`): the change from it is written under the number.',\n }),\n help: z.string().nullable().optional().meta({\n description: 'A line under the number, translated.',\n }),\n tone: ToneName.nullable().optional().meta({\n description: 'A tone of the theme, only when the number calls for attention.',\n }),\n url: z.string().nullable().optional().meta({\n description: 'Where the number links: the list of what it counts.',\n }),\n target: z.number().positive().nullable().optional().meta({\n description: 'A target for the number, drawn as a meter under it, as for a `stat`.',\n }),\n points: z.array(SeriesPoint).nullable().optional().meta({\n description:\n 'Its trend: one point per period, the dates going up, drawn as a small line.',\n }),\n period: z.enum(WIDGET_SERIES_PERIODS).nullable().optional().meta({\n description: 'The period of each point.',\n }),\n parts: z\n .array(BreakdownWidgetItem)\n .max(WIDGET_BREAKDOWN_MAX_ITEMS)\n .nullable()\n .optional()\n .meta({\n description: `Its largest parts, at most ${WIDGET_BREAKDOWN_MAX_ITEMS}: clients draw the 5 largest as bars, and the rest with \\`other\\`.`,\n }),\n other: z.number().nullable().optional().meta({\n description: 'The rest of the value, past the parts: drawn last, as \"Other\".',\n }),\n format: WidgetNumberFormat.nullable().optional(),\n })\n .superRefine((data, context) => {\n checkPointDates(data.points, ['points'], context);\n })\n .meta({\n description:\n 'The data of a `metric` widget: one subject in one card, its number, its change from the previous period, its trend and its parts (decision 0089).',\n });\n\nexport const TableWidgetColumn = z\n .looseObject({\n key: z.string().min(1).meta({ description: 'The key of its cells in each row.' }),\n label: z.string().meta({ description: 'Its header, translated.' }),\n align: z.enum(WIDGET_TABLE_ALIGNS).optional().meta({\n description: '`end` (the default) for numbers, or `start`.',\n }),\n format: WidgetNumberFormat.nullable().optional().meta({\n description: 'How its numbers are written: the `format` of the widget by default.',\n }),\n })\n .meta({ description: 'A column of a `table` widget.' });\n\nexport const TableWidgetCell = z\n .union([\n z.number(),\n z.null(),\n z.looseObject({\n value: z.number().nullable().meta({ description: 'The number, `null` for none.' }),\n tone: ToneName.nullable().optional().meta({\n description: 'A tone, only when the number calls for attention.',\n }),\n help: z.string().nullable().optional().meta({\n description: 'A word after the number, translated: `rejected` in `6 rejected`.',\n }),\n format: WidgetNumberFormat.nullable().optional().meta({\n description: 'How this number is written, instead of the format of its column.',\n }),\n }),\n ])\n .meta({\n description:\n 'A cell of a `table` widget: a number, `null` for none, or a number with a tone and a word.',\n });\n\nexport const TableWidgetRow = z\n .looseObject({\n label: z.string().meta({ description: 'What the row is about, in its first column.' }),\n url: z.string().nullable().optional().meta({ description: 'Where its label links.' }),\n cells: z.record(z.string(), TableWidgetCell).meta({\n description: 'Its cells, by the `key` of their column. A cell missing is empty.',\n }),\n points: z.array(SeriesPoint).nullable().optional().meta({\n description: 'Its trend, drawn as a small line in a last column: the dates going up.',\n }),\n })\n .meta({ description: 'A row of a `table` widget: one subject.' });\n\nexport const TableWidgetData = z\n .looseObject({\n columns: z\n .array(TableWidgetColumn)\n .min(1)\n .max(WIDGET_TABLE_MAX_COLUMNS)\n .meta({\n description: `Its columns of numbers, at most ${WIDGET_TABLE_MAX_COLUMNS}, after the column of the labels.`,\n }),\n rows: z\n .array(TableWidgetRow)\n .max(WIDGET_TABLE_MAX_ROWS)\n .meta({ description: `Its rows, at most ${WIDGET_TABLE_MAX_ROWS}.` }),\n period: z.enum(WIDGET_SERIES_PERIODS).nullable().optional().meta({\n description: 'The period of the points of the rows.',\n }),\n empty: z.string().nullable().optional().meta({\n description: 'The message without rows, translated.',\n }),\n url: z.string().nullable().optional().meta({ description: 'Where \"See all\" links.' }),\n format: WidgetNumberFormat.nullable().optional(),\n })\n .superRefine((data, context) => {\n const keys = new Set<string>();\n data.columns.forEach((column, index) => {\n if (keys.has(column.key)) {\n context.addIssue({\n code: 'custom',\n message: `Duplicate column key \\`${column.key}\\`.`,\n path: ['columns', index, 'key'],\n });\n }\n keys.add(column.key);\n });\n data.rows.forEach((row, index) => {\n checkPointDates(row.points, ['rows', index, 'points'], context);\n });\n })\n .meta({\n description:\n 'The data of a `table` widget: rows of numbers, one per subject, with an optional trend (decision 0089).',\n });\n\n/** The schema of the data of each built-in widget type. */\nexport const widgetDataSchemas = {\n stat: StatWidgetData,\n series: SeriesWidgetData,\n list: ListWidgetData,\n breakdown: BreakdownWidgetData,\n metric: MetricWidgetData,\n table: TableWidgetData,\n} as const;\n\nexport type OverviewPeriod = z.infer<typeof OverviewPeriod>;\nexport type WidgetSettings = z.infer<typeof WidgetSettings>;\nexport type Widget = z.infer<typeof Widget>;\nexport type WidgetBadge = z.infer<typeof WidgetBadge>;\nexport type StatWidgetData = z.infer<typeof StatWidgetData>;\nexport type SeriesPoint = z.infer<typeof SeriesPoint>;\nexport type SeriesWidgetData = z.infer<typeof SeriesWidgetData>;\nexport type ListWidgetItem = z.infer<typeof ListWidgetItem>;\nexport type ListWidgetData = z.infer<typeof ListWidgetData>;\nexport type BreakdownWidgetItem = z.infer<typeof BreakdownWidgetItem>;\nexport type BreakdownWidgetData = z.infer<typeof BreakdownWidgetData>;\nexport type WidgetNumberFormat = z.infer<typeof WidgetNumberFormat>;\nexport type WidgetAlertSettings = z.infer<typeof WidgetAlertSettings>;\nexport type WidgetSeriesSource = z.infer<typeof WidgetSeriesSource>;\nexport type WidgetRowSource = z.infer<typeof WidgetRowSource>;\nexport type WidgetAlert = z.infer<typeof WidgetAlert>;\nexport type SeriesWidgetSeries = z.infer<typeof SeriesWidgetSeries>;\nexport type MetricWidgetData = z.infer<typeof MetricWidgetData>;\nexport type TableWidgetColumn = z.infer<typeof TableWidgetColumn>;\nexport type TableWidgetCell = z.infer<typeof TableWidgetCell>;\nexport type TableWidgetRow = z.infer<typeof TableWidgetRow>;\nexport type TableWidgetData = z.infer<typeof TableWidgetData>;\n"],"mappings":";;;;;AAsBA,IAAM,WAAW,EAAE,OAAO,CAAC,CAAC,MAAM,cAAc;AAEhD,IAAM,aAAa,EAAE,MAAM;CAAC,EAAE,OAAO;CAAG,EAAE,OAAO;CAAG,EAAE,QAAQ;AAAC,CAAC;AAEhE,IAAM,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC;AAEnF,IAAM,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;AAErD,IAAa,qBAAqB,EAC7B,YAAY;CACT,OAAO,EAAE,KAAK,oBAAoB,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAChD,aACI,8GACR,CAAC;CACD,UAAU,EACL,KAAK,cAAc,CAAC,CACpB,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,uDAAqD,CAAC;CAC/E,iBAAiB,EAAE,KAAK,+BAA+B,CAAC,CAAC,SAAS;CAClE,MAAM,EACD,OAAO,CAAC,CACR,OAAO,cAAc,EAClB,SAAS,2EACb,CAAC,CAAC,CACD,SAAS,CAAC,CACV,KAAK,EACF,aACI,qKACR,CAAC;CACL,aAAa,EAAE,KAAK,2BAA2B,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