@panneau/protocol 5.0.0-alpha.36 → 5.0.0-alpha.38
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 +249 -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/action.d.ts +1 -0
- package/dist/schemas/action.d.ts.map +1 -1
- package/dist/schemas/definition.d.ts +127 -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/field.d.ts +1 -0
- package/dist/schemas/field.d.ts.map +1 -1
- package/dist/schemas/field.js +1 -0
- package/dist/schemas/field.js.map +1 -1
- package/dist/schemas/index.d.ts +283 -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 +100 -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 +235 -66
- package/schema/definition.schema.json +235 -66
- package/schema/openapi.json +508 -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": {
|
|
@@ -3975,6 +4193,10 @@
|
|
|
3975
4193
|
"choose"
|
|
3976
4194
|
]
|
|
3977
4195
|
},
|
|
4196
|
+
"transforms": {
|
|
4197
|
+
"description": "`media`, `image`: whether values keep a transform for one use. Defaults to true. With `false`, the backend ignores the `transform` of values and items give none, clients send none, and an `image` field has no editor; it can't have `ratios` or the `crop` rule (decision 0087).",
|
|
4198
|
+
"type": "boolean"
|
|
4199
|
+
},
|
|
3978
4200
|
"from": {
|
|
3979
4201
|
"description": "`slug`: the field the slug is generated from. `region`: the field of the same object that holds its country.",
|
|
3980
4202
|
"type": "string"
|
|
@@ -4500,6 +4722,37 @@
|
|
|
4500
4722
|
],
|
|
4501
4723
|
"additionalProperties": {}
|
|
4502
4724
|
},
|
|
4725
|
+
"ListAggregates": {
|
|
4726
|
+
"type": "object",
|
|
4727
|
+
"properties": {
|
|
4728
|
+
"sum": {
|
|
4729
|
+
"description": "Fields that can be summed (`measure=sum:{field}`): `number`, `range` and `duration` fields, and `money` fields of one `currency`.",
|
|
4730
|
+
"type": "array",
|
|
4731
|
+
"items": {
|
|
4732
|
+
"type": "string",
|
|
4733
|
+
"minLength": 1
|
|
4734
|
+
}
|
|
4735
|
+
},
|
|
4736
|
+
"groupBy": {
|
|
4737
|
+
"description": "Fields whose values the items can be grouped by, in a `breakdown` (`group={field}`).",
|
|
4738
|
+
"type": "array",
|
|
4739
|
+
"items": {
|
|
4740
|
+
"type": "string",
|
|
4741
|
+
"minLength": 1
|
|
4742
|
+
}
|
|
4743
|
+
},
|
|
4744
|
+
"dates": {
|
|
4745
|
+
"description": "`date` and `datetime` fields whose days, weeks or months the items can be grouped by, in a `series` (`group={period}:{field}`).",
|
|
4746
|
+
"type": "array",
|
|
4747
|
+
"items": {
|
|
4748
|
+
"type": "string",
|
|
4749
|
+
"minLength": 1
|
|
4750
|
+
}
|
|
4751
|
+
}
|
|
4752
|
+
},
|
|
4753
|
+
"additionalProperties": {},
|
|
4754
|
+
"description": "What `GET /resources/{resource}/aggregate` can count, sum and group by (decision 0084): nothing that is not declared."
|
|
4755
|
+
},
|
|
4503
4756
|
"ListDefinition": {
|
|
4504
4757
|
"type": "object",
|
|
4505
4758
|
"properties": {
|
|
@@ -4574,6 +4827,10 @@
|
|
|
4574
4827
|
"calendar": {
|
|
4575
4828
|
"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
4829
|
"$ref": "#/components/schemas/ListCalendar"
|
|
4830
|
+
},
|
|
4831
|
+
"aggregates": {
|
|
4832
|
+
"description": "The fields that `GET /resources/{resource}/aggregate` sums and groups by (decision 0084). Without it, the resource has no aggregates.",
|
|
4833
|
+
"$ref": "#/components/schemas/ListAggregates"
|
|
4577
4834
|
}
|
|
4578
4835
|
},
|
|
4579
4836
|
"additionalProperties": {}
|
|
@@ -4896,6 +5153,74 @@
|
|
|
4896
5153
|
"additionalProperties": {},
|
|
4897
5154
|
"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
5155
|
},
|
|
5156
|
+
"SummaryPeriod": {
|
|
5157
|
+
"type": "object",
|
|
5158
|
+
"properties": {
|
|
5159
|
+
"options": {
|
|
5160
|
+
"minItems": 1,
|
|
5161
|
+
"type": "array",
|
|
5162
|
+
"items": {
|
|
5163
|
+
"type": "string",
|
|
5164
|
+
"enum": [
|
|
5165
|
+
"7d",
|
|
5166
|
+
"30d",
|
|
5167
|
+
"90d",
|
|
5168
|
+
"month",
|
|
5169
|
+
"year"
|
|
5170
|
+
]
|
|
5171
|
+
},
|
|
5172
|
+
"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."
|
|
5173
|
+
},
|
|
5174
|
+
"default": {
|
|
5175
|
+
"description": "The period the overview opens on, among `options`. Defaults to the first.",
|
|
5176
|
+
"type": "string",
|
|
5177
|
+
"enum": [
|
|
5178
|
+
"7d",
|
|
5179
|
+
"30d",
|
|
5180
|
+
"90d",
|
|
5181
|
+
"month",
|
|
5182
|
+
"year"
|
|
5183
|
+
]
|
|
5184
|
+
},
|
|
5185
|
+
"filter": {
|
|
5186
|
+
"description": "The id of the list's `date-range` filter that the period sets. Defaults to the first `date-range` filter of the list.",
|
|
5187
|
+
"type": "string",
|
|
5188
|
+
"minLength": 1
|
|
5189
|
+
}
|
|
5190
|
+
},
|
|
5191
|
+
"required": [
|
|
5192
|
+
"options"
|
|
5193
|
+
],
|
|
5194
|
+
"additionalProperties": {},
|
|
5195
|
+
"description": "The period of a summary (decision 0084): the list's own `date-range` filter, so choosing it filters the rows too."
|
|
5196
|
+
},
|
|
5197
|
+
"ResourceSummary": {
|
|
5198
|
+
"type": "object",
|
|
5199
|
+
"properties": {
|
|
5200
|
+
"widgets": {
|
|
5201
|
+
"type": "array",
|
|
5202
|
+
"items": {
|
|
5203
|
+
"$ref": "#/components/schemas/Widget"
|
|
5204
|
+
},
|
|
5205
|
+
"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."
|
|
5206
|
+
},
|
|
5207
|
+
"list": {
|
|
5208
|
+
"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.",
|
|
5209
|
+
"type": "string",
|
|
5210
|
+
"enum": [
|
|
5211
|
+
"collapsed"
|
|
5212
|
+
]
|
|
5213
|
+
},
|
|
5214
|
+
"period": {
|
|
5215
|
+
"$ref": "#/components/schemas/SummaryPeriod"
|
|
5216
|
+
}
|
|
5217
|
+
},
|
|
5218
|
+
"required": [
|
|
5219
|
+
"widgets"
|
|
5220
|
+
],
|
|
5221
|
+
"additionalProperties": {},
|
|
5222
|
+
"description": "Widgets above the list of a resource, which follow its filters and its search (decision 0084)."
|
|
5223
|
+
},
|
|
4899
5224
|
"Resource": {
|
|
4900
5225
|
"type": "object",
|
|
4901
5226
|
"properties": {
|
|
@@ -5006,6 +5331,10 @@
|
|
|
5006
5331
|
"$ref": "#/components/schemas/ResourceType"
|
|
5007
5332
|
}
|
|
5008
5333
|
},
|
|
5334
|
+
"summary": {
|
|
5335
|
+
"description": "Widgets above the list, which follow its filters and its search (decision 0084).",
|
|
5336
|
+
"$ref": "#/components/schemas/ResourceSummary"
|
|
5337
|
+
},
|
|
5009
5338
|
"settings": {
|
|
5010
5339
|
"type": "object",
|
|
5011
5340
|
"propertyNames": {
|
|
@@ -5267,6 +5596,17 @@
|
|
|
5267
5596
|
"abilities": {
|
|
5268
5597
|
"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
5598
|
"$ref": "#/components/schemas/Abilities"
|
|
5599
|
+
},
|
|
5600
|
+
"widgets": {
|
|
5601
|
+
"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`.",
|
|
5602
|
+
"type": "array",
|
|
5603
|
+
"items": {
|
|
5604
|
+
"$ref": "#/components/schemas/Widget"
|
|
5605
|
+
}
|
|
5606
|
+
},
|
|
5607
|
+
"period": {
|
|
5608
|
+
"description": "A page whose component is the built-in `dashboard`: one period for its widgets (decision 0084). On `pages.home`, it replaces `dashboard.period`.",
|
|
5609
|
+
"$ref": "#/components/schemas/OverviewPeriod"
|
|
5270
5610
|
}
|
|
5271
5611
|
},
|
|
5272
5612
|
"required": [
|
|
@@ -5278,7 +5618,7 @@
|
|
|
5278
5618
|
"type": "object",
|
|
5279
5619
|
"properties": {
|
|
5280
5620
|
"resource": {
|
|
5281
|
-
"description": "Built-in
|
|
5621
|
+
"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
5622
|
"type": "string",
|
|
5283
5623
|
"minLength": 1
|
|
5284
5624
|
},
|
|
@@ -5309,10 +5649,78 @@
|
|
|
5309
5649
|
}
|
|
5310
5650
|
]
|
|
5311
5651
|
}
|
|
5652
|
+
},
|
|
5653
|
+
"measure": {
|
|
5654
|
+
"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.",
|
|
5655
|
+
"type": "string",
|
|
5656
|
+
"minLength": 1
|
|
5657
|
+
},
|
|
5658
|
+
"group": {
|
|
5659
|
+
"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`.",
|
|
5660
|
+
"type": "string",
|
|
5661
|
+
"minLength": 1
|
|
5662
|
+
},
|
|
5663
|
+
"target": {
|
|
5664
|
+
"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`.",
|
|
5665
|
+
"type": "number",
|
|
5666
|
+
"exclusiveMinimum": 0
|
|
5667
|
+
},
|
|
5668
|
+
"period": {
|
|
5669
|
+
"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.",
|
|
5670
|
+
"anyOf": [
|
|
5671
|
+
{
|
|
5672
|
+
"type": "string",
|
|
5673
|
+
"minLength": 1
|
|
5674
|
+
},
|
|
5675
|
+
{
|
|
5676
|
+
"type": "boolean",
|
|
5677
|
+
"const": false
|
|
5678
|
+
}
|
|
5679
|
+
]
|
|
5680
|
+
},
|
|
5681
|
+
"followsList": {
|
|
5682
|
+
"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.",
|
|
5683
|
+
"type": "boolean"
|
|
5312
5684
|
}
|
|
5313
5685
|
},
|
|
5314
5686
|
"additionalProperties": {},
|
|
5315
|
-
"description": "The settings of a widget: `resource` and `
|
|
5687
|
+
"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."
|
|
5688
|
+
},
|
|
5689
|
+
"OverviewPeriod": {
|
|
5690
|
+
"type": "object",
|
|
5691
|
+
"properties": {
|
|
5692
|
+
"options": {
|
|
5693
|
+
"minItems": 1,
|
|
5694
|
+
"type": "array",
|
|
5695
|
+
"items": {
|
|
5696
|
+
"type": "string",
|
|
5697
|
+
"enum": [
|
|
5698
|
+
"7d",
|
|
5699
|
+
"30d",
|
|
5700
|
+
"90d",
|
|
5701
|
+
"month",
|
|
5702
|
+
"year"
|
|
5703
|
+
]
|
|
5704
|
+
},
|
|
5705
|
+
"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."
|
|
5706
|
+
},
|
|
5707
|
+
"default": {
|
|
5708
|
+
"description": "The period the overview opens on, among `options`. Defaults to the first.",
|
|
5709
|
+
"type": "string",
|
|
5710
|
+
"enum": [
|
|
5711
|
+
"7d",
|
|
5712
|
+
"30d",
|
|
5713
|
+
"90d",
|
|
5714
|
+
"month",
|
|
5715
|
+
"year"
|
|
5716
|
+
]
|
|
5717
|
+
}
|
|
5718
|
+
},
|
|
5719
|
+
"required": [
|
|
5720
|
+
"options"
|
|
5721
|
+
],
|
|
5722
|
+
"additionalProperties": {},
|
|
5723
|
+
"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
5724
|
},
|
|
5317
5725
|
"Widget": {
|
|
5318
5726
|
"type": "object",
|
|
@@ -5320,12 +5728,12 @@
|
|
|
5320
5728
|
"id": {
|
|
5321
5729
|
"type": "string",
|
|
5322
5730
|
"minLength": 1,
|
|
5323
|
-
"description": "Unique in
|
|
5731
|
+
"description": "Unique in its dashboard: the `{widget}` of its route."
|
|
5324
5732
|
},
|
|
5325
5733
|
"type": {
|
|
5326
5734
|
"type": "string",
|
|
5327
5735
|
"minLength": 1,
|
|
5328
|
-
"description": "Built-in: `stat` (a number), `series` (a line over days, weeks or months)
|
|
5736
|
+
"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
5737
|
},
|
|
5330
5738
|
"label": {
|
|
5331
5739
|
"type": "string"
|
|
@@ -5978,7 +6386,7 @@
|
|
|
5978
6386
|
"$ref": "#/components/schemas/Auth"
|
|
5979
6387
|
},
|
|
5980
6388
|
"dashboard": {
|
|
5981
|
-
"description": "The widgets of the home page for the user, in order, when `pages.home` is the `dashboard` (decision 0064).",
|
|
6389
|
+
"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
6390
|
"type": "object",
|
|
5983
6391
|
"properties": {
|
|
5984
6392
|
"widgets": {
|
|
@@ -5986,6 +6394,9 @@
|
|
|
5986
6394
|
"items": {
|
|
5987
6395
|
"$ref": "#/components/schemas/Widget"
|
|
5988
6396
|
}
|
|
6397
|
+
},
|
|
6398
|
+
"period": {
|
|
6399
|
+
"$ref": "#/components/schemas/OverviewPeriod"
|
|
5989
6400
|
}
|
|
5990
6401
|
},
|
|
5991
6402
|
"required": [
|
|
@@ -7655,6 +8066,18 @@
|
|
|
7655
8066
|
"string",
|
|
7656
8067
|
"null"
|
|
7657
8068
|
]
|
|
8069
|
+
},
|
|
8070
|
+
"target": {
|
|
8071
|
+
"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).",
|
|
8072
|
+
"anyOf": [
|
|
8073
|
+
{
|
|
8074
|
+
"type": "number",
|
|
8075
|
+
"exclusiveMinimum": 0
|
|
8076
|
+
},
|
|
8077
|
+
{
|
|
8078
|
+
"type": "null"
|
|
8079
|
+
}
|
|
8080
|
+
]
|
|
7658
8081
|
}
|
|
7659
8082
|
},
|
|
7660
8083
|
"required": [
|
|
@@ -7787,6 +8210,84 @@
|
|
|
7787
8210
|
],
|
|
7788
8211
|
"additionalProperties": {},
|
|
7789
8212
|
"description": "The data of a `list` widget: a few items (decision 0064)."
|
|
8213
|
+
},
|
|
8214
|
+
"BreakdownWidgetItem": {
|
|
8215
|
+
"type": "object",
|
|
8216
|
+
"properties": {
|
|
8217
|
+
"label": {
|
|
8218
|
+
"type": "string",
|
|
8219
|
+
"description": "What the part is, translated: `Failed`."
|
|
8220
|
+
},
|
|
8221
|
+
"value": {
|
|
8222
|
+
"type": "number",
|
|
8223
|
+
"description": "The count or the sum of the part."
|
|
8224
|
+
},
|
|
8225
|
+
"tone": {
|
|
8226
|
+
"description": "A tone of the theme for its bar: the tone of an option of a `select`.",
|
|
8227
|
+
"anyOf": [
|
|
8228
|
+
{
|
|
8229
|
+
"type": "string",
|
|
8230
|
+
"pattern": "^[a-z0-9-]+$"
|
|
8231
|
+
},
|
|
8232
|
+
{
|
|
8233
|
+
"type": "null"
|
|
8234
|
+
}
|
|
8235
|
+
]
|
|
8236
|
+
},
|
|
8237
|
+
"url": {
|
|
8238
|
+
"description": "Where the bar links: the list of what it counts.",
|
|
8239
|
+
"type": [
|
|
8240
|
+
"string",
|
|
8241
|
+
"null"
|
|
8242
|
+
]
|
|
8243
|
+
},
|
|
8244
|
+
"key": {
|
|
8245
|
+
"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.",
|
|
8246
|
+
"type": [
|
|
8247
|
+
"string",
|
|
8248
|
+
"number",
|
|
8249
|
+
"boolean",
|
|
8250
|
+
"null"
|
|
8251
|
+
]
|
|
8252
|
+
}
|
|
8253
|
+
},
|
|
8254
|
+
"required": [
|
|
8255
|
+
"label",
|
|
8256
|
+
"value"
|
|
8257
|
+
],
|
|
8258
|
+
"additionalProperties": {}
|
|
8259
|
+
},
|
|
8260
|
+
"BreakdownWidgetData": {
|
|
8261
|
+
"type": "object",
|
|
8262
|
+
"properties": {
|
|
8263
|
+
"items": {
|
|
8264
|
+
"maxItems": 10,
|
|
8265
|
+
"type": "array",
|
|
8266
|
+
"items": {
|
|
8267
|
+
"$ref": "#/components/schemas/BreakdownWidgetItem"
|
|
8268
|
+
},
|
|
8269
|
+
"description": "The parts, at most 10: clients draw the largest first."
|
|
8270
|
+
},
|
|
8271
|
+
"total": {
|
|
8272
|
+
"description": "The total the parts are of. Items with several values count in each of their parts, and once in the total.",
|
|
8273
|
+
"type": [
|
|
8274
|
+
"number",
|
|
8275
|
+
"null"
|
|
8276
|
+
]
|
|
8277
|
+
},
|
|
8278
|
+
"other": {
|
|
8279
|
+
"description": "The rest of the total, past the items: drawn last, as \"Other\".",
|
|
8280
|
+
"type": [
|
|
8281
|
+
"number",
|
|
8282
|
+
"null"
|
|
8283
|
+
]
|
|
8284
|
+
}
|
|
8285
|
+
},
|
|
8286
|
+
"required": [
|
|
8287
|
+
"items"
|
|
8288
|
+
],
|
|
8289
|
+
"additionalProperties": {},
|
|
8290
|
+
"description": "The data of a `breakdown` widget: the parts of a total, as horizontal bars (decision 0084)."
|
|
7790
8291
|
}
|
|
7791
8292
|
},
|
|
7792
8293
|
"parameters": {
|