@panneau/protocol 5.0.0-alpha.7 → 5.0.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/conditions.d.ts +1 -1
  2. package/dist/conformance/index.d.ts.map +1 -1
  3. package/dist/conformance/index.js +10 -4
  4. package/dist/conformance/index.js.map +1 -1
  5. package/dist/index.d.ts +4 -4
  6. package/dist/index.js +4 -4
  7. package/dist/lint.d.ts +2 -2
  8. package/dist/mock/example.d.ts +1 -1
  9. package/dist/mock/index.d.ts +3 -3
  10. package/dist/mock/index.d.ts.map +1 -1
  11. package/dist/mock/index.js +14 -0
  12. package/dist/mock/index.js.map +1 -1
  13. package/dist/openapi.d.ts.map +1 -1
  14. package/dist/openapi.js +19 -7
  15. package/dist/openapi.js.map +1 -1
  16. package/dist/problem.d.ts +1 -1
  17. package/dist/query.d.ts +14 -0
  18. package/dist/query.d.ts.map +1 -1
  19. package/dist/query.js +11 -1
  20. package/dist/query.js.map +1 -1
  21. package/dist/rules.d.ts +1 -1
  22. package/dist/runtime/index.d.ts +13 -13
  23. package/dist/runtime/index.d.ts.map +1 -1
  24. package/dist/runtime/index.js +2 -2
  25. package/dist/schemas/action.d.ts +8 -7
  26. package/dist/schemas/action.d.ts.map +1 -1
  27. package/dist/schemas/api.d.ts +14 -2
  28. package/dist/schemas/api.d.ts.map +1 -1
  29. package/dist/schemas/api.js +8 -2
  30. package/dist/schemas/api.js.map +1 -1
  31. package/dist/schemas/boot.d.ts +24 -1
  32. package/dist/schemas/boot.d.ts.map +1 -1
  33. package/dist/schemas/boot.js +2 -1
  34. package/dist/schemas/boot.js.map +1 -1
  35. package/dist/schemas/common.d.ts +1 -0
  36. package/dist/schemas/common.d.ts.map +1 -1
  37. package/dist/schemas/common.js +2 -1
  38. package/dist/schemas/common.js.map +1 -1
  39. package/dist/schemas/definition.d.ts +39 -15
  40. package/dist/schemas/definition.d.ts.map +1 -1
  41. package/dist/schemas/definition.js +10 -3
  42. package/dist/schemas/definition.js.map +1 -1
  43. package/dist/schemas/field.d.ts +2 -1
  44. package/dist/schemas/field.d.ts.map +1 -1
  45. package/dist/schemas/index.d.ts +67 -17
  46. package/dist/schemas/index.d.ts.map +1 -1
  47. package/dist/schemas/index.js +5 -3
  48. package/dist/schemas/index.js.map +1 -1
  49. package/dist/schemas/layout.d.ts +1 -1
  50. package/dist/schemas/list.d.ts +6 -0
  51. package/dist/schemas/list.d.ts.map +1 -1
  52. package/dist/schemas/list.js +1 -0
  53. package/dist/schemas/list.js.map +1 -1
  54. package/dist/schemas/resource.d.ts +17 -10
  55. package/dist/schemas/resource.d.ts.map +1 -1
  56. package/dist/themes.d.ts +1 -1
  57. package/dist/transforms.d.ts +1 -1
  58. package/dist/validate.d.ts +2 -2
  59. package/package.json +3 -3
  60. package/schema/boot.schema.json +42 -0
  61. package/schema/definition.schema.json +39 -0
  62. package/schema/openapi.json +151 -15
@@ -21,6 +21,7 @@ export declare const Filter: z.ZodObject<{
21
21
  label: z.ZodString;
22
22
  description: z.ZodOptional<z.ZodString>;
23
23
  disabled: z.ZodOptional<z.ZodBoolean>;
24
+ tone: z.ZodOptional<z.ZodString>;
24
25
  }, z.core.$loose>>>;
25
26
  resource: z.ZodOptional<z.ZodString>;
26
27
  multiple: z.ZodOptional<z.ZodBoolean>;
@@ -49,6 +50,7 @@ export declare const ListDefinition: z.ZodObject<{
49
50
  label: z.ZodString;
50
51
  description: z.ZodOptional<z.ZodString>;
51
52
  disabled: z.ZodOptional<z.ZodBoolean>;
53
+ tone: z.ZodOptional<z.ZodString>;
52
54
  }, z.core.$loose>>>;
53
55
  resource: z.ZodOptional<z.ZodString>;
54
56
  multiple: z.ZodOptional<z.ZodBoolean>;
@@ -60,6 +62,10 @@ export declare const ListDefinition: z.ZodObject<{
60
62
  layouts: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
63
  perPage: z.ZodOptional<z.ZodNumber>;
62
64
  perPageOptions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
65
+ pagination: z.ZodOptional<z.ZodEnum<{
66
+ pages: "pages";
67
+ cursor: "cursor";
68
+ }>>;
63
69
  inlineEdit: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
70
  selectable: z.ZodOptional<z.ZodBoolean>;
65
71
  }, z.core.$loose>;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/schemas/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,MAAM;;;;;;;;;;;;iBAgBb,CAAC;AAEP,eAAO,MAAM,MAAM;;;;;;;;;;;;;iBAWjB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBzB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/schemas/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,MAAM;;;;;;;;;;;;iBAgBb,CAAC;AAEP,eAAO,MAAM,MAAM;;;;;;;;;;;;;;iBAWjB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBzB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -32,6 +32,7 @@ var ListDefinition = z.looseObject({
32
32
  layouts: z.array(z.string().min(1)).optional(),
33
33
  perPage: z.number().int().positive().optional(),
34
34
  perPageOptions: z.array(z.number().int().positive()).optional(),
35
+ pagination: z.enum(["pages", "cursor"]).optional().meta({ description: "`pages` (the default): numbered pages, with a total. `cursor`: the list follows `nextCursor` of each page with the `cursor` parameter, without page numbers, for large lists that the backend can't count (decision 0039)." }),
35
36
  inlineEdit: z.array(z.string().min(1)).optional().meta({ description: "Fields editable in the list." }),
36
37
  selectable: z.boolean().optional()
37
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","names":[],"sources":["../../src/schemas/list.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Option } from './common';\n\nexport const Column = z\n .looseObject({\n field: z.string().min(1).optional().meta({ description: 'The field shown in the column.' }),\n id: z\n .string()\n .min(1)\n .optional()\n .meta({ description: 'Id of a column that is not a field.' }),\n label: z.string().optional(),\n display: z.string().optional().meta({ description: 'How the value is displayed.' }),\n sortable: z.boolean().optional(),\n width: z.union([z.number(), z.string()]).optional(),\n align: z.enum(['start', 'center', 'end']).optional(),\n })\n .refine((column) => column.field !== undefined || column.id !== undefined, {\n message: 'A column needs a `field` or an `id`.',\n });\n\nexport const Filter = z.looseObject({\n id: z.string().min(1).meta({ description: 'Sent as `filter[id]`.' }),\n type: z.string().min(1).meta({\n description:\n 'Built-in: `text`, `select`, `toggle`, `date`, `date-range`, `relation`. A `date-range` value is the bounds of a range: `filter[id][from]` and `filter[id][to]`, days (`2026-01-31`), both inclusive and both optional.',\n }),\n label: z.string().optional(),\n options: z.array(Option).optional(),\n resource: z.string().optional(),\n multiple: z.boolean().optional(),\n default: z.unknown().optional(),\n});\n\nexport const ListDefinition = z.looseObject({\n columns: z.array(Column).optional(),\n filters: z.array(Filter).optional(),\n sorts: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields the list can be sorted by.' }),\n defaultSort: z\n .string()\n .optional()\n .meta({ description: 'Same format as the `sort` query parameter: `-published_at,title`.' }),\n search: z.boolean().optional().meta({ description: 'Whether the `q` parameter is supported.' }),\n layouts: z.array(z.string().min(1)).optional(),\n perPage: z.number().int().positive().optional(),\n perPageOptions: z.array(z.number().int().positive()).optional(),\n inlineEdit: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields editable in the list.' }),\n selectable: z.boolean().optional(),\n});\n\nexport type Column = z.infer<typeof Column>;\nexport type Filter = z.infer<typeof Filter>;\nexport type ListDefinition = z.infer<typeof ListDefinition>;\n"],"mappings":";;;AAIA,IAAa,SAAS,EACjB,YAAY;CACT,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,iCAAiC,CAAC;CAC1F,IAAI,EACC,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,sCAAsC,CAAC;CAChE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,8BAA8B,CAAC;CAClF,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;CAClD,OAAO,EAAE,KAAK;EAAC;EAAS;EAAU;CAAK,CAAC,CAAC,CAAC,SAAS;AACvD,CAAC,CAAC,CACD,QAAQ,WAAW,OAAO,UAAU,KAAA,KAAa,OAAO,OAAO,KAAA,GAAW,EACvE,SAAS,uCACb,CAAC;AAEL,IAAa,SAAS,EAAE,YAAY;CAChC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EA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version":3,"file":"list.js","names":[],"sources":["../../src/schemas/list.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Option } from './common';\n\nexport const Column = z\n .looseObject({\n field: z.string().min(1).optional().meta({ description: 'The field shown in the column.' }),\n id: z\n .string()\n .min(1)\n .optional()\n .meta({ description: 'Id of a column that is not a field.' }),\n label: z.string().optional(),\n display: z.string().optional().meta({ description: 'How the value is displayed.' }),\n sortable: z.boolean().optional(),\n width: z.union([z.number(), z.string()]).optional(),\n align: z.enum(['start', 'center', 'end']).optional(),\n })\n .refine((column) => column.field !== undefined || column.id !== undefined, {\n message: 'A column needs a `field` or an `id`.',\n });\n\nexport const Filter = z.looseObject({\n id: z.string().min(1).meta({ description: 'Sent as `filter[id]`.' }),\n type: z.string().min(1).meta({\n description:\n 'Built-in: `text`, `select`, `toggle`, `date`, `date-range`, `relation`. A `date-range` value is the bounds of a range: `filter[id][from]` and `filter[id][to]`, days (`2026-01-31`), both inclusive and both optional.',\n }),\n label: z.string().optional(),\n options: z.array(Option).optional(),\n resource: z.string().optional(),\n multiple: z.boolean().optional(),\n default: z.unknown().optional(),\n});\n\nexport const ListDefinition = z.looseObject({\n columns: z.array(Column).optional(),\n filters: z.array(Filter).optional(),\n sorts: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields the list can be sorted by.' }),\n defaultSort: z\n .string()\n .optional()\n .meta({ description: 'Same format as the `sort` query parameter: `-published_at,title`.' }),\n search: z.boolean().optional().meta({ description: 'Whether the `q` parameter is supported.' }),\n layouts: z.array(z.string().min(1)).optional(),\n perPage: z.number().int().positive().optional(),\n perPageOptions: z.array(z.number().int().positive()).optional(),\n pagination: z.enum(['pages', 'cursor']).optional().meta({\n description:\n \"`pages` (the default): numbered pages, with a total. `cursor`: the list follows `nextCursor` of each page with the `cursor` parameter, without page numbers, for large lists that the backend can't count (decision 0039).\",\n }),\n inlineEdit: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields editable in the list.' }),\n selectable: z.boolean().optional(),\n});\n\nexport type Column = z.infer<typeof Column>;\nexport type Filter = z.infer<typeof Filter>;\nexport type ListDefinition = z.infer<typeof ListDefinition>;\n"],"mappings":";;;AAIA,IAAa,SAAS,EACjB,YAAY;CACT,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,iCAAiC,CAAC;CAC1F,IAAI,EACC,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,sCAAsC,CAAC;CAChE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,8BAA8B,CAAC;CAClF,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;CAClD,OAAO,EAAE,KAAK;EAAC;EAAS;EAAU;CAAK,CAAC,CAAC,CAAC,SAAS;AACvD,CAAC,CAAC,CACD,QAAQ,WAAW,OAAO,UAAU,KAAA,KAAa,OAAO,OAAO,KAAA,GAAW,EACvE,SAAS,uCACb,CAAC;AAEL,IAAa,SAAS,EAAE,YAAY;CAChC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,wBAAwB,CAAC;CACnE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EACzB,aACI,yNACR,CAAC;CACD,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,SAAS,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS;AAClC,CAAC;AAED,IAAa,iBAAiB,EAAE,YAAY;CACxC,SAAS,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAClC,SAAS,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAClC,OAAO,EACF,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,oCAAoC,CAAC;CAC9D,aAAa,EACR,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,oEAAoE,CAAC;CAC9F,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,0CAA0C,CAAC;CAC9F,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;CAC7C,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC9C,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;CAC9D,YAAY,EAAE,KAAK,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACpD,aACI,6NACR,CAAC;CACD,YAAY,EACP,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,+BAA+B,CAAC;CACzD,YAAY,EAAE,QAAQ,CAAC,CAAC,SAAS;AACrC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { BlockType, Field } from './field';
3
- import { LayoutNode } from './layout';
2
+ import { BlockType, Field } from './field.js';
3
+ import { LayoutNode } from './layout.js';
4
4
  export declare const ResourceFeatures: z.ZodObject<{
5
5
  drafts: z.ZodOptional<z.ZodBoolean>;
6
6
  revisions: z.ZodOptional<z.ZodBoolean>;
@@ -96,14 +96,15 @@ export declare const Resource: z.ZodObject<{
96
96
  in: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
97
97
  notIn: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
98
98
  filled: z.ZodOptional<z.ZodBoolean>;
99
- all: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
100
- any: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
99
+ all: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
100
+ any: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
101
101
  }, z.core.$loose>>;
102
102
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
103
103
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
104
104
  label: z.ZodString;
105
105
  description: z.ZodOptional<z.ZodString>;
106
106
  disabled: z.ZodOptional<z.ZodBoolean>;
107
+ tone: z.ZodOptional<z.ZodString>;
107
108
  }, z.core.$loose>>>;
108
109
  multiple: z.ZodOptional<z.ZodBoolean>;
109
110
  resource: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
@@ -141,8 +142,8 @@ export declare const Resource: z.ZodObject<{
141
142
  in: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
142
143
  notIn: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
143
144
  filled: z.ZodOptional<z.ZodBoolean>;
144
- all: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
145
- any: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
145
+ all: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
146
+ any: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
146
147
  }, z.core.$loose>>;
147
148
  children: z.ZodOptional<z.ZodArray<typeof LayoutNode>>;
148
149
  }, z.core.$loose>>>;
@@ -170,6 +171,7 @@ export declare const Resource: z.ZodObject<{
170
171
  label: z.ZodString;
171
172
  description: z.ZodOptional<z.ZodString>;
172
173
  disabled: z.ZodOptional<z.ZodBoolean>;
174
+ tone: z.ZodOptional<z.ZodString>;
173
175
  }, z.core.$loose>>>;
174
176
  resource: z.ZodOptional<z.ZodString>;
175
177
  multiple: z.ZodOptional<z.ZodBoolean>;
@@ -181,6 +183,10 @@ export declare const Resource: z.ZodObject<{
181
183
  layouts: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
184
  perPage: z.ZodOptional<z.ZodNumber>;
183
185
  perPageOptions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
186
+ pagination: z.ZodOptional<z.ZodEnum<{
187
+ pages: "pages";
188
+ cursor: "cursor";
189
+ }>>;
184
190
  inlineEdit: z.ZodOptional<z.ZodArray<z.ZodString>>;
185
191
  selectable: z.ZodOptional<z.ZodBoolean>;
186
192
  }, z.core.$loose>>;
@@ -282,14 +288,15 @@ export declare const Resource: z.ZodObject<{
282
288
  in: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
283
289
  notIn: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
284
290
  filled: z.ZodOptional<z.ZodBoolean>;
285
- all: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
286
- any: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
291
+ all: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
292
+ any: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
287
293
  }, z.core.$loose>>;
288
294
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
289
295
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
290
296
  label: z.ZodString;
291
297
  description: z.ZodOptional<z.ZodString>;
292
298
  disabled: z.ZodOptional<z.ZodBoolean>;
299
+ tone: z.ZodOptional<z.ZodString>;
293
300
  }, z.core.$loose>>>;
294
301
  multiple: z.ZodOptional<z.ZodBoolean>;
295
302
  resource: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
@@ -326,8 +333,8 @@ export declare const Resource: z.ZodObject<{
326
333
  in: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
327
334
  notIn: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
328
335
  filled: z.ZodOptional<z.ZodBoolean>;
329
- all: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
330
- any: z.ZodOptional<z.ZodArray<typeof import("./common").Condition>>;
336
+ all: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
337
+ any: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
331
338
  }, z.core.$loose>>;
332
339
  children: z.ZodOptional<z.ZodArray<typeof LayoutNode>>;
333
340
  }, z.core.$loose>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/schemas/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,eAAO,MAAM,gBAAgB;;;;;;;;;;;iBAmB3B,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkC6C,CAAC;AAEnE,MAAM,MAAM,gBAAg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,CAAC,CAAC"}
package/dist/themes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Theme } from './schemas/theme';
1
+ import type { Theme } from './schemas/theme.js';
2
2
  /** A theme to merge: `tokens` can be left out, as in the theme of a definition. */
3
3
  export type PartialTheme = Partial<Theme>;
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { MediaTransform } from './schemas/api';
1
+ import type { MediaTransform } from './schemas/api.js';
2
2
  /** The ratio of `width:height` (`16:9` gives 1.777…), or null when it isn't one. */
3
3
  export declare function parseRatio(ratio: string): number | null;
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import type { z } from 'zod';
2
- import { BootConfig } from './schemas/boot';
3
- import { Definition } from './schemas/definition';
2
+ import { BootConfig } from './schemas/boot.js';
3
+ import { Definition } from './schemas/definition.js';
4
4
  export interface ValidationIssue {
5
5
  /** Dot path of the invalid value (`resources.0.fields.2.type`), empty for the root. */
6
6
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/protocol",
3
- "version": "5.0.0-alpha.7",
3
+ "version": "5.0.0-alpha.9",
4
4
  "description": "The Panneau protocol: definition schema, HTTP API spec and conformance kit",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,9 +42,9 @@
42
42
  "schema"
43
43
  ],
44
44
  "scripts": {
45
- "build": "vite build && tsc -p tsconfig.build.json && node scripts/generate-schemas.js",
45
+ "build": "vite build && node ../../scripts/declarations.js && node scripts/generate-schemas.js",
46
46
  "typecheck": "tsc --noEmit",
47
- "api": "tsc -p tsconfig.build.json && node ../../scripts/api-report.js"
47
+ "api": "node ../../scripts/declarations.js && node ../../scripts/api-report.js"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
@@ -22,6 +22,9 @@
22
22
  "definition": {
23
23
  "$ref": "#/$defs/Definition"
24
24
  },
25
+ "auth": {
26
+ "$ref": "#/$defs/Auth"
27
+ },
25
28
  "loginUrl": {
26
29
  "type": [
27
30
  "string",
@@ -688,6 +691,10 @@
688
691
  },
689
692
  "disabled": {
690
693
  "type": "boolean"
694
+ },
695
+ "tone": {
696
+ "type": "string",
697
+ "pattern": "^[a-z0-9-]+$"
691
698
  }
692
699
  },
693
700
  "required": [
@@ -827,6 +834,13 @@
827
834
  "maximum": 9007199254740991
828
835
  }
829
836
  },
837
+ "pagination": {
838
+ "type": "string",
839
+ "enum": [
840
+ "pages",
841
+ "cursor"
842
+ ]
843
+ },
830
844
  "inlineEdit": {
831
845
  "type": "array",
832
846
  "items": {
@@ -1101,6 +1115,13 @@
1101
1115
  "type": "string"
1102
1116
  },
1103
1117
  "additionalProperties": {}
1118
+ },
1119
+ "params": {
1120
+ "type": "array",
1121
+ "items": {
1122
+ "type": "string",
1123
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1124
+ }
1104
1125
  }
1105
1126
  },
1106
1127
  "required": [
@@ -1161,9 +1182,18 @@
1161
1182
  "null"
1162
1183
  ]
1163
1184
  },
1185
+ "logoutUrl": {
1186
+ "type": [
1187
+ "string",
1188
+ "null"
1189
+ ]
1190
+ },
1164
1191
  "password": {
1165
1192
  "type": "boolean"
1166
1193
  },
1194
+ "token": {
1195
+ "$ref": "#/$defs/AuthToken"
1196
+ },
1167
1197
  "providers": {
1168
1198
  "type": "array",
1169
1199
  "items": {
@@ -1188,6 +1218,18 @@
1188
1218
  ],
1189
1219
  "additionalProperties": {}
1190
1220
  },
1221
+ "AuthToken": {
1222
+ "type": "object",
1223
+ "properties": {
1224
+ "label": {
1225
+ "type": "string"
1226
+ },
1227
+ "help": {
1228
+ "type": "string"
1229
+ }
1230
+ },
1231
+ "additionalProperties": {}
1232
+ },
1191
1233
  "AuthProvider": {
1192
1234
  "type": "object",
1193
1235
  "properties": {
@@ -654,6 +654,10 @@
654
654
  },
655
655
  "disabled": {
656
656
  "type": "boolean"
657
+ },
658
+ "tone": {
659
+ "type": "string",
660
+ "pattern": "^[a-z0-9-]+$"
657
661
  }
658
662
  },
659
663
  "required": [
@@ -793,6 +797,13 @@
793
797
  "maximum": 9007199254740991
794
798
  }
795
799
  },
800
+ "pagination": {
801
+ "type": "string",
802
+ "enum": [
803
+ "pages",
804
+ "cursor"
805
+ ]
806
+ },
796
807
  "inlineEdit": {
797
808
  "type": "array",
798
809
  "items": {
@@ -1067,6 +1078,13 @@
1067
1078
  "type": "string"
1068
1079
  },
1069
1080
  "additionalProperties": {}
1081
+ },
1082
+ "params": {
1083
+ "type": "array",
1084
+ "items": {
1085
+ "type": "string",
1086
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1087
+ }
1070
1088
  }
1071
1089
  },
1072
1090
  "required": [
@@ -1127,9 +1145,18 @@
1127
1145
  "null"
1128
1146
  ]
1129
1147
  },
1148
+ "logoutUrl": {
1149
+ "type": [
1150
+ "string",
1151
+ "null"
1152
+ ]
1153
+ },
1130
1154
  "password": {
1131
1155
  "type": "boolean"
1132
1156
  },
1157
+ "token": {
1158
+ "$ref": "#/$defs/AuthToken"
1159
+ },
1133
1160
  "providers": {
1134
1161
  "type": "array",
1135
1162
  "items": {
@@ -1154,6 +1181,18 @@
1154
1181
  ],
1155
1182
  "additionalProperties": {}
1156
1183
  },
1184
+ "AuthToken": {
1185
+ "type": "object",
1186
+ "properties": {
1187
+ "label": {
1188
+ "type": "string"
1189
+ },
1190
+ "help": {
1191
+ "type": "string"
1192
+ }
1193
+ },
1194
+ "additionalProperties": {}
1195
+ },
1157
1196
  "AuthProvider": {
1158
1197
  "type": "object",
1159
1198
  "properties": {
@@ -79,6 +79,15 @@
79
79
  "minimum": 1
80
80
  }
81
81
  },
82
+ {
83
+ "name": "cursor",
84
+ "in": "query",
85
+ "required": false,
86
+ "description": "Lists whose `pagination` is `cursor`: the `nextCursor` (or `previousCursor`) of a page, instead of `page`.",
87
+ "schema": {
88
+ "type": "string"
89
+ }
90
+ },
82
91
  {
83
92
  "name": "sort",
84
93
  "in": "query",
@@ -1107,22 +1116,41 @@
1107
1116
  "content": {
1108
1117
  "application/json": {
1109
1118
  "schema": {
1110
- "type": "object",
1111
- "required": [
1112
- "email",
1113
- "password"
1114
- ],
1115
- "properties": {
1116
- "email": {
1117
- "type": "string"
1118
- },
1119
- "password": {
1120
- "type": "string"
1119
+ "description": "An email and a password, or the single secret of `auth.token`.",
1120
+ "oneOf": [
1121
+ {
1122
+ "type": "object",
1123
+ "required": [
1124
+ "email",
1125
+ "password"
1126
+ ],
1127
+ "properties": {
1128
+ "email": {
1129
+ "type": "string"
1130
+ },
1131
+ "password": {
1132
+ "type": "string"
1133
+ },
1134
+ "remember": {
1135
+ "type": "boolean"
1136
+ }
1137
+ }
1121
1138
  },
1122
- "remember": {
1123
- "type": "boolean"
1139
+ {
1140
+ "type": "object",
1141
+ "required": [
1142
+ "token"
1143
+ ],
1144
+ "properties": {
1145
+ "token": {
1146
+ "type": "string"
1147
+ },
1148
+ "remember": {
1149
+ "type": "boolean"
1150
+ }
1151
+ }
1124
1152
  }
1125
- }
1153
+ ]
1126
1154
  }
1127
1155
  }
1128
1156
  }
@@ -1170,6 +1198,7 @@
1170
1198
  "/auth/logout": {
1171
1199
  "post": {
1172
1200
  "operationId": "logout",
1201
+ "description": "`panneau` auth mode. In `external` mode, the browser goes to `auth.logoutUrl` instead.",
1173
1202
  "responses": {
1174
1203
  "204": {
1175
1204
  "description": "Logged out."
@@ -1789,6 +1818,11 @@
1789
1818
  },
1790
1819
  "disabled": {
1791
1820
  "type": "boolean"
1821
+ },
1822
+ "tone": {
1823
+ "description": "The tone of the option where it shows as a badge, in lists and details: `neutral` (the default), `accent`, `success`, `warning`, `danger`, `info`, or a tone of the theme.",
1824
+ "type": "string",
1825
+ "pattern": "^[a-z0-9-]+$"
1792
1826
  }
1793
1827
  },
1794
1828
  "required": [
@@ -2507,6 +2541,14 @@
2507
2541
  "maximum": 9007199254740991
2508
2542
  }
2509
2543
  },
2544
+ "pagination": {
2545
+ "description": "`pages` (the default): numbered pages, with a total. `cursor`: the list follows `nextCursor` of each page with the `cursor` parameter, without page numbers, for large lists that the backend can't count (decision 0039).",
2546
+ "type": "string",
2547
+ "enum": [
2548
+ "pages",
2549
+ "cursor"
2550
+ ]
2551
+ },
2510
2552
  "inlineEdit": {
2511
2553
  "description": "Fields editable in the list.",
2512
2554
  "type": "array",
@@ -2850,6 +2892,20 @@
2850
2892
  ],
2851
2893
  "additionalProperties": {}
2852
2894
  },
2895
+ "AuthToken": {
2896
+ "type": "object",
2897
+ "properties": {
2898
+ "label": {
2899
+ "description": "Label of the field. Defaults to \"Token\".",
2900
+ "type": "string"
2901
+ },
2902
+ "help": {
2903
+ "description": "Help under the field: where to find it.",
2904
+ "type": "string"
2905
+ }
2906
+ },
2907
+ "additionalProperties": {}
2908
+ },
2853
2909
  "Auth": {
2854
2910
  "type": "object",
2855
2911
  "properties": {
@@ -2868,9 +2924,21 @@
2868
2924
  "null"
2869
2925
  ]
2870
2926
  },
2927
+ "logoutUrl": {
2928
+ "description": "`external`: where the browser goes to log out, the site's own logout. Without it, the app offers no logout.",
2929
+ "type": [
2930
+ "string",
2931
+ "null"
2932
+ ]
2933
+ },
2871
2934
  "password": {
2935
+ "description": "`panneau`: a login with an email and a password. Defaults to true without `token`.",
2872
2936
  "type": "boolean"
2873
2937
  },
2938
+ "token": {
2939
+ "description": "`panneau`: a login with a single secret, such as an access token, sent as `token` to `POST /auth/login`.",
2940
+ "$ref": "#/components/schemas/AuthToken"
2941
+ },
2874
2942
  "providers": {
2875
2943
  "type": "array",
2876
2944
  "items": {
@@ -2955,6 +3023,14 @@
2955
3023
  "type": "string"
2956
3024
  },
2957
3025
  "additionalProperties": {}
3026
+ },
3027
+ "params": {
3028
+ "description": "Names of the path segments after the page: `[\"id\"]` makes `{basePath}/pages/{page}/{id}`. The component gets them as `params`, and route references (`{ \"route\": \"<page>\", \"params\": { \"id\": … } }`) can link to the page. A page with `params` is not in menus.",
3029
+ "type": "array",
3030
+ "items": {
3031
+ "type": "string",
3032
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
3033
+ }
2958
3034
  }
2959
3035
  },
2960
3036
  "required": [
@@ -3628,6 +3704,59 @@
3628
3704
  ],
3629
3705
  "additionalProperties": {}
3630
3706
  },
3707
+ "CursorPagination": {
3708
+ "type": "object",
3709
+ "properties": {
3710
+ "perPage": {
3711
+ "type": "integer",
3712
+ "exclusiveMinimum": 0,
3713
+ "maximum": 9007199254740991
3714
+ },
3715
+ "nextCursor": {
3716
+ "anyOf": [
3717
+ {
3718
+ "type": "string",
3719
+ "minLength": 1
3720
+ },
3721
+ {
3722
+ "type": "null"
3723
+ }
3724
+ ],
3725
+ "description": "The `cursor` of the next page, or `null` on the last page."
3726
+ },
3727
+ "previousCursor": {
3728
+ "description": "The `cursor` of the previous page, or `null` when it is the first page, which has none (and on the first page). Without it, clients go back through the cursors they followed.",
3729
+ "anyOf": [
3730
+ {
3731
+ "type": "string",
3732
+ "minLength": 1
3733
+ },
3734
+ {
3735
+ "type": "null"
3736
+ }
3737
+ ]
3738
+ },
3739
+ "total": {
3740
+ "description": "How many items match, when the backend counts them.",
3741
+ "anyOf": [
3742
+ {
3743
+ "type": "integer",
3744
+ "minimum": 0,
3745
+ "maximum": 9007199254740991
3746
+ },
3747
+ {
3748
+ "type": "null"
3749
+ }
3750
+ ]
3751
+ }
3752
+ },
3753
+ "required": [
3754
+ "perPage",
3755
+ "nextCursor"
3756
+ ],
3757
+ "additionalProperties": {},
3758
+ "description": "The meta of a page of a list whose `pagination` is `cursor`: no page numbers, and no total unless the backend has one."
3759
+ },
3631
3760
  "ItemResponse": {
3632
3761
  "type": "object",
3633
3762
  "properties": {
@@ -3650,7 +3779,14 @@
3650
3779
  }
3651
3780
  },
3652
3781
  "meta": {
3653
- "$ref": "#/components/schemas/Pagination"
3782
+ "anyOf": [
3783
+ {
3784
+ "$ref": "#/components/schemas/Pagination"
3785
+ },
3786
+ {
3787
+ "$ref": "#/components/schemas/CursorPagination"
3788
+ }
3789
+ ]
3654
3790
  }
3655
3791
  },
3656
3792
  "required": [