@targoninc/lyda-shared 0.0.10 → 0.0.11

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 (73) hide show
  1. package/package.json +3 -2
  2. package/src/Enums/ActivityTableName.ts +12 -0
  3. package/src/Enums/EntityType.ts +5 -0
  4. package/src/Enums/Genre.ts +28 -0
  5. package/src/Enums/InteractionType.ts +5 -0
  6. package/src/Enums/LogLevel.ts +9 -0
  7. package/src/Enums/LoopMode.ts +5 -0
  8. package/src/Enums/MediaFileType.ts +8 -0
  9. package/src/Enums/NotificationReferenceType.ts +6 -0
  10. package/src/Enums/PaymentStatus.ts +6 -0
  11. package/src/Enums/PaypalBatchStatus.ts +7 -0
  12. package/src/Enums/Permissions.ts +15 -0
  13. package/src/Enums/ProgressState.ts +7 -0
  14. package/src/Enums/RoadmapItemStatus.ts +11 -0
  15. package/src/Enums/SearchContext.ts +4 -0
  16. package/src/Enums/StreamingQuality.ts +5 -0
  17. package/src/Enums/SubscriptionStatus.ts +6 -0
  18. package/src/Enums/Theme.ts +5 -0
  19. package/src/Enums/TimeResolution.ts +8 -0
  20. package/src/Enums/UserSettings.ts +12 -0
  21. package/src/Models/Filter.ts +8 -0
  22. package/src/Models/InteractionConfig.ts +9 -0
  23. package/src/Models/InteractionMetadata.ts +5 -0
  24. package/src/Models/Library.ts +9 -0
  25. package/src/Models/Likable.ts +7 -0
  26. package/src/Models/ListTrack.ts +7 -0
  27. package/src/Models/NotifcationPart.ts +5 -0
  28. package/src/Models/NotificationReference.ts +7 -0
  29. package/src/Models/PlayingFrom.ts +5 -0
  30. package/src/Models/ProgressPart.ts +12 -0
  31. package/src/Models/Royalty.ts +23 -0
  32. package/src/Models/RoyaltyInfo.ts +11 -0
  33. package/src/Models/RoyaltyMonth.ts +10 -0
  34. package/src/Models/SearchResult.ts +9 -0
  35. package/src/Models/Statistic.ts +5 -0
  36. package/src/Models/TrackPosition.ts +4 -0
  37. package/src/Models/TypedStatistic.ts +7 -0
  38. package/src/Models/db/finance/AvailableSubscription.ts +10 -0
  39. package/src/Models/db/finance/BillingHistory.ts +8 -0
  40. package/src/Models/db/finance/Expense.ts +9 -0
  41. package/src/Models/db/finance/MonthlyEarning.ts +7 -0
  42. package/src/Models/db/finance/PaymentHistory.ts +14 -0
  43. package/src/Models/db/finance/Payout.ts +11 -0
  44. package/src/Models/db/finance/PaypalBatchPayment.ts +10 -0
  45. package/src/Models/db/finance/PaypalUser.ts +7 -0
  46. package/src/Models/db/finance/PaypalWebhook.ts +9 -0
  47. package/src/Models/db/finance/Product.ts +9 -0
  48. package/src/Models/db/finance/Subscription.ts +18 -0
  49. package/src/Models/db/lyda/Album.ts +25 -0
  50. package/src/Models/db/lyda/AlbumLike.ts +8 -0
  51. package/src/Models/db/lyda/AlbumTrack.ts +10 -0
  52. package/src/Models/db/lyda/Badge.ts +5 -0
  53. package/src/Models/db/lyda/CollaboratorType.ts +7 -0
  54. package/src/Models/db/lyda/Comment.ts +17 -0
  55. package/src/Models/db/lyda/Follow.ts +5 -0
  56. package/src/Models/db/lyda/ListeningHistory.ts +7 -0
  57. package/src/Models/db/lyda/Log.ts +10 -0
  58. package/src/Models/db/lyda/Notification.ts +13 -0
  59. package/src/Models/db/lyda/Permission.ts +7 -0
  60. package/src/Models/db/lyda/Playlist.ts +25 -0
  61. package/src/Models/db/lyda/PlaylistLike.ts +8 -0
  62. package/src/Models/db/lyda/PlaylistTrack.ts +10 -0
  63. package/src/Models/db/lyda/PossibleUsersetting.ts +5 -0
  64. package/src/Models/db/lyda/Repost.ts +8 -0
  65. package/src/Models/db/lyda/Track.ts +45 -0
  66. package/src/Models/db/lyda/TrackCollaborator.ts +16 -0
  67. package/src/Models/db/lyda/TrackLike.ts +8 -0
  68. package/src/Models/db/lyda/User.ts +38 -0
  69. package/src/Models/db/lyda/UserBadge.ts +5 -0
  70. package/src/Models/db/lyda/UserEmail.ts +8 -0
  71. package/src/Models/db/lyda/UserPermission.ts +5 -0
  72. package/src/Models/db/lyda/Usersetting.ts +7 -0
  73. package/src/index.ts +1 -0
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@targoninc/lyda-shared",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
- "dist"
8
+ "dist",
9
+ "src"
9
10
  ],
10
11
  "publishConfig": {
11
12
  "access": "public"
@@ -0,0 +1,12 @@
1
+ export enum ActivityTableName {
2
+ tracks = "tracks",
3
+ albums = "albums",
4
+ playlists = "playlists",
5
+ reposts = "reposts",
6
+ tracklikes = "tracklikes",
7
+ albumlikes = "albumlikes",
8
+ playlistlikes = "playlistlikes",
9
+ comments = "comments",
10
+ follows = "follows",
11
+ streams = "listeninghistory",
12
+ }
@@ -0,0 +1,5 @@
1
+ export enum EntityType {
2
+ track = "track",
3
+ album = "album",
4
+ playlist = "playlist",
5
+ }
@@ -0,0 +1,28 @@
1
+ export enum Genre
2
+ {
3
+ ROCK = 'rock',
4
+ POP = 'pop',
5
+ RAP = 'rap',
6
+ COUNTRY = 'country',
7
+ JAZZ = 'jazz',
8
+ METAL = 'metal',
9
+ CLASSICAL = 'classical',
10
+ BLUES = 'blues',
11
+ REGGAE = 'reggae',
12
+ FOLK = 'folk',
13
+ ELECTRONIC = 'electronic',
14
+ HIP_HOP = 'hip-hop',
15
+ SOUL = 'soul',
16
+ PUNK = 'punk',
17
+ R_AND_B = 'r&b',
18
+ FUNK = 'funk',
19
+ DISCO = 'disco',
20
+ HOUSE = 'house',
21
+ TECHNO = 'techno',
22
+ TRANCE = 'trance',
23
+ DUBSTEP = 'dubstep',
24
+ DANCE = 'dance',
25
+ INDIE = 'indie',
26
+ ALTERNATIVE = 'alternative',
27
+ OTHER = 'other',
28
+ }
@@ -0,0 +1,5 @@
1
+ export enum InteractionType {
2
+ like = 'like',
3
+ repost = 'repost',
4
+ comment = 'comment',
5
+ }
@@ -0,0 +1,9 @@
1
+ export enum LogLevel {
2
+ debug = 0,
3
+ success = 1,
4
+ info = 2,
5
+ warning = 3,
6
+ error = 4,
7
+ critical = 5,
8
+ unknown = 6,
9
+ }
@@ -0,0 +1,5 @@
1
+ export enum LoopMode {
2
+ off = "off",
3
+ single = "single",
4
+ context = "context"
5
+ }
@@ -0,0 +1,8 @@
1
+ export enum MediaFileType {
2
+ audio = "audio",
3
+ trackCover = "trackCover",
4
+ albumCover = "albumCover",
5
+ playlistCover = "playlistCover",
6
+ userAvatar = "userAvatar",
7
+ userBanner = "userBanner",
8
+ }
@@ -0,0 +1,6 @@
1
+ export enum NotificationReferenceType {
2
+ user = "u",
3
+ track = "t",
4
+ album = "a",
5
+ playlist = "p"
6
+ }
@@ -0,0 +1,6 @@
1
+ export enum PaymentStatus {
2
+ requested = "requested",
3
+ paid = "paid",
4
+ failed = "failed",
5
+ processing = "processing",
6
+ }
@@ -0,0 +1,7 @@
1
+ export enum PaypalBatchStatus {
2
+ DENIED = "DENIED",
3
+ PENDING = "PENDING",
4
+ PROCESSING = "PROCESSING",
5
+ SUCCESS = "SUCCESS",
6
+ CANCELLED = "CANCELLED",
7
+ }
@@ -0,0 +1,15 @@
1
+ export enum Permissions {
2
+ canDeleteComments = 'canDeleteComments',
3
+ canEditListsOfOthers = 'canEditListsOfOthers',
4
+ canEditTracksOfOthers = 'canEditTracksOfOthers',
5
+ canBan = 'canBan',
6
+ canDeleteTracksOfOthers = 'canDeleteTracksOfOthers',
7
+ canDeleteListsOfOthers = 'canDeleteListsOfOthers',
8
+ canCalculateRoyalties = 'canCalculateRoyalties',
9
+ canVerifyUsers = 'canVerifyUsers',
10
+ canViewLogs = 'canViewLogs',
11
+ canViewActionLogs = 'canViewActionLogs',
12
+ canTriggerEventHandling = "canTriggerEventHandling",
13
+ canSetPermissions = "canSetPermissions",
14
+ canViewPayments = "canViewPayments",
15
+ }
@@ -0,0 +1,7 @@
1
+ export enum ProgressState {
2
+ notStarted = "notStarted",
3
+ inProgress = "inProgress",
4
+ complete = "complete",
5
+ error = "error",
6
+ cancelled = "cancelled",
7
+ }
@@ -0,0 +1,11 @@
1
+ export enum RoadmapItemStatus {
2
+ todo = "todo",
3
+ inProgress = "inProgress",
4
+ done = "done",
5
+ }
6
+
7
+ export const roadMapItemIcons: Record<RoadmapItemStatus, string> = {
8
+ [RoadmapItemStatus.todo]: "hourglass_empty",
9
+ [RoadmapItemStatus.inProgress]: "progress_activity",
10
+ [RoadmapItemStatus.done]: "check",
11
+ };
@@ -0,0 +1,4 @@
1
+ export enum SearchContext {
2
+ navBar,
3
+ searchPage
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum StreamingQuality {
2
+ low = "l",
3
+ medium = "m",
4
+ high = "h",
5
+ }
@@ -0,0 +1,6 @@
1
+ export enum SubscriptionStatus {
2
+ created = 0,
3
+ pending = 1,
4
+ active = 2,
5
+ cancelled = 3,
6
+ }
@@ -0,0 +1,5 @@
1
+ export enum Theme {
2
+ light = 'light',
3
+ dark = 'dark',
4
+ flexoki = 'flexoki',
5
+ }
@@ -0,0 +1,8 @@
1
+ export enum TimeResolution {
2
+ second = "second",
3
+ minute = "minute",
4
+ hour = "hour",
5
+ day = "day",
6
+ month = "month",
7
+ year = "year",
8
+ }
@@ -0,0 +1,12 @@
1
+ export const UserSettings = {
2
+ notificationCollaboration: "notification_collaboration",
3
+ notificationComment: "notification_comment",
4
+ notificationFollow: "notification_follow",
5
+ notificationLike: "notification_like",
6
+ notificationRepost: "notification_repost",
7
+ paypalMail: "paypalMail",
8
+ publicLikes: "publicLikes",
9
+ theme: "theme",
10
+ streamingQuality: "streamingQuality",
11
+ playFromAutoQueue: "playFromAutoQueue",
12
+ };
@@ -0,0 +1,8 @@
1
+ import {InputType} from "@targoninc/jess";
2
+
3
+ export interface Filter {
4
+ key: string;
5
+ name: string;
6
+ type: InputType;
7
+ default?: any;
8
+ }
@@ -0,0 +1,9 @@
1
+ export interface InteractionConfig {
2
+ toggleable?: boolean;
3
+ icons: {
4
+ default: string;
5
+ interacted: string;
6
+ }
7
+ requiredOptions?: string[];
8
+ optionalOptions?: string[];
9
+ }
@@ -0,0 +1,5 @@
1
+ export interface InteractionMetadata<T> {
2
+ count?: number;
3
+ interacted?: boolean;
4
+ list?: T[];
5
+ }
@@ -0,0 +1,9 @@
1
+ import {Track} from "./db/lyda/Track.ts";
2
+ import {Album} from "./db/lyda/Album.ts";
3
+ import {Playlist} from "./db/lyda/Playlist.ts";
4
+
5
+ export interface Library {
6
+ tracks: Track[];
7
+ albums: Album[];
8
+ playlists: Playlist[];
9
+ }
@@ -0,0 +1,7 @@
1
+ import {TrackLike} from "./db/lyda/TrackLike.ts";
2
+ import {AlbumLike} from "./db/lyda/AlbumLike.ts";
3
+ import {PlaylistLike} from "./db/lyda/PlaylistLike.ts";
4
+
5
+ export interface Likable {
6
+ likes?: (TrackLike | AlbumLike | PlaylistLike)[];
7
+ }
@@ -0,0 +1,7 @@
1
+ import {Track} from "./db/lyda/Track.ts";
2
+
3
+ export interface ListTrack {
4
+ track_id: number;
5
+ position: number;
6
+ track?: Track;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface NotificationPart {
2
+ type: string,
3
+ text?: string,
4
+ id?: number
5
+ }
@@ -0,0 +1,7 @@
1
+ import {NotificationReferenceType} from "../Enums/NotificationReferenceType.ts";
2
+
3
+ export interface NotificationReference {
4
+ type: NotificationReferenceType;
5
+ id: number;
6
+ object?: any;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface PlayingFrom {
2
+ type: "album" | "playlist" | string;
3
+ name: string;
4
+ id: number;
5
+ }
@@ -0,0 +1,12 @@
1
+ import {ProgressState} from "../Enums/ProgressState.ts";
2
+ import {Signal, StringOrSignal} from "@targoninc/jess";
3
+
4
+ export interface ProgressPart {
5
+ id: string;
6
+ icon: string;
7
+ text: Signal<string>;
8
+ state: Signal<ProgressState>;
9
+ title?: StringOrSignal;
10
+ retryFunction?: Function;
11
+ progress?: Signal<number>;
12
+ }
@@ -0,0 +1,23 @@
1
+ export interface Royalty {
2
+ period1: string;
3
+ label: string;
4
+ releasename: string;
5
+ releaseartists: string;
6
+ upc: string;
7
+ catalogue: string;
8
+ title: string;
9
+ mixver: string;
10
+ isrc: string;
11
+ trackartists: string;
12
+ provider: string;
13
+ period2: string;
14
+ territory: string;
15
+ delivery: string;
16
+ type: string;
17
+ salevoid: string;
18
+ count: number;
19
+ royalty: number;
20
+ dataprovider: string;
21
+ updated_at: Date;
22
+ id: number;
23
+ }
@@ -0,0 +1,11 @@
1
+ import {RoyaltyMonth} from "./RoyaltyMonth.ts";
2
+
3
+ export interface RoyaltyInfo {
4
+ calculatableMonths: RoyaltyMonth[];
5
+ trackRoyaltyValues: any;
6
+ meanTrackRoyalty: number;
7
+ paidTotal: number;
8
+ available: number,
9
+ totalRoyalties: number,
10
+ paypalMail: string | null,
11
+ }
@@ -0,0 +1,10 @@
1
+ export interface RoyaltyMonth {
2
+ month: number;
3
+ year: number;
4
+ hasEarnings: boolean;
5
+ earnings: number;
6
+ artistRoyalties: number;
7
+ trackRoyalties: number;
8
+ calculated: boolean;
9
+ approved: boolean;
10
+ }
@@ -0,0 +1,9 @@
1
+ export interface SearchResult {
2
+ id: number;
3
+ url: string;
4
+ exactMatch: boolean;
5
+ type: string;
6
+ display: string;
7
+ subtitle?: string;
8
+ hasImage?: boolean;
9
+ }
@@ -0,0 +1,5 @@
1
+ export interface Statistic {
2
+ id: any,
3
+ label: string,
4
+ value: number,
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface TrackPosition {
2
+ relative: number;
3
+ absolute: number;
4
+ }
@@ -0,0 +1,7 @@
1
+ import {Statistic} from "./Statistic.js";
2
+ import {ActivityTableName} from "../Enums/ActivityTableName.ts";
3
+
4
+ export interface TypedStatistic {
5
+ type: ActivityTableName,
6
+ stats: Statistic[]
7
+ }
@@ -0,0 +1,10 @@
1
+ export interface AvailableSubscription {
2
+ id: number;
3
+ product_id: number;
4
+ name: string;
5
+ description: string;
6
+ service: string;
7
+ plan_id: string;
8
+ term_type: string;
9
+ price_per_term: number;
10
+ }
@@ -0,0 +1,8 @@
1
+ export interface BillingHistory {
2
+ id: number;
3
+ user_id: number;
4
+ product_id: number;
5
+ billing_type: string;
6
+ amount: number;
7
+ created_at: Date;
8
+ }
@@ -0,0 +1,9 @@
1
+ export interface Expense {
2
+ id: bigint;
3
+ year: number;
4
+ month: number;
5
+ day: number;
6
+ amount_ct: number;
7
+ label: string;
8
+ expense_group: string;
9
+ }
@@ -0,0 +1,7 @@
1
+ export interface MonthlyEarning {
2
+ id: number;
3
+ generated_at: Date;
4
+ month: string;
5
+ amount: number;
6
+ product_id: number;
7
+ }
@@ -0,0 +1,14 @@
1
+ export interface PaymentHistory {
2
+ id: number;
3
+ received_at: Date;
4
+ user_id: number;
5
+ product_id: number;
6
+ subscription_id: number;
7
+ currency: string;
8
+ payment_processor: string;
9
+ external_id: string;
10
+ total: number;
11
+ fees: number;
12
+ received: number;
13
+ succeeded: boolean;
14
+ }
@@ -0,0 +1,11 @@
1
+ import {PaymentStatus} from "../../../Enums/PaymentStatus.ts";
2
+
3
+ export interface Payout {
4
+ id: number;
5
+ payout_batch_id: string;
6
+ user_id: number;
7
+ amount_ct: number;
8
+ status: PaymentStatus;
9
+ created_at: Date;
10
+ updated_at: Date;
11
+ }
@@ -0,0 +1,10 @@
1
+ import {PaypalBatchStatus} from "../../../Enums/PaypalBatchStatus.ts";
2
+
3
+ export interface PaypalBatchPayment {
4
+ id: number;
5
+ paypal_batch_id: string;
6
+ request_items_json: string;
7
+ paypal_batch_status: PaypalBatchStatus;
8
+ created_at: Date;
9
+ updated_at: Date;
10
+ }
@@ -0,0 +1,7 @@
1
+ export interface PaypalUser {
2
+ paypal_user_id: string;
3
+ user_id: number;
4
+ given_name: string;
5
+ surname: string;
6
+ email_address: string;
7
+ }
@@ -0,0 +1,9 @@
1
+ export interface PaypalWebhook {
2
+ id: string;
3
+ type: string;
4
+ received_at: Date;
5
+ content: string;
6
+ paypal_user_id: string;
7
+ handled: boolean;
8
+ updated_at: Date;
9
+ }
@@ -0,0 +1,9 @@
1
+ export interface Product {
2
+ id: number;
3
+ name: string;
4
+ description: string;
5
+ available: boolean;
6
+ image: string;
7
+ link: string;
8
+ url: string;
9
+ }
@@ -0,0 +1,18 @@
1
+ import {SubscriptionStatus} from "../../../Enums/SubscriptionStatus.ts";
2
+
3
+ export interface Subscription {
4
+ id: number;
5
+ user_id: number;
6
+ subscription_id: number;
7
+ status: SubscriptionStatus;
8
+ created_at: Date;
9
+ updated_at: Date;
10
+ cancelled_at: Date;
11
+ previous_subscription: number;
12
+ external_subscription_id: string;
13
+ external_order_id: string;
14
+ gifted_by_user_id: number;
15
+ next_billing_time: Date;
16
+ outstanding_balance: string;
17
+ currency_code: string;
18
+ }
@@ -0,0 +1,25 @@
1
+ import {User} from "./User.js";
2
+ import {AlbumTrack} from "./AlbumTrack.js";
3
+ import {Entity} from "@targoninc/ts-search";
4
+ import {InteractionMetadata} from "../../InteractionMetadata.ts";
5
+ import {TrackLike} from "./TrackLike.ts";
6
+
7
+ export interface Album extends Entity {
8
+ tracks?: AlbumTrack[];
9
+ user?: User;
10
+ id: number;
11
+ user_id: number;
12
+ title: string;
13
+ description: string;
14
+ upc: string;
15
+ release_date: Date;
16
+ created_at: Date;
17
+ updated_at: Date;
18
+ visibility: string;
19
+ secretcode: string;
20
+ has_cover: boolean;
21
+ price: number;
22
+ likes?: InteractionMetadata<TrackLike>;
23
+ /*reposts?: InteractionMetadata<Repost>;
24
+ comments?: InteractionMetadata<Comment>;*/
25
+ }
@@ -0,0 +1,8 @@
1
+ import {User} from "./User.js";
2
+
3
+ export interface AlbumLike {
4
+ user?: User;
5
+ user_id: number;
6
+ album_id: number;
7
+ created_at: Date;
8
+ }
@@ -0,0 +1,10 @@
1
+ import {Track} from "./Track.js";
2
+
3
+ export interface AlbumTrack {
4
+ track?: Track;
5
+ album_id: number;
6
+ track_id: number;
7
+ user_id: number;
8
+ position: number;
9
+ created_at: Date;
10
+ }
@@ -0,0 +1,5 @@
1
+ export interface Badge {
2
+ id: number;
3
+ name: string;
4
+ description: string;
5
+ }
@@ -0,0 +1,7 @@
1
+ export interface CollaboratorType {
2
+ id: number;
3
+ name: string;
4
+ description: string;
5
+ created_at: Date;
6
+ updated_at: Date;
7
+ }
@@ -0,0 +1,17 @@
1
+ import {User} from "./User.js";
2
+ import {Track} from "./Track.js";
3
+
4
+ export interface Comment {
5
+ comments?: Comment[];
6
+ user?: User;
7
+ track?: Track;
8
+ canEdit?: boolean;
9
+ id: number;
10
+ parent_id: number;
11
+ track_id: number;
12
+ user_id: number;
13
+ content: string;
14
+ created_at: Date;
15
+ potentially_harmful: boolean;
16
+ hidden: boolean;
17
+ }
@@ -0,0 +1,5 @@
1
+ export interface Follow {
2
+ user_id: number;
3
+ following_user_id: number;
4
+ created_at: Date;
5
+ }
@@ -0,0 +1,7 @@
1
+ export interface ListeningHistory {
2
+ id: number;
3
+ user_id: number;
4
+ track_id: number;
5
+ quality: string;
6
+ created_at: Date;
7
+ }
@@ -0,0 +1,10 @@
1
+ export interface Log {
2
+ id: number;
3
+ correlation_id: string;
4
+ time: string;
5
+ host: string;
6
+ stack: string;
7
+ logLevel: number;
8
+ message: string;
9
+ properties: string;
10
+ }
@@ -0,0 +1,13 @@
1
+ import {NotificationReference} from "../../NotificationReference.ts";
2
+
3
+ export interface Notification {
4
+ references?: NotificationReference[];
5
+ id: number;
6
+ user_id: number;
7
+ track_id: number;
8
+ type: string;
9
+ search_key: string;
10
+ message: string;
11
+ is_read: boolean;
12
+ created_at: Date;
13
+ }
@@ -0,0 +1,7 @@
1
+ export interface Permission {
2
+ id: number;
3
+ name: string;
4
+ description: string;
5
+ created_at: Date;
6
+ updated_at: Date;
7
+ }
@@ -0,0 +1,25 @@
1
+ import {User} from "./User.js";
2
+ import {PlaylistLike} from "./PlaylistLike.js";
3
+ import {Entity} from "@targoninc/ts-search";
4
+ import {PlaylistTrack} from "./PlaylistTrack.ts";
5
+ import {InteractionMetadata} from "../../InteractionMetadata.ts";
6
+ import {TrackLike} from "./TrackLike.ts";
7
+ import {Repost} from "./Repost.ts";
8
+ import {Comment} from "./Comment.ts";
9
+
10
+ export interface Playlist extends Entity {
11
+ tracks?: PlaylistTrack[];
12
+ user?: User;
13
+ id: number;
14
+ user_id: number;
15
+ title: string;
16
+ description: string;
17
+ created_at: Date;
18
+ updated_at: Date;
19
+ visibility: string;
20
+ has_cover: boolean;
21
+ secretcode: string;
22
+ likes?: InteractionMetadata<TrackLike>;
23
+ /*reposts?: InteractionMetadata<Repost>;
24
+ comments?: InteractionMetadata<Comment>;*/
25
+ }
@@ -0,0 +1,8 @@
1
+ import {User} from "./User.js";
2
+
3
+ export interface PlaylistLike {
4
+ user_id: number;
5
+ playlist_id: number;
6
+ created_at: Date;
7
+ user?: User;
8
+ }
@@ -0,0 +1,10 @@
1
+ import {Track} from "./Track.js";
2
+
3
+ export interface PlaylistTrack {
4
+ playlist_id: number;
5
+ track_id: number;
6
+ user_id: number;
7
+ position: number;
8
+ created_at: Date;
9
+ track?: Track;
10
+ }
@@ -0,0 +1,5 @@
1
+ export interface PossibleUsersetting {
2
+ name: string;
3
+ description: string;
4
+ type: string;
5
+ }
@@ -0,0 +1,8 @@
1
+ import {User} from "./User.js";
2
+
3
+ export interface Repost {
4
+ user?: User;
5
+ user_id: number;
6
+ track_id: number;
7
+ created_at: Date;
8
+ }
@@ -0,0 +1,45 @@
1
+ import {TrackLike} from "./TrackLike.js";
2
+ import {Album} from "./Album.js";
3
+ import {Playlist} from "./Playlist.js";
4
+ import {Notification} from "./Notification.js";
5
+ import {Comment} from "./Comment.js";
6
+ import {TrackCollaborator} from "./TrackCollaborator.js";
7
+ import {User} from "./User.js";
8
+ import {Repost} from "./Repost.js";
9
+ import {InteractionMetadata} from "../../InteractionMetadata.ts";
10
+ import {Entity} from "@targoninc/ts-search";
11
+
12
+ export interface Track extends Entity {
13
+ repost_user_id?: number;
14
+ repost?: Repost;
15
+ user?: User;
16
+ playlists?: Playlist[];
17
+ albums?: Album[];
18
+ notifications?: Notification[];
19
+ collaborators?: TrackCollaborator[];
20
+ user_id: number;
21
+ title: string;
22
+ isrc: string;
23
+ artistname: string;
24
+ upc: string;
25
+ visibility: string;
26
+ credits: string;
27
+ loudness_data: string;
28
+ genre: string;
29
+ version: string;
30
+ versionid: number;
31
+ length: number;
32
+ description: string;
33
+ release_date: Date;
34
+ updated_at: Date;
35
+ created_at: Date;
36
+ plays: number;
37
+ secretcode: string;
38
+ monetization: boolean;
39
+ price: number;
40
+ has_cover: boolean;
41
+ processed: boolean;
42
+ likes?: InteractionMetadata<TrackLike>;
43
+ reposts?: InteractionMetadata<Repost>;
44
+ comments?: InteractionMetadata<Comment>;
45
+ }
@@ -0,0 +1,16 @@
1
+ import {User} from "./User.js";
2
+ import {CollaboratorType} from "./CollaboratorType.js";
3
+ import {Track} from "./Track.ts";
4
+
5
+ export interface TrackCollaborator {
6
+ collab_type?: CollaboratorType;
7
+ track?: Track;
8
+ user?: User;
9
+ track_id: number;
10
+ user_id: number;
11
+ type: number;
12
+ approved: boolean;
13
+ denied: boolean;
14
+ created_at: Date;
15
+ updated_at: Date;
16
+ }
@@ -0,0 +1,8 @@
1
+ import {User} from "./User.js";
2
+
3
+ export interface TrackLike {
4
+ user?: User;
5
+ user_id: number;
6
+ track_id: number;
7
+ created_at: Date;
8
+ }
@@ -0,0 +1,38 @@
1
+ import {Follow} from "./Follow.js";
2
+ import {UserBadge} from "./UserBadge.js";
3
+ import {Usersetting} from "./Usersetting.js";
4
+ import {Badge} from "./Badge.js";
5
+ import {Subscription} from "../finance/Subscription.js";
6
+ import {UserEmail} from "./UserEmail.js";
7
+ import {Permission} from "./Permission.js";
8
+ import {Entity} from "@targoninc/ts-search";
9
+
10
+ export interface User extends Entity {
11
+ permissions?: Permission[];
12
+ subscription?: Subscription;
13
+ settings?: Usersetting[];
14
+ badges?: Badge[];
15
+ userBadges?: UserBadge[];
16
+ follows?: Follow[];
17
+ following?: Follow[];
18
+ id: number;
19
+ username: string;
20
+ mfa_enabled: boolean;
21
+ emails: UserEmail[];
22
+ password_hash: string;
23
+ displayname: string;
24
+ description: string;
25
+ password_token: string|null;
26
+ verified: boolean;
27
+ verification_status: string;
28
+ created_at: Date;
29
+ updated_at: Date;
30
+ deleted_at: Date;
31
+ lastlogin?: Date;
32
+ secondlastlogin?: Date;
33
+ password_updated_at: Date;
34
+ tos_agreed_at: Date;
35
+ ip: string;
36
+ has_avatar: boolean;
37
+ has_banner: boolean;
38
+ }
@@ -0,0 +1,5 @@
1
+ export interface UserBadge {
2
+ user_id: number;
3
+ badge_id: number;
4
+ given_at: Date;
5
+ }
@@ -0,0 +1,8 @@
1
+ export interface UserEmail {
2
+ user_id: number;
3
+ email: string;
4
+ primary: boolean;
5
+ verification_code: string;
6
+ verified: boolean;
7
+ verified_at: Date|null;
8
+ }
@@ -0,0 +1,5 @@
1
+ export interface UserPermission {
2
+ user_id: number;
3
+ permission_id: number;
4
+ created_at: Date;
5
+ }
@@ -0,0 +1,7 @@
1
+ export interface Usersetting {
2
+ user_id: number;
3
+ key: string;
4
+ value: string;
5
+ created_at: Date;
6
+ updated_at: Date;
7
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ // your exports here