@scoreboardmax/api-types 1.0.34 → 1.0.36
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.cjs +0 -2
- package/dist/index.d.ts +1 -7
- package/dist/index.mjs +0 -2
- package/dist/internal.cjs +17 -3
- package/dist/internal.d.ts +5 -7
- package/dist/internal.mjs +12 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -225,8 +225,6 @@ var OAuthAction;
|
|
|
225
225
|
OAuthAction["NewUserCreated"] = "new_user_created";
|
|
226
226
|
OAuthAction["ExistingUserSignedIn"] = "existing_user_signed_in";
|
|
227
227
|
OAuthAction["ProviderLinkedAndSignedIn"] = "provider_linked_and_signed_in";
|
|
228
|
-
OAuthAction["RequiresUserDecision"] = "requires_user_decision";
|
|
229
|
-
OAuthAction["NewAccountForExistingUser"] = "new_account_for_existing_user";
|
|
230
228
|
})(OAuthAction || (exports.OAuthAction = OAuthAction = {}));
|
|
231
229
|
var OAuthProvider;
|
|
232
230
|
(function (OAuthProvider) {
|
package/dist/index.d.ts
CHANGED
|
@@ -183,9 +183,7 @@ export declare enum MetaMessageType {
|
|
|
183
183
|
export declare enum OAuthAction {
|
|
184
184
|
NewUserCreated = "new_user_created",
|
|
185
185
|
ExistingUserSignedIn = "existing_user_signed_in",
|
|
186
|
-
ProviderLinkedAndSignedIn = "provider_linked_and_signed_in"
|
|
187
|
-
RequiresUserDecision = "requires_user_decision",
|
|
188
|
-
NewAccountForExistingUser = "new_account_for_existing_user"
|
|
186
|
+
ProviderLinkedAndSignedIn = "provider_linked_and_signed_in"
|
|
189
187
|
}
|
|
190
188
|
export declare enum OAuthProvider {
|
|
191
189
|
Google = "google"
|
|
@@ -716,9 +714,6 @@ export interface NumberInput extends BaseInput {
|
|
|
716
714
|
max?: number;
|
|
717
715
|
step?: number;
|
|
718
716
|
}
|
|
719
|
-
export interface OAuthBindingRequest {
|
|
720
|
-
messageCipher: string;
|
|
721
|
-
}
|
|
722
717
|
export interface OAuthRequest {
|
|
723
718
|
code: string;
|
|
724
719
|
redirectUri: string;
|
|
@@ -730,7 +725,6 @@ export interface OAuthResponse {
|
|
|
730
725
|
oAuthProviderId: string;
|
|
731
726
|
oAuthProviderEmail: string;
|
|
732
727
|
oAuthProviderName: string;
|
|
733
|
-
messageCipher?: string;
|
|
734
728
|
dateNow: string;
|
|
735
729
|
action: OAuthAction;
|
|
736
730
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -216,8 +216,6 @@ export var OAuthAction;
|
|
|
216
216
|
OAuthAction["NewUserCreated"] = "new_user_created";
|
|
217
217
|
OAuthAction["ExistingUserSignedIn"] = "existing_user_signed_in";
|
|
218
218
|
OAuthAction["ProviderLinkedAndSignedIn"] = "provider_linked_and_signed_in";
|
|
219
|
-
OAuthAction["RequiresUserDecision"] = "requires_user_decision";
|
|
220
|
-
OAuthAction["NewAccountForExistingUser"] = "new_account_for_existing_user";
|
|
221
219
|
})(OAuthAction || (OAuthAction = {}));
|
|
222
220
|
export var OAuthProvider;
|
|
223
221
|
(function (OAuthProvider) {
|
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
|
};
|
|
@@ -228,8 +244,6 @@ var OAuthAction;
|
|
|
228
244
|
OAuthAction["NewUserCreated"] = "new_user_created";
|
|
229
245
|
OAuthAction["ExistingUserSignedIn"] = "existing_user_signed_in";
|
|
230
246
|
OAuthAction["ProviderLinkedAndSignedIn"] = "provider_linked_and_signed_in";
|
|
231
|
-
OAuthAction["RequiresUserDecision"] = "requires_user_decision";
|
|
232
|
-
OAuthAction["NewAccountForExistingUser"] = "new_account_for_existing_user";
|
|
233
247
|
})(OAuthAction || (exports.OAuthAction = OAuthAction = {}));
|
|
234
248
|
var OAuthProvider;
|
|
235
249
|
(function (OAuthProvider) {
|
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 {
|
|
@@ -186,9 +190,7 @@ export declare enum MetaMessageType {
|
|
|
186
190
|
export declare enum OAuthAction {
|
|
187
191
|
NewUserCreated = "new_user_created",
|
|
188
192
|
ExistingUserSignedIn = "existing_user_signed_in",
|
|
189
|
-
ProviderLinkedAndSignedIn = "provider_linked_and_signed_in"
|
|
190
|
-
RequiresUserDecision = "requires_user_decision",
|
|
191
|
-
NewAccountForExistingUser = "new_account_for_existing_user"
|
|
193
|
+
ProviderLinkedAndSignedIn = "provider_linked_and_signed_in"
|
|
192
194
|
}
|
|
193
195
|
export declare enum OAuthProvider {
|
|
194
196
|
Google = "google"
|
|
@@ -730,9 +732,6 @@ export interface NumberInput extends BaseInput {
|
|
|
730
732
|
max?: number;
|
|
731
733
|
step?: number;
|
|
732
734
|
}
|
|
733
|
-
export interface OAuthBindingRequest {
|
|
734
|
-
messageCipher: string;
|
|
735
|
-
}
|
|
736
735
|
export interface OAuthRequest {
|
|
737
736
|
code: string;
|
|
738
737
|
redirectUri: string;
|
|
@@ -744,7 +743,6 @@ export interface OAuthResponse {
|
|
|
744
743
|
oAuthProviderId: string;
|
|
745
744
|
oAuthProviderEmail: string;
|
|
746
745
|
oAuthProviderName: string;
|
|
747
|
-
messageCipher?: string;
|
|
748
746
|
dateNow: string;
|
|
749
747
|
action: OAuthAction;
|
|
750
748
|
}
|
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
|
};
|
|
@@ -219,8 +231,6 @@ export var OAuthAction;
|
|
|
219
231
|
OAuthAction["NewUserCreated"] = "new_user_created";
|
|
220
232
|
OAuthAction["ExistingUserSignedIn"] = "existing_user_signed_in";
|
|
221
233
|
OAuthAction["ProviderLinkedAndSignedIn"] = "provider_linked_and_signed_in";
|
|
222
|
-
OAuthAction["RequiresUserDecision"] = "requires_user_decision";
|
|
223
|
-
OAuthAction["NewAccountForExistingUser"] = "new_account_for_existing_user";
|
|
224
234
|
})(OAuthAction || (OAuthAction = {}));
|
|
225
235
|
export var OAuthProvider;
|
|
226
236
|
(function (OAuthProvider) {
|