c2-http 1.0.82 → 1.0.83
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 -1
- package/dist/index.js +15 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,4 +8,8 @@ import { IControllerOptions } from "./model/IControllerOptions";
|
|
|
8
8
|
import { ICrudControllerOptions } from "./model/ICrudControllerOptions";
|
|
9
9
|
import { IServerConfig, Server } from "./model/Server";
|
|
10
10
|
export declare const convertErrorToHttpError: (error: any) => HttpError;
|
|
11
|
-
export
|
|
11
|
+
export declare const prepareRequestParams: (options?: any) => {
|
|
12
|
+
params: any;
|
|
13
|
+
paramsSerializer: (params: any) => string;
|
|
14
|
+
};
|
|
15
|
+
export { Controller, ControllerRoleMiddleware, ControllerRoute, CrudController, getMessage, HttpDispatchDownload, HttpDispatchHandling, IControllerOptions, ICrudControllerOptions, initializei18n, IOpenApiPath, IServerConfig, OpenApi, Server };
|
package/dist/index.js
CHANGED
|
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.Server = exports.OpenApi = exports.initializei18n = exports.HttpDispatchHandling = exports.HttpDispatchDownload = exports.getMessage = exports.CrudController = exports.ControllerRoute = exports.ControllerRoleMiddleware = exports.Controller = exports.prepareRequestParams = exports.convertErrorToHttpError = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
9
9
|
const http_status_1 = require("http-status");
|
|
10
10
|
const mongodb_1 = require("mongodb");
|
|
11
11
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
12
|
+
const qs_1 = __importDefault(require("qs"));
|
|
12
13
|
const i18n_1 = require("./i18n");
|
|
13
14
|
Object.defineProperty(exports, "getMessage", { enumerable: true, get: function () { return i18n_1.getMessage; } });
|
|
14
15
|
Object.defineProperty(exports, "initializei18n", { enumerable: true, get: function () { return i18n_1.initializei18n; } });
|
|
@@ -124,3 +125,16 @@ const convertErrorToHttpError = (error) => {
|
|
|
124
125
|
});
|
|
125
126
|
};
|
|
126
127
|
exports.convertErrorToHttpError = convertErrorToHttpError;
|
|
128
|
+
const prepareRequestParams = (options) => {
|
|
129
|
+
if (options && options?.searchText === "undefined") {
|
|
130
|
+
options.searchText = "";
|
|
131
|
+
}
|
|
132
|
+
const params = {
|
|
133
|
+
params: options,
|
|
134
|
+
paramsSerializer: (params) => {
|
|
135
|
+
return qs_1.default.stringify(params);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
return params;
|
|
139
|
+
};
|
|
140
|
+
exports.prepareRequestParams = prepareRequestParams;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.83",
|
|
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>",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"express-rest-i18n": "^1.0.1",
|
|
32
32
|
"http-status": "^1.7.4",
|
|
33
33
|
"mongoose": "^8.3.4",
|
|
34
|
+
"qs": "^6.13.0",
|
|
34
35
|
"swagger-autogen": "^2.23.7",
|
|
35
36
|
"swagger-ui-express": "^5.0.0",
|
|
36
37
|
"ts-node": "^10.8.1",
|