c2-http 1.0.6 → 1.0.8
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/index.d.ts +5 -0
- package/dist/index.js +8 -53
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Controller, HttpDispatchDownload, HttpDispatchHandling } from "./model/Controller";
|
|
2
|
+
import { CrudController } from "./model/CrudController";
|
|
3
|
+
import { IControllerOptions } from "./model/IControllerOptions";
|
|
4
|
+
import { ICrudControllerOptions } from "./model/ICrudControllerOptions";
|
|
5
|
+
export { Controller, IControllerOptions, CrudController, ICrudControllerOptions, HttpDispatchHandling, HttpDispatchDownload };
|
package/dist/index.js
CHANGED
|
@@ -1,54 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// const originalMethod = descriptor.value;
|
|
11
|
-
// descriptor.value = async function (...args: any) {
|
|
12
|
-
// const response = args[1];
|
|
13
|
-
// try {
|
|
14
|
-
// const returnHttp = await originalMethod.apply(this, args);
|
|
15
|
-
// // const signatureValidation = await ValidateSignatureFlow.validate();
|
|
16
|
-
// // if (signatureValidation.expired) {
|
|
17
|
-
// // returnHttp[0] = PAYMENT_REQUIRED;
|
|
18
|
-
// // }
|
|
19
|
-
// return response.status(returnHttp[0]).json(returnHttp[1]);
|
|
20
|
-
// } catch (error: any) {
|
|
21
|
-
// console.error(error);
|
|
22
|
-
// response
|
|
23
|
-
// .status(error.status || INTERNAL_SERVER_ERROR)
|
|
24
|
-
// .json({ message: error.message, detail: error.detail?.data });
|
|
25
|
-
// }
|
|
26
|
-
// };
|
|
27
|
-
// return descriptor;
|
|
28
|
-
// }
|
|
29
|
-
// function HttpDispatchDownload(
|
|
30
|
-
// target: any,
|
|
31
|
-
// methodName: string,
|
|
32
|
-
// descriptor: PropertyDescriptor
|
|
33
|
-
// ) {
|
|
34
|
-
// const originalMethod = descriptor.value;
|
|
35
|
-
// descriptor.value = async function (...args: [any]) {
|
|
36
|
-
// const [response] = args;
|
|
37
|
-
// try {
|
|
38
|
-
// const [status, data] = await originalMethod.apply(this, args);
|
|
39
|
-
// return response.status(status).send(data);
|
|
40
|
-
// } catch (error: any) {
|
|
41
|
-
// console.error(error);
|
|
42
|
-
// response
|
|
43
|
-
// .status(error.status || INTERNAL_SERVER_ERROR)
|
|
44
|
-
// .json({ message: error.message, detail: error.detail?.data });
|
|
45
|
-
// }
|
|
46
|
-
// };
|
|
47
|
-
// return descriptor;
|
|
48
|
-
// }
|
|
49
|
-
// export {
|
|
50
|
-
// Controller,
|
|
51
|
-
// IControllerOptions,
|
|
52
|
-
// HttpDispatchHandling,
|
|
53
|
-
// HttpDispatchDownload
|
|
54
|
-
// }
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpDispatchDownload = exports.HttpDispatchHandling = exports.CrudController = exports.Controller = void 0;
|
|
4
|
+
const Controller_1 = require("./model/Controller");
|
|
5
|
+
Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return Controller_1.Controller; } });
|
|
6
|
+
Object.defineProperty(exports, "HttpDispatchDownload", { enumerable: true, get: function () { return Controller_1.HttpDispatchDownload; } });
|
|
7
|
+
Object.defineProperty(exports, "HttpDispatchHandling", { enumerable: true, get: function () { return Controller_1.HttpDispatchHandling; } });
|
|
8
|
+
const CrudController_1 = require("./model/CrudController");
|
|
9
|
+
Object.defineProperty(exports, "CrudController", { enumerable: true, get: function () { return CrudController_1.CrudController; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Biblioteca Typescript para API NodeJS",
|
|
5
5
|
"repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
|
|
6
6
|
"author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",
|