ldco-contract 0.1.10 → 0.1.12
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/index.d.ts +23 -13
- package/dist/ldco-contract.cjs.development.js +3 -93
- package/dist/ldco-contract.cjs.development.js.map +1 -1
- package/dist/ldco-contract.cjs.production.min.js +1 -1
- package/dist/ldco-contract.cjs.production.min.js.map +1 -1
- package/dist/ldco-contract.esm.js +4 -82
- package/dist/ldco-contract.esm.js.map +1 -1
- package/dist/lib/getAllUserDanceIds.d.ts +3 -2
- package/dist/types/dto/choreographer.dto.d.ts +5 -0
- package/dist/types/dto/collection.dto.d.ts +11 -0
- package/dist/types/dto/dance.dto.d.ts +10 -0
- package/dist/types/dto/friend.dto.d.ts +6 -0
- package/dist/types/dto/friendRequest.dto.d.ts +7 -0
- package/dist/types/dto/instructor.dto.d.ts +6 -0
- package/dist/types/dto/lesson.dto.d.ts +10 -0
- package/dist/types/dto/track.dto.d.ts +10 -0
- package/dist/types/dto/user.dto.d.ts +25 -0
- package/dist/types/dto/userAcquaintance.dto.d.ts +22 -0
- package/dist/types/dto/venue.dto.d.ts +13 -0
- package/dist/types/model/choreographer.model.d.ts +5 -0
- package/dist/types/model/collection.model.d.ts +10 -0
- package/dist/types/model/dance.model.d.ts +11 -0
- package/dist/types/model/instructor.model.d.ts +6 -0
- package/dist/types/model/lesson.model.d.ts +10 -0
- package/dist/types/model/track.model.d.ts +10 -0
- package/dist/types/model/user.model.d.ts +11 -0
- package/dist/types/model/userAcquaintance.model.d.ts +16 -0
- package/dist/types/model/userTypes/profileData.d.ts +16 -0
- package/dist/{models/socialMediaLinks.model.d.ts → types/model/userTypes/socialMediaLinks.d.ts} +1 -1
- package/dist/types/model/userTypes/userDances.d.ts +7 -0
- package/dist/types/model/venue.model.d.ts +13 -0
- package/package.json +1 -1
- package/src/index.ts +29 -13
- package/src/lib/getAllUserDanceIds.ts +5 -4
- package/src/types/dto/choreographer.dto.ts +5 -0
- package/src/types/dto/collection.dto.ts +13 -0
- package/src/types/dto/dance.dto.ts +10 -0
- package/src/types/dto/friend.dto.ts +6 -0
- package/src/types/dto/friendRequest.dto.ts +7 -0
- package/src/types/dto/instructor.dto.ts +6 -0
- package/src/types/dto/lesson.dto.ts +10 -0
- package/src/types/dto/track.dto.ts +10 -0
- package/src/types/dto/user.dto.ts +25 -0
- package/src/types/dto/userAcquaintance.dto.ts +22 -0
- package/src/types/dto/venue.dto.ts +15 -0
- package/src/types/model/choreographer.model.ts +5 -0
- package/src/types/model/collection.model.ts +11 -0
- package/src/types/model/dance.model.ts +12 -0
- package/src/types/model/instructor.model.ts +6 -0
- package/src/types/model/lesson.model.ts +11 -0
- package/src/types/model/track.model.ts +10 -0
- package/src/types/model/user.model.ts +12 -0
- package/src/types/model/userAcquaintance.model.ts +17 -0
- package/src/types/model/userTypes/profileData.ts +17 -0
- package/src/{models/socialMediaLinks.model.ts → types/model/userTypes/socialMediaLinks.ts} +1 -1
- package/src/types/model/userTypes/userDances.ts +8 -0
- package/src/types/model/venue.model.ts +14 -0
- package/dist/entities/user.entity.d.ts +0 -18
- package/dist/models/collection.model.d.ts +0 -5
- package/dist/models/dance.model.d.ts +0 -11
- package/dist/models/instructor.model.d.ts +0 -5
- package/dist/models/lesson.model.d.ts +0 -11
- package/dist/models/profileData.model.d.ts +0 -16
- package/dist/models/track.model.d.ts +0 -9
- package/dist/models/user.model.d.ts +0 -11
- package/dist/models/userAcquaintance.model.d.ts +0 -20
- package/dist/models/userDances.model.d.ts +0 -7
- package/dist/models/venue.model.d.ts +0 -11
- package/src/entities/user.entity.ts +0 -19
- package/src/models/collection.model.ts +0 -8
- package/src/models/dance.model.ts +0 -15
- package/src/models/instructor.model.ts +0 -8
- package/src/models/lesson.model.ts +0 -11
- package/src/models/profileData.model.ts +0 -29
- package/src/models/track.model.ts +0 -12
- package/src/models/user.model.ts +0 -20
- package/src/models/userAcquaintance.model.ts +0 -39
- package/src/models/userDances.model.ts +0 -14
- package/src/models/venue.model.ts +0 -17
@@ -0,0 +1,13 @@
|
|
1
|
+
import { LessonModel } from "./lesson.model";
|
2
|
+
export interface VenueModel {
|
3
|
+
venuename: string;
|
4
|
+
venueaddress: string;
|
5
|
+
geolocation: [number, number];
|
6
|
+
phone: string;
|
7
|
+
website: string;
|
8
|
+
contactEmail: string;
|
9
|
+
contactName: string;
|
10
|
+
contactPhone: string;
|
11
|
+
lessons: LessonModel[];
|
12
|
+
isVerified: boolean;
|
13
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -1,15 +1,31 @@
|
|
1
|
-
|
2
|
-
export {
|
3
|
-
export {
|
4
|
-
export {
|
5
|
-
export {
|
6
|
-
export {
|
7
|
-
export {
|
8
|
-
export {
|
9
|
-
export {
|
10
|
-
export {
|
11
|
-
export {
|
12
|
-
export {
|
1
|
+
// DTOS
|
2
|
+
export { ChoreographerDTO } from './types/dto/choreographer.dto';
|
3
|
+
export { CollectionDTO } from './types/dto/collection.dto';
|
4
|
+
export { DanceDTO } from './types/dto/dance.dto';
|
5
|
+
export { FriendDTO } from './types/dto/friend.dto';
|
6
|
+
export { FriendRequestDTO } from './types/dto/friendRequest.dto';
|
7
|
+
export { InstructorDTO } from './types/dto/instructor.dto';
|
8
|
+
export { LessonDTO } from './types/dto/lesson.dto';
|
9
|
+
export { TrackDTO } from './types/dto/track.dto';
|
10
|
+
export { UserDTO } from './types/dto/user.dto';
|
11
|
+
export { UserAcquaintanceDTO } from './types/dto/userAcquaintance.dto';
|
12
|
+
export { VenueDTO } from './types/dto/venue.dto';
|
13
13
|
|
14
|
-
|
14
|
+
// MODELS
|
15
|
+
export { ChoreographerModel } from './types/model/choreographer.model';
|
16
|
+
export { CollectionModel } from './types/model/collection.model';
|
17
|
+
export { DanceModel } from './types/model/dance.model';
|
18
|
+
export { InstructorModel } from './types/model/instructor.model';
|
19
|
+
export { LessonModel } from './types/model/lesson.model';
|
20
|
+
export { TrackModel } from './types/model/track.model';
|
21
|
+
export { UserModel } from './types/model/user.model';
|
22
|
+
export { UserAcquaintanceModel } from './types/model/userAcquaintance.model';
|
23
|
+
export { VenueModel } from './types/model/venue.model';
|
24
|
+
|
25
|
+
// USER TYPES
|
26
|
+
export { ProfileData } from './types/model/userTypes/profileData';
|
27
|
+
export { SocialMediaLinks } from './types/model/userTypes/socialMediaLinks';
|
28
|
+
export { UserDances } from './types/model/userTypes/userDances';
|
29
|
+
|
30
|
+
// LIB FUNCTIONS
|
15
31
|
export { getAllUserDanceIds } from './lib/getAllUserDanceIds';
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import
|
1
|
+
import { DanceModel } from "../types/model/dance.model";
|
2
|
+
import { UserDances } from "../types/model/userTypes/userDances";
|
2
3
|
|
3
|
-
export function getAllUserDanceIds(userDances:
|
4
|
+
export function getAllUserDanceIds(userDances: UserDances): DanceModel[] {
|
4
5
|
const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};
|
5
6
|
|
6
7
|
const all = [
|
@@ -10,5 +11,5 @@ export function getAllUserDanceIds(userDances: Partial<UserDances>): string[] {
|
|
10
11
|
...refresh,
|
11
12
|
];
|
12
13
|
|
13
|
-
return
|
14
|
-
}
|
14
|
+
return all.filter((item, index) => all.indexOf(item) === index);
|
15
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export interface CollectionDTO {
|
2
|
+
_id: string;
|
3
|
+
name: string;
|
4
|
+
dances: string[];
|
5
|
+
createdAt: Date;
|
6
|
+
updatedAt: Date;
|
7
|
+
createdBy: string;
|
8
|
+
isPrivate: boolean; // TODO: Private collections should not be returned in public APIs
|
9
|
+
isCopyable: boolean;
|
10
|
+
|
11
|
+
// Added Data
|
12
|
+
isVerified: boolean;
|
13
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
export interface UserDTO {
|
2
|
+
_id: string;
|
3
|
+
email: string;
|
4
|
+
name: string;
|
5
|
+
username: string;
|
6
|
+
image: string;
|
7
|
+
bio: string;
|
8
|
+
isVerified: boolean;
|
9
|
+
profile: {
|
10
|
+
danceIds: {
|
11
|
+
favorites: string[];
|
12
|
+
flagged: string[];
|
13
|
+
known: string[];
|
14
|
+
refresh: string[];
|
15
|
+
};
|
16
|
+
collections: string[];
|
17
|
+
venues: string[];
|
18
|
+
friends: string[];
|
19
|
+
following: string[];
|
20
|
+
friendsRequested: string[];
|
21
|
+
friendRequests: string[];
|
22
|
+
followersCount?: number;
|
23
|
+
links: Record<string, string>;
|
24
|
+
};
|
25
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export interface UserAcquaintanceDTO {
|
2
|
+
id: string;
|
3
|
+
username: string;
|
4
|
+
image: string;
|
5
|
+
bio: string;
|
6
|
+
isVerified: boolean;
|
7
|
+
profile: {
|
8
|
+
dances: {
|
9
|
+
favorites: string[];
|
10
|
+
flagged: string[];
|
11
|
+
known: string[];
|
12
|
+
refresh: string[];
|
13
|
+
};
|
14
|
+
collections: string[];
|
15
|
+
venues: string[];
|
16
|
+
friendsCount: number;
|
17
|
+
followingCount: number;
|
18
|
+
followersCount: number;
|
19
|
+
mutualFriendsCount: number;
|
20
|
+
links: Record<string, string>;
|
21
|
+
};
|
22
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export interface VenueDTO {
|
2
|
+
id: string;
|
3
|
+
venuename: string;
|
4
|
+
venueaddress: string;
|
5
|
+
geolocation: [number, number];
|
6
|
+
phone: string;
|
7
|
+
website: string;
|
8
|
+
contactEmail: string;
|
9
|
+
contactName: string;
|
10
|
+
contactPhone: string;
|
11
|
+
|
12
|
+
// Added Data
|
13
|
+
lessonsIds: string[];
|
14
|
+
isVerified: boolean;
|
15
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { ChoreographerModel } from './choreographer.model';
|
2
|
+
import { TrackModel } from './track.model';
|
3
|
+
|
4
|
+
export interface DanceModel {
|
5
|
+
danceName: string;
|
6
|
+
choreographers: ChoreographerModel[];
|
7
|
+
stepsheet: string;
|
8
|
+
difficulty: string;
|
9
|
+
isVerified: boolean;
|
10
|
+
primaryTrack: TrackModel;
|
11
|
+
tracks: TrackModel[];
|
12
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { ProfileData } from "./userTypes/profileData";
|
2
|
+
|
3
|
+
export interface UserModel {
|
4
|
+
_id: string;
|
5
|
+
email: string;
|
6
|
+
name: string;
|
7
|
+
username: string;
|
8
|
+
image: string;
|
9
|
+
bio: string;
|
10
|
+
profile: ProfileData;
|
11
|
+
isVerified: boolean; // TODO: This makes sense on a UserAquaintanceModel, but is it still useful on a UserModel?
|
12
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { CollectionModel } from "./collection.model";
|
2
|
+
import { SocialMediaLinks } from "./userTypes/socialMediaLinks";
|
3
|
+
import { UserDances } from "./userTypes/userDances";
|
4
|
+
|
5
|
+
export interface UserAcquaintanceModel {
|
6
|
+
id: string;
|
7
|
+
username: string;
|
8
|
+
image: string;
|
9
|
+
bio: string;
|
10
|
+
dances: UserDances;
|
11
|
+
collections: CollectionModel[];
|
12
|
+
followersCount: number;
|
13
|
+
friendsCount: number;
|
14
|
+
mutualFriendsCount: number;
|
15
|
+
links?: SocialMediaLinks;
|
16
|
+
isVerified: boolean;
|
17
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { CollectionModel } from "../collection.model";
|
2
|
+
import { UserDances } from "../userDances.model";
|
3
|
+
import { SocialMediaLinks } from "./socialMediaLinks";
|
4
|
+
import { UserAcquaintanceModel } from "../userAquaintance";
|
5
|
+
import { VenueModel } from "../venue.model";
|
6
|
+
|
7
|
+
export interface ProfileData {
|
8
|
+
dances: UserDances;
|
9
|
+
collections: CollectionModel[];
|
10
|
+
venues: VenueModel[];
|
11
|
+
friends: UserAcquaintanceModel[];
|
12
|
+
following: UserAcquaintanceModel[];
|
13
|
+
friendsRequested: UserAcquaintanceModel[];
|
14
|
+
friendRequests: UserAcquaintanceModel[];
|
15
|
+
followersCount: number;
|
16
|
+
links: SocialMediaLinks;
|
17
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { LessonModel } from "./lesson.model";
|
2
|
+
|
3
|
+
export interface VenueModel {
|
4
|
+
venuename: string;
|
5
|
+
venueaddress: string;
|
6
|
+
geolocation: [number, number];
|
7
|
+
phone: string;
|
8
|
+
website: string;
|
9
|
+
contactEmail: string;
|
10
|
+
contactName: string;
|
11
|
+
contactPhone: string;
|
12
|
+
lessons: LessonModel[];
|
13
|
+
isVerified: boolean;
|
14
|
+
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import Collection from "../models/collection.model";
|
2
|
-
export interface UserEntity {
|
3
|
-
_id: string;
|
4
|
-
email: string;
|
5
|
-
name: string;
|
6
|
-
username?: string;
|
7
|
-
image?: string;
|
8
|
-
bio?: string;
|
9
|
-
favorites?: string[];
|
10
|
-
flagged?: string[];
|
11
|
-
known?: string[];
|
12
|
-
refresh?: string[];
|
13
|
-
collections?: Collection[];
|
14
|
-
venues?: string[];
|
15
|
-
friends?: string[];
|
16
|
-
following?: string[];
|
17
|
-
links?: Record<string, string>;
|
18
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import Track from "./track.model";
|
2
|
-
export default class Dance {
|
3
|
-
constructor(obj: Partial<Dance>);
|
4
|
-
_id: string;
|
5
|
-
difficulty?: string;
|
6
|
-
tracks?: Track[];
|
7
|
-
primaryTrack?: Track;
|
8
|
-
danceName: string;
|
9
|
-
choreographers: string[];
|
10
|
-
stepsheet?: string;
|
11
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import Collection from "./collection.model";
|
2
|
-
import SocialMediaLinks from "./socialMediaLinks.model";
|
3
|
-
import UserDances from "./userDances.model";
|
4
|
-
import UserAcquaintance from "./userAcquaintance.model";
|
5
|
-
export default class ProfileData {
|
6
|
-
constructor(data: Partial<ProfileData>);
|
7
|
-
dances: UserDances;
|
8
|
-
collections: Collection[];
|
9
|
-
venues: string[];
|
10
|
-
friends: UserAcquaintance[];
|
11
|
-
following: UserAcquaintance[];
|
12
|
-
friendsRequested: UserAcquaintance[];
|
13
|
-
friendRequests: UserAcquaintance[];
|
14
|
-
followersCount: number;
|
15
|
-
links: SocialMediaLinks;
|
16
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import UserDances from "./userDances.model";
|
2
|
-
import SocialMediaLinks from "./socialMediaLinks.model";
|
3
|
-
import Collection from "./collection.model";
|
4
|
-
export default class UserAcquaintance {
|
5
|
-
constructor(data: Partial<UserAcquaintance>);
|
6
|
-
_id: string;
|
7
|
-
email: string;
|
8
|
-
name: string;
|
9
|
-
username?: string;
|
10
|
-
image?: string;
|
11
|
-
bio?: string;
|
12
|
-
friends: string[];
|
13
|
-
following: string[];
|
14
|
-
dances: UserDances;
|
15
|
-
collections: Collection[];
|
16
|
-
followersCount: number;
|
17
|
-
venuesCount: number;
|
18
|
-
mutualsCount: number;
|
19
|
-
links?: SocialMediaLinks;
|
20
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import Lesson from "./lesson.model";
|
2
|
-
export default class Venue {
|
3
|
-
constructor(obj: Partial<Venue>);
|
4
|
-
_id: string;
|
5
|
-
venuename: string;
|
6
|
-
venueaddress: string;
|
7
|
-
geolocation: [number, number];
|
8
|
-
phone?: string;
|
9
|
-
website?: string;
|
10
|
-
lessons?: Lesson[];
|
11
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import Collection from "../models/collection.model";
|
2
|
-
|
3
|
-
export interface UserEntity {
|
4
|
-
_id: string;
|
5
|
-
email: string;
|
6
|
-
name: string;
|
7
|
-
username?: string;
|
8
|
-
image?: string;
|
9
|
-
bio?: string;
|
10
|
-
favorites?: string[];
|
11
|
-
flagged?: string[];
|
12
|
-
known?: string[];
|
13
|
-
refresh?: string[];
|
14
|
-
collections?: Collection[];
|
15
|
-
venues?: string[];
|
16
|
-
friends?: string[];
|
17
|
-
following?: string[];
|
18
|
-
links?: Record<string, string>;
|
19
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import Track from "./track.model";
|
2
|
-
|
3
|
-
export default class Dance {
|
4
|
-
constructor(obj: Partial<Dance>) {
|
5
|
-
Object.assign(this, obj);
|
6
|
-
}
|
7
|
-
|
8
|
-
_id!: string;
|
9
|
-
difficulty?: string;
|
10
|
-
tracks?: Track[] = [];
|
11
|
-
primaryTrack?: Track;
|
12
|
-
danceName!: string;
|
13
|
-
choreographers!: string[];
|
14
|
-
stepsheet?: string;
|
15
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import Collection from "./collection.model";
|
2
|
-
import SocialMediaLinks from "./socialMediaLinks.model";
|
3
|
-
import UserDances from "./userDances.model";
|
4
|
-
import UserAcquaintance from "./userAcquaintance.model";
|
5
|
-
|
6
|
-
export default class ProfileData {
|
7
|
-
|
8
|
-
constructor(data: Partial<ProfileData>) {
|
9
|
-
this.dances = new UserDances(data.dances);
|
10
|
-
this.collections = data.collections ?? [];
|
11
|
-
this.venues = data.venues ?? [];
|
12
|
-
this.friends = data.friends ?? [];
|
13
|
-
this.following = data.following ?? [];
|
14
|
-
this.friendsRequested = data.friendsRequested ?? [];
|
15
|
-
this.friendRequests = data.friendRequests ?? [];
|
16
|
-
this.followersCount = data.followersCount ?? 0;
|
17
|
-
this.links = {};
|
18
|
-
}
|
19
|
-
|
20
|
-
dances: UserDances;
|
21
|
-
collections: Collection[];
|
22
|
-
venues: string[];
|
23
|
-
friends: UserAcquaintance[];
|
24
|
-
following: UserAcquaintance[];
|
25
|
-
friendsRequested: UserAcquaintance[];
|
26
|
-
friendRequests: UserAcquaintance[];
|
27
|
-
followersCount: number;
|
28
|
-
links: SocialMediaLinks;
|
29
|
-
}
|