ldco-contract 0.1.16 → 0.1.18

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 CHANGED
@@ -39,6 +39,7 @@ export { ProfileData } from './types/model/userTypes/profileData';
39
39
  export { SocialMediaLinks } from './types/model/userTypes/socialMediaLinks';
40
40
  export { UserDances } from './types/model/userTypes/userDances';
41
41
  export { getAllUserDanceIds } from './lib/getAllUserDanceIds';
42
+ export { itemArrayToItemRecords } from './lib/itemArrayToItemRecords';
42
43
  export { UserInfoUpdateRequest } from './types/requests/userInfoUpdate.request';
43
44
  export { toChoreographerDTO } from './lib/converters/toChoreographerDTO';
44
45
  export { toChoreographerModel } from './lib/converters/toChoreographerModel';
@@ -18,6 +18,13 @@ function getAllUserDanceIds(userDances) {
18
18
  });
19
19
  }
20
20
 
21
+ function itemArrayToItemRecords(arr) {
22
+ return arr.reduce(function (acc, item) {
23
+ acc[item.id] = item;
24
+ return acc;
25
+ }, {});
26
+ }
27
+
21
28
  function toChoreographerDTO(choreographer, isVerified) {
22
29
  return {
23
30
  id: choreographer._id,
@@ -329,6 +336,7 @@ function toVenueModel(venueDTO, lessonMap, instructorMap) {
329
336
  }
330
337
 
331
338
  exports.getAllUserDanceIds = getAllUserDanceIds;
339
+ exports.itemArrayToItemRecords = itemArrayToItemRecords;
332
340
  exports.toChoreographerDTO = toChoreographerDTO;
333
341
  exports.toChoreographerModel = toChoreographerModel;
334
342
  exports.toCollectionModel = toCollectionModel;
@@ -1 +1 @@
1
- {"version":3,"file":"ldco-contract.cjs.development.js","sources":["../src/lib/getAllUserDanceIds.ts","../src/lib/converters/toChoreographerDTO.ts","../src/lib/converters/toChoreographerModel.ts","../src/lib/converters/toTrackModel.ts","../src/lib/converters/toDanceModel.ts","../src/lib/converters/toCollectionsModel.ts","../src/lib/converters/toDanceDTO.ts","../src/lib/converters/toInstructorDTO.ts","../src/lib/converters/toInstructorModel.ts","../src/lib/converters/toLessonDTO.ts","../src/lib/converters/toLessonModel.ts","../src/lib/converters/toTrackDTO.ts","../src/lib/converters/toUserAcquaintanceDTO.ts","../src/lib/converters/toUserAcquaintanceModel.ts","../src/lib/converters/toUserDTO.ts","../src/lib/converters/toUserModel.ts","../src/lib/converters/toVenueDTO.ts","../src/lib/converters/toVenueModel.ts"],"sourcesContent":["import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { ChoreographerEntity } from '../../types/entities/choreographer.entity';\n\nexport function toChoreographerDTO(\n choreographer: ChoreographerEntity,\n isVerified: boolean\n): ChoreographerDTO {\n\n return {\n id: choreographer._id,\n name: choreographer.name,\n isVerified: isVerified\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { ChoreographerModel } from \"../../types/model/choreographer.model\";\n\nexport function toChoreographerModel(\n dto: ChoreographerDTO\n): ChoreographerModel {\n\n return {\n id: dto.id,\n name: dto.name,\n isVerified: dto.isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackModel } from \"../../types/model/track.model\";\n\nexport function toTrackModel(dto: TrackDTO): TrackModel {\n return {\n id: dto.id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { DanceModel } from '../../types/model/dance.model';\nimport { toChoreographerModel } from './toChoreographerModel';\nimport { toTrackModel } from './toTrackModel';\n\nexport function toDanceModel(\n dto: DanceDTO,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): DanceModel {\n\n const tracks = dto.tracks\n .map(id => trackMap[id])\n .filter(Boolean);\n\n return {\n id: dto.id,\n danceName: dto.danceName,\n choreographers: dto.choreographers.map(id => toChoreographerModel(choreographerMap[id])),\n stepsheet: dto.stepsheet,\n difficulty: dto.difficulty,\n primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),\n tracks: tracks.map(toTrackModel),\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { CollectionDTO } from '../../types/dto/collection.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { CollectionModel } from '../../types/model/collection.model';\nimport { toDanceModel } from './toDanceModel';\n\nexport function toCollectionModel(\n dto: CollectionDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): CollectionModel {\n const dances = dto.dances.map(id => danceMap[id]).filter(Boolean);\n\n return {\n id: dto._id,\n name: dto.name,\n dances: dances.map(d => toDanceModel(d, trackMap, choreographerMap)),\n isVerified: dto.isVerified,\n createdAt: dto.createdAt,\n updatedAt: dto.updatedAt,\n createdBy: dto.createdBy,\n isCopyable: dto.isCopyable,\n };\n}\n","import { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { DanceEntity } from \"../../types/entities/dance.entity\";\n\nexport function toDanceDTO(\n dance: DanceEntity,\n isVerified: boolean\n): DanceDTO {\n\n return {\n id: dance._id,\n danceName: dance.danceName,\n choreographers: dance.choreographers?.map((id: string) => id) ?? [],\n stepsheet: dance.stepsheet,\n difficulty: dance.difficulty,\n primaryTrack: dance.primaryTrack ?? '',\n tracks: dance.tracks?.map((id: string) => id) ?? [],\n isVerified: isVerified\n };\n};\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorEntity } from \"../../types/entities/instructor.entity\";\n\nexport function toInstructorDTO(\n instructor: InstructorEntity,\n isVerified: boolean\n): InstructorDTO {\n\n return {\n id: instructor._id,\n name: instructor.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorModel } from \"../../types/model/instructor.model\";\n\nexport function toInstructorModel(\n dto: InstructorDTO, \n): InstructorModel {\n\n return {\n id: dto.id,\n name: dto.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: dto.isVerified\n };\n}\n","import { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonEntity } from \"../../types/entities/lesson.entity\";\n\nexport function toLessonDTO(\n LessonEntity: LessonEntity,\n isVerified: boolean\n): LessonDTO {\n\n return {\n id: LessonEntity._id,\n lessonday: LessonEntity.lessonday,\n lessonstart: LessonEntity.lessonstart,\n instructors: LessonEntity.instructors,\n duration: LessonEntity.duration,\n lessoncost: LessonEntity.lessoncost,\n notes: LessonEntity.notes,\n difficulty: LessonEntity.difficulty,\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonModel } from \"../../types/model/lesson.model\";\n\nexport function toLessonModel(\n lessonDTO: LessonDTO,\n instructorMap: Record<string, InstructorDTO>\n): LessonModel {\n\n return {\n id: lessonDTO.id,\n lessonday: lessonDTO.lessonday,\n lessonstart: lessonDTO.lessonstart,\n instructors: lessonDTO.instructors.map(id => instructorMap[id]).filter(Boolean), // TODO: Do I need the converter?\n duration: lessonDTO.duration,\n lessoncost: lessonDTO.lessoncost,\n notes: lessonDTO.notes,\n difficulty: lessonDTO.difficulty,\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackEntity } from \"../../types/entities/track.entity\";\n\nexport function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO {\n return {\n id: dto._id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: isVerified,\n };\n}\n","import { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserAcquaintanceDTO(\n user: UserEntity,\n isVerified: boolean,\n userProfile: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n collections: string[];\n venues: string[];\n friendsCount: number;\n followingCount: number;\n followersCount: number;\n mutualFriendsCount: number;\n }\n): UserAcquaintanceDTO {\n return {\n id: user._id,\n username: user.username || user.name || '',\n image: user.image || '',\n bio: user.bio || '',\n isVerified,\n profile: {\n dances: {\n favorites: userProfile.favorites,\n flagged: userProfile.flagged,\n known: userProfile.known,\n refresh: userProfile.refresh,\n },\n collections: userProfile.collections,\n venues: userProfile.venues,\n friendsCount: userProfile.friendsCount,\n followingCount: userProfile.followingCount,\n followersCount: userProfile.followersCount,\n mutualFriendsCount: userProfile.mutualFriendsCount,\n links: user.links ?? {},\n },\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { CollectionDTO } from \"../../types/dto/collection.dto\";\nimport { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { TrackDTO } from \"../../types/dto/track.dto\";\nimport { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { toCollectionModel } from \"./toCollectionsModel\";\nimport { toDanceModel } from \"./toDanceModel\";\n\nexport function toUserAcquaintanceModel(\n dto: UserAcquaintanceDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n collectionMap: Record<string, CollectionDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): UserAcquaintanceModel {\n\n return {\n id: dto.id,\n username: dto.username,\n image: dto.image,\n bio: dto.bio,\n isVerified: dto.isVerified,\n friendsCount: dto.profile.friendsCount,\n followersCount: dto.profile.followersCount,\n mutualFriendsCount: dto.profile.mutualFriendsCount,\n links: dto.profile.links,\n dances: {\n favorites: dto.profile.dances.favorites.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n flagged: dto.profile.dances.flagged.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n known: dto.profile.dances.known.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n refresh: dto.profile.dances.refresh.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap))\n },\n collections: dto.profile.collections.map(id => toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap)),\n };\n}\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserDTO(\n user: UserEntity,\n isVerified: boolean,\n danceIds: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n },\n collections: string[],\n venues: string[] = [],\n friends: string[] = [],\n following: string[] = [],\n friendsRequested: string[] = [],\n friendRequests: string[] = []\n): UserDTO {\n return {\n _id: user._id.toString(),\n email: user.email ?? '',\n name: user.name ?? '',\n username: user.username ?? '',\n image: user.image ?? '',\n bio: user.bio ?? '',\n isVerified,\n profile: {\n danceIds,\n collections,\n venues,\n friends,\n following,\n links: user.links ?? {},\n friendsRequested,\n friendRequests\n },\n };\n};\n\nexport default toUserDTO;\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { CollectionModel } from \"../../types/model/collection.model\";\nimport { DanceModel } from \"../../types/model/dance.model\";\nimport { UserModel } from \"../../types/model/user.model\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { VenueModel } from \"../../types/model/venue.model\";\n\nexport function toUserModel(\n userDTO: UserDTO,\n danceMap: Record<string, DanceModel>,\n collectionMap: Record<string, CollectionModel>,\n venueMap: Record<string, VenueModel>,\n friendsMap: Record<string, UserAcquaintanceModel>,\n followingMap: Record<string, UserAcquaintanceModel>\n): UserModel {\n const expand = <T>(ids: string[], map: Record<string, T>): T[] => ids.map(id => map[id]).filter(Boolean);\n\n return {\n _id: userDTO._id,\n email: userDTO.email,\n name: userDTO.name,\n username: userDTO.username,\n image: userDTO.image,\n bio: userDTO.bio,\n isVerified: userDTO.isVerified,\n profile: {\n dances: {\n favorites: expand(userDTO.profile.danceIds.favorites, danceMap),\n flagged: expand(userDTO.profile.danceIds.flagged, danceMap),\n known: expand(userDTO.profile.danceIds.known, danceMap),\n refresh: expand(userDTO.profile.danceIds.refresh, danceMap),\n },\n collections: expand(userDTO.profile.collections, collectionMap),\n venues: expand(userDTO.profile.venues, venueMap),\n friends: expand(userDTO.profile.friends, friendsMap),\n following: expand(userDTO.profile.following, followingMap),\n friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),\n friendRequests: expand(userDTO.profile.friendRequests, friendsMap),\n followersCount: userDTO.profile.followersCount || 0,\n links: userDTO.profile.links,\n },\n };\n}\n","import { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueEntity } from \"../../types/entities/venue.entity\";\n\nexport function toVenueDTO(\n venue: VenueEntity,\n lessonIds: string[],\n isVerified: boolean\n): VenueDTO {\n\n return {\n id: venue._id,\n venuename: venue.venuename,\n venueaddress: venue.venueaddress,\n geolocation: venue.geolocation,\n phone: venue.phone,\n website: venue.website,\n contactEmail: venue.contactEmail,\n contactName: venue.contactName,\n contactPhone: venue.contactPhone,\n lessonsIds: lessonIds,\n isVerified: isVerified,\n isDeleted: venue.isDeleted ?? false,\n deletedAt: venue.deletedAt ?? null,\n createdAt: venue.createdAt ?? null,\n };\n}","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueModel } from \"../../types/model/venue.model\";\nimport { toLessonModel } from \"./toLessonModel\";\n\nexport function toVenueModel(\n venueDTO: VenueDTO,\n lessonMap: Record<string, LessonDTO>,\n instructorMap: Record<string, InstructorDTO>\n): VenueModel {\n const expandedLessons = venueDTO.lessonsIds\n .map(id => toLessonModel(lessonMap[id], instructorMap))\n .filter(Boolean);\n\n return {\n ...venueDTO,\n lessons: expandedLessons,\n };\n}\n"],"names":["getAllUserDanceIds","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","filter","item","index","indexOf","toChoreographerDTO","choreographer","isVerified","id","_id","name","toChoreographerModel","dto","toTrackModel","artists","isrc","uri","duration_ms","explicit","toDanceModel","trackMap","choreographerMap","tracks","map","Boolean","danceName","choreographers","stepsheet","difficulty","primaryTrack","toCollectionModel","danceMap","dances","d","createdAt","updatedAt","createdBy","isCopyable","toDanceDTO","dance","_dance$choreographers","_dance$choreographers2","_dance$primaryTrack","_dance$tracks$map","_dance$tracks","toInstructorDTO","instructor","userid","toInstructorModel","toLessonDTO","LessonEntity","lessonday","lessonstart","instructors","duration","lessoncost","notes","toLessonModel","lessonDTO","instructorMap","toTrackDTO","toUserAcquaintanceDTO","user","userProfile","username","image","bio","profile","collections","venues","friendsCount","followingCount","followersCount","mutualFriendsCount","links","_user$links","toUserAcquaintanceModel","collectionMap","toUserDTO","danceIds","friends","following","friendsRequested","friendRequests","toString","email","_user$email","_user$name","_user$username","_user$image","_user$bio","toUserModel","userDTO","venueMap","friendsMap","followingMap","expand","ids","toVenueDTO","venue","lessonIds","venuename","venueaddress","geolocation","phone","website","contactEmail","contactName","contactPhone","lessonsIds","isDeleted","_venue$isDeleted","deletedAt","_venue$deletedAt","_venue$createdAt","toVenueModel","venueDTO","lessonMap","expandedLessons","_extends","lessons"],"mappings":";;;;SAGgBA,kBAAkBA,CAACC,UAAsB;EACrD,IAAAC,IAAA,GAAmED,UAAU,WAAVA,UAAU,GAAI,EAAE;IAAAE,cAAA,GAAAD,IAAA,CAA3EE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,EAAE,GAAAA,cAAA;IAAAE,YAAA,GA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EAEpB,OAAA+F,QAAA,KACOH,QAAQ;IACXI,OAAO,EAAEF;;AAEjB;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ldco-contract.cjs.development.js","sources":["../src/lib/getAllUserDanceIds.ts","../src/lib/itemArrayToItemRecords.ts","../src/lib/converters/toChoreographerDTO.ts","../src/lib/converters/toChoreographerModel.ts","../src/lib/converters/toTrackModel.ts","../src/lib/converters/toDanceModel.ts","../src/lib/converters/toCollectionsModel.ts","../src/lib/converters/toDanceDTO.ts","../src/lib/converters/toInstructorDTO.ts","../src/lib/converters/toInstructorModel.ts","../src/lib/converters/toLessonDTO.ts","../src/lib/converters/toLessonModel.ts","../src/lib/converters/toTrackDTO.ts","../src/lib/converters/toUserAcquaintanceDTO.ts","../src/lib/converters/toUserAcquaintanceModel.ts","../src/lib/converters/toUserDTO.ts","../src/lib/converters/toUserModel.ts","../src/lib/converters/toVenueDTO.ts","../src/lib/converters/toVenueModel.ts"],"sourcesContent":["import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}","export function itemArrayToItemRecords<T extends { id: string }>(arr: T[]): Record<string, T> {\n return arr.reduce((acc, item) => {\n acc[item.id] = item;\n return acc;\n }, {} as Record<string, T>);\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { ChoreographerEntity } from '../../types/entities/choreographer.entity';\n\nexport function toChoreographerDTO(\n choreographer: ChoreographerEntity,\n isVerified: boolean\n): ChoreographerDTO {\n\n return {\n id: choreographer._id,\n name: choreographer.name,\n isVerified: isVerified\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { ChoreographerModel } from \"../../types/model/choreographer.model\";\n\nexport function toChoreographerModel(\n dto: ChoreographerDTO\n): ChoreographerModel {\n\n return {\n id: dto.id,\n name: dto.name,\n isVerified: dto.isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackModel } from \"../../types/model/track.model\";\n\nexport function toTrackModel(dto: TrackDTO): TrackModel {\n return {\n id: dto.id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { DanceModel } from '../../types/model/dance.model';\nimport { toChoreographerModel } from './toChoreographerModel';\nimport { toTrackModel } from './toTrackModel';\n\nexport function toDanceModel(\n dto: DanceDTO,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): DanceModel {\n\n const tracks = dto.tracks\n .map(id => trackMap[id])\n .filter(Boolean);\n\n return {\n id: dto.id,\n danceName: dto.danceName,\n choreographers: dto.choreographers.map(id => toChoreographerModel(choreographerMap[id])),\n stepsheet: dto.stepsheet,\n difficulty: dto.difficulty,\n primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),\n tracks: tracks.map(toTrackModel),\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { CollectionDTO } from '../../types/dto/collection.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { CollectionModel } from '../../types/model/collection.model';\nimport { toDanceModel } from './toDanceModel';\n\nexport function toCollectionModel(\n dto: CollectionDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): CollectionModel {\n const dances = dto.dances.map(id => danceMap[id]).filter(Boolean);\n\n return {\n id: dto._id,\n name: dto.name,\n dances: dances.map(d => toDanceModel(d, trackMap, choreographerMap)),\n isVerified: dto.isVerified,\n createdAt: dto.createdAt,\n updatedAt: dto.updatedAt,\n createdBy: dto.createdBy,\n isCopyable: dto.isCopyable,\n };\n}\n","import { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { DanceEntity } from \"../../types/entities/dance.entity\";\n\nexport function toDanceDTO(\n dance: DanceEntity,\n isVerified: boolean\n): DanceDTO {\n\n return {\n id: dance._id,\n danceName: dance.danceName,\n choreographers: dance.choreographers?.map((id: string) => id) ?? [],\n stepsheet: dance.stepsheet,\n difficulty: dance.difficulty,\n primaryTrack: dance.primaryTrack ?? '',\n tracks: dance.tracks?.map((id: string) => id) ?? [],\n isVerified: isVerified\n };\n};\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorEntity } from \"../../types/entities/instructor.entity\";\n\nexport function toInstructorDTO(\n instructor: InstructorEntity,\n isVerified: boolean\n): InstructorDTO {\n\n return {\n id: instructor._id,\n name: instructor.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorModel } from \"../../types/model/instructor.model\";\n\nexport function toInstructorModel(\n dto: InstructorDTO, \n): InstructorModel {\n\n return {\n id: dto.id,\n name: dto.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: dto.isVerified\n };\n}\n","import { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonEntity } from \"../../types/entities/lesson.entity\";\n\nexport function toLessonDTO(\n LessonEntity: LessonEntity,\n isVerified: boolean\n): LessonDTO {\n\n return {\n id: LessonEntity._id,\n lessonday: LessonEntity.lessonday,\n lessonstart: LessonEntity.lessonstart,\n instructors: LessonEntity.instructors,\n duration: LessonEntity.duration,\n lessoncost: LessonEntity.lessoncost,\n notes: LessonEntity.notes,\n difficulty: LessonEntity.difficulty,\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonModel } from \"../../types/model/lesson.model\";\n\nexport function toLessonModel(\n lessonDTO: LessonDTO,\n instructorMap: Record<string, InstructorDTO>\n): LessonModel {\n\n return {\n id: lessonDTO.id,\n lessonday: lessonDTO.lessonday,\n lessonstart: lessonDTO.lessonstart,\n instructors: lessonDTO.instructors.map(id => instructorMap[id]).filter(Boolean), // TODO: Do I need the converter?\n duration: lessonDTO.duration,\n lessoncost: lessonDTO.lessoncost,\n notes: lessonDTO.notes,\n difficulty: lessonDTO.difficulty,\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackEntity } from \"../../types/entities/track.entity\";\n\nexport function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO {\n return {\n id: dto._id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: isVerified,\n };\n}\n","import { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserAcquaintanceDTO(\n user: UserEntity,\n isVerified: boolean,\n userProfile: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n collections: string[];\n venues: string[];\n friendsCount: number;\n followingCount: number;\n followersCount: number;\n mutualFriendsCount: number;\n }\n): UserAcquaintanceDTO {\n return {\n id: user._id,\n username: user.username || user.name || '',\n image: user.image || '',\n bio: user.bio || '',\n isVerified,\n profile: {\n dances: {\n favorites: userProfile.favorites,\n flagged: userProfile.flagged,\n known: userProfile.known,\n refresh: userProfile.refresh,\n },\n collections: userProfile.collections,\n venues: userProfile.venues,\n friendsCount: userProfile.friendsCount,\n followingCount: userProfile.followingCount,\n followersCount: userProfile.followersCount,\n mutualFriendsCount: userProfile.mutualFriendsCount,\n links: user.links ?? {},\n },\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { CollectionDTO } from \"../../types/dto/collection.dto\";\nimport { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { TrackDTO } from \"../../types/dto/track.dto\";\nimport { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { toCollectionModel } from \"./toCollectionsModel\";\nimport { toDanceModel } from \"./toDanceModel\";\n\nexport function toUserAcquaintanceModel(\n dto: UserAcquaintanceDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n collectionMap: Record<string, CollectionDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): UserAcquaintanceModel {\n\n return {\n id: dto.id,\n username: dto.username,\n image: dto.image,\n bio: dto.bio,\n isVerified: dto.isVerified,\n friendsCount: dto.profile.friendsCount,\n followersCount: dto.profile.followersCount,\n mutualFriendsCount: dto.profile.mutualFriendsCount,\n links: dto.profile.links,\n dances: {\n favorites: dto.profile.dances.favorites.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n flagged: dto.profile.dances.flagged.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n known: dto.profile.dances.known.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n refresh: dto.profile.dances.refresh.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap))\n },\n collections: dto.profile.collections.map(id => toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap)),\n };\n}\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserDTO(\n user: UserEntity,\n isVerified: boolean,\n danceIds: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n },\n collections: string[],\n venues: string[] = [],\n friends: string[] = [],\n following: string[] = [],\n friendsRequested: string[] = [],\n friendRequests: string[] = []\n): UserDTO {\n return {\n _id: user._id.toString(),\n email: user.email ?? '',\n name: user.name ?? '',\n username: user.username ?? '',\n image: user.image ?? '',\n bio: user.bio ?? '',\n isVerified,\n profile: {\n danceIds,\n collections,\n venues,\n friends,\n following,\n links: user.links ?? {},\n friendsRequested,\n friendRequests\n },\n };\n};\n\nexport default toUserDTO;\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { CollectionModel } from \"../../types/model/collection.model\";\nimport { DanceModel } from \"../../types/model/dance.model\";\nimport { UserModel } from \"../../types/model/user.model\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { VenueModel } from \"../../types/model/venue.model\";\n\nexport function toUserModel(\n userDTO: UserDTO,\n danceMap: Record<string, DanceModel>,\n collectionMap: Record<string, CollectionModel>,\n venueMap: Record<string, VenueModel>,\n friendsMap: Record<string, UserAcquaintanceModel>,\n followingMap: Record<string, UserAcquaintanceModel>\n): UserModel {\n const expand = <T>(ids: string[], map: Record<string, T>): T[] => ids.map(id => map[id]).filter(Boolean);\n\n return {\n _id: userDTO._id,\n email: userDTO.email,\n name: userDTO.name,\n username: userDTO.username,\n image: userDTO.image,\n bio: userDTO.bio,\n isVerified: userDTO.isVerified,\n profile: {\n dances: {\n favorites: expand(userDTO.profile.danceIds.favorites, danceMap),\n flagged: expand(userDTO.profile.danceIds.flagged, danceMap),\n known: expand(userDTO.profile.danceIds.known, danceMap),\n refresh: expand(userDTO.profile.danceIds.refresh, danceMap),\n },\n collections: expand(userDTO.profile.collections, collectionMap),\n venues: expand(userDTO.profile.venues, venueMap),\n friends: expand(userDTO.profile.friends, friendsMap),\n following: expand(userDTO.profile.following, followingMap),\n friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),\n friendRequests: expand(userDTO.profile.friendRequests, friendsMap),\n followersCount: userDTO.profile.followersCount || 0,\n links: userDTO.profile.links,\n },\n };\n}\n","import { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueEntity } from \"../../types/entities/venue.entity\";\n\nexport function toVenueDTO(\n venue: VenueEntity,\n lessonIds: string[],\n isVerified: boolean\n): VenueDTO {\n\n return {\n id: venue._id,\n venuename: venue.venuename,\n venueaddress: venue.venueaddress,\n geolocation: venue.geolocation,\n phone: venue.phone,\n website: venue.website,\n contactEmail: venue.contactEmail,\n contactName: venue.contactName,\n contactPhone: venue.contactPhone,\n lessonsIds: lessonIds,\n isVerified: isVerified,\n isDeleted: venue.isDeleted ?? false,\n deletedAt: venue.deletedAt ?? null,\n createdAt: venue.createdAt ?? null,\n };\n}","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueModel } from \"../../types/model/venue.model\";\nimport { toLessonModel } from \"./toLessonModel\";\n\nexport function toVenueModel(\n venueDTO: VenueDTO,\n lessonMap: Record<string, LessonDTO>,\n instructorMap: Record<string, InstructorDTO>\n): VenueModel {\n const expandedLessons = venueDTO.lessonsIds\n .map(id => toLessonModel(lessonMap[id], instructorMap))\n .filter(Boolean);\n\n return {\n ...venueDTO,\n lessons: expandedLessons,\n };\n}\n"],"names":["getAllUserDanceIds","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","filter","item","index","indexOf","itemArrayToItemRecords","arr","reduce","acc","id","toChoreographerDTO","choreographer","isVerified","_id","name","toChoreographerModel","dto","toTrackModel","artists","isrc","uri","duration_ms","explicit","toDanceModel","trackMap","choreographerMap","tracks","map","Boolean","danceName","choreographers","stepsheet","difficulty","primaryTrack","toCollectionModel","danceMap","dances","d","createdAt","updatedAt","createdBy","isCopyable","toDanceDTO","dance","_dance$choreographers","_dance$choreographers2","_dance$primaryTrack","_dance$tracks$map","_dance$tracks","toInstructorDTO","instructor","userid","toInstructorModel","toLessonDTO","LessonEntity","lessonday","lessonstart","instructors","duration","lessoncost","notes","toLessonModel","lessonDTO","instructorMap","toTrackDTO","toUserAcquaintanceDTO","user","userProfile","username","image","bio","profile","collections","venues","friendsCount","followingCount","followersCount","mutualFriendsCount","links","_user$links","toUserAcquaintanceModel","collectionMap","toUserDTO","danceIds","friends","following","friendsRequested","friendRequests","toString","email","_user$email","_user$name","_user$username","_user$image","_user$bio","toUserModel","userDTO","venueMap","friendsMap","followingMap","expand","ids","toVenueDTO","venue","lessonIds","venuename","venueaddress","geolocation","phone","website","contactEmail","contactName","contactPhone","lessonsIds","isDeleted","_venue$isDeleted","deletedAt","_venue$deletedAt","_venue$createdAt","toVenueModel","venueDTO","lessonMap","expandedLessons","_extends","lessons"],"mappings":";;;;SAGgBA,kBAAkBA,CAACC,UAAsB;EACrD,IAAAC,IAAA,GAAmED,UAAU,WAAVA,UAAU,GAAI,EAAE;IAAAE,cAAA,GAAAD,IAAA,CAA3EE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,EAAE,GAAAA,cAAA;IAAAE,YAAA,GAAAH,IAAA,CAAEI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;IAAAE,UAAA,GAAAL,IAAA,CAAEM,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,EAAE,GAAAA,UAAA;IAAAE,YAAA,GAAAP,IAAA,CAAEQ,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;EAE9D,IAAME,GAAG,MAAAC,MAAA,CACFR,SAAS,EACTE,OAAO,EACPE,KAAK,EACLE,OAAO,CACb;EAED,OAAOC,GAAG,CAACE,MAAM,CAAC,UAACC,IAAI,EAAEC,KAAK;IAAA,OAAKJ,GAAG,CAACK,OAAO,CAACF,IAAI,CAAC,KAAKC,KAAK;IAAC;AACnE;;SCdgBE,sBAAsBA,CAA2BC,GAAQ;EACvE,OAAOA,GAAG,CAACC,MAAM,CAAC,UAACC,GAAG,EAAEN,IAAI;IAC1BM,GAAG,CAACN,IAAI,CAACO,EAAE,CAAC,GAAGP,IAAI;IACnB,OAAOM,GAAG;GACX,EAAE,EAAuB,CAAC;AAC7B;;SCFgBE,kBAA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WAAW;IAC9BC,KAAK,EAAEL,KAAK,CAACK,KAAK;IAClBC,OAAO,EAAEN,KAAK,CAACM,OAAO;IACtBC,YAAY,EAAEP,KAAK,CAACO,YAAY;IAChCC,WAAW,EAAER,KAAK,CAACQ,WAAW;IAC9BC,YAAY,EAAET,KAAK,CAACS,YAAY;IAChCC,UAAU,EAAET,SAAS;IACrB5F,UAAU,EAAEA,UAAU;IACtBsG,SAAS,GAAAC,gBAAA,GAAEZ,KAAK,CAACW,SAAS,YAAAC,gBAAA,GAAI,KAAK;IACnCC,SAAS,GAAAC,gBAAA,GAAEd,KAAK,CAACa,SAAS,YAAAC,gBAAA,GAAI,IAAI;IAClC/E,SAAS,GAAAgF,gBAAA,GAAEf,KAAK,CAACjE,SAAS,YAAAgF,gBAAA,GAAI;GACjC;AACL;;;;;;;;;;;;SCnBgBC,YAAYA,CACxBC,QAAkB,EAClBC,SAAoC,EACpC1D,aAA4C;EAE5C,IAAM2D,eAAe,GAAGF,QAAQ,CAACP,UAAU,CACtCtF,GAAG,CAAC,UAAAlB,EAAE;IAAA,OAAIoD,aAAa,CAAC4D,SAAS,CAAChH,EAAE,CAAC,EAAEsD,aAAa,CAAC;IAAC,CACtD9D,MAAM,CAAC2B,OAAO,CAAC;EAEpB,OAAA+F,QAAA,KACOH,QAAQ;IACXI,OAAO,EAAEF;;AAEjB;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return{id:e.id,name:e.name,isVerified:e.isVerified}}function n(e){return{id:e.id,name:e.name,artists:e.artists,isrc:e.isrc,uri:e.uri,duration_ms:e.duration_ms,explicit:e.explicit,isVerified:e.isVerified}}function i(i,r,t){var o=i.tracks.map((function(e){return r[e]})).filter(Boolean);return{id:i.id,danceName:i.danceName,choreographers:i.choreographers.map((function(n){return e(t[n])})),stepsheet:i.stepsheet,difficulty:i.difficulty,primaryTrack:n(r[i.primaryTrack]),tracks:o.map(n),isVerified:i.isVerified}}function r(e,n,r,t){var o=e.dances.map((function(e){return n[e]})).filter(Boolean);return{id:e._id,name:e.name,dances:o.map((function(e){return i(e,r,t)})),isVerified:e.isVerified,createdAt:e.createdAt,updatedAt:e.updatedAt,createdBy:e.createdBy,isCopyable:e.isCopyable}}function t(e,n){return{id:e.id,lessonday:e.lessonday,lessonstart:e.lessonstart,instructors:e.instructors.map((function(e){return n[e]})).filter(Boolean),duration:e.duration,lessoncost:e.lessoncost,notes:e.notes,difficulty:e.difficulty}}function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllUserDanceIds=function(e){var n=null!=e?e:{},i=n.favorites,r=n.flagged,t=n.known,o=n.refresh,s=[].concat(void 0===i?[]:i,void 0===r?[]:r,void 0===t?[]:t,void 0===o?[]:o);return s.filter((function(e,n){return s.indexOf(e)===n}))},exports.toChoreographerDTO=function(e,n){return{id:e._id,name:e.name,isVerified:n}},exports.toChoreographerModel=e,exports.toCollectionModel=r,exports.toDanceDTO=function(e,n){var i,r,t,o,s;return{id:e._id,danceName:e.danceName,choreographers:null!=(i=null==(r=e.choreographers)?void 0:r.map((function(e){return e})))?i:[],stepsheet:e.stepsheet,difficulty:e.difficulty,primaryTrack:null!=(t=e.primaryTrack)?t:"",tracks:null!=(o=null==(s=e.tracks)?void 0:s.map((function(e){return e})))?o:[],isVerified:n}},exports.toDanceModel=i,exports.toInstructorDTO=function(e,n){return{id:e._id,name:e.name,userid:"leave this this empty for now and figure it out later...",isVerified:n}},exports.toInstructorModel=function(e){return{id:e.id,name:e.name,userid:"leave this this empty for now and figure it out later...",isVerified:e.isVerified}},exports.toLessonDTO=function(e,n){return{id:e._id,lessonday:e.lessonday,lessonstart:e.lessonstart,instructors:e.instructors,duration:e.duration,lessoncost:e.lessoncost,notes:e.notes,difficulty:e.difficulty,isVerified:n}},exports.toLessonModel=t,exports.toTrackDTO=function(e,n){return{id:e._id,name:e.name,artists:e.artists,isrc:e.isrc,uri:e.uri,duration_ms:e.duration_ms,explicit:e.explicit,isVerified:n}},exports.toTrackModel=n,exports.toUserAcquaintanceDTO=function(e,n,i){var r;return{id:e._id,username:e.username||e.name||"",image:e.image||"",bio:e.bio||"",isVerified:n,profile:{dances:{favorites:i.favorites,flagged:i.flagged,known:i.known,refresh:i.refresh},collections:i.collections,venues:i.venues,friendsCount:i.friendsCount,followingCount:i.followingCount,followersCount:i.followersCount,mutualFriendsCount:i.mutualFriendsCount,links:null!=(r=e.links)?r:{}}}},exports.toUserAcquaintanceModel=function(e,n,t,o,s){return{id:e.id,username:e.username,image:e.image,bio:e.bio,isVerified:e.isVerified,friendsCount:e.profile.friendsCount,followersCount:e.profile.followersCount,mutualFriendsCount:e.profile.mutualFriendsCount,links:e.profile.links,dances:{favorites:e.profile.dances.favorites.map((function(e){return i(n[e],t,s)})),flagged:e.profile.dances.flagged.map((function(e){return i(n[e],t,s)})),known:e.profile.dances.known.map((function(e){return i(n[e],t,s)})),refresh:e.profile.dances.refresh.map((function(e){return i(n[e],t,s)}))},collections:e.profile.collections.map((function(e){return r(o[e],n,t,s)}))}},exports.toUserDTO=function(e,n,i,r,t,o,s,a,l){var u,d,f,c,p,m;return void 0===t&&(t=[]),void 0===o&&(o=[]),void 0===s&&(s=[]),void 0===a&&(a=[]),void 0===l&&(l=[]),{_id:e._id.toString(),email:null!=(u=e.email)?u:"",name:null!=(d=e.name)?d:"",username:null!=(f=e.username)?f:"",image:null!=(c=e.image)?c:"",bio:null!=(p=e.bio)?p:"",isVerified:n,profile:{danceIds:i,collections:r,venues:t,friends:o,following:s,links:null!=(m=e.links)?m:{},friendsRequested:a,friendRequests:l}}},exports.toUserModel=function(e,n,i,r,t,o){var s=function(e,n){return e.map((function(e){return n[e]})).filter(Boolean)};return{_id:e._id,email:e.email,name:e.name,username:e.username,image:e.image,bio:e.bio,isVerified:e.isVerified,profile:{dances:{favorites:s(e.profile.danceIds.favorites,n),flagged:s(e.profile.danceIds.flagged,n),known:s(e.profile.danceIds.known,n),refresh:s(e.profile.danceIds.refresh,n)},collections:s(e.profile.collections,i),venues:s(e.profile.venues,r),friends:s(e.profile.friends,t),following:s(e.profile.following,o),friendsRequested:s(e.profile.friendsRequested,t),friendRequests:s(e.profile.friendRequests,t),followersCount:e.profile.followersCount||0,links:e.profile.links}}},exports.toVenueDTO=function(e,n,i){var r,t,o;return{id:e._id,venuename:e.venuename,venueaddress:e.venueaddress,geolocation:e.geolocation,phone:e.phone,website:e.website,contactEmail:e.contactEmail,contactName:e.contactName,contactPhone:e.contactPhone,lessonsIds:n,isVerified:i,isDeleted:null!=(r=e.isDeleted)&&r,deletedAt:null!=(t=e.deletedAt)?t:null,createdAt:null!=(o=e.createdAt)?o:null}},exports.toVenueModel=function(e,n,i){var r=e.lessonsIds.map((function(e){return t(n[e],i)})).filter(Boolean);return o({},e,{lessons:r})};
1
+ "use strict";function e(e){return{id:e.id,name:e.name,isVerified:e.isVerified}}function n(e){return{id:e.id,name:e.name,artists:e.artists,isrc:e.isrc,uri:e.uri,duration_ms:e.duration_ms,explicit:e.explicit,isVerified:e.isVerified}}function i(i,r,t){var o=i.tracks.map((function(e){return r[e]})).filter(Boolean);return{id:i.id,danceName:i.danceName,choreographers:i.choreographers.map((function(n){return e(t[n])})),stepsheet:i.stepsheet,difficulty:i.difficulty,primaryTrack:n(r[i.primaryTrack]),tracks:o.map(n),isVerified:i.isVerified}}function r(e,n,r,t){var o=e.dances.map((function(e){return n[e]})).filter(Boolean);return{id:e._id,name:e.name,dances:o.map((function(e){return i(e,r,t)})),isVerified:e.isVerified,createdAt:e.createdAt,updatedAt:e.updatedAt,createdBy:e.createdBy,isCopyable:e.isCopyable}}function t(e,n){return{id:e.id,lessonday:e.lessonday,lessonstart:e.lessonstart,instructors:e.instructors.map((function(e){return n[e]})).filter(Boolean),duration:e.duration,lessoncost:e.lessoncost,notes:e.notes,difficulty:e.difficulty}}function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllUserDanceIds=function(e){var n=null!=e?e:{},i=n.favorites,r=n.flagged,t=n.known,o=n.refresh,s=[].concat(void 0===i?[]:i,void 0===r?[]:r,void 0===t?[]:t,void 0===o?[]:o);return s.filter((function(e,n){return s.indexOf(e)===n}))},exports.itemArrayToItemRecords=function(e){return e.reduce((function(e,n){return e[n.id]=n,e}),{})},exports.toChoreographerDTO=function(e,n){return{id:e._id,name:e.name,isVerified:n}},exports.toChoreographerModel=e,exports.toCollectionModel=r,exports.toDanceDTO=function(e,n){var i,r,t,o,s;return{id:e._id,danceName:e.danceName,choreographers:null!=(i=null==(r=e.choreographers)?void 0:r.map((function(e){return e})))?i:[],stepsheet:e.stepsheet,difficulty:e.difficulty,primaryTrack:null!=(t=e.primaryTrack)?t:"",tracks:null!=(o=null==(s=e.tracks)?void 0:s.map((function(e){return e})))?o:[],isVerified:n}},exports.toDanceModel=i,exports.toInstructorDTO=function(e,n){return{id:e._id,name:e.name,userid:"leave this this empty for now and figure it out later...",isVerified:n}},exports.toInstructorModel=function(e){return{id:e.id,name:e.name,userid:"leave this this empty for now and figure it out later...",isVerified:e.isVerified}},exports.toLessonDTO=function(e,n){return{id:e._id,lessonday:e.lessonday,lessonstart:e.lessonstart,instructors:e.instructors,duration:e.duration,lessoncost:e.lessoncost,notes:e.notes,difficulty:e.difficulty,isVerified:n}},exports.toLessonModel=t,exports.toTrackDTO=function(e,n){return{id:e._id,name:e.name,artists:e.artists,isrc:e.isrc,uri:e.uri,duration_ms:e.duration_ms,explicit:e.explicit,isVerified:n}},exports.toTrackModel=n,exports.toUserAcquaintanceDTO=function(e,n,i){var r;return{id:e._id,username:e.username||e.name||"",image:e.image||"",bio:e.bio||"",isVerified:n,profile:{dances:{favorites:i.favorites,flagged:i.flagged,known:i.known,refresh:i.refresh},collections:i.collections,venues:i.venues,friendsCount:i.friendsCount,followingCount:i.followingCount,followersCount:i.followersCount,mutualFriendsCount:i.mutualFriendsCount,links:null!=(r=e.links)?r:{}}}},exports.toUserAcquaintanceModel=function(e,n,t,o,s){return{id:e.id,username:e.username,image:e.image,bio:e.bio,isVerified:e.isVerified,friendsCount:e.profile.friendsCount,followersCount:e.profile.followersCount,mutualFriendsCount:e.profile.mutualFriendsCount,links:e.profile.links,dances:{favorites:e.profile.dances.favorites.map((function(e){return i(n[e],t,s)})),flagged:e.profile.dances.flagged.map((function(e){return i(n[e],t,s)})),known:e.profile.dances.known.map((function(e){return i(n[e],t,s)})),refresh:e.profile.dances.refresh.map((function(e){return i(n[e],t,s)}))},collections:e.profile.collections.map((function(e){return r(o[e],n,t,s)}))}},exports.toUserDTO=function(e,n,i,r,t,o,s,a,l){var u,d,f,c,p,m;return void 0===t&&(t=[]),void 0===o&&(o=[]),void 0===s&&(s=[]),void 0===a&&(a=[]),void 0===l&&(l=[]),{_id:e._id.toString(),email:null!=(u=e.email)?u:"",name:null!=(d=e.name)?d:"",username:null!=(f=e.username)?f:"",image:null!=(c=e.image)?c:"",bio:null!=(p=e.bio)?p:"",isVerified:n,profile:{danceIds:i,collections:r,venues:t,friends:o,following:s,links:null!=(m=e.links)?m:{},friendsRequested:a,friendRequests:l}}},exports.toUserModel=function(e,n,i,r,t,o){var s=function(e,n){return e.map((function(e){return n[e]})).filter(Boolean)};return{_id:e._id,email:e.email,name:e.name,username:e.username,image:e.image,bio:e.bio,isVerified:e.isVerified,profile:{dances:{favorites:s(e.profile.danceIds.favorites,n),flagged:s(e.profile.danceIds.flagged,n),known:s(e.profile.danceIds.known,n),refresh:s(e.profile.danceIds.refresh,n)},collections:s(e.profile.collections,i),venues:s(e.profile.venues,r),friends:s(e.profile.friends,t),following:s(e.profile.following,o),friendsRequested:s(e.profile.friendsRequested,t),friendRequests:s(e.profile.friendRequests,t),followersCount:e.profile.followersCount||0,links:e.profile.links}}},exports.toVenueDTO=function(e,n,i){var r,t,o;return{id:e._id,venuename:e.venuename,venueaddress:e.venueaddress,geolocation:e.geolocation,phone:e.phone,website:e.website,contactEmail:e.contactEmail,contactName:e.contactName,contactPhone:e.contactPhone,lessonsIds:n,isVerified:i,isDeleted:null!=(r=e.isDeleted)&&r,deletedAt:null!=(t=e.deletedAt)?t:null,createdAt:null!=(o=e.createdAt)?o:null}},exports.toVenueModel=function(e,n,i){var r=e.lessonsIds.map((function(e){return t(n[e],i)})).filter(Boolean);return o({},e,{lessons:r})};
2
2
  //# sourceMappingURL=ldco-contract.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ldco-contract.cjs.production.min.js","sources":["../src/lib/converters/toChoreographerModel.ts","../src/lib/converters/toTrackModel.ts","../src/lib/converters/toDanceModel.ts","../src/lib/converters/toCollectionsModel.ts","../src/lib/converters/toLessonModel.ts","../src/lib/getAllUserDanceIds.ts","../src/lib/converters/toChoreographerDTO.ts","../src/lib/converters/toDanceDTO.ts","../src/lib/converters/toInstructorDTO.ts","../src/lib/converters/toInstructorModel.ts","../src/lib/converters/toLessonDTO.ts","../src/lib/converters/toTrackDTO.ts","../src/lib/converters/toUserAcquaintanceDTO.ts","../src/lib/converters/toUserAcquaintanceModel.ts","../src/lib/converters/toUserDTO.ts","../src/lib/converters/toUserModel.ts","../src/lib/converters/toVenueDTO.ts","../src/lib/converters/toVenueModel.ts"],"sourcesContent":["import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { ChoreographerModel } from \"../../types/model/choreographer.model\";\n\nexport function toChoreographerModel(\n dto: ChoreographerDTO\n): ChoreographerModel {\n\n return {\n id: dto.id,\n name: dto.name,\n isVerified: dto.isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackModel } from \"../../types/model/track.model\";\n\nexport function toTrackModel(dto: TrackDTO): TrackModel {\n return {\n id: dto.id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { DanceModel } from '../../types/model/dance.model';\nimport { toChoreographerModel } from './toChoreographerModel';\nimport { toTrackModel } from './toTrackModel';\n\nexport function toDanceModel(\n dto: DanceDTO,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): DanceModel {\n\n const tracks = dto.tracks\n .map(id => trackMap[id])\n .filter(Boolean);\n\n return {\n id: dto.id,\n danceName: dto.danceName,\n choreographers: dto.choreographers.map(id => toChoreographerModel(choreographerMap[id])),\n stepsheet: dto.stepsheet,\n difficulty: dto.difficulty,\n primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),\n tracks: tracks.map(toTrackModel),\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { CollectionDTO } from '../../types/dto/collection.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { CollectionModel } from '../../types/model/collection.model';\nimport { toDanceModel } from './toDanceModel';\n\nexport function toCollectionModel(\n dto: CollectionDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): CollectionModel {\n const dances = dto.dances.map(id => danceMap[id]).filter(Boolean);\n\n return {\n id: dto._id,\n name: dto.name,\n dances: dances.map(d => toDanceModel(d, trackMap, choreographerMap)),\n isVerified: dto.isVerified,\n createdAt: dto.createdAt,\n updatedAt: dto.updatedAt,\n createdBy: dto.createdBy,\n isCopyable: dto.isCopyable,\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonModel } from \"../../types/model/lesson.model\";\n\nexport function toLessonModel(\n lessonDTO: LessonDTO,\n instructorMap: Record<string, InstructorDTO>\n): LessonModel {\n\n return {\n id: lessonDTO.id,\n lessonday: lessonDTO.lessonday,\n lessonstart: lessonDTO.lessonstart,\n instructors: lessonDTO.instructors.map(id => instructorMap[id]).filter(Boolean), // TODO: Do I need the converter?\n duration: lessonDTO.duration,\n lessoncost: lessonDTO.lessoncost,\n notes: lessonDTO.notes,\n difficulty: lessonDTO.difficulty,\n };\n}\n","import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { ChoreographerEntity } from '../../types/entities/choreographer.entity';\n\nexport function toChoreographerDTO(\n choreographer: ChoreographerEntity,\n isVerified: boolean\n): ChoreographerDTO {\n\n return {\n id: choreographer._id,\n name: choreographer.name,\n isVerified: isVerified\n };\n}\n","import { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { DanceEntity } from \"../../types/entities/dance.entity\";\n\nexport function toDanceDTO(\n dance: DanceEntity,\n isVerified: boolean\n): DanceDTO {\n\n return {\n id: dance._id,\n danceName: dance.danceName,\n choreographers: dance.choreographers?.map((id: string) => id) ?? [],\n stepsheet: dance.stepsheet,\n difficulty: dance.difficulty,\n primaryTrack: dance.primaryTrack ?? '',\n tracks: dance.tracks?.map((id: string) => id) ?? [],\n isVerified: isVerified\n };\n};\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorEntity } from \"../../types/entities/instructor.entity\";\n\nexport function toInstructorDTO(\n instructor: InstructorEntity,\n isVerified: boolean\n): InstructorDTO {\n\n return {\n id: instructor._id,\n name: instructor.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorModel } from \"../../types/model/instructor.model\";\n\nexport function toInstructorModel(\n dto: InstructorDTO, \n): InstructorModel {\n\n return {\n id: dto.id,\n name: dto.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: dto.isVerified\n };\n}\n","import { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonEntity } from \"../../types/entities/lesson.entity\";\n\nexport function toLessonDTO(\n LessonEntity: LessonEntity,\n isVerified: boolean\n): LessonDTO {\n\n return {\n id: LessonEntity._id,\n lessonday: LessonEntity.lessonday,\n lessonstart: LessonEntity.lessonstart,\n instructors: LessonEntity.instructors,\n duration: LessonEntity.duration,\n lessoncost: LessonEntity.lessoncost,\n notes: LessonEntity.notes,\n difficulty: LessonEntity.difficulty,\n isVerified: isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackEntity } from \"../../types/entities/track.entity\";\n\nexport function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO {\n return {\n id: dto._id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: isVerified,\n };\n}\n","import { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserAcquaintanceDTO(\n user: UserEntity,\n isVerified: boolean,\n userProfile: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n collections: string[];\n venues: string[];\n friendsCount: number;\n followingCount: number;\n followersCount: number;\n mutualFriendsCount: number;\n }\n): UserAcquaintanceDTO {\n return {\n id: user._id,\n username: user.username || user.name || '',\n image: user.image || '',\n bio: user.bio || '',\n isVerified,\n profile: {\n dances: {\n favorites: userProfile.favorites,\n flagged: userProfile.flagged,\n known: userProfile.known,\n refresh: userProfile.refresh,\n },\n collections: userProfile.collections,\n venues: userProfile.venues,\n friendsCount: userProfile.friendsCount,\n followingCount: userProfile.followingCount,\n followersCount: userProfile.followersCount,\n mutualFriendsCount: userProfile.mutualFriendsCount,\n links: user.links ?? {},\n },\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { CollectionDTO } from \"../../types/dto/collection.dto\";\nimport { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { TrackDTO } from \"../../types/dto/track.dto\";\nimport { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { toCollectionModel } from \"./toCollectionsModel\";\nimport { toDanceModel } from \"./toDanceModel\";\n\nexport function toUserAcquaintanceModel(\n dto: UserAcquaintanceDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n collectionMap: Record<string, CollectionDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): UserAcquaintanceModel {\n\n return {\n id: dto.id,\n username: dto.username,\n image: dto.image,\n bio: dto.bio,\n isVerified: dto.isVerified,\n friendsCount: dto.profile.friendsCount,\n followersCount: dto.profile.followersCount,\n mutualFriendsCount: dto.profile.mutualFriendsCount,\n links: dto.profile.links,\n dances: {\n favorites: dto.profile.dances.favorites.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n flagged: dto.profile.dances.flagged.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n known: dto.profile.dances.known.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n refresh: dto.profile.dances.refresh.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap))\n },\n collections: dto.profile.collections.map(id => toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap)),\n };\n}\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserDTO(\n user: UserEntity,\n isVerified: boolean,\n danceIds: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n },\n collections: string[],\n venues: string[] = [],\n friends: string[] = [],\n following: string[] = [],\n friendsRequested: string[] = [],\n friendRequests: string[] = []\n): UserDTO {\n return {\n _id: user._id.toString(),\n email: user.email ?? '',\n name: user.name ?? '',\n username: user.username ?? '',\n image: user.image ?? '',\n bio: user.bio ?? '',\n isVerified,\n profile: {\n danceIds,\n collections,\n venues,\n friends,\n following,\n links: user.links ?? {},\n friendsRequested,\n friendRequests\n },\n };\n};\n\nexport default toUserDTO;\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { CollectionModel } from \"../../types/model/collection.model\";\nimport { DanceModel } from \"../../types/model/dance.model\";\nimport { UserModel } from \"../../types/model/user.model\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { VenueModel } from \"../../types/model/venue.model\";\n\nexport function toUserModel(\n userDTO: UserDTO,\n danceMap: Record<string, DanceModel>,\n collectionMap: Record<string, CollectionModel>,\n venueMap: Record<string, VenueModel>,\n friendsMap: Record<string, UserAcquaintanceModel>,\n followingMap: Record<string, UserAcquaintanceModel>\n): UserModel {\n const expand = <T>(ids: string[], map: Record<string, T>): T[] => ids.map(id => map[id]).filter(Boolean);\n\n return {\n _id: userDTO._id,\n email: userDTO.email,\n name: userDTO.name,\n username: userDTO.username,\n image: userDTO.image,\n bio: userDTO.bio,\n isVerified: userDTO.isVerified,\n profile: {\n dances: {\n favorites: expand(userDTO.profile.danceIds.favorites, danceMap),\n flagged: expand(userDTO.profile.danceIds.flagged, danceMap),\n known: expand(userDTO.profile.danceIds.known, danceMap),\n refresh: expand(userDTO.profile.danceIds.refresh, danceMap),\n },\n collections: expand(userDTO.profile.collections, collectionMap),\n venues: expand(userDTO.profile.venues, venueMap),\n friends: expand(userDTO.profile.friends, friendsMap),\n following: expand(userDTO.profile.following, followingMap),\n friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),\n friendRequests: expand(userDTO.profile.friendRequests, friendsMap),\n followersCount: userDTO.profile.followersCount || 0,\n links: userDTO.profile.links,\n },\n };\n}\n","import { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueEntity } from \"../../types/entities/venue.entity\";\n\nexport function toVenueDTO(\n venue: VenueEntity,\n lessonIds: string[],\n isVerified: boolean\n): VenueDTO {\n\n return {\n id: venue._id,\n venuename: venue.venuename,\n venueaddress: venue.venueaddress,\n geolocation: venue.geolocation,\n phone: venue.phone,\n website: venue.website,\n contactEmail: venue.contactEmail,\n contactName: venue.contactName,\n contactPhone: venue.contactPhone,\n lessonsIds: lessonIds,\n isVerified: isVerified,\n isDeleted: venue.isDeleted ?? false,\n deletedAt: venue.deletedAt ?? null,\n createdAt: venue.createdAt ?? null,\n };\n}","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueModel } from \"../../types/model/venue.model\";\nimport { toLessonModel } from \"./toLessonModel\";\n\nexport function toVenueModel(\n venueDTO: VenueDTO,\n lessonMap: Record<string, LessonDTO>,\n instructorMap: Record<string, InstructorDTO>\n): VenueModel {\n const expandedLessons = venueDTO.lessonsIds\n .map(id => toLessonModel(lessonMap[id], instructorMap))\n .filter(Boolean);\n\n return {\n ...venueDTO,\n lessons: expandedLessons,\n };\n}\n"],"names":["toChoreographerModel","dto","id","name","isVerified","toTrackModel","artists","isrc","uri","duration_ms","explicit","toDanceModel","trackMap","choreographerMap","tracks","map","filter","Boolean","danceName","choreographers","stepsheet","difficulty","primaryTrack","toCollectionModel","danceMap","dances","_id","d","createdAt","updatedAt","createdBy","isCopyable","toLessonModel","lessonDTO","instructorMap","lessonday","lessonstart","instructors","duration","lessoncost","notes","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","item","index","indexOf","choreographer","dance","_dance$choreographers","_dance$choreographers2","_dance$primaryTrack","_dance$tracks$map","_dance$tracks","instructor","userid","LessonEntity","user","userProfile","username","image","bio","profile","collections","venues","friendsCount","followingCount","followersCount","mutualFriendsCount","links","_user$links","collectionMap","danceIds","friends","following","friendsRequested","friendRequests","toString","email","_user$email","_user$name","_user$username","_user$image","_user$bio","userDTO","venueMap","friendsMap","followingMap","expand","ids","venue","lessonIds","venuename","venueaddress","geolocation","phone","website","contactEmail","contactName","contactPhone","lessonsIds","isDeleted","_venue$isDeleted","deletedAt","_venue$deletedAt","_venue$createdAt","venueDTO","lessonMap","expandedLessons","_extends","lessons"],"mappings":"sBAGgBA,EACZC,GAGF,MAAO,CACLC,GAAID,EAAIC,GACRC,KAAMF,EAAIE,KACVC,WAAYH,EAAIG,qBCPJC,EAAaJ,GAC3B,MAAO,CACLC,GAAID,EAAIC,GACRC,KAAMF,EAAIE,KACVG,QAASL,EAAIK,QACbC,KAAMN,EAAIM,KACVC,IAAKP,EAAIO,IACTC,YAAaR,EAAIQ,YACjBC,SAAUT,EAAIS,SACdN,WAAYH,EAAIG,qBCLJO,EACdV,EACAW,EACAC,GAGA,IAAMC,EAASb,EAAIa,OAChBC,KAAI,SAAAb,GAAE,OAAIU,EAASV,MACnBc,OAAOC,SAEV,MAAO,CACLf,GAAID,EAAIC,GACRgB,UAAWjB,EAAIiB,UACfC,eAAgBlB,EAAIkB,eAAeJ,KAAI,SAAAb,GAAE,OAAIF,EAAqBa,EAAiBX,OACnFkB,UAAWnB,EAAImB,UACfC,WAAYpB,EAAIoB,WAChBC,aAAcjB,EAAaO,EAASX,EAAIqB,eACxCR,OAAQA,EAAOC,IAAIV,GACnBD,WAAYH,EAAIG,qBClBJmB,EACZtB,EACAuB,EACAZ,EACAC,GAEA,IAAMY,EAASxB,EAAIwB,OAAOV,KAAI,SAAAb,GAAE,OAAIsB,EAAStB,MAAKc,OAAOC,SAEzD,MAAO,CACHf,GAAID,EAAIyB,IACRvB,KAAMF,EAAIE,KACVsB,OAAQA,EAAOV,K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,YAAaR,EAAMQ,YACnBC,aAAcT,EAAMS,aACpBC,WAAYT,EACZhG,WAAYA,EACZ0G,iBAASC,EAAEZ,EAAMW,YAASC,EAC1BC,iBAASC,EAAEd,EAAMa,WAASC,EAAI,KAC9BrF,iBAASsF,EAAEf,EAAMvE,WAASsF,EAAI,qCChBlCC,EACAC,EACAlF,GAEA,IAAMmF,EAAkBF,EAASN,WAC5B9F,KAAI,SAAAb,GAAE,OAAI8B,EAAcoF,EAAUlH,GAAKgC,MACvClB,OAAOC,SAEZ,OAAAqG,KACOH,GACHI,QAASF"}
1
+ {"version":3,"file":"ldco-contract.cjs.production.min.js","sources":["../src/lib/converters/toChoreographerModel.ts","../src/lib/converters/toTrackModel.ts","../src/lib/converters/toDanceModel.ts","../src/lib/converters/toCollectionsModel.ts","../src/lib/converters/toLessonModel.ts","../src/lib/getAllUserDanceIds.ts","../src/lib/itemArrayToItemRecords.ts","../src/lib/converters/toChoreographerDTO.ts","../src/lib/converters/toDanceDTO.ts","../src/lib/converters/toInstructorDTO.ts","../src/lib/converters/toInstructorModel.ts","../src/lib/converters/toLessonDTO.ts","../src/lib/converters/toTrackDTO.ts","../src/lib/converters/toUserAcquaintanceDTO.ts","../src/lib/converters/toUserAcquaintanceModel.ts","../src/lib/converters/toUserDTO.ts","../src/lib/converters/toUserModel.ts","../src/lib/converters/toVenueDTO.ts","../src/lib/converters/toVenueModel.ts"],"sourcesContent":["import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { ChoreographerModel } from \"../../types/model/choreographer.model\";\n\nexport function toChoreographerModel(\n dto: ChoreographerDTO\n): ChoreographerModel {\n\n return {\n id: dto.id,\n name: dto.name,\n isVerified: dto.isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackModel } from \"../../types/model/track.model\";\n\nexport function toTrackModel(dto: TrackDTO): TrackModel {\n return {\n id: dto.id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { DanceModel } from '../../types/model/dance.model';\nimport { toChoreographerModel } from './toChoreographerModel';\nimport { toTrackModel } from './toTrackModel';\n\nexport function toDanceModel(\n dto: DanceDTO,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): DanceModel {\n\n const tracks = dto.tracks\n .map(id => trackMap[id])\n .filter(Boolean);\n\n return {\n id: dto.id,\n danceName: dto.danceName,\n choreographers: dto.choreographers.map(id => toChoreographerModel(choreographerMap[id])),\n stepsheet: dto.stepsheet,\n difficulty: dto.difficulty,\n primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),\n tracks: tracks.map(toTrackModel),\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { CollectionDTO } from '../../types/dto/collection.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { CollectionModel } from '../../types/model/collection.model';\nimport { toDanceModel } from './toDanceModel';\n\nexport function toCollectionModel(\n dto: CollectionDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): CollectionModel {\n const dances = dto.dances.map(id => danceMap[id]).filter(Boolean);\n\n return {\n id: dto._id,\n name: dto.name,\n dances: dances.map(d => toDanceModel(d, trackMap, choreographerMap)),\n isVerified: dto.isVerified,\n createdAt: dto.createdAt,\n updatedAt: dto.updatedAt,\n createdBy: dto.createdBy,\n isCopyable: dto.isCopyable,\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonModel } from \"../../types/model/lesson.model\";\n\nexport function toLessonModel(\n lessonDTO: LessonDTO,\n instructorMap: Record<string, InstructorDTO>\n): LessonModel {\n\n return {\n id: lessonDTO.id,\n lessonday: lessonDTO.lessonday,\n lessonstart: lessonDTO.lessonstart,\n instructors: lessonDTO.instructors.map(id => instructorMap[id]).filter(Boolean), // TODO: Do I need the converter?\n duration: lessonDTO.duration,\n lessoncost: lessonDTO.lessoncost,\n notes: lessonDTO.notes,\n difficulty: lessonDTO.difficulty,\n };\n}\n","import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}","export function itemArrayToItemRecords<T extends { id: string }>(arr: T[]): Record<string, T> {\n return arr.reduce((acc, item) => {\n acc[item.id] = item;\n return acc;\n }, {} as Record<string, T>);\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { ChoreographerEntity } from '../../types/entities/choreographer.entity';\n\nexport function toChoreographerDTO(\n choreographer: ChoreographerEntity,\n isVerified: boolean\n): ChoreographerDTO {\n\n return {\n id: choreographer._id,\n name: choreographer.name,\n isVerified: isVerified\n };\n}\n","import { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { DanceEntity } from \"../../types/entities/dance.entity\";\n\nexport function toDanceDTO(\n dance: DanceEntity,\n isVerified: boolean\n): DanceDTO {\n\n return {\n id: dance._id,\n danceName: dance.danceName,\n choreographers: dance.choreographers?.map((id: string) => id) ?? [],\n stepsheet: dance.stepsheet,\n difficulty: dance.difficulty,\n primaryTrack: dance.primaryTrack ?? '',\n tracks: dance.tracks?.map((id: string) => id) ?? [],\n isVerified: isVerified\n };\n};\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorEntity } from \"../../types/entities/instructor.entity\";\n\nexport function toInstructorDTO(\n instructor: InstructorEntity,\n isVerified: boolean\n): InstructorDTO {\n\n return {\n id: instructor._id,\n name: instructor.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorModel } from \"../../types/model/instructor.model\";\n\nexport function toInstructorModel(\n dto: InstructorDTO, \n): InstructorModel {\n\n return {\n id: dto.id,\n name: dto.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: dto.isVerified\n };\n}\n","import { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonEntity } from \"../../types/entities/lesson.entity\";\n\nexport function toLessonDTO(\n LessonEntity: LessonEntity,\n isVerified: boolean\n): LessonDTO {\n\n return {\n id: LessonEntity._id,\n lessonday: LessonEntity.lessonday,\n lessonstart: LessonEntity.lessonstart,\n instructors: LessonEntity.instructors,\n duration: LessonEntity.duration,\n lessoncost: LessonEntity.lessoncost,\n notes: LessonEntity.notes,\n difficulty: LessonEntity.difficulty,\n isVerified: isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackEntity } from \"../../types/entities/track.entity\";\n\nexport function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO {\n return {\n id: dto._id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: isVerified,\n };\n}\n","import { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserAcquaintanceDTO(\n user: UserEntity,\n isVerified: boolean,\n userProfile: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n collections: string[];\n venues: string[];\n friendsCount: number;\n followingCount: number;\n followersCount: number;\n mutualFriendsCount: number;\n }\n): UserAcquaintanceDTO {\n return {\n id: user._id,\n username: user.username || user.name || '',\n image: user.image || '',\n bio: user.bio || '',\n isVerified,\n profile: {\n dances: {\n favorites: userProfile.favorites,\n flagged: userProfile.flagged,\n known: userProfile.known,\n refresh: userProfile.refresh,\n },\n collections: userProfile.collections,\n venues: userProfile.venues,\n friendsCount: userProfile.friendsCount,\n followingCount: userProfile.followingCount,\n followersCount: userProfile.followersCount,\n mutualFriendsCount: userProfile.mutualFriendsCount,\n links: user.links ?? {},\n },\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { CollectionDTO } from \"../../types/dto/collection.dto\";\nimport { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { TrackDTO } from \"../../types/dto/track.dto\";\nimport { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { toCollectionModel } from \"./toCollectionsModel\";\nimport { toDanceModel } from \"./toDanceModel\";\n\nexport function toUserAcquaintanceModel(\n dto: UserAcquaintanceDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n collectionMap: Record<string, CollectionDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): UserAcquaintanceModel {\n\n return {\n id: dto.id,\n username: dto.username,\n image: dto.image,\n bio: dto.bio,\n isVerified: dto.isVerified,\n friendsCount: dto.profile.friendsCount,\n followersCount: dto.profile.followersCount,\n mutualFriendsCount: dto.profile.mutualFriendsCount,\n links: dto.profile.links,\n dances: {\n favorites: dto.profile.dances.favorites.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n flagged: dto.profile.dances.flagged.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n known: dto.profile.dances.known.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n refresh: dto.profile.dances.refresh.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap))\n },\n collections: dto.profile.collections.map(id => toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap)),\n };\n}\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserDTO(\n user: UserEntity,\n isVerified: boolean,\n danceIds: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n },\n collections: string[],\n venues: string[] = [],\n friends: string[] = [],\n following: string[] = [],\n friendsRequested: string[] = [],\n friendRequests: string[] = []\n): UserDTO {\n return {\n _id: user._id.toString(),\n email: user.email ?? '',\n name: user.name ?? '',\n username: user.username ?? '',\n image: user.image ?? '',\n bio: user.bio ?? '',\n isVerified,\n profile: {\n danceIds,\n collections,\n venues,\n friends,\n following,\n links: user.links ?? {},\n friendsRequested,\n friendRequests\n },\n };\n};\n\nexport default toUserDTO;\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { CollectionModel } from \"../../types/model/collection.model\";\nimport { DanceModel } from \"../../types/model/dance.model\";\nimport { UserModel } from \"../../types/model/user.model\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { VenueModel } from \"../../types/model/venue.model\";\n\nexport function toUserModel(\n userDTO: UserDTO,\n danceMap: Record<string, DanceModel>,\n collectionMap: Record<string, CollectionModel>,\n venueMap: Record<string, VenueModel>,\n friendsMap: Record<string, UserAcquaintanceModel>,\n followingMap: Record<string, UserAcquaintanceModel>\n): UserModel {\n const expand = <T>(ids: string[], map: Record<string, T>): T[] => ids.map(id => map[id]).filter(Boolean);\n\n return {\n _id: userDTO._id,\n email: userDTO.email,\n name: userDTO.name,\n username: userDTO.username,\n image: userDTO.image,\n bio: userDTO.bio,\n isVerified: userDTO.isVerified,\n profile: {\n dances: {\n favorites: expand(userDTO.profile.danceIds.favorites, danceMap),\n flagged: expand(userDTO.profile.danceIds.flagged, danceMap),\n known: expand(userDTO.profile.danceIds.known, danceMap),\n refresh: expand(userDTO.profile.danceIds.refresh, danceMap),\n },\n collections: expand(userDTO.profile.collections, collectionMap),\n venues: expand(userDTO.profile.venues, venueMap),\n friends: expand(userDTO.profile.friends, friendsMap),\n following: expand(userDTO.profile.following, followingMap),\n friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),\n friendRequests: expand(userDTO.profile.friendRequests, friendsMap),\n followersCount: userDTO.profile.followersCount || 0,\n links: userDTO.profile.links,\n },\n };\n}\n","import { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueEntity } from \"../../types/entities/venue.entity\";\n\nexport function toVenueDTO(\n venue: VenueEntity,\n lessonIds: string[],\n isVerified: boolean\n): VenueDTO {\n\n return {\n id: venue._id,\n venuename: venue.venuename,\n venueaddress: venue.venueaddress,\n geolocation: venue.geolocation,\n phone: venue.phone,\n website: venue.website,\n contactEmail: venue.contactEmail,\n contactName: venue.contactName,\n contactPhone: venue.contactPhone,\n lessonsIds: lessonIds,\n isVerified: isVerified,\n isDeleted: venue.isDeleted ?? false,\n deletedAt: venue.deletedAt ?? null,\n createdAt: venue.createdAt ?? null,\n };\n}","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueModel } from \"../../types/model/venue.model\";\nimport { toLessonModel } from \"./toLessonModel\";\n\nexport function toVenueModel(\n venueDTO: VenueDTO,\n lessonMap: Record<string, LessonDTO>,\n instructorMap: Record<string, InstructorDTO>\n): VenueModel {\n const expandedLessons = venueDTO.lessonsIds\n .map(id => toLessonModel(lessonMap[id], instructorMap))\n .filter(Boolean);\n\n return {\n ...venueDTO,\n lessons: expandedLessons,\n };\n}\n"],"names":["toChoreographerModel","dto","id","name","isVerified","toTrackModel","artists","isrc","uri","duration_ms","explicit","toDanceModel","trackMap","choreographerMap","tracks","map","filter","Boolean","danceName","choreographers","stepsheet","difficulty","primaryTrack","toCollectionModel","danceMap","dances","_id","d","createdAt","updatedAt","createdBy","isCopyable","toLessonModel","lessonDTO","instructorMap","lessonday","lessonstart","instructors","duration","lessoncost","notes","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","item","index","indexOf","arr","reduce","acc","choreographer","dance","_dance$choreographers","_dance$choreographers2","_dance$primaryTrack","_dance$tracks$map","_dance$tracks","instructor","userid","LessonEntity","user","userProfile","username","image","bio","profile","collections","venues","friendsCount","followingCount","followersCount","mutualFriendsCount","links","_user$links","collectionMap","danceIds","friends","following","friendsRequested","friendRequests","toString","email","_user$email","_user$name","_user$username","_user$image","_user$bio","userDTO","venueMap","friendsMap","followingMap","expand","ids","venue","lessonIds","venuename","venueaddress","geolocation","phone","website","contactEmail","contactName","contactPhone","lessonsIds","isDeleted","_venue$isDeleted","deletedAt","_venue$deletedAt","_venue$createdAt","venueDTO","lessonMap","expandedLessons","_extends","lessons"],"mappings":"sBAGgBA,EACZC,GAGF,MAAO,CACLC,GAAID,EAAIC,GACRC,KAAMF,EAAIE,KACVC,WAAYH,EAAIG,qBCPJC,EAAaJ,GAC3B,MAAO,CACLC,GAAID,EAAIC,GACRC,KAAMF,EAAIE,KACVG,QAASL,EAAIK,QACbC,KAAMN,EAAIM,KACVC,IAAKP,EAAIO,IACTC,YAAaR,EAAIQ,YACjBC,SAAUT,EAAIS,SACdN,WAAYH,EAAIG,qBCLJO,EACdV,EACAW,EACAC,GAGA,IAAMC,EAASb,EAAIa,OAChBC,KAAI,SAAAb,GAAE,OAAIU,EAASV,MACnBc,OAAOC,SAEV,MAAO,CACLf,GAAID,EAAIC,GACRgB,UAAWjB,EAAIiB,UACfC,eAAgBlB,EAAIkB,eAAeJ,KAAI,SAAAb,GAAE,OAAIF,EAAqBa,EAAiBX,OACnFkB,UAAWnB,EAAImB,UACfC,WAAYpB,EAAIoB,WAChBC,aAAcjB,EAAaO,EAASX,EAAIqB,eACxCR,OAAQA,EAAOC,IAAIV,GACnBD,WAAYH,EAAIG,qBClBJmB,EACZtB,EACAuB,EACAZ,EACAC,GAEA,IAAMY,EAASxB,EAAIwB,OAAOV,KAAI,SAAAb,GAAE,OAAIsB,EAAStB,MAAKc,OAAOC,SAEzD,M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A,MAAO,CACHF,GAAIoG,EAAM5E,IACV8E,UAAWF,EAAME,UACjBC,aAAcH,EAAMG,aACpBC,YAAaJ,EAAMI,YACnBC,MAAOL,EAAMK,MACbC,QAASN,EAAMM,QACfC,aAAcP,EAAMO,aACpBC,YAAaR,EAAMQ,YACnBC,aAAcT,EAAMS,aACpBC,WAAYT,EACZnG,WAAYA,EACZ6G,iBAASC,EAAEZ,EAAMW,YAASC,EAC1BC,iBAASC,EAAEd,EAAMa,WAASC,EAAI,KAC9BxF,iBAASyF,EAAEf,EAAM1E,WAASyF,EAAI,qCChBlCC,EACAC,EACArF,GAEA,IAAMsF,EAAkBF,EAASN,WAC5BjG,KAAI,SAAAb,GAAE,OAAI8B,EAAcuF,EAAUrH,GAAKgC,MACvClB,OAAOC,SAEZ,OAAAwG,KACOH,GACHI,QAASF"}
@@ -14,6 +14,13 @@ function getAllUserDanceIds(userDances) {
14
14
  });
15
15
  }
16
16
 
17
+ function itemArrayToItemRecords(arr) {
18
+ return arr.reduce(function (acc, item) {
19
+ acc[item.id] = item;
20
+ return acc;
21
+ }, {});
22
+ }
23
+
17
24
  function toChoreographerDTO(choreographer, isVerified) {
18
25
  return {
19
26
  id: choreographer._id,
@@ -324,5 +331,5 @@ function toVenueModel(venueDTO, lessonMap, instructorMap) {
324
331
  });
325
332
  }
326
333
 
327
- export { getAllUserDanceIds, toChoreographerDTO, toChoreographerModel, toCollectionModel, toDanceDTO, toDanceModel, toInstructorDTO, toInstructorModel, toLessonDTO, toLessonModel, toTrackDTO, toTrackModel, toUserAcquaintanceDTO, toUserAcquaintanceModel, toUserDTO, toUserModel, toVenueDTO, toVenueModel };
334
+ export { getAllUserDanceIds, itemArrayToItemRecords, toChoreographerDTO, toChoreographerModel, toCollectionModel, toDanceDTO, toDanceModel, toInstructorDTO, toInstructorModel, toLessonDTO, toLessonModel, toTrackDTO, toTrackModel, toUserAcquaintanceDTO, toUserAcquaintanceModel, toUserDTO, toUserModel, toVenueDTO, toVenueModel };
328
335
  //# sourceMappingURL=ldco-contract.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ldco-contract.esm.js","sources":["../src/lib/getAllUserDanceIds.ts","../src/lib/converters/toChoreographerDTO.ts","../src/lib/converters/toChoreographerModel.ts","../src/lib/converters/toTrackModel.ts","../src/lib/converters/toDanceModel.ts","../src/lib/converters/toCollectionsModel.ts","../src/lib/converters/toDanceDTO.ts","../src/lib/converters/toInstructorDTO.ts","../src/lib/converters/toInstructorModel.ts","../src/lib/converters/toLessonDTO.ts","../src/lib/converters/toLessonModel.ts","../src/lib/converters/toTrackDTO.ts","../src/lib/converters/toUserAcquaintanceDTO.ts","../src/lib/converters/toUserAcquaintanceModel.ts","../src/lib/converters/toUserDTO.ts","../src/lib/converters/toUserModel.ts","../src/lib/converters/toVenueDTO.ts","../src/lib/converters/toVenueModel.ts"],"sourcesContent":["import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { ChoreographerEntity } from '../../types/entities/choreographer.entity';\n\nexport function toChoreographerDTO(\n choreographer: ChoreographerEntity,\n isVerified: boolean\n): ChoreographerDTO {\n\n return {\n id: choreographer._id,\n name: choreographer.name,\n isVerified: isVerified\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { ChoreographerModel } from \"../../types/model/choreographer.model\";\n\nexport function toChoreographerModel(\n dto: ChoreographerDTO\n): ChoreographerModel {\n\n return {\n id: dto.id,\n name: dto.name,\n isVerified: dto.isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackModel } from \"../../types/model/track.model\";\n\nexport function toTrackModel(dto: TrackDTO): TrackModel {\n return {\n id: dto.id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { DanceModel } from '../../types/model/dance.model';\nimport { toChoreographerModel } from './toChoreographerModel';\nimport { toTrackModel } from './toTrackModel';\n\nexport function toDanceModel(\n dto: DanceDTO,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): DanceModel {\n\n const tracks = dto.tracks\n .map(id => trackMap[id])\n .filter(Boolean);\n\n return {\n id: dto.id,\n danceName: dto.danceName,\n choreographers: dto.choreographers.map(id => toChoreographerModel(choreographerMap[id])),\n stepsheet: dto.stepsheet,\n difficulty: dto.difficulty,\n primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),\n tracks: tracks.map(toTrackModel),\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { CollectionDTO } from '../../types/dto/collection.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { CollectionModel } from '../../types/model/collection.model';\nimport { toDanceModel } from './toDanceModel';\n\nexport function toCollectionModel(\n dto: CollectionDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): CollectionModel {\n const dances = dto.dances.map(id => danceMap[id]).filter(Boolean);\n\n return {\n id: dto._id,\n name: dto.name,\n dances: dances.map(d => toDanceModel(d, trackMap, choreographerMap)),\n isVerified: dto.isVerified,\n createdAt: dto.createdAt,\n updatedAt: dto.updatedAt,\n createdBy: dto.createdBy,\n isCopyable: dto.isCopyable,\n };\n}\n","import { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { DanceEntity } from \"../../types/entities/dance.entity\";\n\nexport function toDanceDTO(\n dance: DanceEntity,\n isVerified: boolean\n): DanceDTO {\n\n return {\n id: dance._id,\n danceName: dance.danceName,\n choreographers: dance.choreographers?.map((id: string) => id) ?? [],\n stepsheet: dance.stepsheet,\n difficulty: dance.difficulty,\n primaryTrack: dance.primaryTrack ?? '',\n tracks: dance.tracks?.map((id: string) => id) ?? [],\n isVerified: isVerified\n };\n};\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorEntity } from \"../../types/entities/instructor.entity\";\n\nexport function toInstructorDTO(\n instructor: InstructorEntity,\n isVerified: boolean\n): InstructorDTO {\n\n return {\n id: instructor._id,\n name: instructor.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorModel } from \"../../types/model/instructor.model\";\n\nexport function toInstructorModel(\n dto: InstructorDTO, \n): InstructorModel {\n\n return {\n id: dto.id,\n name: dto.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: dto.isVerified\n };\n}\n","import { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonEntity } from \"../../types/entities/lesson.entity\";\n\nexport function toLessonDTO(\n LessonEntity: LessonEntity,\n isVerified: boolean\n): LessonDTO {\n\n return {\n id: LessonEntity._id,\n lessonday: LessonEntity.lessonday,\n lessonstart: LessonEntity.lessonstart,\n instructors: LessonEntity.instructors,\n duration: LessonEntity.duration,\n lessoncost: LessonEntity.lessoncost,\n notes: LessonEntity.notes,\n difficulty: LessonEntity.difficulty,\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonModel } from \"../../types/model/lesson.model\";\n\nexport function toLessonModel(\n lessonDTO: LessonDTO,\n instructorMap: Record<string, InstructorDTO>\n): LessonModel {\n\n return {\n id: lessonDTO.id,\n lessonday: lessonDTO.lessonday,\n lessonstart: lessonDTO.lessonstart,\n instructors: lessonDTO.instructors.map(id => instructorMap[id]).filter(Boolean), // TODO: Do I need the converter?\n duration: lessonDTO.duration,\n lessoncost: lessonDTO.lessoncost,\n notes: lessonDTO.notes,\n difficulty: lessonDTO.difficulty,\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackEntity } from \"../../types/entities/track.entity\";\n\nexport function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO {\n return {\n id: dto._id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: isVerified,\n };\n}\n","import { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserAcquaintanceDTO(\n user: UserEntity,\n isVerified: boolean,\n userProfile: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n collections: string[];\n venues: string[];\n friendsCount: number;\n followingCount: number;\n followersCount: number;\n mutualFriendsCount: number;\n }\n): UserAcquaintanceDTO {\n return {\n id: user._id,\n username: user.username || user.name || '',\n image: user.image || '',\n bio: user.bio || '',\n isVerified,\n profile: {\n dances: {\n favorites: userProfile.favorites,\n flagged: userProfile.flagged,\n known: userProfile.known,\n refresh: userProfile.refresh,\n },\n collections: userProfile.collections,\n venues: userProfile.venues,\n friendsCount: userProfile.friendsCount,\n followingCount: userProfile.followingCount,\n followersCount: userProfile.followersCount,\n mutualFriendsCount: userProfile.mutualFriendsCount,\n links: user.links ?? {},\n },\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { CollectionDTO } from \"../../types/dto/collection.dto\";\nimport { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { TrackDTO } from \"../../types/dto/track.dto\";\nimport { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { toCollectionModel } from \"./toCollectionsModel\";\nimport { toDanceModel } from \"./toDanceModel\";\n\nexport function toUserAcquaintanceModel(\n dto: UserAcquaintanceDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n collectionMap: Record<string, CollectionDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): UserAcquaintanceModel {\n\n return {\n id: dto.id,\n username: dto.username,\n image: dto.image,\n bio: dto.bio,\n isVerified: dto.isVerified,\n friendsCount: dto.profile.friendsCount,\n followersCount: dto.profile.followersCount,\n mutualFriendsCount: dto.profile.mutualFriendsCount,\n links: dto.profile.links,\n dances: {\n favorites: dto.profile.dances.favorites.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n flagged: dto.profile.dances.flagged.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n known: dto.profile.dances.known.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n refresh: dto.profile.dances.refresh.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap))\n },\n collections: dto.profile.collections.map(id => toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap)),\n };\n}\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserDTO(\n user: UserEntity,\n isVerified: boolean,\n danceIds: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n },\n collections: string[],\n venues: string[] = [],\n friends: string[] = [],\n following: string[] = [],\n friendsRequested: string[] = [],\n friendRequests: string[] = []\n): UserDTO {\n return {\n _id: user._id.toString(),\n email: user.email ?? '',\n name: user.name ?? '',\n username: user.username ?? '',\n image: user.image ?? '',\n bio: user.bio ?? '',\n isVerified,\n profile: {\n danceIds,\n collections,\n venues,\n friends,\n following,\n links: user.links ?? {},\n friendsRequested,\n friendRequests\n },\n };\n};\n\nexport default toUserDTO;\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { CollectionModel } from \"../../types/model/collection.model\";\nimport { DanceModel } from \"../../types/model/dance.model\";\nimport { UserModel } from \"../../types/model/user.model\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { VenueModel } from \"../../types/model/venue.model\";\n\nexport function toUserModel(\n userDTO: UserDTO,\n danceMap: Record<string, DanceModel>,\n collectionMap: Record<string, CollectionModel>,\n venueMap: Record<string, VenueModel>,\n friendsMap: Record<string, UserAcquaintanceModel>,\n followingMap: Record<string, UserAcquaintanceModel>\n): UserModel {\n const expand = <T>(ids: string[], map: Record<string, T>): T[] => ids.map(id => map[id]).filter(Boolean);\n\n return {\n _id: userDTO._id,\n email: userDTO.email,\n name: userDTO.name,\n username: userDTO.username,\n image: userDTO.image,\n bio: userDTO.bio,\n isVerified: userDTO.isVerified,\n profile: {\n dances: {\n favorites: expand(userDTO.profile.danceIds.favorites, danceMap),\n flagged: expand(userDTO.profile.danceIds.flagged, danceMap),\n known: expand(userDTO.profile.danceIds.known, danceMap),\n refresh: expand(userDTO.profile.danceIds.refresh, danceMap),\n },\n collections: expand(userDTO.profile.collections, collectionMap),\n venues: expand(userDTO.profile.venues, venueMap),\n friends: expand(userDTO.profile.friends, friendsMap),\n following: expand(userDTO.profile.following, followingMap),\n friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),\n friendRequests: expand(userDTO.profile.friendRequests, friendsMap),\n followersCount: userDTO.profile.followersCount || 0,\n links: userDTO.profile.links,\n },\n };\n}\n","import { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueEntity } from \"../../types/entities/venue.entity\";\n\nexport function toVenueDTO(\n venue: VenueEntity,\n lessonIds: string[],\n isVerified: boolean\n): VenueDTO {\n\n return {\n id: venue._id,\n venuename: venue.venuename,\n venueaddress: venue.venueaddress,\n geolocation: venue.geolocation,\n phone: venue.phone,\n website: venue.website,\n contactEmail: venue.contactEmail,\n contactName: venue.contactName,\n contactPhone: venue.contactPhone,\n lessonsIds: lessonIds,\n isVerified: isVerified,\n isDeleted: venue.isDeleted ?? false,\n deletedAt: venue.deletedAt ?? null,\n createdAt: venue.createdAt ?? null,\n };\n}","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueModel } from \"../../types/model/venue.model\";\nimport { toLessonModel } from \"./toLessonModel\";\n\nexport function toVenueModel(\n venueDTO: VenueDTO,\n lessonMap: Record<string, LessonDTO>,\n instructorMap: Record<string, InstructorDTO>\n): VenueModel {\n const expandedLessons = venueDTO.lessonsIds\n .map(id => toLessonModel(lessonMap[id], instructorMap))\n .filter(Boolean);\n\n return {\n ...venueDTO,\n lessons: expandedLessons,\n };\n}\n"],"names":["getAllUserDanceIds","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","filter","item","index","indexOf","toChoreographerDTO","choreographer","isVerified","id","_id","name","toChoreographerModel","dto","toTrackModel","artists","isrc","uri","duration_ms","explicit","toDanceModel","trackMap","choreographerMap","tracks","map","Boolean","danceName","choreographers","stepsheet","difficulty","primaryTrack","toCollectionModel","danceMap","dances","d","createdAt","updatedAt","createdBy","isCopyable","toDanceDTO","dance","_dance$choreographers","_dance$choreographers2","_dance$primaryTrack","_dance$tracks$map","_dance$tracks","toInstructorDTO","instructor","userid","toInstructorModel","toLessonDTO","LessonEntity","lessonday","lessonstart","instructors","duration","lessoncost","notes","toLessonModel","lessonDTO","instructorMap","toTrackDTO","toUserAcquaintanceDTO","user","userProfile","username","image","bio","profile","collections","venues","friendsCount","followingCount","followersCount","mutualFriendsCount","links","_user$links","toUserAcquaintanceModel","collectionMap","toUserDTO","danceIds","friends","following","friendsRequested","friendRequests","toString","email","_user$email","_user$name","_user$username","_user$image","_user$bio","toUserModel","userDTO","venueMap","friendsMap","followingMap","expand","ids","toVenueDTO","venue","lessonIds","venuename","venueaddress","geolocation","phone","website","contactEmail","contactName","contactPhone","lessonsIds","isDeleted","_venue$isDeleted","deletedAt","_venue$deletedAt","_venue$createdAt","toVenueModel","venueDTO","lessonMap","expandedLessons","_extends","lessons"],"mappings":"SAGgBA,kBAAkBA,CAACC,UAAsB;EACrD,IAAAC,IAAA,GAAmED,UAAU,WAAVA,UAAU,GAAI,EAAE;IAAAE,cAAA,GAAAD,IAAA,CAA3EE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,EAAE,GAAAA,cAAA;IAAAE,YAAA,GAAAH,IAAA,CAAEI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;IAAAE,UAAA,GAAAL,IAAA,CAAEM,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,EAAE,GAAAA,UAAA;IAAAE,YAAA,GAAAP,IAAA,CAAEQ,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;EAE9D,IAAME,GAAG,MAAAC,MAAA,CACFR,SAAS,EACTE,OAAO,EACPE,KAAK,EACLE,OAAO,CACb;EAED,OAAOC,GAAG,CAACE,MAAM,CAAC,UAACC,IAAI,EAAEC,KAAK;IAAA,OAAKJ,GAAG,CAACK,OAAO,CAACF,IAAI,CAAC,KAAKC,KAAK;IAAC;AACnE;;SCXgBE,kBAAkBA,CAC9BC,aAAkC,EAClCC,UAAmB;EAGrB,OAAO;IACLC,EAAE,EAAEF,aAAa,CAACG,GAAG;IACrBC,IAAI,EAAEJ,aAAa,CAACI,IAAI;IACxBH,UAAU,EAAEA;GACb;AACH;;SCVgBI,oBAAoBA,CAChCC,GAAqB;EAGvB,OAAO;IACLJ,EAAE,EAAEI,GAAG,CAACJ,EAAE;IACVE,IAAI,EAAEE,GAAG,CAACF,IAAI;IACdH,UAAU,EAAEK,GAAG,CAACL;GACjB;AACH;;SCTgBM,YAAYA,CAACD,GAAa;EACxC,OAAO;IACLJ,EAAE,EAAEI,GAAG,CAACJ,EAAE;IACVE,IAAI,EAAEE,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ACjE,SAAS,YAAAgF,gBAAA,GAAI;GACjC;AACL;;;;;;;;;;;;SCnBgBC,YAAYA,CACxBC,QAAkB,EAClBC,SAAoC,EACpC1D,aAA4C;EAE5C,IAAM2D,eAAe,GAAGF,QAAQ,CAACP,UAAU,CACtCtF,GAAG,CAAC,UAAAf,EAAE;IAAA,OAAIiD,aAAa,CAAC4D,SAAS,CAAC7G,EAAE,CAAC,EAAEmD,aAAa,CAAC;IAAC,CACtD1D,MAAM,CAACuB,OAAO,CAAC;EAEpB,OAAA+F,QAAA,KACOH,QAAQ;IACXI,OAAO,EAAEF;;AAEjB;;;;"}
1
+ {"version":3,"file":"ldco-contract.esm.js","sources":["../src/lib/getAllUserDanceIds.ts","../src/lib/itemArrayToItemRecords.ts","../src/lib/converters/toChoreographerDTO.ts","../src/lib/converters/toChoreographerModel.ts","../src/lib/converters/toTrackModel.ts","../src/lib/converters/toDanceModel.ts","../src/lib/converters/toCollectionsModel.ts","../src/lib/converters/toDanceDTO.ts","../src/lib/converters/toInstructorDTO.ts","../src/lib/converters/toInstructorModel.ts","../src/lib/converters/toLessonDTO.ts","../src/lib/converters/toLessonModel.ts","../src/lib/converters/toTrackDTO.ts","../src/lib/converters/toUserAcquaintanceDTO.ts","../src/lib/converters/toUserAcquaintanceModel.ts","../src/lib/converters/toUserDTO.ts","../src/lib/converters/toUserModel.ts","../src/lib/converters/toVenueDTO.ts","../src/lib/converters/toVenueModel.ts"],"sourcesContent":["import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}","export function itemArrayToItemRecords<T extends { id: string }>(arr: T[]): Record<string, T> {\n return arr.reduce((acc, item) => {\n acc[item.id] = item;\n return acc;\n }, {} as Record<string, T>);\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { ChoreographerEntity } from '../../types/entities/choreographer.entity';\n\nexport function toChoreographerDTO(\n choreographer: ChoreographerEntity,\n isVerified: boolean\n): ChoreographerDTO {\n\n return {\n id: choreographer._id,\n name: choreographer.name,\n isVerified: isVerified\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { ChoreographerModel } from \"../../types/model/choreographer.model\";\n\nexport function toChoreographerModel(\n dto: ChoreographerDTO\n): ChoreographerModel {\n\n return {\n id: dto.id,\n name: dto.name,\n isVerified: dto.isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackModel } from \"../../types/model/track.model\";\n\nexport function toTrackModel(dto: TrackDTO): TrackModel {\n return {\n id: dto.id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { DanceModel } from '../../types/model/dance.model';\nimport { toChoreographerModel } from './toChoreographerModel';\nimport { toTrackModel } from './toTrackModel';\n\nexport function toDanceModel(\n dto: DanceDTO,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): DanceModel {\n\n const tracks = dto.tracks\n .map(id => trackMap[id])\n .filter(Boolean);\n\n return {\n id: dto.id,\n danceName: dto.danceName,\n choreographers: dto.choreographers.map(id => toChoreographerModel(choreographerMap[id])),\n stepsheet: dto.stepsheet,\n difficulty: dto.difficulty,\n primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),\n tracks: tracks.map(toTrackModel),\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { CollectionDTO } from '../../types/dto/collection.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { CollectionModel } from '../../types/model/collection.model';\nimport { toDanceModel } from './toDanceModel';\n\nexport function toCollectionModel(\n dto: CollectionDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): CollectionModel {\n const dances = dto.dances.map(id => danceMap[id]).filter(Boolean);\n\n return {\n id: dto._id,\n name: dto.name,\n dances: dances.map(d => toDanceModel(d, trackMap, choreographerMap)),\n isVerified: dto.isVerified,\n createdAt: dto.createdAt,\n updatedAt: dto.updatedAt,\n createdBy: dto.createdBy,\n isCopyable: dto.isCopyable,\n };\n}\n","import { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { DanceEntity } from \"../../types/entities/dance.entity\";\n\nexport function toDanceDTO(\n dance: DanceEntity,\n isVerified: boolean\n): DanceDTO {\n\n return {\n id: dance._id,\n danceName: dance.danceName,\n choreographers: dance.choreographers?.map((id: string) => id) ?? [],\n stepsheet: dance.stepsheet,\n difficulty: dance.difficulty,\n primaryTrack: dance.primaryTrack ?? '',\n tracks: dance.tracks?.map((id: string) => id) ?? [],\n isVerified: isVerified\n };\n};\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorEntity } from \"../../types/entities/instructor.entity\";\n\nexport function toInstructorDTO(\n instructor: InstructorEntity,\n isVerified: boolean\n): InstructorDTO {\n\n return {\n id: instructor._id,\n name: instructor.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorModel } from \"../../types/model/instructor.model\";\n\nexport function toInstructorModel(\n dto: InstructorDTO, \n): InstructorModel {\n\n return {\n id: dto.id,\n name: dto.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: dto.isVerified\n };\n}\n","import { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonEntity } from \"../../types/entities/lesson.entity\";\n\nexport function toLessonDTO(\n LessonEntity: LessonEntity,\n isVerified: boolean\n): LessonDTO {\n\n return {\n id: LessonEntity._id,\n lessonday: LessonEntity.lessonday,\n lessonstart: LessonEntity.lessonstart,\n instructors: LessonEntity.instructors,\n duration: LessonEntity.duration,\n lessoncost: LessonEntity.lessoncost,\n notes: LessonEntity.notes,\n difficulty: LessonEntity.difficulty,\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonModel } from \"../../types/model/lesson.model\";\n\nexport function toLessonModel(\n lessonDTO: LessonDTO,\n instructorMap: Record<string, InstructorDTO>\n): LessonModel {\n\n return {\n id: lessonDTO.id,\n lessonday: lessonDTO.lessonday,\n lessonstart: lessonDTO.lessonstart,\n instructors: lessonDTO.instructors.map(id => instructorMap[id]).filter(Boolean), // TODO: Do I need the converter?\n duration: lessonDTO.duration,\n lessoncost: lessonDTO.lessoncost,\n notes: lessonDTO.notes,\n difficulty: lessonDTO.difficulty,\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackEntity } from \"../../types/entities/track.entity\";\n\nexport function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO {\n return {\n id: dto._id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: isVerified,\n };\n}\n","import { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserAcquaintanceDTO(\n user: UserEntity,\n isVerified: boolean,\n userProfile: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n collections: string[];\n venues: string[];\n friendsCount: number;\n followingCount: number;\n followersCount: number;\n mutualFriendsCount: number;\n }\n): UserAcquaintanceDTO {\n return {\n id: user._id,\n username: user.username || user.name || '',\n image: user.image || '',\n bio: user.bio || '',\n isVerified,\n profile: {\n dances: {\n favorites: userProfile.favorites,\n flagged: userProfile.flagged,\n known: userProfile.known,\n refresh: userProfile.refresh,\n },\n collections: userProfile.collections,\n venues: userProfile.venues,\n friendsCount: userProfile.friendsCount,\n followingCount: userProfile.followingCount,\n followersCount: userProfile.followersCount,\n mutualFriendsCount: userProfile.mutualFriendsCount,\n links: user.links ?? {},\n },\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { CollectionDTO } from \"../../types/dto/collection.dto\";\nimport { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { TrackDTO } from \"../../types/dto/track.dto\";\nimport { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { toCollectionModel } from \"./toCollectionsModel\";\nimport { toDanceModel } from \"./toDanceModel\";\n\nexport function toUserAcquaintanceModel(\n dto: UserAcquaintanceDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n collectionMap: Record<string, CollectionDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): UserAcquaintanceModel {\n\n return {\n id: dto.id,\n username: dto.username,\n image: dto.image,\n bio: dto.bio,\n isVerified: dto.isVerified,\n friendsCount: dto.profile.friendsCount,\n followersCount: dto.profile.followersCount,\n mutualFriendsCount: dto.profile.mutualFriendsCount,\n links: dto.profile.links,\n dances: {\n favorites: dto.profile.dances.favorites.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n flagged: dto.profile.dances.flagged.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n known: dto.profile.dances.known.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n refresh: dto.profile.dances.refresh.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap))\n },\n collections: dto.profile.collections.map(id => toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap)),\n };\n}\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserDTO(\n user: UserEntity,\n isVerified: boolean,\n danceIds: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n },\n collections: string[],\n venues: string[] = [],\n friends: string[] = [],\n following: string[] = [],\n friendsRequested: string[] = [],\n friendRequests: string[] = []\n): UserDTO {\n return {\n _id: user._id.toString(),\n email: user.email ?? '',\n name: user.name ?? '',\n username: user.username ?? '',\n image: user.image ?? '',\n bio: user.bio ?? '',\n isVerified,\n profile: {\n danceIds,\n collections,\n venues,\n friends,\n following,\n links: user.links ?? {},\n friendsRequested,\n friendRequests\n },\n };\n};\n\nexport default toUserDTO;\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { CollectionModel } from \"../../types/model/collection.model\";\nimport { DanceModel } from \"../../types/model/dance.model\";\nimport { UserModel } from \"../../types/model/user.model\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { VenueModel } from \"../../types/model/venue.model\";\n\nexport function toUserModel(\n userDTO: UserDTO,\n danceMap: Record<string, DanceModel>,\n collectionMap: Record<string, CollectionModel>,\n venueMap: Record<string, VenueModel>,\n friendsMap: Record<string, UserAcquaintanceModel>,\n followingMap: Record<string, UserAcquaintanceModel>\n): UserModel {\n const expand = <T>(ids: string[], map: Record<string, T>): T[] => ids.map(id => map[id]).filter(Boolean);\n\n return {\n _id: userDTO._id,\n email: userDTO.email,\n name: userDTO.name,\n username: userDTO.username,\n image: userDTO.image,\n bio: userDTO.bio,\n isVerified: userDTO.isVerified,\n profile: {\n dances: {\n favorites: expand(userDTO.profile.danceIds.favorites, danceMap),\n flagged: expand(userDTO.profile.danceIds.flagged, danceMap),\n known: expand(userDTO.profile.danceIds.known, danceMap),\n refresh: expand(userDTO.profile.danceIds.refresh, danceMap),\n },\n collections: expand(userDTO.profile.collections, collectionMap),\n venues: expand(userDTO.profile.venues, venueMap),\n friends: expand(userDTO.profile.friends, friendsMap),\n following: expand(userDTO.profile.following, followingMap),\n friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),\n friendRequests: expand(userDTO.profile.friendRequests, friendsMap),\n followersCount: userDTO.profile.followersCount || 0,\n links: userDTO.profile.links,\n },\n };\n}\n","import { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueEntity } from \"../../types/entities/venue.entity\";\n\nexport function toVenueDTO(\n venue: VenueEntity,\n lessonIds: string[],\n isVerified: boolean\n): VenueDTO {\n\n return {\n id: venue._id,\n venuename: venue.venuename,\n venueaddress: venue.venueaddress,\n geolocation: venue.geolocation,\n phone: venue.phone,\n website: venue.website,\n contactEmail: venue.contactEmail,\n contactName: venue.contactName,\n contactPhone: venue.contactPhone,\n lessonsIds: lessonIds,\n isVerified: isVerified,\n isDeleted: venue.isDeleted ?? false,\n deletedAt: venue.deletedAt ?? null,\n createdAt: venue.createdAt ?? null,\n };\n}","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueModel } from \"../../types/model/venue.model\";\nimport { toLessonModel } from \"./toLessonModel\";\n\nexport function toVenueModel(\n venueDTO: VenueDTO,\n lessonMap: Record<string, LessonDTO>,\n instructorMap: Record<string, InstructorDTO>\n): VenueModel {\n const expandedLessons = venueDTO.lessonsIds\n .map(id => toLessonModel(lessonMap[id], instructorMap))\n .filter(Boolean);\n\n return {\n ...venueDTO,\n lessons: expandedLessons,\n };\n}\n"],"names":["getAllUserDanceIds","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","filter","item","index","indexOf","itemArrayToItemRecords","arr","reduce","acc","id","toChoreographerDTO","choreographer","isVerified","_id","name","toChoreographerModel","dto","toTrackModel","artists","isrc","uri","duration_ms","explicit","toDanceModel","trackMap","choreographerMap","tracks","map","Boolean","danceName","choreographers","stepsheet","difficulty","primaryTrack","toCollectionModel","danceMap","dances","d","createdAt","updatedAt","createdBy","isCopyable","toDanceDTO","dance","_dance$choreographers","_dance$choreographers2","_dance$primaryTrack","_dance$tracks$map","_dance$tracks","toInstructorDTO","instructor","userid","toInstructorModel","toLessonDTO","LessonEntity","lessonday","lessonstart","instructors","duration","lessoncost","notes","toLessonModel","lessonDTO","instructorMap","toTrackDTO","toUserAcquaintanceDTO","user","userProfile","username","image","bio","profile","collections","venues","friendsCount","followingCount","followersCount","mutualFriendsCount","links","_user$links","toUserAcquaintanceModel","collectionMap","toUserDTO","danceIds","friends","following","friendsRequested","friendRequests","toString","email","_user$email","_user$name","_user$username","_user$image","_user$bio","toUserModel","userDTO","venueMap","friendsMap","followingMap","expand","ids","toVenueDTO","venue","lessonIds","venuename","venueaddress","geolocation","phone","website","contactEmail","contactName","contactPhone","lessonsIds","isDeleted","_venue$isDeleted","deletedAt","_venue$deletedAt","_venue$createdAt","toVenueModel","venueDTO","lessonMap","expandedLessons","_extends","lessons"],"mappings":"SAGgBA,kBAAkBA,CAACC,UAAsB;EACrD,IAAAC,IAAA,GAAmED,UAAU,WAAVA,UAAU,GAAI,EAAE;IAAAE,cAAA,GAAAD,IAAA,CAA3EE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,EAAE,GAAAA,cAAA;IAAAE,YAAA,GAAAH,IAAA,CAAEI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;IAAAE,UAAA,GAAAL,IAAA,CAAEM,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,EAAE,GAAAA,UAAA;IAAAE,YAAA,GAAAP,IAAA,CAAEQ,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;EAE9D,IAAME,GAAG,MAAAC,MAAA,CACFR,SAAS,EACTE,OAAO,EACPE,KAAK,EACLE,OAAO,CACb;EAED,OAAOC,GAAG,CAACE,MAAM,CAAC,UAACC,IAAI,EAAEC,KAAK;IAAA,OA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DE,KAAK,EAAEkB,OAAO,CAACzB,OAAO,CAACO;;GAE9B;AACL;;SCvCgBwB,UAAUA,CACtBC,KAAkB,EAClBC,SAAmB,EACnB5F,UAAmB;;EAGnB,OAAO;IACHH,EAAE,EAAE8F,KAAK,CAAC1F,GAAG;IACb4F,SAAS,EAAEF,KAAK,CAACE,SAAS;IAC1BC,YAAY,EAAEH,KAAK,CAACG,YAAY;IAChCC,WAAW,EAAEJ,KAAK,CAACI,WAAW;IAC9BC,KAAK,EAAEL,KAAK,CAACK,KAAK;IAClBC,OAAO,EAAEN,KAAK,CAACM,OAAO;IACtBC,YAAY,EAAEP,KAAK,CAACO,YAAY;IAChCC,WAAW,EAAER,KAAK,CAACQ,WAAW;IAC9BC,YAAY,EAAET,KAAK,CAACS,YAAY;IAChCC,UAAU,EAAET,SAAS;IACrB5F,UAAU,EAAEA,UAAU;IACtBsG,SAAS,GAAAC,gBAAA,GAAEZ,KAAK,CAACW,SAAS,YAAAC,gBAAA,GAAI,KAAK;IACnCC,SAAS,GAAAC,gBAAA,GAAEd,KAAK,CAACa,SAAS,YAAAC,gBAAA,GAAI,IAAI;IAClC/E,SAAS,GAAAgF,gBAAA,GAAEf,KAAK,CAACjE,SAAS,YAAAgF,gBAAA,GAAI;GACjC;AACL;;;;;;;;;;;;SCnBgBC,YAAYA,CACxBC,QAAkB,EAClBC,SAAoC,EACpC1D,aAA4C;EAE5C,IAAM2D,eAAe,GAAGF,QAAQ,CAACP,UAAU,CACtCtF,GAAG,CAAC,UAAAlB,EAAE;IAAA,OAAIoD,aAAa,CAAC4D,SAAS,CAAChH,EAAE,CAAC,EAAEsD,aAAa,CAAC;IAAC,CACtD9D,MAAM,CAAC2B,OAAO,CAAC;EAEpB,OAAA+F,QAAA,KACOH,QAAQ;IACXI,OAAO,EAAEF;;AAEjB;;;;"}
@@ -0,0 +1,3 @@
1
+ export declare function itemArrayToItemRecords<T extends {
2
+ id: string;
3
+ }>(arr: T[]): Record<string, T>;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.16",
2
+ "version": "0.1.18",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -48,6 +48,7 @@ export { UserDances } from './types/model/userTypes/userDances';
48
48
 
49
49
  // LIB FUNCTIONS
50
50
  export { getAllUserDanceIds } from './lib/getAllUserDanceIds';
51
+ export { itemArrayToItemRecords } from './lib/itemArrayToItemRecords';
51
52
 
52
53
  // REQUESTS
53
54
  export { UserInfoUpdateRequest } from './types/requests/userInfoUpdate.request';
@@ -0,0 +1,6 @@
1
+ export function itemArrayToItemRecords<T extends { id: string }>(arr: T[]): Record<string, T> {
2
+ return arr.reduce((acc, item) => {
3
+ acc[item.id] = item;
4
+ return acc;
5
+ }, {} as Record<string, T>);
6
+ }