@wix/auto_sdk_stores_customizations-v-3 1.0.69 → 1.0.71
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/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js +98 -5
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +70 -16
- package/build/cjs/index.typings.js +88 -5
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +58 -17
- package/build/cjs/meta.js +66 -5
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +97 -5
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +70 -16
- package/build/es/index.typings.mjs +87 -5
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +58 -17
- package/build/es/meta.mjs +65 -5
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +19 -3
- package/build/internal/cjs/index.js +98 -5
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +89 -17
- package/build/internal/cjs/index.typings.js +88 -5
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +58 -17
- package/build/internal/cjs/meta.js +66 -5
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +19 -3
- package/build/internal/es/index.mjs +97 -5
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +89 -17
- package/build/internal/es/index.typings.mjs +87 -5
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +58 -17
- package/build/internal/es/meta.mjs +65 -5
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -96,14 +96,12 @@ interface CustomizationCustomizationSettingsOneOf {
|
|
|
96
96
|
choicesSettings?: ChoicesSettings;
|
|
97
97
|
}
|
|
98
98
|
declare enum CustomizationType {
|
|
99
|
-
UNKNOWN_CUSTOMIZATION_TYPE = "UNKNOWN_CUSTOMIZATION_TYPE",
|
|
100
99
|
PRODUCT_OPTION = "PRODUCT_OPTION",
|
|
101
100
|
MODIFIER = "MODIFIER"
|
|
102
101
|
}
|
|
103
102
|
/** @enumType */
|
|
104
|
-
type CustomizationTypeWithLiterals = CustomizationType | '
|
|
103
|
+
type CustomizationTypeWithLiterals = CustomizationType | 'PRODUCT_OPTION' | 'MODIFIER';
|
|
105
104
|
declare enum CustomizationRenderType {
|
|
106
|
-
UNKNOWN_CUSTOMIZATION_RENDER_TYPE = "UNKNOWN_CUSTOMIZATION_RENDER_TYPE",
|
|
107
105
|
/** Customization by free text input. */
|
|
108
106
|
FREE_TEXT = "FREE_TEXT",
|
|
109
107
|
/** Customization by selection of text choices. */
|
|
@@ -112,7 +110,7 @@ declare enum CustomizationRenderType {
|
|
|
112
110
|
SWATCH_CHOICES = "SWATCH_CHOICES"
|
|
113
111
|
}
|
|
114
112
|
/** @enumType */
|
|
115
|
-
type CustomizationRenderTypeWithLiterals = CustomizationRenderType | '
|
|
113
|
+
type CustomizationRenderTypeWithLiterals = CustomizationRenderType | 'FREE_TEXT' | 'TEXT_CHOICES' | 'SWATCH_CHOICES';
|
|
116
114
|
interface FreeTextSettings {
|
|
117
115
|
/** Minimum text character length. */
|
|
118
116
|
minCharCount?: number;
|
|
@@ -207,14 +205,13 @@ interface ChoiceValueOneOf {
|
|
|
207
205
|
colorCode?: string;
|
|
208
206
|
}
|
|
209
207
|
declare enum ChoiceType {
|
|
210
|
-
UNKNOWN_CHOICE_TYPE = "UNKNOWN_CHOICE_TYPE",
|
|
211
208
|
/** For a `customizationRenderType` of `TEXT_CHOICES`. */
|
|
212
209
|
CHOICE_TEXT = "CHOICE_TEXT",
|
|
213
210
|
/** For `customizationRenderType: SWATCH_CHOICES`. */
|
|
214
211
|
ONE_COLOR = "ONE_COLOR"
|
|
215
212
|
}
|
|
216
213
|
/** @enumType */
|
|
217
|
-
type ChoiceTypeWithLiterals = ChoiceType | '
|
|
214
|
+
type ChoiceTypeWithLiterals = ChoiceType | 'CHOICE_TEXT' | 'ONE_COLOR';
|
|
218
215
|
interface MultipleColors {
|
|
219
216
|
/**
|
|
220
217
|
* A list of color codes.
|
|
@@ -236,18 +233,17 @@ interface FocalPoint {
|
|
|
236
233
|
width?: number | null;
|
|
237
234
|
}
|
|
238
235
|
declare enum ChoiceSortStrategy {
|
|
239
|
-
|
|
240
|
-
/** Text choices are sorted by name, and swatch choices are sorted by the number of matching products. */
|
|
236
|
+
/** Default. Text choices are sorted by name, swatch choices are sorted by product count. */
|
|
241
237
|
DEFAULT = "DEFAULT",
|
|
242
|
-
/**
|
|
238
|
+
/** Alphabetically by name, case-insensitive. Numeric values are sorted first. */
|
|
243
239
|
BY_NAME = "BY_NAME",
|
|
244
|
-
/**
|
|
240
|
+
/** By the number of products assigned to each choice, in descending order. */
|
|
245
241
|
BY_PRODUCT_COUNT = "BY_PRODUCT_COUNT",
|
|
246
|
-
/**
|
|
242
|
+
/** By the order of the choices list. Use [Reorder Customization Choices](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/customizations-v3/reorder-customization-choices) to set the order. */
|
|
247
243
|
MANUAL = "MANUAL"
|
|
248
244
|
}
|
|
249
245
|
/** @enumType */
|
|
250
|
-
type ChoiceSortStrategyWithLiterals = ChoiceSortStrategy | '
|
|
246
|
+
type ChoiceSortStrategyWithLiterals = ChoiceSortStrategy | 'DEFAULT' | 'BY_NAME' | 'BY_PRODUCT_COUNT' | 'MANUAL';
|
|
251
247
|
interface InvalidateCache extends InvalidateCacheGetByOneOf {
|
|
252
248
|
/**
|
|
253
249
|
* Invalidate by msId. NOT recommended, as this will invalidate the entire site cache!
|
|
@@ -428,13 +424,11 @@ interface GetCustomizationRequest {
|
|
|
428
424
|
fields?: RequestedFieldsWithLiterals[];
|
|
429
425
|
}
|
|
430
426
|
declare enum RequestedFields {
|
|
431
|
-
/** Unknown requested field. */
|
|
432
|
-
UNKNOWN_REQUESTED_FIELD = "UNKNOWN_REQUESTED_FIELD",
|
|
433
427
|
/** Assigned products count. */
|
|
434
428
|
ASSIGNED_PRODUCTS_COUNT = "ASSIGNED_PRODUCTS_COUNT"
|
|
435
429
|
}
|
|
436
430
|
/** @enumType */
|
|
437
|
-
type RequestedFieldsWithLiterals = RequestedFields | '
|
|
431
|
+
type RequestedFieldsWithLiterals = RequestedFields | 'ASSIGNED_PRODUCTS_COUNT';
|
|
438
432
|
interface GetCustomizationResponse {
|
|
439
433
|
/** Customization. */
|
|
440
434
|
customization?: Customization;
|
|
@@ -780,6 +774,40 @@ interface UpdateCustomizationChoicesResponse {
|
|
|
780
774
|
/** Updated customization. */
|
|
781
775
|
customization?: Customization;
|
|
782
776
|
}
|
|
777
|
+
interface ReorderCustomizationChoicesRequest {
|
|
778
|
+
/**
|
|
779
|
+
* Customization ID.
|
|
780
|
+
* @format GUID
|
|
781
|
+
*/
|
|
782
|
+
customizationId: string;
|
|
783
|
+
/** Revision number, which increments by 1 each time the customization is updated. To prevent conflicting changes, the current revision must be passed when updating the customization. */
|
|
784
|
+
revision: string;
|
|
785
|
+
/**
|
|
786
|
+
* Choice IDs in the desired display order. Must contain exactly the same set of IDs as the customization's current choices — no additions or removals.
|
|
787
|
+
* @format GUID
|
|
788
|
+
* @minSize 1
|
|
789
|
+
* @maxSize 200
|
|
790
|
+
*/
|
|
791
|
+
choiceIds: string[];
|
|
792
|
+
/**
|
|
793
|
+
* Fields to include in the response.
|
|
794
|
+
*
|
|
795
|
+
* Supported values: `ASSIGNED_PRODUCTS_COUNT`
|
|
796
|
+
* @maxSize 100
|
|
797
|
+
*/
|
|
798
|
+
fields?: RequestedFieldsWithLiterals[];
|
|
799
|
+
}
|
|
800
|
+
interface ReorderCustomizationChoicesResponse {
|
|
801
|
+
/** Updated customization. */
|
|
802
|
+
customization?: Customization;
|
|
803
|
+
}
|
|
804
|
+
/** Additional error details returned with the `CHOICE_IDS_MISMATCH` error. */
|
|
805
|
+
interface ChoiceIdsMismatchData {
|
|
806
|
+
/** Choice IDs that exist in the customization but are missing from the request. */
|
|
807
|
+
missingIds?: string[];
|
|
808
|
+
/** Choice IDs included in the request that don't exist in the customization. */
|
|
809
|
+
extraIds?: string[];
|
|
810
|
+
}
|
|
783
811
|
interface BulkAddCustomizationChoicesRequest {
|
|
784
812
|
/**
|
|
785
813
|
* List of customization IDs and choices.
|
|
@@ -1180,6 +1208,16 @@ type UpdateCustomizationChoicesValidationErrors = {
|
|
|
1180
1208
|
ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
|
|
1181
1209
|
};
|
|
1182
1210
|
/** @docsIgnore */
|
|
1211
|
+
type ReorderCustomizationChoicesApplicationErrors = {
|
|
1212
|
+
code?: 'DOESNT_SUPPORT_CHOICES';
|
|
1213
|
+
description?: string;
|
|
1214
|
+
data?: Record<string, any>;
|
|
1215
|
+
} | {
|
|
1216
|
+
code?: 'CHOICE_IDS_MISMATCH';
|
|
1217
|
+
description?: string;
|
|
1218
|
+
data?: ChoiceIdsMismatchData;
|
|
1219
|
+
};
|
|
1220
|
+
/** @docsIgnore */
|
|
1183
1221
|
type BulkAddCustomizationChoicesApplicationErrors = {
|
|
1184
1222
|
code?: 'CHOICES_LIMIT_EXCEEDED';
|
|
1185
1223
|
description?: string;
|
|
@@ -1804,6 +1842,22 @@ interface UpdateCustomizationChoicesOptions {
|
|
|
1804
1842
|
*/
|
|
1805
1843
|
fields?: RequestedFieldsWithLiterals[];
|
|
1806
1844
|
}
|
|
1845
|
+
interface ReorderCustomizationChoicesOptions {
|
|
1846
|
+
/**
|
|
1847
|
+
* Choice IDs in the desired display order. Must contain exactly the same set of IDs as the customization's current choices — no additions or removals.
|
|
1848
|
+
* @format GUID
|
|
1849
|
+
* @minSize 1
|
|
1850
|
+
* @maxSize 200
|
|
1851
|
+
*/
|
|
1852
|
+
choiceIds: string[];
|
|
1853
|
+
/**
|
|
1854
|
+
* Fields to include in the response.
|
|
1855
|
+
*
|
|
1856
|
+
* Supported values: `ASSIGNED_PRODUCTS_COUNT`
|
|
1857
|
+
* @maxSize 100
|
|
1858
|
+
*/
|
|
1859
|
+
fields?: RequestedFieldsWithLiterals[];
|
|
1860
|
+
}
|
|
1807
1861
|
/**
|
|
1808
1862
|
* Adds choices to multiple customizations.
|
|
1809
1863
|
* @param customizationsChoices - List of customization IDs and choices.
|
|
@@ -1867,4 +1921,4 @@ interface BulkUpdateCustomizationsOptions {
|
|
|
1867
1921
|
fields?: RequestedFieldsWithLiterals[];
|
|
1868
1922
|
}
|
|
1869
1923
|
|
|
1870
|
-
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddCustomizationChoicesApplicationErrors, type AddCustomizationChoicesOptions, type AddCustomizationChoicesRequest, type AddCustomizationChoicesResponse, type AddCustomizationChoicesValidationErrors, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkAddCustomizationChoicesApplicationErrors, type BulkAddCustomizationChoicesOptions, type BulkAddCustomizationChoicesRequest, type BulkAddCustomizationChoicesResponse, type BulkAddCustomizationChoicesValidationErrors, type BulkCreateCustomizationsApplicationErrors, type BulkCreateCustomizationsForMigrationRequest, type BulkCreateCustomizationsForMigrationResponse, type BulkCreateCustomizationsOptions, type BulkCreateCustomizationsRequest, type BulkCreateCustomizationsResponse, type BulkCreateCustomizationsValidationErrors, type BulkCustomizationResult, type BulkUpdateCustomizationsOptions, type BulkUpdateCustomizationsRequest, type BulkUpdateCustomizationsResponse, type Choice, ChoiceSortStrategy, type ChoiceSortStrategyWithLiterals, ChoiceType, type ChoiceTypeWithLiterals, type ChoiceValueOneOf, type ChoicesSettings, type CommonQueryWithEntityContext, type CreateCustomizationApplicationErrors, type CreateCustomizationRequest, type CreateCustomizationResponse, type CreateCustomizationValidationErrors, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type Customization, type CustomizationChoices, type CustomizationCreatedEnvelope, type CustomizationCustomizationSettingsOneOf, type CustomizationDeletedEnvelope, type CustomizationIdsWrapper, type CustomizationQuery, type CustomizationQuerySpec, CustomizationRenderType, type CustomizationRenderTypeWithLiterals, CustomizationType, type CustomizationTypeWithLiterals, type CustomizationUpdatedEnvelope, type CustomizationsQueryBuilder, type CustomizationsQueryResult, type DeleteCustomizationRequest, type DeleteCustomizationResponse, type DeleteCustomizationValidationErrors, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type FocalPoint, type FreeTextSettings, type GetCustomizationOptions, type GetCustomizationRequest, type GetCustomizationResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type MaskedChoice, type MaskedCustomization, type MessageEnvelope, type MultipleColors, type Page, type Pages, type QueryCustomizationsOptions, type QueryCustomizationsRequest, type QueryCustomizationsResponse, type RecloneSiteRequest, type RecloneSiteResponse, type RemoveCustomizationChoicesApplicationErrors, type RemoveCustomizationChoicesOptions, type RemoveCustomizationChoicesRequest, type RemoveCustomizationChoicesResponse, type RemoveCustomizationChoicesValidationErrors, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type SetCustomizationChoicesApplicationErrors, type SetCustomizationChoicesOptions, type SetCustomizationChoicesRequest, type SetCustomizationChoicesResponse, type SetCustomizationChoicesValidationErrors, SortOrder, type SortOrderWithLiterals, type Sorting, type URI, type URIs, type UpdateCustomization, type UpdateCustomizationChoicesApplicationErrors, type UpdateCustomizationChoicesOptions, type UpdateCustomizationChoicesRequest, type UpdateCustomizationChoicesResponse, type UpdateCustomizationChoicesValidationErrors, type UpdateCustomizationOptions, type UpdateCustomizationRequest, type UpdateCustomizationResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addCustomizationChoices, bulkAddCustomizationChoices, bulkCreateCustomizations, bulkUpdateCustomizations, createCustomization, deleteCustomization, getCustomization, onCustomizationCreated, onCustomizationDeleted, onCustomizationUpdated, queryCustomizations, removeCustomizationChoices, setCustomizationChoices, typedQueryCustomizations, updateCustomization, utils };
|
|
1924
|
+
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddCustomizationChoicesApplicationErrors, type AddCustomizationChoicesOptions, type AddCustomizationChoicesRequest, type AddCustomizationChoicesResponse, type AddCustomizationChoicesValidationErrors, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkAddCustomizationChoicesApplicationErrors, type BulkAddCustomizationChoicesOptions, type BulkAddCustomizationChoicesRequest, type BulkAddCustomizationChoicesResponse, type BulkAddCustomizationChoicesValidationErrors, type BulkCreateCustomizationsApplicationErrors, type BulkCreateCustomizationsForMigrationRequest, type BulkCreateCustomizationsForMigrationResponse, type BulkCreateCustomizationsOptions, type BulkCreateCustomizationsRequest, type BulkCreateCustomizationsResponse, type BulkCreateCustomizationsValidationErrors, type BulkCustomizationResult, type BulkUpdateCustomizationsOptions, type BulkUpdateCustomizationsRequest, type BulkUpdateCustomizationsResponse, type Choice, type ChoiceIdsMismatchData, ChoiceSortStrategy, type ChoiceSortStrategyWithLiterals, ChoiceType, type ChoiceTypeWithLiterals, type ChoiceValueOneOf, type ChoicesSettings, type CommonQueryWithEntityContext, type CreateCustomizationApplicationErrors, type CreateCustomizationRequest, type CreateCustomizationResponse, type CreateCustomizationValidationErrors, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomTag, type Customization, type CustomizationChoices, type CustomizationCreatedEnvelope, type CustomizationCustomizationSettingsOneOf, type CustomizationDeletedEnvelope, type CustomizationIdsWrapper, type CustomizationQuery, type CustomizationQuerySpec, CustomizationRenderType, type CustomizationRenderTypeWithLiterals, CustomizationType, type CustomizationTypeWithLiterals, type CustomizationUpdatedEnvelope, type CustomizationsQueryBuilder, type CustomizationsQueryResult, type DeleteCustomizationRequest, type DeleteCustomizationResponse, type DeleteCustomizationValidationErrors, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type FocalPoint, type FreeTextSettings, type GetCustomizationOptions, type GetCustomizationRequest, type GetCustomizationResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateCache, type InvalidateCacheGetByOneOf, type ItemMetadata, type MaskedChoice, type MaskedCustomization, type MessageEnvelope, type MultipleColors, type Page, type Pages, type QueryCustomizationsOptions, type QueryCustomizationsRequest, type QueryCustomizationsResponse, type RecloneSiteRequest, type RecloneSiteResponse, type RemoveCustomizationChoicesApplicationErrors, type RemoveCustomizationChoicesOptions, type RemoveCustomizationChoicesRequest, type RemoveCustomizationChoicesResponse, type RemoveCustomizationChoicesValidationErrors, type ReorderCustomizationChoicesApplicationErrors, type ReorderCustomizationChoicesOptions, type ReorderCustomizationChoicesRequest, type ReorderCustomizationChoicesResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type SetCustomizationChoicesApplicationErrors, type SetCustomizationChoicesOptions, type SetCustomizationChoicesRequest, type SetCustomizationChoicesResponse, type SetCustomizationChoicesValidationErrors, SortOrder, type SortOrderWithLiterals, type Sorting, type URI, type URIs, type UpdateCustomization, type UpdateCustomizationChoicesApplicationErrors, type UpdateCustomizationChoicesOptions, type UpdateCustomizationChoicesRequest, type UpdateCustomizationChoicesResponse, type UpdateCustomizationChoicesValidationErrors, type UpdateCustomizationOptions, type UpdateCustomizationRequest, type UpdateCustomizationResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addCustomizationChoices, bulkAddCustomizationChoices, bulkCreateCustomizations, bulkUpdateCustomizations, createCustomization, deleteCustomization, getCustomization, onCustomizationCreated, onCustomizationDeleted, onCustomizationUpdated, queryCustomizations, removeCustomizationChoices, setCustomizationChoices, typedQueryCustomizations, updateCustomization, utils };
|
|
@@ -599,6 +599,50 @@ function updateCustomizationChoices(payload) {
|
|
|
599
599
|
}
|
|
600
600
|
return __updateCustomizationChoices;
|
|
601
601
|
}
|
|
602
|
+
function reorderCustomizationChoices(payload) {
|
|
603
|
+
function __reorderCustomizationChoices({ host }) {
|
|
604
|
+
const metadata = {
|
|
605
|
+
entityFqdn: "wix.stores.catalog.v3.customization",
|
|
606
|
+
method: "POST",
|
|
607
|
+
methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.ReorderCustomizationChoices",
|
|
608
|
+
packageName: PACKAGE_NAME,
|
|
609
|
+
migrationOptions: {
|
|
610
|
+
optInTransformResponse: true
|
|
611
|
+
},
|
|
612
|
+
url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
|
|
613
|
+
protoPath: "/v3/customizations/{customizationId}/reorder-choices",
|
|
614
|
+
data: payload,
|
|
615
|
+
host
|
|
616
|
+
}),
|
|
617
|
+
data: payload,
|
|
618
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
619
|
+
{
|
|
620
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
621
|
+
paths: [
|
|
622
|
+
{ path: "customization.createdDate" },
|
|
623
|
+
{ path: "customization.updatedDate" },
|
|
624
|
+
{
|
|
625
|
+
path: "customization.choicesSettings.choices.image.urlExpirationDate"
|
|
626
|
+
}
|
|
627
|
+
]
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
631
|
+
paths: [
|
|
632
|
+
{
|
|
633
|
+
path: "customization.choicesSettings.choices.image.focalPoint.x"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
path: "customization.choicesSettings.choices.image.focalPoint.y"
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
}
|
|
640
|
+
])
|
|
641
|
+
};
|
|
642
|
+
return metadata;
|
|
643
|
+
}
|
|
644
|
+
return __reorderCustomizationChoices;
|
|
645
|
+
}
|
|
602
646
|
function bulkAddCustomizationChoices(payload) {
|
|
603
647
|
function __bulkAddCustomizationChoices({ host }) {
|
|
604
648
|
const serializedData = transformPaths(payload, [
|
|
@@ -736,26 +780,22 @@ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/i
|
|
|
736
780
|
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
737
781
|
import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
|
|
738
782
|
var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
|
|
739
|
-
CustomizationType2["UNKNOWN_CUSTOMIZATION_TYPE"] = "UNKNOWN_CUSTOMIZATION_TYPE";
|
|
740
783
|
CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
|
|
741
784
|
CustomizationType2["MODIFIER"] = "MODIFIER";
|
|
742
785
|
return CustomizationType2;
|
|
743
786
|
})(CustomizationType || {});
|
|
744
787
|
var CustomizationRenderType = /* @__PURE__ */ ((CustomizationRenderType2) => {
|
|
745
|
-
CustomizationRenderType2["UNKNOWN_CUSTOMIZATION_RENDER_TYPE"] = "UNKNOWN_CUSTOMIZATION_RENDER_TYPE";
|
|
746
788
|
CustomizationRenderType2["FREE_TEXT"] = "FREE_TEXT";
|
|
747
789
|
CustomizationRenderType2["TEXT_CHOICES"] = "TEXT_CHOICES";
|
|
748
790
|
CustomizationRenderType2["SWATCH_CHOICES"] = "SWATCH_CHOICES";
|
|
749
791
|
return CustomizationRenderType2;
|
|
750
792
|
})(CustomizationRenderType || {});
|
|
751
793
|
var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
|
|
752
|
-
ChoiceType2["UNKNOWN_CHOICE_TYPE"] = "UNKNOWN_CHOICE_TYPE";
|
|
753
794
|
ChoiceType2["CHOICE_TEXT"] = "CHOICE_TEXT";
|
|
754
795
|
ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
|
|
755
796
|
return ChoiceType2;
|
|
756
797
|
})(ChoiceType || {});
|
|
757
798
|
var ChoiceSortStrategy = /* @__PURE__ */ ((ChoiceSortStrategy2) => {
|
|
758
|
-
ChoiceSortStrategy2["UNKNOWN_CHOICE_SORT_STRATEGY"] = "UNKNOWN_CHOICE_SORT_STRATEGY";
|
|
759
799
|
ChoiceSortStrategy2["DEFAULT"] = "DEFAULT";
|
|
760
800
|
ChoiceSortStrategy2["BY_NAME"] = "BY_NAME";
|
|
761
801
|
ChoiceSortStrategy2["BY_PRODUCT_COUNT"] = "BY_PRODUCT_COUNT";
|
|
@@ -763,7 +803,6 @@ var ChoiceSortStrategy = /* @__PURE__ */ ((ChoiceSortStrategy2) => {
|
|
|
763
803
|
return ChoiceSortStrategy2;
|
|
764
804
|
})(ChoiceSortStrategy || {});
|
|
765
805
|
var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
|
|
766
|
-
RequestedFields2["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
767
806
|
RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
|
|
768
807
|
return RequestedFields2;
|
|
769
808
|
})(RequestedFields || {});
|
|
@@ -1244,6 +1283,48 @@ async function updateCustomizationChoices2(customizationId, revision, options) {
|
|
|
1244
1283
|
throw transformedError;
|
|
1245
1284
|
}
|
|
1246
1285
|
}
|
|
1286
|
+
async function reorderCustomizationChoices2(customizationId, revision, options) {
|
|
1287
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
1288
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1289
|
+
customizationId,
|
|
1290
|
+
revision,
|
|
1291
|
+
choiceIds: options?.choiceIds,
|
|
1292
|
+
fields: options?.fields
|
|
1293
|
+
});
|
|
1294
|
+
const reqOpts = reorderCustomizationChoices(
|
|
1295
|
+
payload
|
|
1296
|
+
);
|
|
1297
|
+
sideEffects?.onSiteCall?.();
|
|
1298
|
+
try {
|
|
1299
|
+
const result = await httpClient.request(reqOpts);
|
|
1300
|
+
sideEffects?.onSuccess?.(result);
|
|
1301
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1302
|
+
transformPaths2(result.data, [
|
|
1303
|
+
{
|
|
1304
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1305
|
+
paths: [{ path: "customization.choicesSettings.choices.image" }]
|
|
1306
|
+
}
|
|
1307
|
+
])
|
|
1308
|
+
);
|
|
1309
|
+
} catch (err) {
|
|
1310
|
+
const transformedError = sdkTransformError(
|
|
1311
|
+
err,
|
|
1312
|
+
{
|
|
1313
|
+
spreadPathsToArguments: {},
|
|
1314
|
+
explicitPathsToArguments: {
|
|
1315
|
+
customizationId: "$[0]",
|
|
1316
|
+
revision: "$[1]",
|
|
1317
|
+
choiceIds: "$[2].choiceIds",
|
|
1318
|
+
fields: "$[2].fields"
|
|
1319
|
+
},
|
|
1320
|
+
singleArgumentUnchanged: false
|
|
1321
|
+
},
|
|
1322
|
+
["customizationId", "revision", "options"]
|
|
1323
|
+
);
|
|
1324
|
+
sideEffects?.onError?.(err);
|
|
1325
|
+
throw transformedError;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1247
1328
|
async function bulkAddCustomizationChoices2(customizationsChoices, options) {
|
|
1248
1329
|
const { httpClient, sideEffects } = arguments[2];
|
|
1249
1330
|
const payload = transformPaths2(
|
|
@@ -1363,6 +1444,7 @@ export {
|
|
|
1363
1444
|
getCustomization2 as getCustomization,
|
|
1364
1445
|
queryCustomizations2 as queryCustomizations,
|
|
1365
1446
|
removeCustomizationChoices2 as removeCustomizationChoices,
|
|
1447
|
+
reorderCustomizationChoices2 as reorderCustomizationChoices,
|
|
1366
1448
|
setCustomizationChoices2 as setCustomizationChoices,
|
|
1367
1449
|
typedQueryCustomizations,
|
|
1368
1450
|
updateCustomization2 as updateCustomization,
|