@panneau/protocol 5.0.0-alpha.35 → 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 +9 -6
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +237 -15
- package/dist/lint.js.map +1 -1
- package/dist/mock/example.js +1 -1
- package/dist/mock/example.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 +89 -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 +136 -0
- package/dist/schemas/definition.d.ts.map +1 -1
- package/dist/schemas/definition.js +15 -4
- package/dist/schemas/definition.js.map +1 -1
- package/dist/schemas/index.d.ts +287 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +13 -6
- 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 +10 -2
- 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 +260 -66
- package/schema/definition.schema.json +260 -66
- package/schema/openapi.json +604 -8
package/schema/openapi.json
CHANGED
|
@@ -49,6 +49,72 @@
|
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
|
+
"/locale/{locale}": {
|
|
53
|
+
"parameters": [
|
|
54
|
+
{
|
|
55
|
+
"name": "locale",
|
|
56
|
+
"in": "path",
|
|
57
|
+
"required": true,
|
|
58
|
+
"description": "A `locale` of `interfaceLocales`.",
|
|
59
|
+
"schema": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"$ref": "#/components/parameters/Context"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"get": {
|
|
68
|
+
"operationId": "switchLocale",
|
|
69
|
+
"summary": "Optional: switches the interface to a locale of `interfaceLocales`, when their `url` is here (decision 0083). The app comes with a full navigation, and the next page load gets the definition in that locale.",
|
|
70
|
+
"parameters": [
|
|
71
|
+
{
|
|
72
|
+
"name": "next",
|
|
73
|
+
"in": "query",
|
|
74
|
+
"required": false,
|
|
75
|
+
"description": "Where to go next: a local path under the base path of the app. Another one is ignored.",
|
|
76
|
+
"schema": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"responses": {
|
|
82
|
+
"302": {
|
|
83
|
+
"description": "To `next`, or to the base path of the app."
|
|
84
|
+
},
|
|
85
|
+
"401": {
|
|
86
|
+
"description": "Not authenticated.",
|
|
87
|
+
"content": {
|
|
88
|
+
"application/problem+json": {
|
|
89
|
+
"schema": {
|
|
90
|
+
"$ref": "#/components/schemas/Problem"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"403": {
|
|
96
|
+
"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`.",
|
|
97
|
+
"content": {
|
|
98
|
+
"application/problem+json": {
|
|
99
|
+
"schema": {
|
|
100
|
+
"$ref": "#/components/schemas/Problem"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"404": {
|
|
106
|
+
"description": "Not found.",
|
|
107
|
+
"content": {
|
|
108
|
+
"application/problem+json": {
|
|
109
|
+
"schema": {
|
|
110
|
+
"$ref": "#/components/schemas/Problem"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
52
118
|
"/context/{param}/options": {
|
|
53
119
|
"parameters": [
|
|
54
120
|
{
|
|
@@ -347,6 +413,132 @@
|
|
|
347
413
|
}
|
|
348
414
|
}
|
|
349
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
|
+
},
|
|
350
542
|
"/resources/{resource}/{id}": {
|
|
351
543
|
"parameters": [
|
|
352
544
|
{
|
|
@@ -3063,10 +3255,89 @@
|
|
|
3063
3255
|
],
|
|
3064
3256
|
"get": {
|
|
3065
3257
|
"operationId": "getWidgetData",
|
|
3066
|
-
"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
|
+
],
|
|
3067
3338
|
"responses": {
|
|
3068
3339
|
"200": {
|
|
3069
|
-
"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.",
|
|
3070
3341
|
"content": {
|
|
3071
3342
|
"application/json": {
|
|
3072
3343
|
"schema": {
|
|
@@ -3080,6 +3351,9 @@
|
|
|
3080
3351
|
{
|
|
3081
3352
|
"$ref": "#/components/schemas/ListWidgetData"
|
|
3082
3353
|
},
|
|
3354
|
+
{
|
|
3355
|
+
"$ref": "#/components/schemas/BreakdownWidgetData"
|
|
3356
|
+
},
|
|
3083
3357
|
{
|
|
3084
3358
|
"type": "object",
|
|
3085
3359
|
"additionalProperties": true
|
|
@@ -3119,6 +3393,16 @@
|
|
|
3119
3393
|
}
|
|
3120
3394
|
}
|
|
3121
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
|
+
},
|
|
3122
3406
|
"500": {
|
|
3123
3407
|
"description": "Server error, such as a widget whose data does not have the shape of its type.",
|
|
3124
3408
|
"content": {
|
|
@@ -4434,6 +4718,37 @@
|
|
|
4434
4718
|
],
|
|
4435
4719
|
"additionalProperties": {}
|
|
4436
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
|
+
},
|
|
4437
4752
|
"ListDefinition": {
|
|
4438
4753
|
"type": "object",
|
|
4439
4754
|
"properties": {
|
|
@@ -4508,6 +4823,10 @@
|
|
|
4508
4823
|
"calendar": {
|
|
4509
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).",
|
|
4510
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"
|
|
4511
4830
|
}
|
|
4512
4831
|
},
|
|
4513
4832
|
"additionalProperties": {}
|
|
@@ -4830,6 +5149,74 @@
|
|
|
4830
5149
|
"additionalProperties": {},
|
|
4831
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."
|
|
4832
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
|
+
},
|
|
4833
5220
|
"Resource": {
|
|
4834
5221
|
"type": "object",
|
|
4835
5222
|
"properties": {
|
|
@@ -4877,7 +5264,7 @@
|
|
|
4877
5264
|
"type": "string"
|
|
4878
5265
|
},
|
|
4879
5266
|
"open": {
|
|
4880
|
-
"description": "Where an item's title goes, in its list and wherever the app links to the item (decision
|
|
5267
|
+
"description": "Where an item's title goes, in its list and wherever the app links to the item (decision 0082). `edit`, the default: its edit form, and the show route redirects there. An item the user can't update still opens in the panel. `panel`: the show route, with the item's details in a panel next to the list, for items read more than edited, or shown with their preview. Clients treat a value they don't know as `edit`.",
|
|
4881
5268
|
"anyOf": [
|
|
4882
5269
|
{
|
|
4883
5270
|
"type": "string",
|
|
@@ -4940,6 +5327,10 @@
|
|
|
4940
5327
|
"$ref": "#/components/schemas/ResourceType"
|
|
4941
5328
|
}
|
|
4942
5329
|
},
|
|
5330
|
+
"summary": {
|
|
5331
|
+
"description": "Widgets above the list, which follow its filters and its search (decision 0084).",
|
|
5332
|
+
"$ref": "#/components/schemas/ResourceSummary"
|
|
5333
|
+
},
|
|
4943
5334
|
"settings": {
|
|
4944
5335
|
"type": "object",
|
|
4945
5336
|
"propertyNames": {
|
|
@@ -5091,6 +5482,32 @@
|
|
|
5091
5482
|
],
|
|
5092
5483
|
"additionalProperties": {}
|
|
5093
5484
|
},
|
|
5485
|
+
"InterfaceLocale": {
|
|
5486
|
+
"type": "object",
|
|
5487
|
+
"properties": {
|
|
5488
|
+
"locale": {
|
|
5489
|
+
"type": "string",
|
|
5490
|
+
"minLength": 2,
|
|
5491
|
+
"description": "BCP 47 locale of the interface."
|
|
5492
|
+
},
|
|
5493
|
+
"label": {
|
|
5494
|
+
"type": "string",
|
|
5495
|
+
"description": "The name of the language in that language, such as \"Français\"."
|
|
5496
|
+
},
|
|
5497
|
+
"url": {
|
|
5498
|
+
"type": "string",
|
|
5499
|
+
"minLength": 1,
|
|
5500
|
+
"description": "Where the browser goes to switch to this locale, with a full navigation. The app adds `next`, the path and query to come back to (decision 0083)."
|
|
5501
|
+
}
|
|
5502
|
+
},
|
|
5503
|
+
"required": [
|
|
5504
|
+
"locale",
|
|
5505
|
+
"label",
|
|
5506
|
+
"url"
|
|
5507
|
+
],
|
|
5508
|
+
"additionalProperties": {},
|
|
5509
|
+
"description": "A language the user can switch the interface to."
|
|
5510
|
+
},
|
|
5094
5511
|
"MenuItem": {
|
|
5095
5512
|
"type": "object",
|
|
5096
5513
|
"properties": {
|
|
@@ -5175,6 +5592,17 @@
|
|
|
5175
5592
|
"abilities": {
|
|
5176
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.",
|
|
5177
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"
|
|
5178
5606
|
}
|
|
5179
5607
|
},
|
|
5180
5608
|
"required": [
|
|
@@ -5186,7 +5614,7 @@
|
|
|
5186
5614
|
"type": "object",
|
|
5187
5615
|
"properties": {
|
|
5188
5616
|
"resource": {
|
|
5189
|
-
"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}`.",
|
|
5190
5618
|
"type": "string",
|
|
5191
5619
|
"minLength": 1
|
|
5192
5620
|
},
|
|
@@ -5217,10 +5645,78 @@
|
|
|
5217
5645
|
}
|
|
5218
5646
|
]
|
|
5219
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"
|
|
5680
|
+
}
|
|
5681
|
+
},
|
|
5682
|
+
"additionalProperties": {},
|
|
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
|
+
]
|
|
5220
5713
|
}
|
|
5221
5714
|
},
|
|
5715
|
+
"required": [
|
|
5716
|
+
"options"
|
|
5717
|
+
],
|
|
5222
5718
|
"additionalProperties": {},
|
|
5223
|
-
"description": "
|
|
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)."
|
|
5224
5720
|
},
|
|
5225
5721
|
"Widget": {
|
|
5226
5722
|
"type": "object",
|
|
@@ -5228,12 +5724,12 @@
|
|
|
5228
5724
|
"id": {
|
|
5229
5725
|
"type": "string",
|
|
5230
5726
|
"minLength": 1,
|
|
5231
|
-
"description": "Unique in
|
|
5727
|
+
"description": "Unique in its dashboard: the `{widget}` of its route."
|
|
5232
5728
|
},
|
|
5233
5729
|
"type": {
|
|
5234
5730
|
"type": "string",
|
|
5235
5731
|
"minLength": 1,
|
|
5236
|
-
"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."
|
|
5237
5733
|
},
|
|
5238
5734
|
"label": {
|
|
5239
5735
|
"type": "string"
|
|
@@ -5826,6 +6322,13 @@
|
|
|
5826
6322
|
},
|
|
5827
6323
|
"description": "Locales of localized content fields."
|
|
5828
6324
|
},
|
|
6325
|
+
"interfaceLocales": {
|
|
6326
|
+
"description": "The languages of the interface, `locale` among them: with two or more, the shell has a switcher (decision 0083). Not the locales of the content, which are `locales`.",
|
|
6327
|
+
"type": "array",
|
|
6328
|
+
"items": {
|
|
6329
|
+
"$ref": "#/components/schemas/InterfaceLocale"
|
|
6330
|
+
}
|
|
6331
|
+
},
|
|
5829
6332
|
"api": {
|
|
5830
6333
|
"type": "object",
|
|
5831
6334
|
"properties": {
|
|
@@ -5879,7 +6382,7 @@
|
|
|
5879
6382
|
"$ref": "#/components/schemas/Auth"
|
|
5880
6383
|
},
|
|
5881
6384
|
"dashboard": {
|
|
5882
|
-
"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.",
|
|
5883
6386
|
"type": "object",
|
|
5884
6387
|
"properties": {
|
|
5885
6388
|
"widgets": {
|
|
@@ -5887,6 +6390,9 @@
|
|
|
5887
6390
|
"items": {
|
|
5888
6391
|
"$ref": "#/components/schemas/Widget"
|
|
5889
6392
|
}
|
|
6393
|
+
},
|
|
6394
|
+
"period": {
|
|
6395
|
+
"$ref": "#/components/schemas/OverviewPeriod"
|
|
5890
6396
|
}
|
|
5891
6397
|
},
|
|
5892
6398
|
"required": [
|
|
@@ -7556,6 +8062,18 @@
|
|
|
7556
8062
|
"string",
|
|
7557
8063
|
"null"
|
|
7558
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
|
+
]
|
|
7559
8077
|
}
|
|
7560
8078
|
},
|
|
7561
8079
|
"required": [
|
|
@@ -7688,6 +8206,84 @@
|
|
|
7688
8206
|
],
|
|
7689
8207
|
"additionalProperties": {},
|
|
7690
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)."
|
|
7691
8287
|
}
|
|
7692
8288
|
},
|
|
7693
8289
|
"parameters": {
|