@earbug/db-models 0.0.7 → 0.0.8

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 (131) hide show
  1. package/dist/AppUser.d.ts +5 -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 +9 -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/Platform.d.ts +2 -2
  58. package/dist/Platform.js +7 -7
  59. package/dist/PlatformAlbum.d.ts +5 -5
  60. package/dist/PlatformAlbum.js +10 -10
  61. package/dist/PlatformArtist.d.ts +5 -5
  62. package/dist/PlatformArtist.js +10 -10
  63. package/dist/PlatformGenre.d.ts +2 -2
  64. package/dist/PlatformGenre.js +6 -6
  65. package/dist/PlatformTrack.d.ts +3 -3
  66. package/dist/PlatformTrack.js +6 -6
  67. package/dist/PlatformUserAlbum.d.ts +2 -2
  68. package/dist/PlatformUserAlbum.js +6 -6
  69. package/dist/PlatformUserAlbumTrack.d.ts +4 -4
  70. package/dist/PlatformUserAlbumTrack.js +11 -11
  71. package/dist/PlatformUserPlaylist.d.ts +5 -5
  72. package/dist/PlatformUserPlaylist.js +11 -11
  73. package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
  74. package/dist/PlatformUserPlaylistTrack.js +17 -17
  75. package/dist/PlaybackStatus.d.ts +2 -14
  76. package/dist/PlaybackStatus.js +4 -4
  77. package/dist/PlaybackStatusType.d.ts +12 -0
  78. package/dist/State.d.ts +2 -2
  79. package/dist/State.js +4 -4
  80. package/dist/UnmatchedAlbum.d.ts +2 -2
  81. package/dist/UnmatchedAlbum.js +6 -6
  82. package/dist/UnmatchedArtist.d.ts +2 -2
  83. package/dist/UnmatchedArtist.js +6 -6
  84. package/dist/UserContacts.d.ts +3 -3
  85. package/dist/UserContacts.js +7 -7
  86. package/dist/init-models.js +2 -2
  87. package/models/AppUser.ts +18 -18
  88. package/models/AppUserDevice.ts +12 -12
  89. package/models/AppUserFollowRelation.ts +9 -9
  90. package/models/AppUserPlatformRelation.ts +25 -25
  91. package/models/CanonAlbum.ts +15 -15
  92. package/models/CanonAlbumImageHarvested.ts +33 -41
  93. package/models/CanonArtist.ts +9 -9
  94. package/models/CanonArtistImageHarvested.ts +33 -33
  95. package/models/CanonGenre.ts +9 -9
  96. package/models/CanonLabel.ts +8 -8
  97. package/models/CanonMember.ts +9 -9
  98. package/models/CanonMemberExternalReferenceRelation.ts +7 -7
  99. package/models/CanonTrack.ts +16 -16
  100. package/models/ConfigParam.ts +7 -7
  101. package/models/ExternalReference.ts +7 -7
  102. package/models/JukeboxAccessType.ts +6 -6
  103. package/models/JukeboxCanonGenreRelation.ts +8 -8
  104. package/models/JukeboxInvite.ts +9 -9
  105. package/models/JukeboxQueueEntry.ts +23 -23
  106. package/models/JukeboxQueueMode.ts +6 -6
  107. package/models/JukeboxSession.ts +29 -29
  108. package/models/JukeboxTerminationCondition.ts +6 -6
  109. package/models/JukeboxType.ts +6 -6
  110. package/models/JukeboxUser.ts +27 -27
  111. package/models/KnexMigrations.ts +9 -9
  112. package/models/KnexMigrationsLock.ts +8 -8
  113. package/models/MetricsDaily.ts +7 -7
  114. package/models/NewsSite.ts +9 -9
  115. package/models/Platform.ts +9 -9
  116. package/models/PlatformAlbum.ts +15 -15
  117. package/models/PlatformArtist.ts +15 -15
  118. package/models/PlatformGenre.ts +8 -8
  119. package/models/PlatformTrack.ts +9 -9
  120. package/models/PlatformUserAlbum.ts +8 -8
  121. package/models/PlatformUserAlbumTrack.ts +15 -15
  122. package/models/PlatformUserPlaylist.ts +16 -16
  123. package/models/PlatformUserPlaylistTrack.ts +24 -24
  124. package/models/PlaybackStatus.ts +6 -19
  125. package/models/PlaybackStatusType.ts +13 -0
  126. package/models/State.ts +6 -6
  127. package/models/UnmatchedAlbum.ts +8 -8
  128. package/models/UnmatchedArtist.ts +8 -8
  129. package/models/UserContacts.ts +10 -10
  130. package/models/init-models.ts +2 -2
  131. 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,
@@ -11,37 +11,37 @@ import type { JukeboxType, JukeboxTypeId } from './JukeboxType';
11
11
  import type { JukeboxUser, JukeboxUserId } from './JukeboxUser';
12
12
 
13
13
  export interface JukeboxSessionAttributes {
14
- id: string;
15
14
  typeId: number;
16
15
  accessTypeId: number;
17
16
  terminationConditionId: number;
18
17
  jukeboxQueueModeId: number;
18
+ trackQueue?: string[];
19
+ stateMachineArn?: string;
20
+ id: string;
19
21
  createdAt: Date;
20
22
  updatedAt: Date;
21
- jukeboxStatusId: number;
22
- trackQueue?: string[];
23
23
  description?: string;
24
- stateMachineArn?: string;
24
+ jukeboxStatusId: number;
25
25
  durationMs: number;
26
26
  }
27
27
 
28
28
  export type JukeboxSessionPk = "id";
29
29
  export type JukeboxSessionId = JukeboxSession[JukeboxSessionPk];
30
- export type JukeboxSessionOptionalAttributes = "id" | "createdAt" | "updatedAt" | "jukeboxStatusId" | "trackQueue" | "description" | "stateMachineArn" | "durationMs";
30
+ export type JukeboxSessionOptionalAttributes = "trackQueue" | "stateMachineArn" | "id" | "createdAt" | "updatedAt" | "description" | "jukeboxStatusId" | "durationMs";
31
31
  export type JukeboxSessionCreationAttributes = Optional<JukeboxSessionAttributes, JukeboxSessionOptionalAttributes>;
32
32
 
33
33
  export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessionCreationAttributes> implements JukeboxSessionAttributes {
34
- id!: string;
35
34
  typeId!: number;
36
35
  accessTypeId!: number;
37
36
  terminationConditionId!: number;
38
37
  jukeboxQueueModeId!: number;
38
+ trackQueue?: string[];
39
+ stateMachineArn?: string;
40
+ id!: string;
39
41
  createdAt!: Date;
40
42
  updatedAt!: Date;
41
- jukeboxStatusId!: number;
42
- trackQueue?: string[];
43
43
  description?: string;
44
- stateMachineArn?: string;
44
+ jukeboxStatusId!: number;
45
45
  durationMs!: number;
46
46
 
47
47
  // JukeboxSession belongsTo JukeboxAccessType via accessTypeId
@@ -120,12 +120,6 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
120
120
 
121
121
  static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxSession {
122
122
  return JukeboxSession.init({
123
- id: {
124
- type: DataTypes.UUID,
125
- allowNull: false,
126
- defaultValue: DataTypes.UUIDV4,
127
- primaryKey: true
128
- },
129
123
  typeId: {
130
124
  type: DataTypes.SMALLINT,
131
125
  allowNull: false,
@@ -162,6 +156,22 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
162
156
  },
163
157
  field: 'jukebox_queue_mode_id'
164
158
  },
159
+ trackQueue: {
160
+ type: DataTypes.ARRAY(DataTypes.TEXT),
161
+ allowNull: true,
162
+ field: 'track_queue'
163
+ },
164
+ stateMachineArn: {
165
+ type: DataTypes.STRING(255),
166
+ allowNull: true,
167
+ field: 'state_machine_arn'
168
+ },
169
+ id: {
170
+ type: DataTypes.UUID,
171
+ allowNull: false,
172
+ defaultValue: DataTypes.UUIDV4,
173
+ primaryKey: true
174
+ },
165
175
  createdAt: {
166
176
  type: DataTypes.DATE,
167
177
  allowNull: false,
@@ -174,6 +184,10 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
174
184
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
175
185
  field: 'updated_at'
176
186
  },
187
+ description: {
188
+ type: DataTypes.STRING(512),
189
+ allowNull: true
190
+ },
177
191
  jukeboxStatusId: {
178
192
  type: DataTypes.SMALLINT,
179
193
  allowNull: false,
@@ -184,20 +198,6 @@ export class JukeboxSession extends Model<JukeboxSessionAttributes, JukeboxSessi
184
198
  },
185
199
  field: 'jukebox_status_id'
186
200
  },
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
201
  durationMs: {
202
202
  type: DataTypes.INTEGER,
203
203
  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,