@wix/auto_sdk_stores_customizations-v-3 1.0.16 → 1.0.17

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 (134) hide show
  1. package/build/index.d.mts +154 -0
  2. package/build/index.d.ts +154 -0
  3. package/build/index.js +1389 -0
  4. package/build/index.js.map +1 -0
  5. package/build/index.mjs +1346 -0
  6. package/build/index.mjs.map +1 -0
  7. package/build/internal/index.d.mts +154 -0
  8. package/build/internal/index.d.ts +154 -0
  9. package/build/internal/index.js +1389 -0
  10. package/build/internal/index.js.map +1 -0
  11. package/build/internal/index.mjs +1346 -0
  12. package/build/internal/index.mjs.map +1 -0
  13. package/build/internal/meta.d.mts +619 -0
  14. package/build/internal/meta.d.ts +619 -0
  15. package/build/internal/meta.js +873 -0
  16. package/build/internal/meta.js.map +1 -0
  17. package/build/internal/meta.mjs +836 -0
  18. package/build/internal/meta.mjs.map +1 -0
  19. package/build/{es/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → internal/stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.mts} +377 -108
  20. package/build/{cjs/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → internal/stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.ts} +377 -108
  21. package/build/meta.d.mts +619 -0
  22. package/build/meta.d.ts +619 -0
  23. package/build/meta.js +873 -0
  24. package/build/meta.js.map +1 -0
  25. package/build/meta.mjs +836 -0
  26. package/build/meta.mjs.map +1 -0
  27. package/build/{internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.mts} +377 -108
  28. package/build/{internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.ts} +377 -108
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  40. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -40
  41. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  42. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  43. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -683
  44. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  45. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  46. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -237
  47. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  48. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  49. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -126
  50. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  51. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -54
  52. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  53. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  54. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -819
  55. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  67. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -31
  68. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  69. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  70. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -669
  71. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  72. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  73. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -200
  74. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  75. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  76. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -106
  77. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  78. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -51
  79. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  80. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  81. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -782
  82. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  93. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -40
  94. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  95. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  96. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -683
  97. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  98. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  99. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -237
  100. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  101. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  102. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -126
  103. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  104. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -54
  105. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  106. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  107. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -819
  108. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  119. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -31
  120. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  121. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  122. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -669
  123. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  124. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  125. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -200
  126. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  127. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  128. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -106
  129. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  130. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -51
  131. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  132. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  133. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -782
  134. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
@@ -1,819 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.bulkUpdateCustomizations = exports.bulkAddCustomizationChoices = exports.removeCustomizationChoices = exports.setCustomizationChoices = exports.addCustomizationChoices = exports.bulkCreateCustomizations = exports.queryCustomizations = exports.deleteCustomization = exports.updateCustomization = exports.getCustomization = exports.createCustomization = exports.WebhookIdentityType = exports.SortOrder = exports.RequestedFields = exports.ChoiceType = exports.CustomizationRenderType = exports.CustomizationType = void 0;
27
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
- const query_builder_1 = require("@wix/sdk-runtime/query-builder");
29
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
30
- const ambassadorWixStoresCatalogV3Customization = __importStar(require("./stores-catalog-v3-customization-customizations-v-3.http.js"));
31
- // @ts-ignore
32
- const image_1 = require("@wix/sdk-runtime/transformations/image");
33
- const image_2 = require("@wix/sdk-runtime/transformations/image");
34
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
35
- var CustomizationType;
36
- (function (CustomizationType) {
37
- CustomizationType["UNKNOWN_CUSTOMIZATION_TYPE"] = "UNKNOWN_CUSTOMIZATION_TYPE";
38
- CustomizationType["PRODUCT_OPTION"] = "PRODUCT_OPTION";
39
- CustomizationType["MODIFIER"] = "MODIFIER";
40
- })(CustomizationType || (exports.CustomizationType = CustomizationType = {}));
41
- var CustomizationRenderType;
42
- (function (CustomizationRenderType) {
43
- CustomizationRenderType["UNKNOWN_CUSTOMIZATION_RENDER_TYPE"] = "UNKNOWN_CUSTOMIZATION_RENDER_TYPE";
44
- /** Customization by free text input. */
45
- CustomizationRenderType["FREE_TEXT"] = "FREE_TEXT";
46
- /** Customization by selection of text choices. */
47
- CustomizationRenderType["TEXT_CHOICES"] = "TEXT_CHOICES";
48
- /** Customization by selection of colors. */
49
- CustomizationRenderType["SWATCH_CHOICES"] = "SWATCH_CHOICES";
50
- })(CustomizationRenderType || (exports.CustomizationRenderType = CustomizationRenderType = {}));
51
- var ChoiceType;
52
- (function (ChoiceType) {
53
- ChoiceType["UNKNOWN_CHOICE_TYPE"] = "UNKNOWN_CHOICE_TYPE";
54
- /** For a `customizationRenderType` of `TEXT_CHOICES` and `FREE_TEXT`. */
55
- ChoiceType["CHOICE_TEXT"] = "CHOICE_TEXT";
56
- /** For `customizationRenderType: SWATCH_CHOICES`. */
57
- ChoiceType["ONE_COLOR"] = "ONE_COLOR";
58
- /** For `customizationRenderType: SWATCH_CHOICES`. */
59
- ChoiceType["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
60
- /** For `customizationRenderType: SWATCH_CHOICES`. */
61
- ChoiceType["IMAGE"] = "IMAGE";
62
- })(ChoiceType || (exports.ChoiceType = ChoiceType = {}));
63
- var RequestedFields;
64
- (function (RequestedFields) {
65
- /** Unknown requested field. */
66
- RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
67
- /** Assigned products count. */
68
- RequestedFields["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
69
- })(RequestedFields || (exports.RequestedFields = RequestedFields = {}));
70
- var SortOrder;
71
- (function (SortOrder) {
72
- /** Ascending order. */
73
- SortOrder["ASC"] = "ASC";
74
- /** Descending order. */
75
- SortOrder["DESC"] = "DESC";
76
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
77
- var WebhookIdentityType;
78
- (function (WebhookIdentityType) {
79
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
80
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
81
- WebhookIdentityType["MEMBER"] = "MEMBER";
82
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
83
- WebhookIdentityType["APP"] = "APP";
84
- })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
85
- /**
86
- * Creates a customization.
87
- * @param customization - Customization to create.
88
- * @public
89
- * @documentationMaturity preview
90
- * @requiredField customization
91
- * @requiredField customization.customizationRenderType
92
- * @requiredField customization.customizationSettings
93
- * @requiredField customization.customizationType
94
- * @requiredField customization.freeTextInput.title
95
- * @requiredField customization.name
96
- * @permissionId WIX_STORES.CUSTOMIZATION_CREATE
97
- * @permissionScope Manage Stores - all permissions
98
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
99
- * @permissionScope Manage Stores
100
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
101
- * @permissionScope Customization write in v3 catalog
102
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
103
- * @permissionScope Manage Products
104
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
105
- * @permissionScope Product write in v3 catalog
106
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
107
- * @permissionScope Manage v3 catalog
108
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
109
- * @applicableIdentity APP
110
- * @returns Created customization.
111
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.CreateCustomization
112
- */
113
- async function createCustomization(customization) {
114
- // @ts-ignore
115
- const { httpClient, sideEffects } = arguments[1];
116
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ customization: customization }), [
117
- {
118
- transformFn: image_1.transformSDKImageToRESTImage,
119
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
120
- },
121
- ]);
122
- const reqOpts = ambassadorWixStoresCatalogV3Customization.createCustomization(payload);
123
- sideEffects?.onSiteCall?.();
124
- try {
125
- const result = await httpClient.request(reqOpts);
126
- sideEffects?.onSuccess?.(result);
127
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
128
- {
129
- transformFn: image_2.transformRESTImageToSDKImage,
130
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
131
- },
132
- ]))?.customization;
133
- }
134
- catch (err) {
135
- const transformedError = (0, transform_error_1.transformError)(err, {
136
- spreadPathsToArguments: {},
137
- explicitPathsToArguments: { customization: '$[0]' },
138
- singleArgumentUnchanged: false,
139
- }, ['customization']);
140
- sideEffects?.onError?.(err);
141
- throw transformedError;
142
- }
143
- }
144
- exports.createCustomization = createCustomization;
145
- /**
146
- * Retrieves a customization.
147
- * @param customizationId - Customization ID.
148
- * @public
149
- * @documentationMaturity preview
150
- * @requiredField customizationId
151
- * @permissionId WIX_STORES.CUSTOMIZATION_READ
152
- * @permissionScope Manage Stores - all permissions
153
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
154
- * @permissionScope Manage Stores
155
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
156
- * @permissionScope Read v3 catalog
157
- * @permissionScopeId SCOPE.STORES.CATALOG_READ
158
- * @permissionScope Manage Products
159
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
160
- * @permissionScope Read Stores - all read permissions
161
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
162
- * @permissionScope Read Products
163
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
164
- * @permissionScope Manage Restaurants - all permissions
165
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
166
- * @permissionScope Product write in v3 catalog
167
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
168
- * @permissionScope Read customizations in v3 catalog
169
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_READ
170
- * @permissionScope Manage v3 catalog
171
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
172
- * @permissionScope Manage Orders
173
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
174
- * @applicableIdentity APP
175
- * @applicableIdentity VISITOR
176
- * @returns Customization.
177
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.GetCustomization
178
- */
179
- async function getCustomization(customizationId, options) {
180
- // @ts-ignore
181
- const { httpClient, sideEffects } = arguments[2];
182
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
183
- customizationId: customizationId,
184
- fields: options?.fields,
185
- });
186
- const reqOpts = ambassadorWixStoresCatalogV3Customization.getCustomization(payload);
187
- sideEffects?.onSiteCall?.();
188
- try {
189
- const result = await httpClient.request(reqOpts);
190
- sideEffects?.onSuccess?.(result);
191
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
192
- {
193
- transformFn: image_2.transformRESTImageToSDKImage,
194
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
195
- },
196
- ]))?.customization;
197
- }
198
- catch (err) {
199
- const transformedError = (0, transform_error_1.transformError)(err, {
200
- spreadPathsToArguments: {},
201
- explicitPathsToArguments: {
202
- customizationId: '$[0]',
203
- fields: '$[1].fields',
204
- },
205
- singleArgumentUnchanged: false,
206
- }, ['customizationId', 'options']);
207
- sideEffects?.onError?.(err);
208
- throw transformedError;
209
- }
210
- }
211
- exports.getCustomization = getCustomization;
212
- /**
213
- * Updates a customization.
214
- *
215
- * Each time the customization is updated, `revision` increments by 1.
216
- * The current `revision` must be passed when updating the customization.
217
- * This ensures you're working with the latest customization and prevents unintended overwrites.
218
- * @param _id - Customization ID.
219
- * @public
220
- * @documentationMaturity preview
221
- * @requiredField _id
222
- * @requiredField customization
223
- * @requiredField customization.revision
224
- * @permissionId WIX_STORES.CUSTOMIZATION_UPDATE
225
- * @permissionScope Manage Stores - all permissions
226
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
227
- * @permissionScope Manage Stores
228
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
229
- * @permissionScope Customization write in v3 catalog
230
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
231
- * @permissionScope Manage Products
232
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
233
- * @permissionScope Product write in v3 catalog
234
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
235
- * @permissionScope Manage v3 catalog
236
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
237
- * @applicableIdentity APP
238
- * @returns Updated customization.
239
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomization
240
- */
241
- async function updateCustomization(_id, customization, options) {
242
- // @ts-ignore
243
- const { httpClient, sideEffects } = arguments[3];
244
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
245
- customization: { ...customization, id: _id },
246
- fields: options?.fields,
247
- }), [
248
- {
249
- transformFn: image_1.transformSDKImageToRESTImage,
250
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
251
- },
252
- ]);
253
- const reqOpts = ambassadorWixStoresCatalogV3Customization.updateCustomization(payload);
254
- sideEffects?.onSiteCall?.();
255
- try {
256
- const result = await httpClient.request(reqOpts);
257
- sideEffects?.onSuccess?.(result);
258
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
259
- {
260
- transformFn: image_2.transformRESTImageToSDKImage,
261
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
262
- },
263
- ]))?.customization;
264
- }
265
- catch (err) {
266
- const transformedError = (0, transform_error_1.transformError)(err, {
267
- spreadPathsToArguments: { customization: '$[1]' },
268
- explicitPathsToArguments: {
269
- 'customization.id': '$[0]',
270
- fields: '$[2].fields',
271
- },
272
- singleArgumentUnchanged: false,
273
- }, ['_id', 'customization', 'options']);
274
- sideEffects?.onError?.(err);
275
- throw transformedError;
276
- }
277
- }
278
- exports.updateCustomization = updateCustomization;
279
- /**
280
- * Deletes a customization.
281
- *
282
- * > **Note:** A customization cannot be deleted if it is assigned to one or more products.
283
- * @param customizationId - Customization ID.
284
- * @public
285
- * @documentationMaturity preview
286
- * @requiredField customizationId
287
- * @permissionId WIX_STORES.CUSTOMIZATION_DELETE
288
- * @permissionScope Manage Stores - all permissions
289
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
290
- * @permissionScope Manage Stores
291
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
292
- * @permissionScope Customization write in v3 catalog
293
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
294
- * @permissionScope Manage Products
295
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
296
- * @permissionScope Product write in v3 catalog
297
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
298
- * @permissionScope Manage v3 catalog
299
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
300
- * @applicableIdentity APP
301
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.DeleteCustomization
302
- */
303
- async function deleteCustomization(customizationId) {
304
- // @ts-ignore
305
- const { httpClient, sideEffects } = arguments[1];
306
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
307
- customizationId: customizationId,
308
- });
309
- const reqOpts = ambassadorWixStoresCatalogV3Customization.deleteCustomization(payload);
310
- sideEffects?.onSiteCall?.();
311
- try {
312
- const result = await httpClient.request(reqOpts);
313
- sideEffects?.onSuccess?.(result);
314
- }
315
- catch (err) {
316
- const transformedError = (0, transform_error_1.transformError)(err, {
317
- spreadPathsToArguments: {},
318
- explicitPathsToArguments: { customizationId: '$[0]' },
319
- singleArgumentUnchanged: false,
320
- }, ['customizationId']);
321
- sideEffects?.onError?.(err);
322
- throw transformedError;
323
- }
324
- }
325
- exports.deleteCustomization = deleteCustomization;
326
- /**
327
- * Retrieves a list of up to 100 customizations, given the provided filtering, sorting, and cursor paging.
328
- * Pass supported values to the `fields` array in the request to include those fields in the response.
329
- *
330
- *
331
- * Query Customizations runs with these defaults, which you can override:
332
- *
333
- * - `createdDate` is sorted in `DESC` order
334
- * - `cursorPaging.limit` is `100`
335
- *
336
- * For field support for filters and sorting,
337
- * see [Customizations: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/customizations-v3/supported-filters-and-sorting).
338
- *
339
- * To learn about working with _Query_ endpoints, see
340
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
341
- * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
342
- * @public
343
- * @documentationMaturity preview
344
- * @permissionScope Manage Stores - all permissions
345
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
346
- * @permissionScope Manage Stores
347
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
348
- * @permissionScope Read v3 catalog
349
- * @permissionScopeId SCOPE.STORES.CATALOG_READ
350
- * @permissionScope Manage Products
351
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
352
- * @permissionScope Read Stores - all read permissions
353
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
354
- * @permissionScope Read Products
355
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
356
- * @permissionScope Manage Restaurants - all permissions
357
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
358
- * @permissionScope Product write in v3 catalog
359
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
360
- * @permissionScope Read customizations in v3 catalog
361
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_READ
362
- * @permissionScope Manage v3 catalog
363
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
364
- * @permissionScope Manage Orders
365
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
366
- * @permissionId WIX_STORES.CUSTOMIZATION_READ
367
- * @applicableIdentity APP
368
- * @applicableIdentity VISITOR
369
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.QueryCustomizations
370
- */
371
- function queryCustomizations(options) {
372
- // @ts-ignore
373
- const { httpClient, sideEffects } = arguments[1];
374
- return (0, query_builder_1.queryBuilder)({
375
- func: async (payload) => {
376
- const reqOpts = ambassadorWixStoresCatalogV3Customization.queryCustomizations({
377
- ...payload,
378
- ...(options ?? {}),
379
- });
380
- sideEffects?.onSiteCall?.();
381
- try {
382
- const result = await httpClient.request(reqOpts);
383
- sideEffects?.onSuccess?.(result);
384
- return result;
385
- }
386
- catch (err) {
387
- sideEffects?.onError?.(err);
388
- throw err;
389
- }
390
- },
391
- requestTransformer: (query) => {
392
- const args = [query, options];
393
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
394
- ...args?.[1],
395
- query: args?.[0],
396
- });
397
- },
398
- responseTransformer: ({ data, }) => {
399
- const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
400
- {
401
- transformFn: image_2.transformRESTImageToSDKImage,
402
- paths: [{ path: 'customizations.choicesSettings.choices.image' }],
403
- },
404
- ]));
405
- return {
406
- items: transformedData?.customizations,
407
- pagingMetadata: transformedData?.pagingMetadata,
408
- };
409
- },
410
- errorTransformer: (err) => {
411
- const transformedError = (0, transform_error_1.transformError)(err, {
412
- spreadPathsToArguments: {},
413
- explicitPathsToArguments: { query: '$[0]' },
414
- singleArgumentUnchanged: false,
415
- });
416
- throw transformedError;
417
- },
418
- pagingMethod: 'CURSOR',
419
- transformationPaths: {},
420
- });
421
- }
422
- exports.queryCustomizations = queryCustomizations;
423
- /**
424
- * Creates multiple brands.
425
- * @param customizations - Customizations to create.
426
- * @public
427
- * @documentationMaturity preview
428
- * @requiredField customizations
429
- * @permissionId WIX_STORES.CUSTOMIZATION_CREATE
430
- * @permissionScope Manage Stores - all permissions
431
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
432
- * @permissionScope Manage Stores
433
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
434
- * @permissionScope Customization write in v3 catalog
435
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
436
- * @permissionScope Manage Products
437
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
438
- * @permissionScope Product write in v3 catalog
439
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
440
- * @permissionScope Manage v3 catalog
441
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
442
- * @applicableIdentity APP
443
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.BulkCreateCustomizations
444
- */
445
- async function bulkCreateCustomizations(customizations, options) {
446
- // @ts-ignore
447
- const { httpClient, sideEffects } = arguments[2];
448
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
449
- customizations: customizations,
450
- returnEntity: options?.returnEntity,
451
- }), [
452
- {
453
- transformFn: image_1.transformSDKImageToRESTImage,
454
- paths: [{ path: 'customizations.choicesSettings.choices.image' }],
455
- },
456
- ]);
457
- const reqOpts = ambassadorWixStoresCatalogV3Customization.bulkCreateCustomizations(payload);
458
- sideEffects?.onSiteCall?.();
459
- try {
460
- const result = await httpClient.request(reqOpts);
461
- sideEffects?.onSuccess?.(result);
462
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
463
- {
464
- transformFn: image_2.transformRESTImageToSDKImage,
465
- paths: [
466
- { path: 'results.customization.choicesSettings.choices.image' },
467
- ],
468
- },
469
- ]));
470
- }
471
- catch (err) {
472
- const transformedError = (0, transform_error_1.transformError)(err, {
473
- spreadPathsToArguments: {},
474
- explicitPathsToArguments: {
475
- customizations: '$[0]',
476
- returnEntity: '$[1].returnEntity',
477
- },
478
- singleArgumentUnchanged: false,
479
- }, ['customizations', 'options']);
480
- sideEffects?.onError?.(err);
481
- throw transformedError;
482
- }
483
- }
484
- exports.bulkCreateCustomizations = bulkCreateCustomizations;
485
- /**
486
- * Adds choices to a customization.
487
- * @param customizationId - Customization ID.
488
- * @param choices - Choices to add.
489
- * @public
490
- * @documentationMaturity preview
491
- * @requiredField choices
492
- * @requiredField customizationId
493
- * @permissionId WIX_STORES.CUSTOMIZATION_UPDATE
494
- * @permissionScope Manage Stores - all permissions
495
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
496
- * @permissionScope Manage Stores
497
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
498
- * @permissionScope Customization write in v3 catalog
499
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
500
- * @permissionScope Manage Products
501
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
502
- * @permissionScope Product write in v3 catalog
503
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
504
- * @permissionScope Manage v3 catalog
505
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
506
- * @applicableIdentity APP
507
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.AddCustomizationChoices
508
- */
509
- async function addCustomizationChoices(customizationId, choices, options) {
510
- // @ts-ignore
511
- const { httpClient, sideEffects } = arguments[3];
512
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
513
- customizationId: customizationId,
514
- choices: choices,
515
- fields: options?.fields,
516
- }), [
517
- {
518
- transformFn: image_1.transformSDKImageToRESTImage,
519
- paths: [{ path: 'choices.image' }],
520
- },
521
- ]);
522
- const reqOpts = ambassadorWixStoresCatalogV3Customization.addCustomizationChoices(payload);
523
- sideEffects?.onSiteCall?.();
524
- try {
525
- const result = await httpClient.request(reqOpts);
526
- sideEffects?.onSuccess?.(result);
527
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
528
- {
529
- transformFn: image_2.transformRESTImageToSDKImage,
530
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
531
- },
532
- ]));
533
- }
534
- catch (err) {
535
- const transformedError = (0, transform_error_1.transformError)(err, {
536
- spreadPathsToArguments: {},
537
- explicitPathsToArguments: {
538
- customizationId: '$[0]',
539
- choices: '$[1]',
540
- fields: '$[2].fields',
541
- },
542
- singleArgumentUnchanged: false,
543
- }, ['customizationId', 'choices', 'options']);
544
- sideEffects?.onError?.(err);
545
- throw transformedError;
546
- }
547
- }
548
- exports.addCustomizationChoices = addCustomizationChoices;
549
- /**
550
- * Sets a customization's choices. Any and all existing choices will be overridden.
551
- *
552
- * > **Note:** A choice cannot be overridden if it is assigned to one or more products.
553
- * @param customizationId - Customization ID.
554
- * @param choices - Choices to set.
555
- * @public
556
- * @documentationMaturity preview
557
- * @requiredField choices
558
- * @requiredField customizationId
559
- * @permissionId WIX_STORES.CUSTOMIZATION_UPDATE
560
- * @permissionScope Manage Stores - all permissions
561
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
562
- * @permissionScope Manage Stores
563
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
564
- * @permissionScope Customization write in v3 catalog
565
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
566
- * @permissionScope Manage Products
567
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
568
- * @permissionScope Product write in v3 catalog
569
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
570
- * @permissionScope Manage v3 catalog
571
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
572
- * @applicableIdentity APP
573
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.SetCustomizationChoices
574
- */
575
- async function setCustomizationChoices(customizationId, choices, options) {
576
- // @ts-ignore
577
- const { httpClient, sideEffects } = arguments[3];
578
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
579
- customizationId: customizationId,
580
- choices: choices,
581
- fields: options?.fields,
582
- }), [
583
- {
584
- transformFn: image_1.transformSDKImageToRESTImage,
585
- paths: [{ path: 'choices.image' }],
586
- },
587
- ]);
588
- const reqOpts = ambassadorWixStoresCatalogV3Customization.setCustomizationChoices(payload);
589
- sideEffects?.onSiteCall?.();
590
- try {
591
- const result = await httpClient.request(reqOpts);
592
- sideEffects?.onSuccess?.(result);
593
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
594
- {
595
- transformFn: image_2.transformRESTImageToSDKImage,
596
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
597
- },
598
- ]));
599
- }
600
- catch (err) {
601
- const transformedError = (0, transform_error_1.transformError)(err, {
602
- spreadPathsToArguments: {},
603
- explicitPathsToArguments: {
604
- customizationId: '$[0]',
605
- choices: '$[1]',
606
- fields: '$[2].fields',
607
- },
608
- singleArgumentUnchanged: false,
609
- }, ['customizationId', 'choices', 'options']);
610
- sideEffects?.onError?.(err);
611
- throw transformedError;
612
- }
613
- }
614
- exports.setCustomizationChoices = setCustomizationChoices;
615
- /**
616
- * Removes choices from a customization.
617
- *
618
- * +> **Note:** A choice cannot be removed if it is assigned to one or more products.
619
- * @param customizationId - Customization ID.
620
- * @param choiceIds - IDs of choices to remove.
621
- * @public
622
- * @documentationMaturity preview
623
- * @requiredField choiceIds
624
- * @requiredField customizationId
625
- * @permissionId WIX_STORES.CUSTOMIZATION_UPDATE
626
- * @permissionScope Manage Stores - all permissions
627
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
628
- * @permissionScope Manage Stores
629
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
630
- * @permissionScope Customization write in v3 catalog
631
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
632
- * @permissionScope Manage Products
633
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
634
- * @permissionScope Product write in v3 catalog
635
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
636
- * @permissionScope Manage v3 catalog
637
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
638
- * @applicableIdentity APP
639
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.RemoveCustomizationChoices
640
- */
641
- async function removeCustomizationChoices(customizationId, choiceIds, options) {
642
- // @ts-ignore
643
- const { httpClient, sideEffects } = arguments[3];
644
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
645
- customizationId: customizationId,
646
- choiceIds: choiceIds,
647
- revision: options?.revision,
648
- fields: options?.fields,
649
- });
650
- const reqOpts = ambassadorWixStoresCatalogV3Customization.removeCustomizationChoices(payload);
651
- sideEffects?.onSiteCall?.();
652
- try {
653
- const result = await httpClient.request(reqOpts);
654
- sideEffects?.onSuccess?.(result);
655
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
656
- {
657
- transformFn: image_2.transformRESTImageToSDKImage,
658
- paths: [{ path: 'customization.choicesSettings.choices.image' }],
659
- },
660
- ]));
661
- }
662
- catch (err) {
663
- const transformedError = (0, transform_error_1.transformError)(err, {
664
- spreadPathsToArguments: {},
665
- explicitPathsToArguments: {
666
- customizationId: '$[0]',
667
- choiceIds: '$[1]',
668
- revision: '$[2].revision',
669
- fields: '$[2].fields',
670
- },
671
- singleArgumentUnchanged: false,
672
- }, ['customizationId', 'choiceIds', 'options']);
673
- sideEffects?.onError?.(err);
674
- throw transformedError;
675
- }
676
- }
677
- exports.removeCustomizationChoices = removeCustomizationChoices;
678
- /**
679
- * Adds choices to multiple customizations.
680
- * @param customizationsChoices - List of customization IDs and choices.
681
- * @public
682
- * @documentationMaturity preview
683
- * @requiredField customizationsChoices
684
- * @requiredField customizationsChoices.choices
685
- * @requiredField customizationsChoices.customizationId
686
- * @permissionId WIX_STORES.CUSTOMIZATION_UPDATE
687
- * @permissionScope Manage Stores - all permissions
688
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
689
- * @permissionScope Manage Stores
690
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
691
- * @permissionScope Customization write in v3 catalog
692
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
693
- * @permissionScope Manage Products
694
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
695
- * @permissionScope Product write in v3 catalog
696
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
697
- * @permissionScope Manage v3 catalog
698
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
699
- * @applicableIdentity APP
700
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.BulkAddCustomizationChoices
701
- */
702
- async function bulkAddCustomizationChoices(customizationsChoices, options) {
703
- // @ts-ignore
704
- const { httpClient, sideEffects } = arguments[2];
705
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
706
- customizationsChoices: customizationsChoices,
707
- returnEntity: options?.returnEntity,
708
- fields: options?.fields,
709
- }), [
710
- {
711
- transformFn: image_1.transformSDKImageToRESTImage,
712
- paths: [{ path: 'customizationsChoices.choices.image' }],
713
- },
714
- ]);
715
- const reqOpts = ambassadorWixStoresCatalogV3Customization.bulkAddCustomizationChoices(payload);
716
- sideEffects?.onSiteCall?.();
717
- try {
718
- const result = await httpClient.request(reqOpts);
719
- sideEffects?.onSuccess?.(result);
720
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
721
- {
722
- transformFn: image_2.transformRESTImageToSDKImage,
723
- paths: [
724
- { path: 'results.customization.choicesSettings.choices.image' },
725
- ],
726
- },
727
- ]));
728
- }
729
- catch (err) {
730
- const transformedError = (0, transform_error_1.transformError)(err, {
731
- spreadPathsToArguments: {},
732
- explicitPathsToArguments: {
733
- customizationsChoices: '$[0]',
734
- returnEntity: '$[1].returnEntity',
735
- fields: '$[1].fields',
736
- },
737
- singleArgumentUnchanged: false,
738
- }, ['customizationsChoices', 'options']);
739
- sideEffects?.onError?.(err);
740
- throw transformedError;
741
- }
742
- }
743
- exports.bulkAddCustomizationChoices = bulkAddCustomizationChoices;
744
- /**
745
- * Updates multiple customizations.
746
- *
747
- * Each time the customization is updated, `revision` increments by 1.
748
- * The current `revision` must be passed when updating the customization.
749
- * This ensures you're working with the latest customization and prevents unintended overwrites.
750
- * @param customizations - List of customizations to update.
751
- * @public
752
- * @documentationMaturity preview
753
- * @requiredField customizations
754
- * @requiredField customizations.customization._id
755
- * @requiredField customizations.customization.name
756
- * @requiredField customizations.customization.revision
757
- * @permissionId WIX_STORES.CUSTOMIZATION_UPDATE
758
- * @permissionScope Manage Stores - all permissions
759
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
760
- * @permissionScope Manage Stores
761
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
762
- * @permissionScope Customization write in v3 catalog
763
- * @permissionScopeId SCOPE.STORES.CUSTOMIZATION_WRITE
764
- * @permissionScope Manage Products
765
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
766
- * @permissionScope Product write in v3 catalog
767
- * @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
768
- * @permissionScope Manage v3 catalog
769
- * @permissionScopeId SCOPE.STORES.CATALOG_WRITE
770
- * @applicableIdentity APP
771
- * @fqn wix.stores.catalog.customization.v3.CustomizationService.BulkUpdateCustomizations
772
- */
773
- async function bulkUpdateCustomizations(customizations, options) {
774
- // @ts-ignore
775
- const { httpClient, sideEffects } = arguments[2];
776
- const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
777
- customizations: customizations,
778
- returnEntity: options?.returnEntity,
779
- fields: options?.fields,
780
- }), [
781
- {
782
- transformFn: image_1.transformSDKImageToRESTImage,
783
- paths: [
784
- {
785
- path: 'customizations.customization.choicesSettings.choices.image',
786
- },
787
- ],
788
- },
789
- ]);
790
- const reqOpts = ambassadorWixStoresCatalogV3Customization.bulkUpdateCustomizations(payload);
791
- sideEffects?.onSiteCall?.();
792
- try {
793
- const result = await httpClient.request(reqOpts);
794
- sideEffects?.onSuccess?.(result);
795
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
796
- {
797
- transformFn: image_2.transformRESTImageToSDKImage,
798
- paths: [
799
- { path: 'results.customization.choicesSettings.choices.image' },
800
- ],
801
- },
802
- ]));
803
- }
804
- catch (err) {
805
- const transformedError = (0, transform_error_1.transformError)(err, {
806
- spreadPathsToArguments: {},
807
- explicitPathsToArguments: {
808
- customizations: '$[0]',
809
- returnEntity: '$[1].returnEntity',
810
- fields: '$[1].fields',
811
- },
812
- singleArgumentUnchanged: false,
813
- }, ['customizations', 'options']);
814
- sideEffects?.onError?.(err);
815
- throw transformedError;
816
- }
817
- }
818
- exports.bulkUpdateCustomizations = bulkUpdateCustomizations;
819
- //# sourceMappingURL=stores-catalog-v3-customization-customizations-v-3.universal.js.map