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