@wix/auto_sdk_ecom_delivery-profile 1.0.42 → 1.0.44

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