@panneau/protocol 5.0.0-alpha.2 → 5.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addresses.d.ts +23 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/addresses.js +52 -0
- package/dist/addresses.js.map +1 -0
- package/dist/compound.d.ts +20 -0
- package/dist/compound.d.ts.map +1 -0
- package/dist/compound.js +27 -0
- package/dist/compound.js.map +1 -0
- package/dist/conditions.d.ts +1 -1
- package/dist/conformance/index.d.ts +6 -0
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +787 -11
- package/dist/conformance/index.js.map +1 -1
- package/dist/constants.d.ts +101 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +174 -3
- package/dist/constants.js.map +1 -1
- package/dist/context.d.ts +15 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +34 -0
- package/dist/context.js.map +1 -0
- package/dist/currencies.d.ts +22 -0
- package/dist/currencies.d.ts.map +1 -0
- package/dist/currencies.js +231 -0
- package/dist/currencies.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +17 -7
- package/dist/libraries.d.ts +26 -0
- package/dist/libraries.d.ts.map +1 -0
- package/dist/libraries.js +22 -0
- package/dist/libraries.js.map +1 -0
- package/dist/links.d.ts +38 -0
- package/dist/links.d.ts.map +1 -0
- package/dist/links.js +65 -0
- package/dist/links.js.map +1 -0
- package/dist/lint.d.ts +4 -3
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +114 -2
- package/dist/lint.js.map +1 -1
- package/dist/mock/auth.d.ts +71 -0
- package/dist/mock/auth.d.ts.map +1 -0
- package/dist/mock/auth.js +346 -0
- package/dist/mock/auth.js.map +1 -0
- package/dist/mock/example.d.ts +3 -2
- package/dist/mock/example.d.ts.map +1 -1
- package/dist/mock/example.js +223 -142
- package/dist/mock/example.js.map +1 -1
- package/dist/mock/index.d.ts +77 -7
- package/dist/mock/index.d.ts.map +1 -1
- package/dist/mock/index.js +577 -34
- package/dist/mock/index.js.map +1 -1
- package/dist/openapi.d.ts.map +1 -1
- package/dist/openapi.js +394 -145
- package/dist/openapi.js.map +1 -1
- package/dist/problem.d.ts +1 -1
- package/dist/query.d.ts +18 -0
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +34 -8
- package/dist/query.js.map +1 -1
- package/dist/rules.d.ts +16 -4
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +230 -13
- package/dist/rules.js.map +1 -1
- package/dist/runtime/index.d.ts +19 -10
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +12 -3
- package/dist/schemas/action.d.ts +117 -10
- package/dist/schemas/action.d.ts.map +1 -1
- package/dist/schemas/action.js +21 -3
- package/dist/schemas/action.js.map +1 -1
- package/dist/schemas/api.d.ts +326 -42
- package/dist/schemas/api.d.ts.map +1 -1
- package/dist/schemas/api.js +192 -34
- package/dist/schemas/api.js.map +1 -1
- package/dist/schemas/boot.d.ts +25 -1
- package/dist/schemas/boot.d.ts.map +1 -1
- package/dist/schemas/boot.js +2 -1
- package/dist/schemas/boot.js.map +1 -1
- package/dist/schemas/common.d.ts +1 -0
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/common.js +2 -1
- package/dist/schemas/common.js.map +1 -1
- package/dist/schemas/definition.d.ts +332 -28
- package/dist/schemas/definition.d.ts.map +1 -1
- package/dist/schemas/definition.js +65 -19
- package/dist/schemas/definition.js.map +1 -1
- package/dist/schemas/field.d.ts +356 -2
- package/dist/schemas/field.d.ts.map +1 -1
- package/dist/schemas/field.js +159 -20
- package/dist/schemas/field.js.map +1 -1
- package/dist/schemas/index.d.ts +1384 -72
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +58 -9
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/jsonRules.d.ts +83 -0
- package/dist/schemas/jsonRules.d.ts.map +1 -0
- package/dist/schemas/jsonRules.js +46 -0
- package/dist/schemas/jsonRules.js.map +1 -0
- package/dist/schemas/layout.d.ts +1 -1
- package/dist/schemas/list.d.ts +23 -2
- package/dist/schemas/list.d.ts.map +1 -1
- package/dist/schemas/list.js +14 -5
- package/dist/schemas/list.js.map +1 -1
- package/dist/schemas/resource.d.ts +247 -15
- package/dist/schemas/resource.d.ts.map +1 -1
- package/dist/schemas/resource.js +6 -1
- package/dist/schemas/resource.js.map +1 -1
- package/dist/schemas/widget.d.ts +109 -0
- package/dist/schemas/widget.d.ts.map +1 -0
- package/dist/schemas/widget.js +74 -0
- package/dist/schemas/widget.js.map +1 -0
- package/dist/search.d.ts +51 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +53 -0
- package/dist/search.js.map +1 -0
- package/dist/themes.d.ts +1 -1
- package/dist/transforms.d.ts +17 -0
- package/dist/transforms.d.ts.map +1 -0
- package/dist/transforms.js +34 -0
- package/dist/transforms.js.map +1 -0
- package/dist/validate.d.ts +5 -3
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +36 -2
- package/dist/validate.js.map +1 -1
- package/dist/values.d.ts +5 -1
- package/dist/values.d.ts.map +1 -1
- package/dist/values.js +16 -2
- package/dist/values.js.map +1 -1
- package/dist/widgets.d.ts +42 -0
- package/dist/widgets.d.ts.map +1 -0
- package/dist/widgets.js +130 -0
- package/dist/widgets.js.map +1 -0
- package/package.json +6 -3
- package/schema/boot.schema.json +666 -18
- package/schema/definition.schema.json +663 -18
- package/schema/openapi.json +5694 -2328
|
@@ -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;
|
|
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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGY,CAAC;AAEtC,0FAA0F;AAC1F,wBAAgB,oBAAoB;QACE,MAAM;4GAK3C"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Abilities, Condition, Id, Option, RouteReference } from "./common.js";
|
|
2
|
-
import { BlockType, Field, Rule } from "./field.js";
|
|
2
|
+
import { AddressSettings, BlockType, DateRangeSettings, DurationSettings, Field, LinkSettings, LinkTypeSetting, MoneySettings, 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
|
-
import { Column, Filter, ListDefinition } from "./list.js";
|
|
6
|
+
import { Column, Filter, ListCalendar, ListDefinition } from "./list.js";
|
|
6
7
|
import { Resource, ResourceFeatures } from "./resource.js";
|
|
7
8
|
import { DefinitionTheme, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues } from "./theme.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { ListWidgetData, ListWidgetItem, SeriesPoint, SeriesWidgetData, StatWidgetData, Widget, WidgetBadge, WidgetSettings, widgetDataSchemas } from "./widget.js";
|
|
10
|
+
import { Auth, AuthProvider, AuthToken, ContextOption, ContextParam, Definition, DefinitionContext, MenuItem, Page, Uploads, User } from "./definition.js";
|
|
11
|
+
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";
|
|
10
12
|
import { BootConfig } from "./boot.js";
|
|
11
13
|
import { z } from "zod";
|
|
12
14
|
//#region src/schemas/index.ts
|
|
@@ -20,9 +22,18 @@ var namedSchemas = {
|
|
|
20
22
|
Rule,
|
|
21
23
|
BlockType,
|
|
22
24
|
Field,
|
|
25
|
+
RichTextStyle,
|
|
26
|
+
RichTextSettings,
|
|
27
|
+
LinkTypeSetting,
|
|
28
|
+
LinkSettings,
|
|
29
|
+
AddressSettings,
|
|
30
|
+
DateRangeSettings,
|
|
31
|
+
MoneySettings,
|
|
32
|
+
DurationSettings,
|
|
23
33
|
LayoutNode,
|
|
24
34
|
Column,
|
|
25
35
|
Filter,
|
|
36
|
+
ListCalendar,
|
|
26
37
|
ListDefinition,
|
|
27
38
|
ActionScope,
|
|
28
39
|
ActionPlacement,
|
|
@@ -32,11 +43,16 @@ var namedSchemas = {
|
|
|
32
43
|
Resource,
|
|
33
44
|
User,
|
|
34
45
|
AuthProvider,
|
|
46
|
+
AuthToken,
|
|
35
47
|
Auth,
|
|
36
48
|
MenuItem,
|
|
37
49
|
Page,
|
|
50
|
+
WidgetSettings,
|
|
38
51
|
Widget,
|
|
39
52
|
Uploads,
|
|
53
|
+
ContextOption,
|
|
54
|
+
ContextParam,
|
|
55
|
+
DefinitionContext,
|
|
40
56
|
ThemeTokens,
|
|
41
57
|
ToneValues,
|
|
42
58
|
ToneInput,
|
|
@@ -48,6 +64,7 @@ var namedSchemas = {
|
|
|
48
64
|
Definition,
|
|
49
65
|
Item,
|
|
50
66
|
Pagination,
|
|
67
|
+
CursorPagination,
|
|
51
68
|
ItemResponse,
|
|
52
69
|
ListResponse,
|
|
53
70
|
Problem,
|
|
@@ -58,20 +75,52 @@ var namedSchemas = {
|
|
|
58
75
|
ActionRun,
|
|
59
76
|
ActionRunResponse,
|
|
60
77
|
MediaTransform,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
StoredFile,
|
|
79
|
+
UploadReference,
|
|
80
|
+
Upload,
|
|
81
|
+
UploadResponse,
|
|
82
|
+
UploadSignRequest,
|
|
83
|
+
UploadSignResponse,
|
|
84
|
+
FieldCheckRequest,
|
|
85
|
+
FieldCheckResponse,
|
|
86
|
+
MediaInfo,
|
|
87
|
+
MediaItem,
|
|
88
|
+
MediaReference,
|
|
64
89
|
Session,
|
|
90
|
+
TwoFactorChallenge,
|
|
91
|
+
TwoFactorStatus,
|
|
92
|
+
TwoFactorSetup,
|
|
93
|
+
RecoveryCodes,
|
|
94
|
+
WebAuthnOptions,
|
|
95
|
+
Passkey,
|
|
65
96
|
SearchResponse,
|
|
66
|
-
|
|
97
|
+
ContextOptionsResponse,
|
|
98
|
+
PreviewResponse,
|
|
99
|
+
EmbedValue,
|
|
100
|
+
EmbedResponse,
|
|
101
|
+
LocationValue,
|
|
102
|
+
AddressValue,
|
|
103
|
+
LinkValue,
|
|
104
|
+
DateRangeValue,
|
|
105
|
+
MoneyValue,
|
|
106
|
+
WidgetBadge,
|
|
107
|
+
StatWidgetData,
|
|
108
|
+
SeriesPoint,
|
|
109
|
+
SeriesWidgetData,
|
|
110
|
+
ListWidgetItem,
|
|
111
|
+
ListWidgetData
|
|
67
112
|
};
|
|
68
113
|
/** A registry of the named schemas, used to reference them by name in generated files. */
|
|
69
114
|
function createSchemaRegistry() {
|
|
70
115
|
const registry = z.registry();
|
|
71
116
|
Object.entries(namedSchemas).forEach(([id, schema]) => registry.add(schema, { id }));
|
|
117
|
+
registry.add(Action, {
|
|
118
|
+
id: "Action",
|
|
119
|
+
...actionJsonRules
|
|
120
|
+
});
|
|
72
121
|
return registry;
|
|
73
122
|
}
|
|
74
123
|
//#endregion
|
|
75
|
-
export { Abilities, Action, ActionConfirm, ActionItemResult, ActionPlacement, ActionRequest, ActionResult, ActionRun, ActionRunResponse, ActionScope, Auth, AuthProvider, BlockType, BootConfig, Column, Condition, Definition, DefinitionTheme, Field, Filter, Id, Item, ItemResponse, LayoutNode, ListDefinition, ListResponse,
|
|
124
|
+
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, ListWidgetData, ListWidgetItem, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, MenuItem, MoneySettings, MoneyValue, Option, Page, Pagination, Passkey, PreviewResponse, Problem, RecoveryCodes, Resource, ResourceFeatures, RichTextSettings, RichTextStyle, RouteReference, Rule, SearchResponse, Selection, SeriesPoint, SeriesWidgetData, Session, StatWidgetData, StoredFile, Theme, ThemeFont, ThemeFontFace, ThemeFontStylesheet, ThemeTokens, ToneInput, ToneValues, TwoFactorChallenge, TwoFactorSetup, TwoFactorStatus, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse, Uploads, User, WebAuthnOptions, Widget, WidgetBadge, WidgetSettings, createSchemaRegistry, namedSchemas, widgetDataSchemas };
|
|
76
125
|
|
|
77
126
|
//# 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
|
|
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} 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';\nimport {\n ListWidgetData,\n ListWidgetItem,\n SeriesPoint,\n SeriesWidgetData,\n StatWidgetData,\n Widget,\n WidgetBadge,\n WidgetSettings,\n} from './widget';\n\nexport * from './common';\nexport * from './field';\nexport * from './layout';\nexport * from './list';\nexport * from './action';\nexport * from './resource';\nexport * from './theme';\nexport * from './widget';\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 WidgetSettings,\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 WidgetBadge,\n StatWidgetData,\n SeriesPoint,\n SeriesWidgetData,\n ListWidgetItem,\n ListWidgetData,\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":";;;;;;;;;;;;;;;AA+GA,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;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"}
|
package/dist/schemas/layout.d.ts
CHANGED
package/dist/schemas/list.d.ts
CHANGED
|
@@ -8,9 +8,11 @@ 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
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
hideable: z.ZodOptional<z.ZodBoolean>;
|
|
14
16
|
}, z.core.$loose>;
|
|
15
17
|
export declare const Filter: z.ZodObject<{
|
|
16
18
|
id: z.ZodString;
|
|
@@ -21,11 +23,17 @@ export declare const Filter: z.ZodObject<{
|
|
|
21
23
|
label: z.ZodString;
|
|
22
24
|
description: z.ZodOptional<z.ZodString>;
|
|
23
25
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
tone: z.ZodOptional<z.ZodString>;
|
|
24
27
|
}, z.core.$loose>>>;
|
|
25
28
|
resource: z.ZodOptional<z.ZodString>;
|
|
26
29
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
27
30
|
default: z.ZodOptional<z.ZodUnknown>;
|
|
28
31
|
}, z.core.$loose>;
|
|
32
|
+
export declare const ListCalendar: z.ZodObject<{
|
|
33
|
+
field: z.ZodString;
|
|
34
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
35
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, z.core.$loose>;
|
|
29
37
|
export declare const ListDefinition: z.ZodObject<{
|
|
30
38
|
columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
31
39
|
field: z.ZodOptional<z.ZodString>;
|
|
@@ -36,9 +44,11 @@ export declare const ListDefinition: z.ZodObject<{
|
|
|
36
44
|
width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
37
45
|
align: z.ZodOptional<z.ZodEnum<{
|
|
38
46
|
start: "start";
|
|
39
|
-
center: "center";
|
|
40
47
|
end: "end";
|
|
48
|
+
center: "center";
|
|
41
49
|
}>>;
|
|
50
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
hideable: z.ZodOptional<z.ZodBoolean>;
|
|
42
52
|
}, z.core.$loose>>>;
|
|
43
53
|
filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
54
|
id: z.ZodString;
|
|
@@ -49,6 +59,7 @@ export declare const ListDefinition: z.ZodObject<{
|
|
|
49
59
|
label: z.ZodString;
|
|
50
60
|
description: z.ZodOptional<z.ZodString>;
|
|
51
61
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
tone: z.ZodOptional<z.ZodString>;
|
|
52
63
|
}, z.core.$loose>>>;
|
|
53
64
|
resource: z.ZodOptional<z.ZodString>;
|
|
54
65
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -60,10 +71,20 @@ export declare const ListDefinition: z.ZodObject<{
|
|
|
60
71
|
layouts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
72
|
perPage: z.ZodOptional<z.ZodNumber>;
|
|
62
73
|
perPageOptions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
74
|
+
pagination: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
pages: "pages";
|
|
76
|
+
cursor: "cursor";
|
|
77
|
+
}>>;
|
|
63
78
|
inlineEdit: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
79
|
selectable: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
calendar: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
field: z.ZodString;
|
|
82
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
83
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$loose>>;
|
|
65
85
|
}, z.core.$loose>;
|
|
66
86
|
export type Column = z.infer<typeof Column>;
|
|
67
87
|
export type Filter = z.infer<typeof Filter>;
|
|
68
88
|
export type ListDefinition = z.infer<typeof ListDefinition>;
|
|
89
|
+
export type ListCalendar = z.infer<typeof ListCalendar>;
|
|
69
90
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -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
|
|
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;;;;;;;;;;;;;;iBAwBb,CAAC;AAEP,eAAO,MAAM,MAAM;;;;;;;;;;;;;;iBAWjB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;iBAavB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+BzB,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;AAC5D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
package/dist/schemas/list.js
CHANGED
|
@@ -12,7 +12,9 @@ var Column = z.looseObject({
|
|
|
12
12
|
"start",
|
|
13
13
|
"center",
|
|
14
14
|
"end"
|
|
15
|
-
]).optional()
|
|
15
|
+
]).optional(),
|
|
16
|
+
hidden: z.boolean().optional().meta({ description: "Not shown by default: the user can show it from the columns of the list (decision 0042)." }),
|
|
17
|
+
hideable: z.boolean().optional().meta({ description: "`false`: always shown, the user can move it but not hide it. Columns are hideable by default." })
|
|
16
18
|
}).refine((column) => column.field !== void 0 || column.id !== void 0, { message: "A column needs a `field` or an `id`." });
|
|
17
19
|
var Filter = z.looseObject({
|
|
18
20
|
id: z.string().min(1).meta({ description: "Sent as `filter[id]`." }),
|
|
@@ -23,19 +25,26 @@ var Filter = z.looseObject({
|
|
|
23
25
|
multiple: z.boolean().optional(),
|
|
24
26
|
default: z.unknown().optional()
|
|
25
27
|
});
|
|
28
|
+
var ListCalendar = z.looseObject({
|
|
29
|
+
field: z.string().min(1).meta({ description: "The `date` or `datetime` field each item is shown on the day of." }),
|
|
30
|
+
filter: z.string().min(1).optional().meta({ description: "The id of the list's `date-range` filter on that field, through which the calendar asks for the days around a month. Defaults to the field's name." }),
|
|
31
|
+
perPage: z.number().int().positive().optional().meta({ description: "How many items the calendar asks for a month, in one request. Defaults to 100." })
|
|
32
|
+
});
|
|
26
33
|
var ListDefinition = z.looseObject({
|
|
27
34
|
columns: z.array(Column).optional(),
|
|
28
35
|
filters: z.array(Filter).optional(),
|
|
29
36
|
sorts: z.array(z.string().min(1)).optional().meta({ description: "Fields the list can be sorted by." }),
|
|
30
37
|
defaultSort: z.string().optional().meta({ description: "Same format as the `sort` query parameter: `-published_at,title`." }),
|
|
31
38
|
search: z.boolean().optional().meta({ description: "Whether the `q` parameter is supported." }),
|
|
32
|
-
layouts: z.array(z.string().min(1)).optional(),
|
|
39
|
+
layouts: z.array(z.string().min(1)).optional().meta({ description: "The layouts the list offers, the first being the default. Built in: `table`, `cards`, `gallery` (on the `itemImage` of the resource) and `calendar` (with `calendar`)." }),
|
|
33
40
|
perPage: z.number().int().positive().optional(),
|
|
34
41
|
perPageOptions: z.array(z.number().int().positive()).optional(),
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
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)." }),
|
|
43
|
+
inlineEdit: z.array(z.string().min(1)).optional().meta({ description: "Fields that columns edit in place, on items that can be updated: `text`, `number`, `select`, `boolean` and `date`. Each change is a `PATCH` with the one field and `If-Match` (decision 0043)." }),
|
|
44
|
+
selectable: z.boolean().optional(),
|
|
45
|
+
calendar: ListCalendar.optional().meta({ description: "The calendar of the list: the items of a month on the days of a date field, asked for through a `date-range` filter instead of pages (decision 0044)." })
|
|
37
46
|
});
|
|
38
47
|
//#endregion
|
|
39
|
-
export { Column, Filter, ListDefinition };
|
|
48
|
+
export { Column, Filter, ListCalendar, ListDefinition };
|
|
40
49
|
|
|
41
50
|
//# sourceMappingURL=list.js.map
|
package/dist/schemas/list.js.map
CHANGED
|
@@ -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
|
|
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 hidden: z.boolean().optional().meta({\n description:\n 'Not shown by default: the user can show it from the columns of the list (decision 0042).',\n }),\n hideable: z.boolean().optional().meta({\n description:\n '`false`: always shown, the user can move it but not hide it. Columns are hideable by default.',\n }),\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 ListCalendar = z.looseObject({\n field: z\n .string()\n .min(1)\n .meta({ description: 'The `date` or `datetime` field each item is shown on the day of.' }),\n filter: z.string().min(1).optional().meta({\n description:\n \"The id of the list's `date-range` filter on that field, through which the calendar asks for the days around a month. Defaults to the field's name.\",\n }),\n perPage: z.number().int().positive().optional().meta({\n description:\n 'How many items the calendar asks for a month, in one request. Defaults to 100.',\n }),\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().meta({\n description:\n 'The layouts the list offers, the first being the default. Built in: `table`, `cards`, `gallery` (on the `itemImage` of the resource) and `calendar` (with `calendar`).',\n }),\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.array(z.string().min(1)).optional().meta({\n description:\n 'Fields that columns edit in place, on items that can be updated: `text`, `number`, `select`, `boolean` and `date`. Each change is a `PATCH` with the one field and `If-Match` (decision 0043).',\n }),\n selectable: z.boolean().optional(),\n calendar: ListCalendar.optional().meta({\n description:\n 'The calendar of the list: the items of a month on the days of a date field, asked for through a `date-range` filter instead of pages (decision 0044).',\n }),\n});\n\nexport type Column = z.infer<typeof Column>;\nexport type Filter = z.infer<typeof Filter>;\nexport type ListDefinition = z.infer<typeof ListDefinition>;\nexport type ListCalendar = z.infer<typeof ListCalendar>;\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,C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