glitch-javascript-sdk 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +60 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Competitions.d.ts +45 -0
- package/dist/esm/index.js +242 -164
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +45 -0
- package/package.json +1 -1
- package/src/api/Competitions.ts +60 -0
- package/src/routes/CompetitionRoute.ts +5 -0
|
@@ -457,5 +457,50 @@ declare class Competitions {
|
|
|
457
457
|
* @returns promise
|
|
458
458
|
*/
|
|
459
459
|
static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
460
|
+
/**
|
|
461
|
+
* Get a leaderboard by a users points.
|
|
462
|
+
*
|
|
463
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
464
|
+
*
|
|
465
|
+
* @param competition_id
|
|
466
|
+
* @returns promise
|
|
467
|
+
*/
|
|
468
|
+
static userPointsLeaderboard<T>(competition_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
469
|
+
/**
|
|
470
|
+
* Get a leaderboard by a users wins.
|
|
471
|
+
*
|
|
472
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
473
|
+
*
|
|
474
|
+
* @param competition_id
|
|
475
|
+
* @returns promise
|
|
476
|
+
*/
|
|
477
|
+
static userWinsLeaderboard<T>(competition_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
478
|
+
/**
|
|
479
|
+
* Get a leaderboard by a teams points.
|
|
480
|
+
*
|
|
481
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
482
|
+
*
|
|
483
|
+
* @param competition_id
|
|
484
|
+
* @returns promise
|
|
485
|
+
*/
|
|
486
|
+
static teamPointsLeaderboard<T>(competition_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
487
|
+
/**
|
|
488
|
+
* Get a leaderboard by a teams wins.
|
|
489
|
+
*
|
|
490
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
491
|
+
*
|
|
492
|
+
* @param competition_id
|
|
493
|
+
* @returns promise
|
|
494
|
+
*/
|
|
495
|
+
static teamWinsLeaderboard<T>(competition_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
496
|
+
/**
|
|
497
|
+
* Get all leaderboards.
|
|
498
|
+
*
|
|
499
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
500
|
+
*
|
|
501
|
+
* @param competition_id
|
|
502
|
+
* @returns promise
|
|
503
|
+
*/
|
|
504
|
+
static allLeaderboards<T>(competition_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
460
505
|
}
|
|
461
506
|
export default Competitions;
|
package/dist/esm/index.js
CHANGED
|
@@ -542,7 +542,7 @@ var isTypedArray = (function(TypedArray) {
|
|
|
542
542
|
};
|
|
543
543
|
})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
|
|
544
544
|
|
|
545
|
-
var utils$
|
|
545
|
+
var utils$9 = {
|
|
546
546
|
isArray: isArray$3,
|
|
547
547
|
isArrayBuffer: isArrayBuffer,
|
|
548
548
|
isBuffer: isBuffer$2,
|
|
@@ -575,7 +575,7 @@ var utils$b = {
|
|
|
575
575
|
isFileList: isFileList
|
|
576
576
|
};
|
|
577
577
|
|
|
578
|
-
var utils$
|
|
578
|
+
var utils$8 = utils$9;
|
|
579
579
|
|
|
580
580
|
function encode$1(val) {
|
|
581
581
|
return encodeURIComponent(val).
|
|
@@ -603,26 +603,26 @@ var buildURL$1 = function buildURL(url, params, paramsSerializer) {
|
|
|
603
603
|
var serializedParams;
|
|
604
604
|
if (paramsSerializer) {
|
|
605
605
|
serializedParams = paramsSerializer(params);
|
|
606
|
-
} else if (utils$
|
|
606
|
+
} else if (utils$8.isURLSearchParams(params)) {
|
|
607
607
|
serializedParams = params.toString();
|
|
608
608
|
} else {
|
|
609
609
|
var parts = [];
|
|
610
610
|
|
|
611
|
-
utils$
|
|
611
|
+
utils$8.forEach(params, function serialize(val, key) {
|
|
612
612
|
if (val === null || typeof val === 'undefined') {
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
-
if (utils$
|
|
616
|
+
if (utils$8.isArray(val)) {
|
|
617
617
|
key = key + '[]';
|
|
618
618
|
} else {
|
|
619
619
|
val = [val];
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
-
utils$
|
|
623
|
-
if (utils$
|
|
622
|
+
utils$8.forEach(val, function parseValue(v) {
|
|
623
|
+
if (utils$8.isDate(v)) {
|
|
624
624
|
v = v.toISOString();
|
|
625
|
-
} else if (utils$
|
|
625
|
+
} else if (utils$8.isObject(v)) {
|
|
626
626
|
v = JSON.stringify(v);
|
|
627
627
|
}
|
|
628
628
|
parts.push(encode$1(key) + '=' + encode$1(v));
|
|
@@ -644,7 +644,7 @@ var buildURL$1 = function buildURL(url, params, paramsSerializer) {
|
|
|
644
644
|
return url;
|
|
645
645
|
};
|
|
646
646
|
|
|
647
|
-
var utils$
|
|
647
|
+
var utils$7 = utils$9;
|
|
648
648
|
|
|
649
649
|
function InterceptorManager$1() {
|
|
650
650
|
this.handlers = [];
|
|
@@ -688,7 +688,7 @@ InterceptorManager$1.prototype.eject = function eject(id) {
|
|
|
688
688
|
* @param {Function} fn The function to call for each interceptor
|
|
689
689
|
*/
|
|
690
690
|
InterceptorManager$1.prototype.forEach = function forEach(fn) {
|
|
691
|
-
utils$
|
|
691
|
+
utils$7.forEach(this.handlers, function forEachHandler(h) {
|
|
692
692
|
if (h !== null) {
|
|
693
693
|
fn(h);
|
|
694
694
|
}
|
|
@@ -923,10 +923,10 @@ var browser$1 = {
|
|
|
923
923
|
uptime: uptime
|
|
924
924
|
};
|
|
925
925
|
|
|
926
|
-
var utils$
|
|
926
|
+
var utils$6 = utils$9;
|
|
927
927
|
|
|
928
928
|
var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
|
|
929
|
-
utils$
|
|
929
|
+
utils$6.forEach(headers, function processHeader(value, name) {
|
|
930
930
|
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
931
931
|
headers[normalizedName] = value;
|
|
932
932
|
delete headers[name];
|
|
@@ -934,90 +934,99 @@ var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName
|
|
|
934
934
|
});
|
|
935
935
|
};
|
|
936
936
|
|
|
937
|
-
var
|
|
937
|
+
var AxiosError_1;
|
|
938
|
+
var hasRequiredAxiosError;
|
|
938
939
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
* @param {string} message The error message.
|
|
943
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
944
|
-
* @param {Object} [config] The config.
|
|
945
|
-
* @param {Object} [request] The request.
|
|
946
|
-
* @param {Object} [response] The response.
|
|
947
|
-
* @returns {Error} The created error.
|
|
948
|
-
*/
|
|
949
|
-
function AxiosError$2(message, code, config, request, response) {
|
|
950
|
-
Error.call(this);
|
|
951
|
-
this.message = message;
|
|
952
|
-
this.name = 'AxiosError';
|
|
953
|
-
code && (this.code = code);
|
|
954
|
-
config && (this.config = config);
|
|
955
|
-
request && (this.request = request);
|
|
956
|
-
response && (this.response = response);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
utils$7.inherits(AxiosError$2, Error, {
|
|
960
|
-
toJSON: function toJSON() {
|
|
961
|
-
return {
|
|
962
|
-
// Standard
|
|
963
|
-
message: this.message,
|
|
964
|
-
name: this.name,
|
|
965
|
-
// Microsoft
|
|
966
|
-
description: this.description,
|
|
967
|
-
number: this.number,
|
|
968
|
-
// Mozilla
|
|
969
|
-
fileName: this.fileName,
|
|
970
|
-
lineNumber: this.lineNumber,
|
|
971
|
-
columnNumber: this.columnNumber,
|
|
972
|
-
stack: this.stack,
|
|
973
|
-
// Axios
|
|
974
|
-
config: this.config,
|
|
975
|
-
code: this.code,
|
|
976
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
977
|
-
};
|
|
978
|
-
}
|
|
979
|
-
});
|
|
940
|
+
function requireAxiosError () {
|
|
941
|
+
if (hasRequiredAxiosError) return AxiosError_1;
|
|
942
|
+
hasRequiredAxiosError = 1;
|
|
980
943
|
|
|
981
|
-
var
|
|
982
|
-
var descriptors = {};
|
|
983
|
-
|
|
984
|
-
[
|
|
985
|
-
'ERR_BAD_OPTION_VALUE',
|
|
986
|
-
'ERR_BAD_OPTION',
|
|
987
|
-
'ECONNABORTED',
|
|
988
|
-
'ETIMEDOUT',
|
|
989
|
-
'ERR_NETWORK',
|
|
990
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
991
|
-
'ERR_DEPRECATED',
|
|
992
|
-
'ERR_BAD_RESPONSE',
|
|
993
|
-
'ERR_BAD_REQUEST',
|
|
994
|
-
'ERR_CANCELED'
|
|
995
|
-
// eslint-disable-next-line func-names
|
|
996
|
-
].forEach(function(code) {
|
|
997
|
-
descriptors[code] = {value: code};
|
|
998
|
-
});
|
|
944
|
+
var utils = utils$9;
|
|
999
945
|
|
|
1000
|
-
|
|
1001
|
-
|
|
946
|
+
/**
|
|
947
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
948
|
+
*
|
|
949
|
+
* @param {string} message The error message.
|
|
950
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
951
|
+
* @param {Object} [config] The config.
|
|
952
|
+
* @param {Object} [request] The request.
|
|
953
|
+
* @param {Object} [response] The response.
|
|
954
|
+
* @returns {Error} The created error.
|
|
955
|
+
*/
|
|
956
|
+
function AxiosError(message, code, config, request, response) {
|
|
957
|
+
Error.call(this);
|
|
958
|
+
this.message = message;
|
|
959
|
+
this.name = 'AxiosError';
|
|
960
|
+
code && (this.code = code);
|
|
961
|
+
config && (this.config = config);
|
|
962
|
+
request && (this.request = request);
|
|
963
|
+
response && (this.response = response);
|
|
964
|
+
}
|
|
1002
965
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
966
|
+
utils.inherits(AxiosError, Error, {
|
|
967
|
+
toJSON: function toJSON() {
|
|
968
|
+
return {
|
|
969
|
+
// Standard
|
|
970
|
+
message: this.message,
|
|
971
|
+
name: this.name,
|
|
972
|
+
// Microsoft
|
|
973
|
+
description: this.description,
|
|
974
|
+
number: this.number,
|
|
975
|
+
// Mozilla
|
|
976
|
+
fileName: this.fileName,
|
|
977
|
+
lineNumber: this.lineNumber,
|
|
978
|
+
columnNumber: this.columnNumber,
|
|
979
|
+
stack: this.stack,
|
|
980
|
+
// Axios
|
|
981
|
+
config: this.config,
|
|
982
|
+
code: this.code,
|
|
983
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
});
|
|
1006
987
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
988
|
+
var prototype = AxiosError.prototype;
|
|
989
|
+
var descriptors = {};
|
|
990
|
+
|
|
991
|
+
[
|
|
992
|
+
'ERR_BAD_OPTION_VALUE',
|
|
993
|
+
'ERR_BAD_OPTION',
|
|
994
|
+
'ECONNABORTED',
|
|
995
|
+
'ETIMEDOUT',
|
|
996
|
+
'ERR_NETWORK',
|
|
997
|
+
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
998
|
+
'ERR_DEPRECATED',
|
|
999
|
+
'ERR_BAD_RESPONSE',
|
|
1000
|
+
'ERR_BAD_REQUEST',
|
|
1001
|
+
'ERR_CANCELED'
|
|
1002
|
+
// eslint-disable-next-line func-names
|
|
1003
|
+
].forEach(function(code) {
|
|
1004
|
+
descriptors[code] = {value: code};
|
|
1005
|
+
});
|
|
1010
1006
|
|
|
1011
|
-
|
|
1007
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
1008
|
+
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
1012
1009
|
|
|
1013
|
-
|
|
1010
|
+
// eslint-disable-next-line func-names
|
|
1011
|
+
AxiosError.from = function(error, code, config, request, response, customProps) {
|
|
1012
|
+
var axiosError = Object.create(prototype);
|
|
1014
1013
|
|
|
1015
|
-
|
|
1014
|
+
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
1015
|
+
return obj !== Error.prototype;
|
|
1016
|
+
});
|
|
1016
1017
|
|
|
1017
|
-
|
|
1018
|
-
};
|
|
1018
|
+
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
1019
1019
|
|
|
1020
|
-
|
|
1020
|
+
axiosError.name = error.name;
|
|
1021
|
+
|
|
1022
|
+
customProps && Object.assign(axiosError, customProps);
|
|
1023
|
+
|
|
1024
|
+
return axiosError;
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
AxiosError_1 = AxiosError;
|
|
1028
|
+
return AxiosError_1;
|
|
1029
|
+
}
|
|
1021
1030
|
|
|
1022
1031
|
var transitional = {
|
|
1023
1032
|
silentJSONParsing: true,
|
|
@@ -3000,76 +3009,85 @@ function isSlowBuffer (obj) {
|
|
|
3000
3009
|
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
|
|
3001
3010
|
}
|
|
3002
3011
|
|
|
3003
|
-
var
|
|
3012
|
+
var toFormData_1;
|
|
3013
|
+
var hasRequiredToFormData;
|
|
3004
3014
|
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
* @param {?Object} [formData]
|
|
3009
|
-
* @returns {Object}
|
|
3010
|
-
**/
|
|
3015
|
+
function requireToFormData () {
|
|
3016
|
+
if (hasRequiredToFormData) return toFormData_1;
|
|
3017
|
+
hasRequiredToFormData = 1;
|
|
3011
3018
|
|
|
3012
|
-
|
|
3013
|
-
// eslint-disable-next-line no-param-reassign
|
|
3014
|
-
formData = formData || new FormData();
|
|
3019
|
+
var utils = utils$9;
|
|
3015
3020
|
|
|
3016
|
-
|
|
3021
|
+
/**
|
|
3022
|
+
* Convert a data object to FormData
|
|
3023
|
+
* @param {Object} obj
|
|
3024
|
+
* @param {?Object} [formData]
|
|
3025
|
+
* @returns {Object}
|
|
3026
|
+
**/
|
|
3017
3027
|
|
|
3018
|
-
|
|
3019
|
-
|
|
3028
|
+
function toFormData(obj, formData) {
|
|
3029
|
+
// eslint-disable-next-line no-param-reassign
|
|
3030
|
+
formData = formData || new FormData();
|
|
3020
3031
|
|
|
3021
|
-
|
|
3022
|
-
return value.toISOString();
|
|
3023
|
-
}
|
|
3032
|
+
var stack = [];
|
|
3024
3033
|
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
}
|
|
3034
|
+
function convertValue(value) {
|
|
3035
|
+
if (value === null) return '';
|
|
3028
3036
|
|
|
3029
|
-
|
|
3030
|
-
|
|
3037
|
+
if (utils.isDate(value)) {
|
|
3038
|
+
return value.toISOString();
|
|
3039
|
+
}
|
|
3031
3040
|
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
throw Error('Circular reference detected in ' + parentKey);
|
|
3036
|
-
}
|
|
3041
|
+
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
3042
|
+
return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
3043
|
+
}
|
|
3037
3044
|
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
utils$6.forEach(data, function each(value, key) {
|
|
3041
|
-
if (utils$6.isUndefined(value)) return;
|
|
3042
|
-
var fullKey = parentKey ? parentKey + '.' + key : key;
|
|
3043
|
-
var arr;
|
|
3044
|
-
|
|
3045
|
-
if (value && !parentKey && typeof value === 'object') {
|
|
3046
|
-
if (utils$6.endsWith(key, '{}')) {
|
|
3047
|
-
// eslint-disable-next-line no-param-reassign
|
|
3048
|
-
value = JSON.stringify(value);
|
|
3049
|
-
} else if (utils$6.endsWith(key, '[]') && (arr = utils$6.toArray(value))) {
|
|
3050
|
-
// eslint-disable-next-line func-names
|
|
3051
|
-
arr.forEach(function(el) {
|
|
3052
|
-
!utils$6.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
3053
|
-
});
|
|
3054
|
-
return;
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3045
|
+
return value;
|
|
3046
|
+
}
|
|
3057
3047
|
|
|
3058
|
-
|
|
3059
|
-
|
|
3048
|
+
function build(data, parentKey) {
|
|
3049
|
+
if (utils.isPlainObject(data) || utils.isArray(data)) {
|
|
3050
|
+
if (stack.indexOf(data) !== -1) {
|
|
3051
|
+
throw Error('Circular reference detected in ' + parentKey);
|
|
3052
|
+
}
|
|
3060
3053
|
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3054
|
+
stack.push(data);
|
|
3055
|
+
|
|
3056
|
+
utils.forEach(data, function each(value, key) {
|
|
3057
|
+
if (utils.isUndefined(value)) return;
|
|
3058
|
+
var fullKey = parentKey ? parentKey + '.' + key : key;
|
|
3059
|
+
var arr;
|
|
3060
|
+
|
|
3061
|
+
if (value && !parentKey && typeof value === 'object') {
|
|
3062
|
+
if (utils.endsWith(key, '{}')) {
|
|
3063
|
+
// eslint-disable-next-line no-param-reassign
|
|
3064
|
+
value = JSON.stringify(value);
|
|
3065
|
+
} else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
|
|
3066
|
+
// eslint-disable-next-line func-names
|
|
3067
|
+
arr.forEach(function(el) {
|
|
3068
|
+
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
3069
|
+
});
|
|
3070
|
+
return;
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3066
3073
|
|
|
3067
|
-
|
|
3074
|
+
build(value, fullKey);
|
|
3075
|
+
});
|
|
3068
3076
|
|
|
3069
|
-
|
|
3070
|
-
}
|
|
3077
|
+
stack.pop();
|
|
3078
|
+
} else {
|
|
3079
|
+
formData.append(parentKey, convertValue(data));
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
build(obj);
|
|
3071
3084
|
|
|
3072
|
-
|
|
3085
|
+
return formData;
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
toFormData_1 = toFormData;
|
|
3089
|
+
return toFormData_1;
|
|
3090
|
+
}
|
|
3073
3091
|
|
|
3074
3092
|
var settle;
|
|
3075
3093
|
var hasRequiredSettle;
|
|
@@ -3078,7 +3096,7 @@ function requireSettle () {
|
|
|
3078
3096
|
if (hasRequiredSettle) return settle;
|
|
3079
3097
|
hasRequiredSettle = 1;
|
|
3080
3098
|
|
|
3081
|
-
var AxiosError =
|
|
3099
|
+
var AxiosError = requireAxiosError();
|
|
3082
3100
|
|
|
3083
3101
|
/**
|
|
3084
3102
|
* Resolve or reject a Promise based on response status.
|
|
@@ -3111,7 +3129,7 @@ function requireCookies () {
|
|
|
3111
3129
|
if (hasRequiredCookies) return cookies;
|
|
3112
3130
|
hasRequiredCookies = 1;
|
|
3113
3131
|
|
|
3114
|
-
var utils = utils$
|
|
3132
|
+
var utils = utils$9;
|
|
3115
3133
|
|
|
3116
3134
|
cookies = (
|
|
3117
3135
|
utils.isStandardBrowserEnv() ?
|
|
@@ -3217,7 +3235,7 @@ function requireParseHeaders () {
|
|
|
3217
3235
|
if (hasRequiredParseHeaders) return parseHeaders;
|
|
3218
3236
|
hasRequiredParseHeaders = 1;
|
|
3219
3237
|
|
|
3220
|
-
var utils = utils$
|
|
3238
|
+
var utils = utils$9;
|
|
3221
3239
|
|
|
3222
3240
|
// Headers whose duplicates are ignored by node
|
|
3223
3241
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
@@ -3278,7 +3296,7 @@ function requireIsURLSameOrigin () {
|
|
|
3278
3296
|
if (hasRequiredIsURLSameOrigin) return isURLSameOrigin;
|
|
3279
3297
|
hasRequiredIsURLSameOrigin = 1;
|
|
3280
3298
|
|
|
3281
|
-
var utils = utils$
|
|
3299
|
+
var utils = utils$9;
|
|
3282
3300
|
|
|
3283
3301
|
isURLSameOrigin = (
|
|
3284
3302
|
utils.isStandardBrowserEnv() ?
|
|
@@ -3354,8 +3372,8 @@ function requireCanceledError () {
|
|
|
3354
3372
|
if (hasRequiredCanceledError) return CanceledError_1;
|
|
3355
3373
|
hasRequiredCanceledError = 1;
|
|
3356
3374
|
|
|
3357
|
-
var AxiosError =
|
|
3358
|
-
var utils = utils$
|
|
3375
|
+
var AxiosError = requireAxiosError();
|
|
3376
|
+
var utils = utils$9;
|
|
3359
3377
|
|
|
3360
3378
|
/**
|
|
3361
3379
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
@@ -3398,7 +3416,7 @@ function requireXhr () {
|
|
|
3398
3416
|
if (hasRequiredXhr) return xhr$1;
|
|
3399
3417
|
hasRequiredXhr = 1;
|
|
3400
3418
|
|
|
3401
|
-
var utils = utils$
|
|
3419
|
+
var utils = utils$9;
|
|
3402
3420
|
var settle = requireSettle();
|
|
3403
3421
|
var cookies = requireCookies();
|
|
3404
3422
|
var buildURL = buildURL$1;
|
|
@@ -3406,7 +3424,7 @@ function requireXhr () {
|
|
|
3406
3424
|
var parseHeaders = requireParseHeaders();
|
|
3407
3425
|
var isURLSameOrigin = requireIsURLSameOrigin();
|
|
3408
3426
|
var transitionalDefaults = transitional;
|
|
3409
|
-
var AxiosError =
|
|
3427
|
+
var AxiosError = requireAxiosError();
|
|
3410
3428
|
var CanceledError = requireCanceledError();
|
|
3411
3429
|
var parseProtocol = requireParseProtocol();
|
|
3412
3430
|
|
|
@@ -16043,7 +16061,7 @@ function requireHttp () {
|
|
|
16043
16061
|
if (hasRequiredHttp) return http_1;
|
|
16044
16062
|
hasRequiredHttp = 1;
|
|
16045
16063
|
|
|
16046
|
-
var utils = utils$
|
|
16064
|
+
var utils = utils$9;
|
|
16047
16065
|
var settle = requireSettle();
|
|
16048
16066
|
var buildFullPath = buildFullPath$1;
|
|
16049
16067
|
var buildURL = buildURL$1;
|
|
@@ -16055,7 +16073,7 @@ function requireHttp () {
|
|
|
16055
16073
|
var zlib = require$$8;
|
|
16056
16074
|
var VERSION = requireData().version;
|
|
16057
16075
|
var transitionalDefaults = transitional;
|
|
16058
|
-
var AxiosError =
|
|
16076
|
+
var AxiosError = requireAxiosError();
|
|
16059
16077
|
var CanceledError = requireCanceledError();
|
|
16060
16078
|
|
|
16061
16079
|
var isHttps = /https:?/;
|
|
@@ -29003,11 +29021,11 @@ function requireFormData () {
|
|
|
29003
29021
|
return FormDataExports;
|
|
29004
29022
|
}
|
|
29005
29023
|
|
|
29006
|
-
var utils$5 = utils$
|
|
29024
|
+
var utils$5 = utils$9;
|
|
29007
29025
|
var normalizeHeaderName = normalizeHeaderName$1;
|
|
29008
|
-
var AxiosError$1 =
|
|
29026
|
+
var AxiosError$1 = requireAxiosError();
|
|
29009
29027
|
var transitionalDefaults = transitional;
|
|
29010
|
-
var toFormData =
|
|
29028
|
+
var toFormData = requireToFormData();
|
|
29011
29029
|
|
|
29012
29030
|
var DEFAULT_CONTENT_TYPE = {
|
|
29013
29031
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
@@ -29148,7 +29166,7 @@ utils$5.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
|
|
|
29148
29166
|
|
|
29149
29167
|
var defaults_1 = defaults$3;
|
|
29150
29168
|
|
|
29151
|
-
var utils$4 = utils$
|
|
29169
|
+
var utils$4 = utils$9;
|
|
29152
29170
|
var defaults$2 = defaults_1;
|
|
29153
29171
|
|
|
29154
29172
|
/**
|
|
@@ -29182,7 +29200,7 @@ function requireIsCancel () {
|
|
|
29182
29200
|
return isCancel$1;
|
|
29183
29201
|
}
|
|
29184
29202
|
|
|
29185
|
-
var utils$3 = utils$
|
|
29203
|
+
var utils$3 = utils$9;
|
|
29186
29204
|
var transformData = transformData$1;
|
|
29187
29205
|
var isCancel = requireIsCancel();
|
|
29188
29206
|
var defaults$1 = defaults_1;
|
|
@@ -29268,7 +29286,7 @@ var dispatchRequest$1 = function dispatchRequest(config) {
|
|
|
29268
29286
|
});
|
|
29269
29287
|
};
|
|
29270
29288
|
|
|
29271
|
-
var utils$2 = utils$
|
|
29289
|
+
var utils$2 = utils$9;
|
|
29272
29290
|
|
|
29273
29291
|
/**
|
|
29274
29292
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -29368,7 +29386,7 @@ var mergeConfig$2 = function mergeConfig(config1, config2) {
|
|
|
29368
29386
|
};
|
|
29369
29387
|
|
|
29370
29388
|
var VERSION = requireData().version;
|
|
29371
|
-
var AxiosError =
|
|
29389
|
+
var AxiosError = requireAxiosError();
|
|
29372
29390
|
|
|
29373
29391
|
var validators$1 = {};
|
|
29374
29392
|
|
|
@@ -29452,7 +29470,7 @@ var validator$1 = {
|
|
|
29452
29470
|
validators: validators$1
|
|
29453
29471
|
};
|
|
29454
29472
|
|
|
29455
|
-
var utils$1 = utils$
|
|
29473
|
+
var utils$1 = utils$9;
|
|
29456
29474
|
var buildURL = buildURL$1;
|
|
29457
29475
|
var InterceptorManager = InterceptorManager_1;
|
|
29458
29476
|
var dispatchRequest = dispatchRequest$1;
|
|
@@ -29780,7 +29798,7 @@ function requireIsAxiosError () {
|
|
|
29780
29798
|
if (hasRequiredIsAxiosError) return isAxiosError;
|
|
29781
29799
|
hasRequiredIsAxiosError = 1;
|
|
29782
29800
|
|
|
29783
|
-
var utils = utils$
|
|
29801
|
+
var utils = utils$9;
|
|
29784
29802
|
|
|
29785
29803
|
/**
|
|
29786
29804
|
* Determines whether the payload is an error thrown by Axios
|
|
@@ -29794,7 +29812,7 @@ function requireIsAxiosError () {
|
|
|
29794
29812
|
return isAxiosError;
|
|
29795
29813
|
}
|
|
29796
29814
|
|
|
29797
|
-
var utils = utils$
|
|
29815
|
+
var utils = utils$9;
|
|
29798
29816
|
var bind = bind$2;
|
|
29799
29817
|
var Axios = Axios_1;
|
|
29800
29818
|
var mergeConfig = mergeConfig$2;
|
|
@@ -29835,10 +29853,10 @@ axios$1.CanceledError = requireCanceledError();
|
|
|
29835
29853
|
axios$1.CancelToken = requireCancelToken();
|
|
29836
29854
|
axios$1.isCancel = requireIsCancel();
|
|
29837
29855
|
axios$1.VERSION = requireData().version;
|
|
29838
|
-
axios$1.toFormData =
|
|
29856
|
+
axios$1.toFormData = requireToFormData();
|
|
29839
29857
|
|
|
29840
29858
|
// Expose AxiosError class
|
|
29841
|
-
axios$1.AxiosError =
|
|
29859
|
+
axios$1.AxiosError = requireAxiosError();
|
|
29842
29860
|
|
|
29843
29861
|
// alias for CanceledError for backward compatibility
|
|
29844
29862
|
axios$1.Cancel = axios$1.CanceledError;
|
|
@@ -30304,6 +30322,11 @@ var CompetitionRoutes = /** @class */ (function () {
|
|
|
30304
30322
|
updateVenue: { url: '/competitions/{competition_id}/venues/{venue_id}', method: HTTP_METHODS.PUT },
|
|
30305
30323
|
destroyVenue: { url: '/competitions/{competition_id}/venues/{venue_id}', method: HTTP_METHODS.DELETE },
|
|
30306
30324
|
uploadVenueMainImage: { url: '/competitions/{competition_id}/venues/{venue_id}/uploadMainImage', method: HTTP_METHODS.POST },
|
|
30325
|
+
userPointsLeaderboard: { url: '/competitions/{competition_id}/userPointsLeaderboard', method: HTTP_METHODS.GET },
|
|
30326
|
+
teamPointsLeaderboard: { url: '/competitions/{competition_id}/teamPointsLeaderboard', method: HTTP_METHODS.GET },
|
|
30327
|
+
userWinsLeaderboard: { url: '/competitions/{competition_id}/userWinsLeaderboard', method: HTTP_METHODS.GET },
|
|
30328
|
+
teamWinsLeaderboard: { url: '/competitions/{competition_id}/teamWinsLeaderboard', method: HTTP_METHODS.GET },
|
|
30329
|
+
allLeaderboards: { url: '/competitions/{competition_id}/allLeaderboards', method: HTTP_METHODS.GET },
|
|
30307
30330
|
};
|
|
30308
30331
|
return CompetitionRoutes;
|
|
30309
30332
|
}());
|
|
@@ -30865,6 +30888,61 @@ var Competitions = /** @class */ (function () {
|
|
|
30865
30888
|
var url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id);
|
|
30866
30889
|
return Requests.uploadBlob(url, 'image', blob, data);
|
|
30867
30890
|
};
|
|
30891
|
+
/**
|
|
30892
|
+
* Get a leaderboard by a users points.
|
|
30893
|
+
*
|
|
30894
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
30895
|
+
*
|
|
30896
|
+
* @param competition_id
|
|
30897
|
+
* @returns promise
|
|
30898
|
+
*/
|
|
30899
|
+
Competitions.userPointsLeaderboard = function (competition_id, params) {
|
|
30900
|
+
return Requests.processRoute(CompetitionRoutes.routes.userPointsLeaderboard, {}, { competition_id: competition_id }, params);
|
|
30901
|
+
};
|
|
30902
|
+
/**
|
|
30903
|
+
* Get a leaderboard by a users wins.
|
|
30904
|
+
*
|
|
30905
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
30906
|
+
*
|
|
30907
|
+
* @param competition_id
|
|
30908
|
+
* @returns promise
|
|
30909
|
+
*/
|
|
30910
|
+
Competitions.userWinsLeaderboard = function (competition_id, params) {
|
|
30911
|
+
return Requests.processRoute(CompetitionRoutes.routes.userWinsLeaderboard, {}, { competition_id: competition_id }, params);
|
|
30912
|
+
};
|
|
30913
|
+
/**
|
|
30914
|
+
* Get a leaderboard by a teams points.
|
|
30915
|
+
*
|
|
30916
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
30917
|
+
*
|
|
30918
|
+
* @param competition_id
|
|
30919
|
+
* @returns promise
|
|
30920
|
+
*/
|
|
30921
|
+
Competitions.teamPointsLeaderboard = function (competition_id, params) {
|
|
30922
|
+
return Requests.processRoute(CompetitionRoutes.routes.teamPointsLeaderboard, {}, { competition_id: competition_id }, params);
|
|
30923
|
+
};
|
|
30924
|
+
/**
|
|
30925
|
+
* Get a leaderboard by a teams wins.
|
|
30926
|
+
*
|
|
30927
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
30928
|
+
*
|
|
30929
|
+
* @param competition_id
|
|
30930
|
+
* @returns promise
|
|
30931
|
+
*/
|
|
30932
|
+
Competitions.teamWinsLeaderboard = function (competition_id, params) {
|
|
30933
|
+
return Requests.processRoute(CompetitionRoutes.routes.teamWinsLeaderboard, {}, { competition_id: competition_id }, params);
|
|
30934
|
+
};
|
|
30935
|
+
/**
|
|
30936
|
+
* Get all leaderboards.
|
|
30937
|
+
*
|
|
30938
|
+
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/competitionUserList
|
|
30939
|
+
*
|
|
30940
|
+
* @param competition_id
|
|
30941
|
+
* @returns promise
|
|
30942
|
+
*/
|
|
30943
|
+
Competitions.allLeaderboards = function (competition_id, params) {
|
|
30944
|
+
return Requests.processRoute(CompetitionRoutes.routes.allLeaderboards, {}, { competition_id: competition_id }, params);
|
|
30945
|
+
};
|
|
30868
30946
|
return Competitions;
|
|
30869
30947
|
}());
|
|
30870
30948
|
|