@wix/auto_sdk_ecom_checkout-templates 1.0.0
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/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +32 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js +61 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js.map +1 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +67 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js +377 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js.map +1 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +29 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js +161 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +1 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +111 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js +268 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js.map +1 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.types.d.ts +2224 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js +259 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js.map +1 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts +2538 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js +710 -0
- package/build/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +32 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.context.js +32 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.context.js.map +1 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +67 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.http.js +367 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.http.js.map +1 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +29 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.meta.js +128 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +1 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +111 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.public.js +232 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.public.js.map +1 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.types.d.ts +2224 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.types.js +256 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.types.js.map +1 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts +2538 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.universal.js +677 -0
- package/build/es/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +32 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js +61 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.context.js.map +1 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +67 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js +377 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.http.js.map +1 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +29 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js +161 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +1 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +111 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js +268 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.public.js.map +1 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.types.d.ts +2243 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js +259 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.types.js.map +1 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts +2694 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js +710 -0
- package/build/internal/cjs/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.context.d.ts +32 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.context.js +32 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.context.js.map +1 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.http.d.ts +67 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.http.js +367 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.http.js.map +1 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.meta.d.ts +29 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.meta.js +128 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.meta.js.map +1 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.public.d.ts +111 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.public.js +232 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.public.js.map +1 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.types.d.ts +2243 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.types.js +256 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.types.js.map +1 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.universal.d.ts +2694 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.universal.js +677 -0
- package/build/internal/es/src/ecom-v1-checkout-template-checkout-templates.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,710 @@
|
|
|
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.createAndRedirectToCheckout = exports.createCheckoutFromTemplate = exports.queryCheckoutTemplates = exports.deleteCheckoutTemplate = exports.updateCheckoutTemplate = exports.getCheckoutTemplate = exports.createCheckoutTemplate = exports.WebhookIdentityType = exports.SuggestedFix = exports.NameInLineItem = exports.NameInOther = exports.Severity = exports.AdditionalFeeSource = exports.ChannelType = exports.FallbackReason = exports.ManualCalculationReason = exports.RateType = exports.WeightUnit = exports.DiscountType = exports.RuleType = exports.ChargeType = exports.PickupMethod = exports.VatType = exports.TaxableAddressType = exports.ItemAvailabilityStatus = exports.JurisdictionType = exports.SortOrder = exports.FileType = exports.SubscriptionFrequency = exports.ItemTypeItemType = exports.PaymentOptionType = exports.DescriptionLineType = exports.Status = 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 ambassadorWixEcomV1CheckoutTemplate = __importStar(require("./ecom-v1-checkout-template-checkout-templates.http.js"));
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
33
|
+
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
34
|
+
const page_url_v2_1 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
35
|
+
const page_url_v2_2 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
36
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
37
|
+
var Status;
|
|
38
|
+
(function (Status) {
|
|
39
|
+
Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
|
|
40
|
+
Status["ACTIVE"] = "ACTIVE";
|
|
41
|
+
Status["INACTIVE"] = "INACTIVE";
|
|
42
|
+
})(Status || (exports.Status = Status = {}));
|
|
43
|
+
var DescriptionLineType;
|
|
44
|
+
(function (DescriptionLineType) {
|
|
45
|
+
/** Unrecognized type. */
|
|
46
|
+
DescriptionLineType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
47
|
+
/** Plain text type. */
|
|
48
|
+
DescriptionLineType["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
49
|
+
/** Color type. */
|
|
50
|
+
DescriptionLineType["COLOR"] = "COLOR";
|
|
51
|
+
})(DescriptionLineType || (exports.DescriptionLineType = DescriptionLineType = {}));
|
|
52
|
+
/** Type of selected payment option for catalog item */
|
|
53
|
+
var PaymentOptionType;
|
|
54
|
+
(function (PaymentOptionType) {
|
|
55
|
+
/** The entire payment for this item happens as part of the checkout. */
|
|
56
|
+
PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
|
|
57
|
+
/** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
|
|
58
|
+
PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
|
|
59
|
+
/** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
|
|
60
|
+
PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
|
|
61
|
+
/** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
|
|
62
|
+
PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
|
|
63
|
+
/** 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`. */
|
|
64
|
+
PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
|
|
65
|
+
})(PaymentOptionType || (exports.PaymentOptionType = PaymentOptionType = {}));
|
|
66
|
+
var ItemTypeItemType;
|
|
67
|
+
(function (ItemTypeItemType) {
|
|
68
|
+
ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
69
|
+
ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
|
|
70
|
+
ItemTypeItemType["DIGITAL"] = "DIGITAL";
|
|
71
|
+
ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
|
|
72
|
+
ItemTypeItemType["SERVICE"] = "SERVICE";
|
|
73
|
+
})(ItemTypeItemType || (exports.ItemTypeItemType = ItemTypeItemType = {}));
|
|
74
|
+
/** Frequency unit of recurring payment */
|
|
75
|
+
var SubscriptionFrequency;
|
|
76
|
+
(function (SubscriptionFrequency) {
|
|
77
|
+
SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
|
|
78
|
+
SubscriptionFrequency["DAY"] = "DAY";
|
|
79
|
+
SubscriptionFrequency["WEEK"] = "WEEK";
|
|
80
|
+
SubscriptionFrequency["MONTH"] = "MONTH";
|
|
81
|
+
SubscriptionFrequency["YEAR"] = "YEAR";
|
|
82
|
+
})(SubscriptionFrequency || (exports.SubscriptionFrequency = SubscriptionFrequency = {}));
|
|
83
|
+
var FileType;
|
|
84
|
+
(function (FileType) {
|
|
85
|
+
FileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
86
|
+
FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
87
|
+
FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
88
|
+
FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
89
|
+
FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
90
|
+
FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
91
|
+
})(FileType || (exports.FileType = FileType = {}));
|
|
92
|
+
var SortOrder;
|
|
93
|
+
(function (SortOrder) {
|
|
94
|
+
/** Ascending order. */
|
|
95
|
+
SortOrder["ASC"] = "ASC";
|
|
96
|
+
/** Descending order. */
|
|
97
|
+
SortOrder["DESC"] = "DESC";
|
|
98
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
99
|
+
/** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
|
|
100
|
+
var JurisdictionType;
|
|
101
|
+
(function (JurisdictionType) {
|
|
102
|
+
JurisdictionType["UNDEFINED"] = "UNDEFINED";
|
|
103
|
+
JurisdictionType["COUNTRY"] = "COUNTRY";
|
|
104
|
+
JurisdictionType["STATE"] = "STATE";
|
|
105
|
+
JurisdictionType["COUNTY"] = "COUNTY";
|
|
106
|
+
JurisdictionType["CITY"] = "CITY";
|
|
107
|
+
JurisdictionType["SPECIAL"] = "SPECIAL";
|
|
108
|
+
})(JurisdictionType || (exports.JurisdictionType = JurisdictionType = {}));
|
|
109
|
+
var ItemAvailabilityStatus;
|
|
110
|
+
(function (ItemAvailabilityStatus) {
|
|
111
|
+
ItemAvailabilityStatus["AVAILABLE"] = "AVAILABLE";
|
|
112
|
+
/** Item does not exist */
|
|
113
|
+
ItemAvailabilityStatus["NOT_FOUND"] = "NOT_FOUND";
|
|
114
|
+
/** Item not in stock */
|
|
115
|
+
ItemAvailabilityStatus["NOT_AVAILABLE"] = "NOT_AVAILABLE";
|
|
116
|
+
/** Available quantity is less than requested */
|
|
117
|
+
ItemAvailabilityStatus["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
|
|
118
|
+
})(ItemAvailabilityStatus || (exports.ItemAvailabilityStatus = ItemAvailabilityStatus = {}));
|
|
119
|
+
var TaxableAddressType;
|
|
120
|
+
(function (TaxableAddressType) {
|
|
121
|
+
TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
|
|
122
|
+
TaxableAddressType["BUSINESS"] = "BUSINESS";
|
|
123
|
+
TaxableAddressType["BILLING"] = "BILLING";
|
|
124
|
+
TaxableAddressType["SHIPPING"] = "SHIPPING";
|
|
125
|
+
})(TaxableAddressType || (exports.TaxableAddressType = TaxableAddressType = {}));
|
|
126
|
+
/** tax info types */
|
|
127
|
+
var VatType;
|
|
128
|
+
(function (VatType) {
|
|
129
|
+
VatType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
130
|
+
/** CPF - for individual tax payers. */
|
|
131
|
+
VatType["CPF"] = "CPF";
|
|
132
|
+
/** CNPJ - for corporations */
|
|
133
|
+
VatType["CNPJ"] = "CNPJ";
|
|
134
|
+
})(VatType || (exports.VatType = VatType = {}));
|
|
135
|
+
var PickupMethod;
|
|
136
|
+
(function (PickupMethod) {
|
|
137
|
+
PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
|
|
138
|
+
PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
|
|
139
|
+
PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
|
|
140
|
+
})(PickupMethod || (exports.PickupMethod = PickupMethod = {}));
|
|
141
|
+
var ChargeType;
|
|
142
|
+
(function (ChargeType) {
|
|
143
|
+
ChargeType["HANDLING_FEE"] = "HANDLING_FEE";
|
|
144
|
+
ChargeType["INSURANCE"] = "INSURANCE";
|
|
145
|
+
})(ChargeType || (exports.ChargeType = ChargeType = {}));
|
|
146
|
+
var RuleType;
|
|
147
|
+
(function (RuleType) {
|
|
148
|
+
RuleType["VALIDATION"] = "VALIDATION";
|
|
149
|
+
RuleType["OTHER"] = "OTHER";
|
|
150
|
+
RuleType["MAX"] = "MAX";
|
|
151
|
+
RuleType["MIN"] = "MIN";
|
|
152
|
+
RuleType["MAX_LENGTH"] = "MAX_LENGTH";
|
|
153
|
+
RuleType["MIN_LENGTH"] = "MIN_LENGTH";
|
|
154
|
+
RuleType["MAX_SIZE"] = "MAX_SIZE";
|
|
155
|
+
RuleType["MIN_SIZE"] = "MIN_SIZE";
|
|
156
|
+
RuleType["FORMAT"] = "FORMAT";
|
|
157
|
+
RuleType["DECIMAL_LTE"] = "DECIMAL_LTE";
|
|
158
|
+
RuleType["DECIMAL_GTE"] = "DECIMAL_GTE";
|
|
159
|
+
RuleType["DECIMAL_LT"] = "DECIMAL_LT";
|
|
160
|
+
RuleType["DECIMAL_GT"] = "DECIMAL_GT";
|
|
161
|
+
RuleType["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
|
|
162
|
+
RuleType["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
|
|
163
|
+
RuleType["REQUIRED_FIELD"] = "REQUIRED_FIELD";
|
|
164
|
+
RuleType["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
|
|
165
|
+
RuleType["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
|
|
166
|
+
RuleType["EXACT_LENGTH"] = "EXACT_LENGTH";
|
|
167
|
+
RuleType["EXACT_SIZE"] = "EXACT_SIZE";
|
|
168
|
+
RuleType["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
|
|
169
|
+
})(RuleType || (exports.RuleType = RuleType = {}));
|
|
170
|
+
var DiscountType;
|
|
171
|
+
(function (DiscountType) {
|
|
172
|
+
DiscountType["GLOBAL"] = "GLOBAL";
|
|
173
|
+
DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
|
|
174
|
+
DiscountType["SHIPPING"] = "SHIPPING";
|
|
175
|
+
})(DiscountType || (exports.DiscountType = DiscountType = {}));
|
|
176
|
+
var WeightUnit;
|
|
177
|
+
(function (WeightUnit) {
|
|
178
|
+
/** Weight unit can't be classified, due to an error */
|
|
179
|
+
WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
180
|
+
/** Kilograms */
|
|
181
|
+
WeightUnit["KG"] = "KG";
|
|
182
|
+
/** Pounds */
|
|
183
|
+
WeightUnit["LB"] = "LB";
|
|
184
|
+
})(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
|
|
185
|
+
var RateType;
|
|
186
|
+
(function (RateType) {
|
|
187
|
+
/** no tax being collected for this request due to location of purchase */
|
|
188
|
+
RateType["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
|
|
189
|
+
/** manual rate used for calculation */
|
|
190
|
+
RateType["MANUAL_RATE"] = "MANUAL_RATE";
|
|
191
|
+
/** autotax rate used for calculation */
|
|
192
|
+
RateType["AUTO_RATE"] = "AUTO_RATE";
|
|
193
|
+
/** fallback rate used for calculation */
|
|
194
|
+
RateType["FALLBACK_RATE"] = "FALLBACK_RATE";
|
|
195
|
+
})(RateType || (exports.RateType = RateType = {}));
|
|
196
|
+
var ManualCalculationReason;
|
|
197
|
+
(function (ManualCalculationReason) {
|
|
198
|
+
/** user set calculator in Business Manager to be Manual */
|
|
199
|
+
ManualCalculationReason["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
|
|
200
|
+
/** specific region is on manual even though Global setting is Auto-tax */
|
|
201
|
+
ManualCalculationReason["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
|
|
202
|
+
})(ManualCalculationReason || (exports.ManualCalculationReason = ManualCalculationReason = {}));
|
|
203
|
+
var FallbackReason;
|
|
204
|
+
(function (FallbackReason) {
|
|
205
|
+
/** auto-tax failed to be calculated */
|
|
206
|
+
FallbackReason["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
|
|
207
|
+
/** auto-tax was temporarily deactivated on a system-level */
|
|
208
|
+
FallbackReason["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
|
|
209
|
+
})(FallbackReason || (exports.FallbackReason = FallbackReason = {}));
|
|
210
|
+
var ChannelType;
|
|
211
|
+
(function (ChannelType) {
|
|
212
|
+
/** Unspecified sales channel. This value is not supported. */
|
|
213
|
+
ChannelType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
214
|
+
/** A web client. */
|
|
215
|
+
ChannelType["WEB"] = "WEB";
|
|
216
|
+
/** [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395). */
|
|
217
|
+
ChannelType["POS"] = "POS";
|
|
218
|
+
/** [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop). */
|
|
219
|
+
ChannelType["EBAY"] = "EBAY";
|
|
220
|
+
/** [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop). */
|
|
221
|
+
ChannelType["AMAZON"] = "AMAZON";
|
|
222
|
+
/** Other sales platform. */
|
|
223
|
+
ChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
|
|
224
|
+
/** [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview). */
|
|
225
|
+
ChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
|
|
226
|
+
/** 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) */
|
|
227
|
+
ChannelType["WIX_INVOICES"] = "WIX_INVOICES";
|
|
228
|
+
/** Wix merchant backoffice. */
|
|
229
|
+
ChannelType["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
|
|
230
|
+
/** Wish sales channel. */
|
|
231
|
+
ChannelType["WISH"] = "WISH";
|
|
232
|
+
/** [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass). */
|
|
233
|
+
ChannelType["CLASS_PASS"] = "CLASS_PASS";
|
|
234
|
+
/** Global-E sales channel. */
|
|
235
|
+
ChannelType["GLOBAL_E"] = "GLOBAL_E";
|
|
236
|
+
/** [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops). */
|
|
237
|
+
ChannelType["FACEBOOK"] = "FACEBOOK";
|
|
238
|
+
/** [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel). */
|
|
239
|
+
ChannelType["ETSY"] = "ETSY";
|
|
240
|
+
/** [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel). */
|
|
241
|
+
ChannelType["TIKTOK"] = "TIKTOK";
|
|
242
|
+
/** [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app). */
|
|
243
|
+
ChannelType["FAIRE_COM"] = "FAIRE_COM";
|
|
244
|
+
})(ChannelType || (exports.ChannelType = ChannelType = {}));
|
|
245
|
+
var AdditionalFeeSource;
|
|
246
|
+
(function (AdditionalFeeSource) {
|
|
247
|
+
AdditionalFeeSource["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
|
|
248
|
+
/** The additional fee was added by an additional fee service plugin */
|
|
249
|
+
AdditionalFeeSource["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
|
|
250
|
+
/** The additional fee was added on the item either via the catalog or on custom line item */
|
|
251
|
+
AdditionalFeeSource["ITEM"] = "ITEM";
|
|
252
|
+
/** The additional fee was added manually on the request */
|
|
253
|
+
AdditionalFeeSource["MANUAL"] = "MANUAL";
|
|
254
|
+
})(AdditionalFeeSource || (exports.AdditionalFeeSource = AdditionalFeeSource = {}));
|
|
255
|
+
var Severity;
|
|
256
|
+
(function (Severity) {
|
|
257
|
+
/** The user is allowed to move forward in the flow. */
|
|
258
|
+
Severity["WARNING"] = "WARNING";
|
|
259
|
+
/**
|
|
260
|
+
* The user is blocked from moving forward in the flow.
|
|
261
|
+
* For example, if callerContext is CART - moving to checkout is blocked. if callerContext is CHECKOUT, placing an order is blocked.
|
|
262
|
+
*/
|
|
263
|
+
Severity["ERROR"] = "ERROR";
|
|
264
|
+
})(Severity || (exports.Severity = Severity = {}));
|
|
265
|
+
/** Available locations on the webpage */
|
|
266
|
+
var NameInOther;
|
|
267
|
+
(function (NameInOther) {
|
|
268
|
+
/** Default location, in case no specific location is specified. */
|
|
269
|
+
NameInOther["OTHER_DEFAULT"] = "OTHER_DEFAULT";
|
|
270
|
+
})(NameInOther || (exports.NameInOther = NameInOther = {}));
|
|
271
|
+
/** Available locations on the line item */
|
|
272
|
+
var NameInLineItem;
|
|
273
|
+
(function (NameInLineItem) {
|
|
274
|
+
/** Default location, in case no specific location is specified. */
|
|
275
|
+
NameInLineItem["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
|
|
276
|
+
})(NameInLineItem || (exports.NameInLineItem = NameInLineItem = {}));
|
|
277
|
+
var SuggestedFix;
|
|
278
|
+
(function (SuggestedFix) {
|
|
279
|
+
/** No suggested fix is specified. The user should refer to the violation description to resolve the issue. */
|
|
280
|
+
SuggestedFix["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
|
|
281
|
+
/** The line item should be removed from the cart or checkout to resolve the violation. */
|
|
282
|
+
SuggestedFix["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
|
|
283
|
+
})(SuggestedFix || (exports.SuggestedFix = SuggestedFix = {}));
|
|
284
|
+
var WebhookIdentityType;
|
|
285
|
+
(function (WebhookIdentityType) {
|
|
286
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
287
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
288
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
289
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
290
|
+
WebhookIdentityType["APP"] = "APP";
|
|
291
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
292
|
+
/**
|
|
293
|
+
* Creates a checkout template.
|
|
294
|
+
*
|
|
295
|
+
* A checkout template is used to create a new checkout that will include predefined information. For example, a single link with
|
|
296
|
+
* a `checkoutTemplateId` can be shared with customers and each time the link is clicked, a new checkout page will be created
|
|
297
|
+
* for that customer with certain checkout information already populated.
|
|
298
|
+
*
|
|
299
|
+
* The customizable features include the option to allow or to lock coupon codes or gift cards. For example, if a store owner is
|
|
300
|
+
* using the checkout template to offer a flash sale to their social media followers, they may want to lock the option to apply an
|
|
301
|
+
* additional coupon on top of the sale being offered. If so, they can set `customization.lockedCoupon` to `true`.
|
|
302
|
+
*
|
|
303
|
+
* A checkout can be created with a checkout template by calling `createCheckoutFromTemplate()`. The site may add further customizations to the new checkout and then redirect the customer using the new checkout's `checkoutUrl`.
|
|
304
|
+
* @param checkoutTemplate - Checkout template to create.
|
|
305
|
+
* @public
|
|
306
|
+
* @documentationMaturity preview
|
|
307
|
+
* @requiredField checkoutTemplate
|
|
308
|
+
* @requiredField checkoutTemplate.customLineItems.descriptionLines
|
|
309
|
+
* @requiredField checkoutTemplate.customLineItems.descriptionLines.name
|
|
310
|
+
* @requiredField checkoutTemplate.customLineItems.itemType
|
|
311
|
+
* @requiredField checkoutTemplate.customLineItems.productName
|
|
312
|
+
* @requiredField checkoutTemplate.customLineItems.quantity
|
|
313
|
+
* @requiredField checkoutTemplate.lineItems.catalogReference
|
|
314
|
+
* @requiredField checkoutTemplate.lineItems.catalogReference.appId
|
|
315
|
+
* @requiredField checkoutTemplate.lineItems.catalogReference.catalogItemId
|
|
316
|
+
* @requiredField checkoutTemplate.lineItems.quantity
|
|
317
|
+
* @permissionId ECOM.CHECKOUT_TEMPLATE_CREATE
|
|
318
|
+
* @permissionScope Manage Stores - all permissions
|
|
319
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
320
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
321
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
322
|
+
* @applicableIdentity APP
|
|
323
|
+
* @returns Created checkout template.
|
|
324
|
+
* @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutTemplate
|
|
325
|
+
*/
|
|
326
|
+
async function createCheckoutTemplate(checkoutTemplate) {
|
|
327
|
+
// @ts-ignore
|
|
328
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
329
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
330
|
+
checkoutTemplate: checkoutTemplate,
|
|
331
|
+
}), [
|
|
332
|
+
{
|
|
333
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
334
|
+
paths: [
|
|
335
|
+
{ path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
|
|
336
|
+
{ path: 'checkoutTemplate.customLineItems.media' },
|
|
337
|
+
],
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
341
|
+
paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
|
|
342
|
+
},
|
|
343
|
+
]);
|
|
344
|
+
const reqOpts = ambassadorWixEcomV1CheckoutTemplate.createCheckoutTemplate(payload);
|
|
345
|
+
sideEffects?.onSiteCall?.();
|
|
346
|
+
try {
|
|
347
|
+
const result = await httpClient.request(reqOpts);
|
|
348
|
+
sideEffects?.onSuccess?.(result);
|
|
349
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
350
|
+
{
|
|
351
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
352
|
+
paths: [
|
|
353
|
+
{ path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
|
|
354
|
+
{ path: 'checkoutTemplate.customLineItems.media' },
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
359
|
+
paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
|
|
360
|
+
},
|
|
361
|
+
]))?.checkoutTemplate;
|
|
362
|
+
}
|
|
363
|
+
catch (err) {
|
|
364
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
365
|
+
spreadPathsToArguments: {},
|
|
366
|
+
explicitPathsToArguments: { checkoutTemplate: '$[0]' },
|
|
367
|
+
singleArgumentUnchanged: false,
|
|
368
|
+
}, ['checkoutTemplate']);
|
|
369
|
+
sideEffects?.onError?.(err);
|
|
370
|
+
throw transformedError;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
exports.createCheckoutTemplate = createCheckoutTemplate;
|
|
374
|
+
/**
|
|
375
|
+
* Retrieves a checkout template.
|
|
376
|
+
* @param checkoutTemplateId - ID of the checkout template to retrieve.
|
|
377
|
+
* @public
|
|
378
|
+
* @documentationMaturity preview
|
|
379
|
+
* @requiredField checkoutTemplateId
|
|
380
|
+
* @permissionId ECOM.CHECKOUT_TEMPLATE_READ
|
|
381
|
+
* @permissionScope Manage Stores - all permissions
|
|
382
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
383
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
384
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
385
|
+
* @applicableIdentity APP
|
|
386
|
+
* @returns Retrieved checkout template.
|
|
387
|
+
* @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.GetCheckoutTemplate
|
|
388
|
+
*/
|
|
389
|
+
async function getCheckoutTemplate(checkoutTemplateId) {
|
|
390
|
+
// @ts-ignore
|
|
391
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
392
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
393
|
+
checkoutTemplateId: checkoutTemplateId,
|
|
394
|
+
});
|
|
395
|
+
const reqOpts = ambassadorWixEcomV1CheckoutTemplate.getCheckoutTemplate(payload);
|
|
396
|
+
sideEffects?.onSiteCall?.();
|
|
397
|
+
try {
|
|
398
|
+
const result = await httpClient.request(reqOpts);
|
|
399
|
+
sideEffects?.onSuccess?.(result);
|
|
400
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
401
|
+
{
|
|
402
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
403
|
+
paths: [
|
|
404
|
+
{ path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
|
|
405
|
+
{ path: 'checkoutTemplate.customLineItems.media' },
|
|
406
|
+
],
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
410
|
+
paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
|
|
411
|
+
},
|
|
412
|
+
]))?.checkoutTemplate;
|
|
413
|
+
}
|
|
414
|
+
catch (err) {
|
|
415
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
416
|
+
spreadPathsToArguments: {},
|
|
417
|
+
explicitPathsToArguments: { checkoutTemplateId: '$[0]' },
|
|
418
|
+
singleArgumentUnchanged: false,
|
|
419
|
+
}, ['checkoutTemplateId']);
|
|
420
|
+
sideEffects?.onError?.(err);
|
|
421
|
+
throw transformedError;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
exports.getCheckoutTemplate = getCheckoutTemplate;
|
|
425
|
+
/**
|
|
426
|
+
* Updates a checkout template.
|
|
427
|
+
*
|
|
428
|
+
* If the info in a checkout template is updated, only new checkouts created from this template will include the updated items. Checkouts previously
|
|
429
|
+
* created from this template before the update will not be affected.
|
|
430
|
+
* @param _id - Checkout template ID.
|
|
431
|
+
* @public
|
|
432
|
+
* @documentationMaturity preview
|
|
433
|
+
* @requiredField _id
|
|
434
|
+
* @requiredField checkoutTemplate
|
|
435
|
+
* @param checkoutTemplate - Checkout template info to update.
|
|
436
|
+
* @permissionId ECOM.CHECKOUT_TEMPLATE_UPDATE
|
|
437
|
+
* @permissionScope Manage Stores - all permissions
|
|
438
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
439
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
440
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
441
|
+
* @applicableIdentity APP
|
|
442
|
+
* @returns Updated checkout template.
|
|
443
|
+
* @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.UpdateCheckoutTemplate
|
|
444
|
+
*/
|
|
445
|
+
async function updateCheckoutTemplate(_id, checkoutTemplate) {
|
|
446
|
+
// @ts-ignore
|
|
447
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
448
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
449
|
+
checkoutTemplate: { ...checkoutTemplate, id: _id },
|
|
450
|
+
}), [
|
|
451
|
+
{
|
|
452
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
453
|
+
paths: [
|
|
454
|
+
{ path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
|
|
455
|
+
{ path: 'checkoutTemplate.customLineItems.media' },
|
|
456
|
+
],
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
460
|
+
paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
|
|
461
|
+
},
|
|
462
|
+
]);
|
|
463
|
+
const reqOpts = ambassadorWixEcomV1CheckoutTemplate.updateCheckoutTemplate(payload);
|
|
464
|
+
sideEffects?.onSiteCall?.();
|
|
465
|
+
try {
|
|
466
|
+
const result = await httpClient.request(reqOpts);
|
|
467
|
+
sideEffects?.onSuccess?.(result);
|
|
468
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
469
|
+
{
|
|
470
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
471
|
+
paths: [
|
|
472
|
+
{ path: 'checkoutTemplate.lineItems.catalogOverrideFields.image' },
|
|
473
|
+
{ path: 'checkoutTemplate.customLineItems.media' },
|
|
474
|
+
],
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
478
|
+
paths: [{ path: 'checkoutTemplate.customLineItems.url' }],
|
|
479
|
+
},
|
|
480
|
+
]))?.checkoutTemplate;
|
|
481
|
+
}
|
|
482
|
+
catch (err) {
|
|
483
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
484
|
+
spreadPathsToArguments: { checkoutTemplate: '$[1]' },
|
|
485
|
+
explicitPathsToArguments: { 'checkoutTemplate.id': '$[0]' },
|
|
486
|
+
singleArgumentUnchanged: false,
|
|
487
|
+
}, ['_id', 'checkoutTemplate']);
|
|
488
|
+
sideEffects?.onError?.(err);
|
|
489
|
+
throw transformedError;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
exports.updateCheckoutTemplate = updateCheckoutTemplate;
|
|
493
|
+
/**
|
|
494
|
+
* Deletes a checkout template.
|
|
495
|
+
*
|
|
496
|
+
* If a checkout template is deleted and a customer attempts to create a checkout with that `checkoutTemplateId` then
|
|
497
|
+
* the customer will be redirected to the domain site.
|
|
498
|
+
* @param checkoutTemplateId - ID of the checkout template to delete.
|
|
499
|
+
* @public
|
|
500
|
+
* @documentationMaturity preview
|
|
501
|
+
* @requiredField checkoutTemplateId
|
|
502
|
+
* @permissionId ECOM.CHECKOUT_TEMPLATE_DELETE
|
|
503
|
+
* @permissionScope Manage Stores - all permissions
|
|
504
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
505
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
506
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
507
|
+
* @applicableIdentity APP
|
|
508
|
+
* @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.DeleteCheckoutTemplate
|
|
509
|
+
*/
|
|
510
|
+
async function deleteCheckoutTemplate(checkoutTemplateId) {
|
|
511
|
+
// @ts-ignore
|
|
512
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
513
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
514
|
+
checkoutTemplateId: checkoutTemplateId,
|
|
515
|
+
});
|
|
516
|
+
const reqOpts = ambassadorWixEcomV1CheckoutTemplate.deleteCheckoutTemplate(payload);
|
|
517
|
+
sideEffects?.onSiteCall?.();
|
|
518
|
+
try {
|
|
519
|
+
const result = await httpClient.request(reqOpts);
|
|
520
|
+
sideEffects?.onSuccess?.(result);
|
|
521
|
+
}
|
|
522
|
+
catch (err) {
|
|
523
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
524
|
+
spreadPathsToArguments: {},
|
|
525
|
+
explicitPathsToArguments: { checkoutTemplateId: '$[0]' },
|
|
526
|
+
singleArgumentUnchanged: false,
|
|
527
|
+
}, ['checkoutTemplateId']);
|
|
528
|
+
sideEffects?.onError?.(err);
|
|
529
|
+
throw transformedError;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
exports.deleteCheckoutTemplate = deleteCheckoutTemplate;
|
|
533
|
+
/**
|
|
534
|
+
* Creates a query to retrieve a list of checkout templates.
|
|
535
|
+
*
|
|
536
|
+
* The `queryCheckoutTemplates()` function builds a query to retrieve a list of checkout templates and returns a `CheckoutTemplatesQueryBuilder` object.
|
|
537
|
+
*
|
|
538
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
539
|
+
*
|
|
540
|
+
* You can refine the query by chaining `CheckoutTemplatesQueryBuilder` functions onto the query. `CheckoutTemplatesQueryBuilder` functions enable you to sort, filter, and control the results that `queryCheckoutTemplates()` returns.
|
|
541
|
+
*
|
|
542
|
+
* `queryCheckoutTemplates()` runs with the following `CheckoutTemplatesQueryBuilder` default that you can override:
|
|
543
|
+
* + `ascending("_id")`
|
|
544
|
+
*
|
|
545
|
+
* The functions that are chained to `queryCheckoutTemplates()` are applied in the order they are called. For example, if you apply `ascending("status")` and then `ascending("_id")`, the results are sorted first by the `"status"`, and then, if there are multiple results with the same `"status"`, the items are sorted by `"_id"`.
|
|
546
|
+
*
|
|
547
|
+
* The following `CheckoutTemplatesQueryBuilder` functions are supported for the `queryCheckoutTemplates()` function. For a full description of the checkout template object, see the object returned for the `items` property in `CheckoutTemplatesQueryResult`.
|
|
548
|
+
* @public
|
|
549
|
+
* @documentationMaturity preview
|
|
550
|
+
* @permissionScope Manage Stores - all permissions
|
|
551
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
552
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
553
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
554
|
+
* @permissionId ECOM.CHECKOUT_TEMPLATE_READ
|
|
555
|
+
* @applicableIdentity APP
|
|
556
|
+
* @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.QueryCheckoutTemplates
|
|
557
|
+
*/
|
|
558
|
+
function queryCheckoutTemplates() {
|
|
559
|
+
// @ts-ignore
|
|
560
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
561
|
+
return (0, query_builder_1.queryBuilder)({
|
|
562
|
+
func: async (payload) => {
|
|
563
|
+
const reqOpts = ambassadorWixEcomV1CheckoutTemplate.queryCheckoutTemplates(payload);
|
|
564
|
+
sideEffects?.onSiteCall?.();
|
|
565
|
+
try {
|
|
566
|
+
const result = await httpClient.request(reqOpts);
|
|
567
|
+
sideEffects?.onSuccess?.(result);
|
|
568
|
+
return result;
|
|
569
|
+
}
|
|
570
|
+
catch (err) {
|
|
571
|
+
sideEffects?.onError?.(err);
|
|
572
|
+
throw err;
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
requestTransformer: (query) => {
|
|
576
|
+
const args = [query, {}];
|
|
577
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
578
|
+
...args?.[1],
|
|
579
|
+
query: args?.[0],
|
|
580
|
+
});
|
|
581
|
+
},
|
|
582
|
+
responseTransformer: ({ data, }) => {
|
|
583
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
|
|
584
|
+
{
|
|
585
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
586
|
+
paths: [
|
|
587
|
+
{
|
|
588
|
+
path: 'checkoutTemplates.lineItems.catalogOverrideFields.image',
|
|
589
|
+
},
|
|
590
|
+
{ path: 'checkoutTemplates.customLineItems.media' },
|
|
591
|
+
],
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
595
|
+
paths: [{ path: 'checkoutTemplates.customLineItems.url' }],
|
|
596
|
+
},
|
|
597
|
+
]));
|
|
598
|
+
return {
|
|
599
|
+
items: transformedData?.checkoutTemplates,
|
|
600
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
601
|
+
};
|
|
602
|
+
},
|
|
603
|
+
errorTransformer: (err) => {
|
|
604
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
605
|
+
spreadPathsToArguments: {},
|
|
606
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
607
|
+
singleArgumentUnchanged: false,
|
|
608
|
+
});
|
|
609
|
+
throw transformedError;
|
|
610
|
+
},
|
|
611
|
+
pagingMethod: 'CURSOR',
|
|
612
|
+
transformationPaths: {},
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
exports.queryCheckoutTemplates = queryCheckoutTemplates;
|
|
616
|
+
/**
|
|
617
|
+
* Creates a new checkout based on the checkout template.
|
|
618
|
+
*
|
|
619
|
+
* Before using this function, you must have a checkout template available. Create a checkout template with `createCheckoutTemplate()`.
|
|
620
|
+
*
|
|
621
|
+
* The customer can be directed to the new checkout using the checkout's `checkoutUrl`.
|
|
622
|
+
* @param checkoutTemplateId - ID of the checkout template to use to create a checkout from.
|
|
623
|
+
* @param siteId - ID of the site associated with the checkout template.
|
|
624
|
+
* @public
|
|
625
|
+
* @documentationMaturity preview
|
|
626
|
+
* @requiredField checkoutTemplateId
|
|
627
|
+
* @requiredField siteId
|
|
628
|
+
* @permissionId ECOM.CHECKOUT_TEMPLATE_CREATE_CHECKOUT
|
|
629
|
+
* @permissionScope Manage Stores - all permissions
|
|
630
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
631
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
632
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
633
|
+
* @applicableIdentity APP
|
|
634
|
+
* @applicableIdentity VISITOR
|
|
635
|
+
* @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateCheckoutFromTemplate
|
|
636
|
+
*/
|
|
637
|
+
async function createCheckoutFromTemplate(checkoutTemplateId, siteId) {
|
|
638
|
+
// @ts-ignore
|
|
639
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
640
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
641
|
+
checkoutTemplateId: checkoutTemplateId,
|
|
642
|
+
siteId: siteId,
|
|
643
|
+
});
|
|
644
|
+
const reqOpts = ambassadorWixEcomV1CheckoutTemplate.createCheckoutFromTemplate(payload);
|
|
645
|
+
sideEffects?.onSiteCall?.();
|
|
646
|
+
try {
|
|
647
|
+
const result = await httpClient.request(reqOpts);
|
|
648
|
+
sideEffects?.onSuccess?.(result);
|
|
649
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
650
|
+
}
|
|
651
|
+
catch (err) {
|
|
652
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
653
|
+
spreadPathsToArguments: {},
|
|
654
|
+
explicitPathsToArguments: {
|
|
655
|
+
checkoutTemplateId: '$[0]',
|
|
656
|
+
siteId: '$[1]',
|
|
657
|
+
},
|
|
658
|
+
singleArgumentUnchanged: false,
|
|
659
|
+
}, ['checkoutTemplateId', 'siteId']);
|
|
660
|
+
sideEffects?.onError?.(err);
|
|
661
|
+
throw transformedError;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
exports.createCheckoutFromTemplate = createCheckoutFromTemplate;
|
|
665
|
+
/**
|
|
666
|
+
* Creates a new checkout based on the checkout template and redirects to the new checkout page.
|
|
667
|
+
*
|
|
668
|
+
* Before using this function, you must have a checkout template available. Create a checkout template with `createCheckoutTemplate()`.
|
|
669
|
+
*
|
|
670
|
+
* To build a URL that uses this function, follow this format:
|
|
671
|
+
* `https://www.wixapis.com/ecom/v1/checkout-templates/{checkoutTemplateId}/create-and-redirect-to-checkout?siteId={siteId}`
|
|
672
|
+
*
|
|
673
|
+
* To create a checkout but not automatically redirect to the checkout page, use `createCheckoutFromTemplate()`.
|
|
674
|
+
* @param checkoutTemplateId - ID of the checkout template to use to create a checkout.
|
|
675
|
+
* @param siteId - ID of the site associated with the checkout template.
|
|
676
|
+
* @public
|
|
677
|
+
* @documentationMaturity preview
|
|
678
|
+
* @requiredField checkoutTemplateId
|
|
679
|
+
* @requiredField siteId
|
|
680
|
+
* @fqn wix.ecom.checkout_template.api.v1.CheckoutTemplateService.CreateAndRedirectToCheckout
|
|
681
|
+
*/
|
|
682
|
+
async function createAndRedirectToCheckout(checkoutTemplateId, siteId) {
|
|
683
|
+
// @ts-ignore
|
|
684
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
685
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
686
|
+
checkoutTemplateId: checkoutTemplateId,
|
|
687
|
+
siteId: siteId,
|
|
688
|
+
});
|
|
689
|
+
const reqOpts = ambassadorWixEcomV1CheckoutTemplate.createAndRedirectToCheckout(payload);
|
|
690
|
+
sideEffects?.onSiteCall?.();
|
|
691
|
+
try {
|
|
692
|
+
const result = await httpClient.request(reqOpts);
|
|
693
|
+
sideEffects?.onSuccess?.(result);
|
|
694
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
695
|
+
}
|
|
696
|
+
catch (err) {
|
|
697
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
698
|
+
spreadPathsToArguments: {},
|
|
699
|
+
explicitPathsToArguments: {
|
|
700
|
+
checkoutTemplateId: '$[0]',
|
|
701
|
+
siteId: '$[1]',
|
|
702
|
+
},
|
|
703
|
+
singleArgumentUnchanged: false,
|
|
704
|
+
}, ['checkoutTemplateId', 'siteId']);
|
|
705
|
+
sideEffects?.onError?.(err);
|
|
706
|
+
throw transformedError;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
exports.createAndRedirectToCheckout = createAndRedirectToCheckout;
|
|
710
|
+
//# sourceMappingURL=ecom-v1-checkout-template-checkout-templates.universal.js.map
|