@earbug/db-models 0.0.7 → 0.0.9

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 (138) hide show
  1. package/dist/AppUser.d.ts +28 -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 +21 -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/Notification.d.ts +62 -0
  58. package/dist/Notification.js +163 -0
  59. package/dist/NotificationType.d.ts +26 -0
  60. package/dist/NotificationType.js +42 -0
  61. package/dist/Platform.d.ts +2 -2
  62. package/dist/Platform.js +7 -7
  63. package/dist/PlatformAlbum.d.ts +5 -5
  64. package/dist/PlatformAlbum.js +10 -10
  65. package/dist/PlatformArtist.d.ts +5 -5
  66. package/dist/PlatformArtist.js +10 -10
  67. package/dist/PlatformGenre.d.ts +2 -2
  68. package/dist/PlatformGenre.js +6 -6
  69. package/dist/PlatformTrack.d.ts +3 -3
  70. package/dist/PlatformTrack.js +6 -6
  71. package/dist/PlatformUserAlbum.d.ts +2 -2
  72. package/dist/PlatformUserAlbum.js +6 -6
  73. package/dist/PlatformUserAlbumTrack.d.ts +4 -4
  74. package/dist/PlatformUserAlbumTrack.js +11 -11
  75. package/dist/PlatformUserPlaylist.d.ts +5 -5
  76. package/dist/PlatformUserPlaylist.js +11 -11
  77. package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
  78. package/dist/PlatformUserPlaylistTrack.js +17 -17
  79. package/dist/PlaybackStatus.d.ts +2 -14
  80. package/dist/PlaybackStatus.js +4 -4
  81. package/dist/PlaybackStatusType.d.ts +12 -0
  82. package/dist/State.d.ts +2 -2
  83. package/dist/State.js +4 -4
  84. package/dist/UnmatchedAlbum.d.ts +2 -2
  85. package/dist/UnmatchedAlbum.js +6 -6
  86. package/dist/UnmatchedArtist.d.ts +2 -2
  87. package/dist/UnmatchedArtist.js +6 -6
  88. package/dist/UserContacts.d.ts +3 -3
  89. package/dist/UserContacts.js +7 -7
  90. package/dist/init-models.d.ts +8 -2
  91. package/dist/init-models.js +20 -4
  92. package/models/AppUser.ts +43 -18
  93. package/models/AppUserDevice.ts +12 -12
  94. package/models/AppUserFollowRelation.ts +9 -9
  95. package/models/AppUserPlatformRelation.ts +25 -25
  96. package/models/CanonAlbum.ts +15 -15
  97. package/models/CanonAlbumImageHarvested.ts +33 -41
  98. package/models/CanonArtist.ts +9 -9
  99. package/models/CanonArtistImageHarvested.ts +33 -33
  100. package/models/CanonGenre.ts +9 -9
  101. package/models/CanonLabel.ts +8 -8
  102. package/models/CanonMember.ts +9 -9
  103. package/models/CanonMemberExternalReferenceRelation.ts +7 -7
  104. package/models/CanonTrack.ts +16 -16
  105. package/models/ConfigParam.ts +7 -7
  106. package/models/ExternalReference.ts +7 -7
  107. package/models/JukeboxAccessType.ts +6 -6
  108. package/models/JukeboxCanonGenreRelation.ts +8 -8
  109. package/models/JukeboxInvite.ts +9 -9
  110. package/models/JukeboxQueueEntry.ts +23 -23
  111. package/models/JukeboxQueueMode.ts +6 -6
  112. package/models/JukeboxSession.ts +42 -29
  113. package/models/JukeboxTerminationCondition.ts +6 -6
  114. package/models/JukeboxType.ts +6 -6
  115. package/models/JukeboxUser.ts +27 -27
  116. package/models/KnexMigrations.ts +9 -9
  117. package/models/KnexMigrationsLock.ts +8 -8
  118. package/models/MetricsDaily.ts +7 -7
  119. package/models/NewsSite.ts +9 -9
  120. package/models/Notification.ts +202 -0
  121. package/models/NotificationType.ts +66 -0
  122. package/models/Platform.ts +9 -9
  123. package/models/PlatformAlbum.ts +15 -15
  124. package/models/PlatformArtist.ts +15 -15
  125. package/models/PlatformGenre.ts +8 -8
  126. package/models/PlatformTrack.ts +9 -9
  127. package/models/PlatformUserAlbum.ts +8 -8
  128. package/models/PlatformUserAlbumTrack.ts +15 -15
  129. package/models/PlatformUserPlaylist.ts +16 -16
  130. package/models/PlatformUserPlaylistTrack.ts +24 -24
  131. package/models/PlaybackStatus.ts +6 -19
  132. package/models/PlaybackStatusType.ts +13 -0
  133. package/models/State.ts +6 -6
  134. package/models/UnmatchedAlbum.ts +8 -8
  135. package/models/UnmatchedArtist.ts +8 -8
  136. package/models/UserContacts.ts +10 -10
  137. package/models/init-models.ts +24 -2
  138. package/package.json +1 -1
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Notification = void 0;
27
+ const Sequelize = __importStar(require("sequelize"));
28
+ const sequelize_1 = require("sequelize");
29
+ class Notification extends sequelize_1.Model {
30
+ static initModel(sequelize) {
31
+ return Notification.init({
32
+ targetUserId: {
33
+ type: sequelize_1.DataTypes.UUID,
34
+ allowNull: false,
35
+ references: {
36
+ model: 'app_user',
37
+ key: 'id'
38
+ },
39
+ field: 'target_user_id'
40
+ },
41
+ notificationTypeId: {
42
+ type: sequelize_1.DataTypes.SMALLINT,
43
+ allowNull: false,
44
+ references: {
45
+ model: 'notification_type',
46
+ key: 'id'
47
+ },
48
+ field: 'notification_type_id'
49
+ },
50
+ metadata: {
51
+ type: sequelize_1.DataTypes.JSONB,
52
+ allowNull: true
53
+ },
54
+ readAt: {
55
+ type: sequelize_1.DataTypes.DATE,
56
+ allowNull: true,
57
+ field: 'read_at'
58
+ },
59
+ dismissedAt: {
60
+ type: sequelize_1.DataTypes.DATE,
61
+ allowNull: true,
62
+ field: 'dismissed_at'
63
+ },
64
+ sourceUserId: {
65
+ type: sequelize_1.DataTypes.UUID,
66
+ allowNull: true,
67
+ references: {
68
+ model: 'app_user',
69
+ key: 'id'
70
+ },
71
+ field: 'source_user_id'
72
+ },
73
+ jukeboxSessionId: {
74
+ type: sequelize_1.DataTypes.UUID,
75
+ allowNull: true,
76
+ references: {
77
+ model: 'jukebox_session',
78
+ key: 'id'
79
+ },
80
+ field: 'jukebox_session_id'
81
+ },
82
+ expiresAt: {
83
+ type: sequelize_1.DataTypes.DATE,
84
+ allowNull: true,
85
+ field: 'expires_at'
86
+ },
87
+ pushSentAt: {
88
+ type: sequelize_1.DataTypes.DATE,
89
+ allowNull: true,
90
+ field: 'push_sent_at'
91
+ },
92
+ pushError: {
93
+ type: sequelize_1.DataTypes.TEXT,
94
+ allowNull: true,
95
+ field: 'push_error'
96
+ },
97
+ id: {
98
+ type: sequelize_1.DataTypes.UUID,
99
+ allowNull: false,
100
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
101
+ primaryKey: true
102
+ },
103
+ isRead: {
104
+ type: sequelize_1.DataTypes.BOOLEAN,
105
+ allowNull: false,
106
+ defaultValue: false,
107
+ field: 'is_read'
108
+ },
109
+ isDismissed: {
110
+ type: sequelize_1.DataTypes.BOOLEAN,
111
+ allowNull: false,
112
+ defaultValue: false,
113
+ field: 'is_dismissed'
114
+ },
115
+ createdAt: {
116
+ type: sequelize_1.DataTypes.DATE,
117
+ allowNull: false,
118
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
119
+ field: 'created_at'
120
+ },
121
+ updatedAt: {
122
+ type: sequelize_1.DataTypes.DATE,
123
+ allowNull: false,
124
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
125
+ field: 'updated_at'
126
+ },
127
+ pushSent: {
128
+ type: sequelize_1.DataTypes.BOOLEAN,
129
+ allowNull: false,
130
+ defaultValue: false,
131
+ field: 'push_sent'
132
+ }
133
+ }, {
134
+ sequelize,
135
+ tableName: 'notification',
136
+ schema: 'eb',
137
+ timestamps: false,
138
+ indexes: [
139
+ {
140
+ name: "idx_notification_expires_at",
141
+ fields: [
142
+ { name: "expires_at" },
143
+ ]
144
+ },
145
+ {
146
+ name: "idx_notification_target_user_created_at",
147
+ fields: [
148
+ { name: "target_user_id" },
149
+ { name: "created_at", order: "DESC" },
150
+ ]
151
+ },
152
+ {
153
+ name: "notification_pkey",
154
+ unique: true,
155
+ fields: [
156
+ { name: "id" },
157
+ ]
158
+ },
159
+ ]
160
+ });
161
+ }
162
+ }
163
+ exports.Notification = Notification;
@@ -0,0 +1,26 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model } from 'sequelize';
3
+ import type { Notification, NotificationId } from './Notification';
4
+ export interface NotificationTypeAttributes {
5
+ id: number;
6
+ name: string;
7
+ }
8
+ export type NotificationTypePk = "id";
9
+ export type NotificationTypeId = NotificationType[NotificationTypePk];
10
+ export type NotificationTypeCreationAttributes = NotificationTypeAttributes;
11
+ export declare class NotificationType extends Model<NotificationTypeAttributes, NotificationTypeCreationAttributes> implements NotificationTypeAttributes {
12
+ id: number;
13
+ name: string;
14
+ notifications: Notification[];
15
+ getNotifications: Sequelize.HasManyGetAssociationsMixin<Notification>;
16
+ setNotifications: Sequelize.HasManySetAssociationsMixin<Notification, NotificationId>;
17
+ addNotification: Sequelize.HasManyAddAssociationMixin<Notification, NotificationId>;
18
+ addNotifications: Sequelize.HasManyAddAssociationsMixin<Notification, NotificationId>;
19
+ createNotification: Sequelize.HasManyCreateAssociationMixin<Notification>;
20
+ removeNotification: Sequelize.HasManyRemoveAssociationMixin<Notification, NotificationId>;
21
+ removeNotifications: Sequelize.HasManyRemoveAssociationsMixin<Notification, NotificationId>;
22
+ hasNotification: Sequelize.HasManyHasAssociationMixin<Notification, NotificationId>;
23
+ hasNotifications: Sequelize.HasManyHasAssociationsMixin<Notification, NotificationId>;
24
+ countNotifications: Sequelize.HasManyCountAssociationsMixin;
25
+ static initModel(sequelize: Sequelize.Sequelize): typeof NotificationType;
26
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationType = void 0;
4
+ const sequelize_1 = require("sequelize");
5
+ class NotificationType extends sequelize_1.Model {
6
+ static initModel(sequelize) {
7
+ return NotificationType.init({
8
+ id: {
9
+ type: sequelize_1.DataTypes.SMALLINT,
10
+ allowNull: false,
11
+ primaryKey: true
12
+ },
13
+ name: {
14
+ type: sequelize_1.DataTypes.TEXT,
15
+ allowNull: false,
16
+ unique: "notification_type_name_unique"
17
+ }
18
+ }, {
19
+ sequelize,
20
+ tableName: 'notification_type',
21
+ schema: 'eb',
22
+ timestamps: false,
23
+ indexes: [
24
+ {
25
+ name: "notification_type_name_unique",
26
+ unique: true,
27
+ fields: [
28
+ { name: "name" },
29
+ ]
30
+ },
31
+ {
32
+ name: "notification_type_pkey",
33
+ unique: true,
34
+ fields: [
35
+ { name: "id" },
36
+ ]
37
+ },
38
+ ]
39
+ });
40
+ }
41
+ }
42
+ exports.NotificationType = NotificationType;
@@ -10,20 +10,20 @@ import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './Platfor
10
10
  import type { PlatformUserPlaylist, PlatformUserPlaylistId } from './PlatformUserPlaylist';
11
11
  import type { UnmatchedArtist, UnmatchedArtistId } from './UnmatchedArtist';
12
12
  export interface PlatformAttributes {
13
- id: number;
14
13
  name: string;
15
14
  createDate: Date;
16
15
  updateDate: Date;
16
+ id: number;
17
17
  }
18
18
  export type PlatformPk = "id";
19
19
  export type PlatformId = Platform[PlatformPk];
20
20
  export type PlatformOptionalAttributes = "createDate" | "updateDate";
21
21
  export type PlatformCreationAttributes = Optional<PlatformAttributes, PlatformOptionalAttributes>;
22
22
  export declare class Platform extends Model<PlatformAttributes, PlatformCreationAttributes> implements PlatformAttributes {
23
- id: number;
24
23
  name: string;
25
24
  createDate: Date;
26
25
  updateDate: Date;
26
+ id: number;
27
27
  appUserPlatformRelations: AppUserPlatformRelation[];
28
28
  getAppUserPlatformRelations: Sequelize.HasManyGetAssociationsMixin<AppUserPlatformRelation>;
29
29
  setAppUserPlatformRelations: Sequelize.HasManySetAssociationsMixin<AppUserPlatformRelation, AppUserPlatformRelationId>;
package/dist/Platform.js CHANGED
@@ -29,13 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class Platform extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return Platform.init({
32
- id: {
33
- autoIncrement: true,
34
- autoIncrementIdentity: true,
35
- type: sequelize_1.DataTypes.SMALLINT,
36
- allowNull: false,
37
- primaryKey: true
38
- },
39
32
  name: {
40
33
  type: sequelize_1.DataTypes.TEXT,
41
34
  allowNull: false,
@@ -52,6 +45,13 @@ class Platform extends sequelize_1.Model {
52
45
  allowNull: false,
53
46
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
54
47
  field: 'update_date'
48
+ },
49
+ id: {
50
+ autoIncrement: true,
51
+ autoIncrementIdentity: true,
52
+ type: sequelize_1.DataTypes.SMALLINT,
53
+ allowNull: false,
54
+ primaryKey: true
55
55
  }
56
56
  }, {
57
57
  sequelize,
@@ -18,7 +18,6 @@ import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
18
18
  import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum';
19
19
  import type { UnmatchedAlbum, UnmatchedAlbumId } from './UnmatchedAlbum';
20
20
  export interface PlatformAlbumAttributes {
21
- id: string;
22
21
  platformId: number;
23
22
  externalAlbumId: string;
24
23
  name: string;
@@ -27,18 +26,18 @@ export interface PlatformAlbumAttributes {
27
26
  releaseDate?: string;
28
27
  popularity?: number;
29
28
  recordLabel?: string;
29
+ images?: object;
30
+ id: string;
30
31
  createDate: Date;
31
32
  updateDate: Date;
32
- images?: object;
33
33
  lastHarvestDate?: Date;
34
34
  lastHarvestLog?: string;
35
35
  }
36
36
  export type PlatformAlbumPk = "id";
37
37
  export type PlatformAlbumId = PlatformAlbum[PlatformAlbumPk];
38
- export type PlatformAlbumOptionalAttributes = "id" | "albumType" | "releaseDate" | "popularity" | "recordLabel" | "createDate" | "updateDate" | "images" | "lastHarvestDate" | "lastHarvestLog";
38
+ export type PlatformAlbumOptionalAttributes = "albumType" | "releaseDate" | "popularity" | "recordLabel" | "images" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog";
39
39
  export type PlatformAlbumCreationAttributes = Optional<PlatformAlbumAttributes, PlatformAlbumOptionalAttributes>;
40
40
  export declare class PlatformAlbum extends Model<PlatformAlbumAttributes, PlatformAlbumCreationAttributes> implements PlatformAlbumAttributes {
41
- id: string;
42
41
  platformId: number;
43
42
  externalAlbumId: string;
44
43
  name: string;
@@ -47,9 +46,10 @@ export declare class PlatformAlbum extends Model<PlatformAlbumAttributes, Platfo
47
46
  releaseDate?: string;
48
47
  popularity?: number;
49
48
  recordLabel?: string;
49
+ images?: object;
50
+ id: string;
50
51
  createDate: Date;
51
52
  updateDate: Date;
52
- images?: object;
53
53
  lastHarvestDate?: Date;
54
54
  lastHarvestLog?: string;
55
55
  platform: Platform;
@@ -29,12 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class PlatformAlbum extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return PlatformAlbum.init({
32
- id: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
36
- primaryKey: true
37
- },
38
32
  platformId: {
39
33
  type: sequelize_1.DataTypes.SMALLINT,
40
34
  allowNull: false,
@@ -79,6 +73,16 @@ class PlatformAlbum extends sequelize_1.Model {
79
73
  allowNull: true,
80
74
  field: 'record_label'
81
75
  },
76
+ images: {
77
+ type: sequelize_1.DataTypes.JSONB,
78
+ allowNull: true
79
+ },
80
+ id: {
81
+ type: sequelize_1.DataTypes.UUID,
82
+ allowNull: false,
83
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
84
+ primaryKey: true
85
+ },
82
86
  createDate: {
83
87
  type: sequelize_1.DataTypes.DATE,
84
88
  allowNull: false,
@@ -91,10 +95,6 @@ class PlatformAlbum extends sequelize_1.Model {
91
95
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
92
96
  field: 'update_date'
93
97
  },
94
- images: {
95
- type: sequelize_1.DataTypes.JSONB,
96
- allowNull: true
97
- },
98
98
  lastHarvestDate: {
99
99
  type: sequelize_1.DataTypes.DATE,
100
100
  allowNull: true,
@@ -16,33 +16,33 @@ import type { PlatformArtistTrackRelation, PlatformArtistTrackRelationId } from
16
16
  import type { PlatformGenre, PlatformGenreId } from './PlatformGenre';
17
17
  import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
18
18
  export interface PlatformArtistAttributes {
19
- id: string;
20
19
  externalArtistId: string;
21
20
  platformId: number;
22
21
  name: string;
23
22
  asciiName: string;
24
23
  externalUri?: string;
24
+ genres?: string[];
25
+ id: string;
25
26
  createDate: Date;
26
27
  updateDate: Date;
27
- genres?: string[];
28
28
  lastHarvestDate?: Date;
29
29
  lastHarvestLog?: string;
30
30
  images?: object;
31
31
  }
32
32
  export type PlatformArtistPk = "id";
33
33
  export type PlatformArtistId = PlatformArtist[PlatformArtistPk];
34
- export type PlatformArtistOptionalAttributes = "id" | "externalUri" | "createDate" | "updateDate" | "genres" | "lastHarvestDate" | "lastHarvestLog" | "images";
34
+ export type PlatformArtistOptionalAttributes = "externalUri" | "genres" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog" | "images";
35
35
  export type PlatformArtistCreationAttributes = Optional<PlatformArtistAttributes, PlatformArtistOptionalAttributes>;
36
36
  export declare class PlatformArtist extends Model<PlatformArtistAttributes, PlatformArtistCreationAttributes> implements PlatformArtistAttributes {
37
- id: string;
38
37
  externalArtistId: string;
39
38
  platformId: number;
40
39
  name: string;
41
40
  asciiName: string;
42
41
  externalUri?: string;
42
+ genres?: string[];
43
+ id: string;
43
44
  createDate: Date;
44
45
  updateDate: Date;
45
- genres?: string[];
46
46
  lastHarvestDate?: Date;
47
47
  lastHarvestLog?: string;
48
48
  images?: object;
@@ -29,12 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class PlatformArtist extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return PlatformArtist.init({
32
- id: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
36
- primaryKey: true
37
- },
38
32
  externalArtistId: {
39
33
  type: sequelize_1.DataTypes.TEXT,
40
34
  allowNull: false,
@@ -65,6 +59,16 @@ class PlatformArtist extends sequelize_1.Model {
65
59
  allowNull: true,
66
60
  field: 'external_uri'
67
61
  },
62
+ genres: {
63
+ type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.TEXT),
64
+ allowNull: true
65
+ },
66
+ id: {
67
+ type: sequelize_1.DataTypes.UUID,
68
+ allowNull: false,
69
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
70
+ primaryKey: true
71
+ },
68
72
  createDate: {
69
73
  type: sequelize_1.DataTypes.DATE,
70
74
  allowNull: false,
@@ -77,10 +81,6 @@ class PlatformArtist extends sequelize_1.Model {
77
81
  defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
78
82
  field: 'update_date'
79
83
  },
80
- genres: {
81
- type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.TEXT),
82
- allowNull: true
83
- },
84
84
  lastHarvestDate: {
85
85
  type: sequelize_1.DataTypes.DATE,
86
86
  allowNull: true,
@@ -10,9 +10,9 @@ import type { PlatformArtistGenreRelation, PlatformArtistGenreRelationId } from
10
10
  import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
11
11
  import type { PlatformTrackGenreRelation, PlatformTrackGenreRelationId } from './PlatformTrackGenreRelation';
12
12
  export interface PlatformGenreAttributes {
13
- id: string;
14
13
  platformId: number;
15
14
  name: string;
15
+ id: string;
16
16
  createDate: Date;
17
17
  updateDate: Date;
18
18
  }
@@ -21,9 +21,9 @@ export type PlatformGenreId = PlatformGenre[PlatformGenrePk];
21
21
  export type PlatformGenreOptionalAttributes = "id" | "createDate" | "updateDate";
22
22
  export type PlatformGenreCreationAttributes = Optional<PlatformGenreAttributes, PlatformGenreOptionalAttributes>;
23
23
  export declare class PlatformGenre extends Model<PlatformGenreAttributes, PlatformGenreCreationAttributes> implements PlatformGenreAttributes {
24
- id: string;
25
24
  platformId: number;
26
25
  name: string;
26
+ id: string;
27
27
  createDate: Date;
28
28
  updateDate: Date;
29
29
  platform: Platform;
@@ -29,12 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class PlatformGenre extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return PlatformGenre.init({
32
- id: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
36
- primaryKey: true
37
- },
38
32
  platformId: {
39
33
  type: sequelize_1.DataTypes.SMALLINT,
40
34
  allowNull: false,
@@ -50,6 +44,12 @@ class PlatformGenre extends sequelize_1.Model {
50
44
  allowNull: false,
51
45
  unique: "platform_genre_name_pkey"
52
46
  },
47
+ id: {
48
+ type: sequelize_1.DataTypes.UUID,
49
+ allowNull: false,
50
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
51
+ primaryKey: true
52
+ },
53
53
  createDate: {
54
54
  type: sequelize_1.DataTypes.DATE,
55
55
  allowNull: false,
@@ -12,7 +12,6 @@ import type { PlatformTrackGenreRelation, PlatformTrackGenreRelationId } from '.
12
12
  import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './PlatformUserAlbumTrack';
13
13
  import type { PlatformUserPlaylistTrack, PlatformUserPlaylistTrackId } from './PlatformUserPlaylistTrack';
14
14
  export interface PlatformTrackAttributes {
15
- id: string;
16
15
  platformId: number;
17
16
  externalTrackId: string;
18
17
  name: string;
@@ -22,6 +21,7 @@ export interface PlatformTrackAttributes {
22
21
  popularity?: number;
23
22
  discNumber?: number;
24
23
  discTrackNumber?: number;
24
+ id: string;
25
25
  createDate: Date;
26
26
  updateDate: Date;
27
27
  lastHarvestDate?: Date;
@@ -29,10 +29,9 @@ export interface PlatformTrackAttributes {
29
29
  }
30
30
  export type PlatformTrackPk = "id";
31
31
  export type PlatformTrackId = PlatformTrack[PlatformTrackPk];
32
- export type PlatformTrackOptionalAttributes = "id" | "explicit" | "popularity" | "discNumber" | "discTrackNumber" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog";
32
+ export type PlatformTrackOptionalAttributes = "explicit" | "popularity" | "discNumber" | "discTrackNumber" | "id" | "createDate" | "updateDate" | "lastHarvestDate" | "lastHarvestLog";
33
33
  export type PlatformTrackCreationAttributes = Optional<PlatformTrackAttributes, PlatformTrackOptionalAttributes>;
34
34
  export declare class PlatformTrack extends Model<PlatformTrackAttributes, PlatformTrackCreationAttributes> implements PlatformTrackAttributes {
35
- id: string;
36
35
  platformId: number;
37
36
  externalTrackId: string;
38
37
  name: string;
@@ -42,6 +41,7 @@ export declare class PlatformTrack extends Model<PlatformTrackAttributes, Platfo
42
41
  popularity?: number;
43
42
  discNumber?: number;
44
43
  discTrackNumber?: number;
44
+ id: string;
45
45
  createDate: Date;
46
46
  updateDate: Date;
47
47
  lastHarvestDate?: Date;
@@ -29,12 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class PlatformTrack extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return PlatformTrack.init({
32
- id: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
36
- primaryKey: true
37
- },
38
32
  platformId: {
39
33
  type: sequelize_1.DataTypes.SMALLINT,
40
34
  allowNull: false,
@@ -83,6 +77,12 @@ class PlatformTrack extends sequelize_1.Model {
83
77
  allowNull: true,
84
78
  field: 'disc_track_number'
85
79
  },
80
+ id: {
81
+ type: sequelize_1.DataTypes.UUID,
82
+ allowNull: false,
83
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v1'),
84
+ primaryKey: true
85
+ },
86
86
  createDate: {
87
87
  type: sequelize_1.DataTypes.DATE,
88
88
  allowNull: false,
@@ -5,11 +5,11 @@ import type { Platform, PlatformId } from './Platform';
5
5
  import type { PlatformAlbum, PlatformAlbumId } from './PlatformAlbum';
6
6
  import type { PlatformUserAlbumTrack, PlatformUserAlbumTrackId } from './PlatformUserAlbumTrack';
7
7
  export interface PlatformUserAlbumAttributes {
8
- id: string;
9
8
  appUserId: string;
10
9
  platformId: number;
11
10
  externalUserAlbumId: string;
12
11
  platformAlbumId: string;
12
+ id: string;
13
13
  createdAt: Date;
14
14
  updatedAt: Date;
15
15
  stateId: number;
@@ -19,11 +19,11 @@ export type PlatformUserAlbumId = PlatformUserAlbum[PlatformUserAlbumPk];
19
19
  export type PlatformUserAlbumOptionalAttributes = "id" | "createdAt" | "updatedAt" | "stateId";
20
20
  export type PlatformUserAlbumCreationAttributes = Optional<PlatformUserAlbumAttributes, PlatformUserAlbumOptionalAttributes>;
21
21
  export declare class PlatformUserAlbum extends Model<PlatformUserAlbumAttributes, PlatformUserAlbumCreationAttributes> implements PlatformUserAlbumAttributes {
22
- id: string;
23
22
  appUserId: string;
24
23
  platformId: number;
25
24
  externalUserAlbumId: string;
26
25
  platformAlbumId: string;
26
+ id: string;
27
27
  createdAt: Date;
28
28
  updatedAt: Date;
29
29
  stateId: number;
@@ -29,12 +29,6 @@ const sequelize_1 = require("sequelize");
29
29
  class PlatformUserAlbum extends sequelize_1.Model {
30
30
  static initModel(sequelize) {
31
31
  return PlatformUserAlbum.init({
32
- id: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- defaultValue: sequelize_1.DataTypes.UUIDV4,
36
- primaryKey: true
37
- },
38
32
  appUserId: {
39
33
  type: sequelize_1.DataTypes.UUID,
40
34
  allowNull: false,
@@ -69,6 +63,12 @@ class PlatformUserAlbum extends sequelize_1.Model {
69
63
  unique: "platform_user_album_app_user_id_platform_album_id_unique",
70
64
  field: 'platform_album_id'
71
65
  },
66
+ id: {
67
+ type: sequelize_1.DataTypes.UUID,
68
+ allowNull: false,
69
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
70
+ primaryKey: true
71
+ },
72
72
  createdAt: {
73
73
  type: sequelize_1.DataTypes.DATE,
74
74
  allowNull: false,
@@ -4,28 +4,28 @@ import type { Platform, PlatformId } from './Platform';
4
4
  import type { PlatformTrack, PlatformTrackId } from './PlatformTrack';
5
5
  import type { PlatformUserAlbum, PlatformUserAlbumId } from './PlatformUserAlbum';
6
6
  export interface PlatformUserAlbumTrackAttributes {
7
- id: string;
8
7
  platformUserAlbumId: string;
9
8
  platformId: number;
10
9
  externalUserAlbumTrackId: string;
11
10
  platformTrackId: string;
11
+ stateId: number;
12
+ id: string;
12
13
  createdAt: Date;
13
14
  updatedAt: Date;
14
- stateId: number;
15
15
  }
16
16
  export type PlatformUserAlbumTrackPk = "id";
17
17
  export type PlatformUserAlbumTrackId = PlatformUserAlbumTrack[PlatformUserAlbumTrackPk];
18
18
  export type PlatformUserAlbumTrackOptionalAttributes = "id" | "createdAt" | "updatedAt";
19
19
  export type PlatformUserAlbumTrackCreationAttributes = Optional<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackOptionalAttributes>;
20
20
  export declare class PlatformUserAlbumTrack extends Model<PlatformUserAlbumTrackAttributes, PlatformUserAlbumTrackCreationAttributes> implements PlatformUserAlbumTrackAttributes {
21
- id: string;
22
21
  platformUserAlbumId: string;
23
22
  platformId: number;
24
23
  externalUserAlbumTrackId: string;
25
24
  platformTrackId: string;
25
+ stateId: number;
26
+ id: string;
26
27
  createdAt: Date;
27
28
  updatedAt: Date;
28
- stateId: number;
29
29
  platform: Platform;
30
30
  getPlatform: Sequelize.BelongsToGetAssociationMixin<Platform>;
31
31
  setPlatform: Sequelize.BelongsToSetAssociationMixin<Platform, PlatformId>;