test-entity-library-asm 1.3.7 → 1.3.9

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.
@@ -18,9 +18,6 @@ export declare class User {
18
18
  email: string;
19
19
  phone: string;
20
20
  city: City;
21
- address: string;
22
- latitude: number;
23
- longitude: number;
24
21
  password: string;
25
22
  profile: string;
26
23
  created: Date;
@@ -75,30 +75,6 @@ var User = /** @class */ (function () {
75
75
  (0, typeorm_1.JoinColumn)({ name: 'city' }),
76
76
  __metadata("design:type", City_1.City)
77
77
  ], User.prototype, "city", void 0);
78
- __decorate([
79
- (0, typeorm_1.Column)({ nullable: true, length: 100, comment: 'Dirección del usuario.' }),
80
- __metadata("design:type", String)
81
- ], User.prototype, "address", void 0);
82
- __decorate([
83
- (0, typeorm_1.Column)({
84
- type: 'decimal',
85
- precision: 10,
86
- scale: 8,
87
- nullable: true,
88
- comment: 'Latitude de la dirección del usuario.',
89
- }),
90
- __metadata("design:type", Number)
91
- ], User.prototype, "latitude", void 0);
92
- __decorate([
93
- (0, typeorm_1.Column)({
94
- type: 'decimal',
95
- precision: 10,
96
- scale: 8,
97
- nullable: true,
98
- comment: 'Longitude de la dirección del usuario.',
99
- }),
100
- __metadata("design:type", Number)
101
- ], User.prototype, "longitude", void 0);
102
78
  __decorate([
103
79
  (0, typeorm_1.Column)({
104
80
  length: 255,
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.9",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -64,27 +64,6 @@ export class User {
64
64
  @JoinColumn({ name: 'city' })
65
65
  city: City
66
66
 
67
- @Column({ nullable: true, length: 100, comment: 'Dirección del usuario.' })
68
- address: string
69
-
70
- @Column({
71
- type: 'decimal',
72
- precision: 10,
73
- scale: 8,
74
- nullable: true,
75
- comment: 'Latitude de la dirección del usuario.',
76
- })
77
- latitude: number
78
-
79
- @Column({
80
- type: 'decimal',
81
- precision: 10,
82
- scale: 8,
83
- nullable: true,
84
- comment: 'Longitude de la dirección del usuario.',
85
- })
86
- longitude: number
87
-
88
67
  @Column({
89
68
  length: 255,
90
69
  comment: 'Contraseña almacenada tipo SHA256 del usuario.',
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)