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