@wix/auto_sdk_ecom_draft-orders 1.0.17 → 1.0.19
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.
- package/build/{es/src/ecom-v1-draft-order-draft-orders.types.d.ts → ecom-v1-draft-order-draft-orders.universal-Ch0BEnrn.d.mts} +423 -831
- package/build/{cjs/src/ecom-v1-draft-order-draft-orders.types.d.ts → ecom-v1-draft-order-draft-orders.universal-Ch0BEnrn.d.ts} +423 -831
- package/build/index.d.mts +232 -0
- package/build/index.d.ts +232 -0
- package/build/index.js +4593 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +4520 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/{cjs/src/ecom-v1-draft-order-draft-orders.types.d.ts → ecom-v1-draft-order-draft-orders.universal-B5CD1SEk.d.mts} +885 -1096
- package/build/internal/{es/src/ecom-v1-draft-order-draft-orders.types.d.ts → ecom-v1-draft-order-draft-orders.universal-B5CD1SEk.d.ts} +885 -1096
- package/build/internal/index.d.mts +232 -0
- package/build/internal/index.d.ts +232 -0
- package/build/internal/index.js +4593 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +4520 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/meta.d.mts +2751 -0
- package/build/internal/meta.d.ts +2751 -0
- package/build/internal/meta.js +3323 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +3275 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/meta.d.mts +2751 -0
- package/build/meta.d.ts +2751 -0
- package/build/meta.js +3323 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +3275 -0
- package/build/meta.mjs.map +1 -0
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.context.d.ts +0 -26
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.context.js +0 -57
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.context.js.map +0 -1
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.http.d.ts +0 -97
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.http.js +0 -2951
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.http.js.map +0 -1
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.meta.d.ts +0 -60
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.meta.js +0 -446
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.meta.js.map +0 -1
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.public.d.ts +0 -209
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.public.js +0 -168
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.public.js.map +0 -1
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.types.js +0 -360
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.types.js.map +0 -1
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.universal.d.ts +0 -4562
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.universal.js +0 -1943
- package/build/cjs/src/ecom-v1-draft-order-draft-orders.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/ecom-v1-draft-order-draft-orders.context.d.ts +0 -26
- package/build/es/src/ecom-v1-draft-order-draft-orders.context.js +0 -26
- package/build/es/src/ecom-v1-draft-order-draft-orders.context.js.map +0 -1
- package/build/es/src/ecom-v1-draft-order-draft-orders.http.d.ts +0 -97
- package/build/es/src/ecom-v1-draft-order-draft-orders.http.js +0 -2926
- package/build/es/src/ecom-v1-draft-order-draft-orders.http.js.map +0 -1
- package/build/es/src/ecom-v1-draft-order-draft-orders.meta.d.ts +0 -60
- package/build/es/src/ecom-v1-draft-order-draft-orders.meta.js +0 -398
- package/build/es/src/ecom-v1-draft-order-draft-orders.meta.js.map +0 -1
- package/build/es/src/ecom-v1-draft-order-draft-orders.public.d.ts +0 -209
- package/build/es/src/ecom-v1-draft-order-draft-orders.public.js +0 -114
- package/build/es/src/ecom-v1-draft-order-draft-orders.public.js.map +0 -1
- package/build/es/src/ecom-v1-draft-order-draft-orders.types.js +0 -357
- package/build/es/src/ecom-v1-draft-order-draft-orders.types.js.map +0 -1
- package/build/es/src/ecom-v1-draft-order-draft-orders.universal.d.ts +0 -4562
- package/build/es/src/ecom-v1-draft-order-draft-orders.universal.js +0 -1895
- package/build/es/src/ecom-v1-draft-order-draft-orders.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.context.d.ts +0 -26
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.context.js +0 -57
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.context.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.http.d.ts +0 -97
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.http.js +0 -2951
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.http.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.meta.d.ts +0 -60
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.meta.js +0 -446
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.public.d.ts +0 -209
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.public.js +0 -168
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.public.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.types.js +0 -360
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.types.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.universal.d.ts +0 -5285
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.universal.js +0 -1943
- package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.context.d.ts +0 -26
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.context.js +0 -26
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.context.js.map +0 -1
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.http.d.ts +0 -97
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.http.js +0 -2926
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.http.js.map +0 -1
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.meta.d.ts +0 -60
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.meta.js +0 -398
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.meta.js.map +0 -1
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.public.d.ts +0 -209
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.public.js +0 -114
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.public.js.map +0 -1
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.types.js +0 -357
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.types.js.map +0 -1
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.universal.d.ts +0 -5285
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.universal.js +0 -1895
- package/build/internal/es/src/ecom-v1-draft-order-draft-orders.universal.js.map +0 -1
|
@@ -1,1943 +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.setBusinessLocation = exports.setTaxExemption = exports.queryDraftOrders = exports.deleteDraftOrder = exports.createOrderFromDraft = exports.commitDraftOrder = exports.getOrderDraftabilityStatus = exports.getDraftOrder = exports.setBillingInfo = exports.setRecipientInfo = exports.setBuyerInfo = exports.setShippingInfo = exports.deleteCustomAdditionalFees = exports.createCustomAdditionalFees = exports.setAdditionalFees = exports.deleteCustomDiscounts = exports.createCustomDiscounts = exports.setDiscounts = exports.updateLineItems = exports.addLineItemsToDraftOrder = exports.createEmptyDraftOrder = exports.createDraftOrder = exports.WebhookIdentityType = exports.SortOrder = exports.ChannelType = exports.AttributionSource = exports.ActivityType = exports.LineItemQuantityChangeType = exports.OrderStatus = exports.FulfillmentStatus = exports.PaymentStatus = exports.NonDraftableReason = exports.DiscountType = exports.FileType = exports.RuleType = exports.PickupMethod = exports.WeightUnit = exports.EditingStatus = exports.DiscountReason = exports.AppliedDiscountDiscountType = exports.SourceType = exports.PickupDetailsPickupMethod = exports.VatType = exports.TaxableAddressType = exports.AdjustmentType = exports.SubscriptionFrequency = exports.JurisdictionType = exports.PaymentOptionType = exports.ItemTypeItemType = exports.DescriptionLineType = 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 ambassadorWixEcomV1DraftOrder = __importStar(require("./ecom-v1-draft-order-draft-orders.http.js"));
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
const address_1 = require("@wix/sdk-runtime/transformations/address");
|
|
33
|
-
const address_2 = require("@wix/sdk-runtime/transformations/address");
|
|
34
|
-
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
35
|
-
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
36
|
-
const page_url_v2_1 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
37
|
-
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
38
|
-
var DescriptionLineType;
|
|
39
|
-
(function (DescriptionLineType) {
|
|
40
|
-
/** Unrecognized type. */
|
|
41
|
-
DescriptionLineType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
42
|
-
/** Plain text type. */
|
|
43
|
-
DescriptionLineType["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
44
|
-
/** Color type. */
|
|
45
|
-
DescriptionLineType["COLOR"] = "COLOR";
|
|
46
|
-
})(DescriptionLineType || (exports.DescriptionLineType = DescriptionLineType = {}));
|
|
47
|
-
var ItemTypeItemType;
|
|
48
|
-
(function (ItemTypeItemType) {
|
|
49
|
-
ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
50
|
-
ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
|
|
51
|
-
ItemTypeItemType["DIGITAL"] = "DIGITAL";
|
|
52
|
-
ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
|
|
53
|
-
ItemTypeItemType["SERVICE"] = "SERVICE";
|
|
54
|
-
})(ItemTypeItemType || (exports.ItemTypeItemType = ItemTypeItemType = {}));
|
|
55
|
-
/** Type of selected payment option for catalog item */
|
|
56
|
-
var PaymentOptionType;
|
|
57
|
-
(function (PaymentOptionType) {
|
|
58
|
-
/** The entire payment for this item happens as part of the checkout. */
|
|
59
|
-
PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
|
|
60
|
-
/** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
|
|
61
|
-
PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
|
|
62
|
-
/** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
|
|
63
|
-
PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
|
|
64
|
-
/** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
|
|
65
|
-
PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
|
|
66
|
-
/** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
|
|
67
|
-
PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
|
|
68
|
-
})(PaymentOptionType || (exports.PaymentOptionType = PaymentOptionType = {}));
|
|
69
|
-
/** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
|
|
70
|
-
var JurisdictionType;
|
|
71
|
-
(function (JurisdictionType) {
|
|
72
|
-
JurisdictionType["UNDEFINED"] = "UNDEFINED";
|
|
73
|
-
JurisdictionType["COUNTRY"] = "COUNTRY";
|
|
74
|
-
JurisdictionType["STATE"] = "STATE";
|
|
75
|
-
JurisdictionType["COUNTY"] = "COUNTY";
|
|
76
|
-
JurisdictionType["CITY"] = "CITY";
|
|
77
|
-
JurisdictionType["SPECIAL"] = "SPECIAL";
|
|
78
|
-
})(JurisdictionType || (exports.JurisdictionType = JurisdictionType = {}));
|
|
79
|
-
/** Frequency unit of recurring payment */
|
|
80
|
-
var SubscriptionFrequency;
|
|
81
|
-
(function (SubscriptionFrequency) {
|
|
82
|
-
SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
|
|
83
|
-
SubscriptionFrequency["DAY"] = "DAY";
|
|
84
|
-
SubscriptionFrequency["WEEK"] = "WEEK";
|
|
85
|
-
SubscriptionFrequency["MONTH"] = "MONTH";
|
|
86
|
-
SubscriptionFrequency["YEAR"] = "YEAR";
|
|
87
|
-
})(SubscriptionFrequency || (exports.SubscriptionFrequency = SubscriptionFrequency = {}));
|
|
88
|
-
var AdjustmentType;
|
|
89
|
-
(function (AdjustmentType) {
|
|
90
|
-
AdjustmentType["UNKNOWN_ADJUSTMENT_TYPE"] = "UNKNOWN_ADJUSTMENT_TYPE";
|
|
91
|
-
/** Adjustment increases the total amount due to changes like covering extra billing days. Typically results in an additional fee. */
|
|
92
|
-
AdjustmentType["EXTRA_CHARGE"] = "EXTRA_CHARGE";
|
|
93
|
-
/** Adjustment reduces the total amount due to changes like covering fewer billing days. Typically results in a credit or discount. */
|
|
94
|
-
AdjustmentType["CREDIT"] = "CREDIT";
|
|
95
|
-
})(AdjustmentType || (exports.AdjustmentType = AdjustmentType = {}));
|
|
96
|
-
var TaxableAddressType;
|
|
97
|
-
(function (TaxableAddressType) {
|
|
98
|
-
TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
|
|
99
|
-
TaxableAddressType["BUSINESS"] = "BUSINESS";
|
|
100
|
-
TaxableAddressType["BILLING"] = "BILLING";
|
|
101
|
-
TaxableAddressType["SHIPPING"] = "SHIPPING";
|
|
102
|
-
})(TaxableAddressType || (exports.TaxableAddressType = TaxableAddressType = {}));
|
|
103
|
-
/** tax info types */
|
|
104
|
-
var VatType;
|
|
105
|
-
(function (VatType) {
|
|
106
|
-
VatType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
107
|
-
/** CPF - for individual tax payers. */
|
|
108
|
-
VatType["CPF"] = "CPF";
|
|
109
|
-
/** CNPJ - for corporations */
|
|
110
|
-
VatType["CNPJ"] = "CNPJ";
|
|
111
|
-
})(VatType || (exports.VatType = VatType = {}));
|
|
112
|
-
var PickupDetailsPickupMethod;
|
|
113
|
-
(function (PickupDetailsPickupMethod) {
|
|
114
|
-
PickupDetailsPickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
|
|
115
|
-
PickupDetailsPickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
|
|
116
|
-
PickupDetailsPickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
|
|
117
|
-
})(PickupDetailsPickupMethod || (exports.PickupDetailsPickupMethod = PickupDetailsPickupMethod = {}));
|
|
118
|
-
var SourceType;
|
|
119
|
-
(function (SourceType) {
|
|
120
|
-
/** Part of the original order */
|
|
121
|
-
SourceType["ORIGINAL_ORDER"] = "ORIGINAL_ORDER";
|
|
122
|
-
/** Added by estimate * */
|
|
123
|
-
SourceType["AUTOMATIC"] = "AUTOMATIC";
|
|
124
|
-
/** Added manually to current draft order */
|
|
125
|
-
SourceType["CUSTOM"] = "CUSTOM";
|
|
126
|
-
})(SourceType || (exports.SourceType = SourceType = {}));
|
|
127
|
-
var AppliedDiscountDiscountType;
|
|
128
|
-
(function (AppliedDiscountDiscountType) {
|
|
129
|
-
AppliedDiscountDiscountType["GLOBAL"] = "GLOBAL";
|
|
130
|
-
AppliedDiscountDiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
|
|
131
|
-
AppliedDiscountDiscountType["SHIPPING"] = "SHIPPING";
|
|
132
|
-
})(AppliedDiscountDiscountType || (exports.AppliedDiscountDiscountType = AppliedDiscountDiscountType = {}));
|
|
133
|
-
var DiscountReason;
|
|
134
|
-
(function (DiscountReason) {
|
|
135
|
-
DiscountReason["UNSPECIFIED"] = "UNSPECIFIED";
|
|
136
|
-
DiscountReason["EXCHANGED_ITEMS"] = "EXCHANGED_ITEMS";
|
|
137
|
-
DiscountReason["BILLING_ADJUSTMENT"] = "BILLING_ADJUSTMENT";
|
|
138
|
-
})(DiscountReason || (exports.DiscountReason = DiscountReason = {}));
|
|
139
|
-
var EditingStatus;
|
|
140
|
-
(function (EditingStatus) {
|
|
141
|
-
/** DraftOrder is in draft state. */
|
|
142
|
-
EditingStatus["DRAFT"] = "DRAFT";
|
|
143
|
-
/** DraftOrder is in committed state. */
|
|
144
|
-
EditingStatus["COMMITTED"] = "COMMITTED";
|
|
145
|
-
})(EditingStatus || (exports.EditingStatus = EditingStatus = {}));
|
|
146
|
-
var WeightUnit;
|
|
147
|
-
(function (WeightUnit) {
|
|
148
|
-
/** Weight unit can't be classified due to an error. */
|
|
149
|
-
WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
150
|
-
/** Kilograms. */
|
|
151
|
-
WeightUnit["KG"] = "KG";
|
|
152
|
-
/** Pounds. */
|
|
153
|
-
WeightUnit["LB"] = "LB";
|
|
154
|
-
})(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
|
|
155
|
-
var PickupMethod;
|
|
156
|
-
(function (PickupMethod) {
|
|
157
|
-
PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
|
|
158
|
-
PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
|
|
159
|
-
PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
|
|
160
|
-
})(PickupMethod || (exports.PickupMethod = PickupMethod = {}));
|
|
161
|
-
var RuleType;
|
|
162
|
-
(function (RuleType) {
|
|
163
|
-
RuleType["VALIDATION"] = "VALIDATION";
|
|
164
|
-
RuleType["OTHER"] = "OTHER";
|
|
165
|
-
RuleType["MAX"] = "MAX";
|
|
166
|
-
RuleType["MIN"] = "MIN";
|
|
167
|
-
RuleType["MAX_LENGTH"] = "MAX_LENGTH";
|
|
168
|
-
RuleType["MIN_LENGTH"] = "MIN_LENGTH";
|
|
169
|
-
RuleType["MAX_SIZE"] = "MAX_SIZE";
|
|
170
|
-
RuleType["MIN_SIZE"] = "MIN_SIZE";
|
|
171
|
-
RuleType["FORMAT"] = "FORMAT";
|
|
172
|
-
RuleType["DECIMAL_LTE"] = "DECIMAL_LTE";
|
|
173
|
-
RuleType["DECIMAL_GTE"] = "DECIMAL_GTE";
|
|
174
|
-
RuleType["DECIMAL_LT"] = "DECIMAL_LT";
|
|
175
|
-
RuleType["DECIMAL_GT"] = "DECIMAL_GT";
|
|
176
|
-
RuleType["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
|
|
177
|
-
RuleType["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
|
|
178
|
-
RuleType["REQUIRED_FIELD"] = "REQUIRED_FIELD";
|
|
179
|
-
RuleType["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
|
|
180
|
-
RuleType["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
|
|
181
|
-
RuleType["EXACT_LENGTH"] = "EXACT_LENGTH";
|
|
182
|
-
RuleType["EXACT_SIZE"] = "EXACT_SIZE";
|
|
183
|
-
RuleType["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
|
|
184
|
-
})(RuleType || (exports.RuleType = RuleType = {}));
|
|
185
|
-
var FileType;
|
|
186
|
-
(function (FileType) {
|
|
187
|
-
FileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
188
|
-
FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
189
|
-
FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
190
|
-
FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
191
|
-
FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
192
|
-
FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
193
|
-
})(FileType || (exports.FileType = FileType = {}));
|
|
194
|
-
var DiscountType;
|
|
195
|
-
(function (DiscountType) {
|
|
196
|
-
DiscountType["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
197
|
-
DiscountType["GLOBAL"] = "GLOBAL";
|
|
198
|
-
DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
|
|
199
|
-
DiscountType["SHIPPING"] = "SHIPPING";
|
|
200
|
-
})(DiscountType || (exports.DiscountType = DiscountType = {}));
|
|
201
|
-
var NonDraftableReason;
|
|
202
|
-
(function (NonDraftableReason) {
|
|
203
|
-
NonDraftableReason["UNSPECIFIED"] = "UNSPECIFIED";
|
|
204
|
-
NonDraftableReason["PARTIALLY_OR_FULLY_REFUNDED"] = "PARTIALLY_OR_FULLY_REFUNDED";
|
|
205
|
-
NonDraftableReason["UNSUPPORTED_CHANNEL_TYPE"] = "UNSUPPORTED_CHANNEL_TYPE";
|
|
206
|
-
NonDraftableReason["ORDER_STATUS_IS_NOT_SUPPORTED"] = "ORDER_STATUS_IS_NOT_SUPPORTED";
|
|
207
|
-
NonDraftableReason["ORDER_AND_SITE_CURRENCIES_ARE_INCONSISTENT"] = "ORDER_AND_SITE_CURRENCIES_ARE_INCONSISTENT";
|
|
208
|
-
NonDraftableReason["ORDER_AND_SITE_WEIGHT_UNITS_ARE_INCONSISTENT"] = "ORDER_AND_SITE_WEIGHT_UNITS_ARE_INCONSISTENT";
|
|
209
|
-
NonDraftableReason["AMOUNTS_DO_NOT_ADD_UP"] = "AMOUNTS_DO_NOT_ADD_UP";
|
|
210
|
-
/** remove - this is not a reason, it's an error */
|
|
211
|
-
NonDraftableReason["ORDER_NOT_FOUND"] = "ORDER_NOT_FOUND";
|
|
212
|
-
NonDraftableReason["SUBSCRIPTION_LINE_ITEM_EXISTS"] = "SUBSCRIPTION_LINE_ITEM_EXISTS";
|
|
213
|
-
NonDraftableReason["UNSUPPORTED_CATALOG_ITEM"] = "UNSUPPORTED_CATALOG_ITEM";
|
|
214
|
-
NonDraftableReason["TAXABLE_EXISTING_ADDITIONAL_FEE"] = "TAXABLE_EXISTING_ADDITIONAL_FEE";
|
|
215
|
-
})(NonDraftableReason || (exports.NonDraftableReason = NonDraftableReason = {}));
|
|
216
|
-
var PaymentStatus;
|
|
217
|
-
(function (PaymentStatus) {
|
|
218
|
-
PaymentStatus["UNSPECIFIED"] = "UNSPECIFIED";
|
|
219
|
-
/**
|
|
220
|
-
* `NOT_PAID` can apply to an order made online, but not yet paid. In such cases `order.status` will be `INITIALIZED`.
|
|
221
|
-
* This status also applies when an offline order needs to be manually marked as paid. In such cases `order.status` will be `APPROVED`.
|
|
222
|
-
*/
|
|
223
|
-
PaymentStatus["NOT_PAID"] = "NOT_PAID";
|
|
224
|
-
/** All required payments associated with this order are paid. */
|
|
225
|
-
PaymentStatus["PAID"] = "PAID";
|
|
226
|
-
/** Order partially refunded, but the refunded amount is less than the order's total price. See `order.balanceSummary` for more details. */
|
|
227
|
-
PaymentStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
|
|
228
|
-
/** Order fully refunded. Refund amount equals total price. See `order.balanceSummary` for more details. */
|
|
229
|
-
PaymentStatus["FULLY_REFUNDED"] = "FULLY_REFUNDED";
|
|
230
|
-
/**
|
|
231
|
-
* All payments pending.
|
|
232
|
-
*
|
|
233
|
-
* This can happen with two-step payments, when a payment requires manual review, or when a payment is in progress and will be concluded shortly.
|
|
234
|
-
* Learn more about [pending orders](https://support.wix.com/en/article/pending-orders).
|
|
235
|
-
*/
|
|
236
|
-
PaymentStatus["PENDING"] = "PENDING";
|
|
237
|
-
/** At least one payment received and approved, but it covers less than the order's total price. See `order.balanceSummary` for more details. */
|
|
238
|
-
PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
|
|
239
|
-
/**
|
|
240
|
-
* Payment received, but not yet confirmed by the payment provider.
|
|
241
|
-
*
|
|
242
|
-
* In most cases, when a payment provider is holding payment it's because setup hasn't been successfully completed by the merchant/site owner.
|
|
243
|
-
* To solve this, the merchant/site owner should log in to the payment provider's dashboard and make sure their account is set up correctly, or contact their support for further assistance.
|
|
244
|
-
* @documentationMaturity preview
|
|
245
|
-
*/
|
|
246
|
-
PaymentStatus["PENDING_MERCHANT"] = "PENDING_MERCHANT";
|
|
247
|
-
/**
|
|
248
|
-
* One or more payments canceled.
|
|
249
|
-
* @documentationMaturity preview
|
|
250
|
-
*/
|
|
251
|
-
PaymentStatus["CANCELED"] = "CANCELED";
|
|
252
|
-
/**
|
|
253
|
-
* One or more payments declined.
|
|
254
|
-
* @documentationMaturity preview
|
|
255
|
-
*/
|
|
256
|
-
PaymentStatus["DECLINED"] = "DECLINED";
|
|
257
|
-
})(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
|
|
258
|
-
var FulfillmentStatus;
|
|
259
|
-
(function (FulfillmentStatus) {
|
|
260
|
-
/** None of the order items are fulfilled or the order was manually marked as unfulfilled. */
|
|
261
|
-
FulfillmentStatus["NOT_FULFILLED"] = "NOT_FULFILLED";
|
|
262
|
-
/**
|
|
263
|
-
* All of the order items are fulfilled or the order was manually marked as fulfilled.
|
|
264
|
-
* Orders without shipping info are fulfilled automatically.
|
|
265
|
-
*/
|
|
266
|
-
FulfillmentStatus["FULFILLED"] = "FULFILLED";
|
|
267
|
-
/** Some, but not all, of the order items are fulfilled. */
|
|
268
|
-
FulfillmentStatus["PARTIALLY_FULFILLED"] = "PARTIALLY_FULFILLED";
|
|
269
|
-
})(FulfillmentStatus || (exports.FulfillmentStatus = FulfillmentStatus = {}));
|
|
270
|
-
var OrderStatus;
|
|
271
|
-
(function (OrderStatus) {
|
|
272
|
-
/** Order created, but not yet approved or canceled. */
|
|
273
|
-
OrderStatus["INITIALIZED"] = "INITIALIZED";
|
|
274
|
-
/**
|
|
275
|
-
* Order approved.
|
|
276
|
-
*
|
|
277
|
-
* This happens when either an online payment is received **or** when `order.priceSummary.total = 0` (a zero-total order).
|
|
278
|
-
* Offline orders (cash payment) are automatically approved.
|
|
279
|
-
*/
|
|
280
|
-
OrderStatus["APPROVED"] = "APPROVED";
|
|
281
|
-
/** Order canceled by the user. */
|
|
282
|
-
OrderStatus["CANCELED"] = "CANCELED";
|
|
283
|
-
/**
|
|
284
|
-
* Order pending.
|
|
285
|
-
* @documentationMaturity preview
|
|
286
|
-
*/
|
|
287
|
-
OrderStatus["PENDING"] = "PENDING";
|
|
288
|
-
/**
|
|
289
|
-
* Order rejected.
|
|
290
|
-
*
|
|
291
|
-
* This happens when pending payments fail.
|
|
292
|
-
* @documentationMaturity preview
|
|
293
|
-
*/
|
|
294
|
-
OrderStatus["REJECTED"] = "REJECTED";
|
|
295
|
-
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
|
|
296
|
-
var LineItemQuantityChangeType;
|
|
297
|
-
(function (LineItemQuantityChangeType) {
|
|
298
|
-
/** Quantity increased. */
|
|
299
|
-
LineItemQuantityChangeType["QUANTITY_INCREASED"] = "QUANTITY_INCREASED";
|
|
300
|
-
/** Quantity decreased. */
|
|
301
|
-
LineItemQuantityChangeType["QUANTITY_DECREASED"] = "QUANTITY_DECREASED";
|
|
302
|
-
})(LineItemQuantityChangeType || (exports.LineItemQuantityChangeType = LineItemQuantityChangeType = {}));
|
|
303
|
-
var ActivityType;
|
|
304
|
-
(function (ActivityType) {
|
|
305
|
-
ActivityType["ORDER_REFUNDED"] = "ORDER_REFUNDED";
|
|
306
|
-
ActivityType["ORDER_PLACED"] = "ORDER_PLACED";
|
|
307
|
-
ActivityType["ORDER_PAID"] = "ORDER_PAID";
|
|
308
|
-
ActivityType["ORDER_FULFILLED"] = "ORDER_FULFILLED";
|
|
309
|
-
ActivityType["ORDER_NOT_FULFILLED"] = "ORDER_NOT_FULFILLED";
|
|
310
|
-
ActivityType["ORDER_CANCELED"] = "ORDER_CANCELED";
|
|
311
|
-
ActivityType["DOWNLOAD_LINK_SENT"] = "DOWNLOAD_LINK_SENT";
|
|
312
|
-
ActivityType["TRACKING_NUMBER_ADDED"] = "TRACKING_NUMBER_ADDED";
|
|
313
|
-
ActivityType["TRACKING_NUMBER_EDITED"] = "TRACKING_NUMBER_EDITED";
|
|
314
|
-
ActivityType["TRACKING_LINK_ADDED"] = "TRACKING_LINK_ADDED";
|
|
315
|
-
ActivityType["SHIPPING_CONFIRMATION_EMAIL_SENT"] = "SHIPPING_CONFIRMATION_EMAIL_SENT";
|
|
316
|
-
ActivityType["INVOICE_ADDED"] = "INVOICE_ADDED";
|
|
317
|
-
ActivityType["INVOICE_REMOVED"] = "INVOICE_REMOVED";
|
|
318
|
-
ActivityType["INVOICE_SENT"] = "INVOICE_SENT";
|
|
319
|
-
ActivityType["FULFILLER_EMAIL_SENT"] = "FULFILLER_EMAIL_SENT";
|
|
320
|
-
ActivityType["SHIPPING_ADDRESS_EDITED"] = "SHIPPING_ADDRESS_EDITED";
|
|
321
|
-
ActivityType["EMAIL_EDITED"] = "EMAIL_EDITED";
|
|
322
|
-
ActivityType["PICKUP_READY_EMAIL_SENT"] = "PICKUP_READY_EMAIL_SENT";
|
|
323
|
-
ActivityType["CUSTOM_ACTIVITY"] = "CUSTOM_ACTIVITY";
|
|
324
|
-
ActivityType["MERCHANT_COMMENT"] = "MERCHANT_COMMENT";
|
|
325
|
-
ActivityType["ORDER_CREATED_FROM_EXCHANGE"] = "ORDER_CREATED_FROM_EXCHANGE";
|
|
326
|
-
ActivityType["NEW_EXCHANGE_ORDER_CREATED"] = "NEW_EXCHANGE_ORDER_CREATED";
|
|
327
|
-
ActivityType["ORDER_PARTIALLY_PAID"] = "ORDER_PARTIALLY_PAID";
|
|
328
|
-
ActivityType["DRAFT_ORDER_CHANGES_APPLIED"] = "DRAFT_ORDER_CHANGES_APPLIED";
|
|
329
|
-
ActivityType["SAVED_PAYMENT_METHOD"] = "SAVED_PAYMENT_METHOD";
|
|
330
|
-
/** @documentationMaturity preview */
|
|
331
|
-
ActivityType["PAYMENT_PENDING"] = "PAYMENT_PENDING";
|
|
332
|
-
/** @documentationMaturity preview */
|
|
333
|
-
ActivityType["PAYMENT_CANCELED"] = "PAYMENT_CANCELED";
|
|
334
|
-
/** @documentationMaturity preview */
|
|
335
|
-
ActivityType["PAYMENT_DECLINED"] = "PAYMENT_DECLINED";
|
|
336
|
-
/** @documentationMaturity preview */
|
|
337
|
-
ActivityType["ORDER_PENDING"] = "ORDER_PENDING";
|
|
338
|
-
/** @documentationMaturity preview */
|
|
339
|
-
ActivityType["ORDER_REJECTED"] = "ORDER_REJECTED";
|
|
340
|
-
})(ActivityType || (exports.ActivityType = ActivityType = {}));
|
|
341
|
-
var AttributionSource;
|
|
342
|
-
(function (AttributionSource) {
|
|
343
|
-
AttributionSource["UNSPECIFIED"] = "UNSPECIFIED";
|
|
344
|
-
AttributionSource["FACEBOOK_ADS"] = "FACEBOOK_ADS";
|
|
345
|
-
})(AttributionSource || (exports.AttributionSource = AttributionSource = {}));
|
|
346
|
-
var ChannelType;
|
|
347
|
-
(function (ChannelType) {
|
|
348
|
-
/** Unspecified sales channel. This value is not supported. */
|
|
349
|
-
ChannelType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
350
|
-
/** A web client. */
|
|
351
|
-
ChannelType["WEB"] = "WEB";
|
|
352
|
-
/** [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395). */
|
|
353
|
-
ChannelType["POS"] = "POS";
|
|
354
|
-
/** [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop). */
|
|
355
|
-
ChannelType["EBAY"] = "EBAY";
|
|
356
|
-
/** [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop). */
|
|
357
|
-
ChannelType["AMAZON"] = "AMAZON";
|
|
358
|
-
/** Other sales platform. */
|
|
359
|
-
ChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
|
|
360
|
-
/** [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview). */
|
|
361
|
-
ChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
|
|
362
|
-
/** Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings) */
|
|
363
|
-
ChannelType["WIX_INVOICES"] = "WIX_INVOICES";
|
|
364
|
-
/** Wix merchant backoffice. */
|
|
365
|
-
ChannelType["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
|
|
366
|
-
/** Wish sales channel. */
|
|
367
|
-
ChannelType["WISH"] = "WISH";
|
|
368
|
-
/** [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass). */
|
|
369
|
-
ChannelType["CLASS_PASS"] = "CLASS_PASS";
|
|
370
|
-
/** Global-E sales channel. */
|
|
371
|
-
ChannelType["GLOBAL_E"] = "GLOBAL_E";
|
|
372
|
-
/** [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops). */
|
|
373
|
-
ChannelType["FACEBOOK"] = "FACEBOOK";
|
|
374
|
-
/** [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel). */
|
|
375
|
-
ChannelType["ETSY"] = "ETSY";
|
|
376
|
-
/** [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel). */
|
|
377
|
-
ChannelType["TIKTOK"] = "TIKTOK";
|
|
378
|
-
/** [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app). */
|
|
379
|
-
ChannelType["FAIRE_COM"] = "FAIRE_COM";
|
|
380
|
-
})(ChannelType || (exports.ChannelType = ChannelType = {}));
|
|
381
|
-
var SortOrder;
|
|
382
|
-
(function (SortOrder) {
|
|
383
|
-
SortOrder["ASC"] = "ASC";
|
|
384
|
-
SortOrder["DESC"] = "DESC";
|
|
385
|
-
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
386
|
-
var WebhookIdentityType;
|
|
387
|
-
(function (WebhookIdentityType) {
|
|
388
|
-
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
389
|
-
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
390
|
-
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
391
|
-
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
392
|
-
WebhookIdentityType["APP"] = "APP";
|
|
393
|
-
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
394
|
-
/**
|
|
395
|
-
* Creates or gets a draft order.
|
|
396
|
-
*
|
|
397
|
-
* When passing the ID of an order that is already in draft, the existing draft order will be returned.
|
|
398
|
-
* To complete a draft and update the order, call [Commit Draft Order](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/draft-orders/commit-draft-order).
|
|
399
|
-
* @param orderId - To create a draft from existing order, provide its id. Otherwise, an empty draft will be created.
|
|
400
|
-
* @public
|
|
401
|
-
* @documentationMaturity preview
|
|
402
|
-
* @requiredField orderId
|
|
403
|
-
* @permissionId ECOM.DRAFT_ORDERS_CREATE
|
|
404
|
-
* @permissionId ECOM.DRAFT_ORDER_READ_ALL_EXTENDED_FIELDS
|
|
405
|
-
* @permissionId DRAFT_ORDER_WRITE_ALL_EXTENDED_FIELDS
|
|
406
|
-
* @permissionScope Manage Stores - all permissions
|
|
407
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
408
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
409
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
410
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
411
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
412
|
-
* @permissionScope Picasso private app mega scope
|
|
413
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
414
|
-
* @applicableIdentity APP
|
|
415
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateDraftOrder
|
|
416
|
-
*/
|
|
417
|
-
async function createDraftOrder(orderId) {
|
|
418
|
-
// @ts-ignore
|
|
419
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
420
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ orderId: orderId });
|
|
421
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.createDraftOrder(payload);
|
|
422
|
-
sideEffects?.onSiteCall?.();
|
|
423
|
-
try {
|
|
424
|
-
const result = await httpClient.request(reqOpts);
|
|
425
|
-
sideEffects?.onSuccess?.(result);
|
|
426
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
427
|
-
{
|
|
428
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
429
|
-
paths: [
|
|
430
|
-
{
|
|
431
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
432
|
-
},
|
|
433
|
-
],
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
437
|
-
paths: [
|
|
438
|
-
{
|
|
439
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
449
|
-
},
|
|
450
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
451
|
-
{
|
|
452
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
465
|
-
},
|
|
466
|
-
],
|
|
467
|
-
},
|
|
468
|
-
]));
|
|
469
|
-
}
|
|
470
|
-
catch (err) {
|
|
471
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
472
|
-
spreadPathsToArguments: {},
|
|
473
|
-
explicitPathsToArguments: { orderId: '$[0]' },
|
|
474
|
-
singleArgumentUnchanged: false,
|
|
475
|
-
}, ['orderId']);
|
|
476
|
-
sideEffects?.onError?.(err);
|
|
477
|
-
throw transformedError;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
exports.createDraftOrder = createDraftOrder;
|
|
481
|
-
/**
|
|
482
|
-
* Creates an empty draft order.
|
|
483
|
-
* @public
|
|
484
|
-
* @documentationMaturity preview
|
|
485
|
-
* @permissionId ECOM.DRAFT_ORDERS_CREATE
|
|
486
|
-
* @permissionId ECOM.DRAFT_ORDER_READ_ALL_EXTENDED_FIELDS
|
|
487
|
-
* @permissionId DRAFT_ORDER_WRITE_ALL_EXTENDED_FIELDS
|
|
488
|
-
* @permissionScope Manage Stores - all permissions
|
|
489
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
490
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
491
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
492
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
493
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
494
|
-
* @permissionScope Picasso private app mega scope
|
|
495
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
496
|
-
* @applicableIdentity APP
|
|
497
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateEmptyDraftOrder
|
|
498
|
-
*/
|
|
499
|
-
async function createEmptyDraftOrder() {
|
|
500
|
-
// @ts-ignore
|
|
501
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
502
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
|
|
503
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.createEmptyDraftOrder(payload);
|
|
504
|
-
sideEffects?.onSiteCall?.();
|
|
505
|
-
try {
|
|
506
|
-
const result = await httpClient.request(reqOpts);
|
|
507
|
-
sideEffects?.onSuccess?.(result);
|
|
508
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
509
|
-
{
|
|
510
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
511
|
-
paths: [
|
|
512
|
-
{
|
|
513
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
514
|
-
},
|
|
515
|
-
],
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
519
|
-
paths: [
|
|
520
|
-
{
|
|
521
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
522
|
-
},
|
|
523
|
-
{
|
|
524
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
531
|
-
},
|
|
532
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
533
|
-
{
|
|
534
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
538
|
-
},
|
|
539
|
-
{
|
|
540
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
547
|
-
},
|
|
548
|
-
],
|
|
549
|
-
},
|
|
550
|
-
]));
|
|
551
|
-
}
|
|
552
|
-
catch (err) {
|
|
553
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
554
|
-
spreadPathsToArguments: {},
|
|
555
|
-
explicitPathsToArguments: {},
|
|
556
|
-
singleArgumentUnchanged: false,
|
|
557
|
-
}, []);
|
|
558
|
-
sideEffects?.onError?.(err);
|
|
559
|
-
throw transformedError;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
exports.createEmptyDraftOrder = createEmptyDraftOrder;
|
|
563
|
-
/**
|
|
564
|
-
* Adds line items to a draft order.
|
|
565
|
-
* @param draftOrderId - The draft order id
|
|
566
|
-
* @public
|
|
567
|
-
* @documentationMaturity preview
|
|
568
|
-
* @requiredField draftOrderId
|
|
569
|
-
* @requiredField options.catalogLineItems.catalogReference
|
|
570
|
-
* @permissionId ECOM.DRAFT_ORDERS_ADD_LINE_ITEMS
|
|
571
|
-
* @permissionScope Manage Stores - all permissions
|
|
572
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
573
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
574
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
575
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
576
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
577
|
-
* @permissionScope Picasso private app mega scope
|
|
578
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
579
|
-
* @applicableIdentity APP
|
|
580
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.AddLineItemsToDraftOrder
|
|
581
|
-
*/
|
|
582
|
-
async function addLineItemsToDraftOrder(draftOrderId, options) {
|
|
583
|
-
// @ts-ignore
|
|
584
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
585
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
586
|
-
draftOrderId: draftOrderId,
|
|
587
|
-
catalogLineItems: options?.catalogLineItems,
|
|
588
|
-
customLineItems: options?.customLineItems,
|
|
589
|
-
}), [
|
|
590
|
-
{
|
|
591
|
-
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
592
|
-
paths: [{ path: 'customLineItems.url' }],
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
transformFn: image_1.transformSDKImageToRESTImage,
|
|
596
|
-
paths: [{ path: 'customLineItems.media' }],
|
|
597
|
-
},
|
|
598
|
-
]);
|
|
599
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.addLineItemsToDraftOrder(payload);
|
|
600
|
-
sideEffects?.onSiteCall?.();
|
|
601
|
-
try {
|
|
602
|
-
const result = await httpClient.request(reqOpts);
|
|
603
|
-
sideEffects?.onSuccess?.(result);
|
|
604
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
605
|
-
{
|
|
606
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
607
|
-
paths: [
|
|
608
|
-
{
|
|
609
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
610
|
-
},
|
|
611
|
-
],
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
615
|
-
paths: [
|
|
616
|
-
{
|
|
617
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
627
|
-
},
|
|
628
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
629
|
-
{
|
|
630
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
631
|
-
},
|
|
632
|
-
{
|
|
633
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
640
|
-
},
|
|
641
|
-
{
|
|
642
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
643
|
-
},
|
|
644
|
-
],
|
|
645
|
-
},
|
|
646
|
-
]));
|
|
647
|
-
}
|
|
648
|
-
catch (err) {
|
|
649
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
650
|
-
spreadPathsToArguments: {},
|
|
651
|
-
explicitPathsToArguments: {
|
|
652
|
-
draftOrderId: '$[0]',
|
|
653
|
-
catalogLineItems: '$[1].catalogLineItems',
|
|
654
|
-
customLineItems: '$[1].customLineItems',
|
|
655
|
-
},
|
|
656
|
-
singleArgumentUnchanged: false,
|
|
657
|
-
}, ['draftOrderId', 'options']);
|
|
658
|
-
sideEffects?.onError?.(err);
|
|
659
|
-
throw transformedError;
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
exports.addLineItemsToDraftOrder = addLineItemsToDraftOrder;
|
|
663
|
-
/**
|
|
664
|
-
* Updates a draft order's line items.
|
|
665
|
-
*
|
|
666
|
-
* Using this API, you can update a line item's quantity, price, and description.
|
|
667
|
-
* > **Notes:**
|
|
668
|
-
* > + Passing a quantity of `0` will remove the line item.
|
|
669
|
-
* > + Price cannot be updated for line items with `paymentOption: MEMBERSHIP`.
|
|
670
|
-
* > + Quantity cannot be decreased fulfilled line items. To get fulfillment information, pass the order ID to [List Fulfillments For Single Order](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/order-fulfillments/list-fulfillments-for-single-order).
|
|
671
|
-
* @param draftOrderId - The draft order id
|
|
672
|
-
* @public
|
|
673
|
-
* @documentationMaturity preview
|
|
674
|
-
* @requiredField draftOrderId
|
|
675
|
-
* @permissionId ECOM.DRAFT_ORDERS_MODIFY_ITEMS
|
|
676
|
-
* @permissionScope Manage Stores - all permissions
|
|
677
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
678
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
679
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
680
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
681
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
682
|
-
* @permissionScope Picasso private app mega scope
|
|
683
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
684
|
-
* @applicableIdentity APP
|
|
685
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.UpdateLineItems
|
|
686
|
-
*/
|
|
687
|
-
async function updateLineItems(draftOrderId, options) {
|
|
688
|
-
// @ts-ignore
|
|
689
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
690
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
691
|
-
draftOrderId: draftOrderId,
|
|
692
|
-
lineItemChanges: options?.lineItemChanges,
|
|
693
|
-
});
|
|
694
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.updateLineItems(payload);
|
|
695
|
-
sideEffects?.onSiteCall?.();
|
|
696
|
-
try {
|
|
697
|
-
const result = await httpClient.request(reqOpts);
|
|
698
|
-
sideEffects?.onSuccess?.(result);
|
|
699
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
700
|
-
{
|
|
701
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
702
|
-
paths: [
|
|
703
|
-
{
|
|
704
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
705
|
-
},
|
|
706
|
-
],
|
|
707
|
-
},
|
|
708
|
-
{
|
|
709
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
710
|
-
paths: [
|
|
711
|
-
{
|
|
712
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
713
|
-
},
|
|
714
|
-
{
|
|
715
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
716
|
-
},
|
|
717
|
-
{
|
|
718
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
722
|
-
},
|
|
723
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
724
|
-
{
|
|
725
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
729
|
-
},
|
|
730
|
-
{
|
|
731
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
732
|
-
},
|
|
733
|
-
{
|
|
734
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
738
|
-
},
|
|
739
|
-
],
|
|
740
|
-
},
|
|
741
|
-
]));
|
|
742
|
-
}
|
|
743
|
-
catch (err) {
|
|
744
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
745
|
-
spreadPathsToArguments: {},
|
|
746
|
-
explicitPathsToArguments: {
|
|
747
|
-
draftOrderId: '$[0]',
|
|
748
|
-
lineItemChanges: '$[1].lineItemChanges',
|
|
749
|
-
},
|
|
750
|
-
singleArgumentUnchanged: false,
|
|
751
|
-
}, ['draftOrderId', 'options']);
|
|
752
|
-
sideEffects?.onError?.(err);
|
|
753
|
-
throw transformedError;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
exports.updateLineItems = updateLineItems;
|
|
757
|
-
/**
|
|
758
|
-
* Sets and enables or disables discounts on a draft order.
|
|
759
|
-
*
|
|
760
|
-
* Any discounts not passed will not change.
|
|
761
|
-
* @param draftOrderId - The draft order id
|
|
762
|
-
* @param discounts - The discount ids to opt-in. all existing discounts not listed are to be opted-out.
|
|
763
|
-
* @public
|
|
764
|
-
* @documentationMaturity preview
|
|
765
|
-
* @requiredField discounts
|
|
766
|
-
* @requiredField draftOrderId
|
|
767
|
-
* @permissionId ECOM.DRAFT_ORDERS_SET_DISCOUNTS
|
|
768
|
-
* @permissionScope Manage Stores - all permissions
|
|
769
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
770
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
771
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
772
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
773
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
774
|
-
* @permissionScope Picasso private app mega scope
|
|
775
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
776
|
-
* @applicableIdentity APP
|
|
777
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetDiscounts
|
|
778
|
-
*/
|
|
779
|
-
async function setDiscounts(draftOrderId, discounts) {
|
|
780
|
-
// @ts-ignore
|
|
781
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
782
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
783
|
-
draftOrderId: draftOrderId,
|
|
784
|
-
discounts: discounts,
|
|
785
|
-
});
|
|
786
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setDiscounts(payload);
|
|
787
|
-
sideEffects?.onSiteCall?.();
|
|
788
|
-
try {
|
|
789
|
-
const result = await httpClient.request(reqOpts);
|
|
790
|
-
sideEffects?.onSuccess?.(result);
|
|
791
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
792
|
-
{
|
|
793
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
794
|
-
paths: [
|
|
795
|
-
{
|
|
796
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
797
|
-
},
|
|
798
|
-
],
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
802
|
-
paths: [
|
|
803
|
-
{
|
|
804
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
805
|
-
},
|
|
806
|
-
{
|
|
807
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
811
|
-
},
|
|
812
|
-
{
|
|
813
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
814
|
-
},
|
|
815
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
816
|
-
{
|
|
817
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
818
|
-
},
|
|
819
|
-
{
|
|
820
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
821
|
-
},
|
|
822
|
-
{
|
|
823
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
827
|
-
},
|
|
828
|
-
{
|
|
829
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
830
|
-
},
|
|
831
|
-
],
|
|
832
|
-
},
|
|
833
|
-
]));
|
|
834
|
-
}
|
|
835
|
-
catch (err) {
|
|
836
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
837
|
-
spreadPathsToArguments: {},
|
|
838
|
-
explicitPathsToArguments: { draftOrderId: '$[0]', discounts: '$[1]' },
|
|
839
|
-
singleArgumentUnchanged: false,
|
|
840
|
-
}, ['draftOrderId', 'discounts']);
|
|
841
|
-
sideEffects?.onError?.(err);
|
|
842
|
-
throw transformedError;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
exports.setDiscounts = setDiscounts;
|
|
846
|
-
/**
|
|
847
|
-
* Adds merchant discounts to the order.
|
|
848
|
-
* @param draftOrderId - The draft order id
|
|
849
|
-
* @public
|
|
850
|
-
* @documentationMaturity preview
|
|
851
|
-
* @requiredField draftOrderId
|
|
852
|
-
* @requiredField options.discounts.amount
|
|
853
|
-
* @requiredField options.discounts.amount.amount
|
|
854
|
-
* @requiredField options.discounts.discountType
|
|
855
|
-
* @permissionId ECOM.DRAFT_ORDERS_ADD_DISCOUNTS
|
|
856
|
-
* @permissionScope Manage Stores - all permissions
|
|
857
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
858
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
859
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
860
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
861
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
862
|
-
* @permissionScope Picasso private app mega scope
|
|
863
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
864
|
-
* @applicableIdentity APP
|
|
865
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateCustomDiscounts
|
|
866
|
-
*/
|
|
867
|
-
async function createCustomDiscounts(draftOrderId, options) {
|
|
868
|
-
// @ts-ignore
|
|
869
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
870
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
871
|
-
draftOrderId: draftOrderId,
|
|
872
|
-
discounts: options?.discounts,
|
|
873
|
-
});
|
|
874
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.createCustomDiscounts(payload);
|
|
875
|
-
sideEffects?.onSiteCall?.();
|
|
876
|
-
try {
|
|
877
|
-
const result = await httpClient.request(reqOpts);
|
|
878
|
-
sideEffects?.onSuccess?.(result);
|
|
879
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
880
|
-
{
|
|
881
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
882
|
-
paths: [
|
|
883
|
-
{
|
|
884
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
885
|
-
},
|
|
886
|
-
],
|
|
887
|
-
},
|
|
888
|
-
{
|
|
889
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
890
|
-
paths: [
|
|
891
|
-
{
|
|
892
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
893
|
-
},
|
|
894
|
-
{
|
|
895
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
896
|
-
},
|
|
897
|
-
{
|
|
898
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
899
|
-
},
|
|
900
|
-
{
|
|
901
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
902
|
-
},
|
|
903
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
904
|
-
{
|
|
905
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
909
|
-
},
|
|
910
|
-
{
|
|
911
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
912
|
-
},
|
|
913
|
-
{
|
|
914
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
915
|
-
},
|
|
916
|
-
{
|
|
917
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
918
|
-
},
|
|
919
|
-
],
|
|
920
|
-
},
|
|
921
|
-
]));
|
|
922
|
-
}
|
|
923
|
-
catch (err) {
|
|
924
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
925
|
-
spreadPathsToArguments: {},
|
|
926
|
-
explicitPathsToArguments: {
|
|
927
|
-
draftOrderId: '$[0]',
|
|
928
|
-
discounts: '$[1].discounts',
|
|
929
|
-
},
|
|
930
|
-
singleArgumentUnchanged: false,
|
|
931
|
-
}, ['draftOrderId', 'options']);
|
|
932
|
-
sideEffects?.onError?.(err);
|
|
933
|
-
throw transformedError;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
exports.createCustomDiscounts = createCustomDiscounts;
|
|
937
|
-
/**
|
|
938
|
-
* Remove custom discounts from the order.
|
|
939
|
-
* @param draftOrderId - The draft order id
|
|
940
|
-
* @param discountIds - The discounts to remove
|
|
941
|
-
* @public
|
|
942
|
-
* @documentationMaturity preview
|
|
943
|
-
* @requiredField discountIds
|
|
944
|
-
* @requiredField draftOrderId
|
|
945
|
-
* @permissionId ECOM.DRAFT_ORDERS_DELETE_DISCOUNTS
|
|
946
|
-
* @permissionScope Manage Stores - all permissions
|
|
947
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
948
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
949
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
950
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
951
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
952
|
-
* @permissionScope Picasso private app mega scope
|
|
953
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
954
|
-
* @applicableIdentity APP
|
|
955
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.DeleteCustomDiscounts
|
|
956
|
-
*/
|
|
957
|
-
async function deleteCustomDiscounts(draftOrderId, discountIds) {
|
|
958
|
-
// @ts-ignore
|
|
959
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
960
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
961
|
-
draftOrderId: draftOrderId,
|
|
962
|
-
discountIds: discountIds,
|
|
963
|
-
});
|
|
964
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.deleteCustomDiscounts(payload);
|
|
965
|
-
sideEffects?.onSiteCall?.();
|
|
966
|
-
try {
|
|
967
|
-
const result = await httpClient.request(reqOpts);
|
|
968
|
-
sideEffects?.onSuccess?.(result);
|
|
969
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
970
|
-
{
|
|
971
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
972
|
-
paths: [
|
|
973
|
-
{
|
|
974
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
975
|
-
},
|
|
976
|
-
],
|
|
977
|
-
},
|
|
978
|
-
{
|
|
979
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
980
|
-
paths: [
|
|
981
|
-
{
|
|
982
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
983
|
-
},
|
|
984
|
-
{
|
|
985
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
986
|
-
},
|
|
987
|
-
{
|
|
988
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
989
|
-
},
|
|
990
|
-
{
|
|
991
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
992
|
-
},
|
|
993
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
994
|
-
{
|
|
995
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
996
|
-
},
|
|
997
|
-
{
|
|
998
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
1002
|
-
},
|
|
1003
|
-
{
|
|
1004
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
1005
|
-
},
|
|
1006
|
-
{
|
|
1007
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
1008
|
-
},
|
|
1009
|
-
],
|
|
1010
|
-
},
|
|
1011
|
-
]));
|
|
1012
|
-
}
|
|
1013
|
-
catch (err) {
|
|
1014
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1015
|
-
spreadPathsToArguments: {},
|
|
1016
|
-
explicitPathsToArguments: { draftOrderId: '$[0]', discountIds: '$[1]' },
|
|
1017
|
-
singleArgumentUnchanged: false,
|
|
1018
|
-
}, ['draftOrderId', 'discountIds']);
|
|
1019
|
-
sideEffects?.onError?.(err);
|
|
1020
|
-
throw transformedError;
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
exports.deleteCustomDiscounts = deleteCustomDiscounts;
|
|
1024
|
-
/**
|
|
1025
|
-
* Set which additional fees existing on the draft order are to be opt-in.
|
|
1026
|
-
* All existing additional fees not provided on the call are opted-out.
|
|
1027
|
-
* @param draftOrderId - The draft order id
|
|
1028
|
-
* @param additionalFees - The additional fees ids to opt-in. all existing additional fees not listed are to be opted-out
|
|
1029
|
-
* @public
|
|
1030
|
-
* @documentationMaturity preview
|
|
1031
|
-
* @requiredField additionalFees
|
|
1032
|
-
* @requiredField draftOrderId
|
|
1033
|
-
* @permissionId ECOM.DRAFT_ORDERS_SET_ADDITIONAL_FEES
|
|
1034
|
-
* @permissionScope Manage Stores - all permissions
|
|
1035
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1036
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1037
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1038
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1039
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1040
|
-
* @permissionScope Picasso private app mega scope
|
|
1041
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1042
|
-
* @applicableIdentity APP
|
|
1043
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetAdditionalFees
|
|
1044
|
-
*/
|
|
1045
|
-
async function setAdditionalFees(draftOrderId, additionalFees) {
|
|
1046
|
-
// @ts-ignore
|
|
1047
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1048
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1049
|
-
draftOrderId: draftOrderId,
|
|
1050
|
-
additionalFees: additionalFees,
|
|
1051
|
-
});
|
|
1052
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setAdditionalFees(payload);
|
|
1053
|
-
sideEffects?.onSiteCall?.();
|
|
1054
|
-
try {
|
|
1055
|
-
const result = await httpClient.request(reqOpts);
|
|
1056
|
-
sideEffects?.onSuccess?.(result);
|
|
1057
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1058
|
-
{
|
|
1059
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1060
|
-
paths: [
|
|
1061
|
-
{
|
|
1062
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
1063
|
-
},
|
|
1064
|
-
],
|
|
1065
|
-
},
|
|
1066
|
-
{
|
|
1067
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1068
|
-
paths: [
|
|
1069
|
-
{
|
|
1070
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
1071
|
-
},
|
|
1072
|
-
{
|
|
1073
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
1074
|
-
},
|
|
1075
|
-
{
|
|
1076
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
1077
|
-
},
|
|
1078
|
-
{
|
|
1079
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
1080
|
-
},
|
|
1081
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
1082
|
-
{
|
|
1083
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
1084
|
-
},
|
|
1085
|
-
{
|
|
1086
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
1087
|
-
},
|
|
1088
|
-
{
|
|
1089
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
1090
|
-
},
|
|
1091
|
-
{
|
|
1092
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
1093
|
-
},
|
|
1094
|
-
{
|
|
1095
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
1096
|
-
},
|
|
1097
|
-
],
|
|
1098
|
-
},
|
|
1099
|
-
]));
|
|
1100
|
-
}
|
|
1101
|
-
catch (err) {
|
|
1102
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1103
|
-
spreadPathsToArguments: {},
|
|
1104
|
-
explicitPathsToArguments: {
|
|
1105
|
-
draftOrderId: '$[0]',
|
|
1106
|
-
additionalFees: '$[1]',
|
|
1107
|
-
},
|
|
1108
|
-
singleArgumentUnchanged: false,
|
|
1109
|
-
}, ['draftOrderId', 'additionalFees']);
|
|
1110
|
-
sideEffects?.onError?.(err);
|
|
1111
|
-
throw transformedError;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
exports.setAdditionalFees = setAdditionalFees;
|
|
1115
|
-
/**
|
|
1116
|
-
* Create custom additional fees to the order.
|
|
1117
|
-
* added additional fees are by default opted-out.
|
|
1118
|
-
* To opt-in them, please call SetAdditionalFees with the added additional fee ids.
|
|
1119
|
-
* @param draftOrderId - The draft order id
|
|
1120
|
-
* @public
|
|
1121
|
-
* @documentationMaturity preview
|
|
1122
|
-
* @requiredField draftOrderId
|
|
1123
|
-
* @requiredField options.customAdditionalFees.name
|
|
1124
|
-
* @requiredField options.customAdditionalFees.price
|
|
1125
|
-
* @requiredField options.customAdditionalFees.price.amount
|
|
1126
|
-
* @permissionId ECOM.DRAFT_ORDERS_CREATE_ADDITIONAL_FEES
|
|
1127
|
-
* @permissionScope Manage Stores - all permissions
|
|
1128
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1129
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1130
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1131
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1132
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1133
|
-
* @permissionScope Picasso private app mega scope
|
|
1134
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1135
|
-
* @applicableIdentity APP
|
|
1136
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateCustomAdditionalFees
|
|
1137
|
-
*/
|
|
1138
|
-
async function createCustomAdditionalFees(draftOrderId, options) {
|
|
1139
|
-
// @ts-ignore
|
|
1140
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1141
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1142
|
-
draftOrderId: draftOrderId,
|
|
1143
|
-
customAdditionalFees: options?.customAdditionalFees,
|
|
1144
|
-
});
|
|
1145
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.createCustomAdditionalFees(payload);
|
|
1146
|
-
sideEffects?.onSiteCall?.();
|
|
1147
|
-
try {
|
|
1148
|
-
const result = await httpClient.request(reqOpts);
|
|
1149
|
-
sideEffects?.onSuccess?.(result);
|
|
1150
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1151
|
-
{
|
|
1152
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1153
|
-
paths: [
|
|
1154
|
-
{
|
|
1155
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
1156
|
-
},
|
|
1157
|
-
],
|
|
1158
|
-
},
|
|
1159
|
-
{
|
|
1160
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1161
|
-
paths: [
|
|
1162
|
-
{
|
|
1163
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
1164
|
-
},
|
|
1165
|
-
{
|
|
1166
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
1167
|
-
},
|
|
1168
|
-
{
|
|
1169
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
1170
|
-
},
|
|
1171
|
-
{
|
|
1172
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
1173
|
-
},
|
|
1174
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
1175
|
-
{
|
|
1176
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
1177
|
-
},
|
|
1178
|
-
{
|
|
1179
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
1183
|
-
},
|
|
1184
|
-
{
|
|
1185
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
1186
|
-
},
|
|
1187
|
-
{
|
|
1188
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
1189
|
-
},
|
|
1190
|
-
],
|
|
1191
|
-
},
|
|
1192
|
-
]));
|
|
1193
|
-
}
|
|
1194
|
-
catch (err) {
|
|
1195
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1196
|
-
spreadPathsToArguments: {},
|
|
1197
|
-
explicitPathsToArguments: {
|
|
1198
|
-
draftOrderId: '$[0]',
|
|
1199
|
-
customAdditionalFees: '$[1].customAdditionalFees',
|
|
1200
|
-
},
|
|
1201
|
-
singleArgumentUnchanged: false,
|
|
1202
|
-
}, ['draftOrderId', 'options']);
|
|
1203
|
-
sideEffects?.onError?.(err);
|
|
1204
|
-
throw transformedError;
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
exports.createCustomAdditionalFees = createCustomAdditionalFees;
|
|
1208
|
-
/**
|
|
1209
|
-
* Remove custom additional fees from the order.
|
|
1210
|
-
* @param draftOrderId - The draft order id
|
|
1211
|
-
* @param customAdditionalFees - The additional fees to remove
|
|
1212
|
-
* @public
|
|
1213
|
-
* @documentationMaturity preview
|
|
1214
|
-
* @requiredField customAdditionalFees
|
|
1215
|
-
* @requiredField draftOrderId
|
|
1216
|
-
* @permissionId ECOM.DRAFT_ORDERS_DELETE_ADDITIONAL_FEES
|
|
1217
|
-
* @permissionScope Manage Stores - all permissions
|
|
1218
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1219
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1220
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1221
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1222
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1223
|
-
* @permissionScope Picasso private app mega scope
|
|
1224
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1225
|
-
* @applicableIdentity APP
|
|
1226
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.DeleteCustomAdditionalFees
|
|
1227
|
-
*/
|
|
1228
|
-
async function deleteCustomAdditionalFees(draftOrderId, customAdditionalFees) {
|
|
1229
|
-
// @ts-ignore
|
|
1230
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1231
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1232
|
-
draftOrderId: draftOrderId,
|
|
1233
|
-
customAdditionalFees: customAdditionalFees,
|
|
1234
|
-
});
|
|
1235
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.deleteCustomAdditionalFees(payload);
|
|
1236
|
-
sideEffects?.onSiteCall?.();
|
|
1237
|
-
try {
|
|
1238
|
-
const result = await httpClient.request(reqOpts);
|
|
1239
|
-
sideEffects?.onSuccess?.(result);
|
|
1240
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1241
|
-
{
|
|
1242
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1243
|
-
paths: [
|
|
1244
|
-
{
|
|
1245
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
1246
|
-
},
|
|
1247
|
-
],
|
|
1248
|
-
},
|
|
1249
|
-
{
|
|
1250
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1251
|
-
paths: [
|
|
1252
|
-
{
|
|
1253
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
1254
|
-
},
|
|
1255
|
-
{
|
|
1256
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
1257
|
-
},
|
|
1258
|
-
{
|
|
1259
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
1260
|
-
},
|
|
1261
|
-
{
|
|
1262
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
1263
|
-
},
|
|
1264
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
1265
|
-
{
|
|
1266
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
1267
|
-
},
|
|
1268
|
-
{
|
|
1269
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
1273
|
-
},
|
|
1274
|
-
{
|
|
1275
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
1276
|
-
},
|
|
1277
|
-
{
|
|
1278
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
1279
|
-
},
|
|
1280
|
-
],
|
|
1281
|
-
},
|
|
1282
|
-
]));
|
|
1283
|
-
}
|
|
1284
|
-
catch (err) {
|
|
1285
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1286
|
-
spreadPathsToArguments: {},
|
|
1287
|
-
explicitPathsToArguments: {
|
|
1288
|
-
draftOrderId: '$[0]',
|
|
1289
|
-
customAdditionalFees: '$[1]',
|
|
1290
|
-
},
|
|
1291
|
-
singleArgumentUnchanged: false,
|
|
1292
|
-
}, ['draftOrderId', 'customAdditionalFees']);
|
|
1293
|
-
sideEffects?.onError?.(err);
|
|
1294
|
-
throw transformedError;
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
exports.deleteCustomAdditionalFees = deleteCustomAdditionalFees;
|
|
1298
|
-
/**
|
|
1299
|
-
* Sets shipping info to a draft order.
|
|
1300
|
-
* @public
|
|
1301
|
-
* @documentationMaturity preview
|
|
1302
|
-
* @permissionId ECOM.DRAFT_ORDERS_SET_SHIPPING_INFO
|
|
1303
|
-
* @permissionScope Manage Stores - all permissions
|
|
1304
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1305
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1306
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1307
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1308
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1309
|
-
* @permissionScope Picasso private app mega scope
|
|
1310
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1311
|
-
* @applicableIdentity APP
|
|
1312
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetShippingInfo
|
|
1313
|
-
*/
|
|
1314
|
-
async function setShippingInfo() {
|
|
1315
|
-
// @ts-ignore
|
|
1316
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1317
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({}), [
|
|
1318
|
-
{
|
|
1319
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
1320
|
-
paths: [
|
|
1321
|
-
{ path: 'shippingInfo.logistics.shippingDestination.address' },
|
|
1322
|
-
{ path: 'shippingInfo.logistics.pickupDetails.address' },
|
|
1323
|
-
],
|
|
1324
|
-
},
|
|
1325
|
-
]);
|
|
1326
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setShippingInfo(payload);
|
|
1327
|
-
sideEffects?.onSiteCall?.();
|
|
1328
|
-
try {
|
|
1329
|
-
const result = await httpClient.request(reqOpts);
|
|
1330
|
-
sideEffects?.onSuccess?.(result);
|
|
1331
|
-
}
|
|
1332
|
-
catch (err) {
|
|
1333
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1334
|
-
spreadPathsToArguments: {},
|
|
1335
|
-
explicitPathsToArguments: {},
|
|
1336
|
-
singleArgumentUnchanged: false,
|
|
1337
|
-
}, []);
|
|
1338
|
-
sideEffects?.onError?.(err);
|
|
1339
|
-
throw transformedError;
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
exports.setShippingInfo = setShippingInfo;
|
|
1343
|
-
/**
|
|
1344
|
-
* Sets buyer info to a draft order.
|
|
1345
|
-
* @public
|
|
1346
|
-
* @documentationMaturity preview
|
|
1347
|
-
* @permissionId ECOM.DRAFT_ORDER_SET_BUYER_INFO
|
|
1348
|
-
* @permissionScope Manage Stores - all permissions
|
|
1349
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1350
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1351
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1352
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1353
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1354
|
-
* @permissionScope Picasso private app mega scope
|
|
1355
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1356
|
-
* @applicableIdentity APP
|
|
1357
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetBuyerInfo
|
|
1358
|
-
*/
|
|
1359
|
-
async function setBuyerInfo() {
|
|
1360
|
-
// @ts-ignore
|
|
1361
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1362
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
|
|
1363
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setBuyerInfo(payload);
|
|
1364
|
-
sideEffects?.onSiteCall?.();
|
|
1365
|
-
try {
|
|
1366
|
-
const result = await httpClient.request(reqOpts);
|
|
1367
|
-
sideEffects?.onSuccess?.(result);
|
|
1368
|
-
}
|
|
1369
|
-
catch (err) {
|
|
1370
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1371
|
-
spreadPathsToArguments: {},
|
|
1372
|
-
explicitPathsToArguments: {},
|
|
1373
|
-
singleArgumentUnchanged: false,
|
|
1374
|
-
}, []);
|
|
1375
|
-
sideEffects?.onError?.(err);
|
|
1376
|
-
throw transformedError;
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
exports.setBuyerInfo = setBuyerInfo;
|
|
1380
|
-
/**
|
|
1381
|
-
* Sets recipient info to a draft order.
|
|
1382
|
-
* @public
|
|
1383
|
-
* @documentationMaturity preview
|
|
1384
|
-
* @permissionId ECOM.DRAFT_ORDER_SET_RECIPIENT_INFO
|
|
1385
|
-
* @permissionScope Manage Stores - all permissions
|
|
1386
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1387
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1388
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1389
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1390
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1391
|
-
* @permissionScope Picasso private app mega scope
|
|
1392
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1393
|
-
* @applicableIdentity APP
|
|
1394
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetRecipientInfo
|
|
1395
|
-
*/
|
|
1396
|
-
async function setRecipientInfo() {
|
|
1397
|
-
// @ts-ignore
|
|
1398
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1399
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({}), [
|
|
1400
|
-
{
|
|
1401
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
1402
|
-
paths: [{ path: 'recipientInfo.address' }],
|
|
1403
|
-
},
|
|
1404
|
-
]);
|
|
1405
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setRecipientInfo(payload);
|
|
1406
|
-
sideEffects?.onSiteCall?.();
|
|
1407
|
-
try {
|
|
1408
|
-
const result = await httpClient.request(reqOpts);
|
|
1409
|
-
sideEffects?.onSuccess?.(result);
|
|
1410
|
-
}
|
|
1411
|
-
catch (err) {
|
|
1412
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1413
|
-
spreadPathsToArguments: {},
|
|
1414
|
-
explicitPathsToArguments: {},
|
|
1415
|
-
singleArgumentUnchanged: false,
|
|
1416
|
-
}, []);
|
|
1417
|
-
sideEffects?.onError?.(err);
|
|
1418
|
-
throw transformedError;
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
exports.setRecipientInfo = setRecipientInfo;
|
|
1422
|
-
/**
|
|
1423
|
-
* Sets billing info to a draft order.
|
|
1424
|
-
* @public
|
|
1425
|
-
* @documentationMaturity preview
|
|
1426
|
-
* @permissionId ECOM.DRAFT_ORDER_SET_BILLING_INFO
|
|
1427
|
-
* @permissionScope Manage Stores - all permissions
|
|
1428
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1429
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1430
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1431
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1432
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1433
|
-
* @permissionScope Picasso private app mega scope
|
|
1434
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1435
|
-
* @applicableIdentity APP
|
|
1436
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetBillingInfo
|
|
1437
|
-
*/
|
|
1438
|
-
async function setBillingInfo() {
|
|
1439
|
-
// @ts-ignore
|
|
1440
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1441
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({}), [
|
|
1442
|
-
{
|
|
1443
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
1444
|
-
paths: [{ path: 'billingInfo.address' }],
|
|
1445
|
-
},
|
|
1446
|
-
]);
|
|
1447
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setBillingInfo(payload);
|
|
1448
|
-
sideEffects?.onSiteCall?.();
|
|
1449
|
-
try {
|
|
1450
|
-
const result = await httpClient.request(reqOpts);
|
|
1451
|
-
sideEffects?.onSuccess?.(result);
|
|
1452
|
-
}
|
|
1453
|
-
catch (err) {
|
|
1454
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1455
|
-
spreadPathsToArguments: {},
|
|
1456
|
-
explicitPathsToArguments: {},
|
|
1457
|
-
singleArgumentUnchanged: false,
|
|
1458
|
-
}, []);
|
|
1459
|
-
sideEffects?.onError?.(err);
|
|
1460
|
-
throw transformedError;
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
exports.setBillingInfo = setBillingInfo;
|
|
1464
|
-
/**
|
|
1465
|
-
* Get an order.
|
|
1466
|
-
* When order is in draft status, it's re-estimated and return with latest tax and totals
|
|
1467
|
-
* Automatic discounts and automatic additional fees will reflect the latest prices and eligibility.
|
|
1468
|
-
* Calculation will be based on current draft order content - items, shipping info and eligible discounts and additional fees.
|
|
1469
|
-
* When order is in committed status, it's returned with it's calculation at the moment it was committed.
|
|
1470
|
-
* @param draftOrderId - The draft order id
|
|
1471
|
-
* @public
|
|
1472
|
-
* @documentationMaturity preview
|
|
1473
|
-
* @requiredField draftOrderId
|
|
1474
|
-
* @permissionId ECOM.DRAFT_ORDERS_READ
|
|
1475
|
-
* @permissionId ECOM.DRAFT_ORDER_READ_ALL_EXTENDED_FIELDS
|
|
1476
|
-
* @permissionScope Manage Stores - all permissions
|
|
1477
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1478
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1479
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1480
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1481
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1482
|
-
* @permissionScope Picasso private app mega scope
|
|
1483
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1484
|
-
* @applicableIdentity APP
|
|
1485
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.GetDraftOrder
|
|
1486
|
-
*/
|
|
1487
|
-
async function getDraftOrder(draftOrderId) {
|
|
1488
|
-
// @ts-ignore
|
|
1489
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1490
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1491
|
-
draftOrderId: draftOrderId,
|
|
1492
|
-
});
|
|
1493
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.getDraftOrder(payload);
|
|
1494
|
-
sideEffects?.onSiteCall?.();
|
|
1495
|
-
try {
|
|
1496
|
-
const result = await httpClient.request(reqOpts);
|
|
1497
|
-
sideEffects?.onSuccess?.(result);
|
|
1498
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1499
|
-
{
|
|
1500
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1501
|
-
paths: [
|
|
1502
|
-
{
|
|
1503
|
-
path: 'calculatedDraftOrder.draftOrder.lineItems.lineItem.image',
|
|
1504
|
-
},
|
|
1505
|
-
],
|
|
1506
|
-
},
|
|
1507
|
-
{
|
|
1508
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1509
|
-
paths: [
|
|
1510
|
-
{
|
|
1511
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
1512
|
-
},
|
|
1513
|
-
{
|
|
1514
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
1515
|
-
},
|
|
1516
|
-
{
|
|
1517
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
1518
|
-
},
|
|
1519
|
-
{
|
|
1520
|
-
path: 'calculatedDraftOrder.draftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
1521
|
-
},
|
|
1522
|
-
{ path: 'calculatedDraftOrder.draftOrder.billingInfo.address' },
|
|
1523
|
-
{
|
|
1524
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
1525
|
-
},
|
|
1526
|
-
{
|
|
1527
|
-
path: 'calculatedDraftOrder.draftOrder.recipientInfo.recipientInfo.address',
|
|
1528
|
-
},
|
|
1529
|
-
{
|
|
1530
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
1531
|
-
},
|
|
1532
|
-
{
|
|
1533
|
-
path: 'calculatedDraftOrder.draftOrder.billingDetails.billingInfo.address',
|
|
1534
|
-
},
|
|
1535
|
-
{
|
|
1536
|
-
path: 'calculatedDraftOrder.shippingOptions.logistics.pickupDetails.address',
|
|
1537
|
-
},
|
|
1538
|
-
],
|
|
1539
|
-
},
|
|
1540
|
-
]));
|
|
1541
|
-
}
|
|
1542
|
-
catch (err) {
|
|
1543
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1544
|
-
spreadPathsToArguments: {},
|
|
1545
|
-
explicitPathsToArguments: { draftOrderId: '$[0]' },
|
|
1546
|
-
singleArgumentUnchanged: false,
|
|
1547
|
-
}, ['draftOrderId']);
|
|
1548
|
-
sideEffects?.onError?.(err);
|
|
1549
|
-
throw transformedError;
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
exports.getDraftOrder = getDraftOrder;
|
|
1553
|
-
/**
|
|
1554
|
-
* Checks whether a draft can be created for this order
|
|
1555
|
-
* @param orderId - Order ID.
|
|
1556
|
-
* @public
|
|
1557
|
-
* @documentationMaturity preview
|
|
1558
|
-
* @requiredField orderId
|
|
1559
|
-
* @permissionId ECOM.DRAFT_ORDERS_READ
|
|
1560
|
-
* @permissionScope Manage Stores - all permissions
|
|
1561
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1562
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1563
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1564
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1565
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1566
|
-
* @permissionScope Picasso private app mega scope
|
|
1567
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1568
|
-
* @applicableIdentity APP
|
|
1569
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.GetOrderDraftabilityStatus
|
|
1570
|
-
*/
|
|
1571
|
-
async function getOrderDraftabilityStatus(orderId) {
|
|
1572
|
-
// @ts-ignore
|
|
1573
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1574
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ orderId: orderId });
|
|
1575
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.getOrderDraftabilityStatus(payload);
|
|
1576
|
-
sideEffects?.onSiteCall?.();
|
|
1577
|
-
try {
|
|
1578
|
-
const result = await httpClient.request(reqOpts);
|
|
1579
|
-
sideEffects?.onSuccess?.(result);
|
|
1580
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1581
|
-
}
|
|
1582
|
-
catch (err) {
|
|
1583
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1584
|
-
spreadPathsToArguments: {},
|
|
1585
|
-
explicitPathsToArguments: { orderId: '$[0]' },
|
|
1586
|
-
singleArgumentUnchanged: false,
|
|
1587
|
-
}, ['orderId']);
|
|
1588
|
-
sideEffects?.onError?.(err);
|
|
1589
|
-
throw transformedError;
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
exports.getOrderDraftabilityStatus = getOrderDraftabilityStatus;
|
|
1593
|
-
/**
|
|
1594
|
-
* Commit latest changes to the baseline order and control what side-effects will be applied.
|
|
1595
|
-
* Commit cannot be undone or reverted.
|
|
1596
|
-
* Order-edit become closed for editing, however it's kept for reference and can be retrieved.
|
|
1597
|
-
* @param draftOrderId - The draft order id
|
|
1598
|
-
* @public
|
|
1599
|
-
* @documentationMaturity preview
|
|
1600
|
-
* @requiredField draftOrderId
|
|
1601
|
-
* @permissionId ECOM.DRAFT_ORDERS_COMMIT
|
|
1602
|
-
* @permissionId ECOM.DRAFT_ORDER_READ_ALL_EXTENDED_FIELDS
|
|
1603
|
-
* @permissionScope Manage Stores - all permissions
|
|
1604
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1605
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1606
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1607
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1608
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1609
|
-
* @permissionScope Picasso private app mega scope
|
|
1610
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1611
|
-
* @applicableIdentity APP
|
|
1612
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CommitDraftOrder
|
|
1613
|
-
*/
|
|
1614
|
-
async function commitDraftOrder(draftOrderId, options) {
|
|
1615
|
-
// @ts-ignore
|
|
1616
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1617
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1618
|
-
draftOrderId: draftOrderId,
|
|
1619
|
-
commitSettings: options?.commitSettings,
|
|
1620
|
-
reason: options?.reason,
|
|
1621
|
-
});
|
|
1622
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.commitDraftOrder(payload);
|
|
1623
|
-
sideEffects?.onSiteCall?.();
|
|
1624
|
-
try {
|
|
1625
|
-
const result = await httpClient.request(reqOpts);
|
|
1626
|
-
sideEffects?.onSuccess?.(result);
|
|
1627
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1628
|
-
{
|
|
1629
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1630
|
-
paths: [
|
|
1631
|
-
{ path: 'committedDraftOrder.lineItems.lineItem.image' },
|
|
1632
|
-
{ path: 'orderAfterCommit.lineItems.image' },
|
|
1633
|
-
],
|
|
1634
|
-
},
|
|
1635
|
-
{
|
|
1636
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1637
|
-
paths: [
|
|
1638
|
-
{
|
|
1639
|
-
path: 'committedDraftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
1640
|
-
},
|
|
1641
|
-
{
|
|
1642
|
-
path: 'committedDraftOrder.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
1643
|
-
},
|
|
1644
|
-
{
|
|
1645
|
-
path: 'committedDraftOrder.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
1646
|
-
},
|
|
1647
|
-
{
|
|
1648
|
-
path: 'committedDraftOrder.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
1649
|
-
},
|
|
1650
|
-
{ path: 'committedDraftOrder.billingInfo.address' },
|
|
1651
|
-
{
|
|
1652
|
-
path: 'committedDraftOrder.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
1653
|
-
},
|
|
1654
|
-
{ path: 'committedDraftOrder.recipientInfo.recipientInfo.address' },
|
|
1655
|
-
{
|
|
1656
|
-
path: 'committedDraftOrder.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
1657
|
-
},
|
|
1658
|
-
{ path: 'committedDraftOrder.billingDetails.billingInfo.address' },
|
|
1659
|
-
{ path: 'orderAfterCommit.billingInfo.address' },
|
|
1660
|
-
{
|
|
1661
|
-
path: 'orderAfterCommit.shippingInfo.logistics.shippingDestination.address',
|
|
1662
|
-
},
|
|
1663
|
-
{
|
|
1664
|
-
path: 'orderAfterCommit.shippingInfo.logistics.pickupDetails.address',
|
|
1665
|
-
},
|
|
1666
|
-
{ path: 'orderAfterCommit.recipientInfo.address' },
|
|
1667
|
-
],
|
|
1668
|
-
},
|
|
1669
|
-
]));
|
|
1670
|
-
}
|
|
1671
|
-
catch (err) {
|
|
1672
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1673
|
-
spreadPathsToArguments: {},
|
|
1674
|
-
explicitPathsToArguments: {
|
|
1675
|
-
draftOrderId: '$[0]',
|
|
1676
|
-
commitSettings: '$[1].commitSettings',
|
|
1677
|
-
reason: '$[1].reason',
|
|
1678
|
-
},
|
|
1679
|
-
singleArgumentUnchanged: false,
|
|
1680
|
-
}, ['draftOrderId', 'options']);
|
|
1681
|
-
sideEffects?.onError?.(err);
|
|
1682
|
-
throw transformedError;
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
exports.commitDraftOrder = commitDraftOrder;
|
|
1686
|
-
/**
|
|
1687
|
-
* Create new order and control what side-effects will be applied
|
|
1688
|
-
* Commit cannot be undone or reverted.
|
|
1689
|
-
* Order-edit become closed for editing, however it's kept for reference and can be retrieved.
|
|
1690
|
-
* @public
|
|
1691
|
-
* @documentationMaturity preview
|
|
1692
|
-
* @permissionId ECOM.DRAFT_ORDER_CREATE_ORDER_FROM_DRAFT
|
|
1693
|
-
* @permissionId ECOM.DRAFT_ORDER_READ_ALL_EXTENDED_FIELDS
|
|
1694
|
-
* @permissionScope Manage Stores - all permissions
|
|
1695
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1696
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1697
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1698
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1699
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1700
|
-
* @permissionScope Picasso private app mega scope
|
|
1701
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1702
|
-
* @applicableIdentity APP
|
|
1703
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateOrderFromDraft
|
|
1704
|
-
*/
|
|
1705
|
-
async function createOrderFromDraft() {
|
|
1706
|
-
// @ts-ignore
|
|
1707
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1708
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
|
|
1709
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.createOrderFromDraft(payload);
|
|
1710
|
-
sideEffects?.onSiteCall?.();
|
|
1711
|
-
try {
|
|
1712
|
-
const result = await httpClient.request(reqOpts);
|
|
1713
|
-
sideEffects?.onSuccess?.(result);
|
|
1714
|
-
}
|
|
1715
|
-
catch (err) {
|
|
1716
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1717
|
-
spreadPathsToArguments: {},
|
|
1718
|
-
explicitPathsToArguments: {},
|
|
1719
|
-
singleArgumentUnchanged: false,
|
|
1720
|
-
}, []);
|
|
1721
|
-
sideEffects?.onError?.(err);
|
|
1722
|
-
throw transformedError;
|
|
1723
|
-
}
|
|
1724
|
-
}
|
|
1725
|
-
exports.createOrderFromDraft = createOrderFromDraft;
|
|
1726
|
-
/**
|
|
1727
|
-
* Delete order-edit entity with all pending changes.
|
|
1728
|
-
* Order-edit in status 'COMMITTED' cannot be deleted.
|
|
1729
|
-
* @param draftOrderId - The draft order id
|
|
1730
|
-
* @public
|
|
1731
|
-
* @documentationMaturity preview
|
|
1732
|
-
* @requiredField draftOrderId
|
|
1733
|
-
* @permissionId ECOM.DRAFT_ORDERS_DELETE
|
|
1734
|
-
* @permissionId ECOM.DRAFT_ORDERS_ADMIN_DELETE
|
|
1735
|
-
* @permissionScope Manage Stores - all permissions
|
|
1736
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1737
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1738
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1739
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1740
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1741
|
-
* @permissionScope Picasso private app mega scope
|
|
1742
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1743
|
-
* @applicableIdentity APP
|
|
1744
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.DeleteDraftOrder
|
|
1745
|
-
*/
|
|
1746
|
-
async function deleteDraftOrder(draftOrderId) {
|
|
1747
|
-
// @ts-ignore
|
|
1748
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1749
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1750
|
-
draftOrderId: draftOrderId,
|
|
1751
|
-
});
|
|
1752
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.deleteDraftOrder(payload);
|
|
1753
|
-
sideEffects?.onSiteCall?.();
|
|
1754
|
-
try {
|
|
1755
|
-
const result = await httpClient.request(reqOpts);
|
|
1756
|
-
sideEffects?.onSuccess?.(result);
|
|
1757
|
-
}
|
|
1758
|
-
catch (err) {
|
|
1759
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1760
|
-
spreadPathsToArguments: {},
|
|
1761
|
-
explicitPathsToArguments: { draftOrderId: '$[0]' },
|
|
1762
|
-
singleArgumentUnchanged: false,
|
|
1763
|
-
}, ['draftOrderId']);
|
|
1764
|
-
sideEffects?.onError?.(err);
|
|
1765
|
-
throw transformedError;
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
exports.deleteDraftOrder = deleteDraftOrder;
|
|
1769
|
-
/**
|
|
1770
|
-
* Retrieves a list of draft orders given the provided paging, filtering, and sorting. Up to 100 draft orders can be returned per request.
|
|
1771
|
-
*
|
|
1772
|
-
* Refer to the table below for supported fields, filters, and sorting:
|
|
1773
|
-
* | **Property** | **Supported Filters & Sorting** | **Sortable** |
|
|
1774
|
-
* |----------------|---------------------------------------------------------------------------------|--------------|
|
|
1775
|
-
* | `_createdDate` | `eq()`, `ne()`, `exists()`, `in()`, `hasSome()`, `lt()`, `le()`, `gt()`, `ge()` | Sortable |
|
|
1776
|
-
* | `_updatedDate` | `eq()`, `ne()`, `exists()`, `in()`, `hasSome()`, `lt()`, `le()`, `gt()`, `ge()` | Sortable |
|
|
1777
|
-
* | `status` | `eq()`, `ne()`, `exists()`, `in()`, `hasSome()` | Sortable |
|
|
1778
|
-
* | `orderId` | `eq()`, `ne()`, `exists()`, `in()`, `hasSome()`, `startsWith()` | |
|
|
1779
|
-
* To learn how to query draft orders, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
1780
|
-
* @public
|
|
1781
|
-
* @documentationMaturity preview
|
|
1782
|
-
* @permissionScope Manage Stores - all permissions
|
|
1783
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1784
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1785
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1786
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1787
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1788
|
-
* @permissionScope Picasso private app mega scope
|
|
1789
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1790
|
-
* @permissionId ECOM.DRAFT_ORDERS_READ
|
|
1791
|
-
* @applicableIdentity APP
|
|
1792
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.QueryDraftOrders
|
|
1793
|
-
*/
|
|
1794
|
-
function queryDraftOrders() {
|
|
1795
|
-
// @ts-ignore
|
|
1796
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1797
|
-
return (0, query_builder_1.queryBuilder)({
|
|
1798
|
-
func: async (payload) => {
|
|
1799
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.queryDraftOrders(payload);
|
|
1800
|
-
sideEffects?.onSiteCall?.();
|
|
1801
|
-
try {
|
|
1802
|
-
const result = await httpClient.request(reqOpts);
|
|
1803
|
-
sideEffects?.onSuccess?.(result);
|
|
1804
|
-
return result;
|
|
1805
|
-
}
|
|
1806
|
-
catch (err) {
|
|
1807
|
-
sideEffects?.onError?.(err);
|
|
1808
|
-
throw err;
|
|
1809
|
-
}
|
|
1810
|
-
},
|
|
1811
|
-
requestTransformer: (query) => {
|
|
1812
|
-
const args = [query, {}];
|
|
1813
|
-
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1814
|
-
...args?.[1],
|
|
1815
|
-
query: args?.[0],
|
|
1816
|
-
});
|
|
1817
|
-
},
|
|
1818
|
-
responseTransformer: ({ data }) => {
|
|
1819
|
-
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
|
|
1820
|
-
{
|
|
1821
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1822
|
-
paths: [{ path: 'draftOrders.lineItems.lineItem.image' }],
|
|
1823
|
-
},
|
|
1824
|
-
{
|
|
1825
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1826
|
-
paths: [
|
|
1827
|
-
{
|
|
1828
|
-
path: 'draftOrders.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address',
|
|
1829
|
-
},
|
|
1830
|
-
{
|
|
1831
|
-
path: 'draftOrders.shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.address',
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
path: 'draftOrders.shippingInfo.shippingInfo.logistics.shippingDestination.address',
|
|
1835
|
-
},
|
|
1836
|
-
{
|
|
1837
|
-
path: 'draftOrders.shippingInfo.shippingInfo.logistics.pickupDetails.address',
|
|
1838
|
-
},
|
|
1839
|
-
{ path: 'draftOrders.billingInfo.address' },
|
|
1840
|
-
{
|
|
1841
|
-
path: 'draftOrders.recipientInfo.changedDetails.recipientInfoBeforeChange.address',
|
|
1842
|
-
},
|
|
1843
|
-
{ path: 'draftOrders.recipientInfo.recipientInfo.address' },
|
|
1844
|
-
{
|
|
1845
|
-
path: 'draftOrders.billingDetails.changedDetails.billingInfoBeforeChange.address',
|
|
1846
|
-
},
|
|
1847
|
-
{ path: 'draftOrders.billingDetails.billingInfo.address' },
|
|
1848
|
-
],
|
|
1849
|
-
},
|
|
1850
|
-
]));
|
|
1851
|
-
return {
|
|
1852
|
-
items: transformedData?.draftOrders,
|
|
1853
|
-
pagingMetadata: transformedData?.pagingMetadata,
|
|
1854
|
-
};
|
|
1855
|
-
},
|
|
1856
|
-
errorTransformer: (err) => {
|
|
1857
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1858
|
-
spreadPathsToArguments: {},
|
|
1859
|
-
explicitPathsToArguments: { query: '$[0]' },
|
|
1860
|
-
singleArgumentUnchanged: false,
|
|
1861
|
-
});
|
|
1862
|
-
throw transformedError;
|
|
1863
|
-
},
|
|
1864
|
-
pagingMethod: 'CURSOR',
|
|
1865
|
-
transformationPaths: {},
|
|
1866
|
-
});
|
|
1867
|
-
}
|
|
1868
|
-
exports.queryDraftOrders = queryDraftOrders;
|
|
1869
|
-
/**
|
|
1870
|
-
* Sets tax exemption to a draft order.
|
|
1871
|
-
* @public
|
|
1872
|
-
* @documentationMaturity preview
|
|
1873
|
-
* @permissionId ECOM.DRAFT_ORDER_SET_TAX_EXEMPTION
|
|
1874
|
-
* @permissionScope Manage Stores - all permissions
|
|
1875
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1876
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1877
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1878
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1879
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1880
|
-
* @permissionScope Picasso private app mega scope
|
|
1881
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1882
|
-
* @applicableIdentity APP
|
|
1883
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetTaxExemption
|
|
1884
|
-
*/
|
|
1885
|
-
async function setTaxExemption() {
|
|
1886
|
-
// @ts-ignore
|
|
1887
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1888
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
|
|
1889
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setTaxExemption(payload);
|
|
1890
|
-
sideEffects?.onSiteCall?.();
|
|
1891
|
-
try {
|
|
1892
|
-
const result = await httpClient.request(reqOpts);
|
|
1893
|
-
sideEffects?.onSuccess?.(result);
|
|
1894
|
-
}
|
|
1895
|
-
catch (err) {
|
|
1896
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1897
|
-
spreadPathsToArguments: {},
|
|
1898
|
-
explicitPathsToArguments: {},
|
|
1899
|
-
singleArgumentUnchanged: false,
|
|
1900
|
-
}, []);
|
|
1901
|
-
sideEffects?.onError?.(err);
|
|
1902
|
-
throw transformedError;
|
|
1903
|
-
}
|
|
1904
|
-
}
|
|
1905
|
-
exports.setTaxExemption = setTaxExemption;
|
|
1906
|
-
/**
|
|
1907
|
-
* Sets business location to a draft order.
|
|
1908
|
-
* @public
|
|
1909
|
-
* @documentationMaturity preview
|
|
1910
|
-
* @permissionId ECOM.DRAFT_ORDER_SET_BUSINESS_LOCATION
|
|
1911
|
-
* @permissionScope Manage Stores - all permissions
|
|
1912
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1913
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1914
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1915
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1916
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1917
|
-
* @permissionScope Picasso private app mega scope
|
|
1918
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1919
|
-
* @applicableIdentity APP
|
|
1920
|
-
* @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetBusinessLocation
|
|
1921
|
-
*/
|
|
1922
|
-
async function setBusinessLocation() {
|
|
1923
|
-
// @ts-ignore
|
|
1924
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1925
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
|
|
1926
|
-
const reqOpts = ambassadorWixEcomV1DraftOrder.setBusinessLocation(payload);
|
|
1927
|
-
sideEffects?.onSiteCall?.();
|
|
1928
|
-
try {
|
|
1929
|
-
const result = await httpClient.request(reqOpts);
|
|
1930
|
-
sideEffects?.onSuccess?.(result);
|
|
1931
|
-
}
|
|
1932
|
-
catch (err) {
|
|
1933
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1934
|
-
spreadPathsToArguments: {},
|
|
1935
|
-
explicitPathsToArguments: {},
|
|
1936
|
-
singleArgumentUnchanged: false,
|
|
1937
|
-
}, []);
|
|
1938
|
-
sideEffects?.onError?.(err);
|
|
1939
|
-
throw transformedError;
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
exports.setBusinessLocation = setBusinessLocation;
|
|
1943
|
-
//# sourceMappingURL=ecom-v1-draft-order-draft-orders.universal.js.map
|