@natrave/shared-entities 1.5.1 → 1.5.3
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 +3 -1
- package/dist/app-auth/users/user.entity.d.ts.map +1 -1
- package/dist/app-auth/users/user.entity.js +10 -1
- package/dist/database-entities/index.d.ts +2 -2
- package/dist/database-entities/index.d.ts.map +1 -1
- package/dist/database-entities/index.js +8 -1
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/push-device-tokens/enums/index.d.ts +3 -0
- package/dist/notifications/push-device-tokens/enums/index.d.ts.map +1 -0
- package/dist/notifications/push-device-tokens/enums/index.js +6 -0
- package/dist/notifications/push-device-tokens/enums/push-token-platform.enum.d.ts +7 -0
- package/dist/notifications/push-device-tokens/enums/push-token-platform.enum.d.ts.map +1 -0
- package/dist/notifications/push-device-tokens/enums/push-token-platform.enum.js +10 -0
- package/dist/notifications/push-device-tokens/enums/push-token-provider.enum.d.ts +4 -0
- package/dist/notifications/push-device-tokens/enums/push-token-provider.enum.d.ts.map +1 -0
- package/dist/notifications/push-device-tokens/enums/push-token-provider.enum.js +7 -0
- package/dist/notifications/push-device-tokens/index.d.ts +3 -0
- package/dist/notifications/push-device-tokens/index.d.ts.map +1 -0
- package/dist/notifications/push-device-tokens/index.js +5 -0
- package/dist/notifications/push-device-tokens/push-device-token.entity.d.ts +18 -0
- package/dist/notifications/push-device-tokens/push-device-token.entity.d.ts.map +1 -0
- package/dist/notifications/push-device-tokens/push-device-token.entity.js +136 -0
- package/dist/notifications/user-notification-preferences/index.d.ts +2 -0
- package/dist/notifications/user-notification-preferences/index.d.ts.map +1 -0
- package/dist/notifications/user-notification-preferences/index.js +4 -0
- package/dist/notifications/user-notification-preferences/user-notification-preference.entity.d.ts +9 -0
- package/dist/notifications/user-notification-preferences/user-notification-preference.entity.d.ts.map +1 -0
- package/dist/notifications/user-notification-preferences/user-notification-preference.entity.js +63 -0
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Notification } from '../../notifications';
|
|
1
|
+
import { Notification, PushDeviceToken, UserNotificationPreference } from '../../notifications';
|
|
2
2
|
import { Player } from '../../players';
|
|
3
3
|
import { TournamentRegistrationRequest } from '../../tournaments';
|
|
4
4
|
import { RefreshToken } from '../refresh-tokens';
|
|
@@ -23,6 +23,8 @@ export declare class User {
|
|
|
23
23
|
userAuthProviders: UserAuthProvider[];
|
|
24
24
|
player: Player;
|
|
25
25
|
notifications: Notification[];
|
|
26
|
+
pushDeviceTokens: PushDeviceToken[];
|
|
27
|
+
notificationPreference: UserNotificationPreference | null;
|
|
26
28
|
tournamentRegistrationRequests: TournamentRegistrationRequest[];
|
|
27
29
|
prepareData(): void;
|
|
28
30
|
}
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/app-auth/users/user.entity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAChG,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;IAK9B,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAKtC,MAAM,EAAE,MAAM,CAAC;IAGf,aAAa,EAAE,YAAY,EAAE,CAAC;IAG9B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAMpC,sBAAsB,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAG1D,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, UserNotificationPreference } 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,15 @@ __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);
|
|
169
|
+
__decorateClass([
|
|
170
|
+
OneToOne(
|
|
171
|
+
() => UserNotificationPreference,
|
|
172
|
+
(notificationPreference) => notificationPreference.user
|
|
173
|
+
)
|
|
174
|
+
], User.prototype, "notificationPreference", 2);
|
|
166
175
|
__decorateClass([
|
|
167
176
|
OneToMany(() => TournamentRegistrationRequest, (request) => request.requestedBy)
|
|
168
177
|
], 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, UserNotificationPreference } 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 UserNotificationPreference | 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,
|
|
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,EACL,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,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,8hDA8D7B,CAAC"}
|
|
@@ -8,7 +8,12 @@ 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 {
|
|
11
|
+
import {
|
|
12
|
+
Notification,
|
|
13
|
+
NotificationDelivery,
|
|
14
|
+
PushDeviceToken,
|
|
15
|
+
UserNotificationPreference
|
|
16
|
+
} from "../notifications/index.js";
|
|
12
17
|
import { Payment, PaymentProvider, UserPaymentProvider } from "../payments/index.js";
|
|
13
18
|
import { Player, PlayerPersonalData, PlayerPosition } from "../players/index.js";
|
|
14
19
|
import { PlayerTeam, Team, TeamJoinRequest, TeamModality, TeamTrophy } from "../teams/index.js";
|
|
@@ -95,6 +100,8 @@ const DATABASE_ENTITIES = [
|
|
|
95
100
|
TeamJoinRequest,
|
|
96
101
|
Notification,
|
|
97
102
|
NotificationDelivery,
|
|
103
|
+
PushDeviceToken,
|
|
104
|
+
UserNotificationPreference,
|
|
98
105
|
PhoneNumber,
|
|
99
106
|
TournamentAllowedPhone,
|
|
100
107
|
TeamTrophy,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './email-templates';
|
|
2
2
|
export * from './notifications';
|
|
3
3
|
export * from './notification-deliveries';
|
|
4
|
+
export * from './push-device-tokens';
|
|
5
|
+
export * from './user-notification-preferences';
|
|
4
6
|
export * from './enums';
|
|
5
7
|
//# 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,iCAAiC,CAAC;AAEhD,cAAc,SAAS,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
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";
|
|
5
|
+
export * from "./user-notification-preferences/index.js";
|
|
4
6
|
export * from "./enums/index.js";
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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,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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/notifications/user-notification-preferences/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC"}
|
package/dist/notifications/user-notification-preferences/user-notification-preference.entity.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { User } from '../../app-auth';
|
|
2
|
+
export declare class UserNotificationPreference {
|
|
3
|
+
userId: string;
|
|
4
|
+
notificationsEnabled: boolean;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
updatedAt: Date;
|
|
7
|
+
user: User;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=user-notification-preference.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-notification-preference.entity.d.ts","sourceRoot":"","sources":["../../../src/notifications/user-notification-preferences/user-notification-preference.entity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,qBACa,0BAA0B;IAMrC,MAAM,EAAE,MAAM,CAAC;IAQf,oBAAoB,EAAE,OAAO,CAAC;IAO9B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAMhB,IAAI,EAAE,IAAI,CAAC;CACZ"}
|
package/dist/notifications/user-notification-preferences/user-notification-preference.entity.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
Entity,
|
|
15
|
+
JoinColumn,
|
|
16
|
+
OneToOne,
|
|
17
|
+
PrimaryColumn,
|
|
18
|
+
UpdateDateColumn
|
|
19
|
+
} from "typeorm";
|
|
20
|
+
import { User } from "../../app-auth/index.js";
|
|
21
|
+
let UserNotificationPreference = class {
|
|
22
|
+
};
|
|
23
|
+
__decorateClass([
|
|
24
|
+
PrimaryColumn({
|
|
25
|
+
name: "user_id",
|
|
26
|
+
type: "uuid",
|
|
27
|
+
comment: "FK users.id."
|
|
28
|
+
})
|
|
29
|
+
], UserNotificationPreference.prototype, "userId", 2);
|
|
30
|
+
__decorateClass([
|
|
31
|
+
Column({
|
|
32
|
+
name: "notifications_enabled",
|
|
33
|
+
type: "boolean",
|
|
34
|
+
default: true,
|
|
35
|
+
comment: "Flag global para habilitar/desabilitar notificacoes para o usuario."
|
|
36
|
+
})
|
|
37
|
+
], UserNotificationPreference.prototype, "notificationsEnabled", 2);
|
|
38
|
+
__decorateClass([
|
|
39
|
+
CreateDateColumn({
|
|
40
|
+
name: "created_at",
|
|
41
|
+
type: "timestamptz",
|
|
42
|
+
comment: "Data/hora de criacao da preferencia."
|
|
43
|
+
})
|
|
44
|
+
], UserNotificationPreference.prototype, "createdAt", 2);
|
|
45
|
+
__decorateClass([
|
|
46
|
+
UpdateDateColumn({
|
|
47
|
+
name: "updated_at",
|
|
48
|
+
type: "timestamptz",
|
|
49
|
+
comment: "Data/hora da ultima atualizacao da preferencia."
|
|
50
|
+
})
|
|
51
|
+
], UserNotificationPreference.prototype, "updatedAt", 2);
|
|
52
|
+
__decorateClass([
|
|
53
|
+
OneToOne(() => User, (user) => user.notificationPreference, {
|
|
54
|
+
onDelete: "CASCADE"
|
|
55
|
+
}),
|
|
56
|
+
JoinColumn({ name: "user_id" })
|
|
57
|
+
], UserNotificationPreference.prototype, "user", 2);
|
|
58
|
+
UserNotificationPreference = __decorateClass([
|
|
59
|
+
Entity("user_notification_preferences")
|
|
60
|
+
], UserNotificationPreference);
|
|
61
|
+
export {
|
|
62
|
+
UserNotificationPreference
|
|
63
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@natrave/shared-entities",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
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",
|