@natrave/shared-entities 1.5.1 → 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.
Files changed (25) hide show
  1. package/dist/app-auth/users/user.entity.d.ts +2 -1
  2. package/dist/app-auth/users/user.entity.d.ts.map +1 -1
  3. package/dist/app-auth/users/user.entity.js +4 -1
  4. package/dist/database-entities/index.d.ts +2 -2
  5. package/dist/database-entities/index.d.ts.map +1 -1
  6. package/dist/database-entities/index.js +2 -1
  7. package/dist/notifications/index.d.ts +1 -0
  8. package/dist/notifications/index.d.ts.map +1 -1
  9. package/dist/notifications/index.js +1 -0
  10. package/dist/notifications/push-device-tokens/enums/index.d.ts +3 -0
  11. package/dist/notifications/push-device-tokens/enums/index.d.ts.map +1 -0
  12. package/dist/notifications/push-device-tokens/enums/index.js +6 -0
  13. package/dist/notifications/push-device-tokens/enums/push-token-platform.enum.d.ts +7 -0
  14. package/dist/notifications/push-device-tokens/enums/push-token-platform.enum.d.ts.map +1 -0
  15. package/dist/notifications/push-device-tokens/enums/push-token-platform.enum.js +10 -0
  16. package/dist/notifications/push-device-tokens/enums/push-token-provider.enum.d.ts +4 -0
  17. package/dist/notifications/push-device-tokens/enums/push-token-provider.enum.d.ts.map +1 -0
  18. package/dist/notifications/push-device-tokens/enums/push-token-provider.enum.js +7 -0
  19. package/dist/notifications/push-device-tokens/index.d.ts +3 -0
  20. package/dist/notifications/push-device-tokens/index.d.ts.map +1 -0
  21. package/dist/notifications/push-device-tokens/index.js +5 -0
  22. package/dist/notifications/push-device-tokens/push-device-token.entity.d.ts +18 -0
  23. package/dist/notifications/push-device-tokens/push-device-token.entity.d.ts.map +1 -0
  24. package/dist/notifications/push-device-tokens/push-device-token.entity.js +136 -0
  25. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- import { Notification } from '../../notifications';
1
+ import { Notification, PushDeviceToken } from '../../notifications';
2
2
  import { Player } from '../../players';
3
3
  import { TournamentRegistrationRequest } from '../../tournaments';
4
4
  import { RefreshToken } from '../refresh-tokens';
@@ -23,6 +23,7 @@ export declare class User {
23
23
  userAuthProviders: UserAuthProvider[];
24
24
  player: Player;
25
25
  notifications: Notification[];
26
+ pushDeviceTokens: PushDeviceToken[];
26
27
  tournamentRegistrationRequests: TournamentRegistrationRequest[];
27
28
  prepareData(): void;
28
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/app-auth/users/user.entity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,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,qBAiBa,IAAI;IAIf,EAAE,EAAE,MAAM,CAAC;IAUX,SAAS,EAAE,MAAM,CAAC;IAOlB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IASvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAQpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,KAAK,EAAE,MAAM,CAAC;IAQd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAQtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAS5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAUvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IASrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAKxB,aAAa,EAAE,YAAY,EAAE,CAAC;IA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KtC,MAAM,EAAE,MAAM,CAAC;IAGf,aAAa,EAAE,YAAY,EAAE,CAAC;IAG9B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAGpC,8BAA8B,EAAE,6BAA6B,EAAE,CAAC;IAMhE,WAAW,IAAI,IAAI;CAGpB"}
@@ -21,7 +21,7 @@ import {
21
21
  Unique,
22
22
  UpdateDateColumn
23
23
  } from "typeorm";
24
- import { Notification } from "../../notifications/index.js";
24
+ import { Notification, PushDeviceToken } from "../../notifications/index.js";
25
25
  import { Player } from "../../players/index.js";
26
26
  import { TournamentRegistrationRequest } from "../../tournaments/index.js";
27
27
  import { RefreshToken } from "../refresh-tokens/index.js";
@@ -163,6 +163,9 @@ __decorateClass([
163
163
  __decorateClass([
164
164
  OneToMany(() => Notification, (notification) => notification.user)
165
165
  ], User.prototype, "notifications", 2);
166
+ __decorateClass([
167
+ OneToMany(() => PushDeviceToken, (pushDeviceToken) => pushDeviceToken.user)
168
+ ], User.prototype, "pushDeviceTokens", 2);
166
169
  __decorateClass([
167
170
  OneToMany(() => TournamentRegistrationRequest, (request) => request.requestedBy)
168
171
  ], User.prototype, "tournamentRegistrationRequests", 2);
@@ -3,11 +3,11 @@ import { Organization, OrganizationUser, OrganizationUserBillingInfo, PhoneNumbe
3
3
  import { Coupon, CouponUsage } from '../coupons';
4
4
  import { Address, Facility, FacilityImage, FacilityOwner, Field, FieldImage } from '../facilities';
5
5
  import { TeamPlayerMergeHistory } from '../history-logs';
6
- import { Notification, NotificationDelivery } from '../notifications';
6
+ import { Notification, NotificationDelivery, PushDeviceToken } from '../notifications';
7
7
  import { Payment, PaymentProvider, UserPaymentProvider } from '../payments';
8
8
  import { Player, PlayerPersonalData, PlayerPosition } from '../players';
9
9
  import { PlayerTeam, Team, TeamJoinRequest, TeamModality, TeamTrophy } from '../teams';
10
10
  import { Tournament, TournamentAllowedPhone, TournamentBracket, TournamentBracketSlot, TournamentContact, TournamentCoupon, TournamentFacility, TournamentFormatConfig, TournamentGroup, TournamentMatch, TournamentMatchAvailability, TournamentMatchCard, TournamentMatchGoal, TournamentMatchRule, TournamentMatchSchema, TournamentPayment, TournamentPenaltyShootout, TournamentPlayer, TournamentPlayerRule, TournamentPrizeRule, TournamentPublicationChargeRule, TournamentRegistrationRequirement, TournamentRegistrationRequest, TournamentTeam, TournamentTeamContactAttempt } from '../tournaments';
11
11
  import { UserDomainEvent, UserEventView } from '../user-events';
12
- export declare const DATABASE_ENTITIES: (typeof FacilityImage | typeof Facility | typeof FieldImage | typeof Field | typeof Address | typeof TournamentFacility | typeof OrganizationUserBillingInfo | typeof OrganizationUser | typeof Organization | typeof TournamentPayment | typeof PhoneNumber | typeof TournamentAllowedPhone | typeof Tournament | typeof FacilityOwner | typeof PasswordReset | typeof NotificationDelivery | typeof Notification | typeof User | typeof UserAuthProvider | typeof RefreshToken | typeof Player | typeof TournamentRegistrationRequest | typeof UserVerification | typeof PlayerPersonalData | typeof PlayerPosition | typeof PlayerTeam | typeof TeamJoinRequest | typeof TeamPlayerMergeHistory | typeof Team | typeof TournamentPlayer | typeof TournamentTeam | typeof TeamModality | typeof TournamentTeamContactAttempt | typeof TeamTrophy | typeof TournamentContact | typeof Coupon | typeof CouponUsage | typeof TournamentCoupon | typeof TournamentFormatConfig | typeof TournamentMatchGoal | typeof TournamentMatch | typeof TournamentMatchCard | typeof TournamentPenaltyShootout | typeof TournamentGroup | typeof TournamentBracketSlot | typeof TournamentMatchRule | typeof TournamentMatchSchema | typeof TournamentMatchAvailability | typeof UserPaymentProvider | typeof PaymentProvider | typeof Payment | typeof TournamentPlayerRule | typeof TournamentPrizeRule | typeof TournamentRegistrationRequirement | typeof TournamentBracket | typeof TournamentPublicationChargeRule | typeof UserDomainEvent | typeof UserEventView)[];
12
+ export declare const DATABASE_ENTITIES: (typeof FacilityImage | typeof Facility | typeof FieldImage | typeof Field | typeof Address | typeof TournamentFacility | typeof OrganizationUserBillingInfo | typeof OrganizationUser | typeof Organization | typeof TournamentPayment | typeof PhoneNumber | typeof TournamentAllowedPhone | typeof Tournament | typeof FacilityOwner | typeof PasswordReset | typeof NotificationDelivery | typeof Notification | typeof User | typeof PushDeviceToken | typeof UserAuthProvider | typeof RefreshToken | typeof Player | typeof TournamentRegistrationRequest | typeof UserVerification | typeof PlayerPersonalData | typeof PlayerPosition | typeof PlayerTeam | typeof TeamJoinRequest | typeof TeamPlayerMergeHistory | typeof Team | typeof TournamentPlayer | typeof TournamentTeam | typeof TeamModality | typeof TournamentTeamContactAttempt | typeof TeamTrophy | typeof TournamentContact | typeof Coupon | typeof CouponUsage | typeof TournamentCoupon | typeof TournamentFormatConfig | typeof TournamentMatchGoal | typeof TournamentMatch | typeof TournamentMatchCard | typeof TournamentPenaltyShootout | typeof TournamentGroup | typeof TournamentBracketSlot | typeof TournamentMatchRule | typeof TournamentMatchSchema | typeof TournamentMatchAvailability | typeof UserPaymentProvider | typeof PaymentProvider | typeof Payment | typeof TournamentPlayerRule | typeof TournamentPrizeRule | typeof TournamentRegistrationRequirement | typeof TournamentBracket | typeof TournamentPublicationChargeRule | typeof UserDomainEvent | typeof UserEventView)[];
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database-entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE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,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,+BAA+B,EAC/B,iCAAiC,EACjC,6BAA6B,EAE7B,cAAc,EACd,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,0/CA6D7B,CAAC"}
@@ -8,7 +8,7 @@ import {
8
8
  import { Coupon, CouponUsage } from "../coupons/index.js";
9
9
  import { Address, Facility, FacilityImage, FacilityOwner, Field, FieldImage } from "../facilities/index.js";
10
10
  import { TeamPlayerMergeHistory } from "../history-logs/index.js";
11
- import { Notification, NotificationDelivery } from "../notifications/index.js";
11
+ import { Notification, NotificationDelivery, PushDeviceToken } from "../notifications/index.js";
12
12
  import { Payment, PaymentProvider, UserPaymentProvider } from "../payments/index.js";
13
13
  import { Player, PlayerPersonalData, PlayerPosition } from "../players/index.js";
14
14
  import { PlayerTeam, Team, TeamJoinRequest, TeamModality, TeamTrophy } from "../teams/index.js";
@@ -95,6 +95,7 @@ const DATABASE_ENTITIES = [
95
95
  TeamJoinRequest,
96
96
  Notification,
97
97
  NotificationDelivery,
98
+ PushDeviceToken,
98
99
  PhoneNumber,
99
100
  TournamentAllowedPhone,
100
101
  TeamTrophy,
@@ -1,5 +1,6 @@
1
1
  export * from './email-templates';
2
2
  export * from './notifications';
3
3
  export * from './notification-deliveries';
4
+ export * from './push-device-tokens';
4
5
  export * from './enums';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAElC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,sBAAsB,CAAC;AAErC,cAAc,SAAS,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./email-templates/index.js";
2
2
  export * from "./notifications/index.js";
3
3
  export * from "./notification-deliveries/index.js";
4
+ export * from "./push-device-tokens/index.js";
4
5
  export * from "./enums/index.js";
@@ -0,0 +1,3 @@
1
+ export { PushTokenPlatform } from './push-token-platform.enum';
2
+ export { PushTokenProvider } from './push-token-provider.enum';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/notifications/push-device-tokens/enums/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { PushTokenPlatform } from "./push-token-platform.enum.js";
2
+ import { PushTokenProvider } from "./push-token-provider.enum.js";
3
+ export {
4
+ PushTokenPlatform,
5
+ PushTokenProvider
6
+ };
@@ -0,0 +1,7 @@
1
+ export declare enum PushTokenPlatform {
2
+ IOS = "IOS",
3
+ ANDROID = "ANDROID",
4
+ WEB = "WEB",
5
+ UNKNOWN = "UNKNOWN"
6
+ }
7
+ //# sourceMappingURL=push-token-platform.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-token-platform.enum.d.ts","sourceRoot":"","sources":["../../../../src/notifications/push-device-tokens/enums/push-token-platform.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,OAAO,YAAY;CACpB"}
@@ -0,0 +1,10 @@
1
+ var PushTokenPlatform = /* @__PURE__ */ ((PushTokenPlatform2) => {
2
+ PushTokenPlatform2["IOS"] = "IOS";
3
+ PushTokenPlatform2["ANDROID"] = "ANDROID";
4
+ PushTokenPlatform2["WEB"] = "WEB";
5
+ PushTokenPlatform2["UNKNOWN"] = "UNKNOWN";
6
+ return PushTokenPlatform2;
7
+ })(PushTokenPlatform || {});
8
+ export {
9
+ PushTokenPlatform
10
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum PushTokenProvider {
2
+ FIREBASE = "FIREBASE"
3
+ }
4
+ //# sourceMappingURL=push-token-provider.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-token-provider.enum.d.ts","sourceRoot":"","sources":["../../../../src/notifications/push-device-tokens/enums/push-token-provider.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,QAAQ,aAAa;CACtB"}
@@ -0,0 +1,7 @@
1
+ var PushTokenProvider = /* @__PURE__ */ ((PushTokenProvider2) => {
2
+ PushTokenProvider2["FIREBASE"] = "FIREBASE";
3
+ return PushTokenProvider2;
4
+ })(PushTokenProvider || {});
5
+ export {
6
+ PushTokenProvider
7
+ };
@@ -0,0 +1,3 @@
1
+ export { PushDeviceToken } from './push-device-token.entity';
2
+ export * from './enums';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/notifications/push-device-tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,cAAc,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { PushDeviceToken } from "./push-device-token.entity.js";
2
+ export * from "./enums/index.js";
3
+ export {
4
+ PushDeviceToken
5
+ };
@@ -0,0 +1,18 @@
1
+ import { User } from '../../app-auth';
2
+ import { PushTokenPlatform, PushTokenProvider } from './enums';
3
+ export declare class PushDeviceToken {
4
+ id: string;
5
+ userId: string;
6
+ provider: PushTokenProvider;
7
+ platform: PushTokenPlatform;
8
+ token: string;
9
+ tokenHash: string;
10
+ deviceId: string | null;
11
+ isActive: boolean;
12
+ lastSeenAt: Date;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ deletedAt: Date | null;
16
+ user: User;
17
+ }
18
+ //# sourceMappingURL=push-device-token.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-device-token.entity.d.ts","sourceRoot":"","sources":["../../../src/notifications/push-device-tokens/push-device-token.entity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/D,qBAWa,eAAe;IAI1B,EAAE,EAAE,MAAM,CAAC;IAOX,MAAM,EAAE,MAAM,CAAC;IAQf,QAAQ,EAAE,iBAAiB,CAAC;IAQ5B,QAAQ,EAAE,iBAAiB,CAAC;IAM5B,KAAK,EAAE,MAAM,CAAC;IAQd,SAAS,EAAE,MAAM,CAAC;IASlB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAQxB,QAAQ,EAAE,OAAO,CAAC;IAQlB,UAAU,EAAE,IAAI,CAAC;IAOjB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAMvB,IAAI,EAAE,IAAI,CAAC;CACZ"}
@@ -0,0 +1,136 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result) __defProp(target, key, result);
9
+ return result;
10
+ };
11
+ import {
12
+ Column,
13
+ CreateDateColumn,
14
+ DeleteDateColumn,
15
+ Entity,
16
+ Index,
17
+ JoinColumn,
18
+ ManyToOne,
19
+ PrimaryGeneratedColumn,
20
+ UpdateDateColumn
21
+ } from "typeorm";
22
+ import { User } from "../../app-auth/index.js";
23
+ import { PushTokenPlatform, PushTokenProvider } from "./enums/index.js";
24
+ let PushDeviceToken = class {
25
+ };
26
+ __decorateClass([
27
+ PrimaryGeneratedColumn("uuid", {
28
+ comment: "Identificador unico do token de push por dispositivo."
29
+ })
30
+ ], PushDeviceToken.prototype, "id", 2);
31
+ __decorateClass([
32
+ Column({
33
+ name: "user_id",
34
+ type: "uuid",
35
+ comment: "FK users.id."
36
+ })
37
+ ], PushDeviceToken.prototype, "userId", 2);
38
+ __decorateClass([
39
+ Column({
40
+ type: "enum",
41
+ enum: PushTokenProvider,
42
+ enumName: "PushTokenProvider",
43
+ comment: "Provedor responsavel pelo token de push."
44
+ })
45
+ ], PushDeviceToken.prototype, "provider", 2);
46
+ __decorateClass([
47
+ Column({
48
+ type: "enum",
49
+ enum: PushTokenPlatform,
50
+ enumName: "PushTokenPlatform",
51
+ comment: "Plataforma/dispositivo de origem do token."
52
+ })
53
+ ], PushDeviceToken.prototype, "platform", 2);
54
+ __decorateClass([
55
+ Column({
56
+ type: "text",
57
+ comment: "Token bruto recebido do provedor."
58
+ })
59
+ ], PushDeviceToken.prototype, "token", 2);
60
+ __decorateClass([
61
+ Column({
62
+ name: "token_hash",
63
+ type: "char",
64
+ length: 64,
65
+ comment: "Hash do token para deduplicacao sem expor valor bruto."
66
+ })
67
+ ], PushDeviceToken.prototype, "tokenHash", 2);
68
+ __decorateClass([
69
+ Column({
70
+ name: "device_id",
71
+ type: "varchar",
72
+ length: 120,
73
+ nullable: true,
74
+ comment: "Identificador do dispositivo na aplicacao cliente."
75
+ })
76
+ ], PushDeviceToken.prototype, "deviceId", 2);
77
+ __decorateClass([
78
+ Column({
79
+ name: "is_active",
80
+ type: "boolean",
81
+ default: true,
82
+ comment: "Indica se o token esta ativo para novos envios."
83
+ })
84
+ ], PushDeviceToken.prototype, "isActive", 2);
85
+ __decorateClass([
86
+ Column({
87
+ name: "last_seen_at",
88
+ type: "timestamptz",
89
+ default: () => "now()",
90
+ comment: "Ultima vez em que o token foi validado/atualizado."
91
+ })
92
+ ], PushDeviceToken.prototype, "lastSeenAt", 2);
93
+ __decorateClass([
94
+ CreateDateColumn({
95
+ name: "created_at",
96
+ type: "timestamptz",
97
+ comment: "Data/hora de criacao do registro."
98
+ })
99
+ ], PushDeviceToken.prototype, "createdAt", 2);
100
+ __decorateClass([
101
+ UpdateDateColumn({
102
+ name: "updated_at",
103
+ type: "timestamptz",
104
+ comment: "Data/hora da ultima atualizacao do registro."
105
+ })
106
+ ], PushDeviceToken.prototype, "updatedAt", 2);
107
+ __decorateClass([
108
+ DeleteDateColumn({
109
+ name: "deleted_at",
110
+ type: "timestamptz",
111
+ nullable: true,
112
+ comment: "Data/hora de remocao logica do token."
113
+ })
114
+ ], PushDeviceToken.prototype, "deletedAt", 2);
115
+ __decorateClass([
116
+ ManyToOne(() => User, (user) => user.pushDeviceTokens, {
117
+ onDelete: "CASCADE"
118
+ }),
119
+ JoinColumn({ name: "user_id" })
120
+ ], PushDeviceToken.prototype, "user", 2);
121
+ PushDeviceToken = __decorateClass([
122
+ Entity("push_device_tokens"),
123
+ Index("UQ_push_device_tokens_provider_token_hash_active", ["provider", "tokenHash"], {
124
+ unique: true,
125
+ where: '"deleted_at" IS NULL'
126
+ }),
127
+ Index("IDX_push_device_tokens_user_active_updated", ["userId", "isActive", "updatedAt"]),
128
+ Index("IDX_push_device_tokens_last_seen_at", ["lastSeenAt"]),
129
+ Index("UQ_push_device_tokens_user_provider_device_active", ["userId", "provider", "deviceId"], {
130
+ unique: true,
131
+ where: '"device_id" IS NOT NULL AND "deleted_at" IS NULL'
132
+ })
133
+ ], PushDeviceToken);
134
+ export {
135
+ PushDeviceToken
136
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -55,6 +55,7 @@
55
55
  "build:types": "tsc --emitDeclarationOnly",
56
56
  "build:js": "node build.js",
57
57
  "build": "pnpm run build:types && pnpm run build:js",
58
+ "changeset": "changeset",
58
59
  "clean": "rm -rf dist",
59
60
  "lint": "eslint src --ext .ts",
60
61
  "check:types": "tsc --noEmit",