nextemos 4.4.12 → 4.5.2
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/address.d.ts +14 -0
- 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/address/address.types.d.ts +10 -2
- package/dist/services/address/index.js +10 -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 +6 -0
- package/dist/services/urls.js +7 -1
- package/package.json +1 -1
|
@@ -2,6 +2,9 @@ import { IResponse } from "./response";
|
|
|
2
2
|
export interface IAddressSourceDataResponse extends IResponse {
|
|
3
3
|
data: IAddressSourceData[];
|
|
4
4
|
}
|
|
5
|
+
export interface IAddressSchemaResponse extends IResponse {
|
|
6
|
+
data: IAddressField[];
|
|
7
|
+
}
|
|
5
8
|
export interface IAddressSourceData {
|
|
6
9
|
id?: number;
|
|
7
10
|
addressPartTypeId?: number;
|
|
@@ -38,3 +41,14 @@ export interface IAddressPart {
|
|
|
38
41
|
valueId: number;
|
|
39
42
|
valueIntegrationCode: string;
|
|
40
43
|
}
|
|
44
|
+
export interface IAddressField {
|
|
45
|
+
id: number;
|
|
46
|
+
name: string;
|
|
47
|
+
addressPartTypeId: number;
|
|
48
|
+
inputTypeId: number;
|
|
49
|
+
fieldTypeId?: number;
|
|
50
|
+
isRequired: boolean;
|
|
51
|
+
order: number;
|
|
52
|
+
tenantId: string;
|
|
53
|
+
parentId?: number;
|
|
54
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IApiResponse, IRequestInit, IService } from '../..';
|
|
2
|
-
import { IAddressSourceDataResponse } from 'nextemos/interfaces/address';
|
|
1
|
+
import { IAddressSchemaResponse, IAddressSourceDataResponse, IApiResponse, IRequestInit, IService } from '../..';
|
|
3
2
|
export type TAddressPartTypeId = 'Continent' | 'Country' | 'GoverningDistrict' | 'City' | 'County' | 'Town' | 'Neighbourhood' | 'PostalCode' | 'Street' | 'Complex' | 'Apartment' | 'Description' | 'TelephoneNumber' | 'Name' | 'Surname' | 'CorporationName' | 'MobilePhone';
|
|
4
3
|
export interface IAddressSourceDataRequest {
|
|
5
4
|
addressPartTypeId: TAddressPartTypeId;
|
|
@@ -7,6 +6,15 @@ export interface IAddressSourceDataRequest {
|
|
|
7
6
|
parentId?: number;
|
|
8
7
|
tags?: string[];
|
|
9
8
|
}
|
|
9
|
+
export interface IAddressSchemaRequest {
|
|
10
|
+
name?: string;
|
|
11
|
+
inputTypeId?: 'DataBasedFreeText' | 'FreeText' | 'Data';
|
|
12
|
+
addressPartTypeId?: TAddressPartTypeId;
|
|
13
|
+
TenantId?: string;
|
|
14
|
+
language?: string;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
}
|
|
10
17
|
export interface IAddressService extends IService {
|
|
11
18
|
AddressSourceData: (data: IAddressSourceDataRequest, options?: IRequestInit) => Promise<IApiResponse<IAddressSourceDataResponse>>;
|
|
19
|
+
AddressSchema: (data: IAddressSchemaRequest, options?: IRequestInit) => Promise<IApiResponse<IAddressSchemaResponse>>;
|
|
12
20
|
}
|
|
@@ -52,4 +52,14 @@ exports.AddressService = {
|
|
|
52
52
|
}), Object.assign(Object.assign({}, options), { params: data }));
|
|
53
53
|
});
|
|
54
54
|
},
|
|
55
|
+
AddressSchema: function (data, options) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
58
|
+
serviceUrl: this.ServiceUrl(),
|
|
59
|
+
prefix: this.Prefix,
|
|
60
|
+
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
61
|
+
methodName: urls_1.default.Address.AddressSchemaForTenants.All,
|
|
62
|
+
}), Object.assign(Object.assign({}, options), { params: data }));
|
|
63
|
+
});
|
|
64
|
+
},
|
|
55
65
|
};
|
|
@@ -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
|
@@ -64,6 +64,9 @@ declare const _default: {
|
|
|
64
64
|
AddressSourceData: {
|
|
65
65
|
All: string;
|
|
66
66
|
};
|
|
67
|
+
AddressSchemaForTenants: {
|
|
68
|
+
All: string;
|
|
69
|
+
};
|
|
67
70
|
};
|
|
68
71
|
Localization: {
|
|
69
72
|
AllByTagName: string;
|
|
@@ -80,6 +83,9 @@ declare const _default: {
|
|
|
80
83
|
Notification: {
|
|
81
84
|
RenderTemplate: string;
|
|
82
85
|
};
|
|
86
|
+
ShoppingCart: {
|
|
87
|
+
AddToCart: string;
|
|
88
|
+
};
|
|
83
89
|
};
|
|
84
90
|
export default _default;
|
|
85
91
|
export declare const getUrl: ({ isClient, language, methodName, serviceUrl, prefix, id }: {
|
package/dist/services/urls.js
CHANGED
|
@@ -69,6 +69,9 @@ exports.default = {
|
|
|
69
69
|
Address: {
|
|
70
70
|
AddressSourceData: {
|
|
71
71
|
All: '/api/AddressSourceData/All',
|
|
72
|
+
},
|
|
73
|
+
AddressSchemaForTenants: {
|
|
74
|
+
All: '/{language}/AddressSchemaForTenants/v1/All',
|
|
72
75
|
}
|
|
73
76
|
},
|
|
74
77
|
Localization: {
|
|
@@ -85,7 +88,10 @@ exports.default = {
|
|
|
85
88
|
},
|
|
86
89
|
Notification: {
|
|
87
90
|
RenderTemplate: '/{language}/Template/v1/RenderTemplate',
|
|
88
|
-
}
|
|
91
|
+
},
|
|
92
|
+
ShoppingCart: {
|
|
93
|
+
AddToCart: '/{language}/ShoppingCartGateway/v1/AddToCart',
|
|
94
|
+
},
|
|
89
95
|
};
|
|
90
96
|
const getUrl = ({ isClient = false, language = process.env.DEFAULT_LANGUAGE || "tr", methodName, serviceUrl, prefix, id = '' }) => {
|
|
91
97
|
let url = serviceUrl;
|