@wix/auto_sdk_stores_customizations-v-3 1.0.67 → 1.0.68

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 +123 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +98 -1
  5. package/build/cjs/index.typings.js +113 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +87 -2
  8. package/build/cjs/meta.js +85 -2
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +1 -1
  11. package/build/es/index.mjs +122 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +98 -1
  14. package/build/es/index.typings.mjs +112 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +87 -2
  17. package/build/es/meta.mjs +83 -1
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +23 -3
  20. package/build/internal/cjs/index.js +123 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +134 -1
  23. package/build/internal/cjs/index.typings.js +113 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +87 -2
  26. package/build/internal/cjs/meta.js +85 -2
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +23 -3
  29. package/build/internal/es/index.mjs +122 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +134 -1
  32. package/build/internal/es/index.typings.mjs +112 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +87 -2
  35. package/build/internal/es/meta.mjs +83 -1
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -732,6 +732,40 @@ interface RemoveCustomizationChoicesResponse {
732
732
  /** Updated customization. */
733
733
  customization?: Customization;
734
734
  }
735
+ interface UpdateCustomizationChoicesRequest {
736
+ /**
737
+ * Customization ID.
738
+ * @format GUID
739
+ */
740
+ customizationId: string;
741
+ /**
742
+ * Revision number, which increments by 1 each time the customization is updated.
743
+ * To prevent conflicting changes,
744
+ * the current revision must be passed when updating the customization.
745
+ */
746
+ revision: string;
747
+ /**
748
+ * Choices to update. Each item must include a `choice` with a valid `id` matching an existing choice in the customization.
749
+ * @minSize 1
750
+ * @maxSize 100
751
+ */
752
+ choices: MaskedChoice[];
753
+ /**
754
+ * Fields to include in the response.
755
+ *
756
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
757
+ * @maxSize 100
758
+ */
759
+ fields?: RequestedFieldsWithLiterals[];
760
+ }
761
+ interface MaskedChoice {
762
+ /** Choice to update. */
763
+ choice?: Choice;
764
+ }
765
+ interface UpdateCustomizationChoicesResponse {
766
+ /** Updated customization. */
767
+ customization?: Customization;
768
+ }
735
769
  interface BulkAddCustomizationChoicesRequest {
736
770
  /**
737
771
  * List of customization IDs and choices.
@@ -1002,6 +1036,12 @@ type CreateCustomizationValidationErrors = {
1002
1036
  ruleName?: 'MIXED_CHOICE_IDS_CONSISTENCY';
1003
1037
  } | {
1004
1038
  ruleName?: 'ID_NOT_ALLOWED_IN_REQUEST';
1039
+ } | {
1040
+ ruleName?: 'PARENT_CHOICE_SELF_REFERENCE';
1041
+ } | {
1042
+ ruleName?: 'PARENT_CHOICE_NOT_FOUND';
1043
+ } | {
1044
+ ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
1005
1045
  };
1006
1046
  /** @docsIgnore */
1007
1047
  type DeleteCustomizationValidationErrors = {
@@ -1040,6 +1080,12 @@ type BulkCreateCustomizationsValidationErrors = {
1040
1080
  ruleName?: 'MIXED_CHOICE_IDS_CONSISTENCY';
1041
1081
  } | {
1042
1082
  ruleName?: 'ID_NOT_ALLOWED_IN_REQUEST';
1083
+ } | {
1084
+ ruleName?: 'PARENT_CHOICE_SELF_REFERENCE';
1085
+ } | {
1086
+ ruleName?: 'PARENT_CHOICE_NOT_FOUND';
1087
+ } | {
1088
+ ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
1043
1089
  };
1044
1090
  /** @docsIgnore */
1045
1091
  type AddCustomizationChoicesApplicationErrors = {
@@ -1058,6 +1104,12 @@ type AddCustomizationChoicesValidationErrors = {
1058
1104
  ruleName?: 'INVALID_CHOICE_VALUE';
1059
1105
  } | {
1060
1106
  ruleName?: 'DUPLICATE_CHOICE_NAME';
1107
+ } | {
1108
+ ruleName?: 'PARENT_CHOICE_SELF_REFERENCE';
1109
+ } | {
1110
+ ruleName?: 'PARENT_CHOICE_NOT_FOUND';
1111
+ } | {
1112
+ ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
1061
1113
  };
1062
1114
  /** @docsIgnore */
1063
1115
  type SetCustomizationChoicesApplicationErrors = {
@@ -1078,6 +1130,12 @@ type SetCustomizationChoicesValidationErrors = {
1078
1130
  ruleName?: 'NOT_ALLOWED_DELETE_CHOICE_ASSIGNED_TO_PRODUCT';
1079
1131
  } | {
1080
1132
  ruleName?: 'DUPLICATE_CHOICE_NAME';
1133
+ } | {
1134
+ ruleName?: 'PARENT_CHOICE_SELF_REFERENCE';
1135
+ } | {
1136
+ ruleName?: 'PARENT_CHOICE_NOT_FOUND';
1137
+ } | {
1138
+ ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
1081
1139
  };
1082
1140
  /** @docsIgnore */
1083
1141
  type RemoveCustomizationChoicesApplicationErrors = {
@@ -1088,6 +1146,24 @@ type RemoveCustomizationChoicesApplicationErrors = {
1088
1146
  /** @docsIgnore */
1089
1147
  type RemoveCustomizationChoicesValidationErrors = {
1090
1148
  ruleName?: 'NOT_ALLOWED_CUSTOMIZATION_WITHOUT_CHOICES';
1149
+ } | {
1150
+ ruleName?: 'PARENT_CHOICE_DELETE_REFERENCED';
1151
+ };
1152
+ /** @docsIgnore */
1153
+ type UpdateCustomizationChoicesApplicationErrors = {
1154
+ code?: 'CHOICE_NOT_FOUND';
1155
+ description?: string;
1156
+ data?: Record<string, any>;
1157
+ };
1158
+ /** @docsIgnore */
1159
+ type UpdateCustomizationChoicesValidationErrors = {
1160
+ ruleName?: 'UNSUPPORTED_CHOICE_FIELD';
1161
+ } | {
1162
+ ruleName?: 'PARENT_CHOICE_SELF_REFERENCE';
1163
+ } | {
1164
+ ruleName?: 'PARENT_CHOICE_NOT_FOUND';
1165
+ } | {
1166
+ ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
1091
1167
  };
1092
1168
  /** @docsIgnore */
1093
1169
  type BulkAddCustomizationChoicesApplicationErrors = {
@@ -1104,6 +1180,12 @@ type BulkAddCustomizationChoicesValidationErrors = {
1104
1180
  ruleName?: 'INVALID_CHOICE_TYPE';
1105
1181
  } | {
1106
1182
  ruleName?: 'INVALID_CHOICE_VALUE';
1183
+ } | {
1184
+ ruleName?: 'PARENT_CHOICE_SELF_REFERENCE';
1185
+ } | {
1186
+ ruleName?: 'PARENT_CHOICE_NOT_FOUND';
1187
+ } | {
1188
+ ruleName?: 'PARENT_CHOICE_HIERARCHY_VIOLATION';
1107
1189
  };
1108
1190
  interface BaseEventMetadata {
1109
1191
  /**
@@ -1693,6 +1775,21 @@ interface RemoveCustomizationChoicesOptions {
1693
1775
  */
1694
1776
  fields?: RequestedFieldsWithLiterals[];
1695
1777
  }
1778
+ interface UpdateCustomizationChoicesOptions {
1779
+ /**
1780
+ * Choices to update. Each item must include a `choice` with a valid `id` matching an existing choice in the customization.
1781
+ * @minSize 1
1782
+ * @maxSize 100
1783
+ */
1784
+ choices: MaskedChoice[];
1785
+ /**
1786
+ * Fields to include in the response.
1787
+ *
1788
+ * Supported values: `ASSIGNED_PRODUCTS_COUNT`
1789
+ * @maxSize 100
1790
+ */
1791
+ fields?: RequestedFieldsWithLiterals[];
1792
+ }
1696
1793
  /**
1697
1794
  * Adds choices to multiple customizations.
1698
1795
  * @param customizationsChoices - List of customization IDs and choices.
@@ -1756,4 +1853,4 @@ interface BulkUpdateCustomizationsOptions {
1756
1853
  fields?: RequestedFieldsWithLiterals[];
1757
1854
  }
1758
1855
 
1759
- 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 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 UpdateCustomizationOptions, type UpdateCustomizationRequest, type UpdateCustomizationResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addCustomizationChoices, bulkAddCustomizationChoices, bulkCreateCustomizations, bulkUpdateCustomizations, createCustomization, deleteCustomization, getCustomization, onCustomizationCreated, onCustomizationDeleted, onCustomizationUpdated, queryCustomizations, removeCustomizationChoices, setCustomizationChoices, typedQueryCustomizations, updateCustomization, utils };
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 };
@@ -538,6 +538,67 @@ function removeCustomizationChoices(payload) {
538
538
  }
539
539
  return __removeCustomizationChoices;
540
540
  }
541
+ function updateCustomizationChoices(payload) {
542
+ function __updateCustomizationChoices({ host }) {
543
+ const serializedData = transformPaths(payload, [
544
+ {
545
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
546
+ paths: [{ path: "choices.fieldMask" }]
547
+ },
548
+ {
549
+ transformFn: transformSDKTimestampToRESTTimestamp,
550
+ paths: [{ path: "choices.choice.image.urlExpirationDate" }]
551
+ },
552
+ {
553
+ transformFn: transformSDKFloatToRESTFloat,
554
+ paths: [
555
+ { path: "choices.choice.image.focalPoint.x" },
556
+ { path: "choices.choice.image.focalPoint.y" }
557
+ ]
558
+ }
559
+ ]);
560
+ const metadata = {
561
+ entityFqdn: "wix.stores.catalog.v3.customization",
562
+ method: "POST",
563
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomizationChoices",
564
+ packageName: PACKAGE_NAME,
565
+ migrationOptions: {
566
+ optInTransformResponse: true
567
+ },
568
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
569
+ protoPath: "/v3/customizations/{customizationId}/update-choices",
570
+ data: serializedData,
571
+ host
572
+ }),
573
+ data: serializedData,
574
+ transformResponse: (payload2) => transformPaths(payload2, [
575
+ {
576
+ transformFn: transformRESTTimestampToSDKTimestamp,
577
+ paths: [
578
+ { path: "customization.createdDate" },
579
+ { path: "customization.updatedDate" },
580
+ {
581
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
582
+ }
583
+ ]
584
+ },
585
+ {
586
+ transformFn: transformRESTFloatToSDKFloat,
587
+ paths: [
588
+ {
589
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
590
+ },
591
+ {
592
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
593
+ }
594
+ ]
595
+ }
596
+ ])
597
+ };
598
+ return metadata;
599
+ }
600
+ return __updateCustomizationChoices;
601
+ }
541
602
  function bulkAddCustomizationChoices(payload) {
542
603
  function __bulkAddCustomizationChoices({ host }) {
543
604
  const serializedData = transformPaths(payload, [
@@ -1125,6 +1186,56 @@ async function removeCustomizationChoices2(customizationId, choiceIds, options)
1125
1186
  throw transformedError;
1126
1187
  }
1127
1188
  }
1189
+ async function updateCustomizationChoices2(customizationId, revision, options) {
1190
+ const { httpClient, sideEffects } = arguments[3];
1191
+ const payload = transformPaths2(
1192
+ renameKeysFromSDKRequestToRESTRequest({
1193
+ customizationId,
1194
+ revision,
1195
+ choices: options?.choices,
1196
+ fields: options?.fields
1197
+ }),
1198
+ [
1199
+ {
1200
+ transformFn: transformSDKImageToRESTImage,
1201
+ paths: [{ path: "choices.choice.image" }]
1202
+ }
1203
+ ]
1204
+ );
1205
+ const reqOpts = updateCustomizationChoices(
1206
+ payload
1207
+ );
1208
+ sideEffects?.onSiteCall?.();
1209
+ try {
1210
+ const result = await httpClient.request(reqOpts);
1211
+ sideEffects?.onSuccess?.(result);
1212
+ return renameKeysFromRESTResponseToSDKResponse(
1213
+ transformPaths2(result.data, [
1214
+ {
1215
+ transformFn: transformRESTImageToSDKImage,
1216
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
1217
+ }
1218
+ ])
1219
+ );
1220
+ } catch (err) {
1221
+ const transformedError = sdkTransformError(
1222
+ err,
1223
+ {
1224
+ spreadPathsToArguments: {},
1225
+ explicitPathsToArguments: {
1226
+ customizationId: "$[0]",
1227
+ revision: "$[1]",
1228
+ choices: "$[2].choices",
1229
+ fields: "$[2].fields"
1230
+ },
1231
+ singleArgumentUnchanged: false
1232
+ },
1233
+ ["customizationId", "revision", "options"]
1234
+ );
1235
+ sideEffects?.onError?.(err);
1236
+ throw transformedError;
1237
+ }
1238
+ }
1128
1239
  async function bulkAddCustomizationChoices2(customizationsChoices, options) {
1129
1240
  const { httpClient, sideEffects } = arguments[2];
1130
1241
  const payload = transformPaths2(
@@ -1246,6 +1357,7 @@ export {
1246
1357
  setCustomizationChoices2 as setCustomizationChoices,
1247
1358
  typedQueryCustomizations,
1248
1359
  updateCustomization2 as updateCustomization,
1360
+ updateCustomizationChoices2 as updateCustomizationChoices,
1249
1361
  utils
1250
1362
  };
1251
1363
  //# sourceMappingURL=index.typings.mjs.map