ldco-contract 0.1.15 → 0.1.16
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 +34 -0
- package/dist/ldco-contract.cjs.development.js +327 -0
- package/dist/ldco-contract.cjs.development.js.map +1 -1
- package/dist/ldco-contract.cjs.production.min.js +1 -1
- package/dist/ldco-contract.cjs.production.min.js.map +1 -1
- package/dist/ldco-contract.esm.js +311 -1
- package/dist/ldco-contract.esm.js.map +1 -1
- package/dist/lib/converters/toChoreographerDTO.d.ts +3 -0
- package/dist/lib/converters/toChoreographerModel.d.ts +3 -0
- package/dist/lib/converters/toCollectionsModel.d.ts +6 -0
- package/dist/lib/converters/toDanceDTO.d.ts +3 -0
- package/dist/lib/converters/toDanceModel.d.ts +5 -0
- package/dist/lib/converters/toInstructorDTO.d.ts +3 -0
- package/dist/lib/converters/toInstructorModel.d.ts +3 -0
- package/dist/lib/converters/toLessonDTO.d.ts +3 -0
- package/dist/lib/converters/toLessonModel.d.ts +4 -0
- package/dist/lib/converters/toTrackDTO.d.ts +3 -0
- package/dist/lib/converters/toTrackModel.d.ts +3 -0
- package/dist/lib/converters/toUserAcquaintanceDTO.d.ts +14 -0
- package/dist/lib/converters/toUserAcquaintanceModel.d.ts +7 -0
- package/dist/lib/converters/toUserDTO.d.ts +9 -0
- package/dist/lib/converters/toUserModel.d.ts +7 -0
- package/dist/lib/converters/toVenueDTO.d.ts +3 -0
- package/dist/lib/converters/toVenueModel.d.ts +5 -0
- package/dist/types/dto/lesson.dto.d.ts +1 -0
- package/dist/types/entities/appeal_choreographer_user.entity.d.ts +8 -0
- package/dist/types/entities/appeal_instructor_user.entity.d.ts +8 -0
- package/dist/types/entities/cancelled_lesson.entity.d.ts +6 -0
- package/dist/types/entities/choreographer.entity.d.ts +5 -0
- package/dist/types/entities/dance.entity.d.ts +9 -0
- package/dist/types/entities/dance_collection.entity.d.ts +8 -0
- package/dist/types/entities/friend_request.entity.d.ts +7 -0
- package/dist/types/entities/instructor.entity.d.ts +5 -0
- package/dist/types/entities/lesson.entity.d.ts +13 -0
- package/dist/types/entities/track.entity.d.ts +9 -0
- package/dist/types/entities/user.entity.d.ts +9 -0
- package/dist/types/entities/user_collection.entity.d.ts +8 -0
- package/dist/types/entities/user_favorite_venue.entity.d.ts +5 -0
- package/dist/types/entities/user_follow.entity.d.ts +6 -0
- package/dist/types/entities/user_friend.entity.d.ts +6 -0
- package/dist/types/entities/user_marked_dance.entity.d.ts +6 -0
- package/dist/types/entities/venue.entity.d.ts +14 -0
- package/dist/types/model/collection.model.d.ts +1 -0
- package/dist/types/model/lesson.model.d.ts +1 -0
- package/package.json +1 -1
- package/src/index.ts +39 -1
- package/src/lib/converters/toChoreographerDTO.ts +14 -0
- package/src/lib/converters/toChoreographerModel.ts +13 -0
- package/src/lib/converters/toCollectionsModel.ts +26 -0
- package/src/lib/converters/toDanceDTO.ts +19 -0
- package/src/lib/converters/toDanceModel.ts +28 -0
- package/src/lib/converters/toInstructorDTO.ts +15 -0
- package/src/lib/converters/toInstructorModel.ts +14 -0
- package/src/lib/converters/toLessonDTO.ts +20 -0
- package/src/lib/converters/toLessonModel.ts +20 -0
- package/src/lib/converters/toTrackDTO.ts +15 -0
- package/src/lib/converters/toTrackModel.ts +15 -0
- package/src/lib/converters/toUserAcquaintanceDTO.ts +42 -0
- package/src/lib/converters/toUserAcquaintanceModel.ts +36 -0
- package/src/lib/converters/toUserDTO.ts +41 -0
- package/src/lib/converters/toUserModel.ts +43 -0
- package/src/lib/converters/toVenueDTO.ts +26 -0
- package/src/lib/converters/toVenueModel.ts +20 -0
- package/src/types/dto/lesson.dto.ts +1 -0
- package/src/types/entities/appeal_choreographer_user.entity.ts +8 -0
- package/src/types/entities/appeal_instructor_user.entity.ts +8 -0
- package/src/types/entities/cancelled_lesson.entity.ts +6 -0
- package/src/types/entities/choreographer.entity.ts +5 -0
- package/src/types/entities/dance.entity.ts +9 -0
- package/src/types/entities/dance_collection.entity.ts +8 -0
- package/src/types/entities/friend_request.entity.ts +7 -0
- package/src/types/entities/instructor.entity.ts +5 -0
- package/src/types/entities/lesson.entity.ts +13 -0
- package/src/types/entities/track.entity.ts +9 -0
- package/src/types/entities/user.entity.ts +9 -0
- package/src/types/entities/user_collection.entity.ts +8 -0
- package/src/types/entities/user_favorite_venue.entity.ts +5 -0
- package/src/types/entities/user_follow.entity.ts +6 -0
- package/src/types/entities/user_friend.entity.ts +6 -0
- package/src/types/entities/user_marked_dance.entity.ts +6 -0
- package/src/types/entities/venue.entity.ts +14 -0
- package/src/types/model/collection.model.ts +1 -0
- package/src/types/model/lesson.model.ts +1 -0
- package/dist/converter/userEntityToUser.d.ts +0 -10
- package/src/converter/userEntityToUser.ts +0 -76
@@ -14,5 +14,315 @@ function getAllUserDanceIds(userDances) {
|
|
14
14
|
});
|
15
15
|
}
|
16
16
|
|
17
|
-
|
17
|
+
function toChoreographerDTO(choreographer, isVerified) {
|
18
|
+
return {
|
19
|
+
id: choreographer._id,
|
20
|
+
name: choreographer.name,
|
21
|
+
isVerified: isVerified
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
function toChoreographerModel(dto) {
|
26
|
+
return {
|
27
|
+
id: dto.id,
|
28
|
+
name: dto.name,
|
29
|
+
isVerified: dto.isVerified
|
30
|
+
};
|
31
|
+
}
|
32
|
+
|
33
|
+
function toTrackModel(dto) {
|
34
|
+
return {
|
35
|
+
id: dto.id,
|
36
|
+
name: dto.name,
|
37
|
+
artists: dto.artists,
|
38
|
+
isrc: dto.isrc,
|
39
|
+
uri: dto.uri,
|
40
|
+
duration_ms: dto.duration_ms,
|
41
|
+
explicit: dto.explicit,
|
42
|
+
isVerified: dto.isVerified
|
43
|
+
};
|
44
|
+
}
|
45
|
+
|
46
|
+
function toDanceModel(dto, trackMap, choreographerMap) {
|
47
|
+
var tracks = dto.tracks.map(function (id) {
|
48
|
+
return trackMap[id];
|
49
|
+
}).filter(Boolean);
|
50
|
+
return {
|
51
|
+
id: dto.id,
|
52
|
+
danceName: dto.danceName,
|
53
|
+
choreographers: dto.choreographers.map(function (id) {
|
54
|
+
return toChoreographerModel(choreographerMap[id]);
|
55
|
+
}),
|
56
|
+
stepsheet: dto.stepsheet,
|
57
|
+
difficulty: dto.difficulty,
|
58
|
+
primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),
|
59
|
+
tracks: tracks.map(toTrackModel),
|
60
|
+
isVerified: dto.isVerified
|
61
|
+
};
|
62
|
+
}
|
63
|
+
|
64
|
+
function toCollectionModel(dto, danceMap, trackMap, choreographerMap) {
|
65
|
+
var dances = dto.dances.map(function (id) {
|
66
|
+
return danceMap[id];
|
67
|
+
}).filter(Boolean);
|
68
|
+
return {
|
69
|
+
id: dto._id,
|
70
|
+
name: dto.name,
|
71
|
+
dances: dances.map(function (d) {
|
72
|
+
return toDanceModel(d, trackMap, choreographerMap);
|
73
|
+
}),
|
74
|
+
isVerified: dto.isVerified,
|
75
|
+
createdAt: dto.createdAt,
|
76
|
+
updatedAt: dto.updatedAt,
|
77
|
+
createdBy: dto.createdBy,
|
78
|
+
isCopyable: dto.isCopyable
|
79
|
+
};
|
80
|
+
}
|
81
|
+
|
82
|
+
function toDanceDTO(dance, isVerified) {
|
83
|
+
var _dance$choreographers, _dance$choreographers2, _dance$primaryTrack, _dance$tracks$map, _dance$tracks;
|
84
|
+
return {
|
85
|
+
id: dance._id,
|
86
|
+
danceName: dance.danceName,
|
87
|
+
choreographers: (_dance$choreographers = (_dance$choreographers2 = dance.choreographers) == null ? void 0 : _dance$choreographers2.map(function (id) {
|
88
|
+
return id;
|
89
|
+
})) != null ? _dance$choreographers : [],
|
90
|
+
stepsheet: dance.stepsheet,
|
91
|
+
difficulty: dance.difficulty,
|
92
|
+
primaryTrack: (_dance$primaryTrack = dance.primaryTrack) != null ? _dance$primaryTrack : '',
|
93
|
+
tracks: (_dance$tracks$map = (_dance$tracks = dance.tracks) == null ? void 0 : _dance$tracks.map(function (id) {
|
94
|
+
return id;
|
95
|
+
})) != null ? _dance$tracks$map : [],
|
96
|
+
isVerified: isVerified
|
97
|
+
};
|
98
|
+
}
|
99
|
+
|
100
|
+
function toInstructorDTO(instructor, isVerified) {
|
101
|
+
return {
|
102
|
+
id: instructor._id,
|
103
|
+
name: instructor.name,
|
104
|
+
userid: "leave this this empty for now and figure it out later...",
|
105
|
+
isVerified: isVerified
|
106
|
+
};
|
107
|
+
}
|
108
|
+
|
109
|
+
function toInstructorModel(dto) {
|
110
|
+
return {
|
111
|
+
id: dto.id,
|
112
|
+
name: dto.name,
|
113
|
+
userid: "leave this this empty for now and figure it out later...",
|
114
|
+
isVerified: dto.isVerified
|
115
|
+
};
|
116
|
+
}
|
117
|
+
|
118
|
+
function toLessonDTO(LessonEntity, isVerified) {
|
119
|
+
return {
|
120
|
+
id: LessonEntity._id,
|
121
|
+
lessonday: LessonEntity.lessonday,
|
122
|
+
lessonstart: LessonEntity.lessonstart,
|
123
|
+
instructors: LessonEntity.instructors,
|
124
|
+
duration: LessonEntity.duration,
|
125
|
+
lessoncost: LessonEntity.lessoncost,
|
126
|
+
notes: LessonEntity.notes,
|
127
|
+
difficulty: LessonEntity.difficulty,
|
128
|
+
isVerified: isVerified
|
129
|
+
};
|
130
|
+
}
|
131
|
+
|
132
|
+
function toLessonModel(lessonDTO, instructorMap) {
|
133
|
+
return {
|
134
|
+
id: lessonDTO.id,
|
135
|
+
lessonday: lessonDTO.lessonday,
|
136
|
+
lessonstart: lessonDTO.lessonstart,
|
137
|
+
instructors: lessonDTO.instructors.map(function (id) {
|
138
|
+
return instructorMap[id];
|
139
|
+
}).filter(Boolean),
|
140
|
+
duration: lessonDTO.duration,
|
141
|
+
lessoncost: lessonDTO.lessoncost,
|
142
|
+
notes: lessonDTO.notes,
|
143
|
+
difficulty: lessonDTO.difficulty
|
144
|
+
};
|
145
|
+
}
|
146
|
+
|
147
|
+
function toTrackDTO(dto, isVerified) {
|
148
|
+
return {
|
149
|
+
id: dto._id,
|
150
|
+
name: dto.name,
|
151
|
+
artists: dto.artists,
|
152
|
+
isrc: dto.isrc,
|
153
|
+
uri: dto.uri,
|
154
|
+
duration_ms: dto.duration_ms,
|
155
|
+
explicit: dto.explicit,
|
156
|
+
isVerified: isVerified
|
157
|
+
};
|
158
|
+
}
|
159
|
+
|
160
|
+
function toUserAcquaintanceDTO(user, isVerified, userProfile) {
|
161
|
+
var _user$links;
|
162
|
+
return {
|
163
|
+
id: user._id,
|
164
|
+
username: user.username || user.name || '',
|
165
|
+
image: user.image || '',
|
166
|
+
bio: user.bio || '',
|
167
|
+
isVerified: isVerified,
|
168
|
+
profile: {
|
169
|
+
dances: {
|
170
|
+
favorites: userProfile.favorites,
|
171
|
+
flagged: userProfile.flagged,
|
172
|
+
known: userProfile.known,
|
173
|
+
refresh: userProfile.refresh
|
174
|
+
},
|
175
|
+
collections: userProfile.collections,
|
176
|
+
venues: userProfile.venues,
|
177
|
+
friendsCount: userProfile.friendsCount,
|
178
|
+
followingCount: userProfile.followingCount,
|
179
|
+
followersCount: userProfile.followersCount,
|
180
|
+
mutualFriendsCount: userProfile.mutualFriendsCount,
|
181
|
+
links: (_user$links = user.links) != null ? _user$links : {}
|
182
|
+
}
|
183
|
+
};
|
184
|
+
}
|
185
|
+
|
186
|
+
function toUserAcquaintanceModel(dto, danceMap, trackMap, collectionMap, choreographerMap) {
|
187
|
+
return {
|
188
|
+
id: dto.id,
|
189
|
+
username: dto.username,
|
190
|
+
image: dto.image,
|
191
|
+
bio: dto.bio,
|
192
|
+
isVerified: dto.isVerified,
|
193
|
+
friendsCount: dto.profile.friendsCount,
|
194
|
+
followersCount: dto.profile.followersCount,
|
195
|
+
mutualFriendsCount: dto.profile.mutualFriendsCount,
|
196
|
+
links: dto.profile.links,
|
197
|
+
dances: {
|
198
|
+
favorites: dto.profile.dances.favorites.map(function (id) {
|
199
|
+
return toDanceModel(danceMap[id], trackMap, choreographerMap);
|
200
|
+
}),
|
201
|
+
flagged: dto.profile.dances.flagged.map(function (id) {
|
202
|
+
return toDanceModel(danceMap[id], trackMap, choreographerMap);
|
203
|
+
}),
|
204
|
+
known: dto.profile.dances.known.map(function (id) {
|
205
|
+
return toDanceModel(danceMap[id], trackMap, choreographerMap);
|
206
|
+
}),
|
207
|
+
refresh: dto.profile.dances.refresh.map(function (id) {
|
208
|
+
return toDanceModel(danceMap[id], trackMap, choreographerMap);
|
209
|
+
})
|
210
|
+
},
|
211
|
+
collections: dto.profile.collections.map(function (id) {
|
212
|
+
return toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap);
|
213
|
+
})
|
214
|
+
};
|
215
|
+
}
|
216
|
+
|
217
|
+
function toUserDTO(user, isVerified, danceIds, collections, venues, friends, following, friendsRequested, friendRequests) {
|
218
|
+
var _user$email, _user$name, _user$username, _user$image, _user$bio, _user$links;
|
219
|
+
if (venues === void 0) {
|
220
|
+
venues = [];
|
221
|
+
}
|
222
|
+
if (friends === void 0) {
|
223
|
+
friends = [];
|
224
|
+
}
|
225
|
+
if (following === void 0) {
|
226
|
+
following = [];
|
227
|
+
}
|
228
|
+
if (friendsRequested === void 0) {
|
229
|
+
friendsRequested = [];
|
230
|
+
}
|
231
|
+
if (friendRequests === void 0) {
|
232
|
+
friendRequests = [];
|
233
|
+
}
|
234
|
+
return {
|
235
|
+
_id: user._id.toString(),
|
236
|
+
email: (_user$email = user.email) != null ? _user$email : '',
|
237
|
+
name: (_user$name = user.name) != null ? _user$name : '',
|
238
|
+
username: (_user$username = user.username) != null ? _user$username : '',
|
239
|
+
image: (_user$image = user.image) != null ? _user$image : '',
|
240
|
+
bio: (_user$bio = user.bio) != null ? _user$bio : '',
|
241
|
+
isVerified: isVerified,
|
242
|
+
profile: {
|
243
|
+
danceIds: danceIds,
|
244
|
+
collections: collections,
|
245
|
+
venues: venues,
|
246
|
+
friends: friends,
|
247
|
+
following: following,
|
248
|
+
links: (_user$links = user.links) != null ? _user$links : {},
|
249
|
+
friendsRequested: friendsRequested,
|
250
|
+
friendRequests: friendRequests
|
251
|
+
}
|
252
|
+
};
|
253
|
+
}
|
254
|
+
|
255
|
+
function toUserModel(userDTO, danceMap, collectionMap, venueMap, friendsMap, followingMap) {
|
256
|
+
var expand = function expand(ids, map) {
|
257
|
+
return ids.map(function (id) {
|
258
|
+
return map[id];
|
259
|
+
}).filter(Boolean);
|
260
|
+
};
|
261
|
+
return {
|
262
|
+
_id: userDTO._id,
|
263
|
+
email: userDTO.email,
|
264
|
+
name: userDTO.name,
|
265
|
+
username: userDTO.username,
|
266
|
+
image: userDTO.image,
|
267
|
+
bio: userDTO.bio,
|
268
|
+
isVerified: userDTO.isVerified,
|
269
|
+
profile: {
|
270
|
+
dances: {
|
271
|
+
favorites: expand(userDTO.profile.danceIds.favorites, danceMap),
|
272
|
+
flagged: expand(userDTO.profile.danceIds.flagged, danceMap),
|
273
|
+
known: expand(userDTO.profile.danceIds.known, danceMap),
|
274
|
+
refresh: expand(userDTO.profile.danceIds.refresh, danceMap)
|
275
|
+
},
|
276
|
+
collections: expand(userDTO.profile.collections, collectionMap),
|
277
|
+
venues: expand(userDTO.profile.venues, venueMap),
|
278
|
+
friends: expand(userDTO.profile.friends, friendsMap),
|
279
|
+
following: expand(userDTO.profile.following, followingMap),
|
280
|
+
friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),
|
281
|
+
friendRequests: expand(userDTO.profile.friendRequests, friendsMap),
|
282
|
+
followersCount: userDTO.profile.followersCount || 0,
|
283
|
+
links: userDTO.profile.links
|
284
|
+
}
|
285
|
+
};
|
286
|
+
}
|
287
|
+
|
288
|
+
function toVenueDTO(venue, lessonIds, isVerified) {
|
289
|
+
var _venue$isDeleted, _venue$deletedAt, _venue$createdAt;
|
290
|
+
return {
|
291
|
+
id: venue._id,
|
292
|
+
venuename: venue.venuename,
|
293
|
+
venueaddress: venue.venueaddress,
|
294
|
+
geolocation: venue.geolocation,
|
295
|
+
phone: venue.phone,
|
296
|
+
website: venue.website,
|
297
|
+
contactEmail: venue.contactEmail,
|
298
|
+
contactName: venue.contactName,
|
299
|
+
contactPhone: venue.contactPhone,
|
300
|
+
lessonsIds: lessonIds,
|
301
|
+
isVerified: isVerified,
|
302
|
+
isDeleted: (_venue$isDeleted = venue.isDeleted) != null ? _venue$isDeleted : false,
|
303
|
+
deletedAt: (_venue$deletedAt = venue.deletedAt) != null ? _venue$deletedAt : null,
|
304
|
+
createdAt: (_venue$createdAt = venue.createdAt) != null ? _venue$createdAt : null
|
305
|
+
};
|
306
|
+
}
|
307
|
+
|
308
|
+
function _extends() {
|
309
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
310
|
+
for (var e = 1; e < arguments.length; e++) {
|
311
|
+
var t = arguments[e];
|
312
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
313
|
+
}
|
314
|
+
return n;
|
315
|
+
}, _extends.apply(null, arguments);
|
316
|
+
}
|
317
|
+
|
318
|
+
function toVenueModel(venueDTO, lessonMap, instructorMap) {
|
319
|
+
var expandedLessons = venueDTO.lessonsIds.map(function (id) {
|
320
|
+
return toLessonModel(lessonMap[id], instructorMap);
|
321
|
+
}).filter(Boolean);
|
322
|
+
return _extends({}, venueDTO, {
|
323
|
+
lessons: expandedLessons
|
324
|
+
});
|
325
|
+
}
|
326
|
+
|
327
|
+
export { getAllUserDanceIds, toChoreographerDTO, toChoreographerModel, toCollectionModel, toDanceDTO, toDanceModel, toInstructorDTO, toInstructorModel, toLessonDTO, toLessonModel, toTrackDTO, toTrackModel, toUserAcquaintanceDTO, toUserAcquaintanceModel, toUserDTO, toUserModel, toVenueDTO, toVenueModel };
|
18
328
|
//# sourceMappingURL=ldco-contract.esm.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ldco-contract.esm.js","sources":["../src/lib/getAllUserDanceIds.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}"],"names":["getAllUserDanceIds","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","filter","item","index","indexOf"],"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;;;;"}
|
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,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XI,OAAO,EAAEF;;AAEjB;;;;"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { ChoreographerDTO } from '../../types/dto/choreographer.dto';
|
2
|
+
import { CollectionDTO } from '../../types/dto/collection.dto';
|
3
|
+
import { DanceDTO } from '../../types/dto/dance.dto';
|
4
|
+
import { TrackDTO } from '../../types/dto/track.dto';
|
5
|
+
import { CollectionModel } from '../../types/model/collection.model';
|
6
|
+
export declare function toCollectionModel(dto: CollectionDTO, danceMap: Record<string, DanceDTO>, trackMap: Record<string, TrackDTO>, choreographerMap: Record<string, ChoreographerDTO>): CollectionModel;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { ChoreographerDTO } from '../../types/dto/choreographer.dto';
|
2
|
+
import { DanceDTO } from '../../types/dto/dance.dto';
|
3
|
+
import { TrackDTO } from '../../types/dto/track.dto';
|
4
|
+
import { DanceModel } from '../../types/model/dance.model';
|
5
|
+
export declare function toDanceModel(dto: DanceDTO, trackMap: Record<string, TrackDTO>, choreographerMap: Record<string, ChoreographerDTO>): DanceModel;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { InstructorDTO } from "../../types/dto/instructor.dto";
|
2
|
+
import { LessonDTO } from "../../types/dto/lesson.dto";
|
3
|
+
import { LessonModel } from "../../types/model/lesson.model";
|
4
|
+
export declare function toLessonModel(lessonDTO: LessonDTO, instructorMap: Record<string, InstructorDTO>): LessonModel;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { UserAcquaintanceDTO } from "../../types/dto/userAcquaintance.dto";
|
2
|
+
import { UserEntity } from "../../types/entities/user.entity";
|
3
|
+
export declare function toUserAcquaintanceDTO(user: UserEntity, isVerified: boolean, userProfile: {
|
4
|
+
favorites: string[];
|
5
|
+
flagged: string[];
|
6
|
+
known: string[];
|
7
|
+
refresh: string[];
|
8
|
+
collections: string[];
|
9
|
+
venues: string[];
|
10
|
+
friendsCount: number;
|
11
|
+
followingCount: number;
|
12
|
+
followersCount: number;
|
13
|
+
mutualFriendsCount: number;
|
14
|
+
}): UserAcquaintanceDTO;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ChoreographerDTO } from "../../types/dto/choreographer.dto";
|
2
|
+
import { CollectionDTO } from "../../types/dto/collection.dto";
|
3
|
+
import { DanceDTO } from "../../types/dto/dance.dto";
|
4
|
+
import { TrackDTO } from "../../types/dto/track.dto";
|
5
|
+
import { UserAcquaintanceDTO } from "../../types/dto/userAcquaintance.dto";
|
6
|
+
import { UserAcquaintanceModel } from "../../types/model/userAcquaintance.model";
|
7
|
+
export declare function toUserAcquaintanceModel(dto: UserAcquaintanceDTO, danceMap: Record<string, DanceDTO>, trackMap: Record<string, TrackDTO>, collectionMap: Record<string, CollectionDTO>, choreographerMap: Record<string, ChoreographerDTO>): UserAcquaintanceModel;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { UserDTO } from "../../types/dto/user.dto";
|
2
|
+
import { UserEntity } from "../../types/entities/user.entity";
|
3
|
+
export declare function toUserDTO(user: UserEntity, isVerified: boolean, danceIds: {
|
4
|
+
favorites: string[];
|
5
|
+
flagged: string[];
|
6
|
+
known: string[];
|
7
|
+
refresh: string[];
|
8
|
+
}, collections: string[], venues?: string[], friends?: string[], following?: string[], friendsRequested?: string[], friendRequests?: string[]): UserDTO;
|
9
|
+
export default toUserDTO;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { UserDTO } from "../../types/dto/user.dto";
|
2
|
+
import { CollectionModel } from "../../types/model/collection.model";
|
3
|
+
import { DanceModel } from "../../types/model/dance.model";
|
4
|
+
import { UserModel } from "../../types/model/user.model";
|
5
|
+
import { UserAcquaintanceModel } from "../../types/model/userAcquaintance.model";
|
6
|
+
import { VenueModel } from "../../types/model/venue.model";
|
7
|
+
export declare function toUserModel(userDTO: UserDTO, danceMap: Record<string, DanceModel>, collectionMap: Record<string, CollectionModel>, venueMap: Record<string, VenueModel>, friendsMap: Record<string, UserAcquaintanceModel>, followingMap: Record<string, UserAcquaintanceModel>): UserModel;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { InstructorDTO } from "../../types/dto/instructor.dto";
|
2
|
+
import { LessonDTO } from "../../types/dto/lesson.dto";
|
3
|
+
import { VenueDTO } from "../../types/dto/venue.dto";
|
4
|
+
import { VenueModel } from "../../types/model/venue.model";
|
5
|
+
export declare function toVenueModel(venueDTO: VenueDTO, lessonMap: Record<string, LessonDTO>, instructorMap: Record<string, InstructorDTO>): VenueModel;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export interface LessonEntity {
|
2
|
+
_id: string;
|
3
|
+
venueid: string;
|
4
|
+
title: string;
|
5
|
+
description: string;
|
6
|
+
lessonday: string;
|
7
|
+
lessonstart: string;
|
8
|
+
instructors: string[];
|
9
|
+
duration: string;
|
10
|
+
lessoncost: string;
|
11
|
+
notes: string;
|
12
|
+
difficulty: string;
|
13
|
+
}
|