cricinfo-cli-go 0.1.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 (121) hide show
  1. package/AGENTS.md +63 -0
  2. package/CONTRIBUTORS.md +75 -0
  3. package/LICENSE +21 -0
  4. package/Makefile +131 -0
  5. package/README.md +130 -0
  6. package/bin/cricinfo.js +44 -0
  7. package/cmd/cricinfo/main.go +15 -0
  8. package/go.mod +10 -0
  9. package/go.sum +10 -0
  10. package/internal/app/app.go +11 -0
  11. package/internal/app/app_test.go +122 -0
  12. package/internal/buildinfo/buildinfo.go +16 -0
  13. package/internal/cli/analysis.go +262 -0
  14. package/internal/cli/analysis_test.go +175 -0
  15. package/internal/cli/competitions.go +154 -0
  16. package/internal/cli/competitions_test.go +165 -0
  17. package/internal/cli/leagues.go +297 -0
  18. package/internal/cli/leagues_test.go +194 -0
  19. package/internal/cli/matches.go +403 -0
  20. package/internal/cli/matches_test.go +413 -0
  21. package/internal/cli/players.go +263 -0
  22. package/internal/cli/players_test.go +384 -0
  23. package/internal/cli/root.go +141 -0
  24. package/internal/cli/search.go +119 -0
  25. package/internal/cli/teams.go +214 -0
  26. package/internal/cli/teams_test.go +192 -0
  27. package/internal/cricinfo/analysis.go +1401 -0
  28. package/internal/cricinfo/analysis_phase15_test.go +267 -0
  29. package/internal/cricinfo/client.go +471 -0
  30. package/internal/cricinfo/client_test.go +280 -0
  31. package/internal/cricinfo/cmd/fixture-refresh/main.go +145 -0
  32. package/internal/cricinfo/competitions.go +405 -0
  33. package/internal/cricinfo/competitions_phase13_test.go +234 -0
  34. package/internal/cricinfo/coverage_ledger.go +122 -0
  35. package/internal/cricinfo/coverage_ledger_test.go +253 -0
  36. package/internal/cricinfo/decode.go +115 -0
  37. package/internal/cricinfo/decode_test.go +100 -0
  38. package/internal/cricinfo/entity_index.go +618 -0
  39. package/internal/cricinfo/entity_index_test.go +175 -0
  40. package/internal/cricinfo/fixture_matrix.go +243 -0
  41. package/internal/cricinfo/fixture_matrix_test.go +49 -0
  42. package/internal/cricinfo/fixtures_test.go +264 -0
  43. package/internal/cricinfo/historical_hydration.go +1641 -0
  44. package/internal/cricinfo/historical_phase14_test.go +542 -0
  45. package/internal/cricinfo/leagues.go +1210 -0
  46. package/internal/cricinfo/leagues_phase12_test.go +324 -0
  47. package/internal/cricinfo/live_leagues_test.go +169 -0
  48. package/internal/cricinfo/live_matches_test.go +203 -0
  49. package/internal/cricinfo/live_matrix_test.go +118 -0
  50. package/internal/cricinfo/live_players_test.go +122 -0
  51. package/internal/cricinfo/live_search_test.go +86 -0
  52. package/internal/cricinfo/live_smoke_test.go +213 -0
  53. package/internal/cricinfo/live_teams_test.go +104 -0
  54. package/internal/cricinfo/matches.go +1508 -0
  55. package/internal/cricinfo/matches_phase7_test.go +207 -0
  56. package/internal/cricinfo/matches_phase9_test.go +253 -0
  57. package/internal/cricinfo/normalize_entities.go +1727 -0
  58. package/internal/cricinfo/normalize_leagues.go +346 -0
  59. package/internal/cricinfo/players.go +1332 -0
  60. package/internal/cricinfo/players_phase10_test.go +174 -0
  61. package/internal/cricinfo/players_phase11_test.go +373 -0
  62. package/internal/cricinfo/render_contract.go +1088 -0
  63. package/internal/cricinfo/render_phase4_test.go +633 -0
  64. package/internal/cricinfo/renderer.go +1689 -0
  65. package/internal/cricinfo/resolver.go +813 -0
  66. package/internal/cricinfo/resolver_test.go +244 -0
  67. package/internal/cricinfo/teams.go +603 -0
  68. package/internal/cricinfo/teams_phase8_test.go +231 -0
  69. package/internal/cricinfo/testdata/fixtures/README.md +43 -0
  70. package/internal/cricinfo/testdata/fixtures/aux-competition-metadata/broadcasts.json +11 -0
  71. package/internal/cricinfo/testdata/fixtures/aux-competition-metadata/officials.json +150 -0
  72. package/internal/cricinfo/testdata/fixtures/details-plays/detail-110.json +157 -0
  73. package/internal/cricinfo/testdata/fixtures/details-plays/detail-52545007.json +145 -0
  74. package/internal/cricinfo/testdata/fixtures/details-plays/detail-52559021.json +143 -0
  75. package/internal/cricinfo/testdata/fixtures/details-plays/plays.json +15 -0
  76. package/internal/cricinfo/testdata/fixtures/endpoint-matrix.tsv +19 -0
  77. package/internal/cricinfo/testdata/fixtures/innings-fow-partnerships/fow-1.json +12 -0
  78. package/internal/cricinfo/testdata/fixtures/innings-fow-partnerships/fow.json +42 -0
  79. package/internal/cricinfo/testdata/fixtures/innings-fow-partnerships/innings-1-2.json +38 -0
  80. package/internal/cricinfo/testdata/fixtures/innings-fow-partnerships/partnership-1.json +31 -0
  81. package/internal/cricinfo/testdata/fixtures/innings-fow-partnerships/partnerships.json +42 -0
  82. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/calendar-offdays.json +20 -0
  83. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/calendar-ondays.json +21 -0
  84. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/calendar.json +14 -0
  85. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/season-2025.json +13 -0
  86. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/season-group-1.json +13 -0
  87. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/season-groups.json +11 -0
  88. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/season-type-1.json +13 -0
  89. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/season-types.json +11 -0
  90. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/seasons.json +30 -0
  91. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/standings-item-1.json +72 -0
  92. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/standings-root.json +3 -0
  93. package/internal/cricinfo/testdata/fixtures/leagues-seasons-standings/standings.json +15 -0
  94. package/internal/cricinfo/testdata/fixtures/matches-competitions/competition.json +460 -0
  95. package/internal/cricinfo/testdata/fixtures/matches-competitions/event-1529474.json +86 -0
  96. package/internal/cricinfo/testdata/fixtures/matches-competitions/matchcards-1527966.json +368 -0
  97. package/internal/cricinfo/testdata/fixtures/matches-competitions/situation-1529474.json +10 -0
  98. package/internal/cricinfo/testdata/fixtures/players/athlete-1361257-statistics.json +126 -0
  99. package/internal/cricinfo/testdata/fixtures/players/athlete-1361257.json +113 -0
  100. package/internal/cricinfo/testdata/fixtures/players/roster-1361257-linescores-1-1-statistics-0.json +208 -0
  101. package/internal/cricinfo/testdata/fixtures/players/roster-1361257-linescores-1-2-statistics-0.json +252 -0
  102. package/internal/cricinfo/testdata/fixtures/players/roster-1361257-linescores.json +74 -0
  103. package/internal/cricinfo/testdata/fixtures/players/roster-1361257-statistics-0.json +1008 -0
  104. package/internal/cricinfo/testdata/fixtures/root-discovery/events.json +72 -0
  105. package/internal/cricinfo/testdata/fixtures/root-discovery/root.json +28 -0
  106. package/internal/cricinfo/testdata/fixtures/team-competitor/competitor-789643.json +40 -0
  107. package/internal/cricinfo/testdata/fixtures/team-competitor/leaders-789643.json +353 -0
  108. package/internal/cricinfo/testdata/fixtures/team-competitor/records-789643.json +91 -0
  109. package/internal/cricinfo/testdata/fixtures/team-competitor/roster-1147772-object.json +231 -0
  110. package/internal/cricinfo/testdata/fixtures/team-competitor/roster-1147772.json +235 -0
  111. package/internal/cricinfo/testdata/fixtures/team-competitor/roster-789643.json +322 -0
  112. package/internal/cricinfo/testdata/fixtures/team-competitor/scores-789643.json +19 -0
  113. package/internal/cricinfo/testdata/fixtures/team-competitor/statistics-789643.json +629 -0
  114. package/internal/cricinfo/testdata/fixtures/team-competitor/team-789643-athletes.json +7 -0
  115. package/internal/cricinfo/testdata/fixtures/team-competitor/team-789643.json +67 -0
  116. package/internal/cricinfo/testdata/golden/match-empty.golden +1 -0
  117. package/internal/cricinfo/testdata/golden/match-list.golden +2 -0
  118. package/internal/cricinfo/testdata/golden/match-partial.golden +3 -0
  119. package/internal/cricinfo/types.go +54 -0
  120. package/package.json +51 -0
  121. package/scripts/postinstall.js +153 -0
@@ -0,0 +1,322 @@
1
+
2
+ {
3
+ "$ref":"http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643",
4
+ "entries":[
5
+ {
6
+ "captain":false,
7
+ "playerId":1361257,
8
+ "period": 0,
9
+ "active": false,
10
+ "mediaId": 0,
11
+
12
+ "activeName": "player",
13
+
14
+ "starter": true,
15
+ "forPlayerId": 0,
16
+ "valid": true,
17
+
18
+ "athlete": {
19
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1361257"
20
+ },
21
+
22
+ "position": {
23
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
24
+ },
25
+
26
+
27
+ "linescores": {
28
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1361257/linescores"
29
+ }
30
+
31
+ }
32
+ ,
33
+ {
34
+ "captain":false,
35
+ "playerId":1291031,
36
+ "period": 0,
37
+ "active": true,
38
+ "mediaId": 0,
39
+
40
+ "activeName": "striker",
41
+
42
+ "starter": true,
43
+ "forPlayerId": 0,
44
+ "valid": true,
45
+
46
+ "athlete": {
47
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1291031"
48
+ },
49
+
50
+ "position": {
51
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
52
+ },
53
+
54
+
55
+ "linescores": {
56
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1291031/linescores"
57
+ }
58
+
59
+ }
60
+ ,
61
+ {
62
+ "captain":false,
63
+ "playerId":1076568,
64
+ "period": 0,
65
+ "active": false,
66
+ "mediaId": 0,
67
+
68
+ "activeName": "player",
69
+
70
+ "starter": true,
71
+ "forPlayerId": 0,
72
+ "valid": true,
73
+
74
+ "athlete": {
75
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1076568"
76
+ },
77
+
78
+ "position": {
79
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
80
+ },
81
+
82
+
83
+ "linescores": {
84
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1076568/linescores"
85
+ }
86
+
87
+ }
88
+ ,
89
+ {
90
+ "captain":false,
91
+ "playerId":1082531,
92
+ "period": 0,
93
+ "active": false,
94
+ "mediaId": 0,
95
+
96
+ "activeName": "player",
97
+
98
+ "starter": true,
99
+ "forPlayerId": 0,
100
+ "valid": true,
101
+
102
+ "athlete": {
103
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1082531"
104
+ },
105
+
106
+ "position": {
107
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
108
+ },
109
+
110
+
111
+ "linescores": {
112
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1082531/linescores"
113
+ }
114
+
115
+ }
116
+ ,
117
+ {
118
+ "captain":true,
119
+ "playerId":1108510,
120
+ "period": 0,
121
+ "active": false,
122
+ "mediaId": 0,
123
+
124
+ "activeName": "player",
125
+
126
+ "starter": true,
127
+ "forPlayerId": 0,
128
+ "valid": true,
129
+
130
+ "athlete": {
131
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1108510"
132
+ },
133
+
134
+ "position": {
135
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/WK"
136
+ },
137
+
138
+
139
+ "linescores": {
140
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1108510/linescores"
141
+ }
142
+
143
+ }
144
+ ,
145
+ {
146
+ "captain":false,
147
+ "playerId":1361459,
148
+ "period": 0,
149
+ "active": false,
150
+ "mediaId": 0,
151
+
152
+ "activeName": "player",
153
+
154
+ "starter": true,
155
+ "forPlayerId": 0,
156
+ "valid": true,
157
+
158
+ "athlete": {
159
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1361459"
160
+ },
161
+
162
+ "position": {
163
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
164
+ },
165
+
166
+
167
+ "linescores": {
168
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1361459/linescores"
169
+ }
170
+
171
+ }
172
+ ,
173
+ {
174
+ "captain":false,
175
+ "playerId":1076674,
176
+ "period": 0,
177
+ "active": false,
178
+ "mediaId": 0,
179
+
180
+ "activeName": "player",
181
+
182
+ "starter": true,
183
+ "forPlayerId": 0,
184
+ "valid": true,
185
+
186
+ "athlete": {
187
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1076674"
188
+ },
189
+
190
+ "position": {
191
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
192
+ },
193
+
194
+
195
+ "linescores": {
196
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1076674/linescores"
197
+ }
198
+
199
+ }
200
+ ,
201
+ {
202
+ "captain":false,
203
+ "playerId":1530033,
204
+ "period": 0,
205
+ "active": false,
206
+ "mediaId": 0,
207
+
208
+ "activeName": "player",
209
+
210
+ "starter": true,
211
+ "forPlayerId": 0,
212
+ "valid": true,
213
+
214
+ "athlete": {
215
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1530033"
216
+ },
217
+
218
+ "position": {
219
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
220
+ },
221
+
222
+
223
+ "linescores": {
224
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1530033/linescores"
225
+ }
226
+
227
+ }
228
+ ,
229
+ {
230
+ "captain":false,
231
+ "playerId":1479454,
232
+ "period": 0,
233
+ "active": true,
234
+ "mediaId": 0,
235
+
236
+ "activeName": "non-striker",
237
+
238
+ "starter": true,
239
+ "forPlayerId": 0,
240
+ "valid": true,
241
+
242
+ "athlete": {
243
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1479454"
244
+ },
245
+
246
+ "position": {
247
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/BL"
248
+ },
249
+
250
+
251
+ "linescores": {
252
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1479454/linescores"
253
+ }
254
+
255
+ }
256
+ ,
257
+ {
258
+ "captain":false,
259
+ "playerId":1304656,
260
+ "period": 0,
261
+ "active": false,
262
+ "mediaId": 0,
263
+
264
+ "activeName": "player",
265
+
266
+ "starter": true,
267
+ "forPlayerId": 0,
268
+ "valid": true,
269
+
270
+ "athlete": {
271
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1304656"
272
+ },
273
+
274
+ "position": {
275
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/BL"
276
+ },
277
+
278
+
279
+ "linescores": {
280
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1304656/linescores"
281
+ }
282
+
283
+ }
284
+ ,
285
+ {
286
+ "captain":false,
287
+ "playerId":1530034,
288
+ "period": 0,
289
+ "active": false,
290
+ "mediaId": 0,
291
+
292
+ "activeName": "player",
293
+
294
+ "starter": true,
295
+ "forPlayerId": 0,
296
+ "valid": true,
297
+
298
+ "athlete": {
299
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/athletes/1530034"
300
+ },
301
+
302
+ "position": {
303
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/positions/UKN"
304
+ },
305
+
306
+
307
+ "linescores": {
308
+ "$ref": "http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474/competitors/789643/roster/1530034/linescores"
309
+ }
310
+
311
+ }
312
+ ],
313
+ "competition":{
314
+ "$ref":"http://core.espnuk.org/v2/sports/cricket/leagues/19138/events/1529474/competitions/1529474"
315
+ },
316
+ "team":{
317
+ "$ref":"http://core.espnuk.org/v2/sports/cricket/teams/789643"
318
+ }
319
+ }
320
+
321
+
322
+
@@ -0,0 +1,19 @@
1
+
2
+ {
3
+ "$ref":"http://core.espnuk.org/v2/sports/cricket/leagues/1174248/events/1529474/competitions/1529474/competitors/789643/scores",
4
+ "place":1,
5
+
6
+ "innings":"3",
7
+ "value":"319 & 69/2 (19 ov)",
8
+ "displayValue":"319 & 69/2 (19 ov)",
9
+ "winner":"false"
10
+ ,
11
+ "source":{
12
+ "id":1,
13
+ "description":"Basic/Manual"
14
+ }
15
+ }
16
+
17
+
18
+
19
+