@targoninc/lyda-shared 0.0.2

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 (77) hide show
  1. package/dist/Enums/ActivityTableName.d.ts +12 -0
  2. package/dist/Enums/EntityType.d.ts +5 -0
  3. package/dist/Enums/Genre.d.ts +27 -0
  4. package/dist/Enums/InteractionType.d.ts +5 -0
  5. package/dist/Enums/LogLevel.d.ts +9 -0
  6. package/dist/Enums/LoopMode.d.ts +5 -0
  7. package/dist/Enums/MediaFileType.d.ts +8 -0
  8. package/dist/Enums/NotificationReferenceType.d.ts +6 -0
  9. package/dist/Enums/NotificationType.d.ts +6 -0
  10. package/dist/Enums/PaymentStatus.d.ts +6 -0
  11. package/dist/Enums/PaypalBatchStatus.d.ts +7 -0
  12. package/dist/Enums/Permissions.d.ts +15 -0
  13. package/dist/Enums/ProgressState.d.ts +7 -0
  14. package/dist/Enums/RoadmapItemStatus.d.ts +6 -0
  15. package/dist/Enums/SearchContext.d.ts +4 -0
  16. package/dist/Enums/StreamingQuality.d.ts +5 -0
  17. package/dist/Enums/SubscriptionStatus.d.ts +6 -0
  18. package/dist/Enums/Theme.d.ts +5 -0
  19. package/dist/Enums/TimeResolution.d.ts +8 -0
  20. package/dist/Enums/UserSettings.d.ts +12 -0
  21. package/dist/Enums/UserWidgetContext.d.ts +9 -0
  22. package/dist/Models/Filter.d.ts +7 -0
  23. package/dist/Models/InteractionConfig.d.ts +13 -0
  24. package/dist/Models/InteractionMetadata.d.ts +5 -0
  25. package/dist/Models/Library.d.ts +8 -0
  26. package/dist/Models/Likable.d.ts +6 -0
  27. package/dist/Models/ListTrack.d.ts +6 -0
  28. package/dist/Models/NotifcationPart.d.ts +5 -0
  29. package/dist/Models/NotificationReference.d.ts +6 -0
  30. package/dist/Models/PillOption.d.ts +6 -0
  31. package/dist/Models/PlayingFrom.d.ts +5 -0
  32. package/dist/Models/ProgressPart.d.ts +11 -0
  33. package/dist/Models/Royalty.d.ts +23 -0
  34. package/dist/Models/RoyaltyInfo.d.ts +10 -0
  35. package/dist/Models/RoyaltyMonth.d.ts +10 -0
  36. package/dist/Models/SearchResult.d.ts +9 -0
  37. package/dist/Models/Statistic.d.ts +5 -0
  38. package/dist/Models/TrackPosition.d.ts +4 -0
  39. package/dist/Models/TypedStatistic.d.ts +6 -0
  40. package/dist/Models/db/finance/AvailableSubscription.d.ts +10 -0
  41. package/dist/Models/db/finance/BillingHistory.d.ts +8 -0
  42. package/dist/Models/db/finance/Expense.d.ts +9 -0
  43. package/dist/Models/db/finance/MonthlyEarning.d.ts +7 -0
  44. package/dist/Models/db/finance/PaymentHistory.d.ts +14 -0
  45. package/dist/Models/db/finance/Payout.d.ts +10 -0
  46. package/dist/Models/db/finance/PaypalBatchPayment.d.ts +9 -0
  47. package/dist/Models/db/finance/PaypalUser.d.ts +7 -0
  48. package/dist/Models/db/finance/PaypalWebhook.d.ts +9 -0
  49. package/dist/Models/db/finance/Product.d.ts +9 -0
  50. package/dist/Models/db/finance/Subscription.d.ts +17 -0
  51. package/dist/Models/db/lyda/Album.d.ts +22 -0
  52. package/dist/Models/db/lyda/AlbumLike.d.ts +7 -0
  53. package/dist/Models/db/lyda/AlbumTrack.d.ts +9 -0
  54. package/dist/Models/db/lyda/Badge.d.ts +5 -0
  55. package/dist/Models/db/lyda/CollaboratorType.d.ts +7 -0
  56. package/dist/Models/db/lyda/Comment.d.ts +15 -0
  57. package/dist/Models/db/lyda/Follow.d.ts +5 -0
  58. package/dist/Models/db/lyda/ListeningHistory.d.ts +7 -0
  59. package/dist/Models/db/lyda/Log.d.ts +10 -0
  60. package/dist/Models/db/lyda/Notification.d.ts +12 -0
  61. package/dist/Models/db/lyda/Permission.d.ts +7 -0
  62. package/dist/Models/db/lyda/Playlist.d.ts +19 -0
  63. package/dist/Models/db/lyda/PlaylistLike.d.ts +7 -0
  64. package/dist/Models/db/lyda/PlaylistTrack.d.ts +9 -0
  65. package/dist/Models/db/lyda/PossibleUsersetting.d.ts +5 -0
  66. package/dist/Models/db/lyda/Repost.d.ts +7 -0
  67. package/dist/Models/db/lyda/Track.d.ts +44 -0
  68. package/dist/Models/db/lyda/TrackCollaborator.d.ts +13 -0
  69. package/dist/Models/db/lyda/TrackLike.d.ts +7 -0
  70. package/dist/Models/db/lyda/User.d.ts +37 -0
  71. package/dist/Models/db/lyda/UserBadge.d.ts +5 -0
  72. package/dist/Models/db/lyda/UserEmail.d.ts +8 -0
  73. package/dist/Models/db/lyda/UserPermission.d.ts +5 -0
  74. package/dist/Models/db/lyda/Usersetting.d.ts +7 -0
  75. package/dist/index.d.ts +1 -0
  76. package/dist/index.js +1 -0
  77. package/package.json +33 -0
@@ -0,0 +1,12 @@
1
+ export declare 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 declare enum EntityType {
2
+ track = "track",
3
+ album = "album",
4
+ playlist = "playlist"
5
+ }
@@ -0,0 +1,27 @@
1
+ export declare enum Genre {
2
+ ROCK = "rock",
3
+ POP = "pop",
4
+ RAP = "rap",
5
+ COUNTRY = "country",
6
+ JAZZ = "jazz",
7
+ METAL = "metal",
8
+ CLASSICAL = "classical",
9
+ BLUES = "blues",
10
+ REGGAE = "reggae",
11
+ FOLK = "folk",
12
+ ELECTRONIC = "electronic",
13
+ HIP_HOP = "hip-hop",
14
+ SOUL = "soul",
15
+ PUNK = "punk",
16
+ R_AND_B = "r&b",
17
+ FUNK = "funk",
18
+ DISCO = "disco",
19
+ HOUSE = "house",
20
+ TECHNO = "techno",
21
+ TRANCE = "trance",
22
+ DUBSTEP = "dubstep",
23
+ DANCE = "dance",
24
+ INDIE = "indie",
25
+ ALTERNATIVE = "alternative",
26
+ OTHER = "other"
27
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum InteractionType {
2
+ like = "like",
3
+ repost = "repost",
4
+ comment = "comment"
5
+ }
@@ -0,0 +1,9 @@
1
+ export declare 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 declare enum LoopMode {
2
+ off = "off",
3
+ single = "single",
4
+ context = "context"
5
+ }
@@ -0,0 +1,8 @@
1
+ export declare 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 declare enum NotificationReferenceType {
2
+ user = "u",
3
+ track = "t",
4
+ album = "a",
5
+ playlist = "p"
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum NotificationType {
2
+ info = "info",
3
+ success = "success",
4
+ warning = "warning",
5
+ error = "error"
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum PaymentStatus {
2
+ requested = "requested",
3
+ paid = "paid",
4
+ failed = "failed",
5
+ processing = "processing"
6
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum PaypalBatchStatus {
2
+ DENIED = "DENIED",
3
+ PENDING = "PENDING",
4
+ PROCESSING = "PROCESSING",
5
+ SUCCESS = "SUCCESS",
6
+ CANCELLED = "CANCELLED"
7
+ }
@@ -0,0 +1,15 @@
1
+ export declare 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 declare enum ProgressState {
2
+ notStarted = "notStarted",
3
+ inProgress = "inProgress",
4
+ complete = "complete",
5
+ error = "error",
6
+ cancelled = "cancelled"
7
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum RoadmapItemStatus {
2
+ todo = "todo",
3
+ inProgress = "inProgress",
4
+ done = "done"
5
+ }
6
+ export declare const roadMapItemIcons: Record<RoadmapItemStatus, string>;
@@ -0,0 +1,4 @@
1
+ export declare enum SearchContext {
2
+ navBar = 0,
3
+ searchPage = 1
4
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum StreamingQuality {
2
+ low = "l",
3
+ medium = "m",
4
+ high = "h"
5
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum SubscriptionStatus {
2
+ created = 0,
3
+ pending = 1,
4
+ active = 2,
5
+ cancelled = 3
6
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum Theme {
2
+ light = "light",
3
+ dark = "dark",
4
+ flexoki = "flexoki"
5
+ }
@@ -0,0 +1,8 @@
1
+ export declare 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 declare const UserSettings: {
2
+ notificationCollaboration: string;
3
+ notificationComment: string;
4
+ notificationFollow: string;
5
+ notificationLike: string;
6
+ notificationRepost: string;
7
+ paypalMail: string;
8
+ publicLikes: string;
9
+ theme: string;
10
+ streamingQuality: string;
11
+ playFromAutoQueue: string;
12
+ };
@@ -0,0 +1,9 @@
1
+ export declare enum UserWidgetContext {
2
+ nav = 0,
3
+ singlePage = 1,
4
+ list = 2,
5
+ player = 3,
6
+ card = 4,
7
+ comment = 5,
8
+ unknown = 6
9
+ }
@@ -0,0 +1,7 @@
1
+ import { InputType } from "@targoninc/jess";
2
+ export interface Filter {
3
+ key: string;
4
+ name: string;
5
+ type: InputType;
6
+ default?: any;
7
+ }
@@ -0,0 +1,13 @@
1
+ import { InteractionType } from "../Enums/InteractionType.ts";
2
+ import { EntityType } from "../Enums/EntityType.ts";
3
+ export interface InteractionConfig {
4
+ type: InteractionType;
5
+ entityType: EntityType;
6
+ toggleable?: boolean;
7
+ icons: {
8
+ default: string;
9
+ interacted: string;
10
+ };
11
+ requiredOptions?: string[];
12
+ optionalOptions?: string[];
13
+ }
@@ -0,0 +1,5 @@
1
+ export interface InteractionMetadata<T> {
2
+ count?: number;
3
+ interacted?: boolean;
4
+ list?: T[];
5
+ }
@@ -0,0 +1,8 @@
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
+ export interface Library {
5
+ tracks: Track[];
6
+ albums: Album[];
7
+ playlists: Playlist[];
8
+ }
@@ -0,0 +1,6 @@
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
+ export interface Likable {
5
+ likes?: (TrackLike | AlbumLike | PlaylistLike)[];
6
+ }
@@ -0,0 +1,6 @@
1
+ import { Track } from "./db/lyda/Track.ts";
2
+ export interface ListTrack {
3
+ track_id: number;
4
+ position: number;
5
+ track?: Track;
6
+ }
@@ -0,0 +1,5 @@
1
+ export interface NotificationPart {
2
+ type: string;
3
+ text?: string;
4
+ id?: number;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { NotificationReferenceType } from "../Enums/NotificationReferenceType.ts";
2
+ export interface NotificationReference {
3
+ type: NotificationReferenceType;
4
+ id: number;
5
+ object?: any;
6
+ }
@@ -0,0 +1,6 @@
1
+ export interface PillOption {
2
+ text: string;
3
+ value: any;
4
+ icon?: string;
5
+ onclick: Function;
6
+ }
@@ -0,0 +1,5 @@
1
+ export interface PlayingFrom {
2
+ type: "album" | "playlist" | string;
3
+ name: string;
4
+ id: number;
5
+ }
@@ -0,0 +1,11 @@
1
+ import { ProgressState } from "../Enums/ProgressState.ts";
2
+ import { Signal, StringOrSignal } from "@targoninc/jess";
3
+ export interface ProgressPart {
4
+ id: string;
5
+ icon: string;
6
+ text: Signal<string>;
7
+ state: Signal<ProgressState>;
8
+ title?: StringOrSignal;
9
+ retryFunction?: Function;
10
+ progress?: Signal<number>;
11
+ }
@@ -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,10 @@
1
+ import { RoyaltyMonth } from "./RoyaltyMonth.ts";
2
+ export interface RoyaltyInfo {
3
+ calculatableMonths: RoyaltyMonth[];
4
+ trackRoyaltyValues: any;
5
+ meanTrackRoyalty: number;
6
+ paidTotal: number;
7
+ available: number;
8
+ totalRoyalties: number;
9
+ paypalMail: string | null;
10
+ }
@@ -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,6 @@
1
+ import { Statistic } from "./Statistic.js";
2
+ import { ActivityTableName } from "../Enums/ActivityTableName.ts";
3
+ export interface TypedStatistic {
4
+ type: ActivityTableName;
5
+ stats: Statistic[];
6
+ }
@@ -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,10 @@
1
+ import { PaymentStatus } from "../../../Enums/PaymentStatus.ts";
2
+ export interface Payout {
3
+ id: number;
4
+ payout_batch_id: string;
5
+ user_id: number;
6
+ amount_ct: number;
7
+ status: PaymentStatus;
8
+ created_at: Date;
9
+ updated_at: Date;
10
+ }
@@ -0,0 +1,9 @@
1
+ import { PaypalBatchStatus } from "../../../Enums/PaypalBatchStatus.ts";
2
+ export interface PaypalBatchPayment {
3
+ id: number;
4
+ paypal_batch_id: string;
5
+ request_items_json: string;
6
+ paypal_batch_status: PaypalBatchStatus;
7
+ created_at: Date;
8
+ updated_at: Date;
9
+ }
@@ -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,17 @@
1
+ import { SubscriptionStatus } from "../../../Enums/SubscriptionStatus.ts";
2
+ export interface Subscription {
3
+ id: number;
4
+ user_id: number;
5
+ subscription_id: number;
6
+ status: SubscriptionStatus;
7
+ created_at: Date;
8
+ updated_at: Date;
9
+ cancelled_at: Date;
10
+ previous_subscription: number;
11
+ external_subscription_id: string;
12
+ external_order_id: string;
13
+ gifted_by_user_id: number;
14
+ next_billing_time: Date;
15
+ outstanding_balance: string;
16
+ currency_code: string;
17
+ }
@@ -0,0 +1,22 @@
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
+ export interface Album extends Entity {
7
+ tracks?: AlbumTrack[];
8
+ user?: User;
9
+ id: number;
10
+ user_id: number;
11
+ title: string;
12
+ description: string;
13
+ upc: string;
14
+ release_date: Date;
15
+ created_at: Date;
16
+ updated_at: Date;
17
+ visibility: string;
18
+ secretcode: string;
19
+ has_cover: boolean;
20
+ price: number;
21
+ likes?: InteractionMetadata<TrackLike>;
22
+ }
@@ -0,0 +1,7 @@
1
+ import { User } from "./User.js";
2
+ export interface AlbumLike {
3
+ user?: User;
4
+ user_id: number;
5
+ album_id: number;
6
+ created_at: Date;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Track } from "./Track.js";
2
+ export interface AlbumTrack {
3
+ track?: Track;
4
+ album_id: number;
5
+ track_id: number;
6
+ user_id: number;
7
+ position: number;
8
+ created_at: Date;
9
+ }
@@ -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,15 @@
1
+ import { User } from "./User.js";
2
+ import { Track } from "./Track.js";
3
+ export interface Comment {
4
+ user?: User;
5
+ track?: Track;
6
+ canEdit?: boolean;
7
+ id: number;
8
+ parent_id: number;
9
+ track_id: number;
10
+ user_id: number;
11
+ content: string;
12
+ created_at: Date;
13
+ potentially_harmful: boolean;
14
+ hidden: boolean;
15
+ }
@@ -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,12 @@
1
+ import { NotificationReference } from "../../NotificationReference.ts";
2
+ export interface Notification {
3
+ references?: NotificationReference[];
4
+ id: number;
5
+ user_id: number;
6
+ track_id: number;
7
+ type: string;
8
+ search_key: string;
9
+ message: string;
10
+ is_read: boolean;
11
+ created_at: Date;
12
+ }
@@ -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,19 @@
1
+ import { User } from "./User.js";
2
+ import { Entity } from "@targoninc/ts-search";
3
+ import { PlaylistTrack } from "./PlaylistTrack.ts";
4
+ import { InteractionMetadata } from "../../InteractionMetadata.ts";
5
+ import { TrackLike } from "./TrackLike.ts";
6
+ export interface Playlist extends Entity {
7
+ tracks?: PlaylistTrack[];
8
+ user?: User;
9
+ id: number;
10
+ user_id: number;
11
+ title: string;
12
+ description: string;
13
+ created_at: Date;
14
+ updated_at: Date;
15
+ visibility: string;
16
+ has_cover: boolean;
17
+ secretcode: string;
18
+ likes?: InteractionMetadata<TrackLike>;
19
+ }
@@ -0,0 +1,7 @@
1
+ import { User } from "./User.js";
2
+ export interface PlaylistLike {
3
+ user_id: number;
4
+ playlist_id: number;
5
+ created_at: Date;
6
+ user?: User;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Track } from "./Track.js";
2
+ export interface PlaylistTrack {
3
+ playlist_id: number;
4
+ track_id: number;
5
+ user_id: number;
6
+ position: number;
7
+ created_at: Date;
8
+ track?: Track;
9
+ }
@@ -0,0 +1,5 @@
1
+ export interface PossibleUsersetting {
2
+ name: string;
3
+ description: string;
4
+ type: string;
5
+ }
@@ -0,0 +1,7 @@
1
+ import { User } from "./User.js";
2
+ export interface Repost {
3
+ user?: User;
4
+ user_id: number;
5
+ track_id: number;
6
+ created_at: Date;
7
+ }
@@ -0,0 +1,44 @@
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
+ export interface Track extends Entity {
12
+ repost_user_id?: number;
13
+ repost?: Repost;
14
+ user?: User;
15
+ playlists?: Playlist[];
16
+ albums?: Album[];
17
+ notifications?: Notification[];
18
+ collaborators?: TrackCollaborator[];
19
+ user_id: number;
20
+ title: string;
21
+ isrc: string;
22
+ artistname: string;
23
+ upc: string;
24
+ visibility: string;
25
+ credits: string;
26
+ loudness_data: string;
27
+ genre: string;
28
+ version: string;
29
+ versionid: number;
30
+ length: number;
31
+ description: string;
32
+ release_date: Date;
33
+ updated_at: Date;
34
+ created_at: Date;
35
+ plays: number;
36
+ secretcode: string;
37
+ monetization: boolean;
38
+ price: number;
39
+ has_cover: boolean;
40
+ processed: boolean;
41
+ likes?: InteractionMetadata<TrackLike>;
42
+ reposts?: InteractionMetadata<Repost>;
43
+ comments?: InteractionMetadata<Comment>;
44
+ }
@@ -0,0 +1,13 @@
1
+ import { User } from "./User.js";
2
+ import { CollaboratorType } from "./CollaboratorType.js";
3
+ export interface TrackCollaborator {
4
+ collab_type?: CollaboratorType;
5
+ user?: User;
6
+ track_id: number;
7
+ user_id: number;
8
+ type: number;
9
+ approved: boolean;
10
+ denied: boolean;
11
+ created_at: Date;
12
+ updated_at: Date;
13
+ }
@@ -0,0 +1,7 @@
1
+ import { User } from "./User.js";
2
+ export interface TrackLike {
3
+ user?: User;
4
+ user_id: number;
5
+ track_id: number;
6
+ created_at: Date;
7
+ }
@@ -0,0 +1,37 @@
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
+ export interface User extends Entity {
10
+ permissions?: Permission[];
11
+ subscription?: Subscription;
12
+ settings?: Usersetting[];
13
+ badges?: Badge[];
14
+ userBadges?: UserBadge[];
15
+ follows?: Follow[];
16
+ following?: Follow[];
17
+ id: number;
18
+ username: string;
19
+ mfa_enabled: boolean;
20
+ emails: UserEmail[];
21
+ password_hash: string;
22
+ displayname: string;
23
+ description: string;
24
+ password_token: string | null;
25
+ verified: boolean;
26
+ verification_status: string;
27
+ created_at: Date;
28
+ updated_at: Date;
29
+ deleted_at: Date;
30
+ lastlogin?: Date;
31
+ secondlastlogin?: Date;
32
+ password_updated_at: Date;
33
+ tos_agreed_at: Date;
34
+ ip: string;
35
+ has_avatar: boolean;
36
+ has_banner: boolean;
37
+ }
@@ -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
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ // @bun
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@targoninc/lyda-shared",
3
+ "type": "module",
4
+ "version": "0.0.2",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/targoninc/lyda-shared.git"
16
+ },
17
+ "scripts": {
18
+ "build": "bun build ./src/index.ts --outdir ./dist --target bun --format esm && tsc",
19
+ "typecheck": "tsc --noEmit",
20
+ "prepublishOnly": "bun run build"
21
+ },
22
+ "dependencies": {
23
+ "@targoninc/jess": "^0.0.11",
24
+ "@targoninc/ts-search": "^0.0.5"
25
+ },
26
+ "devDependencies": {
27
+ "@types/bun": "latest",
28
+ "bun-plugin-dtsx": "^0.21.9"
29
+ },
30
+ "peerDependencies": {
31
+ "typescript": "^5"
32
+ }
33
+ }