@wix/auto_sdk_ecom_delivery-profile 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.context.d.ts +21 -0
  11. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.context.js +32 -0
  12. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.context.js.map +1 -0
  13. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.http.d.ts +78 -0
  14. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.http.js +590 -0
  15. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.http.js.map +1 -0
  16. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.meta.d.ts +47 -0
  17. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.meta.js +363 -0
  18. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.meta.js.map +1 -0
  19. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.public.d.ts +167 -0
  20. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.public.js +117 -0
  21. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.public.js.map +1 -0
  22. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.types.d.ts +1053 -0
  23. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.types.js +135 -0
  24. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.types.js.map +1 -0
  25. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.d.ts +1569 -0
  26. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.js +935 -0
  27. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.context.d.ts +21 -0
  39. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.context.js +21 -0
  40. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.context.js.map +1 -0
  41. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.http.d.ts +78 -0
  42. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.http.js +570 -0
  43. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.http.js.map +1 -0
  44. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.meta.d.ts +47 -0
  45. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.meta.js +320 -0
  46. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.meta.js.map +1 -0
  47. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.public.d.ts +167 -0
  48. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.public.js +89 -0
  49. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.public.js.map +1 -0
  50. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.types.d.ts +1053 -0
  51. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.types.js +132 -0
  52. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.types.js.map +1 -0
  53. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.universal.d.ts +1569 -0
  54. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.universal.js +892 -0
  55. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.context.d.ts +21 -0
  66. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.context.js +32 -0
  67. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.context.js.map +1 -0
  68. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.http.d.ts +78 -0
  69. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.http.js +590 -0
  70. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.http.js.map +1 -0
  71. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.meta.d.ts +47 -0
  72. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.meta.js +363 -0
  73. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.public.d.ts +167 -0
  75. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.public.js +117 -0
  76. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.public.js.map +1 -0
  77. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.types.d.ts +1053 -0
  78. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.types.js +135 -0
  79. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.types.js.map +1 -0
  80. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.d.ts +1569 -0
  81. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.js +935 -0
  82. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.context.d.ts +21 -0
  93. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.context.js +21 -0
  94. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.context.js.map +1 -0
  95. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.http.d.ts +78 -0
  96. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.http.js +570 -0
  97. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.http.js.map +1 -0
  98. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.meta.d.ts +47 -0
  99. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.meta.js +320 -0
  100. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.meta.js.map +1 -0
  101. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.public.d.ts +167 -0
  102. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.public.js +89 -0
  103. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.public.js.map +1 -0
  104. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.types.d.ts +1053 -0
  105. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.types.js +132 -0
  106. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.types.js.map +1 -0
  107. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.universal.d.ts +1569 -0
  108. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.universal.js +892 -0
  109. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,935 @@
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.updateExtendedFields = exports.updateCarrierSettings = exports.listDeliveryCarriers = exports.listDeliveryDestinations = exports.listInstalledDeliveryCarriers = exports.listDeliveryCarrierDetails = exports.updateDeliveryCarrier = exports.removeDeliveryCarrier = exports.addDeliveryCarrier = exports.removeDeliveryRegion = exports.updateDeliveryRegion = exports.addDeliveryRegion = exports.queryDeliveryProfiles = exports.deleteDeliveryProfile = exports.updateDeliveryProfile = exports.getDeliveryProfile = exports.createDeliveryProfile = exports.WebhookIdentityType = exports.DeleteStatus = exports.Namespace = exports.SiteCreatedContext = exports.State = exports.DestinationScope = exports.SortOrder = exports.ChargeType = 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 ambassadorWixEcomV1DeliveryProfile = __importStar(require("./ecom-v1-delivery-profile-delivery-profile.http.js"));
31
+ var ChargeType;
32
+ (function (ChargeType) {
33
+ ChargeType["HANDLING_FEE"] = "HANDLING_FEE";
34
+ })(ChargeType || (exports.ChargeType = ChargeType = {}));
35
+ var SortOrder;
36
+ (function (SortOrder) {
37
+ SortOrder["ASC"] = "ASC";
38
+ SortOrder["DESC"] = "DESC";
39
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
40
+ var DestinationScope;
41
+ (function (DestinationScope) {
42
+ /** No additional destinations are requested */
43
+ DestinationScope["SPECIFIC_DESTINATIONS"] = "SPECIFIC_DESTINATIONS";
44
+ /** All Destinations */
45
+ DestinationScope["WORLDWIDE"] = "WORLDWIDE";
46
+ })(DestinationScope || (exports.DestinationScope = DestinationScope = {}));
47
+ var State;
48
+ (function (State) {
49
+ State["UNKNOWN"] = "UNKNOWN";
50
+ State["ENABLED"] = "ENABLED";
51
+ State["DISABLED"] = "DISABLED";
52
+ State["PENDING"] = "PENDING";
53
+ State["DEMO"] = "DEMO";
54
+ })(State || (exports.State = State = {}));
55
+ var SiteCreatedContext;
56
+ (function (SiteCreatedContext) {
57
+ /** A valid option, we don't expose all reasons why site might be created. */
58
+ SiteCreatedContext["OTHER"] = "OTHER";
59
+ /** A meta site was created from template. */
60
+ SiteCreatedContext["FROM_TEMPLATE"] = "FROM_TEMPLATE";
61
+ /** A meta site was created by copying of the transfferred meta site. */
62
+ SiteCreatedContext["DUPLICATE_BY_SITE_TRANSFER"] = "DUPLICATE_BY_SITE_TRANSFER";
63
+ /** A copy of existing meta site. */
64
+ SiteCreatedContext["DUPLICATE"] = "DUPLICATE";
65
+ /** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
66
+ SiteCreatedContext["OLD_SITE_TRANSFER"] = "OLD_SITE_TRANSFER";
67
+ /** deprecated A meta site was created for Flash editor. */
68
+ SiteCreatedContext["FLASH"] = "FLASH";
69
+ })(SiteCreatedContext || (exports.SiteCreatedContext = SiteCreatedContext = {}));
70
+ var Namespace;
71
+ (function (Namespace) {
72
+ Namespace["UNKNOWN_NAMESPACE"] = "UNKNOWN_NAMESPACE";
73
+ /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
74
+ Namespace["WIX"] = "WIX";
75
+ /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
76
+ Namespace["SHOUT_OUT"] = "SHOUT_OUT";
77
+ /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
78
+ Namespace["ALBUMS"] = "ALBUMS";
79
+ /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
80
+ Namespace["WIX_STORES_TEST_DRIVE"] = "WIX_STORES_TEST_DRIVE";
81
+ /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
82
+ Namespace["HOTELS"] = "HOTELS";
83
+ /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
84
+ Namespace["CLUBS"] = "CLUBS";
85
+ /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
86
+ Namespace["ONBOARDING_DRAFT"] = "ONBOARDING_DRAFT";
87
+ /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
88
+ Namespace["DEV_SITE"] = "DEV_SITE";
89
+ /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
90
+ Namespace["LOGOS"] = "LOGOS";
91
+ /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
92
+ Namespace["VIDEO_MAKER"] = "VIDEO_MAKER";
93
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
94
+ Namespace["PARTNER_DASHBOARD"] = "PARTNER_DASHBOARD";
95
+ /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
96
+ Namespace["DEV_CENTER_COMPANY"] = "DEV_CENTER_COMPANY";
97
+ /**
98
+ * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
99
+ *
100
+ * Meta site with this namespace will *not* be shown in a user's site list by default.
101
+ */
102
+ Namespace["HTML_DRAFT"] = "HTML_DRAFT";
103
+ /**
104
+ * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
105
+ * Will be accessible from Site List and will not have a website app.
106
+ * Once the user attaches a site, the site will become a regular wixsite.
107
+ */
108
+ Namespace["SITELESS_BUSINESS"] = "SITELESS_BUSINESS";
109
+ /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
110
+ Namespace["CREATOR_ECONOMY"] = "CREATOR_ECONOMY";
111
+ /** It is to be used in the Business First efforts. */
112
+ Namespace["DASHBOARD_FIRST"] = "DASHBOARD_FIRST";
113
+ /** Bookings business flow with no site. */
114
+ Namespace["ANYWHERE"] = "ANYWHERE";
115
+ /** Namespace for Headless Backoffice with no editor */
116
+ Namespace["HEADLESS"] = "HEADLESS";
117
+ /**
118
+ * Namespace for master site that will exist in parent account that will be referenced by subaccounts
119
+ * The site will be used for account level CSM feature for enterprise
120
+ */
121
+ Namespace["ACCOUNT_MASTER_CMS"] = "ACCOUNT_MASTER_CMS";
122
+ /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
123
+ Namespace["RISE"] = "RISE";
124
+ /**
125
+ * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
126
+ * There's a blank site behind the scene but it's blank).
127
+ * The Mobile company will be the owner of this namespace.
128
+ */
129
+ Namespace["BRANDED_FIRST"] = "BRANDED_FIRST";
130
+ /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
131
+ Namespace["NOWNIA"] = "NOWNIA";
132
+ /**
133
+ * UGC Templates are templates that are created by users for personal use and to sale to other users.
134
+ * The Partners company owns this namespace.
135
+ */
136
+ Namespace["UGC_TEMPLATE"] = "UGC_TEMPLATE";
137
+ /** Codux Headless Sites */
138
+ Namespace["CODUX"] = "CODUX";
139
+ /** Bobb - AI Design Creator. */
140
+ Namespace["MEDIA_DESIGN_CREATOR"] = "MEDIA_DESIGN_CREATOR";
141
+ /**
142
+ * Shared Blog Site is a unique single site across Enterprise account,
143
+ * This site will hold all Blog posts related to the Marketing product.
144
+ */
145
+ Namespace["SHARED_BLOG_ENTERPRISE"] = "SHARED_BLOG_ENTERPRISE";
146
+ })(Namespace || (exports.Namespace = Namespace = {}));
147
+ var DeleteStatus;
148
+ (function (DeleteStatus) {
149
+ DeleteStatus["UNKNOWN"] = "UNKNOWN";
150
+ DeleteStatus["TRASH"] = "TRASH";
151
+ DeleteStatus["DELETED"] = "DELETED";
152
+ DeleteStatus["PENDING_PURGE"] = "PENDING_PURGE";
153
+ })(DeleteStatus || (exports.DeleteStatus = DeleteStatus = {}));
154
+ var WebhookIdentityType;
155
+ (function (WebhookIdentityType) {
156
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
157
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
158
+ WebhookIdentityType["MEMBER"] = "MEMBER";
159
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
160
+ WebhookIdentityType["APP"] = "APP";
161
+ })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
162
+ /**
163
+ * Creates a DeliveryProfile.
164
+ *
165
+ * The request body must include the DeliveryProfiles name. DeliveryRegions are optional.
166
+ * @param deliveryProfile - DeliveryProfile to be created.
167
+ * @public
168
+ * @documentationMaturity preview
169
+ * @requiredField deliveryProfile
170
+ * @requiredField deliveryProfile.deliveryRegions.deliveryCarriers.backupRate.rate
171
+ * @requiredField deliveryProfile.deliveryRegions.destinations
172
+ * @requiredField deliveryProfile.deliveryRegions.destinations.countryCode
173
+ * @requiredField deliveryProfile.deliveryRegions.name
174
+ * @requiredField deliveryProfile.name
175
+ * @permissionId ECOM.DELIVERY_PROFILE_CREATE
176
+ * @permissionScope Manage Stores - all permissions
177
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
178
+ * @permissionScope Manage eCommerce - all permissions
179
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
180
+ * @applicableIdentity APP
181
+ * @returns The created DeliveryProfile.
182
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.CreateDeliveryProfile
183
+ */
184
+ async function createDeliveryProfile(deliveryProfile) {
185
+ // @ts-ignore
186
+ const { httpClient, sideEffects } = arguments[1];
187
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
188
+ deliveryProfile: deliveryProfile,
189
+ });
190
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.createDeliveryProfile(payload);
191
+ sideEffects?.onSiteCall?.();
192
+ try {
193
+ const result = await httpClient.request(reqOpts);
194
+ sideEffects?.onSuccess?.(result);
195
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)
196
+ ?.deliveryProfile;
197
+ }
198
+ catch (err) {
199
+ const transformedError = (0, transform_error_1.transformError)(err, {
200
+ spreadPathsToArguments: {},
201
+ explicitPathsToArguments: { deliveryProfile: '$[0]' },
202
+ singleArgumentUnchanged: false,
203
+ }, ['deliveryProfile']);
204
+ sideEffects?.onError?.(err);
205
+ throw transformedError;
206
+ }
207
+ }
208
+ exports.createDeliveryProfile = createDeliveryProfile;
209
+ /**
210
+ * Retrieves a DeliveryProfile.
211
+ * @param deliveryProfileId - ID of the DeliveryProfile to retrieve.
212
+ * @public
213
+ * @documentationMaturity preview
214
+ * @requiredField deliveryProfileId
215
+ * @permissionId ECOM.DELIVERY_PROFILE_READ
216
+ * @permissionScope Manage Stores - all permissions
217
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
218
+ * @permissionScope Read eCommerce - all read permissions
219
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
220
+ * @permissionScope Manage eCommerce - all permissions
221
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
222
+ * @applicableIdentity APP
223
+ * @applicableIdentity VISITOR
224
+ * @returns The requested DeliveryProfile.
225
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.GetDeliveryProfile
226
+ */
227
+ async function getDeliveryProfile(deliveryProfileId) {
228
+ // @ts-ignore
229
+ const { httpClient, sideEffects } = arguments[1];
230
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
231
+ deliveryProfileId: deliveryProfileId,
232
+ });
233
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.getDeliveryProfile(payload);
234
+ sideEffects?.onSiteCall?.();
235
+ try {
236
+ const result = await httpClient.request(reqOpts);
237
+ sideEffects?.onSuccess?.(result);
238
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)
239
+ ?.deliveryProfile;
240
+ }
241
+ catch (err) {
242
+ const transformedError = (0, transform_error_1.transformError)(err, {
243
+ spreadPathsToArguments: {},
244
+ explicitPathsToArguments: { deliveryProfileId: '$[0]' },
245
+ singleArgumentUnchanged: false,
246
+ }, ['deliveryProfileId']);
247
+ sideEffects?.onError?.(err);
248
+ throw transformedError;
249
+ }
250
+ }
251
+ exports.getDeliveryProfile = getDeliveryProfile;
252
+ /**
253
+ * Updates a DeliveryProfile.
254
+ *
255
+ *
256
+ * Each time the DeliveryProfile is updated,
257
+ * `revision` increments by 1.
258
+ * The current `revision` must be passed when updating the DeliveryProfile.
259
+ * This ensures you're working with the latest DeliveryProfile
260
+ * and prevents unintended overwrites.
261
+ *
262
+ * This method does not allow updating the DeliveryRegions in this DeliveryProfile.
263
+ * Use AddDeliveryRegion, UpdateDeliveryRegion and RemoveDeliveryRegion for these functionalities.
264
+ * @param _id - DeliveryProfile ID.
265
+ * @public
266
+ * @documentationMaturity preview
267
+ * @requiredField _id
268
+ * @requiredField deliveryProfile
269
+ * @requiredField deliveryProfile.revision
270
+ * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
271
+ * @permissionScope Manage Stores - all permissions
272
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
273
+ * @permissionScope Manage eCommerce - all permissions
274
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
275
+ * @applicableIdentity APP
276
+ * @returns Updated DeliveryProfile.
277
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateDeliveryProfile
278
+ */
279
+ async function updateDeliveryProfile(_id, deliveryProfile) {
280
+ // @ts-ignore
281
+ const { httpClient, sideEffects } = arguments[2];
282
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
283
+ deliveryProfile: { ...deliveryProfile, id: _id },
284
+ });
285
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateDeliveryProfile(payload);
286
+ sideEffects?.onSiteCall?.();
287
+ try {
288
+ const result = await httpClient.request(reqOpts);
289
+ sideEffects?.onSuccess?.(result);
290
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)
291
+ ?.deliveryProfile;
292
+ }
293
+ catch (err) {
294
+ const transformedError = (0, transform_error_1.transformError)(err, {
295
+ spreadPathsToArguments: { deliveryProfile: '$[1]' },
296
+ explicitPathsToArguments: { 'deliveryProfile.id': '$[0]' },
297
+ singleArgumentUnchanged: false,
298
+ }, ['_id', 'deliveryProfile']);
299
+ sideEffects?.onError?.(err);
300
+ throw transformedError;
301
+ }
302
+ }
303
+ exports.updateDeliveryProfile = updateDeliveryProfile;
304
+ /**
305
+ * Deletes a DeliveryProfile.
306
+ *
307
+ * Deleting a DeliveryProfile permanently removes them from the DeliveryProfile List.
308
+ * @param deliveryProfileId - Id of the DeliveryProfile to delete.
309
+ * @public
310
+ * @documentationMaturity preview
311
+ * @requiredField deliveryProfileId
312
+ * @permissionId ECOM.DELIVERY_PROFILE_DELETE
313
+ * @permissionScope Manage Stores - all permissions
314
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
315
+ * @permissionScope Manage eCommerce - all permissions
316
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
317
+ * @applicableIdentity APP
318
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.DeleteDeliveryProfile
319
+ */
320
+ async function deleteDeliveryProfile(deliveryProfileId) {
321
+ // @ts-ignore
322
+ const { httpClient, sideEffects } = arguments[1];
323
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
324
+ deliveryProfileId: deliveryProfileId,
325
+ });
326
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.deleteDeliveryProfile(payload);
327
+ sideEffects?.onSiteCall?.();
328
+ try {
329
+ const result = await httpClient.request(reqOpts);
330
+ sideEffects?.onSuccess?.(result);
331
+ }
332
+ catch (err) {
333
+ const transformedError = (0, transform_error_1.transformError)(err, {
334
+ spreadPathsToArguments: {},
335
+ explicitPathsToArguments: { deliveryProfileId: '$[0]' },
336
+ singleArgumentUnchanged: false,
337
+ }, ['deliveryProfileId']);
338
+ sideEffects?.onError?.(err);
339
+ throw transformedError;
340
+ }
341
+ }
342
+ exports.deleteDeliveryProfile = deleteDeliveryProfile;
343
+ /**
344
+ * Retrieves a list of DeliveryProfiles, given the provided [paging, filtering, and sorting][1].
345
+ *
346
+ * Up to 1,000 DeliveryProfiles can be returned per request.
347
+ *
348
+ * To learn how to query DeliveryProfiles, see [API Query Language][2].
349
+ *
350
+ * [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging
351
+ * [2]: https://dev.wix.com/api/rest/getting-started/api-query-language
352
+ * @public
353
+ * @documentationMaturity preview
354
+ * @permissionScope Manage Stores - all permissions
355
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
356
+ * @permissionScope Read eCommerce - all read permissions
357
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
358
+ * @permissionScope Manage eCommerce - all permissions
359
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
360
+ * @permissionId ECOM.DELIVERY_PROFILE_READ
361
+ * @applicableIdentity APP
362
+ * @applicableIdentity VISITOR
363
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.QueryDeliveryProfiles
364
+ */
365
+ function queryDeliveryProfiles() {
366
+ // @ts-ignore
367
+ const { httpClient, sideEffects } = arguments[0];
368
+ return (0, query_builder_1.queryBuilder)({
369
+ func: async (payload) => {
370
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.queryDeliveryProfiles(payload);
371
+ sideEffects?.onSiteCall?.();
372
+ try {
373
+ const result = await httpClient.request(reqOpts);
374
+ sideEffects?.onSuccess?.(result);
375
+ return result;
376
+ }
377
+ catch (err) {
378
+ sideEffects?.onError?.(err);
379
+ throw err;
380
+ }
381
+ },
382
+ requestTransformer: (query) => {
383
+ const args = [query, {}];
384
+ return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
385
+ ...args?.[1],
386
+ query: args?.[0],
387
+ });
388
+ },
389
+ responseTransformer: ({ data, }) => {
390
+ const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(data);
391
+ return {
392
+ items: transformedData?.deliveryProfiles,
393
+ pagingMetadata: transformedData?.pagingMetadata,
394
+ };
395
+ },
396
+ errorTransformer: (err) => {
397
+ const transformedError = (0, transform_error_1.transformError)(err, {
398
+ spreadPathsToArguments: {},
399
+ explicitPathsToArguments: { query: '$[0]' },
400
+ singleArgumentUnchanged: false,
401
+ });
402
+ throw transformedError;
403
+ },
404
+ pagingMethod: 'CURSOR',
405
+ transformationPaths: {},
406
+ });
407
+ }
408
+ exports.queryDeliveryProfiles = queryDeliveryProfiles;
409
+ /**
410
+ * Creates a new DeliveryRegion in an existing DeliveryProfile.
411
+ * @param deliveryProfileId - delivery profile id to associated with the DeliveryRegion
412
+ * @param deliveryRegion - DeliveryRegion to be created
413
+ * @public
414
+ * @documentationMaturity preview
415
+ * @requiredField deliveryProfileId
416
+ * @requiredField deliveryRegion
417
+ * @requiredField deliveryRegion.deliveryCarriers.backupRate.rate
418
+ * @requiredField deliveryRegion.destinations.countryCode
419
+ * @requiredField deliveryRegion.name
420
+ * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
421
+ * @permissionScope Manage Stores - all permissions
422
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
423
+ * @permissionScope Manage eCommerce - all permissions
424
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
425
+ * @applicableIdentity APP
426
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.AddDeliveryRegion
427
+ */
428
+ async function addDeliveryRegion(deliveryProfileId, deliveryRegion, options) {
429
+ // @ts-ignore
430
+ const { httpClient, sideEffects } = arguments[3];
431
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
432
+ deliveryProfileId: deliveryProfileId,
433
+ deliveryRegion: deliveryRegion,
434
+ revision: options?.revision,
435
+ });
436
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.addDeliveryRegion(payload);
437
+ sideEffects?.onSiteCall?.();
438
+ try {
439
+ const result = await httpClient.request(reqOpts);
440
+ sideEffects?.onSuccess?.(result);
441
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
442
+ }
443
+ catch (err) {
444
+ const transformedError = (0, transform_error_1.transformError)(err, {
445
+ spreadPathsToArguments: {},
446
+ explicitPathsToArguments: {
447
+ deliveryProfileId: '$[0]',
448
+ deliveryRegion: '$[1]',
449
+ revision: '$[2].revision',
450
+ },
451
+ singleArgumentUnchanged: false,
452
+ }, ['deliveryProfileId', 'deliveryRegion', 'options']);
453
+ sideEffects?.onError?.(err);
454
+ throw transformedError;
455
+ }
456
+ }
457
+ exports.addDeliveryRegion = addDeliveryRegion;
458
+ /**
459
+ * Update a DeliveryRegion, supports partial update
460
+ * Pass the latest `revision` for a successful update
461
+ *
462
+ * This method does not allow setting or updating the delivery delivery_carriers in this delivery_region.
463
+ * Use AddDeliveryCarrier, UpdateDeliveryCarrier and RemoveDeliveryCarrier for these functionalities.
464
+ * @public
465
+ * @documentationMaturity preview
466
+ * @requiredField deliveryRegion
467
+ * @requiredField identifiers
468
+ * @requiredField identifiers.deliveryProfileId
469
+ * @requiredField identifiers.deliveryRegionId
470
+ * @permissionId ECOM.DELIVERY_REGION_UPDATE
471
+ * @permissionScope Manage Stores - all permissions
472
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
473
+ * @permissionScope Manage eCommerce - all permissions
474
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
475
+ * @applicableIdentity APP
476
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateDeliveryRegion
477
+ */
478
+ async function updateDeliveryRegion(identifiers, deliveryRegion, options) {
479
+ // @ts-ignore
480
+ const { httpClient, sideEffects } = arguments[3];
481
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
482
+ deliveryProfileId: identifiers?.deliveryProfileId,
483
+ deliveryRegion: { ...deliveryRegion, id: identifiers?.deliveryRegionId },
484
+ revision: options?.revision,
485
+ });
486
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateDeliveryRegion(payload);
487
+ sideEffects?.onSiteCall?.();
488
+ try {
489
+ const result = await httpClient.request(reqOpts);
490
+ sideEffects?.onSuccess?.(result);
491
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
492
+ }
493
+ catch (err) {
494
+ const transformedError = (0, transform_error_1.transformError)(err, {
495
+ spreadPathsToArguments: { deliveryRegion: '$[1]' },
496
+ explicitPathsToArguments: {
497
+ deliveryProfileId: '$[0].deliveryProfileId',
498
+ 'deliveryRegion.id': '$[0].deliveryRegionId',
499
+ revision: '$[2].revision',
500
+ },
501
+ singleArgumentUnchanged: false,
502
+ }, ['identifiers', 'deliveryRegion', 'options']);
503
+ sideEffects?.onError?.(err);
504
+ throw transformedError;
505
+ }
506
+ }
507
+ exports.updateDeliveryRegion = updateDeliveryRegion;
508
+ /**
509
+ * Delete a DeliveryRegion
510
+ * @public
511
+ * @documentationMaturity preview
512
+ * @requiredField identifiers
513
+ * @requiredField identifiers.deliveryProfileId
514
+ * @requiredField identifiers.deliveryRegionId
515
+ * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
516
+ * @permissionScope Manage Stores - all permissions
517
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
518
+ * @permissionScope Manage eCommerce - all permissions
519
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
520
+ * @applicableIdentity APP
521
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.RemoveDeliveryRegion
522
+ */
523
+ async function removeDeliveryRegion(identifiers, options) {
524
+ // @ts-ignore
525
+ const { httpClient, sideEffects } = arguments[2];
526
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
527
+ deliveryProfileId: identifiers?.deliveryProfileId,
528
+ deliveryRegionId: identifiers?.deliveryRegionId,
529
+ revision: options?.revision,
530
+ });
531
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.removeDeliveryRegion(payload);
532
+ sideEffects?.onSiteCall?.();
533
+ try {
534
+ const result = await httpClient.request(reqOpts);
535
+ sideEffects?.onSuccess?.(result);
536
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
537
+ }
538
+ catch (err) {
539
+ const transformedError = (0, transform_error_1.transformError)(err, {
540
+ spreadPathsToArguments: {},
541
+ explicitPathsToArguments: {
542
+ deliveryProfileId: '$[0].deliveryProfileId',
543
+ deliveryRegionId: '$[0].deliveryRegionId',
544
+ revision: '$[1].revision',
545
+ },
546
+ singleArgumentUnchanged: false,
547
+ }, ['identifiers', 'options']);
548
+ sideEffects?.onError?.(err);
549
+ throw transformedError;
550
+ }
551
+ }
552
+ exports.removeDeliveryRegion = removeDeliveryRegion;
553
+ /**
554
+ * Add a delivery_carrier to a delivery region
555
+ * @param deliveryRegionId - delivery_region id to associated with the delivery_carrier.
556
+ * @public
557
+ * @documentationMaturity preview
558
+ * @requiredField deliveryRegionId
559
+ * @requiredField options
560
+ * @requiredField options.deliveryCarrier
561
+ * @requiredField options.deliveryCarrier.backupRate.rate
562
+ * @permissionId ECOM.DELIVERY_CARRIER_ADD
563
+ * @permissionScope Manage Stores - all permissions
564
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
565
+ * @permissionScope Manage eCommerce - all permissions
566
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
567
+ * @applicableIdentity APP
568
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.AddDeliveryCarrier
569
+ */
570
+ async function addDeliveryCarrier(deliveryRegionId, options) {
571
+ // @ts-ignore
572
+ const { httpClient, sideEffects } = arguments[2];
573
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
574
+ deliveryRegionId: deliveryRegionId,
575
+ deliveryCarrier: options?.deliveryCarrier,
576
+ });
577
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.addDeliveryCarrier(payload);
578
+ sideEffects?.onSiteCall?.();
579
+ try {
580
+ const result = await httpClient.request(reqOpts);
581
+ sideEffects?.onSuccess?.(result);
582
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
583
+ }
584
+ catch (err) {
585
+ const transformedError = (0, transform_error_1.transformError)(err, {
586
+ spreadPathsToArguments: {},
587
+ explicitPathsToArguments: {
588
+ deliveryRegionId: '$[0]',
589
+ deliveryCarrier: '$[1].deliveryCarrier',
590
+ },
591
+ singleArgumentUnchanged: false,
592
+ }, ['deliveryRegionId', 'options']);
593
+ sideEffects?.onError?.(err);
594
+ throw transformedError;
595
+ }
596
+ }
597
+ exports.addDeliveryCarrier = addDeliveryCarrier;
598
+ /**
599
+ * Remove a delivery_carrier from a delivery region
600
+ * @param deliveryRegionId - Id of the DeliveryRegion
601
+ * @public
602
+ * @documentationMaturity preview
603
+ * @requiredField deliveryRegionId
604
+ * @requiredField options
605
+ * @requiredField options.appId
606
+ * @permissionId ECOM.DELIVERY_CARRIER_REMOVE
607
+ * @permissionScope Manage Stores - all permissions
608
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
609
+ * @permissionScope Manage eCommerce - all permissions
610
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
611
+ * @applicableIdentity APP
612
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.RemoveDeliveryCarrier
613
+ */
614
+ async function removeDeliveryCarrier(deliveryRegionId, options) {
615
+ // @ts-ignore
616
+ const { httpClient, sideEffects } = arguments[2];
617
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
618
+ deliveryRegionId: deliveryRegionId,
619
+ appId: options?.appId,
620
+ });
621
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.removeDeliveryCarrier(payload);
622
+ sideEffects?.onSiteCall?.();
623
+ try {
624
+ const result = await httpClient.request(reqOpts);
625
+ sideEffects?.onSuccess?.(result);
626
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
627
+ }
628
+ catch (err) {
629
+ const transformedError = (0, transform_error_1.transformError)(err, {
630
+ spreadPathsToArguments: {},
631
+ explicitPathsToArguments: {
632
+ deliveryRegionId: '$[0]',
633
+ appId: '$[1].appId',
634
+ },
635
+ singleArgumentUnchanged: false,
636
+ }, ['deliveryRegionId', 'options']);
637
+ sideEffects?.onError?.(err);
638
+ throw transformedError;
639
+ }
640
+ }
641
+ exports.removeDeliveryCarrier = removeDeliveryCarrier;
642
+ /**
643
+ * Update a delivery carrier in a delivery region
644
+ * @param deliveryRegionId - DeliveryRegion id
645
+ * @public
646
+ * @documentationMaturity preview
647
+ * @requiredField deliveryRegionId
648
+ * @requiredField options.deliveryCarrier.appId
649
+ * @permissionId ECOM.DELIVERY_CARRIER_UPDATE
650
+ * @permissionScope Manage Stores - all permissions
651
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
652
+ * @permissionScope Manage eCommerce - all permissions
653
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
654
+ * @applicableIdentity APP
655
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateDeliveryCarrier
656
+ */
657
+ async function updateDeliveryCarrier(deliveryRegionId, options) {
658
+ // @ts-ignore
659
+ const { httpClient, sideEffects } = arguments[2];
660
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
661
+ deliveryRegionId: deliveryRegionId,
662
+ deliveryCarrier: options?.deliveryCarrier,
663
+ });
664
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateDeliveryCarrier(payload);
665
+ sideEffects?.onSiteCall?.();
666
+ try {
667
+ const result = await httpClient.request(reqOpts);
668
+ sideEffects?.onSuccess?.(result);
669
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
670
+ }
671
+ catch (err) {
672
+ const transformedError = (0, transform_error_1.transformError)(err, {
673
+ spreadPathsToArguments: {},
674
+ explicitPathsToArguments: {
675
+ deliveryRegionId: '$[0]',
676
+ deliveryCarrier: '$[1].deliveryCarrier',
677
+ },
678
+ singleArgumentUnchanged: false,
679
+ }, ['deliveryRegionId', 'options']);
680
+ sideEffects?.onError?.(err);
681
+ throw transformedError;
682
+ }
683
+ }
684
+ exports.updateDeliveryCarrier = updateDeliveryCarrier;
685
+ /**
686
+ * List all installed delivery carriers in order to set their ids in delivery rules
687
+ * @public
688
+ * @documentationMaturity preview
689
+ * @permissionId ECOM.DELIVERY_CARRIER_DETAILS_READ
690
+ * @permissionScope Manage Stores - all permissions
691
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
692
+ * @permissionScope Read eCommerce - all read permissions
693
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
694
+ * @permissionScope Manage eCommerce - all permissions
695
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
696
+ * @applicableIdentity APP
697
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.ListDeliveryCarrierDetails
698
+ * @deprecated
699
+ * @replacedBy ListInstalledDeliveryCarriers
700
+ * @targetRemovalDate 2025-04-01
701
+ */
702
+ async function listDeliveryCarrierDetails() {
703
+ // @ts-ignore
704
+ const { httpClient, sideEffects } = arguments[0];
705
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
706
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.listDeliveryCarrierDetails(payload);
707
+ sideEffects?.onSiteCall?.();
708
+ try {
709
+ const result = await httpClient.request(reqOpts);
710
+ sideEffects?.onSuccess?.(result);
711
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
712
+ }
713
+ catch (err) {
714
+ const transformedError = (0, transform_error_1.transformError)(err, {
715
+ spreadPathsToArguments: {},
716
+ explicitPathsToArguments: {},
717
+ singleArgumentUnchanged: false,
718
+ }, []);
719
+ sideEffects?.onError?.(err);
720
+ throw transformedError;
721
+ }
722
+ }
723
+ exports.listDeliveryCarrierDetails = listDeliveryCarrierDetails;
724
+ /** @public
725
+ * @documentationMaturity preview
726
+ * @permissionId ECOM.DELIVERY_CARRIER_READ
727
+ * @permissionScope Manage Stores - all permissions
728
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
729
+ * @permissionScope Read eCommerce - all read permissions
730
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
731
+ * @permissionScope Manage eCommerce - all permissions
732
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
733
+ * @applicableIdentity APP
734
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.ListInstalledDeliveryCarriers
735
+ */
736
+ async function listInstalledDeliveryCarriers() {
737
+ // @ts-ignore
738
+ const { httpClient, sideEffects } = arguments[0];
739
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
740
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.listInstalledDeliveryCarriers(payload);
741
+ sideEffects?.onSiteCall?.();
742
+ try {
743
+ const result = await httpClient.request(reqOpts);
744
+ sideEffects?.onSuccess?.(result);
745
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
746
+ }
747
+ catch (err) {
748
+ const transformedError = (0, transform_error_1.transformError)(err, {
749
+ spreadPathsToArguments: {},
750
+ explicitPathsToArguments: {},
751
+ singleArgumentUnchanged: false,
752
+ }, []);
753
+ sideEffects?.onError?.(err);
754
+ throw transformedError;
755
+ }
756
+ }
757
+ exports.listInstalledDeliveryCarriers = listInstalledDeliveryCarriers;
758
+ /**
759
+ * Retrieves a list of all delivery destinations configured on a site.
760
+ * Sorted by `countryCode` in ascending order.
761
+ * @public
762
+ * @documentationMaturity preview
763
+ * @permissionId ECOM.DELIVERY_PROFILE_READ
764
+ * @permissionScope Manage Stores - all permissions
765
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
766
+ * @permissionScope Read eCommerce - all read permissions
767
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
768
+ * @permissionScope Manage eCommerce - all permissions
769
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
770
+ * @applicableIdentity APP
771
+ * @applicableIdentity VISITOR
772
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.ListDeliveryDestinations
773
+ */
774
+ async function listDeliveryDestinations() {
775
+ // @ts-ignore
776
+ const { httpClient, sideEffects } = arguments[0];
777
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
778
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.listDeliveryDestinations(payload);
779
+ sideEffects?.onSiteCall?.();
780
+ try {
781
+ const result = await httpClient.request(reqOpts);
782
+ sideEffects?.onSuccess?.(result);
783
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
784
+ }
785
+ catch (err) {
786
+ const transformedError = (0, transform_error_1.transformError)(err, {
787
+ spreadPathsToArguments: {},
788
+ explicitPathsToArguments: {},
789
+ singleArgumentUnchanged: false,
790
+ }, []);
791
+ sideEffects?.onError?.(err);
792
+ throw transformedError;
793
+ }
794
+ }
795
+ exports.listDeliveryDestinations = listDeliveryDestinations;
796
+ /**
797
+ * Get delivery carrier settings for a delivery profile and delivery region.
798
+ * These are returned in a table format for the dashboard.
799
+ * @param deliveryProfileId - Delivery profile id.
800
+ * @public
801
+ * @documentationMaturity preview
802
+ * @requiredField deliveryProfileId
803
+ * @permissionId ECOM.DELIVERY_CARRIER_READ
804
+ * @permissionScope Manage Stores - all permissions
805
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
806
+ * @permissionScope Read eCommerce - all read permissions
807
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
808
+ * @permissionScope Manage eCommerce - all permissions
809
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
810
+ * @applicableIdentity APP
811
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.ListDeliveryCarriers
812
+ */
813
+ async function listDeliveryCarriers(deliveryProfileId, options) {
814
+ // @ts-ignore
815
+ const { httpClient, sideEffects } = arguments[2];
816
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
817
+ deliveryProfileId: deliveryProfileId,
818
+ appIds: options?.appIds,
819
+ });
820
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.listDeliveryCarriers(payload);
821
+ sideEffects?.onSiteCall?.();
822
+ try {
823
+ const result = await httpClient.request(reqOpts);
824
+ sideEffects?.onSuccess?.(result);
825
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
826
+ }
827
+ catch (err) {
828
+ const transformedError = (0, transform_error_1.transformError)(err, {
829
+ spreadPathsToArguments: {},
830
+ explicitPathsToArguments: {
831
+ deliveryProfileId: '$[0]',
832
+ appIds: '$[1].appIds',
833
+ },
834
+ singleArgumentUnchanged: false,
835
+ }, ['deliveryProfileId', 'options']);
836
+ sideEffects?.onError?.(err);
837
+ throw transformedError;
838
+ }
839
+ }
840
+ exports.listDeliveryCarriers = listDeliveryCarriers;
841
+ /**
842
+ * Update carrier's external active settings
843
+ * @param carrierId - Carrier id.
844
+ * @public
845
+ * @documentationMaturity preview
846
+ * @requiredField carrierId
847
+ * @requiredField options
848
+ * @requiredField options.active
849
+ * @requiredField options.rowId
850
+ * @permissionId ECOM.DELIVERY_CARRIER_UPDATE
851
+ * @permissionScope Manage Stores - all permissions
852
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
853
+ * @permissionScope Manage eCommerce - all permissions
854
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
855
+ * @applicableIdentity APP
856
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateCarrierSettings
857
+ */
858
+ async function updateCarrierSettings(carrierId, options) {
859
+ // @ts-ignore
860
+ const { httpClient, sideEffects } = arguments[2];
861
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
862
+ carrierId: carrierId,
863
+ rowId: options?.rowId,
864
+ active: options?.active,
865
+ });
866
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateCarrierSettings(payload);
867
+ sideEffects?.onSiteCall?.();
868
+ try {
869
+ const result = await httpClient.request(reqOpts);
870
+ sideEffects?.onSuccess?.(result);
871
+ }
872
+ catch (err) {
873
+ const transformedError = (0, transform_error_1.transformError)(err, {
874
+ spreadPathsToArguments: {},
875
+ explicitPathsToArguments: {
876
+ carrierId: '$[0]',
877
+ rowId: '$[1].rowId',
878
+ active: '$[1].active',
879
+ },
880
+ singleArgumentUnchanged: false,
881
+ }, ['carrierId', 'options']);
882
+ sideEffects?.onError?.(err);
883
+ throw transformedError;
884
+ }
885
+ }
886
+ exports.updateCarrierSettings = updateCarrierSettings;
887
+ /**
888
+ * Updates extended fields of a DeliveryProfile without incrementing revision
889
+ * @param _id - ID of the entity to update.
890
+ * @param namespace - Identifier for the app whose extended fields are being updated.
891
+ * @public
892
+ * @documentationMaturity preview
893
+ * @requiredField _id
894
+ * @requiredField namespace
895
+ * @requiredField options
896
+ * @requiredField options.namespaceData
897
+ * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
898
+ * @permissionScope Manage Stores - all permissions
899
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
900
+ * @permissionScope Manage eCommerce - all permissions
901
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
902
+ * @applicableIdentity APP
903
+ * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateExtendedFields
904
+ */
905
+ async function updateExtendedFields(_id, namespace, options) {
906
+ // @ts-ignore
907
+ const { httpClient, sideEffects } = arguments[3];
908
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
909
+ id: _id,
910
+ namespace: namespace,
911
+ namespaceData: options?.namespaceData,
912
+ });
913
+ const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateExtendedFields(payload);
914
+ sideEffects?.onSiteCall?.();
915
+ try {
916
+ const result = await httpClient.request(reqOpts);
917
+ sideEffects?.onSuccess?.(result);
918
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
919
+ }
920
+ catch (err) {
921
+ const transformedError = (0, transform_error_1.transformError)(err, {
922
+ spreadPathsToArguments: {},
923
+ explicitPathsToArguments: {
924
+ id: '$[0]',
925
+ namespace: '$[1]',
926
+ namespaceData: '$[2].namespaceData',
927
+ },
928
+ singleArgumentUnchanged: false,
929
+ }, ['_id', 'namespace', 'options']);
930
+ sideEffects?.onError?.(err);
931
+ throw transformedError;
932
+ }
933
+ }
934
+ exports.updateExtendedFields = updateExtendedFields;
935
+ //# sourceMappingURL=ecom-v1-delivery-profile-delivery-profile.universal.js.map