warframe-worldstate-parser 3.0.3 → 3.0.4

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/README.md CHANGED
@@ -9,6 +9,7 @@ Parse the Warframe worldstate into useable javascript objects.
9
9
  [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
10
10
 
11
11
  ## Documentation
12
+
12
13
  You can find the documentation [here](https://wfcd.github.io/warframe-worldstate-parser/)
13
14
 
14
15
  ## Installation
@@ -22,7 +23,7 @@ For the most part, you'll have a better experience consuming the product of this
22
23
  ## Example usage
23
24
 
24
25
  ```javascript
25
- const worldstateData = await (require('request-promise'))('http://content.warframe.com/dynamic/worldState.php');
26
+ const worldstateData = await require('request-promise')('http://content.warframe.com/dynamic/worldState.php');
26
27
 
27
28
  const WorldState = require('warframe-worldstate-parser');
28
29
 
@@ -32,10 +33,10 @@ console.log(ws.alerts[0].toString());
32
33
  ```
33
34
 
34
35
  ## Live version
36
+
35
37
  See the parser in action here:
36
38
 
37
39
  [![PC API](https://img.shields.io/badge/API-PC-red.svg)](https://api.warframestat.us/pc)
38
40
  [![PS4 API](https://img.shields.io/badge/API-PS4-blue.svg)](https://api.warframestat.us/ps4)
39
41
  [![XB1 API](https://img.shields.io/badge/API-XB1-brightgreen.svg)](https://api.warframestat.us/xb1)
40
- [![Switch API](https://img.shields.io/badge/API-Switch-orange.svg)](https://api.warframestat.us/swi)
41
-
42
+ [![Switch API](https://img.shields.io/badge/API-Switch-orange.svg)](https://api.warframestat.us/swi)
@@ -1,5 +1,6 @@
1
1
  import { fromNow, parseDate, timeDeltaToString, toNow, languageString } from 'warframe-worldstate-data/utilities';
2
2
 
3
+ import { cdn, wfCdn } from '../supporting/ImgCdn.js';
3
4
  import mdConfig from '../supporting/MarkdownSettings.js';
4
5
 
5
6
  import WorldstateObject from './WorldstateObject.js';
@@ -43,10 +44,7 @@ export default class News extends WorldstateObject {
43
44
  * The news's image link
44
45
  * @type {string}
45
46
  */
46
- this.imageLink = (data.ImageUrl || 'https://i.imgur.com/CNrsc7V.png')
47
- .replace('https://forums.warframe.com/applications/core/interface/imageproxy/imageproxy.php?img=', '')
48
- .replace(/&key=\w*/gi, '')
49
- .replace('http://', 'https://');
47
+ this.imageLink = wfCdn(data.ImageUrl || cdn('img/news-placeholder.png'));
50
48
 
51
49
  /**
52
50
  * Whether this has priority over other news or not
@@ -0,0 +1,9 @@
1
+ export const cdn = (path) => `https://cdn.warframestat.us/genesis/${path}`;
2
+
3
+ export const wfCdn = (path) => `https://cdn.warframestat.us/img/${path}`;
4
+
5
+ export const deProxy = (url) =>
6
+ url
7
+ .replace('https://forums.warframe.com/applications/core/interface/imageproxy/imageproxy.php?img=', '')
8
+ .replace(/&key=\w*/gi, '')
9
+ .replace('http://', 'https://');
@@ -1,4 +1,5 @@
1
1
  import { auras, nightmare, resources } from './RewardData.js';
2
+ import { wfCdn, cdn } from './ImgCdn.js';
2
3
 
3
4
  /**
4
5
  * All possible RewardTypes
@@ -9,21 +10,21 @@ export default [
9
10
  name: 'vauban',
10
11
  description: 'Vauban parts',
11
12
  test: (s) => /^vauban(?!.*helmet)/i.test(s),
12
- thumbnail: 'https://i.imgur.com/r5x0owi.png',
13
+ thumbnail: wfCdn('vauban.png'),
13
14
  color: 0x5c5a53,
14
15
  },
15
16
  {
16
17
  name: 'vandal',
17
18
  description: 'Vandal Weapon Parts',
18
19
  test: (s) => /vandal/i.test(s),
19
- thumbnail: 'https://i.imgur.com/kPQcg5B.png',
20
+ thumbnail: wfCdn('dera-vandal.png'),
20
21
  color: 0x5c5a53,
21
22
  },
22
23
  {
23
24
  name: 'wraith',
24
25
  description: 'Wraith Weapon Parts',
25
26
  test: (s) => /wraith/i.test(s),
26
- thumbnail: 'https://i.imgur.com/B5sv3mQ.png',
27
+ thumbnail: wfCdn('furax-wraith.png'),
27
28
  color: 0x5c5a53,
28
29
  },
29
30
  {
@@ -31,7 +32,7 @@ export default [
31
32
  description: 'Weapon skins',
32
33
  test: (s) => /skin/i.test(s),
33
34
  thumbnail:
34
- 'https://raw.githubusercontent.com/Warframe-Community-Developers/warframe-worldstate-parser/master/resources/weapon_skin_thumb.png',
35
+ 'https://raw.githubusercontent.com/wfcd/warframe-worldstate-parser/master/resources/weapon_skin_thumb.png',
35
36
  color: 0x4f4c33,
36
37
  },
37
38
  {
@@ -39,191 +40,189 @@ export default [
39
40
  description: 'Alternative helmets',
40
41
  test: (s) => /helmet/i.test(s),
41
42
  thumbnail:
42
- 'https://raw.githubusercontent.com/Warframe-Community-Developers/warframe-worldstate-parser/master/resources/alt_helmet_thumb.png',
43
+ 'https://raw.githubusercontent.com/wfcd/warframe-worldstate-parser/master/resources/alt_helmet_thumb.png',
43
44
  color: 0x567677,
44
45
  },
45
46
  {
46
47
  name: 'nitain',
47
48
  description: 'Nitain extract',
48
49
  test: (s) => /nitain/i.test(s),
49
- thumbnail: 'https://i.imgur.com/3Db4PHh.png',
50
+ thumbnail: wfCdn('nitain-extract.png'),
50
51
  color: 0xaeada4,
51
52
  },
52
53
  {
53
54
  name: 'mutalist',
54
55
  description: 'Mutalist Alad V coordinates',
55
56
  test: (s) => /mutalist/i.test(s),
56
- thumbnail: 'https://i.imgur.com/96AWqr8.png',
57
+ thumbnail: wfCdn('mutalist-alad-v-nav-coordinate.png'),
57
58
  color: 0x26b37,
58
59
  },
59
60
  {
60
61
  name: 'weapon',
61
62
  description: 'Weapons',
62
63
  test: (s) => /dagger|sword|glaive/i.test(s),
63
- thumbnail: 'https://i.imgur.com/A2gbH8k.png',
64
+ thumbnail: wfCdn('blueprint'),
64
65
  color: 0xa3a097,
65
66
  },
66
67
  {
67
68
  name: 'fieldron',
68
69
  description: 'Fieldron',
69
70
  test: (s) => /fieldron/i.test(s),
70
- thumbnail: 'https://i.imgur.com/qlrlfft.png',
71
+ thumbnail: wfCdn('fieldron.png'),
71
72
  color: 0x4d5556,
72
73
  },
73
74
  {
74
75
  name: 'detonite',
75
76
  description: 'Detonite Injector',
76
77
  test: (s) => /detonite/i.test(s),
77
- thumbnail: 'https://i.imgur.com/rV6lN4W.png',
78
+ thumbnail: wfCdn('detonite-injector.png'),
78
79
  color: 0x4d5556,
79
80
  },
80
81
  {
81
82
  name: 'mutagen',
82
83
  description: 'Mutagen Mass',
83
84
  test: (s) => /mutagen/i.test(s),
84
- thumbnail: 'https://i.imgur.com/vV7kzub.png',
85
+ thumbnail: wfCdn('mutagen-mass.png'),
85
86
  color: 0x4d5556,
86
87
  },
87
88
  {
88
89
  name: 'clantech',
89
90
  description: 'Clantech resources',
90
91
  test: (s) => /fieldron|detonite|mutagen/i.test(s),
91
- thumbnail:
92
- 'https://github.com/Warframe-Community-Developers/warframe-worldstate-parser/raw/master/resources/clantech_thmb.png',
92
+ thumbnail: 'https://github.com/wfcd/warframe-worldstate-parser/raw/master/resources/clantech_thmb.png',
93
93
  color: 0x4d5556,
94
94
  },
95
95
  {
96
96
  name: 'aura',
97
97
  description: 'Auras',
98
98
  test: (s) => auras.includes(s),
99
- thumbnail:
100
- 'https://github.com/Warframe-Community-Developers/warframe-worldstate-parser/raw/master/resources/aura_thumb.png',
99
+ thumbnail: 'https://github.com/wfcd/warframe-worldstate-parser/raw/master/resources/aura_thumb.png',
101
100
  color: 0xc8f8ff,
102
101
  },
103
102
  {
104
103
  name: 'neuralSensors',
105
104
  description: 'Neural Sensors',
106
105
  test: (s) => /neural/i.test(s),
107
- thumbnail: 'https://i.imgur.com/Gq6cz9p.png',
106
+ thumbnail: wfCdn('neural-sensors.png'),
108
107
  color: 0xc8f8ff,
109
108
  },
110
109
  {
111
110
  name: 'neurodes',
112
111
  description: 'Neurodes',
113
112
  test: (s) => /neurode/i.test(s),
114
- thumbnail: 'https://cdn.warframestat.us/img/component-neurode.png',
113
+ thumbnail: wfCdn('neurodes.png'),
115
114
  color: 0xc8f8ff,
116
115
  },
117
116
  {
118
117
  name: 'orokinCell',
119
118
  description: 'Orokin Cell',
120
119
  test: (s) => /orokin\scell/i.test(s),
121
- thumbnail: 'https://i.imgur.com/tEQdoDE.png',
120
+ thumbnail: wfCdn('orokin-cell.png'),
122
121
  color: 0xc8f8ff,
123
122
  },
124
123
  {
125
124
  name: 'alloyPlate',
126
125
  description: 'Alloy Plate',
127
126
  test: (s) => /alloy\splate/i.test(s),
128
- thumbnail: 'https://i.imgur.com/E8K3fOI.png',
127
+ thumbnail: wfCdn('alloy-plate.png'),
129
128
  color: 0xc8f8ff,
130
129
  },
131
130
  {
132
131
  name: 'circuits',
133
132
  description: 'Circuits',
134
133
  test: (s) => /circuits/i.test(s),
135
- thumbnail: 'https://i.imgur.com/OxJvWIx.png',
134
+ thumbnail: wfCdn('circuits.png'),
136
135
  color: 0xc8f8ff,
137
136
  },
138
137
  {
139
138
  name: 'controlModule',
140
139
  description: 'Control Module',
141
140
  test: (s) => /control\smodule/i.test(s),
142
- thumbnail: 'https://i.imgur.com/F1UUub1.png',
141
+ thumbnail: wfCdn('control-module.png'),
143
142
  color: 0xc8f8ff,
144
143
  },
145
144
  {
146
145
  name: 'ferrite',
147
146
  description: 'Ferrite',
148
147
  test: (s) => /ferrite/i.test(s),
149
- thumbnail: 'https://i.imgur.com/h93eVLr.png',
148
+ thumbnail: wfCdn('ferrite.png'),
150
149
  color: 0xc8f8ff,
151
150
  },
152
151
  {
153
152
  name: 'gallium',
154
153
  description: 'Gallium',
155
154
  test: (s) => /gallium/i.test(s),
156
- thumbnail: 'https://i.imgur.com/pvpc73S.png',
155
+ thumbnail: wfCdn('gallium.png'),
157
156
  color: 0xa1adba,
158
157
  },
159
158
  {
160
159
  name: 'morphics',
161
160
  description: 'Morphics',
162
161
  test: (s) => /morphics/i.test(s),
163
- thumbnail: 'https://i.imgur.com/SF3XWd6.png',
162
+ thumbnail: wfCdn('morphics.png'),
164
163
  color: 0xc8f8ff,
165
164
  },
166
165
  {
167
166
  name: 'nanoSpores',
168
167
  description: 'Nano Spores',
169
168
  test: (s) => /nano\sspores/i.test(s),
170
- thumbnail: 'https://i.imgur.com/bb71Cy7.png',
169
+ thumbnail: wfCdn('nano-spores.png'),
171
170
  color: 0x533f36,
172
171
  },
173
172
  {
174
173
  name: 'oxium',
175
174
  description: 'Oxium',
176
175
  test: (s) => /oxium/i.test(s),
177
- thumbnail: 'https://i.imgur.com/hY8NCjk.png',
176
+ thumbnail: wfCdn('oxium.png'),
178
177
  color: 0x92713b,
179
178
  },
180
179
  {
181
180
  name: 'rubedo',
182
181
  description: 'Rubedo',
183
182
  test: (s) => /rubedo/i.test(s),
184
- thumbnail: 'https://i.imgur.com/gSO9ILf.png',
183
+ thumbnail: wfCdn('rubedo.png'),
185
184
  color: 0xce3e36,
186
185
  },
187
186
  {
188
187
  name: 'salvage',
189
188
  description: 'Salvage',
190
189
  test: (s) => /salvage/i.test(s),
191
- thumbnail: 'https://i.imgur.com/3L7xLYg.png',
190
+ thumbnail: wfCdn('salvage.png'),
192
191
  color: 0x8b8e8d,
193
192
  },
194
193
  {
195
194
  name: 'plastids',
196
195
  description: 'Plastids',
197
196
  test: (s) => /plastids/i.test(s),
198
- thumbnail: 'https://i.imgur.com/5yVfTEF.png',
197
+ thumbnail: wfCdn('plastids.png'),
199
198
  color: 0xceae88,
200
199
  },
201
200
  {
202
201
  name: 'polymerBundle',
203
202
  description: 'Polymer Bundle',
204
203
  test: (s) => /polymer\sbundle/i.test(s),
205
- thumbnail: 'https://i.imgur.com/pg8asnC.png',
204
+ thumbnail: wfCdn('polymer-bundle.png'),
206
205
  color: 0x6b4da4,
207
206
  },
208
207
  {
209
208
  name: 'argonCrystal',
210
209
  description: 'Argon Crystal',
211
210
  test: (s) => /argon\scrystal/i.test(s),
212
- thumbnail: 'https://i.imgur.com/DdJJYSB.png',
211
+ thumbnail: wfCdn('argon-crystal.png'),
213
212
  color: 0xc8f8ff,
214
213
  },
215
214
  {
216
215
  name: 'cryotic',
217
216
  description: 'Cryotic',
218
217
  test: (s) => /cryotic/i.test(s),
219
- thumbnail: 'https://i.imgur.com/yqPgj21.png',
218
+ thumbnail: wfCdn('cryotic.png'),
220
219
  color: 0x78a2b3,
221
220
  },
222
221
  {
223
222
  name: 'tellurium',
224
223
  description: 'Tellurium',
225
224
  test: (s) => /tellurium/i.test(s),
226
- thumbnail: 'https://i.imgur.com/ocjnGU8.png',
225
+ thumbnail: wfCdn('tellurium.png'),
227
226
  color: 0xe72e18,
228
227
  },
229
228
  {
@@ -237,84 +236,84 @@ export default [
237
236
  name: 'nightmare',
238
237
  description: 'Nightmare mods',
239
238
  test: (s) => nightmare.includes(s),
240
- thumbnail: 'https://i.imgur.com/cAYNH7j.png',
239
+ thumbnail: cdn('svg/nightmare.svg'),
241
240
  color: 0xb22e2c,
242
241
  },
243
242
  {
244
243
  name: 'endo',
245
244
  description: 'Endo',
246
245
  test: (s) => /\d+\sendo/i.test(s),
247
- thumbnail: 'https://i.imgur.com/mS8oSwx.png',
246
+ thumbnail: wfCdn('endo.png'),
248
247
  color: 0xc2a24c,
249
248
  },
250
249
  {
251
250
  name: 'reactor',
252
251
  description: 'Orokin Reactors',
253
252
  test: (s) => /reactor/i.test(s),
254
- thumbnail: 'https://i.imgur.com/6Hm1BEq.png',
253
+ thumbnail: wfCdn('orokin-reactor.png'),
255
254
  color: 0xd7c37d,
256
255
  },
257
256
  {
258
257
  name: 'catalyst',
259
258
  description: 'Orokin Catalyst',
260
259
  test: (s) => /catalyst/i.test(s),
261
- thumbnail: 'https://i.imgur.com/C4X9NWm.png',
260
+ thumbnail: wfCdn('orokin-catalyst.png'),
262
261
  color: 0x689add,
263
262
  },
264
263
  {
265
264
  name: 'potato',
266
265
  description: 'Orokin Catalysts/Reactors',
267
266
  test: (s) => /catalyst|reactor/i.test(s),
268
- thumbnail: 'https://i.imgur.com/6Hm1BEq.png',
267
+ thumbnail: wfCdn('orokin-catalyst.png'),
269
268
  color: 0x689add,
270
269
  },
271
270
  {
272
271
  name: 'forma',
273
272
  description: 'Forma',
274
273
  test: (s) => /forma/i.test(s),
275
- thumbnail: 'https://i.imgur.com/2b0FT3D.png',
274
+ thumbnail: wfCdn('forma.png'),
276
275
  color: 0xb19547,
277
276
  },
278
277
  {
279
278
  name: 'exilus',
280
279
  description: 'Exilus',
281
280
  test: (s) => /exilus/i.test(s),
282
- thumbnail: 'https://i.imgur.com/eQNeNpY.png',
281
+ thumbnail: wfCdn('exilus-adapter.png'),
283
282
  color: 0x88332d,
284
283
  },
285
284
  {
286
285
  name: 'synthula',
287
286
  description: 'Synthula',
288
287
  test: (s) => /synthula/i.test(s),
289
- thumbnail: 'https://i.imgur.com/X0Lvfc9.png',
288
+ thumbnail: wfCdn('synthula.png'),
290
289
  color: 0x9fa19f,
291
290
  },
292
291
  {
293
292
  name: 'kavatGene',
294
293
  description: 'Kavat Genetic Code',
295
294
  test: (s) => /Kavat Ge/i.test(s),
296
- thumbnail: 'https://i.imgur.com/ijVUmQV.png',
295
+ thumbnail: wfCdn('kavat-genetic-code.png'),
297
296
  color: 0x76a8ad,
298
297
  },
299
298
  {
300
299
  name: 'kubrowEgg',
301
300
  description: 'Kubrow Egg',
302
301
  test: (s) => /kubrow\segg/i.test(s),
303
- thumbnail: 'https://i.imgur.com/Vv3LXnz.png',
302
+ thumbnail: wfCdn('kubrow-egg'),
304
303
  color: 0xa5937f,
305
304
  },
306
305
  {
307
306
  name: 'traces',
308
307
  description: 'Void Traces',
309
308
  test: (s) => /trace/i.test(s),
310
- thumbnail: 'https://i.imgur.com/vvZGMPv.png',
309
+ thumbnail: wfCdn('void-traces.png'),
311
310
  color: 0x69a4dd,
312
311
  },
313
312
  {
314
313
  name: 'riven',
315
314
  description: 'Riven Mod',
316
315
  test: (s) => /riven/i.test(s),
317
- thumbnail: 'https://i.imgur.com/LoficZr.png',
316
+ thumbnail: wfCdn('rifle-riven-mod.png'),
318
317
  color: 0xa183bd,
319
318
  },
320
319
  // Catch-all
package/package.json CHANGED
@@ -1,39 +1,44 @@
1
1
  {
2
2
  "name": "warframe-worldstate-parser",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "An Open parser for Warframe's Worldstate in Javascript",
5
- "types": "./types/main.d.ts",
6
- "main": "main.js",
7
- "peerDependencies": {
8
- "warframe-worldstate-data": ">=2.0.3"
9
- },
10
- "engines": {
11
- "node": ">=18.19.0"
12
- },
13
- "files": [
14
- "lib",
15
- "main.js",
16
- "LICENSE",
17
- "types"
18
- ],
19
- "repository": "github:wfcd/warframe-worldstate-parser",
20
5
  "keywords": [
21
6
  "warframe-worldstate",
22
7
  "warframe"
23
8
  ],
9
+ "homepage": "https://github.com/wfcd/warframe-worldstate-parser#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/wfcd/warframe-worldstate-parser/issues"
12
+ },
13
+ "repository": "github:wfcd/warframe-worldstate-parser",
14
+ "license": "MIT",
24
15
  "author": "aliasfalse",
25
16
  "contributors": [
26
17
  "nspacestd (https://github.com/nspacestd)"
27
18
  ],
28
- "license": "MIT",
29
- "bugs": {
30
- "url": "https://github.com/wfcd/warframe-worldstate-parser/issues"
31
- },
32
- "homepage": "https://github.com/wfcd/warframe-worldstate-parser#readme",
33
19
  "type": "module",
34
- "overrides": {
35
- "sinon-chai": {
36
- "chai": "^5.0.3"
37
- }
20
+ "main": "main.js",
21
+ "types": "./types/main.d.ts",
22
+ "files": [
23
+ "lib",
24
+ "main.js",
25
+ "LICENSE",
26
+ "types"
27
+ ],
28
+ "pre-commit": [
29
+ "lint",
30
+ "validate",
31
+ "test"
32
+ ],
33
+ "commitlint": {
34
+ "extends": [
35
+ "@commitlint/config-conventional"
36
+ ]
37
+ },
38
+ "peerDependencies": {
39
+ "warframe-worldstate-data": ">=2.0.3"
40
+ },
41
+ "engines": {
42
+ "node": ">=18.19.0"
38
43
  }
39
44
  }
@@ -0,0 +1,3 @@
1
+ export function cdn(path: any): string;
2
+ export function wfCdn(path: any): string;
3
+ export function deProxy(url: any): any;