@earbug/db-models 0.0.62 → 0.0.63

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 (128) hide show
  1. package/.dockerignore +10 -0
  2. package/.github/workflows/publish.yaml +303 -0
  3. package/.nvmrc +1 -0
  4. package/Dockerfile.generate +19 -0
  5. package/model_options.json +3 -0
  6. package/models/AccessControlPreference.ts +53 -0
  7. package/models/AffinityRelationshipType.ts +96 -0
  8. package/models/AffinityTier.ts +131 -0
  9. package/models/AppUser.ts +577 -0
  10. package/models/AppUserDevice.ts +101 -0
  11. package/models/AppUserDeviceClassicBackup20260906.ts +66 -0
  12. package/models/AppUserFollowRelation.ts +128 -0
  13. package/models/AppUserPlatformRelation.ts +150 -0
  14. package/models/CanonAlbum.ts +229 -0
  15. package/models/CanonAlbumExternalReferenceRelation.ts +92 -0
  16. package/models/CanonAlbumGenreRelation.ts +86 -0
  17. package/models/CanonAlbumLabelRelation.ts +86 -0
  18. package/models/CanonAlbumTrackRelation.ts +92 -0
  19. package/models/CanonArtist.ts +356 -0
  20. package/models/CanonArtistAlbumRelation.ts +92 -0
  21. package/models/CanonArtistExternalReferenceRelation.ts +92 -0
  22. package/models/CanonArtistGenreRelation.ts +86 -0
  23. package/models/CanonArtistMemberRelation.ts +86 -0
  24. package/models/CanonArtistTrackRelation.ts +92 -0
  25. package/models/CanonGenre.ts +273 -0
  26. package/models/CanonGenreExternalReferenceRelation.ts +92 -0
  27. package/models/CanonLabel.ts +129 -0
  28. package/models/CanonLabelExternalReferenceRelation.ts +92 -0
  29. package/models/CanonMember.ts +130 -0
  30. package/models/CanonMemberExternalReferenceRelation.ts +99 -0
  31. package/models/CanonToPlatformAlbumRelation.ts +92 -0
  32. package/models/CanonToPlatformArtistRelation.ts +92 -0
  33. package/models/CanonToPlatformGenreRelation.ts +86 -0
  34. package/models/CanonToPlatformTrackRelation.ts +92 -0
  35. package/models/CanonTrack.ts +232 -0
  36. package/models/ConfigParam.ts +62 -0
  37. package/models/ExternalReference.ts +201 -0
  38. package/models/FeedConfig.ts +65 -0
  39. package/models/FeedContentType.ts +124 -0
  40. package/models/GuestUser.ts +137 -0
  41. package/models/JukeboxAccessType.ts +60 -0
  42. package/models/JukeboxCanonGenreRelation.ts +108 -0
  43. package/models/JukeboxInvite.ts +125 -0
  44. package/models/JukeboxQueueEntry.ts +247 -0
  45. package/models/JukeboxQueueMode.ts +60 -0
  46. package/models/JukeboxSession.ts +334 -0
  47. package/models/JukeboxSessionArtistAffinity.ts +136 -0
  48. package/models/JukeboxSessionGenreAffinity.ts +136 -0
  49. package/models/JukeboxStatus.ts +58 -0
  50. package/models/JukeboxTerminationCondition.ts +60 -0
  51. package/models/JukeboxType.ts +60 -0
  52. package/models/JukeboxUser.ts +182 -0
  53. package/models/JukeboxUserType.ts +58 -0
  54. package/models/KnexMigrations.ts +60 -0
  55. package/models/KnexMigrationsLock.ts +48 -0
  56. package/models/MerchItem.ts +198 -0
  57. package/models/MerchOrchestration.ts +130 -0
  58. package/models/MerchPlatform.ts +95 -0
  59. package/models/MerchType.ts +89 -0
  60. package/models/MetricsDaily.ts +79 -0
  61. package/models/MetricsEvent.ts +124 -0
  62. package/models/NewsArticle.ts +177 -0
  63. package/models/NewsPlatform.ts +76 -0
  64. package/models/NewsSite.ts +75 -0
  65. package/models/Notification.ts +214 -0
  66. package/models/NotificationType.ts +66 -0
  67. package/models/PauseStatusType.ts +58 -0
  68. package/models/Platform.ts +189 -0
  69. package/models/PlatformAlbum.ts +398 -0
  70. package/models/PlatformAlbumGenreRelation.ts +86 -0
  71. package/models/PlatformAlbumTrackRelation.ts +92 -0
  72. package/models/PlatformArtist.ts +358 -0
  73. package/models/PlatformArtistAlbumRelation.ts +92 -0
  74. package/models/PlatformArtistGenreRelation.ts +86 -0
  75. package/models/PlatformArtistTrackRelation.ts +92 -0
  76. package/models/PlatformGenre.ts +194 -0
  77. package/models/PlatformTrack.ts +339 -0
  78. package/models/PlatformTrackGenreRelation.ts +86 -0
  79. package/models/PlatformUserAlbum.ts +152 -0
  80. package/models/PlatformUserAlbumTrack.ts +138 -0
  81. package/models/PlatformUserPlaylist.ts +260 -0
  82. package/models/PlatformUserPlaylistArtistAffinity.ts +136 -0
  83. package/models/PlatformUserPlaylistGenreAffinity.ts +136 -0
  84. package/models/PlatformUserPlaylistTrack.ts +162 -0
  85. package/models/PlaybackStatus.ts +47 -0
  86. package/models/PlaybackStatusType.ts +58 -0
  87. package/models/RadioShow.ts +209 -0
  88. package/models/RadioShowGenres.ts +107 -0
  89. package/models/RadioShowMedia.ts +181 -0
  90. package/models/RadioShowPlacement.ts +115 -0
  91. package/models/RadioShowPublishRequests.ts +86 -0
  92. package/models/State.ts +86 -0
  93. package/models/TrackDeletionReason.ts +58 -0
  94. package/models/UnmatchedAlbum.ts +66 -0
  95. package/models/UnmatchedArtist.ts +81 -0
  96. package/models/UserAbuseReports.ts +232 -0
  97. package/models/UserAffinity.ts +117 -0
  98. package/models/UserArtistAffinity.ts +136 -0
  99. package/models/UserBookmarks.ts +235 -0
  100. package/models/UserComments.ts +271 -0
  101. package/models/UserContacts.ts +155 -0
  102. package/models/UserEngagementFactor.ts +109 -0
  103. package/models/UserGenreAffinity.ts +136 -0
  104. package/models/UserLikes.ts +235 -0
  105. package/models/UserMessages.ts +189 -0
  106. package/models/Versus.ts +438 -0
  107. package/models/VersusAccessType.ts +66 -0
  108. package/models/VersusCoCreator.ts +111 -0
  109. package/models/VersusCreatorScope.ts +66 -0
  110. package/models/VersusEndMode.ts +66 -0
  111. package/models/VersusEndTimerDuration.ts +81 -0
  112. package/models/VersusEndVoteThreshold.ts +67 -0
  113. package/models/VersusEntityKind.ts +79 -0
  114. package/models/VersusOption.ts +258 -0
  115. package/models/VersusPublishIssue.ts +146 -0
  116. package/models/VersusQuestion.ts +123 -0
  117. package/models/VersusQuestionVariableType.ts +66 -0
  118. package/models/VersusVote.ts +99 -0
  119. package/models/VersusVotingListType.ts +66 -0
  120. package/models/VersusVotingMode.ts +66 -0
  121. package/models/index.ts +3 -0
  122. package/models/init-models.ts +1259 -0
  123. package/models/initDb.ts +72 -0
  124. package/models/rdsCaBundle.ts +5 -0
  125. package/package.json +2 -5
  126. package/scripts/generate-and-upload.mjs +123 -0
  127. package/scripts/update-rds-ca-bundle.mjs +44 -0
  128. package/tsconfig.json +52 -0
@@ -0,0 +1,152 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AppUser, AppUserId } from './AppUser';
4
+ import type { Platform, PlatformId } from './Platform';
5
+ import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
6
+ import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './PlatformUserAlbumTrack';
7
+
8
+ export interface PlatformUserAlbumAttributes {
9
+ id: string;
10
+ appUserId: string;
11
+ platformId: number;
12
+ externalUserAlbumId: string;
13
+ platformAlbumId: string;
14
+ createdAt: Date;
15
+ updatedAt: Date;
16
+ stateId: number;
17
+ }
18
+
19
+ export type PlatformUserAlbumPk = "id";
20
+ export type PlatformUserAlbumId = PlatformUserAlbum[PlatformUserAlbumPk];
21
+ export type PlatformUserAlbumOptionalAttributes = "id" | "createdAt" | "updatedAt" | "stateId";
22
+ export type PlatformUserAlbumCreationAttributes = Optional<PlatformUserAlbumAttributes, PlatformUserAlbumOptionalAttributes>;
23
+
24
+ export class PlatformUserAlbum extends Model<PlatformUserAlbumAttributes, PlatformUserAlbumCreationAttributes> implements PlatformUserAlbumAttributes {
25
+ id!: string;
26
+ appUserId!: string;
27
+ platformId!: number;
28
+ externalUserAlbumId!: string;
29
+ platformAlbumId!: string;
30
+ createdAt!: Date;
31
+ updatedAt!: Date;
32
+ stateId!: number;
33
+
34
+ // PlatformUserAlbum belongsTo AppUser via appUserId
35
+ appUser!: AppUser;
36
+ getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
37
+ setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
38
+ createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
39
+ // PlatformUserAlbum belongsTo Platform via platformId
40
+ platform!: Platform;
41
+ getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
42
+ setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
43
+ createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
44
+ // PlatformUserAlbum belongsTo PlatformAlbum via platformAlbumId
45
+ platformAlbum!: PlatformAlbum;
46
+ getPlatformAlbum!: Sequelize.BelongsToGetAssociationMixin<PlatformAlbum>;
47
+ setPlatformAlbum!: Sequelize.BelongsToSetAssociationMixin<PlatformAlbum, PlatformAlbumId>;
48
+ createPlatformAlbum!: Sequelize.BelongsToCreateAssociationMixin<PlatformAlbum>;
49
+ // PlatformUserAlbum hasMany PlatformUserAlbumTrack via platformUserAlbumId
50
+ platformUserAlbumTracks!: PlatformUserAlbumTrack[];
51
+ getPlatformUserAlbumTracks!: Sequelize.HasManyGetAssociationsMixin<PlatformUserAlbumTrack>;
52
+ setPlatformUserAlbumTracks!: Sequelize.HasManySetAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
53
+ addPlatformUserAlbumTrack!: Sequelize.HasManyAddAssociationMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
54
+ addPlatformUserAlbumTracks!: Sequelize.HasManyAddAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
55
+ createPlatformUserAlbumTrack!: Sequelize.HasManyCreateAssociationMixin<PlatformUserAlbumTrack>;
56
+ removePlatformUserAlbumTrack!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
57
+ removePlatformUserAlbumTracks!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
58
+ hasPlatformUserAlbumTrack!: Sequelize.HasManyHasAssociationMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
59
+ hasPlatformUserAlbumTracks!: Sequelize.HasManyHasAssociationsMixin<PlatformUserAlbumTrack, PlatformUserAlbumTrackId>;
60
+ countPlatformUserAlbumTracks!: Sequelize.HasManyCountAssociationsMixin;
61
+
62
+ static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserAlbum {
63
+ return PlatformUserAlbum.init({
64
+ id: {
65
+ type: DataTypes.UUID,
66
+ allowNull: false,
67
+ defaultValue: DataTypes.UUIDV4,
68
+ primaryKey: true
69
+ },
70
+ appUserId: {
71
+ type: DataTypes.UUID,
72
+ allowNull: false,
73
+ references: {
74
+ model: 'app_user',
75
+ key: 'id'
76
+ },
77
+ unique: "platform_user_album_app_user_id_platform_album_id_unique",
78
+ field: 'app_user_id'
79
+ },
80
+ platformId: {
81
+ type: DataTypes.SMALLINT,
82
+ allowNull: false,
83
+ references: {
84
+ model: 'platform',
85
+ key: 'id'
86
+ },
87
+ field: 'platform_id'
88
+ },
89
+ externalUserAlbumId: {
90
+ type: DataTypes.STRING(255),
91
+ allowNull: false,
92
+ field: 'external_user_album_id'
93
+ },
94
+ platformAlbumId: {
95
+ type: DataTypes.UUID,
96
+ allowNull: false,
97
+ references: {
98
+ model: 'platform_album',
99
+ key: 'id'
100
+ },
101
+ unique: "platform_user_album_app_user_id_platform_album_id_unique",
102
+ field: 'platform_album_id'
103
+ },
104
+ createdAt: {
105
+ type: DataTypes.DATE,
106
+ allowNull: false,
107
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
108
+ field: 'created_at'
109
+ },
110
+ updatedAt: {
111
+ type: DataTypes.DATE,
112
+ allowNull: false,
113
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
114
+ field: 'updated_at'
115
+ },
116
+ stateId: {
117
+ type: DataTypes.SMALLINT,
118
+ allowNull: false,
119
+ defaultValue: 0,
120
+ field: 'state_id'
121
+ }
122
+ }, {
123
+ sequelize,
124
+ tableName: 'platform_user_album',
125
+ schema: 'eb',
126
+ timestamps: false,
127
+ indexes: [
128
+ {
129
+ name: "platform_user_album_app_user_id_index",
130
+ fields: [
131
+ { name: "app_user_id" },
132
+ ]
133
+ },
134
+ {
135
+ name: "platform_user_album_app_user_id_platform_album_id_unique",
136
+ unique: true,
137
+ fields: [
138
+ { name: "app_user_id" },
139
+ { name: "platform_album_id" },
140
+ ]
141
+ },
142
+ {
143
+ name: "platform_user_album_pkey",
144
+ unique: true,
145
+ fields: [
146
+ { name: "id" },
147
+ ]
148
+ },
149
+ ]
150
+ });
151
+ }
152
+ }
@@ -0,0 +1,138 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { Platform, PlatformId } from './Platform';
4
+ import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
5
+ import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum';
6
+
7
+ export interface PlatformUserAlbumTrackAttributes {
8
+ id: string;
9
+ platformUserAlbumId: string;
10
+ platformId: number;
11
+ externalUserAlbumTrackId: string;
12
+ platformTrackId: string;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ stateId: number;
16
+ }
17
+
18
+ export type PlatformUserAlbumTrackPk = "id";
19
+ export type PlatformUserAlbumTrackId = PlatformUserAlbumTrack[PlatformUserAlbumTrackPk];
20
+ export type PlatformUserAlbumTrackOptionalAttributes = "id" | "createdAt" | "updatedAt";
21
+ export type PlatformUserAlbumTrackCreationAttributes = Optional<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackOptionalAttributes>;
22
+
23
+ export class PlatformUserAlbumTrack extends Model<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackCreationAttributes> implements PlatformUserAlbumTrackAttributes {
24
+ id!: string;
25
+ platformUserAlbumId!: string;
26
+ platformId!: number;
27
+ externalUserAlbumTrackId!: string;
28
+ platformTrackId!: string;
29
+ createdAt!: Date;
30
+ updatedAt!: Date;
31
+ stateId!: number;
32
+
33
+ // PlatformUserAlbumTrack belongsTo Platform via platformId
34
+ platform!: Platform;
35
+ getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
36
+ setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
37
+ createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
38
+ // PlatformUserAlbumTrack belongsTo PlatformTrack via platformTrackId
39
+ platformTrack!: PlatformTrack;
40
+ getPlatformTrack!: Sequelize.BelongsToGetAssociationMixin<PlatformTrack>;
41
+ setPlatformTrack!: Sequelize.BelongsToSetAssociationMixin<PlatformTrack, PlatformTrackId>;
42
+ createPlatformTrack!: Sequelize.BelongsToCreateAssociationMixin<PlatformTrack>;
43
+ // PlatformUserAlbumTrack belongsTo PlatformUserAlbum via platformUserAlbumId
44
+ platformUserAlbum!: PlatformUserAlbum;
45
+ getPlatformUserAlbum!: Sequelize.BelongsToGetAssociationMixin<PlatformUserAlbum>;
46
+ setPlatformUserAlbum!: Sequelize.BelongsToSetAssociationMixin<PlatformUserAlbum, PlatformUserAlbumId>;
47
+ createPlatformUserAlbum!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserAlbum>;
48
+
49
+ static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserAlbumTrack {
50
+ return PlatformUserAlbumTrack.init({
51
+ id: {
52
+ type: DataTypes.UUID,
53
+ allowNull: false,
54
+ defaultValue: DataTypes.UUIDV4,
55
+ primaryKey: true
56
+ },
57
+ platformUserAlbumId: {
58
+ type: DataTypes.UUID,
59
+ allowNull: false,
60
+ references: {
61
+ model: 'platform_user_album',
62
+ key: 'id'
63
+ },
64
+ unique: "platform_user_album_track_platform_user_album_id_platform_track",
65
+ field: 'platform_user_album_id'
66
+ },
67
+ platformId: {
68
+ type: DataTypes.SMALLINT,
69
+ allowNull: false,
70
+ references: {
71
+ model: 'platform',
72
+ key: 'id'
73
+ },
74
+ field: 'platform_id'
75
+ },
76
+ externalUserAlbumTrackId: {
77
+ type: DataTypes.STRING(255),
78
+ allowNull: false,
79
+ field: 'external_user_album_track_id'
80
+ },
81
+ platformTrackId: {
82
+ type: DataTypes.UUID,
83
+ allowNull: false,
84
+ references: {
85
+ model: 'platform_track',
86
+ key: 'id'
87
+ },
88
+ unique: "platform_user_album_track_platform_user_album_id_platform_track",
89
+ field: 'platform_track_id'
90
+ },
91
+ createdAt: {
92
+ type: DataTypes.DATE,
93
+ allowNull: false,
94
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
95
+ field: 'created_at'
96
+ },
97
+ updatedAt: {
98
+ type: DataTypes.DATE,
99
+ allowNull: false,
100
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
101
+ field: 'updated_at'
102
+ },
103
+ stateId: {
104
+ type: DataTypes.SMALLINT,
105
+ allowNull: false,
106
+ field: 'state_id'
107
+ }
108
+ }, {
109
+ sequelize,
110
+ tableName: 'platform_user_album_track',
111
+ schema: 'eb',
112
+ timestamps: false,
113
+ indexes: [
114
+ {
115
+ name: "platform_user_album_track_pkey",
116
+ unique: true,
117
+ fields: [
118
+ { name: "id" },
119
+ ]
120
+ },
121
+ {
122
+ name: "platform_user_album_track_platform_user_album_id_index",
123
+ fields: [
124
+ { name: "platform_user_album_id" },
125
+ ]
126
+ },
127
+ {
128
+ name: "platform_user_album_track_platform_user_album_id_platform_track",
129
+ unique: true,
130
+ fields: [
131
+ { name: "platform_user_album_id" },
132
+ { name: "platform_track_id" },
133
+ ]
134
+ },
135
+ ]
136
+ });
137
+ }
138
+ }
@@ -0,0 +1,260 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AppUser, AppUserId } from './AppUser';
4
+ import type { Platform, PlatformId } from './Platform';
5
+ import type { PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId } from './PlatformUserPlaylistArtistAffinity';
6
+ import type { PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId } from './PlatformUserPlaylistGenreAffinity';
7
+ import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './PlatformUserPlaylistTrack';
8
+ import type { State, StateId } from './State';
9
+ import type { UserAbuseReports, UserAbuseReportsId } from './UserAbuseReports';
10
+ import type { UserBookmarks, UserBookmarksId } from './UserBookmarks';
11
+ import type { UserComments, UserCommentsId } from './UserComments';
12
+ import type { UserLikes, UserLikesId } from './UserLikes';
13
+
14
+ export interface PlatformUserPlaylistAttributes {
15
+ id: string;
16
+ appUserId: string;
17
+ platformId: number;
18
+ externalPlaylistId: string;
19
+ name: string;
20
+ description?: string;
21
+ public?: boolean;
22
+ snapshotId: string;
23
+ collaborative: boolean;
24
+ createDate: Date;
25
+ updateDate: Date;
26
+ stateId: number;
27
+ earbugAccessControlPreference: string;
28
+ }
29
+
30
+ export type PlatformUserPlaylistPk = "id";
31
+ export type PlatformUserPlaylistId = PlatformUserPlaylist[PlatformUserPlaylistPk];
32
+ export type PlatformUserPlaylistOptionalAttributes = "id" | "description" | "public" | "createDate" | "updateDate" | "stateId" | "earbugAccessControlPreference";
33
+ export type PlatformUserPlaylistCreationAttributes = Optional<PlatformUserPlaylistAttributes, PlatformUserPlaylistOptionalAttributes>;
34
+
35
+ export class PlatformUserPlaylist extends Model<PlatformUserPlaylistAttributes, PlatformUserPlaylistCreationAttributes> implements PlatformUserPlaylistAttributes {
36
+ id!: string;
37
+ appUserId!: string;
38
+ platformId!: number;
39
+ externalPlaylistId!: string;
40
+ name!: string;
41
+ description?: string;
42
+ public?: boolean;
43
+ snapshotId!: string;
44
+ collaborative!: boolean;
45
+ createDate!: Date;
46
+ updateDate!: Date;
47
+ stateId!: number;
48
+ earbugAccessControlPreference!: string;
49
+
50
+ // PlatformUserPlaylist belongsTo AppUser via appUserId
51
+ appUser!: AppUser;
52
+ getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
53
+ setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
54
+ createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
55
+ // PlatformUserPlaylist belongsTo Platform via platformId
56
+ platform!: Platform;
57
+ getPlatform!: Sequelize.BelongsToGetAssociationMixin<Platform>;
58
+ setPlatform!: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;
59
+ createPlatform!: Sequelize.BelongsToCreateAssociationMixin<Platform>;
60
+ // PlatformUserPlaylist hasMany PlatformUserPlaylistArtistAffinity via platformUserPlaylistId
61
+ platformUserPlaylistArtistAffinities!: PlatformUserPlaylistArtistAffinity[];
62
+ getPlatformUserPlaylistArtistAffinities!: Sequelize.HasManyGetAssociationsMixin<PlatformUserPlaylistArtistAffinity>;
63
+ setPlatformUserPlaylistArtistAffinities!: Sequelize.HasManySetAssociationsMixin<PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId>;
64
+ addPlatformUserPlaylistArtistAffinity!: Sequelize.HasManyAddAssociationMixin<PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId>;
65
+ addPlatformUserPlaylistArtistAffinities!: Sequelize.HasManyAddAssociationsMixin<PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId>;
66
+ createPlatformUserPlaylistArtistAffinity!: Sequelize.HasManyCreateAssociationMixin<PlatformUserPlaylistArtistAffinity>;
67
+ removePlatformUserPlaylistArtistAffinity!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId>;
68
+ removePlatformUserPlaylistArtistAffinities!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId>;
69
+ hasPlatformUserPlaylistArtistAffinity!: Sequelize.HasManyHasAssociationMixin<PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId>;
70
+ hasPlatformUserPlaylistArtistAffinities!: Sequelize.HasManyHasAssociationsMixin<PlatformUserPlaylistArtistAffinity, PlatformUserPlaylistArtistAffinityId>;
71
+ countPlatformUserPlaylistArtistAffinities!: Sequelize.HasManyCountAssociationsMixin;
72
+ // PlatformUserPlaylist hasMany PlatformUserPlaylistGenreAffinity via platformUserPlaylistId
73
+ platformUserPlaylistGenreAffinities!: PlatformUserPlaylistGenreAffinity[];
74
+ getPlatformUserPlaylistGenreAffinities!: Sequelize.HasManyGetAssociationsMixin<PlatformUserPlaylistGenreAffinity>;
75
+ setPlatformUserPlaylistGenreAffinities!: Sequelize.HasManySetAssociationsMixin<PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId>;
76
+ addPlatformUserPlaylistGenreAffinity!: Sequelize.HasManyAddAssociationMixin<PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId>;
77
+ addPlatformUserPlaylistGenreAffinities!: Sequelize.HasManyAddAssociationsMixin<PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId>;
78
+ createPlatformUserPlaylistGenreAffinity!: Sequelize.HasManyCreateAssociationMixin<PlatformUserPlaylistGenreAffinity>;
79
+ removePlatformUserPlaylistGenreAffinity!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId>;
80
+ removePlatformUserPlaylistGenreAffinities!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId>;
81
+ hasPlatformUserPlaylistGenreAffinity!: Sequelize.HasManyHasAssociationMixin<PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId>;
82
+ hasPlatformUserPlaylistGenreAffinities!: Sequelize.HasManyHasAssociationsMixin<PlatformUserPlaylistGenreAffinity, PlatformUserPlaylistGenreAffinityId>;
83
+ countPlatformUserPlaylistGenreAffinities!: Sequelize.HasManyCountAssociationsMixin;
84
+ // PlatformUserPlaylist hasMany PlatformUserPlaylistTrack via platformUserPlaylistId
85
+ platformUserPlaylistTracks!: PlatformUserPlaylistTrack[];
86
+ getPlatformUserPlaylistTracks!: Sequelize.HasManyGetAssociationsMixin<PlatformUserPlaylistTrack>;
87
+ setPlatformUserPlaylistTracks!: Sequelize.HasManySetAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
88
+ addPlatformUserPlaylistTrack!: Sequelize.HasManyAddAssociationMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
89
+ addPlatformUserPlaylistTracks!: Sequelize.HasManyAddAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
90
+ createPlatformUserPlaylistTrack!: Sequelize.HasManyCreateAssociationMixin<PlatformUserPlaylistTrack>;
91
+ removePlatformUserPlaylistTrack!: Sequelize.HasManyRemoveAssociationMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
92
+ removePlatformUserPlaylistTracks!: Sequelize.HasManyRemoveAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
93
+ hasPlatformUserPlaylistTrack!: Sequelize.HasManyHasAssociationMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
94
+ hasPlatformUserPlaylistTracks!: Sequelize.HasManyHasAssociationsMixin<PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId>;
95
+ countPlatformUserPlaylistTracks!: Sequelize.HasManyCountAssociationsMixin;
96
+ // PlatformUserPlaylist hasMany UserAbuseReports via playlistId
97
+ userAbuseReports!: UserAbuseReports[];
98
+ getUserAbuseReports!: Sequelize.HasManyGetAssociationsMixin<UserAbuseReports>;
99
+ setUserAbuseReports!: Sequelize.HasManySetAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
100
+ addUserAbuseReport!: Sequelize.HasManyAddAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
101
+ addUserAbuseReports!: Sequelize.HasManyAddAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
102
+ createUserAbuseReport!: Sequelize.HasManyCreateAssociationMixin<UserAbuseReports>;
103
+ removeUserAbuseReport!: Sequelize.HasManyRemoveAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
104
+ removeUserAbuseReports!: Sequelize.HasManyRemoveAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
105
+ hasUserAbuseReport!: Sequelize.HasManyHasAssociationMixin<UserAbuseReports, UserAbuseReportsId>;
106
+ hasUserAbuseReports!: Sequelize.HasManyHasAssociationsMixin<UserAbuseReports, UserAbuseReportsId>;
107
+ countUserAbuseReports!: Sequelize.HasManyCountAssociationsMixin;
108
+ // PlatformUserPlaylist hasMany UserBookmarks via playlistId
109
+ userBookmarks!: UserBookmarks[];
110
+ getUserBookmarks!: Sequelize.HasManyGetAssociationsMixin<UserBookmarks>;
111
+ setUserBookmarks!: Sequelize.HasManySetAssociationsMixin<UserBookmarks, UserBookmarksId>;
112
+ addUserBookmark!: Sequelize.HasManyAddAssociationMixin<UserBookmarks, UserBookmarksId>;
113
+ addUserBookmarks!: Sequelize.HasManyAddAssociationsMixin<UserBookmarks, UserBookmarksId>;
114
+ createUserBookmark!: Sequelize.HasManyCreateAssociationMixin<UserBookmarks>;
115
+ removeUserBookmark!: Sequelize.HasManyRemoveAssociationMixin<UserBookmarks, UserBookmarksId>;
116
+ removeUserBookmarks!: Sequelize.HasManyRemoveAssociationsMixin<UserBookmarks, UserBookmarksId>;
117
+ hasUserBookmark!: Sequelize.HasManyHasAssociationMixin<UserBookmarks, UserBookmarksId>;
118
+ hasUserBookmarks!: Sequelize.HasManyHasAssociationsMixin<UserBookmarks, UserBookmarksId>;
119
+ countUserBookmarks!: Sequelize.HasManyCountAssociationsMixin;
120
+ // PlatformUserPlaylist hasMany UserComments via playlistId
121
+ userComments!: UserComments[];
122
+ getUserComments!: Sequelize.HasManyGetAssociationsMixin<UserComments>;
123
+ setUserComments!: Sequelize.HasManySetAssociationsMixin<UserComments, UserCommentsId>;
124
+ addUserComment!: Sequelize.HasManyAddAssociationMixin<UserComments, UserCommentsId>;
125
+ addUserComments!: Sequelize.HasManyAddAssociationsMixin<UserComments, UserCommentsId>;
126
+ createUserComment!: Sequelize.HasManyCreateAssociationMixin<UserComments>;
127
+ removeUserComment!: Sequelize.HasManyRemoveAssociationMixin<UserComments, UserCommentsId>;
128
+ removeUserComments!: Sequelize.HasManyRemoveAssociationsMixin<UserComments, UserCommentsId>;
129
+ hasUserComment!: Sequelize.HasManyHasAssociationMixin<UserComments, UserCommentsId>;
130
+ hasUserComments!: Sequelize.HasManyHasAssociationsMixin<UserComments, UserCommentsId>;
131
+ countUserComments!: Sequelize.HasManyCountAssociationsMixin;
132
+ // PlatformUserPlaylist hasMany UserLikes via playlistId
133
+ userLikes!: UserLikes[];
134
+ getUserLikes!: Sequelize.HasManyGetAssociationsMixin<UserLikes>;
135
+ setUserLikes!: Sequelize.HasManySetAssociationsMixin<UserLikes, UserLikesId>;
136
+ addUserLike!: Sequelize.HasManyAddAssociationMixin<UserLikes, UserLikesId>;
137
+ addUserLikes!: Sequelize.HasManyAddAssociationsMixin<UserLikes, UserLikesId>;
138
+ createUserLike!: Sequelize.HasManyCreateAssociationMixin<UserLikes>;
139
+ removeUserLike!: Sequelize.HasManyRemoveAssociationMixin<UserLikes, UserLikesId>;
140
+ removeUserLikes!: Sequelize.HasManyRemoveAssociationsMixin<UserLikes, UserLikesId>;
141
+ hasUserLike!: Sequelize.HasManyHasAssociationMixin<UserLikes, UserLikesId>;
142
+ hasUserLikes!: Sequelize.HasManyHasAssociationsMixin<UserLikes, UserLikesId>;
143
+ countUserLikes!: Sequelize.HasManyCountAssociationsMixin;
144
+ // PlatformUserPlaylist belongsTo State via stateId
145
+ state!: State;
146
+ getState!: Sequelize.BelongsToGetAssociationMixin<State>;
147
+ setState!: Sequelize.BelongsToSetAssociationMixin<State, StateId>;
148
+ createState!: Sequelize.BelongsToCreateAssociationMixin<State>;
149
+
150
+ static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserPlaylist {
151
+ return PlatformUserPlaylist.init({
152
+ id: {
153
+ type: DataTypes.UUID,
154
+ allowNull: false,
155
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
156
+ primaryKey: true
157
+ },
158
+ appUserId: {
159
+ type: DataTypes.UUID,
160
+ allowNull: false,
161
+ references: {
162
+ model: 'app_user',
163
+ key: 'id'
164
+ },
165
+ unique: "uk_app_user_platform_playlist",
166
+ field: 'app_user_id'
167
+ },
168
+ platformId: {
169
+ type: DataTypes.SMALLINT,
170
+ allowNull: false,
171
+ references: {
172
+ model: 'platform',
173
+ key: 'id'
174
+ },
175
+ unique: "uk_app_user_platform_playlist",
176
+ field: 'platform_id'
177
+ },
178
+ externalPlaylistId: {
179
+ type: DataTypes.TEXT,
180
+ allowNull: false,
181
+ unique: "uk_app_user_platform_playlist",
182
+ field: 'external_playlist_id'
183
+ },
184
+ name: {
185
+ type: DataTypes.TEXT,
186
+ allowNull: false
187
+ },
188
+ description: {
189
+ type: DataTypes.TEXT,
190
+ allowNull: true
191
+ },
192
+ public: {
193
+ type: DataTypes.BOOLEAN,
194
+ allowNull: true,
195
+ defaultValue: false
196
+ },
197
+ snapshotId: {
198
+ type: DataTypes.TEXT,
199
+ allowNull: false,
200
+ field: 'snapshot_id'
201
+ },
202
+ collaborative: {
203
+ type: DataTypes.BOOLEAN,
204
+ allowNull: false,
205
+ defaultValue: false
206
+ },
207
+ createDate: {
208
+ type: DataTypes.DATE,
209
+ allowNull: false,
210
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
211
+ field: 'create_date'
212
+ },
213
+ updateDate: {
214
+ type: DataTypes.DATE,
215
+ allowNull: false,
216
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
217
+ field: 'update_date'
218
+ },
219
+ stateId: {
220
+ type: DataTypes.SMALLINT,
221
+ allowNull: false,
222
+ defaultValue: 0,
223
+ references: {
224
+ model: 'state',
225
+ key: 'id'
226
+ },
227
+ field: 'state_id'
228
+ },
229
+ earbugAccessControlPreference: {
230
+ type: DataTypes.TEXT,
231
+ allowNull: false,
232
+ defaultValue: "PRIVATE",
233
+ field: 'earbug_access_control_preference'
234
+ }
235
+ }, {
236
+ sequelize,
237
+ tableName: 'platform_user_playlist',
238
+ schema: 'eb',
239
+ timestamps: false,
240
+ indexes: [
241
+ {
242
+ name: "playlist_pkey",
243
+ unique: true,
244
+ fields: [
245
+ { name: "id" },
246
+ ]
247
+ },
248
+ {
249
+ name: "uk_app_user_platform_playlist",
250
+ unique: true,
251
+ fields: [
252
+ { name: "app_user_id" },
253
+ { name: "platform_id" },
254
+ { name: "external_playlist_id" },
255
+ ]
256
+ },
257
+ ]
258
+ });
259
+ }
260
+ }
@@ -0,0 +1,136 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AffinityTier, AffinityTierId } from './AffinityTier';
4
+ import type { CanonArtist, CanonArtistId } from './CanonArtist';
5
+ import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
6
+
7
+ export interface PlatformUserPlaylistArtistAffinityAttributes {
8
+ id: string;
9
+ platformUserPlaylistId: string;
10
+ canonArtistId: string;
11
+ affinityTierId: number;
12
+ rank: number;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ }
16
+
17
+ export type PlatformUserPlaylistArtistAffinityPk = "id";
18
+ export type PlatformUserPlaylistArtistAffinityId = PlatformUserPlaylistArtistAffinity[PlatformUserPlaylistArtistAffinityPk];
19
+ export type PlatformUserPlaylistArtistAffinityOptionalAttributes = "id" | "createdAt" | "updatedAt";
20
+ export type PlatformUserPlaylistArtistAffinityCreationAttributes = Optional<PlatformUserPlaylistArtistAffinityAttributes, PlatformUserPlaylistArtistAffinityOptionalAttributes>;
21
+
22
+ export class PlatformUserPlaylistArtistAffinity extends Model<PlatformUserPlaylistArtistAffinityAttributes, PlatformUserPlaylistArtistAffinityCreationAttributes> implements PlatformUserPlaylistArtistAffinityAttributes {
23
+ id!: string;
24
+ platformUserPlaylistId!: string;
25
+ canonArtistId!: string;
26
+ affinityTierId!: number;
27
+ rank!: number;
28
+ createdAt!: Date;
29
+ updatedAt!: Date;
30
+
31
+ // PlatformUserPlaylistArtistAffinity belongsTo AffinityTier via affinityTierId
32
+ affinityTier!: AffinityTier;
33
+ getAffinityTier!: Sequelize.BelongsToGetAssociationMixin<AffinityTier>;
34
+ setAffinityTier!: Sequelize.BelongsToSetAssociationMixin<AffinityTier, AffinityTierId>;
35
+ createAffinityTier!: Sequelize.BelongsToCreateAssociationMixin<AffinityTier>;
36
+ // PlatformUserPlaylistArtistAffinity belongsTo CanonArtist via canonArtistId
37
+ canonArtist!: CanonArtist;
38
+ getCanonArtist!: Sequelize.BelongsToGetAssociationMixin<CanonArtist>;
39
+ setCanonArtist!: Sequelize.BelongsToSetAssociationMixin<CanonArtist, CanonArtistId>;
40
+ createCanonArtist!: Sequelize.BelongsToCreateAssociationMixin<CanonArtist>;
41
+ // PlatformUserPlaylistArtistAffinity belongsTo PlatformUserPlaylist via platformUserPlaylistId
42
+ platformUserPlaylist!: PlatformUserPlaylist;
43
+ getPlatformUserPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
44
+ setPlatformUserPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
45
+ createPlatformUserPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
46
+
47
+ static initModel(sequelize: Sequelize.Sequelize): typeof PlatformUserPlaylistArtistAffinity {
48
+ return PlatformUserPlaylistArtistAffinity.init({
49
+ id: {
50
+ type: DataTypes.UUID,
51
+ allowNull: false,
52
+ defaultValue: DataTypes.UUIDV4,
53
+ primaryKey: true
54
+ },
55
+ platformUserPlaylistId: {
56
+ type: DataTypes.UUID,
57
+ allowNull: false,
58
+ references: {
59
+ model: 'platform_user_playlist',
60
+ key: 'id'
61
+ },
62
+ unique: "unique_pupaa_canon_artist",
63
+ field: 'platform_user_playlist_id'
64
+ },
65
+ canonArtistId: {
66
+ type: DataTypes.UUID,
67
+ allowNull: false,
68
+ references: {
69
+ model: 'canon_artist',
70
+ key: 'id'
71
+ },
72
+ unique: "unique_pupaa_canon_artist",
73
+ field: 'canon_artist_id'
74
+ },
75
+ affinityTierId: {
76
+ type: DataTypes.SMALLINT,
77
+ allowNull: false,
78
+ references: {
79
+ model: 'affinity_tier',
80
+ key: 'id'
81
+ },
82
+ field: 'affinity_tier_id'
83
+ },
84
+ rank: {
85
+ type: DataTypes.INTEGER,
86
+ allowNull: false
87
+ },
88
+ createdAt: {
89
+ type: DataTypes.DATE,
90
+ allowNull: false,
91
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
92
+ field: 'created_at'
93
+ },
94
+ updatedAt: {
95
+ type: DataTypes.DATE,
96
+ allowNull: false,
97
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
98
+ field: 'updated_at'
99
+ }
100
+ }, {
101
+ sequelize,
102
+ tableName: 'platform_user_playlist_artist_affinity',
103
+ schema: 'eb',
104
+ timestamps: false,
105
+ indexes: [
106
+ {
107
+ name: "idx_platform_user_playlist_artist_affinity",
108
+ fields: [
109
+ { name: "platform_user_playlist_id" },
110
+ ]
111
+ },
112
+ {
113
+ name: "idx_platform_user_playlist_artist_affinity_artist",
114
+ fields: [
115
+ { name: "canon_artist_id" },
116
+ ]
117
+ },
118
+ {
119
+ name: "platform_user_playlist_artist_affinity_pkey",
120
+ unique: true,
121
+ fields: [
122
+ { name: "id" },
123
+ ]
124
+ },
125
+ {
126
+ name: "unique_pupaa_canon_artist",
127
+ unique: true,
128
+ fields: [
129
+ { name: "platform_user_playlist_id" },
130
+ { name: "canon_artist_id" },
131
+ ]
132
+ },
133
+ ]
134
+ });
135
+ }
136
+ }