@scoreboardmax/api-types 1.0.34 → 1.0.35
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/internal.cjs +17 -1
- package/dist/internal.d.ts +4 -0
- package/dist/internal.mjs +12 -0
- package/package.json +1 -1
package/dist/internal.cjs
CHANGED
|
@@ -10,7 +10,15 @@
|
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.WrestlingStyle = exports.WrestlingPeriod = exports.WrestlingOvertimeType = exports.WrestlingMeetType = exports.WebsocketOperation = exports.WebsocketMessageType = exports.VolleyballSet = exports.TemplateUseCase = exports.SoccerPeriod = exports.SoccerPenaltyCardType = exports.SoccerGamePeriods = exports.ScoreboardType = exports.ScoreboardCode = exports.PlanId = exports.OAuthProvider = exports.OAuthAction = exports.MetaMessageType = exports.MagicLinkType = exports.FootballPeriod = exports.FileType = exports.ExtraTimeLabel = exports.EventAction = exports.ErrorCode = exports.DownAndDistanceDisplay = exports.DisplayConnectionStatus = exports.ContentType = exports.ClockType = exports.BasketballTimeoutAllocation = exports.BasketballPeriod = exports.BasketballGamePeriods = exports.BaseballInningSegment = exports.AuthType = exports.AppType = exports.ApiResource = exports.ApiAction = exports.isWrestlingData = exports.isVolleyballData = exports.isSoccerData = exports.isFootballData = exports.isBasketballData = exports.isBaseballData = void 0;
|
|
13
|
+
exports.WrestlingStyle = exports.WrestlingPeriod = exports.WrestlingOvertimeType = exports.WrestlingMeetType = exports.WebsocketOperation = exports.WebsocketMessageType = exports.VolleyballSet = exports.TemplateUseCase = exports.SoccerPeriod = exports.SoccerPenaltyCardType = exports.SoccerGamePeriods = exports.ScoreboardType = exports.ScoreboardCode = exports.PlanId = exports.OAuthProvider = exports.OAuthAction = exports.MetaMessageType = exports.MagicLinkType = exports.FootballPeriod = exports.FileType = exports.ExtraTimeLabel = exports.EventAction = exports.ErrorCode = exports.DownAndDistanceDisplay = exports.DisplayConnectionStatus = exports.ContentType = exports.ClockType = exports.BasketballTimeoutAllocation = exports.BasketballPeriod = exports.BasketballGamePeriods = exports.BaseballInningSegment = exports.AuthType = exports.AppType = exports.ApiResource = exports.ApiAction = exports.isWrestlingData = exports.isVolleyballData = exports.isUserResponseAdmin = exports.isUserListResponseAdmin = exports.isSoccerData = exports.isFootballData = exports.isBasketballData = exports.isBaseballData = exports.isAuthResponseAdmin = exports.isAccountResponseAdmin = void 0;
|
|
14
|
+
const isAccountResponseAdmin = (account) => {
|
|
15
|
+
return "paymentProvider" in account && "paymentProviderCustomerId" in account;
|
|
16
|
+
};
|
|
17
|
+
exports.isAccountResponseAdmin = isAccountResponseAdmin;
|
|
18
|
+
const isAuthResponseAdmin = (auth) => {
|
|
19
|
+
return "isAdmin" in auth;
|
|
20
|
+
};
|
|
21
|
+
exports.isAuthResponseAdmin = isAuthResponseAdmin;
|
|
14
22
|
const isBaseballData = (data) => {
|
|
15
23
|
return data.type === ScoreboardType.Baseball;
|
|
16
24
|
};
|
|
@@ -27,6 +35,14 @@ const isSoccerData = (data) => {
|
|
|
27
35
|
return data.type === ScoreboardType.Soccer;
|
|
28
36
|
};
|
|
29
37
|
exports.isSoccerData = isSoccerData;
|
|
38
|
+
const isUserListResponseAdmin = (list) => {
|
|
39
|
+
return list.data.length > 0 && (0, exports.isUserResponseAdmin)(list.data[0]);
|
|
40
|
+
};
|
|
41
|
+
exports.isUserListResponseAdmin = isUserListResponseAdmin;
|
|
42
|
+
const isUserResponseAdmin = (user) => {
|
|
43
|
+
return "isAdmin" in user;
|
|
44
|
+
};
|
|
45
|
+
exports.isUserResponseAdmin = isUserResponseAdmin;
|
|
30
46
|
const isVolleyballData = (data) => {
|
|
31
47
|
return data.type === ScoreboardType.Volleyball;
|
|
32
48
|
};
|
package/dist/internal.d.ts
CHANGED
|
@@ -8,10 +8,14 @@
|
|
|
8
8
|
* these interfaces will not be returned by the API to non-admin users.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
+
export declare const isAccountResponseAdmin: (account: AccountResponse) => account is AccountResponseAdmin;
|
|
12
|
+
export declare const isAuthResponseAdmin: (auth: AuthResponse) => auth is AuthResponseAdmin;
|
|
11
13
|
export declare const isBaseballData: (data: any) => data is BaseballDataResponse;
|
|
12
14
|
export declare const isBasketballData: (data: any) => data is BasketballDataResponse;
|
|
13
15
|
export declare const isFootballData: (data: any) => data is FootballDataResponse;
|
|
14
16
|
export declare const isSoccerData: (data: any) => data is SoccerDataResponse;
|
|
17
|
+
export declare const isUserListResponseAdmin: (list: UserListResponse) => list is UserListResponseAdmin;
|
|
18
|
+
export declare const isUserResponseAdmin: (user: UserResponse) => user is UserResponseAdmin;
|
|
15
19
|
export declare const isVolleyballData: (data: any) => data is VolleyballDataResponse;
|
|
16
20
|
export declare const isWrestlingData: (data: any) => data is WrestlingDataResponse;
|
|
17
21
|
export declare enum ApiAction {
|
package/dist/internal.mjs
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
* these interfaces will not be returned by the API to non-admin users.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
+
export const isAccountResponseAdmin = (account) => {
|
|
12
|
+
return "paymentProvider" in account && "paymentProviderCustomerId" in account;
|
|
13
|
+
};
|
|
14
|
+
export const isAuthResponseAdmin = (auth) => {
|
|
15
|
+
return "isAdmin" in auth;
|
|
16
|
+
};
|
|
11
17
|
export const isBaseballData = (data) => {
|
|
12
18
|
return data.type === ScoreboardType.Baseball;
|
|
13
19
|
};
|
|
@@ -20,6 +26,12 @@ export const isFootballData = (data) => {
|
|
|
20
26
|
export const isSoccerData = (data) => {
|
|
21
27
|
return data.type === ScoreboardType.Soccer;
|
|
22
28
|
};
|
|
29
|
+
export const isUserListResponseAdmin = (list) => {
|
|
30
|
+
return list.data.length > 0 && isUserResponseAdmin(list.data[0]);
|
|
31
|
+
};
|
|
32
|
+
export const isUserResponseAdmin = (user) => {
|
|
33
|
+
return "isAdmin" in user;
|
|
34
|
+
};
|
|
23
35
|
export const isVolleyballData = (data) => {
|
|
24
36
|
return data.type === ScoreboardType.Volleyball;
|
|
25
37
|
};
|