nextemos 3.5.0 → 3.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/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -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.js +32 -11
- package/dist/services/product/product.types.d.ts +4 -5
- package/dist/services/urls.d.ts +8 -0
- package/dist/services/urls.js +9 -1
- package/package.json +1 -1
package/dist/interfaces/index.js
CHANGED
|
@@ -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
|
};
|
|
@@ -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.ProductService = void 0;
|
|
16
|
-
const urls_1 =
|
|
36
|
+
const urls_1 = __importStar(require("../urls"));
|
|
17
37
|
const __1 = require("../..");
|
|
18
38
|
/**
|
|
19
39
|
* Product servisi, Product, Product Category, Channel ve Price Type verilerini alır.
|
|
@@ -27,12 +47,10 @@ exports.ProductService = {
|
|
|
27
47
|
* Bu servise ait local adres
|
|
28
48
|
*/
|
|
29
49
|
ServiceUrl: "http://product.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/product',
|
|
36
54
|
/**
|
|
37
55
|
* ID'ye göre product al.
|
|
38
56
|
* @param data İstek verilerini içeren nesne (varsayılan boş nesne)
|
|
@@ -41,10 +59,13 @@ exports.ProductService = {
|
|
|
41
59
|
*/
|
|
42
60
|
Product: function (data, options) {
|
|
43
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
return yield (0, __1.fetchRequest)().get(
|
|
62
|
+
return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
|
|
63
|
+
serviceUrl: this.ServiceUrl,
|
|
64
|
+
prefix: this.Prefix,
|
|
45
65
|
isClient: options === null || options === void 0 ? void 0 : options.useClient,
|
|
46
66
|
language: data === null || data === void 0 ? void 0 : data.language,
|
|
47
67
|
methodName: urls_1.default.Product.Product,
|
|
68
|
+
id: data === null || data === void 0 ? void 0 : data.id, // replace request id with product id
|
|
48
69
|
}), Object.assign(Object.assign({}, options), { params: data }));
|
|
49
70
|
});
|
|
50
71
|
},
|
|
@@ -18,11 +18,10 @@ export interface IProductService {
|
|
|
18
18
|
* Service URL'i
|
|
19
19
|
*/
|
|
20
20
|
ServiceUrl: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Service Prefix'i
|
|
23
|
+
*/
|
|
24
|
+
Prefix: string;
|
|
26
25
|
/**
|
|
27
26
|
* Product ID'sine göre Product al.
|
|
28
27
|
*/
|
package/dist/services/urls.d.ts
CHANGED
|
@@ -32,3 +32,11 @@ declare const _default: {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
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',
|
|
@@ -25,7 +26,7 @@ exports.default = {
|
|
|
25
26
|
GetRouteInfo: '/{language}/Route/v1/GetRouteInfo',
|
|
26
27
|
},
|
|
27
28
|
Product: {
|
|
28
|
-
Product: '/{language}/Product/v1/Product',
|
|
29
|
+
Product: '/{language}/Product/v1/Product/{id}',
|
|
29
30
|
SearchProductsRequest: '/{language}/Product/v1/SearchProductsRequest',
|
|
30
31
|
GetAllProductsRequest: '/{language}/Product/v1/GetAllProductsRequest',
|
|
31
32
|
SearchProductsRequestWithWorkflow: '/{language}/Product/v1/SearchProductsRequestWithWorkflow',
|
|
@@ -36,3 +37,10 @@ exports.default = {
|
|
|
36
37
|
CategoryTree: '/{language}/ProductCategory/v1/CategoryTree',
|
|
37
38
|
}
|
|
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}`);
|
|
45
|
+
};
|
|
46
|
+
exports.getUrl = getUrl;
|