@tryline/interface 1.0.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.
Files changed (104) hide show
  1. package/README.md +229 -0
  2. package/dist/api/admin/admin.d.ts +4 -0
  3. package/dist/api/admin/admin.d.ts.map +1 -0
  4. package/dist/api/admin/admin.js +1 -0
  5. package/dist/api/admin/articles.d.ts +77 -0
  6. package/dist/api/admin/articles.d.ts.map +1 -0
  7. package/dist/api/admin/articles.js +6 -0
  8. package/dist/api/admin/index.d.ts +5 -0
  9. package/dist/api/admin/index.d.ts.map +1 -0
  10. package/dist/api/admin/index.js +4 -0
  11. package/dist/api/admin/matches.d.ts +33 -0
  12. package/dist/api/admin/matches.d.ts.map +1 -0
  13. package/dist/api/admin/matches.js +6 -0
  14. package/dist/api/admin/matchup/index.d.ts +4 -0
  15. package/dist/api/admin/matchup/index.d.ts.map +1 -0
  16. package/dist/api/admin/matchup/index.js +3 -0
  17. package/dist/api/admin/matchup/matches.d.ts +33 -0
  18. package/dist/api/admin/matchup/matches.d.ts.map +1 -0
  19. package/dist/api/admin/matchup/matches.js +6 -0
  20. package/dist/api/admin/matchup/players.d.ts +100 -0
  21. package/dist/api/admin/matchup/players.d.ts.map +1 -0
  22. package/dist/api/admin/matchup/players.js +6 -0
  23. package/dist/api/admin/matchup/teams.d.ts +207 -0
  24. package/dist/api/admin/matchup/teams.d.ts.map +1 -0
  25. package/dist/api/admin/matchup/teams.js +6 -0
  26. package/dist/api/admin/matchup-players.d.ts +100 -0
  27. package/dist/api/admin/matchup-players.d.ts.map +1 -0
  28. package/dist/api/admin/matchup-players.js +6 -0
  29. package/dist/api/admin/matchup-teams.d.ts +207 -0
  30. package/dist/api/admin/matchup-teams.d.ts.map +1 -0
  31. package/dist/api/admin/matchup-teams.js +6 -0
  32. package/dist/api/admin/nrl-matches.d.ts +146 -0
  33. package/dist/api/admin/nrl-matches.d.ts.map +1 -0
  34. package/dist/api/admin/nrl-matches.js +6 -0
  35. package/dist/api/articles.d.ts +50 -0
  36. package/dist/api/articles.d.ts.map +1 -0
  37. package/dist/api/articles.js +1 -0
  38. package/dist/api/auth.d.ts +75 -0
  39. package/dist/api/auth.d.ts.map +1 -0
  40. package/dist/api/auth.js +5 -0
  41. package/dist/api/competitions.d.ts +34 -0
  42. package/dist/api/competitions.d.ts.map +1 -0
  43. package/dist/api/competitions.js +1 -0
  44. package/dist/api/index.d.ts +10 -0
  45. package/dist/api/index.d.ts.map +1 -0
  46. package/dist/api/index.js +9 -0
  47. package/dist/api/matches.d.ts +77 -0
  48. package/dist/api/matches.d.ts.map +1 -0
  49. package/dist/api/matches.js +1 -0
  50. package/dist/api/news.d.ts +50 -0
  51. package/dist/api/news.d.ts.map +1 -0
  52. package/dist/api/news.js +1 -0
  53. package/dist/api/nrl/analytics.d.ts +129 -0
  54. package/dist/api/nrl/analytics.d.ts.map +1 -0
  55. package/dist/api/nrl/analytics.js +1 -0
  56. package/dist/api/nrl/index.d.ts +7 -0
  57. package/dist/api/nrl/index.d.ts.map +1 -0
  58. package/dist/api/nrl/index.js +6 -0
  59. package/dist/api/nrl/ladder.d.ts +67 -0
  60. package/dist/api/nrl/ladder.d.ts.map +1 -0
  61. package/dist/api/nrl/ladder.js +1 -0
  62. package/dist/api/nrl/matches.d.ts +297 -0
  63. package/dist/api/nrl/matches.d.ts.map +1 -0
  64. package/dist/api/nrl/matches.js +1 -0
  65. package/dist/api/nrl/stats.d.ts +280 -0
  66. package/dist/api/nrl/stats.d.ts.map +1 -0
  67. package/dist/api/nrl/stats.js +1 -0
  68. package/dist/api/nrl/team-player-stats.d.ts +195 -0
  69. package/dist/api/nrl/team-player-stats.d.ts.map +1 -0
  70. package/dist/api/nrl/team-player-stats.js +1 -0
  71. package/dist/api/nrl/teams.d.ts +66 -0
  72. package/dist/api/nrl/teams.d.ts.map +1 -0
  73. package/dist/api/nrl/teams.js +1 -0
  74. package/dist/api/players.d.ts +31 -0
  75. package/dist/api/players.d.ts.map +1 -0
  76. package/dist/api/players.js +1 -0
  77. package/dist/api/search.d.ts +68 -0
  78. package/dist/api/search.d.ts.map +1 -0
  79. package/dist/api/search.js +1 -0
  80. package/dist/api/shared.d.ts +30 -0
  81. package/dist/api/shared.d.ts.map +1 -0
  82. package/dist/api/shared.js +4 -0
  83. package/dist/api/teams.d.ts +48 -0
  84. package/dist/api/teams.d.ts.map +1 -0
  85. package/dist/api/teams.js +1 -0
  86. package/dist/api/test.d.ts +8 -0
  87. package/dist/api/test.d.ts.map +1 -0
  88. package/dist/api/test.js +4 -0
  89. package/dist/api/version.d.ts +8 -0
  90. package/dist/api/version.d.ts.map +1 -0
  91. package/dist/api/version.js +4 -0
  92. package/dist/api/votes.d.ts +26 -0
  93. package/dist/api/votes.d.ts.map +1 -0
  94. package/dist/api/votes.js +5 -0
  95. package/dist/common/index.d.ts +2 -0
  96. package/dist/common/index.d.ts.map +1 -0
  97. package/dist/common/index.js +1 -0
  98. package/dist/common/response.d.ts +31 -0
  99. package/dist/common/response.d.ts.map +1 -0
  100. package/dist/common/response.js +21 -0
  101. package/dist/index.d.ts +15 -0
  102. package/dist/index.d.ts.map +1 -0
  103. package/dist/index.js +16 -0
  104. package/package.json +65 -0
package/README.md ADDED
@@ -0,0 +1,229 @@
1
+ # @tryline/interface
2
+
3
+ Shared TypeScript interface definitions for API responses across the Tryline platform.
4
+
5
+ ## Overview
6
+
7
+ This package contains **shared type definitions for API responses only** used across the Tryline ecosystem:
8
+
9
+ - Backend API (tryline-backend-api)
10
+ - React Native App (tryline-app)
11
+ - Future web applications
12
+
13
+ **Important:** This package contains only TypeScript interfaces and types. It does NOT include:
14
+
15
+ - API client implementations
16
+ - HTTP request/response handling
17
+ - Backend-specific logic (database queries, etc.)
18
+
19
+ ## Structure
20
+
21
+ ```
22
+ src/
23
+ ├── api/ # API response and request types
24
+ │ ├── competitions.ts # Competition-related response types
25
+ │ ├── test.ts # Test endpoint response types
26
+ │ └── index.ts # Exports all API types
27
+ ├── common/ # Common shared types
28
+ │ ├── response.ts # ApiResponse<T> interface
29
+ │ └── index.ts # Exports common types
30
+ └── index.ts # Main entry point
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ### In Backend (tryline-backend-api)
36
+
37
+ ```typescript
38
+ import {
39
+ Competition,
40
+ Season,
41
+ GetAllCompetitionsForSportResponse,
42
+ } from "@tryline/interface";
43
+ // or specifically:
44
+ import { GetSentenceByIdResponse } from "@tryline/interface";
45
+ ```
46
+
47
+ ### In Frontend (tryline-app)
48
+
49
+ ```typescript
50
+ import { GetAllCompetitionsForSportResponse } from "@tryline/interface";
51
+ // or:
52
+ import { Competition, Season } from "@tryline/interface";
53
+ ```
54
+
55
+ ## Development Workflow
56
+
57
+ ### Initial Setup
58
+
59
+ The package is installed locally using file references in both frontend and backend:
60
+
61
+ ```json
62
+ {
63
+ "dependencies": {
64
+ "@tryline/interface": "file:../../tryline-Interface"
65
+ }
66
+ }
67
+ ```
68
+
69
+ ### Building the Package
70
+
71
+ After making changes to type definitions, you must rebuild:
72
+
73
+ ```bash
74
+ cd tryline-Interface
75
+ npm run build
76
+ ```
77
+
78
+ You also add the route to package.json.
79
+
80
+ This compiles TypeScript to JavaScript in the `dist/` folder and generates `.d.ts` declaration files.
81
+
82
+ ### Watch Mode (Recommended for Development)
83
+
84
+ For active development, use watch mode in a separate terminal:
85
+
86
+ ```bash
87
+ cd tryline-Interface
88
+ npm run watch
89
+ ```
90
+
91
+ This automatically rebuilds whenever you save changes to source files.
92
+
93
+ ### Reinstalling in Consumer Projects
94
+
95
+ After building, reinstall in the backend and/or frontend to pick up changes:
96
+
97
+ ```bash
98
+ # Backend
99
+ cd tryline-API/tryline-backend-api
100
+ npm install
101
+
102
+ # Frontend
103
+ cd tryline-RN/tryline-app
104
+ npm install
105
+ ```
106
+
107
+ **Note:** For production builds, as long as the `dist/` folder exists with compiled output, the consuming projects will import the types correctly. The local file reference ensures the latest built version is always used.
108
+
109
+ ## Adding New API Response Types
110
+
111
+ ### Step 1: Create or Update Type File
112
+
113
+ Create a new file in `src/api/` for your domain or update an existing one:
114
+
115
+ ```typescript
116
+ // src/api/teams.ts
117
+ export interface Team {
118
+ team_id: number;
119
+ display_name: string;
120
+ slug: string;
121
+ // ... other fields
122
+ }
123
+
124
+ export interface GetAllTeamsForCompetitionResponse {
125
+ teams: Team[];
126
+ }
127
+ ```
128
+
129
+ ### Step 2: Export from API Index
130
+
131
+ Add the export to `src/api/index.ts`:
132
+
133
+ ```typescript
134
+ export * from "./competitions";
135
+ export * from "./test";
136
+ export * from "./teams"; // Add this line
137
+ ```
138
+
139
+ ### Step 3: Rebuild the Package
140
+
141
+ ```bash
142
+ cd tryline-Interface
143
+ npm run build
144
+ ```
145
+
146
+ ### Step 4: Use in Backend
147
+
148
+ Backend query result types stay in backend, shared response types use the interface:
149
+
150
+ ```typescript
151
+ // Backend: src/types/teams.ts (backend-specific)
152
+ export interface GetAllTeamsQueryResult {
153
+ // Raw database query result
154
+ }
155
+
156
+ // Backend: src/services/teams.service.ts
157
+ import { GetAllTeamsForCompetitionResponse } from "@tryline/interface";
158
+
159
+ static async getAllTeams(): Promise<ApiResponse<GetAllTeamsForCompetitionResponse>> {
160
+ // ... implementation
161
+ }
162
+ ```
163
+
164
+ ### Step 5: Use in Frontend
165
+
166
+ ```typescript
167
+ // Frontend: api/services/teams.ts
168
+ import { GetAllTeamsForCompetitionResponse } from "@tryline/interface";
169
+
170
+ export const teamsService = {
171
+ getAllTeams: async (): Promise<
172
+ ApiResponse<GetAllTeamsForCompetitionResponse>
173
+ > => {
174
+ const response = await apiClient.get("/teams");
175
+ return response.data;
176
+ },
177
+ };
178
+ ```
179
+
180
+ ## Production Builds
181
+
182
+ For production deployments:
183
+
184
+ 1. **Ensure the package is built** before deploying consuming applications:
185
+
186
+ ```bash
187
+ cd tryline-Interface && npm run build
188
+ ```
189
+
190
+ 2. **The `dist/` folder must exist** - consuming projects reference the compiled output
191
+
192
+ 3. **File references work in production** as long as the relative path structure is maintained:
193
+
194
+ ```
195
+ /project-root
196
+ /tryline-Interface/dist/ ← Must exist
197
+ /tryline-API/tryline-backend-api/
198
+ /tryline-RN/tryline-app/
199
+ ```
200
+
201
+ 4. Both backend and frontend package.json files reference `"file:../../tryline-Interface"`, which will resolve correctly in any environment with this folder structure
202
+
203
+ ## Type Categories
204
+
205
+ ### API Response Types (`src/api/`)
206
+
207
+ - Endpoint-specific response structures
208
+ - Returned directly from API calls
209
+ - Shared between backend return types and frontend consumption
210
+ - Examples: `GetAllCompetitionsForSportResponse`, `GetSentenceByIdResponse`
211
+
212
+ ### Common Types (`src/common/`)
213
+
214
+ - Generic wrapper types used across all APIs
215
+ - Examples: `ApiResponse<T>` (standardized response wrapper)
216
+
217
+ ### NOT Included
218
+
219
+ - Database query result types (these stay backend-specific)
220
+ - API client logic (axios/fetch implementations)
221
+ - Backend helper functions (createSuccessResponse, etc.)
222
+
223
+ ## Notes
224
+
225
+ - All types are compiled to the `dist/` folder
226
+ - The package uses ES modules (ES2022)
227
+ - TypeScript declaration files (`.d.ts`) are automatically generated
228
+ - Changes require rebuilding the package to take effect
229
+ - Use watch mode during active development for automatic rebuilds
@@ -0,0 +1,4 @@
1
+ export interface Example {
2
+ id: number;
3
+ }
4
+ //# sourceMappingURL=admin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../src/api/admin/admin.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Admin Articles Types
3
+ *
4
+ * Shared types for admin article management API endpoints
5
+ */
6
+ import { ArticleContentBlock, ArticleStatus } from "../articles";
7
+ /**
8
+ * Article list item for admin dashboard
9
+ */
10
+ export interface AdminArticleListItem {
11
+ article_id: number;
12
+ slug: string;
13
+ title: string;
14
+ main_image: string | null;
15
+ status: ArticleStatus;
16
+ created_at: string;
17
+ }
18
+ /**
19
+ * Response for GET /admin/articles
20
+ */
21
+ export interface GetAdminArticlesResponse {
22
+ articles: AdminArticleListItem[];
23
+ }
24
+ /**
25
+ * Response for GET /admin/articles/{articleId}
26
+ */
27
+ export interface GetAdminArticleDetailResponse {
28
+ article_id: number;
29
+ slug: string;
30
+ title: string;
31
+ main_image: string | null;
32
+ status: ArticleStatus;
33
+ content: ArticleContentBlock[];
34
+ created_at: string;
35
+ }
36
+ /**
37
+ * Request body for POST /admin/articles
38
+ */
39
+ export interface CreateArticleRequest {
40
+ slug: string;
41
+ title: string;
42
+ main_image: string | null;
43
+ status: ArticleStatus;
44
+ content: ArticleContentBlock[];
45
+ }
46
+ /**
47
+ * Response for POST /admin/articles
48
+ */
49
+ export interface CreateArticleResponse {
50
+ article_id: number;
51
+ }
52
+ /**
53
+ * Request body for PUT /admin/articles/{articleId}
54
+ * All fields optional - only provided fields will be updated
55
+ */
56
+ export interface UpdateArticleRequest {
57
+ slug?: string;
58
+ title?: string;
59
+ main_image?: string | null;
60
+ status?: ArticleStatus;
61
+ content?: ArticleContentBlock[];
62
+ }
63
+ /**
64
+ * Response for PUT /admin/articles/{articleId}
65
+ */
66
+ export interface UpdateArticleResponse {
67
+ article_id: number;
68
+ updated: boolean;
69
+ }
70
+ /**
71
+ * Response for DELETE /admin/articles/{articleId}
72
+ */
73
+ export interface DeleteArticleResponse {
74
+ article_id: number;
75
+ deleted: boolean;
76
+ }
77
+ //# sourceMappingURL=articles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"articles.d.ts","sourceRoot":"","sources":["../../../src/api/admin/articles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU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admin Articles Types
3
+ *
4
+ * Shared types for admin article management API endpoints
5
+ */
6
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./admin";
2
+ export * as NRL from "./nrl-matches";
3
+ export * as Matchup from "./matchup";
4
+ export * as Articles from "./articles";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/admin/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./admin";
2
+ export * as NRL from "./nrl-matches";
3
+ export * as Matchup from "./matchup";
4
+ export * as Articles from "./articles";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Admin NRL Matches Types
3
+ *
4
+ * Types for admin NRL match management endpoints
5
+ */
6
+ import { MatchTeam, MatchVenue } from "../shared";
7
+ /**
8
+ * Simplified match item for upcoming matches display
9
+ * Contains essential fields for MatchupsPage rendering
10
+ */
11
+ export interface AdminUpcomingNrlMatch {
12
+ match_id: number;
13
+ datetime: string;
14
+ status: "scheduled" | "live" | "completed" | "postponed" | "cancelled";
15
+ slug: string;
16
+ round: number;
17
+ round_text: string;
18
+ home_team: MatchTeam;
19
+ away_team: MatchTeam;
20
+ venue: MatchVenue;
21
+ }
22
+ /**
23
+ * Response for GET /admin/nrl/upcoming-matches
24
+ * Returns matches for the latest upcoming round only
25
+ */
26
+ export interface AdminUpcomingNrlMatchesResponse {
27
+ round: number;
28
+ round_text: string;
29
+ season_id: number;
30
+ season_value: string;
31
+ matches: AdminUpcomingNrlMatch[];
32
+ }
33
+ //# sourceMappingURL=matches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matches.d.ts","sourceRoot":"","sources":["../../../src/api/admin/matches.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Admin NRL Matches Types
3
+ *
4
+ * Types for admin NRL match management endpoints
5
+ */
6
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from "./matches";
2
+ export * from "./teams";
3
+ export * from "./players";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/matchup/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./matches";
2
+ export * from "./teams";
3
+ export * from "./players";
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Admin Matchup Matches Types
3
+ *
4
+ * Types for admin matchup match management endpoints
5
+ */
6
+ import { MatchTeam, MatchVenue } from "../../shared";
7
+ /**
8
+ * Simplified match item for upcoming matches display
9
+ * Contains essential fields for MatchupsPage rendering
10
+ */
11
+ export interface UpcomingMatch {
12
+ match_id: number;
13
+ datetime: string;
14
+ status: "scheduled" | "live" | "completed" | "postponed" | "cancelled";
15
+ slug: string;
16
+ round: number;
17
+ round_text: string;
18
+ home_team: MatchTeam;
19
+ away_team: MatchTeam;
20
+ venue: MatchVenue;
21
+ }
22
+ /**
23
+ * Response for GET /admin/nrl/upcoming-matches
24
+ * Returns matches for the latest upcoming round only
25
+ */
26
+ export interface GetUpcomingMatchesResponse {
27
+ round: number;
28
+ round_text: string;
29
+ season_id: number;
30
+ season_value: string;
31
+ matches: UpcomingMatch[];
32
+ }
33
+ //# sourceMappingURL=matches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matches.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/matchup/matches.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Admin Matchup Matches Types
3
+ *
4
+ * Types for admin matchup match management endpoints
5
+ */
6
+ export {};
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Admin Matchup Players Analysis Types
3
+ *
4
+ * Types for player analysis endpoints in matchup context
5
+ */
6
+ import { MatchTeam, MatchVenue } from "../../shared";
7
+ /**
8
+ * Base player info included in all analysis results
9
+ */
10
+ export interface PlayerAnalysisBase {
11
+ player_id: number;
12
+ first_name: string;
13
+ last_name: string;
14
+ team_id: number;
15
+ }
16
+ /**
17
+ * Q1: Tries vs Opponent (Career + Last 5)
18
+ */
19
+ export interface TriesVsOpponentPlayer extends PlayerAnalysisBase {
20
+ career_tries: number;
21
+ career_games: number;
22
+ last_5_tries: number;
23
+ last_5_games: number;
24
+ }
25
+ /**
26
+ * Q2 & Q5: Consecutive Games (vs Opponent or at Venue)
27
+ */
28
+ export interface ConsecutiveGamesPlayer extends PlayerAnalysisBase {
29
+ current_streak: number;
30
+ max_streak: number;
31
+ }
32
+ /**
33
+ * Q3: Average Tries per Game vs Opponent
34
+ */
35
+ export interface AverageTriesPlayer extends PlayerAnalysisBase {
36
+ total_tries: number;
37
+ games_played: number;
38
+ tries_per_game: number;
39
+ }
40
+ /**
41
+ * Q4: Tries at Venue
42
+ */
43
+ export interface TriesAtVenuePlayer extends PlayerAnalysisBase {
44
+ tries_at_venue: number;
45
+ games_at_venue: number;
46
+ }
47
+ /**
48
+ * Q6: Back-to-Back This Season
49
+ */
50
+ export interface BackToBackPlayer extends PlayerAnalysisBase {
51
+ current_streak: number;
52
+ max_streak: number;
53
+ total_b2b_instances: number;
54
+ }
55
+ /**
56
+ * Q7: Multiple Tries in Matchup
57
+ */
58
+ export interface MultipleTriesPlayer extends PlayerAnalysisBase {
59
+ multi_try_games: number;
60
+ total_games_vs_opponent: number;
61
+ }
62
+ /**
63
+ * Q8: Tries in Wins vs Losses
64
+ */
65
+ export interface WinsVsLossesPlayer extends PlayerAnalysisBase {
66
+ tries_in_wins: number;
67
+ games_won: number;
68
+ tries_in_losses: number;
69
+ games_lost: number;
70
+ }
71
+ /**
72
+ * Generic section structure for player analysis
73
+ */
74
+ export interface PlayerAnalysisSection<T> {
75
+ id: string;
76
+ title: string;
77
+ description: string;
78
+ home_players: T[];
79
+ away_players: T[];
80
+ }
81
+ /**
82
+ * Response for GET /admin/nrl/matchups/:matchId/players-analysis
83
+ */
84
+ export interface PlayersAnalysisResponse {
85
+ match_id: number;
86
+ home_team: MatchTeam;
87
+ away_team: MatchTeam;
88
+ venue: MatchVenue;
89
+ sections: {
90
+ tries_vs_opponent: PlayerAnalysisSection<TriesVsOpponentPlayer>;
91
+ consecutive_vs_opponent: PlayerAnalysisSection<ConsecutiveGamesPlayer>;
92
+ average_vs_opponent: PlayerAnalysisSection<AverageTriesPlayer>;
93
+ tries_at_venue: PlayerAnalysisSection<TriesAtVenuePlayer> | null;
94
+ consecutive_at_venue: PlayerAnalysisSection<ConsecutiveGamesPlayer> | null;
95
+ back_to_back_season: PlayerAnalysisSection<BackToBackPlayer>;
96
+ multiple_tries_matchup: PlayerAnalysisSection<MultipleTriesPlayer>;
97
+ wins_vs_losses: PlayerAnalysisSection<WinsVsLossesPlayer>;
98
+ };
99
+ }
100
+ //# sourceMappingURL=players.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../../src/api/admin/matchup/players.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;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