nextemos 5.2.13 → 5.2.15
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.
|
@@ -38,6 +38,7 @@ const fetchRequest = () => {
|
|
|
38
38
|
* @returns {Promise<IApiResponse<T>>} API'den gelen yanıt.
|
|
39
39
|
*/
|
|
40
40
|
const request = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
var _b;
|
|
41
42
|
var { url, method, params } = _a, options = __rest(_a, ["url", "method", "params"]);
|
|
42
43
|
const apiURL = new URL(url);
|
|
43
44
|
if (params) {
|
|
@@ -83,10 +84,9 @@ const fetchRequest = () => {
|
|
|
83
84
|
const errorDetail = yield response.text();
|
|
84
85
|
if (["debug", "info", "trace"].includes(FETCH_OPTIONS.LOG_LEVEL))
|
|
85
86
|
console.log("Fetch Error: ", {
|
|
86
|
-
api: apiURL,
|
|
87
87
|
apiUrl: apiURL.toString(),
|
|
88
88
|
status: response.status,
|
|
89
|
-
errorMessage: errorDetail,
|
|
89
|
+
errorMessage: ((_b = JSON.parse(errorDetail || "{}")) === null || _b === void 0 ? void 0 : _b.message) || errorDetail,
|
|
90
90
|
});
|
|
91
91
|
return {
|
|
92
92
|
status: response.status,
|
|
@@ -115,7 +115,10 @@ const fetchRequest = () => {
|
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
117
117
|
if (error instanceof Error) {
|
|
118
|
-
console.log(
|
|
118
|
+
console.log("Fetch Request Exception Error!", {
|
|
119
|
+
apiURL: apiURL.toString(),
|
|
120
|
+
error,
|
|
121
|
+
});
|
|
119
122
|
return {
|
|
120
123
|
status: 500,
|
|
121
124
|
error: error.name,
|
|
@@ -93,4 +93,7 @@ exports.ShoppingCartService = {
|
|
|
93
93
|
GetSalesAggreementForm: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
94
|
return (0, __1.fetchRequest)().post(exports.ShoppingCartService.Url(urls_1.default.ShoppingCart.GetSalesAggreementForm, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
|
|
95
95
|
}),
|
|
96
|
+
AddGiftBoxNote: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
+
return (0, __1.fetchRequest)().post(exports.ShoppingCartService.Url(urls_1.default.ShoppingCart.AddGiftBoxNote, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
|
|
98
|
+
}),
|
|
96
99
|
};
|
|
@@ -102,6 +102,13 @@ export interface IGetPreInfoFormRequest extends Omit<IGetCartRequest, "flags"> {
|
|
|
102
102
|
}
|
|
103
103
|
export interface IGetSalesAggreementFormRequest extends Omit<IGetCartRequest, "flags"> {
|
|
104
104
|
}
|
|
105
|
+
export interface IAddGiftBoxNoteRequest extends IGetCartRequest {
|
|
106
|
+
giftBoxNotes: {
|
|
107
|
+
documentId: string;
|
|
108
|
+
giftBoxNote: string;
|
|
109
|
+
isGiftBoxRequested: boolean;
|
|
110
|
+
}[];
|
|
111
|
+
}
|
|
105
112
|
export interface IShoppingCartService extends IService {
|
|
106
113
|
AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
|
|
107
114
|
GetCartItemCount: (data: IGetCartItemCountRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartItemCountResponse>>;
|
|
@@ -117,4 +124,5 @@ export interface IShoppingCartService extends IService {
|
|
|
117
124
|
DoFreeOfChargeTransaction: (data: IDoFreeOfChargeTransactionRequest, options?: IRequestInit) => Promise<IApiResponse<IDoFreeOfChargeTransactionResponse>>;
|
|
118
125
|
GetPreInfoForm: (data: IGetPreInfoFormRequest, options?: IRequestInit) => Promise<IApiResponse<IGetPreInfoFormResponse>>;
|
|
119
126
|
GetSalesAggreementForm: (data: IGetSalesAggreementFormRequest, options?: IRequestInit) => Promise<IApiResponse<IGetSalesAggreementFormResponse>>;
|
|
127
|
+
AddGiftBoxNote: (data: IAddGiftBoxNoteRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
|
|
120
128
|
}
|
package/dist/services/urls.d.ts
CHANGED
package/dist/services/urls.js
CHANGED
|
@@ -135,6 +135,7 @@ exports.default = {
|
|
|
135
135
|
DoFreeOfChargeTransaction: "/{language}/ShoppingCartGateway/v1/DoFreeOfChargeTransaction",
|
|
136
136
|
GetPreInfoForm: "/{language}/ShoppingCartGateway/v1/GetPreInfoForm",
|
|
137
137
|
GetSalesAggreementForm: "/{language}/ShoppingCartGateway/v1/GetSalesAggreementForm",
|
|
138
|
+
AddGiftBoxNote: "/{language}/ShoppingCartGateway/v1/AddGiftBoxNote",
|
|
138
139
|
},
|
|
139
140
|
OrderManagement: {
|
|
140
141
|
GetMemberOrderDetails: "/{language}/OrderManagement/v1/GetMemberOrderDetails",
|