nextemos 4.4.12 → 4.5.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.
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/response.d.ts +8 -2
- package/dist/interfaces/shoppingcart.d.ts +121 -0
- package/dist/interfaces/shoppingcart.js +2 -0
- package/dist/services/shoppingcart/index.d.ts +2 -0
- package/dist/services/shoppingcart/index.js +55 -0
- package/dist/services/shoppingcart/shoppingcart.types.d.ts +26 -0
- package/dist/services/shoppingcart/shoppingcart.types.js +2 -0
- package/dist/services/urls.d.ts +3 -0
- package/dist/services/urls.js +4 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ export * from './localization';
|
|
|
11
11
|
export * from './environment';
|
|
12
12
|
export * from './keycloack';
|
|
13
13
|
export * from './service';
|
|
14
|
+
export * from './shoppingcart';
|
|
14
15
|
export * from '../services/banner/banner.types';
|
|
15
16
|
export * from '../services/blog/blog.types';
|
|
16
17
|
export * from '../services/product/product.types';
|
|
@@ -20,3 +21,4 @@ export * from '../services/member/member.types';
|
|
|
20
21
|
export * from '../services/address/address.types';
|
|
21
22
|
export * from '../services/prediction/prediction.types';
|
|
22
23
|
export * from '../services/localization/localization.types';
|
|
24
|
+
export * from '../services/shoppingcart/shoppingcart.types';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./localization"), exports);
|
|
|
28
28
|
__exportStar(require("./environment"), exports);
|
|
29
29
|
__exportStar(require("./keycloack"), exports);
|
|
30
30
|
__exportStar(require("./service"), exports);
|
|
31
|
+
__exportStar(require("./shoppingcart"), exports);
|
|
31
32
|
/// service types
|
|
32
33
|
__exportStar(require("../services/banner/banner.types"), exports);
|
|
33
34
|
__exportStar(require("../services/blog/blog.types"), exports);
|
|
@@ -38,3 +39,4 @@ __exportStar(require("../services/member/member.types"), exports);
|
|
|
38
39
|
__exportStar(require("../services/address/address.types"), exports);
|
|
39
40
|
__exportStar(require("../services/prediction/prediction.types"), exports);
|
|
40
41
|
__exportStar(require("../services/localization/localization.types"), exports);
|
|
42
|
+
__exportStar(require("../services/shoppingcart/shoppingcart.types"), exports);
|
|
@@ -24,8 +24,9 @@ export interface IResponse {
|
|
|
24
24
|
script?: string;
|
|
25
25
|
headerScript?: string;
|
|
26
26
|
footerScript?: string;
|
|
27
|
-
refreshEnvironment
|
|
28
|
-
|
|
27
|
+
refreshEnvironment: string;
|
|
28
|
+
outputCacheConfiguration: IOutputCacheConfiguration;
|
|
29
|
+
tags: string[];
|
|
29
30
|
}
|
|
30
31
|
export interface IResponsePaging extends IResponse {
|
|
31
32
|
totalItems: number;
|
|
@@ -35,4 +36,9 @@ export interface IResponsePaging extends IResponse {
|
|
|
35
36
|
currentPage: number;
|
|
36
37
|
totalPages: number;
|
|
37
38
|
}
|
|
39
|
+
export interface IOutputCacheConfiguration {
|
|
40
|
+
key: string;
|
|
41
|
+
value: string;
|
|
42
|
+
positionId: number;
|
|
43
|
+
}
|
|
38
44
|
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { IResponse } from "./response";
|
|
2
|
+
export interface IShoppingCartResponse extends IResponse {
|
|
3
|
+
cart: ICart;
|
|
4
|
+
isUpdated: boolean;
|
|
5
|
+
isTotalsChanged: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ISubscriptionInfo {
|
|
8
|
+
duration: number;
|
|
9
|
+
durationType: number;
|
|
10
|
+
period: number;
|
|
11
|
+
periodType: number;
|
|
12
|
+
}
|
|
13
|
+
export interface IGiftCardInfo {
|
|
14
|
+
fromName?: string;
|
|
15
|
+
toName?: string;
|
|
16
|
+
toEmail?: string;
|
|
17
|
+
note: string;
|
|
18
|
+
deliveryTime?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ICartInfo {
|
|
21
|
+
status: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ICartItem {
|
|
25
|
+
id: number;
|
|
26
|
+
documentId: string;
|
|
27
|
+
parentDocumentId: string;
|
|
28
|
+
productHierarchyId: number;
|
|
29
|
+
productId: number;
|
|
30
|
+
quantity: number;
|
|
31
|
+
unitPriceWithTax: number;
|
|
32
|
+
unitPriceWithoutTax: number;
|
|
33
|
+
discountPriceWithTax: number;
|
|
34
|
+
discountPriceWithoutTax: number;
|
|
35
|
+
salesPriceWithTax: number;
|
|
36
|
+
salesPriceWithoutTax: number;
|
|
37
|
+
lineInfo: string;
|
|
38
|
+
stockBarcodeId: number;
|
|
39
|
+
availableStock: number;
|
|
40
|
+
flags: string;
|
|
41
|
+
totals: ICartTotal[];
|
|
42
|
+
itemDate: string;
|
|
43
|
+
cartItemInfo: ICartInfo[];
|
|
44
|
+
isGiftBoxRequested: boolean;
|
|
45
|
+
giftBoxNote: string;
|
|
46
|
+
platformId: number;
|
|
47
|
+
clientIp: string;
|
|
48
|
+
referrerUrl: string;
|
|
49
|
+
referrerName: string;
|
|
50
|
+
userAgent: string;
|
|
51
|
+
giftCardInfo?: IGiftCardInfo;
|
|
52
|
+
isGiftCard: boolean;
|
|
53
|
+
subscriptionOptionId: number;
|
|
54
|
+
subscriptionInfo?: ISubscriptionInfo;
|
|
55
|
+
commissionRate: number;
|
|
56
|
+
gainPoint: number;
|
|
57
|
+
taxTypeId: number;
|
|
58
|
+
fixedUnitPrice: number;
|
|
59
|
+
scopeTypeId: number;
|
|
60
|
+
criterias: number[];
|
|
61
|
+
tags: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface ICartTotal {
|
|
64
|
+
customType: string;
|
|
65
|
+
customTypeName: string;
|
|
66
|
+
typeId: number;
|
|
67
|
+
type: string;
|
|
68
|
+
campaignId: number;
|
|
69
|
+
campaign: string;
|
|
70
|
+
couponId: number;
|
|
71
|
+
taxTypeDetailId: number;
|
|
72
|
+
taxTypeDetail: string;
|
|
73
|
+
priceWithTax: number;
|
|
74
|
+
priceWithoutTax: number;
|
|
75
|
+
dividedPriceWithTax: number;
|
|
76
|
+
dividedPriceWithoutTax: number;
|
|
77
|
+
rate: number;
|
|
78
|
+
orderNo: number;
|
|
79
|
+
memberSubscriptionItemId: number;
|
|
80
|
+
}
|
|
81
|
+
export interface ICart {
|
|
82
|
+
documentId: string;
|
|
83
|
+
docNo: string;
|
|
84
|
+
docDate: string;
|
|
85
|
+
deliveredPerson: string;
|
|
86
|
+
isTaxIncluded: boolean;
|
|
87
|
+
isGuestOrder: boolean;
|
|
88
|
+
priceTypeId: number;
|
|
89
|
+
currencyId: number;
|
|
90
|
+
currencyRate: number;
|
|
91
|
+
shipperId: number;
|
|
92
|
+
channelId: number;
|
|
93
|
+
deliveryDate: string;
|
|
94
|
+
wareHouseId: number;
|
|
95
|
+
isGiftBoxRequested: boolean;
|
|
96
|
+
isGiftBoxEnabled: boolean;
|
|
97
|
+
shippingAddressId: number;
|
|
98
|
+
invoiceAddressId: number;
|
|
99
|
+
platformId: number;
|
|
100
|
+
clientIp: string;
|
|
101
|
+
referrerUrl: string;
|
|
102
|
+
referrerName: string;
|
|
103
|
+
userAgent: string;
|
|
104
|
+
orderNote: string;
|
|
105
|
+
memberNote: string;
|
|
106
|
+
giftBoxNote: string;
|
|
107
|
+
couponCode: string;
|
|
108
|
+
bankPoint: number;
|
|
109
|
+
sitePoint: number;
|
|
110
|
+
gainPoint: number;
|
|
111
|
+
paymentTypeId: number;
|
|
112
|
+
cardBin: string;
|
|
113
|
+
isSecurePaymentRequired: boolean;
|
|
114
|
+
memberId: number;
|
|
115
|
+
installmentNumber: number;
|
|
116
|
+
bankId: number;
|
|
117
|
+
extraMemberPoint: number;
|
|
118
|
+
totals: ICartTotal[];
|
|
119
|
+
items: ICartItem[];
|
|
120
|
+
cartInfo: ICartInfo[];
|
|
121
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.ShoppingCartService = void 0;
|
|
36
|
+
const urls_1 = __importStar(require("../urls"));
|
|
37
|
+
const __1 = require("../..");
|
|
38
|
+
exports.ShoppingCartService = {
|
|
39
|
+
Namespace: process.env.MS_NAMESPACE || 'emosv2service',
|
|
40
|
+
ServiceUrl: function () {
|
|
41
|
+
return `http://shoppingcartgateway.${this.Namespace}.svc.cluster.local`;
|
|
42
|
+
},
|
|
43
|
+
Prefix: '/api/shoppingcartgateway',
|
|
44
|
+
AddToCart: function (data, options) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
47
|
+
serviceUrl: this.ServiceUrl(),
|
|
48
|
+
prefix: this.Prefix,
|
|
49
|
+
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
50
|
+
language: data === null || data === void 0 ? void 0 : data.language,
|
|
51
|
+
methodName: urls_1.default.ShoppingCart.AddToCart,
|
|
52
|
+
}), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IShoppingCartResponse, IApiResponse, IRequestInit, IService, IGiftCardInfo } from '../..';
|
|
2
|
+
export interface IAddToCartRequest {
|
|
3
|
+
flags?: string;
|
|
4
|
+
tags?: string[];
|
|
5
|
+
productId: number;
|
|
6
|
+
stockBarcodeId: number;
|
|
7
|
+
quantity?: number;
|
|
8
|
+
lineInfo?: string;
|
|
9
|
+
parentDocumentId?: string;
|
|
10
|
+
productHierarchyId?: number;
|
|
11
|
+
subscriptionOptionId?: number;
|
|
12
|
+
children?: IProductChild[];
|
|
13
|
+
giftCardInfo?: IGiftCardInfo;
|
|
14
|
+
language?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IProductChild {
|
|
17
|
+
productId: number;
|
|
18
|
+
stockBarcodeId: number;
|
|
19
|
+
productHierarchyId?: number;
|
|
20
|
+
quantity?: number;
|
|
21
|
+
lineInfo?: string;
|
|
22
|
+
tags?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface IShoppingCartService extends IService {
|
|
25
|
+
AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IShoppingCartResponse>>;
|
|
26
|
+
}
|
package/dist/services/urls.d.ts
CHANGED
package/dist/services/urls.js
CHANGED
|
@@ -85,7 +85,10 @@ exports.default = {
|
|
|
85
85
|
},
|
|
86
86
|
Notification: {
|
|
87
87
|
RenderTemplate: '/{language}/Template/v1/RenderTemplate',
|
|
88
|
-
}
|
|
88
|
+
},
|
|
89
|
+
ShoppingCart: {
|
|
90
|
+
AddToCart: '/{language}/ShoppingCartGateway/v1/AddToCart',
|
|
91
|
+
},
|
|
89
92
|
};
|
|
90
93
|
const getUrl = ({ isClient = false, language = process.env.DEFAULT_LANGUAGE || "tr", methodName, serviceUrl, prefix, id = '' }) => {
|
|
91
94
|
let url = serviceUrl;
|