@earbug/db-models 0.0.7 → 0.0.9

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 (138) hide show
  1. package/dist/AppUser.d.ts +28 -5
  2. package/dist/AppUser.js +13 -13
  3. package/dist/AppUserDevice.d.ts +4 -4
  4. package/dist/AppUserDevice.js +8 -8
  5. package/dist/AppUserFollowRelation.d.ts +3 -3
  6. package/dist/AppUserFollowRelation.js +6 -6
  7. package/dist/AppUserPlatformRelation.d.ts +7 -7
  8. package/dist/AppUserPlatformRelation.js +18 -18
  9. package/dist/CanonAlbum.d.ts +5 -5
  10. package/dist/CanonAlbum.js +10 -10
  11. package/dist/CanonAlbumImageHarvested.d.ts +9 -9
  12. package/dist/CanonAlbumImageHarvested.js +24 -32
  13. package/dist/CanonArtist.d.ts +3 -3
  14. package/dist/CanonArtist.js +6 -6
  15. package/dist/CanonArtistImageHarvested.d.ts +9 -9
  16. package/dist/CanonArtistImageHarvested.js +24 -24
  17. package/dist/CanonGenre.d.ts +3 -3
  18. package/dist/CanonGenre.js +6 -6
  19. package/dist/CanonLabel.d.ts +2 -2
  20. package/dist/CanonLabel.js +6 -6
  21. package/dist/CanonMember.d.ts +3 -3
  22. package/dist/CanonMember.js +6 -6
  23. package/dist/CanonMemberExternalReferenceRelation.d.ts +2 -2
  24. package/dist/CanonMemberExternalReferenceRelation.js +5 -5
  25. package/dist/CanonTrack.d.ts +5 -5
  26. package/dist/CanonTrack.js +11 -11
  27. package/dist/ConfigParam.d.ts +2 -2
  28. package/dist/ConfigParam.js +5 -5
  29. package/dist/ExternalReference.d.ts +2 -2
  30. package/dist/ExternalReference.js +5 -5
  31. package/dist/JukeboxAccessType.d.ts +2 -2
  32. package/dist/JukeboxAccessType.js +4 -4
  33. package/dist/JukeboxCanonGenreRelation.d.ts +2 -2
  34. package/dist/JukeboxCanonGenreRelation.js +6 -6
  35. package/dist/JukeboxInvite.d.ts +3 -3
  36. package/dist/JukeboxInvite.js +6 -6
  37. package/dist/JukeboxQueueEntry.d.ts +10 -10
  38. package/dist/JukeboxQueueEntry.js +12 -12
  39. package/dist/JukeboxQueueMode.d.ts +2 -2
  40. package/dist/JukeboxQueueMode.js +4 -4
  41. package/dist/JukeboxSession.d.ts +21 -9
  42. package/dist/JukeboxSession.js +20 -20
  43. package/dist/JukeboxTerminationCondition.d.ts +2 -2
  44. package/dist/JukeboxTerminationCondition.js +4 -4
  45. package/dist/JukeboxType.d.ts +2 -2
  46. package/dist/JukeboxType.js +4 -4
  47. package/dist/JukeboxUser.d.ts +7 -7
  48. package/dist/JukeboxUser.js +20 -20
  49. package/dist/KnexMigrations.d.ts +3 -3
  50. package/dist/KnexMigrations.js +6 -6
  51. package/dist/KnexMigrationsLock.d.ts +3 -3
  52. package/dist/KnexMigrationsLock.js +5 -5
  53. package/dist/MetricsDaily.d.ts +3 -3
  54. package/dist/MetricsDaily.js +4 -4
  55. package/dist/NewsSite.d.ts +3 -3
  56. package/dist/NewsSite.js +6 -6
  57. package/dist/Notification.d.ts +62 -0
  58. package/dist/Notification.js +163 -0
  59. package/dist/NotificationType.d.ts +26 -0
  60. package/dist/NotificationType.js +42 -0
  61. package/dist/Platform.d.ts +2 -2
  62. package/dist/Platform.js +7 -7
  63. package/dist/PlatformAlbum.d.ts +5 -5
  64. package/dist/PlatformAlbum.js +10 -10
  65. package/dist/PlatformArtist.d.ts +5 -5
  66. package/dist/PlatformArtist.js +10 -10
  67. package/dist/PlatformGenre.d.ts +2 -2
  68. package/dist/PlatformGenre.js +6 -6
  69. package/dist/PlatformTrack.d.ts +3 -3
  70. package/dist/PlatformTrack.js +6 -6
  71. package/dist/PlatformUserAlbum.d.ts +2 -2
  72. package/dist/PlatformUserAlbum.js +6 -6
  73. package/dist/PlatformUserAlbumTrack.d.ts +4 -4
  74. package/dist/PlatformUserAlbumTrack.js +11 -11
  75. package/dist/PlatformUserPlaylist.d.ts +5 -5
  76. package/dist/PlatformUserPlaylist.js +11 -11
  77. package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
  78. package/dist/PlatformUserPlaylistTrack.js +17 -17
  79. package/dist/PlaybackStatus.d.ts +2 -14
  80. package/dist/PlaybackStatus.js +4 -4
  81. package/dist/PlaybackStatusType.d.ts +12 -0
  82. package/dist/State.d.ts +2 -2
  83. package/dist/State.js +4 -4
  84. package/dist/UnmatchedAlbum.d.ts +2 -2
  85. package/dist/UnmatchedAlbum.js +6 -6
  86. package/dist/UnmatchedArtist.d.ts +2 -2
  87. package/dist/UnmatchedArtist.js +6 -6
  88. package/dist/UserContacts.d.ts +3 -3
  89. package/dist/UserContacts.js +7 -7
  90. package/dist/init-models.d.ts +8 -2
  91. package/dist/init-models.js +20 -4
  92. package/models/AppUser.ts +43 -18
  93. package/models/AppUserDevice.ts +12 -12
  94. package/models/AppUserFollowRelation.ts +9 -9
  95. package/models/AppUserPlatformRelation.ts +25 -25
  96. package/models/CanonAlbum.ts +15 -15
  97. package/models/CanonAlbumImageHarvested.ts +33 -41
  98. package/models/CanonArtist.ts +9 -9
  99. package/models/CanonArtistImageHarvested.ts +33 -33
  100. package/models/CanonGenre.ts +9 -9
  101. package/models/CanonLabel.ts +8 -8
  102. package/models/CanonMember.ts +9 -9
  103. package/models/CanonMemberExternalReferenceRelation.ts +7 -7
  104. package/models/CanonTrack.ts +16 -16
  105. package/models/ConfigParam.ts +7 -7
  106. package/models/ExternalReference.ts +7 -7
  107. package/models/JukeboxAccessType.ts +6 -6
  108. package/models/JukeboxCanonGenreRelation.ts +8 -8
  109. package/models/JukeboxInvite.ts +9 -9
  110. package/models/JukeboxQueueEntry.ts +23 -23
  111. package/models/JukeboxQueueMode.ts +6 -6
  112. package/models/JukeboxSession.ts +42 -29
  113. package/models/JukeboxTerminationCondition.ts +6 -6
  114. package/models/JukeboxType.ts +6 -6
  115. package/models/JukeboxUser.ts +27 -27
  116. package/models/KnexMigrations.ts +9 -9
  117. package/models/KnexMigrationsLock.ts +8 -8
  118. package/models/MetricsDaily.ts +7 -7
  119. package/models/NewsSite.ts +9 -9
  120. package/models/Notification.ts +202 -0
  121. package/models/NotificationType.ts +66 -0
  122. package/models/Platform.ts +9 -9
  123. package/models/PlatformAlbum.ts +15 -15
  124. package/models/PlatformArtist.ts +15 -15
  125. package/models/PlatformGenre.ts +8 -8
  126. package/models/PlatformTrack.ts +9 -9
  127. package/models/PlatformUserAlbum.ts +8 -8
  128. package/models/PlatformUserAlbumTrack.ts +15 -15
  129. package/models/PlatformUserPlaylist.ts +16 -16
  130. package/models/PlatformUserPlaylistTrack.ts +24 -24
  131. package/models/PlaybackStatus.ts +6 -19
  132. package/models/PlaybackStatusType.ts +13 -0
  133. package/models/State.ts +6 -6
  134. package/models/UnmatchedAlbum.ts +8 -8
  135. package/models/UnmatchedArtist.ts +8 -8
  136. package/models/UserContacts.ts +10 -10
  137. package/models/init-models.ts +24 -2
  138. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformAlbumGenreRelation = exports.PlatformAlbum = exports.Platform = exports.PauseStatusType = exports.NewsSite = exports.MetricsEvent = exports.MetricsDaily = exports.KnexMigrationsLock = exports.KnexMigrations = exports.JukeboxUserType = exports.JukeboxUser = exports.JukeboxType = exports.JukeboxTerminationCondition = exports.JukeboxStatus = exports.JukeboxSession = exports.JukeboxQueueMode = exports.JukeboxQueueEntry = exports.JukeboxInvite = exports.JukeboxCanonGenreRelation = exports.JukeboxAccessType = exports.ExternalReference = exports.ConfigParam = exports.CanonTrack = exports.CanonToPlatformTrackRelation = exports.CanonToPlatformGenreRelation = exports.CanonToPlatformArtistRelation = exports.CanonToPlatformAlbumRelation = exports.CanonMemberExternalReferenceRelation = exports.CanonMember = exports.CanonLabelExternalReferenceRelation = exports.CanonLabel = exports.CanonGenreExternalReferenceRelation = exports.CanonGenre = exports.CanonArtistTrackRelation = exports.CanonArtistMemberRelation = exports.CanonArtistImageHarvested = exports.CanonArtistGenreRelation = exports.CanonArtistExternalReferenceRelation = exports.CanonArtistAlbumRelation = exports.CanonArtist = exports.CanonAlbumTrackRelation = exports.CanonAlbumLabelRelation = exports.CanonAlbumImageHarvested = exports.CanonAlbumGenreRelation = exports.CanonAlbumExternalReferenceRelation = exports.CanonAlbum = exports.AppUserPlatformRelation = exports.AppUserFollowRelation = exports.AppUserDevice = exports.AppUser = void 0;
4
- exports.UserContacts = exports.UnmatchedArtist = exports.UnmatchedAlbum = exports.TrackDeletionReason = exports.State = exports.PlaybackStatusType = exports.PlaybackStatus = exports.PlatformUserPlaylistTrack = exports.PlatformUserPlaylist = exports.PlatformUserAlbumTrack = exports.PlatformUserAlbum = exports.PlatformTrackGenreRelation = exports.PlatformTrack = exports.PlatformGenre = exports.PlatformArtistTrackRelation = exports.PlatformArtistGenreRelation = exports.PlatformArtistAlbumRelation = exports.PlatformArtist = exports.PlatformAlbumTrackRelation = void 0;
3
+ exports.Platform = exports.PauseStatusType = exports.NotificationType = exports.Notification = exports.NewsSite = exports.MetricsEvent = exports.MetricsDaily = exports.KnexMigrationsLock = exports.KnexMigrations = exports.JukeboxUserType = exports.JukeboxUser = exports.JukeboxType = exports.JukeboxTerminationCondition = exports.JukeboxStatus = exports.JukeboxSession = exports.JukeboxQueueMode = exports.JukeboxQueueEntry = exports.JukeboxInvite = exports.JukeboxCanonGenreRelation = exports.JukeboxAccessType = exports.ExternalReference = exports.ConfigParam = exports.CanonTrack = exports.CanonToPlatformTrackRelation = exports.CanonToPlatformGenreRelation = exports.CanonToPlatformArtistRelation = exports.CanonToPlatformAlbumRelation = exports.CanonMemberExternalReferenceRelation = exports.CanonMember = exports.CanonLabelExternalReferenceRelation = exports.CanonLabel = exports.CanonGenreExternalReferenceRelation = exports.CanonGenre = exports.CanonArtistTrackRelation = exports.CanonArtistMemberRelation = exports.CanonArtistImageHarvested = exports.CanonArtistGenreRelation = exports.CanonArtistExternalReferenceRelation = exports.CanonArtistAlbumRelation = exports.CanonArtist = exports.CanonAlbumTrackRelation = exports.CanonAlbumLabelRelation = exports.CanonAlbumImageHarvested = exports.CanonAlbumGenreRelation = exports.CanonAlbumExternalReferenceRelation = exports.CanonAlbum = exports.AppUserPlatformRelation = exports.AppUserFollowRelation = exports.AppUserDevice = exports.AppUser = void 0;
4
+ exports.UserContacts = exports.UnmatchedArtist = exports.UnmatchedAlbum = exports.TrackDeletionReason = exports.State = exports.PlaybackStatusType = exports.PlaybackStatus = exports.PlatformUserPlaylistTrack = exports.PlatformUserPlaylist = exports.PlatformUserAlbumTrack = exports.PlatformUserAlbum = exports.PlatformTrackGenreRelation = exports.PlatformTrack = exports.PlatformGenre = exports.PlatformArtistTrackRelation = exports.PlatformArtistGenreRelation = exports.PlatformArtistAlbumRelation = exports.PlatformArtist = exports.PlatformAlbumTrackRelation = exports.PlatformAlbumGenreRelation = exports.PlatformAlbum = void 0;
5
5
  exports.initModels = initModels;
6
6
  const AppUser_1 = require("./AppUser");
7
7
  Object.defineProperty(exports, "AppUser", { enumerable: true, get: function () { return AppUser_1.AppUser; } });
@@ -95,6 +95,10 @@ const MetricsEvent_1 = require("./MetricsEvent");
95
95
  Object.defineProperty(exports, "MetricsEvent", { enumerable: true, get: function () { return MetricsEvent_1.MetricsEvent; } });
96
96
  const NewsSite_1 = require("./NewsSite");
97
97
  Object.defineProperty(exports, "NewsSite", { enumerable: true, get: function () { return NewsSite_1.NewsSite; } });
98
+ const Notification_1 = require("./Notification");
99
+ Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return Notification_1.Notification; } });
100
+ const NotificationType_1 = require("./NotificationType");
101
+ Object.defineProperty(exports, "NotificationType", { enumerable: true, get: function () { return NotificationType_1.NotificationType; } });
98
102
  const PauseStatusType_1 = require("./PauseStatusType");
99
103
  Object.defineProperty(exports, "PauseStatusType", { enumerable: true, get: function () { return PauseStatusType_1.PauseStatusType; } });
100
104
  const Platform_1 = require("./Platform");
@@ -188,6 +192,8 @@ function initModels(sequelize) {
188
192
  const MetricsDaily = MetricsDaily_1.MetricsDaily.initModel(sequelize);
189
193
  const MetricsEvent = MetricsEvent_1.MetricsEvent.initModel(sequelize);
190
194
  const NewsSite = NewsSite_1.NewsSite.initModel(sequelize);
195
+ const Notification = Notification_1.Notification.initModel(sequelize);
196
+ const NotificationType = NotificationType_1.NotificationType.initModel(sequelize);
191
197
  const PauseStatusType = PauseStatusType_1.PauseStatusType.initModel(sequelize);
192
198
  const Platform = Platform_1.Platform.initModel(sequelize);
193
199
  const PlatformAlbum = PlatformAlbum_1.PlatformAlbum.initModel(sequelize);
@@ -271,6 +277,10 @@ function initModels(sequelize) {
271
277
  AppUser.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "trackAddedUserId" });
272
278
  JukeboxUser.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId" });
273
279
  AppUser.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "appUserId" });
280
+ Notification.belongsTo(AppUser, { as: "sourceUser", foreignKey: "sourceUserId" });
281
+ AppUser.hasMany(Notification, { as: "notifications", foreignKey: "sourceUserId" });
282
+ Notification.belongsTo(AppUser, { as: "targetUser", foreignKey: "targetUserId" });
283
+ AppUser.hasMany(Notification, { as: "targetUserNotifications", foreignKey: "targetUserId" });
274
284
  PlatformUserAlbum.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId" });
275
285
  AppUser.hasMany(PlatformUserAlbum, { as: "platformUserAlbums", foreignKey: "appUserId" });
276
286
  PlatformUserPlaylist.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId" });
@@ -343,6 +353,8 @@ function initModels(sequelize) {
343
353
  JukeboxSession.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "jukeboxSessionId" });
344
354
  JukeboxUser.belongsTo(JukeboxSession, { as: "jukeboxSession", foreignKey: "jukeboxSessionId" });
345
355
  JukeboxSession.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "jukeboxSessionId" });
356
+ Notification.belongsTo(JukeboxSession, { as: "jukeboxSession", foreignKey: "jukeboxSessionId" });
357
+ JukeboxSession.hasMany(Notification, { as: "notifications", foreignKey: "jukeboxSessionId" });
346
358
  JukeboxSession.belongsTo(JukeboxStatus, { as: "jukeboxStatus", foreignKey: "jukeboxStatusId" });
347
359
  JukeboxStatus.hasMany(JukeboxSession, { as: "jukeboxSessions", foreignKey: "jukeboxStatusId" });
348
360
  JukeboxSession.belongsTo(JukeboxTerminationCondition, { as: "terminationCondition", foreignKey: "terminationConditionId" });
@@ -351,6 +363,8 @@ function initModels(sequelize) {
351
363
  JukeboxType.hasMany(JukeboxSession, { as: "jukeboxSessions", foreignKey: "typeId" });
352
364
  JukeboxUser.belongsTo(JukeboxUserType, { as: "jukeboxUserType", foreignKey: "jukeboxUserTypeId" });
353
365
  JukeboxUserType.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "jukeboxUserTypeId" });
366
+ Notification.belongsTo(NotificationType, { as: "notificationType", foreignKey: "notificationTypeId" });
367
+ NotificationType.hasMany(Notification, { as: "notifications", foreignKey: "notificationTypeId" });
354
368
  JukeboxUser.belongsTo(PauseStatusType, { as: "pauseStatusType", foreignKey: "pauseStatusTypeId" });
355
369
  PauseStatusType.hasMany(JukeboxUser, { as: "jukeboxUsers", foreignKey: "pauseStatusTypeId" });
356
370
  AppUserPlatformRelation.belongsTo(Platform, { as: "platform", foreignKey: "platformId" });
@@ -427,8 +441,8 @@ function initModels(sequelize) {
427
441
  PlatformUserAlbum.hasMany(PlatformUserAlbumTrack, { as: "platformUserAlbumTracks", foreignKey: "platformUserAlbumId" });
428
442
  PlatformUserPlaylistTrack.belongsTo(PlatformUserPlaylist, { as: "platformUserPlaylist", foreignKey: "platformUserPlaylistId" });
429
443
  PlatformUserPlaylist.hasMany(PlatformUserPlaylistTrack, { as: "platformUserPlaylistTracks", foreignKey: "platformUserPlaylistId" });
430
- JukeboxQueueEntry.belongsTo(PlaybackStatus, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId" });
431
- PlaybackStatus.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId" });
444
+ JukeboxQueueEntry.belongsTo(PlaybackStatusType, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId" });
445
+ PlaybackStatusType.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId" });
432
446
  AppUser.belongsTo(State, { as: "state", foreignKey: "stateId" });
433
447
  State.hasMany(AppUser, { as: "appUsers", foreignKey: "stateId" });
434
448
  PlatformUserPlaylist.belongsTo(State, { as: "state", foreignKey: "stateId" });
@@ -484,6 +498,8 @@ function initModels(sequelize) {
484
498
  MetricsDaily: MetricsDaily,
485
499
  MetricsEvent: MetricsEvent,
486
500
  NewsSite: NewsSite,
501
+ Notification: Notification,
502
+ NotificationType: NotificationType,
487
503
  PauseStatusType: PauseStatusType,
488
504
  Platform: Platform,
489
505
  PlatformAlbum: PlatformAlbum,
package/models/AppUser.ts CHANGED
@@ -6,19 +6,20 @@ import type { AppUserPlatformRelation, AppUserPlatformRelationCreationAttributes
6
6
  import type { JukeboxInvite, JukeboxInviteId } from './JukeboxInvite';
7
7
  import type { JukeboxQueueEntry, JukeboxQueueEntryId } from './JukeboxQueueEntry';
8
8
  import type { JukeboxUser, JukeboxUserId } from './JukeboxUser';
9
+ import type { Notification, NotificationId } from './Notification';
9
10
  import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum';
10
11
  import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
11
12
  import type { State, StateId } from './State';
12
13
  import type { UserContacts, UserContactsId } from './UserContacts';
13
14
 
14
15
  export interface AppUserAttributes {
15
- id: string;
16
16
  email: string;
17
17
  firstName: string;
18
+ id: string;
18
19
  createDate: Date;
19
20
  updateDate: Date;
20
- stateId: number;
21
21
  syncContacts?: boolean;
22
+ stateId?: number;
22
23
  lastName?: string;
23
24
  autoApproveFollowers: boolean;
24
25
  lastHarvested?: Date;
@@ -27,17 +28,17 @@ export interface AppUserAttributes {
27
28
 
28
29
  export type AppUserPk = "id";
29
30
  export type AppUserId = AppUser[AppUserPk];
30
- export type AppUserOptionalAttributes = "id" | "createDate" | "updateDate" | "stateId" | "syncContacts" | "lastName" | "autoApproveFollowers" | "lastHarvested" | "lastHarvestedError";
31
+ export type AppUserOptionalAttributes = "id" | "createDate" | "updateDate" | "syncContacts" | "stateId" | "lastName" | "autoApproveFollowers" | "lastHarvested" | "lastHarvestedError";
31
32
  export type AppUserCreationAttributes = Optional<AppUserAttributes, AppUserOptionalAttributes>;
32
33
 
33
34
  export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes> implements AppUserAttributes {
34
- id!: string;
35
35
  email!: string;
36
36
  firstName!: string;
37
+ id!: string;
37
38
  createDate!: Date;
38
39
  updateDate!: Date;
39
- stateId!: number;
40
40
  syncContacts?: boolean;
41
+ stateId?: number;
41
42
  lastName?: string;
42
43
  autoApproveFollowers!: boolean;
43
44
  lastHarvested?: Date;
@@ -132,6 +133,30 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
132
133
  hasJukeboxUser!: Sequelize.HasManyHasAssociationMixin<JukeboxUser, JukeboxUserId>;
133
134
  hasJukeboxUsers!: Sequelize.HasManyHasAssociationsMixin<JukeboxUser, JukeboxUserId>;
134
135
  countJukeboxUsers!: Sequelize.HasManyCountAssociationsMixin;
136
+ // AppUser hasMany Notification via sourceUserId
137
+ notifications!: Notification[];
138
+ getNotifications!: Sequelize.HasManyGetAssociationsMixin<Notification>;
139
+ setNotifications!: Sequelize.HasManySetAssociationsMixin<Notification, NotificationId>;
140
+ addNotification!: Sequelize.HasManyAddAssociationMixin<Notification, NotificationId>;
141
+ addNotifications!: Sequelize.HasManyAddAssociationsMixin<Notification, NotificationId>;
142
+ createNotification!: Sequelize.HasManyCreateAssociationMixin<Notification>;
143
+ removeNotification!: Sequelize.HasManyRemoveAssociationMixin<Notification, NotificationId>;
144
+ removeNotifications!: Sequelize.HasManyRemoveAssociationsMixin<Notification, NotificationId>;
145
+ hasNotification!: Sequelize.HasManyHasAssociationMixin<Notification, NotificationId>;
146
+ hasNotifications!: Sequelize.HasManyHasAssociationsMixin<Notification, NotificationId>;
147
+ countNotifications!: Sequelize.HasManyCountAssociationsMixin;
148
+ // AppUser hasMany Notification via targetUserId
149
+ targetUserNotifications!: Notification[];
150
+ getTargetUserNotifications!: Sequelize.HasManyGetAssociationsMixin<Notification>;
151
+ setTargetUserNotifications!: Sequelize.HasManySetAssociationsMixin<Notification, NotificationId>;
152
+ addTargetUserNotification!: Sequelize.HasManyAddAssociationMixin<Notification, NotificationId>;
153
+ addTargetUserNotifications!: Sequelize.HasManyAddAssociationsMixin<Notification, NotificationId>;
154
+ createTargetUserNotification!: Sequelize.HasManyCreateAssociationMixin<Notification>;
155
+ removeTargetUserNotification!: Sequelize.HasManyRemoveAssociationMixin<Notification, NotificationId>;
156
+ removeTargetUserNotifications!: Sequelize.HasManyRemoveAssociationsMixin<Notification, NotificationId>;
157
+ hasTargetUserNotification!: Sequelize.HasManyHasAssociationMixin<Notification, NotificationId>;
158
+ hasTargetUserNotifications!: Sequelize.HasManyHasAssociationsMixin<Notification, NotificationId>;
159
+ countTargetUserNotifications!: Sequelize.HasManyCountAssociationsMixin;
135
160
  // AppUser hasMany PlatformUserAlbum via appUserId
136
161
  platformUserAlbums!: PlatformUserAlbum[];
137
162
  getPlatformUserAlbums!: Sequelize.HasManyGetAssociationsMixin<PlatformUserAlbum>;
@@ -176,12 +201,6 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
176
201
 
177
202
  static initModel(sequelize: Sequelize.Sequelize): typeof AppUser {
178
203
  return AppUser.init({
179
- id: {
180
- type: DataTypes.UUID,
181
- allowNull: false,
182
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
183
- primaryKey: true
184
- },
185
204
  email: {
186
205
  type: DataTypes.TEXT,
187
206
  allowNull: false,
@@ -192,6 +211,12 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
192
211
  allowNull: false,
193
212
  field: 'first_name'
194
213
  },
214
+ id: {
215
+ type: DataTypes.UUID,
216
+ allowNull: false,
217
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
218
+ primaryKey: true
219
+ },
195
220
  createDate: {
196
221
  type: DataTypes.DATE,
197
222
  allowNull: false,
@@ -204,9 +229,15 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
204
229
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
205
230
  field: 'update_date'
206
231
  },
232
+ syncContacts: {
233
+ type: DataTypes.BOOLEAN,
234
+ allowNull: true,
235
+ defaultValue: false,
236
+ field: 'sync_contacts'
237
+ },
207
238
  stateId: {
208
239
  type: DataTypes.SMALLINT,
209
- allowNull: false,
240
+ allowNull: true,
210
241
  defaultValue: 0,
211
242
  references: {
212
243
  model: 'state',
@@ -214,12 +245,6 @@ export class AppUser extends Model<AppUserAttributes, AppUserCreationAttributes>
214
245
  },
215
246
  field: 'state_id'
216
247
  },
217
- syncContacts: {
218
- type: DataTypes.BOOLEAN,
219
- allowNull: true,
220
- defaultValue: false,
221
- field: 'sync_contacts'
222
- },
223
248
  lastName: {
224
249
  type: DataTypes.TEXT,
225
250
  allowNull: true,
@@ -4,10 +4,10 @@ import type { AppUser, AppUserId } from './AppUser';
4
4
 
5
5
  export interface AppUserDeviceAttributes {
6
6
  id: string;
7
+ createdAt: Date;
7
8
  appUserId: string;
8
- platformId: number;
9
+ devicePlatformId: number;
9
10
  endpointArn: string;
10
- createdAt: Date;
11
11
  }
12
12
 
13
13
  export type AppUserDevicePk = "id";
@@ -17,10 +17,10 @@ export type AppUserDeviceCreationAttributes = Optional<AppUserDeviceAttributes,
17
17
 
18
18
  export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceCreationAttributes> implements AppUserDeviceAttributes {
19
19
  id!: string;
20
+ createdAt!: Date;
20
21
  appUserId!: string;
21
- platformId!: number;
22
+ devicePlatformId!: number;
22
23
  endpointArn!: string;
23
- createdAt!: Date;
24
24
 
25
25
  // AppUserDevice belongsTo AppUser via appUserId
26
26
  appUser!: AppUser;
@@ -36,6 +36,12 @@ export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceC
36
36
  defaultValue: DataTypes.UUIDV4,
37
37
  primaryKey: true
38
38
  },
39
+ createdAt: {
40
+ type: DataTypes.DATE,
41
+ allowNull: false,
42
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
43
+ field: 'created_at'
44
+ },
39
45
  appUserId: {
40
46
  type: DataTypes.UUID,
41
47
  allowNull: false,
@@ -45,22 +51,16 @@ export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceC
45
51
  },
46
52
  field: 'app_user_id'
47
53
  },
48
- platformId: {
54
+ devicePlatformId: {
49
55
  type: DataTypes.SMALLINT,
50
56
  allowNull: false,
51
- field: 'platform_id'
57
+ field: 'device_platform_id'
52
58
  },
53
59
  endpointArn: {
54
60
  type: DataTypes.TEXT,
55
61
  allowNull: false,
56
62
  unique: "unique_app_user_device_endpoint_arn",
57
63
  field: 'endpoint_arn'
58
- },
59
- createdAt: {
60
- type: DataTypes.DATE,
61
- allowNull: false,
62
- defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
63
- field: 'created_at'
64
64
  }
65
65
  }, {
66
66
  sequelize,
@@ -3,28 +3,28 @@ import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { AppUser, AppUserId } from './AppUser';
4
4
 
5
5
  export interface AppUserFollowRelationAttributes {
6
- id: string;
7
6
  appUserId: string;
8
7
  followingAppUserId: string;
9
8
  stateId: number;
10
9
  isBlocked: boolean;
11
10
  createdAt: Date;
12
11
  updatedAt: Date;
12
+ id: string;
13
13
  }
14
14
 
15
15
  export type AppUserFollowRelationPk = "id";
16
16
  export type AppUserFollowRelationId = AppUserFollowRelation[AppUserFollowRelationPk];
17
- export type AppUserFollowRelationOptionalAttributes = "id" | "stateId" | "createdAt" | "updatedAt";
17
+ export type AppUserFollowRelationOptionalAttributes = "stateId" | "createdAt" | "updatedAt" | "id";
18
18
  export type AppUserFollowRelationCreationAttributes = Optional<AppUserFollowRelationAttributes, AppUserFollowRelationOptionalAttributes>;
19
19
 
20
20
  export class AppUserFollowRelation extends Model<AppUserFollowRelationAttributes, AppUserFollowRelationCreationAttributes> implements AppUserFollowRelationAttributes {
21
- id!: string;
22
21
  appUserId!: string;
23
22
  followingAppUserId!: string;
24
23
  stateId!: number;
25
24
  isBlocked!: boolean;
26
25
  createdAt!: Date;
27
26
  updatedAt!: Date;
27
+ id!: string;
28
28
 
29
29
  // AppUserFollowRelation belongsTo AppUser via appUserId
30
30
  appUser!: AppUser;
@@ -39,12 +39,6 @@ export class AppUserFollowRelation extends Model<AppUserFollowRelationAttributes
39
39
 
40
40
  static initModel(sequelize: Sequelize.Sequelize): typeof AppUserFollowRelation {
41
41
  return AppUserFollowRelation.init({
42
- id: {
43
- type: DataTypes.UUID,
44
- allowNull: false,
45
- defaultValue: DataTypes.UUIDV4,
46
- primaryKey: true
47
- },
48
42
  appUserId: {
49
43
  type: DataTypes.UUID,
50
44
  allowNull: false,
@@ -88,6 +82,12 @@ export class AppUserFollowRelation extends Model<AppUserFollowRelationAttributes
88
82
  allowNull: false,
89
83
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
90
84
  field: 'updated_at'
85
+ },
86
+ id: {
87
+ type: DataTypes.UUID,
88
+ allowNull: false,
89
+ defaultValue: DataTypes.UUIDV4,
90
+ primaryKey: true
91
91
  }
92
92
  }, {
93
93
  sequelize,
@@ -4,35 +4,35 @@ import type { AppUser, AppUserId } from './AppUser';
4
4
  import type { Platform, PlatformId } from './Platform';
5
5
 
6
6
  export interface AppUserPlatformRelationAttributes {
7
- id: string;
8
7
  appUserId: string;
9
8
  platformId: number;
10
9
  externalUserId: string;
11
- createDate: Date;
12
- updateDate: Date;
13
10
  accessToken: string;
14
11
  refreshToken?: string;
15
12
  expirationDate: Date;
16
13
  countryCode: string;
14
+ id: string;
15
+ createDate: Date;
16
+ updateDate: Date;
17
17
  stateId: number;
18
18
  }
19
19
 
20
20
  export type AppUserPlatformRelationPk = "id";
21
21
  export type AppUserPlatformRelationId = AppUserPlatformRelation[AppUserPlatformRelationPk];
22
- export type AppUserPlatformRelationOptionalAttributes = "id" | "createDate" | "updateDate" | "refreshToken" | "stateId";
22
+ export type AppUserPlatformRelationOptionalAttributes = "refreshToken" | "id" | "createDate" | "updateDate" | "stateId";
23
23
  export type AppUserPlatformRelationCreationAttributes = Optional<AppUserPlatformRelationAttributes, AppUserPlatformRelationOptionalAttributes>;
24
24
 
25
25
  export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttributes, AppUserPlatformRelationCreationAttributes> implements AppUserPlatformRelationAttributes {
26
- id!: string;
27
26
  appUserId!: string;
28
27
  platformId!: number;
29
28
  externalUserId!: string;
30
- createDate!: Date;
31
- updateDate!: Date;
32
29
  accessToken!: string;
33
30
  refreshToken?: string;
34
31
  expirationDate!: Date;
35
32
  countryCode!: string;
33
+ id!: string;
34
+ createDate!: Date;
35
+ updateDate!: Date;
36
36
  stateId!: number;
37
37
 
38
38
  // AppUserPlatformRelation belongsTo AppUser via appUserId
@@ -48,12 +48,6 @@ export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttrib
48
48
 
49
49
  static initModel(sequelize: Sequelize.Sequelize): typeof AppUserPlatformRelation {
50
50
  return AppUserPlatformRelation.init({
51
- id: {
52
- type: DataTypes.UUID,
53
- allowNull: false,
54
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
55
- primaryKey: true
56
- },
57
51
  appUserId: {
58
52
  type: DataTypes.UUID,
59
53
  allowNull: false,
@@ -78,18 +72,6 @@ export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttrib
78
72
  allowNull: false,
79
73
  field: 'external_user_id'
80
74
  },
81
- createDate: {
82
- type: DataTypes.DATE,
83
- allowNull: false,
84
- defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
85
- field: 'create_date'
86
- },
87
- updateDate: {
88
- type: DataTypes.DATE,
89
- allowNull: false,
90
- defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
91
- field: 'update_date'
92
- },
93
75
  accessToken: {
94
76
  type: DataTypes.STRING,
95
77
  allowNull: false,
@@ -110,6 +92,24 @@ export class AppUserPlatformRelation extends Model<AppUserPlatformRelationAttrib
110
92
  allowNull: false,
111
93
  field: 'country_code'
112
94
  },
95
+ id: {
96
+ type: DataTypes.UUID,
97
+ allowNull: false,
98
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
99
+ primaryKey: true
100
+ },
101
+ createDate: {
102
+ type: DataTypes.DATE,
103
+ allowNull: false,
104
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
105
+ field: 'create_date'
106
+ },
107
+ updateDate: {
108
+ type: DataTypes.DATE,
109
+ allowNull: false,
110
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
111
+ field: 'update_date'
112
+ },
113
113
  stateId: {
114
114
  type: DataTypes.SMALLINT,
115
115
  allowNull: false,
@@ -9,36 +9,36 @@ import type { ExternalReference, ExternalReferenceId } from './ExternalReference
9
9
  import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
10
10
 
11
11
  export interface CanonAlbumAttributes {
12
- id: string;
13
12
  name: string;
14
13
  asciiName: string;
15
14
  releaseDate?: string;
16
15
  noOfDisc?: number;
16
+ description?: string;
17
+ id: string;
17
18
  createDate: Date;
18
19
  updateDate: Date;
19
20
  hasPhoto?: boolean;
20
21
  hasThumbnailPhoto?: boolean;
21
- description?: string;
22
22
  images?: object;
23
23
  lastImageHarvestAttempt?: Date;
24
24
  }
25
25
 
26
26
  export type CanonAlbumPk = "id";
27
27
  export type CanonAlbumId = CanonAlbum[CanonAlbumPk];
28
- export type CanonAlbumOptionalAttributes = "id" | "releaseDate" | "noOfDisc" | "createDate" | "updateDate" | "hasPhoto" | "hasThumbnailPhoto" | "description" | "images" | "lastImageHarvestAttempt";
28
+ export type CanonAlbumOptionalAttributes = "releaseDate" | "noOfDisc" | "description" | "id" | "createDate" | "updateDate" | "hasPhoto" | "hasThumbnailPhoto" | "images" | "lastImageHarvestAttempt";
29
29
  export type CanonAlbumCreationAttributes = Optional<CanonAlbumAttributes, CanonAlbumOptionalAttributes>;
30
30
 
31
31
  export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAttributes> implements CanonAlbumAttributes {
32
- id!: string;
33
32
  name!: string;
34
33
  asciiName!: string;
35
34
  releaseDate?: string;
36
35
  noOfDisc?: number;
36
+ description?: string;
37
+ id!: string;
37
38
  createDate!: Date;
38
39
  updateDate!: Date;
39
40
  hasPhoto?: boolean;
40
41
  hasThumbnailPhoto?: boolean;
41
- description?: string;
42
42
  images?: object;
43
43
  lastImageHarvestAttempt?: Date;
44
44
 
@@ -129,12 +129,6 @@ export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAt
129
129
 
130
130
  static initModel(sequelize: Sequelize.Sequelize): typeof CanonAlbum {
131
131
  return CanonAlbum.init({
132
- id: {
133
- type: DataTypes.UUID,
134
- allowNull: false,
135
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
136
- primaryKey: true
137
- },
138
132
  name: {
139
133
  type: DataTypes.TEXT,
140
134
  allowNull: false
@@ -154,6 +148,16 @@ export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAt
154
148
  allowNull: true,
155
149
  field: 'no_of_disc'
156
150
  },
151
+ description: {
152
+ type: DataTypes.TEXT,
153
+ allowNull: true
154
+ },
155
+ id: {
156
+ type: DataTypes.UUID,
157
+ allowNull: false,
158
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
159
+ primaryKey: true
160
+ },
157
161
  createDate: {
158
162
  type: DataTypes.DATE,
159
163
  allowNull: false,
@@ -178,10 +182,6 @@ export class CanonAlbum extends Model<CanonAlbumAttributes, CanonAlbumCreationAt
178
182
  defaultValue: false,
179
183
  field: 'has_thumbnail_photo'
180
184
  },
181
- description: {
182
- type: DataTypes.TEXT,
183
- allowNull: true
184
- },
185
185
  images: {
186
186
  type: DataTypes.JSONB,
187
187
  allowNull: true
@@ -3,28 +3,28 @@ import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { CanonAlbum, CanonAlbumId } from './CanonAlbum';
4
4
 
5
5
  export interface CanonAlbumImageHarvestedAttributes {
6
- id: string;
7
- canonAlbumId: string;
8
- priority?: number;
9
- url?: string;
10
6
  dateHarvested: Date;
11
7
  storageKey: string;
12
8
  harvestMethod?: string;
9
+ priority?: number;
10
+ id: string;
11
+ url?: string;
12
+ canonAlbumId: string;
13
13
  }
14
14
 
15
15
  export type CanonAlbumImageHarvestedPk = "id";
16
16
  export type CanonAlbumImageHarvestedId = CanonAlbumImageHarvested[CanonAlbumImageHarvestedPk];
17
- export type CanonAlbumImageHarvestedOptionalAttributes = "id" | "priority" | "url" | "harvestMethod";
17
+ export type CanonAlbumImageHarvestedOptionalAttributes = "harvestMethod" | "priority" | "id" | "url";
18
18
  export type CanonAlbumImageHarvestedCreationAttributes = Optional<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedOptionalAttributes>;
19
19
 
20
20
  export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedCreationAttributes> implements CanonAlbumImageHarvestedAttributes {
21
- id!: string;
22
- canonAlbumId!: string;
23
- priority?: number;
24
- url?: string;
25
21
  dateHarvested!: Date;
26
22
  storageKey!: string;
27
23
  harvestMethod?: string;
24
+ priority?: number;
25
+ id!: string;
26
+ url?: string;
27
+ canonAlbumId!: string;
28
28
 
29
29
  // CanonAlbumImageHarvested belongsTo CanonAlbum via canonAlbumId
30
30
  canonAlbum!: CanonAlbum;
@@ -34,31 +34,6 @@ export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttr
34
34
 
35
35
  static initModel(sequelize: Sequelize.Sequelize): typeof CanonAlbumImageHarvested {
36
36
  return CanonAlbumImageHarvested.init({
37
- id: {
38
- type: DataTypes.UUID,
39
- allowNull: false,
40
- defaultValue: DataTypes.UUIDV4,
41
- primaryKey: true
42
- },
43
- canonAlbumId: {
44
- type: DataTypes.UUID,
45
- allowNull: false,
46
- references: {
47
- model: 'canon_album',
48
- key: 'id'
49
- },
50
- field: 'canon_album_id'
51
- },
52
- priority: {
53
- type: DataTypes.DECIMAL,
54
- allowNull: true,
55
- defaultValue: 0
56
- },
57
- url: {
58
- type: DataTypes.TEXT,
59
- allowNull: true,
60
- unique: "canon_album_image_harvested_url_unique"
61
- },
62
37
  dateHarvested: {
63
38
  type: DataTypes.DATE,
64
39
  allowNull: false,
@@ -73,6 +48,30 @@ export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttr
73
48
  type: DataTypes.STRING(255),
74
49
  allowNull: true,
75
50
  field: 'harvest_method'
51
+ },
52
+ priority: {
53
+ type: DataTypes.DECIMAL,
54
+ allowNull: true,
55
+ defaultValue: 0
56
+ },
57
+ id: {
58
+ type: DataTypes.UUID,
59
+ allowNull: false,
60
+ defaultValue: DataTypes.UUIDV4,
61
+ primaryKey: true
62
+ },
63
+ url: {
64
+ type: DataTypes.TEXT,
65
+ allowNull: true
66
+ },
67
+ canonAlbumId: {
68
+ type: DataTypes.UUID,
69
+ allowNull: false,
70
+ references: {
71
+ model: 'canon_album',
72
+ key: 'id'
73
+ },
74
+ field: 'canon_album_id'
76
75
  }
77
76
  }, {
78
77
  sequelize,
@@ -93,13 +92,6 @@ export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttr
93
92
  { name: "id" },
94
93
  ]
95
94
  },
96
- {
97
- name: "canon_album_image_harvested_url_unique",
98
- unique: true,
99
- fields: [
100
- { name: "url" },
101
- ]
102
- },
103
95
  ]
104
96
  });
105
97
  }