test-entity-library-asm 1.3.7 → 1.3.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  import { DataSource } from 'typeorm';
2
2
  export declare function createDataBaseSource(): DataSource;
3
3
  export declare function showEntity(entityName: string): Promise<any>;
4
- export declare function callStoredProcedure(storedProcedure: any): Promise<any>;
4
+ export declare function callStoredProcedure(storedProcedure: any, elements: any): Promise<any>;
package/dist/index.js CHANGED
@@ -87,7 +87,7 @@ function showEntity(entityName) {
87
87
  });
88
88
  }
89
89
  exports.showEntity = showEntity;
90
- function callStoredProcedure(storedProcedure) {
90
+ function callStoredProcedure(storedProcedure, elements) {
91
91
  return __awaiter(this, void 0, void 0, function () {
92
92
  var result, error_1;
93
93
  return __generator(this, function (_a) {
@@ -100,7 +100,7 @@ function callStoredProcedure(storedProcedure) {
100
100
  case 1:
101
101
  _a.sent();
102
102
  _a.label = 2;
103
- case 2: return [4 /*yield*/, connection.query("CALL ".concat(storedProcedure))];
103
+ case 2: return [4 /*yield*/, connection.query("CALL ".concat(storedProcedure), elements)];
104
104
  case 3:
105
105
  result = _a.sent();
106
106
  return [2 /*return*/, result];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -44,14 +44,14 @@ export async function showEntity(entityName: string): Promise<any> {
44
44
  return connection.getRepository(entityName)
45
45
  }
46
46
 
47
- export async function callStoredProcedure(storedProcedure: any) {
47
+ export async function callStoredProcedure(storedProcedure: any, elements: any) {
48
48
  try {
49
49
  if (!connection) {
50
50
  connection = createDataBaseSource()
51
51
  await connection.initialize()
52
52
  }
53
53
 
54
- const result = await connection.query(`CALL ${storedProcedure}`)
54
+ const result = await connection.query(`CALL ${storedProcedure}`, elements)
55
55
  return result
56
56
  } catch (error) {
57
57
  console.error('Error calling stored procedure:', error)