nextemos 2.1.3 → 2.1.5
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/httpMethods.d.ts +60 -0
- package/dist/enums/httpMethods.js +64 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +17 -0
- package/dist/helpers/fetchRequest.d.ts +7 -10
- package/dist/helpers/fetchRequest.js +11 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/response.d.ts +39 -17
- package/dist/services/banner.d.ts +33 -0
- package/dist/services/banner.js +49 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +18 -0
- package/dist/services/urls.d.ts +10 -0
- package/dist/services/urls.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP request methods.
|
|
3
|
+
*
|
|
4
|
+
* HTTP defines a set of request methods to indicate the desired action to be
|
|
5
|
+
* performed for a given resource. Although they can also be nouns, these
|
|
6
|
+
* request methods are sometimes referred as HTTP verbs. Each of them implements
|
|
7
|
+
* a different semantic, but some common features are shared by a group of them:
|
|
8
|
+
* e.g. a request method can be safe, idempotent, or cacheable.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare enum HTTPMethod {
|
|
13
|
+
/**
|
|
14
|
+
* The `CONNECT` method establishes a tunnel to the server identified by the
|
|
15
|
+
* target resource.
|
|
16
|
+
*/
|
|
17
|
+
CONNECT = "CONNECT",
|
|
18
|
+
/**
|
|
19
|
+
* The `DELETE` method deletes the specified resource.
|
|
20
|
+
*/
|
|
21
|
+
DELETE = "DELETE",
|
|
22
|
+
/**
|
|
23
|
+
* The `GET` method requests a representation of the specified resource.
|
|
24
|
+
* Requests using GET should only retrieve data.
|
|
25
|
+
*/
|
|
26
|
+
GET = "GET",
|
|
27
|
+
/**
|
|
28
|
+
* The `HEAD` method asks for a response identical to that of a GET request,
|
|
29
|
+
* but without the response body.
|
|
30
|
+
*/
|
|
31
|
+
HEAD = "HEAD",
|
|
32
|
+
/**
|
|
33
|
+
* The `OPTIONS` method is used to describe the communication options for the
|
|
34
|
+
* target resource.
|
|
35
|
+
*/
|
|
36
|
+
OPTIONS = "OPTIONS",
|
|
37
|
+
/**
|
|
38
|
+
* The PATCH method is used to apply partial modifications to a resource.
|
|
39
|
+
*/
|
|
40
|
+
PATCH = "PATCH",
|
|
41
|
+
/**
|
|
42
|
+
* The `POST` method is used to submit an entity to the specified resource,
|
|
43
|
+
* often causing a change in state or side effects on the server.
|
|
44
|
+
*/
|
|
45
|
+
POST = "POST",
|
|
46
|
+
/**
|
|
47
|
+
* The `PUT` method replaces all current representations of the target
|
|
48
|
+
* resource with the request payload.
|
|
49
|
+
*/
|
|
50
|
+
PUT = "PUT",
|
|
51
|
+
/**
|
|
52
|
+
* The `TRACE` method performs a message loop-back test along the path to the
|
|
53
|
+
* target resource.
|
|
54
|
+
*/
|
|
55
|
+
TRACE = "TRACE"
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export default HTTPMethod;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HTTPMethod = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* HTTP request methods.
|
|
6
|
+
*
|
|
7
|
+
* HTTP defines a set of request methods to indicate the desired action to be
|
|
8
|
+
* performed for a given resource. Although they can also be nouns, these
|
|
9
|
+
* request methods are sometimes referred as HTTP verbs. Each of them implements
|
|
10
|
+
* a different semantic, but some common features are shared by a group of them:
|
|
11
|
+
* e.g. a request method can be safe, idempotent, or cacheable.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
var HTTPMethod;
|
|
16
|
+
(function (HTTPMethod) {
|
|
17
|
+
/**
|
|
18
|
+
* The `CONNECT` method establishes a tunnel to the server identified by the
|
|
19
|
+
* target resource.
|
|
20
|
+
*/
|
|
21
|
+
HTTPMethod["CONNECT"] = "CONNECT";
|
|
22
|
+
/**
|
|
23
|
+
* The `DELETE` method deletes the specified resource.
|
|
24
|
+
*/
|
|
25
|
+
HTTPMethod["DELETE"] = "DELETE";
|
|
26
|
+
/**
|
|
27
|
+
* The `GET` method requests a representation of the specified resource.
|
|
28
|
+
* Requests using GET should only retrieve data.
|
|
29
|
+
*/
|
|
30
|
+
HTTPMethod["GET"] = "GET";
|
|
31
|
+
/**
|
|
32
|
+
* The `HEAD` method asks for a response identical to that of a GET request,
|
|
33
|
+
* but without the response body.
|
|
34
|
+
*/
|
|
35
|
+
HTTPMethod["HEAD"] = "HEAD";
|
|
36
|
+
/**
|
|
37
|
+
* The `OPTIONS` method is used to describe the communication options for the
|
|
38
|
+
* target resource.
|
|
39
|
+
*/
|
|
40
|
+
HTTPMethod["OPTIONS"] = "OPTIONS";
|
|
41
|
+
/**
|
|
42
|
+
* The PATCH method is used to apply partial modifications to a resource.
|
|
43
|
+
*/
|
|
44
|
+
HTTPMethod["PATCH"] = "PATCH";
|
|
45
|
+
/**
|
|
46
|
+
* The `POST` method is used to submit an entity to the specified resource,
|
|
47
|
+
* often causing a change in state or side effects on the server.
|
|
48
|
+
*/
|
|
49
|
+
HTTPMethod["POST"] = "POST";
|
|
50
|
+
/**
|
|
51
|
+
* The `PUT` method replaces all current representations of the target
|
|
52
|
+
* resource with the request payload.
|
|
53
|
+
*/
|
|
54
|
+
HTTPMethod["PUT"] = "PUT";
|
|
55
|
+
/**
|
|
56
|
+
* The `TRACE` method performs a message loop-back test along the path to the
|
|
57
|
+
* target resource.
|
|
58
|
+
*/
|
|
59
|
+
HTTPMethod["TRACE"] = "TRACE";
|
|
60
|
+
})(HTTPMethod || (exports.HTTPMethod = HTTPMethod = {}));
|
|
61
|
+
/**
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
exports.default = HTTPMethod;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './httpMethods';
|
|
@@ -0,0 +1,17 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./httpMethods"), exports);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
status: number;
|
|
5
|
-
}
|
|
6
|
-
type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE';
|
|
1
|
+
import { IApiResponse } from 'nextemos/interfaces/';
|
|
2
|
+
import { HTTPMethod as httpMethods } from 'nextemos/enums';
|
|
3
|
+
type HTTPMethod = httpMethods;
|
|
7
4
|
interface RequestOptions extends RequestInit {
|
|
8
5
|
url: string;
|
|
9
6
|
method: HTTPMethod;
|
|
@@ -14,9 +11,9 @@ interface RequestOptions extends RequestInit {
|
|
|
14
11
|
* @returns {object} HTTP client with methods for making requests.
|
|
15
12
|
*/
|
|
16
13
|
declare const fetchRequest: () => {
|
|
17
|
-
get: <T>(url: string, options?: Omit<RequestOptions, 'method'>) => Promise<
|
|
18
|
-
post: <T_1>(url: string, data: any, options?: Omit<RequestOptions, 'method'>) => Promise<
|
|
19
|
-
put: <T_2>(url: string, data: any, options?: Omit<RequestOptions, 'method'>) => Promise<
|
|
20
|
-
delete: <T_3>(url: string, options?: Omit<RequestOptions, 'method'>) => Promise<
|
|
14
|
+
get: <T>(url: string, options?: Omit<RequestOptions, 'method'>) => Promise<IApiResponse<T>>;
|
|
15
|
+
post: <T_1>(url: string, data: any, options?: Omit<RequestOptions, 'method'>) => Promise<IApiResponse<T_1>>;
|
|
16
|
+
put: <T_2>(url: string, data: any, options?: Omit<RequestOptions, 'method'>) => Promise<IApiResponse<T_2>>;
|
|
17
|
+
delete: <T_3>(url: string, options?: Omit<RequestOptions, 'method'>) => Promise<IApiResponse<T_3>>;
|
|
21
18
|
};
|
|
22
19
|
export default fetchRequest;
|
|
@@ -20,6 +20,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
// enums
|
|
24
|
+
const enums_1 = require("nextemos/enums");
|
|
23
25
|
/**
|
|
24
26
|
* Creates a HTTP client for making requests.
|
|
25
27
|
* @returns {object} HTTP client with methods for making requests.
|
|
@@ -29,7 +31,7 @@ const fetchRequest = () => {
|
|
|
29
31
|
* Makes an HTTP request using fetch.
|
|
30
32
|
* @template T
|
|
31
33
|
* @param {RequestOptions} options - Request options.
|
|
32
|
-
* @returns {Promise<
|
|
34
|
+
* @returns {Promise<IApiResponse<T>>} Response from the API.
|
|
33
35
|
*/
|
|
34
36
|
const request = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
37
|
var { url, method, params } = _a, requestOptions = __rest(_a, ["url", "method", "params"]);
|
|
@@ -57,10 +59,10 @@ const fetchRequest = () => {
|
|
|
57
59
|
* @template T
|
|
58
60
|
* @param {string} url - Endpoint URL.
|
|
59
61
|
* @param {RequestOptions} [options] - Request options.
|
|
60
|
-
* @returns {Promise<
|
|
62
|
+
* @returns {Promise<IApiResponse<T>>} Response from the API.
|
|
61
63
|
*/
|
|
62
64
|
const get = (url, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
return yield request(Object.assign(Object.assign({}, options), { method:
|
|
65
|
+
return yield request(Object.assign(Object.assign({}, options), { method: enums_1.HTTPMethod.GET, url }));
|
|
64
66
|
});
|
|
65
67
|
/**
|
|
66
68
|
* Makes a POST request.
|
|
@@ -68,10 +70,10 @@ const fetchRequest = () => {
|
|
|
68
70
|
* @param {string} url - Endpoint URL.
|
|
69
71
|
* @param {any} data - Request payload.
|
|
70
72
|
* @param {RequestOptions} [options] - Request options.
|
|
71
|
-
* @returns {Promise<
|
|
73
|
+
* @returns {Promise<IApiResponse<T>>} Response from the API.
|
|
72
74
|
*/
|
|
73
75
|
const post = (url, data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
-
return yield request(Object.assign(Object.assign({}, options), { method:
|
|
76
|
+
return yield request(Object.assign(Object.assign({}, options), { method: enums_1.HTTPMethod.POST, url, body: data }));
|
|
75
77
|
});
|
|
76
78
|
/**
|
|
77
79
|
* Makes a PUT request.
|
|
@@ -79,20 +81,20 @@ const fetchRequest = () => {
|
|
|
79
81
|
* @param {string} url - Endpoint URL.
|
|
80
82
|
* @param {any} data - Request payload.
|
|
81
83
|
* @param {RequestOptions} [options] - Request options.
|
|
82
|
-
* @returns {Promise<
|
|
84
|
+
* @returns {Promise<IApiResponse<T>>} Response from the API.
|
|
83
85
|
*/
|
|
84
86
|
const put = (url, data, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
-
return yield request(Object.assign(Object.assign({}, options), { method:
|
|
87
|
+
return yield request(Object.assign(Object.assign({}, options), { method: enums_1.HTTPMethod.PUT, url, body: data }));
|
|
86
88
|
});
|
|
87
89
|
/**
|
|
88
90
|
* Makes a DELETE request.
|
|
89
91
|
* @template T
|
|
90
92
|
* @param {string} url - Endpoint URL.
|
|
91
93
|
* @param {RequestOptions} [options] - Request options.
|
|
92
|
-
* @returns {Promise<
|
|
94
|
+
* @returns {Promise<IApiResponse<T>>} Response from the API.
|
|
93
95
|
*/
|
|
94
96
|
const remove = (url, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
95
|
-
return yield request(Object.assign(Object.assign({}, options), { method:
|
|
97
|
+
return yield request(Object.assign(Object.assign({}, options), { method: enums_1.HTTPMethod.DELETE, url }));
|
|
96
98
|
});
|
|
97
99
|
return {
|
|
98
100
|
get,
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./helpers"), exports);
|
|
18
18
|
__exportStar(require("./hooks"), exports);
|
|
19
19
|
__exportStar(require("./interfaces"), exports);
|
|
20
|
+
__exportStar(require("./enums"), exports);
|
|
21
|
+
__exportStar(require("./services"), exports);
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,64 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* APIResponse arayüzü, genel API yanıtlarını temsil eder.
|
|
3
|
+
*
|
|
4
|
+
* @template T - Döndürülen veri türü (varsayılan: any).
|
|
5
|
+
*/
|
|
6
|
+
export interface IApiResponse<T = any> {
|
|
7
|
+
/**
|
|
8
|
+
* API'den döndürülen veriler.
|
|
9
|
+
* Bu alan opsiyoneldir ve API çağrısı başarılı olduğunda kullanılır.
|
|
10
|
+
*/
|
|
11
|
+
data?: T;
|
|
12
|
+
/**
|
|
13
|
+
* API çağrısı sırasında meydana gelen hata mesajı.
|
|
14
|
+
* Bu alan opsiyoneldir ve API çağrısı başarısız olduğunda kullanılır.
|
|
15
|
+
*/
|
|
16
|
+
error?: string;
|
|
17
|
+
/**
|
|
18
|
+
* HTTP durum kodu.
|
|
19
|
+
* Bu alan, API çağrısının HTTP durum kodunu belirtir (ör. 200, 404, 500).
|
|
20
|
+
*/
|
|
21
|
+
status: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* IResponse arayüzü, bir API tarafından döndürülen standart yanıt nesnesinin yapısını temsil eder.
|
|
25
|
+
* Başarı durumu, ek mesajlar ve istemci tarafında yürütülecek betikler gibi çeşitli özellikler içerir.
|
|
4
26
|
*/
|
|
5
27
|
export interface IResponse {
|
|
6
28
|
/**
|
|
7
|
-
*
|
|
29
|
+
* API isteğinin başarılı olup olmadığını belirtir (true: başarılı, false: başarısız).
|
|
8
30
|
*/
|
|
9
31
|
isSuccess: boolean;
|
|
10
32
|
/**
|
|
11
|
-
*
|
|
33
|
+
* API yanıtının durum kodunu temsil eden bir dize. Bu, belirli başarı veya hata kodlarını iletmek için kullanılabilir.
|
|
12
34
|
*/
|
|
13
35
|
statusCode: string;
|
|
14
36
|
/**
|
|
15
|
-
*
|
|
37
|
+
* Yanıt hakkında ek bilgiler sağlayan bir mesaj. Bu, hata mesajları veya başarı teyitleri için kullanılabilir.
|
|
16
38
|
*/
|
|
17
39
|
message: string;
|
|
18
40
|
/**
|
|
19
|
-
*
|
|
41
|
+
* Yanıt işlendiğinde istemci tarafında yürütülecek bir betik. Bu, dinamik güncellemeler veya diğer amaçlar için JavaScript kodu olabilir.
|
|
20
42
|
*/
|
|
21
43
|
script: string;
|
|
22
44
|
/**
|
|
23
|
-
*
|
|
45
|
+
* HTML belgesinin <head> bölümüne eklenip yürütülecek bir betik. Bu, sayfa içeriğinden önce yüklenmesi gereken betikler için kullanışlıdır.
|
|
24
46
|
*/
|
|
25
47
|
headerScript: string;
|
|
26
48
|
/**
|
|
27
|
-
*
|
|
49
|
+
* HTML belgesinin sonunda, genellikle kapanış </body> etiketinden önce eklenip yürütülecek bir betik. Bu, DOM tamamen yüklendikten sonra çalışması gereken betikler için kullanışlıdır.
|
|
28
50
|
*/
|
|
29
51
|
footerScript: string;
|
|
30
52
|
/**
|
|
31
|
-
*
|
|
53
|
+
* Ortamın yenilenmesi gerekip gerekmediğini belirten bir dize. Bu, uygulamanın belirli bölümlerinin yeniden yüklenmesini veya sıfırlanmasını tetiklemek için kullanılabilir.
|
|
32
54
|
*/
|
|
33
55
|
refreshEnvironment: string;
|
|
34
56
|
/**
|
|
35
|
-
*
|
|
57
|
+
* Yanıtla ilişkilendirilen etiketleri temsil eden bir dize dizisi. Etiketler, kategorize etme, filtreleme veya diğer meta veri amaçları için kullanılabilir.
|
|
36
58
|
*/
|
|
37
59
|
tags: string[];
|
|
38
60
|
}
|
|
39
61
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
62
|
+
* IResponsePaging arayüzü, IResponse arayüzünü genişleterek sayfalanmış yanıtları işlemek için ek özellikler içerir.
|
|
63
|
+
* Bu, büyük veri kümelerinin birden fazla sayfaya yayıldığı yanıtlar için kullanışlıdır.
|
|
42
64
|
*/
|
|
43
65
|
export interface IResponsePaging extends IResponse {
|
|
44
66
|
/**
|
|
45
|
-
*
|
|
67
|
+
* Tüm sayfalardaki toplam öğe sayısı. Bu, veri kümesinin büyüklüğünü anlamak için kullanışlıdır.
|
|
46
68
|
*/
|
|
47
69
|
totalItems: number;
|
|
48
70
|
/**
|
|
49
|
-
*
|
|
71
|
+
* Mevcut yanıtta döndürülen öğe sayısı. Bu genellikle sayfa boyutuna veya onun bir alt kümesine karşılık gelir.
|
|
50
72
|
*/
|
|
51
73
|
taked: number;
|
|
52
74
|
/**
|
|
53
|
-
*
|
|
75
|
+
* Veri kümesinin başından itibaren atlanan öğe sayısı. Bu, mevcut sayfanın veri kümesindeki başlangıç noktasını belirlemek için kullanışlıdır.
|
|
54
76
|
*/
|
|
55
77
|
skipped: number;
|
|
56
78
|
/**
|
|
57
|
-
*
|
|
79
|
+
* Sayfa başına gösterilecek öğe sayısı. Bu, her sayfada gösterilen veri miktarını kontrol etmeye yardımcı olur.
|
|
58
80
|
*/
|
|
59
81
|
pageSize: number;
|
|
60
82
|
/**
|
|
61
|
-
*
|
|
83
|
+
* Görüntülenen mevcut sayfa numarası. Bu, sayfalı veri kümesinde gezinmeye yardımcı olur.
|
|
62
84
|
*/
|
|
63
85
|
currentPage: number;
|
|
64
86
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IApiResponse, IBannerResponse, IBannersResponse } from 'nextemos/interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* BannerService arayüzü, Banner ile ilgili API çağrılarını temsil eder.
|
|
4
|
+
* Banner ile ilgili çeşitli verileri almak için kullanılabilecek metotlar içerir.
|
|
5
|
+
*/
|
|
6
|
+
interface BannerService {
|
|
7
|
+
/**
|
|
8
|
+
* Belirli bir ID'ye sahip banner'ı getirir.
|
|
9
|
+
* @returns Belirli bir ID'ye sahip banner verilerini içeren bir API yanıtı.
|
|
10
|
+
*/
|
|
11
|
+
GetBannerById: () => Promise<IApiResponse<IBannerResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Belirli bir isme sahip banner'ı getirir.
|
|
14
|
+
* @returns Belirli bir isme sahip banner verilerini içeren bir API yanıtı.
|
|
15
|
+
*/
|
|
16
|
+
GetBannerByName: () => Promise<IApiResponse<IBannerResponse>>;
|
|
17
|
+
/**
|
|
18
|
+
* Belirli bir anahtara sahip banner'ı getirir.
|
|
19
|
+
* @returns Belirli bir anahtara sahip banner verilerini içeren bir API yanıtı.
|
|
20
|
+
*/
|
|
21
|
+
GetBannerByKey: () => Promise<IApiResponse<IBannerResponse>>;
|
|
22
|
+
/**
|
|
23
|
+
* Banner listesini getirir.
|
|
24
|
+
* @returns Banner listesini içeren bir API yanıtı.
|
|
25
|
+
*/
|
|
26
|
+
GetBannerList: () => Promise<IApiResponse<IBannersResponse>>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @constant Banner
|
|
30
|
+
* @description Banner ile ilgili hizmetleri sağlayan nesne. BannerService arayüzünü uygular.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Banner: BannerService;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Banner = void 0;
|
|
16
|
+
// URL'lerin bulunduğu dosyayı içe aktarır
|
|
17
|
+
const urls_1 = __importDefault(require("./urls"));
|
|
18
|
+
// Yardımcı fonksiyonları içe aktarır
|
|
19
|
+
const helpers_1 = require("nextemos/helpers");
|
|
20
|
+
/**
|
|
21
|
+
* @constant Banner
|
|
22
|
+
* @description Banner ile ilgili hizmetleri sağlayan nesne. BannerService arayüzünü uygular.
|
|
23
|
+
*/
|
|
24
|
+
exports.Banner = {
|
|
25
|
+
/**
|
|
26
|
+
* @method
|
|
27
|
+
* @description Belirli bir ID'ye sahip banner'ı getirir.
|
|
28
|
+
* @returns {Promise<IApiResponse<IBannerResponse>>} Belirli bir ID'ye sahip banner verilerini içeren bir API yanıtı.
|
|
29
|
+
*/
|
|
30
|
+
GetBannerById: () => __awaiter(void 0, void 0, void 0, function* () { return yield (0, helpers_1.fetchRequest)().get(urls_1.default.Banner.GetBannerById); }),
|
|
31
|
+
/**
|
|
32
|
+
* @method
|
|
33
|
+
* @description Belirli bir isme sahip banner'ı getirir.
|
|
34
|
+
* @returns {Promise<IApiResponse<IBannerResponse>>} Belirli bir isme sahip banner verilerini içeren bir API yanıtı.
|
|
35
|
+
*/
|
|
36
|
+
GetBannerByName: () => __awaiter(void 0, void 0, void 0, function* () { return yield (0, helpers_1.fetchRequest)().get(urls_1.default.Banner.GetBannerByName); }),
|
|
37
|
+
/**
|
|
38
|
+
* @method
|
|
39
|
+
* @description Belirli bir anahtara sahip banner'ı getirir.
|
|
40
|
+
* @returns {Promise<IApiResponse<IBannerResponse>>} Belirli bir anahtara sahip banner verilerini içeren bir API yanıtı.
|
|
41
|
+
*/
|
|
42
|
+
GetBannerByKey: () => __awaiter(void 0, void 0, void 0, function* () { return yield (0, helpers_1.fetchRequest)().get(urls_1.default.Banner.GetBannerByKey); }),
|
|
43
|
+
/**
|
|
44
|
+
* @method
|
|
45
|
+
* @description Banner listesini getirir.
|
|
46
|
+
* @returns {Promise<IApiResponse<IBannersResponse>>} Banner listesini içeren bir API yanıtı.
|
|
47
|
+
*/
|
|
48
|
+
GetBannerList: () => __awaiter(void 0, void 0, void 0, function* () { return yield (0, helpers_1.fetchRequest)().get(urls_1.default.Banner.GetBannerList); }),
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './banner';
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// services
|
|
18
|
+
__exportStar(require("./banner"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
Banner: {
|
|
5
|
+
GetBannerById: '/api/banner/{language}/Banner/v1/GetBannerById',
|
|
6
|
+
GetBannerByName: '/api/banner/{language}/Banner/v1/GetBannerByName',
|
|
7
|
+
GetBannerByKey: '/api/banner/{language}/Banner/v1/GetBannerByKey',
|
|
8
|
+
GetBannerList: '/api/banner/{language}/Banner/v1/GetBannerList',
|
|
9
|
+
GetBannerContainerList: '/api/banner/{language}/Banner/v1/GetBannerContainerList',
|
|
10
|
+
}
|
|
11
|
+
};
|