@ikas/storefront 0.1.21 → 0.1.22-alpha.1
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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface addCouponCodeToCheckout_addCouponCodeToCheckout {
|
|
2
|
+
__typename: "Checkout";
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
export interface addCouponCodeToCheckout {
|
|
6
|
+
addCouponCodeToCheckout: addCouponCodeToCheckout_addCouponCodeToCheckout;
|
|
7
|
+
}
|
|
8
|
+
export interface addCouponCodeToCheckoutVariables {
|
|
9
|
+
checkoutId: string;
|
|
10
|
+
couponCode: string;
|
|
11
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare class IkasCheckoutAPI {
|
|
|
14
14
|
static retrieveInstallmentInfo(input: IkasInstallmentInfoInput): Promise<IkasInstallmentInfo | undefined>;
|
|
15
15
|
static checkStocks(lines: CheckStocksLineInput[], stockLocationIdList: string[]): Promise<CheckStocksTypes.checkStocks_checkStocks | undefined>;
|
|
16
16
|
static listCheckoutSettings(): Promise<IkasCheckoutSettings[] | undefined>;
|
|
17
|
+
static addCouponCodeToCheckout(checkoutId: string, couponCode: string): Promise<true | undefined>;
|
|
17
18
|
}
|
|
18
19
|
declare type CheckStocksLineInput = {
|
|
19
20
|
quantity: number;
|
package/build/index.es.js
CHANGED
|
@@ -23843,26 +23843,32 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23843
23843
|
});
|
|
23844
23844
|
}); };
|
|
23845
23845
|
this.onCouponCodeApply = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
23846
|
-
var newCheckout, oldCheckout;
|
|
23846
|
+
var isCouponSaveSuccess, newCheckout, oldCheckout;
|
|
23847
23847
|
return __generator(this, function (_a) {
|
|
23848
23848
|
switch (_a.label) {
|
|
23849
23849
|
case 0:
|
|
23850
|
-
|
|
23851
|
-
|
|
23850
|
+
if (!this.checkout.couponCode)
|
|
23851
|
+
return [2 /*return*/];
|
|
23852
|
+
_a.label = 1;
|
|
23852
23853
|
case 1:
|
|
23853
|
-
_a.
|
|
23854
|
-
return [4 /*yield*/, IkasCheckoutAPI.
|
|
23854
|
+
_a.trys.push([1, 5, , 6]);
|
|
23855
|
+
return [4 /*yield*/, IkasCheckoutAPI.addCouponCodeToCheckout(this.checkout.id, this.checkout.couponCode)];
|
|
23855
23856
|
case 2:
|
|
23857
|
+
isCouponSaveSuccess = _a.sent();
|
|
23858
|
+
if (!isCouponSaveSuccess) return [3 /*break*/, 4];
|
|
23859
|
+
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(this.checkout.id)];
|
|
23860
|
+
case 3:
|
|
23856
23861
|
newCheckout = _a.sent();
|
|
23857
23862
|
if (newCheckout) {
|
|
23858
23863
|
oldCheckout = this.checkout;
|
|
23859
23864
|
this.checkout = new IkasCheckout(__assign(__assign({}, newCheckout), { shippingAddress: oldCheckout.shippingAddress, billingAddress: oldCheckout.billingAddress, customer: oldCheckout.customer }));
|
|
23860
23865
|
}
|
|
23861
|
-
|
|
23862
|
-
case 3
|
|
23866
|
+
_a.label = 4;
|
|
23867
|
+
case 4: return [3 /*break*/, 6];
|
|
23868
|
+
case 5:
|
|
23863
23869
|
_a.sent();
|
|
23864
|
-
return [3 /*break*/,
|
|
23865
|
-
case
|
|
23870
|
+
return [3 /*break*/, 6];
|
|
23871
|
+
case 6: return [2 /*return*/];
|
|
23866
23872
|
}
|
|
23867
23873
|
});
|
|
23868
23874
|
}); };
|
|
@@ -41662,9 +41668,41 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
41662
41668
|
});
|
|
41663
41669
|
});
|
|
41664
41670
|
};
|
|
41671
|
+
IkasCheckoutAPI.addCouponCodeToCheckout = function (checkoutId, couponCode) {
|
|
41672
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
41673
|
+
var MUTATION, data;
|
|
41674
|
+
return __generator(this, function (_a) {
|
|
41675
|
+
switch (_a.label) {
|
|
41676
|
+
case 0:
|
|
41677
|
+
MUTATION = src(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "], ["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "])));
|
|
41678
|
+
_a.label = 1;
|
|
41679
|
+
case 1:
|
|
41680
|
+
_a.trys.push([1, 3, , 4]);
|
|
41681
|
+
return [4 /*yield*/, apollo
|
|
41682
|
+
.getClient()
|
|
41683
|
+
.query({
|
|
41684
|
+
query: MUTATION,
|
|
41685
|
+
variables: {
|
|
41686
|
+
checkoutId: checkoutId,
|
|
41687
|
+
couponCode: couponCode,
|
|
41688
|
+
},
|
|
41689
|
+
})];
|
|
41690
|
+
case 2:
|
|
41691
|
+
data = (_a.sent()).data;
|
|
41692
|
+
if (data && data.addCouponCodeToCheckout.id)
|
|
41693
|
+
return [2 /*return*/, true];
|
|
41694
|
+
return [3 /*break*/, 4];
|
|
41695
|
+
case 3:
|
|
41696
|
+
_a.sent();
|
|
41697
|
+
return [3 /*break*/, 4];
|
|
41698
|
+
case 4: return [2 /*return*/];
|
|
41699
|
+
}
|
|
41700
|
+
});
|
|
41701
|
+
});
|
|
41702
|
+
};
|
|
41665
41703
|
return IkasCheckoutAPI;
|
|
41666
41704
|
}());
|
|
41667
|
-
var templateObject_1$4, templateObject_2$3, templateObject_3$1, templateObject_4$1, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
41705
|
+
var templateObject_1$4, templateObject_2$3, templateObject_3$1, templateObject_4$1, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
41668
41706
|
|
|
41669
41707
|
var IkasCityAPI = /** @class */ (function () {
|
|
41670
41708
|
function IkasCityAPI() {
|
|
@@ -42162,7 +42200,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42162
42200
|
return __generator(this, function (_b) {
|
|
42163
42201
|
switch (_b.label) {
|
|
42164
42202
|
case 0:
|
|
42165
|
-
LIST_ORDER_TRANSACTIONS = src(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "], ["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "])));
|
|
42203
|
+
LIST_ORDER_TRANSACTIONS = src(templateObject_10$1 || (templateObject_10$1 = __makeTemplateObject(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "], ["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "])));
|
|
42166
42204
|
_b.label = 1;
|
|
42167
42205
|
case 1:
|
|
42168
42206
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42367,7 +42405,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42367
42405
|
};
|
|
42368
42406
|
return IkasCustomerAPI;
|
|
42369
42407
|
}());
|
|
42370
|
-
var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
42408
|
+
var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
42371
42409
|
|
|
42372
42410
|
var IkasDistrictAPI = /** @class */ (function () {
|
|
42373
42411
|
function IkasDistrictAPI() {
|
package/build/index.js
CHANGED
|
@@ -23850,26 +23850,32 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
23850
23850
|
});
|
|
23851
23851
|
}); };
|
|
23852
23852
|
this.onCouponCodeApply = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
23853
|
-
var newCheckout, oldCheckout;
|
|
23853
|
+
var isCouponSaveSuccess, newCheckout, oldCheckout;
|
|
23854
23854
|
return __generator(this, function (_a) {
|
|
23855
23855
|
switch (_a.label) {
|
|
23856
23856
|
case 0:
|
|
23857
|
-
|
|
23858
|
-
|
|
23857
|
+
if (!this.checkout.couponCode)
|
|
23858
|
+
return [2 /*return*/];
|
|
23859
|
+
_a.label = 1;
|
|
23859
23860
|
case 1:
|
|
23860
|
-
_a.
|
|
23861
|
-
return [4 /*yield*/, IkasCheckoutAPI.
|
|
23861
|
+
_a.trys.push([1, 5, , 6]);
|
|
23862
|
+
return [4 /*yield*/, IkasCheckoutAPI.addCouponCodeToCheckout(this.checkout.id, this.checkout.couponCode)];
|
|
23862
23863
|
case 2:
|
|
23864
|
+
isCouponSaveSuccess = _a.sent();
|
|
23865
|
+
if (!isCouponSaveSuccess) return [3 /*break*/, 4];
|
|
23866
|
+
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(this.checkout.id)];
|
|
23867
|
+
case 3:
|
|
23863
23868
|
newCheckout = _a.sent();
|
|
23864
23869
|
if (newCheckout) {
|
|
23865
23870
|
oldCheckout = this.checkout;
|
|
23866
23871
|
this.checkout = new IkasCheckout(__assign(__assign({}, newCheckout), { shippingAddress: oldCheckout.shippingAddress, billingAddress: oldCheckout.billingAddress, customer: oldCheckout.customer }));
|
|
23867
23872
|
}
|
|
23868
|
-
|
|
23869
|
-
case 3
|
|
23873
|
+
_a.label = 4;
|
|
23874
|
+
case 4: return [3 /*break*/, 6];
|
|
23875
|
+
case 5:
|
|
23870
23876
|
_a.sent();
|
|
23871
|
-
return [3 /*break*/,
|
|
23872
|
-
case
|
|
23877
|
+
return [3 /*break*/, 6];
|
|
23878
|
+
case 6: return [2 /*return*/];
|
|
23873
23879
|
}
|
|
23874
23880
|
});
|
|
23875
23881
|
}); };
|
|
@@ -41641,9 +41647,41 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
41641
41647
|
});
|
|
41642
41648
|
});
|
|
41643
41649
|
};
|
|
41650
|
+
IkasCheckoutAPI.addCouponCodeToCheckout = function (checkoutId, couponCode) {
|
|
41651
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
41652
|
+
var MUTATION, data;
|
|
41653
|
+
return __generator(this, function (_a) {
|
|
41654
|
+
switch (_a.label) {
|
|
41655
|
+
case 0:
|
|
41656
|
+
MUTATION = src(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "], ["\n mutation addCouponCodeToCheckout(\n $checkoutId: String!\n $couponCode: String!\n ) {\n addCouponCodeToCheckout(\n checkoutId: $checkoutId\n couponCode: $couponCode\n ) {\n id\n }\n }\n "])));
|
|
41657
|
+
_a.label = 1;
|
|
41658
|
+
case 1:
|
|
41659
|
+
_a.trys.push([1, 3, , 4]);
|
|
41660
|
+
return [4 /*yield*/, apollo
|
|
41661
|
+
.getClient()
|
|
41662
|
+
.query({
|
|
41663
|
+
query: MUTATION,
|
|
41664
|
+
variables: {
|
|
41665
|
+
checkoutId: checkoutId,
|
|
41666
|
+
couponCode: couponCode,
|
|
41667
|
+
},
|
|
41668
|
+
})];
|
|
41669
|
+
case 2:
|
|
41670
|
+
data = (_a.sent()).data;
|
|
41671
|
+
if (data && data.addCouponCodeToCheckout.id)
|
|
41672
|
+
return [2 /*return*/, true];
|
|
41673
|
+
return [3 /*break*/, 4];
|
|
41674
|
+
case 3:
|
|
41675
|
+
_a.sent();
|
|
41676
|
+
return [3 /*break*/, 4];
|
|
41677
|
+
case 4: return [2 /*return*/];
|
|
41678
|
+
}
|
|
41679
|
+
});
|
|
41680
|
+
});
|
|
41681
|
+
};
|
|
41644
41682
|
return IkasCheckoutAPI;
|
|
41645
41683
|
}());
|
|
41646
|
-
var templateObject_1$4, templateObject_2$3, templateObject_3$1, templateObject_4$1, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
41684
|
+
var templateObject_1$4, templateObject_2$3, templateObject_3$1, templateObject_4$1, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
41647
41685
|
|
|
41648
41686
|
var IkasCityAPI = /** @class */ (function () {
|
|
41649
41687
|
function IkasCityAPI() {
|
|
@@ -42141,7 +42179,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42141
42179
|
return __generator(this, function (_b) {
|
|
42142
42180
|
switch (_b.label) {
|
|
42143
42181
|
case 0:
|
|
42144
|
-
LIST_ORDER_TRANSACTIONS = src(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "], ["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "])));
|
|
42182
|
+
LIST_ORDER_TRANSACTIONS = src(templateObject_10$1 || (templateObject_10$1 = __makeTemplateObject(["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "], ["\n query listOrderTransactions(\n $checkoutId: StringFilterInput\n $id: StringFilterInput\n $orderId: StringFilterInput\n ) {\n listOrderTransactions(\n checkoutId: $checkoutId\n id: $id\n orderId: $orderId\n ) {\n amount\n checkoutId\n createdAt\n currencyCode\n customerId\n deleted\n error {\n code\n declineCode\n message\n }\n id\n orderId\n paymentGatewayId\n paymentGatewayName\n paymentMethod\n paymentMethodDetail {\n bankName\n binNumber\n cardAssociation\n cardFamily\n cardType\n installment {\n installmentCount\n installmentPrice\n totalPrice\n }\n lastFourDigits\n threeDSecure\n }\n processedAt\n refundReason\n status\n type\n updatedAt\n }\n }\n "])));
|
|
42145
42183
|
_b.label = 1;
|
|
42146
42184
|
case 1:
|
|
42147
42185
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -42346,7 +42384,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
42346
42384
|
};
|
|
42347
42385
|
return IkasCustomerAPI;
|
|
42348
42386
|
}());
|
|
42349
|
-
var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
42387
|
+
var templateObject_1$7, templateObject_2$5, templateObject_3$3, templateObject_4$2, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
42350
42388
|
|
|
42351
42389
|
var IkasDistrictAPI = /** @class */ (function () {
|
|
42352
42390
|
function IkasDistrictAPI() {
|