@retroachievements/api 1.0.0-rc.0 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/__playground.d.ts +2 -1
  2. package/dist/achievement/getAchievementUnlocks.d.ts +2 -1
  3. package/dist/achievement/models/achievement-unlock-entity.model.d.ts +23 -0
  4. package/dist/achievement/models/get-achievement-unlocks-response.model.d.ts +23 -1
  5. package/dist/api.cjs.development.js +597 -853
  6. package/dist/api.cjs.development.js.map +1 -1
  7. package/dist/api.cjs.production.min.js +1 -1
  8. package/dist/api.cjs.production.min.js.map +1 -1
  9. package/dist/api.esm.js +597 -853
  10. package/dist/api.esm.js.map +1 -1
  11. package/dist/console/getGameList.d.ts +2 -1
  12. package/dist/console/models/game-list.model.d.ts +1 -1
  13. package/dist/console/models/get-console-ids-response.model.d.ts +1 -1
  14. package/dist/console/models/get-game-list-response.model.d.ts +1 -1
  15. package/dist/feed/getTicketData.d.ts +4 -3
  16. package/dist/feed/models/get-active-claims-response.model.d.ts +1 -1
  17. package/dist/feed/models/get-top-ten-users-response.model.d.ts +1 -1
  18. package/dist/feed/models/most-ticketed-games.model.d.ts +1 -2
  19. package/dist/feed/models/top-ten-users.model.d.ts +1 -1
  20. package/dist/game/getAchievementCount.d.ts +2 -1
  21. package/dist/game/getAchievementDistribution.d.ts +2 -1
  22. package/dist/game/getGame.d.ts +2 -1
  23. package/dist/game/getGameExtended.d.ts +2 -1
  24. package/dist/game/getGameRankAndScore.d.ts +2 -1
  25. package/dist/game/getGameRating.d.ts +2 -1
  26. package/dist/game/models/get-achievement-distribution-response.model.d.ts +1 -1
  27. package/dist/game/models/get-game-rank-and-score-response.model.d.ts +1 -1
  28. package/dist/user/getAchievementsEarnedBetween.d.ts +19 -19
  29. package/dist/user/getGameInfoAndUserProgress.d.ts +2 -1
  30. package/dist/user/getUserClaims.d.ts +1 -1
  31. package/dist/user/getUserCompletedGames.d.ts +1 -1
  32. package/dist/user/getUserGameRankAndScore.d.ts +2 -1
  33. package/dist/user/getUserPoints.d.ts +1 -1
  34. package/dist/user/getUserProgress.d.ts +5 -4
  35. package/dist/user/models/dated-user-achievement.model.d.ts +1 -1
  36. package/dist/user/models/dated-user-achievements-response.model.d.ts +1 -1
  37. package/dist/user/models/game-info-and-user-progress.model.d.ts +1 -1
  38. package/dist/user/models/get-game-info-and-user-progress-response.model.d.ts +2 -2
  39. package/dist/user/models/get-user-completed-games-response.model.d.ts +1 -1
  40. package/dist/user/models/get-user-game-rank-and-score-response.model.d.ts +1 -1
  41. package/dist/user/models/get-user-progress-response.model.d.ts +1 -1
  42. package/dist/user/models/get-user-recently-played-games-response.model.d.ts +2 -1
  43. package/dist/user/models/user-claims-response.model.d.ts +1 -1
  44. package/dist/user/models/user-claims.model.d.ts +1 -1
  45. package/dist/user/models/user-completed-games.model.d.ts +2 -3
  46. package/dist/user/models/user-game-rank-and-score.model.d.ts +2 -3
  47. package/dist/user/models/user-progress.model.d.ts +2 -3
  48. package/dist/user/models/user-recently-played-games.model.d.ts +3 -3
  49. package/dist/user/models/user-summary.model.d.ts +5 -6
  50. package/dist/utils/internal/id.model.d.ts +1 -0
  51. package/dist/utils/internal/index.d.ts +1 -0
  52. package/package.json +32 -27
  53. package/src/__playground.ts +25 -12
  54. package/src/achievement/getAchievementUnlocks.test.ts +48 -16
  55. package/src/achievement/getAchievementUnlocks.ts +4 -3
  56. package/src/achievement/models/achievement-unlock-entity.model.ts +19 -0
  57. package/src/achievement/models/get-achievement-unlocks-response.model.ts +17 -1
  58. package/src/console/getGameList.ts +2 -2
  59. package/src/feed/getTicketData.ts +4 -3
  60. package/src/feed/models/most-ticketed-games.model.ts +1 -1
  61. package/src/game/getAchievementCount.ts +2 -1
  62. package/src/game/getAchievementDistribution.test.ts +2 -4
  63. package/src/game/getAchievementDistribution.ts +2 -1
  64. package/src/game/getGame.ts +2 -1
  65. package/src/game/getGameExtended.ts +2 -1
  66. package/src/game/getGameRankAndScore.ts +2 -1
  67. package/src/game/getGameRating.ts +2 -1
  68. package/src/user/getAchievementsEarnedBetween.ts +19 -19
  69. package/src/user/getGameInfoAndUserProgress.ts +2 -1
  70. package/src/user/getUserClaims.ts +1 -1
  71. package/src/user/getUserCompletedGames.ts +1 -1
  72. package/src/user/getUserGameRankAndScore.ts +2 -1
  73. package/src/user/getUserPoints.ts +1 -1
  74. package/src/user/getUserProgress.ts +5 -4
  75. package/src/user/getUserRecentlyPlayedGames.test.ts +4 -2
  76. package/src/user/getUserRecentlyPlayedGames.ts +2 -1
  77. package/src/user/models/get-user-recently-played-games-response.model.ts +1 -0
  78. package/src/user/models/user-completed-games.model.ts +1 -1
  79. package/src/user/models/user-game-rank-and-score.model.ts +1 -1
  80. package/src/user/models/user-progress.model.ts +1 -1
  81. package/src/user/models/user-recently-played-games.model.ts +2 -1
  82. package/src/user/models/user-summary.model.ts +5 -5
  83. package/src/utils/internal/id.model.ts +1 -0
  84. package/src/utils/internal/index.ts +1 -0
  85. package/src/utils/internal/serializeProperties.ts +1 -1
package/dist/api.esm.js CHANGED
@@ -1,20 +1,19 @@
1
1
  import unfetch from 'isomorphic-unfetch';
2
2
 
3
3
  function _regeneratorRuntime() {
4
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
5
-
6
4
  _regeneratorRuntime = function () {
7
5
  return exports;
8
6
  };
9
-
10
7
  var exports = {},
11
- Op = Object.prototype,
12
- hasOwn = Op.hasOwnProperty,
13
- $Symbol = "function" == typeof Symbol ? Symbol : {},
14
- iteratorSymbol = $Symbol.iterator || "@@iterator",
15
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
16
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
17
-
8
+ Op = Object.prototype,
9
+ hasOwn = Op.hasOwnProperty,
10
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
11
+ obj[key] = desc.value;
12
+ },
13
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
14
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
15
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
16
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
18
17
  function define(obj, key, value) {
19
18
  return Object.defineProperty(obj, key, {
20
19
  value: value,
@@ -23,7 +22,6 @@ function _regeneratorRuntime() {
23
22
  writable: !0
24
23
  }), obj[key];
25
24
  }
26
-
27
25
  try {
28
26
  define({}, "");
29
27
  } catch (err) {
@@ -31,54 +29,14 @@ function _regeneratorRuntime() {
31
29
  return obj[key] = value;
32
30
  };
33
31
  }
34
-
35
32
  function wrap(innerFn, outerFn, self, tryLocsList) {
36
33
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
37
- generator = Object.create(protoGenerator.prototype),
38
- context = new Context(tryLocsList || []);
39
- return generator._invoke = function (innerFn, self, context) {
40
- var state = "suspendedStart";
41
- return function (method, arg) {
42
- if ("executing" === state) throw new Error("Generator is already running");
43
-
44
- if ("completed" === state) {
45
- if ("throw" === method) throw arg;
46
- return doneResult();
47
- }
48
-
49
- for (context.method = method, context.arg = arg;;) {
50
- var delegate = context.delegate;
51
-
52
- if (delegate) {
53
- var delegateResult = maybeInvokeDelegate(delegate, context);
54
-
55
- if (delegateResult) {
56
- if (delegateResult === ContinueSentinel) continue;
57
- return delegateResult;
58
- }
59
- }
60
-
61
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
62
- if ("suspendedStart" === state) throw state = "completed", context.arg;
63
- context.dispatchException(context.arg);
64
- } else "return" === context.method && context.abrupt("return", context.arg);
65
- state = "executing";
66
- var record = tryCatch(innerFn, self, context);
67
-
68
- if ("normal" === record.type) {
69
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
70
- return {
71
- value: record.arg,
72
- done: context.done
73
- };
74
- }
75
-
76
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
77
- }
78
- };
79
- }(innerFn, self, context), generator;
34
+ generator = Object.create(protoGenerator.prototype),
35
+ context = new Context(tryLocsList || []);
36
+ return defineProperty(generator, "_invoke", {
37
+ value: makeInvokeMethod(innerFn, self, context)
38
+ }), generator;
80
39
  }
81
-
82
40
  function tryCatch(fn, obj, arg) {
83
41
  try {
84
42
  return {
@@ -92,25 +50,19 @@ function _regeneratorRuntime() {
92
50
  };
93
51
  }
94
52
  }
95
-
96
53
  exports.wrap = wrap;
97
54
  var ContinueSentinel = {};
98
-
99
55
  function Generator() {}
100
-
101
56
  function GeneratorFunction() {}
102
-
103
57
  function GeneratorFunctionPrototype() {}
104
-
105
58
  var IteratorPrototype = {};
106
59
  define(IteratorPrototype, iteratorSymbol, function () {
107
60
  return this;
108
61
  });
109
62
  var getProto = Object.getPrototypeOf,
110
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
63
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
111
64
  NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
112
65
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
113
-
114
66
  function defineIteratorMethods(prototype) {
115
67
  ["next", "throw", "return"].forEach(function (method) {
116
68
  define(prototype, method, function (arg) {
@@ -118,14 +70,12 @@ function _regeneratorRuntime() {
118
70
  });
119
71
  });
120
72
  }
121
-
122
73
  function AsyncIterator(generator, PromiseImpl) {
123
74
  function invoke(method, arg, resolve, reject) {
124
75
  var record = tryCatch(generator[method], generator, arg);
125
-
126
76
  if ("throw" !== record.type) {
127
77
  var result = record.arg,
128
- value = result.value;
78
+ value = result.value;
129
79
  return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
130
80
  invoke("next", value, resolve, reject);
131
81
  }, function (err) {
@@ -136,90 +86,109 @@ function _regeneratorRuntime() {
136
86
  return invoke("throw", error, resolve, reject);
137
87
  });
138
88
  }
139
-
140
89
  reject(record.arg);
141
90
  }
142
-
143
91
  var previousPromise;
144
-
145
- this._invoke = function (method, arg) {
146
- function callInvokeWithMethodAndArg() {
147
- return new PromiseImpl(function (resolve, reject) {
148
- invoke(method, arg, resolve, reject);
149
- });
92
+ defineProperty(this, "_invoke", {
93
+ value: function (method, arg) {
94
+ function callInvokeWithMethodAndArg() {
95
+ return new PromiseImpl(function (resolve, reject) {
96
+ invoke(method, arg, resolve, reject);
97
+ });
98
+ }
99
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
100
+ }
101
+ });
102
+ }
103
+ function makeInvokeMethod(innerFn, self, context) {
104
+ var state = "suspendedStart";
105
+ return function (method, arg) {
106
+ if ("executing" === state) throw new Error("Generator is already running");
107
+ if ("completed" === state) {
108
+ if ("throw" === method) throw arg;
109
+ return doneResult();
110
+ }
111
+ for (context.method = method, context.arg = arg;;) {
112
+ var delegate = context.delegate;
113
+ if (delegate) {
114
+ var delegateResult = maybeInvokeDelegate(delegate, context);
115
+ if (delegateResult) {
116
+ if (delegateResult === ContinueSentinel) continue;
117
+ return delegateResult;
118
+ }
119
+ }
120
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
121
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
122
+ context.dispatchException(context.arg);
123
+ } else "return" === context.method && context.abrupt("return", context.arg);
124
+ state = "executing";
125
+ var record = tryCatch(innerFn, self, context);
126
+ if ("normal" === record.type) {
127
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
128
+ return {
129
+ value: record.arg,
130
+ done: context.done
131
+ };
132
+ }
133
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
150
134
  }
151
-
152
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
153
135
  };
154
136
  }
155
-
156
137
  function maybeInvokeDelegate(delegate, context) {
157
- var method = delegate.iterator[context.method];
158
-
159
- if (undefined === method) {
160
- if (context.delegate = null, "throw" === context.method) {
161
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
162
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
163
- }
164
-
165
- return ContinueSentinel;
166
- }
167
-
138
+ var methodName = context.method,
139
+ method = delegate.iterator[methodName];
140
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
168
141
  var record = tryCatch(method, delegate.iterator, context.arg);
169
142
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
170
143
  var info = record.arg;
171
144
  return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
172
145
  }
173
-
174
146
  function pushTryEntry(locs) {
175
147
  var entry = {
176
148
  tryLoc: locs[0]
177
149
  };
178
150
  1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
179
151
  }
180
-
181
152
  function resetTryEntry(entry) {
182
153
  var record = entry.completion || {};
183
154
  record.type = "normal", delete record.arg, entry.completion = record;
184
155
  }
185
-
186
156
  function Context(tryLocsList) {
187
157
  this.tryEntries = [{
188
158
  tryLoc: "root"
189
159
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
190
160
  }
191
-
192
161
  function values(iterable) {
193
162
  if (iterable) {
194
163
  var iteratorMethod = iterable[iteratorSymbol];
195
164
  if (iteratorMethod) return iteratorMethod.call(iterable);
196
165
  if ("function" == typeof iterable.next) return iterable;
197
-
198
166
  if (!isNaN(iterable.length)) {
199
167
  var i = -1,
200
- next = function next() {
201
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
202
-
203
- return next.value = undefined, next.done = !0, next;
204
- };
205
-
168
+ next = function next() {
169
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
170
+ return next.value = undefined, next.done = !0, next;
171
+ };
206
172
  return next.next = next;
207
173
  }
208
174
  }
209
-
210
175
  return {
211
176
  next: doneResult
212
177
  };
213
178
  }
214
-
215
179
  function doneResult() {
216
180
  return {
217
181
  value: undefined,
218
182
  done: !0
219
183
  };
220
184
  }
221
-
222
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
185
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
186
+ value: GeneratorFunctionPrototype,
187
+ configurable: !0
188
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
189
+ value: GeneratorFunction,
190
+ configurable: !0
191
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
223
192
  var ctor = "function" == typeof genFun && genFun.constructor;
224
193
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
225
194
  }, exports.mark = function (genFun) {
@@ -240,17 +209,15 @@ function _regeneratorRuntime() {
240
209
  return this;
241
210
  }), define(Gp, "toString", function () {
242
211
  return "[object Generator]";
243
- }), exports.keys = function (object) {
244
- var keys = [];
245
-
212
+ }), exports.keys = function (val) {
213
+ var object = Object(val),
214
+ keys = [];
246
215
  for (var key in object) keys.push(key);
247
-
248
216
  return keys.reverse(), function next() {
249
217
  for (; keys.length;) {
250
218
  var key = keys.pop();
251
219
  if (key in object) return next.value = key, next.done = !1, next;
252
220
  }
253
-
254
221
  return next.done = !0, next;
255
222
  };
256
223
  }, exports.values = values, Context.prototype = {
@@ -267,20 +234,16 @@ function _regeneratorRuntime() {
267
234
  dispatchException: function (exception) {
268
235
  if (this.done) throw exception;
269
236
  var context = this;
270
-
271
237
  function handle(loc, caught) {
272
238
  return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
273
239
  }
274
-
275
240
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
276
241
  var entry = this.tryEntries[i],
277
- record = entry.completion;
242
+ record = entry.completion;
278
243
  if ("root" === entry.tryLoc) return handle("end");
279
-
280
244
  if (entry.tryLoc <= this.prev) {
281
245
  var hasCatch = hasOwn.call(entry, "catchLoc"),
282
- hasFinally = hasOwn.call(entry, "finallyLoc");
283
-
246
+ hasFinally = hasOwn.call(entry, "finallyLoc");
284
247
  if (hasCatch && hasFinally) {
285
248
  if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
286
249
  if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
@@ -296,13 +259,11 @@ function _regeneratorRuntime() {
296
259
  abrupt: function (type, arg) {
297
260
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
298
261
  var entry = this.tryEntries[i];
299
-
300
262
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
301
263
  var finallyEntry = entry;
302
264
  break;
303
265
  }
304
266
  }
305
-
306
267
  finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
307
268
  var record = finallyEntry ? finallyEntry.completion : {};
308
269
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
@@ -320,19 +281,15 @@ function _regeneratorRuntime() {
320
281
  catch: function (tryLoc) {
321
282
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
322
283
  var entry = this.tryEntries[i];
323
-
324
284
  if (entry.tryLoc === tryLoc) {
325
285
  var record = entry.completion;
326
-
327
286
  if ("throw" === record.type) {
328
287
  var thrown = record.arg;
329
288
  resetTryEntry(entry);
330
289
  }
331
-
332
290
  return thrown;
333
291
  }
334
292
  }
335
-
336
293
  throw new Error("illegal catch attempt");
337
294
  },
338
295
  delegateYield: function (iterable, resultName, nextLoc) {
@@ -344,7 +301,6 @@ function _regeneratorRuntime() {
344
301
  }
345
302
  }, exports;
346
303
  }
347
-
348
304
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
349
305
  try {
350
306
  var info = gen[key](arg);
@@ -353,51 +309,42 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
353
309
  reject(error);
354
310
  return;
355
311
  }
356
-
357
312
  if (info.done) {
358
313
  resolve(value);
359
314
  } else {
360
315
  Promise.resolve(value).then(_next, _throw);
361
316
  }
362
317
  }
363
-
364
318
  function _asyncToGenerator(fn) {
365
319
  return function () {
366
320
  var self = this,
367
- args = arguments;
321
+ args = arguments;
368
322
  return new Promise(function (resolve, reject) {
369
323
  var gen = fn.apply(self, args);
370
-
371
324
  function _next(value) {
372
325
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
373
326
  }
374
-
375
327
  function _throw(err) {
376
328
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
377
329
  }
378
-
379
330
  _next(undefined);
380
331
  });
381
332
  };
382
333
  }
383
-
384
334
  function _extends() {
385
335
  _extends = Object.assign ? Object.assign.bind() : function (target) {
386
336
  for (var i = 1; i < arguments.length; i++) {
387
337
  var source = arguments[i];
388
-
389
338
  for (var key in source) {
390
339
  if (Object.prototype.hasOwnProperty.call(source, key)) {
391
340
  target[key] = source[key];
392
341
  }
393
342
  }
394
343
  }
395
-
396
344
  return target;
397
345
  };
398
346
  return _extends.apply(this, arguments);
399
347
  }
400
-
401
348
  function _unsupportedIterableToArray(o, minLen) {
402
349
  if (!o) return;
403
350
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -406,19 +353,14 @@ function _unsupportedIterableToArray(o, minLen) {
406
353
  if (n === "Map" || n === "Set") return Array.from(o);
407
354
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
408
355
  }
409
-
410
356
  function _arrayLikeToArray(arr, len) {
411
357
  if (len == null || len > arr.length) len = arr.length;
412
-
413
358
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
414
-
415
359
  return arr2;
416
360
  }
417
-
418
361
  function _createForOfIteratorHelperLoose(o, allowArrayLike) {
419
362
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
420
363
  if (it) return (it = it.call(o)).next.bind(it);
421
-
422
364
  if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
423
365
  if (it) o = it;
424
366
  var i = 0;
@@ -432,7 +374,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
432
374
  };
433
375
  };
434
376
  }
435
-
436
377
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
437
378
  }
438
379
 
@@ -442,22 +383,19 @@ var buildRequestUrl = function buildRequestUrl(baseUrl, endpointUrl, authObject,
442
383
  if (args === void 0) {
443
384
  args = {};
444
385
  }
445
-
446
386
  var concatenated = baseUrl + "/" + endpointUrl;
447
387
  var withoutDoubleSlashes = concatenated.replace(/([^:]\/)\/+/g, "$1");
448
- var withArgs = withoutDoubleSlashes; // `z` and `y` are expected query params from the RA API.
388
+ var withArgs = withoutDoubleSlashes;
389
+ // `z` and `y` are expected query params from the RA API.
449
390
  // Authentication is handled purely by query params.
450
-
451
391
  var queryParamValues = {
452
392
  z: authObject.userName,
453
393
  y: authObject.webApiKey
454
394
  };
455
-
456
395
  for (var _i = 0, _Object$entries = Object.entries(args); _i < _Object$entries.length; _i++) {
457
396
  var _Object$entries$_i = _Object$entries[_i],
458
- argKey = _Object$entries$_i[0],
459
- argValue = _Object$entries$_i[1];
460
-
397
+ argKey = _Object$entries$_i[0],
398
+ argValue = _Object$entries$_i[1];
461
399
  // "abc.com/some-route/:foo/some-path" & {"foo": 4} --> "abc.com/some-route/4/some-path"
462
400
  if (withArgs.includes(":" + argKey)) {
463
401
  withArgs = withArgs.replace(":" + argKey, String(argValue));
@@ -465,7 +403,6 @@ var buildRequestUrl = function buildRequestUrl(baseUrl, endpointUrl, authObject,
465
403
  queryParamValues[argKey] = String(argValue);
466
404
  }
467
405
  }
468
-
469
406
  var queryString = new URLSearchParams(queryParamValues).toString();
470
407
  return withArgs + "?" + queryString;
471
408
  };
@@ -487,76 +424,60 @@ var buildRequestUrl = function buildRequestUrl(baseUrl, endpointUrl, authObject,
487
424
  * isomorphic-unfetch dependency. At that point we will have
488
425
  * two major LTS versions that include a native fetch API.
489
426
  */
490
-
491
427
  var call = /*#__PURE__*/function () {
492
428
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config) {
493
429
  var url, rawResponse;
494
430
  return _regeneratorRuntime().wrap(function _callee$(_context) {
495
- while (1) {
496
- switch (_context.prev = _context.next) {
497
- case 0:
498
- url = config.url;
499
- _context.next = 3;
500
- return unfetch(url);
501
-
502
- case 3:
503
- rawResponse = _context.sent;
504
- _context.next = 6;
505
- return rawResponse.json();
506
-
507
- case 6:
508
- return _context.abrupt("return", _context.sent);
509
-
510
- case 7:
511
- case "end":
512
- return _context.stop();
513
- }
431
+ while (1) switch (_context.prev = _context.next) {
432
+ case 0:
433
+ url = config.url;
434
+ _context.next = 3;
435
+ return unfetch(url);
436
+ case 3:
437
+ rawResponse = _context.sent;
438
+ _context.next = 6;
439
+ return rawResponse.json();
440
+ case 6:
441
+ return _context.abrupt("return", _context.sent);
442
+ case 7:
443
+ case "end":
444
+ return _context.stop();
514
445
  }
515
446
  }, _callee);
516
447
  }));
517
-
518
448
  return function call(_x) {
519
449
  return _ref.apply(this, arguments);
520
450
  };
521
451
  }();
522
452
 
523
453
  /* eslint-disable sonarjs/cognitive-complexity */
524
-
525
454
  /* eslint-disable sonarjs/prefer-immediate-return */
526
455
  var serializeProperties = function serializeProperties(originalData, options) {
527
456
  if (options === void 0) {
528
457
  options = {};
529
458
  }
530
-
531
459
  var _options = options,
532
- shouldCastToNumbers = _options.shouldCastToNumbers,
533
- shouldMapToBooleans = _options.shouldMapToBooleans;
460
+ shouldCastToNumbers = _options.shouldCastToNumbers,
461
+ shouldMapToBooleans = _options.shouldMapToBooleans;
534
462
  var returnValue = originalData;
535
-
536
463
  if (Array.isArray(originalData)) {
537
464
  var cleanedArray = [];
538
-
539
465
  for (var _iterator = _createForOfIteratorHelperLoose(originalData), _step; !(_step = _iterator()).done;) {
540
466
  var entity = _step.value;
541
467
  cleanedArray.push(serializeProperties(entity, options));
542
468
  }
543
-
544
469
  returnValue = cleanedArray;
545
470
  } else if (!Array.isArray(originalData) && originalData instanceof Object) {
546
471
  var cleanedObject = {};
547
-
548
472
  for (var _i = 0, _Object$entries = Object.entries(originalData); _i < _Object$entries.length; _i++) {
549
473
  var _extends2;
550
-
551
474
  var _Object$entries$_i = _Object$entries[_i],
552
- originalKey = _Object$entries$_i[0],
553
- originalValue = _Object$entries$_i[1];
475
+ originalKey = _Object$entries$_i[0],
476
+ originalValue = _Object$entries$_i[1];
554
477
  var sanitizedValue = originalValue;
555
-
556
478
  if (shouldCastToNumbers != null && shouldCastToNumbers.includes(originalKey)) {
557
- sanitizedValue = Number(originalValue);
479
+ sanitizedValue = originalValue === null ? null : Number(originalValue);
558
480
  }
559
-
560
481
  if (shouldMapToBooleans != null && shouldMapToBooleans.includes(originalKey)) {
561
482
  if (originalValue === null) {
562
483
  sanitizedValue = null;
@@ -564,29 +485,24 @@ var serializeProperties = function serializeProperties(originalData, options) {
564
485
  sanitizedValue = originalValue === "1" ? true : false;
565
486
  }
566
487
  }
567
-
568
488
  cleanedObject = _extends({}, cleanedObject, (_extends2 = {}, _extends2[naiveCamelCase(originalKey)] = serializeProperties(sanitizedValue, options), _extends2));
569
489
  }
570
-
571
490
  returnValue = cleanedObject;
572
491
  }
573
-
574
492
  return returnValue;
575
493
  };
576
-
577
494
  var naiveCamelCase = function naiveCamelCase(originalValue) {
578
495
  // "ID" --> "id", "URL" --> "url"
579
496
  if (originalValue.toUpperCase() === originalValue) {
580
497
  return originalValue.toLowerCase();
581
- } // "GameID" -> "gameID"
582
-
583
-
584
- var camelCased = originalValue.charAt(0).toLowerCase() + originalValue.slice(1); // "gameID" -> "gameId"
585
-
586
- camelCased = camelCased.replace(/ID/g, "Id"); // "badgeURL" --> "badgeUrl"
587
-
588
- camelCased = camelCased.replace(/URL/g, "Url"); // "rAPoints" -> "raPoints"
589
-
498
+ }
499
+ // "GameID" -> "gameID"
500
+ var camelCased = originalValue.charAt(0).toLowerCase() + originalValue.slice(1);
501
+ // "gameID" -> "gameId"
502
+ camelCased = camelCased.replace(/ID/g, "Id");
503
+ // "badgeURL" --> "badgeUrl"
504
+ camelCased = camelCased.replace(/URL/g, "Url");
505
+ // "rAPoints" -> "raPoints"
590
506
  camelCased = camelCased.replace(/rA/g, "ra");
591
507
  return camelCased;
592
508
  };
@@ -629,48 +545,39 @@ var naiveCamelCase = function naiveCamelCase(originalValue) {
629
545
  * ]
630
546
  * ```
631
547
  */
632
-
633
548
  var getAchievementUnlocks = /*#__PURE__*/function () {
634
549
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
635
550
  var achievementId, offset, count, queryParams, url, rawResponse;
636
551
  return _regeneratorRuntime().wrap(function _callee$(_context) {
637
- while (1) {
638
- switch (_context.prev = _context.next) {
639
- case 0:
640
- achievementId = payload.achievementId, offset = payload.offset, count = payload.count;
641
- queryParams = {
642
- a: achievementId
643
- };
644
-
645
- if (offset) {
646
- queryParams.o = offset;
647
- }
648
-
649
- if (count) {
650
- queryParams.c = count;
651
- }
652
-
653
- url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementUnlocks.php", authorization, queryParams);
654
- _context.next = 7;
655
- return call({
656
- url: url
657
- });
658
-
659
- case 7:
660
- rawResponse = _context.sent;
661
- return _context.abrupt("return", serializeProperties(rawResponse, {
662
- shouldCastToNumbers: ["RAPoints"],
663
- shouldMapToBooleans: ["HardcoreMode"]
664
- }));
665
-
666
- case 9:
667
- case "end":
668
- return _context.stop();
669
- }
552
+ while (1) switch (_context.prev = _context.next) {
553
+ case 0:
554
+ achievementId = payload.achievementId, offset = payload.offset, count = payload.count;
555
+ queryParams = {
556
+ a: achievementId
557
+ };
558
+ if (offset) {
559
+ queryParams.o = offset;
560
+ }
561
+ if (count) {
562
+ queryParams.c = count;
563
+ }
564
+ url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementUnlocks.php", authorization, queryParams);
565
+ _context.next = 7;
566
+ return call({
567
+ url: url
568
+ });
569
+ case 7:
570
+ rawResponse = _context.sent;
571
+ return _context.abrupt("return", serializeProperties(rawResponse, {
572
+ shouldCastToNumbers: ["ID", "Points", "TrueRatio", "RAPoints"],
573
+ shouldMapToBooleans: ["HardcoreMode"]
574
+ }));
575
+ case 9:
576
+ case "end":
577
+ return _context.stop();
670
578
  }
671
579
  }, _callee);
672
580
  }));
673
-
674
581
  return function getAchievementUnlocks(_x, _x2) {
675
582
  return _ref.apply(this, arguments);
676
583
  };
@@ -695,34 +602,28 @@ var getAchievementUnlocks = /*#__PURE__*/function () {
695
602
  * { id: "1", name: "Mega Drive" }
696
603
  * ```
697
604
  */
698
-
699
605
  var getConsoleIds = /*#__PURE__*/function () {
700
606
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
701
607
  var url, rawResponse;
702
608
  return _regeneratorRuntime().wrap(function _callee$(_context) {
703
- while (1) {
704
- switch (_context.prev = _context.next) {
705
- case 0:
706
- url = buildRequestUrl(apiBaseUrl, "/API_GetConsoleIDs.php", authorization);
707
- _context.next = 3;
708
- return call({
709
- url: url
710
- });
711
-
712
- case 3:
713
- rawResponse = _context.sent;
714
- return _context.abrupt("return", serializeProperties(rawResponse, {
715
- shouldCastToNumbers: ["ID"]
716
- }));
717
-
718
- case 5:
719
- case "end":
720
- return _context.stop();
721
- }
609
+ while (1) switch (_context.prev = _context.next) {
610
+ case 0:
611
+ url = buildRequestUrl(apiBaseUrl, "/API_GetConsoleIDs.php", authorization);
612
+ _context.next = 3;
613
+ return call({
614
+ url: url
615
+ });
616
+ case 3:
617
+ rawResponse = _context.sent;
618
+ return _context.abrupt("return", serializeProperties(rawResponse, {
619
+ shouldCastToNumbers: ["ID"]
620
+ }));
621
+ case 5:
622
+ case "end":
623
+ return _context.stop();
722
624
  }
723
625
  }, _callee);
724
626
  }));
725
-
726
627
  return function getConsoleIds(_x) {
727
628
  return _ref.apply(this, arguments);
728
629
  };
@@ -773,51 +674,42 @@ var getConsoleIds = /*#__PURE__*/function () {
773
674
  * ]
774
675
  * ```
775
676
  */
776
-
777
677
  var getGameList = /*#__PURE__*/function () {
778
678
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
779
679
  var consoleId, shouldOnlyRetrieveGamesWithAchievements, shouldRetrieveGameHashes, callPayload, url, rawResponse;
780
680
  return _regeneratorRuntime().wrap(function _callee$(_context) {
781
- while (1) {
782
- switch (_context.prev = _context.next) {
783
- case 0:
784
- consoleId = payload.consoleId, shouldOnlyRetrieveGamesWithAchievements = payload.shouldOnlyRetrieveGamesWithAchievements, shouldRetrieveGameHashes = payload.shouldRetrieveGameHashes;
785
- callPayload = {
786
- i: consoleId
787
- };
788
-
789
- if (shouldOnlyRetrieveGamesWithAchievements !== undefined) {
790
- callPayload = _extends({}, callPayload, {
791
- f: shouldOnlyRetrieveGamesWithAchievements ? 1 : 0
792
- });
793
- }
794
-
795
- if (shouldRetrieveGameHashes) {
796
- callPayload = _extends({}, callPayload, {
797
- h: shouldRetrieveGameHashes ? 1 : 0
798
- });
799
- }
800
-
801
- url = buildRequestUrl(apiBaseUrl, "/API_GetGameList.php", authorization, callPayload);
802
- _context.next = 7;
803
- return call({
804
- url: url
681
+ while (1) switch (_context.prev = _context.next) {
682
+ case 0:
683
+ consoleId = payload.consoleId, shouldOnlyRetrieveGamesWithAchievements = payload.shouldOnlyRetrieveGamesWithAchievements, shouldRetrieveGameHashes = payload.shouldRetrieveGameHashes;
684
+ callPayload = {
685
+ i: consoleId
686
+ };
687
+ if (shouldOnlyRetrieveGamesWithAchievements !== undefined) {
688
+ callPayload = _extends({}, callPayload, {
689
+ f: shouldOnlyRetrieveGamesWithAchievements ? 1 : 0
805
690
  });
806
-
807
- case 7:
808
- rawResponse = _context.sent;
809
- return _context.abrupt("return", serializeProperties(rawResponse, {
810
- shouldCastToNumbers: ["ID", "ConsoleID"]
811
- }));
812
-
813
- case 9:
814
- case "end":
815
- return _context.stop();
816
- }
691
+ }
692
+ if (shouldRetrieveGameHashes) {
693
+ callPayload = _extends({}, callPayload, {
694
+ h: shouldRetrieveGameHashes ? 1 : 0
695
+ });
696
+ }
697
+ url = buildRequestUrl(apiBaseUrl, "/API_GetGameList.php", authorization, callPayload);
698
+ _context.next = 7;
699
+ return call({
700
+ url: url
701
+ });
702
+ case 7:
703
+ rawResponse = _context.sent;
704
+ return _context.abrupt("return", serializeProperties(rawResponse, {
705
+ shouldCastToNumbers: ["ID", "ConsoleID"]
706
+ }));
707
+ case 9:
708
+ case "end":
709
+ return _context.stop();
817
710
  }
818
711
  }, _callee);
819
712
  }));
820
-
821
713
  return function getGameList(_x, _x2) {
822
714
  return _ref.apply(this, arguments);
823
715
  };
@@ -868,35 +760,29 @@ var getGameList = /*#__PURE__*/function () {
868
760
  * }
869
761
  * ```
870
762
  */
871
-
872
763
  var getAchievementOfTheWeek = /*#__PURE__*/function () {
873
764
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
874
765
  var url, rawResponse;
875
766
  return _regeneratorRuntime().wrap(function _callee$(_context) {
876
- while (1) {
877
- switch (_context.prev = _context.next) {
878
- case 0:
879
- url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementOfTheWeek.php", authorization);
880
- _context.next = 3;
881
- return call({
882
- url: url
883
- });
884
-
885
- case 3:
886
- rawResponse = _context.sent;
887
- return _context.abrupt("return", serializeProperties(rawResponse, {
888
- shouldCastToNumbers: ["ID", "Points", "TrueRatio", "TotalPlayers", "RAPoints", "UnlocksCount"],
889
- shouldMapToBooleans: ["HardcoreMode"]
890
- }));
891
-
892
- case 5:
893
- case "end":
894
- return _context.stop();
895
- }
767
+ while (1) switch (_context.prev = _context.next) {
768
+ case 0:
769
+ url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementOfTheWeek.php", authorization);
770
+ _context.next = 3;
771
+ return call({
772
+ url: url
773
+ });
774
+ case 3:
775
+ rawResponse = _context.sent;
776
+ return _context.abrupt("return", serializeProperties(rawResponse, {
777
+ shouldCastToNumbers: ["ID", "Points", "TrueRatio", "TotalPlayers", "RAPoints", "UnlocksCount"],
778
+ shouldMapToBooleans: ["HardcoreMode"]
779
+ }));
780
+ case 5:
781
+ case "end":
782
+ return _context.stop();
896
783
  }
897
784
  }, _callee);
898
785
  }));
899
-
900
786
  return function getAchievementOfTheWeek(_x) {
901
787
  return _ref.apply(this, arguments);
902
788
  };
@@ -937,34 +823,28 @@ var getAchievementOfTheWeek = /*#__PURE__*/function () {
937
823
  * ]
938
824
  * ```
939
825
  */
940
-
941
826
  var getActiveClaims = /*#__PURE__*/function () {
942
827
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
943
828
  var url, rawResponse;
944
829
  return _regeneratorRuntime().wrap(function _callee$(_context) {
945
- while (1) {
946
- switch (_context.prev = _context.next) {
947
- case 0:
948
- url = buildRequestUrl(apiBaseUrl, "/API_GetActiveClaims.php", authorization);
949
- _context.next = 3;
950
- return call({
951
- url: url
952
- });
953
-
954
- case 3:
955
- rawResponse = _context.sent;
956
- return _context.abrupt("return", serializeProperties(rawResponse, {
957
- shouldCastToNumbers: ["ID", "GameID", "ClaimType", "SetType", "Status", "Extension", "Special", "MinutesLeft"]
958
- }));
959
-
960
- case 5:
961
- case "end":
962
- return _context.stop();
963
- }
830
+ while (1) switch (_context.prev = _context.next) {
831
+ case 0:
832
+ url = buildRequestUrl(apiBaseUrl, "/API_GetActiveClaims.php", authorization);
833
+ _context.next = 3;
834
+ return call({
835
+ url: url
836
+ });
837
+ case 3:
838
+ rawResponse = _context.sent;
839
+ return _context.abrupt("return", serializeProperties(rawResponse, {
840
+ shouldCastToNumbers: ["ID", "GameID", "ClaimType", "SetType", "Status", "Extension", "Special", "MinutesLeft"]
841
+ }));
842
+ case 5:
843
+ case "end":
844
+ return _context.stop();
964
845
  }
965
846
  }, _callee);
966
847
  }));
967
-
968
848
  return function getActiveClaims(_x) {
969
849
  return _ref.apply(this, arguments);
970
850
  };
@@ -973,56 +853,47 @@ var getActiveClaims = /*#__PURE__*/function () {
973
853
  /**
974
854
  * END: Function overload definitions
975
855
  */
976
-
977
856
  function getTicketData(_x, _x2) {
978
857
  return _getTicketData.apply(this, arguments);
979
858
  }
980
-
981
859
  function _getTicketData() {
982
860
  _getTicketData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
983
861
  var queryParams, url, rawResponse;
984
862
  return _regeneratorRuntime().wrap(function _callee$(_context) {
985
- while (1) {
986
- switch (_context.prev = _context.next) {
987
- case 0:
988
- if (payload === void 0) {
989
- payload = {};
990
- }
991
-
992
- queryParams = buildGetTicketDataQueryParams(payload);
993
- url = buildRequestUrl(apiBaseUrl, "/API_GetTicketData.php", authorization, queryParams);
994
- _context.next = 5;
995
- return call({
996
- url: url
997
- });
998
-
999
- case 5:
1000
- rawResponse = _context.sent;
1001
- return _context.abrupt("return", serializeProperties(rawResponse, {
1002
- shouldCastToNumbers: ["ID", "AchievementID", "Points", "GameID", "ReportType", "ReportState", "OpenTickets"],
1003
- shouldMapToBooleans: ["Hardcore"]
1004
- }));
1005
-
1006
- case 7:
1007
- case "end":
1008
- return _context.stop();
1009
- }
863
+ while (1) switch (_context.prev = _context.next) {
864
+ case 0:
865
+ if (payload === void 0) {
866
+ payload = {};
867
+ }
868
+ queryParams = buildGetTicketDataQueryParams(payload);
869
+ url = buildRequestUrl(apiBaseUrl, "/API_GetTicketData.php", authorization, queryParams);
870
+ _context.next = 5;
871
+ return call({
872
+ url: url
873
+ });
874
+ case 5:
875
+ rawResponse = _context.sent;
876
+ return _context.abrupt("return", serializeProperties(rawResponse, {
877
+ shouldCastToNumbers: ["ID", "AchievementID", "Points", "GameID", "ReportType", "ReportState", "OpenTickets"],
878
+ shouldMapToBooleans: ["Hardcore"]
879
+ }));
880
+ case 7:
881
+ case "end":
882
+ return _context.stop();
1010
883
  }
1011
884
  }, _callee);
1012
885
  }));
1013
886
  return _getTicketData.apply(this, arguments);
1014
887
  }
1015
-
1016
888
  var buildGetTicketDataQueryParams = function buildGetTicketDataQueryParams(payload) {
1017
889
  var ticketId = payload.ticketId,
1018
- isGettingMostTicketedGames = payload.isGettingMostTicketedGames,
1019
- userName = payload.userName,
1020
- gameId = payload.gameId,
1021
- isGettingTicketsForUnofficialAchievements = payload.isGettingTicketsForUnofficialAchievements,
1022
- shouldReturnTicketsList = payload.shouldReturnTicketsList,
1023
- achievementId = payload.achievementId;
890
+ isGettingMostTicketedGames = payload.isGettingMostTicketedGames,
891
+ userName = payload.userName,
892
+ gameId = payload.gameId,
893
+ isGettingTicketsForUnofficialAchievements = payload.isGettingTicketsForUnofficialAchievements,
894
+ shouldReturnTicketsList = payload.shouldReturnTicketsList,
895
+ achievementId = payload.achievementId;
1024
896
  var queryParams = {};
1025
-
1026
897
  if (ticketId !== undefined) {
1027
898
  queryParams["i"] = ticketId;
1028
899
  } else if (isGettingMostTicketedGames) {
@@ -1032,11 +903,9 @@ var buildGetTicketDataQueryParams = function buildGetTicketDataQueryParams(paylo
1032
903
  queryParams["u"] = userName;
1033
904
  } else if (gameId) {
1034
905
  queryParams["g"] = gameId;
1035
-
1036
906
  if (isGettingTicketsForUnofficialAchievements) {
1037
907
  queryParams["f"] = "5";
1038
908
  }
1039
-
1040
909
  if (shouldReturnTicketsList) {
1041
910
  queryParams["d"] = "1";
1042
911
  }
@@ -1045,21 +914,16 @@ var buildGetTicketDataQueryParams = function buildGetTicketDataQueryParams(paylo
1045
914
  } else {
1046
915
  queryParams = applyPaginationQueryParams(queryParams, payload);
1047
916
  }
1048
-
1049
917
  return queryParams;
1050
918
  };
1051
-
1052
919
  var applyPaginationQueryParams = function applyPaginationQueryParams(currentParams, payload) {
1053
920
  var modifiedParams = _extends({}, currentParams);
1054
-
1055
921
  if (payload.count !== undefined) {
1056
922
  modifiedParams["c"] = payload.count;
1057
923
  }
1058
-
1059
924
  if (payload.offset !== undefined) {
1060
925
  modifiedParams["o"] = payload.offset;
1061
926
  }
1062
-
1063
927
  return modifiedParams;
1064
928
  };
1065
929
 
@@ -1084,65 +948,51 @@ var applyPaginationQueryParams = function applyPaginationQueryParams(currentPara
1084
948
  * ]
1085
949
  * ```
1086
950
  */
1087
-
1088
951
  var getTopTenUsers = /*#__PURE__*/function () {
1089
952
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
1090
953
  var url, rawTopTenUsers, sanitizedTopTenUsers, _iterator, _step, rawUser;
1091
-
1092
954
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1093
- while (1) {
1094
- switch (_context.prev = _context.next) {
1095
- case 0:
1096
- url = buildRequestUrl(apiBaseUrl, "/API_GetTopTenUsers.php", authorization);
1097
- _context.next = 3;
1098
- return call({
1099
- url: url
955
+ while (1) switch (_context.prev = _context.next) {
956
+ case 0:
957
+ url = buildRequestUrl(apiBaseUrl, "/API_GetTopTenUsers.php", authorization);
958
+ _context.next = 3;
959
+ return call({
960
+ url: url
961
+ });
962
+ case 3:
963
+ rawTopTenUsers = _context.sent;
964
+ sanitizedTopTenUsers = [];
965
+ for (_iterator = _createForOfIteratorHelperLoose(rawTopTenUsers); !(_step = _iterator()).done;) {
966
+ rawUser = _step.value;
967
+ sanitizedTopTenUsers.push({
968
+ userName: rawUser["1"],
969
+ totalPoints: Number(rawUser["2"]),
970
+ totalRatioPoints: Number(rawUser["3"])
1100
971
  });
1101
-
1102
- case 3:
1103
- rawTopTenUsers = _context.sent;
1104
- sanitizedTopTenUsers = [];
1105
-
1106
- for (_iterator = _createForOfIteratorHelperLoose(rawTopTenUsers); !(_step = _iterator()).done;) {
1107
- rawUser = _step.value;
1108
- sanitizedTopTenUsers.push({
1109
- userName: rawUser["1"],
1110
- totalPoints: Number(rawUser["2"]),
1111
- totalRatioPoints: Number(rawUser["3"])
1112
- });
1113
- }
1114
-
1115
- return _context.abrupt("return", sanitizedTopTenUsers);
1116
-
1117
- case 7:
1118
- case "end":
1119
- return _context.stop();
1120
- }
972
+ }
973
+ return _context.abrupt("return", sanitizedTopTenUsers);
974
+ case 7:
975
+ case "end":
976
+ return _context.stop();
1121
977
  }
1122
978
  }, _callee);
1123
979
  }));
1124
-
1125
980
  return function getTopTenUsers(_x) {
1126
981
  return _ref.apply(this, arguments);
1127
982
  };
1128
983
  }();
1129
984
 
1130
985
  var ClaimType;
1131
-
1132
986
  (function (ClaimType) {
1133
987
  ClaimType[ClaimType["Primary"] = 0] = "Primary";
1134
988
  ClaimType[ClaimType["Collaboration"] = 1] = "Collaboration";
1135
989
  })(ClaimType || (ClaimType = {}));
1136
-
1137
990
  var ClaimSetType;
1138
-
1139
991
  (function (ClaimSetType) {
1140
992
  ClaimSetType[ClaimSetType["NewSet"] = 0] = "NewSet";
1141
993
  ClaimSetType[ClaimSetType["Revision"] = 1] = "Revision";
1142
994
  })(ClaimSetType || (ClaimSetType = {}));
1143
-
1144
995
  var ClaimStatus;
1145
-
1146
996
  (function (ClaimStatus) {
1147
997
  ClaimStatus[ClaimStatus["Active"] = 0] = "Active";
1148
998
  ClaimStatus[ClaimStatus["Complete"] = 1] = "Complete";
@@ -1175,35 +1025,29 @@ var ClaimStatus;
1175
1025
  * { gameId: 14402, achievementIds: [1,2,3,4,5] }
1176
1026
  * ```
1177
1027
  */
1178
-
1179
1028
  var getAchievementCount = /*#__PURE__*/function () {
1180
1029
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1181
1030
  var gameId, url, rawResponse;
1182
1031
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1183
- while (1) {
1184
- switch (_context.prev = _context.next) {
1185
- case 0:
1186
- gameId = payload.gameId;
1187
- url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementCount.php", authorization, {
1188
- i: gameId
1189
- });
1190
- _context.next = 4;
1191
- return call({
1192
- url: url
1193
- });
1194
-
1195
- case 4:
1196
- rawResponse = _context.sent;
1197
- return _context.abrupt("return", serializeProperties(rawResponse));
1198
-
1199
- case 6:
1200
- case "end":
1201
- return _context.stop();
1202
- }
1032
+ while (1) switch (_context.prev = _context.next) {
1033
+ case 0:
1034
+ gameId = payload.gameId;
1035
+ url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementCount.php", authorization, {
1036
+ i: gameId
1037
+ });
1038
+ _context.next = 4;
1039
+ return call({
1040
+ url: url
1041
+ });
1042
+ case 4:
1043
+ rawResponse = _context.sent;
1044
+ return _context.abrupt("return", serializeProperties(rawResponse));
1045
+ case 6:
1046
+ case "end":
1047
+ return _context.stop();
1203
1048
  }
1204
1049
  }, _callee);
1205
1050
  }));
1206
-
1207
1051
  return function getAchievementCount(_x, _x2) {
1208
1052
  return _ref.apply(this, arguments);
1209
1053
  };
@@ -1259,44 +1103,35 @@ var getAchievementCount = /*#__PURE__*/function () {
1259
1103
  * }
1260
1104
  * ```
1261
1105
  */
1262
-
1263
1106
  var getAchievementDistribution = /*#__PURE__*/function () {
1264
1107
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1265
1108
  var gameId, flags, hardcore, queryParams, url;
1266
1109
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1267
- while (1) {
1268
- switch (_context.prev = _context.next) {
1269
- case 0:
1270
- gameId = payload.gameId, flags = payload.flags, hardcore = payload.hardcore;
1271
- queryParams = {
1272
- i: gameId
1273
- };
1274
-
1275
- if (flags !== undefined) {
1276
- queryParams["f"] = flags;
1277
- }
1278
-
1279
- if (hardcore !== undefined) {
1280
- queryParams["h"] = hardcore === true ? 1 : 0;
1281
- }
1282
-
1283
- url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementDistribution.php", authorization, queryParams);
1284
- _context.next = 7;
1285
- return call({
1286
- url: url
1287
- });
1288
-
1289
- case 7:
1290
- return _context.abrupt("return", _context.sent);
1291
-
1292
- case 8:
1293
- case "end":
1294
- return _context.stop();
1295
- }
1110
+ while (1) switch (_context.prev = _context.next) {
1111
+ case 0:
1112
+ gameId = payload.gameId, flags = payload.flags, hardcore = payload.hardcore;
1113
+ queryParams = {
1114
+ i: gameId
1115
+ };
1116
+ if (flags !== undefined) {
1117
+ queryParams["f"] = flags;
1118
+ }
1119
+ if (hardcore !== undefined) {
1120
+ queryParams["h"] = hardcore === true ? 1 : 0;
1121
+ }
1122
+ url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementDistribution.php", authorization, queryParams);
1123
+ _context.next = 7;
1124
+ return call({
1125
+ url: url
1126
+ });
1127
+ case 7:
1128
+ return _context.abrupt("return", _context.sent);
1129
+ case 8:
1130
+ case "end":
1131
+ return _context.stop();
1296
1132
  }
1297
1133
  }, _callee);
1298
1134
  }));
1299
-
1300
1135
  return function getAchievementDistribution(_x, _x2) {
1301
1136
  return _ref.apply(this, arguments);
1302
1137
  };
@@ -1345,37 +1180,31 @@ var getAchievementDistribution = /*#__PURE__*/function () {
1345
1180
  * }
1346
1181
  * ```
1347
1182
  */
1348
-
1349
1183
  var getGame = /*#__PURE__*/function () {
1350
1184
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1351
1185
  var gameId, url, rawResponse;
1352
1186
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1353
- while (1) {
1354
- switch (_context.prev = _context.next) {
1355
- case 0:
1356
- gameId = payload.gameId;
1357
- url = buildRequestUrl(apiBaseUrl, "/API_GetGame.php", authorization, {
1358
- i: gameId
1359
- });
1360
- _context.next = 4;
1361
- return call({
1362
- url: url
1363
- });
1364
-
1365
- case 4:
1366
- rawResponse = _context.sent;
1367
- return _context.abrupt("return", serializeProperties(rawResponse, {
1368
- shouldCastToNumbers: ["ID", "ForumTopicID", "ConsoleID", "Flags", "Released"]
1369
- }));
1370
-
1371
- case 6:
1372
- case "end":
1373
- return _context.stop();
1374
- }
1187
+ while (1) switch (_context.prev = _context.next) {
1188
+ case 0:
1189
+ gameId = payload.gameId;
1190
+ url = buildRequestUrl(apiBaseUrl, "/API_GetGame.php", authorization, {
1191
+ i: gameId
1192
+ });
1193
+ _context.next = 4;
1194
+ return call({
1195
+ url: url
1196
+ });
1197
+ case 4:
1198
+ rawResponse = _context.sent;
1199
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1200
+ shouldCastToNumbers: ["ID", "ForumTopicID", "ConsoleID", "Flags", "Released"]
1201
+ }));
1202
+ case 6:
1203
+ case "end":
1204
+ return _context.stop();
1375
1205
  }
1376
1206
  }, _callee);
1377
1207
  }));
1378
-
1379
1208
  return function getGame(_x, _x2) {
1380
1209
  return _ref.apply(this, arguments);
1381
1210
  };
@@ -1444,37 +1273,31 @@ var getGame = /*#__PURE__*/function () {
1444
1273
  * }
1445
1274
  * ```
1446
1275
  */
1447
-
1448
1276
  var getGameExtended = /*#__PURE__*/function () {
1449
1277
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1450
1278
  var gameId, url, rawResponse;
1451
1279
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1452
- while (1) {
1453
- switch (_context.prev = _context.next) {
1454
- case 0:
1455
- gameId = payload.gameId;
1456
- url = buildRequestUrl(apiBaseUrl, "/API_GetGameExtended.php", authorization, {
1457
- i: gameId
1458
- });
1459
- _context.next = 4;
1460
- return call({
1461
- url: url
1462
- });
1463
-
1464
- case 4:
1465
- rawResponse = _context.sent;
1466
- return _context.abrupt("return", serializeProperties(rawResponse, {
1467
- shouldCastToNumbers: ["ID", "NumAwarded", "NumAwardedHardcore", "Points", "TrueRatio", "DisplayOrder", "NumDistinctPlayersCasual", "NumDistinctPlayersHardcore", "Released"]
1468
- }));
1469
-
1470
- case 6:
1471
- case "end":
1472
- return _context.stop();
1473
- }
1280
+ while (1) switch (_context.prev = _context.next) {
1281
+ case 0:
1282
+ gameId = payload.gameId;
1283
+ url = buildRequestUrl(apiBaseUrl, "/API_GetGameExtended.php", authorization, {
1284
+ i: gameId
1285
+ });
1286
+ _context.next = 4;
1287
+ return call({
1288
+ url: url
1289
+ });
1290
+ case 4:
1291
+ rawResponse = _context.sent;
1292
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1293
+ shouldCastToNumbers: ["ID", "NumAwarded", "NumAwardedHardcore", "Points", "TrueRatio", "DisplayOrder", "NumDistinctPlayersCasual", "NumDistinctPlayersHardcore", "Released"]
1294
+ }));
1295
+ case 6:
1296
+ case "end":
1297
+ return _context.stop();
1474
1298
  }
1475
1299
  }, _callee);
1476
1300
  }));
1477
-
1478
1301
  return function getGameExtended(_x, _x2) {
1479
1302
  return _ref.apply(this, arguments);
1480
1303
  };
@@ -1512,38 +1335,32 @@ var getGameExtended = /*#__PURE__*/function () {
1512
1335
  * ]
1513
1336
  * ```
1514
1337
  */
1515
-
1516
1338
  var getGameRankAndScore = /*#__PURE__*/function () {
1517
1339
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1518
1340
  var gameId, type, url, rawResponse;
1519
1341
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1520
- while (1) {
1521
- switch (_context.prev = _context.next) {
1522
- case 0:
1523
- gameId = payload.gameId, type = payload.type;
1524
- url = buildRequestUrl(apiBaseUrl, "/API_GetGameRankAndScore.php", authorization, {
1525
- g: gameId,
1526
- t: type === "latest-masters" ? 1 : 0
1527
- });
1528
- _context.next = 4;
1529
- return call({
1530
- url: url
1531
- });
1532
-
1533
- case 4:
1534
- rawResponse = _context.sent;
1535
- return _context.abrupt("return", serializeProperties(rawResponse, {
1536
- shouldCastToNumbers: ["TotalScore"]
1537
- }));
1538
-
1539
- case 6:
1540
- case "end":
1541
- return _context.stop();
1542
- }
1342
+ while (1) switch (_context.prev = _context.next) {
1343
+ case 0:
1344
+ gameId = payload.gameId, type = payload.type;
1345
+ url = buildRequestUrl(apiBaseUrl, "/API_GetGameRankAndScore.php", authorization, {
1346
+ g: gameId,
1347
+ t: type === "latest-masters" ? 1 : 0
1348
+ });
1349
+ _context.next = 4;
1350
+ return call({
1351
+ url: url
1352
+ });
1353
+ case 4:
1354
+ rawResponse = _context.sent;
1355
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1356
+ shouldCastToNumbers: ["TotalScore"]
1357
+ }));
1358
+ case 6:
1359
+ case "end":
1360
+ return _context.stop();
1543
1361
  }
1544
1362
  }, _callee);
1545
1363
  }));
1546
-
1547
1364
  return function getGameRankAndScore(_x, _x2) {
1548
1365
  return _ref.apply(this, arguments);
1549
1366
  };
@@ -1582,42 +1399,35 @@ var getGameRankAndScore = /*#__PURE__*/function () {
1582
1399
  * }
1583
1400
  * ```
1584
1401
  */
1585
-
1586
1402
  var getGameRating = /*#__PURE__*/function () {
1587
1403
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1588
1404
  var gameId, url, rawResponse;
1589
1405
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1590
- while (1) {
1591
- switch (_context.prev = _context.next) {
1592
- case 0:
1593
- gameId = payload.gameId;
1594
- url = buildRequestUrl(apiBaseUrl, "/API_GetGameRating.php", authorization, {
1595
- i: gameId
1596
- });
1597
- _context.next = 4;
1598
- return call({
1599
- url: url
1600
- });
1601
-
1602
- case 4:
1603
- rawResponse = _context.sent;
1604
- return _context.abrupt("return", serializeProperties(rawResponse));
1605
-
1606
- case 6:
1607
- case "end":
1608
- return _context.stop();
1609
- }
1406
+ while (1) switch (_context.prev = _context.next) {
1407
+ case 0:
1408
+ gameId = payload.gameId;
1409
+ url = buildRequestUrl(apiBaseUrl, "/API_GetGameRating.php", authorization, {
1410
+ i: gameId
1411
+ });
1412
+ _context.next = 4;
1413
+ return call({
1414
+ url: url
1415
+ });
1416
+ case 4:
1417
+ rawResponse = _context.sent;
1418
+ return _context.abrupt("return", serializeProperties(rawResponse));
1419
+ case 6:
1420
+ case "end":
1421
+ return _context.stop();
1610
1422
  }
1611
1423
  }, _callee);
1612
1424
  }));
1613
-
1614
1425
  return function getGameRating(_x, _x2) {
1615
1426
  return _ref.apply(this, arguments);
1616
1427
  };
1617
1428
  }();
1618
1429
 
1619
1430
  var AchievementDistributionFlags;
1620
-
1621
1431
  (function (AchievementDistributionFlags) {
1622
1432
  AchievementDistributionFlags[AchievementDistributionFlags["CoreAchievements"] = 3] = "CoreAchievements";
1623
1433
  AchievementDistributionFlags[AchievementDistributionFlags["UnofficialAchievements"] = 5] = "UnofficialAchievements";
@@ -1627,7 +1437,6 @@ var AchievementDistributionFlags;
1627
1437
  // interface because the return types for many of these fields
1628
1438
  // are different from the actual RA API.
1629
1439
  var GameExtendedClaimType;
1630
-
1631
1440
  (function (GameExtendedClaimType) {
1632
1441
  GameExtendedClaimType["Primary"] = "0";
1633
1442
  GameExtendedClaimType["Collaboration"] = "1";
@@ -1664,61 +1473,55 @@ var GameExtendedClaimType;
1664
1473
  * @returns An array containing metadata about the user
1665
1474
  * achievements earned during the specified date range.
1666
1475
  * ```
1667
- * [
1668
- * {
1669
- * date: '2022-10-12 07:58:05',
1670
- * hardcoreMode: true,
1671
- * achievementId: 173315,
1672
- * title: 'Your Puny Human Weapons',
1673
- * description: 'Collect all objects in the Weapons Category.',
1674
- * badgeName: '193756',
1675
- * points: 10,
1676
- * author: 'blendedsea',
1677
- * gameTitle: 'Me & My Katamari',
1678
- * gameIcon: '/Images/047357.png',
1679
- * gameId: 3571,
1680
- * consoleName: 'PlayStation Portable',
1681
- * cumulScore: 120,
1682
- * badgeUrl: '/Badge/193756.png',
1683
- * gameUrl: '/game/3571'
1684
- * }
1685
- * ]
1476
+ * [
1477
+ * {
1478
+ * date: '2022-10-12 07:58:05',
1479
+ * hardcoreMode: true,
1480
+ * achievementId: 173315,
1481
+ * title: 'Your Puny Human Weapons',
1482
+ * description: 'Collect all objects in the Weapons Category.',
1483
+ * badgeName: '193756',
1484
+ * points: 10,
1485
+ * author: 'blendedsea',
1486
+ * gameTitle: 'Me & My Katamari',
1487
+ * gameIcon: '/Images/047357.png',
1488
+ * gameId: 3571,
1489
+ * consoleName: 'PlayStation Portable',
1490
+ * cumulScore: 120,
1491
+ * badgeUrl: '/Badge/193756.png',
1492
+ * gameUrl: '/game/3571'
1493
+ * }
1494
+ * ]
1686
1495
  * ```
1687
1496
  */
1688
-
1689
1497
  var getAchievementsEarnedBetween = /*#__PURE__*/function () {
1690
1498
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1691
1499
  var userName, fromDate, toDate, url, rawResponse;
1692
1500
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1693
- while (1) {
1694
- switch (_context.prev = _context.next) {
1695
- case 0:
1696
- userName = payload.userName, fromDate = payload.fromDate, toDate = payload.toDate;
1697
- url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementsEarnedBetween.php", authorization, {
1698
- u: userName,
1699
- f: (fromDate.getTime() / 1000).toFixed(0),
1700
- t: (toDate.getTime() / 1000).toFixed(0)
1701
- });
1702
- _context.next = 4;
1703
- return call({
1704
- url: url
1705
- });
1706
-
1707
- case 4:
1708
- rawResponse = _context.sent;
1709
- return _context.abrupt("return", serializeProperties(rawResponse, {
1710
- shouldCastToNumbers: ["AchievementID", "Points", "GameID"],
1711
- shouldMapToBooleans: ["HardcoreMode"]
1712
- }));
1713
-
1714
- case 6:
1715
- case "end":
1716
- return _context.stop();
1717
- }
1501
+ while (1) switch (_context.prev = _context.next) {
1502
+ case 0:
1503
+ userName = payload.userName, fromDate = payload.fromDate, toDate = payload.toDate;
1504
+ url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementsEarnedBetween.php", authorization, {
1505
+ u: userName,
1506
+ f: (fromDate.getTime() / 1000).toFixed(0),
1507
+ t: (toDate.getTime() / 1000).toFixed(0)
1508
+ });
1509
+ _context.next = 4;
1510
+ return call({
1511
+ url: url
1512
+ });
1513
+ case 4:
1514
+ rawResponse = _context.sent;
1515
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1516
+ shouldCastToNumbers: ["AchievementID", "Points", "GameID"],
1517
+ shouldMapToBooleans: ["HardcoreMode"]
1518
+ }));
1519
+ case 6:
1520
+ case "end":
1521
+ return _context.stop();
1718
1522
  }
1719
1523
  }, _callee);
1720
1524
  }));
1721
-
1722
1525
  return function getAchievementsEarnedBetween(_x, _x2) {
1723
1526
  return _ref.apply(this, arguments);
1724
1527
  };
@@ -1775,40 +1578,34 @@ var getAchievementsEarnedBetween = /*#__PURE__*/function () {
1775
1578
  * ]
1776
1579
  * ```
1777
1580
  */
1778
-
1779
1581
  var getAchievementsEarnedOnDay = /*#__PURE__*/function () {
1780
1582
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1781
1583
  var userName, onDate, url, rawResponse;
1782
1584
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1783
- while (1) {
1784
- switch (_context.prev = _context.next) {
1785
- case 0:
1786
- userName = payload.userName, onDate = payload.onDate;
1787
- url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementsEarnedOnDay.php", authorization, {
1788
- u: userName,
1789
- // YYYY-MM-DD
1790
- d: onDate.getFullYear() + "-" + (onDate.getMonth() + 1) + "-" + onDate.getDate()
1791
- });
1792
- _context.next = 4;
1793
- return call({
1794
- url: url
1795
- });
1796
-
1797
- case 4:
1798
- rawResponse = _context.sent;
1799
- return _context.abrupt("return", serializeProperties(rawResponse, {
1800
- shouldCastToNumbers: ["AchievementID", "Points", "GameID"],
1801
- shouldMapToBooleans: ["HardcoreMode"]
1802
- }));
1803
-
1804
- case 6:
1805
- case "end":
1806
- return _context.stop();
1807
- }
1585
+ while (1) switch (_context.prev = _context.next) {
1586
+ case 0:
1587
+ userName = payload.userName, onDate = payload.onDate;
1588
+ url = buildRequestUrl(apiBaseUrl, "/API_GetAchievementsEarnedOnDay.php", authorization, {
1589
+ u: userName,
1590
+ // YYYY-MM-DD
1591
+ d: onDate.getFullYear() + "-" + (onDate.getMonth() + 1) + "-" + onDate.getDate()
1592
+ });
1593
+ _context.next = 4;
1594
+ return call({
1595
+ url: url
1596
+ });
1597
+ case 4:
1598
+ rawResponse = _context.sent;
1599
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1600
+ shouldCastToNumbers: ["AchievementID", "Points", "GameID"],
1601
+ shouldMapToBooleans: ["HardcoreMode"]
1602
+ }));
1603
+ case 6:
1604
+ case "end":
1605
+ return _context.stop();
1808
1606
  }
1809
1607
  }, _callee);
1810
1608
  }));
1811
-
1812
1609
  return function getAchievementsEarnedOnDay(_x, _x2) {
1813
1610
  return _ref.apply(this, arguments);
1814
1611
  };
@@ -1888,38 +1685,32 @@ var getAchievementsEarnedOnDay = /*#__PURE__*/function () {
1888
1685
  * }
1889
1686
  * ```
1890
1687
  */
1891
-
1892
1688
  var getGameInfoAndUserProgress = /*#__PURE__*/function () {
1893
1689
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1894
1690
  var gameId, userName, url, rawResponse;
1895
1691
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1896
- while (1) {
1897
- switch (_context.prev = _context.next) {
1898
- case 0:
1899
- gameId = payload.gameId, userName = payload.userName;
1900
- url = buildRequestUrl(apiBaseUrl, "/API_GetGameInfoAndUserProgress.php", authorization, {
1901
- g: gameId,
1902
- u: userName
1903
- });
1904
- _context.next = 4;
1905
- return call({
1906
- url: url
1907
- });
1908
-
1909
- case 4:
1910
- rawResponse = _context.sent;
1911
- return _context.abrupt("return", serializeProperties(rawResponse, {
1912
- shouldCastToNumbers: ["ID", "NumAwarded", "NumAwardedHardcore", "Points", "TrueRatio", "DisplayOrder", "NumDistinctPlayersCasual", "NumDistinctPlayersHardcore", "Released"]
1913
- }));
1914
-
1915
- case 6:
1916
- case "end":
1917
- return _context.stop();
1918
- }
1692
+ while (1) switch (_context.prev = _context.next) {
1693
+ case 0:
1694
+ gameId = payload.gameId, userName = payload.userName;
1695
+ url = buildRequestUrl(apiBaseUrl, "/API_GetGameInfoAndUserProgress.php", authorization, {
1696
+ g: gameId,
1697
+ u: userName
1698
+ });
1699
+ _context.next = 4;
1700
+ return call({
1701
+ url: url
1702
+ });
1703
+ case 4:
1704
+ rawResponse = _context.sent;
1705
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1706
+ shouldCastToNumbers: ["ID", "NumAwarded", "NumAwardedHardcore", "Points", "TrueRatio", "DisplayOrder", "NumDistinctPlayersCasual", "NumDistinctPlayersHardcore", "Released"]
1707
+ }));
1708
+ case 6:
1709
+ case "end":
1710
+ return _context.stop();
1919
1711
  }
1920
1712
  }, _callee);
1921
1713
  }));
1922
-
1923
1714
  return function getGameInfoAndUserProgress(_x, _x2) {
1924
1715
  return _ref.apply(this, arguments);
1925
1716
  };
@@ -1940,44 +1731,38 @@ var getGameInfoAndUserProgress = /*#__PURE__*/function () {
1940
1731
  * ```
1941
1732
  * const userClaims = await getUserClaims(
1942
1733
  * authorization,
1943
- * { userName: "xelnia" }
1734
+ * { userName: "Jamiras" }
1944
1735
  * );
1945
1736
  * ```
1946
1737
  *
1947
1738
  * @returns An array containing all the achievement set claims
1948
1739
  * made over the lifetime of the given user.
1949
1740
  */
1950
-
1951
1741
  var getUserClaims = /*#__PURE__*/function () {
1952
1742
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1953
1743
  var userName, url, rawResponse;
1954
1744
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1955
- while (1) {
1956
- switch (_context.prev = _context.next) {
1957
- case 0:
1958
- userName = payload.userName;
1959
- url = buildRequestUrl(apiBaseUrl, "/API_GetUserClaims.php", authorization, {
1960
- u: userName
1961
- });
1962
- _context.next = 4;
1963
- return call({
1964
- url: url
1965
- });
1966
-
1967
- case 4:
1968
- rawResponse = _context.sent;
1969
- return _context.abrupt("return", serializeProperties(rawResponse, {
1970
- shouldCastToNumbers: ["ID", "GameID", "ClaimType", "SetType", "Status", "Extension", "Special", "MinutesLeft"]
1971
- }));
1972
-
1973
- case 6:
1974
- case "end":
1975
- return _context.stop();
1976
- }
1745
+ while (1) switch (_context.prev = _context.next) {
1746
+ case 0:
1747
+ userName = payload.userName;
1748
+ url = buildRequestUrl(apiBaseUrl, "/API_GetUserClaims.php", authorization, {
1749
+ u: userName
1750
+ });
1751
+ _context.next = 4;
1752
+ return call({
1753
+ url: url
1754
+ });
1755
+ case 4:
1756
+ rawResponse = _context.sent;
1757
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1758
+ shouldCastToNumbers: ["ID", "GameID", "ClaimType", "SetType", "Status", "Extension", "Special", "MinutesLeft"]
1759
+ }));
1760
+ case 6:
1761
+ case "end":
1762
+ return _context.stop();
1977
1763
  }
1978
1764
  }, _callee);
1979
1765
  }));
1980
-
1981
1766
  return function getUserClaims(_x, _x2) {
1982
1767
  return _ref.apply(this, arguments);
1983
1768
  };
@@ -1988,7 +1773,7 @@ var getUserClaims = /*#__PURE__*/function () {
1988
1773
  * about the games a given user has played. It returns two
1989
1774
  * entries per each game: one for the softcore completion and
1990
1775
  * one for the hardcore completion. These are designated by
1991
- * the `hardcoreMode` property on the completion object.
1776
+ * the `hardcoreMode` property on each completion object.
1992
1777
  *
1993
1778
  * @param authorization An object containing your userName and webApiKey.
1994
1779
  * This can be constructed with `buildAuthorization()`.
@@ -2034,38 +1819,32 @@ var getUserClaims = /*#__PURE__*/function () {
2034
1819
  * ]
2035
1820
  * ```
2036
1821
  */
2037
-
2038
1822
  var getUserCompletedGames = /*#__PURE__*/function () {
2039
1823
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2040
1824
  var userName, url, rawResponse;
2041
1825
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2042
- while (1) {
2043
- switch (_context.prev = _context.next) {
2044
- case 0:
2045
- userName = payload.userName;
2046
- url = buildRequestUrl(apiBaseUrl, "/API_GetUserCompletedGames.php", authorization, {
2047
- u: userName
2048
- });
2049
- _context.next = 4;
2050
- return call({
2051
- url: url
2052
- });
2053
-
2054
- case 4:
2055
- rawResponse = _context.sent;
2056
- return _context.abrupt("return", serializeProperties(rawResponse, {
2057
- shouldCastToNumbers: ["GameID", "ConsoleID", "MaxPossible", "NumAwarded", "PctWon"],
2058
- shouldMapToBooleans: ["HardcoreMode"]
2059
- }));
2060
-
2061
- case 6:
2062
- case "end":
2063
- return _context.stop();
2064
- }
1826
+ while (1) switch (_context.prev = _context.next) {
1827
+ case 0:
1828
+ userName = payload.userName;
1829
+ url = buildRequestUrl(apiBaseUrl, "/API_GetUserCompletedGames.php", authorization, {
1830
+ u: userName
1831
+ });
1832
+ _context.next = 4;
1833
+ return call({
1834
+ url: url
1835
+ });
1836
+ case 4:
1837
+ rawResponse = _context.sent;
1838
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1839
+ shouldCastToNumbers: ["GameID", "ConsoleID", "MaxPossible", "NumAwarded", "PctWon"],
1840
+ shouldMapToBooleans: ["HardcoreMode"]
1841
+ }));
1842
+ case 6:
1843
+ case "end":
1844
+ return _context.stop();
2065
1845
  }
2066
1846
  }, _callee);
2067
1847
  }));
2068
-
2069
1848
  return function getUserCompletedGames(_x, _x2) {
2070
1849
  return _ref.apply(this, arguments);
2071
1850
  };
@@ -2109,38 +1888,32 @@ var getUserCompletedGames = /*#__PURE__*/function () {
2109
1888
  * ]
2110
1889
  * ```
2111
1890
  */
2112
-
2113
1891
  var getUserGameRankAndScore = /*#__PURE__*/function () {
2114
1892
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2115
1893
  var gameId, userName, url, rawResponse;
2116
1894
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2117
- while (1) {
2118
- switch (_context.prev = _context.next) {
2119
- case 0:
2120
- gameId = payload.gameId, userName = payload.userName;
2121
- url = buildRequestUrl(apiBaseUrl, "/API_GetUserGameRankAndScore.php", authorization, {
2122
- g: gameId,
2123
- u: userName
2124
- });
2125
- _context.next = 4;
2126
- return call({
2127
- url: url
2128
- });
2129
-
2130
- case 4:
2131
- rawResponse = _context.sent;
2132
- return _context.abrupt("return", serializeProperties(rawResponse, {
2133
- shouldCastToNumbers: ["TotalScore", "UserRank"]
2134
- }));
2135
-
2136
- case 6:
2137
- case "end":
2138
- return _context.stop();
2139
- }
1895
+ while (1) switch (_context.prev = _context.next) {
1896
+ case 0:
1897
+ gameId = payload.gameId, userName = payload.userName;
1898
+ url = buildRequestUrl(apiBaseUrl, "/API_GetUserGameRankAndScore.php", authorization, {
1899
+ g: gameId,
1900
+ u: userName
1901
+ });
1902
+ _context.next = 4;
1903
+ return call({
1904
+ url: url
1905
+ });
1906
+ case 4:
1907
+ rawResponse = _context.sent;
1908
+ return _context.abrupt("return", serializeProperties(rawResponse, {
1909
+ shouldCastToNumbers: ["TotalScore", "UserRank"]
1910
+ }));
1911
+ case 6:
1912
+ case "end":
1913
+ return _context.stop();
2140
1914
  }
2141
1915
  }, _callee);
2142
1916
  }));
2143
-
2144
1917
  return function getUserGameRankAndScore(_x, _x2) {
2145
1918
  return _ref.apply(this, arguments);
2146
1919
  };
@@ -2153,7 +1926,7 @@ var getUserGameRankAndScore = /*#__PURE__*/function () {
2153
1926
  * @param authorization An object containing your userName and webApiKey.
2154
1927
  * This can be constructed with `buildAuthorization()`.
2155
1928
  *
2156
- * @param payload.userName The user for which to retrieve the points for.
1929
+ * @param payload.userName The user for which to retrieve the point totals for.
2157
1930
  *
2158
1931
  * @example
2159
1932
  * ```
@@ -2171,35 +1944,29 @@ var getUserGameRankAndScore = /*#__PURE__*/function () {
2171
1944
  * }
2172
1945
  * ```
2173
1946
  */
2174
-
2175
1947
  var getUserPoints = /*#__PURE__*/function () {
2176
1948
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2177
1949
  var userName, url, rawResponse;
2178
1950
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2179
- while (1) {
2180
- switch (_context.prev = _context.next) {
2181
- case 0:
2182
- userName = payload.userName;
2183
- url = buildRequestUrl(apiBaseUrl, "/API_GetUserPoints.php", authorization, {
2184
- u: userName
2185
- });
2186
- _context.next = 4;
2187
- return call({
2188
- url: url
2189
- });
2190
-
2191
- case 4:
2192
- rawResponse = _context.sent;
2193
- return _context.abrupt("return", serializeProperties(rawResponse));
2194
-
2195
- case 6:
2196
- case "end":
2197
- return _context.stop();
2198
- }
1951
+ while (1) switch (_context.prev = _context.next) {
1952
+ case 0:
1953
+ userName = payload.userName;
1954
+ url = buildRequestUrl(apiBaseUrl, "/API_GetUserPoints.php", authorization, {
1955
+ u: userName
1956
+ });
1957
+ _context.next = 4;
1958
+ return call({
1959
+ url: url
1960
+ });
1961
+ case 4:
1962
+ rawResponse = _context.sent;
1963
+ return _context.abrupt("return", serializeProperties(rawResponse));
1964
+ case 6:
1965
+ case "end":
1966
+ return _context.stop();
2199
1967
  }
2200
1968
  }, _callee);
2201
1969
  }));
2202
-
2203
1970
  return function getUserPoints(_x, _x2) {
2204
1971
  return _ref.apply(this, arguments);
2205
1972
  };
@@ -2207,14 +1974,14 @@ var getUserPoints = /*#__PURE__*/function () {
2207
1974
 
2208
1975
  /**
2209
1976
  * A call to this function will retrieve a given user's
2210
- * progress on a given set of games, targeted by game ID.
1977
+ * progress on a given list of games, targeted by game ID.
2211
1978
  *
2212
1979
  * @param authorization An object containing your userName and webApiKey.
2213
1980
  * This can be constructed with `buildAuthorization()`.
2214
1981
  *
2215
1982
  * @param payload.userName The user for which to retrieve the progress for.
2216
1983
  *
2217
- * @param payload.gameIds An array of RetroAchievements Game IDs. If you aren't
1984
+ * @param payload.gameIds An array of RetroAchievements game IDs. If you aren't
2218
1985
  * sure of the game ID, visit the game's page on the website and copy the number
2219
1986
  * at the end of the URL.
2220
1987
  *
@@ -2222,7 +1989,7 @@ var getUserPoints = /*#__PURE__*/function () {
2222
1989
  * ```
2223
1990
  * const userProgress = await getUserProgress(
2224
1991
  * authorization,
2225
- * { userName: "xelnia", gameIds: [14402, 1] }
1992
+ * { userName: "xelnia", gameIds: [1, 14402] }
2226
1993
  * );
2227
1994
  * ```
2228
1995
  *
@@ -2248,38 +2015,32 @@ var getUserPoints = /*#__PURE__*/function () {
2248
2015
  * }
2249
2016
  * ```
2250
2017
  */
2251
-
2252
2018
  var getUserProgress = /*#__PURE__*/function () {
2253
2019
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2254
2020
  var userName, gameIds, url, rawResponse;
2255
2021
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2256
- while (1) {
2257
- switch (_context.prev = _context.next) {
2258
- case 0:
2259
- userName = payload.userName, gameIds = payload.gameIds;
2260
- url = buildRequestUrl(apiBaseUrl, "/API_GetUserProgress.php", authorization, {
2261
- u: userName,
2262
- i: gameIds.join(",")
2263
- });
2264
- _context.next = 4;
2265
- return call({
2266
- url: url
2267
- });
2268
-
2269
- case 4:
2270
- rawResponse = _context.sent;
2271
- return _context.abrupt("return", serializeProperties(rawResponse, {
2272
- shouldCastToNumbers: ["NumPossibleAchievements", "PossibleScore", "NumAchieved", "ScoreAchieved", "NumAchievedHardcore", "ScoreAchievedHardcore"]
2273
- }));
2274
-
2275
- case 6:
2276
- case "end":
2277
- return _context.stop();
2278
- }
2022
+ while (1) switch (_context.prev = _context.next) {
2023
+ case 0:
2024
+ userName = payload.userName, gameIds = payload.gameIds;
2025
+ url = buildRequestUrl(apiBaseUrl, "/API_GetUserProgress.php", authorization, {
2026
+ u: userName,
2027
+ i: gameIds.join(",")
2028
+ });
2029
+ _context.next = 4;
2030
+ return call({
2031
+ url: url
2032
+ });
2033
+ case 4:
2034
+ rawResponse = _context.sent;
2035
+ return _context.abrupt("return", serializeProperties(rawResponse, {
2036
+ shouldCastToNumbers: ["NumPossibleAchievements", "PossibleScore", "NumAchieved", "ScoreAchieved", "NumAchievedHardcore", "ScoreAchievedHardcore"]
2037
+ }));
2038
+ case 6:
2039
+ case "end":
2040
+ return _context.stop();
2279
2041
  }
2280
2042
  }, _callee);
2281
2043
  }));
2282
-
2283
2044
  return function getUserProgress(_x, _x2) {
2284
2045
  return _ref.apply(this, arguments);
2285
2046
  };
@@ -2328,47 +2089,38 @@ var getUserProgress = /*#__PURE__*/function () {
2328
2089
  * ]
2329
2090
  * ```
2330
2091
  */
2331
-
2332
2092
  var getUserRecentlyPlayedGames = /*#__PURE__*/function () {
2333
2093
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2334
2094
  var userName, offset, count, queryParams, url, rawResponse;
2335
2095
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2336
- while (1) {
2337
- switch (_context.prev = _context.next) {
2338
- case 0:
2339
- userName = payload.userName, offset = payload.offset, count = payload.count;
2340
- queryParams = {
2341
- u: userName
2342
- };
2343
-
2344
- if (offset !== undefined) {
2345
- queryParams["o"] = offset;
2346
- }
2347
-
2348
- if (count !== undefined) {
2349
- queryParams["c"] = count;
2350
- }
2351
-
2352
- url = buildRequestUrl(apiBaseUrl, "/API_GetUserRecentlyPlayedGames.php", authorization, queryParams);
2353
- _context.next = 7;
2354
- return call({
2355
- url: url
2356
- });
2357
-
2358
- case 7:
2359
- rawResponse = _context.sent;
2360
- return _context.abrupt("return", serializeProperties(rawResponse, {
2361
- shouldCastToNumbers: ["GameID", "ConsoleID", "NumPossibleAchievements", "PossibleScore", "NumAchieved", "ScoreAchieved", "NumAchievedHardcore", "ScoreAchievedHardcore"]
2362
- }));
2363
-
2364
- case 9:
2365
- case "end":
2366
- return _context.stop();
2367
- }
2096
+ while (1) switch (_context.prev = _context.next) {
2097
+ case 0:
2098
+ userName = payload.userName, offset = payload.offset, count = payload.count;
2099
+ queryParams = {
2100
+ u: userName
2101
+ };
2102
+ if (offset !== undefined) {
2103
+ queryParams["o"] = offset;
2104
+ }
2105
+ if (count !== undefined) {
2106
+ queryParams["c"] = count;
2107
+ }
2108
+ url = buildRequestUrl(apiBaseUrl, "/API_GetUserRecentlyPlayedGames.php", authorization, queryParams);
2109
+ _context.next = 7;
2110
+ return call({
2111
+ url: url
2112
+ });
2113
+ case 7:
2114
+ rawResponse = _context.sent;
2115
+ return _context.abrupt("return", serializeProperties(rawResponse, {
2116
+ shouldCastToNumbers: ["GameID", "ConsoleID", "NumPossibleAchievements", "PossibleScore", "NumAchieved", "ScoreAchieved", "NumAchievedHardcore", "ScoreAchievedHardcore", "MyVote"]
2117
+ }));
2118
+ case 9:
2119
+ case "end":
2120
+ return _context.stop();
2368
2121
  }
2369
2122
  }, _callee);
2370
2123
  }));
2371
-
2372
2124
  return function getUserRecentlyPlayedGames(_x, _x2) {
2373
2125
  return _ref.apply(this, arguments);
2374
2126
  };
@@ -2399,52 +2151,44 @@ var getUserRecentlyPlayedGames = /*#__PURE__*/function () {
2399
2151
  *
2400
2152
  * @returns An object containing summary metadata about a target user.
2401
2153
  */
2402
-
2403
2154
  var getUserSummary = /*#__PURE__*/function () {
2404
2155
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2405
2156
  var userName, recentGamesCount, recentAchievementsCount, queryParams, url, rawResponse;
2406
2157
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2407
- while (1) {
2408
- switch (_context.prev = _context.next) {
2409
- case 0:
2410
- userName = payload.userName, recentGamesCount = payload.recentGamesCount, recentAchievementsCount = payload.recentAchievementsCount;
2411
- queryParams = {
2412
- u: userName
2413
- };
2414
-
2415
- if (recentGamesCount !== undefined) {
2416
- queryParams["g"] = recentGamesCount;
2417
- }
2418
-
2419
- if (recentAchievementsCount !== undefined) {
2420
- queryParams["a"] = recentAchievementsCount;
2421
- }
2422
-
2423
- url = buildRequestUrl(apiBaseUrl, "/API_GetUserSummary.php", authorization, queryParams);
2424
- _context.next = 7;
2425
- return call({
2426
- url: url
2427
- });
2428
-
2429
- case 7:
2430
- rawResponse = _context.sent;
2431
- return _context.abrupt("return", serializeProperties(rawResponse, {
2432
- shouldCastToNumbers: ["GameID", "ConsoleID", "ID", "LastGameID", "ForumTopicID", "activitytype", "ContribCount", "ContribYield", "TotalPoints", "TotalSoftcorePoints", "TotalTruePoints", "Permissions", "NumPossibleAchievements", "PossibleScore", "NumAchieved", "ScoreAchieved", "NumAchievedHardcore", "ScoreAchievedHardcore", "Points", "SoftcorePoints"],
2433
- shouldMapToBooleans: ["Untracked", "UserWallActive", "IsAwarded", "HardcoreAchieved"]
2434
- }));
2435
-
2436
- case 9:
2437
- case "end":
2438
- return _context.stop();
2439
- }
2158
+ while (1) switch (_context.prev = _context.next) {
2159
+ case 0:
2160
+ userName = payload.userName, recentGamesCount = payload.recentGamesCount, recentAchievementsCount = payload.recentAchievementsCount;
2161
+ queryParams = {
2162
+ u: userName
2163
+ };
2164
+ if (recentGamesCount !== undefined) {
2165
+ queryParams["g"] = recentGamesCount;
2166
+ }
2167
+ if (recentAchievementsCount !== undefined) {
2168
+ queryParams["a"] = recentAchievementsCount;
2169
+ }
2170
+ url = buildRequestUrl(apiBaseUrl, "/API_GetUserSummary.php", authorization, queryParams);
2171
+ _context.next = 7;
2172
+ return call({
2173
+ url: url
2174
+ });
2175
+ case 7:
2176
+ rawResponse = _context.sent;
2177
+ return _context.abrupt("return", serializeProperties(rawResponse, {
2178
+ shouldCastToNumbers: ["GameID", "ConsoleID", "ID", "LastGameID", "ForumTopicID", "activitytype", "ContribCount", "ContribYield", "TotalPoints", "TotalSoftcorePoints", "TotalTruePoints", "Permissions", "NumPossibleAchievements", "PossibleScore", "NumAchieved", "ScoreAchieved", "NumAchievedHardcore", "ScoreAchievedHardcore", "Points", "SoftcorePoints"],
2179
+ shouldMapToBooleans: ["Untracked", "UserWallActive", "IsAwarded", "HardcoreAchieved"]
2180
+ }));
2181
+ case 9:
2182
+ case "end":
2183
+ return _context.stop();
2440
2184
  }
2441
2185
  }, _callee);
2442
2186
  }));
2443
-
2444
2187
  return function getUserSummary(_x, _x2) {
2445
2188
  return _ref.apply(this, arguments);
2446
2189
  };
2447
- }(); // TODO: add test for this
2190
+ }();
2191
+ // TODO: add test for this
2448
2192
 
2449
2193
  /**
2450
2194
  * Accepts your RetroAchievements.org userName and web API key. After
@@ -2470,9 +2214,9 @@ var buildAuthorization = function buildAuthorization(options) {
2470
2214
  if (!options.userName || !options.webApiKey) {
2471
2215
  throw new Error("\n buildAuthorization() requires an object containing a\n userName and webApiKey. eg:\n\n const authorization = buildAuthorization({\n userName: \"myUserName\",\n webApiKey: \"myWebApiKey\"\n })\n ");
2472
2216
  }
2473
-
2474
2217
  return options;
2475
- }; // This function simply returns what it's given, however the return
2218
+ };
2219
+ // This function simply returns what it's given, however the return
2476
2220
  // value has the added benefit of type safety.
2477
2221
 
2478
2222
  export { AchievementDistributionFlags, ClaimSetType, ClaimStatus, ClaimType, buildAuthorization, getAchievementCount, getAchievementDistribution, getAchievementOfTheWeek, getAchievementUnlocks, getAchievementsEarnedBetween, getAchievementsEarnedOnDay, getActiveClaims, getConsoleIds, getGame, getGameExtended, getGameInfoAndUserProgress, getGameList, getGameRankAndScore, getGameRating, getTicketData, getTopTenUsers, getUserClaims, getUserCompletedGames, getUserGameRankAndScore, getUserPoints, getUserProgress, getUserRecentlyPlayedGames, getUserSummary, call as unsafe_call };