@earbug/db-models 0.0.1

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 (211) hide show
  1. package/.nvmrc +1 -0
  2. package/dist/AppUser.d.ts +161 -0
  3. package/dist/AppUser.js +121 -0
  4. package/dist/AppUserDevice.d.ts +26 -0
  5. package/dist/AppUserDevice.js +88 -0
  6. package/dist/AppUserFollowRelation.d.ts +34 -0
  7. package/dist/AppUserFollowRelation.js +113 -0
  8. package/dist/AppUserPlatformRelation.d.ts +43 -0
  9. package/dist/AppUserPlatformRelation.js +132 -0
  10. package/dist/CanonAlbum.d.ts +119 -0
  11. package/dist/CanonAlbum.js +117 -0
  12. package/dist/CanonAlbumExternalReferenceRelation.d.ts +31 -0
  13. package/dist/CanonAlbumExternalReferenceRelation.js +86 -0
  14. package/dist/CanonAlbumGenreRelation.d.ts +29 -0
  15. package/dist/CanonAlbumGenreRelation.js +82 -0
  16. package/dist/CanonAlbumImageHarvested.d.ts +30 -0
  17. package/dist/CanonAlbumImageHarvested.js +78 -0
  18. package/dist/CanonAlbumLabelRelation.d.ts +29 -0
  19. package/dist/CanonAlbumLabelRelation.js +82 -0
  20. package/dist/CanonAlbumTrackRelation.d.ts +29 -0
  21. package/dist/CanonAlbumTrackRelation.js +82 -0
  22. package/dist/CanonArtist.d.ts +91 -0
  23. package/dist/CanonArtist.js +114 -0
  24. package/dist/CanonArtistAlbumRelation.d.ts +29 -0
  25. package/dist/CanonArtistAlbumRelation.js +82 -0
  26. package/dist/CanonArtistExternalReferenceRelation.d.ts +31 -0
  27. package/dist/CanonArtistExternalReferenceRelation.js +86 -0
  28. package/dist/CanonArtistGenreRelation.d.ts +29 -0
  29. package/dist/CanonArtistGenreRelation.js +82 -0
  30. package/dist/CanonArtistImageHarvested.d.ts +30 -0
  31. package/dist/CanonArtistImageHarvested.js +70 -0
  32. package/dist/CanonArtistMemberRelation.d.ts +29 -0
  33. package/dist/CanonArtistMemberRelation.js +82 -0
  34. package/dist/CanonArtistTrackRelation.d.ts +29 -0
  35. package/dist/CanonArtistTrackRelation.js +82 -0
  36. package/dist/CanonGenre.d.ts +133 -0
  37. package/dist/CanonGenre.js +93 -0
  38. package/dist/CanonGenreExternalReferenceRelation.d.ts +31 -0
  39. package/dist/CanonGenreExternalReferenceRelation.js +86 -0
  40. package/dist/CanonLabel.d.ts +69 -0
  41. package/dist/CanonLabel.js +83 -0
  42. package/dist/CanonLabelExternalReferenceRelation.d.ts +31 -0
  43. package/dist/CanonLabelExternalReferenceRelation.js +86 -0
  44. package/dist/CanonMember.d.ts +71 -0
  45. package/dist/CanonMember.js +82 -0
  46. package/dist/CanonMemberExternalReferenceRelation.d.ts +33 -0
  47. package/dist/CanonMemberExternalReferenceRelation.js +91 -0
  48. package/dist/CanonToPlatformAlbumRelation.d.ts +29 -0
  49. package/dist/CanonToPlatformAlbumRelation.js +82 -0
  50. package/dist/CanonToPlatformArtistRelation.d.ts +29 -0
  51. package/dist/CanonToPlatformArtistRelation.js +82 -0
  52. package/dist/CanonToPlatformGenreRelation.d.ts +29 -0
  53. package/dist/CanonToPlatformGenreRelation.js +82 -0
  54. package/dist/CanonToPlatformTrackRelation.d.ts +29 -0
  55. package/dist/CanonToPlatformTrackRelation.js +82 -0
  56. package/dist/CanonTrack.d.ts +89 -0
  57. package/dist/CanonTrack.js +99 -0
  58. package/dist/ConfigParam.d.ts +19 -0
  59. package/dist/ConfigParam.js +70 -0
  60. package/dist/ExternalReference.d.ts +139 -0
  61. package/dist/ExternalReference.js +79 -0
  62. package/dist/JukeboxAccessType.d.ts +26 -0
  63. package/dist/JukeboxAccessType.js +36 -0
  64. package/dist/JukeboxCanonGenreRelation.d.ts +33 -0
  65. package/dist/JukeboxCanonGenreRelation.js +101 -0
  66. package/dist/JukeboxInvite.d.ts +39 -0
  67. package/dist/JukeboxInvite.js +98 -0
  68. package/dist/JukeboxQueueEntry.d.ts +74 -0
  69. package/dist/JukeboxQueueEntry.js +142 -0
  70. package/dist/JukeboxQueueMode.d.ts +26 -0
  71. package/dist/JukeboxQueueMode.js +36 -0
  72. package/dist/JukeboxSession.d.ts +108 -0
  73. package/dist/JukeboxSession.js +133 -0
  74. package/dist/JukeboxStatus.d.ts +26 -0
  75. package/dist/JukeboxStatus.js +34 -0
  76. package/dist/JukeboxTerminationCondition.d.ts +26 -0
  77. package/dist/JukeboxTerminationCondition.js +36 -0
  78. package/dist/JukeboxType.d.ts +26 -0
  79. package/dist/JukeboxType.js +36 -0
  80. package/dist/JukeboxUser.d.ts +56 -0
  81. package/dist/JukeboxUser.js +135 -0
  82. package/dist/JukeboxUserType.d.ts +26 -0
  83. package/dist/JukeboxUserType.js +34 -0
  84. package/dist/KnexMigrations.d.ts +19 -0
  85. package/dist/KnexMigrations.js +44 -0
  86. package/dist/KnexMigrationsLock.d.ts +15 -0
  87. package/dist/KnexMigrationsLock.js +36 -0
  88. package/dist/MetricsDaily.d.ts +19 -0
  89. package/dist/MetricsDaily.js +87 -0
  90. package/dist/MetricsEvent.d.ts +23 -0
  91. package/dist/MetricsEvent.js +117 -0
  92. package/dist/NewsSite.d.ts +21 -0
  93. package/dist/NewsSite.js +57 -0
  94. package/dist/PauseStatusType.d.ts +26 -0
  95. package/dist/PauseStatusType.js +34 -0
  96. package/dist/Platform.d.ts +127 -0
  97. package/dist/Platform.js +80 -0
  98. package/dist/PlatformAlbum.d.ts +232 -0
  99. package/dist/PlatformAlbum.js +123 -0
  100. package/dist/PlatformAlbumGenreRelation.d.ts +29 -0
  101. package/dist/PlatformAlbumGenreRelation.js +82 -0
  102. package/dist/PlatformAlbumTrackRelation.d.ts +29 -0
  103. package/dist/PlatformAlbumTrackRelation.js +82 -0
  104. package/dist/PlatformArtist.d.ts +225 -0
  105. package/dist/PlatformArtist.js +109 -0
  106. package/dist/PlatformArtistAlbumRelation.d.ts +29 -0
  107. package/dist/PlatformArtistAlbumRelation.js +82 -0
  108. package/dist/PlatformArtistGenreRelation.d.ts +29 -0
  109. package/dist/PlatformArtistGenreRelation.js +82 -0
  110. package/dist/PlatformArtistTrackRelation.d.ts +29 -0
  111. package/dist/PlatformArtistTrackRelation.js +82 -0
  112. package/dist/PlatformGenre.d.ts +122 -0
  113. package/dist/PlatformGenre.js +90 -0
  114. package/dist/PlatformTrack.d.ts +183 -0
  115. package/dist/PlatformTrack.js +129 -0
  116. package/dist/PlatformTrackGenreRelation.d.ts +29 -0
  117. package/dist/PlatformTrackGenreRelation.js +82 -0
  118. package/dist/PlatformUserAlbum.d.ts +54 -0
  119. package/dist/PlatformUserAlbum.js +121 -0
  120. package/dist/PlatformUserAlbumTrack.d.ts +42 -0
  121. package/dist/PlatformUserAlbumTrack.js +121 -0
  122. package/dist/PlatformUserPlaylist.d.ts +62 -0
  123. package/dist/PlatformUserPlaylist.js +135 -0
  124. package/dist/PlatformUserPlaylistTrack.d.ts +48 -0
  125. package/dist/PlatformUserPlaylistTrack.js +132 -0
  126. package/dist/PlaybackStatus.d.ts +26 -0
  127. package/dist/PlaybackStatus.js +36 -0
  128. package/dist/State.d.ts +50 -0
  129. package/dist/State.js +36 -0
  130. package/dist/TrackDeletionReason.d.ts +26 -0
  131. package/dist/TrackDeletionReason.js +34 -0
  132. package/dist/UnmatchedAlbum.d.ts +22 -0
  133. package/dist/UnmatchedAlbum.js +70 -0
  134. package/dist/UnmatchedArtist.d.ts +26 -0
  135. package/dist/UnmatchedArtist.js +81 -0
  136. package/dist/UserContacts.d.ts +46 -0
  137. package/dist/UserContacts.js +105 -0
  138. package/dist/init-models.d.ts +209 -0
  139. package/dist/init-models.js +507 -0
  140. package/model_options.json +3 -0
  141. package/models/AppUser.ts +267 -0
  142. package/models/AppUserDevice.ts +88 -0
  143. package/models/AppUserFollowRelation.ts +122 -0
  144. package/models/AppUserPlatformRelation.ts +150 -0
  145. package/models/CanonAlbum.ts +216 -0
  146. package/models/CanonAlbumExternalReferenceRelation.ts +92 -0
  147. package/models/CanonAlbumGenreRelation.ts +86 -0
  148. package/models/CanonAlbumImageHarvested.ts +106 -0
  149. package/models/CanonAlbumLabelRelation.ts +86 -0
  150. package/models/CanonAlbumTrackRelation.ts +86 -0
  151. package/models/CanonArtist.ts +183 -0
  152. package/models/CanonArtistAlbumRelation.ts +86 -0
  153. package/models/CanonArtistExternalReferenceRelation.ts +92 -0
  154. package/models/CanonArtistGenreRelation.ts +86 -0
  155. package/models/CanonArtistImageHarvested.ts +98 -0
  156. package/models/CanonArtistMemberRelation.ts +86 -0
  157. package/models/CanonArtistTrackRelation.ts +86 -0
  158. package/models/CanonGenre.ts +208 -0
  159. package/models/CanonGenreExternalReferenceRelation.ts +92 -0
  160. package/models/CanonLabel.ts +129 -0
  161. package/models/CanonLabelExternalReferenceRelation.ts +92 -0
  162. package/models/CanonMember.ts +130 -0
  163. package/models/CanonMemberExternalReferenceRelation.ts +99 -0
  164. package/models/CanonToPlatformAlbumRelation.ts +86 -0
  165. package/models/CanonToPlatformArtistRelation.ts +86 -0
  166. package/models/CanonToPlatformGenreRelation.ts +86 -0
  167. package/models/CanonToPlatformTrackRelation.ts +86 -0
  168. package/models/CanonTrack.ts +167 -0
  169. package/models/ConfigParam.ts +62 -0
  170. package/models/ExternalReference.ts +201 -0
  171. package/models/JukeboxAccessType.ts +60 -0
  172. package/models/JukeboxCanonGenreRelation.ts +109 -0
  173. package/models/JukeboxInvite.ts +113 -0
  174. package/models/JukeboxQueueEntry.ts +195 -0
  175. package/models/JukeboxQueueMode.ts +60 -0
  176. package/models/JukeboxSession.ts +223 -0
  177. package/models/JukeboxStatus.ts +58 -0
  178. package/models/JukeboxTerminationCondition.ts +60 -0
  179. package/models/JukeboxType.ts +60 -0
  180. package/models/JukeboxUser.ts +169 -0
  181. package/models/JukeboxUserType.ts +58 -0
  182. package/models/KnexMigrations.ts +60 -0
  183. package/models/KnexMigrationsLock.ts +48 -0
  184. package/models/MetricsDaily.ts +79 -0
  185. package/models/MetricsEvent.ts +114 -0
  186. package/models/NewsSite.ts +75 -0
  187. package/models/PauseStatusType.ts +58 -0
  188. package/models/Platform.ts +189 -0
  189. package/models/PlatformAlbum.ts +345 -0
  190. package/models/PlatformAlbumGenreRelation.ts +86 -0
  191. package/models/PlatformAlbumTrackRelation.ts +86 -0
  192. package/models/PlatformArtist.ts +324 -0
  193. package/models/PlatformArtistAlbumRelation.ts +86 -0
  194. package/models/PlatformArtistGenreRelation.ts +86 -0
  195. package/models/PlatformArtistTrackRelation.ts +86 -0
  196. package/models/PlatformGenre.ts +194 -0
  197. package/models/PlatformTrack.ts +298 -0
  198. package/models/PlatformTrackGenreRelation.ts +86 -0
  199. package/models/PlatformUserAlbum.ts +152 -0
  200. package/models/PlatformUserAlbumTrack.ts +139 -0
  201. package/models/PlatformUserPlaylist.ts +174 -0
  202. package/models/PlatformUserPlaylistTrack.ts +156 -0
  203. package/models/PlaybackStatus.ts +60 -0
  204. package/models/State.ts +86 -0
  205. package/models/TrackDeletionReason.ts +58 -0
  206. package/models/UnmatchedAlbum.ts +66 -0
  207. package/models/UnmatchedArtist.ts +81 -0
  208. package/models/UserContacts.ts +149 -0
  209. package/models/init-models.ts +716 -0
  210. package/package.json +19 -0
  211. package/tsconfig.json +52 -0
@@ -0,0 +1,60 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
4
+
5
+ export interface JukeboxTerminationConditionAttributes {
6
+ id: number;
7
+ description: string;
8
+ }
9
+
10
+ export type JukeboxTerminationConditionPk = "id";
11
+ export type JukeboxTerminationConditionId = JukeboxTerminationCondition[JukeboxTerminationConditionPk];
12
+ export type JukeboxTerminationConditionCreationAttributes = JukeboxTerminationConditionAttributes;
13
+
14
+ export class JukeboxTerminationCondition extends Model<JukeboxTerminationConditionAttributes, JukeboxTerminationConditionCreationAttributes> implements JukeboxTerminationConditionAttributes {
15
+ id!: number;
16
+ description!: string;
17
+
18
+ // JukeboxTerminationCondition hasMany JukeboxSession via terminationConditionId
19
+ jukeboxSessions!: JukeboxSession[];
20
+ getJukeboxSessions!: Sequelize.HasManyGetAssociationsMixin<JukeboxSession>;
21
+ setJukeboxSessions!: Sequelize.HasManySetAssociationsMixin<JukeboxSession, JukeboxSessionId>;
22
+ addJukeboxSession!: Sequelize.HasManyAddAssociationMixin<JukeboxSession, JukeboxSessionId>;
23
+ addJukeboxSessions!: Sequelize.HasManyAddAssociationsMixin<JukeboxSession, JukeboxSessionId>;
24
+ createJukeboxSession!: Sequelize.HasManyCreateAssociationMixin<JukeboxSession>;
25
+ removeJukeboxSession!: Sequelize.HasManyRemoveAssociationMixin<JukeboxSession, JukeboxSessionId>;
26
+ removeJukeboxSessions!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxSession, JukeboxSessionId>;
27
+ hasJukeboxSession!: Sequelize.HasManyHasAssociationMixin<JukeboxSession, JukeboxSessionId>;
28
+ hasJukeboxSessions!: Sequelize.HasManyHasAssociationsMixin<JukeboxSession, JukeboxSessionId>;
29
+ countJukeboxSessions!: Sequelize.HasManyCountAssociationsMixin;
30
+
31
+ static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxTerminationCondition {
32
+ return JukeboxTerminationCondition.init({
33
+ id: {
34
+ autoIncrement: true,
35
+ autoIncrementIdentity: true,
36
+ type: DataTypes.SMALLINT,
37
+ allowNull: false,
38
+ primaryKey: true
39
+ },
40
+ description: {
41
+ type: DataTypes.TEXT,
42
+ allowNull: false
43
+ }
44
+ }, {
45
+ sequelize,
46
+ tableName: 'jukebox_termination_condition',
47
+ schema: 'eb',
48
+ timestamps: false,
49
+ indexes: [
50
+ {
51
+ name: "jukebox_termination_condition_pkey",
52
+ unique: true,
53
+ fields: [
54
+ { name: "id" },
55
+ ]
56
+ },
57
+ ]
58
+ });
59
+ }
60
+ }
@@ -0,0 +1,60 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
4
+
5
+ export interface JukeboxTypeAttributes {
6
+ id: number;
7
+ description: string;
8
+ }
9
+
10
+ export type JukeboxTypePk = "id";
11
+ export type JukeboxTypeId = JukeboxType[JukeboxTypePk];
12
+ export type JukeboxTypeCreationAttributes = JukeboxTypeAttributes;
13
+
14
+ export class JukeboxType extends Model<JukeboxTypeAttributes, JukeboxTypeCreationAttributes> implements JukeboxTypeAttributes {
15
+ id!: number;
16
+ description!: string;
17
+
18
+ // JukeboxType hasMany JukeboxSession via typeId
19
+ jukeboxSessions!: JukeboxSession[];
20
+ getJukeboxSessions!: Sequelize.HasManyGetAssociationsMixin<JukeboxSession>;
21
+ setJukeboxSessions!: Sequelize.HasManySetAssociationsMixin<JukeboxSession, JukeboxSessionId>;
22
+ addJukeboxSession!: Sequelize.HasManyAddAssociationMixin<JukeboxSession, JukeboxSessionId>;
23
+ addJukeboxSessions!: Sequelize.HasManyAddAssociationsMixin<JukeboxSession, JukeboxSessionId>;
24
+ createJukeboxSession!: Sequelize.HasManyCreateAssociationMixin<JukeboxSession>;
25
+ removeJukeboxSession!: Sequelize.HasManyRemoveAssociationMixin<JukeboxSession, JukeboxSessionId>;
26
+ removeJukeboxSessions!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxSession, JukeboxSessionId>;
27
+ hasJukeboxSession!: Sequelize.HasManyHasAssociationMixin<JukeboxSession, JukeboxSessionId>;
28
+ hasJukeboxSessions!: Sequelize.HasManyHasAssociationsMixin<JukeboxSession, JukeboxSessionId>;
29
+ countJukeboxSessions!: Sequelize.HasManyCountAssociationsMixin;
30
+
31
+ static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxType {
32
+ return JukeboxType.init({
33
+ id: {
34
+ autoIncrement: true,
35
+ autoIncrementIdentity: true,
36
+ type: DataTypes.SMALLINT,
37
+ allowNull: false,
38
+ primaryKey: true
39
+ },
40
+ description: {
41
+ type: DataTypes.TEXT,
42
+ allowNull: false
43
+ }
44
+ }, {
45
+ sequelize,
46
+ tableName: 'jukebox_type',
47
+ schema: 'eb',
48
+ timestamps: false,
49
+ indexes: [
50
+ {
51
+ name: "jukebox_type_pkey",
52
+ unique: true,
53
+ fields: [
54
+ { name: "id" },
55
+ ]
56
+ },
57
+ ]
58
+ });
59
+ }
60
+ }
@@ -0,0 +1,169 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AppUser, AppUserId } from './AppUser';
4
+ import type { JukeboxQueueEntry, JukeboxQueueEntryId } from './JukeboxQueueEntry';
5
+ import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
6
+ import type { JukeboxUserType, JukeboxUserTypeId } from './JukeboxUserType';
7
+ import type { PauseStatusType, PauseStatusTypeId } from './PauseStatusType';
8
+
9
+ export interface JukeboxUserAttributes {
10
+ id: string;
11
+ jukeboxSessionId: string;
12
+ appUserId: string;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ enterDate: Date;
16
+ exitDate?: Date;
17
+ jukeboxUserTypeId: number;
18
+ pauseStatusTypeId: number;
19
+ pausedQueueEntryId?: string;
20
+ }
21
+
22
+ export type JukeboxUserPk = "id";
23
+ export type JukeboxUserId = JukeboxUser[JukeboxUserPk];
24
+ export type JukeboxUserOptionalAttributes = "id" | "createdAt" | "updatedAt" | "enterDate" | "exitDate" | "jukeboxUserTypeId" | "pauseStatusTypeId" | "pausedQueueEntryId";
25
+ export type JukeboxUserCreationAttributes = Optional<JukeboxUserAttributes, JukeboxUserOptionalAttributes>;
26
+
27
+ export class JukeboxUser extends Model<JukeboxUserAttributes, JukeboxUserCreationAttributes> implements JukeboxUserAttributes {
28
+ id!: string;
29
+ jukeboxSessionId!: string;
30
+ appUserId!: string;
31
+ createdAt!: Date;
32
+ updatedAt!: Date;
33
+ enterDate!: Date;
34
+ exitDate?: Date;
35
+ jukeboxUserTypeId!: number;
36
+ pauseStatusTypeId!: number;
37
+ pausedQueueEntryId?: string;
38
+
39
+ // JukeboxUser belongsTo AppUser via appUserId
40
+ appUser!: AppUser;
41
+ getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
42
+ setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
43
+ createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
44
+ // JukeboxUser belongsTo JukeboxQueueEntry via pausedQueueEntryId
45
+ pausedQueueEntry!: JukeboxQueueEntry;
46
+ getPausedQueueEntry!: Sequelize.BelongsToGetAssociationMixin<JukeboxQueueEntry>;
47
+ setPausedQueueEntry!: Sequelize.BelongsToSetAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
48
+ createPausedQueueEntry!: Sequelize.BelongsToCreateAssociationMixin<JukeboxQueueEntry>;
49
+ // JukeboxUser belongsTo JukeboxSession via jukeboxSessionId
50
+ jukeboxSession!: JukeboxSession;
51
+ getJukeboxSession!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
52
+ setJukeboxSession!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
53
+ createJukeboxSession!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
54
+ // JukeboxUser belongsTo JukeboxUserType via jukeboxUserTypeId
55
+ jukeboxUserType!: JukeboxUserType;
56
+ getJukeboxUserType!: Sequelize.BelongsToGetAssociationMixin<JukeboxUserType>;
57
+ setJukeboxUserType!: Sequelize.BelongsToSetAssociationMixin<JukeboxUserType, JukeboxUserTypeId>;
58
+ createJukeboxUserType!: Sequelize.BelongsToCreateAssociationMixin<JukeboxUserType>;
59
+ // JukeboxUser belongsTo PauseStatusType via pauseStatusTypeId
60
+ pauseStatusType!: PauseStatusType;
61
+ getPauseStatusType!: Sequelize.BelongsToGetAssociationMixin<PauseStatusType>;
62
+ setPauseStatusType!: Sequelize.BelongsToSetAssociationMixin<PauseStatusType, PauseStatusTypeId>;
63
+ createPauseStatusType!: Sequelize.BelongsToCreateAssociationMixin<PauseStatusType>;
64
+
65
+ static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxUser {
66
+ return JukeboxUser.init({
67
+ id: {
68
+ type: DataTypes.UUID,
69
+ allowNull: false,
70
+ defaultValue: DataTypes.UUIDV4,
71
+ primaryKey: true
72
+ },
73
+ jukeboxSessionId: {
74
+ type: DataTypes.UUID,
75
+ allowNull: false,
76
+ references: {
77
+ model: 'jukebox_session',
78
+ key: 'id'
79
+ },
80
+ unique: "unique_jukebox_user_id",
81
+ field: 'jukebox_session_id'
82
+ },
83
+ appUserId: {
84
+ type: DataTypes.UUID,
85
+ allowNull: false,
86
+ references: {
87
+ model: 'app_user',
88
+ key: 'id'
89
+ },
90
+ unique: "unique_jukebox_user_id",
91
+ field: 'app_user_id'
92
+ },
93
+ createdAt: {
94
+ type: DataTypes.DATE,
95
+ allowNull: false,
96
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
97
+ field: 'created_at'
98
+ },
99
+ updatedAt: {
100
+ type: DataTypes.DATE,
101
+ allowNull: false,
102
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
103
+ field: 'updated_at'
104
+ },
105
+ enterDate: {
106
+ type: DataTypes.DATE,
107
+ allowNull: false,
108
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
109
+ field: 'enter_date'
110
+ },
111
+ exitDate: {
112
+ type: DataTypes.DATE,
113
+ allowNull: true,
114
+ field: 'exit_date'
115
+ },
116
+ jukeboxUserTypeId: {
117
+ type: DataTypes.SMALLINT,
118
+ allowNull: false,
119
+ defaultValue: 0,
120
+ references: {
121
+ model: 'jukebox_user_type',
122
+ key: 'id'
123
+ },
124
+ field: 'jukebox_user_type_id'
125
+ },
126
+ pauseStatusTypeId: {
127
+ type: DataTypes.SMALLINT,
128
+ allowNull: false,
129
+ defaultValue: 0,
130
+ references: {
131
+ model: 'pause_status_type',
132
+ key: 'id'
133
+ },
134
+ 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
+ }
145
+ }, {
146
+ sequelize,
147
+ tableName: 'jukebox_user',
148
+ schema: 'eb',
149
+ timestamps: false,
150
+ indexes: [
151
+ {
152
+ name: "jukebox_user_pkey",
153
+ unique: true,
154
+ fields: [
155
+ { name: "id" },
156
+ ]
157
+ },
158
+ {
159
+ name: "unique_jukebox_user_id",
160
+ unique: true,
161
+ fields: [
162
+ { name: "jukebox_session_id" },
163
+ { name: "app_user_id" },
164
+ ]
165
+ },
166
+ ]
167
+ });
168
+ }
169
+ }
@@ -0,0 +1,58 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { JukeboxUser, JukeboxUserId } from './JukeboxUser';
4
+
5
+ export interface JukeboxUserTypeAttributes {
6
+ id: number;
7
+ description: string;
8
+ }
9
+
10
+ export type JukeboxUserTypePk = "id";
11
+ export type JukeboxUserTypeId = JukeboxUserType[JukeboxUserTypePk];
12
+ export type JukeboxUserTypeCreationAttributes = JukeboxUserTypeAttributes;
13
+
14
+ export class JukeboxUserType extends Model<JukeboxUserTypeAttributes, JukeboxUserTypeCreationAttributes> implements JukeboxUserTypeAttributes {
15
+ id!: number;
16
+ description!: string;
17
+
18
+ // JukeboxUserType hasMany JukeboxUser via jukeboxUserTypeId
19
+ jukeboxUsers!: JukeboxUser[];
20
+ getJukeboxUsers!: Sequelize.HasManyGetAssociationsMixin<JukeboxUser>;
21
+ setJukeboxUsers!: Sequelize.HasManySetAssociationsMixin<JukeboxUser, JukeboxUserId>;
22
+ addJukeboxUser!: Sequelize.HasManyAddAssociationMixin<JukeboxUser, JukeboxUserId>;
23
+ addJukeboxUsers!: Sequelize.HasManyAddAssociationsMixin<JukeboxUser, JukeboxUserId>;
24
+ createJukeboxUser!: Sequelize.HasManyCreateAssociationMixin<JukeboxUser>;
25
+ removeJukeboxUser!: Sequelize.HasManyRemoveAssociationMixin<JukeboxUser, JukeboxUserId>;
26
+ removeJukeboxUsers!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxUser, JukeboxUserId>;
27
+ hasJukeboxUser!: Sequelize.HasManyHasAssociationMixin<JukeboxUser, JukeboxUserId>;
28
+ hasJukeboxUsers!: Sequelize.HasManyHasAssociationsMixin<JukeboxUser, JukeboxUserId>;
29
+ countJukeboxUsers!: Sequelize.HasManyCountAssociationsMixin;
30
+
31
+ static initModel(sequelize: Sequelize.Sequelize): typeof JukeboxUserType {
32
+ return JukeboxUserType.init({
33
+ id: {
34
+ type: DataTypes.SMALLINT,
35
+ allowNull: false,
36
+ primaryKey: true
37
+ },
38
+ description: {
39
+ type: DataTypes.STRING(255),
40
+ allowNull: false
41
+ }
42
+ }, {
43
+ sequelize,
44
+ tableName: 'jukebox_user_type',
45
+ schema: 'eb',
46
+ timestamps: false,
47
+ indexes: [
48
+ {
49
+ name: "jukebox_user_type_pkey",
50
+ unique: true,
51
+ fields: [
52
+ { name: "id" },
53
+ ]
54
+ },
55
+ ]
56
+ });
57
+ }
58
+ }
@@ -0,0 +1,60 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+
4
+ export interface KnexMigrationsAttributes {
5
+ id: number;
6
+ name?: string;
7
+ batch?: number;
8
+ migrationTime?: Date;
9
+ }
10
+
11
+ export type KnexMigrationsPk = "id";
12
+ export type KnexMigrationsId = KnexMigrations[KnexMigrationsPk];
13
+ export type KnexMigrationsOptionalAttributes = "id" | "name" | "batch" | "migrationTime";
14
+ export type KnexMigrationsCreationAttributes = Optional<KnexMigrationsAttributes, KnexMigrationsOptionalAttributes>;
15
+
16
+ export class KnexMigrations extends Model<KnexMigrationsAttributes, KnexMigrationsCreationAttributes> implements KnexMigrationsAttributes {
17
+ id!: number;
18
+ name?: string;
19
+ batch?: number;
20
+ migrationTime?: Date;
21
+
22
+
23
+ static initModel(sequelize: Sequelize.Sequelize): typeof KnexMigrations {
24
+ return KnexMigrations.init({
25
+ id: {
26
+ autoIncrement: true,
27
+ type: DataTypes.INTEGER,
28
+ allowNull: false,
29
+ primaryKey: true
30
+ },
31
+ name: {
32
+ type: DataTypes.STRING(255),
33
+ allowNull: true
34
+ },
35
+ batch: {
36
+ type: DataTypes.INTEGER,
37
+ allowNull: true
38
+ },
39
+ migrationTime: {
40
+ type: DataTypes.DATE,
41
+ allowNull: true,
42
+ field: 'migration_time'
43
+ }
44
+ }, {
45
+ sequelize,
46
+ tableName: 'knex_migrations',
47
+ schema: 'public',
48
+ timestamps: false,
49
+ indexes: [
50
+ {
51
+ name: "knex_migrations_pkey",
52
+ unique: true,
53
+ fields: [
54
+ { name: "id" },
55
+ ]
56
+ },
57
+ ]
58
+ });
59
+ }
60
+ }
@@ -0,0 +1,48 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+
4
+ export interface KnexMigrationsLockAttributes {
5
+ index: number;
6
+ isLocked?: number;
7
+ }
8
+
9
+ export type KnexMigrationsLockPk = "index";
10
+ export type KnexMigrationsLockId = KnexMigrationsLock[KnexMigrationsLockPk];
11
+ export type KnexMigrationsLockOptionalAttributes = "index" | "isLocked";
12
+ export type KnexMigrationsLockCreationAttributes = Optional<KnexMigrationsLockAttributes, KnexMigrationsLockOptionalAttributes>;
13
+
14
+ export class KnexMigrationsLock extends Model<KnexMigrationsLockAttributes, KnexMigrationsLockCreationAttributes> implements KnexMigrationsLockAttributes {
15
+ index!: number;
16
+ isLocked?: number;
17
+
18
+
19
+ static initModel(sequelize: Sequelize.Sequelize): typeof KnexMigrationsLock {
20
+ return KnexMigrationsLock.init({
21
+ index: {
22
+ autoIncrement: true,
23
+ type: DataTypes.INTEGER,
24
+ allowNull: false,
25
+ primaryKey: true
26
+ },
27
+ isLocked: {
28
+ type: DataTypes.INTEGER,
29
+ allowNull: true,
30
+ field: 'is_locked'
31
+ }
32
+ }, {
33
+ sequelize,
34
+ tableName: 'knex_migrations_lock',
35
+ schema: 'public',
36
+ timestamps: false,
37
+ indexes: [
38
+ {
39
+ name: "knex_migrations_lock_pkey",
40
+ unique: true,
41
+ fields: [
42
+ { name: "index" },
43
+ ]
44
+ },
45
+ ]
46
+ });
47
+ }
48
+ }
@@ -0,0 +1,79 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+
4
+ export interface MetricsDailyAttributes {
5
+ day?: string;
6
+ eventType: string;
7
+ createdAt: Date;
8
+ updatedAt: Date;
9
+ metrics?: object;
10
+ }
11
+
12
+ export type MetricsDailyOptionalAttributes = "day" | "createdAt" | "updatedAt" | "metrics";
13
+ export type MetricsDailyCreationAttributes = Optional<MetricsDailyAttributes, MetricsDailyOptionalAttributes>;
14
+
15
+ export class MetricsDaily extends Model<MetricsDailyAttributes, MetricsDailyCreationAttributes> implements MetricsDailyAttributes {
16
+ day?: string;
17
+ eventType!: string;
18
+ createdAt!: Date;
19
+ updatedAt!: Date;
20
+ metrics?: object;
21
+
22
+
23
+ static initModel(sequelize: Sequelize.Sequelize): typeof MetricsDaily {
24
+ return MetricsDaily.init({
25
+ day: {
26
+ type: DataTypes.DATEONLY,
27
+ allowNull: true
28
+ },
29
+ eventType: {
30
+ type: DataTypes.TEXT,
31
+ allowNull: false,
32
+ field: 'event_type'
33
+ },
34
+ createdAt: {
35
+ type: DataTypes.DATE,
36
+ allowNull: false,
37
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
38
+ field: 'created_at'
39
+ },
40
+ updatedAt: {
41
+ type: DataTypes.DATE,
42
+ allowNull: false,
43
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
44
+ field: 'updated_at'
45
+ },
46
+ metrics: {
47
+ type: DataTypes.JSONB,
48
+ allowNull: true
49
+ }
50
+ }, {
51
+ sequelize,
52
+ tableName: 'metrics_daily',
53
+ schema: 'eb',
54
+ timestamps: false,
55
+ indexes: [
56
+ {
57
+ name: "metrics_daily_day_event_type_unique",
58
+ unique: true,
59
+ fields: [
60
+ { name: "day" },
61
+ { name: "event_type" },
62
+ ]
63
+ },
64
+ {
65
+ name: "metrics_daily_event_type_index",
66
+ fields: [
67
+ { name: "event_type" },
68
+ ]
69
+ },
70
+ {
71
+ name: "metricsdaily_day_idx",
72
+ fields: [
73
+ { name: "day" },
74
+ ]
75
+ },
76
+ ]
77
+ });
78
+ }
79
+ }
@@ -0,0 +1,114 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+
4
+ export interface MetricsEventAttributes {
5
+ eventType: string;
6
+ appUserId: string;
7
+ sessionId: string;
8
+ devicePlatformId: number;
9
+ createdAt: Date;
10
+ meta?: object;
11
+ objectId?: string;
12
+ }
13
+
14
+ export type MetricsEventOptionalAttributes = "createdAt" | "meta" | "objectId";
15
+ export type MetricsEventCreationAttributes = Optional<MetricsEventAttributes, MetricsEventOptionalAttributes>;
16
+
17
+ export class MetricsEvent extends Model<MetricsEventAttributes, MetricsEventCreationAttributes> implements MetricsEventAttributes {
18
+ eventType!: string;
19
+ appUserId!: string;
20
+ sessionId!: string;
21
+ devicePlatformId!: number;
22
+ createdAt!: Date;
23
+ meta?: object;
24
+ objectId?: string;
25
+
26
+
27
+ static initModel(sequelize: Sequelize.Sequelize): typeof MetricsEvent {
28
+ return MetricsEvent.init({
29
+ eventType: {
30
+ type: DataTypes.TEXT,
31
+ allowNull: false,
32
+ field: 'event_type'
33
+ },
34
+ appUserId: {
35
+ type: DataTypes.UUID,
36
+ allowNull: false,
37
+ field: 'app_user_id'
38
+ },
39
+ sessionId: {
40
+ type: DataTypes.TEXT,
41
+ allowNull: false,
42
+ field: 'session_id'
43
+ },
44
+ devicePlatformId: {
45
+ type: DataTypes.SMALLINT,
46
+ allowNull: false,
47
+ field: 'device_platform_id'
48
+ },
49
+ createdAt: {
50
+ type: DataTypes.DATE,
51
+ allowNull: false,
52
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
53
+ field: 'created_at'
54
+ },
55
+ meta: {
56
+ type: DataTypes.JSONB,
57
+ allowNull: true
58
+ },
59
+ objectId: {
60
+ type: DataTypes.UUID,
61
+ allowNull: true,
62
+ field: 'object_id'
63
+ }
64
+ }, {
65
+ sequelize,
66
+ tableName: 'metrics_event',
67
+ schema: 'eb',
68
+ timestamps: false,
69
+ indexes: [
70
+ {
71
+ name: "metrics_created_idx",
72
+ fields: [
73
+ { name: "created_at" },
74
+ ]
75
+ },
76
+ {
77
+ name: "metrics_dev_plat_idx",
78
+ fields: [
79
+ { name: "device_platform_id" },
80
+ ]
81
+ },
82
+ {
83
+ name: "metrics_object_idx",
84
+ fields: [
85
+ { name: "object_id" },
86
+ ]
87
+ },
88
+ {
89
+ name: "metrics_session_idx",
90
+ fields: [
91
+ { name: "session_id" },
92
+ ]
93
+ },
94
+ {
95
+ name: "metrics_status_idx",
96
+ fields: [
97
+ ]
98
+ },
99
+ {
100
+ name: "metrics_type_idx",
101
+ fields: [
102
+ { name: "event_type" },
103
+ ]
104
+ },
105
+ {
106
+ name: "metrics_user_idx",
107
+ fields: [
108
+ { name: "app_user_id" },
109
+ ]
110
+ },
111
+ ]
112
+ });
113
+ }
114
+ }