zwift-data 1.6.0 → 1.9.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 (88) hide show
  1. package/lib/cjs/achievements.js +826 -0
  2. package/lib/cjs/bikeFrames.js +621 -0
  3. package/lib/cjs/bikeFrontWheels.js +241 -0
  4. package/lib/cjs/bikeRearWheels.js +246 -0
  5. package/lib/cjs/bikeShoes.js +81 -0
  6. package/lib/cjs/challenges.js +21 -0
  7. package/lib/cjs/glasses.js +121 -0
  8. package/lib/cjs/headgears.js +411 -0
  9. package/lib/cjs/index.js +54 -0
  10. package/lib/cjs/jerseys.js +3446 -0
  11. package/lib/cjs/notableMomentTypes.js +84 -0
  12. package/lib/cjs/paintJobs.js +598 -0
  13. package/lib/cjs/routes.js +4737 -0
  14. package/lib/cjs/runShirts.js +566 -0
  15. package/lib/cjs/runShoes.js +121 -0
  16. package/lib/cjs/runShorts.js +321 -0
  17. package/lib/cjs/segments.js +811 -0
  18. package/lib/cjs/socks.js +446 -0
  19. package/lib/cjs/trainingPlans.js +141 -0
  20. package/lib/cjs/types.js +2 -0
  21. package/lib/cjs/unlockableCategories.js +54 -0
  22. package/lib/cjs/worlds.js +115 -0
  23. package/lib/esm/achievements.js +823 -0
  24. package/lib/esm/bikeFrames.js +618 -0
  25. package/lib/esm/bikeFrontWheels.js +238 -0
  26. package/lib/esm/bikeRearWheels.js +243 -0
  27. package/lib/esm/bikeShoes.js +78 -0
  28. package/lib/esm/challenges.js +18 -0
  29. package/lib/esm/glasses.js +118 -0
  30. package/lib/esm/headgears.js +408 -0
  31. package/lib/esm/index.js +21 -0
  32. package/lib/esm/jerseys.js +3443 -0
  33. package/lib/esm/notableMomentTypes.js +81 -0
  34. package/lib/esm/paintJobs.js +595 -0
  35. package/lib/esm/routes.js +4734 -0
  36. package/lib/esm/runShirts.js +563 -0
  37. package/lib/esm/runShoes.js +118 -0
  38. package/lib/esm/runShorts.js +318 -0
  39. package/lib/esm/segments.js +808 -0
  40. package/lib/esm/socks.js +443 -0
  41. package/lib/esm/trainingPlans.js +138 -0
  42. package/lib/esm/types.js +1 -0
  43. package/lib/esm/unlockableCategories.js +51 -0
  44. package/lib/esm/worlds.js +112 -0
  45. package/lib/types/achievements.d.ts +2 -0
  46. package/lib/types/bikeFrames.d.ts +2 -0
  47. package/lib/types/bikeFrontWheels.d.ts +2 -0
  48. package/lib/types/bikeRearWheels.d.ts +2 -0
  49. package/lib/types/bikeShoes.d.ts +2 -0
  50. package/lib/types/challenges.d.ts +2 -0
  51. package/lib/types/glasses.d.ts +2 -0
  52. package/lib/types/headgears.d.ts +2 -0
  53. package/lib/{index.d.ts → types/index.d.ts} +21 -21
  54. package/lib/types/jerseys.d.ts +2 -0
  55. package/lib/types/notableMomentTypes.d.ts +2 -0
  56. package/lib/types/paintJobs.d.ts +2 -0
  57. package/lib/types/routes.d.ts +2 -0
  58. package/lib/types/runShirts.d.ts +2 -0
  59. package/lib/types/runShoes.d.ts +2 -0
  60. package/lib/types/runShorts.d.ts +2 -0
  61. package/lib/{segments.d.ts → types/segments.d.ts} +2 -2
  62. package/lib/types/socks.d.ts +2 -0
  63. package/lib/types/trainingPlans.d.ts +2 -0
  64. package/lib/{types.d.ts → types/types.d.ts} +263 -259
  65. package/lib/types/unlockableCategories.d.ts +2 -0
  66. package/lib/{worlds.d.ts → types/worlds.d.ts} +2 -2
  67. package/package.json +9 -11
  68. package/lib/achievements.d.ts +0 -2
  69. package/lib/bikeFrames.d.ts +0 -2
  70. package/lib/bikeFrontWheels.d.ts +0 -2
  71. package/lib/bikeRearWheels.d.ts +0 -2
  72. package/lib/bikeShoes.d.ts +0 -2
  73. package/lib/challenges.d.ts +0 -2
  74. package/lib/glasses.d.ts +0 -2
  75. package/lib/headgears.d.ts +0 -2
  76. package/lib/index.es.js +0 -1
  77. package/lib/index.js +0 -1
  78. package/lib/jersey.d.ts +0 -2
  79. package/lib/jerseys.d.ts +0 -2
  80. package/lib/notableMomentTypes.d.ts +0 -2
  81. package/lib/paintJobs.d.ts +0 -2
  82. package/lib/routes.d.ts +0 -2
  83. package/lib/runShirts.d.ts +0 -2
  84. package/lib/runShoes.d.ts +0 -2
  85. package/lib/runShorts.d.ts +0 -2
  86. package/lib/socks.d.ts +0 -2
  87. package/lib/trainingPlans.d.ts +0 -2
  88. package/lib/unlockableCategories.d.ts +0 -2
@@ -1,259 +1,263 @@
1
- export interface World {
2
- /**
3
- * Zwift internal world/map id
4
- */
5
- id: number;
6
- /**
7
- * Name of the world/map
8
- */
9
- name: string;
10
- /**
11
- * Unique url-safe string to reference the world
12
- */
13
- slug: WorldSlug;
14
- /**
15
- * Bounds of the world
16
- */
17
- bounds: [
18
- [
19
- latitude: number,
20
- longitude: number
21
- ],
22
- [
23
- latitude: number,
24
- longitude: number
25
- ]
26
- ];
27
- }
28
- export declare type WorldSlug = "bologna" | "crit-city" | "france" | "innsbruck" | "london" | "paris" | "makuri-islands" | "new-york" | "richmond" | "watopia" | "yorkshire";
29
- export interface Route {
30
- /**
31
- * Zwift internal route id. Optional as the id is not present for all routes
32
- */
33
- id?: number;
34
- /**
35
- * The world the route is in
36
- */
37
- world: WorldSlug;
38
- /**
39
- * Name of the route
40
- */
41
- name: string;
42
- /**
43
- * Unique url-safe string to reference the route
44
- */
45
- slug: string;
46
- /**
47
- * Distance of the route in kilometers
48
- */
49
- distance: number;
50
- /**
51
- * Total elevation gain on the route in meters
52
- */
53
- elevation: number;
54
- /**
55
- * Distance of the lead in
56
- */
57
- leadInDistance?: number;
58
- /**
59
- * Elevation gain of the lead in
60
- */
61
- leadInElevation?: number;
62
- /**
63
- * Distance of the lead in during free ride or meetups
64
- */
65
- leadInDistanceFreeRide?: number;
66
- /**
67
- * Elevation gain of the lead in during free ride or meetups
68
- */
69
- leadInElevationFreeRide?: number;
70
- /**
71
- * Distance of the lead in during meetups
72
- */
73
- leadInDistanceMeetups?: number;
74
- /**
75
- * Elevation gain of the lead in during meetups
76
- */
77
- leadInElevationInMeetups?: number;
78
- /**
79
- * Experience points you gain when finishing the route
80
- */
81
- experience?: number;
82
- /**
83
- * Official segments on the route sorted by appearance. Segments are listed multiple times if they are ridden multiple times.
84
- */
85
- segments: string[];
86
- /**
87
- * Id of the corresponding strava segment
88
- */
89
- stravaSegmentId?: number;
90
- /**
91
- * Url of the corresponding strava segment
92
- */
93
- stravaSegmentUrl?: string;
94
- /**
95
- * Url of the Zwift insiders page
96
- */
97
- zwiftInsiderUrl?: string;
98
- /**
99
- * Url of the route on What's on Zwift
100
- */
101
- whatsOnZwiftUrl?: string;
102
- /**
103
- * Types of sport that can complete this route
104
- */
105
- sports: Sport[];
106
- /**
107
- * `true`, if the route can not be selected in the start screen and can only be ridden in events
108
- */
109
- eventOnly: boolean;
110
- /**
111
- * `true`, if the route can only be ridden from a certain level
112
- */
113
- levelLocked: boolean;
114
- /**
115
- * `true`, if the route is a lap
116
- */
117
- lap: boolean;
118
- /**
119
- * `true`, if the route supports time trial events
120
- */
121
- supportsTT: boolean;
122
- /**
123
- * `true`, if the route is available for meetups
124
- */
125
- supportsMeetups: boolean;
126
- }
127
- export declare type Sport = "running" | "cycling";
128
- export interface Segment {
129
- /**
130
- * World the segment is in
131
- */
132
- world: WorldSlug;
133
- /**
134
- * Name of the segment
135
- */
136
- name: string;
137
- /**
138
- * Unique url-safe string to reference the segment
139
- */
140
- slug: string;
141
- /**
142
- * Distance of the segment
143
- */
144
- distance: number;
145
- /**
146
- * Total elevation gain of the segment
147
- */
148
- elevation?: number;
149
- /**
150
- * Average include of the segment. `0` if the segment is a lap.
151
- */
152
- avgIncline?: number;
153
- /**
154
- * Id of the corresponding strava segment
155
- */
156
- stravaSegmentId?: number;
157
- /**
158
- * Url of the corresponding strava segment
159
- */
160
- stravaSegmentUrl?: string;
161
- /**
162
- * Type of the segment
163
- */
164
- type: SegmentType;
165
- /**
166
- * Url of the route on What's on Zwift
167
- */
168
- whatsOnZwiftUrl?: string;
169
- /**
170
- * Rating of a climb segment. Only available if `type=climb`.
171
- */
172
- climbType?: "HC" | "4" | "3" | "2" | "1";
173
- }
174
- export declare type SegmentType = "sprint" | "climb" | "segment";
175
- export interface BikeFrame {
176
- id: number;
177
- name: string;
178
- modelYear?: number;
179
- isTT: boolean;
180
- }
181
- export interface Jersey {
182
- id: number;
183
- name: string;
184
- imageName: string;
185
- }
186
- export interface TrainingPlan {
187
- id: number;
188
- name: string;
189
- imageName: string;
190
- }
191
- export interface RunShirt {
192
- id: number;
193
- name: string;
194
- imageName: string;
195
- }
196
- export interface RunShort {
197
- id: number;
198
- name: string;
199
- imageName: string;
200
- }
201
- export interface RunShoe {
202
- id: number;
203
- name: string;
204
- imageName: string;
205
- }
206
- export interface BikeShoe {
207
- id: number;
208
- name: string;
209
- imageName: string;
210
- }
211
- export interface BikeFrontWheel {
212
- id: number;
213
- name: string;
214
- imageName: string;
215
- }
216
- export interface BikeRearWheel {
217
- id: number;
218
- name: string;
219
- imageName: string;
220
- }
221
- export interface PaintJob {
222
- id: number;
223
- name: string;
224
- }
225
- export interface Sock {
226
- id: number;
227
- name: string;
228
- imageName: string;
229
- }
230
- export interface Glass {
231
- id: number;
232
- name: string;
233
- imageName: string;
234
- }
235
- export interface Headgear {
236
- id: number;
237
- name: string;
238
- imageName: string;
239
- }
240
- export interface Achievements {
241
- id: number;
242
- name: string;
243
- imageName: string;
244
- }
245
- export interface Challenge {
246
- id: number;
247
- name: string;
248
- imageName: string;
249
- }
250
- export interface NotableMomentType {
251
- id: number;
252
- name: string;
253
- priority: number;
254
- imageName: string;
255
- }
256
- export interface UnlockableCategory {
257
- id: number;
258
- name: string;
259
- }
1
+ export interface World {
2
+ /**
3
+ * Zwift internal world/map id
4
+ */
5
+ id: number;
6
+ /**
7
+ * Name of the world/map
8
+ */
9
+ name: string;
10
+ /**
11
+ * Unique url-safe string to reference the world
12
+ */
13
+ slug: WorldSlug;
14
+ /**
15
+ * Bounds of the world
16
+ */
17
+ bounds: [
18
+ [
19
+ latitude: number,
20
+ longitude: number
21
+ ],
22
+ [
23
+ latitude: number,
24
+ longitude: number
25
+ ]
26
+ ];
27
+ /**
28
+ * URL to the image of the world
29
+ */
30
+ imageUrl: string;
31
+ }
32
+ export declare type WorldSlug = "bologna" | "crit-city" | "france" | "innsbruck" | "london" | "paris" | "makuri-islands" | "new-york" | "richmond" | "watopia" | "yorkshire";
33
+ export interface Route {
34
+ /**
35
+ * Zwift internal route id. Optional as the id is not present for all routes
36
+ */
37
+ id?: number;
38
+ /**
39
+ * The world the route is in
40
+ */
41
+ world: WorldSlug;
42
+ /**
43
+ * Name of the route
44
+ */
45
+ name: string;
46
+ /**
47
+ * Unique url-safe string to reference the route
48
+ */
49
+ slug: string;
50
+ /**
51
+ * Distance of the route in kilometers
52
+ */
53
+ distance: number;
54
+ /**
55
+ * Total elevation gain on the route in meters
56
+ */
57
+ elevation: number;
58
+ /**
59
+ * Distance of the lead in
60
+ */
61
+ leadInDistance?: number;
62
+ /**
63
+ * Elevation gain of the lead in
64
+ */
65
+ leadInElevation?: number;
66
+ /**
67
+ * Distance of the lead in during free ride or meetups
68
+ */
69
+ leadInDistanceFreeRide?: number;
70
+ /**
71
+ * Elevation gain of the lead in during free ride or meetups
72
+ */
73
+ leadInElevationFreeRide?: number;
74
+ /**
75
+ * Distance of the lead in during meetups
76
+ */
77
+ leadInDistanceMeetups?: number;
78
+ /**
79
+ * Elevation gain of the lead in during meetups
80
+ */
81
+ leadInElevationInMeetups?: number;
82
+ /**
83
+ * Experience points you gain when finishing the route
84
+ */
85
+ experience?: number;
86
+ /**
87
+ * Official segments on the route sorted by appearance. Segments are listed multiple times if they are ridden multiple times.
88
+ */
89
+ segments: ReadonlyArray<string>;
90
+ /**
91
+ * Id of the corresponding strava segment
92
+ */
93
+ stravaSegmentId?: number;
94
+ /**
95
+ * Url of the corresponding strava segment
96
+ */
97
+ stravaSegmentUrl?: string;
98
+ /**
99
+ * Url of the Zwift insiders page
100
+ */
101
+ zwiftInsiderUrl?: string;
102
+ /**
103
+ * Url of the route on What's on Zwift
104
+ */
105
+ whatsOnZwiftUrl?: string;
106
+ /**
107
+ * Types of sport that can complete this route
108
+ */
109
+ sports: ReadonlyArray<Sport>;
110
+ /**
111
+ * `true`, if the route can not be selected in the start screen and can only be ridden in events
112
+ */
113
+ eventOnly: boolean;
114
+ /**
115
+ * `true`, if the route can only be ridden from a certain level
116
+ */
117
+ levelLocked: boolean;
118
+ /**
119
+ * `true`, if the route is a lap
120
+ */
121
+ lap: boolean;
122
+ /**
123
+ * `true`, if the route supports time trial events
124
+ */
125
+ supportsTT: boolean;
126
+ /**
127
+ * `true`, if the route is available for meetups
128
+ */
129
+ supportsMeetups: boolean;
130
+ }
131
+ export declare type Sport = "running" | "cycling";
132
+ export interface Segment {
133
+ /**
134
+ * World the segment is in
135
+ */
136
+ world: WorldSlug;
137
+ /**
138
+ * Name of the segment
139
+ */
140
+ name: string;
141
+ /**
142
+ * Unique url-safe string to reference the segment
143
+ */
144
+ slug: string;
145
+ /**
146
+ * Distance of the segment
147
+ */
148
+ distance: number;
149
+ /**
150
+ * Total elevation gain of the segment
151
+ */
152
+ elevation?: number;
153
+ /**
154
+ * Average include of the segment. `0` if the segment is a lap.
155
+ */
156
+ avgIncline?: number;
157
+ /**
158
+ * Id of the corresponding strava segment
159
+ */
160
+ stravaSegmentId?: number;
161
+ /**
162
+ * Url of the corresponding strava segment
163
+ */
164
+ stravaSegmentUrl?: string;
165
+ /**
166
+ * Type of the segment
167
+ */
168
+ type: SegmentType;
169
+ /**
170
+ * Url of the route on What's on Zwift
171
+ */
172
+ whatsOnZwiftUrl?: string;
173
+ /**
174
+ * Rating of a climb segment. Only available if `type=climb`.
175
+ */
176
+ climbType?: "HC" | "4" | "3" | "2" | "1";
177
+ }
178
+ export declare type SegmentType = "sprint" | "climb" | "segment";
179
+ export interface BikeFrame {
180
+ id: number;
181
+ name: string;
182
+ modelYear?: number;
183
+ isTT: boolean;
184
+ }
185
+ export interface Jersey {
186
+ id: number;
187
+ name: string;
188
+ imageName: string;
189
+ }
190
+ export interface TrainingPlan {
191
+ id: number;
192
+ name: string;
193
+ imageName: string;
194
+ }
195
+ export interface RunShirt {
196
+ id: number;
197
+ name: string;
198
+ imageName: string;
199
+ }
200
+ export interface RunShort {
201
+ id: number;
202
+ name: string;
203
+ imageName: string;
204
+ }
205
+ export interface RunShoe {
206
+ id: number;
207
+ name: string;
208
+ imageName: string;
209
+ }
210
+ export interface BikeShoe {
211
+ id: number;
212
+ name: string;
213
+ imageName: string;
214
+ }
215
+ export interface BikeFrontWheel {
216
+ id: number;
217
+ name: string;
218
+ imageName: string;
219
+ }
220
+ export interface BikeRearWheel {
221
+ id: number;
222
+ name: string;
223
+ imageName: string;
224
+ }
225
+ export interface PaintJob {
226
+ id: number;
227
+ name: string;
228
+ }
229
+ export interface Sock {
230
+ id: number;
231
+ name: string;
232
+ imageName: string;
233
+ }
234
+ export interface Glass {
235
+ id: number;
236
+ name: string;
237
+ imageName: string;
238
+ }
239
+ export interface Headgear {
240
+ id: number;
241
+ name: string;
242
+ imageName: string;
243
+ }
244
+ export interface Achievements {
245
+ id: number;
246
+ name: string;
247
+ imageName: string;
248
+ }
249
+ export interface Challenge {
250
+ id: number;
251
+ name: string;
252
+ imageName: string;
253
+ }
254
+ export interface NotableMomentType {
255
+ id: number;
256
+ name: string;
257
+ priority: number;
258
+ imageName: string;
259
+ }
260
+ export interface UnlockableCategory {
261
+ id: number;
262
+ name: string;
263
+ }
@@ -0,0 +1,2 @@
1
+ import { UnlockableCategory } from "./types";
2
+ export declare const unlockableCategories: ReadonlyArray<UnlockableCategory>;
@@ -1,2 +1,2 @@
1
- import { World } from "./types";
2
- export declare const worlds: ReadonlyArray<World>;
1
+ import { World } from "./types";
2
+ export declare const worlds: ReadonlyArray<World>;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "zwift-data",
3
- "version": "1.6.0",
3
+ "version": "1.9.0",
4
4
  "description": "Data about Zwift worlds, routes and segments",
5
- "main": "lib/index.js",
6
- "module": "lib/index.es.js",
5
+ "main": "./lib/cjs/index.js",
6
+ "module": "./lib/esm/index.js",
7
+ "types": "./lib/types/index.d.ts",
7
8
  "files": [
8
9
  "lib"
9
10
  ],
10
- "types": "lib/index.d.ts",
11
11
  "keywords": [
12
12
  "zwift",
13
13
  "data"
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/andipaetzold/zwift-data#readme",
29
29
  "devDependencies": {
30
+ "@octokit/rest": "18.12.0",
30
31
  "@semantic-release/changelog": "5.0.1",
31
32
  "@semantic-release/git": "9.0.0",
32
33
  "@tsconfig/recommended": "1.0.1",
@@ -35,9 +36,6 @@
35
36
  "jest": "27.0.3",
36
37
  "node-fetch": "3.1.0",
37
38
  "rimraf": "3.0.2",
38
- "rollup": "2.50.5",
39
- "rollup-plugin-terser": "7.0.2",
40
- "rollup-plugin-typescript2": "0.30.0",
41
39
  "semantic-release": "17.4.3",
42
40
  "simple-git": "2.47.0",
43
41
  "ts-jest": "27.0.2",
@@ -46,13 +44,13 @@
46
44
  },
47
45
  "scripts": {
48
46
  "prepublishOnly": "npm run build",
49
- "clean": "rimraf lib",
50
- "build": "npm run clean && rollup -c",
47
+ "build": "rimraf lib && npm run build:cjs && npm run build:esm",
48
+ "build:cjs": "rimraf lib/cjs && tsc --module commonjs --outDir lib/cjs",
49
+ "build:esm": "rimraf lib/esm && tsc --module ES2015 --outDir lib/esm",
51
50
  "build-docs": "rimraf docs && typedoc src/index.ts",
52
- "watch": "npm run clean && rollup -cw",
53
51
  "test": "jest",
54
52
  "semantic-release": "semantic-release",
55
53
  "update-data": "node ./scripts/update-data.mjs",
56
- "push-changes": "node ./scripts/push-changes.mjs"
54
+ "prepare-pr": "node ./scripts/prepare-pr.mjs"
57
55
  }
58
56
  }
@@ -1,2 +0,0 @@
1
- import { Achievements } from "./types";
2
- export declare const achievements: Achievements[];
@@ -1,2 +0,0 @@
1
- import { BikeFrame } from "./types";
2
- export declare const bikeFrames: BikeFrame[];
@@ -1,2 +0,0 @@
1
- import { BikeFrontWheel } from "./types";
2
- export declare const bikeFrontWheels: BikeFrontWheel[];
@@ -1,2 +0,0 @@
1
- import { BikeRearWheel } from "./types";
2
- export declare const bikeRearWheels: BikeRearWheel[];
@@ -1,2 +0,0 @@
1
- import { BikeShoe } from "./types";
2
- export declare const bikeShoes: BikeShoe[];
@@ -1,2 +0,0 @@
1
- import { Challenge } from "./types";
2
- export declare const challenges: Challenge[];
package/lib/glasses.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Glass } from "./types";
2
- export declare const glasses: Glass[];
@@ -1,2 +0,0 @@
1
- import { Headgear } from "./types";
2
- export declare const headgears: Headgear[];