@wix/auto_sdk_ecom_delivery-profile 1.0.25 → 1.0.26

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