@builder-builder/builder 0.0.27 → 0.0.29
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 +9 -10
- 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 +126 -45
- package/dist/client/schema.js +6 -1
- package/dist/components/BuilderOption.svelte.d.ts +12 -12
- package/dist/components/BuilderOptionValueBoolean.svelte.d.ts +20 -0
- package/dist/components/BuilderOptionValueNumber.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionValueSelect.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionValueString.svelte.d.ts +21 -0
- package/dist/components/BuilderRender.svelte.d.ts +2 -2
- package/dist/components/index.d.ts +8 -8
- package/dist/components/index.js +4376 -4258
- package/dist/components/index.min.js +3 -0
- package/dist/entities/collection/collection.d.ts +191 -401
- package/dist/entities/collection/collection.js +7 -4
- package/dist/entities/collection/{when.d.ts → condition.d.ts} +4 -5
- package/dist/entities/collection/condition.js +2 -0
- package/dist/entities/collection/config.d.ts +62 -80
- package/dist/entities/collection/index.d.ts +4 -4
- package/dist/entities/collection/index.js +2 -2
- package/dist/entities/component/component.d.ts +71 -83
- package/dist/entities/component/component.js +4 -4
- package/dist/entities/component/condition.d.ts +10 -0
- package/dist/entities/component/{when.js → condition.js} +3 -9
- 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 +6 -6
- package/dist/entities/component/index.js +3 -3
- package/dist/entities/{when.d.ts → condition.d.ts} +23 -36
- package/dist/entities/{when.js → condition.js} +20 -25
- package/dist/entities/expectation.d.ts +135 -3
- package/dist/entities/expectation.js +6 -2
- package/dist/entities/index.d.ts +9 -9
- package/dist/entities/index.js +4 -4
- package/dist/entities/kind.d.ts +4 -4
- package/dist/entities/kind.js +24 -25
- package/dist/entities/model/bind.d.ts +5 -5
- package/dist/entities/model/methods.d.ts +18 -27
- package/dist/entities/model/methods.js +4 -22
- package/dist/entities/model/model.d.ts +3 -1
- package/dist/entities/model/model.js +25 -27
- package/dist/entities/option/condition.d.ts +9 -0
- package/dist/entities/option/condition.js +2 -0
- package/dist/entities/option/config.d.ts +47 -72
- package/dist/entities/option/config.js +6 -6
- package/dist/entities/option/expectation.d.ts +6 -1
- package/dist/entities/option/expectation.js +2 -2
- package/dist/entities/option/index.d.ts +8 -8
- package/dist/entities/option/index.js +4 -4
- package/dist/entities/option/option.d.ts +179 -210
- package/dist/entities/option/option.js +4 -4
- package/dist/entities/option/select.d.ts +16 -43
- package/dist/entities/option/select.js +8 -31
- package/dist/entities/option/value.d.ts +73 -0
- package/dist/entities/option/value.js +99 -0
- 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 +124 -84
- package/dist/entities/serialise.d.ts +175 -109
- package/dist/entities/serialise.js +32 -27
- package/dist/entities/ui/describe.d.ts +1 -1
- package/dist/entities/ui/input.d.ts +2 -2
- package/dist/entities/ui/page.d.ts +1 -1
- package/dist/entities/ui/pages.d.ts +2 -2
- package/dist/entities/validated.d.ts +3 -3
- package/dist/environment.d.ts +2 -2
- package/dist/errors/errors.d.ts +94 -58
- package/dist/errors/errors.js +41 -7
- 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 +45 -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/price.js +6 -4
- package/dist/mappers/resolve.js +23 -22
- 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 +4 -18
- 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 +20 -20
- package/dist/public.js +17 -9
- 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 +23 -5
- 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 +57 -51
- 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 +27 -31
- 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 +4 -2
- package/dist/components/BuilderOptionSelect.svelte.d.ts +0 -21
- package/dist/components/BuilderOptionToggleBoolean.svelte.d.ts +0 -20
- package/dist/components/BuilderOptionToggleNumber.svelte.d.ts +0 -21
- package/dist/components/BuilderOptionToggleString.svelte.d.ts +0 -21
- package/dist/entities/collection/when.js +0 -2
- package/dist/entities/component/field.d.ts +0 -59
- package/dist/entities/component/field.js +0 -52
- package/dist/entities/component/when.d.ts +0 -11
- package/dist/entities/option/toggle.d.ts +0 -45
- package/dist/entities/option/toggle.js +0 -66
- package/dist/entities/option/when.d.ts +0 -10
- package/dist/entities/option/when.js +0 -2
package/dist/bb.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validateBoolean, validateCollectionConfig, validateCollectionSelectMap,
|
|
1
|
+
import { validateBoolean, validateCollectionConfig, validateCollectionSelectMap, validateCollectionCondition, validateComponentConfig, validateComponentSelectMap, validateComponentCondition, validateExpectations, validateNumber, validateOptionSelectMap, validateOptionCondition, validatePath, validatePaths, validatePricingRates, validateString, validateValue, validateUIDescribe, validateUIInput, validateUIItems, validateUIPage, validateUIPages } from './entities/index.js';
|
|
2
2
|
import { BuilderException } from './errors/index.js';
|
|
3
3
|
import { createInstance, createVariants, order, price, render } from './mappers/index.js';
|
|
4
4
|
import { assertValidated, validateBuilder, validateInstance, validateModel, validatePricing, validateUI, validateVariants } from './validate/index.js';
|
|
@@ -18,16 +18,15 @@ function bbFactory(environment, references = []) {
|
|
|
18
18
|
validate: {
|
|
19
19
|
builder: (input) => throwInProd(validateBuilder(input, references)),
|
|
20
20
|
model: (input) => throwInProd(validateModel(input, references)),
|
|
21
|
-
|
|
22
|
-
toggle: (input) => throwInProd(validateToggle(input, references)),
|
|
21
|
+
value: (input) => throwInProd(validateValue(input, references)),
|
|
23
22
|
optionSelectMap: (input) => throwInProd(validateOptionSelectMap(input, references)),
|
|
24
|
-
|
|
23
|
+
optionCondition: (input) => throwInProd(validateOptionCondition(input, references)),
|
|
25
24
|
componentConfig: (input) => throwInProd(validateComponentConfig(input, references)),
|
|
26
25
|
componentSelectMap: (input) => throwInProd(validateComponentSelectMap(input, references)),
|
|
27
|
-
|
|
26
|
+
componentCondition: (input) => throwInProd(validateComponentCondition(input, references)),
|
|
28
27
|
collectionConfig: (input) => throwInProd(validateCollectionConfig(input, references)),
|
|
29
28
|
collectionSelectMap: (input) => throwInProd(validateCollectionSelectMap(input, references)),
|
|
30
|
-
|
|
29
|
+
collectionCondition: (input) => throwInProd(validateCollectionCondition(input, references)),
|
|
31
30
|
ui: (input) => throwInProd(validateUI(input, references)),
|
|
32
31
|
uiDescribe: (input) => throwInProd(validateUIDescribe(input, references)),
|
|
33
32
|
uiItems: (input) => throwInProd(validateUIItems(input, references)),
|
|
@@ -43,7 +42,7 @@ function bbFactory(environment, references = []) {
|
|
|
43
42
|
string: (input) => throwInProd(validateString(input, references)),
|
|
44
43
|
boolean: (input) => throwInProd(validateBoolean(input, references)),
|
|
45
44
|
instance: (model, instance) => throwInProd(validateInstance(model, instance)),
|
|
46
|
-
variants: (model, input, variantOptions) => throwInProd(validateVariants(model, input, variantOptions))
|
|
45
|
+
variants: (model, input, variantOptions) => throwInProd(validateVariants(model, input, variantOptions, references))
|
|
47
46
|
},
|
|
48
47
|
instance: (entity, partial) => {
|
|
49
48
|
assertValidated(entity);
|
|
@@ -66,17 +65,17 @@ function bbFactory(environment, references = []) {
|
|
|
66
65
|
},
|
|
67
66
|
variants: (entity) => {
|
|
68
67
|
assertValidated(entity);
|
|
69
|
-
return createVariants(entity);
|
|
68
|
+
return createVariants(entity, references);
|
|
70
69
|
}
|
|
71
70
|
};
|
|
72
71
|
function throwInProd(result) {
|
|
73
|
-
const [entity, errors] = result;
|
|
72
|
+
const [entity, errors, warnings] = result;
|
|
74
73
|
if (environment === 'development') {
|
|
75
74
|
return result;
|
|
76
75
|
}
|
|
77
76
|
if (errors.length > 0) {
|
|
78
77
|
throw new BuilderException({ category: 'validation', errors });
|
|
79
78
|
}
|
|
80
|
-
return [entity, []];
|
|
79
|
+
return [entity, [], warnings];
|
|
81
80
|
}
|
|
82
81
|
}
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { BuilderBuilderClientOptions, BuilderBuilderGetResponse, BuilderBuilderPriceResponse } from './schema.js';
|
|
2
1
|
import type { BuilderInstance } from '../instance.js';
|
|
2
|
+
import type { BuilderBuilderClientOptions, BuilderBuilderGetResponse, BuilderBuilderPriceResponse, BuilderBuilderVariantsResponse } from './schema.js';
|
|
3
3
|
export type BuilderBuilderClient = {
|
|
4
4
|
builder: {
|
|
5
5
|
get(id: string): Promise<BuilderBuilderGetResponse>;
|
|
6
|
+
variants(id: string): Promise<BuilderBuilderVariantsResponse>;
|
|
6
7
|
price(id: string, instance: BuilderInstance): Promise<BuilderBuilderPriceResponse>;
|
|
7
8
|
};
|
|
8
9
|
};
|
package/dist/client/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
import { BuilderException } from '../errors/index.js';
|
|
3
|
-
import { BuilderBuilderClientOptionsSchema, BuilderBuilderGetResponseSchema, BuilderBuilderPriceResponseSchema } from './schema.js';
|
|
3
|
+
import { BuilderBuilderClientOptionsSchema, BuilderBuilderGetResponseSchema, BuilderBuilderPriceResponseSchema, BuilderBuilderVariantsResponseSchema } from './schema.js';
|
|
4
4
|
export function client(options) {
|
|
5
5
|
const { url, apiKey, headers } = v.parse(BuilderBuilderClientOptionsSchema, options);
|
|
6
6
|
const baseHeaders = {
|
|
@@ -12,6 +12,9 @@ export function client(options) {
|
|
|
12
12
|
get: (id) => request(BuilderBuilderGetResponseSchema, `${url}/api/builder/${id}`, {
|
|
13
13
|
headers: baseHeaders
|
|
14
14
|
}),
|
|
15
|
+
variants: (id) => request(BuilderBuilderVariantsResponseSchema, `${url}/api/builder/${id}/variants`, {
|
|
16
|
+
headers: baseHeaders
|
|
17
|
+
}),
|
|
15
18
|
price: (id, instance) => request(BuilderBuilderPriceResponseSchema, `${url}/api/builder/${id}/price`, {
|
|
16
19
|
method: 'POST',
|
|
17
20
|
headers: {
|
package/dist/client/public.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { BuilderBuilderClientOptions, BuilderBuilderGetResponse, BuilderBuilderPriceRequest, BuilderBuilderPriceResponse } from './schema.js';
|
|
1
|
+
export type { BuilderBuilderClientOptions, BuilderBuilderGetResponse, BuilderBuilderPriceRequest, BuilderBuilderPriceResponse, BuilderBuilderVariantsRequest, BuilderBuilderVariantsResponse } from './schema.js';
|
|
2
2
|
export type { BuilderBuilderClient } from './client.js';
|
|
3
|
-
export { BuilderBuilderClientOptionsSchema, BuilderBuilderGetResponseSchema, BuilderBuilderPriceRequestSchema, BuilderBuilderPriceResponseSchema } from './schema.js';
|
|
3
|
+
export { BuilderBuilderClientOptionsSchema, BuilderBuilderGetResponseSchema, BuilderBuilderPriceRequestSchema, BuilderBuilderPriceResponseSchema, BuilderBuilderVariantsRequestSchema, BuilderBuilderVariantsResponseSchema } from './schema.js';
|
|
4
4
|
export { client } from './client.js';
|
package/dist/client/public.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BuilderBuilderClientOptionsSchema, BuilderBuilderGetResponseSchema, BuilderBuilderPriceRequestSchema, BuilderBuilderPriceResponseSchema } from './schema.js';
|
|
1
|
+
export { BuilderBuilderClientOptionsSchema, BuilderBuilderGetResponseSchema, BuilderBuilderPriceRequestSchema, BuilderBuilderPriceResponseSchema, BuilderBuilderVariantsRequestSchema, BuilderBuilderVariantsResponseSchema } from './schema.js';
|
|
2
2
|
export { client } from './client.js';
|
package/dist/client/schema.d.ts
CHANGED
|
@@ -11,17 +11,18 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
11
11
|
readonly references: v.ArraySchema<v.ObjectSchema<{
|
|
12
12
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
13
13
|
readonly serialised: v.GenericSchema<string | number | boolean | readonly (string | number)[] | readonly (readonly (string | number)[])[] | import("../public.js").BuilderSerialised | import("../public.js").BuilderModelSerialised | Readonly<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
defaultValue: string | null;
|
|
14
|
+
kind: "string" | "number" | "boolean";
|
|
15
|
+
type: "value";
|
|
16
|
+
defaultValue: string | number | boolean | null;
|
|
17
17
|
isOptional: boolean;
|
|
18
|
-
optionLabels: {
|
|
19
|
-
[x: string]: string;
|
|
20
|
-
};
|
|
21
18
|
tags?: readonly string[] | undefined;
|
|
22
19
|
}> | Readonly<{
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
kind: "select";
|
|
21
|
+
readonly options: readonly [string, ...string[]];
|
|
22
|
+
optionLabels?: {
|
|
23
|
+
[x: string]: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
type: "value";
|
|
25
26
|
defaultValue: string | number | boolean | null;
|
|
26
27
|
isOptional: boolean;
|
|
27
28
|
tags?: readonly string[] | undefined;
|
|
@@ -29,38 +30,40 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
29
30
|
type: "parameter";
|
|
30
31
|
id: string;
|
|
31
32
|
name: string;
|
|
32
|
-
}> | Readonly<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
defaultValue: string | null;
|
|
33
|
+
}> | Readonly<{
|
|
34
|
+
kind: "string" | "number" | "boolean";
|
|
35
|
+
type: "value";
|
|
36
|
+
defaultValue: string | number | boolean | null;
|
|
36
37
|
isOptional: boolean;
|
|
37
|
-
|
|
38
|
+
tags?: readonly string[] | undefined;
|
|
39
|
+
}> | Readonly<{
|
|
40
|
+
kind: "select";
|
|
41
|
+
readonly options: readonly [string, ...string[]];
|
|
42
|
+
optionLabels?: {
|
|
38
43
|
[x: string]: string;
|
|
39
|
-
};
|
|
44
|
+
} | undefined;
|
|
45
|
+
type: "value";
|
|
46
|
+
defaultValue: string | number | boolean | null;
|
|
47
|
+
isOptional: boolean;
|
|
40
48
|
tags?: readonly string[] | undefined;
|
|
41
|
-
}>> |
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
}>> | import("../public.js").BuilderConditionSerialised<Readonly<{
|
|
50
|
+
kind: "string" | "number" | "boolean";
|
|
51
|
+
type: "value";
|
|
44
52
|
defaultValue: string | number | boolean | null;
|
|
45
53
|
isOptional: boolean;
|
|
46
54
|
tags?: readonly string[] | undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
55
|
+
}> | Readonly<{
|
|
56
|
+
kind: "select";
|
|
49
57
|
readonly options: readonly [string, ...string[]];
|
|
50
|
-
|
|
51
|
-
isOptional: boolean;
|
|
52
|
-
optionLabels: {
|
|
58
|
+
optionLabels?: {
|
|
53
59
|
[x: string]: string;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
}>> | Readonly<Readonly<{
|
|
57
|
-
type: "toggle";
|
|
58
|
-
valueType: "string" | "number" | "boolean";
|
|
60
|
+
} | undefined;
|
|
61
|
+
type: "value";
|
|
59
62
|
defaultValue: string | number | boolean | null;
|
|
60
63
|
isOptional: boolean;
|
|
61
64
|
tags?: readonly string[] | undefined;
|
|
62
|
-
}
|
|
63
|
-
|
|
65
|
+
}>> | Readonly<{
|
|
66
|
+
details: Readonly<{
|
|
64
67
|
type: "parameter";
|
|
65
68
|
id: string;
|
|
66
69
|
name: string;
|
|
@@ -68,9 +71,9 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
68
71
|
type: "ref";
|
|
69
72
|
id: string;
|
|
70
73
|
}> | readonly Readonly<{
|
|
71
|
-
type: "component-
|
|
74
|
+
type: "component-detail";
|
|
72
75
|
name: string;
|
|
73
|
-
|
|
76
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
74
77
|
isOptional: boolean;
|
|
75
78
|
tags?: readonly string[] | undefined;
|
|
76
79
|
}>[];
|
|
@@ -80,7 +83,7 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
80
83
|
id: string;
|
|
81
84
|
name: string;
|
|
82
85
|
}> | Readonly<{
|
|
83
|
-
|
|
86
|
+
details: Readonly<{
|
|
84
87
|
type: "parameter";
|
|
85
88
|
id: string;
|
|
86
89
|
name: string;
|
|
@@ -88,15 +91,15 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
88
91
|
type: "ref";
|
|
89
92
|
id: string;
|
|
90
93
|
}> | readonly Readonly<{
|
|
91
|
-
type: "component-
|
|
94
|
+
type: "component-detail";
|
|
92
95
|
name: string;
|
|
93
|
-
|
|
96
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
94
97
|
isOptional: boolean;
|
|
95
98
|
tags?: readonly string[] | undefined;
|
|
96
99
|
}>[];
|
|
97
100
|
tags?: readonly string[] | undefined;
|
|
98
|
-
}>> | import("../public.js").
|
|
99
|
-
|
|
101
|
+
}>> | import("../public.js").BuilderConditionSerialised<Readonly<{
|
|
102
|
+
details: Readonly<{
|
|
100
103
|
type: "parameter";
|
|
101
104
|
id: string;
|
|
102
105
|
name: string;
|
|
@@ -104,9 +107,9 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
104
107
|
type: "ref";
|
|
105
108
|
id: string;
|
|
106
109
|
}> | readonly Readonly<{
|
|
107
|
-
type: "component-
|
|
110
|
+
type: "component-detail";
|
|
108
111
|
name: string;
|
|
109
|
-
|
|
112
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
110
113
|
isOptional: boolean;
|
|
111
114
|
tags?: readonly string[] | undefined;
|
|
112
115
|
}>[];
|
|
@@ -167,7 +170,7 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
167
170
|
id: string;
|
|
168
171
|
}>;
|
|
169
172
|
tags?: readonly string[] | undefined;
|
|
170
|
-
}>> | import("../public.js").
|
|
173
|
+
}>> | import("../public.js").BuilderConditionSerialised<Readonly<{
|
|
171
174
|
model: Readonly<{
|
|
172
175
|
type: "parameter";
|
|
173
176
|
id: string;
|
|
@@ -390,36 +393,114 @@ export declare const BuilderBuilderGetResponseSchema: v.ObjectSchema<{
|
|
|
390
393
|
}> | import("../entities/index.js").BuilderUIItemSerialised)[] | import("../public.js").BuilderPricingSerialised | import("../entities/index.js").BuilderRates | readonly Readonly<{
|
|
391
394
|
name: string;
|
|
392
395
|
kind: "option" | "component" | "collection";
|
|
396
|
+
payload?: Readonly<{
|
|
397
|
+
kind: "string" | "number" | "boolean";
|
|
398
|
+
type: "value";
|
|
399
|
+
defaultValue: string | number | boolean | null;
|
|
400
|
+
isOptional: boolean;
|
|
401
|
+
tags?: readonly string[] | undefined;
|
|
402
|
+
}> | Readonly<{
|
|
403
|
+
kind: "select";
|
|
404
|
+
readonly options: readonly [string, ...string[]];
|
|
405
|
+
optionLabels?: {
|
|
406
|
+
[x: string]: string;
|
|
407
|
+
} | undefined;
|
|
408
|
+
type: "value";
|
|
409
|
+
defaultValue: string | number | boolean | null;
|
|
410
|
+
isOptional: boolean;
|
|
411
|
+
tags?: readonly string[] | undefined;
|
|
412
|
+
}> | undefined;
|
|
393
413
|
}>[]>;
|
|
394
414
|
}, undefined>, undefined>;
|
|
415
|
+
readonly environment: v.PicklistSchema<["development", "staging", "production"], undefined>;
|
|
416
|
+
}, undefined>;
|
|
417
|
+
export type BuilderBuilderGetResponse = v.InferOutput<typeof BuilderBuilderGetResponseSchema>;
|
|
418
|
+
export declare const BuilderBuilderVariantsResponseSchema: v.ObjectSchema<{
|
|
395
419
|
readonly variants: v.SchemaWithPipe<readonly [v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
396
420
|
readonly instance: v.GenericSchema<import("../instance.js").BuilderInstance>;
|
|
397
|
-
readonly details: v.OptionalSchema<v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.
|
|
421
|
+
readonly details: v.OptionalSchema<v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
422
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number", "price", "image"], undefined>;
|
|
423
|
+
readonly value: v.NullableSchema<v.NullableSchema<v.UnionSchema<[v.StringSchema<undefined>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, undefined>;
|
|
424
|
+
}, undefined>, v.ReadonlyAction<{
|
|
425
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
426
|
+
value: string | number | boolean | null;
|
|
427
|
+
}>]>, undefined>, undefined>;
|
|
398
428
|
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>;
|
|
399
429
|
}, undefined>, v.ReadonlyAction<{
|
|
400
430
|
instance: import("../instance.js").BuilderInstance;
|
|
401
431
|
details?: {
|
|
402
|
-
[x: string]:
|
|
432
|
+
readonly [x: string]: Readonly<{
|
|
433
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
434
|
+
value: string | number | boolean | null;
|
|
435
|
+
}>;
|
|
403
436
|
} | undefined;
|
|
404
437
|
tags?: readonly string[] | undefined;
|
|
405
438
|
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
406
439
|
instance: import("../instance.js").BuilderInstance;
|
|
407
440
|
details?: {
|
|
408
|
-
[x: string]:
|
|
441
|
+
readonly [x: string]: Readonly<{
|
|
442
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
443
|
+
value: string | number | boolean | null;
|
|
444
|
+
}>;
|
|
409
445
|
} | undefined;
|
|
410
446
|
tags?: readonly string[] | undefined;
|
|
411
447
|
}>[]>]>, undefined>, v.ReadonlyAction<{
|
|
412
448
|
readonly [x: string]: readonly Readonly<{
|
|
413
449
|
instance: import("../instance.js").BuilderInstance;
|
|
414
450
|
details?: {
|
|
415
|
-
[x: string]:
|
|
451
|
+
readonly [x: string]: Readonly<{
|
|
452
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
453
|
+
value: string | number | boolean | null;
|
|
454
|
+
}>;
|
|
416
455
|
} | undefined;
|
|
417
456
|
tags?: readonly string[] | undefined;
|
|
418
457
|
}>[];
|
|
419
458
|
}>]>;
|
|
420
|
-
readonly environment: v.PicklistSchema<["development", "staging", "production"], undefined>;
|
|
421
459
|
}, undefined>;
|
|
422
|
-
export type
|
|
460
|
+
export type BuilderBuilderVariantsResponse = v.InferOutput<typeof BuilderBuilderVariantsResponseSchema>;
|
|
461
|
+
export declare const BuilderBuilderVariantsRequestSchema: v.ObjectSchema<{
|
|
462
|
+
readonly variants: v.SchemaWithPipe<readonly [v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
463
|
+
readonly instance: v.GenericSchema<import("../instance.js").BuilderInstance>;
|
|
464
|
+
readonly details: v.OptionalSchema<v.RecordSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
465
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number", "price", "image"], undefined>;
|
|
466
|
+
readonly value: v.NullableSchema<v.NullableSchema<v.UnionSchema<[v.StringSchema<undefined>, v.BooleanSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, undefined>;
|
|
467
|
+
}, undefined>, v.ReadonlyAction<{
|
|
468
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
469
|
+
value: string | number | boolean | null;
|
|
470
|
+
}>]>, undefined>, undefined>;
|
|
471
|
+
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>;
|
|
472
|
+
}, undefined>, v.ReadonlyAction<{
|
|
473
|
+
instance: import("../instance.js").BuilderInstance;
|
|
474
|
+
details?: {
|
|
475
|
+
readonly [x: string]: Readonly<{
|
|
476
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
477
|
+
value: string | number | boolean | null;
|
|
478
|
+
}>;
|
|
479
|
+
} | undefined;
|
|
480
|
+
tags?: readonly string[] | undefined;
|
|
481
|
+
}>]>, undefined>, v.ReadonlyAction<Readonly<{
|
|
482
|
+
instance: import("../instance.js").BuilderInstance;
|
|
483
|
+
details?: {
|
|
484
|
+
readonly [x: string]: Readonly<{
|
|
485
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
486
|
+
value: string | number | boolean | null;
|
|
487
|
+
}>;
|
|
488
|
+
} | undefined;
|
|
489
|
+
tags?: readonly string[] | undefined;
|
|
490
|
+
}>[]>]>, undefined>, v.ReadonlyAction<{
|
|
491
|
+
readonly [x: string]: readonly Readonly<{
|
|
492
|
+
instance: import("../instance.js").BuilderInstance;
|
|
493
|
+
details?: {
|
|
494
|
+
readonly [x: string]: Readonly<{
|
|
495
|
+
kind: "string" | "number" | "boolean" | "price" | "image";
|
|
496
|
+
value: string | number | boolean | null;
|
|
497
|
+
}>;
|
|
498
|
+
} | undefined;
|
|
499
|
+
tags?: readonly string[] | undefined;
|
|
500
|
+
}>[];
|
|
501
|
+
}>]>;
|
|
502
|
+
}, undefined>;
|
|
503
|
+
export type BuilderBuilderVariantsRequest = v.InferOutput<typeof BuilderBuilderVariantsRequestSchema>;
|
|
423
504
|
export declare const BuilderBuilderPriceRequestSchema: v.ObjectSchema<{
|
|
424
505
|
readonly instance: v.GenericSchema<import("../instance.js").BuilderInstance>;
|
|
425
506
|
}, undefined>;
|
package/dist/client/schema.js
CHANGED
|
@@ -11,9 +11,14 @@ export const BuilderBuilderGetResponseSchema = v.object({
|
|
|
11
11
|
name: v.string(),
|
|
12
12
|
serialised: BuilderSerialisedSchema,
|
|
13
13
|
references: BuilderReferencesSchema,
|
|
14
|
-
variants: BuilderVariantsSchema,
|
|
15
14
|
environment: BuilderEnvironmentSchema
|
|
16
15
|
});
|
|
16
|
+
export const BuilderBuilderVariantsResponseSchema = v.object({
|
|
17
|
+
variants: BuilderVariantsSchema
|
|
18
|
+
});
|
|
19
|
+
export const BuilderBuilderVariantsRequestSchema = v.object({
|
|
20
|
+
variants: BuilderVariantsSchema
|
|
21
|
+
});
|
|
17
22
|
export const BuilderBuilderPriceRequestSchema = v.object({
|
|
18
23
|
instance: BuilderInstanceSchema
|
|
19
24
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderPrimitive, BuilderRenderOption } from '../index.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
3
|
+
import type { BuilderBuilderOptionValueSelectProps } from './BuilderOptionValueSelect.svelte';
|
|
4
|
+
import type { BuilderBuilderOptionValueBooleanProps } from './BuilderOptionValueBoolean.svelte';
|
|
5
|
+
import type { BuilderBuilderOptionValueNumberProps } from './BuilderOptionValueNumber.svelte';
|
|
6
|
+
import type { BuilderBuilderOptionValueStringProps } from './BuilderOptionValueString.svelte';
|
|
7
7
|
export type BuilderBuilderOptionProps = {
|
|
8
8
|
readonly option: BuilderRenderOption;
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
9
|
+
readonly valueSelect?: Partial<BuilderBuilderOptionValueSelectProps>;
|
|
10
|
+
readonly valueBoolean?: Partial<BuilderBuilderOptionValueBooleanProps>;
|
|
11
|
+
readonly valueNumber?: Partial<BuilderBuilderOptionValueNumberProps>;
|
|
12
|
+
readonly valueString?: Partial<BuilderBuilderOptionValueStringProps>;
|
|
13
13
|
};
|
|
14
14
|
export type BuilderBuilderOptionUpdateEvent = CustomEvent<BuilderPrimitive>;
|
|
15
|
-
import './
|
|
16
|
-
import './
|
|
17
|
-
import './
|
|
18
|
-
import './
|
|
15
|
+
import './BuilderOptionValueSelect.svelte';
|
|
16
|
+
import './BuilderOptionValueBoolean.svelte';
|
|
17
|
+
import './BuilderOptionValueNumber.svelte';
|
|
18
|
+
import './BuilderOptionValueString.svelte';
|
|
19
19
|
declare const __propDef: {
|
|
20
20
|
props: Record<string, never>;
|
|
21
21
|
events: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueBooleanProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly id?: string;
|
|
6
|
+
};
|
|
7
|
+
export type BuilderBuilderOptionValueBooleanUpdateEvent = CustomEvent<boolean>;
|
|
8
|
+
declare const __propDef: {
|
|
9
|
+
props: Record<string, never>;
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type BuilderOptionValueBooleanProps = typeof __propDef.props;
|
|
16
|
+
export type BuilderOptionValueBooleanEvents = typeof __propDef.events;
|
|
17
|
+
export type BuilderOptionValueBooleanSlots = typeof __propDef.slots;
|
|
18
|
+
export default class BuilderOptionValueBoolean extends SvelteComponentTyped<BuilderOptionValueBooleanProps, BuilderOptionValueBooleanEvents, BuilderOptionValueBooleanSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueNumberProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly placeholder?: string;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BuilderBuilderOptionValueNumberUpdateEvent = CustomEvent<number>;
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: Record<string, never>;
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type BuilderOptionValueNumberProps = typeof __propDef.props;
|
|
17
|
+
export type BuilderOptionValueNumberEvents = typeof __propDef.events;
|
|
18
|
+
export type BuilderOptionValueNumberSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BuilderOptionValueNumber extends SvelteComponentTyped<BuilderOptionValueNumberProps, BuilderOptionValueNumberEvents, BuilderOptionValueNumberSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueSelectProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly placeholder?: string;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BuilderBuilderOptionValueSelectUpdateEvent = CustomEvent<string | null>;
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: Record<string, never>;
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type BuilderOptionValueSelectProps = typeof __propDef.props;
|
|
17
|
+
export type BuilderOptionValueSelectEvents = typeof __propDef.events;
|
|
18
|
+
export type BuilderOptionValueSelectSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BuilderOptionValueSelect extends SvelteComponentTyped<BuilderOptionValueSelectProps, BuilderOptionValueSelectEvents, BuilderOptionValueSelectSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BuilderRenderOption } from '../index.js';
|
|
3
|
+
export type BuilderBuilderOptionValueStringProps = {
|
|
4
|
+
readonly option: BuilderRenderOption;
|
|
5
|
+
readonly placeholder?: string;
|
|
6
|
+
readonly id?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BuilderBuilderOptionValueStringUpdateEvent = CustomEvent<string>;
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: Record<string, never>;
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type BuilderOptionValueStringProps = typeof __propDef.props;
|
|
17
|
+
export type BuilderOptionValueStringEvents = typeof __propDef.events;
|
|
18
|
+
export type BuilderOptionValueStringSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BuilderOptionValueString extends SvelteComponentTyped<BuilderOptionValueStringProps, BuilderOptionValueStringEvents, BuilderOptionValueStringSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -7,7 +7,7 @@ import type { BuilderBuilderPriceProps } from './BuilderPrice.svelte';
|
|
|
7
7
|
export type BuilderBuilderRenderProps = {
|
|
8
8
|
readonly serialised: BuilderSerialised;
|
|
9
9
|
readonly references: BuilderReferences;
|
|
10
|
-
readonly variants: BuilderVariants;
|
|
10
|
+
readonly variants: BuilderVariants | Promise<BuilderVariants> | null;
|
|
11
11
|
readonly environment: BuilderEnvironment;
|
|
12
12
|
readonly layout?: Partial<BuilderBuilderLayoutProps>;
|
|
13
13
|
readonly collections?: Partial<BuilderBuilderCollectionsProps>;
|
|
@@ -16,7 +16,7 @@ export type BuilderBuilderRenderProps = {
|
|
|
16
16
|
};
|
|
17
17
|
export type BuilderBuilderUpdate = {
|
|
18
18
|
readonly instance: BuilderInstance;
|
|
19
|
-
readonly order: BuilderOrder;
|
|
19
|
+
readonly order: BuilderOrder | null;
|
|
20
20
|
readonly price: number | null;
|
|
21
21
|
};
|
|
22
22
|
export type BuilderBuilderRenderUpdateEvent = CustomEvent<BuilderBuilderUpdate>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './
|
|
2
|
-
import './
|
|
3
|
-
import './
|
|
4
|
-
import './
|
|
1
|
+
import './BuilderOptionValueSelect.svelte';
|
|
2
|
+
import './BuilderOptionValueBoolean.svelte';
|
|
3
|
+
import './BuilderOptionValueNumber.svelte';
|
|
4
|
+
import './BuilderOptionValueString.svelte';
|
|
5
5
|
import './BuilderOption.svelte';
|
|
6
6
|
import './BuilderCollectionButtons.svelte';
|
|
7
7
|
import './BuilderLayout.svelte';
|
|
@@ -11,10 +11,10 @@ import './BuilderPrice.svelte';
|
|
|
11
11
|
import './BuilderRender.svelte';
|
|
12
12
|
import './Builder.svelte';
|
|
13
13
|
export type { BuilderBuilderOptionUpdateEvent, BuilderBuilderOptionProps } from './BuilderOption.svelte';
|
|
14
|
-
export type {
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
14
|
+
export type { BuilderBuilderOptionValueSelectUpdateEvent, BuilderBuilderOptionValueSelectProps } from './BuilderOptionValueSelect.svelte';
|
|
15
|
+
export type { BuilderBuilderOptionValueBooleanUpdateEvent, BuilderBuilderOptionValueBooleanProps } from './BuilderOptionValueBoolean.svelte';
|
|
16
|
+
export type { BuilderBuilderOptionValueNumberUpdateEvent, BuilderBuilderOptionValueNumberProps } from './BuilderOptionValueNumber.svelte';
|
|
17
|
+
export type { BuilderBuilderOptionValueStringUpdateEvent, BuilderBuilderOptionValueStringProps } from './BuilderOptionValueString.svelte';
|
|
18
18
|
export type { BuilderBuilderCollectionButtonsAddEvent, BuilderBuilderCollectionButtonsProps, BuilderBuilderCollectionButtonsRemoveEvent } from './BuilderCollectionButtons.svelte';
|
|
19
19
|
export type { BuilderBuilderLayoutUpdateEvent, BuilderBuilderLayoutProps } from './BuilderLayout.svelte';
|
|
20
20
|
export type { BuilderBuilderCollectionsUpdateEvent, BuilderBuilderCollectionsProps } from './BuilderCollections.svelte';
|