@adobe/aio-commerce-lib-app 0.1.0
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/CHANGELOG.md +21 -0
- package/LICENSE +201 -0
- package/README.md +22 -0
- package/dist/cjs/commands/generate/actions/templates/get-app-config.js.template +61 -0
- package/dist/cjs/commands/index.cjs +144 -0
- package/dist/cjs/commands/index.d.cts +1 -0
- package/dist/cjs/config/index.cjs +14 -0
- package/dist/cjs/config/index.d.cts +995 -0
- package/dist/cjs/parser-DsI4Y-Z2.cjs +14 -0
- package/dist/es/commands/generate/actions/templates/get-app-config.js.template +61 -0
- package/dist/es/commands/index.d.mts +1 -0
- package/dist/es/commands/index.mjs +144 -0
- package/dist/es/config/index.d.mts +995 -0
- package/dist/es/config/index.mjs +14 -0
- package/dist/es/parser-BoZ6cYn-.mjs +14 -0
- package/package.json +77 -0
|
@@ -0,0 +1,995 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import * as v from "valibot";
|
|
16
|
+
import { Get } from "type-fest";
|
|
17
|
+
|
|
18
|
+
//#region source/config/schema/app.d.ts
|
|
19
|
+
declare const CommerceAppConfigSchemas: {
|
|
20
|
+
readonly metadata: v.ObjectSchema<{
|
|
21
|
+
readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The application id must contain only alphanumeric characters and dashes">]>;
|
|
22
|
+
readonly displayName: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 50, "The application display name must not be longer than 50 characters">]>;
|
|
23
|
+
readonly description: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 255, "The metadata description must not be longer than 255 characters">]>;
|
|
24
|
+
readonly version: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The version must follow semantic versioning (semver) format">]>;
|
|
25
|
+
}, undefined>;
|
|
26
|
+
readonly businessConfig: v.ObjectSchema<{
|
|
27
|
+
readonly schema: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.VariantSchema<"selectionMode", [v.ObjectSchema<{
|
|
28
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
29
|
+
readonly selectionMode: v.LiteralSchema<"single", "Expected the selectionMode to be 'single'">;
|
|
30
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
31
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
32
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
33
|
+
}, undefined>, "Expected an array of list options">;
|
|
34
|
+
readonly default: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default value">, v.NonEmptyAction<string, "The default value must not be empty">]>;
|
|
35
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
36
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
37
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
38
|
+
}, undefined>, v.ObjectSchema<{
|
|
39
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
40
|
+
readonly selectionMode: v.LiteralSchema<"multiple", "Expected the selectionMode to be 'multiple'">;
|
|
41
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
42
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
43
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
44
|
+
}, undefined>, "Expected an array of list options">;
|
|
45
|
+
readonly default: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for each default value">, v.NonEmptyAction<string, "Each default value must not be empty">]>, "Expected an array of default values">, readonly []>;
|
|
46
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
47
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
48
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
49
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
50
|
+
readonly type: v.LiteralSchema<"text", "Expected the type to be 'text'">;
|
|
51
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
52
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
53
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
54
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
55
|
+
}, undefined>, v.ObjectSchema<{
|
|
56
|
+
readonly type: v.LiteralSchema<"password", "Expected the type to be 'password'">;
|
|
57
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
58
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
59
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
60
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
61
|
+
}, undefined>, v.ObjectSchema<{
|
|
62
|
+
readonly type: v.LiteralSchema<"email", "Expected the type to be 'email'">;
|
|
63
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default email value">, v.EmailAction<string, "The email must be a valid email address">]>, undefined>;
|
|
64
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
65
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
66
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
67
|
+
}, undefined>, v.ObjectSchema<{
|
|
68
|
+
readonly type: v.LiteralSchema<"url", "Expected the type to be 'url'">;
|
|
69
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default URL value">, v.UrlAction<string, "The URL must be a valid URL">]>, undefined>;
|
|
70
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
71
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
72
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
73
|
+
}, undefined>, v.ObjectSchema<{
|
|
74
|
+
readonly type: v.LiteralSchema<"tel", "Expected the type to be 'tel'">;
|
|
75
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default phone number value">, v.RegexAction<string, "The phone number must contain only numbers and/or country codes">]>, undefined>;
|
|
76
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
77
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
78
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
79
|
+
}, undefined>], undefined>, "Expected an array of configuration fields">, v.MinLengthAction<({
|
|
80
|
+
type: "list";
|
|
81
|
+
selectionMode: "single";
|
|
82
|
+
options: {
|
|
83
|
+
label: string;
|
|
84
|
+
value: string;
|
|
85
|
+
}[];
|
|
86
|
+
default: string;
|
|
87
|
+
name: string;
|
|
88
|
+
label?: string | undefined;
|
|
89
|
+
description?: string | undefined;
|
|
90
|
+
} | {
|
|
91
|
+
type: "list";
|
|
92
|
+
selectionMode: "multiple";
|
|
93
|
+
options: {
|
|
94
|
+
label: string;
|
|
95
|
+
value: string;
|
|
96
|
+
}[];
|
|
97
|
+
default: string[];
|
|
98
|
+
name: string;
|
|
99
|
+
label?: string | undefined;
|
|
100
|
+
description?: string | undefined;
|
|
101
|
+
} | {
|
|
102
|
+
type: "text";
|
|
103
|
+
default?: string | undefined;
|
|
104
|
+
name: string;
|
|
105
|
+
label?: string | undefined;
|
|
106
|
+
description?: string | undefined;
|
|
107
|
+
} | {
|
|
108
|
+
type: "password";
|
|
109
|
+
default?: string | undefined;
|
|
110
|
+
name: string;
|
|
111
|
+
label?: string | undefined;
|
|
112
|
+
description?: string | undefined;
|
|
113
|
+
} | {
|
|
114
|
+
type: "email";
|
|
115
|
+
default?: string | undefined;
|
|
116
|
+
name: string;
|
|
117
|
+
label?: string | undefined;
|
|
118
|
+
description?: string | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
type: "url";
|
|
121
|
+
default?: string | undefined;
|
|
122
|
+
name: string;
|
|
123
|
+
label?: string | undefined;
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
} | {
|
|
126
|
+
type: "tel";
|
|
127
|
+
default?: string | undefined;
|
|
128
|
+
name: string;
|
|
129
|
+
label?: string | undefined;
|
|
130
|
+
description?: string | undefined;
|
|
131
|
+
})[], 1, "At least one configuration parameter is required">]>, readonly []>;
|
|
132
|
+
}, undefined>;
|
|
133
|
+
readonly "businessConfig.schema": v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.VariantSchema<"selectionMode", [v.ObjectSchema<{
|
|
134
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
135
|
+
readonly selectionMode: v.LiteralSchema<"single", "Expected the selectionMode to be 'single'">;
|
|
136
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
137
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
138
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
139
|
+
}, undefined>, "Expected an array of list options">;
|
|
140
|
+
readonly default: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default value">, v.NonEmptyAction<string, "The default value must not be empty">]>;
|
|
141
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
142
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
143
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
144
|
+
}, undefined>, v.ObjectSchema<{
|
|
145
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
146
|
+
readonly selectionMode: v.LiteralSchema<"multiple", "Expected the selectionMode to be 'multiple'">;
|
|
147
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
148
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
149
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
150
|
+
}, undefined>, "Expected an array of list options">;
|
|
151
|
+
readonly default: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for each default value">, v.NonEmptyAction<string, "Each default value must not be empty">]>, "Expected an array of default values">, readonly []>;
|
|
152
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
153
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
154
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
155
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
156
|
+
readonly type: v.LiteralSchema<"text", "Expected the type to be 'text'">;
|
|
157
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
158
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
159
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
160
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
161
|
+
}, undefined>, v.ObjectSchema<{
|
|
162
|
+
readonly type: v.LiteralSchema<"password", "Expected the type to be 'password'">;
|
|
163
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
164
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
165
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
166
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
167
|
+
}, undefined>, v.ObjectSchema<{
|
|
168
|
+
readonly type: v.LiteralSchema<"email", "Expected the type to be 'email'">;
|
|
169
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default email value">, v.EmailAction<string, "The email must be a valid email address">]>, undefined>;
|
|
170
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
171
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
172
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
173
|
+
}, undefined>, v.ObjectSchema<{
|
|
174
|
+
readonly type: v.LiteralSchema<"url", "Expected the type to be 'url'">;
|
|
175
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default URL value">, v.UrlAction<string, "The URL must be a valid URL">]>, undefined>;
|
|
176
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
177
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
178
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
179
|
+
}, undefined>, v.ObjectSchema<{
|
|
180
|
+
readonly type: v.LiteralSchema<"tel", "Expected the type to be 'tel'">;
|
|
181
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default phone number value">, v.RegexAction<string, "The phone number must contain only numbers and/or country codes">]>, undefined>;
|
|
182
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
183
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
184
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
185
|
+
}, undefined>], undefined>, "Expected an array of configuration fields">, v.MinLengthAction<({
|
|
186
|
+
type: "list";
|
|
187
|
+
selectionMode: "single";
|
|
188
|
+
options: {
|
|
189
|
+
label: string;
|
|
190
|
+
value: string;
|
|
191
|
+
}[];
|
|
192
|
+
default: string;
|
|
193
|
+
name: string;
|
|
194
|
+
label?: string | undefined;
|
|
195
|
+
description?: string | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
type: "list";
|
|
198
|
+
selectionMode: "multiple";
|
|
199
|
+
options: {
|
|
200
|
+
label: string;
|
|
201
|
+
value: string;
|
|
202
|
+
}[];
|
|
203
|
+
default: string[];
|
|
204
|
+
name: string;
|
|
205
|
+
label?: string | undefined;
|
|
206
|
+
description?: string | undefined;
|
|
207
|
+
} | {
|
|
208
|
+
type: "text";
|
|
209
|
+
default?: string | undefined;
|
|
210
|
+
name: string;
|
|
211
|
+
label?: string | undefined;
|
|
212
|
+
description?: string | undefined;
|
|
213
|
+
} | {
|
|
214
|
+
type: "password";
|
|
215
|
+
default?: string | undefined;
|
|
216
|
+
name: string;
|
|
217
|
+
label?: string | undefined;
|
|
218
|
+
description?: string | undefined;
|
|
219
|
+
} | {
|
|
220
|
+
type: "email";
|
|
221
|
+
default?: string | undefined;
|
|
222
|
+
name: string;
|
|
223
|
+
label?: string | undefined;
|
|
224
|
+
description?: string | undefined;
|
|
225
|
+
} | {
|
|
226
|
+
type: "url";
|
|
227
|
+
default?: string | undefined;
|
|
228
|
+
name: string;
|
|
229
|
+
label?: string | undefined;
|
|
230
|
+
description?: string | undefined;
|
|
231
|
+
} | {
|
|
232
|
+
type: "tel";
|
|
233
|
+
default?: string | undefined;
|
|
234
|
+
name: string;
|
|
235
|
+
label?: string | undefined;
|
|
236
|
+
description?: string | undefined;
|
|
237
|
+
})[], 1, "At least one configuration parameter is required">]>;
|
|
238
|
+
};
|
|
239
|
+
/** Individual validatable domains of the commerce app config. */
|
|
240
|
+
type CommerceAppConfigDomain = keyof typeof CommerceAppConfigSchemas;
|
|
241
|
+
/** The schema used to validate the commerce app config file. */
|
|
242
|
+
declare const CommerceAppConfigSchema: v.ObjectSchema<{
|
|
243
|
+
readonly metadata: v.ObjectSchema<{
|
|
244
|
+
readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The application id must contain only alphanumeric characters and dashes">]>;
|
|
245
|
+
readonly displayName: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 50, "The application display name must not be longer than 50 characters">]>;
|
|
246
|
+
readonly description: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 255, "The metadata description must not be longer than 255 characters">]>;
|
|
247
|
+
readonly version: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The version must follow semantic versioning (semver) format">]>;
|
|
248
|
+
}, undefined>;
|
|
249
|
+
readonly businessConfig: v.OptionalSchema<v.ObjectSchema<{
|
|
250
|
+
readonly schema: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.VariantSchema<"selectionMode", [v.ObjectSchema<{
|
|
251
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
252
|
+
readonly selectionMode: v.LiteralSchema<"single", "Expected the selectionMode to be 'single'">;
|
|
253
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
254
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
255
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
256
|
+
}, undefined>, "Expected an array of list options">;
|
|
257
|
+
readonly default: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default value">, v.NonEmptyAction<string, "The default value must not be empty">]>;
|
|
258
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
259
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
260
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
261
|
+
}, undefined>, v.ObjectSchema<{
|
|
262
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
263
|
+
readonly selectionMode: v.LiteralSchema<"multiple", "Expected the selectionMode to be 'multiple'">;
|
|
264
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
265
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
266
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
267
|
+
}, undefined>, "Expected an array of list options">;
|
|
268
|
+
readonly default: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for each default value">, v.NonEmptyAction<string, "Each default value must not be empty">]>, "Expected an array of default values">, readonly []>;
|
|
269
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
270
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
271
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
272
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
273
|
+
readonly type: v.LiteralSchema<"text", "Expected the type to be 'text'">;
|
|
274
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
275
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
276
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
277
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
278
|
+
}, undefined>, v.ObjectSchema<{
|
|
279
|
+
readonly type: v.LiteralSchema<"password", "Expected the type to be 'password'">;
|
|
280
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
281
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
282
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
283
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
284
|
+
}, undefined>, v.ObjectSchema<{
|
|
285
|
+
readonly type: v.LiteralSchema<"email", "Expected the type to be 'email'">;
|
|
286
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default email value">, v.EmailAction<string, "The email must be a valid email address">]>, undefined>;
|
|
287
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
288
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
289
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
290
|
+
}, undefined>, v.ObjectSchema<{
|
|
291
|
+
readonly type: v.LiteralSchema<"url", "Expected the type to be 'url'">;
|
|
292
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default URL value">, v.UrlAction<string, "The URL must be a valid URL">]>, undefined>;
|
|
293
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
294
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
295
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
296
|
+
}, undefined>, v.ObjectSchema<{
|
|
297
|
+
readonly type: v.LiteralSchema<"tel", "Expected the type to be 'tel'">;
|
|
298
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default phone number value">, v.RegexAction<string, "The phone number must contain only numbers and/or country codes">]>, undefined>;
|
|
299
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
300
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
301
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
302
|
+
}, undefined>], undefined>, "Expected an array of configuration fields">, v.MinLengthAction<({
|
|
303
|
+
type: "list";
|
|
304
|
+
selectionMode: "single";
|
|
305
|
+
options: {
|
|
306
|
+
label: string;
|
|
307
|
+
value: string;
|
|
308
|
+
}[];
|
|
309
|
+
default: string;
|
|
310
|
+
name: string;
|
|
311
|
+
label?: string | undefined;
|
|
312
|
+
description?: string | undefined;
|
|
313
|
+
} | {
|
|
314
|
+
type: "list";
|
|
315
|
+
selectionMode: "multiple";
|
|
316
|
+
options: {
|
|
317
|
+
label: string;
|
|
318
|
+
value: string;
|
|
319
|
+
}[];
|
|
320
|
+
default: string[];
|
|
321
|
+
name: string;
|
|
322
|
+
label?: string | undefined;
|
|
323
|
+
description?: string | undefined;
|
|
324
|
+
} | {
|
|
325
|
+
type: "text";
|
|
326
|
+
default?: string | undefined;
|
|
327
|
+
name: string;
|
|
328
|
+
label?: string | undefined;
|
|
329
|
+
description?: string | undefined;
|
|
330
|
+
} | {
|
|
331
|
+
type: "password";
|
|
332
|
+
default?: string | undefined;
|
|
333
|
+
name: string;
|
|
334
|
+
label?: string | undefined;
|
|
335
|
+
description?: string | undefined;
|
|
336
|
+
} | {
|
|
337
|
+
type: "email";
|
|
338
|
+
default?: string | undefined;
|
|
339
|
+
name: string;
|
|
340
|
+
label?: string | undefined;
|
|
341
|
+
description?: string | undefined;
|
|
342
|
+
} | {
|
|
343
|
+
type: "url";
|
|
344
|
+
default?: string | undefined;
|
|
345
|
+
name: string;
|
|
346
|
+
label?: string | undefined;
|
|
347
|
+
description?: string | undefined;
|
|
348
|
+
} | {
|
|
349
|
+
type: "tel";
|
|
350
|
+
default?: string | undefined;
|
|
351
|
+
name: string;
|
|
352
|
+
label?: string | undefined;
|
|
353
|
+
description?: string | undefined;
|
|
354
|
+
})[], 1, "At least one configuration parameter is required">]>, readonly []>;
|
|
355
|
+
}, undefined>, undefined>;
|
|
356
|
+
}, undefined>;
|
|
357
|
+
/** The input shape of the commerce app config schema. */
|
|
358
|
+
type CommerceAppConfig = v.InferInput<typeof CommerceAppConfigSchema>;
|
|
359
|
+
/** The output shape of the commerce app config schema. */
|
|
360
|
+
type CommerceAppConfigOutputModel = v.InferOutput<typeof CommerceAppConfigSchema>;
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region source/config/lib/define.d.ts
|
|
363
|
+
/**
|
|
364
|
+
* Helper to type-safely define the app config.
|
|
365
|
+
* @param config - The app config to define.
|
|
366
|
+
*
|
|
367
|
+
* @example
|
|
368
|
+
* ```typescript
|
|
369
|
+
* import { defineConfig } from "@adobe/aio-commerce-lib-app";
|
|
370
|
+
*
|
|
371
|
+
* // In app.commerce.config.js
|
|
372
|
+
* export default defineConfig({
|
|
373
|
+
* // You get autocompletion and type-safety for the config object.
|
|
374
|
+
* businessConfig: { ... }
|
|
375
|
+
* });
|
|
376
|
+
*/
|
|
377
|
+
declare function defineConfig(config: CommerceAppConfig): {
|
|
378
|
+
metadata: {
|
|
379
|
+
id: string;
|
|
380
|
+
displayName: string;
|
|
381
|
+
description: string;
|
|
382
|
+
version: string;
|
|
383
|
+
};
|
|
384
|
+
businessConfig?: {
|
|
385
|
+
schema?: ({
|
|
386
|
+
type: "list";
|
|
387
|
+
selectionMode: "single";
|
|
388
|
+
options: {
|
|
389
|
+
label: string;
|
|
390
|
+
value: string;
|
|
391
|
+
}[];
|
|
392
|
+
default: string;
|
|
393
|
+
name: string;
|
|
394
|
+
label?: string | undefined;
|
|
395
|
+
description?: string | undefined;
|
|
396
|
+
} | {
|
|
397
|
+
type: "list";
|
|
398
|
+
selectionMode: "multiple";
|
|
399
|
+
options: {
|
|
400
|
+
label: string;
|
|
401
|
+
value: string;
|
|
402
|
+
}[];
|
|
403
|
+
default?: string[] | undefined;
|
|
404
|
+
name: string;
|
|
405
|
+
label?: string | undefined;
|
|
406
|
+
description?: string | undefined;
|
|
407
|
+
} | {
|
|
408
|
+
type: "text";
|
|
409
|
+
default?: string | undefined;
|
|
410
|
+
name: string;
|
|
411
|
+
label?: string | undefined;
|
|
412
|
+
description?: string | undefined;
|
|
413
|
+
} | {
|
|
414
|
+
type: "password";
|
|
415
|
+
default?: string | undefined;
|
|
416
|
+
name: string;
|
|
417
|
+
label?: string | undefined;
|
|
418
|
+
description?: string | undefined;
|
|
419
|
+
} | {
|
|
420
|
+
type: "email";
|
|
421
|
+
default?: string | undefined;
|
|
422
|
+
name: string;
|
|
423
|
+
label?: string | undefined;
|
|
424
|
+
description?: string | undefined;
|
|
425
|
+
} | {
|
|
426
|
+
type: "url";
|
|
427
|
+
default?: string | undefined;
|
|
428
|
+
name: string;
|
|
429
|
+
label?: string | undefined;
|
|
430
|
+
description?: string | undefined;
|
|
431
|
+
} | {
|
|
432
|
+
type: "tel";
|
|
433
|
+
default?: string | undefined;
|
|
434
|
+
name: string;
|
|
435
|
+
label?: string | undefined;
|
|
436
|
+
description?: string | undefined;
|
|
437
|
+
})[] | undefined;
|
|
438
|
+
} | undefined;
|
|
439
|
+
};
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region source/config/lib/parser.d.ts
|
|
442
|
+
/**
|
|
443
|
+
* Try to find (up to the nearest package.json file) the app config file.
|
|
444
|
+
*
|
|
445
|
+
* Searches for config files in the following order of priority:
|
|
446
|
+
* 1. `app.commerce.config.js` - JavaScript (CommonJS or ESM)
|
|
447
|
+
* 2. `app.commerce.config.ts` - TypeScript
|
|
448
|
+
* 3. `app.commerce.config.cjs` - CommonJS
|
|
449
|
+
* 4. `app.commerce.config.mjs` - ES Module
|
|
450
|
+
* 5. `app.commerce.config.mts` - ES Module TypeScript
|
|
451
|
+
* 6. `app.commerce.config.cts` - CommonJS TypeScript
|
|
452
|
+
*
|
|
453
|
+
* @param cwd The current working directory
|
|
454
|
+
* @returns The path to the config file, or null if not found
|
|
455
|
+
*/
|
|
456
|
+
declare function resolveCommerceAppConfig(cwd?: string): Promise<string | null>;
|
|
457
|
+
/**
|
|
458
|
+
* Read the commerce app config file as-is, without validating it.
|
|
459
|
+
*
|
|
460
|
+
* Supports multiple config file formats (see {@link resolveCommerceAppConfig} for the list).
|
|
461
|
+
* The config file must export a default export with the configuration object.
|
|
462
|
+
*
|
|
463
|
+
* @param cwd The current working directory
|
|
464
|
+
* @returns The raw config object from the file
|
|
465
|
+
* @throws {Error} If no config file is found or if the file doesn't export a default export
|
|
466
|
+
*/
|
|
467
|
+
declare function readCommerceAppConfig(cwd?: string): Promise<unknown>;
|
|
468
|
+
/**
|
|
469
|
+
* Read the commerce app config file and parse its contents into its schema.
|
|
470
|
+
*
|
|
471
|
+
* Supports multiple config file formats (see {@link resolveCommerceAppConfig} for the list).
|
|
472
|
+
* The config file must export a default export with the configuration object.
|
|
473
|
+
*
|
|
474
|
+
* @param cwd The current working directory
|
|
475
|
+
* @returns The validated and parsed config object
|
|
476
|
+
* @throws {Error} If no config file is found, if the file doesn't export a default export, or if validation fails
|
|
477
|
+
*/
|
|
478
|
+
declare function parseCommerceAppConfig(cwd?: string): Promise<{
|
|
479
|
+
metadata: {
|
|
480
|
+
id: string;
|
|
481
|
+
displayName: string;
|
|
482
|
+
description: string;
|
|
483
|
+
version: string;
|
|
484
|
+
};
|
|
485
|
+
businessConfig?: {
|
|
486
|
+
schema: ({
|
|
487
|
+
type: "list";
|
|
488
|
+
selectionMode: "single";
|
|
489
|
+
options: {
|
|
490
|
+
label: string;
|
|
491
|
+
value: string;
|
|
492
|
+
}[];
|
|
493
|
+
default: string;
|
|
494
|
+
name: string;
|
|
495
|
+
label?: string | undefined;
|
|
496
|
+
description?: string | undefined;
|
|
497
|
+
} | {
|
|
498
|
+
type: "list";
|
|
499
|
+
selectionMode: "multiple";
|
|
500
|
+
options: {
|
|
501
|
+
label: string;
|
|
502
|
+
value: string;
|
|
503
|
+
}[];
|
|
504
|
+
default: string[];
|
|
505
|
+
name: string;
|
|
506
|
+
label?: string | undefined;
|
|
507
|
+
description?: string | undefined;
|
|
508
|
+
} | {
|
|
509
|
+
type: "text";
|
|
510
|
+
default?: string | undefined;
|
|
511
|
+
name: string;
|
|
512
|
+
label?: string | undefined;
|
|
513
|
+
description?: string | undefined;
|
|
514
|
+
} | {
|
|
515
|
+
type: "password";
|
|
516
|
+
default?: string | undefined;
|
|
517
|
+
name: string;
|
|
518
|
+
label?: string | undefined;
|
|
519
|
+
description?: string | undefined;
|
|
520
|
+
} | {
|
|
521
|
+
type: "email";
|
|
522
|
+
default?: string | undefined;
|
|
523
|
+
name: string;
|
|
524
|
+
label?: string | undefined;
|
|
525
|
+
description?: string | undefined;
|
|
526
|
+
} | {
|
|
527
|
+
type: "url";
|
|
528
|
+
default?: string | undefined;
|
|
529
|
+
name: string;
|
|
530
|
+
label?: string | undefined;
|
|
531
|
+
description?: string | undefined;
|
|
532
|
+
} | {
|
|
533
|
+
type: "tel";
|
|
534
|
+
default?: string | undefined;
|
|
535
|
+
name: string;
|
|
536
|
+
label?: string | undefined;
|
|
537
|
+
description?: string | undefined;
|
|
538
|
+
})[];
|
|
539
|
+
} | undefined;
|
|
540
|
+
}>;
|
|
541
|
+
/**
|
|
542
|
+
* Read the bundled commerce app config file
|
|
543
|
+
*
|
|
544
|
+
* @throws {Error} If the bundled commerce app config file is not found or if it is invalid
|
|
545
|
+
*/
|
|
546
|
+
declare function readBundledCommerceAppConfig(): Promise<{
|
|
547
|
+
metadata: {
|
|
548
|
+
id: string;
|
|
549
|
+
displayName: string;
|
|
550
|
+
description: string;
|
|
551
|
+
version: string;
|
|
552
|
+
};
|
|
553
|
+
businessConfig?: {
|
|
554
|
+
schema: ({
|
|
555
|
+
type: "list";
|
|
556
|
+
selectionMode: "single";
|
|
557
|
+
options: {
|
|
558
|
+
label: string;
|
|
559
|
+
value: string;
|
|
560
|
+
}[];
|
|
561
|
+
default: string;
|
|
562
|
+
name: string;
|
|
563
|
+
label?: string | undefined;
|
|
564
|
+
description?: string | undefined;
|
|
565
|
+
} | {
|
|
566
|
+
type: "list";
|
|
567
|
+
selectionMode: "multiple";
|
|
568
|
+
options: {
|
|
569
|
+
label: string;
|
|
570
|
+
value: string;
|
|
571
|
+
}[];
|
|
572
|
+
default: string[];
|
|
573
|
+
name: string;
|
|
574
|
+
label?: string | undefined;
|
|
575
|
+
description?: string | undefined;
|
|
576
|
+
} | {
|
|
577
|
+
type: "text";
|
|
578
|
+
default?: string | undefined;
|
|
579
|
+
name: string;
|
|
580
|
+
label?: string | undefined;
|
|
581
|
+
description?: string | undefined;
|
|
582
|
+
} | {
|
|
583
|
+
type: "password";
|
|
584
|
+
default?: string | undefined;
|
|
585
|
+
name: string;
|
|
586
|
+
label?: string | undefined;
|
|
587
|
+
description?: string | undefined;
|
|
588
|
+
} | {
|
|
589
|
+
type: "email";
|
|
590
|
+
default?: string | undefined;
|
|
591
|
+
name: string;
|
|
592
|
+
label?: string | undefined;
|
|
593
|
+
description?: string | undefined;
|
|
594
|
+
} | {
|
|
595
|
+
type: "url";
|
|
596
|
+
default?: string | undefined;
|
|
597
|
+
name: string;
|
|
598
|
+
label?: string | undefined;
|
|
599
|
+
description?: string | undefined;
|
|
600
|
+
} | {
|
|
601
|
+
type: "tel";
|
|
602
|
+
default?: string | undefined;
|
|
603
|
+
name: string;
|
|
604
|
+
label?: string | undefined;
|
|
605
|
+
description?: string | undefined;
|
|
606
|
+
})[];
|
|
607
|
+
} | undefined;
|
|
608
|
+
}>;
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region source/config/lib/validate.d.ts
|
|
611
|
+
/**
|
|
612
|
+
* Validates a complete commerce app configuration object against the schema.
|
|
613
|
+
*
|
|
614
|
+
* @param config - The configuration object to validate.
|
|
615
|
+
* @returns The validated and typed configuration output model.
|
|
616
|
+
*
|
|
617
|
+
* @throws {CommerceSdkValidationError} If the configuration is invalid, with
|
|
618
|
+
* detailed validation issues included.
|
|
619
|
+
*
|
|
620
|
+
* @example
|
|
621
|
+
* ```typescript
|
|
622
|
+
* const config = {
|
|
623
|
+
* businessConfiguration: {
|
|
624
|
+
* // ... configuration data
|
|
625
|
+
* }
|
|
626
|
+
* };
|
|
627
|
+
*
|
|
628
|
+
* try {
|
|
629
|
+
* const validatedConfig = validateCommerceAppConfig(config);
|
|
630
|
+
* // Use validatedConfig safely
|
|
631
|
+
* } catch (error) {
|
|
632
|
+
* if (error instanceof CommerceSdkValidationError) {
|
|
633
|
+
* console.error('Validation failed:', error.display());
|
|
634
|
+
* }
|
|
635
|
+
* }
|
|
636
|
+
* ```
|
|
637
|
+
*/
|
|
638
|
+
declare function validateCommerceAppConfig(config: unknown): CommerceAppConfigOutputModel;
|
|
639
|
+
/**
|
|
640
|
+
* Validates a specific domain configuration within the commerce app config.
|
|
641
|
+
*
|
|
642
|
+
* This function validates only a specific domain's configuration rather than
|
|
643
|
+
* the entire commerce app configuration object. It first validates that the
|
|
644
|
+
* domain name is valid, then validates the configuration data against the
|
|
645
|
+
* schema for that specific domain.
|
|
646
|
+
*
|
|
647
|
+
* @template T - The type of the domain, constrained to valid domain names.
|
|
648
|
+
*
|
|
649
|
+
* @param config - The domain configuration object to validate.
|
|
650
|
+
* @param domain - The name of the domain to validate (e.g., 'businessConfiguration').
|
|
651
|
+
* @returns The validated and typed configuration for the specified domain.
|
|
652
|
+
*
|
|
653
|
+
* @throws {CommerceSdkValidationError} If the domain name is invalid or if the
|
|
654
|
+
* configuration doesn't match the domain's schema.
|
|
655
|
+
*
|
|
656
|
+
* @example
|
|
657
|
+
* ```typescript
|
|
658
|
+
* const businessConfig = {
|
|
659
|
+
* fields: [
|
|
660
|
+
* {
|
|
661
|
+
* name: 'category',
|
|
662
|
+
* type: 'dropdown',
|
|
663
|
+
* // ... field configuration
|
|
664
|
+
* }
|
|
665
|
+
* ]
|
|
666
|
+
* };
|
|
667
|
+
*
|
|
668
|
+
* try {
|
|
669
|
+
* const validatedConfig = validateCommerceAppConfigDomain(
|
|
670
|
+
* businessConfig,
|
|
671
|
+
* 'businessConfig'
|
|
672
|
+
* );
|
|
673
|
+
* // Use validatedConfig safely
|
|
674
|
+
* } catch (error) {
|
|
675
|
+
* if (error instanceof CommerceSdkValidationError) {
|
|
676
|
+
* console.error('Domain validation failed:', error.issues);
|
|
677
|
+
* }
|
|
678
|
+
* }
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
declare function validateCommerceAppConfigDomain<T extends CommerceAppConfigDomain>(config: unknown, domain: T): NonNullable<Get<CommerceAppConfigOutputModel, T>>;
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region source/config/schema/business-configuration.d.ts
|
|
684
|
+
/** Schema for a configuration field that can be one of various field types (list, text, password, email, url, or phone) */
|
|
685
|
+
declare const FieldSchema: v.VariantSchema<"type", [v.VariantSchema<"selectionMode", [v.ObjectSchema<{
|
|
686
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
687
|
+
readonly selectionMode: v.LiteralSchema<"single", "Expected the selectionMode to be 'single'">;
|
|
688
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
689
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
690
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
691
|
+
}, undefined>, "Expected an array of list options">;
|
|
692
|
+
readonly default: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default value">, v.NonEmptyAction<string, "The default value must not be empty">]>;
|
|
693
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
694
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
695
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
696
|
+
}, undefined>, v.ObjectSchema<{
|
|
697
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
698
|
+
readonly selectionMode: v.LiteralSchema<"multiple", "Expected the selectionMode to be 'multiple'">;
|
|
699
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
700
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
701
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
702
|
+
}, undefined>, "Expected an array of list options">;
|
|
703
|
+
readonly default: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for each default value">, v.NonEmptyAction<string, "Each default value must not be empty">]>, "Expected an array of default values">, readonly []>;
|
|
704
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
705
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
706
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
707
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
708
|
+
readonly type: v.LiteralSchema<"text", "Expected the type to be 'text'">;
|
|
709
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
710
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
711
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
712
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
713
|
+
}, undefined>, v.ObjectSchema<{
|
|
714
|
+
readonly type: v.LiteralSchema<"password", "Expected the type to be 'password'">;
|
|
715
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
716
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
717
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
718
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
719
|
+
}, undefined>, v.ObjectSchema<{
|
|
720
|
+
readonly type: v.LiteralSchema<"email", "Expected the type to be 'email'">;
|
|
721
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default email value">, v.EmailAction<string, "The email must be a valid email address">]>, undefined>;
|
|
722
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
723
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
724
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
725
|
+
}, undefined>, v.ObjectSchema<{
|
|
726
|
+
readonly type: v.LiteralSchema<"url", "Expected the type to be 'url'">;
|
|
727
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default URL value">, v.UrlAction<string, "The URL must be a valid URL">]>, undefined>;
|
|
728
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
729
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
730
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
731
|
+
}, undefined>, v.ObjectSchema<{
|
|
732
|
+
readonly type: v.LiteralSchema<"tel", "Expected the type to be 'tel'">;
|
|
733
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default phone number value">, v.RegexAction<string, "The phone number must contain only numbers and/or country codes">]>, undefined>;
|
|
734
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
735
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
736
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
737
|
+
}, undefined>], undefined>;
|
|
738
|
+
/** Schema for the schema of the business configuration, which is an array of configuration fields with at least one field required */
|
|
739
|
+
declare const SchemaBusinessConfigSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.VariantSchema<"selectionMode", [v.ObjectSchema<{
|
|
740
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
741
|
+
readonly selectionMode: v.LiteralSchema<"single", "Expected the selectionMode to be 'single'">;
|
|
742
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
743
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
744
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
745
|
+
}, undefined>, "Expected an array of list options">;
|
|
746
|
+
readonly default: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default value">, v.NonEmptyAction<string, "The default value must not be empty">]>;
|
|
747
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
748
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
749
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
750
|
+
}, undefined>, v.ObjectSchema<{
|
|
751
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
752
|
+
readonly selectionMode: v.LiteralSchema<"multiple", "Expected the selectionMode to be 'multiple'">;
|
|
753
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
754
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
755
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
756
|
+
}, undefined>, "Expected an array of list options">;
|
|
757
|
+
readonly default: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for each default value">, v.NonEmptyAction<string, "Each default value must not be empty">]>, "Expected an array of default values">, readonly []>;
|
|
758
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
759
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
760
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
761
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
762
|
+
readonly type: v.LiteralSchema<"text", "Expected the type to be 'text'">;
|
|
763
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
764
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
765
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
766
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
767
|
+
}, undefined>, v.ObjectSchema<{
|
|
768
|
+
readonly type: v.LiteralSchema<"password", "Expected the type to be 'password'">;
|
|
769
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
770
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
771
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
772
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
773
|
+
}, undefined>, v.ObjectSchema<{
|
|
774
|
+
readonly type: v.LiteralSchema<"email", "Expected the type to be 'email'">;
|
|
775
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default email value">, v.EmailAction<string, "The email must be a valid email address">]>, undefined>;
|
|
776
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
777
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
778
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
779
|
+
}, undefined>, v.ObjectSchema<{
|
|
780
|
+
readonly type: v.LiteralSchema<"url", "Expected the type to be 'url'">;
|
|
781
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default URL value">, v.UrlAction<string, "The URL must be a valid URL">]>, undefined>;
|
|
782
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
783
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
784
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
785
|
+
}, undefined>, v.ObjectSchema<{
|
|
786
|
+
readonly type: v.LiteralSchema<"tel", "Expected the type to be 'tel'">;
|
|
787
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default phone number value">, v.RegexAction<string, "The phone number must contain only numbers and/or country codes">]>, undefined>;
|
|
788
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
789
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
790
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
791
|
+
}, undefined>], undefined>, "Expected an array of configuration fields">, v.MinLengthAction<({
|
|
792
|
+
type: "list";
|
|
793
|
+
selectionMode: "single";
|
|
794
|
+
options: {
|
|
795
|
+
label: string;
|
|
796
|
+
value: string;
|
|
797
|
+
}[];
|
|
798
|
+
default: string;
|
|
799
|
+
name: string;
|
|
800
|
+
label?: string | undefined;
|
|
801
|
+
description?: string | undefined;
|
|
802
|
+
} | {
|
|
803
|
+
type: "list";
|
|
804
|
+
selectionMode: "multiple";
|
|
805
|
+
options: {
|
|
806
|
+
label: string;
|
|
807
|
+
value: string;
|
|
808
|
+
}[];
|
|
809
|
+
default: string[];
|
|
810
|
+
name: string;
|
|
811
|
+
label?: string | undefined;
|
|
812
|
+
description?: string | undefined;
|
|
813
|
+
} | {
|
|
814
|
+
type: "text";
|
|
815
|
+
default?: string | undefined;
|
|
816
|
+
name: string;
|
|
817
|
+
label?: string | undefined;
|
|
818
|
+
description?: string | undefined;
|
|
819
|
+
} | {
|
|
820
|
+
type: "password";
|
|
821
|
+
default?: string | undefined;
|
|
822
|
+
name: string;
|
|
823
|
+
label?: string | undefined;
|
|
824
|
+
description?: string | undefined;
|
|
825
|
+
} | {
|
|
826
|
+
type: "email";
|
|
827
|
+
default?: string | undefined;
|
|
828
|
+
name: string;
|
|
829
|
+
label?: string | undefined;
|
|
830
|
+
description?: string | undefined;
|
|
831
|
+
} | {
|
|
832
|
+
type: "url";
|
|
833
|
+
default?: string | undefined;
|
|
834
|
+
name: string;
|
|
835
|
+
label?: string | undefined;
|
|
836
|
+
description?: string | undefined;
|
|
837
|
+
} | {
|
|
838
|
+
type: "tel";
|
|
839
|
+
default?: string | undefined;
|
|
840
|
+
name: string;
|
|
841
|
+
label?: string | undefined;
|
|
842
|
+
description?: string | undefined;
|
|
843
|
+
})[], 1, "At least one configuration parameter is required">]>;
|
|
844
|
+
/**
|
|
845
|
+
* The schema type for a configuration field.
|
|
846
|
+
*
|
|
847
|
+
* Represents a single field definition in the configuration schema, which can be
|
|
848
|
+
* one of various types: list, text, password, email, url, or phone.
|
|
849
|
+
*/
|
|
850
|
+
type BusinessConfigSchemaField = v.InferInput<typeof FieldSchema>;
|
|
851
|
+
/**
|
|
852
|
+
* The schema type for the business configuration schema.
|
|
853
|
+
*
|
|
854
|
+
* Represents an array of configuration field definitions that make up the complete
|
|
855
|
+
* business configuration schema. Must contain at least one field.
|
|
856
|
+
*/
|
|
857
|
+
type BusinessConfigSchema = v.InferInput<typeof SchemaBusinessConfigSchema>;
|
|
858
|
+
/** The schema type for the business configuration schema. */
|
|
859
|
+
type BusinessConfigSchemaValue = BusinessConfigSchemaField["default"];
|
|
860
|
+
/**
|
|
861
|
+
* The schema type for an option in a list configuration field.
|
|
862
|
+
* Represents a single option that can be selected in a list-type configuration field.
|
|
863
|
+
*/
|
|
864
|
+
type BusinessConfigSchemaListOption = Extract<BusinessConfigSchemaField, {
|
|
865
|
+
type: "list";
|
|
866
|
+
}>["options"][number];
|
|
867
|
+
/** The keys of the `businessConfig` settings in the app config file. */
|
|
868
|
+
type BusinessConfig = {
|
|
869
|
+
/**
|
|
870
|
+
* The schema of the app business configuration.
|
|
871
|
+
* @default []
|
|
872
|
+
*/
|
|
873
|
+
schema?: BusinessConfigSchema;
|
|
874
|
+
};
|
|
875
|
+
/** The schema used to validate the `businessConfig` settings in the app config file. */
|
|
876
|
+
declare const SchemaBusinessConfig: v.ObjectSchema<{
|
|
877
|
+
readonly schema: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.VariantSchema<"selectionMode", [v.ObjectSchema<{
|
|
878
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
879
|
+
readonly selectionMode: v.LiteralSchema<"single", "Expected the selectionMode to be 'single'">;
|
|
880
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
881
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
882
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
883
|
+
}, undefined>, "Expected an array of list options">;
|
|
884
|
+
readonly default: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default value">, v.NonEmptyAction<string, "The default value must not be empty">]>;
|
|
885
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
886
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
887
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
888
|
+
}, undefined>, v.ObjectSchema<{
|
|
889
|
+
readonly type: v.LiteralSchema<"list", "Expected the type to be 'list'">;
|
|
890
|
+
readonly selectionMode: v.LiteralSchema<"multiple", "Expected the selectionMode to be 'multiple'">;
|
|
891
|
+
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
892
|
+
readonly label: v.StringSchema<"Expected a string for the option label">;
|
|
893
|
+
readonly value: v.StringSchema<"Expected a string for the option value">;
|
|
894
|
+
}, undefined>, "Expected an array of list options">;
|
|
895
|
+
readonly default: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for each default value">, v.NonEmptyAction<string, "Each default value must not be empty">]>, "Expected an array of default values">, readonly []>;
|
|
896
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
897
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
898
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
899
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
900
|
+
readonly type: v.LiteralSchema<"text", "Expected the type to be 'text'">;
|
|
901
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
902
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
903
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
904
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
905
|
+
}, undefined>, v.ObjectSchema<{
|
|
906
|
+
readonly type: v.LiteralSchema<"password", "Expected the type to be 'password'">;
|
|
907
|
+
readonly default: v.OptionalSchema<v.StringSchema<"Expected a string for the default value">, undefined>;
|
|
908
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
909
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
910
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
911
|
+
}, undefined>, v.ObjectSchema<{
|
|
912
|
+
readonly type: v.LiteralSchema<"email", "Expected the type to be 'email'">;
|
|
913
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default email value">, v.EmailAction<string, "The email must be a valid email address">]>, undefined>;
|
|
914
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
915
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
916
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
917
|
+
}, undefined>, v.ObjectSchema<{
|
|
918
|
+
readonly type: v.LiteralSchema<"url", "Expected the type to be 'url'">;
|
|
919
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default URL value">, v.UrlAction<string, "The URL must be a valid URL">]>, undefined>;
|
|
920
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
921
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
922
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
923
|
+
}, undefined>, v.ObjectSchema<{
|
|
924
|
+
readonly type: v.LiteralSchema<"tel", "Expected the type to be 'tel'">;
|
|
925
|
+
readonly default: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the default phone number value">, v.RegexAction<string, "The phone number must contain only numbers and/or country codes">]>, undefined>;
|
|
926
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<"Expected a string for the field name">, v.NonEmptyAction<string, "The field name must not be empty">]>;
|
|
927
|
+
readonly label: v.OptionalSchema<v.StringSchema<"Expected a string for the field label">, undefined>;
|
|
928
|
+
readonly description: v.OptionalSchema<v.StringSchema<"Expected a string for the field description">, undefined>;
|
|
929
|
+
}, undefined>], undefined>, "Expected an array of configuration fields">, v.MinLengthAction<({
|
|
930
|
+
type: "list";
|
|
931
|
+
selectionMode: "single";
|
|
932
|
+
options: {
|
|
933
|
+
label: string;
|
|
934
|
+
value: string;
|
|
935
|
+
}[];
|
|
936
|
+
default: string;
|
|
937
|
+
name: string;
|
|
938
|
+
label?: string | undefined;
|
|
939
|
+
description?: string | undefined;
|
|
940
|
+
} | {
|
|
941
|
+
type: "list";
|
|
942
|
+
selectionMode: "multiple";
|
|
943
|
+
options: {
|
|
944
|
+
label: string;
|
|
945
|
+
value: string;
|
|
946
|
+
}[];
|
|
947
|
+
default: string[];
|
|
948
|
+
name: string;
|
|
949
|
+
label?: string | undefined;
|
|
950
|
+
description?: string | undefined;
|
|
951
|
+
} | {
|
|
952
|
+
type: "text";
|
|
953
|
+
default?: string | undefined;
|
|
954
|
+
name: string;
|
|
955
|
+
label?: string | undefined;
|
|
956
|
+
description?: string | undefined;
|
|
957
|
+
} | {
|
|
958
|
+
type: "password";
|
|
959
|
+
default?: string | undefined;
|
|
960
|
+
name: string;
|
|
961
|
+
label?: string | undefined;
|
|
962
|
+
description?: string | undefined;
|
|
963
|
+
} | {
|
|
964
|
+
type: "email";
|
|
965
|
+
default?: string | undefined;
|
|
966
|
+
name: string;
|
|
967
|
+
label?: string | undefined;
|
|
968
|
+
description?: string | undefined;
|
|
969
|
+
} | {
|
|
970
|
+
type: "url";
|
|
971
|
+
default?: string | undefined;
|
|
972
|
+
name: string;
|
|
973
|
+
label?: string | undefined;
|
|
974
|
+
description?: string | undefined;
|
|
975
|
+
} | {
|
|
976
|
+
type: "tel";
|
|
977
|
+
default?: string | undefined;
|
|
978
|
+
name: string;
|
|
979
|
+
label?: string | undefined;
|
|
980
|
+
description?: string | undefined;
|
|
981
|
+
})[], 1, "At least one configuration parameter is required">]>, readonly []>;
|
|
982
|
+
}, undefined>;
|
|
983
|
+
//#endregion
|
|
984
|
+
//#region source/config/schema/metadata.d.ts
|
|
985
|
+
/** The schema for the metadata of the application. */
|
|
986
|
+
declare const MetadataSchema: v.ObjectSchema<{
|
|
987
|
+
readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The application id must contain only alphanumeric characters and dashes">]>;
|
|
988
|
+
readonly displayName: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 50, "The application display name must not be longer than 50 characters">]>;
|
|
989
|
+
readonly description: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 255, "The metadata description must not be longer than 255 characters">]>;
|
|
990
|
+
readonly version: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The version must follow semantic versioning (semver) format">]>;
|
|
991
|
+
}, undefined>;
|
|
992
|
+
/** The metadata associated to an Adobe Commerce application. */
|
|
993
|
+
type ApplicationMetadata = v.InferInput<typeof MetadataSchema>;
|
|
994
|
+
//#endregion
|
|
995
|
+
export { type ApplicationMetadata, type BusinessConfig, type BusinessConfigSchema, type BusinessConfigSchemaField, type BusinessConfigSchemaListOption, type BusinessConfigSchemaValue, type CommerceAppConfig, type CommerceAppConfigDomain, type SchemaBusinessConfig, defineConfig, parseCommerceAppConfig, readBundledCommerceAppConfig, readCommerceAppConfig, resolveCommerceAppConfig, validateCommerceAppConfig, validateCommerceAppConfigDomain };
|