@builder-builder/builder 0.0.25 → 0.0.27
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/client/schema.d.ts +29 -4
- package/dist/client/schema.js +3 -1
- package/dist/components/Builder.svelte.d.ts +24 -0
- package/dist/components/BuilderCollectionButtons.svelte.d.ts +22 -0
- package/dist/components/BuilderCollections.svelte.d.ts +23 -0
- package/dist/components/BuilderDescription.svelte.d.ts +18 -0
- package/dist/components/BuilderLayout.svelte.d.ts +24 -0
- package/dist/components/BuilderOption.svelte.d.ts +31 -0
- package/dist/components/BuilderOptionSelect.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionToggleBoolean.svelte.d.ts +20 -0
- package/dist/components/BuilderOptionToggleNumber.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionToggleString.svelte.d.ts +21 -0
- package/dist/components/BuilderPrice.svelte.d.ts +21 -0
- package/dist/components/BuilderRender.svelte.d.ts +39 -0
- package/dist/components/config.d.ts +2 -0
- package/dist/components/config.js +1 -0
- package/dist/components/dispatch.d.ts +1 -0
- package/dist/components/dispatch.js +3 -0
- package/dist/components/id.d.ts +1 -0
- package/dist/components/id.js +3 -0
- package/dist/components/index.d.ts +25 -0
- package/dist/components/index.js +7441 -0
- package/dist/entities/builder/builder.js +2 -1
- package/dist/entities/collection/collection.js +2 -1
- package/dist/entities/collection/config.d.ts +20 -20
- package/dist/entities/collection/config.js +3 -2
- package/dist/entities/component/component.d.ts +30 -30
- package/dist/entities/component/component.js +2 -1
- package/dist/entities/component/config.d.ts +12 -12
- package/dist/entities/component/field.d.ts +4 -4
- package/dist/entities/component/field.js +4 -3
- package/dist/entities/expectation.d.ts +2 -2
- package/dist/entities/expectation.js +2 -1
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/kind.d.ts +1 -1
- package/dist/entities/kind.js +43 -3
- package/dist/entities/model/models.d.ts +3 -3
- package/dist/entities/option/config.d.ts +4 -4
- package/dist/entities/option/option.d.ts +22 -22
- package/dist/entities/option/option.js +2 -1
- package/dist/entities/option/select.d.ts +1 -1
- package/dist/entities/option/select.js +5 -4
- package/dist/entities/option/toggle.d.ts +1 -1
- package/dist/entities/option/toggle.js +4 -3
- package/dist/entities/paths.d.ts +2 -2
- package/dist/entities/paths.js +2 -1
- package/dist/entities/pricing/expression.js +5 -4
- package/dist/entities/pricing/rates.js +2 -1
- package/dist/entities/references.d.ts +50 -2
- package/dist/entities/references.js +2 -1
- package/dist/entities/serialise.d.ts +318 -113
- package/dist/entities/serialise.js +4 -3
- package/dist/entities/tags.d.ts +1 -1
- package/dist/entities/tags.js +2 -1
- package/dist/entities/ui/describe.d.ts +126 -34
- package/dist/entities/ui/describe.js +3 -2
- package/dist/entities/ui/input.d.ts +158 -49
- package/dist/entities/ui/input.js +13 -6
- package/dist/entities/ui/page.d.ts +124 -32
- package/dist/entities/ui/page.js +2 -1
- package/dist/entities/ui/pages.d.ts +11 -3
- package/dist/entities/ui/pages.js +3 -2
- package/dist/entities/validated.d.ts +1 -0
- package/dist/entities/when.d.ts +16 -16
- package/dist/entities/when.js +2 -2
- package/dist/errors/errors.d.ts +10 -0
- package/dist/errors/errors.js +6 -0
- package/dist/instance.d.ts +7 -7
- package/dist/instance.js +4 -4
- package/dist/mappers/index.d.ts +1 -1
- package/dist/mappers/order.js +4 -2
- package/dist/mappers/price.js +1 -2
- package/dist/mappers/render/collection.d.ts +9 -0
- package/dist/mappers/render/collection.js +27 -0
- package/dist/mappers/render/compose.d.ts +5 -0
- package/dist/mappers/render/compose.js +15 -0
- package/dist/mappers/render/description.d.ts +3 -0
- package/dist/mappers/render/description.js +17 -0
- package/dist/mappers/render/index.d.ts +3 -1
- package/dist/mappers/render/option.d.ts +21 -0
- package/dist/mappers/render/option.js +26 -0
- package/dist/mappers/render/page.d.ts +11 -0
- package/dist/mappers/render/page.js +11 -0
- package/dist/mappers/render/paths.d.ts +3 -0
- package/dist/mappers/render/paths.js +21 -0
- package/dist/mappers/render/render.d.ts +1 -1
- package/dist/mappers/render/render.js +33 -98
- package/dist/mappers/resolve.d.ts +2 -1
- package/dist/mappers/resolve.js +24 -23
- package/dist/primitive.d.ts +5 -0
- package/dist/primitive.js +6 -1
- package/dist/public.d.ts +1 -1
- package/dist/references.d.ts +6 -6
- package/dist/references.js +3 -2
- package/dist/validate/model.js +16 -5
- package/dist/validate/paths.js +3 -5
- package/dist/validate/pricing.js +5 -6
- package/dist/validate/resolve.d.ts +2 -1
- package/dist/validate/resolve.js +87 -73
- package/dist/validate/ui.js +14 -13
- package/package.json +7 -5
- package/dist/mappers/render/pages.d.ts +0 -24
- package/dist/mappers/render/pages.js +0 -2
|
@@ -7,15 +7,15 @@ export type BuilderModels = ReadonlyArray<Paramable<BuilderModelGeneric>>;
|
|
|
7
7
|
export type BuilderModelsSerialised = ReadonlyArray<ParamableSerialised<BuilderModelSerialised>>;
|
|
8
8
|
export declare const BuilderModelsSerialisedSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
9
9
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
10
|
-
readonly id: v.StringSchema<undefined>;
|
|
11
|
-
readonly name: v.StringSchema<undefined>;
|
|
10
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
11
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
12
12
|
}, undefined>, v.ReadonlyAction<{
|
|
13
13
|
type: "parameter";
|
|
14
14
|
id: string;
|
|
15
15
|
name: string;
|
|
16
16
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
17
17
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
18
|
-
readonly id: v.StringSchema<undefined>;
|
|
18
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
19
19
|
}, undefined>, v.ReadonlyAction<{
|
|
20
20
|
type: "ref";
|
|
21
21
|
id: string;
|
|
@@ -7,7 +7,7 @@ export declare const BuilderOptionConfigSerialisedSchema: v.SchemaWithPipe<reado
|
|
|
7
7
|
readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
8
8
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
9
9
|
readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
10
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
10
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
11
11
|
}, undefined>, v.ReadonlyAction<{
|
|
12
12
|
type: "select";
|
|
13
13
|
readonly options: readonly [string, ...string[]];
|
|
@@ -22,7 +22,7 @@ export declare const BuilderOptionConfigSerialisedSchema: v.SchemaWithPipe<reado
|
|
|
22
22
|
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
23
23
|
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
24
24
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
25
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
25
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
26
26
|
}, undefined>, v.ReadonlyAction<{
|
|
27
27
|
type: "toggle";
|
|
28
28
|
valueType: "string" | "number" | "boolean";
|
|
@@ -52,7 +52,7 @@ export declare const BuilderOptionConfigsSerialisedSchema: v.SchemaWithPipe<read
|
|
|
52
52
|
readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
53
53
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
54
54
|
readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
55
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
55
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
56
56
|
}, undefined>, v.ReadonlyAction<{
|
|
57
57
|
type: "select";
|
|
58
58
|
readonly options: readonly [string, ...string[]];
|
|
@@ -67,7 +67,7 @@ export declare const BuilderOptionConfigsSerialisedSchema: v.SchemaWithPipe<read
|
|
|
67
67
|
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
68
68
|
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
69
69
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
70
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
70
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
71
71
|
}, undefined>, v.ReadonlyAction<{
|
|
72
72
|
type: "toggle";
|
|
73
73
|
valueType: "string" | "number" | "boolean";
|
|
@@ -55,18 +55,18 @@ export declare const BuilderOptionSelectMapSerialisedSchema: v.GenericSchema<imp
|
|
|
55
55
|
tags?: readonly string[] | undefined;
|
|
56
56
|
}>>>>;
|
|
57
57
|
export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
58
|
-
readonly name: v.StringSchema<undefined>;
|
|
58
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
59
59
|
readonly payload: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
60
60
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
61
|
-
readonly id: v.StringSchema<undefined>;
|
|
62
|
-
readonly name: v.StringSchema<undefined>;
|
|
61
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
62
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
63
63
|
}, undefined>, v.ReadonlyAction<{
|
|
64
64
|
type: "parameter";
|
|
65
65
|
id: string;
|
|
66
66
|
name: string;
|
|
67
67
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
68
68
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
69
|
-
readonly id: v.StringSchema<undefined>;
|
|
69
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
70
70
|
}, undefined>, v.ReadonlyAction<{
|
|
71
71
|
type: "ref";
|
|
72
72
|
id: string;
|
|
@@ -76,7 +76,7 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
|
|
|
76
76
|
readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
77
77
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
78
78
|
readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
79
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
79
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
80
80
|
}, undefined>, v.ReadonlyAction<{
|
|
81
81
|
type: "select";
|
|
82
82
|
readonly options: readonly [string, ...string[]];
|
|
@@ -91,7 +91,7 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
|
|
|
91
91
|
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
92
92
|
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
93
93
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
94
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
94
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
95
95
|
}, undefined>, v.ReadonlyAction<{
|
|
96
96
|
type: "toggle";
|
|
97
97
|
valueType: "string" | "number" | "boolean";
|
|
@@ -131,20 +131,20 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
|
|
|
131
131
|
}>>>>], undefined>], undefined>;
|
|
132
132
|
readonly paths: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
133
133
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
134
|
-
readonly id: v.StringSchema<undefined>;
|
|
135
|
-
readonly name: v.StringSchema<undefined>;
|
|
134
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
135
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
136
136
|
}, undefined>, v.ReadonlyAction<{
|
|
137
137
|
type: "parameter";
|
|
138
138
|
id: string;
|
|
139
139
|
name: string;
|
|
140
140
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
141
141
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
142
|
-
readonly id: v.StringSchema<undefined>;
|
|
142
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
143
143
|
}, undefined>, v.ReadonlyAction<{
|
|
144
144
|
type: "ref";
|
|
145
145
|
id: string;
|
|
146
|
-
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>], undefined>, undefined>;
|
|
147
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
146
|
+
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>], undefined>, undefined>;
|
|
147
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
148
148
|
}, undefined>, v.ReadonlyAction<{
|
|
149
149
|
name: string;
|
|
150
150
|
payload: Readonly<{
|
|
@@ -197,18 +197,18 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
|
|
|
197
197
|
}>]>;
|
|
198
198
|
export type BuilderOptionSerialised = v.InferOutput<typeof BuilderOptionSerialisedSchema>;
|
|
199
199
|
export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
200
|
-
readonly name: v.StringSchema<undefined>;
|
|
200
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
201
201
|
readonly payload: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
202
202
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
203
|
-
readonly id: v.StringSchema<undefined>;
|
|
204
|
-
readonly name: v.StringSchema<undefined>;
|
|
203
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
204
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
205
205
|
}, undefined>, v.ReadonlyAction<{
|
|
206
206
|
type: "parameter";
|
|
207
207
|
id: string;
|
|
208
208
|
name: string;
|
|
209
209
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
210
210
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
211
|
-
readonly id: v.StringSchema<undefined>;
|
|
211
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
212
212
|
}, undefined>, v.ReadonlyAction<{
|
|
213
213
|
type: "ref";
|
|
214
214
|
id: string;
|
|
@@ -218,7 +218,7 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
218
218
|
readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
219
219
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
220
220
|
readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
221
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
221
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
222
222
|
}, undefined>, v.ReadonlyAction<{
|
|
223
223
|
type: "select";
|
|
224
224
|
readonly options: readonly [string, ...string[]];
|
|
@@ -233,7 +233,7 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
233
233
|
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
234
234
|
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
235
235
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
236
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
236
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
237
237
|
}, undefined>, v.ReadonlyAction<{
|
|
238
238
|
type: "toggle";
|
|
239
239
|
valueType: "string" | "number" | "boolean";
|
|
@@ -273,20 +273,20 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
273
273
|
}>>>>], undefined>], undefined>;
|
|
274
274
|
readonly paths: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
275
275
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
276
|
-
readonly id: v.StringSchema<undefined>;
|
|
277
|
-
readonly name: v.StringSchema<undefined>;
|
|
276
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
277
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
278
278
|
}, undefined>, v.ReadonlyAction<{
|
|
279
279
|
type: "parameter";
|
|
280
280
|
id: string;
|
|
281
281
|
name: string;
|
|
282
282
|
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
283
283
|
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
284
|
-
readonly id: v.StringSchema<undefined>;
|
|
284
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
285
285
|
}, undefined>, v.ReadonlyAction<{
|
|
286
286
|
type: "ref";
|
|
287
287
|
id: string;
|
|
288
|
-
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>], undefined>, undefined>;
|
|
289
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
288
|
+
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>], undefined>, undefined>;
|
|
289
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
290
290
|
}, undefined>, v.ReadonlyAction<{
|
|
291
291
|
name: string;
|
|
292
292
|
payload: Readonly<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { NameSchema } from '../../primitive.js';
|
|
2
3
|
import { paramable } from '../../references.js';
|
|
3
4
|
import { createEntityValidator } from '../kind.js';
|
|
4
5
|
import { BuilderPathsSchema } from '../paths.js';
|
|
@@ -25,7 +26,7 @@ export const BuilderOptionSchema = v.instance(BuilderOption);
|
|
|
25
26
|
export const BuilderOptionWhenSerialisedSchema = createWhenSerialisedSchema(BuilderOptionConfigSerialisedSchema);
|
|
26
27
|
export const BuilderOptionSelectMapSerialisedSchema = createSelectMapSerialisedSchema(BuilderOptionConfigSerialisedSchema);
|
|
27
28
|
export const BuilderOptionSerialisedSchema = serialisable(v.object({
|
|
28
|
-
name:
|
|
29
|
+
name: NameSchema,
|
|
29
30
|
payload: paramable(v.union([BuilderOptionConfigSerialisedSchema, BuilderOptionWhenSerialisedSchema])),
|
|
30
31
|
paths: v.optional(paramable(BuilderPathsSchema)),
|
|
31
32
|
tags: v.optional(BuilderTagsSchema)
|
|
@@ -29,7 +29,7 @@ export declare const BuilderSelectConfigSerialisedSchema: v.SchemaWithPipe<reado
|
|
|
29
29
|
readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
30
30
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
31
31
|
readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
32
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
32
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
33
33
|
}, undefined>, v.ReadonlyAction<{
|
|
34
34
|
type: "select";
|
|
35
35
|
readonly options: readonly [string, ...string[]];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { BooleanSchema, StringSchema } from '../../primitive.js';
|
|
2
3
|
import { createEntityValidator } from '../kind.js';
|
|
3
4
|
import { serialisable } from '../serialisable.js';
|
|
4
5
|
import { BuilderTagsSchema } from '../tags.js';
|
|
@@ -43,10 +44,10 @@ export function select(values) {
|
|
|
43
44
|
export const BuilderSelectConfigSchema = v.instance(BuilderSelectConfig);
|
|
44
45
|
export const BuilderSelectConfigSerialisedSchema = serialisable(v.object({
|
|
45
46
|
type: v.literal('select'),
|
|
46
|
-
options: v.pipe(v.tupleWithRest([
|
|
47
|
-
defaultValue: v.nullable(
|
|
48
|
-
isOptional:
|
|
49
|
-
optionLabels: v.record(
|
|
47
|
+
options: v.pipe(v.tupleWithRest([StringSchema], StringSchema), v.readonly()),
|
|
48
|
+
defaultValue: v.nullable(StringSchema),
|
|
49
|
+
isOptional: BooleanSchema,
|
|
50
|
+
optionLabels: v.record(StringSchema, StringSchema),
|
|
50
51
|
tags: v.optional(BuilderTagsSchema)
|
|
51
52
|
}));
|
|
52
53
|
export function selectValueSchema(options, optional) {
|
|
@@ -26,7 +26,7 @@ export declare const BuilderToggleConfigSerialisedSchema: v.SchemaWithPipe<reado
|
|
|
26
26
|
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
27
27
|
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
28
28
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
29
|
-
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
29
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
30
30
|
}, undefined>, v.ReadonlyAction<{
|
|
31
31
|
type: "toggle";
|
|
32
32
|
valueType: "string" | "number" | "boolean";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import { check } from '../../errors/index.js';
|
|
3
|
+
import { BooleanSchema, NumberSchema, StringSchema } from '../../primitive.js';
|
|
3
4
|
import { createEntityValidator } from '../kind.js';
|
|
4
5
|
import { serialisable } from '../serialisable.js';
|
|
5
6
|
import { BuilderTagsSchema } from '../tags.js';
|
|
@@ -46,12 +47,12 @@ export const BuilderToggleConfigSchema = v.instance(BuilderToggleConfig);
|
|
|
46
47
|
export const BuilderToggleConfigSerialisedSchema = serialisable(v.object({
|
|
47
48
|
type: v.literal('toggle'),
|
|
48
49
|
valueType: BuilderToggleValueTypeSchema,
|
|
49
|
-
defaultValue: v.nullable(v.union([
|
|
50
|
-
isOptional:
|
|
50
|
+
defaultValue: v.nullable(v.union([BooleanSchema, StringSchema, NumberSchema])),
|
|
51
|
+
isOptional: BooleanSchema,
|
|
51
52
|
tags: v.optional(BuilderTagsSchema)
|
|
52
53
|
}));
|
|
53
54
|
export function toggleValueSchema(valueType, optional) {
|
|
54
|
-
const baseSchema = valueType === 'string' ?
|
|
55
|
+
const baseSchema = valueType === 'string' ? StringSchema : valueType === 'boolean' ? BooleanSchema : NumberSchema;
|
|
55
56
|
return optional ? v.nullable(baseSchema) : baseSchema;
|
|
56
57
|
}
|
|
57
58
|
export const validateToggle = createEntityValidator('toggle', BuilderToggleConfigSerialisedSchema, (input, errors) => {
|
package/dist/entities/paths.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
export declare const BuilderPathSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>;
|
|
2
|
+
export declare const BuilderPathSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>;
|
|
3
3
|
export type BuilderPath = v.InferOutput<typeof BuilderPathSchema>;
|
|
4
|
-
export declare const BuilderPathsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
4
|
+
export declare const BuilderPathsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>, undefined>, v.ReadonlyAction<(readonly (string | number)[])[]>]>;
|
|
5
5
|
export type BuilderPaths = v.InferOutput<typeof BuilderPathsSchema>;
|
|
6
6
|
export declare const validatePath: (input: unknown, references?: import("./references.js").BuilderReferences, errors?: import("../errors/errors.js").BuilderErrorsScope) => import("./validated.js").ValidationResult<readonly (string | number)[]>;
|
|
7
7
|
export declare const validatePaths: (input: unknown, references?: import("./references.js").BuilderReferences, errors?: import("../errors/errors.js").BuilderErrorsScope) => import("./validated.js").ValidationResult<readonly (readonly (string | number)[])[]>;
|
package/dist/entities/paths.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { NameSchema, NumberSchema } from '../primitive.js';
|
|
2
3
|
import { createEntityValidator } from './kind.js';
|
|
3
|
-
export const BuilderPathSchema = v.pipe(v.array(v.union([
|
|
4
|
+
export const BuilderPathSchema = v.pipe(v.array(v.union([NameSchema, NumberSchema])), v.readonly());
|
|
4
5
|
export const BuilderPathsSchema = v.pipe(v.array(BuilderPathSchema), v.readonly());
|
|
5
6
|
export const validatePath = createEntityValidator('path', BuilderPathSchema);
|
|
6
7
|
export const validatePaths = createEntityValidator('paths', BuilderPathsSchema);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { NameSchema, NumberSchema } from '../../primitive.js';
|
|
2
3
|
import { paramable } from '../../references.js';
|
|
3
4
|
export const BuilderPricingReduceSchema = v.picklist(['product', 'sum', 'first']);
|
|
4
5
|
export const BuilderPricingLookupKeySchema = v.variant('kind', [
|
|
5
6
|
v.object({ kind: v.literal('variantTags') }),
|
|
6
|
-
v.object({ kind: v.literal('option'), name:
|
|
7
|
+
v.object({ kind: v.literal('option'), name: NameSchema })
|
|
7
8
|
]);
|
|
8
9
|
export const BuilderPricingExpressionSchema = v.lazy(() => v.union([
|
|
9
|
-
|
|
10
|
+
NumberSchema,
|
|
10
11
|
v.object({ kind: v.literal('variantPrice') }),
|
|
11
12
|
v.object({
|
|
12
13
|
kind: v.literal('lookup'),
|
|
13
|
-
rate:
|
|
14
|
+
rate: NameSchema,
|
|
14
15
|
key: BuilderPricingLookupKeySchema,
|
|
15
16
|
reduce: v.optional(BuilderPricingReduceSchema)
|
|
16
17
|
}),
|
|
17
18
|
v.object({
|
|
18
19
|
kind: v.literal('variants'),
|
|
19
|
-
tag: v.optional(
|
|
20
|
+
tag: v.optional(NameSchema),
|
|
20
21
|
expression: paramable(BuilderPricingExpressionSchema),
|
|
21
22
|
reduce: v.optional(BuilderPricingReduceSchema)
|
|
22
23
|
}),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { NameSchema, NumberSchema } from '../../primitive.js';
|
|
2
3
|
import { serialisable } from '../serialisable.js';
|
|
3
4
|
import { createEntityValidator } from '../kind.js';
|
|
4
|
-
export const BuilderRatesSchema = serialisable(v.record(
|
|
5
|
+
export const BuilderRatesSchema = serialisable(v.record(NameSchema, v.record(NameSchema, NumberSchema)));
|
|
5
6
|
export const validatePricingRates = createEntityValidator('pricingRates', BuilderRatesSchema);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
export declare const BuilderReferenceSchema: v.ObjectSchema<{
|
|
3
|
-
readonly id: v.StringSchema<undefined>;
|
|
3
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
4
4
|
readonly serialised: v.GenericSchema<string | number | boolean | readonly (string | number)[] | readonly (readonly (string | number)[])[] | import("./index.js").BuilderSerialised | import("./index.js").BuilderModelSerialised | Readonly<{
|
|
5
5
|
type: "select";
|
|
6
6
|
readonly options: readonly [string, ...string[]];
|
|
@@ -210,6 +210,14 @@ export declare const BuilderReferenceSchema: v.ObjectSchema<{
|
|
|
210
210
|
type: "ref";
|
|
211
211
|
id: string;
|
|
212
212
|
}> | undefined;
|
|
213
|
+
placeholderLabel?: string | Readonly<{
|
|
214
|
+
type: "parameter";
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
}> | Readonly<{
|
|
218
|
+
type: "ref";
|
|
219
|
+
id: string;
|
|
220
|
+
}> | undefined;
|
|
213
221
|
metadata?: Readonly<{
|
|
214
222
|
type: "parameter";
|
|
215
223
|
id: string;
|
|
@@ -271,6 +279,14 @@ export declare const BuilderReferenceSchema: v.ObjectSchema<{
|
|
|
271
279
|
type: "ref";
|
|
272
280
|
id: string;
|
|
273
281
|
}> | undefined;
|
|
282
|
+
placeholderLabel?: string | Readonly<{
|
|
283
|
+
type: "parameter";
|
|
284
|
+
id: string;
|
|
285
|
+
name: string;
|
|
286
|
+
}> | Readonly<{
|
|
287
|
+
type: "ref";
|
|
288
|
+
id: string;
|
|
289
|
+
}> | undefined;
|
|
274
290
|
metadata?: Readonly<{
|
|
275
291
|
type: "parameter";
|
|
276
292
|
id: string;
|
|
@@ -334,6 +350,14 @@ export declare const BuilderReferenceSchema: v.ObjectSchema<{
|
|
|
334
350
|
type: "ref";
|
|
335
351
|
id: string;
|
|
336
352
|
}> | undefined;
|
|
353
|
+
placeholderLabel?: string | Readonly<{
|
|
354
|
+
type: "parameter";
|
|
355
|
+
id: string;
|
|
356
|
+
name: string;
|
|
357
|
+
}> | Readonly<{
|
|
358
|
+
type: "ref";
|
|
359
|
+
id: string;
|
|
360
|
+
}> | undefined;
|
|
337
361
|
metadata?: Readonly<{
|
|
338
362
|
type: "parameter";
|
|
339
363
|
id: string;
|
|
@@ -361,7 +385,7 @@ export declare const BuilderReferenceSchema: v.ObjectSchema<{
|
|
|
361
385
|
}, undefined>;
|
|
362
386
|
export type BuilderReference = v.InferOutput<typeof BuilderReferenceSchema>;
|
|
363
387
|
export declare const BuilderReferencesSchema: v.ArraySchema<v.ObjectSchema<{
|
|
364
|
-
readonly id: v.StringSchema<undefined>;
|
|
388
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
365
389
|
readonly serialised: v.GenericSchema<string | number | boolean | readonly (string | number)[] | readonly (readonly (string | number)[])[] | import("./index.js").BuilderSerialised | import("./index.js").BuilderModelSerialised | Readonly<{
|
|
366
390
|
type: "select";
|
|
367
391
|
readonly options: readonly [string, ...string[]];
|
|
@@ -571,6 +595,14 @@ export declare const BuilderReferencesSchema: v.ArraySchema<v.ObjectSchema<{
|
|
|
571
595
|
type: "ref";
|
|
572
596
|
id: string;
|
|
573
597
|
}> | undefined;
|
|
598
|
+
placeholderLabel?: string | Readonly<{
|
|
599
|
+
type: "parameter";
|
|
600
|
+
id: string;
|
|
601
|
+
name: string;
|
|
602
|
+
}> | Readonly<{
|
|
603
|
+
type: "ref";
|
|
604
|
+
id: string;
|
|
605
|
+
}> | undefined;
|
|
574
606
|
metadata?: Readonly<{
|
|
575
607
|
type: "parameter";
|
|
576
608
|
id: string;
|
|
@@ -632,6 +664,14 @@ export declare const BuilderReferencesSchema: v.ArraySchema<v.ObjectSchema<{
|
|
|
632
664
|
type: "ref";
|
|
633
665
|
id: string;
|
|
634
666
|
}> | undefined;
|
|
667
|
+
placeholderLabel?: string | Readonly<{
|
|
668
|
+
type: "parameter";
|
|
669
|
+
id: string;
|
|
670
|
+
name: string;
|
|
671
|
+
}> | Readonly<{
|
|
672
|
+
type: "ref";
|
|
673
|
+
id: string;
|
|
674
|
+
}> | undefined;
|
|
635
675
|
metadata?: Readonly<{
|
|
636
676
|
type: "parameter";
|
|
637
677
|
id: string;
|
|
@@ -695,6 +735,14 @@ export declare const BuilderReferencesSchema: v.ArraySchema<v.ObjectSchema<{
|
|
|
695
735
|
type: "ref";
|
|
696
736
|
id: string;
|
|
697
737
|
}> | undefined;
|
|
738
|
+
placeholderLabel?: string | Readonly<{
|
|
739
|
+
type: "parameter";
|
|
740
|
+
id: string;
|
|
741
|
+
name: string;
|
|
742
|
+
}> | Readonly<{
|
|
743
|
+
type: "ref";
|
|
744
|
+
id: string;
|
|
745
|
+
}> | undefined;
|
|
698
746
|
metadata?: Readonly<{
|
|
699
747
|
type: "parameter";
|
|
700
748
|
id: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { IdSchema } from '../primitive.js';
|
|
2
3
|
import { BuilderEntitySerialisedSchema } from './serialise.js';
|
|
3
4
|
export const BuilderReferenceSchema = v.object({
|
|
4
|
-
id:
|
|
5
|
+
id: IdSchema,
|
|
5
6
|
serialised: BuilderEntitySerialisedSchema
|
|
6
7
|
});
|
|
7
8
|
export const BuilderReferencesSchema = v.array(BuilderReferenceSchema);
|