@scoreboardmax/api-types 1.0.11 → 1.0.13

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,6 @@
1
- # ScoreboardMax API Type Definitions
1
+ # ScoreboardMax API Types & Constants
2
2
 
3
- This package provides TypeScript type definitions for developers integrating with the ScoreboardMax API. 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.
4
4
 
5
5
  **API Documentation:** [https://scoreboardmax.com/api/docs](https://scoreboardmax.com/api/docs)
6
6
 
@@ -24,18 +24,55 @@ bun add @scoreboardmax/api-types
24
24
 
25
25
  ## Usage
26
26
 
27
- ### Basic Import
27
+ ### TypeScript
28
28
  ```typescript
29
- import { ScoreboardRequest, ScoreboardResponse } from "@scoreboardmax/api-types";
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
+ }
30
46
  ```
31
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
+
32
69
  ## Contributing
33
70
 
34
71
  This package is automatically generated from the ScoreboardMax API schema. If you find issues with the types:
35
72
 
36
73
  1. Check if the issue exists in the API documentation
37
74
  2. Report issues at: [GitHub Issues](https://github.com/scoreboardmax/api-types/issues)
38
- 3. For API-related issues, [contact ScoreboardMax support ](https://scoreboardmax.com/#contact)
75
+ 3. For API-related issues, [contact ScoreboardMax support](https://scoreboardmax.com/#contact)
39
76
 
40
77
  ## License
41
78
 
package/dist/index.d.ts CHANGED
@@ -463,6 +463,13 @@ export interface DataExtractResponse {
463
463
  }
464
464
  export interface DataRow extends Array<string> {
465
465
  }
466
+ export interface ErrorResponse {
467
+ error: boolean;
468
+ code: ErrorCode;
469
+ statusCode: number;
470
+ reference: string;
471
+ message: string;
472
+ }
466
473
  export interface Event {
467
474
  eventId: string;
468
475
  accountId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scoreboardmax/api-types",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "TypeScript definitions for ScoreboardMax API",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",