@wix/auto_sdk_ecom_delivery-profile 1.0.23 → 1.0.25

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-_1-ffDas.d.mts} +359 -124
  2. package/build/{internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.types.d.ts → ecom-v1-delivery-profile-delivery-profile.universal-_1-ffDas.d.ts} +359 -124
  3. package/build/index.d.mts +176 -0
  4. package/build/index.d.ts +176 -0
  5. package/build/index.js +1257 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +1210 -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-_1-ffDas.d.mts} +359 -124
  10. package/build/{es/src/ecom-v1-delivery-profile-delivery-profile.types.d.ts → internal/ecom-v1-delivery-profile-delivery-profile.universal-_1-ffDas.d.ts} +359 -124
  11. package/build/internal/index.d.mts +176 -0
  12. package/build/internal/index.d.ts +176 -0
  13. package/build/internal/index.js +1257 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +1210 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +729 -0
  18. package/build/internal/meta.d.ts +729 -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 +729 -0
  24. package/build/meta.d.ts +729 -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 -1975
  54. package/build/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.js +0 -965
  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 -1975
  81. package/build/es/src/ecom-v1-delivery-profile-delivery-profile.universal.js +0 -923
  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 -1975
  107. package/build/internal/cjs/src/ecom-v1-delivery-profile-delivery-profile.universal.js +0 -965
  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 -1975
  133. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.universal.js +0 -923
  134. package/build/internal/es/src/ecom-v1-delivery-profile-delivery-profile.universal.js.map +0 -1
@@ -1,923 +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
- 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
- * @permissionScope Picasso private app mega scope
163
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
164
- * @applicableIdentity APP
165
- * @returns The created DeliveryProfile.
166
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.CreateDeliveryProfile
167
- */
168
- export async function createDeliveryProfile(deliveryProfile) {
169
- // @ts-ignore
170
- const { httpClient, sideEffects } = arguments[1];
171
- const payload = renameKeysFromSDKRequestToRESTRequest({
172
- deliveryProfile: deliveryProfile,
173
- });
174
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.createDeliveryProfile(payload);
175
- sideEffects?.onSiteCall?.();
176
- try {
177
- const result = await httpClient.request(reqOpts);
178
- sideEffects?.onSuccess?.(result);
179
- return renameKeysFromRESTResponseToSDKResponse(result.data)
180
- ?.deliveryProfile;
181
- }
182
- catch (err) {
183
- const transformedError = sdkTransformError(err, {
184
- spreadPathsToArguments: {},
185
- explicitPathsToArguments: { deliveryProfile: '$[0]' },
186
- singleArgumentUnchanged: false,
187
- }, ['deliveryProfile']);
188
- sideEffects?.onError?.(err);
189
- throw transformedError;
190
- }
191
- }
192
- /**
193
- * Retrieves a DeliveryProfile.
194
- * @param deliveryProfileId - ID of the DeliveryProfile to retrieve.
195
- * @public
196
- * @documentationMaturity preview
197
- * @requiredField deliveryProfileId
198
- * @permissionId ECOM.DELIVERY_PROFILE_READ
199
- * @permissionScope Manage Stores - all permissions
200
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
201
- * @permissionScope Read eCommerce - all read permissions
202
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
203
- * @permissionScope Manage Restaurants - all permissions
204
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
205
- * @permissionScope Manage eCommerce - all permissions
206
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
207
- * @permissionScope Picasso private app mega scope
208
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
209
- * @applicableIdentity APP
210
- * @applicableIdentity VISITOR
211
- * @returns The requested DeliveryProfile.
212
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.GetDeliveryProfile
213
- */
214
- export async function getDeliveryProfile(deliveryProfileId) {
215
- // @ts-ignore
216
- const { httpClient, sideEffects } = arguments[1];
217
- const payload = renameKeysFromSDKRequestToRESTRequest({
218
- deliveryProfileId: deliveryProfileId,
219
- });
220
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.getDeliveryProfile(payload);
221
- sideEffects?.onSiteCall?.();
222
- try {
223
- const result = await httpClient.request(reqOpts);
224
- sideEffects?.onSuccess?.(result);
225
- return renameKeysFromRESTResponseToSDKResponse(result.data)
226
- ?.deliveryProfile;
227
- }
228
- catch (err) {
229
- const transformedError = sdkTransformError(err, {
230
- spreadPathsToArguments: {},
231
- explicitPathsToArguments: { deliveryProfileId: '$[0]' },
232
- singleArgumentUnchanged: false,
233
- }, ['deliveryProfileId']);
234
- sideEffects?.onError?.(err);
235
- throw transformedError;
236
- }
237
- }
238
- /**
239
- * Updates a DeliveryProfile.
240
- *
241
- *
242
- * Each time the DeliveryProfile is updated,
243
- * `revision` increments by 1.
244
- * The current `revision` must be passed when updating the DeliveryProfile.
245
- * This ensures you're working with the latest DeliveryProfile
246
- * and prevents unintended overwrites.
247
- *
248
- * This method does not allow updating the DeliveryRegions in this DeliveryProfile.
249
- * Use AddDeliveryRegion, UpdateDeliveryRegion and RemoveDeliveryRegion for these functionalities.
250
- * @param _id - DeliveryProfile ID.
251
- * @public
252
- * @documentationMaturity preview
253
- * @requiredField _id
254
- * @requiredField deliveryProfile
255
- * @requiredField deliveryProfile.revision
256
- * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
257
- * @permissionScope Manage Stores - all permissions
258
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
259
- * @permissionScope Manage Restaurants - all permissions
260
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
261
- * @permissionScope Manage eCommerce - all permissions
262
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
263
- * @permissionScope Picasso private app mega scope
264
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
265
- * @applicableIdentity APP
266
- * @returns Updated DeliveryProfile.
267
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateDeliveryProfile
268
- */
269
- export async function updateDeliveryProfile(_id, deliveryProfile) {
270
- // @ts-ignore
271
- const { httpClient, sideEffects } = arguments[2];
272
- const payload = renameKeysFromSDKRequestToRESTRequest({
273
- deliveryProfile: { ...deliveryProfile, id: _id },
274
- });
275
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateDeliveryProfile(payload);
276
- sideEffects?.onSiteCall?.();
277
- try {
278
- const result = await httpClient.request(reqOpts);
279
- sideEffects?.onSuccess?.(result);
280
- return renameKeysFromRESTResponseToSDKResponse(result.data)
281
- ?.deliveryProfile;
282
- }
283
- catch (err) {
284
- const transformedError = sdkTransformError(err, {
285
- spreadPathsToArguments: { deliveryProfile: '$[1]' },
286
- explicitPathsToArguments: { 'deliveryProfile.id': '$[0]' },
287
- singleArgumentUnchanged: false,
288
- }, ['_id', 'deliveryProfile']);
289
- sideEffects?.onError?.(err);
290
- throw transformedError;
291
- }
292
- }
293
- /**
294
- * Deletes a DeliveryProfile.
295
- *
296
- * Deleting a DeliveryProfile permanently removes them from the DeliveryProfile List.
297
- * @param deliveryProfileId - Id of the DeliveryProfile to delete.
298
- * @public
299
- * @documentationMaturity preview
300
- * @requiredField deliveryProfileId
301
- * @permissionId ECOM.DELIVERY_PROFILE_DELETE
302
- * @permissionScope Manage Stores - all permissions
303
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
304
- * @permissionScope Manage Restaurants - all permissions
305
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
306
- * @permissionScope Manage eCommerce - all permissions
307
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
308
- * @permissionScope Picasso private app mega scope
309
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
310
- * @applicableIdentity APP
311
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.DeleteDeliveryProfile
312
- */
313
- export async function deleteDeliveryProfile(deliveryProfileId) {
314
- // @ts-ignore
315
- const { httpClient, sideEffects } = arguments[1];
316
- const payload = renameKeysFromSDKRequestToRESTRequest({
317
- deliveryProfileId: deliveryProfileId,
318
- });
319
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.deleteDeliveryProfile(payload);
320
- sideEffects?.onSiteCall?.();
321
- try {
322
- const result = await httpClient.request(reqOpts);
323
- sideEffects?.onSuccess?.(result);
324
- }
325
- catch (err) {
326
- const transformedError = sdkTransformError(err, {
327
- spreadPathsToArguments: {},
328
- explicitPathsToArguments: { deliveryProfileId: '$[0]' },
329
- singleArgumentUnchanged: false,
330
- }, ['deliveryProfileId']);
331
- sideEffects?.onError?.(err);
332
- throw transformedError;
333
- }
334
- }
335
- /**
336
- * Retrieves a list of DeliveryProfiles, given the provided [paging, filtering, and sorting][1].
337
- *
338
- * Up to 1,000 DeliveryProfiles can be returned per request.
339
- *
340
- * To learn how to query DeliveryProfiles, see [API Query Language][2].
341
- *
342
- * [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging
343
- * [2]: https://dev.wix.com/api/rest/getting-started/api-query-language
344
- * @public
345
- * @documentationMaturity preview
346
- * @permissionScope Manage Stores - all permissions
347
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
348
- * @permissionScope Read eCommerce - all read permissions
349
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
350
- * @permissionScope Manage Restaurants - all permissions
351
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
352
- * @permissionScope Manage eCommerce - all permissions
353
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
354
- * @permissionScope Picasso private app mega scope
355
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
356
- * @permissionId ECOM.DELIVERY_PROFILE_READ
357
- * @applicableIdentity APP
358
- * @applicableIdentity VISITOR
359
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.QueryDeliveryProfiles
360
- */
361
- export function queryDeliveryProfiles() {
362
- // @ts-ignore
363
- const { httpClient, sideEffects } = arguments[0];
364
- return queryBuilder({
365
- func: async (payload) => {
366
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.queryDeliveryProfiles(payload);
367
- sideEffects?.onSiteCall?.();
368
- try {
369
- const result = await httpClient.request(reqOpts);
370
- sideEffects?.onSuccess?.(result);
371
- return result;
372
- }
373
- catch (err) {
374
- sideEffects?.onError?.(err);
375
- throw err;
376
- }
377
- },
378
- requestTransformer: (query) => {
379
- const args = [query, {}];
380
- return renameKeysFromSDKRequestToRESTRequest({
381
- ...args?.[1],
382
- query: args?.[0],
383
- });
384
- },
385
- responseTransformer: ({ data, }) => {
386
- const transformedData = renameKeysFromRESTResponseToSDKResponse(data);
387
- return {
388
- items: transformedData?.deliveryProfiles,
389
- pagingMetadata: transformedData?.pagingMetadata,
390
- };
391
- },
392
- errorTransformer: (err) => {
393
- const transformedError = sdkTransformError(err, {
394
- spreadPathsToArguments: {},
395
- explicitPathsToArguments: { query: '$[0]' },
396
- singleArgumentUnchanged: false,
397
- });
398
- throw transformedError;
399
- },
400
- pagingMethod: 'CURSOR',
401
- transformationPaths: {},
402
- });
403
- }
404
- /**
405
- * Creates a new DeliveryRegion in an existing DeliveryProfile.
406
- * @param deliveryProfileId - delivery profile id to associated with the DeliveryRegion
407
- * @param deliveryRegion - DeliveryRegion to be created
408
- * @public
409
- * @documentationMaturity preview
410
- * @requiredField deliveryProfileId
411
- * @requiredField deliveryRegion
412
- * @requiredField deliveryRegion.destinations.countryCode
413
- * @requiredField deliveryRegion.name
414
- * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
415
- * @permissionScope Manage Stores - all permissions
416
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
417
- * @permissionScope Manage Restaurants - all permissions
418
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
419
- * @permissionScope Manage eCommerce - all permissions
420
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
421
- * @permissionScope Picasso private app mega scope
422
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
423
- * @applicableIdentity APP
424
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.AddDeliveryRegion
425
- */
426
- export async function addDeliveryRegion(deliveryProfileId, deliveryRegion, options) {
427
- // @ts-ignore
428
- const { httpClient, sideEffects } = arguments[3];
429
- const payload = renameKeysFromSDKRequestToRESTRequest({
430
- deliveryProfileId: deliveryProfileId,
431
- deliveryRegion: deliveryRegion,
432
- revision: options?.revision,
433
- });
434
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.addDeliveryRegion(payload);
435
- sideEffects?.onSiteCall?.();
436
- try {
437
- const result = await httpClient.request(reqOpts);
438
- sideEffects?.onSuccess?.(result);
439
- return renameKeysFromRESTResponseToSDKResponse(result.data);
440
- }
441
- catch (err) {
442
- const transformedError = sdkTransformError(err, {
443
- spreadPathsToArguments: {},
444
- explicitPathsToArguments: {
445
- deliveryProfileId: '$[0]',
446
- deliveryRegion: '$[1]',
447
- revision: '$[2].revision',
448
- },
449
- singleArgumentUnchanged: false,
450
- }, ['deliveryProfileId', 'deliveryRegion', 'options']);
451
- sideEffects?.onError?.(err);
452
- throw transformedError;
453
- }
454
- }
455
- /**
456
- * Update a DeliveryRegion, supports partial update
457
- * Pass the latest `revision` for a successful update
458
- *
459
- * This method does not allow setting or updating the delivery delivery_carriers in this delivery_region.
460
- * Use AddDeliveryCarrier, UpdateDeliveryCarrier and RemoveDeliveryCarrier for these functionalities.
461
- * @public
462
- * @documentationMaturity preview
463
- * @requiredField deliveryRegion
464
- * @requiredField identifiers
465
- * @requiredField identifiers.deliveryProfileId
466
- * @requiredField identifiers.deliveryRegionId
467
- * @permissionId ECOM.DELIVERY_REGION_UPDATE
468
- * @permissionScope Manage Stores - all permissions
469
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
470
- * @permissionScope Manage Restaurants - all permissions
471
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
472
- * @permissionScope Manage eCommerce - all permissions
473
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
474
- * @permissionScope Picasso private app mega scope
475
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
476
- * @applicableIdentity APP
477
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateDeliveryRegion
478
- */
479
- export async function updateDeliveryRegion(identifiers, deliveryRegion, options) {
480
- // @ts-ignore
481
- const { httpClient, sideEffects } = arguments[3];
482
- const payload = renameKeysFromSDKRequestToRESTRequest({
483
- deliveryProfileId: identifiers?.deliveryProfileId,
484
- deliveryRegion: { ...deliveryRegion, id: identifiers?.deliveryRegionId },
485
- revision: options?.revision,
486
- });
487
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateDeliveryRegion(payload);
488
- sideEffects?.onSiteCall?.();
489
- try {
490
- const result = await httpClient.request(reqOpts);
491
- sideEffects?.onSuccess?.(result);
492
- return renameKeysFromRESTResponseToSDKResponse(result.data);
493
- }
494
- catch (err) {
495
- const transformedError = sdkTransformError(err, {
496
- spreadPathsToArguments: { deliveryRegion: '$[1]' },
497
- explicitPathsToArguments: {
498
- deliveryProfileId: '$[0].deliveryProfileId',
499
- 'deliveryRegion.id': '$[0].deliveryRegionId',
500
- revision: '$[2].revision',
501
- },
502
- singleArgumentUnchanged: false,
503
- }, ['identifiers', 'deliveryRegion', 'options']);
504
- sideEffects?.onError?.(err);
505
- throw transformedError;
506
- }
507
- }
508
- /**
509
- * Delete a DeliveryRegion
510
- * @public
511
- * @documentationMaturity preview
512
- * @requiredField identifiers
513
- * @requiredField identifiers.deliveryProfileId
514
- * @requiredField identifiers.deliveryRegionId
515
- * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
516
- * @permissionScope Manage Stores - all permissions
517
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
518
- * @permissionScope Manage Restaurants - all permissions
519
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
520
- * @permissionScope Manage eCommerce - all permissions
521
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
522
- * @permissionScope Picasso private app mega scope
523
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
524
- * @applicableIdentity APP
525
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.RemoveDeliveryRegion
526
- */
527
- export async function removeDeliveryRegion(identifiers, options) {
528
- // @ts-ignore
529
- const { httpClient, sideEffects } = arguments[2];
530
- const payload = renameKeysFromSDKRequestToRESTRequest({
531
- deliveryProfileId: identifiers?.deliveryProfileId,
532
- deliveryRegionId: identifiers?.deliveryRegionId,
533
- revision: options?.revision,
534
- });
535
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.removeDeliveryRegion(payload);
536
- sideEffects?.onSiteCall?.();
537
- try {
538
- const result = await httpClient.request(reqOpts);
539
- sideEffects?.onSuccess?.(result);
540
- return renameKeysFromRESTResponseToSDKResponse(result.data);
541
- }
542
- catch (err) {
543
- const transformedError = sdkTransformError(err, {
544
- spreadPathsToArguments: {},
545
- explicitPathsToArguments: {
546
- deliveryProfileId: '$[0].deliveryProfileId',
547
- deliveryRegionId: '$[0].deliveryRegionId',
548
- revision: '$[1].revision',
549
- },
550
- singleArgumentUnchanged: false,
551
- }, ['identifiers', 'options']);
552
- sideEffects?.onError?.(err);
553
- throw transformedError;
554
- }
555
- }
556
- /**
557
- * Add a delivery_carrier to a delivery region
558
- * @param deliveryRegionId - delivery_region id to associated with the delivery_carrier.
559
- * @public
560
- * @documentationMaturity preview
561
- * @requiredField deliveryRegionId
562
- * @requiredField options
563
- * @requiredField options.deliveryCarrier
564
- * @permissionId ECOM.DELIVERY_CARRIER_ADD
565
- * @permissionScope Manage Stores - all permissions
566
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
567
- * @permissionScope Manage Restaurants - all permissions
568
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
569
- * @permissionScope Manage eCommerce - all permissions
570
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
571
- * @permissionScope Picasso private app mega scope
572
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
573
- * @applicableIdentity APP
574
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.AddDeliveryCarrier
575
- */
576
- export async function addDeliveryCarrier(deliveryRegionId, options) {
577
- // @ts-ignore
578
- const { httpClient, sideEffects } = arguments[2];
579
- const payload = renameKeysFromSDKRequestToRESTRequest({
580
- deliveryRegionId: deliveryRegionId,
581
- deliveryCarrier: options?.deliveryCarrier,
582
- });
583
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.addDeliveryCarrier(payload);
584
- sideEffects?.onSiteCall?.();
585
- try {
586
- const result = await httpClient.request(reqOpts);
587
- sideEffects?.onSuccess?.(result);
588
- return renameKeysFromRESTResponseToSDKResponse(result.data);
589
- }
590
- catch (err) {
591
- const transformedError = sdkTransformError(err, {
592
- spreadPathsToArguments: {},
593
- explicitPathsToArguments: {
594
- deliveryRegionId: '$[0]',
595
- deliveryCarrier: '$[1].deliveryCarrier',
596
- },
597
- singleArgumentUnchanged: false,
598
- }, ['deliveryRegionId', 'options']);
599
- sideEffects?.onError?.(err);
600
- throw transformedError;
601
- }
602
- }
603
- /**
604
- * Remove a delivery_carrier from a delivery region
605
- * @param deliveryRegionId - Id of the DeliveryRegion
606
- * @public
607
- * @documentationMaturity preview
608
- * @requiredField deliveryRegionId
609
- * @requiredField options
610
- * @requiredField options.appId
611
- * @permissionId ECOM.DELIVERY_CARRIER_REMOVE
612
- * @permissionScope Manage Stores - all permissions
613
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
614
- * @permissionScope Manage Restaurants - all permissions
615
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
616
- * @permissionScope Manage eCommerce - all permissions
617
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
618
- * @permissionScope Picasso private app mega scope
619
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
620
- * @applicableIdentity APP
621
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.RemoveDeliveryCarrier
622
- */
623
- export async function removeDeliveryCarrier(deliveryRegionId, options) {
624
- // @ts-ignore
625
- const { httpClient, sideEffects } = arguments[2];
626
- const payload = renameKeysFromSDKRequestToRESTRequest({
627
- deliveryRegionId: deliveryRegionId,
628
- appId: options?.appId,
629
- });
630
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.removeDeliveryCarrier(payload);
631
- sideEffects?.onSiteCall?.();
632
- try {
633
- const result = await httpClient.request(reqOpts);
634
- sideEffects?.onSuccess?.(result);
635
- return renameKeysFromRESTResponseToSDKResponse(result.data);
636
- }
637
- catch (err) {
638
- const transformedError = sdkTransformError(err, {
639
- spreadPathsToArguments: {},
640
- explicitPathsToArguments: {
641
- deliveryRegionId: '$[0]',
642
- appId: '$[1].appId',
643
- },
644
- singleArgumentUnchanged: false,
645
- }, ['deliveryRegionId', 'options']);
646
- sideEffects?.onError?.(err);
647
- throw transformedError;
648
- }
649
- }
650
- /**
651
- * Update a delivery carrier in a delivery region
652
- * @param deliveryRegionId - DeliveryRegion id
653
- * @public
654
- * @documentationMaturity preview
655
- * @requiredField deliveryRegionId
656
- * @requiredField options.deliveryCarrier.appId
657
- * @permissionId ECOM.DELIVERY_CARRIER_UPDATE
658
- * @permissionScope Manage Stores - all permissions
659
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
660
- * @permissionScope Manage Restaurants - all permissions
661
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
662
- * @permissionScope Manage eCommerce - all permissions
663
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
664
- * @permissionScope Picasso private app mega scope
665
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
666
- * @applicableIdentity APP
667
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateDeliveryCarrier
668
- */
669
- export async function updateDeliveryCarrier(deliveryRegionId, options) {
670
- // @ts-ignore
671
- const { httpClient, sideEffects } = arguments[2];
672
- const payload = renameKeysFromSDKRequestToRESTRequest({
673
- deliveryRegionId: deliveryRegionId,
674
- deliveryCarrier: options?.deliveryCarrier,
675
- });
676
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateDeliveryCarrier(payload);
677
- sideEffects?.onSiteCall?.();
678
- try {
679
- const result = await httpClient.request(reqOpts);
680
- sideEffects?.onSuccess?.(result);
681
- return renameKeysFromRESTResponseToSDKResponse(result.data);
682
- }
683
- catch (err) {
684
- const transformedError = sdkTransformError(err, {
685
- spreadPathsToArguments: {},
686
- explicitPathsToArguments: {
687
- deliveryRegionId: '$[0]',
688
- deliveryCarrier: '$[1].deliveryCarrier',
689
- },
690
- singleArgumentUnchanged: false,
691
- }, ['deliveryRegionId', 'options']);
692
- sideEffects?.onError?.(err);
693
- throw transformedError;
694
- }
695
- }
696
- /**
697
- * List all installed delivery carriers in order to set their ids in delivery rules
698
- * @public
699
- * @documentationMaturity preview
700
- * @permissionId ECOM.DELIVERY_CARRIER_DETAILS_READ
701
- * @permissionScope Manage Stores - all permissions
702
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
703
- * @permissionScope Read eCommerce - all read permissions
704
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
705
- * @permissionScope Manage Restaurants - all permissions
706
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
707
- * @permissionScope Manage eCommerce - all permissions
708
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
709
- * @permissionScope Picasso private app mega scope
710
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
711
- * @applicableIdentity APP
712
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.ListDeliveryCarrierDetails
713
- * @deprecated
714
- * @replacedBy ListInstalledDeliveryCarriers
715
- * @targetRemovalDate 2025-04-01
716
- */
717
- export async function listDeliveryCarrierDetails() {
718
- // @ts-ignore
719
- const { httpClient, sideEffects } = arguments[0];
720
- const payload = renameKeysFromSDKRequestToRESTRequest({});
721
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.listDeliveryCarrierDetails(payload);
722
- sideEffects?.onSiteCall?.();
723
- try {
724
- const result = await httpClient.request(reqOpts);
725
- sideEffects?.onSuccess?.(result);
726
- return renameKeysFromRESTResponseToSDKResponse(result.data);
727
- }
728
- catch (err) {
729
- const transformedError = sdkTransformError(err, {
730
- spreadPathsToArguments: {},
731
- explicitPathsToArguments: {},
732
- singleArgumentUnchanged: false,
733
- }, []);
734
- sideEffects?.onError?.(err);
735
- throw transformedError;
736
- }
737
- }
738
- /** @public
739
- * @documentationMaturity preview
740
- * @permissionId ECOM.DELIVERY_CARRIER_READ
741
- * @permissionScope Manage Stores - all permissions
742
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
743
- * @permissionScope Read eCommerce - all read permissions
744
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
745
- * @permissionScope Manage Restaurants - all permissions
746
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
747
- * @permissionScope Manage eCommerce - all permissions
748
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
749
- * @permissionScope Picasso private app mega scope
750
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
751
- * @applicableIdentity APP
752
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.ListInstalledDeliveryCarriers
753
- */
754
- export async function listInstalledDeliveryCarriers() {
755
- // @ts-ignore
756
- const { httpClient, sideEffects } = arguments[0];
757
- const payload = renameKeysFromSDKRequestToRESTRequest({});
758
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.listInstalledDeliveryCarriers(payload);
759
- sideEffects?.onSiteCall?.();
760
- try {
761
- const result = await httpClient.request(reqOpts);
762
- sideEffects?.onSuccess?.(result);
763
- return renameKeysFromRESTResponseToSDKResponse(result.data);
764
- }
765
- catch (err) {
766
- const transformedError = sdkTransformError(err, {
767
- spreadPathsToArguments: {},
768
- explicitPathsToArguments: {},
769
- singleArgumentUnchanged: false,
770
- }, []);
771
- sideEffects?.onError?.(err);
772
- throw transformedError;
773
- }
774
- }
775
- /**
776
- * Get delivery carrier settings for a delivery profile and delivery region.
777
- * These are returned in a table format for the dashboard.
778
- * @param deliveryProfileId - Delivery profile id.
779
- * @public
780
- * @documentationMaturity preview
781
- * @requiredField deliveryProfileId
782
- * @permissionId ECOM.DELIVERY_CARRIER_READ
783
- * @permissionScope Manage Stores - all permissions
784
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
785
- * @permissionScope Read eCommerce - all read permissions
786
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
787
- * @permissionScope Manage Restaurants - all permissions
788
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
789
- * @permissionScope Manage eCommerce - all permissions
790
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
791
- * @permissionScope Picasso private app mega scope
792
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
793
- * @applicableIdentity APP
794
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.ListDeliveryCarriers
795
- */
796
- export async function listDeliveryCarriers(deliveryProfileId, options) {
797
- // @ts-ignore
798
- const { httpClient, sideEffects } = arguments[2];
799
- const payload = renameKeysFromSDKRequestToRESTRequest({
800
- deliveryProfileId: deliveryProfileId,
801
- appIds: options?.appIds,
802
- });
803
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.listDeliveryCarriers(payload);
804
- sideEffects?.onSiteCall?.();
805
- try {
806
- const result = await httpClient.request(reqOpts);
807
- sideEffects?.onSuccess?.(result);
808
- return renameKeysFromRESTResponseToSDKResponse(result.data);
809
- }
810
- catch (err) {
811
- const transformedError = sdkTransformError(err, {
812
- spreadPathsToArguments: {},
813
- explicitPathsToArguments: {
814
- deliveryProfileId: '$[0]',
815
- appIds: '$[1].appIds',
816
- },
817
- singleArgumentUnchanged: false,
818
- }, ['deliveryProfileId', 'options']);
819
- sideEffects?.onError?.(err);
820
- throw transformedError;
821
- }
822
- }
823
- /**
824
- * Update carrier's external active settings
825
- * @param carrierId - Carrier id.
826
- * @public
827
- * @documentationMaturity preview
828
- * @requiredField carrierId
829
- * @requiredField options
830
- * @requiredField options.active
831
- * @requiredField options.rowId
832
- * @permissionId ECOM.DELIVERY_CARRIER_UPDATE
833
- * @permissionScope Manage Stores - all permissions
834
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
835
- * @permissionScope Manage Restaurants - all permissions
836
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
837
- * @permissionScope Manage eCommerce - all permissions
838
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
839
- * @permissionScope Picasso private app mega scope
840
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
841
- * @applicableIdentity APP
842
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateCarrierSettings
843
- */
844
- export async function updateCarrierSettings(carrierId, options) {
845
- // @ts-ignore
846
- const { httpClient, sideEffects } = arguments[2];
847
- const payload = renameKeysFromSDKRequestToRESTRequest({
848
- carrierId: carrierId,
849
- rowId: options?.rowId,
850
- active: options?.active,
851
- });
852
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateCarrierSettings(payload);
853
- sideEffects?.onSiteCall?.();
854
- try {
855
- const result = await httpClient.request(reqOpts);
856
- sideEffects?.onSuccess?.(result);
857
- }
858
- catch (err) {
859
- const transformedError = sdkTransformError(err, {
860
- spreadPathsToArguments: {},
861
- explicitPathsToArguments: {
862
- carrierId: '$[0]',
863
- rowId: '$[1].rowId',
864
- active: '$[1].active',
865
- },
866
- singleArgumentUnchanged: false,
867
- }, ['carrierId', 'options']);
868
- sideEffects?.onError?.(err);
869
- throw transformedError;
870
- }
871
- }
872
- /**
873
- * Updates extended fields of a DeliveryProfile without incrementing revision
874
- * @param _id - ID of the entity to update.
875
- * @param namespace - Identifier for the app whose extended fields are being updated.
876
- * @public
877
- * @documentationMaturity preview
878
- * @requiredField _id
879
- * @requiredField namespace
880
- * @requiredField options
881
- * @requiredField options.namespaceData
882
- * @permissionId ECOM.DELIVERY_PROFILE_UPDATE
883
- * @permissionScope Manage Stores - all permissions
884
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
885
- * @permissionScope Manage Restaurants - all permissions
886
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
887
- * @permissionScope Manage eCommerce - all permissions
888
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
889
- * @permissionScope Picasso private app mega scope
890
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
891
- * @applicableIdentity APP
892
- * @fqn wix.ecom.deliveryprofile.v1.DeliveryProfiles.UpdateExtendedFields
893
- */
894
- export async function updateExtendedFields(_id, namespace, options) {
895
- // @ts-ignore
896
- const { httpClient, sideEffects } = arguments[3];
897
- const payload = renameKeysFromSDKRequestToRESTRequest({
898
- id: _id,
899
- namespace: namespace,
900
- namespaceData: options?.namespaceData,
901
- });
902
- const reqOpts = ambassadorWixEcomV1DeliveryProfile.updateExtendedFields(payload);
903
- sideEffects?.onSiteCall?.();
904
- try {
905
- const result = await httpClient.request(reqOpts);
906
- sideEffects?.onSuccess?.(result);
907
- return renameKeysFromRESTResponseToSDKResponse(result.data);
908
- }
909
- catch (err) {
910
- const transformedError = sdkTransformError(err, {
911
- spreadPathsToArguments: {},
912
- explicitPathsToArguments: {
913
- id: '$[0]',
914
- namespace: '$[1]',
915
- namespaceData: '$[2].namespaceData',
916
- },
917
- singleArgumentUnchanged: false,
918
- }, ['_id', 'namespace', 'options']);
919
- sideEffects?.onError?.(err);
920
- throw transformedError;
921
- }
922
- }
923
- //# sourceMappingURL=ecom-v1-delivery-profile-delivery-profile.universal.js.map