@natrave/shared-entities 1.4.103 → 1.4.105
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/app-auth/users/user.entity.d.ts +2 -1
- package/dist/app-auth/users/user.entity.d.ts.map +1 -1
- package/dist/app-auth/users/user.entity.js +16 -7
- package/dist/app-auth/users/utils/format-data.utils.d.ts +2 -1
- package/dist/app-auth/users/utils/format-data.utils.d.ts.map +1 -1
- package/dist/app-auth/users/utils/format-data.utils.js +6 -2
- package/dist/user-events/user-event-views/user-event-view.entity.d.ts +2 -1
- package/dist/user-events/user-event-views/user-event-view.entity.d.ts.map +1 -1
- package/dist/user-events/user-event-views/user-event-view.entity.js +13 -1
- package/package.json +10 -10
|
@@ -15,7 +15,8 @@ export declare class User {
|
|
|
15
15
|
shirtNumber: number | null;
|
|
16
16
|
email: string;
|
|
17
17
|
gender: Gender | null;
|
|
18
|
-
|
|
18
|
+
cpfEncrypted: string | null;
|
|
19
|
+
cpfHash: string | null;
|
|
19
20
|
phone: string | null;
|
|
20
21
|
imageUrl: string | null;
|
|
21
22
|
refreshTokens: RefreshToken[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/app-auth/users/user.entity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAa7C,
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/app-auth/users/user.entity.ts"],"names":[],"mapp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-
|
|
116
|
+
name: "cpf_encrypted",
|
|
117
|
+
type: "text",
|
|
118
118
|
nullable: true,
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
comment: "CPF do usu\xE1rio criptografado com AES-256-GCM."
|
|
120
|
+
})
|
|
121
|
+
], User.prototype, "cpfEncrypted", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
Column({
|
|
124
|
+
name: "cpf_hash",
|
|
125
|
+
type: "char",
|
|
126
|
+
length: 64,
|
|
127
|
+
nullable: true,
|
|
128
|
+
comment: "Hash SHA-256 do CPF normalizado com pepper para compara\xE7\xE3o."
|
|
121
129
|
})
|
|
122
|
-
], User.prototype, "
|
|
130
|
+
], User.prototype, "cpfHash", 2);
|
|
123
131
|
__decorateClass([
|
|
124
132
|
Column({
|
|
125
133
|
name: "phone",
|
|
@@ -165,12 +173,13 @@ User = __decorateClass([
|
|
|
165
173
|
Entity("users"),
|
|
166
174
|
Unique(["email"]),
|
|
167
175
|
Unique(["phone"]),
|
|
168
|
-
Unique(["cpf"]),
|
|
169
176
|
Index("IDX_users_id", ["id"]),
|
|
170
177
|
Index("IDX_users_numeric_id", ["numericId"]),
|
|
171
178
|
Index("IDX_users_email_lookup", ["email"], { where: '"deleted_at" IS NULL' }),
|
|
172
179
|
Index("IDX_users_phone_lookup", ["phone"], { where: '"deleted_at" IS NULL' }),
|
|
173
|
-
Index("
|
|
180
|
+
Index("IDX_users_cpf_hash_lookup", ["cpfHash"], {
|
|
181
|
+
where: '"deleted_at" IS NULL AND "cpf_hash" IS NOT NULL'
|
|
182
|
+
}),
|
|
174
183
|
Index("IDX_users_deleted_at", ["deletedAt"]),
|
|
175
184
|
Index("IDX_users_id_deleted", ["id", "deletedAt"]),
|
|
176
185
|
Index("IDX_users_created_at", ["createdAt"]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-data.utils.d.ts","sourceRoot":"","sources":["../../../../src/app-auth/users/utils/format-data.utils.ts"],"names":[],"mappings":"AAWA,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"format-data.utils.d.ts","sourceRoot":"","sources":["../../../../src/app-auth/users/utils/format-data.utils.ts"],"names":[],"mappings":"AAWA,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,GAAG,IAAI,CAwBP"}
|
|
@@ -2,8 +2,12 @@ function formatUserBeforeInsertData(user) {
|
|
|
2
2
|
if (user.email) {
|
|
3
3
|
user.email = user.email.toLowerCase().trim();
|
|
4
4
|
}
|
|
5
|
-
if (user.
|
|
6
|
-
user.
|
|
5
|
+
if (user.cpfEncrypted) {
|
|
6
|
+
user.cpfEncrypted = user.cpfEncrypted.trim();
|
|
7
|
+
}
|
|
8
|
+
if (user.cpfHash) {
|
|
9
|
+
const normalizedHash = user.cpfHash.trim().toLowerCase();
|
|
10
|
+
user.cpfHash = /^[a-f0-9]{64}$/.test(normalizedHash) ? normalizedHash : null;
|
|
7
11
|
}
|
|
8
12
|
if (user.phone) {
|
|
9
13
|
user.phone = user.phone.replace(/\D/g, "").trim();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UserEventDisplayType, UserEventViewStatus } from '@natrave/user-domain-events';
|
|
1
|
+
import { UserEventClosePolicy, UserEventDisplayType, UserEventViewStatus } from '@natrave/user-domain-events';
|
|
2
2
|
import { User } from '../../app-auth';
|
|
3
3
|
import { UserDomainEvent } from '../user-domain-events';
|
|
4
4
|
export declare class UserEventView {
|
|
@@ -7,6 +7,7 @@ export declare class UserEventView {
|
|
|
7
7
|
userDomainEventId: string;
|
|
8
8
|
viewKey: string;
|
|
9
9
|
displayType: UserEventDisplayType;
|
|
10
|
+
closePolicy: UserEventClosePolicy;
|
|
10
11
|
status: UserEventViewStatus;
|
|
11
12
|
priority: number;
|
|
12
13
|
dedupeKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-event-view.entity.d.ts","sourceRoot":"","sources":["../../../src/user-events/user-event-views/user-event-view.entity.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"user-event-view.entity.d.ts","sourceRoot":"","sources":["../../../src/user-events/user-event-views/user-event-view.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAYrC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,qBAMa,aAAa;IAExB,EAAE,EAAE,MAAM,CAAC;IAOX,MAAM,EAAE,MAAM,CAAC;IAOf,iBAAiB,EAAE,MAAM,CAAC;IAG1B,OAAO,EAAE,MAAM,CAAC;IAGhB,WAAW,EAAE,oBAAoB,CAAC;IAQlC,WAAW,EAAE,oBAAoB,CAAC;IAQlC,MAAM,EAAE,mBAAmB,CAAC;IAG5B,QAAQ,EAAE,MAAM,CAAC;IAIjB,SAAS,EAAE,MAAM,CAAC;IAGlB,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAG3B,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IAGrB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAGzB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAIhB,IAAI,EAAE,IAAI,CAAC;IAIX,eAAe,EAAE,eAAe,CAAC;CAClC"}
|
|
@@ -8,7 +8,11 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
8
8
|
if (kind && result) __defProp(target, key, result);
|
|
9
9
|
return result;
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
UserEventClosePolicy,
|
|
13
|
+
UserEventDisplayType,
|
|
14
|
+
UserEventViewStatus
|
|
15
|
+
} from "@natrave/user-domain-events";
|
|
12
16
|
import {
|
|
13
17
|
Column,
|
|
14
18
|
CreateDateColumn,
|
|
@@ -46,6 +50,14 @@ __decorateClass([
|
|
|
46
50
|
__decorateClass([
|
|
47
51
|
Column({ name: "display_type", type: "enum", enum: UserEventDisplayType })
|
|
48
52
|
], UserEventView.prototype, "displayType", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
Column({
|
|
55
|
+
name: "close_policy",
|
|
56
|
+
type: "enum",
|
|
57
|
+
enum: UserEventClosePolicy,
|
|
58
|
+
default: UserEventClosePolicy.ALWAYS_ALLOW
|
|
59
|
+
})
|
|
60
|
+
], UserEventView.prototype, "closePolicy", 2);
|
|
49
61
|
__decorateClass([
|
|
50
62
|
Column({
|
|
51
63
|
name: "status",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@natrave/shared-entities",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.105",
|
|
4
4
|
"description": "Entidades compartilhadass da NaTrave",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"private": false,
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@changesets/cli": "^2.29.8",
|
|
29
|
-
"@eslint/js": "^
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
31
|
-
"@typescript-eslint/parser": "^8.
|
|
32
|
-
"esbuild": "^0.27.
|
|
33
|
-
"eslint": "^
|
|
29
|
+
"@eslint/js": "^10.0.1",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
31
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
32
|
+
"esbuild": "^0.27.3",
|
|
33
|
+
"eslint": "^10.0.0",
|
|
34
34
|
"eslint-config-prettier": "^10.1.8",
|
|
35
35
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
36
36
|
"eslint-plugin-import": "^2.32.0",
|
|
37
37
|
"eslint-plugin-prettier": "^5.5.5",
|
|
38
|
-
"eslint-plugin-unused-imports": "^4.
|
|
39
|
-
"glob": "^13.0.
|
|
38
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
39
|
+
"glob": "^13.0.2",
|
|
40
40
|
"husky": "^9.1.7",
|
|
41
41
|
"lint-staged": "^16.2.7",
|
|
42
|
-
"prettier": "^3.
|
|
42
|
+
"prettier": "^3.8.1",
|
|
43
43
|
"ts-node": "^10.9.2"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@natrave/facility-service-types": "^0.0.9",
|
|
48
48
|
"@natrave/notification-service-types": "^1.1.73",
|
|
49
49
|
"@natrave/tournaments-service-types": "^1.4.4",
|
|
50
|
-
"@natrave/user-domain-events": "^0.1.
|
|
50
|
+
"@natrave/user-domain-events": "^0.1.9",
|
|
51
51
|
"reflect-metadata": "^0.2.2",
|
|
52
52
|
"typeorm": "^0.3.28"
|
|
53
53
|
},
|