jh-be-tools 1.0.15 → 1.0.17

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.
@@ -47,7 +47,7 @@ const baseQuery = async (req, func) => {
47
47
  };
48
48
  try {
49
49
  if (req.body) {
50
- return (await func(req.path, req.body, options)).data;
50
+ return (await func(req.path, { data: req.body }, options)).data;
51
51
  }
52
52
  else {
53
53
  return (await func(req.path, options)).data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jh-be-tools",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,10 +0,0 @@
1
- export declare const connection: {
2
- client: string;
3
- connection: {
4
- host: string | undefined;
5
- port: number;
6
- user: string | undefined;
7
- password: string | undefined;
8
- database: string | undefined;
9
- };
10
- };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.connection = void 0;
4
- const dotenv_1 = require("dotenv");
5
- (0, dotenv_1.config)();
6
- const host = process.env.POSTGRES_HOST;
7
- const dbName = process.env.POSTGRES_DB;
8
- const pass = process.env.POSTGRES_PASSWORD;
9
- exports.connection = {
10
- client: 'pg',
11
- connection: {
12
- host: host,
13
- port: 5432,
14
- user: dbName,
15
- password: pass,
16
- database: dbName,
17
- },
18
- };
@@ -1,2 +0,0 @@
1
- import { knex } from 'knex';
2
- export declare const dbConnection: knex.Knex<any, unknown[]>;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dbConnection = void 0;
4
- const knex_1 = require("knex");
5
- const connection_1 = require("./connection");
6
- exports.dbConnection = (0, knex_1.knex)(connection_1.connection);
@@ -1,2 +0,0 @@
1
- export { dbConfig } from './knexFile';
2
- export { dbConnection } from './dbConnection';
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dbConnection = exports.dbConfig = void 0;
4
- var knexFile_1 = require("./knexFile");
5
- Object.defineProperty(exports, "dbConfig", { enumerable: true, get: function () { return knexFile_1.dbConfig; } });
6
- var dbConnection_1 = require("./dbConnection");
7
- Object.defineProperty(exports, "dbConnection", { enumerable: true, get: function () { return dbConnection_1.dbConnection; } });
@@ -1,4 +0,0 @@
1
- import type { Knex } from 'knex';
2
- export declare const dbConfig: {
3
- [key: string]: Knex.Config;
4
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dbConfig = void 0;
4
- const connection_1 = require("./connection");
5
- exports.dbConfig = {
6
- development: {
7
- ...connection_1.connection,
8
- pool: {
9
- min: 2,
10
- max: 10,
11
- },
12
- migrations: {
13
- tableName: 'knex_migrations',
14
- directory: 'src/db/migrations',
15
- },
16
- seeds: {
17
- directory: 'src/db/seeds',
18
- },
19
- },
20
- };
package/dist/package.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "name": "jh-be-tools",
3
- "version": "1.0.13",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "npx tsc --build && cp package.json dist/.",
9
- "test": "echo \"Error: no test\" && exit 1"
10
- },
11
- "author": "",
12
- "license": "ISC",
13
- "devDependencies": {
14
- "@types/express": "^5.0.0",
15
- "@types/node": "^20.11.5",
16
- "typescript": "^5.3.3"
17
- },
18
- "dependencies": {
19
- "axios": "^1.6.7",
20
- "express": "^4.21.1",
21
- "pg": "^8.13.1",
22
- "zod": "^3.23.8"
23
- },
24
- "bin": {
25
- "createPackageIndexFiles": "create-package-index-files/createPackageIndexFiles.js"
26
- }
27
- }