@natrave/shared-entities 1.5.2 → 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 +2 -1
- package/dist/app-auth/users/user.entity.d.ts.map +1 -1
- package/dist/app-auth/users/user.entity.js +7 -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 +7 -1
- package/dist/notifications/index.d.ts +1 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +1 -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 +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Notification, PushDeviceToken } 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';
|
|
@@ -24,6 +24,7 @@ export declare class User {
|
|
|
24
24
|
player: Player;
|
|
25
25
|
notifications: Notification[];
|
|
26
26
|
pushDeviceTokens: PushDeviceToken[];
|
|
27
|
+
notificationPreference: UserNotificationPreference | null;
|
|
27
28
|
tournamentRegistrationRequests: TournamentRegistrationRequest[];
|
|
28
29
|
prepareData(): void;
|
|
29
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,YA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,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, PushDeviceToken } 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";
|
|
@@ -166,6 +166,12 @@ __decorateClass([
|
|
|
166
166
|
__decorateClass([
|
|
167
167
|
OneToMany(() => PushDeviceToken, (pushDeviceToken) => pushDeviceToken.user)
|
|
168
168
|
], User.prototype, "pushDeviceTokens", 2);
|
|
169
|
+
__decorateClass([
|
|
170
|
+
OneToOne(
|
|
171
|
+
() => UserNotificationPreference,
|
|
172
|
+
(notificationPreference) => notificationPreference.user
|
|
173
|
+
)
|
|
174
|
+
], User.prototype, "notificationPreference", 2);
|
|
169
175
|
__decorateClass([
|
|
170
176
|
OneToMany(() => TournamentRegistrationRequest, (request) => request.requestedBy)
|
|
171
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, PushDeviceToken } 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 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)[];
|
|
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,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AClB,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";
|
|
@@ -96,6 +101,7 @@ const DATABASE_ENTITIES = [
|
|
|
96
101
|
Notification,
|
|
97
102
|
NotificationDelivery,
|
|
98
103
|
PushDeviceToken,
|
|
104
|
+
UserNotificationPreference,
|
|
99
105
|
PhoneNumber,
|
|
100
106
|
TournamentAllowedPhone,
|
|
101
107
|
TeamTrophy,
|
|
@@ -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,sBAAsB,CAAC;AAErC,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"}
|
|
@@ -2,4 +2,5 @@ export * from "./email-templates/index.js";
|
|
|
2
2
|
export * from "./notifications/index.js";
|
|
3
3
|
export * from "./notification-deliveries/index.js";
|
|
4
4
|
export * from "./push-device-tokens/index.js";
|
|
5
|
+
export * from "./user-notification-preferences/index.js";
|
|
5
6
|
export * from "./enums/index.js";
|
|
@@ -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
|
+
};
|