@arkyn/server 3.0.1-beta.12 → 3.0.1-beta.121
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/README.md +368 -65
- package/dist/bundle.js +1518 -0
- package/dist/bundle.umd.cjs +5 -0
- package/dist/{api/arkynLogRequest.d.ts → http/api/_logRequest.d.ts} +22 -19
- package/dist/{api/arkynLogRequest.d.ts.map → http/api/_logRequest.d.ts.map} +1 -1
- package/dist/http/api/_logRequest.js +88 -0
- package/dist/http/api/_makeRequest.d.ts +61 -0
- package/dist/http/api/_makeRequest.d.ts.map +1 -0
- package/dist/{api/makeRequest.js → http/api/_makeRequest.js} +33 -20
- package/dist/http/api/deleteRequest.d.ts +17 -0
- package/dist/http/api/deleteRequest.d.ts.map +1 -0
- package/dist/http/api/deleteRequest.js +18 -0
- package/dist/http/api/getRequest.d.ts +16 -0
- package/dist/http/api/getRequest.d.ts.map +1 -0
- package/dist/http/api/getRequest.js +17 -0
- package/dist/http/api/patchRequest.d.ts +17 -0
- package/dist/http/api/patchRequest.d.ts.map +1 -0
- package/dist/http/api/patchRequest.js +18 -0
- package/dist/http/api/postRequest.d.ts +17 -0
- package/dist/http/api/postRequest.d.ts.map +1 -0
- package/dist/http/api/postRequest.js +18 -0
- package/dist/http/api/putRequest.d.ts +17 -0
- package/dist/http/api/putRequest.d.ts.map +1 -0
- package/dist/http/api/putRequest.js +18 -0
- package/dist/http/badResponses/_badResponse.d.ts +22 -0
- package/dist/http/badResponses/_badResponse.d.ts.map +1 -0
- package/dist/http/badResponses/_badResponse.js +51 -0
- package/dist/http/badResponses/badGateway.d.ts +6 -9
- package/dist/http/badResponses/badGateway.d.ts.map +1 -1
- package/dist/http/badResponses/badGateway.js +12 -14
- package/dist/http/badResponses/badRequest.d.ts +6 -9
- package/dist/http/badResponses/badRequest.d.ts.map +1 -1
- package/dist/http/badResponses/badRequest.js +12 -14
- package/dist/http/badResponses/conflict.d.ts +6 -9
- package/dist/http/badResponses/conflict.d.ts.map +1 -1
- package/dist/http/badResponses/conflict.js +12 -14
- package/dist/http/badResponses/forbidden.d.ts +6 -9
- package/dist/http/badResponses/forbidden.d.ts.map +1 -1
- package/dist/http/badResponses/forbidden.js +12 -14
- package/dist/http/badResponses/notFound.d.ts +6 -9
- package/dist/http/badResponses/notFound.d.ts.map +1 -1
- package/dist/http/badResponses/notFound.js +12 -14
- package/dist/http/badResponses/notImplemented.d.ts +6 -9
- package/dist/http/badResponses/notImplemented.d.ts.map +1 -1
- package/dist/http/badResponses/notImplemented.js +12 -14
- package/dist/http/badResponses/serverError.d.ts +6 -9
- package/dist/http/badResponses/serverError.d.ts.map +1 -1
- package/dist/http/badResponses/serverError.js +12 -14
- package/dist/http/badResponses/unauthorized.d.ts +4 -7
- package/dist/http/badResponses/unauthorized.d.ts.map +1 -1
- package/dist/http/badResponses/unauthorized.js +10 -12
- package/dist/http/badResponses/unprocessableEntity.d.ts +15 -19
- package/dist/http/badResponses/unprocessableEntity.d.ts.map +1 -1
- package/dist/http/badResponses/unprocessableEntity.js +18 -21
- package/dist/http/successResponses/_successResponse.d.ts +33 -0
- package/dist/http/successResponses/_successResponse.d.ts.map +1 -0
- package/dist/http/successResponses/_successResponse.js +66 -0
- package/dist/http/successResponses/created.d.ts +9 -19
- package/dist/http/successResponses/created.d.ts.map +1 -1
- package/dist/http/successResponses/created.js +16 -25
- package/dist/http/successResponses/found.d.ts +10 -23
- package/dist/http/successResponses/found.d.ts.map +1 -1
- package/dist/http/successResponses/found.js +17 -29
- package/dist/http/successResponses/noContent.d.ts +6 -13
- package/dist/http/successResponses/noContent.d.ts.map +1 -1
- package/dist/http/successResponses/noContent.js +12 -17
- package/dist/http/successResponses/success.d.ts +9 -19
- package/dist/http/successResponses/success.d.ts.map +1 -1
- package/dist/http/successResponses/success.js +16 -25
- package/dist/http/successResponses/updated.d.ts +9 -19
- package/dist/http/successResponses/updated.d.ts.map +1 -1
- package/dist/http/successResponses/updated.js +16 -25
- package/dist/index.d.ts +19 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -13
- package/dist/services/apiService.d.ts +63 -0
- package/dist/services/apiService.d.ts.map +1 -0
- package/dist/services/apiService.js +158 -0
- package/dist/services/debugService.d.ts +69 -0
- package/dist/services/debugService.d.ts.map +1 -0
- package/dist/services/debugService.js +114 -0
- package/dist/services/logMapperService.d.ts +86 -0
- package/dist/services/logMapperService.d.ts.map +1 -0
- package/dist/services/logMapperService.js +68 -0
- package/dist/services/logService.d.ts +38 -0
- package/dist/services/logService.d.ts.map +1 -0
- package/dist/services/logService.js +40 -0
- package/dist/{services → utilities}/decodeRequestBody.d.ts +3 -4
- package/dist/utilities/decodeRequestBody.d.ts.map +1 -0
- package/dist/{services → utilities}/decodeRequestBody.js +5 -5
- package/dist/{services/decodeErrorMessageFromRequest.d.ts → utilities/decodeRequestErrorMessage.d.ts} +6 -6
- package/dist/utilities/decodeRequestErrorMessage.d.ts.map +1 -0
- package/dist/{services/decodeErrorMessageFromRequest.js → utilities/decodeRequestErrorMessage.js} +5 -5
- package/dist/utilities/errorHandler.d.ts +50 -0
- package/dist/utilities/errorHandler.d.ts.map +1 -0
- package/dist/{services → utilities}/errorHandler.js +34 -28
- package/dist/utilities/flushDebugLogs.d.ts +46 -0
- package/dist/utilities/flushDebugLogs.d.ts.map +1 -0
- package/dist/utilities/flushDebugLogs.js +59 -0
- package/dist/utilities/formAsyncParse.d.ts +59 -0
- package/dist/utilities/formAsyncParse.d.ts.map +1 -0
- package/dist/utilities/formAsyncParse.js +58 -0
- package/dist/{services → utilities}/formParse.d.ts +6 -6
- package/dist/utilities/formParse.d.ts.map +1 -0
- package/dist/{services → utilities}/formParse.js +10 -8
- package/dist/{services → utilities}/getScopedParams.d.ts +3 -4
- package/dist/utilities/getScopedParams.d.ts.map +1 -0
- package/dist/{services → utilities}/getScopedParams.js +4 -4
- package/dist/utilities/schemaValidator.d.ts +146 -0
- package/dist/utilities/schemaValidator.d.ts.map +1 -0
- package/dist/utilities/schemaValidator.js +191 -0
- package/dist/validations/validateCep.d.ts +19 -0
- package/dist/validations/validateCep.d.ts.map +1 -0
- package/dist/validations/validateCep.js +27 -0
- package/dist/validations/validateCnpj.d.ts +21 -0
- package/dist/validations/validateCnpj.d.ts.map +1 -0
- package/dist/validations/validateCnpj.js +59 -0
- package/dist/validations/validateCpf.d.ts +23 -0
- package/dist/validations/validateCpf.d.ts.map +1 -0
- package/dist/validations/validateCpf.js +61 -0
- package/dist/validations/validateDate.d.ts +27 -0
- package/dist/validations/validateDate.d.ts.map +1 -0
- package/dist/validations/validateDate.js +55 -0
- package/dist/validations/validateEmail.d.ts +21 -0
- package/dist/validations/validateEmail.d.ts.map +1 -0
- package/dist/validations/validateEmail.js +111 -0
- package/dist/validations/validatePassword.d.ts +20 -0
- package/dist/validations/validatePassword.d.ts.map +1 -0
- package/dist/validations/validatePassword.js +34 -0
- package/dist/validations/validatePhone.d.ts +28 -0
- package/dist/validations/validatePhone.d.ts.map +1 -0
- package/dist/validations/validatePhone.js +44 -0
- package/dist/validations/validateRg.d.ts +21 -0
- package/dist/validations/validateRg.d.ts.map +1 -0
- package/dist/validations/validateRg.js +31 -0
- package/package.json +34 -18
- package/dist/api/arkynLogRequest.js +0 -82
- package/dist/api/deleteRequest.d.ts +0 -13
- package/dist/api/deleteRequest.d.ts.map +0 -1
- package/dist/api/deleteRequest.js +0 -14
- package/dist/api/getRequest.d.ts +0 -12
- package/dist/api/getRequest.d.ts.map +0 -1
- package/dist/api/getRequest.js +0 -13
- package/dist/api/makeRequest.d.ts +0 -38
- package/dist/api/makeRequest.d.ts.map +0 -1
- package/dist/api/patchRequest.d.ts +0 -13
- package/dist/api/patchRequest.d.ts.map +0 -1
- package/dist/api/patchRequest.js +0 -14
- package/dist/api/postRequest.d.ts +0 -13
- package/dist/api/postRequest.d.ts.map +0 -1
- package/dist/api/postRequest.js +0 -14
- package/dist/api/putRequest.d.ts +0 -13
- package/dist/api/putRequest.d.ts.map +0 -1
- package/dist/api/putRequest.js +0 -14
- package/dist/config/apiInstance.d.ts +0 -80
- package/dist/config/apiInstance.d.ts.map +0 -1
- package/dist/config/apiInstance.js +0 -111
- package/dist/config/arkynLogInstance.d.ts +0 -44
- package/dist/config/arkynLogInstance.d.ts.map +0 -1
- package/dist/config/arkynLogInstance.js +0 -49
- package/dist/mapper/arkynLogRequestMapper.d.ts +0 -30
- package/dist/mapper/arkynLogRequestMapper.d.ts.map +0 -1
- package/dist/mapper/arkynLogRequestMapper.js +0 -44
- package/dist/services/decodeErrorMessageFromRequest.d.ts.map +0 -1
- package/dist/services/decodeRequestBody.d.ts.map +0 -1
- package/dist/services/errorHandler.d.ts +0 -44
- package/dist/services/errorHandler.d.ts.map +0 -1
- package/dist/services/formParse.d.ts.map +0 -1
- package/dist/services/getCaller.d.ts +0 -17
- package/dist/services/getCaller.d.ts.map +0 -1
- package/dist/services/getCaller.js +0 -65
- package/dist/services/getScopedParams.d.ts.map +0 -1
- package/dist/services/httpDebug.d.ts +0 -35
- package/dist/services/httpDebug.d.ts.map +0 -1
- package/dist/services/httpDebug.js +0 -52
- package/dist/services/measureRouteExecution.d.ts +0 -3
- package/dist/services/measureRouteExecution.d.ts.map +0 -1
- package/dist/services/measureRouteExecution.js +0 -24
- package/dist/services/schemaValidator.d.ts +0 -13
- package/dist/services/schemaValidator.d.ts.map +0 -1
- package/dist/services/schemaValidator.js +0 -51
- package/dist/types/ApiResponseDTO.d.ts +0 -17
- package/dist/types/ApiResponseDTO.d.ts.map +0 -1
- package/dist/types/ApiResponseDTO.js +0 -1
- package/src/api/arkynLogRequest.ts +0 -118
- package/src/api/deleteRequest.ts +0 -22
- package/src/api/getRequest.ts +0 -20
- package/src/api/makeRequest.ts +0 -118
- package/src/api/patchRequest.ts +0 -22
- package/src/api/postRequest.ts +0 -22
- package/src/api/putRequest.ts +0 -22
- package/src/config/apiInstance.ts +0 -148
- package/src/config/arkynLogInstance.ts +0 -70
- package/src/http/badResponses/badGateway.ts +0 -63
- package/src/http/badResponses/badRequest.ts +0 -63
- package/src/http/badResponses/conflict.ts +0 -63
- package/src/http/badResponses/forbidden.ts +0 -63
- package/src/http/badResponses/notFound.ts +0 -63
- package/src/http/badResponses/notImplemented.ts +0 -63
- package/src/http/badResponses/serverError.ts +0 -63
- package/src/http/badResponses/unauthorized.ts +0 -63
- package/src/http/badResponses/unprocessableEntity.ts +0 -79
- package/src/http/successResponses/created.ts +0 -64
- package/src/http/successResponses/found.ts +0 -67
- package/src/http/successResponses/noContent.ts +0 -42
- package/src/http/successResponses/success.ts +0 -64
- package/src/http/successResponses/updated.ts +0 -64
- package/src/index.ts +0 -31
- package/src/mapper/arkynLogRequestMapper.ts +0 -73
- package/src/services/decodeErrorMessageFromRequest.ts +0 -36
- package/src/services/decodeRequestBody.ts +0 -43
- package/src/services/errorHandler.ts +0 -99
- package/src/services/formParse.ts +0 -83
- package/src/services/getCaller.ts +0 -82
- package/src/services/getScopedParams.ts +0 -43
- package/src/services/httpDebug.ts +0 -61
- package/src/services/measureRouteExecution.ts +0 -31
- package/src/services/schemaValidator.ts +0 -66
- package/src/types/ApiResponseDTO.ts +0 -19
- package/tsconfig.json +0 -21
- package/vitest.config.ts +0 -5
|
@@ -1,37 +1,24 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to create a standardized HTTP response with a status of 302 (Found),
|
|
4
|
-
* including optional headers and a response body.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type of the response body.
|
|
3
|
+
* Class representing a successful HTTP 302 Found response.
|
|
7
4
|
*/
|
|
8
|
-
declare class Found
|
|
9
|
-
body: T;
|
|
10
|
-
headers: ResponseInit["headers"];
|
|
11
|
-
status: number;
|
|
12
|
-
statusText: string;
|
|
5
|
+
declare class Found extends SuccessResponse {
|
|
13
6
|
/**
|
|
14
7
|
* Creates an instance of the `Found` class.
|
|
15
8
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* - `headers`: Additional headers to include in the response.
|
|
19
|
-
* - `status`: HTTP status code (default is 302).
|
|
20
|
-
* - `statusText`: HTTP status text (default is "Found").
|
|
9
|
+
* @param {string} message - A message describing the creation status.
|
|
10
|
+
* @param {any} body - The response body to be included in the HTTP response.
|
|
21
11
|
*/
|
|
22
|
-
constructor(
|
|
12
|
+
constructor(message: string, body?: any);
|
|
23
13
|
/**
|
|
24
14
|
* Converts the `Found` instance into a `Response` object.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @returns A `Response` object with the serialized JSON body and the specified headers, status, and statusText.
|
|
15
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
28
16
|
*/
|
|
29
17
|
toResponse(): Response;
|
|
30
18
|
/**
|
|
31
|
-
* Converts the `Found` instance into a
|
|
32
|
-
* This method is an alternative to `toResponse` for
|
|
33
|
-
*
|
|
34
|
-
* @returns A `Response` object with the JSON body and the specified headers, status, and statusText.
|
|
19
|
+
* Converts the `Found` instance into a `Response` object using the `Response.json` method.
|
|
20
|
+
* This method is an alternative to `toResponse` for generating JSON responses.
|
|
21
|
+
* @returns {Response["json"]} A `Response` object with the JSON body and response metadata.
|
|
35
22
|
*/
|
|
36
23
|
toJson(): Response;
|
|
37
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"found.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/found.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"found.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/found.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AAEH,cAAM,KAAM,SAAQ,eAAe;IACjC;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;IAWvC;;;OAGG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;OAIG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,53 +1,41 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to create a standardized HTTP response with a status of 302 (Found),
|
|
4
|
-
* including optional headers and a response body.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type of the response body.
|
|
3
|
+
* Class representing a successful HTTP 302 Found response.
|
|
7
4
|
*/
|
|
8
|
-
class Found {
|
|
9
|
-
body;
|
|
10
|
-
headers;
|
|
11
|
-
status;
|
|
12
|
-
statusText;
|
|
5
|
+
class Found extends SuccessResponse {
|
|
13
6
|
/**
|
|
14
7
|
* Creates an instance of the `Found` class.
|
|
15
8
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* - `headers`: Additional headers to include in the response.
|
|
19
|
-
* - `status`: HTTP status code (default is 302).
|
|
20
|
-
* - `statusText`: HTTP status text (default is "Found").
|
|
9
|
+
* @param {string} message - A message describing the creation status.
|
|
10
|
+
* @param {any} body - The response body to be included in the HTTP response.
|
|
21
11
|
*/
|
|
22
|
-
constructor(
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
this.status =
|
|
26
|
-
this.statusText =
|
|
12
|
+
constructor(message, body) {
|
|
13
|
+
super();
|
|
14
|
+
this.name = "Found";
|
|
15
|
+
this.status = 302;
|
|
16
|
+
this.statusText = message;
|
|
17
|
+
this.body = body || undefined;
|
|
18
|
+
this.onDebug();
|
|
27
19
|
}
|
|
28
20
|
/**
|
|
29
21
|
* Converts the `Found` instance into a `Response` object.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @returns A `Response` object with the serialized JSON body and the specified headers, status, and statusText.
|
|
22
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
33
23
|
*/
|
|
34
24
|
toResponse() {
|
|
35
25
|
const responseInit = {
|
|
36
|
-
headers: { "Content-Type": "application/json"
|
|
26
|
+
headers: { "Content-Type": "application/json" },
|
|
37
27
|
status: this.status,
|
|
38
28
|
statusText: this.statusText,
|
|
39
29
|
};
|
|
40
30
|
return new Response(JSON.stringify(this.body), responseInit);
|
|
41
31
|
}
|
|
42
32
|
/**
|
|
43
|
-
* Converts the `Found` instance into a
|
|
44
|
-
* This method is an alternative to `toResponse` for
|
|
45
|
-
*
|
|
46
|
-
* @returns A `Response` object with the JSON body and the specified headers, status, and statusText.
|
|
33
|
+
* Converts the `Found` instance into a `Response` object using the `Response.json` method.
|
|
34
|
+
* This method is an alternative to `toResponse` for generating JSON responses.
|
|
35
|
+
* @returns {Response["json"]} A `Response` object with the JSON body and response metadata.
|
|
47
36
|
*/
|
|
48
37
|
toJson() {
|
|
49
38
|
const responseInit = {
|
|
50
|
-
headers: this.headers,
|
|
51
39
|
status: this.status,
|
|
52
40
|
statusText: this.statusText,
|
|
53
41
|
};
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to standardize the structure of a "No Content" response,
|
|
4
|
-
* including headers, status, and status text.
|
|
3
|
+
* Class representing a successful HTTP 204 NoContent response.
|
|
5
4
|
*/
|
|
6
|
-
declare class NoContent {
|
|
7
|
-
headers: ResponseInit["headers"];
|
|
8
|
-
status: number;
|
|
9
|
-
statusText: string;
|
|
5
|
+
declare class NoContent extends SuccessResponse {
|
|
10
6
|
/**
|
|
11
7
|
* Creates an instance of the `NoContent` class.
|
|
12
|
-
*
|
|
13
|
-
* @param init - Optional initialization object for customizing headers, status, and status text.
|
|
8
|
+
* @param {string} message - A message describing the creation status.
|
|
14
9
|
*/
|
|
15
|
-
constructor(
|
|
10
|
+
constructor(message: string);
|
|
16
11
|
/**
|
|
17
12
|
* Converts the `NoContent` instance into a `Response` object.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @returns A `Response` object with no body and response metadata.
|
|
13
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
21
14
|
*/
|
|
22
15
|
toResponse(): Response;
|
|
23
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/noContent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/noContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AAEH,cAAM,SAAU,SAAQ,eAAe;IACrC;;;OAGG;gBAES,OAAO,EAAE,MAAM;IAU3B;;;OAGG;IAEH,UAAU,IAAI,QAAQ;CASvB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to standardize the structure of a "No Content" response,
|
|
4
|
-
* including headers, status, and status text.
|
|
3
|
+
* Class representing a successful HTTP 204 NoContent response.
|
|
5
4
|
*/
|
|
6
|
-
class NoContent {
|
|
7
|
-
headers;
|
|
8
|
-
status;
|
|
9
|
-
statusText;
|
|
5
|
+
class NoContent extends SuccessResponse {
|
|
10
6
|
/**
|
|
11
7
|
* Creates an instance of the `NoContent` class.
|
|
12
|
-
*
|
|
13
|
-
* @param init - Optional initialization object for customizing headers, status, and status text.
|
|
8
|
+
* @param {string} message - A message describing the creation status.
|
|
14
9
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super();
|
|
12
|
+
this.name = "NoContent";
|
|
13
|
+
this.status = 204;
|
|
14
|
+
this.statusText = message;
|
|
15
|
+
this.onDebug();
|
|
19
16
|
}
|
|
20
17
|
/**
|
|
21
18
|
* Converts the `NoContent` instance into a `Response` object.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @returns A `Response` object with no body and response metadata.
|
|
19
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
25
20
|
*/
|
|
26
21
|
toResponse() {
|
|
27
22
|
const responseInit = {
|
|
28
|
-
headers:
|
|
23
|
+
headers: { "Content-Type": "application/json" },
|
|
29
24
|
status: this.status,
|
|
30
25
|
statusText: this.statusText,
|
|
31
26
|
};
|
|
@@ -1,34 +1,24 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to standardize the structure of a "Success" response,
|
|
4
|
-
* including the response body, headers, status, and status text.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type of the response body.
|
|
3
|
+
* Class representing a successful HTTP 200 Success response.
|
|
7
4
|
*/
|
|
8
|
-
declare class Success
|
|
9
|
-
body: T;
|
|
10
|
-
headers: ResponseInit["headers"];
|
|
11
|
-
status: number;
|
|
12
|
-
statusText: string;
|
|
5
|
+
declare class Success extends SuccessResponse {
|
|
13
6
|
/**
|
|
14
7
|
* Creates an instance of the `Success` class.
|
|
15
8
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
9
|
+
* @param {string} message - A message describing the creation status.
|
|
10
|
+
* @param {any} body - The response body to be included in the HTTP response.
|
|
18
11
|
*/
|
|
19
|
-
constructor(
|
|
12
|
+
constructor(message: string, body?: any);
|
|
20
13
|
/**
|
|
21
|
-
* Converts the `Success` instance into a `Response` object
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @returns A `Response` object with the serialized JSON body and response metadata.
|
|
14
|
+
* Converts the `Success` instance into a `Response` object.
|
|
15
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
25
16
|
*/
|
|
26
17
|
toResponse(): Response;
|
|
27
18
|
/**
|
|
28
19
|
* Converts the `Success` instance into a `Response` object using the `Response.json` method.
|
|
29
20
|
* This method is an alternative to `toResponse` for generating JSON responses.
|
|
30
|
-
*
|
|
31
|
-
* @returns A `Response` object with the JSON body and response metadata.
|
|
21
|
+
* @returns {Response["json"]} A `Response` object with the JSON body and response metadata.
|
|
32
22
|
*/
|
|
33
23
|
toJson(): Response;
|
|
34
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/success.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/success.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AAEH,cAAM,OAAQ,SAAQ,eAAe;IACnC;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;IAWvC;;;OAGG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;OAIG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,36 +1,29 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to standardize the structure of a "Success" response,
|
|
4
|
-
* including the response body, headers, status, and status text.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type of the response body.
|
|
3
|
+
* Class representing a successful HTTP 200 Success response.
|
|
7
4
|
*/
|
|
8
|
-
class Success {
|
|
9
|
-
body;
|
|
10
|
-
headers;
|
|
11
|
-
status;
|
|
12
|
-
statusText;
|
|
5
|
+
class Success extends SuccessResponse {
|
|
13
6
|
/**
|
|
14
7
|
* Creates an instance of the `Success` class.
|
|
15
8
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
9
|
+
* @param {string} message - A message describing the creation status.
|
|
10
|
+
* @param {any} body - The response body to be included in the HTTP response.
|
|
18
11
|
*/
|
|
19
|
-
constructor(
|
|
20
|
-
|
|
21
|
-
this.
|
|
22
|
-
this.status =
|
|
23
|
-
this.statusText =
|
|
12
|
+
constructor(message, body) {
|
|
13
|
+
super();
|
|
14
|
+
this.name = "Success";
|
|
15
|
+
this.status = 200;
|
|
16
|
+
this.statusText = message;
|
|
17
|
+
this.body = body || undefined;
|
|
18
|
+
this.onDebug();
|
|
24
19
|
}
|
|
25
20
|
/**
|
|
26
|
-
* Converts the `Success` instance into a `Response` object
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @returns A `Response` object with the serialized JSON body and response metadata.
|
|
21
|
+
* Converts the `Success` instance into a `Response` object.
|
|
22
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
30
23
|
*/
|
|
31
24
|
toResponse() {
|
|
32
25
|
const responseInit = {
|
|
33
|
-
headers: { "Content-Type": "application/json"
|
|
26
|
+
headers: { "Content-Type": "application/json" },
|
|
34
27
|
status: this.status,
|
|
35
28
|
statusText: this.statusText,
|
|
36
29
|
};
|
|
@@ -39,12 +32,10 @@ class Success {
|
|
|
39
32
|
/**
|
|
40
33
|
* Converts the `Success` instance into a `Response` object using the `Response.json` method.
|
|
41
34
|
* This method is an alternative to `toResponse` for generating JSON responses.
|
|
42
|
-
*
|
|
43
|
-
* @returns A `Response` object with the JSON body and response metadata.
|
|
35
|
+
* @returns {Response["json"]} A `Response` object with the JSON body and response metadata.
|
|
44
36
|
*/
|
|
45
37
|
toJson() {
|
|
46
38
|
const responseInit = {
|
|
47
|
-
headers: this.headers,
|
|
48
39
|
status: this.status,
|
|
49
40
|
statusText: this.statusText,
|
|
50
41
|
};
|
|
@@ -1,34 +1,24 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to standardize the structure of an "Updated" response,
|
|
4
|
-
* including the response body, headers, status, and status text.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type of the response body.
|
|
3
|
+
* Class representing a successful HTTP 200 Updated response.
|
|
7
4
|
*/
|
|
8
|
-
declare class Updated
|
|
9
|
-
body: T;
|
|
10
|
-
headers: ResponseInit["headers"];
|
|
11
|
-
status: number;
|
|
12
|
-
statusText: string;
|
|
5
|
+
declare class Updated extends SuccessResponse {
|
|
13
6
|
/**
|
|
14
7
|
* Creates an instance of the `Updated` class.
|
|
15
8
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
9
|
+
* @param {string} message - A message describing the creation status.
|
|
10
|
+
* @param {any} body - The response body to be included in the HTTP response.
|
|
18
11
|
*/
|
|
19
|
-
constructor(
|
|
12
|
+
constructor(message: string, body?: any);
|
|
20
13
|
/**
|
|
21
|
-
* Converts the `Updated` instance into a `Response` object
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @returns A `Response` object with the serialized JSON body and response metadata.
|
|
14
|
+
* Converts the `Updated` instance into a `Response` object.
|
|
15
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
25
16
|
*/
|
|
26
17
|
toResponse(): Response;
|
|
27
18
|
/**
|
|
28
19
|
* Converts the `Updated` instance into a `Response` object using the `Response.json` method.
|
|
29
20
|
* This method is an alternative to `toResponse` for generating JSON responses.
|
|
30
|
-
*
|
|
31
|
-
* @returns A `Response` object with the JSON body and response metadata.
|
|
21
|
+
* @returns {Response["json"]} A `Response` object with the JSON body and response metadata.
|
|
32
22
|
*/
|
|
33
23
|
toJson(): Response;
|
|
34
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/updated.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AAEH,cAAM,OAAQ,SAAQ,eAAe;IACnC;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;IAWvC;;;OAGG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;OAIG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,36 +1,29 @@
|
|
|
1
|
+
import { SuccessResponse } from "./_successResponse";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* This class is used to standardize the structure of an "Updated" response,
|
|
4
|
-
* including the response body, headers, status, and status text.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type of the response body.
|
|
3
|
+
* Class representing a successful HTTP 200 Updated response.
|
|
7
4
|
*/
|
|
8
|
-
class Updated {
|
|
9
|
-
body;
|
|
10
|
-
headers;
|
|
11
|
-
status;
|
|
12
|
-
statusText;
|
|
5
|
+
class Updated extends SuccessResponse {
|
|
13
6
|
/**
|
|
14
7
|
* Creates an instance of the `Updated` class.
|
|
15
8
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
9
|
+
* @param {string} message - A message describing the creation status.
|
|
10
|
+
* @param {any} body - The response body to be included in the HTTP response.
|
|
18
11
|
*/
|
|
19
|
-
constructor(
|
|
20
|
-
|
|
21
|
-
this.
|
|
22
|
-
this.status =
|
|
23
|
-
this.statusText =
|
|
12
|
+
constructor(message, body) {
|
|
13
|
+
super();
|
|
14
|
+
this.name = "Updated";
|
|
15
|
+
this.status = 200;
|
|
16
|
+
this.statusText = message;
|
|
17
|
+
this.body = body || undefined;
|
|
18
|
+
this.onDebug();
|
|
24
19
|
}
|
|
25
20
|
/**
|
|
26
|
-
* Converts the `Updated` instance into a `Response` object
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @returns A `Response` object with the serialized JSON body and response metadata.
|
|
21
|
+
* Converts the `Updated` instance into a `Response` object.
|
|
22
|
+
* @returns {Response} A `Response` object with the body and response metadata.
|
|
30
23
|
*/
|
|
31
24
|
toResponse() {
|
|
32
25
|
const responseInit = {
|
|
33
|
-
headers: { "Content-Type": "application/json"
|
|
26
|
+
headers: { "Content-Type": "application/json" },
|
|
34
27
|
status: this.status,
|
|
35
28
|
statusText: this.statusText,
|
|
36
29
|
};
|
|
@@ -39,12 +32,10 @@ class Updated {
|
|
|
39
32
|
/**
|
|
40
33
|
* Converts the `Updated` instance into a `Response` object using the `Response.json` method.
|
|
41
34
|
* This method is an alternative to `toResponse` for generating JSON responses.
|
|
42
|
-
*
|
|
43
|
-
* @returns A `Response` object with the JSON body and response metadata.
|
|
35
|
+
* @returns {Response["json"]} A `Response` object with the JSON body and response metadata.
|
|
44
36
|
*/
|
|
45
37
|
toJson() {
|
|
46
38
|
const responseInit = {
|
|
47
|
-
headers: this.headers,
|
|
48
39
|
status: this.status,
|
|
49
40
|
statusText: this.statusText,
|
|
50
41
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { ApiInstance } from "./config/apiInstance";
|
|
2
|
-
export { ArkynLogInstance } from "./config/arkynLogInstance";
|
|
3
1
|
export { BadGateway } from "./http/badResponses/badGateway";
|
|
4
2
|
export { BadRequest } from "./http/badResponses/badRequest";
|
|
5
3
|
export { Conflict } from "./http/badResponses/conflict";
|
|
@@ -14,12 +12,23 @@ export { Found } from "./http/successResponses/found";
|
|
|
14
12
|
export { NoContent } from "./http/successResponses/noContent";
|
|
15
13
|
export { Success } from "./http/successResponses/success";
|
|
16
14
|
export { Updated } from "./http/successResponses/updated";
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
15
|
+
export { ApiService } from "./services/apiService";
|
|
16
|
+
export { DebugService } from "./services/debugService";
|
|
17
|
+
export { LogService } from "./services/logService";
|
|
18
|
+
export { decodeRequestBody } from "./utilities/decodeRequestBody";
|
|
19
|
+
export { decodeRequestErrorMessage } from "./utilities/decodeRequestErrorMessage";
|
|
20
|
+
export { errorHandler } from "./utilities/errorHandler";
|
|
21
|
+
export { flushDebugLogs } from "./utilities/flushDebugLogs";
|
|
22
|
+
export { formAsyncParse } from "./utilities/formAsyncParse";
|
|
23
|
+
export { formParse } from "./utilities/formParse";
|
|
24
|
+
export { getScopedParams } from "./utilities/getScopedParams";
|
|
25
|
+
export { SchemaValidator } from "./utilities/schemaValidator";
|
|
26
|
+
export { validateCep } from "./validations/validateCep";
|
|
27
|
+
export { validateCnpj } from "./validations/validateCnpj";
|
|
28
|
+
export { validateCpf } from "./validations/validateCpf";
|
|
29
|
+
export { validateDate } from "./validations/validateDate";
|
|
30
|
+
export { validateEmail } from "./validations/validateEmail";
|
|
31
|
+
export { validatePassword } from "./validations/validatePassword";
|
|
32
|
+
export { validatePhone } from "./validations/validatePhone";
|
|
33
|
+
export { validateRg } from "./validations/validateRg";
|
|
25
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
export { ApiInstance } from "./config/apiInstance";
|
|
3
|
-
export { ArkynLogInstance } from "./config/arkynLogInstance";
|
|
4
|
-
// http bad responses
|
|
1
|
+
// http
|
|
5
2
|
export { BadGateway } from "./http/badResponses/badGateway";
|
|
6
3
|
export { BadRequest } from "./http/badResponses/badRequest";
|
|
7
4
|
export { Conflict } from "./http/badResponses/conflict";
|
|
@@ -11,18 +8,30 @@ export { NotImplemented } from "./http/badResponses/notImplemented";
|
|
|
11
8
|
export { ServerError } from "./http/badResponses/serverError";
|
|
12
9
|
export { Unauthorized } from "./http/badResponses/unauthorized";
|
|
13
10
|
export { UnprocessableEntity } from "./http/badResponses/unprocessableEntity";
|
|
14
|
-
// http success responses
|
|
15
11
|
export { Created } from "./http/successResponses/created";
|
|
16
12
|
export { Found } from "./http/successResponses/found";
|
|
17
13
|
export { NoContent } from "./http/successResponses/noContent";
|
|
18
14
|
export { Success } from "./http/successResponses/success";
|
|
19
15
|
export { Updated } from "./http/successResponses/updated";
|
|
20
16
|
// services
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
17
|
+
export { ApiService } from "./services/apiService";
|
|
18
|
+
export { DebugService } from "./services/debugService";
|
|
19
|
+
export { LogService } from "./services/logService";
|
|
20
|
+
// utilities
|
|
21
|
+
export { decodeRequestBody } from "./utilities/decodeRequestBody";
|
|
22
|
+
export { decodeRequestErrorMessage } from "./utilities/decodeRequestErrorMessage";
|
|
23
|
+
export { errorHandler } from "./utilities/errorHandler";
|
|
24
|
+
export { flushDebugLogs } from "./utilities/flushDebugLogs";
|
|
25
|
+
export { formAsyncParse } from "./utilities/formAsyncParse";
|
|
26
|
+
export { formParse } from "./utilities/formParse";
|
|
27
|
+
export { getScopedParams } from "./utilities/getScopedParams";
|
|
28
|
+
export { SchemaValidator } from "./utilities/schemaValidator";
|
|
29
|
+
// validates
|
|
30
|
+
export { validateCep } from "./validations/validateCep";
|
|
31
|
+
export { validateCnpj } from "./validations/validateCnpj";
|
|
32
|
+
export { validateCpf } from "./validations/validateCpf";
|
|
33
|
+
export { validateDate } from "./validations/validateDate";
|
|
34
|
+
export { validateEmail } from "./validations/validateEmail";
|
|
35
|
+
export { validatePassword } from "./validations/validatePassword";
|
|
36
|
+
export { validatePhone } from "./validations/validatePhone";
|
|
37
|
+
export { validateRg } from "./validations/validateRg";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
type ApiServiceConstructorProps = {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
baseHeaders?: HeadersInit;
|
|
4
|
+
baseToken?: string | null;
|
|
5
|
+
enableDebug?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type ApiRequestDataWithoutBodyProps = {
|
|
8
|
+
headers?: HeadersInit;
|
|
9
|
+
token?: string;
|
|
10
|
+
urlParams?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
type ApiRequestDataWithBodyProps = {
|
|
13
|
+
body?: any;
|
|
14
|
+
headers?: HeadersInit;
|
|
15
|
+
token?: string;
|
|
16
|
+
urlParams?: Record<string, string>;
|
|
17
|
+
};
|
|
18
|
+
declare class ApiService {
|
|
19
|
+
private baseUrl;
|
|
20
|
+
private baseHeaders?;
|
|
21
|
+
private baseToken?;
|
|
22
|
+
private enableDebug?;
|
|
23
|
+
constructor(props: ApiServiceConstructorProps);
|
|
24
|
+
private onDebug;
|
|
25
|
+
private generateHeaders;
|
|
26
|
+
/**
|
|
27
|
+
* Sends a get request to the specified endpoint.
|
|
28
|
+
* @param endpoint - The API endpoint to send the get request to.
|
|
29
|
+
* @param data - The request data, including optional headers and token.
|
|
30
|
+
* @returns The API response data.
|
|
31
|
+
*/
|
|
32
|
+
get(endpoint: string, data?: ApiRequestDataWithoutBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
|
|
33
|
+
/**
|
|
34
|
+
* Sends a post request to the specified endpoint.
|
|
35
|
+
* @param endpoint - The API endpoint to send the post request to.
|
|
36
|
+
* @param data - The request data, including body, optional headers, and token.
|
|
37
|
+
* @returns The API response data.
|
|
38
|
+
*/
|
|
39
|
+
post(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
|
|
40
|
+
/**
|
|
41
|
+
* Sends a put request to the specified endpoint.
|
|
42
|
+
* @param endpoint - The API endpoint to send the put request to.
|
|
43
|
+
* @param data - The request data, including body, optional headers, and token.
|
|
44
|
+
* @returns The API response data.
|
|
45
|
+
*/
|
|
46
|
+
put(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
|
|
47
|
+
/**
|
|
48
|
+
* Sends a patch request to the specified endpoint.
|
|
49
|
+
* @param endpoint - The API endpoint to send the patch request to.
|
|
50
|
+
* @param data - The request data, including body, optional headers, and token.
|
|
51
|
+
* @returns The API response data.
|
|
52
|
+
*/
|
|
53
|
+
patch(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
|
|
54
|
+
/**
|
|
55
|
+
* Sends a delete request to the specified endpoint.
|
|
56
|
+
* @param endpoint - The API endpoint to send the delete request to.
|
|
57
|
+
* @param data - The request data, including body, optional headers, and token.
|
|
58
|
+
* @returns The API response data.
|
|
59
|
+
*/
|
|
60
|
+
delete(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
|
|
61
|
+
}
|
|
62
|
+
export { ApiService };
|
|
63
|
+
//# sourceMappingURL=apiService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiService.d.ts","sourceRoot":"","sources":["../../src/services/apiService.ts"],"names":[],"mappings":"AAOA,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AASF,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAC,CAAU;gBAElB,KAAK,EAAE,0BAA0B;IAO7C,OAAO,CAAC,OAAO;IAiBf,OAAO,CAAC,eAAe;IAcvB;;;;;OAKG;IAEG,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,8BAA8B;IAkBjE;;;;;OAKG;IAEG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAqB/D;;;;;OAKG;IAEG,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAqB9D;;;;;OAKG;IAEG,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAqBhE;;;;;OAKG;IAEG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;CAoBlE;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|