@earbug/db-models 0.0.22 → 0.0.24

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.
@@ -0,0 +1,124 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { UserEngagementFactor, UserEngagementFactorId } from './UserEngagementFactor';
4
+
5
+ export interface FeedContentTypeAttributes {
6
+ name: string;
7
+ id: string;
8
+ mixPercentage: number;
9
+ affinityMixHigh: number;
10
+ affinityMixMedium: number;
11
+ affinityMixLow: number;
12
+ apiEndpoint?: string;
13
+ isActive: boolean;
14
+ createDate?: Date;
15
+ updateDate?: Date;
16
+ }
17
+
18
+ export type FeedContentTypePk = "id";
19
+ export type FeedContentTypeId = FeedContentType[FeedContentTypePk];
20
+ export type FeedContentTypeOptionalAttributes = "id" | "mixPercentage" | "affinityMixHigh" | "affinityMixMedium" | "affinityMixLow" | "apiEndpoint" | "isActive" | "createDate" | "updateDate";
21
+ export type FeedContentTypeCreationAttributes = Optional<FeedContentTypeAttributes, FeedContentTypeOptionalAttributes>;
22
+
23
+ export class FeedContentType extends Model<FeedContentTypeAttributes, FeedContentTypeCreationAttributes> implements FeedContentTypeAttributes {
24
+ name!: string;
25
+ id!: string;
26
+ mixPercentage!: number;
27
+ affinityMixHigh!: number;
28
+ affinityMixMedium!: number;
29
+ affinityMixLow!: number;
30
+ apiEndpoint?: string;
31
+ isActive!: boolean;
32
+ createDate?: Date;
33
+ updateDate?: Date;
34
+
35
+ // FeedContentType hasMany UserEngagementFactor via contentTypeId
36
+ userEngagementFactors!: UserEngagementFactor[];
37
+ getUserEngagementFactors!: Sequelize.HasManyGetAssociationsMixin<UserEngagementFactor>;
38
+ setUserEngagementFactors!: Sequelize.HasManySetAssociationsMixin<UserEngagementFactor, UserEngagementFactorId>;
39
+ addUserEngagementFactor!: Sequelize.HasManyAddAssociationMixin<UserEngagementFactor, UserEngagementFactorId>;
40
+ addUserEngagementFactors!: Sequelize.HasManyAddAssociationsMixin<UserEngagementFactor, UserEngagementFactorId>;
41
+ createUserEngagementFactor!: Sequelize.HasManyCreateAssociationMixin<UserEngagementFactor>;
42
+ removeUserEngagementFactor!: Sequelize.HasManyRemoveAssociationMixin<UserEngagementFactor, UserEngagementFactorId>;
43
+ removeUserEngagementFactors!: Sequelize.HasManyRemoveAssociationsMixin<UserEngagementFactor, UserEngagementFactorId>;
44
+ hasUserEngagementFactor!: Sequelize.HasManyHasAssociationMixin<UserEngagementFactor, UserEngagementFactorId>;
45
+ hasUserEngagementFactors!: Sequelize.HasManyHasAssociationsMixin<UserEngagementFactor, UserEngagementFactorId>;
46
+ countUserEngagementFactors!: Sequelize.HasManyCountAssociationsMixin;
47
+
48
+ static initModel(sequelize: Sequelize.Sequelize): typeof FeedContentType {
49
+ return FeedContentType.init({
50
+ name: {
51
+ type: DataTypes.STRING(50),
52
+ allowNull: false
53
+ },
54
+ id: {
55
+ type: DataTypes.UUID,
56
+ allowNull: false,
57
+ defaultValue: DataTypes.UUIDV4,
58
+ primaryKey: true
59
+ },
60
+ mixPercentage: {
61
+ type: DataTypes.DECIMAL,
62
+ allowNull: false,
63
+ defaultValue: 20,
64
+ field: 'mix_percentage'
65
+ },
66
+ affinityMixHigh: {
67
+ type: DataTypes.DECIMAL,
68
+ allowNull: false,
69
+ defaultValue: 30,
70
+ field: 'affinity_mix_high'
71
+ },
72
+ affinityMixMedium: {
73
+ type: DataTypes.DECIMAL,
74
+ allowNull: false,
75
+ defaultValue: 50,
76
+ field: 'affinity_mix_medium'
77
+ },
78
+ affinityMixLow: {
79
+ type: DataTypes.DECIMAL,
80
+ allowNull: false,
81
+ defaultValue: 20,
82
+ field: 'affinity_mix_low'
83
+ },
84
+ apiEndpoint: {
85
+ type: DataTypes.STRING(255),
86
+ allowNull: true,
87
+ defaultValue: "",
88
+ field: 'api_endpoint'
89
+ },
90
+ isActive: {
91
+ type: DataTypes.BOOLEAN,
92
+ allowNull: false,
93
+ defaultValue: true,
94
+ field: 'is_active'
95
+ },
96
+ createDate: {
97
+ type: DataTypes.DATE,
98
+ allowNull: true,
99
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
100
+ field: 'create_date'
101
+ },
102
+ updateDate: {
103
+ type: DataTypes.DATE,
104
+ allowNull: true,
105
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
106
+ field: 'update_date'
107
+ }
108
+ }, {
109
+ sequelize,
110
+ tableName: 'feed_content_type',
111
+ schema: 'eb',
112
+ timestamps: false,
113
+ indexes: [
114
+ {
115
+ name: "feed_content_type_pkey",
116
+ unique: true,
117
+ fields: [
118
+ { name: "id" },
119
+ ]
120
+ },
121
+ ]
122
+ });
123
+ }
124
+ }
@@ -0,0 +1,117 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AffinityRelationshipType, AffinityRelationshipTypeId } from './AffinityRelationshipType';
4
+ import type { AppUser, AppUserId } from './AppUser';
5
+
6
+ export interface UserAffinityAttributes {
7
+ userId: string;
8
+ affinityRelationshipTypeId: string;
9
+ relatedId: string;
10
+ id: string;
11
+ createDate?: Date;
12
+ updateDate?: Date;
13
+ }
14
+
15
+ export type UserAffinityPk = "id";
16
+ export type UserAffinityId = UserAffinity[UserAffinityPk];
17
+ export type UserAffinityOptionalAttributes = "id" | "createDate" | "updateDate";
18
+ export type UserAffinityCreationAttributes = Optional<UserAffinityAttributes, UserAffinityOptionalAttributes>;
19
+
20
+ export class UserAffinity extends Model<UserAffinityAttributes, UserAffinityCreationAttributes> implements UserAffinityAttributes {
21
+ userId!: string;
22
+ affinityRelationshipTypeId!: string;
23
+ relatedId!: string;
24
+ id!: string;
25
+ createDate?: Date;
26
+ updateDate?: Date;
27
+
28
+ // UserAffinity belongsTo AffinityRelationshipType via affinityRelationshipTypeId
29
+ affinityRelationshipType!: AffinityRelationshipType;
30
+ getAffinityRelationshipType!: Sequelize.BelongsToGetAssociationMixin<AffinityRelationshipType>;
31
+ setAffinityRelationshipType!: Sequelize.BelongsToSetAssociationMixin<AffinityRelationshipType, AffinityRelationshipTypeId>;
32
+ createAffinityRelationshipType!: Sequelize.BelongsToCreateAssociationMixin<AffinityRelationshipType>;
33
+ // UserAffinity belongsTo AppUser via userId
34
+ user!: AppUser;
35
+ getUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
36
+ setUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
37
+ createUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
38
+
39
+ static initModel(sequelize: Sequelize.Sequelize): typeof UserAffinity {
40
+ return UserAffinity.init({
41
+ userId: {
42
+ type: DataTypes.UUID,
43
+ allowNull: false,
44
+ references: {
45
+ model: 'app_user',
46
+ key: 'id'
47
+ },
48
+ unique: "user_affinity_user_id_affinity_relationship_type_id_related_id_",
49
+ field: 'user_id'
50
+ },
51
+ affinityRelationshipTypeId: {
52
+ type: DataTypes.UUID,
53
+ allowNull: false,
54
+ references: {
55
+ model: 'affinity_relationship_type',
56
+ key: 'id'
57
+ },
58
+ unique: "user_affinity_user_id_affinity_relationship_type_id_related_id_",
59
+ field: 'affinity_relationship_type_id'
60
+ },
61
+ relatedId: {
62
+ type: DataTypes.UUID,
63
+ allowNull: false,
64
+ unique: "user_affinity_user_id_affinity_relationship_type_id_related_id_",
65
+ field: 'related_id'
66
+ },
67
+ id: {
68
+ type: DataTypes.UUID,
69
+ allowNull: false,
70
+ defaultValue: DataTypes.UUIDV4,
71
+ primaryKey: true
72
+ },
73
+ createDate: {
74
+ type: DataTypes.DATE,
75
+ allowNull: true,
76
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
77
+ field: 'create_date'
78
+ },
79
+ updateDate: {
80
+ type: DataTypes.DATE,
81
+ allowNull: true,
82
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
83
+ field: 'update_date'
84
+ }
85
+ }, {
86
+ sequelize,
87
+ tableName: 'user_affinity',
88
+ schema: 'eb',
89
+ timestamps: false,
90
+ indexes: [
91
+ {
92
+ name: "user_affinity_pkey",
93
+ unique: true,
94
+ fields: [
95
+ { name: "id" },
96
+ ]
97
+ },
98
+ {
99
+ name: "user_affinity_user_id_affinity_relationship_type_id_index",
100
+ fields: [
101
+ { name: "user_id" },
102
+ { name: "affinity_relationship_type_id" },
103
+ ]
104
+ },
105
+ {
106
+ name: "user_affinity_user_id_affinity_relationship_type_id_related_id_",
107
+ unique: true,
108
+ fields: [
109
+ { name: "user_id" },
110
+ { name: "affinity_relationship_type_id" },
111
+ { name: "related_id" },
112
+ ]
113
+ },
114
+ ]
115
+ });
116
+ }
117
+ }
@@ -0,0 +1,109 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { AppUser, AppUserId } from './AppUser';
4
+ import type { FeedContentType, FeedContentTypeId } from './FeedContentType';
5
+
6
+ export interface UserEngagementFactorAttributes {
7
+ userId: string;
8
+ contentTypeId: string;
9
+ id: string;
10
+ engagementFactor: number;
11
+ createDate?: Date;
12
+ updateDate?: Date;
13
+ }
14
+
15
+ export type UserEngagementFactorPk = "id";
16
+ export type UserEngagementFactorId = UserEngagementFactor[UserEngagementFactorPk];
17
+ export type UserEngagementFactorOptionalAttributes = "id" | "engagementFactor" | "createDate" | "updateDate";
18
+ export type UserEngagementFactorCreationAttributes = Optional<UserEngagementFactorAttributes, UserEngagementFactorOptionalAttributes>;
19
+
20
+ export class UserEngagementFactor extends Model<UserEngagementFactorAttributes, UserEngagementFactorCreationAttributes> implements UserEngagementFactorAttributes {
21
+ userId!: string;
22
+ contentTypeId!: string;
23
+ id!: string;
24
+ engagementFactor!: number;
25
+ createDate?: Date;
26
+ updateDate?: Date;
27
+
28
+ // UserEngagementFactor belongsTo AppUser via userId
29
+ user!: AppUser;
30
+ getUser!: Sequelize.BelongsToGetAssociationMixin<AppUser>;
31
+ setUser!: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
32
+ createUser!: Sequelize.BelongsToCreateAssociationMixin<AppUser>;
33
+ // UserEngagementFactor belongsTo FeedContentType via contentTypeId
34
+ contentType!: FeedContentType;
35
+ getContentType!: Sequelize.BelongsToGetAssociationMixin<FeedContentType>;
36
+ setContentType!: Sequelize.BelongsToSetAssociationMixin<FeedContentType, FeedContentTypeId>;
37
+ createContentType!: Sequelize.BelongsToCreateAssociationMixin<FeedContentType>;
38
+
39
+ static initModel(sequelize: Sequelize.Sequelize): typeof UserEngagementFactor {
40
+ return UserEngagementFactor.init({
41
+ userId: {
42
+ type: DataTypes.UUID,
43
+ allowNull: false,
44
+ references: {
45
+ model: 'app_user',
46
+ key: 'id'
47
+ },
48
+ unique: "user_engagement_factor_user_id_content_type_id_unique",
49
+ field: 'user_id'
50
+ },
51
+ contentTypeId: {
52
+ type: DataTypes.UUID,
53
+ allowNull: false,
54
+ references: {
55
+ model: 'feed_content_type',
56
+ key: 'id'
57
+ },
58
+ unique: "user_engagement_factor_user_id_content_type_id_unique",
59
+ field: 'content_type_id'
60
+ },
61
+ id: {
62
+ type: DataTypes.UUID,
63
+ allowNull: false,
64
+ defaultValue: DataTypes.UUIDV4,
65
+ primaryKey: true
66
+ },
67
+ engagementFactor: {
68
+ type: DataTypes.DECIMAL,
69
+ allowNull: false,
70
+ defaultValue: 1,
71
+ field: 'engagement_factor'
72
+ },
73
+ createDate: {
74
+ type: DataTypes.DATE,
75
+ allowNull: true,
76
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
77
+ field: 'create_date'
78
+ },
79
+ updateDate: {
80
+ type: DataTypes.DATE,
81
+ allowNull: true,
82
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
83
+ field: 'update_date'
84
+ }
85
+ }, {
86
+ sequelize,
87
+ tableName: 'user_engagement_factor',
88
+ schema: 'eb',
89
+ timestamps: false,
90
+ indexes: [
91
+ {
92
+ name: "user_engagement_factor_pkey",
93
+ unique: true,
94
+ fields: [
95
+ { name: "id" },
96
+ ]
97
+ },
98
+ {
99
+ name: "user_engagement_factor_user_id_content_type_id_unique",
100
+ unique: true,
101
+ fields: [
102
+ { name: "user_id" },
103
+ { name: "content_type_id" },
104
+ ]
105
+ },
106
+ ]
107
+ });
108
+ }
109
+ }
@@ -1,6 +1,8 @@
1
1
  import type { Sequelize } from "sequelize";
2
2
  import { AccessControlPreference as _AccessControlPreference } from "./AccessControlPreference";
3
3
  import type { AccessControlPreferenceAttributes, AccessControlPreferenceCreationAttributes } from "./AccessControlPreference";
4
+ import { AffinityRelationshipType as _AffinityRelationshipType } from "./AffinityRelationshipType";
5
+ import type { AffinityRelationshipTypeAttributes, AffinityRelationshipTypeCreationAttributes } from "./AffinityRelationshipType";
4
6
  import { AppUser as _AppUser } from "./AppUser";
5
7
  import type { AppUserAttributes, AppUserCreationAttributes } from "./AppUser";
6
8
  import { AppUserDevice as _AppUserDevice } from "./AppUserDevice";
@@ -61,6 +63,10 @@ import { ConfigParam as _ConfigParam } from "./ConfigParam";
61
63
  import type { ConfigParamAttributes, ConfigParamCreationAttributes } from "./ConfigParam";
62
64
  import { ExternalReference as _ExternalReference } from "./ExternalReference";
63
65
  import type { ExternalReferenceAttributes, ExternalReferenceCreationAttributes } from "./ExternalReference";
66
+ import { FeedConfig as _FeedConfig } from "./FeedConfig";
67
+ import type { FeedConfigAttributes, FeedConfigCreationAttributes } from "./FeedConfig";
68
+ import { FeedContentType as _FeedContentType } from "./FeedContentType";
69
+ import type { FeedContentTypeAttributes, FeedContentTypeCreationAttributes } from "./FeedContentType";
64
70
  import { GuestUser as _GuestUser } from "./GuestUser";
65
71
  import type { GuestUserAttributes, GuestUserCreationAttributes } from "./GuestUser";
66
72
  import { JukeboxAccessType as _JukeboxAccessType } from "./JukeboxAccessType";
@@ -165,15 +171,20 @@ import { UnmatchedAlbum as _UnmatchedAlbum } from "./UnmatchedAlbum";
165
171
  import type { UnmatchedAlbumAttributes, UnmatchedAlbumCreationAttributes } from "./UnmatchedAlbum";
166
172
  import { UnmatchedArtist as _UnmatchedArtist } from "./UnmatchedArtist";
167
173
  import type { UnmatchedArtistAttributes, UnmatchedArtistCreationAttributes } from "./UnmatchedArtist";
174
+ import { UserAffinity as _UserAffinity } from "./UserAffinity";
175
+ import type { UserAffinityAttributes, UserAffinityCreationAttributes } from "./UserAffinity";
168
176
  import { UserComments as _UserComments } from "./UserComments";
169
177
  import type { UserCommentsAttributes, UserCommentsCreationAttributes } from "./UserComments";
170
178
  import { UserContacts as _UserContacts } from "./UserContacts";
171
179
  import type { UserContactsAttributes, UserContactsCreationAttributes } from "./UserContacts";
180
+ import { UserEngagementFactor as _UserEngagementFactor } from "./UserEngagementFactor";
181
+ import type { UserEngagementFactorAttributes, UserEngagementFactorCreationAttributes } from "./UserEngagementFactor";
172
182
  import { UserLikes as _UserLikes } from "./UserLikes";
173
183
  import type { UserLikesAttributes, UserLikesCreationAttributes } from "./UserLikes";
174
184
 
175
185
  export {
176
186
  _AccessControlPreference as AccessControlPreference,
187
+ _AffinityRelationshipType as AffinityRelationshipType,
177
188
  _AppUser as AppUser,
178
189
  _AppUserDevice as AppUserDevice,
179
190
  _AppUserFollowRelation as AppUserFollowRelation,
@@ -204,6 +215,8 @@ export {
204
215
  _CanonTrack as CanonTrack,
205
216
  _ConfigParam as ConfigParam,
206
217
  _ExternalReference as ExternalReference,
218
+ _FeedConfig as FeedConfig,
219
+ _FeedContentType as FeedContentType,
207
220
  _GuestUser as GuestUser,
208
221
  _JukeboxAccessType as JukeboxAccessType,
209
222
  _JukeboxCanonGenreRelation as JukeboxCanonGenreRelation,
@@ -256,14 +269,18 @@ export {
256
269
  _TrackDeletionReason as TrackDeletionReason,
257
270
  _UnmatchedAlbum as UnmatchedAlbum,
258
271
  _UnmatchedArtist as UnmatchedArtist,
272
+ _UserAffinity as UserAffinity,
259
273
  _UserComments as UserComments,
260
274
  _UserContacts as UserContacts,
275
+ _UserEngagementFactor as UserEngagementFactor,
261
276
  _UserLikes as UserLikes,
262
277
  };
263
278
 
264
279
  export type {
265
280
  AccessControlPreferenceAttributes,
266
281
  AccessControlPreferenceCreationAttributes,
282
+ AffinityRelationshipTypeAttributes,
283
+ AffinityRelationshipTypeCreationAttributes,
267
284
  AppUserAttributes,
268
285
  AppUserCreationAttributes,
269
286
  AppUserDeviceAttributes,
@@ -324,6 +341,10 @@ export type {
324
341
  ConfigParamCreationAttributes,
325
342
  ExternalReferenceAttributes,
326
343
  ExternalReferenceCreationAttributes,
344
+ FeedConfigAttributes,
345
+ FeedConfigCreationAttributes,
346
+ FeedContentTypeAttributes,
347
+ FeedContentTypeCreationAttributes,
327
348
  GuestUserAttributes,
328
349
  GuestUserCreationAttributes,
329
350
  JukeboxAccessTypeAttributes,
@@ -428,16 +449,21 @@ export type {
428
449
  UnmatchedAlbumCreationAttributes,
429
450
  UnmatchedArtistAttributes,
430
451
  UnmatchedArtistCreationAttributes,
452
+ UserAffinityAttributes,
453
+ UserAffinityCreationAttributes,
431
454
  UserCommentsAttributes,
432
455
  UserCommentsCreationAttributes,
433
456
  UserContactsAttributes,
434
457
  UserContactsCreationAttributes,
458
+ UserEngagementFactorAttributes,
459
+ UserEngagementFactorCreationAttributes,
435
460
  UserLikesAttributes,
436
461
  UserLikesCreationAttributes,
437
462
  };
438
463
 
439
464
  export function initModels(sequelize: Sequelize) {
440
465
  const AccessControlPreference = _AccessControlPreference.initModel(sequelize);
466
+ const AffinityRelationshipType = _AffinityRelationshipType.initModel(sequelize);
441
467
  const AppUser = _AppUser.initModel(sequelize);
442
468
  const AppUserDevice = _AppUserDevice.initModel(sequelize);
443
469
  const AppUserFollowRelation = _AppUserFollowRelation.initModel(sequelize);
@@ -468,6 +494,8 @@ export function initModels(sequelize: Sequelize) {
468
494
  const CanonTrack = _CanonTrack.initModel(sequelize);
469
495
  const ConfigParam = _ConfigParam.initModel(sequelize);
470
496
  const ExternalReference = _ExternalReference.initModel(sequelize);
497
+ const FeedConfig = _FeedConfig.initModel(sequelize);
498
+ const FeedContentType = _FeedContentType.initModel(sequelize);
471
499
  const GuestUser = _GuestUser.initModel(sequelize);
472
500
  const JukeboxAccessType = _JukeboxAccessType.initModel(sequelize);
473
501
  const JukeboxCanonGenreRelation = _JukeboxCanonGenreRelation.initModel(sequelize);
@@ -520,8 +548,10 @@ export function initModels(sequelize: Sequelize) {
520
548
  const TrackDeletionReason = _TrackDeletionReason.initModel(sequelize);
521
549
  const UnmatchedAlbum = _UnmatchedAlbum.initModel(sequelize);
522
550
  const UnmatchedArtist = _UnmatchedArtist.initModel(sequelize);
551
+ const UserAffinity = _UserAffinity.initModel(sequelize);
523
552
  const UserComments = _UserComments.initModel(sequelize);
524
553
  const UserContacts = _UserContacts.initModel(sequelize);
554
+ const UserEngagementFactor = _UserEngagementFactor.initModel(sequelize);
525
555
  const UserLikes = _UserLikes.initModel(sequelize);
526
556
 
527
557
  CanonAlbum.belongsToMany(CanonTrack, { as: 'canonTrackIdCanonTracks', through: CanonAlbumTrackRelation, foreignKey: "canonAlbumId", otherKey: "canonTrackId" });
@@ -568,6 +598,8 @@ export function initModels(sequelize: Sequelize) {
568
598
  PlatformTrack.belongsToMany(PlatformAlbum, { as: 'platformAlbumIdPlatformAlbumPlatformAlbumTrackRelations', through: PlatformAlbumTrackRelation, foreignKey: "platformTrackId", otherKey: "platformAlbumId" });
569
599
  PlatformTrack.belongsToMany(PlatformArtist, { as: 'platformArtistIdPlatformArtistPlatformArtistTrackRelations', through: PlatformArtistTrackRelation, foreignKey: "platformTrackId", otherKey: "platformArtistId" });
570
600
  PlatformTrack.belongsToMany(PlatformGenre, { as: 'platformGenreIdPlatformGenrePlatformTrackGenreRelations', through: PlatformTrackGenreRelation, foreignKey: "platformTrackId", otherKey: "platformGenreId" });
601
+ UserAffinity.belongsTo(AffinityRelationshipType, { as: "affinityRelationshipType", foreignKey: "affinityRelationshipTypeId"});
602
+ AffinityRelationshipType.hasMany(UserAffinity, { as: "userAffinities", foreignKey: "affinityRelationshipTypeId"});
571
603
  AppUserDevice.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
572
604
  AppUser.hasMany(AppUserDevice, { as: "appUserDevices", foreignKey: "appUserId"});
573
605
  AppUserFollowRelation.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
@@ -594,10 +626,14 @@ export function initModels(sequelize: Sequelize) {
594
626
  AppUser.hasMany(PlatformUserPlaylist, { as: "platformUserPlaylists", foreignKey: "appUserId"});
595
627
  RadioShow.belongsTo(AppUser, { as: "creatorUser", foreignKey: "creatorUserId"});
596
628
  AppUser.hasMany(RadioShow, { as: "radioShows", foreignKey: "creatorUserId"});
629
+ UserAffinity.belongsTo(AppUser, { as: "user", foreignKey: "userId"});
630
+ AppUser.hasMany(UserAffinity, { as: "userAffinities", foreignKey: "userId"});
597
631
  UserComments.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
598
632
  AppUser.hasMany(UserComments, { as: "userComments", foreignKey: "appUserId"});
599
633
  UserContacts.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
600
634
  AppUser.hasMany(UserContacts, { as: "userContacts", foreignKey: "appUserId"});
635
+ UserEngagementFactor.belongsTo(AppUser, { as: "user", foreignKey: "userId"});
636
+ AppUser.hasMany(UserEngagementFactor, { as: "userEngagementFactors", foreignKey: "userId"});
601
637
  UserLikes.belongsTo(AppUser, { as: "appUser", foreignKey: "appUserId"});
602
638
  AppUser.hasMany(UserLikes, { as: "userLikes", foreignKey: "appUserId"});
603
639
  CanonAlbumExternalReferenceRelation.belongsTo(CanonAlbum, { as: "canonAlbum", foreignKey: "canonAlbumId"});
@@ -662,6 +698,8 @@ export function initModels(sequelize: Sequelize) {
662
698
  ExternalReference.hasMany(CanonLabelExternalReferenceRelation, { as: "canonLabelExternalReferenceRelations", foreignKey: "externalReferenceId"});
663
699
  CanonMemberExternalReferenceRelation.belongsTo(ExternalReference, { as: "externalReference", foreignKey: "externalReferenceId"});
664
700
  ExternalReference.hasMany(CanonMemberExternalReferenceRelation, { as: "canonMemberExternalReferenceRelations", foreignKey: "externalReferenceId"});
701
+ UserEngagementFactor.belongsTo(FeedContentType, { as: "contentType", foreignKey: "contentTypeId"});
702
+ FeedContentType.hasMany(UserEngagementFactor, { as: "userEngagementFactors", foreignKey: "contentTypeId"});
665
703
  JukeboxQueueEntry.belongsTo(GuestUser, { as: "trackAddedGuestUser", foreignKey: "trackAddedGuestUserId"});
666
704
  GuestUser.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "trackAddedGuestUserId"});
667
705
  JukeboxSession.belongsTo(JukeboxAccessType, { as: "accessType", foreignKey: "accessTypeId"});
@@ -815,6 +853,7 @@ export function initModels(sequelize: Sequelize) {
815
853
 
816
854
  return {
817
855
  AccessControlPreference: AccessControlPreference,
856
+ AffinityRelationshipType: AffinityRelationshipType,
818
857
  AppUser: AppUser,
819
858
  AppUserDevice: AppUserDevice,
820
859
  AppUserFollowRelation: AppUserFollowRelation,
@@ -845,6 +884,8 @@ export function initModels(sequelize: Sequelize) {
845
884
  CanonTrack: CanonTrack,
846
885
  ConfigParam: ConfigParam,
847
886
  ExternalReference: ExternalReference,
887
+ FeedConfig: FeedConfig,
888
+ FeedContentType: FeedContentType,
848
889
  GuestUser: GuestUser,
849
890
  JukeboxAccessType: JukeboxAccessType,
850
891
  JukeboxCanonGenreRelation: JukeboxCanonGenreRelation,
@@ -897,8 +938,10 @@ export function initModels(sequelize: Sequelize) {
897
938
  TrackDeletionReason: TrackDeletionReason,
898
939
  UnmatchedAlbum: UnmatchedAlbum,
899
940
  UnmatchedArtist: UnmatchedArtist,
941
+ UserAffinity: UserAffinity,
900
942
  UserComments: UserComments,
901
943
  UserContacts: UserContacts,
944
+ UserEngagementFactor: UserEngagementFactor,
902
945
  UserLikes: UserLikes,
903
946
  };
904
947
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earbug/db-models",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "main": "dist/init-models.js",
5
5
  "types": "dist/init-models.d.ts",
6
6
  "scripts": {