@panneau/protocol 5.0.0-alpha.36 → 5.0.0-alpha.37
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/aggregates.d.ts +135 -0
- package/dist/aggregates.d.ts.map +1 -0
- package/dist/aggregates.js +236 -0
- package/dist/aggregates.js.map +1 -0
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +201 -24
- package/dist/conformance/index.js.map +1 -1
- package/dist/dashboards.d.ts +95 -0
- package/dist/dashboards.d.ts.map +1 -0
- package/dist/dashboards.js +140 -0
- package/dist/dashboards.js.map +1 -0
- package/dist/index.js +8 -5
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +237 -15
- package/dist/lint.js.map +1 -1
- package/dist/mock/index.d.ts +27 -8
- package/dist/mock/index.d.ts.map +1 -1
- package/dist/mock/index.js +42 -6
- package/dist/mock/index.js.map +1 -1
- package/dist/openapi.d.ts.map +1 -1
- package/dist/openapi.js +77 -3
- package/dist/openapi.js.map +1 -1
- package/dist/periods.d.ts +49 -0
- package/dist/periods.d.ts.map +1 -0
- package/dist/periods.js +93 -0
- package/dist/periods.js.map +1 -0
- package/dist/runtime/index.d.ts +4 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +5 -2
- package/dist/schemas/definition.d.ts +125 -0
- package/dist/schemas/definition.d.ts.map +1 -1
- package/dist/schemas/definition.js +8 -3
- package/dist/schemas/definition.js.map +1 -1
- package/dist/schemas/index.d.ts +277 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +11 -5
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/list.d.ts +11 -0
- package/dist/schemas/list.d.ts.map +1 -1
- package/dist/schemas/list.js +8 -2
- package/dist/schemas/list.js.map +1 -1
- package/dist/schemas/resource.d.ts +98 -0
- package/dist/schemas/resource.d.ts.map +1 -1
- package/dist/schemas/resource.js +9 -1
- package/dist/schemas/resource.js.map +1 -1
- package/dist/schemas/widget.d.ts +62 -2
- package/dist/schemas/widget.d.ts.map +1 -1
- package/dist/schemas/widget.js +36 -8
- package/dist/schemas/widget.js.map +1 -1
- package/dist/widgets.d.ts +48 -9
- package/dist/widgets.d.ts.map +1 -1
- package/dist/widgets.js +81 -10
- package/dist/widgets.js.map +1 -1
- package/package.json +1 -1
- package/schema/boot.schema.json +232 -66
- package/schema/definition.schema.json +232 -66
- package/schema/openapi.json +504 -7
package/schema/openapi.json
CHANGED
|
@@ -413,6 +413,132 @@
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
},
|
|
416
|
+
"/resources/{resource}/aggregate": {
|
|
417
|
+
"parameters": [
|
|
418
|
+
{
|
|
419
|
+
"name": "resource",
|
|
420
|
+
"in": "path",
|
|
421
|
+
"required": true,
|
|
422
|
+
"description": "Resource id.",
|
|
423
|
+
"schema": {
|
|
424
|
+
"type": "string"
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"$ref": "#/components/parameters/Context"
|
|
429
|
+
}
|
|
430
|
+
],
|
|
431
|
+
"get": {
|
|
432
|
+
"operationId": "getResourceAggregate",
|
|
433
|
+
"description": "The count or the sum of the items of the list that the user can list, with the filters and the search of the list, in the shape of a widget (decision 0084). Only what `list.aggregates` declares is aggregated: a resource without it is a `404`, and an undeclared field, or a measure or a group in the wrong format, a `422` with `errors` keyed by `measure` or `group`. Without a group, a `StatWidgetData`. By a period, a `SeriesWidgetData`: a point per period, at 0 without items, from the period of the `from` bound of the `date-range` filter whose id is the date field to the period of its `to` bound, or without a bound, of the first or the last item; at most 366 points, the latest, and their sum in `total`. By a field, a `BreakdownWidgetData`: a part per value, the largest first, at most 10, the rest in `other`, each with its `key` (`null` for the items without a value), the label and the tone of its option for a `select`, and the measure of every item in `total`.",
|
|
434
|
+
"parameters": [
|
|
435
|
+
{
|
|
436
|
+
"name": "filter",
|
|
437
|
+
"in": "query",
|
|
438
|
+
"required": false,
|
|
439
|
+
"style": "deepObject",
|
|
440
|
+
"explode": true,
|
|
441
|
+
"description": "`filter[status]=published`; `filter[tags][]=a&filter[tags][]=b` for any of several values; `filter[published_at][from]=2026-01-01&filter[published_at][to]=2026-01-31` for the inclusive bounds of a range filter (`date-range`), without the open end.",
|
|
442
|
+
"schema": {
|
|
443
|
+
"type": "object",
|
|
444
|
+
"additionalProperties": true
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"name": "q",
|
|
449
|
+
"in": "query",
|
|
450
|
+
"required": false,
|
|
451
|
+
"description": "Search.",
|
|
452
|
+
"schema": {
|
|
453
|
+
"type": "string"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"name": "measure",
|
|
458
|
+
"in": "query",
|
|
459
|
+
"required": false,
|
|
460
|
+
"description": "What is measured of the items: `count` (the default), or `sum:{field}` of a field of the `sum` of the aggregates of the list. A sum of `money` adds the amounts, in minor units.",
|
|
461
|
+
"schema": {
|
|
462
|
+
"type": "string",
|
|
463
|
+
"pattern": "^(count|sum:.+)$",
|
|
464
|
+
"default": "count"
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "group",
|
|
469
|
+
"in": "query",
|
|
470
|
+
"required": false,
|
|
471
|
+
"description": "How the items are grouped: `{period}:{date field}`, where the period is `day`, `week` (from Monday) or `month` and the field is in the `dates` of the aggregates, or a field of their `groupBy`. Without it, the answer is a stat.",
|
|
472
|
+
"schema": {
|
|
473
|
+
"type": "string",
|
|
474
|
+
"pattern": "^((day|week|month):.+|[^:]+)$"
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
],
|
|
478
|
+
"responses": {
|
|
479
|
+
"200": {
|
|
480
|
+
"description": "The aggregate, in the shape of a widget.",
|
|
481
|
+
"content": {
|
|
482
|
+
"application/json": {
|
|
483
|
+
"schema": {
|
|
484
|
+
"anyOf": [
|
|
485
|
+
{
|
|
486
|
+
"$ref": "#/components/schemas/StatWidgetData"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"$ref": "#/components/schemas/SeriesWidgetData"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"$ref": "#/components/schemas/BreakdownWidgetData"
|
|
493
|
+
}
|
|
494
|
+
]
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"401": {
|
|
500
|
+
"description": "Not authenticated.",
|
|
501
|
+
"content": {
|
|
502
|
+
"application/problem+json": {
|
|
503
|
+
"schema": {
|
|
504
|
+
"$ref": "#/components/schemas/Problem"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
"403": {
|
|
510
|
+
"description": "Not allowed. A value of `Panneau-Context` that the user can't use is a problem of type `urn:panneau:problem:context`, with its `param`. With `auth.emailVerification`, a user whose email address isn't verified gets a problem of type `urn:panneau:problem:email-unverified` on every operation but those of the auth. A user who must have two-factor authentication and hasn't set it up gets a problem of type `urn:panneau:problem:two-factor-required` on every operation but those of the auth and of `/account/two-factor`.",
|
|
511
|
+
"content": {
|
|
512
|
+
"application/problem+json": {
|
|
513
|
+
"schema": {
|
|
514
|
+
"$ref": "#/components/schemas/Problem"
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
"404": {
|
|
520
|
+
"description": "Not found.",
|
|
521
|
+
"content": {
|
|
522
|
+
"application/problem+json": {
|
|
523
|
+
"schema": {
|
|
524
|
+
"$ref": "#/components/schemas/Problem"
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
"422": {
|
|
530
|
+
"description": "Invalid values: messages are in `errors`, keyed by dot path.",
|
|
531
|
+
"content": {
|
|
532
|
+
"application/problem+json": {
|
|
533
|
+
"schema": {
|
|
534
|
+
"$ref": "#/components/schemas/Problem"
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
},
|
|
416
542
|
"/resources/{resource}/{id}": {
|
|
417
543
|
"parameters": [
|
|
418
544
|
{
|
|
@@ -3129,10 +3255,89 @@
|
|
|
3129
3255
|
],
|
|
3130
3256
|
"get": {
|
|
3131
3257
|
"operationId": "getWidgetData",
|
|
3132
|
-
"description": "The data of a widget of
|
|
3258
|
+
"description": "The data of a widget of a dashboard of the user, read as the user (decision 0064): the home page, the dashboard page of `page`, or the summary above the list of `resource`, with the filters and the search of the list (decision 0084). The built-in widgets on a resource (`settings.resource`) have none: clients read the list or the aggregates of the resource. A widget that is not on that page or in that summary of the user is a `404`; a `403` hides the widget. `page` and `resource` together are a `422`.",
|
|
3259
|
+
"parameters": [
|
|
3260
|
+
{
|
|
3261
|
+
"name": "page",
|
|
3262
|
+
"in": "query",
|
|
3263
|
+
"required": false,
|
|
3264
|
+
"description": "The id of the dashboard page of the widget, in `pages`. Defaults to `home`, the home page, whose widgets are `pages.home.widgets` or `dashboard.widgets`. Not with `resource`.",
|
|
3265
|
+
"schema": {
|
|
3266
|
+
"type": "string",
|
|
3267
|
+
"minLength": 1
|
|
3268
|
+
}
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
"name": "resource",
|
|
3272
|
+
"in": "query",
|
|
3273
|
+
"required": false,
|
|
3274
|
+
"description": "The id of the resource whose summary (`summary.widgets`) holds the widget, instead of a page. The request then has the list's current filters and search (`filter`, `q`), unless the widget has `settings.followsList: false`; never its sort or paging.",
|
|
3275
|
+
"schema": {
|
|
3276
|
+
"type": "string",
|
|
3277
|
+
"minLength": 1
|
|
3278
|
+
}
|
|
3279
|
+
},
|
|
3280
|
+
{
|
|
3281
|
+
"name": "filter",
|
|
3282
|
+
"in": "query",
|
|
3283
|
+
"required": false,
|
|
3284
|
+
"style": "deepObject",
|
|
3285
|
+
"explode": true,
|
|
3286
|
+
"description": "`filter[status]=published`; `filter[tags][]=a&filter[tags][]=b` for any of several values; `filter[published_at][from]=2026-01-01&filter[published_at][to]=2026-01-31` for the inclusive bounds of a range filter (`date-range`), without the open end.",
|
|
3287
|
+
"schema": {
|
|
3288
|
+
"type": "object",
|
|
3289
|
+
"additionalProperties": true
|
|
3290
|
+
}
|
|
3291
|
+
},
|
|
3292
|
+
{
|
|
3293
|
+
"name": "q",
|
|
3294
|
+
"in": "query",
|
|
3295
|
+
"required": false,
|
|
3296
|
+
"description": "Search.",
|
|
3297
|
+
"schema": {
|
|
3298
|
+
"type": "string"
|
|
3299
|
+
}
|
|
3300
|
+
},
|
|
3301
|
+
{
|
|
3302
|
+
"name": "period",
|
|
3303
|
+
"in": "query",
|
|
3304
|
+
"required": false,
|
|
3305
|
+
"style": "deepObject",
|
|
3306
|
+
"explode": true,
|
|
3307
|
+
"description": "The period chosen in the overview of the widget (decision 0084), unless the widget has `settings.period: false`: `period[option]=30d&period[from]=2026-10-19&period[to]=2026-11-17`. `from` and `to` are its first and last days, both inclusive, in the time zone of the browser. A wrong period is a `422` keyed by `period`.",
|
|
3308
|
+
"schema": {
|
|
3309
|
+
"type": "object",
|
|
3310
|
+
"properties": {
|
|
3311
|
+
"option": {
|
|
3312
|
+
"type": "string",
|
|
3313
|
+
"enum": [
|
|
3314
|
+
"7d",
|
|
3315
|
+
"30d",
|
|
3316
|
+
"90d",
|
|
3317
|
+
"month",
|
|
3318
|
+
"year"
|
|
3319
|
+
]
|
|
3320
|
+
},
|
|
3321
|
+
"from": {
|
|
3322
|
+
"type": "string",
|
|
3323
|
+
"format": "date"
|
|
3324
|
+
},
|
|
3325
|
+
"to": {
|
|
3326
|
+
"type": "string",
|
|
3327
|
+
"format": "date"
|
|
3328
|
+
}
|
|
3329
|
+
},
|
|
3330
|
+
"required": [
|
|
3331
|
+
"option",
|
|
3332
|
+
"from",
|
|
3333
|
+
"to"
|
|
3334
|
+
]
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
],
|
|
3133
3338
|
"responses": {
|
|
3134
3339
|
"200": {
|
|
3135
|
-
"description": "The widget's data, in the shape of its type: `StatWidgetData`, `SeriesWidgetData` and `
|
|
3340
|
+
"description": "The widget's data, in the shape of its type: `StatWidgetData`, `SeriesWidgetData`, `ListWidgetData` and `BreakdownWidgetData` for the built-in types, the plugin's own object for others.",
|
|
3136
3341
|
"content": {
|
|
3137
3342
|
"application/json": {
|
|
3138
3343
|
"schema": {
|
|
@@ -3146,6 +3351,9 @@
|
|
|
3146
3351
|
{
|
|
3147
3352
|
"$ref": "#/components/schemas/ListWidgetData"
|
|
3148
3353
|
},
|
|
3354
|
+
{
|
|
3355
|
+
"$ref": "#/components/schemas/BreakdownWidgetData"
|
|
3356
|
+
},
|
|
3149
3357
|
{
|
|
3150
3358
|
"type": "object",
|
|
3151
3359
|
"additionalProperties": true
|
|
@@ -3185,6 +3393,16 @@
|
|
|
3185
3393
|
}
|
|
3186
3394
|
}
|
|
3187
3395
|
},
|
|
3396
|
+
"422": {
|
|
3397
|
+
"description": "Invalid values: messages are in `errors`, keyed by dot path.",
|
|
3398
|
+
"content": {
|
|
3399
|
+
"application/problem+json": {
|
|
3400
|
+
"schema": {
|
|
3401
|
+
"$ref": "#/components/schemas/Problem"
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
}
|
|
3405
|
+
},
|
|
3188
3406
|
"500": {
|
|
3189
3407
|
"description": "Server error, such as a widget whose data does not have the shape of its type.",
|
|
3190
3408
|
"content": {
|
|
@@ -4500,6 +4718,37 @@
|
|
|
4500
4718
|
],
|
|
4501
4719
|
"additionalProperties": {}
|
|
4502
4720
|
},
|
|
4721
|
+
"ListAggregates": {
|
|
4722
|
+
"type": "object",
|
|
4723
|
+
"properties": {
|
|
4724
|
+
"sum": {
|
|
4725
|
+
"description": "Fields that can be summed (`measure=sum:{field}`): `number`, `range` and `duration` fields, and `money` fields of one `currency`.",
|
|
4726
|
+
"type": "array",
|
|
4727
|
+
"items": {
|
|
4728
|
+
"type": "string",
|
|
4729
|
+
"minLength": 1
|
|
4730
|
+
}
|
|
4731
|
+
},
|
|
4732
|
+
"groupBy": {
|
|
4733
|
+
"description": "Fields whose values the items can be grouped by, in a `breakdown` (`group={field}`).",
|
|
4734
|
+
"type": "array",
|
|
4735
|
+
"items": {
|
|
4736
|
+
"type": "string",
|
|
4737
|
+
"minLength": 1
|
|
4738
|
+
}
|
|
4739
|
+
},
|
|
4740
|
+
"dates": {
|
|
4741
|
+
"description": "`date` and `datetime` fields whose days, weeks or months the items can be grouped by, in a `series` (`group={period}:{field}`).",
|
|
4742
|
+
"type": "array",
|
|
4743
|
+
"items": {
|
|
4744
|
+
"type": "string",
|
|
4745
|
+
"minLength": 1
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
},
|
|
4749
|
+
"additionalProperties": {},
|
|
4750
|
+
"description": "What `GET /resources/{resource}/aggregate` can count, sum and group by (decision 0084): nothing that is not declared."
|
|
4751
|
+
},
|
|
4503
4752
|
"ListDefinition": {
|
|
4504
4753
|
"type": "object",
|
|
4505
4754
|
"properties": {
|
|
@@ -4574,6 +4823,10 @@
|
|
|
4574
4823
|
"calendar": {
|
|
4575
4824
|
"description": "The calendar of the list: the items of a month on the days of a date field, asked for through a `date-range` filter instead of pages (decision 0044).",
|
|
4576
4825
|
"$ref": "#/components/schemas/ListCalendar"
|
|
4826
|
+
},
|
|
4827
|
+
"aggregates": {
|
|
4828
|
+
"description": "The fields that `GET /resources/{resource}/aggregate` sums and groups by (decision 0084). Without it, the resource has no aggregates.",
|
|
4829
|
+
"$ref": "#/components/schemas/ListAggregates"
|
|
4577
4830
|
}
|
|
4578
4831
|
},
|
|
4579
4832
|
"additionalProperties": {}
|
|
@@ -4896,6 +5149,74 @@
|
|
|
4896
5149
|
"additionalProperties": {},
|
|
4897
5150
|
"description": "A type of the items of a resource (decision 0077): the items of a type have the fields of the resource and its own."
|
|
4898
5151
|
},
|
|
5152
|
+
"SummaryPeriod": {
|
|
5153
|
+
"type": "object",
|
|
5154
|
+
"properties": {
|
|
5155
|
+
"options": {
|
|
5156
|
+
"minItems": 1,
|
|
5157
|
+
"type": "array",
|
|
5158
|
+
"items": {
|
|
5159
|
+
"type": "string",
|
|
5160
|
+
"enum": [
|
|
5161
|
+
"7d",
|
|
5162
|
+
"30d",
|
|
5163
|
+
"90d",
|
|
5164
|
+
"month",
|
|
5165
|
+
"year"
|
|
5166
|
+
]
|
|
5167
|
+
},
|
|
5168
|
+
"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."
|
|
5169
|
+
},
|
|
5170
|
+
"default": {
|
|
5171
|
+
"description": "The period the overview opens on, among `options`. Defaults to the first.",
|
|
5172
|
+
"type": "string",
|
|
5173
|
+
"enum": [
|
|
5174
|
+
"7d",
|
|
5175
|
+
"30d",
|
|
5176
|
+
"90d",
|
|
5177
|
+
"month",
|
|
5178
|
+
"year"
|
|
5179
|
+
]
|
|
5180
|
+
},
|
|
5181
|
+
"filter": {
|
|
5182
|
+
"description": "The id of the list's `date-range` filter that the period sets. Defaults to the first `date-range` filter of the list.",
|
|
5183
|
+
"type": "string",
|
|
5184
|
+
"minLength": 1
|
|
5185
|
+
}
|
|
5186
|
+
},
|
|
5187
|
+
"required": [
|
|
5188
|
+
"options"
|
|
5189
|
+
],
|
|
5190
|
+
"additionalProperties": {},
|
|
5191
|
+
"description": "The period of a summary (decision 0084): the list's own `date-range` filter, so choosing it filters the rows too."
|
|
5192
|
+
},
|
|
5193
|
+
"ResourceSummary": {
|
|
5194
|
+
"type": "object",
|
|
5195
|
+
"properties": {
|
|
5196
|
+
"widgets": {
|
|
5197
|
+
"type": "array",
|
|
5198
|
+
"items": {
|
|
5199
|
+
"$ref": "#/components/schemas/Widget"
|
|
5200
|
+
},
|
|
5201
|
+
"description": "The widgets of the summary for the user, in order, drawn above the list in the grid of a dashboard. Widgets on this resource get the list's current filters and search, unless `settings.followsList` is `false`. Widgets with data of their own are fed by `GET /dashboard/widgets/{widget}?resource={resource}`, with the filters and the search of the list."
|
|
5202
|
+
},
|
|
5203
|
+
"list": {
|
|
5204
|
+
"description": "`collapsed`: the resource opens on its summary, with its list folded under it behind \"Show the N items\". Without it, the list is shown under the summary.",
|
|
5205
|
+
"type": "string",
|
|
5206
|
+
"enum": [
|
|
5207
|
+
"collapsed"
|
|
5208
|
+
]
|
|
5209
|
+
},
|
|
5210
|
+
"period": {
|
|
5211
|
+
"$ref": "#/components/schemas/SummaryPeriod"
|
|
5212
|
+
}
|
|
5213
|
+
},
|
|
5214
|
+
"required": [
|
|
5215
|
+
"widgets"
|
|
5216
|
+
],
|
|
5217
|
+
"additionalProperties": {},
|
|
5218
|
+
"description": "Widgets above the list of a resource, which follow its filters and its search (decision 0084)."
|
|
5219
|
+
},
|
|
4899
5220
|
"Resource": {
|
|
4900
5221
|
"type": "object",
|
|
4901
5222
|
"properties": {
|
|
@@ -5006,6 +5327,10 @@
|
|
|
5006
5327
|
"$ref": "#/components/schemas/ResourceType"
|
|
5007
5328
|
}
|
|
5008
5329
|
},
|
|
5330
|
+
"summary": {
|
|
5331
|
+
"description": "Widgets above the list, which follow its filters and its search (decision 0084).",
|
|
5332
|
+
"$ref": "#/components/schemas/ResourceSummary"
|
|
5333
|
+
},
|
|
5009
5334
|
"settings": {
|
|
5010
5335
|
"type": "object",
|
|
5011
5336
|
"propertyNames": {
|
|
@@ -5267,6 +5592,17 @@
|
|
|
5267
5592
|
"abilities": {
|
|
5268
5593
|
"description": "What the current user can do with the page (decision 0046). `view: false` leaves it out of menus, and its route shows a forbidden state; `pages.home` falls back to the built-in home. Without it, the page is allowed.",
|
|
5269
5594
|
"$ref": "#/components/schemas/Abilities"
|
|
5595
|
+
},
|
|
5596
|
+
"widgets": {
|
|
5597
|
+
"description": "A page whose component is the built-in `dashboard`: its widgets for the user, in order (decision 0084), fed by `GET /dashboard/widgets/{widget}?page={page}`. On `pages.home`, they replace `dashboard.widgets`.",
|
|
5598
|
+
"type": "array",
|
|
5599
|
+
"items": {
|
|
5600
|
+
"$ref": "#/components/schemas/Widget"
|
|
5601
|
+
}
|
|
5602
|
+
},
|
|
5603
|
+
"period": {
|
|
5604
|
+
"description": "A page whose component is the built-in `dashboard`: one period for its widgets (decision 0084). On `pages.home`, it replaces `dashboard.period`.",
|
|
5605
|
+
"$ref": "#/components/schemas/OverviewPeriod"
|
|
5270
5606
|
}
|
|
5271
5607
|
},
|
|
5272
5608
|
"required": [
|
|
@@ -5278,7 +5614,7 @@
|
|
|
5278
5614
|
"type": "object",
|
|
5279
5615
|
"properties": {
|
|
5280
5616
|
"resource": {
|
|
5281
|
-
"description": "Built-in
|
|
5617
|
+
"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}`.",
|
|
5282
5618
|
"type": "string",
|
|
5283
5619
|
"minLength": 1
|
|
5284
5620
|
},
|
|
@@ -5309,10 +5645,78 @@
|
|
|
5309
5645
|
}
|
|
5310
5646
|
]
|
|
5311
5647
|
}
|
|
5648
|
+
},
|
|
5649
|
+
"measure": {
|
|
5650
|
+
"description": "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.",
|
|
5651
|
+
"type": "string",
|
|
5652
|
+
"minLength": 1
|
|
5653
|
+
},
|
|
5654
|
+
"group": {
|
|
5655
|
+
"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`.",
|
|
5656
|
+
"type": "string",
|
|
5657
|
+
"minLength": 1
|
|
5658
|
+
},
|
|
5659
|
+
"target": {
|
|
5660
|
+
"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`.",
|
|
5661
|
+
"type": "number",
|
|
5662
|
+
"exclusiveMinimum": 0
|
|
5663
|
+
},
|
|
5664
|
+
"period": {
|
|
5665
|
+
"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.",
|
|
5666
|
+
"anyOf": [
|
|
5667
|
+
{
|
|
5668
|
+
"type": "string",
|
|
5669
|
+
"minLength": 1
|
|
5670
|
+
},
|
|
5671
|
+
{
|
|
5672
|
+
"type": "boolean",
|
|
5673
|
+
"const": false
|
|
5674
|
+
}
|
|
5675
|
+
]
|
|
5676
|
+
},
|
|
5677
|
+
"followsList": {
|
|
5678
|
+
"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.",
|
|
5679
|
+
"type": "boolean"
|
|
5312
5680
|
}
|
|
5313
5681
|
},
|
|
5314
5682
|
"additionalProperties": {},
|
|
5315
|
-
"description": "The settings of a widget: `resource` and `
|
|
5683
|
+
"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."
|
|
5684
|
+
},
|
|
5685
|
+
"OverviewPeriod": {
|
|
5686
|
+
"type": "object",
|
|
5687
|
+
"properties": {
|
|
5688
|
+
"options": {
|
|
5689
|
+
"minItems": 1,
|
|
5690
|
+
"type": "array",
|
|
5691
|
+
"items": {
|
|
5692
|
+
"type": "string",
|
|
5693
|
+
"enum": [
|
|
5694
|
+
"7d",
|
|
5695
|
+
"30d",
|
|
5696
|
+
"90d",
|
|
5697
|
+
"month",
|
|
5698
|
+
"year"
|
|
5699
|
+
]
|
|
5700
|
+
},
|
|
5701
|
+
"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."
|
|
5702
|
+
},
|
|
5703
|
+
"default": {
|
|
5704
|
+
"description": "The period the overview opens on, among `options`. Defaults to the first.",
|
|
5705
|
+
"type": "string",
|
|
5706
|
+
"enum": [
|
|
5707
|
+
"7d",
|
|
5708
|
+
"30d",
|
|
5709
|
+
"90d",
|
|
5710
|
+
"month",
|
|
5711
|
+
"year"
|
|
5712
|
+
]
|
|
5713
|
+
}
|
|
5714
|
+
},
|
|
5715
|
+
"required": [
|
|
5716
|
+
"options"
|
|
5717
|
+
],
|
|
5718
|
+
"additionalProperties": {},
|
|
5719
|
+
"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)."
|
|
5316
5720
|
},
|
|
5317
5721
|
"Widget": {
|
|
5318
5722
|
"type": "object",
|
|
@@ -5320,12 +5724,12 @@
|
|
|
5320
5724
|
"id": {
|
|
5321
5725
|
"type": "string",
|
|
5322
5726
|
"minLength": 1,
|
|
5323
|
-
"description": "Unique in
|
|
5727
|
+
"description": "Unique in its dashboard: the `{widget}` of its route."
|
|
5324
5728
|
},
|
|
5325
5729
|
"type": {
|
|
5326
5730
|
"type": "string",
|
|
5327
5731
|
"minLength": 1,
|
|
5328
|
-
"description": "Built-in: `stat` (a number), `series` (a line over days, weeks or months)
|
|
5732
|
+
"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."
|
|
5329
5733
|
},
|
|
5330
5734
|
"label": {
|
|
5331
5735
|
"type": "string"
|
|
@@ -5978,7 +6382,7 @@
|
|
|
5978
6382
|
"$ref": "#/components/schemas/Auth"
|
|
5979
6383
|
},
|
|
5980
6384
|
"dashboard": {
|
|
5981
|
-
"description": "The widgets of the home page for the user, in order, when `pages.home` is the `dashboard` (decision 0064).",
|
|
6385
|
+
"description": "The widgets of the home page for the user, in order, when `pages.home` is the `dashboard` (decision 0064): the shorthand of `pages.home.widgets`, which wins when set.",
|
|
5982
6386
|
"type": "object",
|
|
5983
6387
|
"properties": {
|
|
5984
6388
|
"widgets": {
|
|
@@ -5986,6 +6390,9 @@
|
|
|
5986
6390
|
"items": {
|
|
5987
6391
|
"$ref": "#/components/schemas/Widget"
|
|
5988
6392
|
}
|
|
6393
|
+
},
|
|
6394
|
+
"period": {
|
|
6395
|
+
"$ref": "#/components/schemas/OverviewPeriod"
|
|
5989
6396
|
}
|
|
5990
6397
|
},
|
|
5991
6398
|
"required": [
|
|
@@ -7655,6 +8062,18 @@
|
|
|
7655
8062
|
"string",
|
|
7656
8063
|
"null"
|
|
7657
8064
|
]
|
|
8065
|
+
},
|
|
8066
|
+
"target": {
|
|
8067
|
+
"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).",
|
|
8068
|
+
"anyOf": [
|
|
8069
|
+
{
|
|
8070
|
+
"type": "number",
|
|
8071
|
+
"exclusiveMinimum": 0
|
|
8072
|
+
},
|
|
8073
|
+
{
|
|
8074
|
+
"type": "null"
|
|
8075
|
+
}
|
|
8076
|
+
]
|
|
7658
8077
|
}
|
|
7659
8078
|
},
|
|
7660
8079
|
"required": [
|
|
@@ -7787,6 +8206,84 @@
|
|
|
7787
8206
|
],
|
|
7788
8207
|
"additionalProperties": {},
|
|
7789
8208
|
"description": "The data of a `list` widget: a few items (decision 0064)."
|
|
8209
|
+
},
|
|
8210
|
+
"BreakdownWidgetItem": {
|
|
8211
|
+
"type": "object",
|
|
8212
|
+
"properties": {
|
|
8213
|
+
"label": {
|
|
8214
|
+
"type": "string",
|
|
8215
|
+
"description": "What the part is, translated: `Failed`."
|
|
8216
|
+
},
|
|
8217
|
+
"value": {
|
|
8218
|
+
"type": "number",
|
|
8219
|
+
"description": "The count or the sum of the part."
|
|
8220
|
+
},
|
|
8221
|
+
"tone": {
|
|
8222
|
+
"description": "A tone of the theme for its bar: the tone of an option of a `select`.",
|
|
8223
|
+
"anyOf": [
|
|
8224
|
+
{
|
|
8225
|
+
"type": "string",
|
|
8226
|
+
"pattern": "^[a-z0-9-]+$"
|
|
8227
|
+
},
|
|
8228
|
+
{
|
|
8229
|
+
"type": "null"
|
|
8230
|
+
}
|
|
8231
|
+
]
|
|
8232
|
+
},
|
|
8233
|
+
"url": {
|
|
8234
|
+
"description": "Where the bar links: the list of what it counts.",
|
|
8235
|
+
"type": [
|
|
8236
|
+
"string",
|
|
8237
|
+
"null"
|
|
8238
|
+
]
|
|
8239
|
+
},
|
|
8240
|
+
"key": {
|
|
8241
|
+
"description": "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.",
|
|
8242
|
+
"type": [
|
|
8243
|
+
"string",
|
|
8244
|
+
"number",
|
|
8245
|
+
"boolean",
|
|
8246
|
+
"null"
|
|
8247
|
+
]
|
|
8248
|
+
}
|
|
8249
|
+
},
|
|
8250
|
+
"required": [
|
|
8251
|
+
"label",
|
|
8252
|
+
"value"
|
|
8253
|
+
],
|
|
8254
|
+
"additionalProperties": {}
|
|
8255
|
+
},
|
|
8256
|
+
"BreakdownWidgetData": {
|
|
8257
|
+
"type": "object",
|
|
8258
|
+
"properties": {
|
|
8259
|
+
"items": {
|
|
8260
|
+
"maxItems": 10,
|
|
8261
|
+
"type": "array",
|
|
8262
|
+
"items": {
|
|
8263
|
+
"$ref": "#/components/schemas/BreakdownWidgetItem"
|
|
8264
|
+
},
|
|
8265
|
+
"description": "The parts, at most 10: clients draw the largest first."
|
|
8266
|
+
},
|
|
8267
|
+
"total": {
|
|
8268
|
+
"description": "The total the parts are of. Items with several values count in each of their parts, and once in the total.",
|
|
8269
|
+
"type": [
|
|
8270
|
+
"number",
|
|
8271
|
+
"null"
|
|
8272
|
+
]
|
|
8273
|
+
},
|
|
8274
|
+
"other": {
|
|
8275
|
+
"description": "The rest of the total, past the items: drawn last, as \"Other\".",
|
|
8276
|
+
"type": [
|
|
8277
|
+
"number",
|
|
8278
|
+
"null"
|
|
8279
|
+
]
|
|
8280
|
+
}
|
|
8281
|
+
},
|
|
8282
|
+
"required": [
|
|
8283
|
+
"items"
|
|
8284
|
+
],
|
|
8285
|
+
"additionalProperties": {},
|
|
8286
|
+
"description": "The data of a `breakdown` widget: the parts of a total, as horizontal bars (decision 0084)."
|
|
7790
8287
|
}
|
|
7791
8288
|
},
|
|
7792
8289
|
"parameters": {
|