@earbug/db-models 0.0.60 → 0.0.63

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 (230) hide show
  1. package/.dockerignore +10 -0
  2. package/.github/workflows/publish.yaml +266 -19
  3. package/Dockerfile.generate +19 -0
  4. package/dist/AffinityRelationshipType.d.ts +2 -2
  5. package/dist/AffinityRelationshipType.js +6 -6
  6. package/dist/AppUser.d.ts +5 -5
  7. package/dist/AppUser.js +7 -7
  8. package/dist/AppUserDevice.d.ts +2 -2
  9. package/dist/AppUserDevice.js +6 -6
  10. package/dist/AppUserDeviceClassicBackup20260906.d.ts +23 -0
  11. package/dist/AppUserDeviceClassicBackup20260906.js +46 -0
  12. package/dist/AppUserFollowRelation.d.ts +3 -3
  13. package/dist/AppUserFollowRelation.js +6 -6
  14. package/dist/AppUserPlatformRelation.d.ts +13 -13
  15. package/dist/AppUserPlatformRelation.js +25 -25
  16. package/dist/CanonAlbum.d.ts +5 -5
  17. package/dist/CanonAlbum.js +10 -10
  18. package/dist/CanonArtist.d.ts +5 -5
  19. package/dist/CanonArtist.js +11 -11
  20. package/dist/CanonGenre.d.ts +3 -3
  21. package/dist/CanonGenre.js +6 -6
  22. package/dist/CanonLabel.d.ts +2 -2
  23. package/dist/CanonLabel.js +6 -6
  24. package/dist/CanonMember.d.ts +3 -3
  25. package/dist/CanonMember.js +6 -6
  26. package/dist/CanonMemberExternalReferenceRelation.d.ts +2 -2
  27. package/dist/CanonMemberExternalReferenceRelation.js +5 -5
  28. package/dist/CanonTrack.d.ts +5 -5
  29. package/dist/CanonTrack.js +11 -11
  30. package/dist/ConfigParam.d.ts +2 -2
  31. package/dist/ConfigParam.js +5 -5
  32. package/dist/ExternalReference.d.ts +2 -2
  33. package/dist/ExternalReference.js +5 -5
  34. package/dist/FeedContentType.d.ts +2 -2
  35. package/dist/FeedContentType.js +4 -4
  36. package/dist/GuestUser.d.ts +5 -5
  37. package/dist/GuestUser.js +13 -13
  38. package/dist/JukeboxAccessType.d.ts +2 -2
  39. package/dist/JukeboxAccessType.js +4 -4
  40. package/dist/JukeboxCanonGenreRelation.d.ts +2 -2
  41. package/dist/JukeboxCanonGenreRelation.js +6 -6
  42. package/dist/JukeboxInvite.d.ts +3 -3
  43. package/dist/JukeboxInvite.js +6 -6
  44. package/dist/JukeboxQueueEntry.d.ts +9 -9
  45. package/dist/JukeboxQueueEntry.js +25 -25
  46. package/dist/JukeboxQueueMode.d.ts +2 -2
  47. package/dist/JukeboxQueueMode.js +4 -4
  48. package/dist/JukeboxSession.d.ts +9 -9
  49. package/dist/JukeboxSession.js +20 -20
  50. package/dist/JukeboxSessionArtistAffinity.d.ts +2 -2
  51. package/dist/JukeboxSessionArtistAffinity.js +6 -6
  52. package/dist/JukeboxSessionGenreAffinity.d.ts +2 -2
  53. package/dist/JukeboxSessionGenreAffinity.js +6 -6
  54. package/dist/JukeboxTerminationCondition.d.ts +2 -2
  55. package/dist/JukeboxTerminationCondition.js +4 -4
  56. package/dist/JukeboxType.d.ts +2 -2
  57. package/dist/JukeboxType.js +4 -4
  58. package/dist/JukeboxUser.d.ts +7 -7
  59. package/dist/JukeboxUser.js +20 -20
  60. package/dist/KnexMigrations.d.ts +3 -3
  61. package/dist/KnexMigrations.js +6 -6
  62. package/dist/KnexMigrationsLock.d.ts +3 -3
  63. package/dist/KnexMigrationsLock.js +5 -5
  64. package/dist/MerchItem.d.ts +3 -3
  65. package/dist/MerchItem.js +6 -6
  66. package/dist/MerchOrchestration.d.ts +3 -3
  67. package/dist/MerchOrchestration.js +6 -6
  68. package/dist/MerchPlatform.d.ts +2 -2
  69. package/dist/MerchPlatform.js +6 -6
  70. package/dist/MerchType.d.ts +2 -2
  71. package/dist/MerchType.js +4 -4
  72. package/dist/MetricsDaily.d.ts +3 -3
  73. package/dist/MetricsDaily.js +4 -4
  74. package/dist/NewsSite.d.ts +3 -3
  75. package/dist/NewsSite.js +6 -6
  76. package/dist/Notification.d.ts +13 -13
  77. package/dist/Notification.js +33 -33
  78. package/dist/Platform.d.ts +2 -2
  79. package/dist/Platform.js +7 -7
  80. package/dist/PlatformAlbum.d.ts +5 -5
  81. package/dist/PlatformAlbum.js +10 -10
  82. package/dist/PlatformArtist.d.ts +5 -5
  83. package/dist/PlatformArtist.js +10 -10
  84. package/dist/PlatformGenre.d.ts +2 -2
  85. package/dist/PlatformGenre.js +6 -6
  86. package/dist/PlatformTrack.d.ts +3 -3
  87. package/dist/PlatformTrack.js +6 -6
  88. package/dist/PlatformUserAlbum.d.ts +2 -2
  89. package/dist/PlatformUserAlbum.js +6 -6
  90. package/dist/PlatformUserAlbumTrack.d.ts +4 -4
  91. package/dist/PlatformUserAlbumTrack.js +11 -11
  92. package/dist/PlatformUserPlaylist.d.ts +5 -5
  93. package/dist/PlatformUserPlaylist.js +11 -11
  94. package/dist/PlatformUserPlaylistArtistAffinity.d.ts +4 -4
  95. package/dist/PlatformUserPlaylistArtistAffinity.js +12 -12
  96. package/dist/PlatformUserPlaylistGenreAffinity.d.ts +2 -2
  97. package/dist/PlatformUserPlaylistGenreAffinity.js +6 -6
  98. package/dist/PlatformUserPlaylistTrack.d.ts +7 -7
  99. package/dist/PlatformUserPlaylistTrack.js +17 -17
  100. package/dist/PlaybackStatus.d.ts +2 -2
  101. package/dist/PlaybackStatus.js +4 -4
  102. package/dist/RadioShow.d.ts +3 -3
  103. package/dist/RadioShow.js +6 -6
  104. package/dist/RadioShowMedia.d.ts +3 -3
  105. package/dist/RadioShowMedia.js +6 -6
  106. package/dist/RadioShowPlacement.d.ts +3 -3
  107. package/dist/RadioShowPlacement.js +6 -6
  108. package/dist/RadioShowPublishRequests.d.ts +3 -3
  109. package/dist/RadioShowPublishRequests.js +6 -6
  110. package/dist/State.d.ts +2 -2
  111. package/dist/State.js +4 -4
  112. package/dist/UnmatchedAlbum.d.ts +2 -2
  113. package/dist/UnmatchedAlbum.js +6 -6
  114. package/dist/UnmatchedArtist.d.ts +2 -2
  115. package/dist/UnmatchedArtist.js +6 -6
  116. package/dist/UserAbuseReports.d.ts +7 -7
  117. package/dist/UserAbuseReports.js +18 -18
  118. package/dist/UserAffinity.d.ts +2 -2
  119. package/dist/UserAffinity.js +6 -6
  120. package/dist/UserArtistAffinity.d.ts +2 -2
  121. package/dist/UserArtistAffinity.js +6 -6
  122. package/dist/UserBookmarks.d.ts +3 -3
  123. package/dist/UserBookmarks.js +6 -6
  124. package/dist/UserComments.d.ts +5 -5
  125. package/dist/UserComments.js +12 -12
  126. package/dist/UserContacts.d.ts +3 -3
  127. package/dist/UserContacts.js +7 -7
  128. package/dist/UserEngagementFactor.d.ts +2 -2
  129. package/dist/UserEngagementFactor.js +6 -6
  130. package/dist/UserGenreAffinity.d.ts +2 -2
  131. package/dist/UserGenreAffinity.js +6 -6
  132. package/dist/UserLikes.d.ts +3 -3
  133. package/dist/UserLikes.js +6 -6
  134. package/dist/UserMessages.d.ts +5 -5
  135. package/dist/UserMessages.js +15 -15
  136. package/dist/Versus.d.ts +5 -5
  137. package/dist/Versus.js +11 -11
  138. package/dist/VersusCoCreator.d.ts +4 -4
  139. package/dist/VersusCoCreator.js +12 -12
  140. package/dist/VersusOption.d.ts +3 -3
  141. package/dist/VersusOption.js +6 -6
  142. package/dist/VersusPublishIssue.d.ts +3 -3
  143. package/dist/VersusPublishIssue.js +6 -6
  144. package/dist/VersusQuestion.d.ts +2 -2
  145. package/dist/VersusQuestion.js +6 -6
  146. package/dist/VersusVote.d.ts +2 -2
  147. package/dist/VersusVote.js +6 -6
  148. package/dist/init-models.d.ts +349 -3
  149. package/dist/init-models.js +905 -1
  150. package/models/AffinityRelationshipType.ts +8 -8
  151. package/models/AppUser.ts +12 -12
  152. package/models/AppUserDevice.ts +8 -8
  153. package/models/AppUserDeviceClassicBackup20260906.ts +66 -0
  154. package/models/AppUserFollowRelation.ts +9 -9
  155. package/models/AppUserPlatformRelation.ts +38 -38
  156. package/models/CanonAlbum.ts +15 -15
  157. package/models/CanonArtist.ts +16 -16
  158. package/models/CanonGenre.ts +9 -9
  159. package/models/CanonLabel.ts +8 -8
  160. package/models/CanonMember.ts +9 -9
  161. package/models/CanonMemberExternalReferenceRelation.ts +7 -7
  162. package/models/CanonTrack.ts +16 -16
  163. package/models/ConfigParam.ts +7 -7
  164. package/models/ExternalReference.ts +7 -7
  165. package/models/FeedContentType.ts +6 -6
  166. package/models/GuestUser.ts +18 -18
  167. package/models/JukeboxAccessType.ts +6 -6
  168. package/models/JukeboxCanonGenreRelation.ts +8 -8
  169. package/models/JukeboxInvite.ts +9 -9
  170. package/models/JukeboxQueueEntry.ts +34 -34
  171. package/models/JukeboxQueueMode.ts +6 -6
  172. package/models/JukeboxSession.ts +29 -29
  173. package/models/JukeboxSessionArtistAffinity.ts +8 -8
  174. package/models/JukeboxSessionGenreAffinity.ts +8 -8
  175. package/models/JukeboxTerminationCondition.ts +6 -6
  176. package/models/JukeboxType.ts +6 -6
  177. package/models/JukeboxUser.ts +27 -27
  178. package/models/KnexMigrations.ts +9 -9
  179. package/models/KnexMigrationsLock.ts +8 -8
  180. package/models/MerchItem.ts +9 -9
  181. package/models/MerchOrchestration.ts +9 -9
  182. package/models/MerchPlatform.ts +8 -8
  183. package/models/MerchType.ts +6 -6
  184. package/models/MetricsDaily.ts +7 -7
  185. package/models/NewsSite.ts +9 -9
  186. package/models/Notification.ts +46 -46
  187. package/models/Platform.ts +9 -9
  188. package/models/PlatformAlbum.ts +15 -15
  189. package/models/PlatformArtist.ts +15 -15
  190. package/models/PlatformGenre.ts +8 -8
  191. package/models/PlatformTrack.ts +9 -9
  192. package/models/PlatformUserAlbum.ts +8 -8
  193. package/models/PlatformUserAlbumTrack.ts +15 -15
  194. package/models/PlatformUserPlaylist.ts +16 -16
  195. package/models/PlatformUserPlaylistArtistAffinity.ts +16 -16
  196. package/models/PlatformUserPlaylistGenreAffinity.ts +8 -8
  197. package/models/PlatformUserPlaylistTrack.ts +24 -24
  198. package/models/PlaybackStatus.ts +6 -6
  199. package/models/RadioShow.ts +9 -9
  200. package/models/RadioShowMedia.ts +9 -9
  201. package/models/RadioShowPlacement.ts +9 -9
  202. package/models/RadioShowPublishRequests.ts +9 -9
  203. package/models/State.ts +6 -6
  204. package/models/UnmatchedAlbum.ts +8 -8
  205. package/models/UnmatchedArtist.ts +8 -8
  206. package/models/UserAbuseReports.ts +25 -25
  207. package/models/UserAffinity.ts +8 -8
  208. package/models/UserArtistAffinity.ts +8 -8
  209. package/models/UserBookmarks.ts +9 -9
  210. package/models/UserComments.ts +17 -17
  211. package/models/UserContacts.ts +10 -10
  212. package/models/UserEngagementFactor.ts +8 -8
  213. package/models/UserGenreAffinity.ts +8 -8
  214. package/models/UserLikes.ts +9 -9
  215. package/models/UserMessages.ts +20 -20
  216. package/models/Versus.ts +16 -16
  217. package/models/VersusCoCreator.ts +16 -16
  218. package/models/VersusOption.ts +9 -9
  219. package/models/VersusPublishIssue.ts +9 -9
  220. package/models/VersusQuestion.ts +8 -8
  221. package/models/VersusVote.ts +8 -8
  222. package/models/init-models.ts +1245 -0
  223. package/package.json +1 -1
  224. package/scripts/generate-and-upload.mjs +123 -0
  225. package/dist/CanonAlbumImageHarvested.d.ts +0 -30
  226. package/dist/CanonAlbumImageHarvested.js +0 -70
  227. package/dist/CanonArtistImageHarvested.d.ts +0 -30
  228. package/dist/CanonArtistImageHarvested.js +0 -70
  229. package/models/CanonAlbumImageHarvested.ts +0 -98
  230. package/models/CanonArtistImageHarvested.ts +0 -98
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earbug/db-models",
3
- "version": "0.0.60",
3
+ "version": "0.0.63",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,123 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs";
3
+ import { createRequire } from "node:module";
4
+
5
+ const require = createRequire(import.meta.url);
6
+ const { SequelizeAuto } = require("sequelize-auto");
7
+
8
+ const requiredEnvironment = [
9
+ "PGHOST",
10
+ "PGPORT",
11
+ "PGUSER",
12
+ "PGPASSWORD",
13
+ "PGDATABASE",
14
+ "ARTIFACT_BUCKET",
15
+ "ARTIFACT_KEY",
16
+ ];
17
+
18
+ for (const name of requiredEnvironment) {
19
+ if (!process.env[name]) {
20
+ throw new Error(`${name} is required`);
21
+ }
22
+ }
23
+
24
+ if (process.env.PG_SSL !== "true") {
25
+ throw new Error("PG_SSL must be true; refusing a plaintext database connection");
26
+ }
27
+
28
+ const caSource = readFileSync("models/rdsCaBundle.ts", "utf8");
29
+ const caMatch = caSource.match(/RDS_GLOBAL_CA_BUNDLE: string = (.*);\s*$/s);
30
+ if (!caMatch) {
31
+ throw new Error("Unable to read the bundled RDS CA certificate");
32
+ }
33
+
34
+ const dialectOptions = {
35
+ ssl: {
36
+ require: true,
37
+ rejectUnauthorized: true,
38
+ ca: JSON.parse(caMatch[1]),
39
+ },
40
+ };
41
+
42
+ const maintainedFiles = new Set(["index.ts", "initDb.ts", "rdsCaBundle.ts"]);
43
+ for (const entry of readdirSync("models")) {
44
+ if (!maintainedFiles.has(entry)) {
45
+ rmSync(`models/${entry}`, { recursive: true, force: true });
46
+ }
47
+ }
48
+
49
+ const auto = new SequelizeAuto(
50
+ process.env.PGDATABASE,
51
+ process.env.PGUSER,
52
+ process.env.PGPASSWORD,
53
+ {
54
+ host: process.env.PGHOST,
55
+ port: Number(process.env.PGPORT),
56
+ dialect: "postgres",
57
+ dialectOptions,
58
+ logging: false,
59
+ directory: "models",
60
+ lang: "ts",
61
+ caseModel: "p",
62
+ caseFile: "p",
63
+ caseProp: "c",
64
+ additional: JSON.parse(readFileSync("model_options.json", "utf8")),
65
+ skipTables: ["harvested_article", "article_to_artist_relation"],
66
+ },
67
+ );
68
+
69
+ console.log("Generating database models with verified TLS");
70
+ try {
71
+ await auto.run();
72
+ } catch (error) {
73
+ const errorName = error instanceof Error ? error.name : "UnknownError";
74
+ throw new Error(`Model generation failed (${errorName})`);
75
+ }
76
+
77
+ const initModels = readFileSync("models/init-models.ts", "utf8");
78
+ const modelCount = (initModels.match(/^import \{ .* as _.* \} from "\.\//gm) ?? []).length;
79
+ console.log(`init-models.ts imports ${modelCount} models`);
80
+
81
+ if (modelCount < 25) {
82
+ throw new Error(`Only ${modelCount} models generated; expected at least 25`);
83
+ }
84
+
85
+ for (const model of ["AppUser", "CanonArtist", "JukeboxSession", "PlatformTrack", "RadioShow"]) {
86
+ if (!existsSync(`models/${model}.ts`)) {
87
+ throw new Error(`Required model ${model} was not generated`);
88
+ }
89
+ }
90
+
91
+ for (const excludedModel of ["HarvestedArticle", "ArticleToArtistRelation"]) {
92
+ if (existsSync(`models/${excludedModel}.ts`)) {
93
+ throw new Error(`Excluded model ${excludedModel} was generated`);
94
+ }
95
+ }
96
+
97
+ function run(command, args) {
98
+ const result = spawnSync(command, args, { stdio: "inherit" });
99
+ if (result.status !== 0) {
100
+ throw new Error(`${command} exited with status ${result.status}`);
101
+ }
102
+ }
103
+
104
+ const archive = "/tmp/models.tgz";
105
+ run("tar", [
106
+ "-czf",
107
+ archive,
108
+ "--exclude=models/index.ts",
109
+ "--exclude=models/initDb.ts",
110
+ "--exclude=models/rdsCaBundle.ts",
111
+ "models",
112
+ ]);
113
+ run("aws", [
114
+ "s3",
115
+ "cp",
116
+ archive,
117
+ `s3://${process.env.ARTIFACT_BUCKET}/${process.env.ARTIFACT_KEY}`,
118
+ "--checksum-algorithm",
119
+ "SHA256",
120
+ "--only-show-errors",
121
+ ]);
122
+
123
+ console.log(`Uploaded generated models to s3://${process.env.ARTIFACT_BUCKET}/${process.env.ARTIFACT_KEY}`);
@@ -1,30 +0,0 @@
1
- import * as Sequelize from 'sequelize';
2
- import { Model, Optional } from 'sequelize';
3
- import type { CanonAlbum, CanonAlbumId } from './CanonAlbum';
4
- export interface CanonAlbumImageHarvestedAttributes {
5
- dateHarvested: Date;
6
- storageKey: string;
7
- harvestMethod?: string;
8
- priority?: number;
9
- id: string;
10
- url?: string;
11
- canonAlbumId: string;
12
- }
13
- export type CanonAlbumImageHarvestedPk = "id";
14
- export type CanonAlbumImageHarvestedId = CanonAlbumImageHarvested[CanonAlbumImageHarvestedPk];
15
- export type CanonAlbumImageHarvestedOptionalAttributes = "harvestMethod" | "priority" | "id" | "url";
16
- export type CanonAlbumImageHarvestedCreationAttributes = Optional<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedOptionalAttributes>;
17
- export declare class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedCreationAttributes> implements CanonAlbumImageHarvestedAttributes {
18
- dateHarvested: Date;
19
- storageKey: string;
20
- harvestMethod?: string;
21
- priority?: number;
22
- id: string;
23
- url?: string;
24
- canonAlbumId: string;
25
- canonAlbum: CanonAlbum;
26
- getCanonAlbum: Sequelize.BelongsToGetAssociationMixin<CanonAlbum>;
27
- setCanonAlbum: Sequelize.BelongsToSetAssociationMixin<CanonAlbum, CanonAlbumId>;
28
- createCanonAlbum: Sequelize.BelongsToCreateAssociationMixin<CanonAlbum>;
29
- static initModel(sequelize: Sequelize.Sequelize): typeof CanonAlbumImageHarvested;
30
- }
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CanonAlbumImageHarvested = void 0;
4
- const sequelize_1 = require("sequelize");
5
- class CanonAlbumImageHarvested extends sequelize_1.Model {
6
- static initModel(sequelize) {
7
- return CanonAlbumImageHarvested.init({
8
- dateHarvested: {
9
- type: sequelize_1.DataTypes.DATE,
10
- allowNull: false,
11
- field: 'date_harvested'
12
- },
13
- storageKey: {
14
- type: sequelize_1.DataTypes.STRING(255),
15
- allowNull: false,
16
- field: 'storage_key'
17
- },
18
- harvestMethod: {
19
- type: sequelize_1.DataTypes.STRING(255),
20
- allowNull: true,
21
- field: 'harvest_method'
22
- },
23
- priority: {
24
- type: sequelize_1.DataTypes.DECIMAL,
25
- allowNull: true,
26
- defaultValue: 0
27
- },
28
- id: {
29
- type: sequelize_1.DataTypes.UUID,
30
- allowNull: false,
31
- defaultValue: sequelize_1.DataTypes.UUIDV4,
32
- primaryKey: true
33
- },
34
- url: {
35
- type: sequelize_1.DataTypes.TEXT,
36
- allowNull: true
37
- },
38
- canonAlbumId: {
39
- type: sequelize_1.DataTypes.UUID,
40
- allowNull: false,
41
- references: {
42
- model: 'canon_album',
43
- key: 'id'
44
- },
45
- field: 'canon_album_id'
46
- }
47
- }, {
48
- sequelize,
49
- tableName: 'canon_album_image_harvested',
50
- schema: 'eb',
51
- timestamps: false,
52
- indexes: [
53
- {
54
- name: "canon_album_image_harvested_canon_album_id_index",
55
- fields: [
56
- { name: "canon_album_id" },
57
- ]
58
- },
59
- {
60
- name: "canon_album_image_harvested_pkey",
61
- unique: true,
62
- fields: [
63
- { name: "id" },
64
- ]
65
- },
66
- ]
67
- });
68
- }
69
- }
70
- exports.CanonAlbumImageHarvested = CanonAlbumImageHarvested;
@@ -1,30 +0,0 @@
1
- import * as Sequelize from 'sequelize';
2
- import { Model, Optional } from 'sequelize';
3
- import type { CanonArtist, CanonArtistId } from './CanonArtist';
4
- export interface CanonArtistImageHarvestedAttributes {
5
- dateHarvested: Date;
6
- storageKey: string;
7
- harvestMethod?: string;
8
- url?: string;
9
- priority?: number;
10
- canonArtistId: string;
11
- id: string;
12
- }
13
- export type CanonArtistImageHarvestedPk = "id";
14
- export type CanonArtistImageHarvestedId = CanonArtistImageHarvested[CanonArtistImageHarvestedPk];
15
- export type CanonArtistImageHarvestedOptionalAttributes = "harvestMethod" | "url" | "priority" | "id";
16
- export type CanonArtistImageHarvestedCreationAttributes = Optional<CanonArtistImageHarvestedAttributes, CanonArtistImageHarvestedOptionalAttributes>;
17
- export declare class CanonArtistImageHarvested extends Model<CanonArtistImageHarvestedAttributes, CanonArtistImageHarvestedCreationAttributes> implements CanonArtistImageHarvestedAttributes {
18
- dateHarvested: Date;
19
- storageKey: string;
20
- harvestMethod?: string;
21
- url?: string;
22
- priority?: number;
23
- canonArtistId: string;
24
- id: string;
25
- canonArtist: CanonArtist;
26
- getCanonArtist: Sequelize.BelongsToGetAssociationMixin<CanonArtist>;
27
- setCanonArtist: Sequelize.BelongsToSetAssociationMixin<CanonArtist, CanonArtistId>;
28
- createCanonArtist: Sequelize.BelongsToCreateAssociationMixin<CanonArtist>;
29
- static initModel(sequelize: Sequelize.Sequelize): typeof CanonArtistImageHarvested;
30
- }
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CanonArtistImageHarvested = void 0;
4
- const sequelize_1 = require("sequelize");
5
- class CanonArtistImageHarvested extends sequelize_1.Model {
6
- static initModel(sequelize) {
7
- return CanonArtistImageHarvested.init({
8
- dateHarvested: {
9
- type: sequelize_1.DataTypes.DATE,
10
- allowNull: false,
11
- field: 'date_harvested'
12
- },
13
- storageKey: {
14
- type: sequelize_1.DataTypes.STRING(255),
15
- allowNull: false,
16
- field: 'storage_key'
17
- },
18
- harvestMethod: {
19
- type: sequelize_1.DataTypes.STRING(255),
20
- allowNull: true,
21
- field: 'harvest_method'
22
- },
23
- url: {
24
- type: sequelize_1.DataTypes.TEXT,
25
- allowNull: true
26
- },
27
- priority: {
28
- type: sequelize_1.DataTypes.DECIMAL,
29
- allowNull: true,
30
- defaultValue: 0
31
- },
32
- canonArtistId: {
33
- type: sequelize_1.DataTypes.UUID,
34
- allowNull: false,
35
- references: {
36
- model: 'canon_artist',
37
- key: 'id'
38
- },
39
- field: 'canon_artist_id'
40
- },
41
- id: {
42
- type: sequelize_1.DataTypes.UUID,
43
- allowNull: false,
44
- defaultValue: sequelize_1.DataTypes.UUIDV4,
45
- primaryKey: true
46
- }
47
- }, {
48
- sequelize,
49
- tableName: 'canon_artist_image_harvested',
50
- schema: 'eb',
51
- timestamps: false,
52
- indexes: [
53
- {
54
- name: "canon_artist_image_harvested_canon_artist_id_index",
55
- fields: [
56
- { name: "canon_artist_id" },
57
- ]
58
- },
59
- {
60
- name: "canon_artist_image_harvested_pkey",
61
- unique: true,
62
- fields: [
63
- { name: "id" },
64
- ]
65
- },
66
- ]
67
- });
68
- }
69
- }
70
- exports.CanonArtistImageHarvested = CanonArtistImageHarvested;
@@ -1,98 +0,0 @@
1
- import * as Sequelize from 'sequelize';
2
- import { DataTypes, Model, Optional } from 'sequelize';
3
- import type { CanonAlbum, CanonAlbumId } from './CanonAlbum';
4
-
5
- export interface CanonAlbumImageHarvestedAttributes {
6
- dateHarvested: Date;
7
- storageKey: string;
8
- harvestMethod?: string;
9
- priority?: number;
10
- id: string;
11
- url?: string;
12
- canonAlbumId: string;
13
- }
14
-
15
- export type CanonAlbumImageHarvestedPk = "id";
16
- export type CanonAlbumImageHarvestedId = CanonAlbumImageHarvested[CanonAlbumImageHarvestedPk];
17
- export type CanonAlbumImageHarvestedOptionalAttributes = "harvestMethod" | "priority" | "id" | "url";
18
- export type CanonAlbumImageHarvestedCreationAttributes = Optional<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedOptionalAttributes>;
19
-
20
- export class CanonAlbumImageHarvested extends Model<CanonAlbumImageHarvestedAttributes, CanonAlbumImageHarvestedCreationAttributes> implements CanonAlbumImageHarvestedAttributes {
21
- dateHarvested!: Date;
22
- storageKey!: string;
23
- harvestMethod?: string;
24
- priority?: number;
25
- id!: string;
26
- url?: string;
27
- canonAlbumId!: string;
28
-
29
- // CanonAlbumImageHarvested belongsTo CanonAlbum via canonAlbumId
30
- canonAlbum!: CanonAlbum;
31
- getCanonAlbum!: Sequelize.BelongsToGetAssociationMixin<CanonAlbum>;
32
- setCanonAlbum!: Sequelize.BelongsToSetAssociationMixin<CanonAlbum, CanonAlbumId>;
33
- createCanonAlbum!: Sequelize.BelongsToCreateAssociationMixin<CanonAlbum>;
34
-
35
- static initModel(sequelize: Sequelize.Sequelize): typeof CanonAlbumImageHarvested {
36
- return CanonAlbumImageHarvested.init({
37
- dateHarvested: {
38
- type: DataTypes.DATE,
39
- allowNull: false,
40
- field: 'date_harvested'
41
- },
42
- storageKey: {
43
- type: DataTypes.STRING(255),
44
- allowNull: false,
45
- field: 'storage_key'
46
- },
47
- harvestMethod: {
48
- type: DataTypes.STRING(255),
49
- allowNull: true,
50
- field: 'harvest_method'
51
- },
52
- priority: {
53
- type: DataTypes.DECIMAL,
54
- allowNull: true,
55
- defaultValue: 0
56
- },
57
- id: {
58
- type: DataTypes.UUID,
59
- allowNull: false,
60
- defaultValue: DataTypes.UUIDV4,
61
- primaryKey: true
62
- },
63
- url: {
64
- type: DataTypes.TEXT,
65
- allowNull: true
66
- },
67
- canonAlbumId: {
68
- type: DataTypes.UUID,
69
- allowNull: false,
70
- references: {
71
- model: 'canon_album',
72
- key: 'id'
73
- },
74
- field: 'canon_album_id'
75
- }
76
- }, {
77
- sequelize,
78
- tableName: 'canon_album_image_harvested',
79
- schema: 'eb',
80
- timestamps: false,
81
- indexes: [
82
- {
83
- name: "canon_album_image_harvested_canon_album_id_index",
84
- fields: [
85
- { name: "canon_album_id" },
86
- ]
87
- },
88
- {
89
- name: "canon_album_image_harvested_pkey",
90
- unique: true,
91
- fields: [
92
- { name: "id" },
93
- ]
94
- },
95
- ]
96
- });
97
- }
98
- }
@@ -1,98 +0,0 @@
1
- import * as Sequelize from 'sequelize';
2
- import { DataTypes, Model, Optional } from 'sequelize';
3
- import type { CanonArtist, CanonArtistId } from './CanonArtist';
4
-
5
- export interface CanonArtistImageHarvestedAttributes {
6
- dateHarvested: Date;
7
- storageKey: string;
8
- harvestMethod?: string;
9
- url?: string;
10
- priority?: number;
11
- canonArtistId: string;
12
- id: string;
13
- }
14
-
15
- export type CanonArtistImageHarvestedPk = "id";
16
- export type CanonArtistImageHarvestedId = CanonArtistImageHarvested[CanonArtistImageHarvestedPk];
17
- export type CanonArtistImageHarvestedOptionalAttributes = "harvestMethod" | "url" | "priority" | "id";
18
- export type CanonArtistImageHarvestedCreationAttributes = Optional<CanonArtistImageHarvestedAttributes, CanonArtistImageHarvestedOptionalAttributes>;
19
-
20
- export class CanonArtistImageHarvested extends Model<CanonArtistImageHarvestedAttributes, CanonArtistImageHarvestedCreationAttributes> implements CanonArtistImageHarvestedAttributes {
21
- dateHarvested!: Date;
22
- storageKey!: string;
23
- harvestMethod?: string;
24
- url?: string;
25
- priority?: number;
26
- canonArtistId!: string;
27
- id!: string;
28
-
29
- // CanonArtistImageHarvested belongsTo CanonArtist via canonArtistId
30
- canonArtist!: CanonArtist;
31
- getCanonArtist!: Sequelize.BelongsToGetAssociationMixin<CanonArtist>;
32
- setCanonArtist!: Sequelize.BelongsToSetAssociationMixin<CanonArtist, CanonArtistId>;
33
- createCanonArtist!: Sequelize.BelongsToCreateAssociationMixin<CanonArtist>;
34
-
35
- static initModel(sequelize: Sequelize.Sequelize): typeof CanonArtistImageHarvested {
36
- return CanonArtistImageHarvested.init({
37
- dateHarvested: {
38
- type: DataTypes.DATE,
39
- allowNull: false,
40
- field: 'date_harvested'
41
- },
42
- storageKey: {
43
- type: DataTypes.STRING(255),
44
- allowNull: false,
45
- field: 'storage_key'
46
- },
47
- harvestMethod: {
48
- type: DataTypes.STRING(255),
49
- allowNull: true,
50
- field: 'harvest_method'
51
- },
52
- url: {
53
- type: DataTypes.TEXT,
54
- allowNull: true
55
- },
56
- priority: {
57
- type: DataTypes.DECIMAL,
58
- allowNull: true,
59
- defaultValue: 0
60
- },
61
- canonArtistId: {
62
- type: DataTypes.UUID,
63
- allowNull: false,
64
- references: {
65
- model: 'canon_artist',
66
- key: 'id'
67
- },
68
- field: 'canon_artist_id'
69
- },
70
- id: {
71
- type: DataTypes.UUID,
72
- allowNull: false,
73
- defaultValue: DataTypes.UUIDV4,
74
- primaryKey: true
75
- }
76
- }, {
77
- sequelize,
78
- tableName: 'canon_artist_image_harvested',
79
- schema: 'eb',
80
- timestamps: false,
81
- indexes: [
82
- {
83
- name: "canon_artist_image_harvested_canon_artist_id_index",
84
- fields: [
85
- { name: "canon_artist_id" },
86
- ]
87
- },
88
- {
89
- name: "canon_artist_image_harvested_pkey",
90
- unique: true,
91
- fields: [
92
- { name: "id" },
93
- ]
94
- },
95
- ]
96
- });
97
- }
98
- }