@targoninc/lyda-shared 0.0.9 → 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.
- package/dist/Models/db/lyda/Comment.d.ts +1 -0
- package/package.json +3 -2
- package/src/Enums/ActivityTableName.ts +12 -0
- package/src/Enums/EntityType.ts +5 -0
- package/src/Enums/Genre.ts +28 -0
- package/src/Enums/InteractionType.ts +5 -0
- package/src/Enums/LogLevel.ts +9 -0
- package/src/Enums/LoopMode.ts +5 -0
- package/src/Enums/MediaFileType.ts +8 -0
- package/src/Enums/NotificationReferenceType.ts +6 -0
- package/src/Enums/PaymentStatus.ts +6 -0
- package/src/Enums/PaypalBatchStatus.ts +7 -0
- package/src/Enums/Permissions.ts +15 -0
- package/src/Enums/ProgressState.ts +7 -0
- package/src/Enums/RoadmapItemStatus.ts +11 -0
- package/src/Enums/SearchContext.ts +4 -0
- package/src/Enums/StreamingQuality.ts +5 -0
- package/src/Enums/SubscriptionStatus.ts +6 -0
- package/src/Enums/Theme.ts +5 -0
- package/src/Enums/TimeResolution.ts +8 -0
- package/src/Enums/UserSettings.ts +12 -0
- package/src/Models/Filter.ts +8 -0
- package/src/Models/InteractionConfig.ts +9 -0
- package/src/Models/InteractionMetadata.ts +5 -0
- package/src/Models/Library.ts +9 -0
- package/src/Models/Likable.ts +7 -0
- package/src/Models/ListTrack.ts +7 -0
- package/src/Models/NotifcationPart.ts +5 -0
- package/src/Models/NotificationReference.ts +7 -0
- package/src/Models/PlayingFrom.ts +5 -0
- package/src/Models/ProgressPart.ts +12 -0
- package/src/Models/Royalty.ts +23 -0
- package/src/Models/RoyaltyInfo.ts +11 -0
- package/src/Models/RoyaltyMonth.ts +10 -0
- package/src/Models/SearchResult.ts +9 -0
- package/src/Models/Statistic.ts +5 -0
- package/src/Models/TrackPosition.ts +4 -0
- package/src/Models/TypedStatistic.ts +7 -0
- package/src/Models/db/finance/AvailableSubscription.ts +10 -0
- package/src/Models/db/finance/BillingHistory.ts +8 -0
- package/src/Models/db/finance/Expense.ts +9 -0
- package/src/Models/db/finance/MonthlyEarning.ts +7 -0
- package/src/Models/db/finance/PaymentHistory.ts +14 -0
- package/src/Models/db/finance/Payout.ts +11 -0
- package/src/Models/db/finance/PaypalBatchPayment.ts +10 -0
- package/src/Models/db/finance/PaypalUser.ts +7 -0
- package/src/Models/db/finance/PaypalWebhook.ts +9 -0
- package/src/Models/db/finance/Product.ts +9 -0
- package/src/Models/db/finance/Subscription.ts +18 -0
- package/src/Models/db/lyda/Album.ts +25 -0
- package/src/Models/db/lyda/AlbumLike.ts +8 -0
- package/src/Models/db/lyda/AlbumTrack.ts +10 -0
- package/src/Models/db/lyda/Badge.ts +5 -0
- package/src/Models/db/lyda/CollaboratorType.ts +7 -0
- package/src/Models/db/lyda/Comment.ts +17 -0
- package/src/Models/db/lyda/Follow.ts +5 -0
- package/src/Models/db/lyda/ListeningHistory.ts +7 -0
- package/src/Models/db/lyda/Log.ts +10 -0
- package/src/Models/db/lyda/Notification.ts +13 -0
- package/src/Models/db/lyda/Permission.ts +7 -0
- package/src/Models/db/lyda/Playlist.ts +25 -0
- package/src/Models/db/lyda/PlaylistLike.ts +8 -0
- package/src/Models/db/lyda/PlaylistTrack.ts +10 -0
- package/src/Models/db/lyda/PossibleUsersetting.ts +5 -0
- package/src/Models/db/lyda/Repost.ts +8 -0
- package/src/Models/db/lyda/Track.ts +45 -0
- package/src/Models/db/lyda/TrackCollaborator.ts +16 -0
- package/src/Models/db/lyda/TrackLike.ts +8 -0
- package/src/Models/db/lyda/User.ts +38 -0
- package/src/Models/db/lyda/UserBadge.ts +5 -0
- package/src/Models/db/lyda/UserEmail.ts +8 -0
- package/src/Models/db/lyda/UserPermission.ts +5 -0
- package/src/Models/db/lyda/Usersetting.ts +7 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -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,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,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,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,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,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,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 {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,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,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,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,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,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,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
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// your exports here
|