@myclub_se/data-access 2.9.6 → 2.10.0
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/esm2020/lib/api-models/api-search-club.mjs +1 -1
- package/esm2020/lib/authentication/authentication.service.mjs +4 -1
- package/esm2020/lib/interfaces/index.mjs +2 -1
- package/esm2020/lib/interfaces/open-activity-search-params.interface.mjs +2 -0
- package/esm2020/lib/models/search-club.mjs +4 -3
- package/esm2020/lib/services/activity.service.mjs +63 -15
- package/esm2020/lib/services/auth.service.mjs +6 -1
- package/esm2020/lib/services/club.service.mjs +6 -1
- package/esm2020/lib/services/factories/search-club-factory.mjs +2 -2
- package/fesm2015/myclub_se-data-access.mjs +79 -17
- package/fesm2015/myclub_se-data-access.mjs.map +1 -1
- package/fesm2020/myclub_se-data-access.mjs +79 -17
- package/fesm2020/myclub_se-data-access.mjs.map +1 -1
- package/lib/api-models/api-search-club.d.ts +2 -1
- package/lib/authentication/authentication.service.d.ts +1 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/interfaces/open-activity-search-params.interface.d.ts +6 -0
- package/lib/models/search-club.d.ts +3 -2
- package/lib/services/activity.service.d.ts +9 -2
- package/lib/services/auth.service.d.ts +1 -0
- package/lib/services/club.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1467,14 +1467,15 @@ var Role;
|
|
|
1467
1467
|
})(Role || (Role = {}));
|
|
1468
1468
|
|
|
1469
1469
|
class SearchClub {
|
|
1470
|
-
constructor(id, leader_member_search, member_search, member_view, open_activities, open_activities_name,
|
|
1470
|
+
constructor(id, leader_member_search, member_search, member_view, name, open_activities, open_activities_name, open_activities_search_type) {
|
|
1471
1471
|
this.id = id;
|
|
1472
1472
|
this.leader_member_search = leader_member_search;
|
|
1473
1473
|
this.member_search = member_search;
|
|
1474
1474
|
this.member_view = member_view;
|
|
1475
|
+
this.name = name;
|
|
1475
1476
|
this.open_activities = open_activities;
|
|
1476
1477
|
this.open_activities_name = open_activities_name;
|
|
1477
|
-
this.
|
|
1478
|
+
this.open_activities_search_type = open_activities_search_type;
|
|
1478
1479
|
}
|
|
1479
1480
|
}
|
|
1480
1481
|
|
|
@@ -1748,7 +1749,7 @@ const paymentAttemptFactory = (apiPaymentAttempt) => {
|
|
|
1748
1749
|
|
|
1749
1750
|
const publicAuthenticationFactory = (publicToken) => new PublicAuthentication(publicToken.token, publicToken.token_expires);
|
|
1750
1751
|
|
|
1751
|
-
const searchClubFactory = (apiSearchClub) => new SearchClub(apiSearchClub.id, apiSearchClub.leader_member_search, apiSearchClub.member_search, apiSearchClub.member_view, apiSearchClub.open_activities, apiSearchClub.open_activities_name, apiSearchClub.
|
|
1752
|
+
const searchClubFactory = (apiSearchClub) => new SearchClub(apiSearchClub.id, apiSearchClub.leader_member_search, apiSearchClub.member_search, apiSearchClub.member_view, apiSearchClub.name, apiSearchClub.open_activities, apiSearchClub.open_activities_name, apiSearchClub.open_activities_search_type);
|
|
1752
1753
|
|
|
1753
1754
|
const searchMemberCardFactory = (apiSearchMemberCard) => new SearchMemberCard(apiSearchMemberCard.id, apiSearchMemberCard.name, apiSearchMemberCard.notification_count, apiSearchMemberCard.pdf_url);
|
|
1754
1755
|
|
|
@@ -1865,6 +1866,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
1865
1866
|
|
|
1866
1867
|
const AUTHS_PATH = 'every-admin/auths/';
|
|
1867
1868
|
const REMOVE_AUTH_PATH = 'accounts/remove-auth/:authId/:authType/:id/';
|
|
1869
|
+
const UPDATE_MEMBERS_PATH = 'every-admin/auths/update-members/';
|
|
1868
1870
|
class AuthService {
|
|
1869
1871
|
constructor(apiService) {
|
|
1870
1872
|
this.apiService = apiService;
|
|
@@ -1894,6 +1896,10 @@ class AuthService {
|
|
|
1894
1896
|
removeTeamAuth(authId, teamId) {
|
|
1895
1897
|
return this.removeAuth(authId, teamId, 'team');
|
|
1896
1898
|
}
|
|
1899
|
+
updateMembers() {
|
|
1900
|
+
return this.apiService.updateResourceNoResponse(Role.None, UPDATE_MEMBERS_PATH, {}, {})
|
|
1901
|
+
.pipe(map(() => true), catchError(() => of(false)));
|
|
1902
|
+
}
|
|
1897
1903
|
removeAuth(authId, authTypeId, authType) {
|
|
1898
1904
|
return this.apiService.postResource(() => { }, Role.None, REMOVE_AUTH_PATH, {
|
|
1899
1905
|
authId,
|
|
@@ -1916,10 +1922,14 @@ const MEMBER_ACTIVITY_INVITE_PATH = ':memberId/activities/:activityInviteId/';
|
|
|
1916
1922
|
const MEMBER_ACTIVITY_INVITES_PATH = ':memberId/activities/';
|
|
1917
1923
|
const MEMBER_CALENDAR_PATH = ':memberId/activities/calendar/';
|
|
1918
1924
|
const MEMBER_OPEN_ACTIVITIES_PATH = ':memberId/open-activities/';
|
|
1925
|
+
const MEMBER_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH = ':memberId/open-activities/types/';
|
|
1926
|
+
const MEMBER_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH = ':memberId/open-activities/locations/';
|
|
1919
1927
|
const MEMBER_OPEN_ACTIVITY_PATH = ':memberId/open-activities/:activityId/';
|
|
1920
1928
|
const MEMBER_OPEN_ACTIVITY_RESPOND_PATH = ':memberId/open-activities/:activityId/respond/';
|
|
1921
1929
|
const PUBLIC_ACTIVITY_INVITE_PATH = 'activities/:id/:token/';
|
|
1922
1930
|
const PUBLIC_OPEN_ACTIVITIES_PATH = 'open-activities/';
|
|
1931
|
+
const PUBLIC_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH = 'open-activities/types/';
|
|
1932
|
+
const PUBLIC_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH = 'open-activities/locations/';
|
|
1923
1933
|
const PUBLIC_OPEN_ACTIVITY_PATH = 'open-activities/:activityId/';
|
|
1924
1934
|
const PUBLIC_OPEN_ACTIVITY_RESPOND_PATH = 'open-activities/:activityId/respond/';
|
|
1925
1935
|
const PUBLIC_OPEN_ACTIVITY_INVITE_PATH = 'open-activities/invites/:activityId/';
|
|
@@ -2018,15 +2028,10 @@ class ActivityService {
|
|
|
2018
2028
|
params
|
|
2019
2029
|
});
|
|
2020
2030
|
}
|
|
2021
|
-
getMemberOpenActivities(memberId,
|
|
2022
|
-
const params = {
|
|
2023
|
-
end_date: endDate,
|
|
2024
|
-
limit: 'null',
|
|
2025
|
-
start_date: startDate
|
|
2026
|
-
};
|
|
2031
|
+
getMemberOpenActivities(memberId, openActivitySearchParams) {
|
|
2027
2032
|
return this.apiService
|
|
2028
2033
|
.getCollection(openActivityFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_PATH, { memberId }, {
|
|
2029
|
-
params
|
|
2034
|
+
params: this.getOpenActivitySearchParams(openActivitySearchParams)
|
|
2030
2035
|
});
|
|
2031
2036
|
}
|
|
2032
2037
|
getMemberOpenActivity(memberId, activityId) {
|
|
@@ -2036,6 +2041,22 @@ class ActivityService {
|
|
|
2036
2041
|
activityId
|
|
2037
2042
|
});
|
|
2038
2043
|
}
|
|
2044
|
+
getMemberOpenActivityActivityTypes(memberId, startDate = null, endDate = null, all = false) {
|
|
2045
|
+
return this.apiService
|
|
2046
|
+
.getCollection(activityTypeFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH, {
|
|
2047
|
+
memberId
|
|
2048
|
+
}, {
|
|
2049
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
getMemberOpenActivityLocations(memberId, startDate = null, endDate = null, all = false) {
|
|
2053
|
+
return this.apiService
|
|
2054
|
+
.getCollection(activityLocationFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH, {
|
|
2055
|
+
memberId
|
|
2056
|
+
}, {
|
|
2057
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2058
|
+
});
|
|
2059
|
+
}
|
|
2039
2060
|
getPublicActivityInvite(id, token) {
|
|
2040
2061
|
return this.apiService
|
|
2041
2062
|
.getResource(activityInviteFactory, Role.Public, PUBLIC_ACTIVITY_INVITE_PATH, {
|
|
@@ -2043,19 +2064,26 @@ class ActivityService {
|
|
|
2043
2064
|
token
|
|
2044
2065
|
});
|
|
2045
2066
|
}
|
|
2046
|
-
getPublicOpenActivities(
|
|
2047
|
-
const params = {
|
|
2048
|
-
end_date: endDate,
|
|
2049
|
-
limit: 'null',
|
|
2050
|
-
start_date: startDate
|
|
2051
|
-
};
|
|
2067
|
+
getPublicOpenActivities(openActivitySearchParams) {
|
|
2052
2068
|
return this.apiService
|
|
2053
|
-
.getCollection(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_PATH, {}, { params });
|
|
2069
|
+
.getCollection(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_PATH, {}, { params: this.getOpenActivitySearchParams(openActivitySearchParams) });
|
|
2054
2070
|
}
|
|
2055
2071
|
getPublicOpenActivity(activityId) {
|
|
2056
2072
|
return this.apiService
|
|
2057
2073
|
.getResource(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITY_PATH, { activityId });
|
|
2058
2074
|
}
|
|
2075
|
+
getPublicOpenActivityActivityTypes(startDate = null, endDate = null, all = false) {
|
|
2076
|
+
return this.apiService
|
|
2077
|
+
.getCollection(activityTypeFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH, {}, {
|
|
2078
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
getPublicOpenActivityLocations(startDate = null, endDate = null, all = false) {
|
|
2082
|
+
return this.apiService
|
|
2083
|
+
.getCollection(activityLocationFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH, {}, {
|
|
2084
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2059
2087
|
getTeamActivity(teamId, id) {
|
|
2060
2088
|
return this.apiService
|
|
2061
2089
|
.getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_PATH, { teamId, id });
|
|
@@ -2469,6 +2497,32 @@ class ActivityService {
|
|
|
2469
2497
|
members
|
|
2470
2498
|
});
|
|
2471
2499
|
}
|
|
2500
|
+
getOpenActivityDateParams(startDate, endDate, all = false) {
|
|
2501
|
+
let params = {
|
|
2502
|
+
'all': all ? 'true' : 'false'
|
|
2503
|
+
};
|
|
2504
|
+
if (startDate) {
|
|
2505
|
+
params['start_date'] = startDate;
|
|
2506
|
+
}
|
|
2507
|
+
if (endDate) {
|
|
2508
|
+
params['end_date'] = endDate;
|
|
2509
|
+
}
|
|
2510
|
+
return params;
|
|
2511
|
+
}
|
|
2512
|
+
getOpenActivitySearchParams(openActivitySearchParams) {
|
|
2513
|
+
const params = {
|
|
2514
|
+
end_date: openActivitySearchParams.endDate,
|
|
2515
|
+
limit: 'null',
|
|
2516
|
+
start_date: openActivitySearchParams.startDate
|
|
2517
|
+
};
|
|
2518
|
+
if (openActivitySearchParams.activityTypeId) {
|
|
2519
|
+
params['activity_type_id'] = openActivitySearchParams.activityTypeId;
|
|
2520
|
+
}
|
|
2521
|
+
if (openActivitySearchParams.locationId) {
|
|
2522
|
+
params['location_id'] = openActivitySearchParams.locationId;
|
|
2523
|
+
}
|
|
2524
|
+
return params;
|
|
2525
|
+
}
|
|
2472
2526
|
removeUnusedActivityFields(activity) {
|
|
2473
2527
|
if (typeof activity.id !== 'undefined') {
|
|
2474
2528
|
delete activity.id;
|
|
@@ -3225,6 +3279,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
3225
3279
|
}], ctorParameters: function () { return [{ type: ApiService }]; } });
|
|
3226
3280
|
|
|
3227
3281
|
const MEMBER_CLUB_INFO = ':memberId/club-info/';
|
|
3282
|
+
const PUBLIC_CLUB_INFO = 'club-info/';
|
|
3228
3283
|
const TEAM_CLUB_INFO = ':teamId/club-info/';
|
|
3229
3284
|
class ClubService {
|
|
3230
3285
|
constructor(apiService) {
|
|
@@ -3234,6 +3289,10 @@ class ClubService {
|
|
|
3234
3289
|
return this.apiService
|
|
3235
3290
|
.getResource(searchClubFactory, Role.MemberAdmin, MEMBER_CLUB_INFO, { memberId });
|
|
3236
3291
|
}
|
|
3292
|
+
getPublicClubInfo() {
|
|
3293
|
+
return this.apiService
|
|
3294
|
+
.getResource(searchClubFactory, Role.Public, PUBLIC_CLUB_INFO);
|
|
3295
|
+
}
|
|
3237
3296
|
getTeamClubInfo(teamId) {
|
|
3238
3297
|
return this.apiService
|
|
3239
3298
|
.getResource(searchClubFactory, Role.TeamAdmin, TEAM_CLUB_INFO, { teamId });
|
|
@@ -4121,6 +4180,9 @@ class AuthenticationService {
|
|
|
4121
4180
|
this.publicAuthentication = null;
|
|
4122
4181
|
this.currentTokenSubject.next(null);
|
|
4123
4182
|
}
|
|
4183
|
+
clearPublicAuthentication() {
|
|
4184
|
+
this.publicAuthentication = null;
|
|
4185
|
+
}
|
|
4124
4186
|
getLoginCode(email, clubId) {
|
|
4125
4187
|
const params = { email };
|
|
4126
4188
|
if (clubId) {
|