@adobe/aio-commerce-lib-app 0.1.0 → 0.2.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 +41 -0
- package/dist/cjs/actions/index.cjs +179 -0
- package/dist/cjs/actions/index.d.cts +18 -0
- package/dist/cjs/app-C4HhkXbP.d.cts +451 -0
- package/dist/cjs/commands/generate/actions/templates/custom-scripts.js.template +28 -0
- package/dist/cjs/commands/generate/actions/templates/get-app-config.js.template +11 -10
- package/dist/cjs/commands/generate/actions/templates/installation.js.template +21 -0
- package/dist/cjs/commands/index.cjs +39 -50
- package/dist/cjs/config/index.cjs +1 -14
- package/dist/cjs/config/index.d.cts +107 -423
- package/dist/cjs/error-yAk1zzvx.cjs +1 -0
- package/dist/cjs/index-DS3IlISO.d.cts +345 -0
- package/dist/cjs/management/index.cjs +1 -0
- package/dist/cjs/management/index.d.cts +2 -0
- package/dist/cjs/management-CE3_DJw4.cjs +2 -0
- package/dist/cjs/parser-Dovux8ce.cjs +1 -0
- package/dist/cjs/schemas-CdaP-Exw.cjs +1 -0
- package/dist/es/actions/index.d.mts +18 -0
- package/dist/es/actions/index.mjs +179 -0
- package/dist/es/app-CMpx3D7Y.d.mts +451 -0
- package/dist/es/chunk-VmiN0kV1.mjs +1 -0
- package/dist/es/commands/generate/actions/templates/custom-scripts.js.template +28 -0
- package/dist/es/commands/generate/actions/templates/get-app-config.js.template +11 -10
- package/dist/es/commands/generate/actions/templates/installation.js.template +21 -0
- package/dist/es/commands/index.mjs +39 -50
- package/dist/es/config/index.d.mts +107 -423
- package/dist/es/config/index.mjs +1 -14
- package/dist/es/error-hBHRgZ9R.mjs +1 -0
- package/dist/es/index-DQepSWYP.d.mts +345 -0
- package/dist/es/management/index.d.mts +3 -0
- package/dist/es/management/index.mjs +1 -0
- package/dist/es/management-BM2WcbV6.mjs +2 -0
- package/dist/es/parser-DOVfvr9l.mjs +1 -0
- package/dist/es/schemas-eemlD-xS.mjs +1 -0
- package/package.json +34 -6
- package/dist/cjs/parser-DsI4Y-Z2.cjs +0 -14
- package/dist/es/parser-BoZ6cYn-.mjs +0 -14
|
@@ -1,365 +1,9 @@
|
|
|
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
|
-
|
|
1
|
+
import { n as CommerceAppConfigDomain, r as CommerceAppConfigOutputModel, t as CommerceAppConfig } from "../app-CMpx3D7Y.mjs";
|
|
15
2
|
import * as v from "valibot";
|
|
16
3
|
import { Get } from "type-fest";
|
|
17
4
|
|
|
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
5
|
//#region source/config/lib/define.d.ts
|
|
6
|
+
|
|
363
7
|
/**
|
|
364
8
|
* Helper to type-safely define the app config.
|
|
365
9
|
* @param config - The app config to define.
|
|
@@ -436,6 +80,60 @@ declare function defineConfig(config: CommerceAppConfig): {
|
|
|
436
80
|
description?: string | undefined;
|
|
437
81
|
})[] | undefined;
|
|
438
82
|
} | undefined;
|
|
83
|
+
eventing?: {
|
|
84
|
+
commerce?: {
|
|
85
|
+
provider: {
|
|
86
|
+
label: string;
|
|
87
|
+
description: string;
|
|
88
|
+
key?: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
events: {
|
|
91
|
+
name: string;
|
|
92
|
+
fields: {
|
|
93
|
+
name: string;
|
|
94
|
+
source?: string | undefined;
|
|
95
|
+
}[];
|
|
96
|
+
rules?: {
|
|
97
|
+
field: string;
|
|
98
|
+
operator: "regex" | "greaterThan" | "lessThan" | "equal" | "in" | "onChange";
|
|
99
|
+
value: string;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
destination?: string | undefined;
|
|
102
|
+
hipaaAuditRequired?: boolean | undefined;
|
|
103
|
+
prioritary?: boolean | undefined;
|
|
104
|
+
force?: boolean | undefined;
|
|
105
|
+
label: string;
|
|
106
|
+
description: string;
|
|
107
|
+
runtimeActions: string[];
|
|
108
|
+
}[];
|
|
109
|
+
}[] | undefined;
|
|
110
|
+
external?: {
|
|
111
|
+
provider: {
|
|
112
|
+
label: string;
|
|
113
|
+
description: string;
|
|
114
|
+
key?: string | undefined;
|
|
115
|
+
};
|
|
116
|
+
events: {
|
|
117
|
+
name: string;
|
|
118
|
+
label: string;
|
|
119
|
+
description: string;
|
|
120
|
+
runtimeActions: string[];
|
|
121
|
+
}[];
|
|
122
|
+
}[] | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
installation?: {
|
|
125
|
+
messages?: {
|
|
126
|
+
preInstallation?: string | undefined;
|
|
127
|
+
postInstallation?: string | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
customInstallationSteps?: {
|
|
130
|
+
script: string;
|
|
131
|
+
name: string;
|
|
132
|
+
description: string;
|
|
133
|
+
}[] | undefined;
|
|
134
|
+
} | undefined;
|
|
135
|
+
} & {
|
|
136
|
+
[key: string]: unknown;
|
|
439
137
|
};
|
|
440
138
|
//#endregion
|
|
441
139
|
//#region source/config/lib/parser.d.ts
|
|
@@ -537,74 +235,60 @@ declare function parseCommerceAppConfig(cwd?: string): Promise<{
|
|
|
537
235
|
description?: string | undefined;
|
|
538
236
|
})[];
|
|
539
237
|
} | undefined;
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
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: {
|
|
238
|
+
eventing?: {
|
|
239
|
+
commerce?: {
|
|
240
|
+
provider: {
|
|
558
241
|
label: string;
|
|
559
|
-
|
|
242
|
+
description: string;
|
|
243
|
+
key?: string | undefined;
|
|
244
|
+
};
|
|
245
|
+
events: {
|
|
246
|
+
name: string;
|
|
247
|
+
fields: {
|
|
248
|
+
name: string;
|
|
249
|
+
source?: string | undefined;
|
|
250
|
+
}[];
|
|
251
|
+
rules?: {
|
|
252
|
+
field: string;
|
|
253
|
+
operator: "regex" | "greaterThan" | "lessThan" | "equal" | "in" | "onChange";
|
|
254
|
+
value: string;
|
|
255
|
+
}[] | undefined;
|
|
256
|
+
destination?: string | undefined;
|
|
257
|
+
hipaaAuditRequired?: boolean | undefined;
|
|
258
|
+
prioritary?: boolean | undefined;
|
|
259
|
+
force?: boolean | undefined;
|
|
260
|
+
label: string;
|
|
261
|
+
description: string;
|
|
262
|
+
runtimeActions: string[];
|
|
560
263
|
}[];
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
description?: string | undefined;
|
|
565
|
-
} | {
|
|
566
|
-
type: "list";
|
|
567
|
-
selectionMode: "multiple";
|
|
568
|
-
options: {
|
|
264
|
+
}[] | undefined;
|
|
265
|
+
external?: {
|
|
266
|
+
provider: {
|
|
569
267
|
label: string;
|
|
570
|
-
|
|
268
|
+
description: string;
|
|
269
|
+
key?: string | undefined;
|
|
270
|
+
};
|
|
271
|
+
events: {
|
|
272
|
+
name: string;
|
|
273
|
+
label: string;
|
|
274
|
+
description: string;
|
|
275
|
+
runtimeActions: string[];
|
|
571
276
|
}[];
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
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
|
-
})[];
|
|
277
|
+
}[] | undefined;
|
|
278
|
+
} | undefined;
|
|
279
|
+
installation?: {
|
|
280
|
+
messages?: {
|
|
281
|
+
preInstallation?: string | undefined;
|
|
282
|
+
postInstallation?: string | undefined;
|
|
283
|
+
} | undefined;
|
|
284
|
+
customInstallationSteps?: {
|
|
285
|
+
script: string;
|
|
286
|
+
name: string;
|
|
287
|
+
description: string;
|
|
288
|
+
}[] | undefined;
|
|
607
289
|
} | undefined;
|
|
290
|
+
} & {
|
|
291
|
+
[key: string]: unknown;
|
|
608
292
|
}>;
|
|
609
293
|
//#endregion
|
|
610
294
|
//#region source/config/lib/validate.d.ts
|
|
@@ -984,7 +668,7 @@ declare const SchemaBusinessConfig: v.ObjectSchema<{
|
|
|
984
668
|
//#region source/config/schema/metadata.d.ts
|
|
985
669
|
/** The schema for the metadata of the application. */
|
|
986
670
|
declare const MetadataSchema: v.ObjectSchema<{
|
|
987
|
-
readonly id: v.SchemaWithPipe<readonly [v.
|
|
671
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.RegexAction<string, `Only alphanumeric characters and hyphens are allowed in string value of "${string}"${string}`>]>;
|
|
988
672
|
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
673
|
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
674
|
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">]>;
|
|
@@ -992,4 +676,4 @@ declare const MetadataSchema: v.ObjectSchema<{
|
|
|
992
676
|
/** The metadata associated to an Adobe Commerce application. */
|
|
993
677
|
type ApplicationMetadata = v.InferInput<typeof MetadataSchema>;
|
|
994
678
|
//#endregion
|
|
995
|
-
export { type ApplicationMetadata, type BusinessConfig, type BusinessConfigSchema, type BusinessConfigSchemaField, type BusinessConfigSchemaListOption, type BusinessConfigSchemaValue, type CommerceAppConfig, type CommerceAppConfigDomain, type SchemaBusinessConfig, defineConfig, parseCommerceAppConfig,
|
|
679
|
+
export { type ApplicationMetadata, type BusinessConfig, type BusinessConfigSchema, type BusinessConfigSchemaField, type BusinessConfigSchemaListOption, type BusinessConfigSchemaValue, type CommerceAppConfig, type CommerceAppConfigDomain, type SchemaBusinessConfig, defineConfig, parseCommerceAppConfig, readCommerceAppConfig, resolveCommerceAppConfig, validateCommerceAppConfig, validateCommerceAppConfigDomain };
|
package/dist/es/config/index.mjs
CHANGED
|
@@ -1,14 +1 @@
|
|
|
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
|
-
import{a as validateCommerceAppConfig,i as resolveCommerceAppConfig,n as readBundledCommerceAppConfig,o as validateCommerceAppConfigDomain,r as readCommerceAppConfig,t as parseCommerceAppConfig}from"../parser-BoZ6cYn-.mjs";function defineConfig(config){return config}export{defineConfig,parseCommerceAppConfig,readBundledCommerceAppConfig,readCommerceAppConfig,resolveCommerceAppConfig,validateCommerceAppConfig,validateCommerceAppConfigDomain};
|
|
1
|
+
import{a as validateCommerceAppConfigDomain,i as validateCommerceAppConfig,n as readCommerceAppConfig,r as resolveCommerceAppConfig,t as parseCommerceAppConfig}from"../parser-DOVfvr9l.mjs";function defineConfig(config){return config}export{defineConfig,parseCommerceAppConfig,readCommerceAppConfig,resolveCommerceAppConfig,validateCommerceAppConfig,validateCommerceAppConfigDomain};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CommerceSdkValidationError}from"@adobe/aio-commerce-lib-core/error";function stringifyError(error){return error instanceof CommerceSdkValidationError?error.display():error instanceof Error?error.message:String(error)}export{stringifyError as t};
|