nextemos 3.4.1 → 3.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/enums/productFlags.d.ts +79 -0
- package/dist/enums/productFlags.js +83 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/product.d.ts +240 -0
- package/dist/interfaces/product.js +2 -0
- package/dist/services/banner/banner.types.d.ts +4 -5
- package/dist/services/banner/index.js +43 -15
- package/dist/services/blog/blog.types.d.ts +4 -5
- package/dist/services/blog/index.js +52 -18
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/product/index.d.ts +9 -0
- package/dist/services/product/index.js +72 -0
- package/dist/services/product/product.types.d.ts +30 -0
- package/dist/services/product/product.types.js +2 -0
- package/dist/services/urls.d.ts +19 -0
- package/dist/services/urls.js +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Product API Flags
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ProductApiFlags {
|
|
5
|
+
/**
|
|
6
|
+
* The no flag status
|
|
7
|
+
*/
|
|
8
|
+
None = 1,
|
|
9
|
+
/**
|
|
10
|
+
* If price is 0 then removes it
|
|
11
|
+
*/
|
|
12
|
+
PriceIsNotZero = 2,
|
|
13
|
+
/**
|
|
14
|
+
* Lists ready items for sale with scope type:
|
|
15
|
+
* Commercial, Set, Custom, Combine
|
|
16
|
+
*/
|
|
17
|
+
OffTheShelf = 4,
|
|
18
|
+
/**
|
|
19
|
+
* Combines `PriceIsNotZero` and `OffTheShelf`.
|
|
20
|
+
* If price is 0, then removes it, and lists ready items for sale.
|
|
21
|
+
*/
|
|
22
|
+
Default = 6,
|
|
23
|
+
/**
|
|
24
|
+
* The group variations
|
|
25
|
+
*/
|
|
26
|
+
GroupVariations = 8,
|
|
27
|
+
/**
|
|
28
|
+
* Ignore approval
|
|
29
|
+
*/
|
|
30
|
+
IgnoreApproval = 16,
|
|
31
|
+
/**
|
|
32
|
+
* Show products where stock is available
|
|
33
|
+
*/
|
|
34
|
+
InStock = 32,
|
|
35
|
+
/**
|
|
36
|
+
* Show out of stock items
|
|
37
|
+
*/
|
|
38
|
+
OutOfStock = 64,
|
|
39
|
+
/**
|
|
40
|
+
* Gets items with discount rate > 0
|
|
41
|
+
*/
|
|
42
|
+
Discounted = 128,
|
|
43
|
+
/**
|
|
44
|
+
* Check sales quantity
|
|
45
|
+
*/
|
|
46
|
+
Sold = 256,
|
|
47
|
+
/**
|
|
48
|
+
* Service computes stocks from the database
|
|
49
|
+
*/
|
|
50
|
+
ComputePhysicalStocks = 512,
|
|
51
|
+
/**
|
|
52
|
+
* Recomputes the product
|
|
53
|
+
*/
|
|
54
|
+
TransientRequest = 1024,
|
|
55
|
+
/**
|
|
56
|
+
* The just selected culture
|
|
57
|
+
*/
|
|
58
|
+
JustSelectedCulture = 2048,
|
|
59
|
+
/**
|
|
60
|
+
* The just default category
|
|
61
|
+
*/
|
|
62
|
+
JustDefaultCategory = 4096,
|
|
63
|
+
/**
|
|
64
|
+
* The just default image document
|
|
65
|
+
*/
|
|
66
|
+
JustDefaultImageDocument = 8192,
|
|
67
|
+
/**
|
|
68
|
+
* The just default video document
|
|
69
|
+
*/
|
|
70
|
+
JustDefaultVideoDocument = 16384,
|
|
71
|
+
/**
|
|
72
|
+
* Flag to show item on the list page
|
|
73
|
+
*/
|
|
74
|
+
IsShowedListPage = 32768,
|
|
75
|
+
/**
|
|
76
|
+
* Flag to show item on the detail page
|
|
77
|
+
*/
|
|
78
|
+
IsShowedDetailPage = 65536
|
|
79
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductApiFlags = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The Product API Flags
|
|
6
|
+
*/
|
|
7
|
+
var ProductApiFlags;
|
|
8
|
+
(function (ProductApiFlags) {
|
|
9
|
+
/**
|
|
10
|
+
* The no flag status
|
|
11
|
+
*/
|
|
12
|
+
ProductApiFlags[ProductApiFlags["None"] = 1] = "None";
|
|
13
|
+
/**
|
|
14
|
+
* If price is 0 then removes it
|
|
15
|
+
*/
|
|
16
|
+
ProductApiFlags[ProductApiFlags["PriceIsNotZero"] = 2] = "PriceIsNotZero";
|
|
17
|
+
/**
|
|
18
|
+
* Lists ready items for sale with scope type:
|
|
19
|
+
* Commercial, Set, Custom, Combine
|
|
20
|
+
*/
|
|
21
|
+
ProductApiFlags[ProductApiFlags["OffTheShelf"] = 4] = "OffTheShelf";
|
|
22
|
+
/**
|
|
23
|
+
* Combines `PriceIsNotZero` and `OffTheShelf`.
|
|
24
|
+
* If price is 0, then removes it, and lists ready items for sale.
|
|
25
|
+
*/
|
|
26
|
+
ProductApiFlags[ProductApiFlags["Default"] = 6] = "Default";
|
|
27
|
+
/**
|
|
28
|
+
* The group variations
|
|
29
|
+
*/
|
|
30
|
+
ProductApiFlags[ProductApiFlags["GroupVariations"] = 8] = "GroupVariations";
|
|
31
|
+
/**
|
|
32
|
+
* Ignore approval
|
|
33
|
+
*/
|
|
34
|
+
ProductApiFlags[ProductApiFlags["IgnoreApproval"] = 16] = "IgnoreApproval";
|
|
35
|
+
/**
|
|
36
|
+
* Show products where stock is available
|
|
37
|
+
*/
|
|
38
|
+
ProductApiFlags[ProductApiFlags["InStock"] = 32] = "InStock";
|
|
39
|
+
/**
|
|
40
|
+
* Show out of stock items
|
|
41
|
+
*/
|
|
42
|
+
ProductApiFlags[ProductApiFlags["OutOfStock"] = 64] = "OutOfStock";
|
|
43
|
+
/**
|
|
44
|
+
* Gets items with discount rate > 0
|
|
45
|
+
*/
|
|
46
|
+
ProductApiFlags[ProductApiFlags["Discounted"] = 128] = "Discounted";
|
|
47
|
+
/**
|
|
48
|
+
* Check sales quantity
|
|
49
|
+
*/
|
|
50
|
+
ProductApiFlags[ProductApiFlags["Sold"] = 256] = "Sold";
|
|
51
|
+
/**
|
|
52
|
+
* Service computes stocks from the database
|
|
53
|
+
*/
|
|
54
|
+
ProductApiFlags[ProductApiFlags["ComputePhysicalStocks"] = 512] = "ComputePhysicalStocks";
|
|
55
|
+
/**
|
|
56
|
+
* Recomputes the product
|
|
57
|
+
*/
|
|
58
|
+
ProductApiFlags[ProductApiFlags["TransientRequest"] = 1024] = "TransientRequest";
|
|
59
|
+
/**
|
|
60
|
+
* The just selected culture
|
|
61
|
+
*/
|
|
62
|
+
ProductApiFlags[ProductApiFlags["JustSelectedCulture"] = 2048] = "JustSelectedCulture";
|
|
63
|
+
/**
|
|
64
|
+
* The just default category
|
|
65
|
+
*/
|
|
66
|
+
ProductApiFlags[ProductApiFlags["JustDefaultCategory"] = 4096] = "JustDefaultCategory";
|
|
67
|
+
/**
|
|
68
|
+
* The just default image document
|
|
69
|
+
*/
|
|
70
|
+
ProductApiFlags[ProductApiFlags["JustDefaultImageDocument"] = 8192] = "JustDefaultImageDocument";
|
|
71
|
+
/**
|
|
72
|
+
* The just default video document
|
|
73
|
+
*/
|
|
74
|
+
ProductApiFlags[ProductApiFlags["JustDefaultVideoDocument"] = 16384] = "JustDefaultVideoDocument";
|
|
75
|
+
/**
|
|
76
|
+
* Flag to show item on the list page
|
|
77
|
+
*/
|
|
78
|
+
ProductApiFlags[ProductApiFlags["IsShowedListPage"] = 32768] = "IsShowedListPage";
|
|
79
|
+
/**
|
|
80
|
+
* Flag to show item on the detail page
|
|
81
|
+
*/
|
|
82
|
+
ProductApiFlags[ProductApiFlags["IsShowedDetailPage"] = 65536] = "IsShowedDetailPage";
|
|
83
|
+
})(ProductApiFlags || (exports.ProductApiFlags = ProductApiFlags = {}));
|
package/dist/interfaces/index.js
CHANGED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { IResponse } from "./response";
|
|
2
|
+
export interface IProductResponse extends IResponse {
|
|
3
|
+
product: Product;
|
|
4
|
+
}
|
|
5
|
+
export interface Product {
|
|
6
|
+
id: number;
|
|
7
|
+
productUrl: string;
|
|
8
|
+
routePath: string;
|
|
9
|
+
routeTitle: string;
|
|
10
|
+
routeLocalizations: RouteLocalization[];
|
|
11
|
+
routeDescription: string;
|
|
12
|
+
parameterName: string;
|
|
13
|
+
templateId: number;
|
|
14
|
+
barcode: string;
|
|
15
|
+
name: string;
|
|
16
|
+
deci: number;
|
|
17
|
+
shortName: string;
|
|
18
|
+
description: string;
|
|
19
|
+
sku: string;
|
|
20
|
+
className: string;
|
|
21
|
+
code: string;
|
|
22
|
+
isApproved: any;
|
|
23
|
+
isCompleted: any;
|
|
24
|
+
scopeTypeId: number;
|
|
25
|
+
isAssembleRequired: boolean;
|
|
26
|
+
year: number;
|
|
27
|
+
rptDate: string;
|
|
28
|
+
seasonCode: string;
|
|
29
|
+
orderRate: number;
|
|
30
|
+
salesCount: number;
|
|
31
|
+
isGiftCard: any;
|
|
32
|
+
integrationCode: string;
|
|
33
|
+
rates: Rate[];
|
|
34
|
+
extensionData: any;
|
|
35
|
+
stocksByBarcode: StocksByBarcode;
|
|
36
|
+
stocksByWarehouse: StocksByWarehouse;
|
|
37
|
+
basePrice: number;
|
|
38
|
+
discountPrice: number;
|
|
39
|
+
salesPrice: number;
|
|
40
|
+
discountRate: number;
|
|
41
|
+
brand: Brand;
|
|
42
|
+
unitOfMeasure: UnitOfMeasure;
|
|
43
|
+
displayType: DisplayType;
|
|
44
|
+
categories: Category[];
|
|
45
|
+
variations: number[];
|
|
46
|
+
channelProperties: ChannelProperty[];
|
|
47
|
+
types: Type[];
|
|
48
|
+
barcodes: Barcode[];
|
|
49
|
+
documents: Document[];
|
|
50
|
+
vendors: Vendor[];
|
|
51
|
+
attributeGroupMappings: AttributeGroupMapping[];
|
|
52
|
+
}
|
|
53
|
+
export interface RouteLocalization {
|
|
54
|
+
id: number;
|
|
55
|
+
culture: string;
|
|
56
|
+
parameterName: string;
|
|
57
|
+
routeDescription: string;
|
|
58
|
+
routePath: string;
|
|
59
|
+
routeTitle: string;
|
|
60
|
+
}
|
|
61
|
+
export interface Rate {
|
|
62
|
+
id: number;
|
|
63
|
+
name: string;
|
|
64
|
+
code: string;
|
|
65
|
+
iconUrl: string;
|
|
66
|
+
rate: number;
|
|
67
|
+
isDefault: boolean;
|
|
68
|
+
totalComments: number;
|
|
69
|
+
totalRatings: number;
|
|
70
|
+
}
|
|
71
|
+
export interface StocksByBarcode {
|
|
72
|
+
[barcode: string]: number;
|
|
73
|
+
}
|
|
74
|
+
export interface StocksByWarehouse {
|
|
75
|
+
[storeId: string]: StocksByBarcode;
|
|
76
|
+
}
|
|
77
|
+
export interface Brand {
|
|
78
|
+
id: number;
|
|
79
|
+
order: number;
|
|
80
|
+
name: string;
|
|
81
|
+
filePath: string;
|
|
82
|
+
thumbnailUrl: string;
|
|
83
|
+
className: string;
|
|
84
|
+
routePath: string;
|
|
85
|
+
routeTitle: string;
|
|
86
|
+
routeDescription: string;
|
|
87
|
+
parameterName: string;
|
|
88
|
+
integrationCode: string;
|
|
89
|
+
extensionData: any;
|
|
90
|
+
}
|
|
91
|
+
export interface UnitOfMeasure {
|
|
92
|
+
id: number;
|
|
93
|
+
name: string;
|
|
94
|
+
extensionData: ExtensionData3;
|
|
95
|
+
}
|
|
96
|
+
export interface ExtensionData3 {
|
|
97
|
+
additionalProp1: string[];
|
|
98
|
+
additionalProp2: string[];
|
|
99
|
+
additionalProp3: string[];
|
|
100
|
+
}
|
|
101
|
+
export interface DisplayType {
|
|
102
|
+
id: number;
|
|
103
|
+
name: string;
|
|
104
|
+
extensionData: any;
|
|
105
|
+
}
|
|
106
|
+
export interface Category {
|
|
107
|
+
id: number;
|
|
108
|
+
name: string;
|
|
109
|
+
description: string;
|
|
110
|
+
sort: number;
|
|
111
|
+
parentId: number;
|
|
112
|
+
catalogId: number;
|
|
113
|
+
integrationCode: string;
|
|
114
|
+
className: string;
|
|
115
|
+
isDefault: boolean;
|
|
116
|
+
routePath: string;
|
|
117
|
+
routeTitle: string;
|
|
118
|
+
routeDescription: string;
|
|
119
|
+
parameterName: string;
|
|
120
|
+
hierarchy: number[];
|
|
121
|
+
extensionData: any;
|
|
122
|
+
}
|
|
123
|
+
export interface ChannelProperty {
|
|
124
|
+
channelId: number;
|
|
125
|
+
taxTypeId: number;
|
|
126
|
+
note: string;
|
|
127
|
+
stockStatusId: number;
|
|
128
|
+
stockStatus: string;
|
|
129
|
+
isStockNeeded: boolean;
|
|
130
|
+
minSalesQuantity: number;
|
|
131
|
+
maxSalesQuantity: number;
|
|
132
|
+
isShowedListPage: boolean;
|
|
133
|
+
isShowedDetailPage: boolean;
|
|
134
|
+
}
|
|
135
|
+
export interface Type {
|
|
136
|
+
id: number;
|
|
137
|
+
name: string;
|
|
138
|
+
key: string;
|
|
139
|
+
integrationCode: string;
|
|
140
|
+
isShowedOnPage: boolean;
|
|
141
|
+
parameterName: string;
|
|
142
|
+
routePath: string;
|
|
143
|
+
routeTitle: string;
|
|
144
|
+
routeDescription: string;
|
|
145
|
+
isAggregated: boolean;
|
|
146
|
+
extensionData: any;
|
|
147
|
+
}
|
|
148
|
+
export interface Barcode {
|
|
149
|
+
id: number;
|
|
150
|
+
barcode: string;
|
|
151
|
+
maxSalesQuantity: number;
|
|
152
|
+
stockTypes: StockType[];
|
|
153
|
+
stockTypeValues: StockTypeValue[];
|
|
154
|
+
}
|
|
155
|
+
export interface StockType {
|
|
156
|
+
id: number;
|
|
157
|
+
externalId: number;
|
|
158
|
+
}
|
|
159
|
+
export interface StockTypeValue {
|
|
160
|
+
id: number;
|
|
161
|
+
externalId: number;
|
|
162
|
+
}
|
|
163
|
+
export interface Document {
|
|
164
|
+
id: number;
|
|
165
|
+
name: string;
|
|
166
|
+
filePath: string;
|
|
167
|
+
thumbnailUrl: string;
|
|
168
|
+
documentType: string;
|
|
169
|
+
isDefault: boolean;
|
|
170
|
+
order: number;
|
|
171
|
+
templateId: number;
|
|
172
|
+
productDocumentGroup: ProductDocumentGroup;
|
|
173
|
+
thumbnails: Thumbnails;
|
|
174
|
+
extensionData: any;
|
|
175
|
+
integrationCode: string;
|
|
176
|
+
className: string;
|
|
177
|
+
}
|
|
178
|
+
export interface Thumbnails {
|
|
179
|
+
[thumbKey: string]: string;
|
|
180
|
+
}
|
|
181
|
+
export interface ProductDocumentGroup {
|
|
182
|
+
id: number;
|
|
183
|
+
name: string;
|
|
184
|
+
}
|
|
185
|
+
export interface Vendor {
|
|
186
|
+
id: number;
|
|
187
|
+
currenyId: number;
|
|
188
|
+
purchasePrice: number;
|
|
189
|
+
isFundingCalculation: boolean;
|
|
190
|
+
}
|
|
191
|
+
export interface AttributeGroupMapping {
|
|
192
|
+
attributeGroup: AttributeGroup;
|
|
193
|
+
attributeValueMappings: AttributeValueMapping[];
|
|
194
|
+
}
|
|
195
|
+
export interface AttributeGroup {
|
|
196
|
+
id: number;
|
|
197
|
+
name: string;
|
|
198
|
+
hierarchy: number[];
|
|
199
|
+
hierarchyField: string;
|
|
200
|
+
integrationCode: string;
|
|
201
|
+
parentId: number;
|
|
202
|
+
sort: number;
|
|
203
|
+
tenantId: string;
|
|
204
|
+
hierarchyIds: number[];
|
|
205
|
+
extensionData: any;
|
|
206
|
+
}
|
|
207
|
+
export interface AttributeValueMapping {
|
|
208
|
+
attribute: Attribute;
|
|
209
|
+
attributeValues: AttributeValue[];
|
|
210
|
+
attributeValueTexts: string[];
|
|
211
|
+
}
|
|
212
|
+
export interface Attribute {
|
|
213
|
+
id: number;
|
|
214
|
+
name: string;
|
|
215
|
+
attributeTypeId: number;
|
|
216
|
+
attributeGroupIds: number[];
|
|
217
|
+
integrationCode: string;
|
|
218
|
+
className: string;
|
|
219
|
+
order: number;
|
|
220
|
+
isExistOnList: boolean;
|
|
221
|
+
isAggregated: boolean;
|
|
222
|
+
parameterName: string;
|
|
223
|
+
routePath: string;
|
|
224
|
+
routeTitle: string;
|
|
225
|
+
routeDescription: string;
|
|
226
|
+
extensionData: any;
|
|
227
|
+
}
|
|
228
|
+
export interface AttributeValue {
|
|
229
|
+
id: number;
|
|
230
|
+
value: string;
|
|
231
|
+
attributeId: number;
|
|
232
|
+
routePath: string;
|
|
233
|
+
routeTitle: string;
|
|
234
|
+
routeDescription: string;
|
|
235
|
+
parameterName: string;
|
|
236
|
+
integrationCode: string;
|
|
237
|
+
className: string;
|
|
238
|
+
sort: number;
|
|
239
|
+
extensionData: any;
|
|
240
|
+
}
|
|
@@ -54,11 +54,10 @@ export interface IBannerService {
|
|
|
54
54
|
* Service URL'i
|
|
55
55
|
*/
|
|
56
56
|
ServiceUrl: string;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Service Prefix'i
|
|
59
|
+
*/
|
|
60
|
+
Prefix: string;
|
|
62
61
|
/**
|
|
63
62
|
* Banner ID'sine göre banner al.
|
|
64
63
|
*/
|
|
@@ -1,4 +1,27 @@
|
|
|
1
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
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,12 +31,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
32
|
});
|
|
10
33
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
35
|
exports.BannerService = void 0;
|
|
16
|
-
const urls_1 =
|
|
36
|
+
const urls_1 = __importStar(require("../urls"));
|
|
17
37
|
const __1 = require("../..");
|
|
18
38
|
/**
|
|
19
39
|
* Banner servisi, banner ve banner konteyner verilerini alır.
|
|
@@ -27,12 +47,10 @@ exports.BannerService = {
|
|
|
27
47
|
* Bu servise ait local adres
|
|
28
48
|
*/
|
|
29
49
|
ServiceUrl: "http://banner.emosv2service.svc.cluster.local",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return (url + methodName).replace(/{language}/g, language);
|
|
35
|
-
},
|
|
50
|
+
/**
|
|
51
|
+
* Bu servise ait url prefix
|
|
52
|
+
*/
|
|
53
|
+
Prefix: '/api/banner',
|
|
36
54
|
/**
|
|
37
55
|
* ID'ye göre banner al.
|
|
38
56
|
* @param data - Banner ID'si ve dil bilgisi.
|
|
@@ -40,7 +58,9 @@ exports.BannerService = {
|
|
|
40
58
|
*/
|
|
41
59
|
GetBannerById: function (data, options) {
|
|
42
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
return yield (0, __1.fetchRequest)().get(
|
|
61
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
62
|
+
serviceUrl: this.ServiceUrl,
|
|
63
|
+
prefix: this.Prefix,
|
|
44
64
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
45
65
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
46
66
|
methodName: urls_1.default.Banner.GetBannerById,
|
|
@@ -54,7 +74,9 @@ exports.BannerService = {
|
|
|
54
74
|
*/
|
|
55
75
|
GetBannerByName: function (data, options) {
|
|
56
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
return yield (0, __1.fetchRequest)().get(
|
|
77
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
78
|
+
serviceUrl: this.ServiceUrl,
|
|
79
|
+
prefix: this.Prefix,
|
|
58
80
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
59
81
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
60
82
|
methodName: urls_1.default.Banner.GetBannerByName,
|
|
@@ -68,7 +90,9 @@ exports.BannerService = {
|
|
|
68
90
|
*/
|
|
69
91
|
GetBannerByKey: function (data, options) {
|
|
70
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
return yield (0, __1.fetchRequest)().get(
|
|
93
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
94
|
+
serviceUrl: this.ServiceUrl,
|
|
95
|
+
prefix: this.Prefix,
|
|
72
96
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
73
97
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
74
98
|
methodName: urls_1.default.Banner.GetBannerByKey,
|
|
@@ -82,7 +106,9 @@ exports.BannerService = {
|
|
|
82
106
|
*/
|
|
83
107
|
GetBannerList: function (data, options) {
|
|
84
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
return yield (0, __1.fetchRequest)().get(
|
|
109
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
110
|
+
serviceUrl: this.ServiceUrl,
|
|
111
|
+
prefix: this.Prefix,
|
|
86
112
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
87
113
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
88
114
|
methodName: urls_1.default.Banner.GetBannerList,
|
|
@@ -96,7 +122,9 @@ exports.BannerService = {
|
|
|
96
122
|
*/
|
|
97
123
|
GetBannerContainerList: function (data, options) {
|
|
98
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
return yield (0, __1.fetchRequest)().get(
|
|
125
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
126
|
+
serviceUrl: this.ServiceUrl,
|
|
127
|
+
prefix: this.Prefix,
|
|
100
128
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
101
129
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
102
130
|
methodName: urls_1.default.Banner.GetBannerContainerList,
|
|
@@ -109,11 +109,10 @@ export interface IBlogService {
|
|
|
109
109
|
* Service URL'i
|
|
110
110
|
*/
|
|
111
111
|
ServiceUrl: string;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}) => string;
|
|
112
|
+
/**
|
|
113
|
+
* Service Prefix'i
|
|
114
|
+
*/
|
|
115
|
+
Prefix: string;
|
|
117
116
|
/**
|
|
118
117
|
* Blog gönderilerini almak için istek fonksiyonu
|
|
119
118
|
*/
|
|
@@ -1,4 +1,27 @@
|
|
|
1
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
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,13 +31,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
32
|
});
|
|
10
33
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
35
|
exports.BlogService = void 0;
|
|
16
36
|
// URL'lerin bulunduğu dosyayı içe aktarır
|
|
17
|
-
const urls_1 =
|
|
37
|
+
const urls_1 = __importStar(require("../urls"));
|
|
18
38
|
// Farklı blog cevap arayüzlerini ve fetchRequest fonksiyonunu içe aktarır
|
|
19
39
|
const __1 = require("../..");
|
|
20
40
|
/** BlogService adlı nesneyi oluşturur ve IBlogService arayüzünü uygular
|
|
@@ -28,12 +48,10 @@ exports.BlogService = {
|
|
|
28
48
|
* Bu servise ait local adres
|
|
29
49
|
*/
|
|
30
50
|
ServiceUrl: "http://blog.emosv2service.svc.cluster.local",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return (url + methodName).replace(/{language}/g, language);
|
|
36
|
-
},
|
|
51
|
+
/**
|
|
52
|
+
* Bu servise ait url prefix
|
|
53
|
+
*/
|
|
54
|
+
Prefix: '/api/blog',
|
|
37
55
|
/**
|
|
38
56
|
* Blog gönderilerini almak için istek fonksiyonu
|
|
39
57
|
* @param data İstek verilerini içeren nesne (varsayılan boş nesne)
|
|
@@ -42,7 +60,9 @@ exports.BlogService = {
|
|
|
42
60
|
*/
|
|
43
61
|
GetBlogPostsRequest: function () {
|
|
44
62
|
return __awaiter(this, arguments, void 0, function* (data = {}, options) {
|
|
45
|
-
return yield (0, __1.fetchRequest)().post(
|
|
63
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
64
|
+
serviceUrl: this.ServiceUrl,
|
|
65
|
+
prefix: this.Prefix,
|
|
46
66
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
47
67
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
48
68
|
methodName: urls_1.default.Blog.GetBlogPostsRequest,
|
|
@@ -57,7 +77,9 @@ exports.BlogService = {
|
|
|
57
77
|
*/
|
|
58
78
|
GetBlogPostRequest: function (data, options) {
|
|
59
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
return yield (0, __1.fetchRequest)().post(
|
|
80
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
81
|
+
serviceUrl: this.ServiceUrl,
|
|
82
|
+
prefix: this.Prefix,
|
|
61
83
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
62
84
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
63
85
|
methodName: urls_1.default.Blog.GetBlogPostRequest,
|
|
@@ -72,7 +94,9 @@ exports.BlogService = {
|
|
|
72
94
|
*/
|
|
73
95
|
GetBlogCategoriesRequest: function () {
|
|
74
96
|
return __awaiter(this, arguments, void 0, function* (data = {}, options) {
|
|
75
|
-
return yield (0, __1.fetchRequest)().post(
|
|
97
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
98
|
+
serviceUrl: this.ServiceUrl,
|
|
99
|
+
prefix: this.Prefix,
|
|
76
100
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
77
101
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
78
102
|
methodName: urls_1.default.Blog.GetBlogCategoriesRequest,
|
|
@@ -87,7 +111,9 @@ exports.BlogService = {
|
|
|
87
111
|
*/
|
|
88
112
|
GetBlogCategoryRequest: function (data, options) {
|
|
89
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
return yield (0, __1.fetchRequest)().post(
|
|
114
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
115
|
+
serviceUrl: this.ServiceUrl,
|
|
116
|
+
prefix: this.Prefix,
|
|
91
117
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
92
118
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
93
119
|
methodName: urls_1.default.Blog.GetBlogCategoryRequest,
|
|
@@ -102,7 +128,9 @@ exports.BlogService = {
|
|
|
102
128
|
*/
|
|
103
129
|
GetBlogCategoryHierarchyRequest: function (data, options) {
|
|
104
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
return yield (0, __1.fetchRequest)().post(
|
|
131
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
132
|
+
serviceUrl: this.ServiceUrl,
|
|
133
|
+
prefix: this.Prefix,
|
|
106
134
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
107
135
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
108
136
|
methodName: urls_1.default.Blog.GetBlogCategoryHierarchyRequest,
|
|
@@ -117,7 +145,9 @@ exports.BlogService = {
|
|
|
117
145
|
*/
|
|
118
146
|
GetBlogCategoryTreeRequest: function (data, options) {
|
|
119
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
return yield (0, __1.fetchRequest)().post(
|
|
148
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
149
|
+
serviceUrl: this.ServiceUrl,
|
|
150
|
+
prefix: this.Prefix,
|
|
121
151
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
122
152
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
123
153
|
methodName: urls_1.default.Blog.GetBlogCategoryTreeRequest,
|
|
@@ -132,7 +162,9 @@ exports.BlogService = {
|
|
|
132
162
|
*/
|
|
133
163
|
GetBlogTagRequest: function (data, options) {
|
|
134
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
return yield (0, __1.fetchRequest)().post(
|
|
165
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
166
|
+
serviceUrl: this.ServiceUrl,
|
|
167
|
+
prefix: this.Prefix,
|
|
136
168
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
137
169
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
138
170
|
methodName: urls_1.default.Blog.GetBlogTagRequest,
|
|
@@ -147,7 +179,9 @@ exports.BlogService = {
|
|
|
147
179
|
*/
|
|
148
180
|
GetBlogTagsRequest: function (data, options) {
|
|
149
181
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
-
return yield (0, __1.fetchRequest)().post(
|
|
182
|
+
return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
|
|
183
|
+
serviceUrl: this.ServiceUrl,
|
|
184
|
+
prefix: this.Prefix,
|
|
151
185
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
152
186
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
153
187
|
methodName: urls_1.default.Blog.GetBlogTagsRequest,
|
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -4,9 +4,11 @@ exports.Service = void 0;
|
|
|
4
4
|
// services
|
|
5
5
|
const banner_1 = require("./banner");
|
|
6
6
|
const blog_1 = require("./blog");
|
|
7
|
+
const product_1 = require("./product");
|
|
7
8
|
const route_1 = require("./route");
|
|
8
9
|
exports.Service = {
|
|
9
10
|
Banner: banner_1.BannerService,
|
|
10
11
|
Blog: blog_1.BlogService,
|
|
11
12
|
Route: route_1.RouteService,
|
|
13
|
+
Product: product_1.ProductService
|
|
12
14
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IProductService } from './product.types';
|
|
2
|
+
/**
|
|
3
|
+
* Product servisi, Product, Product Category, Channel ve Price Type verilerini alır.
|
|
4
|
+
* @description
|
|
5
|
+
* Microservice Kubernates içerisinden doğrudan iletişim sağlanabilmesi için aşağıdaki adresi kullanmalıdır.
|
|
6
|
+
* <service-name>.<namespace>.svc.cluster.local:<service-port>
|
|
7
|
+
* http://product.emosv2service.svc.cluster.local
|
|
8
|
+
*/
|
|
9
|
+
export declare const ProductService: IProductService;
|
|
@@ -0,0 +1,72 @@
|
|
|
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.ProductService = void 0;
|
|
36
|
+
const urls_1 = __importStar(require("../urls"));
|
|
37
|
+
const __1 = require("../..");
|
|
38
|
+
/**
|
|
39
|
+
* Product servisi, Product, Product Category, Channel ve Price Type verilerini alır.
|
|
40
|
+
* @description
|
|
41
|
+
* Microservice Kubernates içerisinden doğrudan iletişim sağlanabilmesi için aşağıdaki adresi kullanmalıdır.
|
|
42
|
+
* <service-name>.<namespace>.svc.cluster.local:<service-port>
|
|
43
|
+
* http://product.emosv2service.svc.cluster.local
|
|
44
|
+
*/
|
|
45
|
+
exports.ProductService = {
|
|
46
|
+
/**
|
|
47
|
+
* Bu servise ait local adres
|
|
48
|
+
*/
|
|
49
|
+
ServiceUrl: "http://product.emosv2service.svc.cluster.local",
|
|
50
|
+
/**
|
|
51
|
+
* Bu servise ait url prefix
|
|
52
|
+
*/
|
|
53
|
+
Prefix: '/api/product',
|
|
54
|
+
/**
|
|
55
|
+
* ID'ye göre product al.
|
|
56
|
+
* @param data İstek verilerini içeren nesne (varsayılan boş nesne)
|
|
57
|
+
* @param options İstek seçeneklerini içeren nesne
|
|
58
|
+
* @returns Product içeren cevap nesnesi
|
|
59
|
+
*/
|
|
60
|
+
Product: function (data, options) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
63
|
+
serviceUrl: this.ServiceUrl,
|
|
64
|
+
prefix: this.Prefix,
|
|
65
|
+
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
66
|
+
language: data === null || data === void 0 ? void 0 : data.language,
|
|
67
|
+
methodName: urls_1.default.Product.Product,
|
|
68
|
+
id: data === null || data === void 0 ? void 0 : data.id, // replace request id with product id
|
|
69
|
+
}), Object.assign(Object.assign({}, options), { params: data }));
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IProductResponse } from 'nextemos/interfaces/product';
|
|
2
|
+
import { IApiResponse, IRequestInit } from '../..';
|
|
3
|
+
/**
|
|
4
|
+
* Product ID'sine göre Product alma isteği arayüzü.
|
|
5
|
+
*/
|
|
6
|
+
interface IProductRequest {
|
|
7
|
+
id: number;
|
|
8
|
+
flags?: number;
|
|
9
|
+
includes?: string[];
|
|
10
|
+
tags?: string[];
|
|
11
|
+
language?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Product hizmetleri arayüzü.
|
|
15
|
+
*/
|
|
16
|
+
export interface IProductService {
|
|
17
|
+
/**
|
|
18
|
+
* Service URL'i
|
|
19
|
+
*/
|
|
20
|
+
ServiceUrl: string;
|
|
21
|
+
/**
|
|
22
|
+
* Service Prefix'i
|
|
23
|
+
*/
|
|
24
|
+
Prefix: string;
|
|
25
|
+
/**
|
|
26
|
+
* Product ID'sine göre Product al.
|
|
27
|
+
*/
|
|
28
|
+
Product: (data: IProductRequest, options?: IRequestInit) => Promise<IApiResponse<IProductResponse>>;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
package/dist/services/urls.d.ts
CHANGED
|
@@ -19,5 +19,24 @@ declare const _default: {
|
|
|
19
19
|
Route: {
|
|
20
20
|
GetRouteInfo: string;
|
|
21
21
|
};
|
|
22
|
+
Product: {
|
|
23
|
+
Product: string;
|
|
24
|
+
SearchProductsRequest: string;
|
|
25
|
+
GetAllProductsRequest: string;
|
|
26
|
+
SearchProductsRequestWithWorkflow: string;
|
|
27
|
+
};
|
|
28
|
+
ProductCategory: {
|
|
29
|
+
All: string;
|
|
30
|
+
ProductCategory: string;
|
|
31
|
+
CategoryTree: string;
|
|
32
|
+
};
|
|
22
33
|
};
|
|
23
34
|
export default _default;
|
|
35
|
+
export declare const getUrl: ({ isClient, language, methodName, serviceUrl, prefix, id }: {
|
|
36
|
+
isClient?: boolean;
|
|
37
|
+
language?: string;
|
|
38
|
+
methodName: string;
|
|
39
|
+
serviceUrl: string;
|
|
40
|
+
prefix: string;
|
|
41
|
+
id?: string | number;
|
|
42
|
+
}) => string;
|
package/dist/services/urls.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUrl = void 0;
|
|
3
4
|
exports.default = {
|
|
4
5
|
Banner: {
|
|
5
6
|
GetBannerById: '/{language}/Banner/v1/GetBannerById',
|
|
@@ -24,4 +25,22 @@ exports.default = {
|
|
|
24
25
|
Route: {
|
|
25
26
|
GetRouteInfo: '/{language}/Route/v1/GetRouteInfo',
|
|
26
27
|
},
|
|
28
|
+
Product: {
|
|
29
|
+
Product: '/{language}/Product/v1/Product',
|
|
30
|
+
SearchProductsRequest: '/{language}/Product/v1/SearchProductsRequest',
|
|
31
|
+
GetAllProductsRequest: '/{language}/Product/v1/GetAllProductsRequest',
|
|
32
|
+
SearchProductsRequestWithWorkflow: '/{language}/Product/v1/SearchProductsRequestWithWorkflow',
|
|
33
|
+
},
|
|
34
|
+
ProductCategory: {
|
|
35
|
+
All: '/{language}/ProductCategory/v1/All',
|
|
36
|
+
ProductCategory: '/{language}/ProductCategory/v1/ProductCategory',
|
|
37
|
+
CategoryTree: '/{language}/ProductCategory/v1/CategoryTree',
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const getUrl = ({ isClient = false, language = process.env.DEFAULT_LANGUAGE || "tr", methodName, serviceUrl, prefix, id = '' }) => {
|
|
41
|
+
let url = serviceUrl;
|
|
42
|
+
if (process.env.API_URL && (process.env.USE_API_URL === 'true' || isClient))
|
|
43
|
+
url = `${process.env.API_URL}${prefix}`;
|
|
44
|
+
return (url + methodName).replace(/{language}/g, language).replace(/{id}/g, `${id}`);
|
|
27
45
|
};
|
|
46
|
+
exports.getUrl = getUrl;
|