@time2win/t2w 2.0.3 → 2.0.5

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,6 +5,14 @@ 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
+ ## 2.0.5 - 2025-08-26
9
+ ### Added
10
+ page size option to participantInfo and individualResults methods
11
+
12
+ ## 2.0.4 - 2025-08-22
13
+ ### Added
14
+ non binary gender support
15
+
8
16
  ## 2.0.3 - 2025-07-30
9
17
  ### Added
10
18
  apiKey get property to retrieve the current api key
package/index.js CHANGED
@@ -254,7 +254,7 @@ var Time2WinAPI = /** @class */ (function () {
254
254
  case 0:
255
255
  _a = this.fetchIndividualResults;
256
256
  return [4 /*yield*/, this.getEventDataWithCache(eventId, { dataExtra: ['splits'] }, options === null || options === void 0 ? void 0 : options.maxEventAge)];
257
- case 1: return [2 /*return*/, _a.apply(this, [_b.sent(), raceId, options === null || options === void 0 ? void 0 : options.dataExtra, options === null || options === void 0 ? void 0 : options.gender, page])];
257
+ case 1: return [2 /*return*/, _a.apply(this, [_b.sent(), raceId, options === null || options === void 0 ? void 0 : options.dataExtra, options === null || options === void 0 ? void 0 : options.gender, page, options === null || options === void 0 ? void 0 : options.pageSize])];
258
258
  }
259
259
  });
260
260
  });
@@ -268,7 +268,7 @@ var Time2WinAPI = /** @class */ (function () {
268
268
  case 0:
269
269
  _a = this.fetchParticipantInfos;
270
270
  return [4 /*yield*/, this.getEventDataWithCache(eventId, {}, options === null || options === void 0 ? void 0 : options.maxEventAge)];
271
- case 1: return [2 /*return*/, _a.apply(this, [_b.sent(), options === null || options === void 0 ? void 0 : options.raceId, options === null || options === void 0 ? void 0 : options.dataExtra, options === null || options === void 0 ? void 0 : options.gender, page])];
271
+ case 1: return [2 /*return*/, _a.apply(this, [_b.sent(), options === null || options === void 0 ? void 0 : options.raceId, options === null || options === void 0 ? void 0 : options.dataExtra, options === null || options === void 0 ? void 0 : options.gender, page, options === null || options === void 0 ? void 0 : options.pageSize])];
272
272
  }
273
273
  });
274
274
  });
@@ -321,8 +321,9 @@ var Time2WinAPI = /** @class */ (function () {
321
321
  });
322
322
  });
323
323
  };
324
- Time2WinAPI.prototype.fetchIndividualResults = function (event, raceId, dataExtra, gender, page) {
324
+ Time2WinAPI.prototype.fetchIndividualResults = function (event, raceId, dataExtra, gender, page, pageSize) {
325
325
  if (page === void 0) { page = 1; }
326
+ if (pageSize === void 0) { pageSize = this.pageSize; }
326
327
  return __awaiter(this, void 0, void 0, function () {
327
328
  var _this = this;
328
329
  return __generator(this, function (_a) {
@@ -332,7 +333,7 @@ var Time2WinAPI = /** @class */ (function () {
332
333
  'data_extra': (dataExtra === null || dataExtra === void 0 ? void 0 : dataExtra.join(',')) || '',
333
334
  page: page,
334
335
  'gender': gender || '',
335
- 'page_size': _this.pageSize
336
+ 'page_size': pageSize
336
337
  };
337
338
  fetch(_this.getUrl(_this.apiUrl, "results/".concat(event.event_id, "/individuals"), queryParams))
338
339
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
@@ -372,8 +373,9 @@ var Time2WinAPI = /** @class */ (function () {
372
373
  });
373
374
  });
374
375
  };
375
- Time2WinAPI.prototype.fetchParticipantInfos = function (event, raceId, dataExtra, gender, page) {
376
+ Time2WinAPI.prototype.fetchParticipantInfos = function (event, raceId, dataExtra, gender, page, pageSize) {
376
377
  if (page === void 0) { page = 1; }
378
+ if (pageSize === void 0) { pageSize = this.pageSize; }
377
379
  return __awaiter(this, void 0, void 0, function () {
378
380
  var _this = this;
379
381
  return __generator(this, function (_a) {
@@ -386,7 +388,7 @@ var Time2WinAPI = /** @class */ (function () {
386
388
  'data_extra': (dataExtra === null || dataExtra === void 0 ? void 0 : dataExtra.join(',')) || '',
387
389
  gender: gender || '',
388
390
  page: page,
389
- 'page_size': this.pageSize
391
+ 'page_size': pageSize
390
392
  };
391
393
  fetch(this.getUrl(this.apiUrl, "/participants/".concat(event.event_id, "/individuals"), queryParams))
392
394
  .then(function (response) { return __awaiter(_this, void 0, void 0, function () {
package/models.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare type gender = 'M' | 'F' | 'U';
1
+ declare type gender = T2WGender;
2
2
  export interface T2WEventResponse {
3
3
  events: T2WEvent[];
4
4
  page: number;
@@ -274,23 +274,26 @@ export declare enum RaceStatus {
274
274
  export interface ParticipantInfoOptions {
275
275
  raceId?: number;
276
276
  dataExtra?: ('order' | 'attributes' | 'categories' | 'uci_id' | 'chip_code' | 'externalticket' | 'contactinfo')[];
277
- gender?: 'M' | 'F' | 'U';
277
+ gender?: T2WGender;
278
278
  maxEventAge?: number;
279
+ pageSize?: number;
279
280
  }
280
281
  export interface IndividualResultsOptions {
281
282
  dataExtra?: ('splits' | 'laps' | 'positions' | 'attributes')[];
282
- gender?: 'M' | 'F' | 'U';
283
+ gender?: T2WGender;
283
284
  maxEventAge?: number;
285
+ pageSize?: number;
284
286
  }
285
287
  export interface EventDataOptions {
286
288
  dataExtra?: ('prices' | 'splits' | 'categories' | 'attributes')[];
287
289
  }
288
290
  export interface TeamResultOptions {
289
291
  dataExtra?: ('splits' | 'attributes' | 'laps')[];
290
- teamType?: 'M' | 'F' | 'U';
292
+ teamType?: T2WGender;
291
293
  }
292
294
  export interface TeamsWithMembersOptions {
293
295
  raceId?: number;
294
296
  dataExtra?: ('teammembers' | 'attributes')[];
295
297
  }
298
+ export declare type T2WGender = 'M' | 'F' | 'X' | 'U';
296
299
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@time2win/t2w",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "providing latest-state models and advanced methods to interact with the T2W API",
5
5
  "keywords": [
6
6
  "time2win",