@builder-builder/builder 0.0.26 → 0.0.28
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/bb.js +4 -4
- package/dist/client/client.d.ts +2 -1
- package/dist/client/client.js +4 -1
- package/dist/client/public.d.ts +2 -2
- package/dist/client/public.js +1 -1
- package/dist/client/schema.d.ts +103 -17
- package/dist/client/schema.js +7 -0
- 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 +7515 -0
- package/dist/components/index.min.js +3 -0
- package/dist/entities/collection/collection.d.ts +66 -66
- package/dist/entities/collection/config.d.ts +17 -17
- package/dist/entities/collection/when.d.ts +1 -1
- package/dist/entities/component/component.d.ts +64 -64
- package/dist/entities/component/config.d.ts +33 -33
- package/dist/entities/component/config.js +18 -16
- package/dist/entities/component/detail.d.ts +61 -0
- package/dist/entities/component/detail.js +71 -0
- package/dist/entities/component/index.d.ts +2 -2
- package/dist/entities/component/index.js +1 -1
- package/dist/entities/component/when.d.ts +2 -2
- package/dist/entities/expectation.d.ts +1 -1
- package/dist/entities/index.d.ts +4 -4
- package/dist/entities/index.js +1 -1
- package/dist/entities/kind.d.ts +3 -3
- package/dist/entities/kind.js +20 -20
- package/dist/entities/model/methods.d.ts +1 -1
- package/dist/entities/option/config.d.ts +7 -7
- package/dist/entities/option/config.js +1 -1
- package/dist/entities/option/index.d.ts +4 -4
- package/dist/entities/option/index.js +2 -2
- package/dist/entities/option/option.d.ts +22 -22
- package/dist/entities/option/select.d.ts +1 -1
- package/dist/entities/option/toggle.d.ts +9 -9
- package/dist/entities/option/toggle.js +15 -10
- package/dist/entities/option/when.d.ts +1 -1
- package/dist/entities/paths.d.ts +2 -2
- package/dist/entities/pricing/expression.d.ts +16 -39
- package/dist/entities/pricing/expression.js +1 -16
- package/dist/entities/pricing/index.d.ts +1 -1
- package/dist/entities/pricing/rates.d.ts +1 -1
- package/dist/entities/references.d.ts +72 -24
- package/dist/entities/serialise.d.ts +148 -32
- package/dist/entities/serialise.js +7 -7
- package/dist/entities/ui/describe.d.ts +49 -1
- package/dist/entities/ui/input.d.ts +67 -2
- package/dist/entities/ui/input.js +8 -2
- package/dist/entities/ui/page.d.ts +49 -1
- package/dist/entities/ui/pages.d.ts +10 -2
- package/dist/entities/validated.d.ts +2 -2
- package/dist/entities/when.d.ts +5 -5
- package/dist/environment.d.ts +2 -2
- package/dist/errors/errors.d.ts +86 -55
- package/dist/errors/errors.js +36 -5
- package/dist/errors/exception.d.ts +3 -3
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/public.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/instance.d.ts +53 -9
- package/dist/instance.js +6 -2
- package/dist/mappers/dependencies.d.ts +3 -0
- package/dist/mappers/dependencies.js +44 -0
- package/dist/mappers/index.d.ts +2 -2
- package/dist/mappers/index.js +2 -1
- package/dist/mappers/instance.js +26 -21
- package/dist/mappers/order.js +4 -2
- package/dist/mappers/price.js +6 -4
- package/dist/mappers/render/option.d.ts +1 -0
- package/dist/mappers/render/option.js +1 -0
- package/dist/mappers/variants/index.d.ts +1 -2
- package/dist/mappers/variants/index.js +1 -2
- package/dist/mappers/variants/option-graph.d.ts +1 -2
- package/dist/mappers/variants/option-graph.js +3 -17
- package/dist/mappers/variants/variants.d.ts +3 -6
- package/dist/mappers/variants/variants.js +34 -11
- package/dist/primitive.d.ts +3 -0
- package/dist/primitive.js +2 -0
- package/dist/public.d.ts +8 -8
- package/dist/public.js +1 -1
- package/dist/validate/builder.d.ts +2 -2
- package/dist/validate/builder.js +15 -15
- package/dist/validate/expectations.d.ts +2 -2
- package/dist/validate/expectations.js +3 -3
- package/dist/validate/instance.d.ts +2 -2
- package/dist/validate/instance.js +31 -13
- package/dist/validate/model.d.ts +4 -4
- package/dist/validate/model.js +51 -42
- package/dist/validate/paths.d.ts +2 -2
- package/dist/validate/paths.js +19 -14
- package/dist/validate/pricing.d.ts +4 -4
- package/dist/validate/pricing.js +31 -31
- package/dist/validate/resolve.d.ts +2 -2
- package/dist/validate/resolve.js +18 -18
- package/dist/validate/ui.d.ts +4 -4
- package/dist/validate/ui.js +38 -38
- package/dist/validate/variants.d.ts +3 -3
- package/dist/validate/variants.js +32 -31
- package/package.json +9 -5
- package/dist/entities/component/field.d.ts +0 -59
- package/dist/entities/component/field.js +0 -52
|
@@ -18,7 +18,7 @@ export declare class BuilderComponent<const Name extends string = string, const
|
|
|
18
18
|
export declare const BuilderComponentSchema: v.InstanceSchema<typeof BuilderComponent, undefined>;
|
|
19
19
|
export type BuilderComponents = ReadonlyArray<BuilderComponent>;
|
|
20
20
|
export declare const BuilderComponentWhenSerialisedSchema: v.GenericSchema<BuilderWhenSerialised<Readonly<{
|
|
21
|
-
|
|
21
|
+
details: Readonly<{
|
|
22
22
|
type: "parameter";
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
|
@@ -26,9 +26,9 @@ export declare const BuilderComponentWhenSerialisedSchema: v.GenericSchema<Build
|
|
|
26
26
|
type: "ref";
|
|
27
27
|
id: string;
|
|
28
28
|
}> | readonly Readonly<{
|
|
29
|
-
type: "component-
|
|
29
|
+
type: "component-detail";
|
|
30
30
|
name: string;
|
|
31
|
-
|
|
31
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
32
32
|
isOptional: boolean;
|
|
33
33
|
tags?: readonly string[] | undefined;
|
|
34
34
|
}>[];
|
|
@@ -40,7 +40,7 @@ export declare const BuilderComponentSelectMapSerialisedSchema: v.GenericSchema<
|
|
|
40
40
|
id: string;
|
|
41
41
|
name: string;
|
|
42
42
|
}> | Readonly<{
|
|
43
|
-
|
|
43
|
+
details: Readonly<{
|
|
44
44
|
type: "parameter";
|
|
45
45
|
id: string;
|
|
46
46
|
name: string;
|
|
@@ -48,9 +48,9 @@ export declare const BuilderComponentSelectMapSerialisedSchema: v.GenericSchema<
|
|
|
48
48
|
type: "ref";
|
|
49
49
|
id: string;
|
|
50
50
|
}> | readonly Readonly<{
|
|
51
|
-
type: "component-
|
|
51
|
+
type: "component-detail";
|
|
52
52
|
name: string;
|
|
53
|
-
|
|
53
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
54
54
|
isOptional: boolean;
|
|
55
55
|
tags?: readonly string[] | undefined;
|
|
56
56
|
}>[];
|
|
@@ -73,7 +73,7 @@ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
73
73
|
type: "ref";
|
|
74
74
|
id: string;
|
|
75
75
|
}>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
76
|
-
readonly
|
|
76
|
+
readonly details: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
77
77
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
78
78
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
79
79
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -88,27 +88,27 @@ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
88
88
|
type: "ref";
|
|
89
89
|
id: string;
|
|
90
90
|
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
91
|
-
readonly type: v.LiteralSchema<"component-
|
|
91
|
+
readonly type: v.LiteralSchema<"component-detail", undefined>;
|
|
92
92
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
93
|
-
readonly
|
|
93
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number", "price", "image"], undefined>;
|
|
94
94
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
95
95
|
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>;
|
|
96
96
|
}, undefined>, v.ReadonlyAction<{
|
|
97
|
-
type: "component-
|
|
97
|
+
type: "component-detail";
|
|
98
98
|
name: string;
|
|
99
|
-
|
|
99
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
100
100
|
isOptional: boolean;
|
|
101
101
|
tags?: readonly string[] | undefined;
|
|
102
102
|
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
103
|
-
type: "component-
|
|
103
|
+
type: "component-detail";
|
|
104
104
|
name: string;
|
|
105
|
-
|
|
105
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
106
106
|
isOptional: boolean;
|
|
107
107
|
tags?: readonly string[] | undefined;
|
|
108
108
|
}>[]>]>], undefined>;
|
|
109
109
|
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>;
|
|
110
110
|
}, undefined>, v.ReadonlyAction<{
|
|
111
|
-
|
|
111
|
+
details: Readonly<{
|
|
112
112
|
type: "parameter";
|
|
113
113
|
id: string;
|
|
114
114
|
name: string;
|
|
@@ -116,15 +116,15 @@ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
116
116
|
type: "ref";
|
|
117
117
|
id: string;
|
|
118
118
|
}> | readonly Readonly<{
|
|
119
|
-
type: "component-
|
|
119
|
+
type: "component-detail";
|
|
120
120
|
name: string;
|
|
121
|
-
|
|
121
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
122
122
|
isOptional: boolean;
|
|
123
123
|
tags?: readonly string[] | undefined;
|
|
124
124
|
}>[];
|
|
125
125
|
tags?: readonly string[] | undefined;
|
|
126
126
|
}>]>, v.GenericSchema<BuilderWhenSerialised<Readonly<{
|
|
127
|
-
|
|
127
|
+
details: Readonly<{
|
|
128
128
|
type: "parameter";
|
|
129
129
|
id: string;
|
|
130
130
|
name: string;
|
|
@@ -132,9 +132,9 @@ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
132
132
|
type: "ref";
|
|
133
133
|
id: string;
|
|
134
134
|
}> | readonly Readonly<{
|
|
135
|
-
type: "component-
|
|
135
|
+
type: "component-detail";
|
|
136
136
|
name: string;
|
|
137
|
-
|
|
137
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
138
138
|
isOptional: boolean;
|
|
139
139
|
tags?: readonly string[] | undefined;
|
|
140
140
|
}>[];
|
|
@@ -166,7 +166,7 @@ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
166
166
|
type: "ref";
|
|
167
167
|
id: string;
|
|
168
168
|
}> | Readonly<{
|
|
169
|
-
|
|
169
|
+
details: Readonly<{
|
|
170
170
|
type: "parameter";
|
|
171
171
|
id: string;
|
|
172
172
|
name: string;
|
|
@@ -174,15 +174,15 @@ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
174
174
|
type: "ref";
|
|
175
175
|
id: string;
|
|
176
176
|
}> | readonly Readonly<{
|
|
177
|
-
type: "component-
|
|
177
|
+
type: "component-detail";
|
|
178
178
|
name: string;
|
|
179
|
-
|
|
179
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
180
180
|
isOptional: boolean;
|
|
181
181
|
tags?: readonly string[] | undefined;
|
|
182
182
|
}>[];
|
|
183
183
|
tags?: readonly string[] | undefined;
|
|
184
184
|
}> | BuilderWhenSerialised<Readonly<{
|
|
185
|
-
|
|
185
|
+
details: Readonly<{
|
|
186
186
|
type: "parameter";
|
|
187
187
|
id: string;
|
|
188
188
|
name: string;
|
|
@@ -190,9 +190,9 @@ export declare const BuilderComponentSerialisedSchema: v.SchemaWithPipe<readonly
|
|
|
190
190
|
type: "ref";
|
|
191
191
|
id: string;
|
|
192
192
|
}> | readonly Readonly<{
|
|
193
|
-
type: "component-
|
|
193
|
+
type: "component-detail";
|
|
194
194
|
name: string;
|
|
195
|
-
|
|
195
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
196
196
|
isOptional: boolean;
|
|
197
197
|
tags?: readonly string[] | undefined;
|
|
198
198
|
}>[];
|
|
@@ -226,7 +226,7 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
226
226
|
type: "ref";
|
|
227
227
|
id: string;
|
|
228
228
|
}>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
229
|
-
readonly
|
|
229
|
+
readonly details: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
230
230
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
231
231
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
232
232
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -241,27 +241,27 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
241
241
|
type: "ref";
|
|
242
242
|
id: string;
|
|
243
243
|
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
244
|
-
readonly type: v.LiteralSchema<"component-
|
|
244
|
+
readonly type: v.LiteralSchema<"component-detail", undefined>;
|
|
245
245
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
246
|
-
readonly
|
|
246
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number", "price", "image"], undefined>;
|
|
247
247
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
248
248
|
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>;
|
|
249
249
|
}, undefined>, v.ReadonlyAction<{
|
|
250
|
-
type: "component-
|
|
250
|
+
type: "component-detail";
|
|
251
251
|
name: string;
|
|
252
|
-
|
|
252
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
253
253
|
isOptional: boolean;
|
|
254
254
|
tags?: readonly string[] | undefined;
|
|
255
255
|
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
256
|
-
type: "component-
|
|
256
|
+
type: "component-detail";
|
|
257
257
|
name: string;
|
|
258
|
-
|
|
258
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
259
259
|
isOptional: boolean;
|
|
260
260
|
tags?: readonly string[] | undefined;
|
|
261
261
|
}>[]>]>], undefined>;
|
|
262
262
|
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>;
|
|
263
263
|
}, undefined>, v.ReadonlyAction<{
|
|
264
|
-
|
|
264
|
+
details: Readonly<{
|
|
265
265
|
type: "parameter";
|
|
266
266
|
id: string;
|
|
267
267
|
name: string;
|
|
@@ -269,15 +269,15 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
269
269
|
type: "ref";
|
|
270
270
|
id: string;
|
|
271
271
|
}> | readonly Readonly<{
|
|
272
|
-
type: "component-
|
|
272
|
+
type: "component-detail";
|
|
273
273
|
name: string;
|
|
274
|
-
|
|
274
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
275
275
|
isOptional: boolean;
|
|
276
276
|
tags?: readonly string[] | undefined;
|
|
277
277
|
}>[];
|
|
278
278
|
tags?: readonly string[] | undefined;
|
|
279
279
|
}>]>, v.GenericSchema<BuilderWhenSerialised<Readonly<{
|
|
280
|
-
|
|
280
|
+
details: Readonly<{
|
|
281
281
|
type: "parameter";
|
|
282
282
|
id: string;
|
|
283
283
|
name: string;
|
|
@@ -285,9 +285,9 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
285
285
|
type: "ref";
|
|
286
286
|
id: string;
|
|
287
287
|
}> | readonly Readonly<{
|
|
288
|
-
type: "component-
|
|
288
|
+
type: "component-detail";
|
|
289
289
|
name: string;
|
|
290
|
-
|
|
290
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
291
291
|
isOptional: boolean;
|
|
292
292
|
tags?: readonly string[] | undefined;
|
|
293
293
|
}>[];
|
|
@@ -319,7 +319,7 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
319
319
|
type: "ref";
|
|
320
320
|
id: string;
|
|
321
321
|
}> | Readonly<{
|
|
322
|
-
|
|
322
|
+
details: Readonly<{
|
|
323
323
|
type: "parameter";
|
|
324
324
|
id: string;
|
|
325
325
|
name: string;
|
|
@@ -327,15 +327,15 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
327
327
|
type: "ref";
|
|
328
328
|
id: string;
|
|
329
329
|
}> | readonly Readonly<{
|
|
330
|
-
type: "component-
|
|
330
|
+
type: "component-detail";
|
|
331
331
|
name: string;
|
|
332
|
-
|
|
332
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
333
333
|
isOptional: boolean;
|
|
334
334
|
tags?: readonly string[] | undefined;
|
|
335
335
|
}>[];
|
|
336
336
|
tags?: readonly string[] | undefined;
|
|
337
337
|
}> | BuilderWhenSerialised<Readonly<{
|
|
338
|
-
|
|
338
|
+
details: Readonly<{
|
|
339
339
|
type: "parameter";
|
|
340
340
|
id: string;
|
|
341
341
|
name: string;
|
|
@@ -343,9 +343,9 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
343
343
|
type: "ref";
|
|
344
344
|
id: string;
|
|
345
345
|
}> | readonly Readonly<{
|
|
346
|
-
type: "component-
|
|
346
|
+
type: "component-detail";
|
|
347
347
|
name: string;
|
|
348
|
-
|
|
348
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
349
349
|
isOptional: boolean;
|
|
350
350
|
tags?: readonly string[] | undefined;
|
|
351
351
|
}>[];
|
|
@@ -370,7 +370,7 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
370
370
|
type: "ref";
|
|
371
371
|
id: string;
|
|
372
372
|
}> | Readonly<{
|
|
373
|
-
|
|
373
|
+
details: Readonly<{
|
|
374
374
|
type: "parameter";
|
|
375
375
|
id: string;
|
|
376
376
|
name: string;
|
|
@@ -378,15 +378,15 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
378
378
|
type: "ref";
|
|
379
379
|
id: string;
|
|
380
380
|
}> | readonly Readonly<{
|
|
381
|
-
type: "component-
|
|
381
|
+
type: "component-detail";
|
|
382
382
|
name: string;
|
|
383
|
-
|
|
383
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
384
384
|
isOptional: boolean;
|
|
385
385
|
tags?: readonly string[] | undefined;
|
|
386
386
|
}>[];
|
|
387
387
|
tags?: readonly string[] | undefined;
|
|
388
388
|
}> | BuilderWhenSerialised<Readonly<{
|
|
389
|
-
|
|
389
|
+
details: Readonly<{
|
|
390
390
|
type: "parameter";
|
|
391
391
|
id: string;
|
|
392
392
|
name: string;
|
|
@@ -394,9 +394,9 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
394
394
|
type: "ref";
|
|
395
395
|
id: string;
|
|
396
396
|
}> | readonly Readonly<{
|
|
397
|
-
type: "component-
|
|
397
|
+
type: "component-detail";
|
|
398
398
|
name: string;
|
|
399
|
-
|
|
399
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
400
400
|
isOptional: boolean;
|
|
401
401
|
tags?: readonly string[] | undefined;
|
|
402
402
|
}>[];
|
|
@@ -413,13 +413,13 @@ export declare const BuilderComponentsSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
413
413
|
tags?: readonly string[] | undefined;
|
|
414
414
|
}>[]>]>;
|
|
415
415
|
export type BuilderComponentsSerialised = v.InferOutput<typeof BuilderComponentsSerialisedSchema>;
|
|
416
|
-
export declare const validateComponentWhen: (input: unknown, references?: import("..").BuilderReferences,
|
|
416
|
+
export declare const validateComponentWhen: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors").BuilderIssuesScope) => import("..").ValidationResult<{
|
|
417
417
|
readonly type: "enable";
|
|
418
418
|
readonly payload: {
|
|
419
|
-
readonly
|
|
420
|
-
readonly type: "component-
|
|
419
|
+
readonly details: readonly {
|
|
420
|
+
readonly type: "component-detail";
|
|
421
421
|
readonly name: string;
|
|
422
|
-
readonly
|
|
422
|
+
readonly kind: "string" | "number" | "boolean" | "price" | "image";
|
|
423
423
|
readonly isOptional: boolean;
|
|
424
424
|
readonly tags?: readonly string[] | undefined;
|
|
425
425
|
}[];
|
|
@@ -430,10 +430,10 @@ export declare const validateComponentWhen: (input: unknown, references?: import
|
|
|
430
430
|
readonly matchPath: readonly (string | number)[];
|
|
431
431
|
readonly selectMap: {
|
|
432
432
|
readonly [x: string]: {
|
|
433
|
-
readonly
|
|
434
|
-
readonly type: "component-
|
|
433
|
+
readonly details: readonly {
|
|
434
|
+
readonly type: "component-detail";
|
|
435
435
|
readonly name: string;
|
|
436
|
-
readonly
|
|
436
|
+
readonly kind: "string" | "number" | "boolean" | "price" | "image";
|
|
437
437
|
readonly isOptional: boolean;
|
|
438
438
|
readonly tags?: readonly string[] | undefined;
|
|
439
439
|
}[];
|
|
@@ -445,22 +445,22 @@ export declare const validateComponentWhen: (input: unknown, references?: import
|
|
|
445
445
|
readonly unlessPath: readonly (string | number)[];
|
|
446
446
|
readonly disabledValues: readonly (string | number | boolean | null)[];
|
|
447
447
|
readonly payload: {
|
|
448
|
-
readonly
|
|
449
|
-
readonly type: "component-
|
|
448
|
+
readonly details: readonly {
|
|
449
|
+
readonly type: "component-detail";
|
|
450
450
|
readonly name: string;
|
|
451
|
-
readonly
|
|
451
|
+
readonly kind: "string" | "number" | "boolean" | "price" | "image";
|
|
452
452
|
readonly isOptional: boolean;
|
|
453
453
|
readonly tags?: readonly string[] | undefined;
|
|
454
454
|
}[];
|
|
455
455
|
readonly tags?: readonly string[] | undefined;
|
|
456
456
|
};
|
|
457
457
|
}>;
|
|
458
|
-
export declare const validateComponentSelectMap: (input: unknown, references?: import("..").BuilderReferences,
|
|
458
|
+
export declare const validateComponentSelectMap: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors").BuilderIssuesScope) => import("..").ValidationResult<{
|
|
459
459
|
readonly [x: string]: {
|
|
460
|
-
readonly
|
|
461
|
-
readonly type: "component-
|
|
460
|
+
readonly details: readonly {
|
|
461
|
+
readonly type: "component-detail";
|
|
462
462
|
readonly name: string;
|
|
463
|
-
readonly
|
|
463
|
+
readonly kind: "string" | "number" | "boolean" | "price" | "image";
|
|
464
464
|
readonly isOptional: boolean;
|
|
465
465
|
readonly tags?: readonly string[] | undefined;
|
|
466
466
|
}[];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Paramable } from '../../references';
|
|
2
2
|
import type { BuilderTags } from '../tags';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BuilderComponentDetails } from './detail';
|
|
4
4
|
import * as v from 'valibot';
|
|
5
|
-
export declare class BuilderComponentConfig<const
|
|
5
|
+
export declare class BuilderComponentConfig<const Details extends Paramable<BuilderComponentDetails> = Paramable<BuilderComponentDetails>> {
|
|
6
6
|
readonly type: 'component-config';
|
|
7
|
-
readonly
|
|
7
|
+
readonly details: Details;
|
|
8
8
|
readonly tags?: BuilderTags;
|
|
9
|
-
constructor(
|
|
10
|
-
tag(...tags: Array<string>): BuilderComponentConfig<
|
|
9
|
+
constructor(details: Details, tags?: BuilderTags);
|
|
10
|
+
tag(...tags: Array<string>): BuilderComponentConfig<Details>;
|
|
11
11
|
}
|
|
12
12
|
export declare const BuilderComponentConfigSchema: v.InstanceSchema<typeof BuilderComponentConfig, undefined>;
|
|
13
13
|
export declare const BuilderComponentConfigSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
14
|
-
readonly
|
|
14
|
+
readonly details: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
15
15
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
16
16
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
17
17
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -26,27 +26,27 @@ export declare const BuilderComponentConfigSerialisedSchema: v.SchemaWithPipe<re
|
|
|
26
26
|
type: "ref";
|
|
27
27
|
id: string;
|
|
28
28
|
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
29
|
-
readonly type: v.LiteralSchema<"component-
|
|
29
|
+
readonly type: v.LiteralSchema<"component-detail", undefined>;
|
|
30
30
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
31
|
-
readonly
|
|
31
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number", "price", "image"], undefined>;
|
|
32
32
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
33
33
|
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>;
|
|
34
34
|
}, undefined>, v.ReadonlyAction<{
|
|
35
|
-
type: "component-
|
|
35
|
+
type: "component-detail";
|
|
36
36
|
name: string;
|
|
37
|
-
|
|
37
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
38
38
|
isOptional: boolean;
|
|
39
39
|
tags?: readonly string[] | undefined;
|
|
40
40
|
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
41
|
-
type: "component-
|
|
41
|
+
type: "component-detail";
|
|
42
42
|
name: string;
|
|
43
|
-
|
|
43
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
44
44
|
isOptional: boolean;
|
|
45
45
|
tags?: readonly string[] | undefined;
|
|
46
46
|
}>[]>]>], undefined>;
|
|
47
47
|
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>;
|
|
48
48
|
}, undefined>, v.ReadonlyAction<{
|
|
49
|
-
|
|
49
|
+
details: Readonly<{
|
|
50
50
|
type: "parameter";
|
|
51
51
|
id: string;
|
|
52
52
|
name: string;
|
|
@@ -54,9 +54,9 @@ export declare const BuilderComponentConfigSerialisedSchema: v.SchemaWithPipe<re
|
|
|
54
54
|
type: "ref";
|
|
55
55
|
id: string;
|
|
56
56
|
}> | readonly Readonly<{
|
|
57
|
-
type: "component-
|
|
57
|
+
type: "component-detail";
|
|
58
58
|
name: string;
|
|
59
|
-
|
|
59
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
60
60
|
isOptional: boolean;
|
|
61
61
|
tags?: readonly string[] | undefined;
|
|
62
62
|
}>[];
|
|
@@ -64,7 +64,7 @@ export declare const BuilderComponentConfigSerialisedSchema: v.SchemaWithPipe<re
|
|
|
64
64
|
}>]>;
|
|
65
65
|
export type BuilderComponentConfigSerialised = v.InferOutput<typeof BuilderComponentConfigSerialisedSchema>;
|
|
66
66
|
export declare const BuilderComponentConfigsSerialisedSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
67
|
-
readonly
|
|
67
|
+
readonly details: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
68
68
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
69
69
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
70
70
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -79,27 +79,27 @@ export declare const BuilderComponentConfigsSerialisedSchema: v.SchemaWithPipe<r
|
|
|
79
79
|
type: "ref";
|
|
80
80
|
id: string;
|
|
81
81
|
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
82
|
-
readonly type: v.LiteralSchema<"component-
|
|
82
|
+
readonly type: v.LiteralSchema<"component-detail", undefined>;
|
|
83
83
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
84
|
-
readonly
|
|
84
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number", "price", "image"], undefined>;
|
|
85
85
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
86
86
|
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>;
|
|
87
87
|
}, undefined>, v.ReadonlyAction<{
|
|
88
|
-
type: "component-
|
|
88
|
+
type: "component-detail";
|
|
89
89
|
name: string;
|
|
90
|
-
|
|
90
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
91
91
|
isOptional: boolean;
|
|
92
92
|
tags?: readonly string[] | undefined;
|
|
93
93
|
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
94
|
-
type: "component-
|
|
94
|
+
type: "component-detail";
|
|
95
95
|
name: string;
|
|
96
|
-
|
|
96
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
97
97
|
isOptional: boolean;
|
|
98
98
|
tags?: readonly string[] | undefined;
|
|
99
99
|
}>[]>]>], undefined>;
|
|
100
100
|
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>;
|
|
101
101
|
}, undefined>, v.ReadonlyAction<{
|
|
102
|
-
|
|
102
|
+
details: Readonly<{
|
|
103
103
|
type: "parameter";
|
|
104
104
|
id: string;
|
|
105
105
|
name: string;
|
|
@@ -107,15 +107,15 @@ export declare const BuilderComponentConfigsSerialisedSchema: v.SchemaWithPipe<r
|
|
|
107
107
|
type: "ref";
|
|
108
108
|
id: string;
|
|
109
109
|
}> | readonly Readonly<{
|
|
110
|
-
type: "component-
|
|
110
|
+
type: "component-detail";
|
|
111
111
|
name: string;
|
|
112
|
-
|
|
112
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
113
113
|
isOptional: boolean;
|
|
114
114
|
tags?: readonly string[] | undefined;
|
|
115
115
|
}>[];
|
|
116
116
|
tags?: readonly string[] | undefined;
|
|
117
117
|
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
118
|
-
|
|
118
|
+
details: Readonly<{
|
|
119
119
|
type: "parameter";
|
|
120
120
|
id: string;
|
|
121
121
|
name: string;
|
|
@@ -123,21 +123,21 @@ export declare const BuilderComponentConfigsSerialisedSchema: v.SchemaWithPipe<r
|
|
|
123
123
|
type: "ref";
|
|
124
124
|
id: string;
|
|
125
125
|
}> | readonly Readonly<{
|
|
126
|
-
type: "component-
|
|
126
|
+
type: "component-detail";
|
|
127
127
|
name: string;
|
|
128
|
-
|
|
128
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
129
129
|
isOptional: boolean;
|
|
130
130
|
tags?: readonly string[] | undefined;
|
|
131
131
|
}>[];
|
|
132
132
|
tags?: readonly string[] | undefined;
|
|
133
133
|
}>[]>]>;
|
|
134
134
|
export type BuilderComponentConfigsSerialised = v.InferOutput<typeof BuilderComponentConfigsSerialisedSchema>;
|
|
135
|
-
export declare function componentConfig<const
|
|
136
|
-
export declare const validateComponentConfig: (input: unknown, references?: import("..").BuilderReferences,
|
|
137
|
-
readonly
|
|
138
|
-
readonly type: "component-
|
|
135
|
+
export declare function componentConfig<const Details extends BuilderComponentDetails>(...details: Details): BuilderComponentConfig<Details>;
|
|
136
|
+
export declare const validateComponentConfig: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors/errors").BuilderIssuesScope) => import("..").ValidationResult<{
|
|
137
|
+
readonly details: readonly {
|
|
138
|
+
readonly type: "component-detail";
|
|
139
139
|
readonly name: string;
|
|
140
|
-
readonly
|
|
140
|
+
readonly kind: "string" | "number" | "boolean" | "price" | "image";
|
|
141
141
|
readonly isOptional: boolean;
|
|
142
142
|
readonly tags?: readonly string[] | undefined;
|
|
143
143
|
}[];
|
|
@@ -4,39 +4,41 @@ import { paramable } from '../../references.js';
|
|
|
4
4
|
import { createEntityValidator } from '../kind.js';
|
|
5
5
|
import { serialisable } from '../serialisable.js';
|
|
6
6
|
import { BuilderTagsSchema } from '../tags.js';
|
|
7
|
-
import {
|
|
7
|
+
import { BuilderComponentDetailsSerialisedSchema } from './detail.js';
|
|
8
8
|
export class BuilderComponentConfig {
|
|
9
|
-
|
|
9
|
+
details;
|
|
10
10
|
tags;
|
|
11
|
-
constructor(
|
|
12
|
-
this.
|
|
11
|
+
constructor(details, tags) {
|
|
12
|
+
this.details = details;
|
|
13
13
|
this.tags = tags;
|
|
14
14
|
}
|
|
15
15
|
tag(...tags) {
|
|
16
|
-
return new BuilderComponentConfig(this.
|
|
16
|
+
return new BuilderComponentConfig(this.details, tags);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
export const BuilderComponentConfigSchema = v.instance(BuilderComponentConfig);
|
|
20
20
|
export const BuilderComponentConfigSerialisedSchema = serialisable(v.object({
|
|
21
|
-
|
|
21
|
+
details: paramable(BuilderComponentDetailsSerialisedSchema),
|
|
22
22
|
tags: v.optional(BuilderTagsSchema)
|
|
23
23
|
}));
|
|
24
24
|
export const BuilderComponentConfigsSerialisedSchema = v.pipe(v.array(BuilderComponentConfigSerialisedSchema), v.readonly());
|
|
25
|
-
export function componentConfig(...
|
|
26
|
-
return new BuilderComponentConfig(
|
|
25
|
+
export function componentConfig(...details) {
|
|
26
|
+
return new BuilderComponentConfig(details);
|
|
27
27
|
}
|
|
28
28
|
export const validateComponentConfig = createEntityValidator('componentConfig', BuilderComponentConfigSerialisedSchema, (input, errors) => {
|
|
29
|
-
if (!check.is(
|
|
29
|
+
if (!check.is(BuilderComponentDetailsSerialisedSchema, input.details)) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const seenNames = new Set();
|
|
33
|
+
const seenKinds = new Set();
|
|
34
|
+
input.details.forEach((detail) => {
|
|
35
|
+
if (seenNames.has(detail.name)) {
|
|
36
|
+
errors.entityDuplicateDetail();
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
seenNames.add(detail.name);
|
|
39
|
+
if (detail.kind === 'price' && seenKinds.has(detail.kind)) {
|
|
40
|
+
errors.entityDuplicatePrice();
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
seenKinds.add(detail.kind);
|
|
41
43
|
});
|
|
42
44
|
});
|