test-entity-library-asm 2.6.16 → 2.6.18

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.
@@ -26,8 +26,7 @@ export declare class Partners {
26
26
  country_name: string;
27
27
  country_currency: string;
28
28
  country_prefix: string;
29
- country_sructure_phone: string;
30
- country_legal_information: any;
29
+ country_structure_phone: string;
31
30
  country_details: any;
32
31
  country_status: number;
33
32
  assigned_local: number;
@@ -16,7 +16,15 @@ var __1 = require("..");
16
16
  // JSON Transformer
17
17
  var jsonTransformer = {
18
18
  to: function (value) { return JSON.stringify(value); },
19
- from: function (value) { return JSON.parse(value); },
19
+ from: function (value) {
20
+ try {
21
+ return JSON.parse(value);
22
+ }
23
+ catch (error) {
24
+ console.log(error, 'Transformer error');
25
+ return null;
26
+ }
27
+ },
20
28
  };
21
29
  var DateTransformer = {
22
30
  to: function (value) {
@@ -140,11 +148,7 @@ var Partners = /** @class */ (function () {
140
148
  __decorate([
141
149
  (0, typeorm_1.ViewColumn)(),
142
150
  __metadata("design:type", String)
143
- ], Partners.prototype, "country_sructure_phone", void 0);
144
- __decorate([
145
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
146
- __metadata("design:type", Object)
147
- ], Partners.prototype, "country_legal_information", void 0);
151
+ ], Partners.prototype, "country_structure_phone", void 0);
148
152
  __decorate([
149
153
  (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
150
154
  __metadata("design:type", Object)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.6.16",
3
+ "version": "2.6.18",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -5,7 +5,15 @@ import { getTimeZone } from "..";
5
5
  // JSON Transformer
6
6
  const jsonTransformer = {
7
7
  to: (value: any) => JSON.stringify(value),
8
- from: (value: string) => JSON.parse(value),
8
+
9
+ from: (value: string) => {
10
+ try {
11
+ return JSON.parse(value);
12
+ } catch (error) {
13
+ console.log(error,'Transformer error');
14
+ return null;
15
+ }
16
+ },
9
17
  };
10
18
 
11
19
  const DateTransformer = {
@@ -21,99 +29,96 @@ const DateTransformer = {
21
29
  name: "Partners",
22
30
  })
23
31
  export class Partners {
24
- @ViewColumn()
25
- id: number;
26
-
27
- @ViewColumn()
28
- company: number;
32
+ @ViewColumn()
33
+ id: number;
29
34
 
30
- @ViewColumn()
31
- code: string;
35
+ @ViewColumn()
36
+ company: number;
32
37
 
33
- @ViewColumn()
34
- document: string;
38
+ @ViewColumn()
39
+ code: string;
35
40
 
36
- @ViewColumn()
37
- name: string;
41
+ @ViewColumn()
42
+ document: string;
38
43
 
39
- @ViewColumn()
40
- surname: string;
44
+ @ViewColumn()
45
+ name: string;
41
46
 
42
- @ViewColumn()
43
- email: string;
47
+ @ViewColumn()
48
+ surname: string;
44
49
 
45
- @ViewColumn()
46
- phone: string;
50
+ @ViewColumn()
51
+ email: string;
47
52
 
48
- @ViewColumn()
49
- city: number;
53
+ @ViewColumn()
54
+ phone: string;
50
55
 
51
- @ViewColumn()
52
- address: string;
56
+ @ViewColumn()
57
+ city: number;
53
58
 
54
- @ViewColumn()
55
- password: string;
59
+ @ViewColumn()
60
+ address: string;
56
61
 
57
- @ViewColumn({transformer: jsonTransformer})
58
- profile: any;
62
+ @ViewColumn()
63
+ password: string;
59
64
 
60
- @ViewColumn()
61
- owner: number;
65
+ @ViewColumn({ transformer: jsonTransformer })
66
+ profile: any;
62
67
 
63
- @ViewColumn({transformer: DateTransformer})
64
- created: string;
68
+ @ViewColumn()
69
+ owner: number;
65
70
 
66
- @ViewColumn({transformer: DateTransformer})
67
- updated: string;
71
+ @ViewColumn({ transformer: DateTransformer })
72
+ created: string;
68
73
 
69
- @ViewColumn()
70
- status: number;
74
+ @ViewColumn({ transformer: DateTransformer })
75
+ updated: string;
71
76
 
72
- @ViewColumn()
73
- visible: number;
77
+ @ViewColumn()
78
+ status: number;
74
79
 
75
- @ViewColumn()
76
- city_region: number;
80
+ @ViewColumn()
81
+ visible: number;
77
82
 
78
- @ViewColumn()
79
- city_name: string;
83
+ @ViewColumn()
84
+ city_region: number;
80
85
 
81
- @ViewColumn()
82
- city_status: number;
86
+ @ViewColumn()
87
+ city_name: string;
83
88
 
84
- @ViewColumn()
85
- region_country: number;
89
+ @ViewColumn()
90
+ city_status: number;
86
91
 
87
- @ViewColumn()
88
- region_name: string;
92
+ @ViewColumn()
93
+ region_country: number;
89
94
 
90
- @ViewColumn()
91
- region_status: number;
95
+ @ViewColumn()
96
+ region_name: string;
92
97
 
93
- @ViewColumn()
94
- country_code: string;
98
+ @ViewColumn()
99
+ region_status: number;
95
100
 
96
- @ViewColumn()
97
- country_name: string;
101
+ @ViewColumn()
102
+ country_code: string;
98
103
 
99
- @ViewColumn()
100
- country_currency: string;
104
+ @ViewColumn()
105
+ country_name: string;
101
106
 
102
- @ViewColumn()
103
- country_prefix: string;
107
+ @ViewColumn()
108
+ country_currency: string;
104
109
 
105
- @ViewColumn()
106
- country_sructure_phone: string;
110
+ @ViewColumn()
111
+ country_prefix: string;
107
112
 
108
- @ViewColumn({transformer: jsonTransformer})
109
- country_legal_information: any;
113
+ @ViewColumn()
114
+ country_structure_phone: string;
110
115
 
111
- @ViewColumn({transformer: jsonTransformer})
112
- country_details: any;
116
+ @ViewColumn({ transformer: jsonTransformer })
117
+ country_details: any;
113
118
 
114
- @ViewColumn()
115
- country_status: number;
119
+ @ViewColumn()
120
+ country_status: number;
116
121
 
117
- @ViewColumn()
118
- assigned_local: number;
122
+ @ViewColumn()
123
+ assigned_local: number;
119
124
  }