glitch-javascript-sdk 0.0.2 → 0.0.3
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 +0 -136
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +53 -0
- package/dist/esm/api/Users.d.ts +62 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +8 -2
- package/dist/esm/index.js +164 -318
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/EventsRoute.d.ts +7 -0
- package/dist/esm/routes/UserRoutes.d.ts +7 -0
- package/dist/index.d.ts +117 -2
- package/package.json +1 -1
- package/src/api/Events.ts +81 -0
- package/src/api/Users.ts +92 -0
- package/src/api/index.ts +5 -1
- package/src/index.ts +8 -2
- package/src/routes/EventsRoute.ts +33 -0
- package/src/routes/UserRoutes.ts +20 -0
package/dist/esm/index.js
CHANGED
|
@@ -488,7 +488,7 @@ var isTypedArray = (function(TypedArray) {
|
|
|
488
488
|
};
|
|
489
489
|
})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
|
|
490
490
|
|
|
491
|
-
var utils$
|
|
491
|
+
var utils$b = {
|
|
492
492
|
isArray: isArray$3,
|
|
493
493
|
isArrayBuffer: isArrayBuffer,
|
|
494
494
|
isBuffer: isBuffer$2,
|
|
@@ -521,7 +521,7 @@ var utils$9 = {
|
|
|
521
521
|
isFileList: isFileList
|
|
522
522
|
};
|
|
523
523
|
|
|
524
|
-
var utils$
|
|
524
|
+
var utils$a = utils$b;
|
|
525
525
|
|
|
526
526
|
function encode$1(val) {
|
|
527
527
|
return encodeURIComponent(val).
|
|
@@ -549,26 +549,26 @@ var buildURL$1 = function buildURL(url, params, paramsSerializer) {
|
|
|
549
549
|
var serializedParams;
|
|
550
550
|
if (paramsSerializer) {
|
|
551
551
|
serializedParams = paramsSerializer(params);
|
|
552
|
-
} else if (utils$
|
|
552
|
+
} else if (utils$a.isURLSearchParams(params)) {
|
|
553
553
|
serializedParams = params.toString();
|
|
554
554
|
} else {
|
|
555
555
|
var parts = [];
|
|
556
556
|
|
|
557
|
-
utils$
|
|
557
|
+
utils$a.forEach(params, function serialize(val, key) {
|
|
558
558
|
if (val === null || typeof val === 'undefined') {
|
|
559
559
|
return;
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
if (utils$
|
|
562
|
+
if (utils$a.isArray(val)) {
|
|
563
563
|
key = key + '[]';
|
|
564
564
|
} else {
|
|
565
565
|
val = [val];
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
-
utils$
|
|
569
|
-
if (utils$
|
|
568
|
+
utils$a.forEach(val, function parseValue(v) {
|
|
569
|
+
if (utils$a.isDate(v)) {
|
|
570
570
|
v = v.toISOString();
|
|
571
|
-
} else if (utils$
|
|
571
|
+
} else if (utils$a.isObject(v)) {
|
|
572
572
|
v = JSON.stringify(v);
|
|
573
573
|
}
|
|
574
574
|
parts.push(encode$1(key) + '=' + encode$1(v));
|
|
@@ -590,7 +590,7 @@ var buildURL$1 = function buildURL(url, params, paramsSerializer) {
|
|
|
590
590
|
return url;
|
|
591
591
|
};
|
|
592
592
|
|
|
593
|
-
var utils$
|
|
593
|
+
var utils$9 = utils$b;
|
|
594
594
|
|
|
595
595
|
function InterceptorManager$1() {
|
|
596
596
|
this.handlers = [];
|
|
@@ -634,7 +634,7 @@ InterceptorManager$1.prototype.eject = function eject(id) {
|
|
|
634
634
|
* @param {Function} fn The function to call for each interceptor
|
|
635
635
|
*/
|
|
636
636
|
InterceptorManager$1.prototype.forEach = function forEach(fn) {
|
|
637
|
-
utils$
|
|
637
|
+
utils$9.forEach(this.handlers, function forEachHandler(h) {
|
|
638
638
|
if (h !== null) {
|
|
639
639
|
fn(h);
|
|
640
640
|
}
|
|
@@ -869,10 +869,10 @@ var browser$1 = {
|
|
|
869
869
|
uptime: uptime
|
|
870
870
|
};
|
|
871
871
|
|
|
872
|
-
var utils$
|
|
872
|
+
var utils$8 = utils$b;
|
|
873
873
|
|
|
874
874
|
var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
|
|
875
|
-
utils$
|
|
875
|
+
utils$8.forEach(headers, function processHeader(value, name) {
|
|
876
876
|
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
877
877
|
headers[normalizedName] = value;
|
|
878
878
|
delete headers[name];
|
|
@@ -880,99 +880,90 @@ var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName
|
|
|
880
880
|
});
|
|
881
881
|
};
|
|
882
882
|
|
|
883
|
-
var
|
|
884
|
-
var hasRequiredAxiosError;
|
|
883
|
+
var utils$7 = utils$b;
|
|
885
884
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
config: this.config,
|
|
928
|
-
code: this.code,
|
|
929
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
930
|
-
};
|
|
931
|
-
}
|
|
932
|
-
});
|
|
933
|
-
|
|
934
|
-
var prototype = AxiosError.prototype;
|
|
935
|
-
var descriptors = {};
|
|
885
|
+
/**
|
|
886
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
887
|
+
*
|
|
888
|
+
* @param {string} message The error message.
|
|
889
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
890
|
+
* @param {Object} [config] The config.
|
|
891
|
+
* @param {Object} [request] The request.
|
|
892
|
+
* @param {Object} [response] The response.
|
|
893
|
+
* @returns {Error} The created error.
|
|
894
|
+
*/
|
|
895
|
+
function AxiosError$2(message, code, config, request, response) {
|
|
896
|
+
Error.call(this);
|
|
897
|
+
this.message = message;
|
|
898
|
+
this.name = 'AxiosError';
|
|
899
|
+
code && (this.code = code);
|
|
900
|
+
config && (this.config = config);
|
|
901
|
+
request && (this.request = request);
|
|
902
|
+
response && (this.response = response);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
utils$7.inherits(AxiosError$2, Error, {
|
|
906
|
+
toJSON: function toJSON() {
|
|
907
|
+
return {
|
|
908
|
+
// Standard
|
|
909
|
+
message: this.message,
|
|
910
|
+
name: this.name,
|
|
911
|
+
// Microsoft
|
|
912
|
+
description: this.description,
|
|
913
|
+
number: this.number,
|
|
914
|
+
// Mozilla
|
|
915
|
+
fileName: this.fileName,
|
|
916
|
+
lineNumber: this.lineNumber,
|
|
917
|
+
columnNumber: this.columnNumber,
|
|
918
|
+
stack: this.stack,
|
|
919
|
+
// Axios
|
|
920
|
+
config: this.config,
|
|
921
|
+
code: this.code,
|
|
922
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
});
|
|
936
926
|
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
927
|
+
var prototype = AxiosError$2.prototype;
|
|
928
|
+
var descriptors = {};
|
|
929
|
+
|
|
930
|
+
[
|
|
931
|
+
'ERR_BAD_OPTION_VALUE',
|
|
932
|
+
'ERR_BAD_OPTION',
|
|
933
|
+
'ECONNABORTED',
|
|
934
|
+
'ETIMEDOUT',
|
|
935
|
+
'ERR_NETWORK',
|
|
936
|
+
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
937
|
+
'ERR_DEPRECATED',
|
|
938
|
+
'ERR_BAD_RESPONSE',
|
|
939
|
+
'ERR_BAD_REQUEST',
|
|
940
|
+
'ERR_CANCELED'
|
|
941
|
+
// eslint-disable-next-line func-names
|
|
942
|
+
].forEach(function(code) {
|
|
943
|
+
descriptors[code] = {value: code};
|
|
944
|
+
});
|
|
952
945
|
|
|
953
|
-
|
|
954
|
-
|
|
946
|
+
Object.defineProperties(AxiosError$2, descriptors);
|
|
947
|
+
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
955
948
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
949
|
+
// eslint-disable-next-line func-names
|
|
950
|
+
AxiosError$2.from = function(error, code, config, request, response, customProps) {
|
|
951
|
+
var axiosError = Object.create(prototype);
|
|
959
952
|
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
953
|
+
utils$7.toFlatObject(error, axiosError, function filter(obj) {
|
|
954
|
+
return obj !== Error.prototype;
|
|
955
|
+
});
|
|
963
956
|
|
|
964
|
-
|
|
957
|
+
AxiosError$2.call(axiosError, error.message, code, config, request, response);
|
|
965
958
|
|
|
966
|
-
|
|
959
|
+
axiosError.name = error.name;
|
|
967
960
|
|
|
968
|
-
|
|
961
|
+
customProps && Object.assign(axiosError, customProps);
|
|
969
962
|
|
|
970
|
-
|
|
971
|
-
|
|
963
|
+
return axiosError;
|
|
964
|
+
};
|
|
972
965
|
|
|
973
|
-
|
|
974
|
-
return AxiosError_1;
|
|
975
|
-
}
|
|
966
|
+
var AxiosError_1 = AxiosError$2;
|
|
976
967
|
|
|
977
968
|
var transitional = {
|
|
978
969
|
silentJSONParsing: true,
|
|
@@ -2955,86 +2946,77 @@ function isSlowBuffer (obj) {
|
|
|
2955
2946
|
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
|
|
2956
2947
|
}
|
|
2957
2948
|
|
|
2958
|
-
var
|
|
2959
|
-
var hasRequiredToFormData;
|
|
2949
|
+
var utils$6 = utils$b;
|
|
2960
2950
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
/**
|
|
2968
|
-
* Convert a data object to FormData
|
|
2969
|
-
* @param {Object} obj
|
|
2970
|
-
* @param {?Object} [formData]
|
|
2971
|
-
* @returns {Object}
|
|
2972
|
-
**/
|
|
2973
|
-
|
|
2974
|
-
function toFormData(obj, formData) {
|
|
2975
|
-
// eslint-disable-next-line no-param-reassign
|
|
2976
|
-
formData = formData || new FormData();
|
|
2951
|
+
/**
|
|
2952
|
+
* Convert a data object to FormData
|
|
2953
|
+
* @param {Object} obj
|
|
2954
|
+
* @param {?Object} [formData]
|
|
2955
|
+
* @returns {Object}
|
|
2956
|
+
**/
|
|
2977
2957
|
|
|
2978
|
-
|
|
2958
|
+
function toFormData$1(obj, formData) {
|
|
2959
|
+
// eslint-disable-next-line no-param-reassign
|
|
2960
|
+
formData = formData || new FormData();
|
|
2979
2961
|
|
|
2980
|
-
|
|
2981
|
-
if (value === null) return '';
|
|
2962
|
+
var stack = [];
|
|
2982
2963
|
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
}
|
|
2964
|
+
function convertValue(value) {
|
|
2965
|
+
if (value === null) return '';
|
|
2986
2966
|
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2967
|
+
if (utils$6.isDate(value)) {
|
|
2968
|
+
return value.toISOString();
|
|
2969
|
+
}
|
|
2990
2970
|
|
|
2991
|
-
|
|
2992
|
-
|
|
2971
|
+
if (utils$6.isArrayBuffer(value) || utils$6.isTypedArray(value)) {
|
|
2972
|
+
return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
2973
|
+
}
|
|
2993
2974
|
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
if (stack.indexOf(data) !== -1) {
|
|
2997
|
-
throw Error('Circular reference detected in ' + parentKey);
|
|
2998
|
-
}
|
|
2975
|
+
return value;
|
|
2976
|
+
}
|
|
2999
2977
|
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
var arr;
|
|
3006
|
-
|
|
3007
|
-
if (value && !parentKey && typeof value === 'object') {
|
|
3008
|
-
if (utils.endsWith(key, '{}')) {
|
|
3009
|
-
// eslint-disable-next-line no-param-reassign
|
|
3010
|
-
value = JSON.stringify(value);
|
|
3011
|
-
} else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
|
|
3012
|
-
// eslint-disable-next-line func-names
|
|
3013
|
-
arr.forEach(function(el) {
|
|
3014
|
-
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
3015
|
-
});
|
|
3016
|
-
return;
|
|
3017
|
-
}
|
|
3018
|
-
}
|
|
2978
|
+
function build(data, parentKey) {
|
|
2979
|
+
if (utils$6.isPlainObject(data) || utils$6.isArray(data)) {
|
|
2980
|
+
if (stack.indexOf(data) !== -1) {
|
|
2981
|
+
throw Error('Circular reference detected in ' + parentKey);
|
|
2982
|
+
}
|
|
3019
2983
|
|
|
3020
|
-
|
|
3021
|
-
|
|
2984
|
+
stack.push(data);
|
|
2985
|
+
|
|
2986
|
+
utils$6.forEach(data, function each(value, key) {
|
|
2987
|
+
if (utils$6.isUndefined(value)) return;
|
|
2988
|
+
var fullKey = parentKey ? parentKey + '.' + key : key;
|
|
2989
|
+
var arr;
|
|
2990
|
+
|
|
2991
|
+
if (value && !parentKey && typeof value === 'object') {
|
|
2992
|
+
if (utils$6.endsWith(key, '{}')) {
|
|
2993
|
+
// eslint-disable-next-line no-param-reassign
|
|
2994
|
+
value = JSON.stringify(value);
|
|
2995
|
+
} else if (utils$6.endsWith(key, '[]') && (arr = utils$6.toArray(value))) {
|
|
2996
|
+
// eslint-disable-next-line func-names
|
|
2997
|
+
arr.forEach(function(el) {
|
|
2998
|
+
!utils$6.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
2999
|
+
});
|
|
3000
|
+
return;
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3022
3003
|
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
formData.append(parentKey, convertValue(data));
|
|
3026
|
-
}
|
|
3027
|
-
}
|
|
3004
|
+
build(value, fullKey);
|
|
3005
|
+
});
|
|
3028
3006
|
|
|
3029
|
-
|
|
3007
|
+
stack.pop();
|
|
3008
|
+
} else {
|
|
3009
|
+
formData.append(parentKey, convertValue(data));
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3030
3012
|
|
|
3031
|
-
|
|
3032
|
-
}
|
|
3013
|
+
build(obj);
|
|
3033
3014
|
|
|
3034
|
-
|
|
3035
|
-
return toFormData_1;
|
|
3015
|
+
return formData;
|
|
3036
3016
|
}
|
|
3037
3017
|
|
|
3018
|
+
var toFormData_1 = toFormData$1;
|
|
3019
|
+
|
|
3038
3020
|
var settle;
|
|
3039
3021
|
var hasRequiredSettle;
|
|
3040
3022
|
|
|
@@ -3042,7 +3024,7 @@ function requireSettle () {
|
|
|
3042
3024
|
if (hasRequiredSettle) return settle;
|
|
3043
3025
|
hasRequiredSettle = 1;
|
|
3044
3026
|
|
|
3045
|
-
var AxiosError =
|
|
3027
|
+
var AxiosError = AxiosError_1;
|
|
3046
3028
|
|
|
3047
3029
|
/**
|
|
3048
3030
|
* Resolve or reject a Promise based on response status.
|
|
@@ -3075,7 +3057,7 @@ function requireCookies () {
|
|
|
3075
3057
|
if (hasRequiredCookies) return cookies;
|
|
3076
3058
|
hasRequiredCookies = 1;
|
|
3077
3059
|
|
|
3078
|
-
var utils = utils$
|
|
3060
|
+
var utils = utils$b;
|
|
3079
3061
|
|
|
3080
3062
|
cookies = (
|
|
3081
3063
|
utils.isStandardBrowserEnv() ?
|
|
@@ -3181,7 +3163,7 @@ function requireParseHeaders () {
|
|
|
3181
3163
|
if (hasRequiredParseHeaders) return parseHeaders;
|
|
3182
3164
|
hasRequiredParseHeaders = 1;
|
|
3183
3165
|
|
|
3184
|
-
var utils = utils$
|
|
3166
|
+
var utils = utils$b;
|
|
3185
3167
|
|
|
3186
3168
|
// Headers whose duplicates are ignored by node
|
|
3187
3169
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
@@ -3242,7 +3224,7 @@ function requireIsURLSameOrigin () {
|
|
|
3242
3224
|
if (hasRequiredIsURLSameOrigin) return isURLSameOrigin;
|
|
3243
3225
|
hasRequiredIsURLSameOrigin = 1;
|
|
3244
3226
|
|
|
3245
|
-
var utils = utils$
|
|
3227
|
+
var utils = utils$b;
|
|
3246
3228
|
|
|
3247
3229
|
isURLSameOrigin = (
|
|
3248
3230
|
utils.isStandardBrowserEnv() ?
|
|
@@ -3318,8 +3300,8 @@ function requireCanceledError () {
|
|
|
3318
3300
|
if (hasRequiredCanceledError) return CanceledError_1;
|
|
3319
3301
|
hasRequiredCanceledError = 1;
|
|
3320
3302
|
|
|
3321
|
-
var AxiosError =
|
|
3322
|
-
var utils = utils$
|
|
3303
|
+
var AxiosError = AxiosError_1;
|
|
3304
|
+
var utils = utils$b;
|
|
3323
3305
|
|
|
3324
3306
|
/**
|
|
3325
3307
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
@@ -3362,7 +3344,7 @@ function requireXhr () {
|
|
|
3362
3344
|
if (hasRequiredXhr) return xhr$1;
|
|
3363
3345
|
hasRequiredXhr = 1;
|
|
3364
3346
|
|
|
3365
|
-
var utils = utils$
|
|
3347
|
+
var utils = utils$b;
|
|
3366
3348
|
var settle = requireSettle();
|
|
3367
3349
|
var cookies = requireCookies();
|
|
3368
3350
|
var buildURL = buildURL$1;
|
|
@@ -3370,7 +3352,7 @@ function requireXhr () {
|
|
|
3370
3352
|
var parseHeaders = requireParseHeaders();
|
|
3371
3353
|
var isURLSameOrigin = requireIsURLSameOrigin();
|
|
3372
3354
|
var transitionalDefaults = transitional;
|
|
3373
|
-
var AxiosError =
|
|
3355
|
+
var AxiosError = AxiosError_1;
|
|
3374
3356
|
var CanceledError = requireCanceledError();
|
|
3375
3357
|
var parseProtocol = requireParseProtocol();
|
|
3376
3358
|
|
|
@@ -16007,7 +15989,7 @@ function requireHttp () {
|
|
|
16007
15989
|
if (hasRequiredHttp) return http_1;
|
|
16008
15990
|
hasRequiredHttp = 1;
|
|
16009
15991
|
|
|
16010
|
-
var utils = utils$
|
|
15992
|
+
var utils = utils$b;
|
|
16011
15993
|
var settle = requireSettle();
|
|
16012
15994
|
var buildFullPath = buildFullPath$1;
|
|
16013
15995
|
var buildURL = buildURL$1;
|
|
@@ -16019,7 +16001,7 @@ function requireHttp () {
|
|
|
16019
16001
|
var zlib = require$$8;
|
|
16020
16002
|
var VERSION = requireData().version;
|
|
16021
16003
|
var transitionalDefaults = transitional;
|
|
16022
|
-
var AxiosError =
|
|
16004
|
+
var AxiosError = AxiosError_1;
|
|
16023
16005
|
var CanceledError = requireCanceledError();
|
|
16024
16006
|
|
|
16025
16007
|
var isHttps = /https:?/;
|
|
@@ -28967,11 +28949,11 @@ function requireFormData () {
|
|
|
28967
28949
|
return FormDataExports;
|
|
28968
28950
|
}
|
|
28969
28951
|
|
|
28970
|
-
var utils$5 = utils$
|
|
28952
|
+
var utils$5 = utils$b;
|
|
28971
28953
|
var normalizeHeaderName = normalizeHeaderName$1;
|
|
28972
|
-
var AxiosError$1 =
|
|
28954
|
+
var AxiosError$1 = AxiosError_1;
|
|
28973
28955
|
var transitionalDefaults = transitional;
|
|
28974
|
-
var toFormData =
|
|
28956
|
+
var toFormData = toFormData_1;
|
|
28975
28957
|
|
|
28976
28958
|
var DEFAULT_CONTENT_TYPE = {
|
|
28977
28959
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
@@ -29112,7 +29094,7 @@ utils$5.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
|
|
|
29112
29094
|
|
|
29113
29095
|
var defaults_1 = defaults$3;
|
|
29114
29096
|
|
|
29115
|
-
var utils$4 = utils$
|
|
29097
|
+
var utils$4 = utils$b;
|
|
29116
29098
|
var defaults$2 = defaults_1;
|
|
29117
29099
|
|
|
29118
29100
|
/**
|
|
@@ -29146,7 +29128,7 @@ function requireIsCancel () {
|
|
|
29146
29128
|
return isCancel$1;
|
|
29147
29129
|
}
|
|
29148
29130
|
|
|
29149
|
-
var utils$3 = utils$
|
|
29131
|
+
var utils$3 = utils$b;
|
|
29150
29132
|
var transformData = transformData$1;
|
|
29151
29133
|
var isCancel = requireIsCancel();
|
|
29152
29134
|
var defaults$1 = defaults_1;
|
|
@@ -29232,7 +29214,7 @@ var dispatchRequest$1 = function dispatchRequest(config) {
|
|
|
29232
29214
|
});
|
|
29233
29215
|
};
|
|
29234
29216
|
|
|
29235
|
-
var utils$2 = utils$
|
|
29217
|
+
var utils$2 = utils$b;
|
|
29236
29218
|
|
|
29237
29219
|
/**
|
|
29238
29220
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -29332,7 +29314,7 @@ var mergeConfig$2 = function mergeConfig(config1, config2) {
|
|
|
29332
29314
|
};
|
|
29333
29315
|
|
|
29334
29316
|
var VERSION = requireData().version;
|
|
29335
|
-
var AxiosError =
|
|
29317
|
+
var AxiosError = AxiosError_1;
|
|
29336
29318
|
|
|
29337
29319
|
var validators$1 = {};
|
|
29338
29320
|
|
|
@@ -29416,7 +29398,7 @@ var validator$1 = {
|
|
|
29416
29398
|
validators: validators$1
|
|
29417
29399
|
};
|
|
29418
29400
|
|
|
29419
|
-
var utils$1 = utils$
|
|
29401
|
+
var utils$1 = utils$b;
|
|
29420
29402
|
var buildURL = buildURL$1;
|
|
29421
29403
|
var InterceptorManager = InterceptorManager_1;
|
|
29422
29404
|
var dispatchRequest = dispatchRequest$1;
|
|
@@ -29744,7 +29726,7 @@ function requireIsAxiosError () {
|
|
|
29744
29726
|
if (hasRequiredIsAxiosError) return isAxiosError;
|
|
29745
29727
|
hasRequiredIsAxiosError = 1;
|
|
29746
29728
|
|
|
29747
|
-
var utils = utils$
|
|
29729
|
+
var utils = utils$b;
|
|
29748
29730
|
|
|
29749
29731
|
/**
|
|
29750
29732
|
* Determines whether the payload is an error thrown by Axios
|
|
@@ -29758,7 +29740,7 @@ function requireIsAxiosError () {
|
|
|
29758
29740
|
return isAxiosError;
|
|
29759
29741
|
}
|
|
29760
29742
|
|
|
29761
|
-
var utils = utils$
|
|
29743
|
+
var utils = utils$b;
|
|
29762
29744
|
var bind = bind$2;
|
|
29763
29745
|
var Axios = Axios_1;
|
|
29764
29746
|
var mergeConfig = mergeConfig$2;
|
|
@@ -29799,10 +29781,10 @@ axios$1.CanceledError = requireCanceledError();
|
|
|
29799
29781
|
axios$1.CancelToken = requireCancelToken();
|
|
29800
29782
|
axios$1.isCancel = requireIsCancel();
|
|
29801
29783
|
axios$1.VERSION = requireData().version;
|
|
29802
|
-
axios$1.toFormData =
|
|
29784
|
+
axios$1.toFormData = toFormData_1;
|
|
29803
29785
|
|
|
29804
29786
|
// Expose AxiosError class
|
|
29805
|
-
axios$1.AxiosError =
|
|
29787
|
+
axios$1.AxiosError = AxiosError_1;
|
|
29806
29788
|
|
|
29807
29789
|
// alias for CanceledError for backward compatibility
|
|
29808
29790
|
axios$1.Cancel = axios$1.CanceledError;
|
|
@@ -29952,147 +29934,11 @@ var Config = /** @class */ (function () {
|
|
|
29952
29934
|
return Config;
|
|
29953
29935
|
}());
|
|
29954
29936
|
|
|
29955
|
-
var AuthRoutes = /** @class */ (function () {
|
|
29956
|
-
function AuthRoutes() {
|
|
29957
|
-
}
|
|
29958
|
-
AuthRoutes.routes = {
|
|
29959
|
-
login: { url: '/auth/login', method: HTTP_METHODS.POST },
|
|
29960
|
-
register: { url: '/auth/register', method: HTTP_METHODS.POST },
|
|
29961
|
-
one_time_login: { url: '/auth/oneTimeLoginWithToken', method: HTTP_METHODS.POST },
|
|
29962
|
-
forgot_password: { url: '/auth/forgotpassword', method: HTTP_METHODS.POST },
|
|
29963
|
-
reset_password: { url: '/auth/resetpassword', method: HTTP_METHODS.POST },
|
|
29964
|
-
};
|
|
29965
|
-
return AuthRoutes;
|
|
29966
|
-
}());
|
|
29967
|
-
|
|
29968
|
-
var Auth = /** @class */ (function () {
|
|
29969
|
-
function Auth() {
|
|
29970
|
-
}
|
|
29971
|
-
/**
|
|
29972
|
-
* Attempts to authenticate a user using their email address.
|
|
29973
|
-
*
|
|
29974
|
-
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
|
|
29975
|
-
*
|
|
29976
|
-
* @param email The email address of the user
|
|
29977
|
-
* @param password The password of the user
|
|
29978
|
-
*
|
|
29979
|
-
* @returns A promise
|
|
29980
|
-
*/
|
|
29981
|
-
Auth.loginWithEmail = function (email, password) {
|
|
29982
|
-
return Requests.post(AuthRoutes.routes.login.url, { email: email, password: password });
|
|
29983
|
-
};
|
|
29984
|
-
/**
|
|
29985
|
-
* Attempts to authenticate a user using their username.
|
|
29986
|
-
*
|
|
29987
|
-
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authLogin
|
|
29988
|
-
*
|
|
29989
|
-
* @param username The username of the user
|
|
29990
|
-
* @param password The password of the user
|
|
29991
|
-
*
|
|
29992
|
-
* @returns A promise
|
|
29993
|
-
*/
|
|
29994
|
-
Auth.loginWithUsername = function (username, password) {
|
|
29995
|
-
return Requests.post(AuthRoutes.routes.login.url, { username: username, password: password });
|
|
29996
|
-
};
|
|
29997
|
-
/**
|
|
29998
|
-
* Attempts to register a user.
|
|
29999
|
-
*
|
|
30000
|
-
* @see https://api.glitch.fun/api/documentation#/Authentication%20Route/authRegister
|
|
30001
|
-
*
|
|
30002
|
-
* @param data The data the user can register with.
|
|
30003
|
-
*
|
|
30004
|
-
* @returns A promise
|
|
30005
|
-
*/
|
|
30006
|
-
Auth.register = function (data) {
|
|
30007
|
-
return Requests.processRoute(AuthRoutes.routes.register, data);
|
|
30008
|
-
};
|
|
30009
|
-
return Auth;
|
|
30010
|
-
}());
|
|
30011
|
-
|
|
30012
|
-
var CompetitionRoutes = /** @class */ (function () {
|
|
30013
|
-
function CompetitionRoutes() {
|
|
30014
|
-
}
|
|
30015
|
-
CompetitionRoutes.routes = {
|
|
30016
|
-
list: { url: '/competitions', method: HTTP_METHODS.GET },
|
|
30017
|
-
create: { url: '/competitions', method: HTTP_METHODS.POST },
|
|
30018
|
-
view: { url: '/competitions/{competition_id}', method: HTTP_METHODS.GET },
|
|
30019
|
-
update: { url: '/competitions/{competition_id}', method: HTTP_METHODS.PUT },
|
|
30020
|
-
delete: { url: '/competitions/{competition_id}', method: HTTP_METHODS.DELETE },
|
|
30021
|
-
};
|
|
30022
|
-
return CompetitionRoutes;
|
|
30023
|
-
}());
|
|
30024
|
-
|
|
30025
|
-
var Competitions = /** @class */ (function () {
|
|
30026
|
-
function Competitions() {
|
|
30027
|
-
}
|
|
30028
|
-
/**
|
|
30029
|
-
* List all the competitions
|
|
30030
|
-
*
|
|
30031
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/resourceList
|
|
30032
|
-
*
|
|
30033
|
-
* @returns promise
|
|
30034
|
-
*/
|
|
30035
|
-
Competitions.list = function () {
|
|
30036
|
-
return Requests.processRoute(CompetitionRoutes.routes.list);
|
|
30037
|
-
};
|
|
30038
|
-
/**
|
|
30039
|
-
* Create a new competition
|
|
30040
|
-
*
|
|
30041
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/newResourceStorage
|
|
30042
|
-
*
|
|
30043
|
-
* @param data The date to be passed when creating a competiton.
|
|
30044
|
-
*
|
|
30045
|
-
* @returns Promise
|
|
30046
|
-
*/
|
|
30047
|
-
Competitions.create = function (data) {
|
|
30048
|
-
return Requests.processRoute(CompetitionRoutes.routes.create, data);
|
|
30049
|
-
};
|
|
30050
|
-
/**
|
|
30051
|
-
* Update a competition
|
|
30052
|
-
*
|
|
30053
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/updateStorage
|
|
30054
|
-
*
|
|
30055
|
-
* @param competition_id The id of the competition to update.
|
|
30056
|
-
* @param data The data to update.
|
|
30057
|
-
*
|
|
30058
|
-
* @returns promise
|
|
30059
|
-
*/
|
|
30060
|
-
Competitions.update = function (competition_id, data) {
|
|
30061
|
-
return Requests.processRoute(CompetitionRoutes.routes.create, data, { competition_id: competition_id });
|
|
30062
|
-
};
|
|
30063
|
-
/**
|
|
30064
|
-
* Retrieve the information for a single competition.
|
|
30065
|
-
*
|
|
30066
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/showStorage
|
|
30067
|
-
*
|
|
30068
|
-
* @param competition_id The id fo the competition to retrieve.
|
|
30069
|
-
*
|
|
30070
|
-
* @returns promise
|
|
30071
|
-
*/
|
|
30072
|
-
Competitions.view = function (competition_id) {
|
|
30073
|
-
return Requests.processRoute(CompetitionRoutes.routes.view, {}, { competition_id: competition_id });
|
|
30074
|
-
};
|
|
30075
|
-
/**
|
|
30076
|
-
* Deletes a competition.
|
|
30077
|
-
*
|
|
30078
|
-
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/destoryStorage
|
|
30079
|
-
*
|
|
30080
|
-
* @param competition_id The id of the competition to delete.
|
|
30081
|
-
* @returns promise
|
|
30082
|
-
*/
|
|
30083
|
-
Competitions.delete = function (competition_id) {
|
|
30084
|
-
return Requests.processRoute(CompetitionRoutes.routes.delete, {}, { competition_id: competition_id });
|
|
30085
|
-
};
|
|
30086
|
-
return Competitions;
|
|
30087
|
-
}());
|
|
30088
|
-
|
|
30089
29937
|
//Configuration
|
|
30090
29938
|
var Glitch = /** @class */ (function () {
|
|
30091
29939
|
function Glitch() {
|
|
30092
29940
|
}
|
|
30093
29941
|
Glitch.config = Config;
|
|
30094
|
-
Glitch.auth = Auth;
|
|
30095
|
-
Glitch.competitions = Competitions;
|
|
30096
29942
|
return Glitch;
|
|
30097
29943
|
}());
|
|
30098
29944
|
|