@earbug/db-models 0.0.15 → 0.0.17

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 (51) hide show
  1. package/.github/workflows/publish.yaml +54 -0
  2. package/.nvmrc +1 -1
  3. package/dist/AppUser.d.ts +24 -0
  4. package/dist/CanonArtist.d.ts +43 -1
  5. package/dist/CanonArtist.js +18 -2
  6. package/dist/GuestUser.d.ts +42 -0
  7. package/dist/GuestUser.js +91 -0
  8. package/dist/JukeboxQueueEntry.d.ts +19 -5
  9. package/dist/JukeboxQueueEntry.js +36 -18
  10. package/dist/JukeboxSession.d.ts +36 -0
  11. package/dist/MerchItem.d.ts +50 -0
  12. package/dist/MerchItem.js +120 -0
  13. package/dist/MerchOrchestration.d.ts +42 -0
  14. package/dist/MerchOrchestration.js +104 -0
  15. package/dist/MerchPlatform.d.ts +45 -0
  16. package/dist/MerchPlatform.js +75 -0
  17. package/dist/MerchType.d.ts +43 -0
  18. package/dist/MerchType.js +71 -0
  19. package/dist/NewsArticle.js +5 -5
  20. package/dist/NewsPlatform.js +2 -2
  21. package/dist/PlatformTrack.d.ts +12 -0
  22. package/dist/PlatformUserPlaylist.d.ts +24 -0
  23. package/dist/RadioShow.d.ts +24 -0
  24. package/dist/RadioShow.js +6 -0
  25. package/dist/RadioShowGenres.d.ts +3 -1
  26. package/dist/RadioShowGenres.js +24 -0
  27. package/dist/UserComments.d.ts +55 -0
  28. package/dist/UserComments.js +151 -0
  29. package/dist/UserLikes.d.ts +45 -0
  30. package/dist/UserLikes.js +151 -0
  31. package/dist/init-models.d.ts +23 -2
  32. package/dist/init-models.js +66 -2
  33. package/models/AppUser.ts +26 -0
  34. package/models/CanonArtist.ts +64 -3
  35. package/models/GuestUser.ts +108 -0
  36. package/models/JukeboxQueueEntry.ts +57 -23
  37. package/models/JukeboxSession.ts +39 -0
  38. package/models/MerchItem.ts +146 -0
  39. package/models/MerchOrchestration.ts +122 -0
  40. package/models/MerchPlatform.ts +95 -0
  41. package/models/MerchType.ts +89 -0
  42. package/models/NewsArticle.ts +5 -6
  43. package/models/NewsPlatform.ts +2 -3
  44. package/models/PlatformTrack.ts +13 -0
  45. package/models/PlatformUserPlaylist.ts +26 -0
  46. package/models/RadioShow.ts +32 -0
  47. package/models/RadioShowGenres.ts +27 -1
  48. package/models/UserComments.ts +184 -0
  49. package/models/UserLikes.ts +173 -0
  50. package/models/init-models.ts +85 -0
  51. package/package.json +1 -1
@@ -5,6 +5,8 @@ import type { RadioShowGenres, RadioShowGenresId } from './RadioShowGenres';
5
5
  import type { RadioShowMedia, RadioShowMediaId } from './RadioShowMedia';
6
6
  import type { RadioShowPlacement, RadioShowPlacementId } from './RadioShowPlacement';
7
7
  import type { RadioShowPublishRequests, RadioShowPublishRequestsId } from './RadioShowPublishRequests';
8
+ import type { UserComments, UserCommentsId } from './UserComments';
9
+ import type { UserLikes, UserLikesId } from './UserLikes';
8
10
 
9
11
  export interface RadioShowAttributes {
10
12
  creatorUserId: string;
@@ -85,6 +87,30 @@ export class RadioShow extends Model<RadioShowAttributes, RadioShowCreationAttri
85
87
  hasRadioShowPublishRequest!: Sequelize.HasManyHasAssociationMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
86
88
  hasRadioShowPublishRequests!: Sequelize.HasManyHasAssociationsMixin<RadioShowPublishRequests, RadioShowPublishRequestsId>;
87
89
  countRadioShowPublishRequests!: Sequelize.HasManyCountAssociationsMixin;
90
+ // RadioShow hasMany UserComments via radioShowId
91
+ userComments!: UserComments[];
92
+ getUserComments!: Sequelize.HasManyGetAssociationsMixin<UserComments>;
93
+ setUserComments!: Sequelize.HasManySetAssociationsMixin<UserComments, UserCommentsId>;
94
+ addUserComment!: Sequelize.HasManyAddAssociationMixin<UserComments, UserCommentsId>;
95
+ addUserComments!: Sequelize.HasManyAddAssociationsMixin<UserComments, UserCommentsId>;
96
+ createUserComment!: Sequelize.HasManyCreateAssociationMixin<UserComments>;
97
+ removeUserComment!: Sequelize.HasManyRemoveAssociationMixin<UserComments, UserCommentsId>;
98
+ removeUserComments!: Sequelize.HasManyRemoveAssociationsMixin<UserComments, UserCommentsId>;
99
+ hasUserComment!: Sequelize.HasManyHasAssociationMixin<UserComments, UserCommentsId>;
100
+ hasUserComments!: Sequelize.HasManyHasAssociationsMixin<UserComments, UserCommentsId>;
101
+ countUserComments!: Sequelize.HasManyCountAssociationsMixin;
102
+ // RadioShow hasMany UserLikes via radioShowId
103
+ userLikes!: UserLikes[];
104
+ getUserLikes!: Sequelize.HasManyGetAssociationsMixin<UserLikes>;
105
+ setUserLikes!: Sequelize.HasManySetAssociationsMixin<UserLikes, UserLikesId>;
106
+ addUserLike!: Sequelize.HasManyAddAssociationMixin<UserLikes, UserLikesId>;
107
+ addUserLikes!: Sequelize.HasManyAddAssociationsMixin<UserLikes, UserLikesId>;
108
+ createUserLike!: Sequelize.HasManyCreateAssociationMixin<UserLikes>;
109
+ removeUserLike!: Sequelize.HasManyRemoveAssociationMixin<UserLikes, UserLikesId>;
110
+ removeUserLikes!: Sequelize.HasManyRemoveAssociationsMixin<UserLikes, UserLikesId>;
111
+ hasUserLike!: Sequelize.HasManyHasAssociationMixin<UserLikes, UserLikesId>;
112
+ hasUserLikes!: Sequelize.HasManyHasAssociationsMixin<UserLikes, UserLikesId>;
113
+ countUserLikes!: Sequelize.HasManyCountAssociationsMixin;
88
114
 
89
115
  static initModel(sequelize: Sequelize.Sequelize): typeof RadioShow {
90
116
  return RadioShow.init({
@@ -138,6 +164,12 @@ export class RadioShow extends Model<RadioShowAttributes, RadioShowCreationAttri
138
164
  schema: 'eb',
139
165
  timestamps: false,
140
166
  indexes: [
167
+ {
168
+ name: "idx_radio_show_creator",
169
+ fields: [
170
+ { name: "creator_user_id" },
171
+ ]
172
+ },
141
173
  {
142
174
  name: "radio_show_pkey",
143
175
  unique: true,
@@ -8,11 +8,12 @@ export interface RadioShowGenresAttributes {
8
8
  radioShowId: string;
9
9
  title: string;
10
10
  id: string;
11
+ seqNum?: number;
11
12
  }
12
13
 
13
14
  export type RadioShowGenresPk = "id";
14
15
  export type RadioShowGenresId = RadioShowGenres[RadioShowGenresPk];
15
- export type RadioShowGenresOptionalAttributes = "id";
16
+ export type RadioShowGenresOptionalAttributes = "id" | "seqNum";
16
17
  export type RadioShowGenresCreationAttributes = Optional<RadioShowGenresAttributes, RadioShowGenresOptionalAttributes>;
17
18
 
18
19
  export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowGenresCreationAttributes> implements RadioShowGenresAttributes {
@@ -20,6 +21,7 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
20
21
  radioShowId!: string;
21
22
  title!: string;
22
23
  id!: string;
24
+ seqNum?: number;
23
25
 
24
26
  // RadioShowGenres belongsTo CanonGenre via canonGenreId
25
27
  canonGenre!: CanonGenre;
@@ -41,6 +43,7 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
41
43
  model: 'canon_genre',
42
44
  key: 'id'
43
45
  },
46
+ unique: "uq_radio_show_genre_unique",
44
47
  field: 'canon_genre_id'
45
48
  },
46
49
  radioShowId: {
@@ -50,6 +53,7 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
50
53
  model: 'radio_show',
51
54
  key: 'id'
52
55
  },
56
+ unique: "uq_radio_show_genre_unique",
53
57
  field: 'radio_show_id'
54
58
  },
55
59
  title: {
@@ -61,6 +65,12 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
61
65
  allowNull: false,
62
66
  defaultValue: DataTypes.UUIDV4,
63
67
  primaryKey: true
68
+ },
69
+ seqNum: {
70
+ type: DataTypes.SMALLINT,
71
+ allowNull: true,
72
+ unique: "uq_radio_show_genre_seq_unique",
73
+ field: 'seq_num'
64
74
  }
65
75
  }, {
66
76
  sequelize,
@@ -75,6 +85,22 @@ export class RadioShowGenres extends Model<RadioShowGenresAttributes, RadioShowG
75
85
  { name: "id" },
76
86
  ]
77
87
  },
88
+ {
89
+ name: "uq_radio_show_genre_seq_unique",
90
+ unique: true,
91
+ fields: [
92
+ { name: "radio_show_id" },
93
+ { name: "seq_num" },
94
+ ]
95
+ },
96
+ {
97
+ name: "uq_radio_show_genre_unique",
98
+ unique: true,
99
+ fields: [
100
+ { name: "radio_show_id" },
101
+ { name: "canon_genre_id" },
102
+ ]
103
+ },
78
104
  ]
79
105
  });
80
106
  }
@@ -0,0 +1,184 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AppUser, AppUserId } from './AppUser';
4
+ import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
5
+ import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
6
+ import type { RadioShow, RadioShowId } from './RadioShow';
7
+
8
+ export interface UserCommentsAttributes {
9
+ appUserId: string;
10
+ jukeboxId?: string;
11
+ playlistId?: string;
12
+ radioShowId?: string;
13
+ comment: string;
14
+ id: string;
15
+ replyCommentId?: string;
16
+ deleted: boolean;
17
+ createDate: Date;
18
+ updateDate: Date;
19
+ }
20
+
21
+ export type UserCommentsPk = "id";
22
+ export type UserCommentsId = UserComments[UserCommentsPk];
23
+ export type UserCommentsOptionalAttributes = "jukeboxId" | "playlistId" | "radioShowId" | "id" | "replyCommentId" | "createDate" | "updateDate";
24
+ export type UserCommentsCreationAttributes = Optional<UserCommentsAttributes, UserCommentsOptionalAttributes>;
25
+
26
+ export class UserComments extends Model<UserCommentsAttributes, UserCommentsCreationAttributes> implements UserCommentsAttributes {
27
+ appUserId!: string;
28
+ jukeboxId?: string;
29
+ playlistId?: string;
30
+ radioShowId?: string;
31
+ comment!: string;
32
+ id!: string;
33
+ replyCommentId?: string;
34
+ deleted!: boolean;
35
+ createDate!: Date;
36
+ updateDate!: Date;
37
+
38
+ // UserComments belongsTo AppUser via appUserId
39
+ appUser!: AppUser;
40
+ getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
41
+ setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
42
+ createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
43
+ // UserComments belongsTo JukeboxSession via jukeboxId
44
+ jukebox!: JukeboxSession;
45
+ getJukebox!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
46
+ setJukebox!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
47
+ createJukebox!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
48
+ // UserComments belongsTo PlatformUserPlaylist via playlistId
49
+ playlist!: PlatformUserPlaylist;
50
+ getPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
51
+ setPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
52
+ createPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
53
+ // UserComments belongsTo RadioShow via radioShowId
54
+ radioShow!: RadioShow;
55
+ getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
56
+ setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
57
+ createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
58
+ // UserComments belongsTo UserComments via replyCommentId
59
+ replyComment!: UserComments;
60
+ getReplyComment!: Sequelize.BelongsToGetAssociationMixin<UserComments>;
61
+ setReplyComment!: Sequelize.BelongsToSetAssociationMixin<UserComments, UserCommentsId>;
62
+ createReplyComment!: Sequelize.BelongsToCreateAssociationMixin<UserComments>;
63
+
64
+ static initModel(sequelize: Sequelize.Sequelize): typeof UserComments {
65
+ return UserComments.init({
66
+ appUserId: {
67
+ type: DataTypes.UUID,
68
+ allowNull: false,
69
+ references: {
70
+ model: 'app_user',
71
+ key: 'id'
72
+ },
73
+ field: 'app_user_id'
74
+ },
75
+ jukeboxId: {
76
+ type: DataTypes.UUID,
77
+ allowNull: true,
78
+ references: {
79
+ model: 'jukebox_session',
80
+ key: 'id'
81
+ },
82
+ field: 'jukebox_id'
83
+ },
84
+ playlistId: {
85
+ type: DataTypes.UUID,
86
+ allowNull: true,
87
+ references: {
88
+ model: 'platform_user_playlist',
89
+ key: 'id'
90
+ },
91
+ field: 'playlist_id'
92
+ },
93
+ radioShowId: {
94
+ type: DataTypes.UUID,
95
+ allowNull: true,
96
+ references: {
97
+ model: 'radio_show',
98
+ key: 'id'
99
+ },
100
+ field: 'radio_show_id'
101
+ },
102
+ comment: {
103
+ type: DataTypes.STRING(1000),
104
+ allowNull: false
105
+ },
106
+ id: {
107
+ type: DataTypes.UUID,
108
+ allowNull: false,
109
+ defaultValue: DataTypes.UUIDV4,
110
+ primaryKey: true
111
+ },
112
+ replyCommentId: {
113
+ type: DataTypes.UUID,
114
+ allowNull: true,
115
+ references: {
116
+ model: 'user_comments',
117
+ key: 'id'
118
+ },
119
+ field: 'reply_comment_id'
120
+ },
121
+ deleted: {
122
+ type: DataTypes.BOOLEAN,
123
+ allowNull: false,
124
+ defaultValue: false
125
+ },
126
+ createDate: {
127
+ type: DataTypes.DATE,
128
+ allowNull: false,
129
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
130
+ field: 'create_date'
131
+ },
132
+ updateDate: {
133
+ type: DataTypes.DATE,
134
+ allowNull: false,
135
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
136
+ field: 'update_date'
137
+ }
138
+ }, {
139
+ sequelize,
140
+ tableName: 'user_comments',
141
+ schema: 'eb',
142
+ timestamps: false,
143
+ indexes: [
144
+ {
145
+ name: "idx_user_comments_jukebox",
146
+ fields: [
147
+ { name: "jukebox_id" },
148
+ ]
149
+ },
150
+ {
151
+ name: "idx_user_comments_playlist",
152
+ fields: [
153
+ { name: "playlist_id" },
154
+ ]
155
+ },
156
+ {
157
+ name: "idx_user_comments_radio_show",
158
+ fields: [
159
+ { name: "radio_show_id" },
160
+ ]
161
+ },
162
+ {
163
+ name: "idx_user_comments_reply",
164
+ fields: [
165
+ { name: "reply_comment_id" },
166
+ ]
167
+ },
168
+ {
169
+ name: "idx_user_comments_user",
170
+ fields: [
171
+ { name: "app_user_id" },
172
+ ]
173
+ },
174
+ {
175
+ name: "user_comments_pkey",
176
+ unique: true,
177
+ fields: [
178
+ { name: "id" },
179
+ ]
180
+ },
181
+ ]
182
+ });
183
+ }
184
+ }
@@ -0,0 +1,173 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AppUser, AppUserId } from './AppUser';
4
+ import type { JukeboxSession, JukeboxSessionId } from './JukeboxSession';
5
+ import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
6
+ import type { RadioShow, RadioShowId } from './RadioShow';
7
+
8
+ export interface UserLikesAttributes {
9
+ appUserId: string;
10
+ jukeboxId?: string;
11
+ playlistId?: string;
12
+ radioShowId?: string;
13
+ id: string;
14
+ createDate: Date;
15
+ updateDate: Date;
16
+ }
17
+
18
+ export type UserLikesPk = "id";
19
+ export type UserLikesId = UserLikes[UserLikesPk];
20
+ export type UserLikesOptionalAttributes = "jukeboxId" | "playlistId" | "radioShowId" | "id" | "createDate" | "updateDate";
21
+ export type UserLikesCreationAttributes = Optional<UserLikesAttributes, UserLikesOptionalAttributes>;
22
+
23
+ export class UserLikes extends Model<UserLikesAttributes, UserLikesCreationAttributes> implements UserLikesAttributes {
24
+ appUserId!: string;
25
+ jukeboxId?: string;
26
+ playlistId?: string;
27
+ radioShowId?: string;
28
+ id!: string;
29
+ createDate!: Date;
30
+ updateDate!: Date;
31
+
32
+ // UserLikes belongsTo AppUser via appUserId
33
+ appUser!: AppUser;
34
+ getAppUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
35
+ setAppUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
36
+ createAppUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
37
+ // UserLikes belongsTo JukeboxSession via jukeboxId
38
+ jukebox!: JukeboxSession;
39
+ getJukebox!: Sequelize.BelongsToGetAssociationMixin<JukeboxSession>;
40
+ setJukebox!: Sequelize.BelongsToSetAssociationMixin<JukeboxSession, JukeboxSessionId>;
41
+ createJukebox!: Sequelize.BelongsToCreateAssociationMixin<JukeboxSession>;
42
+ // UserLikes belongsTo PlatformUserPlaylist via playlistId
43
+ playlist!: PlatformUserPlaylist;
44
+ getPlaylist!: Sequelize.BelongsToGetAssociationMixin<PlatformUserPlaylist>;
45
+ setPlaylist!: Sequelize.BelongsToSetAssociationMixin<PlatformUserPlaylist, PlatformUserPlaylistId>;
46
+ createPlaylist!: Sequelize.BelongsToCreateAssociationMixin<PlatformUserPlaylist>;
47
+ // UserLikes belongsTo RadioShow via radioShowId
48
+ radioShow!: RadioShow;
49
+ getRadioShow!: Sequelize.BelongsToGetAssociationMixin<RadioShow>;
50
+ setRadioShow!: Sequelize.BelongsToSetAssociationMixin<RadioShow, RadioShowId>;
51
+ createRadioShow!: Sequelize.BelongsToCreateAssociationMixin<RadioShow>;
52
+
53
+ static initModel(sequelize: Sequelize.Sequelize): typeof UserLikes {
54
+ return UserLikes.init({
55
+ appUserId: {
56
+ type: DataTypes.UUID,
57
+ allowNull: false,
58
+ references: {
59
+ model: 'app_user',
60
+ key: 'id'
61
+ },
62
+ field: 'app_user_id'
63
+ },
64
+ jukeboxId: {
65
+ type: DataTypes.UUID,
66
+ allowNull: true,
67
+ references: {
68
+ model: 'jukebox_session',
69
+ key: 'id'
70
+ },
71
+ field: 'jukebox_id'
72
+ },
73
+ playlistId: {
74
+ type: DataTypes.UUID,
75
+ allowNull: true,
76
+ references: {
77
+ model: 'platform_user_playlist',
78
+ key: 'id'
79
+ },
80
+ field: 'playlist_id'
81
+ },
82
+ radioShowId: {
83
+ type: DataTypes.UUID,
84
+ allowNull: true,
85
+ references: {
86
+ model: 'radio_show',
87
+ key: 'id'
88
+ },
89
+ field: 'radio_show_id'
90
+ },
91
+ id: {
92
+ type: DataTypes.UUID,
93
+ allowNull: false,
94
+ defaultValue: DataTypes.UUIDV4,
95
+ primaryKey: true
96
+ },
97
+ createDate: {
98
+ type: DataTypes.DATE,
99
+ allowNull: false,
100
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
101
+ field: 'create_date'
102
+ },
103
+ updateDate: {
104
+ type: DataTypes.DATE,
105
+ allowNull: false,
106
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
107
+ field: 'update_date'
108
+ }
109
+ }, {
110
+ sequelize,
111
+ tableName: 'user_likes',
112
+ schema: 'eb',
113
+ timestamps: false,
114
+ indexes: [
115
+ {
116
+ name: "idx_user_likes_jukebox",
117
+ fields: [
118
+ { name: "jukebox_id" },
119
+ ]
120
+ },
121
+ {
122
+ name: "idx_user_likes_playlist",
123
+ fields: [
124
+ { name: "playlist_id" },
125
+ ]
126
+ },
127
+ {
128
+ name: "idx_user_likes_radio_show",
129
+ fields: [
130
+ { name: "radio_show_id" },
131
+ ]
132
+ },
133
+ {
134
+ name: "idx_user_likes_user",
135
+ fields: [
136
+ { name: "app_user_id" },
137
+ ]
138
+ },
139
+ {
140
+ name: "uq_user_likes_user_jukebox",
141
+ unique: true,
142
+ fields: [
143
+ { name: "app_user_id" },
144
+ { name: "jukebox_id" },
145
+ ]
146
+ },
147
+ {
148
+ name: "uq_user_likes_user_playlist",
149
+ unique: true,
150
+ fields: [
151
+ { name: "app_user_id" },
152
+ { name: "playlist_id" },
153
+ ]
154
+ },
155
+ {
156
+ name: "uq_user_likes_user_radio_show",
157
+ unique: true,
158
+ fields: [
159
+ { name: "app_user_id" },
160
+ { name: "radio_show_id" },
161
+ ]
162
+ },
163
+ {
164
+ name: "user_likes_pkey",
165
+ unique: true,
166
+ fields: [
167
+ { name: "id" },
168
+ ]
169
+ },
170
+ ]
171
+ });
172
+ }
173
+ }