@panneau/protocol 5.0.0-alpha.6 → 5.0.0-alpha.8
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/conditions.d.ts +1 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +15 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/lint.d.ts +2 -2
- package/dist/mock/example.d.ts +1 -1
- package/dist/mock/index.d.ts +3 -3
- package/dist/openapi.d.ts.map +1 -1
- package/dist/openapi.js +18 -7
- package/dist/openapi.js.map +1 -1
- package/dist/problem.d.ts +1 -1
- package/dist/rules.d.ts +1 -1
- package/dist/runtime/index.d.ts +13 -13
- package/dist/runtime/index.js +2 -2
- package/dist/schemas/action.d.ts +7 -7
- package/dist/schemas/boot.d.ts +24 -1
- package/dist/schemas/boot.d.ts.map +1 -1
- package/dist/schemas/boot.js +2 -1
- package/dist/schemas/boot.js.map +1 -1
- package/dist/schemas/definition.d.ts +30 -15
- package/dist/schemas/definition.d.ts.map +1 -1
- package/dist/schemas/definition.js +8 -2
- package/dist/schemas/definition.js.map +1 -1
- package/dist/schemas/field.d.ts +55 -1
- package/dist/schemas/field.d.ts.map +1 -1
- package/dist/schemas/field.js +22 -2
- package/dist/schemas/field.js.map +1 -1
- package/dist/schemas/index.d.ts +74 -15
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +6 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/layout.d.ts +1 -1
- package/dist/schemas/resource.d.ts +10 -10
- package/dist/themes.d.ts +1 -1
- package/dist/transforms.d.ts +1 -1
- package/dist/validate.d.ts +4 -3
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +22 -2
- package/dist/validate.js.map +1 -1
- package/package.json +3 -3
- package/schema/boot.schema.json +24 -0
- package/schema/definition.schema.json +21 -0
- package/schema/openapi.json +143 -14
|
@@ -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,8 +96,8 @@ 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]>;
|
|
@@ -141,8 +141,8 @@ export declare const Resource: z.ZodObject<{
|
|
|
141
141
|
in: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
142
142
|
notIn: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
143
143
|
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>>;
|
|
144
|
+
all: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
|
|
145
|
+
any: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
|
|
146
146
|
}, z.core.$loose>>;
|
|
147
147
|
children: z.ZodOptional<z.ZodArray<typeof LayoutNode>>;
|
|
148
148
|
}, z.core.$loose>>>;
|
|
@@ -282,8 +282,8 @@ export declare const Resource: z.ZodObject<{
|
|
|
282
282
|
in: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
283
283
|
notIn: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
284
284
|
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>>;
|
|
285
|
+
all: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
|
|
286
|
+
any: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
|
|
287
287
|
}, z.core.$loose>>;
|
|
288
288
|
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
289
289
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
@@ -326,8 +326,8 @@ export declare const Resource: z.ZodObject<{
|
|
|
326
326
|
in: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
327
327
|
notIn: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
328
328
|
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>>;
|
|
329
|
+
all: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
|
|
330
|
+
any: z.ZodOptional<z.ZodArray<typeof import("./common.js").Condition>>;
|
|
331
331
|
}, z.core.$loose>>;
|
|
332
332
|
children: z.ZodOptional<z.ZodArray<typeof LayoutNode>>;
|
|
333
333
|
}, z.core.$loose>>>;
|
package/dist/themes.d.ts
CHANGED
package/dist/transforms.d.ts
CHANGED
package/dist/validate.d.ts
CHANGED
|
@@ -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;
|
|
@@ -17,7 +17,8 @@ export type ValidationResult<T> = {
|
|
|
17
17
|
export declare function validate<T extends z.ZodType>(schema: T, input: unknown): ValidationResult<z.infer<T>>;
|
|
18
18
|
/**
|
|
19
19
|
* Validates a definition, as returned by `GET /definition`: against the schema, then the
|
|
20
|
-
* references between its parts (see `lintDefinition()`)
|
|
20
|
+
* references between its parts (see `lintDefinition()`), and the settings of field types that
|
|
21
|
+
* the protocol describes (`RichTextSettings`).
|
|
21
22
|
*/
|
|
22
23
|
export declare function validateDefinition(input: unknown): ValidationResult<Definition>;
|
|
23
24
|
/**
|
package/dist/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,MAAM,WAAW,eAAe;IAC5B,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAC1B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAE/E,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EACxC,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,OAAO,GACf,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAY9B;AAuBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAwB/E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAU/E"}
|
package/dist/validate.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { lintDefinition } from "./lint.js";
|
|
2
|
+
import { RichTextSettings } from "./schemas/field.js";
|
|
2
3
|
import { Definition } from "./schemas/definition.js";
|
|
3
4
|
import { BootConfig } from "./schemas/boot.js";
|
|
4
5
|
//#region src/validate.ts
|
|
@@ -17,14 +18,33 @@ function validate(schema, input) {
|
|
|
17
18
|
}))
|
|
18
19
|
};
|
|
19
20
|
}
|
|
21
|
+
/** Checks the settings of the `richtext` fields of a list of fields, nested ones included. */
|
|
22
|
+
function checkFieldSettings(fields, path) {
|
|
23
|
+
return fields.flatMap((field, index) => {
|
|
24
|
+
const fieldPath = `${path}.${String(index)}`;
|
|
25
|
+
return [
|
|
26
|
+
...field.type === "richtext" && field.settings !== void 0 ? (RichTextSettings.safeParse(field.settings).error?.issues ?? []).map((issue) => ({
|
|
27
|
+
path: [`${fieldPath}.settings`, ...issue.path.map(String)].join("."),
|
|
28
|
+
message: issue.message
|
|
29
|
+
})) : [],
|
|
30
|
+
...checkFieldSettings(field.fields ?? [], `${fieldPath}.fields`),
|
|
31
|
+
...(field.types ?? []).flatMap((type, typeIndex) => checkFieldSettings(type.fields, `${fieldPath}.types.${String(typeIndex)}.fields`))
|
|
32
|
+
];
|
|
33
|
+
});
|
|
34
|
+
}
|
|
20
35
|
/**
|
|
21
36
|
* Validates a definition, as returned by `GET /definition`: against the schema, then the
|
|
22
|
-
* references between its parts (see `lintDefinition()`)
|
|
37
|
+
* references between its parts (see `lintDefinition()`), and the settings of field types that
|
|
38
|
+
* the protocol describes (`RichTextSettings`).
|
|
23
39
|
*/
|
|
24
40
|
function validateDefinition(input) {
|
|
25
41
|
const result = validate(Definition, input);
|
|
26
42
|
if (!result.success) return result;
|
|
27
|
-
const issues = lintDefinition(result.data)
|
|
43
|
+
const issues = [...lintDefinition(result.data), ...result.data.resources.flatMap((resource, index) => [
|
|
44
|
+
...checkFieldSettings(resource.fields, `resources.${String(index)}.fields`),
|
|
45
|
+
...(resource.types ?? []).flatMap((type, typeIndex) => checkFieldSettings(type.fields, `resources.${String(index)}.types.${String(typeIndex)}.fields`)),
|
|
46
|
+
...(resource.actions ?? []).flatMap((action, actionIndex) => checkFieldSettings(action.fields ?? [], `resources.${String(index)}.actions.${String(actionIndex)}.fields`))
|
|
47
|
+
])];
|
|
28
48
|
return issues.length > 0 ? {
|
|
29
49
|
success: false,
|
|
30
50
|
issues
|
package/dist/validate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","names":[],"sources":["../src/validate.ts"],"sourcesContent":["import type { z } from 'zod';\n\nimport { lintDefinition } from './lint';\nimport { BootConfig } from './schemas/boot';\nimport { Definition } from './schemas/definition';\n\nexport interface ValidationIssue {\n /** Dot path of the invalid value (`resources.0.fields.2.type`), empty for the root. */\n path: string;\n message: string;\n}\n\nexport type ValidationResult<T> =\n { success: true; data: T } | { success: false; issues: ValidationIssue[] };\n\n/** Validates a value against one of the protocol's schemas. */\nexport function validate<T extends z.ZodType>(\n schema: T,\n input: unknown,\n): ValidationResult<z.infer<T>> {\n const result = schema.safeParse(input);\n if (result.success) {\n return { success: true, data: result.data };\n }\n return {\n success: false,\n issues: result.error.issues.map((issue) => ({\n path: issue.path.map(String).join('.'),\n message: issue.message,\n })),\n };\n}\n\n/**\n * Validates a definition, as returned by `GET /definition`: against the schema, then the\n * references between its parts (see `lintDefinition()`).\n */\nexport function validateDefinition(input: unknown): ValidationResult<Definition> {\n const result = validate(Definition, input);\n if (!result.success) {\n return result;\n }\n const issues = lintDefinition(result.data);\n return issues.length > 0 ? { success: false, issues } : result;\n}\n\n/**\n * Validates a boot config, as a server writes it in the page: against the schema, then the\n * references between the parts of its inlined definition, if any.\n */\nexport function validateBootConfig(input: unknown): ValidationResult<BootConfig> {\n const result = validate(BootConfig, input);\n if (!result.success || result.data.definition === undefined) {\n return result;\n }\n const issues = lintDefinition(result.data.definition).map((issue) => ({\n ...issue,\n path: issue.path === '' ? 'definition' : `definition.${issue.path}`,\n }));\n return issues.length > 0 ? { success: false, issues } : result;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.js","names":[],"sources":["../src/validate.ts"],"sourcesContent":["import type { z } from 'zod';\n\nimport { lintDefinition } from './lint';\nimport { BootConfig } from './schemas/boot';\nimport { Definition } from './schemas/definition';\nimport { type Field, RichTextSettings } from './schemas/field';\n\nexport interface ValidationIssue {\n /** Dot path of the invalid value (`resources.0.fields.2.type`), empty for the root. */\n path: string;\n message: string;\n}\n\nexport type ValidationResult<T> =\n { success: true; data: T } | { success: false; issues: ValidationIssue[] };\n\n/** Validates a value against one of the protocol's schemas. */\nexport function validate<T extends z.ZodType>(\n schema: T,\n input: unknown,\n): ValidationResult<z.infer<T>> {\n const result = schema.safeParse(input);\n if (result.success) {\n return { success: true, data: result.data };\n }\n return {\n success: false,\n issues: result.error.issues.map((issue) => ({\n path: issue.path.map(String).join('.'),\n message: issue.message,\n })),\n };\n}\n\n/** Checks the settings of the `richtext` fields of a list of fields, nested ones included. */\nfunction checkFieldSettings(fields: readonly Field[], path: string): ValidationIssue[] {\n return fields.flatMap((field, index) => {\n const fieldPath = `${path}.${String(index)}`;\n const own =\n field.type === 'richtext' && field.settings !== undefined\n ? (RichTextSettings.safeParse(field.settings).error?.issues ?? []).map((issue) => ({\n path: [`${fieldPath}.settings`, ...issue.path.map(String)].join('.'),\n message: issue.message,\n }))\n : [];\n return [\n ...own,\n ...checkFieldSettings(field.fields ?? [], `${fieldPath}.fields`),\n ...(field.types ?? []).flatMap((type, typeIndex) =>\n checkFieldSettings(type.fields, `${fieldPath}.types.${String(typeIndex)}.fields`),\n ),\n ];\n });\n}\n\n/**\n * Validates a definition, as returned by `GET /definition`: against the schema, then the\n * references between its parts (see `lintDefinition()`), and the settings of field types that\n * the protocol describes (`RichTextSettings`).\n */\nexport function validateDefinition(input: unknown): ValidationResult<Definition> {\n const result = validate(Definition, input);\n if (!result.success) {\n return result;\n }\n const issues = [\n ...lintDefinition(result.data),\n ...result.data.resources.flatMap((resource, index) => [\n ...checkFieldSettings(resource.fields, `resources.${String(index)}.fields`),\n ...(resource.types ?? []).flatMap((type, typeIndex) =>\n checkFieldSettings(\n type.fields,\n `resources.${String(index)}.types.${String(typeIndex)}.fields`,\n ),\n ),\n ...(resource.actions ?? []).flatMap((action, actionIndex) =>\n checkFieldSettings(\n action.fields ?? [],\n `resources.${String(index)}.actions.${String(actionIndex)}.fields`,\n ),\n ),\n ]),\n ];\n return issues.length > 0 ? { success: false, issues } : result;\n}\n\n/**\n * Validates a boot config, as a server writes it in the page: against the schema, then the\n * references between the parts of its inlined definition, if any.\n */\nexport function validateBootConfig(input: unknown): ValidationResult<BootConfig> {\n const result = validate(BootConfig, input);\n if (!result.success || result.data.definition === undefined) {\n return result;\n }\n const issues = lintDefinition(result.data.definition).map((issue) => ({\n ...issue,\n path: issue.path === '' ? 'definition' : `definition.${issue.path}`,\n }));\n return issues.length > 0 ? { success: false, issues } : result;\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,SACZ,QACA,OAC4B;CAC5B,MAAM,SAAS,OAAO,UAAU,KAAK;CACrC,IAAI,OAAO,SACP,OAAO;EAAE,SAAS;EAAM,MAAM,OAAO;CAAK;CAE9C,OAAO;EACH,SAAS;EACT,QAAQ,OAAO,MAAM,OAAO,KAAK,WAAW;GACxC,MAAM,MAAM,KAAK,IAAI,MAAM,CAAC,CAAC,KAAK,GAAG;GACrC,SAAS,MAAM;EACnB,EAAE;CACN;AACJ;;AAGA,SAAS,mBAAmB,QAA0B,MAAiC;CACnF,OAAO,OAAO,SAAS,OAAO,UAAU;EACpC,MAAM,YAAY,GAAG,KAAK,GAAG,OAAO,KAAK;EAQzC,OAAO;GACH,GAPA,MAAM,SAAS,cAAc,MAAM,aAAa,KAAA,KACzC,iBAAiB,UAAU,MAAM,QAAQ,CAAC,CAAC,OAAO,UAAU,CAAC,EAAA,CAAG,KAAK,WAAW;IAC7E,MAAM,CAAC,GAAG,UAAU,YAAY,GAAG,MAAM,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;IACnE,SAAS,MAAM;GACnB,EAAE,IACF,CAAC;GAGP,GAAG,mBAAmB,MAAM,UAAU,CAAC,GAAG,GAAG,UAAU,QAAQ;GAC/D,IAAI,MAAM,SAAS,CAAC,EAAA,CAAG,SAAS,MAAM,cAClC,mBAAmB,KAAK,QAAQ,GAAG,UAAU,SAAS,OAAO,SAAS,EAAE,QAAQ,CACpF;EACJ;CACJ,CAAC;AACL;;;;;;AAOA,SAAgB,mBAAmB,OAA8C;CAC7E,MAAM,SAAS,SAAS,YAAY,KAAK;CACzC,IAAI,CAAC,OAAO,SACR,OAAO;CAEX,MAAM,SAAS,CACX,GAAG,eAAe,OAAO,IAAI,GAC7B,GAAG,OAAO,KAAK,UAAU,SAAS,UAAU,UAAU;EAClD,GAAG,mBAAmB,SAAS,QAAQ,aAAa,OAAO,KAAK,EAAE,QAAQ;EAC1E,IAAI,SAAS,SAAS,CAAC,EAAA,CAAG,SAAS,MAAM,cACrC,mBACI,KAAK,QACL,aAAa,OAAO,KAAK,EAAE,SAAS,OAAO,SAAS,EAAE,QAC1D,CACJ;EACA,IAAI,SAAS,WAAW,CAAC,EAAA,CAAG,SAAS,QAAQ,gBACzC,mBACI,OAAO,UAAU,CAAC,GAClB,aAAa,OAAO,KAAK,EAAE,WAAW,OAAO,WAAW,EAAE,QAC9D,CACJ;CACJ,CAAC,CACL;CACA,OAAO,OAAO,SAAS,IAAI;EAAE,SAAS;EAAO;CAAO,IAAI;AAC5D;;;;;AAMA,SAAgB,mBAAmB,OAA8C;CAC7E,MAAM,SAAS,SAAS,YAAY,KAAK;CACzC,IAAI,CAAC,OAAO,WAAW,OAAO,KAAK,eAAe,KAAA,GAC9C,OAAO;CAEX,MAAM,SAAS,eAAe,OAAO,KAAK,UAAU,CAAC,CAAC,KAAK,WAAW;EAClE,GAAG;EACH,MAAM,MAAM,SAAS,KAAK,eAAe,cAAc,MAAM;CACjE,EAAE;CACF,OAAO,OAAO,SAAS,IAAI;EAAE,SAAS;EAAO;CAAO,IAAI;AAC5D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/protocol",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.8",
|
|
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 &&
|
|
45
|
+
"build": "vite build && node ../../scripts/declarations.js && node scripts/generate-schemas.js",
|
|
46
46
|
"typecheck": "tsc --noEmit",
|
|
47
|
-
"api": "
|
|
47
|
+
"api": "node ../../scripts/declarations.js && node ../../scripts/api-report.js"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
package/schema/boot.schema.json
CHANGED
|
@@ -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",
|
|
@@ -1161,9 +1164,18 @@
|
|
|
1161
1164
|
"null"
|
|
1162
1165
|
]
|
|
1163
1166
|
},
|
|
1167
|
+
"logoutUrl": {
|
|
1168
|
+
"type": [
|
|
1169
|
+
"string",
|
|
1170
|
+
"null"
|
|
1171
|
+
]
|
|
1172
|
+
},
|
|
1164
1173
|
"password": {
|
|
1165
1174
|
"type": "boolean"
|
|
1166
1175
|
},
|
|
1176
|
+
"token": {
|
|
1177
|
+
"$ref": "#/$defs/AuthToken"
|
|
1178
|
+
},
|
|
1167
1179
|
"providers": {
|
|
1168
1180
|
"type": "array",
|
|
1169
1181
|
"items": {
|
|
@@ -1188,6 +1200,18 @@
|
|
|
1188
1200
|
],
|
|
1189
1201
|
"additionalProperties": {}
|
|
1190
1202
|
},
|
|
1203
|
+
"AuthToken": {
|
|
1204
|
+
"type": "object",
|
|
1205
|
+
"properties": {
|
|
1206
|
+
"label": {
|
|
1207
|
+
"type": "string"
|
|
1208
|
+
},
|
|
1209
|
+
"help": {
|
|
1210
|
+
"type": "string"
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
"additionalProperties": {}
|
|
1214
|
+
},
|
|
1191
1215
|
"AuthProvider": {
|
|
1192
1216
|
"type": "object",
|
|
1193
1217
|
"properties": {
|
|
@@ -1127,9 +1127,18 @@
|
|
|
1127
1127
|
"null"
|
|
1128
1128
|
]
|
|
1129
1129
|
},
|
|
1130
|
+
"logoutUrl": {
|
|
1131
|
+
"type": [
|
|
1132
|
+
"string",
|
|
1133
|
+
"null"
|
|
1134
|
+
]
|
|
1135
|
+
},
|
|
1130
1136
|
"password": {
|
|
1131
1137
|
"type": "boolean"
|
|
1132
1138
|
},
|
|
1139
|
+
"token": {
|
|
1140
|
+
"$ref": "#/$defs/AuthToken"
|
|
1141
|
+
},
|
|
1133
1142
|
"providers": {
|
|
1134
1143
|
"type": "array",
|
|
1135
1144
|
"items": {
|
|
@@ -1154,6 +1163,18 @@
|
|
|
1154
1163
|
],
|
|
1155
1164
|
"additionalProperties": {}
|
|
1156
1165
|
},
|
|
1166
|
+
"AuthToken": {
|
|
1167
|
+
"type": "object",
|
|
1168
|
+
"properties": {
|
|
1169
|
+
"label": {
|
|
1170
|
+
"type": "string"
|
|
1171
|
+
},
|
|
1172
|
+
"help": {
|
|
1173
|
+
"type": "string"
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1176
|
+
"additionalProperties": {}
|
|
1177
|
+
},
|
|
1157
1178
|
"AuthProvider": {
|
|
1158
1179
|
"type": "object",
|
|
1159
1180
|
"properties": {
|
package/schema/openapi.json
CHANGED
|
@@ -1107,22 +1107,41 @@
|
|
|
1107
1107
|
"content": {
|
|
1108
1108
|
"application/json": {
|
|
1109
1109
|
"schema": {
|
|
1110
|
-
"
|
|
1111
|
-
"
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1110
|
+
"description": "An email and a password, or the single secret of `auth.token`.",
|
|
1111
|
+
"oneOf": [
|
|
1112
|
+
{
|
|
1113
|
+
"type": "object",
|
|
1114
|
+
"required": [
|
|
1115
|
+
"email",
|
|
1116
|
+
"password"
|
|
1117
|
+
],
|
|
1118
|
+
"properties": {
|
|
1119
|
+
"email": {
|
|
1120
|
+
"type": "string"
|
|
1121
|
+
},
|
|
1122
|
+
"password": {
|
|
1123
|
+
"type": "string"
|
|
1124
|
+
},
|
|
1125
|
+
"remember": {
|
|
1126
|
+
"type": "boolean"
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1121
1129
|
},
|
|
1122
|
-
|
|
1123
|
-
"type": "
|
|
1130
|
+
{
|
|
1131
|
+
"type": "object",
|
|
1132
|
+
"required": [
|
|
1133
|
+
"token"
|
|
1134
|
+
],
|
|
1135
|
+
"properties": {
|
|
1136
|
+
"token": {
|
|
1137
|
+
"type": "string"
|
|
1138
|
+
},
|
|
1139
|
+
"remember": {
|
|
1140
|
+
"type": "boolean"
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1124
1143
|
}
|
|
1125
|
-
|
|
1144
|
+
]
|
|
1126
1145
|
}
|
|
1127
1146
|
}
|
|
1128
1147
|
}
|
|
@@ -1170,6 +1189,7 @@
|
|
|
1170
1189
|
"/auth/logout": {
|
|
1171
1190
|
"post": {
|
|
1172
1191
|
"operationId": "logout",
|
|
1192
|
+
"description": "`panneau` auth mode. In `external` mode, the browser goes to `auth.logoutUrl` instead.",
|
|
1173
1193
|
"responses": {
|
|
1174
1194
|
"204": {
|
|
1175
1195
|
"description": "Logged out."
|
|
@@ -2234,6 +2254,89 @@
|
|
|
2234
2254
|
"additionalProperties": {},
|
|
2235
2255
|
"description": "A field of a form."
|
|
2236
2256
|
},
|
|
2257
|
+
"RichTextStyle": {
|
|
2258
|
+
"type": "object",
|
|
2259
|
+
"properties": {
|
|
2260
|
+
"label": {
|
|
2261
|
+
"type": "string",
|
|
2262
|
+
"description": "The name of the style in the toolbar."
|
|
2263
|
+
},
|
|
2264
|
+
"class": {
|
|
2265
|
+
"type": "string",
|
|
2266
|
+
"minLength": 1,
|
|
2267
|
+
"description": "The class the style puts on the element: `big`. Several classes are separated by spaces."
|
|
2268
|
+
},
|
|
2269
|
+
"element": {
|
|
2270
|
+
"description": "The element the style applies to: `p` (the default), `h1` to `h6`, `blockquote`, `ul`, `ol` or `li`.",
|
|
2271
|
+
"type": "string",
|
|
2272
|
+
"enum": [
|
|
2273
|
+
"p",
|
|
2274
|
+
"h1",
|
|
2275
|
+
"h2",
|
|
2276
|
+
"h3",
|
|
2277
|
+
"h4",
|
|
2278
|
+
"h5",
|
|
2279
|
+
"h6",
|
|
2280
|
+
"blockquote",
|
|
2281
|
+
"ul",
|
|
2282
|
+
"ol",
|
|
2283
|
+
"li"
|
|
2284
|
+
]
|
|
2285
|
+
}
|
|
2286
|
+
},
|
|
2287
|
+
"required": [
|
|
2288
|
+
"label",
|
|
2289
|
+
"class"
|
|
2290
|
+
],
|
|
2291
|
+
"additionalProperties": {},
|
|
2292
|
+
"description": "A block style of a `richtext` field: a named class on a paragraph, a heading, a quote or a list (`<p class=\"big\">`)."
|
|
2293
|
+
},
|
|
2294
|
+
"RichTextSettings": {
|
|
2295
|
+
"type": "object",
|
|
2296
|
+
"properties": {
|
|
2297
|
+
"toolbar": {
|
|
2298
|
+
"description": "The toolbar, in order: `heading`, `style`, `bold`, `italic`, `underline`, `strike`, `superscript`, `subscript`, `code`, `link`, `bulletList`, `orderedList`, `blockquote`, `horizontalRule`, `clear`, `undo`, `redo`, `|` between groups, and the buttons of plugins. Clients skip the names they don't know.",
|
|
2299
|
+
"type": "array",
|
|
2300
|
+
"items": {
|
|
2301
|
+
"type": "string",
|
|
2302
|
+
"minLength": 1
|
|
2303
|
+
}
|
|
2304
|
+
},
|
|
2305
|
+
"headings": {
|
|
2306
|
+
"description": "The heading levels the toolbar offers. Defaults to 2, 3 and 4.",
|
|
2307
|
+
"type": "array",
|
|
2308
|
+
"items": {
|
|
2309
|
+
"type": "integer",
|
|
2310
|
+
"minimum": 1,
|
|
2311
|
+
"maximum": 6
|
|
2312
|
+
}
|
|
2313
|
+
},
|
|
2314
|
+
"styles": {
|
|
2315
|
+
"description": "The block styles.",
|
|
2316
|
+
"type": "array",
|
|
2317
|
+
"items": {
|
|
2318
|
+
"$ref": "#/components/schemas/RichTextStyle"
|
|
2319
|
+
}
|
|
2320
|
+
},
|
|
2321
|
+
"links": {
|
|
2322
|
+
"type": "object",
|
|
2323
|
+
"properties": {
|
|
2324
|
+
"newTab": {
|
|
2325
|
+
"description": "Which links open in a new tab (`target=\"_blank\" rel=\"noopener noreferrer\"`): as the user chooses (the default), every link to another site, or none.",
|
|
2326
|
+
"type": "string",
|
|
2327
|
+
"enum": [
|
|
2328
|
+
"choose",
|
|
2329
|
+
"external",
|
|
2330
|
+
"never"
|
|
2331
|
+
]
|
|
2332
|
+
}
|
|
2333
|
+
},
|
|
2334
|
+
"additionalProperties": {}
|
|
2335
|
+
}
|
|
2336
|
+
},
|
|
2337
|
+
"additionalProperties": {},
|
|
2338
|
+
"description": "The `settings` of a `richtext` field. Its value is HTML. The toolbar only limits what users add: content that the field stores keeps its elements and attributes."
|
|
2339
|
+
},
|
|
2237
2340
|
"LayoutNode": {
|
|
2238
2341
|
"type": "object",
|
|
2239
2342
|
"properties": {
|
|
@@ -2767,6 +2870,20 @@
|
|
|
2767
2870
|
],
|
|
2768
2871
|
"additionalProperties": {}
|
|
2769
2872
|
},
|
|
2873
|
+
"AuthToken": {
|
|
2874
|
+
"type": "object",
|
|
2875
|
+
"properties": {
|
|
2876
|
+
"label": {
|
|
2877
|
+
"description": "Label of the field. Defaults to \"Token\".",
|
|
2878
|
+
"type": "string"
|
|
2879
|
+
},
|
|
2880
|
+
"help": {
|
|
2881
|
+
"description": "Help under the field: where to find it.",
|
|
2882
|
+
"type": "string"
|
|
2883
|
+
}
|
|
2884
|
+
},
|
|
2885
|
+
"additionalProperties": {}
|
|
2886
|
+
},
|
|
2770
2887
|
"Auth": {
|
|
2771
2888
|
"type": "object",
|
|
2772
2889
|
"properties": {
|
|
@@ -2785,9 +2902,21 @@
|
|
|
2785
2902
|
"null"
|
|
2786
2903
|
]
|
|
2787
2904
|
},
|
|
2905
|
+
"logoutUrl": {
|
|
2906
|
+
"description": "`external`: where the browser goes to log out, the site's own logout. Without it, the app offers no logout.",
|
|
2907
|
+
"type": [
|
|
2908
|
+
"string",
|
|
2909
|
+
"null"
|
|
2910
|
+
]
|
|
2911
|
+
},
|
|
2788
2912
|
"password": {
|
|
2913
|
+
"description": "`panneau`: a login with an email and a password. Defaults to true without `token`.",
|
|
2789
2914
|
"type": "boolean"
|
|
2790
2915
|
},
|
|
2916
|
+
"token": {
|
|
2917
|
+
"description": "`panneau`: a login with a single secret, such as an access token, sent as `token` to `POST /auth/login`.",
|
|
2918
|
+
"$ref": "#/components/schemas/AuthToken"
|
|
2919
|
+
},
|
|
2791
2920
|
"providers": {
|
|
2792
2921
|
"type": "array",
|
|
2793
2922
|
"items": {
|