@panneau/protocol 5.0.0-alpha.15 → 5.0.0-alpha.17

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 (63) hide show
  1. package/dist/addresses.d.ts +23 -0
  2. package/dist/addresses.d.ts.map +1 -0
  3. package/dist/addresses.js +52 -0
  4. package/dist/addresses.js.map +1 -0
  5. package/dist/conformance/index.d.ts.map +1 -1
  6. package/dist/conformance/index.js +109 -0
  7. package/dist/conformance/index.js.map +1 -1
  8. package/dist/constants.d.ts +23 -2
  9. package/dist/constants.d.ts.map +1 -1
  10. package/dist/constants.js +51 -3
  11. package/dist/constants.js.map +1 -1
  12. package/dist/currencies.d.ts +22 -0
  13. package/dist/currencies.d.ts.map +1 -0
  14. package/dist/currencies.js +231 -0
  15. package/dist/currencies.js.map +1 -0
  16. package/dist/index.js +7 -4
  17. package/dist/links.d.ts +38 -0
  18. package/dist/links.d.ts.map +1 -0
  19. package/dist/links.js +65 -0
  20. package/dist/links.js.map +1 -0
  21. package/dist/lint.js +6 -2
  22. package/dist/lint.js.map +1 -1
  23. package/dist/mock/index.d.ts.map +1 -1
  24. package/dist/mock/index.js +11 -2
  25. package/dist/mock/index.js.map +1 -1
  26. package/dist/query.d.ts +4 -0
  27. package/dist/query.d.ts.map +1 -1
  28. package/dist/query.js +23 -7
  29. package/dist/query.js.map +1 -1
  30. package/dist/rules.d.ts +4 -1
  31. package/dist/rules.d.ts.map +1 -1
  32. package/dist/rules.js +165 -7
  33. package/dist/rules.js.map +1 -1
  34. package/dist/runtime/index.d.ts +3 -0
  35. package/dist/runtime/index.d.ts.map +1 -1
  36. package/dist/runtime/index.js +5 -2
  37. package/dist/schemas/action.d.ts +46 -1
  38. package/dist/schemas/action.d.ts.map +1 -1
  39. package/dist/schemas/api.d.ts +43 -3
  40. package/dist/schemas/api.d.ts.map +1 -1
  41. package/dist/schemas/api.js +35 -1
  42. package/dist/schemas/api.js.map +1 -1
  43. package/dist/schemas/definition.d.ts +93 -3
  44. package/dist/schemas/definition.d.ts.map +1 -1
  45. package/dist/schemas/field.d.ts +193 -2
  46. package/dist/schemas/field.d.ts.map +1 -1
  47. package/dist/schemas/field.js +91 -7
  48. package/dist/schemas/field.js.map +1 -1
  49. package/dist/schemas/index.d.ts +445 -14
  50. package/dist/schemas/index.d.ts.map +1 -1
  51. package/dist/schemas/index.js +14 -4
  52. package/dist/schemas/index.js.map +1 -1
  53. package/dist/schemas/list.d.ts +2 -2
  54. package/dist/schemas/resource.d.ts +93 -3
  55. package/dist/schemas/resource.d.ts.map +1 -1
  56. package/dist/validate.d.ts +2 -1
  57. package/dist/validate.d.ts.map +1 -1
  58. package/dist/validate.js +18 -4
  59. package/dist/validate.js.map +1 -1
  60. package/package.json +1 -1
  61. package/schema/boot.schema.json +164 -2
  62. package/schema/definition.schema.json +164 -2
  63. package/schema/openapi.json +611 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAmBH,cAAc,EAmBjB,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,SAAS,EAA8B,MAAM,UAAU,CAAC;AAC5E,OAAO,EAQH,QAAQ,EAKX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAyC,MAAM,SAAS,CAAC;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AActC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AAEvB,wGAAwG;AACxG,eAAO,MAAM,YAA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;AAC1F,wBAAgB,oBAAoB;QACE,MAAM;4GAK3C"}
@@ -1,5 +1,5 @@
1
1
  import { Abilities, Condition, Id, Option, RouteReference } from "./common.js";
2
- import { BlockType, Field, RichTextSettings, RichTextStyle, Rule } from "./field.js";
2
+ import { AddressSettings, BlockType, DateRangeSettings, DurationSettings, Field, LinkSettings, LinkTypeSetting, MoneySettings, RichTextSettings, RichTextStyle, Rule } from "./field.js";
3
3
  import { actionJsonRules } from "./jsonRules.js";
4
4
  import { LayoutNode } from "./layout.js";
5
5
  import { Action, ActionConfirm, ActionPlacement, ActionScope } from "./action.js";
@@ -7,7 +7,7 @@ import { Column, Filter, ListCalendar, ListDefinition } from "./list.js";
7
7
  import { Resource, ResourceFeatures } from "./resource.js";
8
8
  import { DefinitionTheme, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues } from "./theme.js";
9
9
  import { Auth, AuthProvider, AuthToken, ContextOption, ContextParam, Definition, DefinitionContext, MenuItem, Page, Uploads, User, Widget } from "./definition.js";
10
- import { ActionItemResult, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ContextOptionsResponse, CursorPagination, EmbedResponse, EmbedValue, FieldCheckRequest, FieldCheckResponse, Item, ItemResponse, ListResponse, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, Pagination, Passkey, PreviewResponse, Problem, RecoveryCodes, SearchResponse, Selection, Session, StoredFile, TwoFactorChallenge, TwoFactorSetup, TwoFactorStatus, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse, WebAuthnOptions } from "./api.js";
10
+ import { ActionItemResult, ActionRequest, ActionResult, ActionRun, ActionRunResponse, AddressValue, ContextOptionsResponse, CursorPagination, DateRangeValue, EmbedResponse, EmbedValue, FieldCheckRequest, FieldCheckResponse, Item, ItemResponse, LinkValue, ListResponse, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, MoneyValue, Pagination, Passkey, PreviewResponse, Problem, RecoveryCodes, SearchResponse, Selection, Session, StoredFile, TwoFactorChallenge, TwoFactorSetup, TwoFactorStatus, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse, WebAuthnOptions } from "./api.js";
11
11
  import { BootConfig } from "./boot.js";
12
12
  import { z } from "zod";
13
13
  //#region src/schemas/index.ts
@@ -23,6 +23,12 @@ var namedSchemas = {
23
23
  Field,
24
24
  RichTextStyle,
25
25
  RichTextSettings,
26
+ LinkTypeSetting,
27
+ LinkSettings,
28
+ AddressSettings,
29
+ DateRangeSettings,
30
+ MoneySettings,
31
+ DurationSettings,
26
32
  LayoutNode,
27
33
  Column,
28
34
  Filter,
@@ -90,7 +96,11 @@ var namedSchemas = {
90
96
  PreviewResponse,
91
97
  EmbedValue,
92
98
  EmbedResponse,
93
- LocationValue
99
+ LocationValue,
100
+ AddressValue,
101
+ LinkValue,
102
+ DateRangeValue,
103
+ MoneyValue
94
104
  };
95
105
  /** A registry of the named schemas, used to reference them by name in generated files. */
96
106
  function createSchemaRegistry() {
@@ -103,6 +113,6 @@ function createSchemaRegistry() {
103
113
  return registry;
104
114
  }
105
115
  //#endregion
106
- export { Abilities, Action, ActionConfirm, ActionItemResult, ActionPlacement, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ActionScope, Auth, AuthProvider, AuthToken, BlockType, BootConfig, Column, Condition, ContextOption, ContextOptionsResponse, ContextParam, CursorPagination, Definition, DefinitionContext, DefinitionTheme, EmbedResponse, EmbedValue, Field, FieldCheckRequest, FieldCheckResponse, Filter, Id, Item, ItemResponse, LayoutNode, ListCalendar, ListDefinition, ListResponse, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, MenuItem, Option, Page, Pagination, Passkey, PreviewResponse, Problem, RecoveryCodes, Resource, ResourceFeatures, RichTextSettings, RichTextStyle, RouteReference, Rule, SearchResponse, Selection, Session, StoredFile, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues, TwoFactorChallenge, TwoFactorSetup, TwoFactorStatus, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse, Uploads, User, WebAuthnOptions, Widget, createSchemaRegistry, namedSchemas };
116
+ export { Abilities, Action, ActionConfirm, ActionItemResult, ActionPlacement, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ActionScope, AddressSettings, AddressValue, Auth, AuthProvider, AuthToken, BlockType, BootConfig, Column, Condition, ContextOption, ContextOptionsResponse, ContextParam, CursorPagination, DateRangeSettings, DateRangeValue, Definition, DefinitionContext, DefinitionTheme, DurationSettings, EmbedResponse, EmbedValue, Field, FieldCheckRequest, FieldCheckResponse, Filter, Id, Item, ItemResponse, LayoutNode, LinkSettings, LinkTypeSetting, LinkValue, ListCalendar, ListDefinition, ListResponse, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, MenuItem, MoneySettings, MoneyValue, Option, Page, Pagination, Passkey, PreviewResponse, Problem, RecoveryCodes, Resource, ResourceFeatures, RichTextSettings, RichTextStyle, RouteReference, Rule, SearchResponse, Selection, Session, StoredFile, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues, TwoFactorChallenge, TwoFactorSetup, TwoFactorStatus, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse, Uploads, User, WebAuthnOptions, Widget, createSchemaRegistry, namedSchemas };
107
117
 
108
118
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Action, ActionConfirm, ActionPlacement, ActionScope } from './action';\nimport {\n ActionItemResult,\n ActionRequest,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n ContextOptionsResponse,\n CursorPagination,\n EmbedResponse,\n EmbedValue,\n FieldCheckRequest,\n FieldCheckResponse,\n Item,\n ItemResponse,\n ListResponse,\n LocationValue,\n MediaInfo,\n MediaItem,\n MediaReference,\n MediaTransform,\n Pagination,\n Passkey,\n PreviewResponse,\n Problem,\n RecoveryCodes,\n SearchResponse,\n Selection,\n Session,\n StoredFile,\n TwoFactorChallenge,\n TwoFactorSetup,\n TwoFactorStatus,\n Upload,\n UploadReference,\n UploadResponse,\n UploadSignRequest,\n UploadSignResponse,\n WebAuthnOptions,\n} from './api';\nimport { Abilities, Condition, Id, Option, RouteReference } from './common';\nimport {\n Auth,\n AuthProvider,\n AuthToken,\n ContextOption,\n ContextParam,\n Definition,\n DefinitionContext,\n MenuItem,\n Page,\n Uploads,\n User,\n Widget,\n} from './definition';\nimport { BlockType, Field, RichTextSettings, RichTextStyle, Rule } from './field';\nimport { actionJsonRules } from './jsonRules';\nimport { LayoutNode } from './layout';\nimport { Column, Filter, ListCalendar, ListDefinition } from './list';\nimport { Resource, ResourceFeatures } from './resource';\nimport {\n DefinitionTheme,\n Theme,\n ThemeFont,\n ThemeFontFace,\n ThemeFontStylesheet,\n ThemeTokens,\n ToneInput,\n ToneValues,\n} from './theme';\n\nexport * from './common';\nexport * from './field';\nexport * from './layout';\nexport * from './list';\nexport * from './action';\nexport * from './resource';\nexport * from './theme';\nexport * from './definition';\nexport * from './api';\nexport * from './boot';\n\n/** The named schemas of the protocol, as they appear in the generated JSON Schema and OpenAPI files. */\nexport const namedSchemas = {\n Id,\n Abilities,\n RouteReference,\n Condition,\n Option,\n Rule,\n BlockType,\n Field,\n RichTextStyle,\n RichTextSettings,\n LayoutNode,\n Column,\n Filter,\n ListCalendar,\n ListDefinition,\n ActionScope,\n ActionPlacement,\n ActionConfirm,\n Action,\n ResourceFeatures,\n Resource,\n User,\n AuthProvider,\n AuthToken,\n Auth,\n MenuItem,\n Page,\n Widget,\n Uploads,\n ContextOption,\n ContextParam,\n DefinitionContext,\n ThemeTokens,\n ToneValues,\n ToneInput,\n ThemeFontFace,\n ThemeFontStylesheet,\n ThemeFont,\n Theme,\n DefinitionTheme,\n Definition,\n Item,\n Pagination,\n CursorPagination,\n ItemResponse,\n ListResponse,\n Problem,\n Selection,\n ActionRequest,\n ActionItemResult,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n MediaTransform,\n StoredFile,\n UploadReference,\n Upload,\n UploadResponse,\n UploadSignRequest,\n UploadSignResponse,\n FieldCheckRequest,\n FieldCheckResponse,\n MediaInfo,\n MediaItem,\n MediaReference,\n Session,\n TwoFactorChallenge,\n TwoFactorStatus,\n TwoFactorSetup,\n RecoveryCodes,\n WebAuthnOptions,\n Passkey,\n SearchResponse,\n ContextOptionsResponse,\n PreviewResponse,\n EmbedValue,\n EmbedResponse,\n LocationValue,\n} satisfies Record<string, z.ZodType>;\n\n/** A registry of the named schemas, used to reference them by name in generated files. */\nexport function createSchemaRegistry() {\n const registry = z.registry<{ id: string } & Record<string, unknown>>();\n Object.entries(namedSchemas).forEach(([id, schema]) => registry.add(schema, { id }));\n // Checks that Zod makes in code, which the JSON Schema of the definition must make too.\n registry.add(Action, { id: 'Action', ...actionJsonRules });\n return registry;\n}\n"],"mappings":";;;;;;;;;;;;;;AAqFA,IAAa,eAAe;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;AAGA,SAAgB,uBAAuB;CACnC,MAAM,WAAW,EAAE,SAAmD;CACtE,OAAO,QAAQ,YAAY,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,SAAS,IAAI,QAAQ,EAAE,GAAG,CAAC,CAAC;CAEnF,SAAS,IAAI,QAAQ;EAAE,IAAI;EAAU,GAAG;CAAgB,CAAC;CACzD,OAAO;AACX"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/schemas/index.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Action, ActionConfirm, ActionPlacement, ActionScope } from './action';\nimport {\n ActionItemResult,\n ActionRequest,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n AddressValue,\n ContextOptionsResponse,\n CursorPagination,\n DateRangeValue,\n EmbedResponse,\n EmbedValue,\n FieldCheckRequest,\n FieldCheckResponse,\n Item,\n ItemResponse,\n LinkValue,\n ListResponse,\n LocationValue,\n MediaInfo,\n MediaItem,\n MediaReference,\n MediaTransform,\n MoneyValue,\n Pagination,\n Passkey,\n PreviewResponse,\n Problem,\n RecoveryCodes,\n SearchResponse,\n Selection,\n Session,\n StoredFile,\n TwoFactorChallenge,\n TwoFactorSetup,\n TwoFactorStatus,\n Upload,\n UploadReference,\n UploadResponse,\n UploadSignRequest,\n UploadSignResponse,\n WebAuthnOptions,\n} from './api';\nimport { Abilities, Condition, Id, Option, RouteReference } from './common';\nimport {\n Auth,\n AuthProvider,\n AuthToken,\n ContextOption,\n ContextParam,\n Definition,\n DefinitionContext,\n MenuItem,\n Page,\n Uploads,\n User,\n Widget,\n} from './definition';\nimport {\n AddressSettings,\n BlockType,\n DateRangeSettings,\n DurationSettings,\n Field,\n LinkSettings,\n LinkTypeSetting,\n MoneySettings,\n RichTextSettings,\n RichTextStyle,\n Rule,\n} from './field';\nimport { actionJsonRules } from './jsonRules';\nimport { LayoutNode } from './layout';\nimport { Column, Filter, ListCalendar, ListDefinition } from './list';\nimport { Resource, ResourceFeatures } from './resource';\nimport {\n DefinitionTheme,\n Theme,\n ThemeFont,\n ThemeFontFace,\n ThemeFontStylesheet,\n ThemeTokens,\n ToneInput,\n ToneValues,\n} from './theme';\n\nexport * from './common';\nexport * from './field';\nexport * from './layout';\nexport * from './list';\nexport * from './action';\nexport * from './resource';\nexport * from './theme';\nexport * from './definition';\nexport * from './api';\nexport * from './boot';\n\n/** The named schemas of the protocol, as they appear in the generated JSON Schema and OpenAPI files. */\nexport const namedSchemas = {\n Id,\n Abilities,\n RouteReference,\n Condition,\n Option,\n Rule,\n BlockType,\n Field,\n RichTextStyle,\n RichTextSettings,\n LinkTypeSetting,\n LinkSettings,\n AddressSettings,\n DateRangeSettings,\n MoneySettings,\n DurationSettings,\n LayoutNode,\n Column,\n Filter,\n ListCalendar,\n ListDefinition,\n ActionScope,\n ActionPlacement,\n ActionConfirm,\n Action,\n ResourceFeatures,\n Resource,\n User,\n AuthProvider,\n AuthToken,\n Auth,\n MenuItem,\n Page,\n Widget,\n Uploads,\n ContextOption,\n ContextParam,\n DefinitionContext,\n ThemeTokens,\n ToneValues,\n ToneInput,\n ThemeFontFace,\n ThemeFontStylesheet,\n ThemeFont,\n Theme,\n DefinitionTheme,\n Definition,\n Item,\n Pagination,\n CursorPagination,\n ItemResponse,\n ListResponse,\n Problem,\n Selection,\n ActionRequest,\n ActionItemResult,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n MediaTransform,\n StoredFile,\n UploadReference,\n Upload,\n UploadResponse,\n UploadSignRequest,\n UploadSignResponse,\n FieldCheckRequest,\n FieldCheckResponse,\n MediaInfo,\n MediaItem,\n MediaReference,\n Session,\n TwoFactorChallenge,\n TwoFactorStatus,\n TwoFactorSetup,\n RecoveryCodes,\n WebAuthnOptions,\n Passkey,\n SearchResponse,\n ContextOptionsResponse,\n PreviewResponse,\n EmbedValue,\n EmbedResponse,\n LocationValue,\n AddressValue,\n LinkValue,\n DateRangeValue,\n MoneyValue,\n} satisfies Record<string, z.ZodType>;\n\n/** A registry of the named schemas, used to reference them by name in generated files. */\nexport function createSchemaRegistry() {\n const registry = z.registry<{ id: string } & Record<string, unknown>>();\n Object.entries(namedSchemas).forEach(([id, schema]) => registry.add(schema, { id }));\n // Checks that Zod makes in code, which the JSON Schema of the definition must make too.\n registry.add(Action, { id: 'Action', ...actionJsonRules });\n return registry;\n}\n"],"mappings":";;;;;;;;;;;;;;AAqGA,IAAa,eAAe;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;AAGA,SAAgB,uBAAuB;CACnC,MAAM,WAAW,EAAE,SAAmD;CACtE,OAAO,QAAQ,YAAY,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,SAAS,IAAI,QAAQ,EAAE,GAAG,CAAC,CAAC;CAEnF,SAAS,IAAI,QAAQ;EAAE,IAAI;EAAU,GAAG;CAAgB,CAAC;CACzD,OAAO;AACX"}
@@ -8,8 +8,8 @@ export declare const Column: z.ZodObject<{
8
8
  width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
9
9
  align: z.ZodOptional<z.ZodEnum<{
10
10
  start: "start";
11
- center: "center";
12
11
  end: "end";
12
+ center: "center";
13
13
  }>>;
14
14
  hidden: z.ZodOptional<z.ZodBoolean>;
15
15
  hideable: z.ZodOptional<z.ZodBoolean>;
@@ -44,8 +44,8 @@ export declare const ListDefinition: z.ZodObject<{
44
44
  width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
45
45
  align: z.ZodOptional<z.ZodEnum<{
46
46
  start: "start";
47
- center: "center";
48
47
  end: "end";
48
+ center: "center";
49
49
  }>>;
50
50
  hidden: z.ZodOptional<z.ZodBoolean>;
51
51
  hideable: z.ZodOptional<z.ZodBoolean>;
@@ -73,7 +73,6 @@ export declare const Resource: z.ZodObject<{
73
73
  rule: z.ZodEnum<{
74
74
  email: "email";
75
75
  url: "url";
76
- tel: "tel";
77
76
  json: "json";
78
77
  }>;
79
78
  message: z.ZodOptional<z.ZodString>;
@@ -81,6 +80,34 @@ export declare const Resource: z.ZodObject<{
81
80
  update: "update";
82
81
  create: "create";
83
82
  }>>;
83
+ }, z.core.$loose>, z.ZodObject<{
84
+ rule: z.ZodLiteral<"tel">;
85
+ extension: z.ZodOptional<z.ZodBoolean>;
86
+ message: z.ZodOptional<z.ZodString>;
87
+ mode: z.ZodOptional<z.ZodEnum<{
88
+ update: "update";
89
+ create: "create";
90
+ }>>;
91
+ }, z.core.$loose>, z.ZodObject<{
92
+ rule: z.ZodLiteral<"daterange">;
93
+ open: z.ZodOptional<z.ZodEnum<{
94
+ start: "start";
95
+ end: "end";
96
+ both: "both";
97
+ }>>;
98
+ message: z.ZodOptional<z.ZodString>;
99
+ mode: z.ZodOptional<z.ZodEnum<{
100
+ update: "update";
101
+ create: "create";
102
+ }>>;
103
+ }, z.core.$loose>, z.ZodObject<{
104
+ rule: z.ZodLiteral<"money">;
105
+ currencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
106
+ message: z.ZodOptional<z.ZodString>;
107
+ mode: z.ZodOptional<z.ZodEnum<{
108
+ update: "update";
109
+ create: "create";
110
+ }>>;
84
111
  }, z.core.$loose>, z.ZodObject<{
85
112
  rule: z.ZodLiteral<"in">;
86
113
  value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
@@ -118,6 +145,16 @@ export declare const Resource: z.ZodObject<{
118
145
  update: "update";
119
146
  create: "create";
120
147
  }>>;
148
+ }, z.core.$loose>, z.ZodObject<{
149
+ rule: z.ZodLiteral<"postalCode">;
150
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
151
+ field: z.ZodString;
152
+ }, z.core.$loose>]>>;
153
+ message: z.ZodOptional<z.ZodString>;
154
+ mode: z.ZodOptional<z.ZodEnum<{
155
+ update: "update";
156
+ create: "create";
157
+ }>>;
121
158
  }, z.core.$loose>, z.ZodObject<{
122
159
  rule: z.ZodLiteral<"crop">;
123
160
  value: z.ZodObject<{
@@ -129,6 +166,14 @@ export declare const Resource: z.ZodObject<{
129
166
  update: "update";
130
167
  create: "create";
131
168
  }>>;
169
+ }, z.core.$loose>, z.ZodObject<{
170
+ rule: z.ZodLiteral<"providers">;
171
+ value: z.ZodArray<z.ZodString>;
172
+ message: z.ZodOptional<z.ZodString>;
173
+ mode: z.ZodOptional<z.ZodEnum<{
174
+ update: "update";
175
+ create: "create";
176
+ }>>;
132
177
  }, z.core.$loose>, z.ZodObject<{
133
178
  rule: z.ZodString;
134
179
  message: z.ZodOptional<z.ZodString>;
@@ -205,8 +250,8 @@ export declare const Resource: z.ZodObject<{
205
250
  width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
206
251
  align: z.ZodOptional<z.ZodEnum<{
207
252
  start: "start";
208
- center: "center";
209
253
  end: "end";
254
+ center: "center";
210
255
  }>>;
211
256
  hidden: z.ZodOptional<z.ZodBoolean>;
212
257
  hideable: z.ZodOptional<z.ZodBoolean>;
@@ -314,7 +359,6 @@ export declare const Resource: z.ZodObject<{
314
359
  rule: z.ZodEnum<{
315
360
  email: "email";
316
361
  url: "url";
317
- tel: "tel";
318
362
  json: "json";
319
363
  }>;
320
364
  message: z.ZodOptional<z.ZodString>;
@@ -322,6 +366,34 @@ export declare const Resource: z.ZodObject<{
322
366
  update: "update";
323
367
  create: "create";
324
368
  }>>;
369
+ }, z.core.$loose>, z.ZodObject<{
370
+ rule: z.ZodLiteral<"tel">;
371
+ extension: z.ZodOptional<z.ZodBoolean>;
372
+ message: z.ZodOptional<z.ZodString>;
373
+ mode: z.ZodOptional<z.ZodEnum<{
374
+ update: "update";
375
+ create: "create";
376
+ }>>;
377
+ }, z.core.$loose>, z.ZodObject<{
378
+ rule: z.ZodLiteral<"daterange">;
379
+ open: z.ZodOptional<z.ZodEnum<{
380
+ start: "start";
381
+ end: "end";
382
+ both: "both";
383
+ }>>;
384
+ message: z.ZodOptional<z.ZodString>;
385
+ mode: z.ZodOptional<z.ZodEnum<{
386
+ update: "update";
387
+ create: "create";
388
+ }>>;
389
+ }, z.core.$loose>, z.ZodObject<{
390
+ rule: z.ZodLiteral<"money">;
391
+ currencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
392
+ message: z.ZodOptional<z.ZodString>;
393
+ mode: z.ZodOptional<z.ZodEnum<{
394
+ update: "update";
395
+ create: "create";
396
+ }>>;
325
397
  }, z.core.$loose>, z.ZodObject<{
326
398
  rule: z.ZodLiteral<"in">;
327
399
  value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
@@ -359,6 +431,16 @@ export declare const Resource: z.ZodObject<{
359
431
  update: "update";
360
432
  create: "create";
361
433
  }>>;
434
+ }, z.core.$loose>, z.ZodObject<{
435
+ rule: z.ZodLiteral<"postalCode">;
436
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
437
+ field: z.ZodString;
438
+ }, z.core.$loose>]>>;
439
+ message: z.ZodOptional<z.ZodString>;
440
+ mode: z.ZodOptional<z.ZodEnum<{
441
+ update: "update";
442
+ create: "create";
443
+ }>>;
362
444
  }, z.core.$loose>, z.ZodObject<{
363
445
  rule: z.ZodLiteral<"crop">;
364
446
  value: z.ZodObject<{
@@ -370,6 +452,14 @@ export declare const Resource: z.ZodObject<{
370
452
  update: "update";
371
453
  create: "create";
372
454
  }>>;
455
+ }, z.core.$loose>, z.ZodObject<{
456
+ rule: z.ZodLiteral<"providers">;
457
+ value: z.ZodArray<z.ZodString>;
458
+ message: z.ZodOptional<z.ZodString>;
459
+ mode: z.ZodOptional<z.ZodEnum<{
460
+ update: "update";
461
+ create: "create";
462
+ }>>;
373
463
  }, z.core.$loose>, z.ZodObject<{
374
464
  rule: z.ZodString;
375
465
  message: z.ZodOptional<z.ZodString>;
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6C6C,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,sEAAsE;AACtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/schemas/resource.ts"],"names":[],"mappings":"AA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Validates a definition, as returned by `GET /definition`: against the schema, then the
20
20
  * references between its parts (see `lintDefinition()`), and the settings of field types that
21
- * the protocol describes (`RichTextSettings`).
21
+ * the protocol describes (`RichTextSettings`, `DurationSettings`, `DateRangeSettings`,
22
+ * `MoneySettings`, `LinkSettings`, `AddressSettings`).
22
23
  */
23
24
  export declare function validateDefinition(input: unknown): ValidationResult<Definition>;
24
25
  /**
@@ -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;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"}
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;AAWlD,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;AAqCD;;;;;GAKG;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,5 +1,5 @@
1
1
  import { lintDefinition } from "./lint.js";
2
- import { RichTextSettings } from "./schemas/field.js";
2
+ import { AddressSettings, DateRangeSettings, DurationSettings, LinkSettings, MoneySettings, RichTextSettings } from "./schemas/field.js";
3
3
  import { Definition } from "./schemas/definition.js";
4
4
  import { BootConfig } from "./schemas/boot.js";
5
5
  //#region src/validate.ts
@@ -18,12 +18,25 @@ function validate(schema, input) {
18
18
  }))
19
19
  };
20
20
  }
21
- /** Checks the settings of the `richtext` fields of a list of fields, nested ones included. */
21
+ /** The schemas of the settings of the types that the protocol describes. */
22
+ var SETTINGS = {
23
+ richtext: RichTextSettings,
24
+ duration: DurationSettings,
25
+ daterange: DateRangeSettings,
26
+ money: MoneySettings,
27
+ link: LinkSettings,
28
+ address: AddressSettings
29
+ };
30
+ /**
31
+ * Checks the settings of the fields whose type the protocol describes the settings of (`richtext`,
32
+ * `duration`, `daterange`, `money`, `link`, `address`), nested ones included.
33
+ */
22
34
  function checkFieldSettings(fields, path) {
23
35
  return fields.flatMap((field, index) => {
24
36
  const fieldPath = `${path}.${String(index)}`;
37
+ const schema = SETTINGS[field.type];
25
38
  return [
26
- ...field.type === "richtext" && field.settings !== void 0 ? (RichTextSettings.safeParse(field.settings).error?.issues ?? []).map((issue) => ({
39
+ ...schema !== void 0 && field.settings !== void 0 ? (schema.safeParse(field.settings).error?.issues ?? []).map((issue) => ({
27
40
  path: [`${fieldPath}.settings`, ...issue.path.map(String)].join("."),
28
41
  message: issue.message
29
42
  })) : [],
@@ -35,7 +48,8 @@ function checkFieldSettings(fields, path) {
35
48
  /**
36
49
  * Validates a definition, as returned by `GET /definition`: against the schema, then the
37
50
  * references between its parts (see `lintDefinition()`), and the settings of field types that
38
- * the protocol describes (`RichTextSettings`).
51
+ * the protocol describes (`RichTextSettings`, `DurationSettings`, `DateRangeSettings`,
52
+ * `MoneySettings`, `LinkSettings`, `AddressSettings`).
39
53
  */
40
54
  function validateDefinition(input) {
41
55
  const result = validate(Definition, input);
@@ -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';\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"}
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 {\n AddressSettings,\n DateRangeSettings,\n DurationSettings,\n type Field,\n LinkSettings,\n MoneySettings,\n RichTextSettings,\n} 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/** The schemas of the settings of the types that the protocol describes. */\nconst SETTINGS: Readonly<Record<string, z.ZodType>> = {\n richtext: RichTextSettings,\n duration: DurationSettings,\n daterange: DateRangeSettings,\n money: MoneySettings,\n link: LinkSettings,\n address: AddressSettings,\n};\n\n/**\n * Checks the settings of the fields whose type the protocol describes the settings of (`richtext`,\n * `duration`, `daterange`, `money`, `link`, `address`), nested ones included.\n */\nfunction checkFieldSettings(fields: readonly Field[], path: string): ValidationIssue[] {\n return fields.flatMap((field, index) => {\n const fieldPath = `${path}.${String(index)}`;\n const schema = SETTINGS[field.type];\n const own =\n schema !== undefined && field.settings !== undefined\n ? (schema.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`, `DurationSettings`, `DateRangeSettings`,\n * `MoneySettings`, `LinkSettings`, `AddressSettings`).\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":";;;;;;AAyBA,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,IAAM,WAAgD;CAClD,UAAU;CACV,UAAU;CACV,WAAW;CACX,OAAO;CACP,MAAM;CACN,SAAS;AACb;;;;;AAMA,SAAS,mBAAmB,QAA0B,MAAiC;CACnF,OAAO,OAAO,SAAS,OAAO,UAAU;EACpC,MAAM,YAAY,GAAG,KAAK,GAAG,OAAO,KAAK;EACzC,MAAM,SAAS,SAAS,MAAM;EAQ9B,OAAO;GACH,GAPA,WAAW,KAAA,KAAa,MAAM,aAAa,KAAA,KACpC,OAAO,UAAU,MAAM,QAAQ,CAAC,CA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,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.15",
3
+ "version": "5.0.0-alpha.17",
4
4
  "description": "The Panneau protocol: definition schema, HTTP API spec and conformance kit",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -522,8 +522,7 @@
522
522
  "enum": [
523
523
  "email",
524
524
  "url",
525
- "json",
526
- "tel"
525
+ "json"
527
526
  ]
528
527
  },
529
528
  "message": {
@@ -542,6 +541,93 @@
542
541
  ],
543
542
  "additionalProperties": {}
544
543
  },
544
+ {
545
+ "type": "object",
546
+ "properties": {
547
+ "rule": {
548
+ "type": "string",
549
+ "const": "tel"
550
+ },
551
+ "extension": {
552
+ "type": "boolean"
553
+ },
554
+ "message": {
555
+ "type": "string"
556
+ },
557
+ "mode": {
558
+ "type": "string",
559
+ "enum": [
560
+ "create",
561
+ "update"
562
+ ]
563
+ }
564
+ },
565
+ "required": [
566
+ "rule"
567
+ ],
568
+ "additionalProperties": {}
569
+ },
570
+ {
571
+ "type": "object",
572
+ "properties": {
573
+ "rule": {
574
+ "type": "string",
575
+ "const": "daterange"
576
+ },
577
+ "open": {
578
+ "type": "string",
579
+ "enum": [
580
+ "start",
581
+ "end",
582
+ "both"
583
+ ]
584
+ },
585
+ "message": {
586
+ "type": "string"
587
+ },
588
+ "mode": {
589
+ "type": "string",
590
+ "enum": [
591
+ "create",
592
+ "update"
593
+ ]
594
+ }
595
+ },
596
+ "required": [
597
+ "rule"
598
+ ],
599
+ "additionalProperties": {}
600
+ },
601
+ {
602
+ "type": "object",
603
+ "properties": {
604
+ "rule": {
605
+ "type": "string",
606
+ "const": "money"
607
+ },
608
+ "currencies": {
609
+ "type": "array",
610
+ "items": {
611
+ "type": "string",
612
+ "pattern": "^[A-Z]{3}$"
613
+ }
614
+ },
615
+ "message": {
616
+ "type": "string"
617
+ },
618
+ "mode": {
619
+ "type": "string",
620
+ "enum": [
621
+ "create",
622
+ "update"
623
+ ]
624
+ }
625
+ },
626
+ "required": [
627
+ "rule"
628
+ ],
629
+ "additionalProperties": {}
630
+ },
545
631
  {
546
632
  "type": "object",
547
633
  "properties": {
@@ -683,6 +769,50 @@
683
769
  ],
684
770
  "additionalProperties": {}
685
771
  },
772
+ {
773
+ "type": "object",
774
+ "properties": {
775
+ "rule": {
776
+ "type": "string",
777
+ "const": "postalCode"
778
+ },
779
+ "value": {
780
+ "anyOf": [
781
+ {
782
+ "type": "string",
783
+ "pattern": "^[A-Z]{2}$"
784
+ },
785
+ {
786
+ "type": "object",
787
+ "properties": {
788
+ "field": {
789
+ "type": "string",
790
+ "minLength": 1
791
+ }
792
+ },
793
+ "required": [
794
+ "field"
795
+ ],
796
+ "additionalProperties": {}
797
+ }
798
+ ]
799
+ },
800
+ "message": {
801
+ "type": "string"
802
+ },
803
+ "mode": {
804
+ "type": "string",
805
+ "enum": [
806
+ "create",
807
+ "update"
808
+ ]
809
+ }
810
+ },
811
+ "required": [
812
+ "rule"
813
+ ],
814
+ "additionalProperties": {}
815
+ },
686
816
  {
687
817
  "type": "object",
688
818
  "properties": {
@@ -723,6 +853,38 @@
723
853
  ],
724
854
  "additionalProperties": {}
725
855
  },
856
+ {
857
+ "type": "object",
858
+ "properties": {
859
+ "rule": {
860
+ "type": "string",
861
+ "const": "providers"
862
+ },
863
+ "value": {
864
+ "minItems": 1,
865
+ "type": "array",
866
+ "items": {
867
+ "type": "string",
868
+ "minLength": 1
869
+ }
870
+ },
871
+ "message": {
872
+ "type": "string"
873
+ },
874
+ "mode": {
875
+ "type": "string",
876
+ "enum": [
877
+ "create",
878
+ "update"
879
+ ]
880
+ }
881
+ },
882
+ "required": [
883
+ "rule",
884
+ "value"
885
+ ],
886
+ "additionalProperties": {}
887
+ },
726
888
  {
727
889
  "type": "object",
728
890
  "properties": {