@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.
Files changed (131) hide show
  1. package/dist/AppUser.d.ts +5 -5
  2. package/dist/AppUser.js +13 -13
  3. package/dist/AppUserDevice.d.ts +4 -4
  4. package/dist/AppUserDevice.js +8 -8
  5. package/dist/AppUserFollowRelation.d.ts +3 -3
  6. package/dist/AppUserFollowRelation.js +6 -6
  7. package/dist/AppUserPlatformRelation.d.ts +7 -7
  8. package/dist/AppUserPlatformRelation.js +18 -18
  9. package/dist/CanonAlbum.d.ts +5 -5
  10. package/dist/CanonAlbum.js +10 -10
  11. package/dist/CanonAlbumImageHarvested.d.ts +9 -9
  12. package/dist/CanonAlbumImageHarvested.js +24 -32
  13. package/dist/CanonArtist.d.ts +3 -3
  14. package/dist/CanonArtist.js +6 -6
  15. package/dist/CanonArtistImageHarvested.d.ts +9 -9
  16. package/dist/CanonArtistImageHarvested.js +24 -24
  17. package/dist/CanonGenre.d.ts +3 -3
  18. package/dist/CanonGenre.js +6 -6
  19. package/dist/CanonLabel.d.ts +2 -2
  20. package/dist/CanonLabel.js +6 -6
  21. package/dist/CanonMember.d.ts +3 -3
  22. package/dist/CanonMember.js +6 -6
  23. package/dist/CanonMemberExternalReferenceRelation.d.ts +2 -2
  24. package/dist/CanonMemberExternalReferenceRelation.js +5 -5
  25. package/dist/CanonTrack.d.ts +5 -5
  26. package/dist/CanonTrack.js +11 -11
  27. package/dist/ConfigParam.d.ts +2 -2
  28. package/dist/ConfigParam.js +5 -5
  29. package/dist/ExternalReference.d.ts +2 -2
  30. package/dist/ExternalReference.js +5 -5
  31. package/dist/JukeboxAccessType.d.ts +2 -2
  32. package/dist/JukeboxAccessType.js +4 -4
  33. package/dist/JukeboxCanonGenreRelation.d.ts +2 -2
  34. package/dist/JukeboxCanonGenreRelation.js +6 -6
  35. package/dist/JukeboxInvite.d.ts +3 -3
  36. package/dist/JukeboxInvite.js +6 -6
  37. package/dist/JukeboxQueueEntry.d.ts +10 -10
  38. package/dist/JukeboxQueueEntry.js +12 -12
  39. package/dist/JukeboxQueueMode.d.ts +2 -2
  40. package/dist/JukeboxQueueMode.js +4 -4
  41. package/dist/JukeboxSession.d.ts +9 -9
  42. package/dist/JukeboxSession.js +20 -20
  43. package/dist/JukeboxTerminationCondition.d.ts +2 -2
  44. package/dist/JukeboxTerminationCondition.js +4 -4
  45. package/dist/JukeboxType.d.ts +2 -2
  46. package/dist/JukeboxType.js +4 -4
  47. package/dist/JukeboxUser.d.ts +7 -7
  48. package/dist/JukeboxUser.js +20 -20
  49. package/dist/KnexMigrations.d.ts +3 -3
  50. package/dist/KnexMigrations.js +6 -6
  51. package/dist/KnexMigrationsLock.d.ts +3 -3
  52. package/dist/KnexMigrationsLock.js +5 -5
  53. package/dist/MetricsDaily.d.ts +3 -3
  54. package/dist/MetricsDaily.js +4 -4
  55. package/dist/NewsSite.d.ts +3 -3
  56. package/dist/NewsSite.js +6 -6
  57. package/dist/Platform.d.ts +2 -2
  58. package/dist/Platform.js +7 -7
  59. package/dist/PlatformAlbum.d.ts +5 -5
  60. package/dist/PlatformAlbum.js +10 -10
  61. package/dist/PlatformArtist.d.ts +5 -5
  62. package/dist/PlatformArtist.js +10 -10
  63. package/dist/PlatformGenre.d.ts +2 -2
  64. package/dist/PlatformGenre.js +6 -6
  65. package/dist/PlatformTrack.d.ts +3 -3
  66. package/dist/PlatformTrack.js +6 -6
  67. package/dist/PlatformUserAlbum.d.ts +2 -2
  68. package/dist/PlatformUserAlbum.js +6 -6
  69. package/dist/PlatformUserAlbumTrack.d.ts +4 -4
  70. package/dist/PlatformUserAlbumTrack.js +11 -11
  71. package/dist/PlatformUserPlaylist.d.ts +5 -5
  72. package/dist/PlatformUserPlaylist.js +11 -11
  73. package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
  74. package/dist/PlatformUserPlaylistTrack.js +17 -17
  75. package/dist/PlaybackStatus.d.ts +2 -14
  76. package/dist/PlaybackStatus.js +4 -4
  77. package/dist/PlaybackStatusType.d.ts +12 -0
  78. package/dist/State.d.ts +2 -2
  79. package/dist/State.js +4 -4
  80. package/dist/UnmatchedAlbum.d.ts +2 -2
  81. package/dist/UnmatchedAlbum.js +6 -6
  82. package/dist/UnmatchedArtist.d.ts +2 -2
  83. package/dist/UnmatchedArtist.js +6 -6
  84. package/dist/UserContacts.d.ts +3 -3
  85. package/dist/UserContacts.js +7 -7
  86. package/dist/init-models.js +2 -2
  87. package/models/AppUser.ts +18 -18
  88. package/models/AppUserDevice.ts +12 -12
  89. package/models/AppUserFollowRelation.ts +9 -9
  90. package/models/AppUserPlatformRelation.ts +25 -25
  91. package/models/CanonAlbum.ts +15 -15
  92. package/models/CanonAlbumImageHarvested.ts +33 -41
  93. package/models/CanonArtist.ts +9 -9
  94. package/models/CanonArtistImageHarvested.ts +33 -33
  95. package/models/CanonGenre.ts +9 -9
  96. package/models/CanonLabel.ts +8 -8
  97. package/models/CanonMember.ts +9 -9
  98. package/models/CanonMemberExternalReferenceRelation.ts +7 -7
  99. package/models/CanonTrack.ts +16 -16
  100. package/models/ConfigParam.ts +7 -7
  101. package/models/ExternalReference.ts +7 -7
  102. package/models/JukeboxAccessType.ts +6 -6
  103. package/models/JukeboxCanonGenreRelation.ts +8 -8
  104. package/models/JukeboxInvite.ts +9 -9
  105. package/models/JukeboxQueueEntry.ts +23 -23
  106. package/models/JukeboxQueueMode.ts +6 -6
  107. package/models/JukeboxSession.ts +29 -29
  108. package/models/JukeboxTerminationCondition.ts +6 -6
  109. package/models/JukeboxType.ts +6 -6
  110. package/models/JukeboxUser.ts +27 -27
  111. package/models/KnexMigrations.ts +9 -9
  112. package/models/KnexMigrationsLock.ts +8 -8
  113. package/models/MetricsDaily.ts +7 -7
  114. package/models/NewsSite.ts +9 -9
  115. package/models/Platform.ts +9 -9
  116. package/models/PlatformAlbum.ts +15 -15
  117. package/models/PlatformArtist.ts +15 -15
  118. package/models/PlatformGenre.ts +8 -8
  119. package/models/PlatformTrack.ts +9 -9
  120. package/models/PlatformUserAlbum.ts +8 -8
  121. package/models/PlatformUserAlbumTrack.ts +15 -15
  122. package/models/PlatformUserPlaylist.ts +16 -16
  123. package/models/PlatformUserPlaylistTrack.ts +24 -24
  124. package/models/PlaybackStatus.ts +6 -19
  125. package/models/PlaybackStatusType.ts +13 -0
  126. package/models/State.ts +6 -6
  127. package/models/UnmatchedAlbum.ts +8 -8
  128. package/models/UnmatchedArtist.ts +8 -8
  129. package/models/UserContacts.ts +10 -10
  130. package/models/init-models.ts +2 -2
  131. 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,
@@ -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,
@@ -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 = "contactId" | "contactAppUserId" | "firstName" | "lastName" | "contactEmail1" | "contactEmail2" | "contactEmail3" | "contactPhone1" | "contactPhone1Type" | "contactPhone2" | "contactPhone2Type" | "contactPhone3" | "contactPhone3Type" | "active";
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,
@@ -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(PlaybackStatus, { as: "playbackStatusType", foreignKey: "playbackStatusTypeId"});
642
- PlaybackStatus.hasMany(JukeboxQueueEntry, { as: "jukeboxQueueEntries", foreignKey: "playbackStatusTypeId"});
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"});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earbug/db-models",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "main": "dist/init-models.js",
5
5
  "types": "dist/init-models.d.ts",
6
6
  "scripts": {