@scoreboardmax/api-types 1.0.10 → 1.0.12

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/README.md CHANGED
@@ -1,6 +1,85 @@
1
- # ScoreboardMax API Type Definitions
1
+ # ScoreboardMax API Types & Constants
2
2
 
3
- This file provides TypeScript type definitions for developers integrating with the ScoreboardMax API.
4
- All types are automatically generated from the official ScoreboardMax API source code to ensure accuracy and consistency.
3
+ This package provides TypeScript types and runtime constants for developers integrating with the ScoreboardMax API. All definitions are automatically generated from the official ScoreboardMax API source code to ensure accuracy and consistency.
5
4
 
6
5
  **API Documentation:** [https://scoreboardmax.com/api/docs](https://scoreboardmax.com/api/docs)
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @scoreboardmax/api-types
11
+ ```
12
+
13
+ ```bash
14
+ yarn add @scoreboardmax/api-types
15
+ ```
16
+
17
+ ```bash
18
+ pnpm add @scoreboardmax/api-types
19
+ ```
20
+
21
+ ```bash
22
+ bun add @scoreboardmax/api-types
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### TypeScript
28
+ ```typescript
29
+ // Import types for API requests and responses
30
+ import { ScoreboardRequest, ScoreboardResponse, ScoreboardType } from "@scoreboardmax/api-types";
31
+
32
+ // Import runtime constants and enums
33
+ import { WebsocketOperation, WebsocketMessageType } from "@scoreboardmax/api-types";
34
+
35
+ // Use in your application
36
+ const request: ScoreboardRequest = {
37
+ name: "Varsity Football",
38
+ type: ScoreboardType.Basketball,
39
+ data: { /* ... */ }
40
+ };
41
+
42
+ // Runtime constants work in conditionals
43
+ if (operation === WebsocketOperation.SendHeartbeat) {
44
+ // Handle heartbeat
45
+ }
46
+ ```
47
+
48
+ ### JavaScript
49
+ ```javascript
50
+ // CommonJS
51
+ const { WebsocketOperation, ScoreboardType } = require("@scoreboardmax/api-types");
52
+
53
+ // ES6 modules
54
+ import { WebsocketOperation, ScoreboardType } from "@scoreboardmax/api-types";
55
+
56
+ // Use runtime constants
57
+ if (body.operation === WebsocketOperation.GetConnectionId) {
58
+ // Handle connection request
59
+ }
60
+ ```
61
+
62
+ ## What's Included
63
+
64
+ - **TypeScript Types**: Interfaces for API requests and responses
65
+ - **Runtime Constants**: Enums for operations, message types, and scoreboard types
66
+ - **Full Type Safety**: Complete IntelliSense support for TypeScript projects
67
+ - **Universal Compatibility**: Works with both CommonJS and ES6 module systems
68
+
69
+ ## Contributing
70
+
71
+ This package is automatically generated from the ScoreboardMax API schema. If you find issues with the types:
72
+
73
+ 1. Check if the issue exists in the API documentation
74
+ 2. Report issues at: [GitHub Issues](https://github.com/scoreboardmax/api-types/issues)
75
+ 3. For API-related issues, [contact ScoreboardMax support](https://scoreboardmax.com/#contact)
76
+
77
+ ## License
78
+
79
+ MIT License - see [LICENSE](./LICENSE) file for details.
80
+
81
+ ## Support
82
+
83
+ - **Contact Us**: [https://scoreboardmax.com/#contact](https://scoreboardmax.com/#contact)
84
+ - **Documentation**: [https://scoreboardmax.com/api/docs](https://scoreboardmax.com/api/docs)
85
+ - **GitHub Issues**: [https://github.com/scoreboardmax/api-types/issues](https://github.com/scoreboardmax/api-types/issues)
package/dist/index.cjs ADDED
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ /**
3
+ * ScoreboardMax API Types
4
+ *
5
+ * This file contains type definitions for API consumers.
6
+ * These types are automatically generated from the ScoreboardMax API source code.
7
+ *
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.WrestlingStyle = exports.WrestlingPeriod = exports.WrestlingOvertimeType = exports.WrestlingMeetType = exports.WebsocketOperation = exports.WebsocketMessageType = exports.SoccerPeriod = exports.SoccerPenaltyCardType = exports.SoccerGamePeriods = exports.ScoreboardType = exports.ScoreboardCode = exports.PlanId = exports.OAuthProvider = exports.MetaMessageType = exports.MagicLinkType = exports.FootballPeriod = exports.FileType = exports.ExtraTimeLabel = exports.ErrorCode = exports.DownAndDistanceDisplay = exports.ContentType = exports.ClockType = exports.BasketballTimeoutAllocation = exports.BasketballPeriod = exports.BasketballGamePeriods = exports.BaseballInningSegment = exports.AuthType = exports.ApiResource = exports.ApiAction = void 0;
11
+ var ApiAction;
12
+ (function (ApiAction) {
13
+ ApiAction["Create"] = "create";
14
+ ApiAction["Read"] = "read";
15
+ ApiAction["Update"] = "update";
16
+ ApiAction["Delete"] = "delete";
17
+ ApiAction["All"] = "*";
18
+ })(ApiAction || (exports.ApiAction = ApiAction = {}));
19
+ var ApiResource;
20
+ (function (ApiResource) {
21
+ ApiResource["All"] = "*";
22
+ ApiResource["Account"] = "account";
23
+ ApiResource["AccountList"] = "accountList";
24
+ ApiResource["File"] = "file";
25
+ ApiResource["FileList"] = "fileList";
26
+ ApiResource["Auth"] = "auth";
27
+ ApiResource["AuthList"] = "authList";
28
+ ApiResource["Clock"] = "clock";
29
+ ApiResource["ClockList"] = "clockList";
30
+ ApiResource["Player"] = "player";
31
+ ApiResource["PlayerList"] = "playerList";
32
+ ApiResource["Roster"] = "roster";
33
+ ApiResource["RosterList"] = "rosterList";
34
+ ApiResource["Scoreboard"] = "scoreboard";
35
+ ApiResource["ScoreboardList"] = "scoreboardList";
36
+ ApiResource["Sponsor"] = "sponsor";
37
+ ApiResource["SponsorList"] = "sponsorList";
38
+ ApiResource["Team"] = "team";
39
+ ApiResource["TeamList"] = "teamList";
40
+ ApiResource["Upload"] = "upload";
41
+ ApiResource["UploadList"] = "uploadList";
42
+ ApiResource["User"] = "user";
43
+ ApiResource["UserList"] = "userList";
44
+ ApiResource["UserCredentials"] = "userCredentials";
45
+ ApiResource["UserCredentialsList"] = "userCredentialsList";
46
+ ApiResource["Overlay"] = "overlay";
47
+ ApiResource["OverlayList"] = "overlayList";
48
+ ApiResource["Preset"] = "preset";
49
+ ApiResource["PresetList"] = "presetList";
50
+ })(ApiResource || (exports.ApiResource = ApiResource = {}));
51
+ var AuthType;
52
+ (function (AuthType) {
53
+ AuthType["Session"] = "session";
54
+ AuthType["Api"] = "api";
55
+ AuthType["Guest"] = "guest";
56
+ AuthType["ScoreboardView"] = "scoreboardView";
57
+ })(AuthType || (exports.AuthType = AuthType = {}));
58
+ var BaseballInningSegment;
59
+ (function (BaseballInningSegment) {
60
+ BaseballInningSegment["Top"] = "top";
61
+ BaseballInningSegment["Middle"] = "middle";
62
+ BaseballInningSegment["Bottom"] = "bottom";
63
+ BaseballInningSegment["End"] = "end";
64
+ })(BaseballInningSegment || (exports.BaseballInningSegment = BaseballInningSegment = {}));
65
+ var BasketballGamePeriods;
66
+ (function (BasketballGamePeriods) {
67
+ BasketballGamePeriods["Quarters"] = "quarters";
68
+ BasketballGamePeriods["Halves"] = "halves";
69
+ })(BasketballGamePeriods || (exports.BasketballGamePeriods = BasketballGamePeriods = {}));
70
+ var BasketballPeriod;
71
+ (function (BasketballPeriod) {
72
+ BasketballPeriod["Pre"] = "pregame";
73
+ BasketballPeriod["First"] = "1";
74
+ BasketballPeriod["Second"] = "2";
75
+ BasketballPeriod["Half"] = "half";
76
+ BasketballPeriod["Third"] = "3";
77
+ BasketballPeriod["Fourth"] = "4";
78
+ BasketballPeriod["Overtime"] = "overtime";
79
+ })(BasketballPeriod || (exports.BasketballPeriod = BasketballPeriod = {}));
80
+ var BasketballTimeoutAllocation;
81
+ (function (BasketballTimeoutAllocation) {
82
+ BasketballTimeoutAllocation["PerGame"] = "perGame";
83
+ BasketballTimeoutAllocation["PerHalf"] = "perHalf";
84
+ })(BasketballTimeoutAllocation || (exports.BasketballTimeoutAllocation = BasketballTimeoutAllocation = {}));
85
+ var ClockType;
86
+ (function (ClockType) {
87
+ ClockType["Game"] = "game";
88
+ ClockType["Play"] = "play";
89
+ ClockType["Shot"] = "shot";
90
+ ClockType["Pitch"] = "pitch";
91
+ ClockType["Period"] = "period";
92
+ })(ClockType || (exports.ClockType = ClockType = {}));
93
+ var ContentType;
94
+ (function (ContentType) {
95
+ ContentType["Png"] = "image/png";
96
+ ContentType["Jpg"] = "image/jpeg";
97
+ ContentType["Gif"] = "image/gif";
98
+ ContentType["Webp"] = "image/webp";
99
+ ContentType["Avif"] = "image/avif";
100
+ ContentType["Csv"] = "text/csv";
101
+ ContentType["Xlsx"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
102
+ })(ContentType || (exports.ContentType = ContentType = {}));
103
+ var DownAndDistanceDisplay;
104
+ (function (DownAndDistanceDisplay) {
105
+ DownAndDistanceDisplay["Both"] = "both";
106
+ DownAndDistanceDisplay["DownOnly"] = "downOnly";
107
+ DownAndDistanceDisplay["None"] = "none";
108
+ })(DownAndDistanceDisplay || (exports.DownAndDistanceDisplay = DownAndDistanceDisplay = {}));
109
+ var ErrorCode;
110
+ (function (ErrorCode) {
111
+ ErrorCode["ForbiddenSelfPermissionsChange"] = "ForbiddenSelfPermissionsChange";
112
+ ErrorCode["InsufficientAdminPermissions"] = "InsufficientAdminPermissions";
113
+ ErrorCode["InsufficientItemPermissions"] = "InsufficientItemPermissions";
114
+ ErrorCode["InsufficientResourcePermissions"] = "InsufficientResourcePermissions";
115
+ ErrorCode["InsufficientResourceItemPermissions"] = "InsufficientResourceItemPermissions";
116
+ ErrorCode["InvalidAuthType"] = "InvalidAuthType";
117
+ ErrorCode["InvalidColorFormat"] = "InvalidColorFormat";
118
+ ErrorCode["InvalidDate"] = "InvalidDate";
119
+ ErrorCode["InvalidInput"] = "InvalidInput";
120
+ ErrorCode["InvalidRequest"] = "InvalidRequest";
121
+ ErrorCode["InvalidPermissionGrant"] = "InvalidPermissionGrant";
122
+ ErrorCode["InvalidSignIn"] = "InvalidSignIn";
123
+ ErrorCode["InvalidAccountSignIn"] = "InvalidAccountSignIn";
124
+ ErrorCode["InvalidToken"] = "InvalidToken";
125
+ ErrorCode["AccountLimitExceeded"] = "AccountLimitExceeded";
126
+ ErrorCode["AccountStorageExceeded"] = "AccountStorageExceeded";
127
+ ErrorCode["ActiveScoreboardsExceeded"] = "ActiveScoreboardsExceeded";
128
+ ErrorCode["AccountFeatureNotEnabled"] = "AccountFeatureNotEnabled";
129
+ ErrorCode["ImageProcessingError"] = "ImageProcessingError";
130
+ ErrorCode["RemoteServerError"] = "RemoteServerError";
131
+ ErrorCode["RemoteServerTimeout"] = "RemoteServerTimeout";
132
+ ErrorCode["RequestLimitExceeded"] = "RequestLimitExceeded";
133
+ ErrorCode["ResourceNotFound"] = "ResourceNotFound";
134
+ ErrorCode["UserCredentialsInUse"] = "UserCredentialsInUse";
135
+ ErrorCode["AccountEmailInUse"] = "AccountEmailInUse";
136
+ ErrorCode["IncompatibleState"] = "IncompatibleState";
137
+ ErrorCode["UnspecifiedError"] = "UnspecifiedError";
138
+ })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
139
+ var ExtraTimeLabel;
140
+ (function (ExtraTimeLabel) {
141
+ ExtraTimeLabel["ExtraTime"] = "ET";
142
+ ExtraTimeLabel["Overtime"] = "OT";
143
+ })(ExtraTimeLabel || (exports.ExtraTimeLabel = ExtraTimeLabel = {}));
144
+ var FileType;
145
+ (function (FileType) {
146
+ FileType["TeamLogo"] = "teamLogo";
147
+ FileType["AccountLogo"] = "accountLogo";
148
+ FileType["PlayerPhoto"] = "playerPhoto";
149
+ FileType["SponsorLogo"] = "sponsorLogo";
150
+ FileType["Temporary"] = "temporary";
151
+ })(FileType || (exports.FileType = FileType = {}));
152
+ var FootballPeriod;
153
+ (function (FootballPeriod) {
154
+ FootballPeriod["Pre"] = "pregame";
155
+ FootballPeriod["First"] = "1";
156
+ FootballPeriod["Second"] = "2";
157
+ FootballPeriod["Half"] = "half";
158
+ FootballPeriod["Third"] = "3";
159
+ FootballPeriod["Fourth"] = "4";
160
+ FootballPeriod["Overtime"] = "overtime";
161
+ })(FootballPeriod || (exports.FootballPeriod = FootballPeriod = {}));
162
+ var MagicLinkType;
163
+ (function (MagicLinkType) {
164
+ MagicLinkType["SignIn"] = "signIn";
165
+ MagicLinkType["ScoreboardGuest"] = "scoreboardGuest";
166
+ MagicLinkType["UserInvite"] = "userInvite";
167
+ MagicLinkType["ScoreboardView"] = "scoreboardView";
168
+ })(MagicLinkType || (exports.MagicLinkType = MagicLinkType = {}));
169
+ var MetaMessageType;
170
+ (function (MetaMessageType) {
171
+ MetaMessageType["ScoreboardReset"] = "scoreboardReset";
172
+ MetaMessageType["ScoreboardRefresh"] = "scoreboardRefresh";
173
+ })(MetaMessageType || (exports.MetaMessageType = MetaMessageType = {}));
174
+ var OAuthProvider;
175
+ (function (OAuthProvider) {
176
+ OAuthProvider["Google"] = "google";
177
+ })(OAuthProvider || (exports.OAuthProvider = OAuthProvider = {}));
178
+ var PlanId;
179
+ (function (PlanId) {
180
+ PlanId["Basic"] = "basic";
181
+ PlanId["Plus"] = "plus";
182
+ PlanId["Pro"] = "pro";
183
+ })(PlanId || (exports.PlanId = PlanId = {}));
184
+ var ScoreboardCode;
185
+ (function (ScoreboardCode) {
186
+ ScoreboardCode["Football"] = "fb";
187
+ ScoreboardCode["Basketball"] = "bb";
188
+ ScoreboardCode["Volleyball"] = "vb";
189
+ ScoreboardCode["Soccer"] = "sc";
190
+ ScoreboardCode["Baseball"] = "ba";
191
+ ScoreboardCode["Wrestling"] = "wr";
192
+ })(ScoreboardCode || (exports.ScoreboardCode = ScoreboardCode = {}));
193
+ var ScoreboardType;
194
+ (function (ScoreboardType) {
195
+ ScoreboardType["Baseball"] = "baseball";
196
+ ScoreboardType["Basketball"] = "basketball";
197
+ ScoreboardType["Football"] = "football";
198
+ ScoreboardType["Soccer"] = "soccer";
199
+ ScoreboardType["Volleyball"] = "volleyball";
200
+ ScoreboardType["Wrestling"] = "wrestling";
201
+ })(ScoreboardType || (exports.ScoreboardType = ScoreboardType = {}));
202
+ var SoccerGamePeriods;
203
+ (function (SoccerGamePeriods) {
204
+ SoccerGamePeriods["Quarters"] = "quarters";
205
+ SoccerGamePeriods["Halves"] = "halves";
206
+ })(SoccerGamePeriods || (exports.SoccerGamePeriods = SoccerGamePeriods = {}));
207
+ var SoccerPenaltyCardType;
208
+ (function (SoccerPenaltyCardType) {
209
+ SoccerPenaltyCardType["Yellow"] = "yellow";
210
+ SoccerPenaltyCardType["Red"] = "red";
211
+ })(SoccerPenaltyCardType || (exports.SoccerPenaltyCardType = SoccerPenaltyCardType = {}));
212
+ var SoccerPeriod;
213
+ (function (SoccerPeriod) {
214
+ SoccerPeriod["Pre"] = "pregame";
215
+ SoccerPeriod["First"] = "1";
216
+ SoccerPeriod["Second"] = "2";
217
+ SoccerPeriod["Half"] = "half";
218
+ SoccerPeriod["Third"] = "3";
219
+ SoccerPeriod["Fourth"] = "4";
220
+ SoccerPeriod["ExtraTime1"] = "ET 1";
221
+ SoccerPeriod["ExtraTime2"] = "ET 2";
222
+ SoccerPeriod["Shootout"] = "shootout";
223
+ })(SoccerPeriod || (exports.SoccerPeriod = SoccerPeriod = {}));
224
+ var WebsocketMessageType;
225
+ (function (WebsocketMessageType) {
226
+ WebsocketMessageType["Event"] = "event";
227
+ WebsocketMessageType["Heartbeat"] = "heartbeat";
228
+ WebsocketMessageType["ConnectionConfirmation"] = "connectionConfirmation";
229
+ WebsocketMessageType["Info"] = "info";
230
+ WebsocketMessageType["Meta"] = "meta";
231
+ })(WebsocketMessageType || (exports.WebsocketMessageType = WebsocketMessageType = {}));
232
+ var WebsocketOperation;
233
+ (function (WebsocketOperation) {
234
+ WebsocketOperation["SendHeartbeat"] = "sendHeartbeat";
235
+ WebsocketOperation["GetConnectionId"] = "getConnectionId";
236
+ })(WebsocketOperation || (exports.WebsocketOperation = WebsocketOperation = {}));
237
+ var WrestlingMeetType;
238
+ (function (WrestlingMeetType) {
239
+ WrestlingMeetType["Dual"] = "dual";
240
+ WrestlingMeetType["Tournament"] = "tournament";
241
+ })(WrestlingMeetType || (exports.WrestlingMeetType = WrestlingMeetType = {}));
242
+ var WrestlingOvertimeType;
243
+ (function (WrestlingOvertimeType) {
244
+ WrestlingOvertimeType["SuddenVictory"] = "sv";
245
+ WrestlingOvertimeType["TieBreaker"] = "tb";
246
+ WrestlingOvertimeType["UltimateTieBreaker"] = "utb";
247
+ })(WrestlingOvertimeType || (exports.WrestlingOvertimeType = WrestlingOvertimeType = {}));
248
+ var WrestlingPeriod;
249
+ (function (WrestlingPeriod) {
250
+ WrestlingPeriod["First"] = "1";
251
+ WrestlingPeriod["Second"] = "2";
252
+ WrestlingPeriod["Third"] = "3";
253
+ WrestlingPeriod["Overtime"] = "overtime";
254
+ })(WrestlingPeriod || (exports.WrestlingPeriod = WrestlingPeriod = {}));
255
+ var WrestlingStyle;
256
+ (function (WrestlingStyle) {
257
+ WrestlingStyle["Freestyle"] = "freestyle";
258
+ WrestlingStyle["Greco"] = "greco";
259
+ WrestlingStyle["Folkstyle"] = "folkstyle";
260
+ })(WrestlingStyle || (exports.WrestlingStyle = WrestlingStyle = {}));