@panneau/protocol 0.0.0-stage → 5.0.0-alpha.1
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/README.md +35 -2
- package/dist/conditions.d.ts +7 -0
- package/dist/conditions.d.ts.map +1 -0
- package/dist/conditions.js +21 -0
- package/dist/conditions.js.map +1 -0
- package/dist/conformance/index.d.ts +42 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +270 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +73 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/lint.d.ts +8 -0
- package/dist/lint.d.ts.map +1 -0
- package/dist/lint.js +73 -0
- package/dist/lint.js.map +1 -0
- package/dist/mock/example.d.ts +8 -0
- package/dist/mock/example.d.ts.map +1 -0
- package/dist/mock/example.js +190 -0
- package/dist/mock/example.js.map +1 -0
- package/dist/mock/index.d.ts +24 -0
- package/dist/mock/index.d.ts.map +1 -0
- package/dist/mock/index.js +254 -0
- package/dist/mock/index.js.map +1 -0
- package/dist/openapi.d.ts +11 -0
- package/dist/openapi.d.ts.map +1 -0
- package/dist/openapi.js +540 -0
- package/dist/openapi.js.map +1 -0
- package/dist/problem.d.ts +7 -0
- package/dist/problem.d.ts.map +1 -0
- package/dist/problem.js +22 -0
- package/dist/problem.js.map +1 -0
- package/dist/query.d.ts +41 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +80 -0
- package/dist/query.js.map +1 -0
- package/dist/rules.d.ts +29 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +143 -0
- package/dist/rules.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +9 -0
- package/dist/schemas/action.d.ts +163 -0
- package/dist/schemas/action.d.ts.map +1 -0
- package/dist/schemas/action.js +56 -0
- package/dist/schemas/action.js.map +1 -0
- package/dist/schemas/api.d.ts +371 -0
- package/dist/schemas/api.d.ts.map +1 -0
- package/dist/schemas/api.js +140 -0
- package/dist/schemas/api.js.map +1 -0
- package/dist/schemas/boot.d.ts +14 -0
- package/dist/schemas/boot.d.ts.map +1 -0
- package/dist/schemas/boot.js +16 -0
- package/dist/schemas/boot.js.map +1 -0
- package/dist/schemas/common.d.ts +28 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +35 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/definition.d.ts +462 -0
- package/dist/schemas/definition.d.ts.map +1 -0
- package/dist/schemas/definition.js +101 -0
- package/dist/schemas/definition.js.map +1 -0
- package/dist/schemas/field.d.ts +139 -0
- package/dist/schemas/field.d.ts.map +1 -0
- package/dist/schemas/field.js +94 -0
- package/dist/schemas/field.js.map +1 -0
- package/dist/schemas/index.d.ts +1536 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +68 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/layout.d.ts +26 -0
- package/dist/schemas/layout.d.ts.map +1 -0
- package/dist/schemas/layout.js +23 -0
- package/dist/schemas/layout.js.map +1 -0
- package/dist/schemas/list.d.ts +69 -0
- package/dist/schemas/list.d.ts.map +1 -0
- package/dist/schemas/list.js +41 -0
- package/dist/schemas/list.js.map +1 -0
- package/dist/schemas/resource.d.ts +328 -0
- package/dist/schemas/resource.d.ts.map +1 -0
- package/dist/schemas/resource.js +38 -0
- package/dist/schemas/resource.js.map +1 -0
- package/dist/validate.d.ts +28 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +52 -0
- package/dist/validate.js.map +1 -0
- package/dist/values.d.ts +7 -0
- package/dist/values.d.ts.map +1 -0
- package/dist/values.js +29 -0
- package/dist/values.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +9 -0
- package/dist/version.js.map +1 -0
- package/package.json +53 -5
- package/schema/boot.schema.json +1229 -0
- package/schema/definition.schema.json +1195 -0
- package/schema/openapi.json +3839 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","names":[],"sources":["../../src/schemas/resource.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Action } from './action';\nimport { Abilities } from './common';\nimport { BlockType, Field } from './field';\nimport { LayoutNode } from './layout';\nimport { ListDefinition } from './list';\n\nexport const ResourceFeatures = z.looseObject({\n drafts: z.boolean().optional(),\n revisions: z.boolean().optional(),\n preview: z\n .union([\n z.null(),\n z.looseObject({\n mode: z.enum(['component', 'iframe']),\n component: z\n .string()\n .optional()\n .meta({ description: '`component`: the plugin preview.' }),\n }),\n ])\n .optional(),\n search: z\n .boolean()\n .optional()\n .meta({ description: 'Whether the resource is in the global search.' }),\n});\n\nexport const Resource = z\n .looseObject({\n id: z.string().min(1),\n label: z.looseObject({ singular: z.string(), plural: z.string() }),\n description: z.string().optional(),\n icon: z.string().optional(),\n itemTitle: z\n .string()\n .optional()\n .meta({ description: 'The field used as the title of an item, in lists and pickers.' }),\n fields: z.array(Field),\n form: z.looseObject({ layout: z.array(LayoutNode).optional() }).optional(),\n list: ListDefinition.optional(),\n actions: z.array(Action).optional(),\n abilities: Abilities.optional(),\n features: ResourceFeatures.optional(),\n types: z\n .array(BlockType)\n .optional()\n .meta({ description: 'Variants of the resource, each with its own extra fields.' }),\n settings: z.record(z.string(), z.unknown()).optional(),\n })\n .meta({ description: 'A set of items managed in the admin.' });\n\nexport type ResourceFeatures = z.infer<typeof ResourceFeatures>;\nexport type Resource = z.infer<typeof Resource>;\n/** A resource as a backend writes it, before defaults are applied. */\nexport type ResourceInput = z.input<typeof Resource>;\n"],"mappings":";;;;;;;AAQA,IAAa,mBAAmB,EAAE,YAAY;CAC1C,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC7B,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS;CAChC,SAAS,EACJ,MAAM,CACH,EAAE,KAAK,GACP,EAAE,YAAY;EACV,MAAM,EAAE,KAAK,CAAC,aAAa,QAAQ,CAAC;EACpC,WAAW,EACN,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,mCAAmC,CAAC;CACjE,CAAC,CACL,CAAC,CAAC,CACD,SAAS;CACd,QAAQ,EACH,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,gDAAgD,CAAC;AAC9E,CAAC;AAED,IAAa,WAAW,EACnB,YAAY;CACT,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,OAAO,EAAE,YAAY;EAAE,UAAU,EAAE,OAAO;EAAG,QAAQ,EAAE,OAAO;CAAE,CAAC;CACjE,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,WAAW,EACN,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,gEAAgE,CAAC;CAC1F,QAAQ,EAAE,MAAM,KAAK;CACrB,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS;CACzE,MAAM,eAAe,SAAS;CAC9B,SAAS,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAClC,WAAW,UAAU,SAAS;CAC9B,UAAU,iBAAiB,SAAS;CACpC,OAAO,EACF,MAAM,SAAS,CAAC,CAChB,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,4DAA4D,CAAC;CACtF,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;AACzD,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { BootConfig } from './schemas/boot';
|
|
3
|
+
import { Definition } from './schemas/definition';
|
|
4
|
+
export interface ValidationIssue {
|
|
5
|
+
/** Dot path of the invalid value (`resources.0.fields.2.type`), empty for the root. */
|
|
6
|
+
path: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
export type ValidationResult<T> = {
|
|
10
|
+
success: true;
|
|
11
|
+
data: T;
|
|
12
|
+
} | {
|
|
13
|
+
success: false;
|
|
14
|
+
issues: ValidationIssue[];
|
|
15
|
+
};
|
|
16
|
+
/** Validates a value against one of the protocol's schemas. */
|
|
17
|
+
export declare function validate<T extends z.ZodType>(schema: T, input: unknown): ValidationResult<z.infer<T>>;
|
|
18
|
+
/**
|
|
19
|
+
* Validates a definition, as returned by `GET /definition`: against the schema, then the
|
|
20
|
+
* references between its parts (see `lintDefinition()`).
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateDefinition(input: unknown): ValidationResult<Definition>;
|
|
23
|
+
/**
|
|
24
|
+
* Validates a boot config, as a server writes it in the page: against the schema, then the
|
|
25
|
+
* references between the parts of its inlined definition, if any.
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateBootConfig(input: unknown): ValidationResult<BootConfig>;
|
|
28
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +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;AAElD,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;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAO/E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAU/E"}
|
package/dist/validate.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { lintDefinition } from "./lint.js";
|
|
2
|
+
import { Definition } from "./schemas/definition.js";
|
|
3
|
+
import { BootConfig } from "./schemas/boot.js";
|
|
4
|
+
//#region src/validate.ts
|
|
5
|
+
/** Validates a value against one of the protocol's schemas. */
|
|
6
|
+
function validate(schema, input) {
|
|
7
|
+
const result = schema.safeParse(input);
|
|
8
|
+
if (result.success) return {
|
|
9
|
+
success: true,
|
|
10
|
+
data: result.data
|
|
11
|
+
};
|
|
12
|
+
return {
|
|
13
|
+
success: false,
|
|
14
|
+
issues: result.error.issues.map((issue) => ({
|
|
15
|
+
path: issue.path.map(String).join("."),
|
|
16
|
+
message: issue.message
|
|
17
|
+
}))
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Validates a definition, as returned by `GET /definition`: against the schema, then the
|
|
22
|
+
* references between its parts (see `lintDefinition()`).
|
|
23
|
+
*/
|
|
24
|
+
function validateDefinition(input) {
|
|
25
|
+
const result = validate(Definition, input);
|
|
26
|
+
if (!result.success) return result;
|
|
27
|
+
const issues = lintDefinition(result.data);
|
|
28
|
+
return issues.length > 0 ? {
|
|
29
|
+
success: false,
|
|
30
|
+
issues
|
|
31
|
+
} : result;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Validates a boot config, as a server writes it in the page: against the schema, then the
|
|
35
|
+
* references between the parts of its inlined definition, if any.
|
|
36
|
+
*/
|
|
37
|
+
function validateBootConfig(input) {
|
|
38
|
+
const result = validate(BootConfig, input);
|
|
39
|
+
if (!result.success || result.data.definition === void 0) return result;
|
|
40
|
+
const issues = lintDefinition(result.data.definition).map((issue) => ({
|
|
41
|
+
...issue,
|
|
42
|
+
path: issue.path === "" ? "definition" : `definition.${issue.path}`
|
|
43
|
+
}));
|
|
44
|
+
return issues.length > 0 ? {
|
|
45
|
+
success: false,
|
|
46
|
+
issues
|
|
47
|
+
} : result;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { validate, validateBootConfig, validateDefinition };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +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":";;;;;AAgBA,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;;;;;AAMA,SAAgB,mBAAmB,OAA8C;CAC7E,MAAM,SAAS,SAAS,YAAY,KAAK;CACzC,IAAI,CAAC,OAAO,SACR,OAAO;CAEX,MAAM,SAAS,eAAe,OAAO,IAAI;CACzC,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/dist/values.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Reads a value at a dot path (`blocks.2.title.fr`). */
|
|
2
|
+
export declare function getValue(values: unknown, path: string): unknown;
|
|
3
|
+
/** Whether a value counts as filled: not null, not an empty or blank string, not an empty array or object. */
|
|
4
|
+
export declare function isFilled(value: unknown): boolean;
|
|
5
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
6
|
+
export declare function isEqual(a: unknown, b: unknown): boolean;
|
|
7
|
+
//# sourceMappingURL=values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAU/D;AAED,8GAA8G;AAC9G,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAchD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAQvD"}
|
package/dist/values.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/values.ts
|
|
2
|
+
/** Reads a value at a dot path (`blocks.2.title.fr`). */
|
|
3
|
+
function getValue(values, path) {
|
|
4
|
+
if (path === "") return values;
|
|
5
|
+
return path.split(".").reduce((current, key) => {
|
|
6
|
+
if (current === null || typeof current !== "object") return;
|
|
7
|
+
return current[key];
|
|
8
|
+
}, values);
|
|
9
|
+
}
|
|
10
|
+
/** Whether a value counts as filled: not null, not an empty or blank string, not an empty array or object. */
|
|
11
|
+
function isFilled(value) {
|
|
12
|
+
if (value === null || value === void 0) return false;
|
|
13
|
+
if (typeof value === "string") return value.trim() !== "";
|
|
14
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
15
|
+
if (typeof value === "object") return Object.keys(value).length > 0;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
function isRecord(value) {
|
|
19
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
20
|
+
}
|
|
21
|
+
function isEqual(a, b) {
|
|
22
|
+
if (a === b) return true;
|
|
23
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
|
|
24
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getValue, isEqual, isFilled, isRecord };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.js","names":[],"sources":["../src/values.ts"],"sourcesContent":["/** Reads a value at a dot path (`blocks.2.title.fr`). */\nexport function getValue(values: unknown, path: string): unknown {\n if (path === '') {\n return values;\n }\n return path.split('.').reduce<unknown>((current, key) => {\n if (current === null || typeof current !== 'object') {\n return undefined;\n }\n return (current as Record<string, unknown>)[key];\n }, values);\n}\n\n/** Whether a value counts as filled: not null, not an empty or blank string, not an empty array or object. */\nexport function isFilled(value: unknown): boolean {\n if (value === null || value === undefined) {\n return false;\n }\n if (typeof value === 'string') {\n return value.trim() !== '';\n }\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n if (typeof value === 'object') {\n return Object.keys(value).length > 0;\n }\n return true;\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nexport function isEqual(a: unknown, b: unknown): boolean {\n if (a === b) {\n return true;\n }\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {\n return false;\n }\n return JSON.stringify(a) === JSON.stringify(b);\n}\n"],"mappings":";;AACA,SAAgB,SAAS,QAAiB,MAAuB;CAC7D,IAAI,SAAS,IACT,OAAO;CAEX,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC,QAAiB,SAAS,QAAQ;EACrD,IAAI,YAAY,QAAQ,OAAO,YAAY,UACvC;EAEJ,OAAQ,QAAoC;CAChD,GAAG,MAAM;AACb;;AAGA,SAAgB,SAAS,OAAyB;CAC9C,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC5B,OAAO;CAEX,IAAI,OAAO,UAAU,UACjB,OAAO,MAAM,KAAK,MAAM;CAE5B,IAAI,MAAM,QAAQ,KAAK,GACnB,OAAO,MAAM,SAAS;CAE1B,IAAI,OAAO,UAAU,UACjB,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS;CAEvC,OAAO;AACX;AAEA,SAAgB,SAAS,OAAkD;CACvE,OAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC9E;AAEA,SAAgB,QAAQ,GAAY,GAAqB;CACrD,IAAI,MAAM,GACN,OAAO;CAEX,IAAI,OAAO,MAAM,YAAY,OAAO,MAAM,YAAY,MAAM,QAAQ,MAAM,MACtE,OAAO;CAEX,OAAO,KAAK,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC;AACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,qCAAqC;AACrC,eAAO,MAAM,oBAAoB,6BAA6B,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/version.ts
|
|
2
|
+
/** Version of the Panneau protocol described by this package. */
|
|
3
|
+
var PROTOCOL_VERSION = 1;
|
|
4
|
+
/** Media type of error responses. */
|
|
5
|
+
var PROBLEM_CONTENT_TYPE = "application/problem+json";
|
|
6
|
+
//#endregion
|
|
7
|
+
export { PROBLEM_CONTENT_TYPE, PROTOCOL_VERSION };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["/** Version of the Panneau protocol described by this package. */\nexport const PROTOCOL_VERSION = 1;\n\n/** Media type of error responses. */\nexport const PROBLEM_CONTENT_TYPE = 'application/problem+json';\n"],"mappings":";;AACA,IAAa,mBAAmB;;AAGhC,IAAa,uBAAuB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@panneau/protocol",
|
|
3
|
+
"version": "5.0.0-alpha.1",
|
|
4
|
+
"description": "The Panneau protocol: definition schema, HTTP API spec and conformance kit",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/folkloreinc/panneau-js.git",
|
|
10
|
+
"directory": "packages/protocol"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"@panneau/source": "./src/index.ts",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./runtime": {
|
|
20
|
+
"@panneau/source": "./src/runtime/index.ts",
|
|
21
|
+
"types": "./dist/runtime/index.d.ts",
|
|
22
|
+
"default": "./dist/runtime/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./mock": {
|
|
25
|
+
"@panneau/source": "./src/mock/index.ts",
|
|
26
|
+
"types": "./dist/mock/index.d.ts",
|
|
27
|
+
"default": "./dist/mock/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./conformance": {
|
|
30
|
+
"@panneau/source": "./src/conformance/index.ts",
|
|
31
|
+
"types": "./dist/conformance/index.d.ts",
|
|
32
|
+
"default": "./dist/conformance/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./definition.schema.json": "./schema/definition.schema.json",
|
|
35
|
+
"./openapi.json": "./schema/openapi.json",
|
|
36
|
+
"./boot.schema.json": "./schema/boot.schema.json",
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"schema"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "vite build && tsc -p tsconfig.build.json && node scripts/generate-schemas.js",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"api": "tsc -p tsconfig.build.json && node ../../scripts/api-report.js"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"zod": "^4.6.7"
|
|
53
|
+
}
|
|
54
|
+
}
|