@retroachievements/api 1.0.0-rc.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +101 -60
  3. package/dist/achievement/getAchievementUnlocks.d.ts +1 -1
  4. package/dist/achievement/getAchievementUnlocks.test.d.ts +1 -0
  5. package/dist/api.cjs +2 -0
  6. package/dist/api.cjs.map +1 -0
  7. package/dist/api.modern.js +2 -0
  8. package/dist/api.modern.js.map +1 -0
  9. package/dist/api.module.js +2 -0
  10. package/dist/api.module.js.map +1 -0
  11. package/dist/api.umd.js +2 -0
  12. package/dist/api.umd.js.map +1 -0
  13. package/dist/console/getConsoleIds.test.d.ts +1 -0
  14. package/dist/console/getGameList.test.d.ts +1 -0
  15. package/dist/feed/getAchievementOfTheWeek.test.d.ts +1 -0
  16. package/dist/feed/getActiveClaims.test.d.ts +1 -0
  17. package/dist/feed/getTopTenUsers.d.ts +1 -1
  18. package/dist/feed/getTopTenUsers.test.d.ts +1 -0
  19. package/dist/feed/index.d.ts +0 -1
  20. package/dist/feed/models/index.d.ts +0 -12
  21. package/dist/game/getAchievementCount.d.ts +1 -1
  22. package/dist/game/getAchievementCount.test.d.ts +1 -0
  23. package/dist/game/getAchievementDistribution.test.d.ts +1 -0
  24. package/dist/game/getGame.test.d.ts +1 -0
  25. package/dist/game/getGameExtended.d.ts +1 -1
  26. package/dist/game/getGameExtended.test.d.ts +1 -0
  27. package/dist/game/getGameRankAndScore.test.d.ts +1 -0
  28. package/dist/game/getGameRating.test.d.ts +1 -0
  29. package/dist/game/models/game-rank-and-score-entity.model.d.ts +1 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.esm.js +2 -0
  32. package/dist/index.esm.js.map +1 -0
  33. package/dist/index.js +2 -8
  34. package/dist/index.js.map +1 -0
  35. package/dist/index.umd.js +2 -0
  36. package/dist/index.umd.js.map +1 -0
  37. package/dist/{feed → ticket}/getTicketData.d.ts +3 -3
  38. package/dist/ticket/getTicketData.test.d.ts +1 -0
  39. package/dist/ticket/index.d.ts +2 -0
  40. package/dist/{feed → ticket}/models/achievement-ticket-stats-response.model.d.ts +0 -0
  41. package/dist/{feed → ticket}/models/achievement-ticket-stats.model.d.ts +0 -0
  42. package/dist/{feed → ticket}/models/game-ticket-stats.model.d.ts +0 -0
  43. package/dist/{feed → ticket}/models/game-tickets-response.model.d.ts +0 -0
  44. package/dist/ticket/models/index.d.ts +12 -0
  45. package/dist/{feed → ticket}/models/most-ticketed-games-response.model.d.ts +0 -0
  46. package/dist/{feed → ticket}/models/most-ticketed-games.model.d.ts +0 -0
  47. package/dist/{feed → ticket}/models/recent-tickets-response.model.d.ts +0 -0
  48. package/dist/{feed → ticket}/models/recent-tickets.model.d.ts +0 -0
  49. package/dist/{feed → ticket}/models/response-ticket-entity.model.d.ts +0 -0
  50. package/dist/{feed → ticket}/models/ticket-entity.model.d.ts +0 -0
  51. package/dist/{feed → ticket}/models/tickets-by-user-response.model.d.ts +0 -0
  52. package/dist/{feed → ticket}/models/user-ticket-stats.model.d.ts +0 -0
  53. package/dist/user/getAchievementsEarnedBetween.test.d.ts +1 -0
  54. package/dist/user/getAchievementsEarnedOnDay.test.d.ts +1 -0
  55. package/dist/user/getGameInfoAndUserProgress.test.d.ts +1 -0
  56. package/dist/user/getUserClaims.test.d.ts +1 -0
  57. package/dist/user/getUserCompletedGames.test.d.ts +1 -0
  58. package/dist/user/getUserGameRankAndScore.test.d.ts +1 -0
  59. package/dist/user/getUserPoints.test.d.ts +1 -0
  60. package/dist/user/getUserProgress.test.d.ts +1 -0
  61. package/dist/user/getUserRecentlyPlayedGames.d.ts +1 -1
  62. package/dist/user/getUserRecentlyPlayedGames.test.d.ts +1 -0
  63. package/dist/user/getUserSummary.test.d.ts +1 -0
  64. package/dist/utils/internal/buildRequestUrl.test.d.ts +1 -0
  65. package/dist/utils/internal/call.test.d.ts +1 -0
  66. package/dist/utils/internal/serializeProperties.test.d.ts +1 -0
  67. package/dist/utils/public/buildAuthorization.d.ts +1 -1
  68. package/dist/utils/public/buildAuthorization.test.d.ts +1 -0
  69. package/package.json +21 -15
  70. package/src/achievement/getAchievementUnlocks.ts +1 -1
  71. package/src/feed/getTopTenUsers.ts +1 -1
  72. package/src/feed/index.ts +0 -1
  73. package/src/feed/models/index.ts +0 -12
  74. package/src/game/getAchievementCount.ts +1 -1
  75. package/src/game/getGameExtended.ts +1 -1
  76. package/src/game/models/game-rank-and-score-entity.model.ts +2 -1
  77. package/src/index.ts +1 -0
  78. package/src/{feed → ticket}/getTicketData.test.ts +0 -0
  79. package/src/{feed → ticket}/getTicketData.ts +3 -3
  80. package/src/ticket/index.ts +2 -0
  81. package/src/{feed → ticket}/models/achievement-ticket-stats-response.model.ts +0 -0
  82. package/src/{feed → ticket}/models/achievement-ticket-stats.model.ts +0 -0
  83. package/src/{feed → ticket}/models/game-ticket-stats.model.ts +0 -0
  84. package/src/{feed → ticket}/models/game-tickets-response.model.ts +0 -0
  85. package/src/ticket/models/index.ts +12 -0
  86. package/src/{feed → ticket}/models/most-ticketed-games-response.model.ts +0 -0
  87. package/src/{feed → ticket}/models/most-ticketed-games.model.ts +0 -0
  88. package/src/{feed → ticket}/models/recent-tickets-response.model.ts +0 -0
  89. package/src/{feed → ticket}/models/recent-tickets.model.ts +0 -0
  90. package/src/{feed → ticket}/models/response-ticket-entity.model.ts +0 -0
  91. package/src/{feed → ticket}/models/ticket-entity.model.ts +0 -0
  92. package/src/{feed → ticket}/models/tickets-by-user-response.model.ts +0 -0
  93. package/src/{feed → ticket}/models/user-ticket-stats.model.ts +0 -0
  94. package/src/user/getUserRecentlyPlayedGames.ts +1 -1
  95. package/src/utils/public/buildAuthorization.ts +1 -1
  96. package/dist/api.cjs.development.js +0 -2255
  97. package/dist/api.cjs.development.js.map +0 -1
  98. package/dist/api.cjs.production.min.js +0 -2
  99. package/dist/api.cjs.production.min.js.map +0 -1
  100. package/dist/api.esm.js +0 -2223
  101. package/dist/api.esm.js.map +0 -1
package/dist/api.esm.js DELETED
@@ -1,2223 +0,0 @@
1
- import unfetch from 'isomorphic-unfetch';
2
-
3
- function _regeneratorRuntime() {
4
- _regeneratorRuntime = function () {
5
- return exports;
6
- };
7
- var exports = {},
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";
17
- function define(obj, key, value) {
18
- return Object.defineProperty(obj, key, {
19
- value: value,
20
- enumerable: !0,
21
- configurable: !0,
22
- writable: !0
23
- }), obj[key];
24
- }
25
- try {
26
- define({}, "");
27
- } catch (err) {
28
- define = function (obj, key, value) {
29
- return obj[key] = value;
30
- };
31
- }
32
- function wrap(innerFn, outerFn, self, tryLocsList) {
33
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : 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;
39
- }
40
- function tryCatch(fn, obj, arg) {
41
- try {
42
- return {
43
- type: "normal",
44
- arg: fn.call(obj, arg)
45
- };
46
- } catch (err) {
47
- return {
48
- type: "throw",
49
- arg: err
50
- };
51
- }
52
- }
53
- exports.wrap = wrap;
54
- var ContinueSentinel = {};
55
- function Generator() {}
56
- function GeneratorFunction() {}
57
- function GeneratorFunctionPrototype() {}
58
- var IteratorPrototype = {};
59
- define(IteratorPrototype, iteratorSymbol, function () {
60
- return this;
61
- });
62
- var getProto = Object.getPrototypeOf,
63
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
64
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
65
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
66
- function defineIteratorMethods(prototype) {
67
- ["next", "throw", "return"].forEach(function (method) {
68
- define(prototype, method, function (arg) {
69
- return this._invoke(method, arg);
70
- });
71
- });
72
- }
73
- function AsyncIterator(generator, PromiseImpl) {
74
- function invoke(method, arg, resolve, reject) {
75
- var record = tryCatch(generator[method], generator, arg);
76
- if ("throw" !== record.type) {
77
- var result = record.arg,
78
- value = result.value;
79
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
80
- invoke("next", value, resolve, reject);
81
- }, function (err) {
82
- invoke("throw", err, resolve, reject);
83
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
84
- result.value = unwrapped, resolve(result);
85
- }, function (error) {
86
- return invoke("throw", error, resolve, reject);
87
- });
88
- }
89
- reject(record.arg);
90
- }
91
- var previousPromise;
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);
134
- }
135
- };
136
- }
137
- function maybeInvokeDelegate(delegate, context) {
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;
141
- var record = tryCatch(method, delegate.iterator, context.arg);
142
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
143
- var info = record.arg;
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);
145
- }
146
- function pushTryEntry(locs) {
147
- var entry = {
148
- tryLoc: locs[0]
149
- };
150
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
151
- }
152
- function resetTryEntry(entry) {
153
- var record = entry.completion || {};
154
- record.type = "normal", delete record.arg, entry.completion = record;
155
- }
156
- function Context(tryLocsList) {
157
- this.tryEntries = [{
158
- tryLoc: "root"
159
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
160
- }
161
- function values(iterable) {
162
- if (iterable) {
163
- var iteratorMethod = iterable[iteratorSymbol];
164
- if (iteratorMethod) return iteratorMethod.call(iterable);
165
- if ("function" == typeof iterable.next) return iterable;
166
- if (!isNaN(iterable.length)) {
167
- var i = -1,
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
- };
172
- return next.next = next;
173
- }
174
- }
175
- return {
176
- next: doneResult
177
- };
178
- }
179
- function doneResult() {
180
- return {
181
- value: undefined,
182
- done: !0
183
- };
184
- }
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) {
192
- var ctor = "function" == typeof genFun && genFun.constructor;
193
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
194
- }, exports.mark = function (genFun) {
195
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
196
- }, exports.awrap = function (arg) {
197
- return {
198
- __await: arg
199
- };
200
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
201
- return this;
202
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
203
- void 0 === PromiseImpl && (PromiseImpl = Promise);
204
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
205
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
206
- return result.done ? result.value : iter.next();
207
- });
208
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
209
- return this;
210
- }), define(Gp, "toString", function () {
211
- return "[object Generator]";
212
- }), exports.keys = function (val) {
213
- var object = Object(val),
214
- keys = [];
215
- for (var key in object) keys.push(key);
216
- return keys.reverse(), function next() {
217
- for (; keys.length;) {
218
- var key = keys.pop();
219
- if (key in object) return next.value = key, next.done = !1, next;
220
- }
221
- return next.done = !0, next;
222
- };
223
- }, exports.values = values, Context.prototype = {
224
- constructor: Context,
225
- reset: function (skipTempReset) {
226
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
227
- },
228
- stop: function () {
229
- this.done = !0;
230
- var rootRecord = this.tryEntries[0].completion;
231
- if ("throw" === rootRecord.type) throw rootRecord.arg;
232
- return this.rval;
233
- },
234
- dispatchException: function (exception) {
235
- if (this.done) throw exception;
236
- var context = this;
237
- function handle(loc, caught) {
238
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
239
- }
240
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
241
- var entry = this.tryEntries[i],
242
- record = entry.completion;
243
- if ("root" === entry.tryLoc) return handle("end");
244
- if (entry.tryLoc <= this.prev) {
245
- var hasCatch = hasOwn.call(entry, "catchLoc"),
246
- hasFinally = hasOwn.call(entry, "finallyLoc");
247
- if (hasCatch && hasFinally) {
248
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
249
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
250
- } else if (hasCatch) {
251
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
252
- } else {
253
- if (!hasFinally) throw new Error("try statement without catch or finally");
254
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
255
- }
256
- }
257
- }
258
- },
259
- abrupt: function (type, arg) {
260
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
261
- var entry = this.tryEntries[i];
262
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
263
- var finallyEntry = entry;
264
- break;
265
- }
266
- }
267
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
268
- var record = finallyEntry ? finallyEntry.completion : {};
269
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
270
- },
271
- complete: function (record, afterLoc) {
272
- if ("throw" === record.type) throw record.arg;
273
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
274
- },
275
- finish: function (finallyLoc) {
276
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
277
- var entry = this.tryEntries[i];
278
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
279
- }
280
- },
281
- catch: function (tryLoc) {
282
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
283
- var entry = this.tryEntries[i];
284
- if (entry.tryLoc === tryLoc) {
285
- var record = entry.completion;
286
- if ("throw" === record.type) {
287
- var thrown = record.arg;
288
- resetTryEntry(entry);
289
- }
290
- return thrown;
291
- }
292
- }
293
- throw new Error("illegal catch attempt");
294
- },
295
- delegateYield: function (iterable, resultName, nextLoc) {
296
- return this.delegate = {
297
- iterator: values(iterable),
298
- resultName: resultName,
299
- nextLoc: nextLoc
300
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
301
- }
302
- }, exports;
303
- }
304
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
305
- try {
306
- var info = gen[key](arg);
307
- var value = info.value;
308
- } catch (error) {
309
- reject(error);
310
- return;
311
- }
312
- if (info.done) {
313
- resolve(value);
314
- } else {
315
- Promise.resolve(value).then(_next, _throw);
316
- }
317
- }
318
- function _asyncToGenerator(fn) {
319
- return function () {
320
- var self = this,
321
- args = arguments;
322
- return new Promise(function (resolve, reject) {
323
- var gen = fn.apply(self, args);
324
- function _next(value) {
325
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
326
- }
327
- function _throw(err) {
328
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
329
- }
330
- _next(undefined);
331
- });
332
- };
333
- }
334
- function _extends() {
335
- _extends = Object.assign ? Object.assign.bind() : function (target) {
336
- for (var i = 1; i < arguments.length; i++) {
337
- var source = arguments[i];
338
- for (var key in source) {
339
- if (Object.prototype.hasOwnProperty.call(source, key)) {
340
- target[key] = source[key];
341
- }
342
- }
343
- }
344
- return target;
345
- };
346
- return _extends.apply(this, arguments);
347
- }
348
- function _unsupportedIterableToArray(o, minLen) {
349
- if (!o) return;
350
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
351
- var n = Object.prototype.toString.call(o).slice(8, -1);
352
- if (n === "Object" && o.constructor) n = o.constructor.name;
353
- if (n === "Map" || n === "Set") return Array.from(o);
354
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
355
- }
356
- function _arrayLikeToArray(arr, len) {
357
- if (len == null || len > arr.length) len = arr.length;
358
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
359
- return arr2;
360
- }
361
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
362
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
363
- if (it) return (it = it.call(o)).next.bind(it);
364
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
365
- if (it) o = it;
366
- var i = 0;
367
- return function () {
368
- if (i >= o.length) return {
369
- done: true
370
- };
371
- return {
372
- done: false,
373
- value: o[i++]
374
- };
375
- };
376
- }
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.");
378
- }
379
-
380
- var apiBaseUrl = "https://retroachievements.org/API";
381
-
382
- var buildRequestUrl = function buildRequestUrl(baseUrl, endpointUrl, authObject, args) {
383
- if (args === void 0) {
384
- args = {};
385
- }
386
- var concatenated = baseUrl + "/" + endpointUrl;
387
- var withoutDoubleSlashes = concatenated.replace(/([^:]\/)\/+/g, "$1");
388
- var withArgs = withoutDoubleSlashes;
389
- // `z` and `y` are expected query params from the RA API.
390
- // Authentication is handled purely by query params.
391
- var queryParamValues = {
392
- z: authObject.userName,
393
- y: authObject.webApiKey
394
- };
395
- for (var _i = 0, _Object$entries = Object.entries(args); _i < _Object$entries.length; _i++) {
396
- var _Object$entries$_i = _Object$entries[_i],
397
- argKey = _Object$entries$_i[0],
398
- argValue = _Object$entries$_i[1];
399
- // "abc.com/some-route/:foo/some-path" & {"foo": 4} --> "abc.com/some-route/4/some-path"
400
- if (withArgs.includes(":" + argKey)) {
401
- withArgs = withArgs.replace(":" + argKey, String(argValue));
402
- } else if (argValue !== undefined) {
403
- queryParamValues[argKey] = String(argValue);
404
- }
405
- }
406
- var queryString = new URLSearchParams(queryParamValues).toString();
407
- return withArgs + "?" + queryString;
408
- };
409
-
410
- /**
411
- * Fetch an HTTP resource. This is publicly exposed in the
412
- * event you would like to access an endpoint that this
413
- * library does not currently support.
414
- *
415
- * UNLESS YOU'RE SURE OF WHAT YOU'RE DOING, YOU PROBABLY
416
- * SHOULDN'T USE THIS FUNCTION.
417
- *
418
- * 2022-10-09: At the time of writing, Node.js LTS (16.x)
419
- * does not yet support fetch. As a result, we pull in
420
- * isomorphic-unfetch for Node.js compatibility. Our support
421
- * matrix includes 14.x and 16.x.
422
- *
423
- * @FIXME - When Node.js 20.x is released, remove the
424
- * isomorphic-unfetch dependency. At that point we will have
425
- * two major LTS versions that include a native fetch API.
426
- */
427
- var call = /*#__PURE__*/function () {
428
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config) {
429
- var url, rawResponse;
430
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
445
- }
446
- }, _callee);
447
- }));
448
- return function call(_x) {
449
- return _ref.apply(this, arguments);
450
- };
451
- }();
452
-
453
- /* eslint-disable sonarjs/cognitive-complexity */
454
- /* eslint-disable sonarjs/prefer-immediate-return */
455
- var serializeProperties = function serializeProperties(originalData, options) {
456
- if (options === void 0) {
457
- options = {};
458
- }
459
- var _options = options,
460
- shouldCastToNumbers = _options.shouldCastToNumbers,
461
- shouldMapToBooleans = _options.shouldMapToBooleans;
462
- var returnValue = originalData;
463
- if (Array.isArray(originalData)) {
464
- var cleanedArray = [];
465
- for (var _iterator = _createForOfIteratorHelperLoose(originalData), _step; !(_step = _iterator()).done;) {
466
- var entity = _step.value;
467
- cleanedArray.push(serializeProperties(entity, options));
468
- }
469
- returnValue = cleanedArray;
470
- } else if (!Array.isArray(originalData) && originalData instanceof Object) {
471
- var cleanedObject = {};
472
- for (var _i = 0, _Object$entries = Object.entries(originalData); _i < _Object$entries.length; _i++) {
473
- var _extends2;
474
- var _Object$entries$_i = _Object$entries[_i],
475
- originalKey = _Object$entries$_i[0],
476
- originalValue = _Object$entries$_i[1];
477
- var sanitizedValue = originalValue;
478
- if (shouldCastToNumbers != null && shouldCastToNumbers.includes(originalKey)) {
479
- sanitizedValue = originalValue === null ? null : Number(originalValue);
480
- }
481
- if (shouldMapToBooleans != null && shouldMapToBooleans.includes(originalKey)) {
482
- if (originalValue === null) {
483
- sanitizedValue = null;
484
- } else {
485
- sanitizedValue = originalValue === "1" ? true : false;
486
- }
487
- }
488
- cleanedObject = _extends({}, cleanedObject, (_extends2 = {}, _extends2[naiveCamelCase(originalKey)] = serializeProperties(sanitizedValue, options), _extends2));
489
- }
490
- returnValue = cleanedObject;
491
- }
492
- return returnValue;
493
- };
494
- var naiveCamelCase = function naiveCamelCase(originalValue) {
495
- // "ID" --> "id", "URL" --> "url"
496
- if (originalValue.toUpperCase() === originalValue) {
497
- return originalValue.toLowerCase();
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"
506
- camelCased = camelCased.replace(/rA/g, "ra");
507
- return camelCased;
508
- };
509
-
510
- /**
511
- * A call to this function will retrieve a list of users who
512
- * have earned the given achievementId.
513
- *
514
- * @param authorization An object containing your userName and webApiKey.
515
- * This can be constructed with `buildAuthorization()`.
516
- *
517
- * @param payload.achievementId The target achievement we want to
518
- * retrieve the unlocks list for. If unknown, this can be found
519
- * by navigating to the achievement's page on the RetroAchievements.org
520
- * website. eg: https://retroachievements.org/achievement/13876 has an
521
- * ID of 13876.
522
- *
523
- * @param payload.offset Defaults to 0. The number of entries to skip.
524
- *
525
- * @param payload.count Defaults to 50, has a max of 500.
526
- *
527
- * @example
528
- * ```
529
- * const achievementUnlocks = await getAchievementUnlocks(
530
- * authorization,
531
- * { achievementId: 13876 }
532
- * );
533
- * ```
534
- *
535
- * @returns An array containing metadata about unlocks for
536
- * the target achievement.
537
- * ```
538
- * [
539
- * {
540
- * user: 'Podgicus0305',
541
- * raPoints: 15544,
542
- * dateAwarded: '2022-07-12 19:06:34',
543
- * hardcoreMode: true
544
- * }
545
- * ]
546
- * ```
547
- */
548
- var getAchievementUnlocks = /*#__PURE__*/function () {
549
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
550
- var achievementId, offset, count, queryParams, url, rawResponse;
551
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
578
- }
579
- }, _callee);
580
- }));
581
- return function getAchievementUnlocks(_x, _x2) {
582
- return _ref.apply(this, arguments);
583
- };
584
- }();
585
-
586
- /**
587
- * A call to this function will retrieve the complete list
588
- * of console ID and name pairs on the RetroAchievements.org
589
- * platform.
590
- *
591
- * @param authorization An object containing your userName and webApiKey.
592
- * This can be constructed with `buildAuthorization()`.
593
- *
594
- * @example
595
- * ```
596
- * const consoleIds = await getConsoleIds(authorization);
597
- * ```
598
- *
599
- * @returns An array containing a complete list of console ID
600
- * and name pairs for RetroAchievements.org.
601
- * ```
602
- * { id: "1", name: "Mega Drive" }
603
- * ```
604
- */
605
- var getConsoleIds = /*#__PURE__*/function () {
606
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
607
- var url, rawResponse;
608
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
624
- }
625
- }, _callee);
626
- }));
627
- return function getConsoleIds(_x) {
628
- return _ref.apply(this, arguments);
629
- };
630
- }();
631
-
632
- /**
633
- * A call to this function will retrieve the complete list
634
- * of games for a specified console on the RetroAchievements.org
635
- * platform.
636
- *
637
- * @param authorization An object containing your userName and webApiKey.
638
- * This can be constructed with `buildAuthorization()`.
639
- *
640
- * @param payload.consoleId The unique console ID to retrieve a list of
641
- * games from. The list of consoleIds can be retrieved using the `getConsoleIds()`
642
- * function provided by this library.
643
- *
644
- * @param payload.shouldOnlyRetrieveGamesWithAchievements If truthy, will not
645
- * return games that do not have achievements.
646
- *
647
- * @param payload.shouldRetrieveGameHashes If truthy, will return valid
648
- * hashes for game ROMs in an array attached to each game in the list.
649
- *
650
- * @example
651
- * ```
652
- * const gameList = await getGameList(
653
- * authorization,
654
- * { consoleId: 1, shouldOnlyRetrieveGamesWithAchievements: true }
655
- * );
656
- * ```
657
- *
658
- * @returns An array containing a list of games for a given consoleId.
659
- * ```
660
- * [
661
- * {
662
- * title: "Elemental Master",
663
- * id: 4247,
664
- * consoleId: 1,
665
- * consoleName: "Mega Drive",
666
- * imageIcon: "/Images/048245.png",
667
- * numAchievements: 44,
668
- * numLeaderboards: 0,
669
- * points: 500,
670
- * dateModified: "2021-12-09 17:05:39",
671
- * forumTopicId: 1972,
672
- * hashes: ["32e1a15161ef1f070b023738353bde51"]
673
- * }
674
- * ]
675
- * ```
676
- */
677
- var getGameList = /*#__PURE__*/function () {
678
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
679
- var consoleId, shouldOnlyRetrieveGamesWithAchievements, shouldRetrieveGameHashes, callPayload, url, rawResponse;
680
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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
690
- });
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();
710
- }
711
- }, _callee);
712
- }));
713
- return function getGameList(_x, _x2) {
714
- return _ref.apply(this, arguments);
715
- };
716
- }();
717
-
718
- /**
719
- * A call to this function will retrieve comprehensive
720
- * metadata about the current Achievement of the Week.
721
- *
722
- * @param authorization An object containing your userName and webApiKey.
723
- * This can be constructed with `buildAuthorization()`.
724
- *
725
- * @example
726
- * ```
727
- * const achievementOfTheWeek = await getAchievementOfTheWeek(
728
- * authorization
729
- * );
730
- * ```
731
- *
732
- * @returns An object containing comprehensive metadata
733
- * about the current Achievement of the Week.
734
- * ```
735
- * {
736
- * achievement: {
737
- * id: "165062",
738
- * title: "The True Hero",
739
- * description: "Receive any Ending as Han [Normal or Hard]",
740
- * points: "10",
741
- * trueRatio: "22",
742
- * author: "BigWeedSmokerMan",
743
- * dateCreated: "2021-08-08 17:47:46",
744
- * dateModified: "2021-08-09 12:20:05"
745
- * },
746
- * console: { id: "39", title: "Saturn" },
747
- * forumTopic: { id: "14767" },
748
- * game: { id: "14513", title: "Guardian Heroes" },
749
- * startAt: "2022-10-10 00:00:00",
750
- * totalPlayers: "219",
751
- * unlocks: [
752
- * {
753
- * user: "Tirbaba2",
754
- * rAPoints: "72",
755
- * dateAwarded: "2022-10-10 01:42:19",
756
- * hardcoreMode: "1"
757
- * }
758
- * ],
759
- * unlocksCount: "40"
760
- * }
761
- * ```
762
- */
763
- var getAchievementOfTheWeek = /*#__PURE__*/function () {
764
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
765
- var url, rawResponse;
766
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
783
- }
784
- }, _callee);
785
- }));
786
- return function getAchievementOfTheWeek(_x) {
787
- return _ref.apply(this, arguments);
788
- };
789
- }();
790
-
791
- /**
792
- * A call to this function returns information about all
793
- * (1000 max) active set claims.
794
- *
795
- * @param authorization An object containing your userName and webApiKey.
796
- * This can be constructed with `buildAuthorization()`.
797
- *
798
- * @example
799
- * ```
800
- * const activeClaims = await getActiveClaims(authorization);
801
- * ```
802
- *
803
- * @returns An array containing metadata about all active claims.
804
- * ```
805
- * [
806
- * {
807
- * id: 7044,
808
- * user: "blendedsea",
809
- * gameId: 19212,
810
- * gameTitle: "SpongeBob SquarePants: Battle for Bikini Bottom",
811
- * gameIcon: "/Images/059776.png",
812
- * consoleName: "PlayStation 2",
813
- * claimType: 0,
814
- * setType: 0,
815
- * status: 0,
816
- * extension: 0,
817
- * special: 0,
818
- * created: "2022-10-04 00:25:06",
819
- * doneTime: "2023-01-04 00:25:06",
820
- * updated: "2022-10-04 00:25:06",
821
- * minutesLeft: 112523
822
- * }
823
- * ]
824
- * ```
825
- */
826
- var getActiveClaims = /*#__PURE__*/function () {
827
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
828
- var url, rawResponse;
829
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
845
- }
846
- }, _callee);
847
- }));
848
- return function getActiveClaims(_x) {
849
- return _ref.apply(this, arguments);
850
- };
851
- }();
852
-
853
- /**
854
- * END: Function overload definitions
855
- */
856
- function getTicketData(_x, _x2) {
857
- return _getTicketData.apply(this, arguments);
858
- }
859
- function _getTicketData() {
860
- _getTicketData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
861
- var queryParams, url, rawResponse;
862
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
883
- }
884
- }, _callee);
885
- }));
886
- return _getTicketData.apply(this, arguments);
887
- }
888
- var buildGetTicketDataQueryParams = function buildGetTicketDataQueryParams(payload) {
889
- var ticketId = payload.ticketId,
890
- isGettingMostTicketedGames = payload.isGettingMostTicketedGames,
891
- userName = payload.userName,
892
- gameId = payload.gameId,
893
- isGettingTicketsForUnofficialAchievements = payload.isGettingTicketsForUnofficialAchievements,
894
- shouldReturnTicketsList = payload.shouldReturnTicketsList,
895
- achievementId = payload.achievementId;
896
- var queryParams = {};
897
- if (ticketId !== undefined) {
898
- queryParams["i"] = ticketId;
899
- } else if (isGettingMostTicketedGames) {
900
- queryParams["f"] = "1";
901
- queryParams = applyPaginationQueryParams(queryParams, payload);
902
- } else if (userName) {
903
- queryParams["u"] = userName;
904
- } else if (gameId) {
905
- queryParams["g"] = gameId;
906
- if (isGettingTicketsForUnofficialAchievements) {
907
- queryParams["f"] = "5";
908
- }
909
- if (shouldReturnTicketsList) {
910
- queryParams["d"] = "1";
911
- }
912
- } else if (achievementId) {
913
- queryParams["a"] = achievementId;
914
- } else {
915
- queryParams = applyPaginationQueryParams(queryParams, payload);
916
- }
917
- return queryParams;
918
- };
919
- var applyPaginationQueryParams = function applyPaginationQueryParams(currentParams, payload) {
920
- var modifiedParams = _extends({}, currentParams);
921
- if (payload.count !== undefined) {
922
- modifiedParams["c"] = payload.count;
923
- }
924
- if (payload.offset !== undefined) {
925
- modifiedParams["o"] = payload.offset;
926
- }
927
- return modifiedParams;
928
- };
929
-
930
- /**
931
- * A call to this function will retrieve the current top ten users
932
- * on the site.
933
- *
934
- * @param authorization An object containing your userName and webApiKey.
935
- * This can be constructed with `buildAuthorization()`.
936
- *
937
- * @example
938
- * ```
939
- * const topTenUsers = await getTopTenUsers(authorization);
940
- * ```
941
- *
942
- * @returns An array containing the list of top ten users.
943
- * ```json
944
- * [
945
- * { userName: "MockUser", totalPoints: 350000, totalRatioPoints: 995000 },
946
- * { userName: "MockUser2", totalPoints: 345000, totalRatioPoints: 994000 },
947
- * ...
948
- * ]
949
- * ```
950
- */
951
- var getTopTenUsers = /*#__PURE__*/function () {
952
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization) {
953
- var url, rawTopTenUsers, sanitizedTopTenUsers, _iterator, _step, rawUser;
954
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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"])
971
- });
972
- }
973
- return _context.abrupt("return", sanitizedTopTenUsers);
974
- case 7:
975
- case "end":
976
- return _context.stop();
977
- }
978
- }, _callee);
979
- }));
980
- return function getTopTenUsers(_x) {
981
- return _ref.apply(this, arguments);
982
- };
983
- }();
984
-
985
- var ClaimType;
986
- (function (ClaimType) {
987
- ClaimType[ClaimType["Primary"] = 0] = "Primary";
988
- ClaimType[ClaimType["Collaboration"] = 1] = "Collaboration";
989
- })(ClaimType || (ClaimType = {}));
990
- var ClaimSetType;
991
- (function (ClaimSetType) {
992
- ClaimSetType[ClaimSetType["NewSet"] = 0] = "NewSet";
993
- ClaimSetType[ClaimSetType["Revision"] = 1] = "Revision";
994
- })(ClaimSetType || (ClaimSetType = {}));
995
- var ClaimStatus;
996
- (function (ClaimStatus) {
997
- ClaimStatus[ClaimStatus["Active"] = 0] = "Active";
998
- ClaimStatus[ClaimStatus["Complete"] = 1] = "Complete";
999
- ClaimStatus[ClaimStatus["Dropped"] = 2] = "Dropped";
1000
- })(ClaimStatus || (ClaimStatus = {}));
1001
-
1002
- /**
1003
- * A call to this function will retrieve the list of
1004
- * achievement IDs for a game.
1005
- *
1006
- * @param authorization An object containing your userName and webApiKey.
1007
- * This can be constructed with `buildAuthorization()`.
1008
- *
1009
- * @param payload.gameId The unique game ID. If you are unsure, open the
1010
- * game's page on the RetroAchievements.org website. For example, Dragster's
1011
- * URL is https://retroachievements.org/game/14402. We can see from the
1012
- * URL that the game ID is "14402".
1013
- *
1014
- * @example
1015
- * ```
1016
- * const achievementCount = await getAchievementCount(
1017
- * authorization,
1018
- * { gameId: 14402 }
1019
- * );
1020
- * ```
1021
- *
1022
- * @returns An object containing a gameId and a list of
1023
- * achievementIds.
1024
- * ```
1025
- * { gameId: 14402, achievementIds: [1,2,3,4,5] }
1026
- * ```
1027
- */
1028
- var getAchievementCount = /*#__PURE__*/function () {
1029
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1030
- var gameId, url, rawResponse;
1031
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1048
- }
1049
- }, _callee);
1050
- }));
1051
- return function getAchievementCount(_x, _x2) {
1052
- return _ref.apply(this, arguments);
1053
- };
1054
- }();
1055
-
1056
- /**
1057
- * A call to this function will retrieve a dictionary
1058
- * of the number of players who have earned a specific
1059
- * number of achievements for a given game ID.
1060
- *
1061
- * @param authorization An object containing your userName and webApiKey.
1062
- * This can be constructed with `buildAuthorization()`.
1063
- *
1064
- * @param payload.gameId The unique game ID. If you are unsure, open the
1065
- * game's page on the RetroAchievements.org website. For example, Dragster's
1066
- * URL is https://retroachievements.org/game/14402. We can see from the
1067
- * URL that the game ID is "14402".
1068
- *
1069
- * @param payload.flags Optional. By default, only official achievement
1070
- * tallies are returned in the response. Import the `AchievementDistributionFlags`
1071
- * enum for possible values. This lets you see the count of players who have
1072
- * unlocked unofficial achievements.
1073
- *
1074
- * @param payload.hardcore Optional. By default, set to false, with both
1075
- * softcore and hardcore tallies returned in the response. If this option
1076
- * is set to true, only hardcore unlocks will be included in the totals.
1077
- *
1078
- * @example
1079
- * ```
1080
- * const achievementDistribution = await getAchievementDistribution(
1081
- * authorization,
1082
- * { gameId: 14402, hardcore: true }
1083
- * );
1084
- * ```
1085
- *
1086
- * @returns A dictionary where the keys represent the earned achievement
1087
- * count and the values represent the number of players who have unlocked
1088
- * that many achievements.
1089
- * ```
1090
- * {
1091
- * '1': 64,
1092
- * '2': 19,
1093
- * '3': 11,
1094
- * '4': 18,
1095
- * '5': 25,
1096
- * '6': 20,
1097
- * '7': 26,
1098
- * '8': 29,
1099
- * '9': 54,
1100
- * '10': 17,
1101
- * '11': 29,
1102
- * '12': 4
1103
- * }
1104
- * ```
1105
- */
1106
- var getAchievementDistribution = /*#__PURE__*/function () {
1107
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1108
- var gameId, flags, hardcore, queryParams, url;
1109
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1132
- }
1133
- }, _callee);
1134
- }));
1135
- return function getAchievementDistribution(_x, _x2) {
1136
- return _ref.apply(this, arguments);
1137
- };
1138
- }();
1139
-
1140
- /**
1141
- * A call to this function will retrieve basic metadata about
1142
- * a game, targeted via its unique ID.
1143
- *
1144
- * @param authorization An object containing your userName and webApiKey.
1145
- * This can be constructed with `buildAuthorization()`.
1146
- *
1147
- * @param payload.gameId The unique game ID. If you are unsure, open the
1148
- * game's page on the RetroAchievements.org website. For example, Dragster's
1149
- * URL is https://retroachievements.org/game/14402. We can see from the
1150
- * URL that the game ID is "14402".
1151
- *
1152
- * @example
1153
- * ```
1154
- * const game = await getGame(
1155
- * authorization,
1156
- * { gameId: 14402 }
1157
- * );
1158
- * ```
1159
- *
1160
- * @returns An object containing basic metadata about a target game.
1161
- * ```json
1162
- * {
1163
- * id: 14402,
1164
- * title: "Dragster",
1165
- * forumTopicId: 9145,
1166
- * consoleId: 25,
1167
- * consoleName: "Atari 2600",
1168
- * flags: 0,
1169
- * imageIcon: "/Images/026368.png",
1170
- * gameIcon: "/Images/026368.png",
1171
- * imageTitle: "/Images/026366.png",
1172
- * imageIngame: "/Images/026367.png",
1173
- * imageBoxArt: "/Images/026365.png",
1174
- * publisher: "Activision",
1175
- * developer: "David Crane",
1176
- * genre: "Racing",
1177
- * released: 1980,
1178
- * gameTitle: "Dragster",
1179
- * console: "Atari 2600"
1180
- * }
1181
- * ```
1182
- */
1183
- var getGame = /*#__PURE__*/function () {
1184
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1185
- var gameId, url, rawResponse;
1186
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1205
- }
1206
- }, _callee);
1207
- }));
1208
- return function getGame(_x, _x2) {
1209
- return _ref.apply(this, arguments);
1210
- };
1211
- }();
1212
-
1213
- /**
1214
- * A call to this function will retrieve extended metadata
1215
- * about a game, targeted via its unique ID.
1216
- *
1217
- * @param authorization An object containing your userName and webApiKey.
1218
- * This can be constructed with `buildAuthorization()`.
1219
- *
1220
- * @param payload.gameId The unique game ID. If you are unsure, open the
1221
- * game's page on the RetroAchievements.org website. For example, Dragster's
1222
- * URL is https://retroachievements.org/game/14402. We can see from the
1223
- * URL that the game ID is "14402".
1224
- *
1225
- * @example
1226
- * ```
1227
- * const gameExtended = await getGameExtended(
1228
- * authorization,
1229
- * { gameId: 14402 }
1230
- * );
1231
- * ```
1232
- *
1233
- * @returns An object containing extended metadata about a target game.
1234
- * ```json
1235
- * {
1236
- * id: 14402,
1237
- * title: "Dragster",
1238
- * consoleId: 25,
1239
- * forumTopicId: 9145,
1240
- * flags: 0,
1241
- * imageIcon: "/Images/026368.png",
1242
- * imageTitle: "/Images/026366.png",
1243
- * imageIngame: "/Images/026367.png",
1244
- * imageBoxArt: "/Images/026365.png",
1245
- * publisher: "Activision",
1246
- * developer: "David Crane",
1247
- * genre: "Racing",
1248
- * released: 1980,
1249
- * isFinal: false,
1250
- * consoleName: "Atari 2600",
1251
- * richPresencePatch: "2b92fa1bf9635c303b3b7f8feea3ed3c",
1252
- * numAchievements: 12,
1253
- * numDistinctPlayersCasual: 454,
1254
- * numDistinctPlayersHardcore, 323
1255
- * claims: [],
1256
- * achievements: {
1257
- * '79434': {
1258
- * id: 79434,
1259
- * numAwarded: 338,
1260
- * numAwardedHardcore: 253,
1261
- * title: "Novice Dragster Driver 1",
1262
- * description: "Complete your very first race in game 1.",
1263
- * points: 1,
1264
- * trueRatio: 1,
1265
- * author: "Boldewin",
1266
- * dateModified: "2019-08-01 19:03:46",
1267
- * dateCreated: "2019-07-31 18:49:57",
1268
- * badgeName: "85541",
1269
- * displayOrder: 0,
1270
- * memAddr: "f5c41fa0b5fa0d5fbb8a74c598f18582"
1271
- * }
1272
- * }
1273
- * }
1274
- * ```
1275
- */
1276
- var getGameExtended = /*#__PURE__*/function () {
1277
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1278
- var gameId, url, rawResponse;
1279
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1298
- }
1299
- }, _callee);
1300
- }));
1301
- return function getGameExtended(_x, _x2) {
1302
- return _ref.apply(this, arguments);
1303
- };
1304
- }();
1305
-
1306
- /**
1307
- * A call to this function will retrieve metadata about
1308
- * either the latest masters for a game, or the highest
1309
- * points earners for a game. The game is targeted via
1310
- * its unique ID.
1311
- *
1312
- * @param authorization An object containing your userName and webApiKey.
1313
- * This can be constructed with `buildAuthorization()`.
1314
- *
1315
- * @param payload.gameId The unique game ID. If you are unsure, open the
1316
- * game's page on the RetroAchievements.org website. For example, Dragster's
1317
- * URL is https://retroachievements.org/game/14402. We can see from the
1318
- * URL that the game ID is "14402".
1319
- *
1320
- * @param payload.type Can either be "latest-masters" or "high-scores".
1321
- *
1322
- * @example
1323
- * ```
1324
- * const gameRankAndScore = await getGameRankAndScore(
1325
- * authorization,
1326
- * { gameId: 14402, type: "latest-masters" }
1327
- * );
1328
- * ```
1329
- *
1330
- * @returns An array containing a list of latest masters or
1331
- * high score earners for a given game ID.
1332
- * ```json
1333
- * [
1334
- * { user: 'Arekdias', totalScore: 189, lastAward: '2020-10-10 22:43:32' }
1335
- * ]
1336
- * ```
1337
- */
1338
- var getGameRankAndScore = /*#__PURE__*/function () {
1339
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1340
- var gameId, type, url, rawResponse;
1341
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1361
- }
1362
- }, _callee);
1363
- }));
1364
- return function getGameRankAndScore(_x, _x2) {
1365
- return _ref.apply(this, arguments);
1366
- };
1367
- }();
1368
-
1369
- /**
1370
- * A call to this function will retrieve metadata about
1371
- * how users have rated the game and its set.
1372
- *
1373
- * @param authorization An object containing your userName and webApiKey.
1374
- * This can be constructed with `buildAuthorization()`.
1375
- *
1376
- * @param payload.gameId The unique game ID. If you are unsure, open the
1377
- * game's page on the RetroAchievements.org website. For example, Dragster's
1378
- * URL is https://retroachievements.org/game/14402. We can see from the
1379
- * URL that the game ID is "14402".
1380
- *
1381
- * @example
1382
- * ```
1383
- * const gameRating = await getGameRating(
1384
- * authorization,
1385
- * { gameId: 14402 }
1386
- * );
1387
- * ```
1388
- *
1389
- * @returns An object with game rating metadata.
1390
- * ```json
1391
- * {
1392
- * gameId: 14402,
1393
- * ratings: {
1394
- * game: 3.1875,
1395
- * achievements: 0,
1396
- * gameNumVotes: 16,
1397
- * achievementsNumVotes: 0
1398
- * }
1399
- * }
1400
- * ```
1401
- */
1402
- var getGameRating = /*#__PURE__*/function () {
1403
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1404
- var gameId, url, rawResponse;
1405
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1422
- }
1423
- }, _callee);
1424
- }));
1425
- return function getGameRating(_x, _x2) {
1426
- return _ref.apply(this, arguments);
1427
- };
1428
- }();
1429
-
1430
- var AchievementDistributionFlags;
1431
- (function (AchievementDistributionFlags) {
1432
- AchievementDistributionFlags[AchievementDistributionFlags["CoreAchievements"] = 3] = "CoreAchievements";
1433
- AchievementDistributionFlags[AchievementDistributionFlags["UnofficialAchievements"] = 5] = "UnofficialAchievements";
1434
- })(AchievementDistributionFlags || (AchievementDistributionFlags = {}));
1435
-
1436
- // NOTE: This cannot be a true extension of the `GetGameResponse`
1437
- // interface because the return types for many of these fields
1438
- // are different from the actual RA API.
1439
- var GameExtendedClaimType;
1440
- (function (GameExtendedClaimType) {
1441
- GameExtendedClaimType["Primary"] = "0";
1442
- GameExtendedClaimType["Collaboration"] = "1";
1443
- })(GameExtendedClaimType || (GameExtendedClaimType = {}));
1444
-
1445
- /**
1446
- * A call to this function will retrieve a list of achievements
1447
- * earned by a given user between two provided dates.
1448
- *
1449
- * @param authorization An object containing your userName and webApiKey.
1450
- * This can be constructed with `buildAuthorization()`.
1451
- *
1452
- * @param payload.userName The user for which to retrieve the
1453
- * list of achievements for.
1454
- *
1455
- * @param payload.fromDate A Date object specifying when
1456
- * the list itself should begin.
1457
- *
1458
- * @param payload.toDate A Date object specifying when
1459
- * the list itself should end.
1460
- *
1461
- * @example
1462
- * ```
1463
- * const achievementsEarnedBetween = await getAchievementsEarnedBetween(
1464
- * authorization,
1465
- * {
1466
- * userName: "xelnia",
1467
- * fromDate: new Date("2022-10-12"),
1468
- * toDate: new Date("2022-10-13")
1469
- * }
1470
- * );
1471
- * ```
1472
- *
1473
- * @returns An array containing metadata about the user
1474
- * achievements earned during the specified date range.
1475
- * ```
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
- * ]
1495
- * ```
1496
- */
1497
- var getAchievementsEarnedBetween = /*#__PURE__*/function () {
1498
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1499
- var userName, fromDate, toDate, url, rawResponse;
1500
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1522
- }
1523
- }, _callee);
1524
- }));
1525
- return function getAchievementsEarnedBetween(_x, _x2) {
1526
- return _ref.apply(this, arguments);
1527
- };
1528
- }();
1529
-
1530
- /**
1531
- * A call to this function will retrieve a list of achievements
1532
- * earned by a given user on a specified date.
1533
- *
1534
- * @param authorization An object containing your userName and webApiKey.
1535
- * This can be constructed with `buildAuthorization()`.
1536
- *
1537
- * @param payload.userName The user for which to retrieve the
1538
- * list of achievements for.
1539
- *
1540
- * @param payload.fromDate A Date object specifying when
1541
- * the list itself should begin.
1542
- *
1543
- * @param payload.onDate A Date object specifying the day
1544
- * to query for a user's earned achievements.
1545
- *
1546
- * @example
1547
- * ```
1548
- * const achievementsEarnedOnDay = await getAchievementsEarnedOnDay(
1549
- * authorization,
1550
- * {
1551
- * userName: "xelnia",
1552
- * onDate: new Date("2022-10-13")
1553
- * }
1554
- * );
1555
- * ```
1556
- *
1557
- * @returns An array containing metadata about the user
1558
- * achievements earned on the specified day.
1559
- * ```
1560
- * [
1561
- * {
1562
- * date: '2022-10-12 07:58:05',
1563
- * hardcoreMode: true,
1564
- * achievementId: 173315,
1565
- * title: 'Your Puny Human Weapons',
1566
- * description: 'Collect all objects in the Weapons Category.',
1567
- * badgeName: '193756',
1568
- * points: 10,
1569
- * author: 'blendedsea',
1570
- * gameTitle: 'Me & My Katamari',
1571
- * gameIcon: '/Images/047357.png',
1572
- * gameId: 3571,
1573
- * consoleName: 'PlayStation Portable',
1574
- * cumulScore: 120,
1575
- * badgeUrl: '/Badge/193756.png',
1576
- * gameUrl: '/game/3571'
1577
- * }
1578
- * ]
1579
- * ```
1580
- */
1581
- var getAchievementsEarnedOnDay = /*#__PURE__*/function () {
1582
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1583
- var userName, onDate, url, rawResponse;
1584
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1606
- }
1607
- }, _callee);
1608
- }));
1609
- return function getAchievementsEarnedOnDay(_x, _x2) {
1610
- return _ref.apply(this, arguments);
1611
- };
1612
- }();
1613
-
1614
- /**
1615
- * A call to this function will retrieve extended metadata
1616
- * about a game, in addition to a user's progress about a game.
1617
- * This is targeted via a game's unique ID and a given username.
1618
- *
1619
- * @param authorization An object containing your userName and webApiKey.
1620
- * This can be constructed with `buildAuthorization()`.
1621
- *
1622
- * @param payload.gameId The unique game ID. If you are unsure, open the
1623
- * game's page on the RetroAchievements.org website. For example, Dragster's
1624
- * URL is https://retroachievements.org/game/14402. We can see from the
1625
- * URL that the game ID is "14402".
1626
- *
1627
- * @param payload.userName The user for which to retrieve the
1628
- * game progress for.
1629
- *
1630
- * @example
1631
- * ```
1632
- * const gameInfoAndUserProgress = await getGameInfoAndUserProgress(
1633
- * authorization,
1634
- * { gameId: 14402, userName: "wv_pinball" }
1635
- * );
1636
- * ```
1637
- *
1638
- * @returns An object containing extended metadata about a target game,
1639
- * with attached progress for a target username.
1640
- * ```json
1641
- * {
1642
- * id: 14402,
1643
- * title: "Dragster",
1644
- * consoleId: 25,
1645
- * forumTopicId: 9145,
1646
- * flags: 0,
1647
- * imageIcon: "/Images/026368.png",
1648
- * imageTitle: "/Images/026366.png",
1649
- * imageIngame: "/Images/026367.png",
1650
- * imageBoxArt: "/Images/026365.png",
1651
- * publisher: "Activision",
1652
- * developer: "David Crane",
1653
- * genre: "Racing",
1654
- * released: 1980,
1655
- * isFinal: false,
1656
- * consoleName: "Atari 2600",
1657
- * richPresencePatch: "2b92fa1bf9635c303b3b7f8feea3ed3c",
1658
- * numAchievements: 12,
1659
- * numDistinctPlayersCasual: 454,
1660
- * numDistinctPlayersHardcore, 323
1661
- * claims: [],
1662
- * achievements: {
1663
- * '79434': {
1664
- * id: 79434,
1665
- * numAwarded: 338,
1666
- * numAwardedHardcore: 253,
1667
- * title: "Novice Dragster Driver 1",
1668
- * description: "Complete your very first race in game 1.",
1669
- * points: 1,
1670
- * trueRatio: 1,
1671
- * author: "Boldewin",
1672
- * dateModified: "2019-08-01 19:03:46",
1673
- * dateCreated: "2019-07-31 18:49:57",
1674
- * badgeName: "85541",
1675
- * displayOrder: 0,
1676
- * memAddr: "f5c41fa0b5fa0d5fbb8a74c598f18582",
1677
- * dateEarned: '2022-08-23 22:56:38',
1678
- * dateEarnedHardcore: '2022-08-23 22:56:38'
1679
- * }
1680
- * },
1681
- * numAwardedToUser: 12,
1682
- * numAwardedToUserHardcore: 12,
1683
- * userCompletion: "100.00%",
1684
- * userCompletionHardcore: "100.00%"
1685
- * }
1686
- * ```
1687
- */
1688
- var getGameInfoAndUserProgress = /*#__PURE__*/function () {
1689
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1690
- var gameId, userName, url, rawResponse;
1691
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1711
- }
1712
- }, _callee);
1713
- }));
1714
- return function getGameInfoAndUserProgress(_x, _x2) {
1715
- return _ref.apply(this, arguments);
1716
- };
1717
- }();
1718
-
1719
- /**
1720
- * A call to this function will retrieve a list of
1721
- * achievement set claims made over the lifetime of a given
1722
- * user, targeted by their username.
1723
- *
1724
- * @param authorization An object containing your userName and webApiKey.
1725
- * This can be constructed with `buildAuthorization()`.
1726
- *
1727
- * @param payload.userName The user for which to retrieve the historical
1728
- * achievement set claims list for.
1729
- *
1730
- * @example
1731
- * ```
1732
- * const userClaims = await getUserClaims(
1733
- * authorization,
1734
- * { userName: "Jamiras" }
1735
- * );
1736
- * ```
1737
- *
1738
- * @returns An array containing all the achievement set claims
1739
- * made over the lifetime of the given user.
1740
- */
1741
- var getUserClaims = /*#__PURE__*/function () {
1742
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1743
- var userName, url, rawResponse;
1744
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1763
- }
1764
- }, _callee);
1765
- }));
1766
- return function getUserClaims(_x, _x2) {
1767
- return _ref.apply(this, arguments);
1768
- };
1769
- }();
1770
-
1771
- /**
1772
- * A call to this function will retrieve completion metadata
1773
- * about the games a given user has played. It returns two
1774
- * entries per each game: one for the softcore completion and
1775
- * one for the hardcore completion. These are designated by
1776
- * the `hardcoreMode` property on each completion object.
1777
- *
1778
- * @param authorization An object containing your userName and webApiKey.
1779
- * This can be constructed with `buildAuthorization()`.
1780
- *
1781
- * @param payload.userName The user for which to retrieve the
1782
- * completion metadata for.
1783
- *
1784
- * @example
1785
- * ```
1786
- * const userCompletedGames = await getUserCompletedGames(
1787
- * authorization,
1788
- * { userName: "xelnia" }
1789
- * );
1790
- * ```
1791
- *
1792
- * @returns An array containing completion metadata objects
1793
- * for a given user. Each game contains two completion records,
1794
- * one for softcore and another for hardcore.
1795
- * ```json
1796
- * [
1797
- * {
1798
- * gameId: 14976,
1799
- * title: 'Mortal Kombat',
1800
- * imageIcon: '/Images/036812.png',
1801
- * consoleId: 27,
1802
- * consoleName: 'Arcade',
1803
- * maxPossible: 35,
1804
- * numAwarded: 13,
1805
- * pctWon: 0.3714,
1806
- * hardcoreMode: false
1807
- * },
1808
- * {
1809
- * gameId: 14976,
1810
- * title: 'Mortal Kombat',
1811
- * imageIcon: '/Images/036812.png',
1812
- * consoleId: 27,
1813
- * consoleName: 'Arcade',
1814
- * maxPossible: 35,
1815
- * numAwarded: 13,
1816
- * pctWon: 0.3714,
1817
- * hardcoreMode: true
1818
- * },
1819
- * ]
1820
- * ```
1821
- */
1822
- var getUserCompletedGames = /*#__PURE__*/function () {
1823
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1824
- var userName, url, rawResponse;
1825
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1845
- }
1846
- }, _callee);
1847
- }));
1848
- return function getUserCompletedGames(_x, _x2) {
1849
- return _ref.apply(this, arguments);
1850
- };
1851
- }();
1852
-
1853
- /**
1854
- * A call to this function will retrieve metadata about
1855
- * how a particular user has performed/ranked on a particular
1856
- * game, targeted by game ID.
1857
- *
1858
- * @param authorization An object containing your userName and webApiKey.
1859
- * This can be constructed with `buildAuthorization()`.
1860
- *
1861
- * @param payload.gameId The unique game ID. If you are unsure, open the
1862
- * game's page on the RetroAchievements.org website. For example, Dragster's
1863
- * URL is https://retroachievements.org/game/14402. We can see from the
1864
- * URL that the game ID is "14402".
1865
- *
1866
- * @param payload.userName The user for which to retrieve the
1867
- * game ranking metadata for.
1868
- *
1869
- * @example
1870
- * ```
1871
- * const userGameRankAndScore = await getUserGameRankAndScore(
1872
- * authorization,
1873
- * { gameId: 14402, userName: "xelnia" }
1874
- * );
1875
- * ```
1876
- *
1877
- * @returns An array containing metadata about the user's
1878
- * rank and score for the target game ID. If metadata
1879
- * cannot be found, the array is empty.
1880
- * ```json
1881
- * [
1882
- * {
1883
- * user: "xelnia",
1884
- * totalScore: 378,
1885
- * lastAward: "2022-09-01 21:51:23",
1886
- * userRank: 3
1887
- * }
1888
- * ]
1889
- * ```
1890
- */
1891
- var getUserGameRankAndScore = /*#__PURE__*/function () {
1892
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1893
- var gameId, userName, url, rawResponse;
1894
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1914
- }
1915
- }, _callee);
1916
- }));
1917
- return function getUserGameRankAndScore(_x, _x2) {
1918
- return _ref.apply(this, arguments);
1919
- };
1920
- }();
1921
-
1922
- /**
1923
- * A call to this function will retrieve a given user's hardcore
1924
- * and softcore points.
1925
- *
1926
- * @param authorization An object containing your userName and webApiKey.
1927
- * This can be constructed with `buildAuthorization()`.
1928
- *
1929
- * @param payload.userName The user for which to retrieve the point totals for.
1930
- *
1931
- * @example
1932
- * ```
1933
- * const userPoints = await getUserPoints(
1934
- * authorization,
1935
- * { userName: "xelnia" }
1936
- * );
1937
- * ```
1938
- *
1939
- * @returns An object containing metadata about a target user's points.
1940
- * ```json
1941
- * {
1942
- * points: 7640,
1943
- * softcorePoints: 25
1944
- * }
1945
- * ```
1946
- */
1947
- var getUserPoints = /*#__PURE__*/function () {
1948
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
1949
- var userName, url, rawResponse;
1950
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
1967
- }
1968
- }, _callee);
1969
- }));
1970
- return function getUserPoints(_x, _x2) {
1971
- return _ref.apply(this, arguments);
1972
- };
1973
- }();
1974
-
1975
- /**
1976
- * A call to this function will retrieve a given user's
1977
- * progress on a given list of games, targeted by game ID.
1978
- *
1979
- * @param authorization An object containing your userName and webApiKey.
1980
- * This can be constructed with `buildAuthorization()`.
1981
- *
1982
- * @param payload.userName The user for which to retrieve the progress for.
1983
- *
1984
- * @param payload.gameIds An array of RetroAchievements game IDs. If you aren't
1985
- * sure of the game ID, visit the game's page on the website and copy the number
1986
- * at the end of the URL.
1987
- *
1988
- * @example
1989
- * ```
1990
- * const userProgress = await getUserProgress(
1991
- * authorization,
1992
- * { userName: "xelnia", gameIds: [1, 14402] }
1993
- * );
1994
- * ```
1995
- *
1996
- * @returns An object which is a map of summarized progress for games.
1997
- * ```json
1998
- * {
1999
- * "1": {
2000
- * numPossibleAchievements: 24,
2001
- * possibleScore: 255,
2002
- * numAchieved: 0,
2003
- * scoreAchieved: 0,
2004
- * numAchievedHardcore: 0,
2005
- * scoreAchievedHardcore: 0
2006
- * },
2007
- * "14402": {
2008
- * numPossibleAchievements: 24,
2009
- * possibleScore: 255,
2010
- * numAchieved: 0,
2011
- * scoreAchieved: 0,
2012
- * numAchievedHardcore: 0,
2013
- * scoreAchievedHardcore: 0
2014
- * }
2015
- * }
2016
- * ```
2017
- */
2018
- var getUserProgress = /*#__PURE__*/function () {
2019
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2020
- var userName, gameIds, url, rawResponse;
2021
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
2041
- }
2042
- }, _callee);
2043
- }));
2044
- return function getUserProgress(_x, _x2) {
2045
- return _ref.apply(this, arguments);
2046
- };
2047
- }();
2048
-
2049
- /**
2050
- * A call to this function will retrieve a list of a target user's
2051
- * recently played games, targeted by username.
2052
- *
2053
- * @param authorization An object containing your userName and webApiKey.
2054
- * This can be constructed with `buildAuthorization()`.
2055
- *
2056
- * @param payload.userName The user for which to retrieve the summary for.
2057
- *
2058
- * @param payload.count Optional. Defaults to 10. Max is 50. How many
2059
- * recently played games for the user to retrieve.
2060
- *
2061
- * @param payload.offset Optional. Defaults to 0. Number of recently played
2062
- * game entries to skip. This can be used for pagination.
2063
- *
2064
- * @example
2065
- * ```
2066
- * const userRecentlyPlayedGames = await getUserRecentlyPlayedGames(
2067
- * authorization,
2068
- * { userName: "xelnia" }
2069
- * );
2070
- * ```
2071
- *
2072
- * @returns An array containing metadata about a user's recently played games.
2073
- * ```json
2074
- * [
2075
- * {
2076
- * gameId: 19010,
2077
- * consoleId: 21,
2078
- * consoleName: "PlayStation 2",
2079
- * title: "Simpsons, The: Hit & Run",
2080
- * imageIcon: "/Images/066024.png",
2081
- * lastPlayed: "2022-10-24 22:05:12",
2082
- * numPossibleAchievements: 131,
2083
- * possibleScore: 865,
2084
- * numAchieved: 23,
2085
- * scoreAchieved: 84,
2086
- * numAchievedHardcore: 23,
2087
- * scoreAchievedHardcore: 84
2088
- * }
2089
- * ]
2090
- * ```
2091
- */
2092
- var getUserRecentlyPlayedGames = /*#__PURE__*/function () {
2093
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2094
- var userName, offset, count, queryParams, url, rawResponse;
2095
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
2121
- }
2122
- }, _callee);
2123
- }));
2124
- return function getUserRecentlyPlayedGames(_x, _x2) {
2125
- return _ref.apply(this, arguments);
2126
- };
2127
- }();
2128
-
2129
- /**
2130
- * A call to this function will retrieve summary information about
2131
- * a given user, targeted by username.
2132
- *
2133
- * @param authorization An object containing your userName and webApiKey.
2134
- * This can be constructed with `buildAuthorization()`.
2135
- *
2136
- * @param payload.userName The user for which to retrieve the summary for.
2137
- *
2138
- * @param payload.recentGamesCount Optional. The number of recent games to return.
2139
- * This defaults to 5.
2140
- *
2141
- * @param payload.recentAchievementsCount Optional. The number of recent achievements
2142
- * to return. This defaults to 5.
2143
- *
2144
- * @example
2145
- * ```
2146
- * const userSummary = await getUserSummary(
2147
- * authorization,
2148
- * { userName: "xelnia" }
2149
- * );
2150
- * ```
2151
- *
2152
- * @returns An object containing summary metadata about a target user.
2153
- */
2154
- var getUserSummary = /*#__PURE__*/function () {
2155
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(authorization, payload) {
2156
- var userName, recentGamesCount, recentAchievementsCount, queryParams, url, rawResponse;
2157
- return _regeneratorRuntime().wrap(function _callee$(_context) {
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();
2184
- }
2185
- }, _callee);
2186
- }));
2187
- return function getUserSummary(_x, _x2) {
2188
- return _ref.apply(this, arguments);
2189
- };
2190
- }();
2191
- // TODO: add test for this
2192
-
2193
- /**
2194
- * Accepts your RetroAchievements.org userName and web API key. After
2195
- * receiving these inputs, the function returns you a value that can be
2196
- * used for the authentication parameter by any of the async calls in this
2197
- * library.
2198
- *
2199
- * Your account's personal Web API Key can be found on the Settings page
2200
- * of RetroAchievements.org. Do not use a Web API Key that is not associated
2201
- * with your account.
2202
- *
2203
- * @returns An `AuthObject` that you can pass to any of the API call functions.
2204
- *
2205
- * @example
2206
- * ```
2207
- * const authorization = buildAuthorization({
2208
- * userName: "Scott",
2209
- * webApiKey: "LtjCwW16nJI7cqOyPIQtXk8v1cfF0tmO"
2210
- * });
2211
- * ```
2212
- */
2213
- var buildAuthorization = function buildAuthorization(options) {
2214
- if (!options.userName || !options.webApiKey) {
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 ");
2216
- }
2217
- return options;
2218
- };
2219
- // This function simply returns what it's given, however the return
2220
- // value has the added benefit of type safety.
2221
-
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 };
2223
- //# sourceMappingURL=api.esm.js.map