@spiffcommerce/theme-bridge 1.25.4-alpha.2 → 1.26.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/dist/configurationTypes-6D808idm.js.map +1 -1
- package/dist/configurationTypes-Bt8NVGKp.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +37 -14
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConversionDataType, OptionResource, SpiffCommerceClient, DesignCreationMessage, BundleDesignCreationMessage } from '@repo/core';
|
|
1
|
+
import { ConversionDataType, OptionResource, CollectionProduct, SpiffCommerceClient, DesignCreationMessage, BundleDesignCreationMessage } from '@repo/core';
|
|
2
2
|
export { ConversionDataType } from '@repo/core';
|
|
3
3
|
import { ThemeInstallConfigurationGraphQl } from '@repo/types';
|
|
4
4
|
export { ThemeInstallConfigurationGraphQl } from '@repo/types';
|
|
@@ -88,18 +88,24 @@ interface ConfigurableField extends FieldBase {
|
|
|
88
88
|
* Optional: A brief description of what the field might be used for. This is displayed beneath the field in the configuration form.
|
|
89
89
|
*/
|
|
90
90
|
description?: string;
|
|
91
|
+
}
|
|
92
|
+
interface RequiredOption {
|
|
91
93
|
/**
|
|
92
94
|
* Optional: Set to `true` to require a value to be provided in the configuration form.
|
|
93
95
|
*/
|
|
94
96
|
required?: boolean;
|
|
97
|
+
/** Cannot combine required and defaultValue options. */
|
|
98
|
+
readonly defaultValue?: undefined;
|
|
95
99
|
}
|
|
96
|
-
|
|
100
|
+
type RequiredOrDefault = RequiredOption | {
|
|
97
101
|
/**
|
|
98
102
|
* Optional: A default value to supply. Values are always supplied as strings.
|
|
99
103
|
* When the `type` is `"Select"`, this should be one of the `key` fields in the `options` array.
|
|
100
104
|
*/
|
|
101
105
|
defaultValue?: string;
|
|
102
|
-
|
|
106
|
+
/** Cannot combine required and defaultValue options. */
|
|
107
|
+
readonly required?: undefined;
|
|
108
|
+
};
|
|
103
109
|
interface LimitOption {
|
|
104
110
|
/**
|
|
105
111
|
* Optional: A limit to impose on the input.
|
|
@@ -112,9 +118,10 @@ interface LimitOption {
|
|
|
112
118
|
/**
|
|
113
119
|
* Generic fields which have no extra configuration and can accept default values from the Theme developer.
|
|
114
120
|
*/
|
|
115
|
-
interface
|
|
121
|
+
interface GenericFieldBase extends ConfigurableField {
|
|
116
122
|
type: FieldType.Boolean | FieldType.Color | FieldType.Number | FieldType.DateRange;
|
|
117
123
|
}
|
|
124
|
+
type GenericField = GenericFieldBase & RequiredOrDefault;
|
|
118
125
|
declare enum AssetType {
|
|
119
126
|
Color = "Color",
|
|
120
127
|
ColorProfile = "ColorProfile",
|
|
@@ -128,7 +135,7 @@ declare enum AssetType {
|
|
|
128
135
|
Model = "Model",
|
|
129
136
|
Video = "Video"
|
|
130
137
|
}
|
|
131
|
-
interface AssetField extends ConfigurableField {
|
|
138
|
+
interface AssetField extends ConfigurableField, RequiredOption {
|
|
132
139
|
/**
|
|
133
140
|
* The type of asset, e.g. Image, Model, Font, etc.
|
|
134
141
|
*/
|
|
@@ -138,7 +145,7 @@ interface AssetField extends ConfigurableField {
|
|
|
138
145
|
interface ConversionConfigurationField extends ConfigurableField {
|
|
139
146
|
type: FieldType.ConversionConfiguration;
|
|
140
147
|
}
|
|
141
|
-
interface
|
|
148
|
+
interface SelectFieldBase extends ConfigurableField {
|
|
142
149
|
/**
|
|
143
150
|
* The options available for the Partner to select in the configuration form.
|
|
144
151
|
*/
|
|
@@ -154,13 +161,15 @@ interface SelectField extends ConfigurableField, DefaultValueOption {
|
|
|
154
161
|
}[];
|
|
155
162
|
type: FieldType.Select;
|
|
156
163
|
}
|
|
157
|
-
|
|
164
|
+
type SelectField = SelectFieldBase & RequiredOrDefault;
|
|
165
|
+
interface TextFieldBase extends ConfigurableField, LimitOption {
|
|
158
166
|
/**
|
|
159
167
|
* Allows the Partner to configure the field in a multi-line text editor.
|
|
160
168
|
*/
|
|
161
169
|
multiLine?: boolean;
|
|
162
170
|
type: FieldType.Text;
|
|
163
171
|
}
|
|
172
|
+
type TextField = TextFieldBase & RequiredOrDefault;
|
|
164
173
|
/**
|
|
165
174
|
* Displays a heading in the Configuration Editor page in Hub.
|
|
166
175
|
*/
|
|
@@ -170,7 +179,7 @@ interface HeadingField extends FieldBase {
|
|
|
170
179
|
/**
|
|
171
180
|
* A list of one specific field type.
|
|
172
181
|
*/
|
|
173
|
-
interface ListField extends ConfigurableField, LimitOption {
|
|
182
|
+
interface ListField extends ConfigurableField, RequiredOption, LimitOption {
|
|
174
183
|
type: FieldType.List;
|
|
175
184
|
/**
|
|
176
185
|
* Defines the configuration schema for the entries in this list.
|
|
@@ -180,16 +189,16 @@ interface ListField extends ConfigurableField, LimitOption {
|
|
|
180
189
|
/**
|
|
181
190
|
* A collection of any number of different fields.
|
|
182
191
|
*/
|
|
183
|
-
interface ObjectField extends ConfigurableField {
|
|
192
|
+
interface ObjectField extends ConfigurableField, RequiredOption {
|
|
184
193
|
type: FieldType.Object;
|
|
185
194
|
/**
|
|
186
195
|
* Defines the configuration schema for the fields in this object.
|
|
187
196
|
*/
|
|
188
197
|
fields: ThemeConfigurationSchemaField[];
|
|
189
198
|
/**
|
|
190
|
-
* The schema to use from the `customSchemas` field. Leave this
|
|
199
|
+
* The schema to use from the `customSchemas` field. Leave this undefined when not using a pre-defined schema.
|
|
191
200
|
*/
|
|
192
|
-
schema?:
|
|
201
|
+
schema?: undefined;
|
|
193
202
|
}
|
|
194
203
|
interface CustomObjectField extends Omit<ObjectField, "fields" | "schema"> {
|
|
195
204
|
schema: string;
|
|
@@ -308,6 +317,7 @@ interface ThemeConfigurationSchemaFieldResource {
|
|
|
308
317
|
value: string;
|
|
309
318
|
}[];
|
|
310
319
|
assetType?: string;
|
|
320
|
+
entityType?: string;
|
|
311
321
|
multiLine?: boolean;
|
|
312
322
|
/** An arbitrary limit which applies differently depending on the field type. When Text, this is a character limit. */
|
|
313
323
|
limit?: number;
|
|
@@ -384,17 +394,18 @@ interface ConversionConfiguration {
|
|
|
384
394
|
}
|
|
385
395
|
interface ThemeInstallConfigurationFieldResource {
|
|
386
396
|
key?: string;
|
|
397
|
+
/** @deprecated No longer supported. */
|
|
387
398
|
fallbackToDefaultConfiguration?: boolean;
|
|
388
399
|
value?: string | null;
|
|
389
400
|
type: FieldType;
|
|
390
401
|
/** When the type is `Asset`, this will be the configured Asset resource. */
|
|
391
402
|
asset?: AssetResource | null;
|
|
392
403
|
/** When the type is `ConversionConfiguration`, this will be the configured ConversionConfiguration resource. */
|
|
393
|
-
conversionConfiguration?: ConversionConfiguration;
|
|
404
|
+
conversionConfiguration?: ConversionConfiguration | null;
|
|
394
405
|
/** When the type is `MetafieldConfiguration`, this will be the configured MetafieldConfiguration resource. */
|
|
395
|
-
metafieldConfiguration?: MetafieldConfigurationResource;
|
|
406
|
+
metafieldConfiguration?: MetafieldConfigurationResource | null;
|
|
396
407
|
/** When the type is `ProductCollection`, this will be the configured ProductCollection resource. */
|
|
397
|
-
productCollection?: ProductCollectionResource;
|
|
408
|
+
productCollection?: ProductCollectionResource | null;
|
|
398
409
|
/** When the type is `List`, this will be the configured values */
|
|
399
410
|
listValues?: ThemeInstallConfigurationFieldResource[];
|
|
400
411
|
/** When the type is `Object`, this will be the configured field values */
|
|
@@ -469,6 +480,13 @@ interface ThemeContextBase {
|
|
|
469
480
|
interface ThemeContextBundleOptionsNew {
|
|
470
481
|
integrationProductId?: string;
|
|
471
482
|
productCollectionId?: string;
|
|
483
|
+
singleProductMode?: boolean;
|
|
484
|
+
/**
|
|
485
|
+
* The active CollectionProduct. Use this to determine Workflows instead of fetching them from the IntegrationProduct.
|
|
486
|
+
*
|
|
487
|
+
* Only present when `singleProductMode === true`.
|
|
488
|
+
*/
|
|
489
|
+
collectionProduct?: CollectionProduct;
|
|
472
490
|
type: "new";
|
|
473
491
|
}
|
|
474
492
|
interface ThemeContextBundleOptionsExisting {
|
|
@@ -498,6 +516,11 @@ interface ThemeContextWorkflowOptionsExternalProduct extends ThemeContextWorkflo
|
|
|
498
516
|
type: "external";
|
|
499
517
|
}
|
|
500
518
|
type ThemeContextWorkflowOptions = ThemeContextWorkflowOptionsTransaction | ThemeContextWorkflowOptionsIntegrationProduct | ThemeContextWorkflowOptionsExternalProduct;
|
|
519
|
+
/**
|
|
520
|
+
* @deprecated Transaction contexts are to be replaced entirely by Bundle contexts.
|
|
521
|
+
* If you are creating a testing context, single product flows should be achieved by creating a Bundle context with an Activation, and providing:
|
|
522
|
+
* `singleProductMode = true` and the appropriate `collectionProduct`.
|
|
523
|
+
*/
|
|
501
524
|
interface ThemeContextTransaction extends ThemeContextBase {
|
|
502
525
|
workflowOptions: ThemeContextWorkflowOptions;
|
|
503
526
|
type: "transaction";
|