@universalis-ffxiv/universalis-client 0.1.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.
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/v1.d.ts +1158 -0
- package/dist/v1.d.ts.map +1 -0
- package/dist/v1.js +2140 -0
- package/dist/v1.js.map +1 -0
- package/dist/v2.d.ts +1240 -0
- package/dist/v2.d.ts.map +1 -0
- package/dist/v2.js +2419 -0
- package/dist/v2.js.map +1 -0
- package/dist/v3.d.ts +361 -0
- package/dist/v3.d.ts.map +1 -0
- package/dist/v3.js +768 -0
- package/dist/v3.js.map +1 -0
- package/package.json +24 -0
package/dist/v1.js
ADDED
|
@@ -0,0 +1,2140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//----------------------
|
|
3
|
+
// <auto-generated>
|
|
4
|
+
// Generated using the NSwag toolchain v14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
|
|
5
|
+
// </auto-generated>
|
|
6
|
+
//----------------------
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.SwaggerException = exports.World = exports.DataCenter = exports.UserListView = exports.TaxRatesView = exports.SaleView = exports.MinimizedSaleView = exports.MateriaView = exports.ListingView = exports.HistoryView = exports.HistoryMultiView = exports.WorldUploadCountView = exports.WorldItemRecencyView = exports.UploadCountHistoryView = exports.SourceUploadCountView = exports.RecentlyUpdatedItemsView = exports.MostRecentlyUpdatedItemsView = exports.ContentView = exports.CurrentlyShownView = exports.CurrentlyShownMultiView = exports.UploadParameters = exports.Sale = exports.Materia = exports.MarketTaxRates = exports.Listing = exports.ProblemDetails = exports.Client = void 0;
|
|
9
|
+
class Client {
|
|
10
|
+
constructor(baseUrl, http) {
|
|
11
|
+
this.jsonParseReviver = undefined;
|
|
12
|
+
this.http = http ? http : window;
|
|
13
|
+
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns all data centers supported by the API.
|
|
17
|
+
* @return Success
|
|
18
|
+
*/
|
|
19
|
+
dataCenters() {
|
|
20
|
+
let url_ = this.baseUrl + "/api/data-centers";
|
|
21
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
22
|
+
let options_ = {
|
|
23
|
+
method: "GET",
|
|
24
|
+
headers: {
|
|
25
|
+
"Accept": "application/json"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
29
|
+
return this.processDataCenters(_response);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
processDataCenters(response) {
|
|
33
|
+
const status = response.status;
|
|
34
|
+
let _headers = {};
|
|
35
|
+
if (response.headers && response.headers.forEach) {
|
|
36
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
37
|
+
}
|
|
38
|
+
;
|
|
39
|
+
if (status === 200) {
|
|
40
|
+
return response.text().then((_responseText) => {
|
|
41
|
+
let result200 = null;
|
|
42
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
43
|
+
if (Array.isArray(resultData200)) {
|
|
44
|
+
result200 = [];
|
|
45
|
+
for (let item of resultData200)
|
|
46
|
+
result200.push(DataCenter.fromJS(item));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
result200 = null;
|
|
50
|
+
}
|
|
51
|
+
return result200;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else if (status !== 200 && status !== 204) {
|
|
55
|
+
return response.text().then((_responseText) => {
|
|
56
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return Promise.resolve(null);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns the IDs and names of all worlds supported by the API.
|
|
63
|
+
* @return Success
|
|
64
|
+
*/
|
|
65
|
+
worlds() {
|
|
66
|
+
let url_ = this.baseUrl + "/api/worlds";
|
|
67
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
68
|
+
let options_ = {
|
|
69
|
+
method: "GET",
|
|
70
|
+
headers: {
|
|
71
|
+
"Accept": "application/json"
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
75
|
+
return this.processWorlds(_response);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
processWorlds(response) {
|
|
79
|
+
const status = response.status;
|
|
80
|
+
let _headers = {};
|
|
81
|
+
if (response.headers && response.headers.forEach) {
|
|
82
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
83
|
+
}
|
|
84
|
+
;
|
|
85
|
+
if (status === 200) {
|
|
86
|
+
return response.text().then((_responseText) => {
|
|
87
|
+
let result200 = null;
|
|
88
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
89
|
+
if (Array.isArray(resultData200)) {
|
|
90
|
+
result200 = [];
|
|
91
|
+
for (let item of resultData200)
|
|
92
|
+
result200.push(World.fromJS(item));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
result200 = null;
|
|
96
|
+
}
|
|
97
|
+
return result200;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else if (status !== 200 && status !== 204) {
|
|
101
|
+
return response.text().then((_responseText) => {
|
|
102
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return Promise.resolve(null);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns the content object associated with the provided content ID. Please note that this endpoint is largely untested,
|
|
109
|
+
and may return inconsistent data at times.
|
|
110
|
+
* @param contentId The ID of the content object to retrieve.
|
|
111
|
+
* @return Success
|
|
112
|
+
*/
|
|
113
|
+
content(contentId) {
|
|
114
|
+
let url_ = this.baseUrl + "/api/extra/content/{contentId}";
|
|
115
|
+
if (contentId === undefined || contentId === null)
|
|
116
|
+
throw new globalThis.Error("The parameter 'contentId' must be defined.");
|
|
117
|
+
url_ = url_.replace("{contentId}", encodeURIComponent("" + contentId));
|
|
118
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
119
|
+
let options_ = {
|
|
120
|
+
method: "GET",
|
|
121
|
+
headers: {
|
|
122
|
+
"Accept": "application/json"
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
126
|
+
return this.processContent(_response);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
processContent(response) {
|
|
130
|
+
const status = response.status;
|
|
131
|
+
let _headers = {};
|
|
132
|
+
if (response.headers && response.headers.forEach) {
|
|
133
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
134
|
+
}
|
|
135
|
+
;
|
|
136
|
+
if (status === 200) {
|
|
137
|
+
return response.text().then((_responseText) => {
|
|
138
|
+
let result200 = null;
|
|
139
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
140
|
+
result200 = ContentView.fromJS(resultData200);
|
|
141
|
+
return result200;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
else if (status !== 200 && status !== 204) {
|
|
145
|
+
return response.text().then((_responseText) => {
|
|
146
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return Promise.resolve(null);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get the least-recently updated items on the specified world or data center, along with the upload times for each item.
|
|
153
|
+
* @param world (optional) The world to request data for.
|
|
154
|
+
* @param dcName (optional) The data center to request data for.
|
|
155
|
+
* @param entries (optional) The number of entries to return (default 50, max 200).
|
|
156
|
+
* @return Success
|
|
157
|
+
*/
|
|
158
|
+
leastRecentlyUpdated(world, dcName, entries) {
|
|
159
|
+
let url_ = this.baseUrl + "/api/extra/stats/least-recently-updated?";
|
|
160
|
+
if (world === null)
|
|
161
|
+
throw new globalThis.Error("The parameter 'world' cannot be null.");
|
|
162
|
+
else if (world !== undefined)
|
|
163
|
+
url_ += "world=" + encodeURIComponent("" + world) + "&";
|
|
164
|
+
if (dcName === null)
|
|
165
|
+
throw new globalThis.Error("The parameter 'dcName' cannot be null.");
|
|
166
|
+
else if (dcName !== undefined)
|
|
167
|
+
url_ += "dcName=" + encodeURIComponent("" + dcName) + "&";
|
|
168
|
+
if (entries === null)
|
|
169
|
+
throw new globalThis.Error("The parameter 'entries' cannot be null.");
|
|
170
|
+
else if (entries !== undefined)
|
|
171
|
+
url_ += "entries=" + encodeURIComponent("" + entries) + "&";
|
|
172
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
173
|
+
let options_ = {
|
|
174
|
+
method: "GET",
|
|
175
|
+
headers: {
|
|
176
|
+
"Accept": "application/json"
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
180
|
+
return this.processLeastRecentlyUpdated(_response);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
processLeastRecentlyUpdated(response) {
|
|
184
|
+
const status = response.status;
|
|
185
|
+
let _headers = {};
|
|
186
|
+
if (response.headers && response.headers.forEach) {
|
|
187
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
188
|
+
}
|
|
189
|
+
;
|
|
190
|
+
if (status === 200) {
|
|
191
|
+
return response.text().then((_responseText) => {
|
|
192
|
+
let result200 = null;
|
|
193
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
194
|
+
result200 = MostRecentlyUpdatedItemsView.fromJS(resultData200);
|
|
195
|
+
return result200;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
else if (status === 404) {
|
|
199
|
+
return response.text().then((_responseText) => {
|
|
200
|
+
let result404 = null;
|
|
201
|
+
let resultData404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
202
|
+
result404 = ProblemDetails.fromJS(resultData404);
|
|
203
|
+
return throwException("The world/DC requested is invalid.", status, _responseText, _headers, result404);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
else if (status !== 200 && status !== 204) {
|
|
207
|
+
return response.text().then((_responseText) => {
|
|
208
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return Promise.resolve(null);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Retrieves the data currently shown on the market board for the requested item and world or data center.
|
|
215
|
+
Up to 100 item IDs can be comma-separated in order to retrieve data for multiple items at once.
|
|
216
|
+
* @param itemIds The item ID or comma-separated item IDs to retrieve data for.
|
|
217
|
+
* @param worldDcRegion The world, data center, or region to retrieve data for. This may be an ID or a name. Regions should be specified as Japan, Europe, North-America, Oceania, China, or 中国.
|
|
218
|
+
* @param listings (optional) The number of listings to return per item. By default, all listings will be returned.
|
|
219
|
+
* @param entries (optional) The number of recent history entries to return per item. By default, a maximum of 5 entries will be returned.
|
|
220
|
+
* @param hq (optional) Filter for HQ listings and entries. By default, both HQ and NQ listings and entries will be returned.
|
|
221
|
+
* @param statsWithin (optional) The amount of time before now to calculate stats over, in milliseconds. By default, this is 7 days.
|
|
222
|
+
* @param entriesWithin (optional) The amount of time before now to take entries within, in seconds. Negative values will be ignored.
|
|
223
|
+
* @param fields (optional) A comma separated list of fields that should be included in the response, if omitted will return all fields.
|
|
224
|
+
For example, if you're only interested in the listings price per unit you can set this to listings.pricePerUnit.
|
|
225
|
+
Note that querying multiple items changes the response schema, which should be reflected in the value provided
|
|
226
|
+
for this field. In this case, querying the price per unit requires setting this field to
|
|
227
|
+
items.listings.pricePerUnit.
|
|
228
|
+
* @param user_Agent (optional)
|
|
229
|
+
* @param cF_Connecting_IP (optional)
|
|
230
|
+
* @return Data retrieved successfully.
|
|
231
|
+
*/
|
|
232
|
+
api(itemIds, worldDcRegion, listings, entries, hq, statsWithin, entriesWithin, fields, user_Agent, cF_Connecting_IP) {
|
|
233
|
+
let url_ = this.baseUrl + "/api/{worldDcRegion}/{itemIds}?";
|
|
234
|
+
if (itemIds === undefined || itemIds === null)
|
|
235
|
+
throw new globalThis.Error("The parameter 'itemIds' must be defined.");
|
|
236
|
+
url_ = url_.replace("{itemIds}", encodeURIComponent("" + itemIds));
|
|
237
|
+
if (worldDcRegion === undefined || worldDcRegion === null)
|
|
238
|
+
throw new globalThis.Error("The parameter 'worldDcRegion' must be defined.");
|
|
239
|
+
url_ = url_.replace("{worldDcRegion}", encodeURIComponent("" + worldDcRegion));
|
|
240
|
+
if (listings === null)
|
|
241
|
+
throw new globalThis.Error("The parameter 'listings' cannot be null.");
|
|
242
|
+
else if (listings !== undefined)
|
|
243
|
+
url_ += "listings=" + encodeURIComponent("" + listings) + "&";
|
|
244
|
+
if (entries === null)
|
|
245
|
+
throw new globalThis.Error("The parameter 'entries' cannot be null.");
|
|
246
|
+
else if (entries !== undefined)
|
|
247
|
+
url_ += "entries=" + encodeURIComponent("" + entries) + "&";
|
|
248
|
+
if (hq === null)
|
|
249
|
+
throw new globalThis.Error("The parameter 'hq' cannot be null.");
|
|
250
|
+
else if (hq !== undefined)
|
|
251
|
+
url_ += "hq=" + encodeURIComponent("" + hq) + "&";
|
|
252
|
+
if (statsWithin === null)
|
|
253
|
+
throw new globalThis.Error("The parameter 'statsWithin' cannot be null.");
|
|
254
|
+
else if (statsWithin !== undefined)
|
|
255
|
+
url_ += "statsWithin=" + encodeURIComponent("" + statsWithin) + "&";
|
|
256
|
+
if (entriesWithin === null)
|
|
257
|
+
throw new globalThis.Error("The parameter 'entriesWithin' cannot be null.");
|
|
258
|
+
else if (entriesWithin !== undefined)
|
|
259
|
+
url_ += "entriesWithin=" + encodeURIComponent("" + entriesWithin) + "&";
|
|
260
|
+
if (fields === null)
|
|
261
|
+
throw new globalThis.Error("The parameter 'fields' cannot be null.");
|
|
262
|
+
else if (fields !== undefined)
|
|
263
|
+
url_ += "fields=" + encodeURIComponent("" + fields) + "&";
|
|
264
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
265
|
+
let options_ = {
|
|
266
|
+
method: "GET",
|
|
267
|
+
headers: {
|
|
268
|
+
"User-Agent": user_Agent !== undefined && user_Agent !== null ? "" + user_Agent : "",
|
|
269
|
+
"CF-Connecting-IP": cF_Connecting_IP !== undefined && cF_Connecting_IP !== null ? "" + cF_Connecting_IP : "",
|
|
270
|
+
"Accept": "application/json"
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
274
|
+
return this.processApi(_response);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
processApi(response) {
|
|
278
|
+
const status = response.status;
|
|
279
|
+
let _headers = {};
|
|
280
|
+
if (response.headers && response.headers.forEach) {
|
|
281
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
282
|
+
}
|
|
283
|
+
;
|
|
284
|
+
if (status === 200) {
|
|
285
|
+
return response.text().then((_responseText) => {
|
|
286
|
+
let result200 = null;
|
|
287
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
288
|
+
result200 = CurrentlyShownMultiView.fromJS(resultData200);
|
|
289
|
+
return result200;
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
else if (status === 400) {
|
|
293
|
+
return response.text().then((_responseText) => {
|
|
294
|
+
return throwException("The parameters were invalid.", status, _responseText, _headers);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
else if (status === 404) {
|
|
298
|
+
return response.text().then((_responseText) => {
|
|
299
|
+
let result404 = null;
|
|
300
|
+
let resultData404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
301
|
+
result404 = ProblemDetails.fromJS(resultData404);
|
|
302
|
+
return throwException("The world/DC or item requested is invalid. When requesting multiple items at once, an invalid item ID\r\nwill not trigger this. Instead, the returned list of unresolved item IDs will contain the invalid item ID or IDs.", status, _responseText, _headers, result404);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
else if (status !== 200 && status !== 204) {
|
|
306
|
+
return response.text().then((_responseText) => {
|
|
307
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
return Promise.resolve(null);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Retrieves the history data for the requested item and world or data center.
|
|
314
|
+
Up to 100 item IDs can be comma-separated in order to retrieve data for multiple items at once.
|
|
315
|
+
* @param itemIds The item ID or comma-separated item IDs to retrieve data for.
|
|
316
|
+
* @param worldDcRegion The world or data center to retrieve data for. This may be an ID or a name. Regions should be specified as Japan, Europe, North-America, Oceania, China, or 中国.
|
|
317
|
+
* @param entries (optional) The number of entries to return per item. By default, this is set to 1800, but may be set to a maximum of 99999.
|
|
318
|
+
* @param statsWithin (optional) The amount of time before now to calculate stats over, in milliseconds. By default, this is 7 days.
|
|
319
|
+
* @param entriesWithin (optional) The amount of time before entriesUntil or now to take entries within, in seconds. Negative values will be ignored. By default, this is 7 days.
|
|
320
|
+
* @param entriesUntil (optional) The UNIX timestamp in seconds to take entries until. Negative values will be ignored. By default, this is current time.
|
|
321
|
+
* @param minSalePrice (optional) The inclusive minimum unit sale price of entries to return.
|
|
322
|
+
* @param maxSalePrice (optional) The inclusive maximum unit sale price of entries to return.
|
|
323
|
+
* @param user_Agent (optional)
|
|
324
|
+
* @param cF_Connecting_IP (optional)
|
|
325
|
+
* @return Data retrieved successfully.
|
|
326
|
+
*/
|
|
327
|
+
history(itemIds, worldDcRegion, entries, statsWithin, entriesWithin, entriesUntil, minSalePrice, maxSalePrice, user_Agent, cF_Connecting_IP) {
|
|
328
|
+
let url_ = this.baseUrl + "/api/history/{worldDcRegion}/{itemIds}?";
|
|
329
|
+
if (itemIds === undefined || itemIds === null)
|
|
330
|
+
throw new globalThis.Error("The parameter 'itemIds' must be defined.");
|
|
331
|
+
url_ = url_.replace("{itemIds}", encodeURIComponent("" + itemIds));
|
|
332
|
+
if (worldDcRegion === undefined || worldDcRegion === null)
|
|
333
|
+
throw new globalThis.Error("The parameter 'worldDcRegion' must be defined.");
|
|
334
|
+
url_ = url_.replace("{worldDcRegion}", encodeURIComponent("" + worldDcRegion));
|
|
335
|
+
if (entries === null)
|
|
336
|
+
throw new globalThis.Error("The parameter 'entries' cannot be null.");
|
|
337
|
+
else if (entries !== undefined)
|
|
338
|
+
url_ += "entries=" + encodeURIComponent("" + entries) + "&";
|
|
339
|
+
if (statsWithin === null)
|
|
340
|
+
throw new globalThis.Error("The parameter 'statsWithin' cannot be null.");
|
|
341
|
+
else if (statsWithin !== undefined)
|
|
342
|
+
url_ += "statsWithin=" + encodeURIComponent("" + statsWithin) + "&";
|
|
343
|
+
if (entriesWithin === null)
|
|
344
|
+
throw new globalThis.Error("The parameter 'entriesWithin' cannot be null.");
|
|
345
|
+
else if (entriesWithin !== undefined)
|
|
346
|
+
url_ += "entriesWithin=" + encodeURIComponent("" + entriesWithin) + "&";
|
|
347
|
+
if (entriesUntil === null)
|
|
348
|
+
throw new globalThis.Error("The parameter 'entriesUntil' cannot be null.");
|
|
349
|
+
else if (entriesUntil !== undefined)
|
|
350
|
+
url_ += "entriesUntil=" + encodeURIComponent("" + entriesUntil) + "&";
|
|
351
|
+
if (minSalePrice === null)
|
|
352
|
+
throw new globalThis.Error("The parameter 'minSalePrice' cannot be null.");
|
|
353
|
+
else if (minSalePrice !== undefined)
|
|
354
|
+
url_ += "minSalePrice=" + encodeURIComponent("" + minSalePrice) + "&";
|
|
355
|
+
if (maxSalePrice === null)
|
|
356
|
+
throw new globalThis.Error("The parameter 'maxSalePrice' cannot be null.");
|
|
357
|
+
else if (maxSalePrice !== undefined)
|
|
358
|
+
url_ += "maxSalePrice=" + encodeURIComponent("" + maxSalePrice) + "&";
|
|
359
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
360
|
+
let options_ = {
|
|
361
|
+
method: "GET",
|
|
362
|
+
headers: {
|
|
363
|
+
"User-Agent": user_Agent !== undefined && user_Agent !== null ? "" + user_Agent : "",
|
|
364
|
+
"CF-Connecting-IP": cF_Connecting_IP !== undefined && cF_Connecting_IP !== null ? "" + cF_Connecting_IP : "",
|
|
365
|
+
"Accept": "application/json"
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
369
|
+
return this.processHistory(_response);
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
processHistory(response) {
|
|
373
|
+
const status = response.status;
|
|
374
|
+
let _headers = {};
|
|
375
|
+
if (response.headers && response.headers.forEach) {
|
|
376
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
377
|
+
}
|
|
378
|
+
;
|
|
379
|
+
if (status === 200) {
|
|
380
|
+
return response.text().then((_responseText) => {
|
|
381
|
+
let result200 = null;
|
|
382
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
383
|
+
result200 = HistoryMultiView.fromJS(resultData200);
|
|
384
|
+
return result200;
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
else if (status === 404) {
|
|
388
|
+
return response.text().then((_responseText) => {
|
|
389
|
+
let result404 = null;
|
|
390
|
+
let resultData404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
391
|
+
result404 = ProblemDetails.fromJS(resultData404);
|
|
392
|
+
return throwException("The world/DC or item requested is invalid. When requesting multiple items at once, an invalid item ID\r\nwill not trigger this. Instead, the returned list of unresolved item IDs will contain the invalid item ID or IDs.", status, _responseText, _headers, result404);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
else if (status !== 200 && status !== 204) {
|
|
396
|
+
return response.text().then((_responseText) => {
|
|
397
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
return Promise.resolve(null);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Retrieves the current tax rate data for the specified world. This data is provided by the Retainer Vocate in each major city.
|
|
404
|
+
* @param world (optional) The world or to retrieve data for. This may be an ID or a name.
|
|
405
|
+
* @param user_Agent (optional)
|
|
406
|
+
* @return Data retrieved successfully.
|
|
407
|
+
*/
|
|
408
|
+
taxRates(world, user_Agent) {
|
|
409
|
+
let url_ = this.baseUrl + "/api/tax-rates?";
|
|
410
|
+
if (world === null)
|
|
411
|
+
throw new globalThis.Error("The parameter 'world' cannot be null.");
|
|
412
|
+
else if (world !== undefined)
|
|
413
|
+
url_ += "world=" + encodeURIComponent("" + world) + "&";
|
|
414
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
415
|
+
let options_ = {
|
|
416
|
+
method: "GET",
|
|
417
|
+
headers: {
|
|
418
|
+
"User-Agent": user_Agent !== undefined && user_Agent !== null ? "" + user_Agent : "",
|
|
419
|
+
"Accept": "application/json"
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
423
|
+
return this.processTaxRates(_response);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
processTaxRates(response) {
|
|
427
|
+
const status = response.status;
|
|
428
|
+
let _headers = {};
|
|
429
|
+
if (response.headers && response.headers.forEach) {
|
|
430
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
431
|
+
}
|
|
432
|
+
;
|
|
433
|
+
if (status === 200) {
|
|
434
|
+
return response.text().then((_responseText) => {
|
|
435
|
+
let result200 = null;
|
|
436
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
437
|
+
result200 = TaxRatesView.fromJS(resultData200);
|
|
438
|
+
return result200;
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
else if (status === 404) {
|
|
442
|
+
return response.text().then((_responseText) => {
|
|
443
|
+
let result404 = null;
|
|
444
|
+
let resultData404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
445
|
+
result404 = ProblemDetails.fromJS(resultData404);
|
|
446
|
+
return throwException("The world requested is invalid.", status, _responseText, _headers, result404);
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
else if (status !== 200 && status !== 204) {
|
|
450
|
+
return response.text().then((_responseText) => {
|
|
451
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
return Promise.resolve(null);
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Returns the set of marketable item IDs.
|
|
458
|
+
* @return Success
|
|
459
|
+
*/
|
|
460
|
+
marketable() {
|
|
461
|
+
let url_ = this.baseUrl + "/api/marketable";
|
|
462
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
463
|
+
let options_ = {
|
|
464
|
+
method: "GET",
|
|
465
|
+
headers: {
|
|
466
|
+
"Accept": "application/json"
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
470
|
+
return this.processMarketable(_response);
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
processMarketable(response) {
|
|
474
|
+
const status = response.status;
|
|
475
|
+
let _headers = {};
|
|
476
|
+
if (response.headers && response.headers.forEach) {
|
|
477
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
478
|
+
}
|
|
479
|
+
;
|
|
480
|
+
if (status === 200) {
|
|
481
|
+
return response.text().then((_responseText) => {
|
|
482
|
+
let result200 = null;
|
|
483
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
484
|
+
if (Array.isArray(resultData200)) {
|
|
485
|
+
result200 = [];
|
|
486
|
+
for (let item of resultData200)
|
|
487
|
+
result200.push(item);
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
result200 = null;
|
|
491
|
+
}
|
|
492
|
+
return result200;
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
else if (status !== 200 && status !== 204) {
|
|
496
|
+
return response.text().then((_responseText) => {
|
|
497
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
return Promise.resolve(null);
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Get the most-recently updated items on the specified world or data center, along with the upload times for each item.
|
|
504
|
+
* @param world (optional) The world to request data for.
|
|
505
|
+
* @param dcName (optional) The data center to request data for.
|
|
506
|
+
* @param entries (optional) The number of entries to return (default 50, max 200).
|
|
507
|
+
* @return Success
|
|
508
|
+
*/
|
|
509
|
+
mostRecentlyUpdated(world, dcName, entries) {
|
|
510
|
+
let url_ = this.baseUrl + "/api/extra/stats/most-recently-updated?";
|
|
511
|
+
if (world === null)
|
|
512
|
+
throw new globalThis.Error("The parameter 'world' cannot be null.");
|
|
513
|
+
else if (world !== undefined)
|
|
514
|
+
url_ += "world=" + encodeURIComponent("" + world) + "&";
|
|
515
|
+
if (dcName === null)
|
|
516
|
+
throw new globalThis.Error("The parameter 'dcName' cannot be null.");
|
|
517
|
+
else if (dcName !== undefined)
|
|
518
|
+
url_ += "dcName=" + encodeURIComponent("" + dcName) + "&";
|
|
519
|
+
if (entries === null)
|
|
520
|
+
throw new globalThis.Error("The parameter 'entries' cannot be null.");
|
|
521
|
+
else if (entries !== undefined)
|
|
522
|
+
url_ += "entries=" + encodeURIComponent("" + entries) + "&";
|
|
523
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
524
|
+
let options_ = {
|
|
525
|
+
method: "GET",
|
|
526
|
+
headers: {
|
|
527
|
+
"Accept": "application/json"
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
531
|
+
return this.processMostRecentlyUpdated(_response);
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
processMostRecentlyUpdated(response) {
|
|
535
|
+
const status = response.status;
|
|
536
|
+
let _headers = {};
|
|
537
|
+
if (response.headers && response.headers.forEach) {
|
|
538
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
539
|
+
}
|
|
540
|
+
;
|
|
541
|
+
if (status === 200) {
|
|
542
|
+
return response.text().then((_responseText) => {
|
|
543
|
+
let result200 = null;
|
|
544
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
545
|
+
result200 = MostRecentlyUpdatedItemsView.fromJS(resultData200);
|
|
546
|
+
return result200;
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
else if (status === 404) {
|
|
550
|
+
return response.text().then((_responseText) => {
|
|
551
|
+
let result404 = null;
|
|
552
|
+
let resultData404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
553
|
+
result404 = ProblemDetails.fromJS(resultData404);
|
|
554
|
+
return throwException("The world/DC requested is invalid.", status, _responseText, _headers, result404);
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
else if (status !== 200 && status !== 204) {
|
|
558
|
+
return response.text().then((_responseText) => {
|
|
559
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
return Promise.resolve(null);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Returns a list of some of the most recently updated items on the website. This endpoint
|
|
566
|
+
is a legacy endpoint and does not include any data on which worlds or data centers the updates happened on.
|
|
567
|
+
* @return Success
|
|
568
|
+
*/
|
|
569
|
+
recentlyUpdated() {
|
|
570
|
+
let url_ = this.baseUrl + "/api/extra/stats/recently-updated";
|
|
571
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
572
|
+
let options_ = {
|
|
573
|
+
method: "GET",
|
|
574
|
+
headers: {
|
|
575
|
+
"Accept": "application/json"
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
579
|
+
return this.processRecentlyUpdated(_response);
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
processRecentlyUpdated(response) {
|
|
583
|
+
const status = response.status;
|
|
584
|
+
let _headers = {};
|
|
585
|
+
if (response.headers && response.headers.forEach) {
|
|
586
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
587
|
+
}
|
|
588
|
+
;
|
|
589
|
+
if (status === 200) {
|
|
590
|
+
return response.text().then((_responseText) => {
|
|
591
|
+
let result200 = null;
|
|
592
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
593
|
+
result200 = RecentlyUpdatedItemsView.fromJS(resultData200);
|
|
594
|
+
return result200;
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
else if (status !== 200 && status !== 204) {
|
|
598
|
+
return response.text().then((_responseText) => {
|
|
599
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
return Promise.resolve(null);
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* @param body (optional)
|
|
606
|
+
* @return Success
|
|
607
|
+
*/
|
|
608
|
+
upload(apiKey, body) {
|
|
609
|
+
let url_ = this.baseUrl + "/upload/{apiKey}";
|
|
610
|
+
if (apiKey === undefined || apiKey === null)
|
|
611
|
+
throw new globalThis.Error("The parameter 'apiKey' must be defined.");
|
|
612
|
+
url_ = url_.replace("{apiKey}", encodeURIComponent("" + apiKey));
|
|
613
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
614
|
+
const content_ = JSON.stringify(body);
|
|
615
|
+
let options_ = {
|
|
616
|
+
body: content_,
|
|
617
|
+
method: "POST",
|
|
618
|
+
headers: {
|
|
619
|
+
"Content-Type": "application/json",
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
623
|
+
return this.processUpload(_response);
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
processUpload(response) {
|
|
627
|
+
const status = response.status;
|
|
628
|
+
let _headers = {};
|
|
629
|
+
if (response.headers && response.headers.forEach) {
|
|
630
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
631
|
+
}
|
|
632
|
+
;
|
|
633
|
+
if (status === 200) {
|
|
634
|
+
return response.text().then((_responseText) => {
|
|
635
|
+
return;
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
else if (status === 400) {
|
|
639
|
+
return response.text().then((_responseText) => {
|
|
640
|
+
let result400 = null;
|
|
641
|
+
let resultData400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
642
|
+
result400 = ProblemDetails.fromJS(resultData400);
|
|
643
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
else if (status !== 200 && status !== 204) {
|
|
647
|
+
return response.text().then((_responseText) => {
|
|
648
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
return Promise.resolve(null);
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Returns the total upload counts for each client application that uploads data to Universalis.
|
|
655
|
+
* @return Success
|
|
656
|
+
*/
|
|
657
|
+
uploaderUploadCounts() {
|
|
658
|
+
let url_ = this.baseUrl + "/api/extra/stats/uploader-upload-counts";
|
|
659
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
660
|
+
let options_ = {
|
|
661
|
+
method: "GET",
|
|
662
|
+
headers: {
|
|
663
|
+
"Accept": "application/json"
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
667
|
+
return this.processUploaderUploadCounts(_response);
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
processUploaderUploadCounts(response) {
|
|
671
|
+
const status = response.status;
|
|
672
|
+
let _headers = {};
|
|
673
|
+
if (response.headers && response.headers.forEach) {
|
|
674
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
675
|
+
}
|
|
676
|
+
;
|
|
677
|
+
if (status === 200) {
|
|
678
|
+
return response.text().then((_responseText) => {
|
|
679
|
+
let result200 = null;
|
|
680
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
681
|
+
if (Array.isArray(resultData200)) {
|
|
682
|
+
result200 = [];
|
|
683
|
+
for (let item of resultData200)
|
|
684
|
+
result200.push(SourceUploadCountView.fromJS(item));
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
result200 = null;
|
|
688
|
+
}
|
|
689
|
+
return result200;
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
else if (status !== 200 && status !== 204) {
|
|
693
|
+
return response.text().then((_responseText) => {
|
|
694
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
return Promise.resolve(null);
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Returns the world upload counts and proportions of the total uploads for each world.
|
|
701
|
+
* @return Success
|
|
702
|
+
*/
|
|
703
|
+
worldUploadCounts() {
|
|
704
|
+
let url_ = this.baseUrl + "/api/extra/stats/world-upload-counts";
|
|
705
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
706
|
+
let options_ = {
|
|
707
|
+
method: "GET",
|
|
708
|
+
headers: {
|
|
709
|
+
"Accept": "application/json"
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
713
|
+
return this.processWorldUploadCounts(_response);
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
processWorldUploadCounts(response) {
|
|
717
|
+
const status = response.status;
|
|
718
|
+
let _headers = {};
|
|
719
|
+
if (response.headers && response.headers.forEach) {
|
|
720
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
721
|
+
}
|
|
722
|
+
;
|
|
723
|
+
if (status === 200) {
|
|
724
|
+
return response.text().then((_responseText) => {
|
|
725
|
+
let result200 = null;
|
|
726
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
727
|
+
if (resultData200) {
|
|
728
|
+
result200 = {};
|
|
729
|
+
for (let key in resultData200) {
|
|
730
|
+
if (resultData200.hasOwnProperty(key))
|
|
731
|
+
result200[key] = resultData200[key] ? WorldUploadCountView.fromJS(resultData200[key]) : new WorldUploadCountView();
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
result200 = null;
|
|
736
|
+
}
|
|
737
|
+
return result200;
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
else if (status !== 200 && status !== 204) {
|
|
741
|
+
return response.text().then((_responseText) => {
|
|
742
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
return Promise.resolve(null);
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Returns the number of uploads per day over the past 30 days.
|
|
749
|
+
* @return Success
|
|
750
|
+
*/
|
|
751
|
+
uploadHistory() {
|
|
752
|
+
let url_ = this.baseUrl + "/api/extra/stats/upload-history";
|
|
753
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
754
|
+
let options_ = {
|
|
755
|
+
method: "GET",
|
|
756
|
+
headers: {
|
|
757
|
+
"Accept": "application/json"
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
761
|
+
return this.processUploadHistory(_response);
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
processUploadHistory(response) {
|
|
765
|
+
const status = response.status;
|
|
766
|
+
let _headers = {};
|
|
767
|
+
if (response.headers && response.headers.forEach) {
|
|
768
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
769
|
+
}
|
|
770
|
+
;
|
|
771
|
+
if (status === 200) {
|
|
772
|
+
return response.text().then((_responseText) => {
|
|
773
|
+
let result200 = null;
|
|
774
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
775
|
+
result200 = UploadCountHistoryView.fromJS(resultData200);
|
|
776
|
+
return result200;
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
else if (status !== 200 && status !== 204) {
|
|
780
|
+
return response.text().then((_responseText) => {
|
|
781
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
return Promise.resolve(null);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Retrieves a user list.
|
|
788
|
+
* @param listId The ID of the list to retrieve.
|
|
789
|
+
* @return Data retrieved successfully.
|
|
790
|
+
*/
|
|
791
|
+
lists(listId) {
|
|
792
|
+
let url_ = this.baseUrl + "/api/lists/{listId}";
|
|
793
|
+
if (listId === undefined || listId === null)
|
|
794
|
+
throw new globalThis.Error("The parameter 'listId' must be defined.");
|
|
795
|
+
url_ = url_.replace("{listId}", encodeURIComponent("" + listId));
|
|
796
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
797
|
+
let options_ = {
|
|
798
|
+
method: "GET",
|
|
799
|
+
headers: {
|
|
800
|
+
"Accept": "application/json"
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
804
|
+
return this.processLists(_response);
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
processLists(response) {
|
|
808
|
+
const status = response.status;
|
|
809
|
+
let _headers = {};
|
|
810
|
+
if (response.headers && response.headers.forEach) {
|
|
811
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
812
|
+
}
|
|
813
|
+
;
|
|
814
|
+
if (status === 200) {
|
|
815
|
+
return response.text().then((_responseText) => {
|
|
816
|
+
let result200 = null;
|
|
817
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
818
|
+
result200 = UserListView.fromJS(resultData200);
|
|
819
|
+
return result200;
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
else if (status === 404) {
|
|
823
|
+
return response.text().then((_responseText) => {
|
|
824
|
+
let result404 = null;
|
|
825
|
+
let resultData404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
826
|
+
result404 = ProblemDetails.fromJS(resultData404);
|
|
827
|
+
return throwException("The list requested does not exist.", status, _responseText, _headers, result404);
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
else if (status !== 200 && status !== 204) {
|
|
831
|
+
return response.text().then((_responseText) => {
|
|
832
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
return Promise.resolve(null);
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Connect to the WebSocket endpoint of the API. Requires a valid WebSocket client.
|
|
839
|
+
* @return Success
|
|
840
|
+
*/
|
|
841
|
+
ws() {
|
|
842
|
+
let url_ = this.baseUrl + "/api/ws";
|
|
843
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
844
|
+
let options_ = {
|
|
845
|
+
method: "GET",
|
|
846
|
+
headers: {}
|
|
847
|
+
};
|
|
848
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
849
|
+
return this.processWs(_response);
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
processWs(response) {
|
|
853
|
+
const status = response.status;
|
|
854
|
+
let _headers = {};
|
|
855
|
+
if (response.headers && response.headers.forEach) {
|
|
856
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
857
|
+
}
|
|
858
|
+
;
|
|
859
|
+
if (status === 200) {
|
|
860
|
+
return response.text().then((_responseText) => {
|
|
861
|
+
return;
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
else if (status !== 200 && status !== 204) {
|
|
865
|
+
return response.text().then((_responseText) => {
|
|
866
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
return Promise.resolve(null);
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Connect to the WebSocket dev endpoint of the API. Requires a valid WebSocket client.
|
|
873
|
+
* @return Success
|
|
874
|
+
*/
|
|
875
|
+
wsDev() {
|
|
876
|
+
let url_ = this.baseUrl + "/api/ws-dev";
|
|
877
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
878
|
+
let options_ = {
|
|
879
|
+
method: "GET",
|
|
880
|
+
headers: {}
|
|
881
|
+
};
|
|
882
|
+
return this.http.fetch(url_, options_).then((_response) => {
|
|
883
|
+
return this.processWsDev(_response);
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
processWsDev(response) {
|
|
887
|
+
const status = response.status;
|
|
888
|
+
let _headers = {};
|
|
889
|
+
if (response.headers && response.headers.forEach) {
|
|
890
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
891
|
+
}
|
|
892
|
+
;
|
|
893
|
+
if (status === 200) {
|
|
894
|
+
return response.text().then((_responseText) => {
|
|
895
|
+
return;
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
else if (status !== 200 && status !== 204) {
|
|
899
|
+
return response.text().then((_responseText) => {
|
|
900
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
return Promise.resolve(null);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
exports.Client = Client;
|
|
907
|
+
class ProblemDetails {
|
|
908
|
+
constructor(data) {
|
|
909
|
+
if (data) {
|
|
910
|
+
for (var property in data) {
|
|
911
|
+
if (data.hasOwnProperty(property))
|
|
912
|
+
this[property] = data[property];
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
init(_data) {
|
|
917
|
+
if (_data) {
|
|
918
|
+
for (var property in _data) {
|
|
919
|
+
if (_data.hasOwnProperty(property))
|
|
920
|
+
this[property] = _data[property];
|
|
921
|
+
}
|
|
922
|
+
this.type = _data["type"];
|
|
923
|
+
this.title = _data["title"];
|
|
924
|
+
this.status = _data["status"];
|
|
925
|
+
this.detail = _data["detail"];
|
|
926
|
+
this.instance = _data["instance"];
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
static fromJS(data) {
|
|
930
|
+
data = typeof data === 'object' ? data : {};
|
|
931
|
+
let result = new ProblemDetails();
|
|
932
|
+
result.init(data);
|
|
933
|
+
return result;
|
|
934
|
+
}
|
|
935
|
+
toJSON(data) {
|
|
936
|
+
data = typeof data === 'object' ? data : {};
|
|
937
|
+
for (var property in this) {
|
|
938
|
+
if (this.hasOwnProperty(property))
|
|
939
|
+
data[property] = this[property];
|
|
940
|
+
}
|
|
941
|
+
data["type"] = this.type;
|
|
942
|
+
data["title"] = this.title;
|
|
943
|
+
data["status"] = this.status;
|
|
944
|
+
data["detail"] = this.detail;
|
|
945
|
+
data["instance"] = this.instance;
|
|
946
|
+
return data;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
exports.ProblemDetails = ProblemDetails;
|
|
950
|
+
class Listing {
|
|
951
|
+
constructor(data) {
|
|
952
|
+
if (data) {
|
|
953
|
+
for (var property in data) {
|
|
954
|
+
if (data.hasOwnProperty(property))
|
|
955
|
+
this[property] = data[property];
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
init(_data) {
|
|
960
|
+
if (_data) {
|
|
961
|
+
this.listingID = _data["listingID"];
|
|
962
|
+
this.hq = _data["hq"];
|
|
963
|
+
this.pricePerUnit = _data["pricePerUnit"];
|
|
964
|
+
this.quantity = _data["quantity"];
|
|
965
|
+
this.retainerName = _data["retainerName"];
|
|
966
|
+
this.retainerID = _data["retainerID"];
|
|
967
|
+
this.retainerCity = _data["retainerCity"];
|
|
968
|
+
this.creatorName = _data["creatorName"];
|
|
969
|
+
this.onMannequin = _data["onMannequin"];
|
|
970
|
+
this.sellerID = _data["sellerID"];
|
|
971
|
+
this.creatorID = _data["creatorID"];
|
|
972
|
+
this.stainID = _data["stainID"];
|
|
973
|
+
this.lastReviewTime = _data["lastReviewTime"];
|
|
974
|
+
if (Array.isArray(_data["materia"])) {
|
|
975
|
+
this.materia = [];
|
|
976
|
+
for (let item of _data["materia"])
|
|
977
|
+
this.materia.push(Materia.fromJS(item));
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
static fromJS(data) {
|
|
982
|
+
data = typeof data === 'object' ? data : {};
|
|
983
|
+
let result = new Listing();
|
|
984
|
+
result.init(data);
|
|
985
|
+
return result;
|
|
986
|
+
}
|
|
987
|
+
toJSON(data) {
|
|
988
|
+
data = typeof data === 'object' ? data : {};
|
|
989
|
+
data["listingID"] = this.listingID;
|
|
990
|
+
data["hq"] = this.hq;
|
|
991
|
+
data["pricePerUnit"] = this.pricePerUnit;
|
|
992
|
+
data["quantity"] = this.quantity;
|
|
993
|
+
data["retainerName"] = this.retainerName;
|
|
994
|
+
data["retainerID"] = this.retainerID;
|
|
995
|
+
data["retainerCity"] = this.retainerCity;
|
|
996
|
+
data["creatorName"] = this.creatorName;
|
|
997
|
+
data["onMannequin"] = this.onMannequin;
|
|
998
|
+
data["sellerID"] = this.sellerID;
|
|
999
|
+
data["creatorID"] = this.creatorID;
|
|
1000
|
+
data["stainID"] = this.stainID;
|
|
1001
|
+
data["lastReviewTime"] = this.lastReviewTime;
|
|
1002
|
+
if (Array.isArray(this.materia)) {
|
|
1003
|
+
data["materia"] = [];
|
|
1004
|
+
for (let item of this.materia)
|
|
1005
|
+
data["materia"].push(item ? item.toJSON() : undefined);
|
|
1006
|
+
}
|
|
1007
|
+
return data;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
exports.Listing = Listing;
|
|
1011
|
+
class MarketTaxRates {
|
|
1012
|
+
constructor(data) {
|
|
1013
|
+
if (data) {
|
|
1014
|
+
for (var property in data) {
|
|
1015
|
+
if (data.hasOwnProperty(property))
|
|
1016
|
+
this[property] = data[property];
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
init(_data) {
|
|
1021
|
+
if (_data) {
|
|
1022
|
+
this.limsaLominsa = _data["limsaLominsa"];
|
|
1023
|
+
this.gridania = _data["gridania"];
|
|
1024
|
+
this.uldah = _data["uldah"];
|
|
1025
|
+
this.ishgard = _data["ishgard"];
|
|
1026
|
+
this.kugane = _data["kugane"];
|
|
1027
|
+
this.crystarium = _data["crystarium"];
|
|
1028
|
+
this.sharlayan = _data["sharlayan"];
|
|
1029
|
+
this.tuliyollal = _data["tuliyollal"];
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
static fromJS(data) {
|
|
1033
|
+
data = typeof data === 'object' ? data : {};
|
|
1034
|
+
let result = new MarketTaxRates();
|
|
1035
|
+
result.init(data);
|
|
1036
|
+
return result;
|
|
1037
|
+
}
|
|
1038
|
+
toJSON(data) {
|
|
1039
|
+
data = typeof data === 'object' ? data : {};
|
|
1040
|
+
data["limsaLominsa"] = this.limsaLominsa;
|
|
1041
|
+
data["gridania"] = this.gridania;
|
|
1042
|
+
data["uldah"] = this.uldah;
|
|
1043
|
+
data["ishgard"] = this.ishgard;
|
|
1044
|
+
data["kugane"] = this.kugane;
|
|
1045
|
+
data["crystarium"] = this.crystarium;
|
|
1046
|
+
data["sharlayan"] = this.sharlayan;
|
|
1047
|
+
data["tuliyollal"] = this.tuliyollal;
|
|
1048
|
+
return data;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
exports.MarketTaxRates = MarketTaxRates;
|
|
1052
|
+
class Materia {
|
|
1053
|
+
constructor(data) {
|
|
1054
|
+
if (data) {
|
|
1055
|
+
for (var property in data) {
|
|
1056
|
+
if (data.hasOwnProperty(property))
|
|
1057
|
+
this[property] = data[property];
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
init(_data) {
|
|
1062
|
+
if (_data) {
|
|
1063
|
+
this.slotID = _data["slotID"];
|
|
1064
|
+
this.materiaID = _data["materiaID"];
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
static fromJS(data) {
|
|
1068
|
+
data = typeof data === 'object' ? data : {};
|
|
1069
|
+
let result = new Materia();
|
|
1070
|
+
result.init(data);
|
|
1071
|
+
return result;
|
|
1072
|
+
}
|
|
1073
|
+
toJSON(data) {
|
|
1074
|
+
data = typeof data === 'object' ? data : {};
|
|
1075
|
+
data["slotID"] = this.slotID;
|
|
1076
|
+
data["materiaID"] = this.materiaID;
|
|
1077
|
+
return data;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
exports.Materia = Materia;
|
|
1081
|
+
class Sale {
|
|
1082
|
+
constructor(data) {
|
|
1083
|
+
if (data) {
|
|
1084
|
+
for (var property in data) {
|
|
1085
|
+
if (data.hasOwnProperty(property))
|
|
1086
|
+
this[property] = data[property];
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
init(_data) {
|
|
1091
|
+
if (_data) {
|
|
1092
|
+
this.hq = _data["hq"];
|
|
1093
|
+
this.pricePerUnit = _data["pricePerUnit"];
|
|
1094
|
+
this.quantity = _data["quantity"];
|
|
1095
|
+
this.buyerName = _data["buyerName"];
|
|
1096
|
+
this.onMannequin = _data["onMannequin"];
|
|
1097
|
+
this.sellerID = _data["sellerID"];
|
|
1098
|
+
this.buyerID = _data["buyerID"];
|
|
1099
|
+
this.timestamp = _data["timestamp"];
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
static fromJS(data) {
|
|
1103
|
+
data = typeof data === 'object' ? data : {};
|
|
1104
|
+
let result = new Sale();
|
|
1105
|
+
result.init(data);
|
|
1106
|
+
return result;
|
|
1107
|
+
}
|
|
1108
|
+
toJSON(data) {
|
|
1109
|
+
data = typeof data === 'object' ? data : {};
|
|
1110
|
+
data["hq"] = this.hq;
|
|
1111
|
+
data["pricePerUnit"] = this.pricePerUnit;
|
|
1112
|
+
data["quantity"] = this.quantity;
|
|
1113
|
+
data["buyerName"] = this.buyerName;
|
|
1114
|
+
data["onMannequin"] = this.onMannequin;
|
|
1115
|
+
data["sellerID"] = this.sellerID;
|
|
1116
|
+
data["buyerID"] = this.buyerID;
|
|
1117
|
+
data["timestamp"] = this.timestamp;
|
|
1118
|
+
return data;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
exports.Sale = Sale;
|
|
1122
|
+
class UploadParameters {
|
|
1123
|
+
constructor(data) {
|
|
1124
|
+
if (data) {
|
|
1125
|
+
for (var property in data) {
|
|
1126
|
+
if (data.hasOwnProperty(property))
|
|
1127
|
+
this[property] = data[property];
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
if (!data) {
|
|
1131
|
+
this.marketTaxRates = new MarketTaxRates();
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
init(_data) {
|
|
1135
|
+
if (_data) {
|
|
1136
|
+
this.uploaderID = _data["uploaderID"];
|
|
1137
|
+
this.worldID = _data["worldID"];
|
|
1138
|
+
this.itemID = _data["itemID"];
|
|
1139
|
+
this.marketTaxRates = _data["marketTaxRates"] ? MarketTaxRates.fromJS(_data["marketTaxRates"]) : new MarketTaxRates();
|
|
1140
|
+
if (Array.isArray(_data["listings"])) {
|
|
1141
|
+
this.listings = [];
|
|
1142
|
+
for (let item of _data["listings"])
|
|
1143
|
+
this.listings.push(Listing.fromJS(item));
|
|
1144
|
+
}
|
|
1145
|
+
if (Array.isArray(_data["entries"])) {
|
|
1146
|
+
this.entries = [];
|
|
1147
|
+
for (let item of _data["entries"])
|
|
1148
|
+
this.entries.push(Sale.fromJS(item));
|
|
1149
|
+
}
|
|
1150
|
+
this.contentID = _data["contentID"];
|
|
1151
|
+
this.characterName = _data["characterName"];
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
static fromJS(data) {
|
|
1155
|
+
data = typeof data === 'object' ? data : {};
|
|
1156
|
+
let result = new UploadParameters();
|
|
1157
|
+
result.init(data);
|
|
1158
|
+
return result;
|
|
1159
|
+
}
|
|
1160
|
+
toJSON(data) {
|
|
1161
|
+
data = typeof data === 'object' ? data : {};
|
|
1162
|
+
data["uploaderID"] = this.uploaderID;
|
|
1163
|
+
data["worldID"] = this.worldID;
|
|
1164
|
+
data["itemID"] = this.itemID;
|
|
1165
|
+
data["marketTaxRates"] = this.marketTaxRates ? this.marketTaxRates.toJSON() : undefined;
|
|
1166
|
+
if (Array.isArray(this.listings)) {
|
|
1167
|
+
data["listings"] = [];
|
|
1168
|
+
for (let item of this.listings)
|
|
1169
|
+
data["listings"].push(item ? item.toJSON() : undefined);
|
|
1170
|
+
}
|
|
1171
|
+
if (Array.isArray(this.entries)) {
|
|
1172
|
+
data["entries"] = [];
|
|
1173
|
+
for (let item of this.entries)
|
|
1174
|
+
data["entries"].push(item ? item.toJSON() : undefined);
|
|
1175
|
+
}
|
|
1176
|
+
data["contentID"] = this.contentID;
|
|
1177
|
+
data["characterName"] = this.characterName;
|
|
1178
|
+
return data;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
exports.UploadParameters = UploadParameters;
|
|
1182
|
+
class CurrentlyShownMultiView {
|
|
1183
|
+
constructor(data) {
|
|
1184
|
+
if (data) {
|
|
1185
|
+
for (var property in data) {
|
|
1186
|
+
if (data.hasOwnProperty(property))
|
|
1187
|
+
this[property] = data[property];
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
init(_data) {
|
|
1192
|
+
if (_data) {
|
|
1193
|
+
if (Array.isArray(_data["itemIDs"])) {
|
|
1194
|
+
this.itemIDs = [];
|
|
1195
|
+
for (let item of _data["itemIDs"])
|
|
1196
|
+
this.itemIDs.push(item);
|
|
1197
|
+
}
|
|
1198
|
+
if (Array.isArray(_data["items"])) {
|
|
1199
|
+
this.items = [];
|
|
1200
|
+
for (let item of _data["items"])
|
|
1201
|
+
this.items.push(CurrentlyShownView.fromJS(item));
|
|
1202
|
+
}
|
|
1203
|
+
this.worldID = _data["worldID"];
|
|
1204
|
+
this.dcName = _data["dcName"];
|
|
1205
|
+
this.regionName = _data["regionName"];
|
|
1206
|
+
if (Array.isArray(_data["unresolvedItems"])) {
|
|
1207
|
+
this.unresolvedItems = [];
|
|
1208
|
+
for (let item of _data["unresolvedItems"])
|
|
1209
|
+
this.unresolvedItems.push(item);
|
|
1210
|
+
}
|
|
1211
|
+
this.worldName = _data["worldName"];
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
static fromJS(data) {
|
|
1215
|
+
data = typeof data === 'object' ? data : {};
|
|
1216
|
+
let result = new CurrentlyShownMultiView();
|
|
1217
|
+
result.init(data);
|
|
1218
|
+
return result;
|
|
1219
|
+
}
|
|
1220
|
+
toJSON(data) {
|
|
1221
|
+
data = typeof data === 'object' ? data : {};
|
|
1222
|
+
if (Array.isArray(this.itemIDs)) {
|
|
1223
|
+
data["itemIDs"] = [];
|
|
1224
|
+
for (let item of this.itemIDs)
|
|
1225
|
+
data["itemIDs"].push(item);
|
|
1226
|
+
}
|
|
1227
|
+
if (Array.isArray(this.items)) {
|
|
1228
|
+
data["items"] = [];
|
|
1229
|
+
for (let item of this.items)
|
|
1230
|
+
data["items"].push(item ? item.toJSON() : undefined);
|
|
1231
|
+
}
|
|
1232
|
+
data["worldID"] = this.worldID;
|
|
1233
|
+
data["dcName"] = this.dcName;
|
|
1234
|
+
data["regionName"] = this.regionName;
|
|
1235
|
+
if (Array.isArray(this.unresolvedItems)) {
|
|
1236
|
+
data["unresolvedItems"] = [];
|
|
1237
|
+
for (let item of this.unresolvedItems)
|
|
1238
|
+
data["unresolvedItems"].push(item);
|
|
1239
|
+
}
|
|
1240
|
+
data["worldName"] = this.worldName;
|
|
1241
|
+
return data;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
exports.CurrentlyShownMultiView = CurrentlyShownMultiView;
|
|
1245
|
+
class CurrentlyShownView {
|
|
1246
|
+
constructor(data) {
|
|
1247
|
+
if (data) {
|
|
1248
|
+
for (var property in data) {
|
|
1249
|
+
if (data.hasOwnProperty(property))
|
|
1250
|
+
this[property] = data[property];
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
init(_data) {
|
|
1255
|
+
if (_data) {
|
|
1256
|
+
this.itemID = _data["itemID"];
|
|
1257
|
+
this.worldID = _data["worldID"];
|
|
1258
|
+
this.lastUploadTime = _data["lastUploadTime"];
|
|
1259
|
+
if (Array.isArray(_data["listings"])) {
|
|
1260
|
+
this.listings = [];
|
|
1261
|
+
for (let item of _data["listings"])
|
|
1262
|
+
this.listings.push(ListingView.fromJS(item));
|
|
1263
|
+
}
|
|
1264
|
+
if (Array.isArray(_data["recentHistory"])) {
|
|
1265
|
+
this.recentHistory = [];
|
|
1266
|
+
for (let item of _data["recentHistory"])
|
|
1267
|
+
this.recentHistory.push(SaleView.fromJS(item));
|
|
1268
|
+
}
|
|
1269
|
+
this.dcName = _data["dcName"];
|
|
1270
|
+
this.regionName = _data["regionName"];
|
|
1271
|
+
this.currentAveragePrice = _data["currentAveragePrice"];
|
|
1272
|
+
this.currentAveragePriceNQ = _data["currentAveragePriceNQ"];
|
|
1273
|
+
this.currentAveragePriceHQ = _data["currentAveragePriceHQ"];
|
|
1274
|
+
this.regularSaleVelocity = _data["regularSaleVelocity"];
|
|
1275
|
+
this.nqSaleVelocity = _data["nqSaleVelocity"];
|
|
1276
|
+
this.hqSaleVelocity = _data["hqSaleVelocity"];
|
|
1277
|
+
this.averagePrice = _data["averagePrice"];
|
|
1278
|
+
this.averagePriceNQ = _data["averagePriceNQ"];
|
|
1279
|
+
this.averagePriceHQ = _data["averagePriceHQ"];
|
|
1280
|
+
this.minPrice = _data["minPrice"];
|
|
1281
|
+
this.minPriceNQ = _data["minPriceNQ"];
|
|
1282
|
+
this.minPriceHQ = _data["minPriceHQ"];
|
|
1283
|
+
this.maxPrice = _data["maxPrice"];
|
|
1284
|
+
this.maxPriceNQ = _data["maxPriceNQ"];
|
|
1285
|
+
this.maxPriceHQ = _data["maxPriceHQ"];
|
|
1286
|
+
if (_data["stackSizeHistogram"]) {
|
|
1287
|
+
this.stackSizeHistogram = {};
|
|
1288
|
+
for (let key in _data["stackSizeHistogram"]) {
|
|
1289
|
+
if (_data["stackSizeHistogram"].hasOwnProperty(key))
|
|
1290
|
+
this.stackSizeHistogram[key] = _data["stackSizeHistogram"][key];
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
if (_data["stackSizeHistogramNQ"]) {
|
|
1294
|
+
this.stackSizeHistogramNQ = {};
|
|
1295
|
+
for (let key in _data["stackSizeHistogramNQ"]) {
|
|
1296
|
+
if (_data["stackSizeHistogramNQ"].hasOwnProperty(key))
|
|
1297
|
+
this.stackSizeHistogramNQ[key] = _data["stackSizeHistogramNQ"][key];
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
if (_data["stackSizeHistogramHQ"]) {
|
|
1301
|
+
this.stackSizeHistogramHQ = {};
|
|
1302
|
+
for (let key in _data["stackSizeHistogramHQ"]) {
|
|
1303
|
+
if (_data["stackSizeHistogramHQ"].hasOwnProperty(key))
|
|
1304
|
+
this.stackSizeHistogramHQ[key] = _data["stackSizeHistogramHQ"][key];
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
this.worldName = _data["worldName"];
|
|
1308
|
+
if (_data["worldUploadTimes"]) {
|
|
1309
|
+
this.worldUploadTimes = {};
|
|
1310
|
+
for (let key in _data["worldUploadTimes"]) {
|
|
1311
|
+
if (_data["worldUploadTimes"].hasOwnProperty(key))
|
|
1312
|
+
this.worldUploadTimes[key] = _data["worldUploadTimes"][key];
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
this.listingsCount = _data["listingsCount"];
|
|
1316
|
+
this.recentHistoryCount = _data["recentHistoryCount"];
|
|
1317
|
+
this.unitsForSale = _data["unitsForSale"];
|
|
1318
|
+
this.unitsSold = _data["unitsSold"];
|
|
1319
|
+
this.hasData = _data["hasData"];
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
static fromJS(data) {
|
|
1323
|
+
data = typeof data === 'object' ? data : {};
|
|
1324
|
+
let result = new CurrentlyShownView();
|
|
1325
|
+
result.init(data);
|
|
1326
|
+
return result;
|
|
1327
|
+
}
|
|
1328
|
+
toJSON(data) {
|
|
1329
|
+
data = typeof data === 'object' ? data : {};
|
|
1330
|
+
data["itemID"] = this.itemID;
|
|
1331
|
+
data["worldID"] = this.worldID;
|
|
1332
|
+
data["lastUploadTime"] = this.lastUploadTime;
|
|
1333
|
+
if (Array.isArray(this.listings)) {
|
|
1334
|
+
data["listings"] = [];
|
|
1335
|
+
for (let item of this.listings)
|
|
1336
|
+
data["listings"].push(item ? item.toJSON() : undefined);
|
|
1337
|
+
}
|
|
1338
|
+
if (Array.isArray(this.recentHistory)) {
|
|
1339
|
+
data["recentHistory"] = [];
|
|
1340
|
+
for (let item of this.recentHistory)
|
|
1341
|
+
data["recentHistory"].push(item ? item.toJSON() : undefined);
|
|
1342
|
+
}
|
|
1343
|
+
data["dcName"] = this.dcName;
|
|
1344
|
+
data["regionName"] = this.regionName;
|
|
1345
|
+
data["currentAveragePrice"] = this.currentAveragePrice;
|
|
1346
|
+
data["currentAveragePriceNQ"] = this.currentAveragePriceNQ;
|
|
1347
|
+
data["currentAveragePriceHQ"] = this.currentAveragePriceHQ;
|
|
1348
|
+
data["regularSaleVelocity"] = this.regularSaleVelocity;
|
|
1349
|
+
data["nqSaleVelocity"] = this.nqSaleVelocity;
|
|
1350
|
+
data["hqSaleVelocity"] = this.hqSaleVelocity;
|
|
1351
|
+
data["averagePrice"] = this.averagePrice;
|
|
1352
|
+
data["averagePriceNQ"] = this.averagePriceNQ;
|
|
1353
|
+
data["averagePriceHQ"] = this.averagePriceHQ;
|
|
1354
|
+
data["minPrice"] = this.minPrice;
|
|
1355
|
+
data["minPriceNQ"] = this.minPriceNQ;
|
|
1356
|
+
data["minPriceHQ"] = this.minPriceHQ;
|
|
1357
|
+
data["maxPrice"] = this.maxPrice;
|
|
1358
|
+
data["maxPriceNQ"] = this.maxPriceNQ;
|
|
1359
|
+
data["maxPriceHQ"] = this.maxPriceHQ;
|
|
1360
|
+
if (this.stackSizeHistogram) {
|
|
1361
|
+
data["stackSizeHistogram"] = {};
|
|
1362
|
+
for (let key in this.stackSizeHistogram) {
|
|
1363
|
+
if (this.stackSizeHistogram.hasOwnProperty(key))
|
|
1364
|
+
data["stackSizeHistogram"][key] = this.stackSizeHistogram[key];
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
if (this.stackSizeHistogramNQ) {
|
|
1368
|
+
data["stackSizeHistogramNQ"] = {};
|
|
1369
|
+
for (let key in this.stackSizeHistogramNQ) {
|
|
1370
|
+
if (this.stackSizeHistogramNQ.hasOwnProperty(key))
|
|
1371
|
+
data["stackSizeHistogramNQ"][key] = this.stackSizeHistogramNQ[key];
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
if (this.stackSizeHistogramHQ) {
|
|
1375
|
+
data["stackSizeHistogramHQ"] = {};
|
|
1376
|
+
for (let key in this.stackSizeHistogramHQ) {
|
|
1377
|
+
if (this.stackSizeHistogramHQ.hasOwnProperty(key))
|
|
1378
|
+
data["stackSizeHistogramHQ"][key] = this.stackSizeHistogramHQ[key];
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
data["worldName"] = this.worldName;
|
|
1382
|
+
if (this.worldUploadTimes) {
|
|
1383
|
+
data["worldUploadTimes"] = {};
|
|
1384
|
+
for (let key in this.worldUploadTimes) {
|
|
1385
|
+
if (this.worldUploadTimes.hasOwnProperty(key))
|
|
1386
|
+
data["worldUploadTimes"][key] = this.worldUploadTimes[key];
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
data["listingsCount"] = this.listingsCount;
|
|
1390
|
+
data["recentHistoryCount"] = this.recentHistoryCount;
|
|
1391
|
+
data["unitsForSale"] = this.unitsForSale;
|
|
1392
|
+
data["unitsSold"] = this.unitsSold;
|
|
1393
|
+
data["hasData"] = this.hasData;
|
|
1394
|
+
return data;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
exports.CurrentlyShownView = CurrentlyShownView;
|
|
1398
|
+
class ContentView {
|
|
1399
|
+
constructor(data) {
|
|
1400
|
+
if (data) {
|
|
1401
|
+
for (var property in data) {
|
|
1402
|
+
if (data.hasOwnProperty(property))
|
|
1403
|
+
this[property] = data[property];
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
init(_data) {
|
|
1408
|
+
if (_data) {
|
|
1409
|
+
this.contentID = _data["contentID"];
|
|
1410
|
+
this.contentType = _data["contentType"];
|
|
1411
|
+
this.characterName = _data["characterName"];
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
static fromJS(data) {
|
|
1415
|
+
data = typeof data === 'object' ? data : {};
|
|
1416
|
+
let result = new ContentView();
|
|
1417
|
+
result.init(data);
|
|
1418
|
+
return result;
|
|
1419
|
+
}
|
|
1420
|
+
toJSON(data) {
|
|
1421
|
+
data = typeof data === 'object' ? data : {};
|
|
1422
|
+
data["contentID"] = this.contentID;
|
|
1423
|
+
data["contentType"] = this.contentType;
|
|
1424
|
+
data["characterName"] = this.characterName;
|
|
1425
|
+
return data;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
exports.ContentView = ContentView;
|
|
1429
|
+
class MostRecentlyUpdatedItemsView {
|
|
1430
|
+
constructor(data) {
|
|
1431
|
+
if (data) {
|
|
1432
|
+
for (var property in data) {
|
|
1433
|
+
if (data.hasOwnProperty(property))
|
|
1434
|
+
this[property] = data[property];
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
init(_data) {
|
|
1439
|
+
if (_data) {
|
|
1440
|
+
if (Array.isArray(_data["items"])) {
|
|
1441
|
+
this.items = [];
|
|
1442
|
+
for (let item of _data["items"])
|
|
1443
|
+
this.items.push(WorldItemRecencyView.fromJS(item));
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
static fromJS(data) {
|
|
1448
|
+
data = typeof data === 'object' ? data : {};
|
|
1449
|
+
let result = new MostRecentlyUpdatedItemsView();
|
|
1450
|
+
result.init(data);
|
|
1451
|
+
return result;
|
|
1452
|
+
}
|
|
1453
|
+
toJSON(data) {
|
|
1454
|
+
data = typeof data === 'object' ? data : {};
|
|
1455
|
+
if (Array.isArray(this.items)) {
|
|
1456
|
+
data["items"] = [];
|
|
1457
|
+
for (let item of this.items)
|
|
1458
|
+
data["items"].push(item ? item.toJSON() : undefined);
|
|
1459
|
+
}
|
|
1460
|
+
return data;
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
exports.MostRecentlyUpdatedItemsView = MostRecentlyUpdatedItemsView;
|
|
1464
|
+
class RecentlyUpdatedItemsView {
|
|
1465
|
+
constructor(data) {
|
|
1466
|
+
if (data) {
|
|
1467
|
+
for (var property in data) {
|
|
1468
|
+
if (data.hasOwnProperty(property))
|
|
1469
|
+
this[property] = data[property];
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
init(_data) {
|
|
1474
|
+
if (_data) {
|
|
1475
|
+
if (Array.isArray(_data["items"])) {
|
|
1476
|
+
this.items = [];
|
|
1477
|
+
for (let item of _data["items"])
|
|
1478
|
+
this.items.push(item);
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
static fromJS(data) {
|
|
1483
|
+
data = typeof data === 'object' ? data : {};
|
|
1484
|
+
let result = new RecentlyUpdatedItemsView();
|
|
1485
|
+
result.init(data);
|
|
1486
|
+
return result;
|
|
1487
|
+
}
|
|
1488
|
+
toJSON(data) {
|
|
1489
|
+
data = typeof data === 'object' ? data : {};
|
|
1490
|
+
if (Array.isArray(this.items)) {
|
|
1491
|
+
data["items"] = [];
|
|
1492
|
+
for (let item of this.items)
|
|
1493
|
+
data["items"].push(item);
|
|
1494
|
+
}
|
|
1495
|
+
return data;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
exports.RecentlyUpdatedItemsView = RecentlyUpdatedItemsView;
|
|
1499
|
+
class SourceUploadCountView {
|
|
1500
|
+
constructor(data) {
|
|
1501
|
+
if (data) {
|
|
1502
|
+
for (var property in data) {
|
|
1503
|
+
if (data.hasOwnProperty(property))
|
|
1504
|
+
this[property] = data[property];
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
init(_data) {
|
|
1509
|
+
if (_data) {
|
|
1510
|
+
this.sourceName = _data["sourceName"];
|
|
1511
|
+
this.uploadCount = _data["uploadCount"];
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
static fromJS(data) {
|
|
1515
|
+
data = typeof data === 'object' ? data : {};
|
|
1516
|
+
let result = new SourceUploadCountView();
|
|
1517
|
+
result.init(data);
|
|
1518
|
+
return result;
|
|
1519
|
+
}
|
|
1520
|
+
toJSON(data) {
|
|
1521
|
+
data = typeof data === 'object' ? data : {};
|
|
1522
|
+
data["sourceName"] = this.sourceName;
|
|
1523
|
+
data["uploadCount"] = this.uploadCount;
|
|
1524
|
+
return data;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
exports.SourceUploadCountView = SourceUploadCountView;
|
|
1528
|
+
class UploadCountHistoryView {
|
|
1529
|
+
constructor(data) {
|
|
1530
|
+
if (data) {
|
|
1531
|
+
for (var property in data) {
|
|
1532
|
+
if (data.hasOwnProperty(property))
|
|
1533
|
+
this[property] = data[property];
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
init(_data) {
|
|
1538
|
+
if (_data) {
|
|
1539
|
+
if (Array.isArray(_data["uploadCountByDay"])) {
|
|
1540
|
+
this.uploadCountByDay = [];
|
|
1541
|
+
for (let item of _data["uploadCountByDay"])
|
|
1542
|
+
this.uploadCountByDay.push(item);
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
static fromJS(data) {
|
|
1547
|
+
data = typeof data === 'object' ? data : {};
|
|
1548
|
+
let result = new UploadCountHistoryView();
|
|
1549
|
+
result.init(data);
|
|
1550
|
+
return result;
|
|
1551
|
+
}
|
|
1552
|
+
toJSON(data) {
|
|
1553
|
+
data = typeof data === 'object' ? data : {};
|
|
1554
|
+
if (Array.isArray(this.uploadCountByDay)) {
|
|
1555
|
+
data["uploadCountByDay"] = [];
|
|
1556
|
+
for (let item of this.uploadCountByDay)
|
|
1557
|
+
data["uploadCountByDay"].push(item);
|
|
1558
|
+
}
|
|
1559
|
+
return data;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
exports.UploadCountHistoryView = UploadCountHistoryView;
|
|
1563
|
+
class WorldItemRecencyView {
|
|
1564
|
+
constructor(data) {
|
|
1565
|
+
if (data) {
|
|
1566
|
+
for (var property in data) {
|
|
1567
|
+
if (data.hasOwnProperty(property))
|
|
1568
|
+
this[property] = data[property];
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
init(_data) {
|
|
1573
|
+
if (_data) {
|
|
1574
|
+
this.itemID = _data["itemID"];
|
|
1575
|
+
this.lastUploadTime = _data["lastUploadTime"];
|
|
1576
|
+
this.worldID = _data["worldID"];
|
|
1577
|
+
this.worldName = _data["worldName"];
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
static fromJS(data) {
|
|
1581
|
+
data = typeof data === 'object' ? data : {};
|
|
1582
|
+
let result = new WorldItemRecencyView();
|
|
1583
|
+
result.init(data);
|
|
1584
|
+
return result;
|
|
1585
|
+
}
|
|
1586
|
+
toJSON(data) {
|
|
1587
|
+
data = typeof data === 'object' ? data : {};
|
|
1588
|
+
data["itemID"] = this.itemID;
|
|
1589
|
+
data["lastUploadTime"] = this.lastUploadTime;
|
|
1590
|
+
data["worldID"] = this.worldID;
|
|
1591
|
+
data["worldName"] = this.worldName;
|
|
1592
|
+
return data;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
exports.WorldItemRecencyView = WorldItemRecencyView;
|
|
1596
|
+
class WorldUploadCountView {
|
|
1597
|
+
constructor(data) {
|
|
1598
|
+
if (data) {
|
|
1599
|
+
for (var property in data) {
|
|
1600
|
+
if (data.hasOwnProperty(property))
|
|
1601
|
+
this[property] = data[property];
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
init(_data) {
|
|
1606
|
+
if (_data) {
|
|
1607
|
+
this.count = _data["count"];
|
|
1608
|
+
this.proportion = _data["proportion"];
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
static fromJS(data) {
|
|
1612
|
+
data = typeof data === 'object' ? data : {};
|
|
1613
|
+
let result = new WorldUploadCountView();
|
|
1614
|
+
result.init(data);
|
|
1615
|
+
return result;
|
|
1616
|
+
}
|
|
1617
|
+
toJSON(data) {
|
|
1618
|
+
data = typeof data === 'object' ? data : {};
|
|
1619
|
+
data["count"] = this.count;
|
|
1620
|
+
data["proportion"] = this.proportion;
|
|
1621
|
+
return data;
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
exports.WorldUploadCountView = WorldUploadCountView;
|
|
1625
|
+
class HistoryMultiView {
|
|
1626
|
+
constructor(data) {
|
|
1627
|
+
if (data) {
|
|
1628
|
+
for (var property in data) {
|
|
1629
|
+
if (data.hasOwnProperty(property))
|
|
1630
|
+
this[property] = data[property];
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
init(_data) {
|
|
1635
|
+
if (_data) {
|
|
1636
|
+
if (Array.isArray(_data["itemIDs"])) {
|
|
1637
|
+
this.itemIDs = [];
|
|
1638
|
+
for (let item of _data["itemIDs"])
|
|
1639
|
+
this.itemIDs.push(item);
|
|
1640
|
+
}
|
|
1641
|
+
if (Array.isArray(_data["items"])) {
|
|
1642
|
+
this.items = [];
|
|
1643
|
+
for (let item of _data["items"])
|
|
1644
|
+
this.items.push(HistoryView.fromJS(item));
|
|
1645
|
+
}
|
|
1646
|
+
this.worldID = _data["worldID"];
|
|
1647
|
+
this.dcName = _data["dcName"];
|
|
1648
|
+
this.regionName = _data["regionName"];
|
|
1649
|
+
if (Array.isArray(_data["unresolvedItems"])) {
|
|
1650
|
+
this.unresolvedItems = [];
|
|
1651
|
+
for (let item of _data["unresolvedItems"])
|
|
1652
|
+
this.unresolvedItems.push(item);
|
|
1653
|
+
}
|
|
1654
|
+
this.worldName = _data["worldName"];
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
static fromJS(data) {
|
|
1658
|
+
data = typeof data === 'object' ? data : {};
|
|
1659
|
+
let result = new HistoryMultiView();
|
|
1660
|
+
result.init(data);
|
|
1661
|
+
return result;
|
|
1662
|
+
}
|
|
1663
|
+
toJSON(data) {
|
|
1664
|
+
data = typeof data === 'object' ? data : {};
|
|
1665
|
+
if (Array.isArray(this.itemIDs)) {
|
|
1666
|
+
data["itemIDs"] = [];
|
|
1667
|
+
for (let item of this.itemIDs)
|
|
1668
|
+
data["itemIDs"].push(item);
|
|
1669
|
+
}
|
|
1670
|
+
if (Array.isArray(this.items)) {
|
|
1671
|
+
data["items"] = [];
|
|
1672
|
+
for (let item of this.items)
|
|
1673
|
+
data["items"].push(item ? item.toJSON() : undefined);
|
|
1674
|
+
}
|
|
1675
|
+
data["worldID"] = this.worldID;
|
|
1676
|
+
data["dcName"] = this.dcName;
|
|
1677
|
+
data["regionName"] = this.regionName;
|
|
1678
|
+
if (Array.isArray(this.unresolvedItems)) {
|
|
1679
|
+
data["unresolvedItems"] = [];
|
|
1680
|
+
for (let item of this.unresolvedItems)
|
|
1681
|
+
data["unresolvedItems"].push(item);
|
|
1682
|
+
}
|
|
1683
|
+
data["worldName"] = this.worldName;
|
|
1684
|
+
return data;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
exports.HistoryMultiView = HistoryMultiView;
|
|
1688
|
+
class HistoryView {
|
|
1689
|
+
constructor(data) {
|
|
1690
|
+
if (data) {
|
|
1691
|
+
for (var property in data) {
|
|
1692
|
+
if (data.hasOwnProperty(property))
|
|
1693
|
+
this[property] = data[property];
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
init(_data) {
|
|
1698
|
+
if (_data) {
|
|
1699
|
+
this.itemID = _data["itemID"];
|
|
1700
|
+
this.worldID = _data["worldID"];
|
|
1701
|
+
this.lastUploadTime = _data["lastUploadTime"];
|
|
1702
|
+
if (Array.isArray(_data["entries"])) {
|
|
1703
|
+
this.entries = [];
|
|
1704
|
+
for (let item of _data["entries"])
|
|
1705
|
+
this.entries.push(MinimizedSaleView.fromJS(item));
|
|
1706
|
+
}
|
|
1707
|
+
this.dcName = _data["dcName"];
|
|
1708
|
+
this.regionName = _data["regionName"];
|
|
1709
|
+
if (_data["stackSizeHistogram"]) {
|
|
1710
|
+
this.stackSizeHistogram = {};
|
|
1711
|
+
for (let key in _data["stackSizeHistogram"]) {
|
|
1712
|
+
if (_data["stackSizeHistogram"].hasOwnProperty(key))
|
|
1713
|
+
this.stackSizeHistogram[key] = _data["stackSizeHistogram"][key];
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
if (_data["stackSizeHistogramNQ"]) {
|
|
1717
|
+
this.stackSizeHistogramNQ = {};
|
|
1718
|
+
for (let key in _data["stackSizeHistogramNQ"]) {
|
|
1719
|
+
if (_data["stackSizeHistogramNQ"].hasOwnProperty(key))
|
|
1720
|
+
this.stackSizeHistogramNQ[key] = _data["stackSizeHistogramNQ"][key];
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
if (_data["stackSizeHistogramHQ"]) {
|
|
1724
|
+
this.stackSizeHistogramHQ = {};
|
|
1725
|
+
for (let key in _data["stackSizeHistogramHQ"]) {
|
|
1726
|
+
if (_data["stackSizeHistogramHQ"].hasOwnProperty(key))
|
|
1727
|
+
this.stackSizeHistogramHQ[key] = _data["stackSizeHistogramHQ"][key];
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
this.regularSaleVelocity = _data["regularSaleVelocity"];
|
|
1731
|
+
this.nqSaleVelocity = _data["nqSaleVelocity"];
|
|
1732
|
+
this.hqSaleVelocity = _data["hqSaleVelocity"];
|
|
1733
|
+
this.worldName = _data["worldName"];
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
static fromJS(data) {
|
|
1737
|
+
data = typeof data === 'object' ? data : {};
|
|
1738
|
+
let result = new HistoryView();
|
|
1739
|
+
result.init(data);
|
|
1740
|
+
return result;
|
|
1741
|
+
}
|
|
1742
|
+
toJSON(data) {
|
|
1743
|
+
data = typeof data === 'object' ? data : {};
|
|
1744
|
+
data["itemID"] = this.itemID;
|
|
1745
|
+
data["worldID"] = this.worldID;
|
|
1746
|
+
data["lastUploadTime"] = this.lastUploadTime;
|
|
1747
|
+
if (Array.isArray(this.entries)) {
|
|
1748
|
+
data["entries"] = [];
|
|
1749
|
+
for (let item of this.entries)
|
|
1750
|
+
data["entries"].push(item ? item.toJSON() : undefined);
|
|
1751
|
+
}
|
|
1752
|
+
data["dcName"] = this.dcName;
|
|
1753
|
+
data["regionName"] = this.regionName;
|
|
1754
|
+
if (this.stackSizeHistogram) {
|
|
1755
|
+
data["stackSizeHistogram"] = {};
|
|
1756
|
+
for (let key in this.stackSizeHistogram) {
|
|
1757
|
+
if (this.stackSizeHistogram.hasOwnProperty(key))
|
|
1758
|
+
data["stackSizeHistogram"][key] = this.stackSizeHistogram[key];
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
if (this.stackSizeHistogramNQ) {
|
|
1762
|
+
data["stackSizeHistogramNQ"] = {};
|
|
1763
|
+
for (let key in this.stackSizeHistogramNQ) {
|
|
1764
|
+
if (this.stackSizeHistogramNQ.hasOwnProperty(key))
|
|
1765
|
+
data["stackSizeHistogramNQ"][key] = this.stackSizeHistogramNQ[key];
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
if (this.stackSizeHistogramHQ) {
|
|
1769
|
+
data["stackSizeHistogramHQ"] = {};
|
|
1770
|
+
for (let key in this.stackSizeHistogramHQ) {
|
|
1771
|
+
if (this.stackSizeHistogramHQ.hasOwnProperty(key))
|
|
1772
|
+
data["stackSizeHistogramHQ"][key] = this.stackSizeHistogramHQ[key];
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
data["regularSaleVelocity"] = this.regularSaleVelocity;
|
|
1776
|
+
data["nqSaleVelocity"] = this.nqSaleVelocity;
|
|
1777
|
+
data["hqSaleVelocity"] = this.hqSaleVelocity;
|
|
1778
|
+
data["worldName"] = this.worldName;
|
|
1779
|
+
return data;
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
exports.HistoryView = HistoryView;
|
|
1783
|
+
class ListingView {
|
|
1784
|
+
constructor(data) {
|
|
1785
|
+
if (data) {
|
|
1786
|
+
for (var property in data) {
|
|
1787
|
+
if (data.hasOwnProperty(property))
|
|
1788
|
+
this[property] = data[property];
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
init(_data) {
|
|
1793
|
+
if (_data) {
|
|
1794
|
+
this.lastReviewTime = _data["lastReviewTime"];
|
|
1795
|
+
this.pricePerUnit = _data["pricePerUnit"];
|
|
1796
|
+
this.quantity = _data["quantity"];
|
|
1797
|
+
this.stainID = _data["stainID"];
|
|
1798
|
+
this.worldName = _data["worldName"];
|
|
1799
|
+
this.worldID = _data["worldID"];
|
|
1800
|
+
this.creatorName = _data["creatorName"];
|
|
1801
|
+
this.creatorID = _data["creatorID"];
|
|
1802
|
+
this.hq = _data["hq"];
|
|
1803
|
+
this.isCrafted = _data["isCrafted"];
|
|
1804
|
+
this.listingID = _data["listingID"];
|
|
1805
|
+
if (Array.isArray(_data["materia"])) {
|
|
1806
|
+
this.materia = [];
|
|
1807
|
+
for (let item of _data["materia"])
|
|
1808
|
+
this.materia.push(MateriaView.fromJS(item));
|
|
1809
|
+
}
|
|
1810
|
+
this.onMannequin = _data["onMannequin"];
|
|
1811
|
+
this.retainerCity = _data["retainerCity"];
|
|
1812
|
+
this.retainerID = _data["retainerID"];
|
|
1813
|
+
this.retainerName = _data["retainerName"];
|
|
1814
|
+
this.sellerID = _data["sellerID"];
|
|
1815
|
+
this.total = _data["total"];
|
|
1816
|
+
this.tax = _data["tax"];
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
static fromJS(data) {
|
|
1820
|
+
data = typeof data === 'object' ? data : {};
|
|
1821
|
+
let result = new ListingView();
|
|
1822
|
+
result.init(data);
|
|
1823
|
+
return result;
|
|
1824
|
+
}
|
|
1825
|
+
toJSON(data) {
|
|
1826
|
+
data = typeof data === 'object' ? data : {};
|
|
1827
|
+
data["lastReviewTime"] = this.lastReviewTime;
|
|
1828
|
+
data["pricePerUnit"] = this.pricePerUnit;
|
|
1829
|
+
data["quantity"] = this.quantity;
|
|
1830
|
+
data["stainID"] = this.stainID;
|
|
1831
|
+
data["worldName"] = this.worldName;
|
|
1832
|
+
data["worldID"] = this.worldID;
|
|
1833
|
+
data["creatorName"] = this.creatorName;
|
|
1834
|
+
data["creatorID"] = this.creatorID;
|
|
1835
|
+
data["hq"] = this.hq;
|
|
1836
|
+
data["isCrafted"] = this.isCrafted;
|
|
1837
|
+
data["listingID"] = this.listingID;
|
|
1838
|
+
if (Array.isArray(this.materia)) {
|
|
1839
|
+
data["materia"] = [];
|
|
1840
|
+
for (let item of this.materia)
|
|
1841
|
+
data["materia"].push(item ? item.toJSON() : undefined);
|
|
1842
|
+
}
|
|
1843
|
+
data["onMannequin"] = this.onMannequin;
|
|
1844
|
+
data["retainerCity"] = this.retainerCity;
|
|
1845
|
+
data["retainerID"] = this.retainerID;
|
|
1846
|
+
data["retainerName"] = this.retainerName;
|
|
1847
|
+
data["sellerID"] = this.sellerID;
|
|
1848
|
+
data["total"] = this.total;
|
|
1849
|
+
data["tax"] = this.tax;
|
|
1850
|
+
return data;
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
exports.ListingView = ListingView;
|
|
1854
|
+
class MateriaView {
|
|
1855
|
+
constructor(data) {
|
|
1856
|
+
if (data) {
|
|
1857
|
+
for (var property in data) {
|
|
1858
|
+
if (data.hasOwnProperty(property))
|
|
1859
|
+
this[property] = data[property];
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
init(_data) {
|
|
1864
|
+
if (_data) {
|
|
1865
|
+
this.slotID = _data["slotID"];
|
|
1866
|
+
this.materiaID = _data["materiaID"];
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
static fromJS(data) {
|
|
1870
|
+
data = typeof data === 'object' ? data : {};
|
|
1871
|
+
let result = new MateriaView();
|
|
1872
|
+
result.init(data);
|
|
1873
|
+
return result;
|
|
1874
|
+
}
|
|
1875
|
+
toJSON(data) {
|
|
1876
|
+
data = typeof data === 'object' ? data : {};
|
|
1877
|
+
data["slotID"] = this.slotID;
|
|
1878
|
+
data["materiaID"] = this.materiaID;
|
|
1879
|
+
return data;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
exports.MateriaView = MateriaView;
|
|
1883
|
+
class MinimizedSaleView {
|
|
1884
|
+
constructor(data) {
|
|
1885
|
+
if (data) {
|
|
1886
|
+
for (var property in data) {
|
|
1887
|
+
if (data.hasOwnProperty(property))
|
|
1888
|
+
this[property] = data[property];
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
init(_data) {
|
|
1893
|
+
if (_data) {
|
|
1894
|
+
this.hq = _data["hq"];
|
|
1895
|
+
this.pricePerUnit = _data["pricePerUnit"];
|
|
1896
|
+
this.quantity = _data["quantity"];
|
|
1897
|
+
this.buyerName = _data["buyerName"];
|
|
1898
|
+
this.onMannequin = _data["onMannequin"];
|
|
1899
|
+
this.timestamp = _data["timestamp"];
|
|
1900
|
+
this.worldName = _data["worldName"];
|
|
1901
|
+
this.worldID = _data["worldID"];
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
static fromJS(data) {
|
|
1905
|
+
data = typeof data === 'object' ? data : {};
|
|
1906
|
+
let result = new MinimizedSaleView();
|
|
1907
|
+
result.init(data);
|
|
1908
|
+
return result;
|
|
1909
|
+
}
|
|
1910
|
+
toJSON(data) {
|
|
1911
|
+
data = typeof data === 'object' ? data : {};
|
|
1912
|
+
data["hq"] = this.hq;
|
|
1913
|
+
data["pricePerUnit"] = this.pricePerUnit;
|
|
1914
|
+
data["quantity"] = this.quantity;
|
|
1915
|
+
data["buyerName"] = this.buyerName;
|
|
1916
|
+
data["onMannequin"] = this.onMannequin;
|
|
1917
|
+
data["timestamp"] = this.timestamp;
|
|
1918
|
+
data["worldName"] = this.worldName;
|
|
1919
|
+
data["worldID"] = this.worldID;
|
|
1920
|
+
return data;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
exports.MinimizedSaleView = MinimizedSaleView;
|
|
1924
|
+
class SaleView {
|
|
1925
|
+
constructor(data) {
|
|
1926
|
+
if (data) {
|
|
1927
|
+
for (var property in data) {
|
|
1928
|
+
if (data.hasOwnProperty(property))
|
|
1929
|
+
this[property] = data[property];
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
init(_data) {
|
|
1934
|
+
if (_data) {
|
|
1935
|
+
this.hq = _data["hq"];
|
|
1936
|
+
this.pricePerUnit = _data["pricePerUnit"];
|
|
1937
|
+
this.quantity = _data["quantity"];
|
|
1938
|
+
this.timestamp = _data["timestamp"];
|
|
1939
|
+
this.onMannequin = _data["onMannequin"];
|
|
1940
|
+
this.worldName = _data["worldName"];
|
|
1941
|
+
this.worldID = _data["worldID"];
|
|
1942
|
+
this.buyerName = _data["buyerName"];
|
|
1943
|
+
this.total = _data["total"];
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
static fromJS(data) {
|
|
1947
|
+
data = typeof data === 'object' ? data : {};
|
|
1948
|
+
let result = new SaleView();
|
|
1949
|
+
result.init(data);
|
|
1950
|
+
return result;
|
|
1951
|
+
}
|
|
1952
|
+
toJSON(data) {
|
|
1953
|
+
data = typeof data === 'object' ? data : {};
|
|
1954
|
+
data["hq"] = this.hq;
|
|
1955
|
+
data["pricePerUnit"] = this.pricePerUnit;
|
|
1956
|
+
data["quantity"] = this.quantity;
|
|
1957
|
+
data["timestamp"] = this.timestamp;
|
|
1958
|
+
data["onMannequin"] = this.onMannequin;
|
|
1959
|
+
data["worldName"] = this.worldName;
|
|
1960
|
+
data["worldID"] = this.worldID;
|
|
1961
|
+
data["buyerName"] = this.buyerName;
|
|
1962
|
+
data["total"] = this.total;
|
|
1963
|
+
return data;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
exports.SaleView = SaleView;
|
|
1967
|
+
class TaxRatesView {
|
|
1968
|
+
constructor(data) {
|
|
1969
|
+
if (data) {
|
|
1970
|
+
for (var property in data) {
|
|
1971
|
+
if (data.hasOwnProperty(property))
|
|
1972
|
+
this[property] = data[property];
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
init(_data) {
|
|
1977
|
+
if (_data) {
|
|
1978
|
+
this.limsa_Lominsa = _data["Limsa Lominsa"];
|
|
1979
|
+
this.gridania = _data["Gridania"];
|
|
1980
|
+
this.uldah = _data["Ul'dah"];
|
|
1981
|
+
this.ishgard = _data["Ishgard"];
|
|
1982
|
+
this.kugane = _data["Kugane"];
|
|
1983
|
+
this.crystarium = _data["Crystarium"];
|
|
1984
|
+
this.old_Sharlayan = _data["Old Sharlayan"];
|
|
1985
|
+
this.tuliyollal = _data["Tuliyollal"];
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
static fromJS(data) {
|
|
1989
|
+
data = typeof data === 'object' ? data : {};
|
|
1990
|
+
let result = new TaxRatesView();
|
|
1991
|
+
result.init(data);
|
|
1992
|
+
return result;
|
|
1993
|
+
}
|
|
1994
|
+
toJSON(data) {
|
|
1995
|
+
data = typeof data === 'object' ? data : {};
|
|
1996
|
+
data["Limsa Lominsa"] = this.limsa_Lominsa;
|
|
1997
|
+
data["Gridania"] = this.gridania;
|
|
1998
|
+
data["Ul'dah"] = this.uldah;
|
|
1999
|
+
data["Ishgard"] = this.ishgard;
|
|
2000
|
+
data["Kugane"] = this.kugane;
|
|
2001
|
+
data["Crystarium"] = this.crystarium;
|
|
2002
|
+
data["Old Sharlayan"] = this.old_Sharlayan;
|
|
2003
|
+
data["Tuliyollal"] = this.tuliyollal;
|
|
2004
|
+
return data;
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
exports.TaxRatesView = TaxRatesView;
|
|
2008
|
+
class UserListView {
|
|
2009
|
+
constructor(data) {
|
|
2010
|
+
if (data) {
|
|
2011
|
+
for (var property in data) {
|
|
2012
|
+
if (data.hasOwnProperty(property))
|
|
2013
|
+
this[property] = data[property];
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
init(_data) {
|
|
2018
|
+
if (_data) {
|
|
2019
|
+
this.id = _data["id"];
|
|
2020
|
+
this.created = _data["created"];
|
|
2021
|
+
this.updated = _data["updated"];
|
|
2022
|
+
this.name = _data["name"];
|
|
2023
|
+
if (Array.isArray(_data["itemIDs"])) {
|
|
2024
|
+
this.itemIDs = [];
|
|
2025
|
+
for (let item of _data["itemIDs"])
|
|
2026
|
+
this.itemIDs.push(item);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
static fromJS(data) {
|
|
2031
|
+
data = typeof data === 'object' ? data : {};
|
|
2032
|
+
let result = new UserListView();
|
|
2033
|
+
result.init(data);
|
|
2034
|
+
return result;
|
|
2035
|
+
}
|
|
2036
|
+
toJSON(data) {
|
|
2037
|
+
data = typeof data === 'object' ? data : {};
|
|
2038
|
+
data["id"] = this.id;
|
|
2039
|
+
data["created"] = this.created;
|
|
2040
|
+
data["updated"] = this.updated;
|
|
2041
|
+
data["name"] = this.name;
|
|
2042
|
+
if (Array.isArray(this.itemIDs)) {
|
|
2043
|
+
data["itemIDs"] = [];
|
|
2044
|
+
for (let item of this.itemIDs)
|
|
2045
|
+
data["itemIDs"].push(item);
|
|
2046
|
+
}
|
|
2047
|
+
return data;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
exports.UserListView = UserListView;
|
|
2051
|
+
class DataCenter {
|
|
2052
|
+
constructor(data) {
|
|
2053
|
+
if (data) {
|
|
2054
|
+
for (var property in data) {
|
|
2055
|
+
if (data.hasOwnProperty(property))
|
|
2056
|
+
this[property] = data[property];
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
init(_data) {
|
|
2061
|
+
if (_data) {
|
|
2062
|
+
this.name = _data["name"];
|
|
2063
|
+
this.region = _data["region"];
|
|
2064
|
+
if (Array.isArray(_data["worlds"])) {
|
|
2065
|
+
this.worlds = [];
|
|
2066
|
+
for (let item of _data["worlds"])
|
|
2067
|
+
this.worlds.push(item);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
static fromJS(data) {
|
|
2072
|
+
data = typeof data === 'object' ? data : {};
|
|
2073
|
+
let result = new DataCenter();
|
|
2074
|
+
result.init(data);
|
|
2075
|
+
return result;
|
|
2076
|
+
}
|
|
2077
|
+
toJSON(data) {
|
|
2078
|
+
data = typeof data === 'object' ? data : {};
|
|
2079
|
+
data["name"] = this.name;
|
|
2080
|
+
data["region"] = this.region;
|
|
2081
|
+
if (Array.isArray(this.worlds)) {
|
|
2082
|
+
data["worlds"] = [];
|
|
2083
|
+
for (let item of this.worlds)
|
|
2084
|
+
data["worlds"].push(item);
|
|
2085
|
+
}
|
|
2086
|
+
return data;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
exports.DataCenter = DataCenter;
|
|
2090
|
+
class World {
|
|
2091
|
+
constructor(data) {
|
|
2092
|
+
if (data) {
|
|
2093
|
+
for (var property in data) {
|
|
2094
|
+
if (data.hasOwnProperty(property))
|
|
2095
|
+
this[property] = data[property];
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
init(_data) {
|
|
2100
|
+
if (_data) {
|
|
2101
|
+
this.id = _data["id"];
|
|
2102
|
+
this.name = _data["name"];
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
static fromJS(data) {
|
|
2106
|
+
data = typeof data === 'object' ? data : {};
|
|
2107
|
+
let result = new World();
|
|
2108
|
+
result.init(data);
|
|
2109
|
+
return result;
|
|
2110
|
+
}
|
|
2111
|
+
toJSON(data) {
|
|
2112
|
+
data = typeof data === 'object' ? data : {};
|
|
2113
|
+
data["id"] = this.id;
|
|
2114
|
+
data["name"] = this.name;
|
|
2115
|
+
return data;
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
exports.World = World;
|
|
2119
|
+
class SwaggerException extends Error {
|
|
2120
|
+
constructor(message, status, response, headers, result) {
|
|
2121
|
+
super();
|
|
2122
|
+
this.isSwaggerException = true;
|
|
2123
|
+
this.message = message;
|
|
2124
|
+
this.status = status;
|
|
2125
|
+
this.response = response;
|
|
2126
|
+
this.headers = headers;
|
|
2127
|
+
this.result = result;
|
|
2128
|
+
}
|
|
2129
|
+
static isSwaggerException(obj) {
|
|
2130
|
+
return obj.isSwaggerException === true;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
exports.SwaggerException = SwaggerException;
|
|
2134
|
+
function throwException(message, status, response, headers, result) {
|
|
2135
|
+
if (result !== null && result !== undefined)
|
|
2136
|
+
throw result;
|
|
2137
|
+
else
|
|
2138
|
+
throw new SwaggerException(message, status, response, headers, null);
|
|
2139
|
+
}
|
|
2140
|
+
//# sourceMappingURL=v1.js.map
|