test-entity-library-asm 1.5.0 → 1.5.2

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.
@@ -4,7 +4,7 @@ export declare class LocalsCompany {
4
4
  address: string;
5
5
  latitude: string;
6
6
  longitude: string;
7
- local_details: Record<string, any>;
7
+ local_details: object;
8
8
  created: string;
9
9
  updated: string;
10
10
  status: number;
@@ -18,7 +18,7 @@ export declare class LocalsCompany {
18
18
  country_code: string;
19
19
  country_name: string;
20
20
  country_status: number;
21
- country_details: Record<string, any>;
21
+ country_details: object;
22
22
  average_rating: number;
23
23
  square_id: number;
24
24
  square_name: string;
@@ -11,6 +11,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LocalsCompany = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
+ // JSON Transformer
15
+ var jsonTransformer = {
16
+ to: function (value) { return JSON.stringify(value); },
17
+ from: function (value) { return JSON.parse(value); },
18
+ };
14
19
  var LocalsCompany = /** @class */ (function () {
15
20
  function LocalsCompany() {
16
21
  }
@@ -35,7 +40,7 @@ var LocalsCompany = /** @class */ (function () {
35
40
  __metadata("design:type", String)
36
41
  ], LocalsCompany.prototype, "longitude", void 0);
37
42
  __decorate([
38
- (0, typeorm_1.ViewColumn)(),
43
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
39
44
  __metadata("design:type", Object)
40
45
  ], LocalsCompany.prototype, "local_details", void 0);
41
46
  __decorate([
@@ -91,7 +96,7 @@ var LocalsCompany = /** @class */ (function () {
91
96
  __metadata("design:type", Number)
92
97
  ], LocalsCompany.prototype, "country_status", void 0);
93
98
  __decorate([
94
- (0, typeorm_1.ViewColumn)(),
99
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
95
100
  __metadata("design:type", Object)
96
101
  ], LocalsCompany.prototype, "country_details", void 0);
97
102
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,10 @@
1
1
  import { ViewEntity, ViewColumn } from 'typeorm'
2
2
 
3
+ // JSON Transformer
4
+ const jsonTransformer = {
5
+ to: (value: any) => JSON.stringify(value),
6
+ from: (value: string) => JSON.parse(value),
7
+ }
3
8
  @ViewEntity({
4
9
  name: 'locals_company',
5
10
  })
@@ -19,8 +24,8 @@ export class LocalsCompany {
19
24
  @ViewColumn()
20
25
  longitude: string
21
26
 
22
- @ViewColumn()
23
- local_details: Record<string, any>
27
+ @ViewColumn({ transformer: jsonTransformer })
28
+ local_details: object
24
29
 
25
30
  @ViewColumn()
26
31
  created: string
@@ -61,8 +66,8 @@ export class LocalsCompany {
61
66
  @ViewColumn()
62
67
  country_status: number
63
68
 
64
- @ViewColumn()
65
- country_details: Record<string, any>
69
+ @ViewColumn({ transformer: jsonTransformer })
70
+ country_details: object
66
71
 
67
72
  @ViewColumn()
68
73
  average_rating: number