@time2win/t2w 1.4.11 → 1.4.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/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ 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.12 - 2024-09-19
9
+ ### Added
10
+ RaceStatus enum
11
+
8
12
  ## 1.4.11 - 2024-09-11
9
13
  ### Removed
10
14
  age calculation for participant infos - this is temporary to decrease requests
package/index.js CHANGED
@@ -217,6 +217,12 @@ var Time2WinAPI = /** @class */ (function () {
217
217
  reject(body);
218
218
  return [2 /*return*/];
219
219
  }
220
+ if (body.list === undefined) {
221
+ console.log('body.list is undefined');
222
+ console.log(body);
223
+ console.log(raceId);
224
+ body.list = [];
225
+ }
220
226
  if (!(body.page < body.page_total)) return [3 /*break*/, 3];
221
227
  _b = (_a = (_d = body.list).push).apply;
222
228
  _c = [_d];
package/models.d.ts CHANGED
@@ -251,3 +251,20 @@ export interface T2WParticipantInfo {
251
251
  team_name: string | null;
252
252
  extra_fields: T2WParticipantExtraFields;
253
253
  }
254
+ export declare enum RaceStatus {
255
+ FINISHED = 1,
256
+ FINISHED_PENDING_VERIFICATION = 2,
257
+ FINISHED_BUT_NOT_COMPLETED = 3,
258
+ DSQ = 5,
259
+ AFTER_CUT_OFF = 10,
260
+ DNF = 15,
261
+ LAPPED = 17,
262
+ STARTED_AND_ACTIVE = 20,
263
+ SHOULD_BE_INVESTIGATED = 25,
264
+ INSUFFICIENT_DATA = 30,
265
+ DNS = 35,
266
+ UNKNOWN_OTHER = 40,
267
+ NOT_STARTED = 45,
268
+ CHECKED_IN = 50,
269
+ PENALTY = 60
270
+ }
package/models.js CHANGED
@@ -1,2 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RaceStatus = void 0;
4
+ var RaceStatus;
5
+ (function (RaceStatus) {
6
+ RaceStatus[RaceStatus["FINISHED"] = 1] = "FINISHED";
7
+ RaceStatus[RaceStatus["FINISHED_PENDING_VERIFICATION"] = 2] = "FINISHED_PENDING_VERIFICATION";
8
+ RaceStatus[RaceStatus["FINISHED_BUT_NOT_COMPLETED"] = 3] = "FINISHED_BUT_NOT_COMPLETED";
9
+ RaceStatus[RaceStatus["DSQ"] = 5] = "DSQ";
10
+ RaceStatus[RaceStatus["AFTER_CUT_OFF"] = 10] = "AFTER_CUT_OFF";
11
+ RaceStatus[RaceStatus["DNF"] = 15] = "DNF";
12
+ RaceStatus[RaceStatus["LAPPED"] = 17] = "LAPPED";
13
+ RaceStatus[RaceStatus["STARTED_AND_ACTIVE"] = 20] = "STARTED_AND_ACTIVE";
14
+ RaceStatus[RaceStatus["SHOULD_BE_INVESTIGATED"] = 25] = "SHOULD_BE_INVESTIGATED";
15
+ RaceStatus[RaceStatus["INSUFFICIENT_DATA"] = 30] = "INSUFFICIENT_DATA";
16
+ RaceStatus[RaceStatus["DNS"] = 35] = "DNS";
17
+ RaceStatus[RaceStatus["UNKNOWN_OTHER"] = 40] = "UNKNOWN_OTHER";
18
+ RaceStatus[RaceStatus["NOT_STARTED"] = 45] = "NOT_STARTED";
19
+ RaceStatus[RaceStatus["CHECKED_IN"] = 50] = "CHECKED_IN";
20
+ RaceStatus[RaceStatus["PENALTY"] = 60] = "PENALTY"; // custom status, does not exist in api
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.11",
3
+ "version": "1.4.13",
4
4
  "description": "providing latest-state models and advanced methods to interact with the T2W API",
5
5
  "keywords": [
6
6
  "time2win",
package/test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/test.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var index_1 = __importDefault(require("./index"));
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);
10
+ }).catch(function (err) {
11
+ console.log('ERROR', err);
12
+ });