@time2win/t2w 1.4.17 → 1.4.18

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/CHANGELOG.md CHANGED
@@ -5,12 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 1.4.18 - 2025-02-14
9
+ ### Added
10
+ ```agecategories``` and ```attributes``` properties to ```T2WEvent```
11
+
8
12
  ## 1.4.17 - 2024-11-12
9
13
  ### Changed
10
14
  ```Time2WinAPI``` constructor, to add optional parameter ```pageSize```, default value = 250.
11
15
  <br> removed currently unused ```getEventData()``` call in ```getParticipantInfos()```
12
16
 
13
-
14
17
  ## 1.4.16 - 2024-10-15
15
18
  ### Changed
16
19
  type of ```organization``` of ```T2WTeamResult``` to ```string | null```
package/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export default class Time2WinAPI {
4
4
  private readonly apiKey;
5
5
  private readonly pageSize;
6
6
  constructor(apiKey: string, pageSize?: number);
7
- getEventData(eventId: number, dataExtra?: ('prices' | 'splits')[]): Promise<T2WEvent>;
7
+ getEventData(eventId: number, dataExtra?: ('prices' | 'splits' | 'categories' | 'attributes')[]): Promise<T2WEvent>;
8
8
  getTeamResult(eventId: number, raceId: number, dataExtra?: ('splits' | 'attributes' | 'laps')[], teamType?: 'M' | 'F' | 'U', page?: number): Promise<T2WTeamResultsResponse>;
9
9
  getTeamsWithMembers(eventId: number, raceId?: number, dataExtra?: ('teammembers' | 'attributes')[], page?: number): Promise<T2WTeamResponse>;
10
10
  getIndividualResults(eventId: number, raceId: number, dataExtra?: ('splits' | 'laps' | 'positions' | 'attributes')[], gender?: 'M' | 'F' | 'U', page?: number): Promise<T2WIndividualResultResponse>;
package/models.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ declare type gender = 'M' | 'F' | 'U';
1
2
  export interface T2WEventResponse {
2
3
  events: T2WEvent[];
3
4
  page: number;
@@ -6,6 +7,7 @@ export interface T2WEventResponse {
6
7
  }
7
8
  export interface T2WEvent {
8
9
  event_id: number;
10
+ event_id_previous: number | null;
9
11
  event_name: string;
10
12
  event_start: string;
11
13
  event_end: string;
@@ -23,6 +25,8 @@ export interface T2WEvent {
23
25
  banner_url: string;
24
26
  locations: T2WEventLocations[];
25
27
  races: T2WEventRace[];
28
+ attributes: T2WEventAttributes[] | null;
29
+ agecategories: T2WEventCategories[] | null;
26
30
  }
27
31
  export interface T2WEventRace {
28
32
  race_id: number;
@@ -56,6 +60,19 @@ export interface T2WEventLocations {
56
60
  latitude: number;
57
61
  longitude: number;
58
62
  }
63
+ export interface T2WEventAttributes {
64
+ attribute: number;
65
+ name: string;
66
+ }
67
+ export interface T2WEventCategories {
68
+ id: number;
69
+ name: string;
70
+ interval_from: number;
71
+ interval_to: number;
72
+ gender: gender | null;
73
+ ordering: number;
74
+ races: number[];
75
+ }
59
76
  export interface T2WTeamResultsResponse {
60
77
  page_size: number;
61
78
  page: number;
@@ -80,7 +97,7 @@ export interface T2WTeamResultSplit {
80
97
  }
81
98
  export interface T2WTeamResult {
82
99
  id: number;
83
- team_type: 'M' | 'F' | 'U';
100
+ team_type: gender;
84
101
  name_team: string;
85
102
  organization: string | null;
86
103
  race_id: number;
@@ -128,7 +145,7 @@ export interface T2WTeam {
128
145
  status_text: string;
129
146
  name_team: string;
130
147
  organization: string | null;
131
- team_type: 'M' | 'F' | 'U';
148
+ team_type: gender;
132
149
  attr_1: string | null;
133
150
  attr_2: string | null;
134
151
  members: T2WTeamMember[];
@@ -221,7 +238,7 @@ interface T2WParticipantBasic {
221
238
  name_last: string;
222
239
  organization: string | null;
223
240
  birthdate: Date | null;
224
- gender: 'M' | 'F' | 'U';
241
+ gender: gender;
225
242
  country_code: string;
226
243
  attr_extra: string | null;
227
244
  attr_commentary: string | null;
package/models.js CHANGED
@@ -17,5 +17,5 @@ var RaceStatus;
17
17
  RaceStatus[RaceStatus["UNKNOWN_OTHER"] = 40] = "UNKNOWN_OTHER";
18
18
  RaceStatus[RaceStatus["NOT_STARTED"] = 45] = "NOT_STARTED";
19
19
  RaceStatus[RaceStatus["CHECKED_IN"] = 50] = "CHECKED_IN";
20
- RaceStatus[RaceStatus["PENALTY"] = 60] = "PENALTY"; // custom status, does not exist in api
20
+ RaceStatus[RaceStatus["PENALTY"] = 60] = "PENALTY";
21
21
  })(RaceStatus = exports.RaceStatus || (exports.RaceStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@time2win/t2w",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
4
4
  "description": "providing latest-state models and advanced methods to interact with the T2W API",
5
5
  "keywords": [
6
6
  "time2win",
package/test.js CHANGED
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var index_1 = __importDefault(require("./index"));
7
7
  var api = new index_1.default('09f006ca-23ee-44da-bec5-4372580f4113');
8
- api.getIndividualResults(681, 4237).then(function (res) {
9
- console.log('SUCCESS', res);
8
+ api.getEventData(550, ['prices', 'splits', 'categories', 'attributes']).then(function (res) {
9
+ // console.log('SUCCESS', res);
10
10
  }).catch(function (err) {
11
11
  console.log('ERROR', err);
12
12
  });