@panneau/protocol 5.0.0-alpha.1 → 5.0.0-alpha.11

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 (114) hide show
  1. package/README.md +10 -9
  2. package/dist/conditions.d.ts +1 -1
  3. package/dist/conformance/index.d.ts.map +1 -1
  4. package/dist/conformance/index.js +288 -9
  5. package/dist/conformance/index.js.map +1 -1
  6. package/dist/constants.d.ts +25 -2
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/constants.js +58 -3
  9. package/dist/constants.js.map +1 -1
  10. package/dist/index.d.ts +4 -4
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +12 -7
  13. package/dist/libraries.d.ts +16 -0
  14. package/dist/libraries.d.ts.map +1 -0
  15. package/dist/libraries.js +15 -0
  16. package/dist/libraries.js.map +1 -0
  17. package/dist/lint.d.ts +4 -3
  18. package/dist/lint.d.ts.map +1 -1
  19. package/dist/lint.js +34 -2
  20. package/dist/lint.js.map +1 -1
  21. package/dist/mock/example.d.ts +3 -2
  22. package/dist/mock/example.d.ts.map +1 -1
  23. package/dist/mock/example.js +223 -142
  24. package/dist/mock/example.js.map +1 -1
  25. package/dist/mock/index.d.ts +19 -5
  26. package/dist/mock/index.d.ts.map +1 -1
  27. package/dist/mock/index.js +378 -18
  28. package/dist/mock/index.js.map +1 -1
  29. package/dist/openapi.d.ts +2 -0
  30. package/dist/openapi.d.ts.map +1 -1
  31. package/dist/openapi.js +112 -108
  32. package/dist/openapi.js.map +1 -1
  33. package/dist/problem.d.ts +1 -1
  34. package/dist/query.d.ts +14 -0
  35. package/dist/query.d.ts.map +1 -1
  36. package/dist/query.js +11 -1
  37. package/dist/query.js.map +1 -1
  38. package/dist/rules.d.ts +6 -3
  39. package/dist/rules.d.ts.map +1 -1
  40. package/dist/rules.js +50 -8
  41. package/dist/rules.js.map +1 -1
  42. package/dist/runtime/index.d.ts +13 -9
  43. package/dist/runtime/index.d.ts.map +1 -1
  44. package/dist/runtime/index.js +7 -3
  45. package/dist/schemas/action.d.ts +69 -10
  46. package/dist/schemas/action.d.ts.map +1 -1
  47. package/dist/schemas/action.js +20 -3
  48. package/dist/schemas/action.js.map +1 -1
  49. package/dist/schemas/api.d.ts +224 -39
  50. package/dist/schemas/api.d.ts.map +1 -1
  51. package/dist/schemas/api.js +124 -30
  52. package/dist/schemas/api.js.map +1 -1
  53. package/dist/schemas/boot.d.ts +24 -1
  54. package/dist/schemas/boot.d.ts.map +1 -1
  55. package/dist/schemas/boot.js +2 -1
  56. package/dist/schemas/boot.js.map +1 -1
  57. package/dist/schemas/common.d.ts +1 -0
  58. package/dist/schemas/common.d.ts.map +1 -1
  59. package/dist/schemas/common.js +2 -1
  60. package/dist/schemas/common.js.map +1 -1
  61. package/dist/schemas/definition.d.ts +222 -20
  62. package/dist/schemas/definition.d.ts.map +1 -1
  63. package/dist/schemas/definition.js +16 -11
  64. package/dist/schemas/definition.js.map +1 -1
  65. package/dist/schemas/field.d.ts +162 -2
  66. package/dist/schemas/field.d.ts.map +1 -1
  67. package/dist/schemas/field.js +69 -16
  68. package/dist/schemas/field.js.map +1 -1
  69. package/dist/schemas/index.d.ts +955 -63
  70. package/dist/schemas/index.d.ts.map +1 -1
  71. package/dist/schemas/index.js +37 -8
  72. package/dist/schemas/index.js.map +1 -1
  73. package/dist/schemas/jsonRules.d.ts +83 -0
  74. package/dist/schemas/jsonRules.d.ts.map +1 -0
  75. package/dist/schemas/jsonRules.js +46 -0
  76. package/dist/schemas/jsonRules.js.map +1 -0
  77. package/dist/schemas/layout.d.ts +1 -1
  78. package/dist/schemas/list.d.ts +6 -0
  79. package/dist/schemas/list.d.ts.map +1 -1
  80. package/dist/schemas/list.js +1 -0
  81. package/dist/schemas/list.js.map +1 -1
  82. package/dist/schemas/resource.d.ts +144 -14
  83. package/dist/schemas/resource.d.ts.map +1 -1
  84. package/dist/schemas/resource.js +6 -1
  85. package/dist/schemas/resource.js.map +1 -1
  86. package/dist/schemas/theme.d.ts +179 -0
  87. package/dist/schemas/theme.d.ts.map +1 -0
  88. package/dist/schemas/theme.js +66 -0
  89. package/dist/schemas/theme.js.map +1 -0
  90. package/dist/search.d.ts +51 -0
  91. package/dist/search.d.ts.map +1 -0
  92. package/dist/search.js +53 -0
  93. package/dist/search.js.map +1 -0
  94. package/dist/themes.d.ts +11 -0
  95. package/dist/themes.d.ts.map +1 -0
  96. package/dist/themes.js +80 -0
  97. package/dist/themes.js.map +1 -0
  98. package/dist/transforms.d.ts +17 -0
  99. package/dist/transforms.d.ts.map +1 -0
  100. package/dist/transforms.js +34 -0
  101. package/dist/transforms.js.map +1 -0
  102. package/dist/validate.d.ts +4 -3
  103. package/dist/validate.d.ts.map +1 -1
  104. package/dist/validate.js +22 -2
  105. package/dist/validate.js.map +1 -1
  106. package/dist/values.d.ts +5 -1
  107. package/dist/values.d.ts.map +1 -1
  108. package/dist/values.js +16 -2
  109. package/dist/values.js.map +1 -1
  110. package/package.json +7 -3
  111. package/schema/boot.schema.json +580 -16
  112. package/schema/definition.schema.json +577 -16
  113. package/schema/openapi.json +1815 -541
  114. package/schema/theme.schema.json +234 -0
@@ -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;AAuBxB,OAAO,EAAa,SAAS,EAA8B,MAAM,UAAU,CAAC;AAC5E,OAAO,EAIH,QAAQ,EAKX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAQ,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,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,cAAc,CAAC;AA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEY,CAAC;AAEtC,0FAA0F;AAC1F,wBAAgB,oBAAoB;QACE,MAAM;4GAK3C"}
@@ -1,11 +1,13 @@
1
1
  import { Abilities, Condition, Id, Option, RouteReference } from "./common.js";
2
- import { BlockType, Field, Rule } from "./field.js";
2
+ import { BlockType, Field, RichTextSettings, RichTextStyle, Rule } from "./field.js";
3
+ import { actionJsonRules } from "./jsonRules.js";
3
4
  import { LayoutNode } from "./layout.js";
4
5
  import { Action, ActionConfirm, ActionPlacement, ActionScope } from "./action.js";
5
6
  import { Column, Filter, ListDefinition } from "./list.js";
6
7
  import { Resource, ResourceFeatures } from "./resource.js";
7
- import { Auth, AuthProvider, Definition, MenuItem, Page, Uploads, User, Widget } from "./definition.js";
8
- import { ActionItemResult, ActionRequest, ActionResult, ActionRun, ActionRunResponse, Item, ItemResponse, ListResponse, Media, MediaListResponse, MediaResponse, MediaTransform, Pagination, PreviewResponse, Problem, SearchResponse, Selection, Session } from "./api.js";
8
+ import { DefinitionTheme, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues } from "./theme.js";
9
+ import { Auth, AuthProvider, AuthToken, Definition, MenuItem, Page, Uploads, User, Widget } from "./definition.js";
10
+ import { ActionItemResult, ActionRequest, ActionResult, ActionRun, ActionRunResponse, CursorPagination, EmbedResponse, EmbedValue, FieldCheckRequest, FieldCheckResponse, Item, ItemResponse, ListResponse, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, Pagination, PreviewResponse, Problem, SearchResponse, Selection, Session, StoredFile, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse } from "./api.js";
9
11
  import { BootConfig } from "./boot.js";
10
12
  import { z } from "zod";
11
13
  //#region src/schemas/index.ts
@@ -19,6 +21,8 @@ var namedSchemas = {
19
21
  Rule,
20
22
  BlockType,
21
23
  Field,
24
+ RichTextStyle,
25
+ RichTextSettings,
22
26
  LayoutNode,
23
27
  Column,
24
28
  Filter,
@@ -31,14 +35,24 @@ var namedSchemas = {
31
35
  Resource,
32
36
  User,
33
37
  AuthProvider,
38
+ AuthToken,
34
39
  Auth,
35
40
  MenuItem,
36
41
  Page,
37
42
  Widget,
38
43
  Uploads,
44
+ ThemeTokens,
45
+ ToneValues,
46
+ ToneInput,
47
+ ThemeFontFace,
48
+ ThemeFontStylesheet,
49
+ ThemeFont,
50
+ Theme,
51
+ DefinitionTheme,
39
52
  Definition,
40
53
  Item,
41
54
  Pagination,
55
+ CursorPagination,
42
56
  ItemResponse,
43
57
  ListResponse,
44
58
  Problem,
@@ -49,20 +63,35 @@ var namedSchemas = {
49
63
  ActionRun,
50
64
  ActionRunResponse,
51
65
  MediaTransform,
52
- Media,
53
- MediaResponse,
54
- MediaListResponse,
66
+ StoredFile,
67
+ UploadReference,
68
+ Upload,
69
+ UploadResponse,
70
+ UploadSignRequest,
71
+ UploadSignResponse,
72
+ FieldCheckRequest,
73
+ FieldCheckResponse,
74
+ MediaInfo,
75
+ MediaItem,
76
+ MediaReference,
55
77
  Session,
56
78
  SearchResponse,
57
- PreviewResponse
79
+ PreviewResponse,
80
+ EmbedValue,
81
+ EmbedResponse,
82
+ LocationValue
58
83
  };
59
84
  /** A registry of the named schemas, used to reference them by name in generated files. */
60
85
  function createSchemaRegistry() {
61
86
  const registry = z.registry();
62
87
  Object.entries(namedSchemas).forEach(([id, schema]) => registry.add(schema, { id }));
88
+ registry.add(Action, {
89
+ id: "Action",
90
+ ...actionJsonRules
91
+ });
63
92
  return registry;
64
93
  }
65
94
  //#endregion
66
- export { Abilities, Action, ActionConfirm, ActionItemResult, ActionPlacement, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ActionScope, Auth, AuthProvider, BlockType, BootConfig, Column, Condition, Definition, Field, Filter, Id, Item, ItemResponse, LayoutNode, ListDefinition, ListResponse, Media, MediaListResponse, MediaResponse, MediaTransform, MenuItem, Option, Page, Pagination, PreviewResponse, Problem, Resource, ResourceFeatures, RouteReference, Rule, SearchResponse, Selection, Session, Uploads, User, Widget, createSchemaRegistry, namedSchemas };
95
+ export { Abilities, Action, ActionConfirm, ActionItemResult, ActionPlacement, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ActionScope, Auth, AuthProvider, AuthToken, BlockType, BootConfig, Column, Condition, CursorPagination, Definition, DefinitionTheme, EmbedResponse, EmbedValue, Field, FieldCheckRequest, FieldCheckResponse, Filter, Id, Item, ItemResponse, LayoutNode, ListDefinition, ListResponse, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, MenuItem, Option, Page, Pagination, PreviewResponse, Problem, Resource, ResourceFeatures, RichTextSettings, RichTextStyle, RouteReference, Rule, SearchResponse, Selection, Session, StoredFile, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse, Uploads, User, Widget, createSchemaRegistry, namedSchemas };
67
96
 
68
97
  //# 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 Item,\n ItemResponse,\n ListResponse,\n Media,\n MediaListResponse,\n MediaResponse,\n MediaTransform,\n Pagination,\n PreviewResponse,\n Problem,\n SearchResponse,\n Selection,\n Session,\n} from './api';\nimport { Abilities, Condition, Id, Option, RouteReference } from './common';\nimport {\n Auth,\n AuthProvider,\n Definition,\n MenuItem,\n Page,\n Uploads,\n User,\n Widget,\n} from './definition';\nimport { BlockType, Field, Rule } from './field';\nimport { LayoutNode } from './layout';\nimport { Column, Filter, ListDefinition } from './list';\nimport { Resource, ResourceFeatures } from './resource';\n\nexport * from './common';\nexport * from './field';\nexport * from './layout';\nexport * from './list';\nexport * from './action';\nexport * from './resource';\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 LayoutNode,\n Column,\n Filter,\n ListDefinition,\n ActionScope,\n ActionPlacement,\n ActionConfirm,\n Action,\n ResourceFeatures,\n Resource,\n User,\n AuthProvider,\n Auth,\n MenuItem,\n Page,\n Widget,\n Uploads,\n Definition,\n Item,\n Pagination,\n ItemResponse,\n ListResponse,\n Problem,\n Selection,\n ActionRequest,\n ActionItemResult,\n ActionResult,\n ActionRun,\n ActionRunResponse,\n MediaTransform,\n Media,\n MediaResponse,\n MediaListResponse,\n Session,\n SearchResponse,\n PreviewResponse,\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 }>();\n Object.entries(namedSchemas).forEach(([id, schema]) => registry.add(schema, { id }));\n return registry;\n}\n"],"mappings":";;;;;;;;;;;;AAkDA,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;AACJ;;AAGA,SAAgB,uBAAuB;CACnC,MAAM,WAAW,EAAE,SAAyB;CAC5C,OAAO,QAAQ,YAAY,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,SAAS,IAAI,QAAQ,EAAE,GAAG,CAAC,CAAC;CACnF,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 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 PreviewResponse,\n Problem,\n SearchResponse,\n Selection,\n Session,\n StoredFile,\n Upload,\n UploadReference,\n UploadResponse,\n UploadSignRequest,\n UploadSignResponse,\n} from './api';\nimport { Abilities, Condition, Id, Option, RouteReference } from './common';\nimport {\n Auth,\n AuthProvider,\n AuthToken,\n Definition,\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, 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 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 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 SearchResponse,\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":";;;;;;;;;;;;;;AA2EA,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;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"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The checks of `Action` that its `superRefine` makes in Zod, as JSON Schema keywords, so that the
3
+ * generated files check them too: backends validate their definitions against those files.
4
+ */
5
+ export declare const actionJsonRules: {
6
+ allOf: ({
7
+ if: {
8
+ properties: {
9
+ id: {
10
+ enum: ("show" | "edit" | "duplicate" | "delete")[];
11
+ not?: undefined;
12
+ };
13
+ kind?: undefined;
14
+ };
15
+ required: string[];
16
+ };
17
+ else: {
18
+ required: string[];
19
+ };
20
+ then?: undefined;
21
+ } | {
22
+ if: {
23
+ properties: {
24
+ id: {
25
+ enum: ("show" | "edit")[];
26
+ not?: undefined;
27
+ };
28
+ kind?: undefined;
29
+ };
30
+ required: string[];
31
+ };
32
+ then: {
33
+ properties: {
34
+ kind: {
35
+ const: string;
36
+ };
37
+ };
38
+ required: string[];
39
+ anyOf?: undefined;
40
+ };
41
+ else?: undefined;
42
+ } | {
43
+ if: {
44
+ properties: {
45
+ kind: {
46
+ const: string;
47
+ };
48
+ id: {
49
+ not: {
50
+ enum: ("show" | "edit")[];
51
+ };
52
+ enum?: undefined;
53
+ };
54
+ };
55
+ required: string[];
56
+ };
57
+ then: {
58
+ anyOf: {
59
+ required: string[];
60
+ }[];
61
+ properties?: undefined;
62
+ required?: undefined;
63
+ };
64
+ else?: undefined;
65
+ } | {
66
+ if: {
67
+ properties: {
68
+ kind: {
69
+ const: string;
70
+ };
71
+ id?: undefined;
72
+ };
73
+ required: string[];
74
+ };
75
+ then: {
76
+ required: string[];
77
+ properties?: undefined;
78
+ anyOf?: undefined;
79
+ };
80
+ else?: undefined;
81
+ })[];
82
+ };
83
+ //# sourceMappingURL=jsonRules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonRules.d.ts","sourceRoot":"","sources":["../../src/schemas/jsonRules.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B3B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { BUILT_IN_ITEM_ACTIONS, BUILT_IN_LINK_ACTIONS } from "../constants.js";
2
+ //#region src/schemas/jsonRules.ts
3
+ /**
4
+ * The checks of `Action` that its `superRefine` makes in Zod, as JSON Schema keywords, so that the
5
+ * generated files check them too: backends validate their definitions against those files.
6
+ */
7
+ var actionJsonRules = { allOf: [
8
+ {
9
+ if: {
10
+ properties: { id: { enum: [...BUILT_IN_ITEM_ACTIONS] } },
11
+ required: ["id"]
12
+ },
13
+ else: { required: ["label"] }
14
+ },
15
+ {
16
+ if: {
17
+ properties: { id: { enum: [...BUILT_IN_LINK_ACTIONS] } },
18
+ required: ["id"]
19
+ },
20
+ then: {
21
+ properties: { kind: { const: "link" } },
22
+ required: ["kind"]
23
+ }
24
+ },
25
+ {
26
+ if: {
27
+ properties: {
28
+ kind: { const: "link" },
29
+ id: { not: { enum: [...BUILT_IN_LINK_ACTIONS] } }
30
+ },
31
+ required: ["kind", "id"]
32
+ },
33
+ then: { anyOf: [{ required: ["url"] }, { required: ["route"] }] }
34
+ },
35
+ {
36
+ if: {
37
+ properties: { kind: { const: "client" } },
38
+ required: ["kind"]
39
+ },
40
+ then: { required: ["component"] }
41
+ }
42
+ ] };
43
+ //#endregion
44
+ export { actionJsonRules };
45
+
46
+ //# sourceMappingURL=jsonRules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonRules.js","names":[],"sources":["../../src/schemas/jsonRules.ts"],"sourcesContent":["import { BUILT_IN_ITEM_ACTIONS, BUILT_IN_LINK_ACTIONS } from '../constants';\n\n/**\n * The checks of `Action` that its `superRefine` makes in Zod, as JSON Schema keywords, so that the\n * generated files check them too: backends validate their definitions against those files.\n */\nexport const actionJsonRules = {\n allOf: [\n {\n // The built-in item actions need no label: the client labels them.\n if: { properties: { id: { enum: [...BUILT_IN_ITEM_ACTIONS] } }, required: ['id'] },\n else: { required: ['label'] },\n },\n {\n // The ids of the built-in links are only for links.\n if: { properties: { id: { enum: [...BUILT_IN_LINK_ACTIONS] } }, required: ['id'] },\n then: { properties: { kind: { const: 'link' } }, required: ['kind'] },\n },\n {\n if: {\n properties: {\n kind: { const: 'link' },\n id: { not: { enum: [...BUILT_IN_LINK_ACTIONS] } },\n },\n required: ['kind', 'id'],\n },\n then: { anyOf: [{ required: ['url'] }, { required: ['route'] }] },\n },\n {\n if: { properties: { kind: { const: 'client' } }, required: ['kind'] },\n then: { required: ['component'] },\n },\n ],\n};\n"],"mappings":";;;;;;AAMA,IAAa,kBAAkB,EAC3B,OAAO;CACH;EAEI,IAAI;GAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,qBAAqB,EAAE,EAAE;GAAG,UAAU,CAAC,IAAI;EAAE;EACjF,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE;CAChC;CACA;EAEI,IAAI;GAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,qBAAqB,EAAE,EAAE;GAAG,UAAU,CAAC,IAAI;EAAE;EACjF,MAAM;GAAE,YAAY,EAAE,MAAM,EAAE,OAAO,OAAO,EAAE;GAAG,UAAU,CAAC,MAAM;EAAE;CACxE;CACA;EACI,IAAI;GACA,YAAY;IACR,MAAM,EAAE,OAAO,OAAO;IACtB,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,qBAAqB,EAAE,EAAE;GACpD;GACA,UAAU,CAAC,QAAQ,IAAI;EAC3B;EACA,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE;CACpE;CACA;EACI,IAAI;GAAE,YAAY,EAAE,MAAM,EAAE,OAAO,SAAS,EAAE;GAAG,UAAU,CAAC,MAAM;EAAE;EACpE,MAAM,EAAE,UAAU,CAAC,WAAW,EAAE;CACpC;AACJ,EACJ"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Condition } from './common';
2
+ import { Condition } from './common.js';
3
3
  export declare const LayoutNode: z.ZodObject<{
4
4
  type: z.ZodString;
5
5
  name: z.ZodOptional<z.ZodString>;
@@ -21,6 +21,7 @@ export declare const Filter: z.ZodObject<{
21
21
  label: z.ZodString;
22
22
  description: z.ZodOptional<z.ZodString>;
23
23
  disabled: z.ZodOptional<z.ZodBoolean>;
24
+ tone: z.ZodOptional<z.ZodString>;
24
25
  }, z.core.$loose>>>;
25
26
  resource: z.ZodOptional<z.ZodString>;
26
27
  multiple: z.ZodOptional<z.ZodBoolean>;
@@ -49,6 +50,7 @@ export declare const ListDefinition: z.ZodObject<{
49
50
  label: z.ZodString;
50
51
  description: z.ZodOptional<z.ZodString>;
51
52
  disabled: z.ZodOptional<z.ZodBoolean>;
53
+ tone: z.ZodOptional<z.ZodString>;
52
54
  }, z.core.$loose>>>;
53
55
  resource: z.ZodOptional<z.ZodString>;
54
56
  multiple: z.ZodOptional<z.ZodBoolean>;
@@ -60,6 +62,10 @@ export declare const ListDefinition: z.ZodObject<{
60
62
  layouts: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
63
  perPage: z.ZodOptional<z.ZodNumber>;
62
64
  perPageOptions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
65
+ pagination: z.ZodOptional<z.ZodEnum<{
66
+ pages: "pages";
67
+ cursor: "cursor";
68
+ }>>;
63
69
  inlineEdit: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
70
  selectable: z.ZodOptional<z.ZodBoolean>;
65
71
  }, z.core.$loose>;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/schemas/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,MAAM;;;;;;;;;;;;iBAgBb,CAAC;AAEP,eAAO,MAAM,MAAM;;;;;;;;;;;;;iBAWjB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBzB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/schemas/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,MAAM;;;;;;;;;;;;iBAgBb,CAAC;AAEP,eAAO,MAAM,MAAM;;;;;;;;;;;;;;iBAWjB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBzB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -32,6 +32,7 @@ var ListDefinition = z.looseObject({
32
32
  layouts: z.array(z.string().min(1)).optional(),
33
33
  perPage: z.number().int().positive().optional(),
34
34
  perPageOptions: z.array(z.number().int().positive()).optional(),
35
+ pagination: z.enum(["pages", "cursor"]).optional().meta({ description: "`pages` (the default): numbered pages, with a total. `cursor`: the list follows `nextCursor` of each page with the `cursor` parameter, without page numbers, for large lists that the backend can't count (decision 0039)." }),
35
36
  inlineEdit: z.array(z.string().min(1)).optional().meta({ description: "Fields editable in the list." }),
36
37
  selectable: z.boolean().optional()
37
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","names":[],"sources":["../../src/schemas/list.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Option } from './common';\n\nexport const Column = z\n .looseObject({\n field: z.string().min(1).optional().meta({ description: 'The field shown in the column.' }),\n id: z\n .string()\n .min(1)\n .optional()\n .meta({ description: 'Id of a column that is not a field.' }),\n label: z.string().optional(),\n display: z.string().optional().meta({ description: 'How the value is displayed.' }),\n sortable: z.boolean().optional(),\n width: z.union([z.number(), z.string()]).optional(),\n align: z.enum(['start', 'center', 'end']).optional(),\n })\n .refine((column) => column.field !== undefined || column.id !== undefined, {\n message: 'A column needs a `field` or an `id`.',\n });\n\nexport const Filter = z.looseObject({\n id: z.string().min(1).meta({ description: 'Sent as `filter[id]`.' }),\n type: z.string().min(1).meta({\n description:\n 'Built-in: `text`, `select`, `toggle`, `date`, `date-range`, `relation`. A `date-range` value is the bounds of a range: `filter[id][from]` and `filter[id][to]`, days (`2026-01-31`), both inclusive and both optional.',\n }),\n label: z.string().optional(),\n options: z.array(Option).optional(),\n resource: z.string().optional(),\n multiple: z.boolean().optional(),\n default: z.unknown().optional(),\n});\n\nexport const ListDefinition = z.looseObject({\n columns: z.array(Column).optional(),\n filters: z.array(Filter).optional(),\n sorts: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields the list can be sorted by.' }),\n defaultSort: z\n .string()\n .optional()\n .meta({ description: 'Same format as the `sort` query parameter: `-published_at,title`.' }),\n search: z.boolean().optional().meta({ description: 'Whether the `q` parameter is supported.' }),\n layouts: z.array(z.string().min(1)).optional(),\n perPage: z.number().int().positive().optional(),\n perPageOptions: z.array(z.number().int().positive()).optional(),\n inlineEdit: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields editable in the list.' }),\n selectable: z.boolean().optional(),\n});\n\nexport type Column = z.infer<typeof Column>;\nexport type Filter = z.infer<typeof Filter>;\nexport type ListDefinition = z.infer<typeof ListDefinition>;\n"],"mappings":";;;AAIA,IAAa,SAAS,EACjB,YAAY;CACT,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,iCAAiC,CAAC;CAC1F,IAAI,EACC,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,sCAAsC,CAAC;CAChE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,8BAA8B,CAAC;CAClF,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;CAClD,OAAO,EAAE,KAAK;EAAC;EAAS;EAAU;CAAK,CAAC,CAAC,CAAC,SAAS;AACvD,CAAC,CAAC,CACD,QAAQ,WAAW,OAAO,UAAU,KAAA,KAAa,OAAO,OAAO,KAAA,GAAW,EACvE,SAAS,uCACb,CAAC;AAEL,IAAa,SAAS,EAAE,YAAY;CAChC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAA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+ {"version":3,"file":"list.js","names":[],"sources":["../../src/schemas/list.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Option } from './common';\n\nexport const Column = z\n .looseObject({\n field: z.string().min(1).optional().meta({ description: 'The field shown in the column.' }),\n id: z\n .string()\n .min(1)\n .optional()\n .meta({ description: 'Id of a column that is not a field.' }),\n label: z.string().optional(),\n display: z.string().optional().meta({ description: 'How the value is displayed.' }),\n sortable: z.boolean().optional(),\n width: z.union([z.number(), z.string()]).optional(),\n align: z.enum(['start', 'center', 'end']).optional(),\n })\n .refine((column) => column.field !== undefined || column.id !== undefined, {\n message: 'A column needs a `field` or an `id`.',\n });\n\nexport const Filter = z.looseObject({\n id: z.string().min(1).meta({ description: 'Sent as `filter[id]`.' }),\n type: z.string().min(1).meta({\n description:\n 'Built-in: `text`, `select`, `toggle`, `date`, `date-range`, `relation`. A `date-range` value is the bounds of a range: `filter[id][from]` and `filter[id][to]`, days (`2026-01-31`), both inclusive and both optional.',\n }),\n label: z.string().optional(),\n options: z.array(Option).optional(),\n resource: z.string().optional(),\n multiple: z.boolean().optional(),\n default: z.unknown().optional(),\n});\n\nexport const ListDefinition = z.looseObject({\n columns: z.array(Column).optional(),\n filters: z.array(Filter).optional(),\n sorts: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields the list can be sorted by.' }),\n defaultSort: z\n .string()\n .optional()\n .meta({ description: 'Same format as the `sort` query parameter: `-published_at,title`.' }),\n search: z.boolean().optional().meta({ description: 'Whether the `q` parameter is supported.' }),\n layouts: z.array(z.string().min(1)).optional(),\n perPage: z.number().int().positive().optional(),\n perPageOptions: z.array(z.number().int().positive()).optional(),\n pagination: z.enum(['pages', 'cursor']).optional().meta({\n description:\n \"`pages` (the default): numbered pages, with a total. `cursor`: the list follows `nextCursor` of each page with the `cursor` parameter, without page numbers, for large lists that the backend can't count (decision 0039).\",\n }),\n inlineEdit: z\n .array(z.string().min(1))\n .optional()\n .meta({ description: 'Fields editable in the list.' }),\n selectable: z.boolean().optional(),\n});\n\nexport type Column = z.infer<typeof Column>;\nexport type Filter = z.infer<typeof Filter>;\nexport type ListDefinition = z.infer<typeof ListDefinition>;\n"],"mappings":";;;AAIA,IAAa,SAAS,EACjB,YAAY;CACT,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,iCAAiC,CAAC;CAC1F,IAAI,EACC,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,sCAAsC,CAAC;CAChE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,8BAA8B,CAAC;CAClF,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;CAClD,OAAO,EAAE,KAAK;EAAC;EAAS;EAAU;CAAK,CAAC,CAAC,CAAC,SAAS;AACvD,CAAC,CAAC,CACD,QAAQ,WAAW,OAAO,UAAU,KAAA,KAAa,OAAO,OAAO,KAAA,GAAW,EACvE,SAAS,uCACb,CAAC;AAEL,IAAa,SAAS,EAAE,YAAY;CAChC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,wBAAwB,CAAC;CACnE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EACzB,aACI,yNACR,CAAC;CACD,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,SAAS,EAAE,MAAM,MAAM,CAAC,CAAC,SAAS;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,SAAS,EAAE,QAAQ,CAAC,CAAC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