@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
@@ -4,42 +4,42 @@ import type { AppUser, AppUserId } from './AppUser';
4
4
  import type { CanonTrack, CanonTrackId } from './CanonTrack';
5
5
  import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
6
6
  import type { JukeboxUser, JukeboxUserId } from './JukeboxUser';
7
- import type { PlaybackStatus, PlaybackStatusId } from './PlaybackStatus';
7
+ import type { PlaybackStatusType, PlaybackStatusTypeId } from './PlaybackStatusType';
8
8
  import type { TrackDeletionReason, TrackDeletionReasonId } from './TrackDeletionReason';
9
9
 
10
10
  export interface JukeboxQueueEntryAttributes {
11
- id: string;
12
11
  jukeboxSessionId: string;
13
12
  trackId: string;
14
13
  playbackPriority?: number;
15
14
  trackAddedUserId: string;
15
+ playbackStarted?: Date;
16
+ id: string;
16
17
  createdAt: Date;
17
18
  updatedAt: Date;
18
19
  setOrder: number;
19
20
  trackDeletionReasonId: number;
20
21
  playbackStatusTypeId: number;
21
- playbackStarted?: Date;
22
22
  trackThumbsUp?: string[];
23
23
  trackThumbsDown?: string[];
24
24
  }
25
25
 
26
26
  export type JukeboxQueueEntryPk = "id";
27
27
  export type JukeboxQueueEntryId = JukeboxQueueEntry[JukeboxQueueEntryPk];
28
- export type JukeboxQueueEntryOptionalAttributes = "id" | "playbackPriority" | "createdAt" | "updatedAt" | "setOrder" | "trackDeletionReasonId" | "playbackStatusTypeId" | "playbackStarted" | "trackThumbsUp" | "trackThumbsDown";
28
+ export type JukeboxQueueEntryOptionalAttributes = "playbackPriority" | "playbackStarted" | "id" | "createdAt" | "updatedAt" | "setOrder" | "trackDeletionReasonId" | "playbackStatusTypeId" | "trackThumbsUp" | "trackThumbsDown";
29
29
  export type JukeboxQueueEntryCreationAttributes = Optional<JukeboxQueueEntryAttributes, JukeboxQueueEntryOptionalAttributes>;
30
30
 
31
31
  export class JukeboxQueueEntry extends Model<JukeboxQueueEntryAttributes, JukeboxQueueEntryCreationAttributes> implements JukeboxQueueEntryAttributes {
32
- id!: string;
33
32
  jukeboxSessionId!: string;
34
33
  trackId!: string;
35
34
  playbackPriority?: number;
36
35
  trackAddedUserId!: string;
36
+ playbackStarted?: Date;
37
+ id!: string;
37
38
  createdAt!: Date;
38
39
  updatedAt!: Date;
39
40
  setOrder!: number;
40
41
  trackDeletionReasonId!: number;
41
42
  playbackStatusTypeId!: number;
42
- playbackStarted?: Date;
43
43
  trackThumbsUp?: string[];
44
44
  trackThumbsDown?: string[];
45
45
 
@@ -70,11 +70,11 @@ export class JukeboxQueueEntry extends Model<JukeboxQueueEntryAttributes, Jukebo
70
70
  getJukeboxSession!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
71
71
  setJukeboxSession!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
72
72
  createJukeboxSession!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
73
- // JukeboxQueueEntry belongsTo PlaybackStatus via playbackStatusTypeId
74
- playbackStatusType!: PlaybackStatus;
75
- getPlaybackStatusType!: Sequelize.BelongsToGetAssociationMixin<PlaybackStatus>;
76
- setPlaybackStatusType!: Sequelize.BelongsToSetAssociationMixin<PlaybackStatus, PlaybackStatusId>;
77
- createPlaybackStatusType!: Sequelize.BelongsToCreateAssociationMixin<PlaybackStatus>;
73
+ // JukeboxQueueEntry belongsTo PlaybackStatusType via playbackStatusTypeId
74
+ playbackStatusType!: PlaybackStatusType;
75
+ getPlaybackStatusType!: Sequelize.BelongsToGetAssociationMixin<PlaybackStatusType>;
76
+ setPlaybackStatusType!: Sequelize.BelongsToSetAssociationMixin<PlaybackStatusType, PlaybackStatusTypeId>;
77
+ createPlaybackStatusType!: Sequelize.BelongsToCreateAssociationMixin<PlaybackStatusType>;
78
78
  // JukeboxQueueEntry belongsTo TrackDeletionReason via trackDeletionReasonId
79
79
  trackDeletionReason!: TrackDeletionReason;
80
80
  getTrackDeletionReason!: Sequelize.BelongsToGetAssociationMixin<TrackDeletionReason>;
@@ -83,12 +83,6 @@ export class JukeboxQueueEntry extends Model<JukeboxQueueEntryAttributes, Jukebo
83
83
 
84
84
  static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxQueueEntry {
85
85
  return JukeboxQueueEntry.init({
86
- id: {
87
- type: DataTypes.UUID,
88
- allowNull: false,
89
- defaultValue: DataTypes.UUIDV4,
90
- primaryKey: true
91
- },
92
86
  jukeboxSessionId: {
93
87
  type: DataTypes.UUID,
94
88
  allowNull: false,
@@ -121,6 +115,17 @@ export class JukeboxQueueEntry extends Model<JukeboxQueueEntryAttributes, Jukebo
121
115
  },
122
116
  field: 'track_added_user_id'
123
117
  },
118
+ playbackStarted: {
119
+ type: DataTypes.DATE,
120
+ allowNull: true,
121
+ field: 'playback_started'
122
+ },
123
+ id: {
124
+ type: DataTypes.UUID,
125
+ allowNull: false,
126
+ defaultValue: DataTypes.UUIDV4,
127
+ primaryKey: true
128
+ },
124
129
  createdAt: {
125
130
  type: DataTypes.DATE,
126
131
  allowNull: false,
@@ -154,16 +159,11 @@ export class JukeboxQueueEntry extends Model<JukeboxQueueEntryAttributes, Jukebo
154
159
  allowNull: false,
155
160
  defaultValue: 0,
156
161
  references: {
157
- model: 'playback_status',
162
+ model: 'playback_status_type',
158
163
  key: 'id'
159
164
  },
160
165
  field: 'playback_status_type_id'
161
166
  },
162
- playbackStarted: {
163
- type: DataTypes.DATE,
164
- allowNull: true,
165
- field: 'playback_started'
166
- },
167
167
  trackThumbsUp: {
168
168
  type: DataTypes.ARRAY(DataTypes.UUID),
169
169
  allowNull: true,
@@ -3,8 +3,8 @@ import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
4
4
 
5
5
  export interface JukeboxQueueModeAttributes {
6
- id: number;
7
6
  description: string;
7
+ id: number;
8
8
  }
9
9
 
10
10
  export type JukeboxQueueModePk = "id";
@@ -12,8 +12,8 @@ export type JukeboxQueueModeId = JukeboxQueueMode[JukeboxQueueModePk];
12
12
  export type JukeboxQueueModeCreationAttributes = JukeboxQueueModeAttributes;
13
13
 
14
14
  export class JukeboxQueueMode extends Model<JukeboxQueueModeAttributes, JukeboxQueueModeCreationAttributes> implements JukeboxQueueModeAttributes {
15
- id!: number;
16
15
  description!: string;
16
+ id!: number;
17
17
 
18
18
  // JukeboxQueueMode hasMany JukeboxSession via jukeboxQueueModeId
19
19
  jukeboxSessions!: JukeboxSession[];
@@ -30,16 +30,16 @@ export class JukeboxQueueMode extends Model<JukeboxQueueModeAttributes, JukeboxQ
30
30
 
31
31
  static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxQueueMode {
32
32
  return JukeboxQueueMode.init({
33
+ description: {
34
+ type: DataTypes.TEXT,
35
+ allowNull: false
36
+ },
33
37
  id: {
34
38
  autoIncrement: true,
35
39
  autoIncrementIdentity: true,
36
40
  type: DataTypes.SMALLINT,
37
41
  allowNull: false,
38
42
  primaryKey: true
39
- },
40
- description: {
41
- type: DataTypes.TEXT,
42
- allowNull: false
43
43
  }
44
44
  }, {
45
45
  sequelize,
@@ -9,39 +9,40 @@ import type { JukeboxStatus, JukeboxStatusId } from './JukeboxStatus';
9
9
  import type { JukeboxTerminationCondition, JukeboxTerminationConditionId } from './JukeboxTerminationCondition';
10
10
  import type { JukeboxType, JukeboxTypeId } from './JukeboxType';
11
11
  import type { JukeboxUser, JukeboxUserId } from './JukeboxUser';
12
+ import type { Notification, NotificationId } from './Notification';
12
13
 
13
14
  export interface JukeboxSessionAttributes {
14
- id: string;
15
15
  typeId: number;
16
16
  accessTypeId: number;
17
17
  terminationConditionId: number;
18
18
  jukeboxQueueModeId: number;
19
+ trackQueue?: string[];
20
+ stateMachineArn?: string;
21
+ id: string;
19
22
  createdAt: Date;
20
23
  updatedAt: Date;
21
- jukeboxStatusId: number;
22
- trackQueue?: string[];
23
24
  description?: string;
24
- stateMachineArn?: string;
25
+ jukeboxStatusId: number;
25
26
  durationMs: number;
26
27
  }
27
28
 
28
29
  export type JukeboxSessionPk = "id";
29
30
  export type JukeboxSessionId = JukeboxSession[JukeboxSessionPk];
30
- export type JukeboxSessionOptionalAttributes = "id" | "createdAt" | "updatedAt" | "jukeboxStatusId" | "trackQueue" | "description" | "stateMachineArn" | "durationMs";
31
+ export type JukeboxSessionOptionalAttributes = "trackQueue" | "stateMachineArn" | "id" | "createdAt" | "updatedAt" | "description" | "jukeboxStatusId" | "durationMs";
31
32
  export type JukeboxSessionCreationAttributes = Optional<JukeboxSessionAttributes, JukeboxSessionOptionalAttributes>;
32
33
 
33
34
  export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessionCreationAttributes> implements JukeboxSessionAttributes {
34
- id!: string;
35
35
  typeId!: number;
36
36
  accessTypeId!: number;
37
37
  terminationConditionId!: number;
38
38
  jukeboxQueueModeId!: number;
39
+ trackQueue?: string[];
40
+ stateMachineArn?: string;
41
+ id!: string;
39
42
  createdAt!: Date;
40
43
  updatedAt!: Date;
41
- jukeboxStatusId!: number;
42
- trackQueue?: string[];
43
44
  description?: string;
44
- stateMachineArn?: string;
45
+ jukeboxStatusId!: number;
45
46
  durationMs!: number;
46
47
 
47
48
  // JukeboxSession belongsTo JukeboxAccessType via accessTypeId
@@ -102,6 +103,18 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
102
103
  hasJukeboxUser!: Sequelize.HasManyHasAssociationMixin<JukeboxUser, JukeboxUserId>;
103
104
  hasJukeboxUsers!: Sequelize.HasManyHasAssociationsMixin<JukeboxUser, JukeboxUserId>;
104
105
  countJukeboxUsers!: Sequelize.HasManyCountAssociationsMixin;
106
+ // JukeboxSession hasMany Notification via jukeboxSessionId
107
+ notifications!: Notification[];
108
+ getNotifications!: Sequelize.HasManyGetAssociationsMixin<Notification>;
109
+ setNotifications!: Sequelize.HasManySetAssociationsMixin<Notification, NotificationId>;
110
+ addNotification!: Sequelize.HasManyAddAssociationMixin<Notification, NotificationId>;
111
+ addNotifications!: Sequelize.HasManyAddAssociationsMixin<Notification, NotificationId>;
112
+ createNotification!: Sequelize.HasManyCreateAssociationMixin<Notification>;
113
+ removeNotification!: Sequelize.HasManyRemoveAssociationMixin<Notification, NotificationId>;
114
+ removeNotifications!: Sequelize.HasManyRemoveAssociationsMixin<Notification, NotificationId>;
115
+ hasNotification!: Sequelize.HasManyHasAssociationMixin<Notification, NotificationId>;
116
+ hasNotifications!: Sequelize.HasManyHasAssociationsMixin<Notification, NotificationId>;
117
+ countNotifications!: Sequelize.HasManyCountAssociationsMixin;
105
118
  // JukeboxSession belongsTo JukeboxStatus via jukeboxStatusId
106
119
  jukeboxStatus!: JukeboxStatus;
107
120
  getJukeboxStatus!: Sequelize.BelongsToGetAssociationMixin<JukeboxStatus>;
@@ -120,12 +133,6 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
120
133
 
121
134
  static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxSession {
122
135
  return JukeboxSession.init({
123
- id: {
124
- type: DataTypes.UUID,
125
- allowNull: false,
126
- defaultValue: DataTypes.UUIDV4,
127
- primaryKey: true
128
- },
129
136
  typeId: {
130
137
  type: DataTypes.SMALLINT,
131
138
  allowNull: false,
@@ -162,6 +169,22 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
162
169
  },
163
170
  field: 'jukebox_queue_mode_id'
164
171
  },
172
+ trackQueue: {
173
+ type: DataTypes.ARRAY(DataTypes.TEXT),
174
+ allowNull: true,
175
+ field: 'track_queue'
176
+ },
177
+ stateMachineArn: {
178
+ type: DataTypes.STRING(255),
179
+ allowNull: true,
180
+ field: 'state_machine_arn'
181
+ },
182
+ id: {
183
+ type: DataTypes.UUID,
184
+ allowNull: false,
185
+ defaultValue: DataTypes.UUIDV4,
186
+ primaryKey: true
187
+ },
165
188
  createdAt: {
166
189
  type: DataTypes.DATE,
167
190
  allowNull: false,
@@ -174,6 +197,10 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
174
197
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
175
198
  field: 'updated_at'
176
199
  },
200
+ description: {
201
+ type: DataTypes.STRING(512),
202
+ allowNull: true
203
+ },
177
204
  jukeboxStatusId: {
178
205
  type: DataTypes.SMALLINT,
179
206
  allowNull: false,
@@ -184,20 +211,6 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
184
211
  },
185
212
  field: 'jukebox_status_id'
186
213
  },
187
- trackQueue: {
188
- type: DataTypes.ARRAY(DataTypes.TEXT),
189
- allowNull: true,
190
- field: 'track_queue'
191
- },
192
- description: {
193
- type: DataTypes.STRING(512),
194
- allowNull: true
195
- },
196
- stateMachineArn: {
197
- type: DataTypes.STRING(255),
198
- allowNull: true,
199
- field: 'state_machine_arn'
200
- },
201
214
  durationMs: {
202
215
  type: DataTypes.INTEGER,
203
216
  allowNull: false,
@@ -3,8 +3,8 @@ import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
4
4
 
5
5
  export interface JukeboxTerminationConditionAttributes {
6
- id: number;
7
6
  description: string;
7
+ id: number;
8
8
  }
9
9
 
10
10
  export type JukeboxTerminationConditionPk = "id";
@@ -12,8 +12,8 @@ export type JukeboxTerminationConditionId = JukeboxTerminationCondition[JukeboxT
12
12
  export type JukeboxTerminationConditionCreationAttributes = JukeboxTerminationConditionAttributes;
13
13
 
14
14
  export class JukeboxTerminationCondition extends Model<JukeboxTerminationConditionAttributes, JukeboxTerminationConditionCreationAttributes> implements JukeboxTerminationConditionAttributes {
15
- id!: number;
16
15
  description!: string;
16
+ id!: number;
17
17
 
18
18
  // JukeboxTerminationCondition hasMany JukeboxSession via terminationConditionId
19
19
  jukeboxSessions!: JukeboxSession[];
@@ -30,16 +30,16 @@ export class JukeboxTerminationCondition extends Model<JukeboxTerminationConditi
30
30
 
31
31
  static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxTerminationCondition {
32
32
  return JukeboxTerminationCondition.init({
33
+ description: {
34
+ type: DataTypes.TEXT,
35
+ allowNull: false
36
+ },
33
37
  id: {
34
38
  autoIncrement: true,
35
39
  autoIncrementIdentity: true,
36
40
  type: DataTypes.SMALLINT,
37
41
  allowNull: false,
38
42
  primaryKey: true
39
- },
40
- description: {
41
- type: DataTypes.TEXT,
42
- allowNull: false
43
43
  }
44
44
  }, {
45
45
  sequelize,
@@ -3,8 +3,8 @@ import { DataTypes, Model, Optional } from 'sequelize';
3
3
  import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
4
4
 
5
5
  export interface JukeboxTypeAttributes {
6
- id: number;
7
6
  description: string;
7
+ id: number;
8
8
  }
9
9
 
10
10
  export type JukeboxTypePk = "id";
@@ -12,8 +12,8 @@ export type JukeboxTypeId = JukeboxType[JukeboxTypePk];
12
12
  export type JukeboxTypeCreationAttributes = JukeboxTypeAttributes;
13
13
 
14
14
  export class JukeboxType extends Model<JukeboxTypeAttributes, JukeboxTypeCreationAttributes> implements JukeboxTypeAttributes {
15
- id!: number;
16
15
  description!: string;
16
+ id!: number;
17
17
 
18
18
  // JukeboxType hasMany JukeboxSession via typeId
19
19
  jukeboxSessions!: JukeboxSession[];
@@ -30,16 +30,16 @@ export class JukeboxType extends Model<JukeboxTypeAttributes, JukeboxTypeCreatio
30
30
 
31
31
  static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxType {
32
32
  return JukeboxType.init({
33
+ description: {
34
+ type: DataTypes.TEXT,
35
+ allowNull: false
36
+ },
33
37
  id: {
34
38
  autoIncrement: true,
35
39
  autoIncrementIdentity: true,
36
40
  type: DataTypes.SMALLINT,
37
41
  allowNull: false,
38
42
  primaryKey: true
39
- },
40
- description: {
41
- type: DataTypes.TEXT,
42
- allowNull: false
43
43
  }
44
44
  }, {
45
45
  sequelize,
@@ -7,34 +7,34 @@ import type { JukeboxUserType, JukeboxUserTypeId } from './JukeboxUserType';
7
7
  import type { PauseStatusType, PauseStatusTypeId } from './PauseStatusType';
8
8
 
9
9
  export interface JukeboxUserAttributes {
10
- id: string;
11
10
  jukeboxSessionId: string;
12
11
  appUserId: string;
12
+ exitDate?: Date;
13
+ pausedQueueEntryId?: string;
14
+ id: string;
13
15
  createdAt: Date;
14
16
  updatedAt: Date;
15
17
  enterDate: Date;
16
- exitDate?: Date;
17
18
  jukeboxUserTypeId: number;
18
19
  pauseStatusTypeId: number;
19
- pausedQueueEntryId?: string;
20
20
  }
21
21
 
22
22
  export type JukeboxUserPk = "id";
23
23
  export type JukeboxUserId = JukeboxUser[JukeboxUserPk];
24
- export type JukeboxUserOptionalAttributes = "id" | "createdAt" | "updatedAt" | "enterDate" | "exitDate" | "jukeboxUserTypeId" | "pauseStatusTypeId" | "pausedQueueEntryId";
24
+ export type JukeboxUserOptionalAttributes = "exitDate" | "pausedQueueEntryId" | "id" | "createdAt" | "updatedAt" | "enterDate" | "jukeboxUserTypeId" | "pauseStatusTypeId";
25
25
  export type JukeboxUserCreationAttributes = Optional<JukeboxUserAttributes, JukeboxUserOptionalAttributes>;
26
26
 
27
27
  export class JukeboxUser extends Model<JukeboxUserAttributes, JukeboxUserCreationAttributes> implements JukeboxUserAttributes {
28
- id!: string;
29
28
  jukeboxSessionId!: string;
30
29
  appUserId!: string;
30
+ exitDate?: Date;
31
+ pausedQueueEntryId?: string;
32
+ id!: string;
31
33
  createdAt!: Date;
32
34
  updatedAt!: Date;
33
35
  enterDate!: Date;
34
- exitDate?: Date;
35
36
  jukeboxUserTypeId!: number;
36
37
  pauseStatusTypeId!: number;
37
- pausedQueueEntryId?: string;
38
38
 
39
39
  // JukeboxUser belongsTo AppUser via appUserId
40
40
  appUser!: AppUser;
@@ -64,12 +64,6 @@ export class JukeboxUser extends Model<JukeboxUserAttributes, JukeboxUserCreatio
64
64
 
65
65
  static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxUser {
66
66
  return JukeboxUser.init({
67
- id: {
68
- type: DataTypes.UUID,
69
- allowNull: false,
70
- defaultValue: DataTypes.UUIDV4,
71
- primaryKey: true
72
- },
73
67
  jukeboxSessionId: {
74
68
  type: DataTypes.UUID,
75
69
  allowNull: false,
@@ -90,6 +84,26 @@ export class JukeboxUser extends Model<JukeboxUserAttributes, JukeboxUserCreatio
90
84
  unique: "unique_jukebox_user_id",
91
85
  field: 'app_user_id'
92
86
  },
87
+ exitDate: {
88
+ type: DataTypes.DATE,
89
+ allowNull: true,
90
+ field: 'exit_date'
91
+ },
92
+ pausedQueueEntryId: {
93
+ type: DataTypes.UUID,
94
+ allowNull: true,
95
+ references: {
96
+ model: 'jukebox_queue_entry',
97
+ key: 'id'
98
+ },
99
+ field: 'paused_queue_entry_id'
100
+ },
101
+ id: {
102
+ type: DataTypes.UUID,
103
+ allowNull: false,
104
+ defaultValue: DataTypes.UUIDV4,
105
+ primaryKey: true
106
+ },
93
107
  createdAt: {
94
108
  type: DataTypes.DATE,
95
109
  allowNull: false,
@@ -108,11 +122,6 @@ export class JukeboxUser extends Model<JukeboxUserAttributes, JukeboxUserCreatio
108
122
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
109
123
  field: 'enter_date'
110
124
  },
111
- exitDate: {
112
- type: DataTypes.DATE,
113
- allowNull: true,
114
- field: 'exit_date'
115
- },
116
125
  jukeboxUserTypeId: {
117
126
  type: DataTypes.SMALLINT,
118
127
  allowNull: false,
@@ -132,15 +141,6 @@ export class JukeboxUser extends Model<JukeboxUserAttributes, JukeboxUserCreatio
132
141
  key: 'id'
133
142
  },
134
143
  field: 'pause_status_type_id'
135
- },
136
- pausedQueueEntryId: {
137
- type: DataTypes.UUID,
138
- allowNull: true,
139
- references: {
140
- model: 'jukebox_queue_entry',
141
- key: 'id'
142
- },
143
- field: 'paused_queue_entry_id'
144
144
  }
145
145
  }, {
146
146
  sequelize,
@@ -2,32 +2,26 @@ import * as Sequelize from 'sequelize';
2
2
  import { DataTypes, Model, Optional } from 'sequelize';
3
3
 
4
4
  export interface KnexMigrationsAttributes {
5
- id: number;
6
5
  name?: string;
7
6
  batch?: number;
8
7
  migrationTime?: Date;
8
+ id: number;
9
9
  }
10
10
 
11
11
  export type KnexMigrationsPk = "id";
12
12
  export type KnexMigrationsId = KnexMigrations[KnexMigrationsPk];
13
- export type KnexMigrationsOptionalAttributes = "id" | "name" | "batch" | "migrationTime";
13
+ export type KnexMigrationsOptionalAttributes = "name" | "batch" | "migrationTime" | "id";
14
14
  export type KnexMigrationsCreationAttributes = Optional<KnexMigrationsAttributes, KnexMigrationsOptionalAttributes>;
15
15
 
16
16
  export class KnexMigrations extends Model<KnexMigrationsAttributes, KnexMigrationsCreationAttributes> implements KnexMigrationsAttributes {
17
- id!: number;
18
17
  name?: string;
19
18
  batch?: number;
20
19
  migrationTime?: Date;
20
+ id!: number;
21
21
 
22
22
 
23
23
  static initModel(sequelize: Sequelize.Sequelize): typeof KnexMigrations {
24
24
  return KnexMigrations.init({
25
- id: {
26
- autoIncrement: true,
27
- type: DataTypes.INTEGER,
28
- allowNull: false,
29
- primaryKey: true
30
- },
31
25
  name: {
32
26
  type: DataTypes.STRING(255),
33
27
  allowNull: true
@@ -40,6 +34,12 @@ export class KnexMigrations extends Model<KnexMigrationsAttributes, KnexMigratio
40
34
  type: DataTypes.DATE,
41
35
  allowNull: true,
42
36
  field: 'migration_time'
37
+ },
38
+ id: {
39
+ autoIncrement: true,
40
+ type: DataTypes.INTEGER,
41
+ allowNull: false,
42
+ primaryKey: true
43
43
  }
44
44
  }, {
45
45
  sequelize,
@@ -2,32 +2,32 @@ import * as Sequelize from 'sequelize';
2
2
  import { DataTypes, Model, Optional } from 'sequelize';
3
3
 
4
4
  export interface KnexMigrationsLockAttributes {
5
- index: number;
6
5
  isLocked?: number;
6
+ index: number;
7
7
  }
8
8
 
9
9
  export type KnexMigrationsLockPk = "index";
10
10
  export type KnexMigrationsLockId = KnexMigrationsLock[KnexMigrationsLockPk];
11
- export type KnexMigrationsLockOptionalAttributes = "index" | "isLocked";
11
+ export type KnexMigrationsLockOptionalAttributes = "isLocked" | "index";
12
12
  export type KnexMigrationsLockCreationAttributes = Optional<KnexMigrationsLockAttributes, KnexMigrationsLockOptionalAttributes>;
13
13
 
14
14
  export class KnexMigrationsLock extends Model<KnexMigrationsLockAttributes, KnexMigrationsLockCreationAttributes> implements KnexMigrationsLockAttributes {
15
- index!: number;
16
15
  isLocked?: number;
16
+ index!: number;
17
17
 
18
18
 
19
19
  static initModel(sequelize: Sequelize.Sequelize): typeof KnexMigrationsLock {
20
20
  return KnexMigrationsLock.init({
21
+ isLocked: {
22
+ type: DataTypes.INTEGER,
23
+ allowNull: true,
24
+ field: 'is_locked'
25
+ },
21
26
  index: {
22
27
  autoIncrement: true,
23
28
  type: DataTypes.INTEGER,
24
29
  allowNull: false,
25
30
  primaryKey: true
26
- },
27
- isLocked: {
28
- type: DataTypes.INTEGER,
29
- allowNull: true,
30
- field: 'is_locked'
31
31
  }
32
32
  }, {
33
33
  sequelize,
@@ -4,20 +4,20 @@ import { DataTypes, Model, Optional } from 'sequelize';
4
4
  export interface MetricsDailyAttributes {
5
5
  day?: string;
6
6
  eventType: string;
7
+ metrics?: object;
7
8
  createdAt: Date;
8
9
  updatedAt: Date;
9
- metrics?: object;
10
10
  }
11
11
 
12
- export type MetricsDailyOptionalAttributes = "day" | "createdAt" | "updatedAt" | "metrics";
12
+ export type MetricsDailyOptionalAttributes = "day" | "metrics" | "createdAt" | "updatedAt";
13
13
  export type MetricsDailyCreationAttributes = Optional<MetricsDailyAttributes, MetricsDailyOptionalAttributes>;
14
14
 
15
15
  export class MetricsDaily extends Model<MetricsDailyAttributes, MetricsDailyCreationAttributes> implements MetricsDailyAttributes {
16
16
  day?: string;
17
17
  eventType!: string;
18
+ metrics?: object;
18
19
  createdAt!: Date;
19
20
  updatedAt!: Date;
20
- metrics?: object;
21
21
 
22
22
 
23
23
  static initModel(sequelize: Sequelize.Sequelize): typeof MetricsDaily {
@@ -31,6 +31,10 @@ export class MetricsDaily extends Model<MetricsDailyAttributes, MetricsDailyCrea
31
31
  allowNull: false,
32
32
  field: 'event_type'
33
33
  },
34
+ metrics: {
35
+ type: DataTypes.JSONB,
36
+ allowNull: true
37
+ },
34
38
  createdAt: {
35
39
  type: DataTypes.DATE,
36
40
  allowNull: false,
@@ -42,10 +46,6 @@ export class MetricsDaily extends Model<MetricsDailyAttributes, MetricsDailyCrea
42
46
  allowNull: false,
43
47
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
44
48
  field: 'updated_at'
45
- },
46
- metrics: {
47
- type: DataTypes.JSONB,
48
- allowNull: true
49
49
  }
50
50
  }, {
51
51
  sequelize,
@@ -2,34 +2,28 @@ import * as Sequelize from 'sequelize';
2
2
  import { DataTypes, Model, Optional } from 'sequelize';
3
3
 
4
4
  export interface NewsSiteAttributes {
5
- id: number;
6
5
  name: string;
7
6
  domain?: string;
8
7
  scrapingBaseUrl: string;
8
+ id: number;
9
9
  active?: boolean;
10
10
  }
11
11
 
12
12
  export type NewsSitePk = "id";
13
13
  export type NewsSiteId = NewsSite[NewsSitePk];
14
- export type NewsSiteOptionalAttributes = "id" | "domain" | "active";
14
+ export type NewsSiteOptionalAttributes = "domain" | "id" | "active";
15
15
  export type NewsSiteCreationAttributes = Optional<NewsSiteAttributes, NewsSiteOptionalAttributes>;
16
16
 
17
17
  export class NewsSite extends Model<NewsSiteAttributes, NewsSiteCreationAttributes> implements NewsSiteAttributes {
18
- id!: number;
19
18
  name!: string;
20
19
  domain?: string;
21
20
  scrapingBaseUrl!: string;
21
+ id!: number;
22
22
  active?: boolean;
23
23
 
24
24
 
25
25
  static initModel(sequelize: Sequelize.Sequelize): typeof NewsSite {
26
26
  return NewsSite.init({
27
- id: {
28
- autoIncrement: true,
29
- type: DataTypes.INTEGER,
30
- allowNull: false,
31
- primaryKey: true
32
- },
33
27
  name: {
34
28
  type: DataTypes.STRING(255),
35
29
  allowNull: false,
@@ -44,6 +38,12 @@ export class NewsSite extends Model<NewsSiteAttributes, NewsSiteCreationAttribut
44
38
  allowNull: false,
45
39
  field: 'scraping_base_url'
46
40
  },
41
+ id: {
42
+ autoIncrement: true,
43
+ type: DataTypes.INTEGER,
44
+ allowNull: false,
45
+ primaryKey: true
46
+ },
47
47
  active: {
48
48
  type: DataTypes.BOOLEAN,
49
49
  allowNull: true,