@wix/auto_sdk_stores_customizations-v-3 1.0.68 → 1.0.70

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +1 -1
  2. package/build/cjs/index.js +108 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +75 -1
  5. package/build/cjs/index.typings.js +98 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +63 -2
  8. package/build/cjs/meta.js +76 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +1 -1
  11. package/build/es/index.mjs +106 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +75 -1
  14. package/build/es/index.typings.mjs +96 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +63 -2
  17. package/build/es/meta.mjs +74 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +19 -3
  20. package/build/internal/cjs/index.js +108 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +100 -1
  23. package/build/internal/cjs/index.typings.js +98 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +63 -2
  26. package/build/internal/cjs/meta.js +76 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +19 -3
  29. package/build/internal/es/index.mjs +106 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +100 -1
  32. package/build/internal/es/index.typings.mjs +96 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +63 -2
  35. package/build/internal/es/meta.mjs +74 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -142,6 +142,7 @@ interface FreeTextSettings {
142
142
  */
143
143
  key?: string | null;
144
144
  }
145
+ /** Settings for choice-based customizations. */
145
146
  interface ChoicesSettings {
146
147
  /**
147
148
  * List of choices.
@@ -234,6 +235,19 @@ interface FocalPoint {
234
235
  /** crop by width */
235
236
  width?: number | null;
236
237
  }
238
+ declare enum ChoiceSortStrategy {
239
+ UNKNOWN_CHOICE_SORT_STRATEGY = "UNKNOWN_CHOICE_SORT_STRATEGY",
240
+ /** Default. Text choices are sorted by name, swatch choices are sorted by product count. */
241
+ DEFAULT = "DEFAULT",
242
+ /** Alphabetically by name, case-insensitive. Numeric values are sorted first. */
243
+ BY_NAME = "BY_NAME",
244
+ /** By the number of products assigned to each choice, in descending order. */
245
+ BY_PRODUCT_COUNT = "BY_PRODUCT_COUNT",
246
+ /** 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
+ MANUAL = "MANUAL"
248
+ }
249
+ /** @enumType */
250
+ type ChoiceSortStrategyWithLiterals = ChoiceSortStrategy | 'UNKNOWN_CHOICE_SORT_STRATEGY' | 'DEFAULT' | 'BY_NAME' | 'BY_PRODUCT_COUNT' | 'MANUAL';
237
251
  interface InvalidateCache extends InvalidateCacheGetByOneOf {
238
252
  /**
239
253
  * Invalidate by msId. NOT recommended, as this will invalidate the entire site cache!
@@ -766,6 +780,40 @@ interface UpdateCustomizationChoicesResponse {
766
780
  /** Updated customization. */
767
781
  customization?: Customization;
768
782
  }
783
+ interface ReorderCustomizationChoicesRequest {
784
+ /**
785
+ * Customization ID.
786
+ * @format GUID
787
+ */
788
+ customizationId: string;
789
+ /** 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. */
790
+ revision: string;
791
+ /**
792
+ * 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.
793
+ * @format GUID
794
+ * @minSize 1
795
+ * @maxSize 200
796
+ */
797
+ choiceIds: string[];
798
+ /**
799
+ * Fields to include in the response.
800
+ *
801
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
802
+ * @maxSize 100
803
+ */
804
+ fields?: RequestedFieldsWithLiterals[];
805
+ }
806
+ interface ReorderCustomizationChoicesResponse {
807
+ /** Updated customization. */
808
+ customization?: Customization;
809
+ }
810
+ /** Additional error details returned with the `CHOICE_IDS_MISMATCH` error. */
811
+ interface ChoiceIdsMismatchData {
812
+ /** Choice IDs that exist in the customization but are missing from the request. */
813
+ missingIds?: string[];
814
+ /** Choice IDs included in the request that don't exist in the customization. */
815
+ extraIds?: string[];
816
+ }
769
817
  interface BulkAddCustomizationChoicesRequest {
770
818
  /**
771
819
  * List of customization IDs and choices.
@@ -1166,6 +1214,16 @@ type UpdateCustomizationChoicesValidationErrors = {
1166
1214
  ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
1167
1215
  };
1168
1216
  /** @docsIgnore */
1217
+ type ReorderCustomizationChoicesApplicationErrors = {
1218
+ code?: 'DOESNT_SUPPORT_CHOICES';
1219
+ description?: string;
1220
+ data?: Record<string, any>;
1221
+ } | {
1222
+ code?: 'CHOICE_IDS_MISMATCH';
1223
+ description?: string;
1224
+ data?: ChoiceIdsMismatchData;
1225
+ };
1226
+ /** @docsIgnore */
1169
1227
  type BulkAddCustomizationChoicesApplicationErrors = {
1170
1228
  code?: 'CHOICES_LIMIT_EXCEEDED';
1171
1229
  description?: string;
@@ -1790,6 +1848,22 @@ interface UpdateCustomizationChoicesOptions {
1790
1848
  */
1791
1849
  fields?: RequestedFieldsWithLiterals[];
1792
1850
  }
1851
+ interface ReorderCustomizationChoicesOptions {
1852
+ /**
1853
+ * 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.
1854
+ * @format GUID
1855
+ * @minSize 1
1856
+ * @maxSize 200
1857
+ */
1858
+ choiceIds: string[];
1859
+ /**
1860
+ * Fields to include in the response.
1861
+ *
1862
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
1863
+ * @maxSize 100
1864
+ */
1865
+ fields?: RequestedFieldsWithLiterals[];
1866
+ }
1793
1867
  /**
1794
1868
  * Adds choices to multiple customizations.
1795
1869
  * @param customizationsChoices - List of customization IDs and choices.
@@ -1853,4 +1927,4 @@ interface BulkUpdateCustomizationsOptions {
1853
1927
  fields?: RequestedFieldsWithLiterals[];
1854
1928
  }
1855
1929
 
1856
- 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, 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 };
1930
+ 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 };
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // index.typings.ts
21
21
  var index_typings_exports = {};
22
22
  __export(index_typings_exports, {
23
+ ChoiceSortStrategy: () => ChoiceSortStrategy,
23
24
  ChoiceType: () => ChoiceType,
24
25
  CustomizationRenderType: () => CustomizationRenderType,
25
26
  CustomizationType: () => CustomizationType,
@@ -35,6 +36,7 @@ __export(index_typings_exports, {
35
36
  getCustomization: () => getCustomization2,
36
37
  queryCustomizations: () => queryCustomizations2,
37
38
  removeCustomizationChoices: () => removeCustomizationChoices2,
39
+ reorderCustomizationChoices: () => reorderCustomizationChoices2,
38
40
  setCustomizationChoices: () => setCustomizationChoices2,
39
41
  typedQueryCustomizations: () => typedQueryCustomizations,
40
42
  updateCustomization: () => updateCustomization2,
@@ -641,6 +643,50 @@ function updateCustomizationChoices(payload) {
641
643
  }
642
644
  return __updateCustomizationChoices;
643
645
  }
646
+ function reorderCustomizationChoices(payload) {
647
+ function __reorderCustomizationChoices({ host }) {
648
+ const metadata = {
649
+ entityFqdn: "wix.stores.catalog.v3.customization",
650
+ method: "POST",
651
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.ReorderCustomizationChoices",
652
+ packageName: PACKAGE_NAME,
653
+ migrationOptions: {
654
+ optInTransformResponse: true
655
+ },
656
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
657
+ protoPath: "/v3/customizations/{customizationId}/reorder-choices",
658
+ data: payload,
659
+ host
660
+ }),
661
+ data: payload,
662
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
663
+ {
664
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
665
+ paths: [
666
+ { path: "customization.createdDate" },
667
+ { path: "customization.updatedDate" },
668
+ {
669
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
670
+ }
671
+ ]
672
+ },
673
+ {
674
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
675
+ paths: [
676
+ {
677
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
678
+ },
679
+ {
680
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
681
+ }
682
+ ]
683
+ }
684
+ ])
685
+ };
686
+ return metadata;
687
+ }
688
+ return __reorderCustomizationChoices;
689
+ }
644
690
  function bulkAddCustomizationChoices(payload) {
645
691
  function __bulkAddCustomizationChoices({ host }) {
646
692
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
@@ -796,6 +842,14 @@ var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
796
842
  ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
797
843
  return ChoiceType2;
798
844
  })(ChoiceType || {});
845
+ var ChoiceSortStrategy = /* @__PURE__ */ ((ChoiceSortStrategy2) => {
846
+ ChoiceSortStrategy2["UNKNOWN_CHOICE_SORT_STRATEGY"] = "UNKNOWN_CHOICE_SORT_STRATEGY";
847
+ ChoiceSortStrategy2["DEFAULT"] = "DEFAULT";
848
+ ChoiceSortStrategy2["BY_NAME"] = "BY_NAME";
849
+ ChoiceSortStrategy2["BY_PRODUCT_COUNT"] = "BY_PRODUCT_COUNT";
850
+ ChoiceSortStrategy2["MANUAL"] = "MANUAL";
851
+ return ChoiceSortStrategy2;
852
+ })(ChoiceSortStrategy || {});
799
853
  var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
800
854
  RequestedFields2["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
801
855
  RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
@@ -1278,6 +1332,48 @@ async function updateCustomizationChoices2(customizationId, revision, options) {
1278
1332
  throw transformedError;
1279
1333
  }
1280
1334
  }
1335
+ async function reorderCustomizationChoices2(customizationId, revision, options) {
1336
+ const { httpClient, sideEffects } = arguments[3];
1337
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1338
+ customizationId,
1339
+ revision,
1340
+ choiceIds: options?.choiceIds,
1341
+ fields: options?.fields
1342
+ });
1343
+ const reqOpts = reorderCustomizationChoices(
1344
+ payload
1345
+ );
1346
+ sideEffects?.onSiteCall?.();
1347
+ try {
1348
+ const result = await httpClient.request(reqOpts);
1349
+ sideEffects?.onSuccess?.(result);
1350
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1351
+ (0, import_transform_paths2.transformPaths)(result.data, [
1352
+ {
1353
+ transformFn: import_image2.transformRESTImageToSDKImage,
1354
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
1355
+ }
1356
+ ])
1357
+ );
1358
+ } catch (err) {
1359
+ const transformedError = (0, import_transform_error.transformError)(
1360
+ err,
1361
+ {
1362
+ spreadPathsToArguments: {},
1363
+ explicitPathsToArguments: {
1364
+ customizationId: "$[0]",
1365
+ revision: "$[1]",
1366
+ choiceIds: "$[2].choiceIds",
1367
+ fields: "$[2].fields"
1368
+ },
1369
+ singleArgumentUnchanged: false
1370
+ },
1371
+ ["customizationId", "revision", "options"]
1372
+ );
1373
+ sideEffects?.onError?.(err);
1374
+ throw transformedError;
1375
+ }
1376
+ }
1281
1377
  async function bulkAddCustomizationChoices2(customizationsChoices, options) {
1282
1378
  const { httpClient, sideEffects } = arguments[2];
1283
1379
  const payload = (0, import_transform_paths2.transformPaths)(
@@ -1382,6 +1478,7 @@ async function bulkUpdateCustomizations2(customizations, options) {
1382
1478
  }
1383
1479
  // Annotate the CommonJS export names for ESM import in node:
1384
1480
  0 && (module.exports = {
1481
+ ChoiceSortStrategy,
1385
1482
  ChoiceType,
1386
1483
  CustomizationRenderType,
1387
1484
  CustomizationType,
@@ -1397,6 +1494,7 @@ async function bulkUpdateCustomizations2(customizations, options) {
1397
1494
  getCustomization,
1398
1495
  queryCustomizations,
1399
1496
  removeCustomizationChoices,
1497
+ reorderCustomizationChoices,
1400
1498
  setCustomizationChoices,
1401
1499
  typedQueryCustomizations,
1402
1500
  updateCustomization,