@earbug/db-models 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppUser.d.ts +5 -5
- package/dist/AppUser.js +13 -13
- package/dist/AppUserDevice.d.ts +4 -4
- package/dist/AppUserDevice.js +8 -8
- package/dist/AppUserFollowRelation.d.ts +3 -3
- package/dist/AppUserFollowRelation.js +6 -6
- package/dist/AppUserPlatformRelation.d.ts +7 -7
- package/dist/AppUserPlatformRelation.js +18 -18
- package/dist/CanonAlbum.d.ts +5 -5
- package/dist/CanonAlbum.js +10 -10
- package/dist/CanonAlbumImageHarvested.d.ts +9 -9
- package/dist/CanonAlbumImageHarvested.js +24 -32
- package/dist/CanonArtist.d.ts +3 -3
- package/dist/CanonArtist.js +6 -6
- package/dist/CanonArtistImageHarvested.d.ts +9 -9
- package/dist/CanonArtistImageHarvested.js +24 -24
- package/dist/CanonGenre.d.ts +3 -3
- package/dist/CanonGenre.js +6 -6
- package/dist/CanonLabel.d.ts +2 -2
- package/dist/CanonLabel.js +6 -6
- package/dist/CanonMember.d.ts +3 -3
- package/dist/CanonMember.js +6 -6
- package/dist/CanonMemberExternalReferenceRelation.d.ts +2 -2
- package/dist/CanonMemberExternalReferenceRelation.js +5 -5
- package/dist/CanonTrack.d.ts +5 -5
- package/dist/CanonTrack.js +11 -11
- package/dist/ConfigParam.d.ts +2 -2
- package/dist/ConfigParam.js +5 -5
- package/dist/ExternalReference.d.ts +2 -2
- package/dist/ExternalReference.js +5 -5
- package/dist/JukeboxAccessType.d.ts +2 -2
- package/dist/JukeboxAccessType.js +4 -4
- package/dist/JukeboxCanonGenreRelation.d.ts +2 -2
- package/dist/JukeboxCanonGenreRelation.js +6 -6
- package/dist/JukeboxInvite.d.ts +3 -3
- package/dist/JukeboxInvite.js +6 -6
- package/dist/JukeboxQueueEntry.d.ts +10 -10
- package/dist/JukeboxQueueEntry.js +12 -12
- package/dist/JukeboxQueueMode.d.ts +2 -2
- package/dist/JukeboxQueueMode.js +4 -4
- package/dist/JukeboxSession.d.ts +9 -9
- package/dist/JukeboxSession.js +20 -20
- package/dist/JukeboxTerminationCondition.d.ts +2 -2
- package/dist/JukeboxTerminationCondition.js +4 -4
- package/dist/JukeboxType.d.ts +2 -2
- package/dist/JukeboxType.js +4 -4
- package/dist/JukeboxUser.d.ts +7 -7
- package/dist/JukeboxUser.js +20 -20
- package/dist/KnexMigrations.d.ts +3 -3
- package/dist/KnexMigrations.js +6 -6
- package/dist/KnexMigrationsLock.d.ts +3 -3
- package/dist/KnexMigrationsLock.js +5 -5
- package/dist/MetricsDaily.d.ts +3 -3
- package/dist/MetricsDaily.js +4 -4
- package/dist/NewsSite.d.ts +3 -3
- package/dist/NewsSite.js +6 -6
- package/dist/Platform.d.ts +2 -2
- package/dist/Platform.js +7 -7
- package/dist/PlatformAlbum.d.ts +5 -5
- package/dist/PlatformAlbum.js +10 -10
- package/dist/PlatformArtist.d.ts +5 -5
- package/dist/PlatformArtist.js +10 -10
- package/dist/PlatformGenre.d.ts +2 -2
- package/dist/PlatformGenre.js +6 -6
- package/dist/PlatformTrack.d.ts +3 -3
- package/dist/PlatformTrack.js +6 -6
- package/dist/PlatformUserAlbum.d.ts +2 -2
- package/dist/PlatformUserAlbum.js +6 -6
- package/dist/PlatformUserAlbumTrack.d.ts +4 -4
- package/dist/PlatformUserAlbumTrack.js +11 -11
- package/dist/PlatformUserPlaylist.d.ts +5 -5
- package/dist/PlatformUserPlaylist.js +11 -11
- package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
- package/dist/PlatformUserPlaylistTrack.js +17 -17
- package/dist/PlaybackStatus.d.ts +2 -14
- package/dist/PlaybackStatus.js +4 -4
- package/dist/PlaybackStatusType.d.ts +12 -0
- package/dist/State.d.ts +2 -2
- package/dist/State.js +4 -4
- package/dist/UnmatchedAlbum.d.ts +2 -2
- package/dist/UnmatchedAlbum.js +6 -6
- package/dist/UnmatchedArtist.d.ts +2 -2
- package/dist/UnmatchedArtist.js +6 -6
- package/dist/UserContacts.d.ts +3 -3
- package/dist/UserContacts.js +7 -7
- package/dist/init-models.js +2 -2
- package/models/AppUser.ts +18 -18
- package/models/AppUserDevice.ts +12 -12
- package/models/AppUserFollowRelation.ts +9 -9
- package/models/AppUserPlatformRelation.ts +25 -25
- package/models/CanonAlbum.ts +15 -15
- package/models/CanonAlbumImageHarvested.ts +33 -41
- package/models/CanonArtist.ts +9 -9
- package/models/CanonArtistImageHarvested.ts +33 -33
- package/models/CanonGenre.ts +9 -9
- package/models/CanonLabel.ts +8 -8
- package/models/CanonMember.ts +9 -9
- package/models/CanonMemberExternalReferenceRelation.ts +7 -7
- package/models/CanonTrack.ts +16 -16
- package/models/ConfigParam.ts +7 -7
- package/models/ExternalReference.ts +7 -7
- package/models/JukeboxAccessType.ts +6 -6
- package/models/JukeboxCanonGenreRelation.ts +8 -8
- package/models/JukeboxInvite.ts +9 -9
- package/models/JukeboxQueueEntry.ts +23 -23
- package/models/JukeboxQueueMode.ts +6 -6
- package/models/JukeboxSession.ts +29 -29
- package/models/JukeboxTerminationCondition.ts +6 -6
- package/models/JukeboxType.ts +6 -6
- package/models/JukeboxUser.ts +27 -27
- package/models/KnexMigrations.ts +9 -9
- package/models/KnexMigrationsLock.ts +8 -8
- package/models/MetricsDaily.ts +7 -7
- package/models/NewsSite.ts +9 -9
- package/models/Platform.ts +9 -9
- package/models/PlatformAlbum.ts +15 -15
- package/models/PlatformArtist.ts +15 -15
- package/models/PlatformGenre.ts +8 -8
- package/models/PlatformTrack.ts +9 -9
- package/models/PlatformUserAlbum.ts +8 -8
- package/models/PlatformUserAlbumTrack.ts +15 -15
- package/models/PlatformUserPlaylist.ts +16 -16
- package/models/PlatformUserPlaylistTrack.ts +24 -24
- package/models/PlaybackStatus.ts +6 -19
- package/models/PlaybackStatusType.ts +13 -0
- package/models/State.ts +6 -6
- package/models/UnmatchedAlbum.ts +8 -8
- package/models/UnmatchedArtist.ts +8 -8
- package/models/UserContacts.ts +10 -10
- package/models/init-models.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { DataTypes, Model, Optional } from 'sequelize';
|
|
3
|
+
import type { JukeboxQueueEntry, JukeboxQueueEntryId } from './JukeboxQueueEntry';
|
|
3
4
|
|
|
4
5
|
export interface PlaybackStatusTypeAttributes {
|
|
5
6
|
id: number;
|
|
@@ -14,6 +15,18 @@ export class PlaybackStatusType extends Model<PlaybackStatusTypeAttributes, Play
|
|
|
14
15
|
id!: number;
|
|
15
16
|
description!: string;
|
|
16
17
|
|
|
18
|
+
// PlaybackStatusType hasMany JukeboxQueueEntry via playbackStatusTypeId
|
|
19
|
+
jukeboxQueueEntries!: JukeboxQueueEntry[];
|
|
20
|
+
getJukeboxQueueEntries!: Sequelize.HasManyGetAssociationsMixin<JukeboxQueueEntry>;
|
|
21
|
+
setJukeboxQueueEntries!: Sequelize.HasManySetAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
22
|
+
addJukeboxQueueEntry!: Sequelize.HasManyAddAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
23
|
+
addJukeboxQueueEntries!: Sequelize.HasManyAddAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
24
|
+
createJukeboxQueueEntry!: Sequelize.HasManyCreateAssociationMixin<JukeboxQueueEntry>;
|
|
25
|
+
removeJukeboxQueueEntry!: Sequelize.HasManyRemoveAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
26
|
+
removeJukeboxQueueEntries!: Sequelize.HasManyRemoveAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
27
|
+
hasJukeboxQueueEntry!: Sequelize.HasManyHasAssociationMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
28
|
+
hasJukeboxQueueEntries!: Sequelize.HasManyHasAssociationsMixin<JukeboxQueueEntry, JukeboxQueueEntryId>;
|
|
29
|
+
countJukeboxQueueEntries!: Sequelize.HasManyCountAssociationsMixin;
|
|
17
30
|
|
|
18
31
|
static initModel(sequelize: Sequelize.Sequelize): typeof PlaybackStatusType {
|
|
19
32
|
return PlaybackStatusType.init({
|
package/models/State.ts
CHANGED
|
@@ -5,8 +5,8 @@ import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUse
|
|
|
5
5
|
import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './PlatformUserPlaylistTrack';
|
|
6
6
|
|
|
7
7
|
export interface StateAttributes {
|
|
8
|
-
id: number;
|
|
9
8
|
description: string;
|
|
9
|
+
id: number;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export type StatePk = "id";
|
|
@@ -14,8 +14,8 @@ export type StateId = State[StatePk];
|
|
|
14
14
|
export type StateCreationAttributes = StateAttributes;
|
|
15
15
|
|
|
16
16
|
export class State extends Model<StateAttributes, StateCreationAttributes> implements StateAttributes {
|
|
17
|
-
id!: number;
|
|
18
17
|
description!: string;
|
|
18
|
+
id!: number;
|
|
19
19
|
|
|
20
20
|
// State hasMany AppUser via stateId
|
|
21
21
|
appUsers!: AppUser[];
|
|
@@ -56,16 +56,16 @@ export class State extends Model<StateAttributes, StateCreationAttributes> imple
|
|
|
56
56
|
|
|
57
57
|
static initModel(sequelize: Sequelize.Sequelize): typeof State {
|
|
58
58
|
return State.init({
|
|
59
|
+
description: {
|
|
60
|
+
type: DataTypes.TEXT,
|
|
61
|
+
allowNull: false
|
|
62
|
+
},
|
|
59
63
|
id: {
|
|
60
64
|
autoIncrement: true,
|
|
61
65
|
autoIncrementIdentity: true,
|
|
62
66
|
type: DataTypes.SMALLINT,
|
|
63
67
|
allowNull: false,
|
|
64
68
|
primaryKey: true
|
|
65
|
-
},
|
|
66
|
-
description: {
|
|
67
|
-
type: DataTypes.TEXT,
|
|
68
|
-
allowNull: false
|
|
69
69
|
}
|
|
70
70
|
}, {
|
|
71
71
|
sequelize,
|
package/models/UnmatchedAlbum.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { DataTypes, Model, Optional } from 'sequelize';
|
|
|
3
3
|
import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
|
|
4
4
|
|
|
5
5
|
export interface UnmatchedAlbumAttributes {
|
|
6
|
-
id: string;
|
|
7
6
|
platformAlbumId: string;
|
|
7
|
+
id: string;
|
|
8
8
|
createDate: Date;
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -14,8 +14,8 @@ export type UnmatchedAlbumOptionalAttributes = "id" | "createDate";
|
|
|
14
14
|
export type UnmatchedAlbumCreationAttributes = Optional<UnmatchedAlbumAttributes, UnmatchedAlbumOptionalAttributes>;
|
|
15
15
|
|
|
16
16
|
export class UnmatchedAlbum extends Model<UnmatchedAlbumAttributes, UnmatchedAlbumCreationAttributes> implements UnmatchedAlbumAttributes {
|
|
17
|
-
id!: string;
|
|
18
17
|
platformAlbumId!: string;
|
|
18
|
+
id!: string;
|
|
19
19
|
createDate!: Date;
|
|
20
20
|
|
|
21
21
|
// UnmatchedAlbum belongsTo PlatformAlbum via platformAlbumId
|
|
@@ -26,12 +26,6 @@ export class UnmatchedAlbum extends Model<UnmatchedAlbumAttributes, UnmatchedAlb
|
|
|
26
26
|
|
|
27
27
|
static initModel(sequelize: Sequelize.Sequelize): typeof UnmatchedAlbum {
|
|
28
28
|
return UnmatchedAlbum.init({
|
|
29
|
-
id: {
|
|
30
|
-
type: DataTypes.UUID,
|
|
31
|
-
allowNull: false,
|
|
32
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
33
|
-
primaryKey: true
|
|
34
|
-
},
|
|
35
29
|
platformAlbumId: {
|
|
36
30
|
type: DataTypes.UUID,
|
|
37
31
|
allowNull: false,
|
|
@@ -41,6 +35,12 @@ export class UnmatchedAlbum extends Model<UnmatchedAlbumAttributes, UnmatchedAlb
|
|
|
41
35
|
},
|
|
42
36
|
field: 'platform_album_id'
|
|
43
37
|
},
|
|
38
|
+
id: {
|
|
39
|
+
type: DataTypes.UUID,
|
|
40
|
+
allowNull: false,
|
|
41
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
42
|
+
primaryKey: true
|
|
43
|
+
},
|
|
44
44
|
createDate: {
|
|
45
45
|
type: DataTypes.DATE,
|
|
46
46
|
allowNull: false,
|
|
@@ -3,9 +3,9 @@ import { DataTypes, Model, Optional } from 'sequelize';
|
|
|
3
3
|
import type { Platform, PlatformId } from './Platform';
|
|
4
4
|
|
|
5
5
|
export interface UnmatchedArtistAttributes {
|
|
6
|
-
id: string;
|
|
7
6
|
platformId: number;
|
|
8
7
|
externalArtistId: number;
|
|
8
|
+
id: string;
|
|
9
9
|
createDate: Date;
|
|
10
10
|
updateDate: Date;
|
|
11
11
|
}
|
|
@@ -16,9 +16,9 @@ export type UnmatchedArtistOptionalAttributes = "id" | "createDate" | "updateDat
|
|
|
16
16
|
export type UnmatchedArtistCreationAttributes = Optional<UnmatchedArtistAttributes, UnmatchedArtistOptionalAttributes>;
|
|
17
17
|
|
|
18
18
|
export class UnmatchedArtist extends Model<UnmatchedArtistAttributes, UnmatchedArtistCreationAttributes> implements UnmatchedArtistAttributes {
|
|
19
|
-
id!: string;
|
|
20
19
|
platformId!: number;
|
|
21
20
|
externalArtistId!: number;
|
|
21
|
+
id!: string;
|
|
22
22
|
createDate!: Date;
|
|
23
23
|
updateDate!: Date;
|
|
24
24
|
|
|
@@ -30,12 +30,6 @@ export class UnmatchedArtist extends Model<UnmatchedArtistAttributes, UnmatchedA
|
|
|
30
30
|
|
|
31
31
|
static initModel(sequelize: Sequelize.Sequelize): typeof UnmatchedArtist {
|
|
32
32
|
return UnmatchedArtist.init({
|
|
33
|
-
id: {
|
|
34
|
-
type: DataTypes.UUID,
|
|
35
|
-
allowNull: false,
|
|
36
|
-
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
37
|
-
primaryKey: true
|
|
38
|
-
},
|
|
39
33
|
platformId: {
|
|
40
34
|
type: DataTypes.SMALLINT,
|
|
41
35
|
allowNull: false,
|
|
@@ -50,6 +44,12 @@ export class UnmatchedArtist extends Model<UnmatchedArtistAttributes, UnmatchedA
|
|
|
50
44
|
allowNull: false,
|
|
51
45
|
field: 'external_artist_id'
|
|
52
46
|
},
|
|
47
|
+
id: {
|
|
48
|
+
type: DataTypes.UUID,
|
|
49
|
+
allowNull: false,
|
|
50
|
+
defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
|
|
51
|
+
primaryKey: true
|
|
52
|
+
},
|
|
53
53
|
createDate: {
|
|
54
54
|
type: DataTypes.DATE,
|
|
55
55
|
allowNull: false,
|
package/models/UserContacts.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { AppUser, AppUserId } from './AppUser';
|
|
|
4
4
|
|
|
5
5
|
export interface UserContactsAttributes {
|
|
6
6
|
appUserId: string;
|
|
7
|
-
contactId: string;
|
|
8
7
|
contactAppUserId?: string;
|
|
9
8
|
firstName?: string;
|
|
10
9
|
lastName?: string;
|
|
@@ -18,16 +17,16 @@ export interface UserContactsAttributes {
|
|
|
18
17
|
contactPhone3?: string;
|
|
19
18
|
contactPhone3Type?: "mobile" | "work" | "home" | "main";
|
|
20
19
|
active?: boolean;
|
|
20
|
+
contactId: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export type UserContactsPk = "contactId";
|
|
24
24
|
export type UserContactsId = UserContacts[UserContactsPk];
|
|
25
|
-
export type UserContactsOptionalAttributes = "
|
|
25
|
+
export type UserContactsOptionalAttributes = "contactAppUserId" | "firstName" | "lastName" | "contactEmail1" | "contactEmail2" | "contactEmail3" | "contactPhone1" | "contactPhone1Type" | "contactPhone2" | "contactPhone2Type" | "contactPhone3" | "contactPhone3Type" | "active" | "contactId";
|
|
26
26
|
export type UserContactsCreationAttributes = Optional<UserContactsAttributes, UserContactsOptionalAttributes>;
|
|
27
27
|
|
|
28
28
|
export class UserContacts extends Model<UserContactsAttributes, UserContactsCreationAttributes> implements UserContactsAttributes {
|
|
29
29
|
appUserId!: string;
|
|
30
|
-
contactId!: string;
|
|
31
30
|
contactAppUserId?: string;
|
|
32
31
|
firstName?: string;
|
|
33
32
|
lastName?: string;
|
|
@@ -41,6 +40,7 @@ export class UserContacts extends Model<UserContactsAttributes, UserContactsCrea
|
|
|
41
40
|
contactPhone3?: string;
|
|
42
41
|
contactPhone3Type?: "mobile" | "work" | "home" | "main";
|
|
43
42
|
active?: boolean;
|
|
43
|
+
contactId!: string;
|
|
44
44
|
|
|
45
45
|
// UserContacts belongsTo AppUser via appUserId
|
|
46
46
|
appUser!: AppUser;
|
|
@@ -59,13 +59,6 @@ export class UserContacts extends Model<UserContactsAttributes, UserContactsCrea
|
|
|
59
59
|
},
|
|
60
60
|
field: 'app_user_id'
|
|
61
61
|
},
|
|
62
|
-
contactId: {
|
|
63
|
-
type: DataTypes.UUID,
|
|
64
|
-
allowNull: false,
|
|
65
|
-
defaultValue: DataTypes.UUIDV4,
|
|
66
|
-
primaryKey: true,
|
|
67
|
-
field: 'contact_id'
|
|
68
|
-
},
|
|
69
62
|
contactAppUserId: {
|
|
70
63
|
type: DataTypes.UUID,
|
|
71
64
|
allowNull: true,
|
|
@@ -129,6 +122,13 @@ export class UserContacts extends Model<UserContactsAttributes, UserContactsCrea
|
|
|
129
122
|
active: {
|
|
130
123
|
type: DataTypes.BOOLEAN,
|
|
131
124
|
allowNull: true
|
|
125
|
+
},
|
|
126
|
+
contactId: {
|
|
127
|
+
type: DataTypes.UUID,
|
|
128
|
+
allowNull: false,
|
|
129
|
+
defaultValue: DataTypes.UUIDV4,
|
|
130
|
+
primaryKey: true,
|
|
131
|
+
field: 'contact_id'
|
|
132
132
|
}
|
|
133
133
|
}, {
|
|
134
134
|
sequelize,
|
package/models/init-models.ts
CHANGED
|
@@ -638,8 +638,8 @@ export function initModels(sequelize: Sequelize) {
|
|
|
638
638
|
PlatformUserAlbum.hasMany(PlatformUserAlbumTrack, { as: "platformUserAlbumTracks", foreignKey: "platformUserAlbumId"});
|
|
639
639
|
PlatformUserPlaylistTrack.belongsTo(PlatformUserPlaylist, { as: "platformUserPlaylist", foreignKey: "platformUserPlaylistId"});
|
|
640
640
|
PlatformUserPlaylist.hasMany(PlatformUserPlaylistTrack, { as: "platformUserPlaylistTracks", foreignKey: "platformUserPlaylistId"});
|
|
641
|
-
JukeboxQueueEntry.belongsTo(
|
|
642
|
-
|
|
641
|
+
JukeboxQueueEntry.belongsTo(PlaybackStatusType, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId"});
|
|
642
|
+
PlaybackStatusType.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId"});
|
|
643
643
|
AppUser.belongsTo(State, { as: "state", foreignKey: "stateId"});
|
|
644
644
|
State.hasMany(AppUser, { as: "appUsers", foreignKey: "stateId"});
|
|
645
645
|
PlatformUserPlaylist.belongsTo(State, { as: "state", foreignKey: "stateId"});
|