test-entity-library-asm 3.9.5 → 3.9.7
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/CustomRepository.js +21 -109
- package/dist/entities/AuthenticationCredential.js +54 -57
- package/dist/entities/Bank.js +50 -53
- package/dist/entities/BusinessType.js +47 -50
- package/dist/entities/BusinessTypeProduct.js +68 -71
- package/dist/entities/Category.js +148 -151
- package/dist/entities/CategoryDate.js +39 -42
- package/dist/entities/CategorySchedule.js +41 -44
- package/dist/entities/City.js +70 -73
- package/dist/entities/CodeRedemptionHistoryCompany.js +44 -47
- package/dist/entities/CodeRedemptionHistoryUser.js +54 -57
- package/dist/entities/Company.js +169 -172
- package/dist/entities/Configuration.d.ts +1 -1
- package/dist/entities/Configuration.js +25 -26
- package/dist/entities/Country.js +91 -94
- package/dist/entities/Day.js +38 -41
- package/dist/entities/DecorationReserve.js +46 -49
- package/dist/entities/DiscountCodeCompany.js +124 -129
- package/dist/entities/DiscountCodeUser.js +139 -142
- package/dist/entities/Gallery.js +88 -91
- package/dist/entities/Local.js +239 -242
- package/dist/entities/LocalDecorationReserve.js +64 -67
- package/dist/entities/LocalPaymentMethod.js +41 -44
- package/dist/entities/LocalPlan.js +88 -91
- package/dist/entities/LocalQualification.js +51 -54
- package/dist/entities/LocalReserve.js +177 -180
- package/dist/entities/LocalReserveStatus.js +85 -88
- package/dist/entities/LocalTable.js +163 -166
- package/dist/entities/LocalTableReserve.js +22 -25
- package/dist/entities/LocalTableReservePayment.js +156 -159
- package/dist/entities/LocalTableZone.js +84 -87
- package/dist/entities/Master.js +182 -185
- package/dist/entities/MasterNotification.js +96 -99
- package/dist/entities/MasterPermission.js +65 -68
- package/dist/entities/MasterRole.js +83 -86
- package/dist/entities/Partner.js +306 -309
- package/dist/entities/PartnerNotification.js +97 -100
- package/dist/entities/PartnerPlatform.js +66 -69
- package/dist/entities/PartnerPlatformSection.js +74 -79
- package/dist/entities/PartnerPlatformSectionPermission.js +113 -118
- package/dist/entities/PartnerPlatformSectionPermissionAssociate.js +26 -29
- package/dist/entities/PartnerRole.js +93 -96
- package/dist/entities/PartnerSession.js +94 -97
- package/dist/entities/PaymentMethod.js +91 -94
- package/dist/entities/Plan.js +86 -89
- package/dist/entities/PosSystem.js +69 -74
- package/dist/entities/Product.js +219 -222
- package/dist/entities/ProductDate.js +39 -42
- package/dist/entities/ProductGroup.js +76 -79
- package/dist/entities/ProductImage.js +33 -36
- package/dist/entities/ProductIngredient.js +54 -57
- package/dist/entities/ProductSchedule.js +41 -44
- package/dist/entities/ProductTopping.js +47 -50
- package/dist/entities/ReceiptConfig.js +184 -187
- package/dist/entities/Region.js +46 -49
- package/dist/entities/Request.js +152 -155
- package/dist/entities/RequestInvoice.js +125 -128
- package/dist/entities/RequestInvoiceCategory.js +34 -37
- package/dist/entities/RequestLocal.js +164 -169
- package/dist/entities/RequestLocalHistory.js +61 -64
- package/dist/entities/RequestLocalPayment.js +154 -157
- package/dist/entities/RequestLocalTable.js +34 -37
- package/dist/entities/RequestPrint.js +60 -63
- package/dist/entities/RequestProduct.js +58 -61
- package/dist/entities/RequestProductGroupComplement.js +51 -56
- package/dist/entities/ServiceDiscountsPlan.js +30 -33
- package/dist/entities/ServicePlan.js +84 -87
- package/dist/entities/Square.js +130 -133
- package/dist/entities/ToppingImage.js +56 -59
- package/dist/entities/TypeMeasureIngredient.js +45 -48
- package/dist/entities/User.js +234 -237
- package/dist/entities/UserAddress.js +114 -117
- package/dist/entities/UserPaymentMethod.js +118 -121
- package/dist/entities/VerificationCode.js +60 -63
- package/dist/entities/VerifyLocal.js +142 -145
- package/dist/entities/productGroupComplement.js +117 -120
- package/dist/filters/DiscountsCodeCompanyInformation.js +153 -202
- package/dist/filters/DiscountsCodeUserInformation.js +173 -220
- package/dist/filters/LocalReservesInformation.js +35 -81
- package/dist/filters/LocalsCompanyInformation.js +169 -218
- package/dist/filters/LocalsCompanyInformationForTheTable.js +157 -203
- package/dist/filters/VerifyLocalsInformation.js +131 -179
- package/dist/index.js +55 -130
- package/dist/transformers/dateTransformer.js +10 -13
- package/dist/transformers/jsonEncryptionTransformer.d.ts +2 -0
- package/dist/transformers/jsonEncryptionTransformer.js +72 -0
- package/dist/transformers/jsonTransformer.js +2 -2
- package/dist/utils.js +3 -3
- package/dist/views/DiscountsCodeUser.js +120 -123
- package/dist/views/LocalReserves.js +280 -283
- package/dist/views/LocalTableZonesFilter.js +76 -79
- package/dist/views/LocalsCompany.js +172 -175
- package/dist/views/LocalsCompanyInformationForTheMap.js +276 -279
- package/dist/views/LocalsCompanyInformationForTheTable.js +384 -387
- package/dist/views/MasterNotifications.js +132 -135
- package/dist/views/PartnerNotifications.js +104 -107
- package/dist/views/Partners.js +140 -143
- package/dist/views/VerifyLocals.js +152 -155
- package/dist/views/ViewLocalsCompanies.js +100 -103
- package/package.json +3 -2
- package/src/entities/Configuration.ts +3 -1
- package/src/transformers/jsonEncryptionTransformer.ts +78 -0
- package/tsconfig.json +7 -3
|
@@ -10,114 +10,111 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ViewLocalsCompanies = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const moment = require("moment-timezone");
|
|
15
|
+
const __1 = require("..");
|
|
16
16
|
// JSON Transformer
|
|
17
|
-
|
|
18
|
-
to:
|
|
19
|
-
from:
|
|
17
|
+
const jsonTransformer = {
|
|
18
|
+
to: (value) => JSON.stringify(value),
|
|
19
|
+
from: (value) => JSON.parse(value),
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
to
|
|
21
|
+
const DateTransformer = {
|
|
22
|
+
to(value) {
|
|
23
23
|
return moment.utc(value).format("YYYY-MM-DD HH:mm:ss");
|
|
24
24
|
},
|
|
25
|
-
from
|
|
25
|
+
from(value) {
|
|
26
26
|
return moment.utc(value).tz((0, __1.getTimeZone)()).format("YYYY-MM-DD HH:mm:ss");
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, typeorm_1.ViewColumn)(),
|
|
34
|
-
__metadata("design:type", Number)
|
|
35
|
-
], ViewLocalsCompanies.prototype, "id_local", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, typeorm_1.ViewColumn)(),
|
|
38
|
-
__metadata("design:type", String)
|
|
39
|
-
], ViewLocalsCompanies.prototype, "name_local", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], ViewLocalsCompanies.prototype, "created_local", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
|
|
46
|
-
__metadata("design:type", String)
|
|
47
|
-
], ViewLocalsCompanies.prototype, "updated_local", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, typeorm_1.ViewColumn)(),
|
|
50
|
-
__metadata("design:type", Number)
|
|
51
|
-
], ViewLocalsCompanies.prototype, "status", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, typeorm_1.ViewColumn)(),
|
|
54
|
-
__metadata("design:type", Number)
|
|
55
|
-
], ViewLocalsCompanies.prototype, "has_square", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
|
|
58
|
-
__metadata("design:type", Object)
|
|
59
|
-
], ViewLocalsCompanies.prototype, "details_local", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, typeorm_1.ViewColumn)(),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], ViewLocalsCompanies.prototype, "pos_system_name", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, typeorm_1.ViewColumn)(),
|
|
66
|
-
__metadata("design:type", String)
|
|
67
|
-
], ViewLocalsCompanies.prototype, "city_name", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
(0, typeorm_1.ViewColumn)(),
|
|
70
|
-
__metadata("design:type", String)
|
|
71
|
-
], ViewLocalsCompanies.prototype, "region_name", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, typeorm_1.ViewColumn)(),
|
|
74
|
-
__metadata("design:type", String)
|
|
75
|
-
], ViewLocalsCompanies.prototype, "country_name", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
(0, typeorm_1.ViewColumn)(),
|
|
78
|
-
__metadata("design:type", String)
|
|
79
|
-
], ViewLocalsCompanies.prototype, "prefix", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
(0, typeorm_1.ViewColumn)(),
|
|
82
|
-
__metadata("design:type", String)
|
|
83
|
-
], ViewLocalsCompanies.prototype, "country_code", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
(0, typeorm_1.ViewColumn)(),
|
|
86
|
-
__metadata("design:type", Number)
|
|
87
|
-
], ViewLocalsCompanies.prototype, "total_partners", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
(0, typeorm_1.ViewColumn)(),
|
|
90
|
-
__metadata("design:type", String)
|
|
91
|
-
], ViewLocalsCompanies.prototype, "cellphone", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
(0, typeorm_1.ViewColumn)(),
|
|
94
|
-
__metadata("design:type", String)
|
|
95
|
-
], ViewLocalsCompanies.prototype, "email", void 0);
|
|
96
|
-
__decorate([
|
|
97
|
-
(0, typeorm_1.ViewColumn)(),
|
|
98
|
-
__metadata("design:type", Number)
|
|
99
|
-
], ViewLocalsCompanies.prototype, "isVerifyPhone", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, typeorm_1.ViewColumn)(),
|
|
102
|
-
__metadata("design:type", Number)
|
|
103
|
-
], ViewLocalsCompanies.prototype, "isVerifyEmail", void 0);
|
|
104
|
-
__decorate([
|
|
105
|
-
(0, typeorm_1.ViewColumn)(),
|
|
106
|
-
__metadata("design:type", String)
|
|
107
|
-
], ViewLocalsCompanies.prototype, "address", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
(0, typeorm_1.ViewColumn)(),
|
|
110
|
-
__metadata("design:type", Number)
|
|
111
|
-
], ViewLocalsCompanies.prototype, "visible", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
(0, typeorm_1.ViewColumn)(),
|
|
114
|
-
__metadata("design:type", Number)
|
|
115
|
-
], ViewLocalsCompanies.prototype, "company", void 0);
|
|
116
|
-
ViewLocalsCompanies = __decorate([
|
|
117
|
-
(0, typeorm_1.ViewEntity)({
|
|
118
|
-
name: "view_locals_companies",
|
|
119
|
-
})
|
|
120
|
-
], ViewLocalsCompanies);
|
|
121
|
-
return ViewLocalsCompanies;
|
|
122
|
-
}());
|
|
29
|
+
let ViewLocalsCompanies = class ViewLocalsCompanies {
|
|
30
|
+
};
|
|
123
31
|
exports.ViewLocalsCompanies = ViewLocalsCompanies;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.ViewColumn)(),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], ViewLocalsCompanies.prototype, "id_local", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.ViewColumn)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ViewLocalsCompanies.prototype, "name_local", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ViewLocalsCompanies.prototype, "created_local", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ViewLocalsCompanies.prototype, "updated_local", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.ViewColumn)(),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], ViewLocalsCompanies.prototype, "status", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.ViewColumn)(),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], ViewLocalsCompanies.prototype, "has_square", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], ViewLocalsCompanies.prototype, "details_local", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.ViewColumn)(),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], ViewLocalsCompanies.prototype, "pos_system_name", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.ViewColumn)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], ViewLocalsCompanies.prototype, "city_name", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.ViewColumn)(),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], ViewLocalsCompanies.prototype, "region_name", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.ViewColumn)(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], ViewLocalsCompanies.prototype, "country_name", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.ViewColumn)(),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], ViewLocalsCompanies.prototype, "prefix", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.ViewColumn)(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], ViewLocalsCompanies.prototype, "country_code", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.ViewColumn)(),
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
|
+
], ViewLocalsCompanies.prototype, "total_partners", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.ViewColumn)(),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], ViewLocalsCompanies.prototype, "cellphone", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.ViewColumn)(),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], ViewLocalsCompanies.prototype, "email", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.ViewColumn)(),
|
|
98
|
+
__metadata("design:type", Number)
|
|
99
|
+
], ViewLocalsCompanies.prototype, "isVerifyPhone", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.ViewColumn)(),
|
|
102
|
+
__metadata("design:type", Number)
|
|
103
|
+
], ViewLocalsCompanies.prototype, "isVerifyEmail", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.ViewColumn)(),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], ViewLocalsCompanies.prototype, "address", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.ViewColumn)(),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], ViewLocalsCompanies.prototype, "visible", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.ViewColumn)(),
|
|
114
|
+
__metadata("design:type", Number)
|
|
115
|
+
], ViewLocalsCompanies.prototype, "company", void 0);
|
|
116
|
+
exports.ViewLocalsCompanies = ViewLocalsCompanies = __decorate([
|
|
117
|
+
(0, typeorm_1.ViewEntity)({
|
|
118
|
+
name: "view_locals_companies",
|
|
119
|
+
})
|
|
120
|
+
], ViewLocalsCompanies);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-entity-library-asm",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.7",
|
|
4
4
|
"description": "Entidades de ejemplo para una base de datos",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"crypto": "^1.0.1",
|
|
14
15
|
"dotenv": "^16.4.5",
|
|
15
16
|
"express": "^4.19.2",
|
|
16
17
|
"moment-timezone": "^0.5.45",
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@types/express": "^4.17.21",
|
|
22
|
-
"@types/node": "^20.
|
|
23
|
+
"@types/node": "^20.19.10",
|
|
23
24
|
"rimraf": "^6.0.1",
|
|
24
25
|
"typescript": "^5.4.5"
|
|
25
26
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Column, Entity, PrimaryColumn } from "typeorm";
|
|
2
|
+
import { JsonEncryptionTransformer } from "../transformers/jsonEncryptionTransformer";
|
|
2
3
|
|
|
3
4
|
@Entity({
|
|
4
5
|
comment:
|
|
@@ -14,8 +15,9 @@ export class Configuration {
|
|
|
14
15
|
|
|
15
16
|
@Column({
|
|
16
17
|
type: "longtext",
|
|
18
|
+
transformer: JsonEncryptionTransformer,
|
|
17
19
|
comment:
|
|
18
20
|
"Columna de tipo JSON para agregar la información y configuración respecto a la plataforma.",
|
|
19
21
|
})
|
|
20
|
-
settings:
|
|
22
|
+
settings: any;
|
|
21
23
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ValueTransformer } from "typeorm";
|
|
2
|
+
import * as crypto from "crypto";
|
|
3
|
+
|
|
4
|
+
const ENCRYPTION_KEY =
|
|
5
|
+
process.env.SECRET_ENCRYPTION_KEY || "clave-32-bytes-segura";
|
|
6
|
+
const ALGORITHM = "aes-256-cbc";
|
|
7
|
+
|
|
8
|
+
// KeyObject de 32 bytes (evita líos de tipos con CipherKey)
|
|
9
|
+
const KEY = crypto.createSecretKey(
|
|
10
|
+
crypto.createHash("sha256").update(String(ENCRYPTION_KEY)).digest()
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
function looksLikeCBC(encoded: string) {
|
|
14
|
+
// formato: iv:cipherHex
|
|
15
|
+
return /^[0-9a-fA-F]+:[0-9a-fA-F]+$/.test(encoded);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function decryptValue(value: any): any {
|
|
19
|
+
if (typeof value !== "string" || !looksLikeCBC(value)) return value;
|
|
20
|
+
|
|
21
|
+
var parts = value.split(":");
|
|
22
|
+
var ivHex = parts[0];
|
|
23
|
+
var contentHex = parts[1];
|
|
24
|
+
|
|
25
|
+
var iv = Buffer.from(ivHex, "hex");
|
|
26
|
+
var decipher = crypto.createDecipheriv(ALGORITHM, KEY, iv);
|
|
27
|
+
var dec = Buffer.concat([
|
|
28
|
+
decipher.update(Buffer.from(contentHex, "hex")),
|
|
29
|
+
decipher.final(),
|
|
30
|
+
]);
|
|
31
|
+
return dec.toString("utf8");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function encryptValue(plain: any): string | null {
|
|
35
|
+
if (plain === null || plain === undefined) return null;
|
|
36
|
+
var text = String(plain);
|
|
37
|
+
|
|
38
|
+
var iv = crypto.randomBytes(16);
|
|
39
|
+
var cipher = crypto.createCipheriv(ALGORITHM, KEY, iv);
|
|
40
|
+
var enc = Buffer.concat([cipher.update(text, "utf8"), cipher.final()]);
|
|
41
|
+
return iv.toString("hex") + ":" + enc.toString("hex");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const JsonEncryptionTransformer: ValueTransformer = {
|
|
45
|
+
to(value: any): string {
|
|
46
|
+
if (typeof value !== "object" || value === null) return JSON.stringify({});
|
|
47
|
+
|
|
48
|
+
var out: { [k: string]: any } = {};
|
|
49
|
+
for (var k in value) {
|
|
50
|
+
var v = value[k];
|
|
51
|
+
// No usamos startsWith (no tipado en ES5)
|
|
52
|
+
if (k.length >= 10 && k.substr(0, 10) === "encrypted_") {
|
|
53
|
+
out[k] = encryptValue(v);
|
|
54
|
+
} else {
|
|
55
|
+
out[k] = v;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return JSON.stringify(out);
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
from(dbValue: string): any {
|
|
62
|
+
try {
|
|
63
|
+
var parsed = JSON.parse(dbValue);
|
|
64
|
+
for (var k in parsed) {
|
|
65
|
+
if (k.length >= 10 && k.substr(0, 10) === "encrypted_") {
|
|
66
|
+
try {
|
|
67
|
+
parsed[k] = decryptValue(parsed[k]);
|
|
68
|
+
} catch {
|
|
69
|
+
// si falla, deja el valor original
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return parsed;
|
|
74
|
+
} catch {
|
|
75
|
+
return {};
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
};
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"module": "
|
|
5
|
-
"
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"lib": ["es2020"],
|
|
6
|
+
"types": ["node"],
|
|
7
|
+
"moduleResolution": "Node",
|
|
6
8
|
"outDir": "./dist",
|
|
9
|
+
"declaration": true,
|
|
7
10
|
"strict": true,
|
|
8
11
|
"emitDecoratorMetadata": true,
|
|
9
12
|
"experimentalDecorators": true,
|
|
10
13
|
"strictPropertyInitialization": false,
|
|
14
|
+
"skipLibCheck": true
|
|
11
15
|
},
|
|
12
16
|
"include": ["src"]
|
|
13
17
|
}
|