@ifunny/ifunny-api-types 0.6.9 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/dist/errors/bad_request.js +8 -0
- package/dist/errors/bad_request.js.map +1 -0
- package/dist/errors/captcha_required.js +19 -0
- package/dist/errors/captcha_required.js.map +1 -0
- package/dist/errors/email_exists.js +8 -0
- package/dist/errors/email_exists.js.map +1 -0
- package/dist/errors/error.js +3 -0
- package/dist/errors/error.js.map +1 -0
- package/dist/errors/error_base.js +40 -0
- package/dist/errors/error_base.js.map +1 -0
- package/dist/errors/index.js +23 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/invalid_email.js +8 -0
- package/dist/errors/invalid_email.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/rest/content.js +15 -13
- package/dist/rest/content.js.map +1 -1
- package/dist/rest/endpoints.js +156 -0
- package/dist/rest/endpoints.js.map +1 -0
- package/dist/rest/index.js +1 -0
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/oauth2.js.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/types/errors/bad_request.d.ts +12 -0
- package/types/errors/bad_request.d.ts.map +1 -0
- package/types/errors/captcha_required.d.ts +33 -0
- package/types/errors/captcha_required.d.ts.map +1 -0
- package/types/errors/email_exists.d.ts +15 -0
- package/types/errors/email_exists.d.ts.map +1 -0
- package/types/errors/error.d.ts +24 -0
- package/types/errors/error.d.ts.map +1 -0
- package/types/errors/error_base.d.ts +58 -0
- package/types/errors/error_base.d.ts.map +1 -0
- package/types/errors/index.d.ts +7 -0
- package/types/errors/index.d.ts.map +1 -0
- package/types/errors/invalid_email.d.ts +15 -0
- package/types/errors/invalid_email.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/rest/content.d.ts +12 -2
- package/types/rest/content.d.ts.map +1 -1
- package/types/rest/endpoints.d.ts +118 -0
- package/types/rest/endpoints.d.ts.map +1 -0
- package/types/rest/index.d.ts +1 -0
- package/types/rest/index.d.ts.map +1 -1
- package/types/rest/oauth2.d.ts +4 -2
- package/types/rest/oauth2.d.ts.map +1 -1
- package/types/utils/index.d.ts +0 -1
- package/types/utils/index.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
> All notable changes to this project will be documented in this file.
|
|
3
3
|
> This Changelog adheres to the [Semantic Versioning]("https://semver.org/")
|
|
4
4
|
|
|
5
|
+
## [v0.7.2](https://github.com/ifunny-co/ifunny-api-types/compare/v0.7.1...v0.7.2) - 2022-08-28
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Refactored util/errors into errors/ @MakeShiftArtist ([`e5e709d`](https://github.com/ifunny-co/ifunny-api-types/commit/e5e709d3b6880ee8817a95314d2e3668497634c8))
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
* Change VIEWED_FROM to ACTION_LOCATION @MakeShiftArtist ([`94ae53e`](https://github.com/ifunny-co/ifunny-api-types/commit/94ae53ebc57a20a8bfc9d1dd3cecac4401f0e843))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Documentation
|
|
17
|
+
|
|
18
|
+
* Update CHANGELOG.md @MakeShiftArtist ([`3a58949`](https://github.com/ifunny-co/ifunny-api-types/commit/3a589494c5a9a8853cc8c46604f465f3b887bf54))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [v0.7.1](https://github.com/ifunny-co/ifunny-api-types/compare/v0.7.0...v0.7.1) - 2022-08-25
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Fixes
|
|
25
|
+
|
|
26
|
+
* Updated exports to reflect endpoints @MakeShiftArtist ([`49c70fd`](https://github.com/ifunny-co/ifunny-api-types/commit/49c70fd9604e1561cd372c98dc6f3171fb945e1c))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Documentation
|
|
30
|
+
|
|
31
|
+
* Update CHANGELOG.md @MakeShiftArtist ([`4ef5690`](https://github.com/ifunny-co/ifunny-api-types/commit/4ef56906067a61045cd21b1287f7bba589d1a0fb))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## [v0.7.0](https://github.com/ifunny-co/ifunny-api-types/compare/v0.6.9...v0.7.0) - 2022-08-25
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* Add endpoints.ts @MakeShiftArtist ([`e39adf6`](https://github.com/ifunny-co/ifunny-api-types/commit/e39adf6adde6699dd0630dbfaaae960ba939177d))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Documentation
|
|
43
|
+
|
|
44
|
+
* Update CHANGELOG.md @MakeShiftArtist ([`13a6361`](https://github.com/ifunny-co/ifunny-api-types/commit/13a63613724d515986b87a746b674fd5d2446d9b))
|
|
45
|
+
|
|
46
|
+
|
|
5
47
|
## [v0.6.9](https://github.com/ifunny-co/ifunny-api-types/compare/v0.6.8...v0.6.9) - 2022-08-25
|
|
6
48
|
|
|
7
49
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BAD_REQUEST = void 0;
|
|
4
|
+
var BAD_REQUEST;
|
|
5
|
+
(function (BAD_REQUEST) {
|
|
6
|
+
BAD_REQUEST["INVALID_USER_ID"] = "Invalid user id";
|
|
7
|
+
})(BAD_REQUEST = exports.BAD_REQUEST || (exports.BAD_REQUEST = {}));
|
|
8
|
+
//# sourceMappingURL=bad_request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bad_request.js","sourceRoot":"","sources":["../../src/errors/bad_request.ts"],"names":[],"mappings":";;;AAUA,IAAY,WAEX;AAFD,WAAY,WAAW;IACtB,kDAAmC,CAAA;AACpC,CAAC,EAFW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAEtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CAPTCHA_REQUIRED = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Known error descriptions
|
|
6
|
+
*/
|
|
7
|
+
var CAPTCHA_REQUIRED;
|
|
8
|
+
(function (CAPTCHA_REQUIRED) {
|
|
9
|
+
CAPTCHA_REQUIRED["VERIFY_HUMAN"] = "Human verification is required";
|
|
10
|
+
})(CAPTCHA_REQUIRED = exports.CAPTCHA_REQUIRED || (exports.CAPTCHA_REQUIRED = {}));
|
|
11
|
+
/**
|
|
12
|
+
* Known captcha types
|
|
13
|
+
*/
|
|
14
|
+
var CAPTCHA_TYPE;
|
|
15
|
+
(function (CAPTCHA_TYPE) {
|
|
16
|
+
CAPTCHA_TYPE["FUN_CAPTCHA"] = "fun_captcha";
|
|
17
|
+
CAPTCHA_TYPE["RECAPTCHA"] = "recaptcha";
|
|
18
|
+
})(CAPTCHA_TYPE || (CAPTCHA_TYPE = {}));
|
|
19
|
+
//# sourceMappingURL=captcha_required.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captcha_required.js","sourceRoot":"","sources":["../../src/errors/captcha_required.ts"],"names":[],"mappings":";;;AAoBA;;GAEG;AACH,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC3B,mEAA+C,CAAA;AAChD,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B;AAID;;GAEG;AACH,IAAK,YAGJ;AAHD,WAAK,YAAY;IAChB,2CAA2B,CAAA;IAC3B,uCAAuB,CAAA;AACxB,CAAC,EAHI,YAAY,KAAZ,YAAY,QAGhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EMAIL_EXISTS_MESSAGE = void 0;
|
|
4
|
+
var EMAIL_EXISTS_MESSAGE;
|
|
5
|
+
(function (EMAIL_EXISTS_MESSAGE) {
|
|
6
|
+
EMAIL_EXISTS_MESSAGE["USER_WITH_EMAIL"] = "There is a user with this email";
|
|
7
|
+
})(EMAIL_EXISTS_MESSAGE = exports.EMAIL_EXISTS_MESSAGE || (exports.EMAIL_EXISTS_MESSAGE = {}));
|
|
8
|
+
//# sourceMappingURL=email_exists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email_exists.js","sourceRoot":"","sources":["../../src/errors/email_exists.ts"],"names":[],"mappings":";;;AAYA,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC/B,2EAAmD,CAAA;AACpD,CAAC,EAFW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAE/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/errors/error.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IFUNNY_ERRORS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* All known error types
|
|
6
|
+
*/
|
|
7
|
+
var IFUNNY_ERRORS;
|
|
8
|
+
(function (IFUNNY_ERRORS) {
|
|
9
|
+
IFUNNY_ERRORS["ALREADY_REPUBLISHED"] = "already_republished";
|
|
10
|
+
IFUNNY_ERRORS["ALREADY_SMILED"] = "already_smiled";
|
|
11
|
+
IFUNNY_ERRORS["ALREADY_UNSMILED"] = "already_unsmiled";
|
|
12
|
+
IFUNNY_ERRORS["BAD_REQUEST"] = "bad_request";
|
|
13
|
+
IFUNNY_ERRORS["CAPTCHA_REQUIRED"] = "captcha_required";
|
|
14
|
+
IFUNNY_ERRORS["CONTENT_WAS_DELETED"] = "content_was_deleted";
|
|
15
|
+
IFUNNY_ERRORS["EMAIL_EXISTS"] = "email_exists";
|
|
16
|
+
IFUNNY_ERRORS["EMAIL_NOT_CONFIRMED"] = "email_not_confirmed";
|
|
17
|
+
IFUNNY_ERRORS["ENTITY_ABUSED"] = "entity_abused";
|
|
18
|
+
IFUNNY_ERRORS["FORBIDDEN_FOR_BANNED"] = "forbidden_for_banned";
|
|
19
|
+
IFUNNY_ERRORS["FORBIDDEN_FOR_DELETED"] = "forbidden_for_deactivated";
|
|
20
|
+
IFUNNY_ERRORS["INVALID_CLIENT"] = "invalid_client";
|
|
21
|
+
IFUNNY_ERRORS["INVALID_EMAIL"] = "invalid_email";
|
|
22
|
+
IFUNNY_ERRORS["INVALID_GRANT"] = "invalid_grant";
|
|
23
|
+
IFUNNY_ERRORS["NOT_REPUBLISHED"] = "not_republished";
|
|
24
|
+
IFUNNY_ERRORS["NOT_SMILED"] = "not_smiled";
|
|
25
|
+
IFUNNY_ERRORS["NOT_UNSMILED"] = "not_unsmiled";
|
|
26
|
+
IFUNNY_ERRORS["PINNED_LIMIT_EXCEEDED"] = "profile_pins_to_many_pins_error";
|
|
27
|
+
IFUNNY_ERRORS["PUBLISHING_TIMEOUT"] = "publishing_timeout";
|
|
28
|
+
IFUNNY_ERRORS["QUERY_TOO_SHORT"] = "query_too_short";
|
|
29
|
+
IFUNNY_ERRORS["ROOT_COMMENT_WAS_DELETED"] = "root_comment_was_deleted";
|
|
30
|
+
IFUNNY_ERRORS["SOURCE_IS_UNAVAILABLE"] = "source_is_unavailable";
|
|
31
|
+
IFUNNY_ERRORS["STOP_WORD"] = "content_tag_stopword";
|
|
32
|
+
IFUNNY_ERRORS["TOO_MANY_UPPERCASE"] = "too_many_uppercase";
|
|
33
|
+
IFUNNY_ERRORS["UNACCEPTABLE_SYMBOLS"] = "unacceptable_symbols";
|
|
34
|
+
IFUNNY_ERRORS["UNAUTHORIZED"] = "unauthorized";
|
|
35
|
+
IFUNNY_ERRORS["UNKNOWN_ERROR"] = "unknown_error";
|
|
36
|
+
IFUNNY_ERRORS["UNKNOWN_SOURCE"] = "unknown_source";
|
|
37
|
+
IFUNNY_ERRORS["VIDEO_IS_INVALID"] = "video_is_invalid";
|
|
38
|
+
IFUNNY_ERRORS["YOU_ARE_BLOCKED"] = "you_are_blocked";
|
|
39
|
+
})(IFUNNY_ERRORS = exports.IFUNNY_ERRORS || (exports.IFUNNY_ERRORS = {}));
|
|
40
|
+
//# sourceMappingURL=error_base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error_base.js","sourceRoot":"","sources":["../../src/errors/error_base.ts"],"names":[],"mappings":";;;AAwBA;;GAEG;AACH,IAAY,aA+BX;AA/BD,WAAY,aAAa;IACxB,4DAA2C,CAAA;IAC3C,kDAAiC,CAAA;IACjC,sDAAqC,CAAA;IACrC,4CAA2B,CAAA;IAC3B,sDAAqC,CAAA;IACrC,4DAA2C,CAAA;IAC3C,8CAA6B,CAAA;IAC7B,4DAA2C,CAAA;IAC3C,gDAA+B,CAAA;IAC/B,8DAA6C,CAAA;IAC7C,oEAAmD,CAAA;IACnD,kDAAiC,CAAA;IACjC,gDAA+B,CAAA;IAC/B,gDAA+B,CAAA;IAC/B,oDAAmC,CAAA;IACnC,0CAAyB,CAAA;IACzB,8CAA6B,CAAA;IAC7B,0EAAyD,CAAA;IACzD,0DAAyC,CAAA;IACzC,oDAAmC,CAAA;IACnC,sEAAqD,CAAA;IACrD,gEAA+C,CAAA;IAC/C,mDAAkC,CAAA;IAClC,0DAAyC,CAAA;IACzC,8DAA6C,CAAA;IAC7C,8CAA6B,CAAA;IAC7B,gDAA+B,CAAA;IAC/B,kDAAiC,CAAA;IACjC,sDAAqC,CAAA;IACrC,oDAAmC,CAAA;AACpC,CAAC,EA/BW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA+BxB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bad_request"), exports);
|
|
18
|
+
__exportStar(require("./captcha_required"), exports);
|
|
19
|
+
__exportStar(require("./email_exists"), exports);
|
|
20
|
+
__exportStar(require("./error_base"), exports);
|
|
21
|
+
__exportStar(require("./error"), exports);
|
|
22
|
+
__exportStar(require("./invalid_email"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,qDAAmC;AACnC,iDAA+B;AAC/B,+CAA6B;AAC7B,0CAAwB;AACxB,kDAAgC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INVALID_EMAIL_MESSAGE = void 0;
|
|
4
|
+
var INVALID_EMAIL_MESSAGE;
|
|
5
|
+
(function (INVALID_EMAIL_MESSAGE) {
|
|
6
|
+
INVALID_EMAIL_MESSAGE["DISPOSABLE"] = "Domain of email was found in disposable domains list";
|
|
7
|
+
})(INVALID_EMAIL_MESSAGE = exports.INVALID_EMAIL_MESSAGE || (exports.INVALID_EMAIL_MESSAGE = {}));
|
|
8
|
+
//# sourceMappingURL=invalid_email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid_email.js","sourceRoot":"","sources":["../../src/errors/invalid_email.ts"],"names":[],"mappings":";;;AAaA,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAChC,4FAAmE,CAAA;AACpE,CAAC,EAFW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAEhC"}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./errors"), exports);
|
|
17
18
|
__exportStar(require("./payloads"), exports);
|
|
18
19
|
__exportStar(require("./rest"), exports);
|
|
19
20
|
__exportStar(require("./utils"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yCAAuB;AACvB,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,yCAAuB;AACvB,0CAAwB"}
|
package/dist/rest/content.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ACTION_LOCATION = exports.REPORT_TYPE = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Possible report reasons
|
|
6
6
|
*/
|
|
@@ -52,17 +52,19 @@ var REPORT_TYPE;
|
|
|
52
52
|
REPORT_TYPE["BANNER"] = "banner";
|
|
53
53
|
})(REPORT_TYPE = exports.REPORT_TYPE || (exports.REPORT_TYPE = {}));
|
|
54
54
|
/**
|
|
55
|
-
* Where
|
|
55
|
+
* Where an action was completed
|
|
56
|
+
* @example
|
|
57
|
+
* PUT /v4/reads/:contentId?from=:ACTION_LOCATION
|
|
56
58
|
*/
|
|
57
|
-
var
|
|
58
|
-
(function (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})(
|
|
59
|
+
var ACTION_LOCATION;
|
|
60
|
+
(function (ACTION_LOCATION) {
|
|
61
|
+
ACTION_LOCATION["CHANNEL"] = "channel";
|
|
62
|
+
ACTION_LOCATION["COLLECTIVE"] = "coll";
|
|
63
|
+
ACTION_LOCATION["FEATURES"] = "feat";
|
|
64
|
+
ACTION_LOCATION["MONOFEED"] = "monofeed";
|
|
65
|
+
ACTION_LOCATION["MY_SMILES"] = "my-smiles";
|
|
66
|
+
ACTION_LOCATION["PROFILE"] = "prof";
|
|
67
|
+
ACTION_LOCATION["SUBS"] = "subs";
|
|
68
|
+
ACTION_LOCATION["TAG"] = "tag";
|
|
69
|
+
})(ACTION_LOCATION = exports.ACTION_LOCATION || (exports.ACTION_LOCATION = {}));
|
|
68
70
|
//# sourceMappingURL=content.js.map
|
package/dist/rest/content.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/rest/content.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WA6CX;AA7CD,WAAY,WAAW;IACtB;;OAEG;IACH,4BAAa,CAAA;IACb;;OAEG;IACH,4BAAa,CAAA;IACb;;OAEG;IACH,4BAAa,CAAA;IACb;;OAEG;IACH,8BAAe,CAAA;IACf;;OAEG;IACH,wCAAyB,CAAA;IACzB;;OAEG;IACH,+BAAgB,CAAA;IAChB;;OAEG;IACH,oCAAqB,CAAA;IACrB;;OAEG;IACH,wCAAyB,CAAA;IACzB;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,gCAAiB,CAAA;AAClB,CAAC,EA7CW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6CtB;
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/rest/content.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WA6CX;AA7CD,WAAY,WAAW;IACtB;;OAEG;IACH,4BAAa,CAAA;IACb;;OAEG;IACH,4BAAa,CAAA;IACb;;OAEG;IACH,4BAAa,CAAA;IACb;;OAEG;IACH,8BAAe,CAAA;IACf;;OAEG;IACH,wCAAyB,CAAA;IACzB;;OAEG;IACH,+BAAgB,CAAA;IAChB;;OAEG;IACH,oCAAqB,CAAA;IACrB;;OAEG;IACH,wCAAyB,CAAA;IACzB;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,gCAAiB,CAAA;AAClB,CAAC,EA7CW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6CtB;AAOD;;;;GAIG;AACH,IAAY,eASX;AATD,WAAY,eAAe;IAC1B,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB,0CAAuB,CAAA;IACvB,mCAAgB,CAAA;IAChB,gCAAa,CAAA;IACb,8BAAW,CAAA;AACZ,CAAC,EATW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAS1B"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Endpoints = void 0;
|
|
4
|
+
class Endpoints {
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* "/timelines/users/:userId"
|
|
8
|
+
* "/timelines/users/by_nick/:userNick"
|
|
9
|
+
*/
|
|
10
|
+
static userTimeline(query, byNick = false) {
|
|
11
|
+
return this.timelines + this.user(query, byNick);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @param query The user id or nick
|
|
15
|
+
* @param byNick Whether to search by nick (Default: false)
|
|
16
|
+
* @example
|
|
17
|
+
* "/users"
|
|
18
|
+
* "/users/:userId"
|
|
19
|
+
* "/users/by_nick/:userNick"
|
|
20
|
+
*/
|
|
21
|
+
static user(query, byNick = false) {
|
|
22
|
+
let users = "/users";
|
|
23
|
+
if (!query)
|
|
24
|
+
return users;
|
|
25
|
+
return users + (byNick ? `/by_nick/${query}` : `/query`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @param user The user id or nick
|
|
29
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
30
|
+
* @example
|
|
31
|
+
* "/users/:userId/guests"
|
|
32
|
+
* "/users/by_nick/:userNick/guests"
|
|
33
|
+
*/
|
|
34
|
+
static guests(user, byNick = false) {
|
|
35
|
+
return this.user(user, byNick) + "/guests";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @param user The user id or nick
|
|
39
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
40
|
+
* @example
|
|
41
|
+
* "/users/:userId/blocked"
|
|
42
|
+
* "/users/by_nick/:userNick/blocked"
|
|
43
|
+
*/
|
|
44
|
+
static blocked(user, byNick = false) {
|
|
45
|
+
return this.user(user, byNick) + "/blocked";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @param user The user id or nick
|
|
49
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
50
|
+
* @example
|
|
51
|
+
* "/users/:userId/subscribers"
|
|
52
|
+
* "/users/by_nick/:userNick/subscribers"
|
|
53
|
+
*/
|
|
54
|
+
static subscribers(user, byNick = false) {
|
|
55
|
+
return this.user(user, byNick) + "/subscribers";
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @param user The user id or nick
|
|
59
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
60
|
+
* @example
|
|
61
|
+
* "/users/:userId/subscriptions"
|
|
62
|
+
*/
|
|
63
|
+
static subscriptions(user, byNick = false) {
|
|
64
|
+
return this.user(user, byNick) + "/subscriptions";
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @example
|
|
68
|
+
* "/content"
|
|
69
|
+
* "/content/:contentId"
|
|
70
|
+
*/
|
|
71
|
+
static content(id) {
|
|
72
|
+
return "/content" + (id ? `/${id}` : "");
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @param contentId The content id or array of content ids if adding to reads
|
|
76
|
+
* @example
|
|
77
|
+
* "/content/:contentId/smiles"
|
|
78
|
+
*/
|
|
79
|
+
static smiles(contentId) {
|
|
80
|
+
return this.content(contentId) + "/smiles";
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @param contentId The content id
|
|
84
|
+
* @example
|
|
85
|
+
* "/content/:contentId/republished"
|
|
86
|
+
*/
|
|
87
|
+
static republishes(id) {
|
|
88
|
+
return this.content(id) + "/republished";
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @example
|
|
92
|
+
* "/content/:contentId/comments"
|
|
93
|
+
*/
|
|
94
|
+
static comments(contentId) {
|
|
95
|
+
return this.content(contentId) + "/comments";
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @param contentId The content id
|
|
99
|
+
* @param commentId The comment id
|
|
100
|
+
* @example
|
|
101
|
+
* "/content/:contentId/comments/:commentId/replies"
|
|
102
|
+
*/
|
|
103
|
+
static replies(contentId, commentId) {
|
|
104
|
+
return this.comments(contentId) + `/${commentId}/replies`;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @param contentId The content id
|
|
108
|
+
* @example
|
|
109
|
+
* "/content/:contentId/comments/attached_content"
|
|
110
|
+
*/
|
|
111
|
+
static commentAttachment(contentId) {
|
|
112
|
+
return this.comments(contentId) + "/attached_content";
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @param contentId The content id or array of content ids if adding to reads
|
|
116
|
+
* @example
|
|
117
|
+
* "/reads"
|
|
118
|
+
* "/reads/:contentId"
|
|
119
|
+
* "/reads/:contentId1,contentId2..."
|
|
120
|
+
*/
|
|
121
|
+
static reads(contentId) {
|
|
122
|
+
if (Array.isArray(contentId)) {
|
|
123
|
+
contentId = contentId.join(",");
|
|
124
|
+
}
|
|
125
|
+
return "/reads" + (contentId ? `/${contentId}` : "");
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @param userId The id of the user the ban belongs to
|
|
129
|
+
* @param banId The id of the Ban
|
|
130
|
+
* @example
|
|
131
|
+
* "/users/:userId/bans"
|
|
132
|
+
* "/users/:userId/bans/:banId"
|
|
133
|
+
*/
|
|
134
|
+
static bans(userId, banId) {
|
|
135
|
+
return `/users/${userId}/bans` + (banId ? `/${banId}` : "");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.Endpoints = Endpoints;
|
|
139
|
+
Endpoints.base = "api.ifunny.mobi";
|
|
140
|
+
Endpoints.account = "/account";
|
|
141
|
+
Endpoints.collective = "/feeds/collective";
|
|
142
|
+
Endpoints.counters = "/counters";
|
|
143
|
+
Endpoints.featured = "/feeds/featured";
|
|
144
|
+
Endpoints.feeds = "/feeds";
|
|
145
|
+
Endpoints.oauth2 = "/oauth2";
|
|
146
|
+
Endpoints.projectElements = "/feeds/project_elements";
|
|
147
|
+
Endpoints.subscriptionFeed = "/timelines/home";
|
|
148
|
+
Endpoints.timelines = "/timelines";
|
|
149
|
+
Endpoints.token = "/oauth2/token";
|
|
150
|
+
Endpoints.myComments = "users/my/comments";
|
|
151
|
+
Endpoints.chatInvites = "users/my/chat_invitations";
|
|
152
|
+
Endpoints.mySmiles = "/users/my/content_smiles";
|
|
153
|
+
Endpoints.myAppeals = "users/my/appeals";
|
|
154
|
+
Endpoints.unreadChatMessages = "users/my/unread_chat_messages";
|
|
155
|
+
Endpoints.myNews = "news/my";
|
|
156
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/rest/endpoints.ts"],"names":[],"mappings":"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"}
|
package/dist/rest/index.js
CHANGED
|
@@ -19,4 +19,5 @@ __exportStar(require("./explore"), exports);
|
|
|
19
19
|
__exportStar(require("./issues"), exports);
|
|
20
20
|
__exportStar(require("./oauth2"), exports);
|
|
21
21
|
__exportStar(require("./content"), exports);
|
|
22
|
+
__exportStar(require("./endpoints"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/dist/rest/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,8CAA4B"}
|
package/dist/rest/oauth2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2.js","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"oauth2.js","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":";;;AAqBA,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AAChB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB"}
|
package/dist/utils/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./errors"), exports);
|
|
18
17
|
__exportStar(require("./rest"), exports);
|
|
19
18
|
__exportStar(require("./util"), exports);
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifunny/ifunny-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "iFunny API typings for use in bot library creaion.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "types",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build-js": "tsc",
|
|
9
9
|
"build": "npm run build-js",
|
|
10
|
-
"changelog": "auto-changelog -p && git add CHANGELOG.md && git commit -m \"
|
|
10
|
+
"changelog": "auto-changelog -p && git add CHANGELOG.md && git commit -m \"Update CHANGELOG.md\"",
|
|
11
11
|
"update": "npx npm-check-updates -u && npm install",
|
|
12
12
|
"test": "tsc --noEmit",
|
|
13
13
|
"link": "npm run build && npm link"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IFUNNY_ERRORS, RESTAPIError } from "./error_base";
|
|
2
|
+
export interface RESTAPIErrorBadRequest extends RESTAPIError {
|
|
3
|
+
error: IFUNNY_ERRORS.BAD_REQUEST;
|
|
4
|
+
error_description: RESTAPIBadRequestMessage;
|
|
5
|
+
status: 400;
|
|
6
|
+
}
|
|
7
|
+
export default RESTAPIErrorBadRequest;
|
|
8
|
+
export declare enum BAD_REQUEST {
|
|
9
|
+
INVALID_USER_ID = "Invalid user id"
|
|
10
|
+
}
|
|
11
|
+
declare type RESTAPIBadRequestMessage = `${BAD_REQUEST}`;
|
|
12
|
+
//# sourceMappingURL=bad_request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bad_request.d.ts","sourceRoot":"","sources":["../../src/errors/bad_request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC3D,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC;IACjC,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,MAAM,EAAE,GAAG,CAAC;CACZ;AAED,eAAe,sBAAsB,CAAC;AAEtC,oBAAY,WAAW;IACtB,eAAe,oBAAoB;CACnC;AAED,aAAK,wBAAwB,GAAG,GAAG,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IFUNNY_ERRORS, RESTAPIError } from "./error_base";
|
|
2
|
+
/**
|
|
3
|
+
* This is thrown when you need to solve a captcha to complete the request.
|
|
4
|
+
*/
|
|
5
|
+
export interface RESTAPIErrorCaptchaRequired extends RESTAPIError {
|
|
6
|
+
error: IFUNNY_ERRORS.CAPTCHA_REQUIRED;
|
|
7
|
+
error_description: RESTAPIErrorCaptchaRequiredMessage;
|
|
8
|
+
data: {
|
|
9
|
+
/**
|
|
10
|
+
* Open this url in any browser, solve it, then make the exact same request again.
|
|
11
|
+
*/
|
|
12
|
+
captcha_url: string;
|
|
13
|
+
type: RESTAPICaptchaType;
|
|
14
|
+
};
|
|
15
|
+
status: 403;
|
|
16
|
+
}
|
|
17
|
+
export default RESTAPIErrorCaptchaRequired;
|
|
18
|
+
/**
|
|
19
|
+
* Known error descriptions
|
|
20
|
+
*/
|
|
21
|
+
export declare enum CAPTCHA_REQUIRED {
|
|
22
|
+
VERIFY_HUMAN = "Human verification is required"
|
|
23
|
+
}
|
|
24
|
+
export declare type RESTAPIErrorCaptchaRequiredMessage = `${CAPTCHA_REQUIRED}`;
|
|
25
|
+
/**
|
|
26
|
+
* Known captcha types
|
|
27
|
+
*/
|
|
28
|
+
declare enum CAPTCHA_TYPE {
|
|
29
|
+
FUN_CAPTCHA = "fun_captcha",
|
|
30
|
+
RECAPTCHA = "recaptcha"
|
|
31
|
+
}
|
|
32
|
+
export declare type RESTAPICaptchaType = `${CAPTCHA_TYPE}`;
|
|
33
|
+
//# sourceMappingURL=captcha_required.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captcha_required.d.ts","sourceRoot":"","sources":["../../src/errors/captcha_required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,YAAY;IAChE,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC;IACtC,iBAAiB,EAAE,kCAAkC,CAAC;IACtD,IAAI,EAAE;QACL;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,kBAAkB,CAAC;KACzB,CAAC;IACF,MAAM,EAAE,GAAG,CAAC;CACZ;AAED,eAAe,2BAA2B,CAAC;AAE3C;;GAEG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,mCAAmC;CAC/C;AAED,oBAAY,kCAAkC,GAAG,GAAG,gBAAgB,EAAE,CAAC;AAEvE;;GAEG;AACH,aAAK,YAAY;IAChB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;CACvB;AAED,oBAAY,kBAAkB,GAAG,GAAG,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IFUNNY_ERRORS, RESTAPIError } from "./error_base";
|
|
2
|
+
/**
|
|
3
|
+
* Returned when trying to create an account with an email that's already taken
|
|
4
|
+
*/
|
|
5
|
+
export interface RESTAPIErrorEmailExists extends RESTAPIError {
|
|
6
|
+
error: IFUNNY_ERRORS.EMAIL_EXISTS;
|
|
7
|
+
error_description: RESTAPIErrorEmailExistsMessage;
|
|
8
|
+
status: 403;
|
|
9
|
+
}
|
|
10
|
+
export default RESTAPIErrorEmailExists;
|
|
11
|
+
export declare enum EMAIL_EXISTS_MESSAGE {
|
|
12
|
+
USER_WITH_EMAIL = "There is a user with this email"
|
|
13
|
+
}
|
|
14
|
+
export declare type RESTAPIErrorEmailExistsMessage = `${EMAIL_EXISTS_MESSAGE}`;
|
|
15
|
+
//# sourceMappingURL=email_exists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email_exists.d.ts","sourceRoot":"","sources":["../../src/errors/email_exists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC5D,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC;IAClC,iBAAiB,EAAE,8BAA8B,CAAC;IAClD,MAAM,EAAE,GAAG,CAAC;CACZ;AACD,eAAe,uBAAuB,CAAC;AAEvC,oBAAY,oBAAoB;IAC/B,eAAe,oCAAoC;CACnD;AAED,oBAAY,8BAA8B,GAAG,GAAG,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RESTAPIError } from "./error_base";
|
|
2
|
+
import { RESTAPIErrorBadRequest } from "./bad_request";
|
|
3
|
+
import { RESTAPIErrorCaptchaRequired } from "./captcha_required";
|
|
4
|
+
import { RESTAPIErrorEmailExists } from "./email_exists";
|
|
5
|
+
import { RESTAPIErrorInvalidEmail } from "./invalid_email";
|
|
6
|
+
/**
|
|
7
|
+
* Returns when the request throws an error.\
|
|
8
|
+
* Automatically evaluates the error based on other values
|
|
9
|
+
* @example
|
|
10
|
+
* function foo(error: RESTAPIErrorResponse) {
|
|
11
|
+
* switch(error.status) {
|
|
12
|
+
* case 400:
|
|
13
|
+
* error.error !== 'captcha_required' // true
|
|
14
|
+
* case 403:
|
|
15
|
+
* error.error !== 'bad_request' // true
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
export declare type RESTAPIErrorResponse = RESTAPIErrorBadRequest | RESTAPIErrorCaptchaRequired | RESTAPIErrorEmailExists | RESTAPIErrorInvalidEmail;
|
|
20
|
+
/**
|
|
21
|
+
* Use this if you don't know the error being thrown or don't want full intellisense support
|
|
22
|
+
*/
|
|
23
|
+
export declare type RESTAPIUnknownError = RESTAPIError;
|
|
24
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/errors/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,oBAAY,oBAAoB,GAC7B,sBAAsB,GACtB,2BAA2B,GAC3B,uBAAuB,GACvB,wBAAwB,CAAC;AAE5B;;GAEG;AACH,oBAAY,mBAAmB,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when the response is not in the 200 range
|
|
3
|
+
*/
|
|
4
|
+
export interface RESTAPIError {
|
|
5
|
+
/**
|
|
6
|
+
* The error returned by the API
|
|
7
|
+
*/
|
|
8
|
+
error: RESTAPIiFunnyError;
|
|
9
|
+
/**
|
|
10
|
+
* Brief description of the error
|
|
11
|
+
*/
|
|
12
|
+
error_description: string;
|
|
13
|
+
/**
|
|
14
|
+
* Status code of the error
|
|
15
|
+
*/
|
|
16
|
+
status: 400 | 401 | 403 | 404 | 500;
|
|
17
|
+
}
|
|
18
|
+
export default RESTAPIError;
|
|
19
|
+
/**
|
|
20
|
+
* Possible iFunny Errors
|
|
21
|
+
*/
|
|
22
|
+
export declare type RESTAPIiFunnyError = `${IFUNNY_ERRORS}`;
|
|
23
|
+
/**
|
|
24
|
+
* All known error types
|
|
25
|
+
*/
|
|
26
|
+
export declare enum IFUNNY_ERRORS {
|
|
27
|
+
ALREADY_REPUBLISHED = "already_republished",
|
|
28
|
+
ALREADY_SMILED = "already_smiled",
|
|
29
|
+
ALREADY_UNSMILED = "already_unsmiled",
|
|
30
|
+
BAD_REQUEST = "bad_request",
|
|
31
|
+
CAPTCHA_REQUIRED = "captcha_required",
|
|
32
|
+
CONTENT_WAS_DELETED = "content_was_deleted",
|
|
33
|
+
EMAIL_EXISTS = "email_exists",
|
|
34
|
+
EMAIL_NOT_CONFIRMED = "email_not_confirmed",
|
|
35
|
+
ENTITY_ABUSED = "entity_abused",
|
|
36
|
+
FORBIDDEN_FOR_BANNED = "forbidden_for_banned",
|
|
37
|
+
FORBIDDEN_FOR_DELETED = "forbidden_for_deactivated",
|
|
38
|
+
INVALID_CLIENT = "invalid_client",
|
|
39
|
+
INVALID_EMAIL = "invalid_email",
|
|
40
|
+
INVALID_GRANT = "invalid_grant",
|
|
41
|
+
NOT_REPUBLISHED = "not_republished",
|
|
42
|
+
NOT_SMILED = "not_smiled",
|
|
43
|
+
NOT_UNSMILED = "not_unsmiled",
|
|
44
|
+
PINNED_LIMIT_EXCEEDED = "profile_pins_to_many_pins_error",
|
|
45
|
+
PUBLISHING_TIMEOUT = "publishing_timeout",
|
|
46
|
+
QUERY_TOO_SHORT = "query_too_short",
|
|
47
|
+
ROOT_COMMENT_WAS_DELETED = "root_comment_was_deleted",
|
|
48
|
+
SOURCE_IS_UNAVAILABLE = "source_is_unavailable",
|
|
49
|
+
STOP_WORD = "content_tag_stopword",
|
|
50
|
+
TOO_MANY_UPPERCASE = "too_many_uppercase",
|
|
51
|
+
UNACCEPTABLE_SYMBOLS = "unacceptable_symbols",
|
|
52
|
+
UNAUTHORIZED = "unauthorized",
|
|
53
|
+
UNKNOWN_ERROR = "unknown_error",
|
|
54
|
+
UNKNOWN_SOURCE = "unknown_source",
|
|
55
|
+
VIDEO_IS_INVALID = "video_is_invalid",
|
|
56
|
+
YOU_ARE_BLOCKED = "you_are_blocked"
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=error_base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error_base.d.ts","sourceRoot":"","sources":["../../src/errors/error_base.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,KAAK,EAAE,kBAAkB,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CACpC;AACD,eAAe,YAAY,CAAC;AAE5B;;GAEG;AACH,oBAAY,kBAAkB,GAAG,GAAG,aAAa,EAAE,CAAC;AAEpD;;GAEG;AACH,oBAAY,aAAa;IACxB,mBAAmB,wBAAwB;IAC3C,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,YAAY,iBAAiB;IAC7B,mBAAmB,wBAAwB;IAC3C,aAAa,kBAAkB;IAC/B,oBAAoB,yBAAyB;IAC7C,qBAAqB,8BAA8B;IACnD,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,qBAAqB,oCAAoC;IACzD,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,wBAAwB,6BAA6B;IACrD,qBAAqB,0BAA0B;IAC/C,SAAS,yBAAyB;IAClC,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IFUNNY_ERRORS, RESTAPIError } from "./error_base";
|
|
2
|
+
/**
|
|
3
|
+
* Returned when an email is invalid
|
|
4
|
+
*/
|
|
5
|
+
export interface RESTAPIErrorInvalidEmail extends RESTAPIError {
|
|
6
|
+
error: IFUNNY_ERRORS.INVALID_EMAIL;
|
|
7
|
+
error_description: RESTAPIInvalidEmailMessage;
|
|
8
|
+
status: 403;
|
|
9
|
+
}
|
|
10
|
+
export default RESTAPIErrorInvalidEmail;
|
|
11
|
+
export declare enum INVALID_EMAIL_MESSAGE {
|
|
12
|
+
DISPOSABLE = "Domain of email was found in disposable domains list"
|
|
13
|
+
}
|
|
14
|
+
declare type RESTAPIInvalidEmailMessage = `${INVALID_EMAIL_MESSAGE}`;
|
|
15
|
+
//# sourceMappingURL=invalid_email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid_email.d.ts","sourceRoot":"","sources":["../../src/errors/invalid_email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC7D,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC;IACnC,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,MAAM,EAAE,GAAG,CAAC;CACZ;AAED,eAAe,wBAAwB,CAAC;AAExC,oBAAY,qBAAqB;IAChC,UAAU,yDAAyD;CACnE;AAED,aAAK,0BAA0B,GAAG,GAAG,qBAAqB,EAAE,CAAC"}
|
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
package/types/rest/content.d.ts
CHANGED
|
@@ -48,9 +48,15 @@ export declare enum REPORT_TYPE {
|
|
|
48
48
|
BANNER = "banner"
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Possible report reasons
|
|
52
|
+
*/
|
|
53
|
+
export declare type APIReportReason = `${REPORT_TYPE}`;
|
|
54
|
+
/**
|
|
55
|
+
* Where an action was completed
|
|
56
|
+
* @example
|
|
57
|
+
* PUT /v4/reads/:contentId?from=:ACTION_LOCATION
|
|
52
58
|
*/
|
|
53
|
-
export declare enum
|
|
59
|
+
export declare enum ACTION_LOCATION {
|
|
54
60
|
CHANNEL = "channel",
|
|
55
61
|
COLLECTIVE = "coll",
|
|
56
62
|
FEATURES = "feat",
|
|
@@ -60,4 +66,8 @@ export declare enum VIEWED_FROM {
|
|
|
60
66
|
SUBS = "subs",
|
|
61
67
|
TAG = "tag"
|
|
62
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Possible `from` locations
|
|
71
|
+
*/
|
|
72
|
+
export declare type APIActionLocation = `${ACTION_LOCATION}`;
|
|
63
73
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/rest/content.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACtB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,cAAc,WAAW;IACzB;;OAEG;IACH,OAAO,SAAS;IAChB;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,UAAU,eAAe;IACzB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;CACjB;AAED;;GAEG;AACH,oBAAY,WAAW;
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/rest/content.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACtB;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,cAAc,WAAW;IACzB;;OAEG;IACH,OAAO,SAAS;IAChB;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,UAAU,eAAe;IACzB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;CACjB;AAED;;GAEG;AACH,oBAAY,eAAe,GAAG,GAAG,WAAW,EAAE,CAAC;AAE/C;;;;GAIG;AACH,oBAAY,eAAe;IAC1B,OAAO,YAAY;IACnB,UAAU,SAAS;IACnB,QAAQ,SAAS;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,OAAO,SAAS;IAChB,IAAI,SAAS;IACb,GAAG,QAAQ;CACX;AAED;;GAEG;AACH,oBAAY,iBAAiB,GAAG,GAAG,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export declare class Endpoints {
|
|
2
|
+
static readonly base = "api.ifunny.mobi";
|
|
3
|
+
static readonly account = "/account";
|
|
4
|
+
static readonly collective = "/feeds/collective";
|
|
5
|
+
static readonly counters = "/counters";
|
|
6
|
+
static readonly featured = "/feeds/featured";
|
|
7
|
+
static readonly feeds = "/feeds";
|
|
8
|
+
static readonly oauth2 = "/oauth2";
|
|
9
|
+
static readonly projectElements = "/feeds/project_elements";
|
|
10
|
+
static readonly subscriptionFeed = "/timelines/home";
|
|
11
|
+
static readonly timelines = "/timelines";
|
|
12
|
+
static readonly token = "/oauth2/token";
|
|
13
|
+
static readonly myComments = "users/my/comments";
|
|
14
|
+
static readonly chatInvites = "users/my/chat_invitations";
|
|
15
|
+
static readonly mySmiles = "/users/my/content_smiles";
|
|
16
|
+
static readonly myAppeals = "users/my/appeals";
|
|
17
|
+
static readonly unreadChatMessages = "users/my/unread_chat_messages";
|
|
18
|
+
static readonly myNews = "news/my";
|
|
19
|
+
/**
|
|
20
|
+
* @example
|
|
21
|
+
* "/timelines/users/:userId"
|
|
22
|
+
* "/timelines/users/by_nick/:userNick"
|
|
23
|
+
*/
|
|
24
|
+
static userTimeline(query: string, byNick?: boolean): string;
|
|
25
|
+
/**
|
|
26
|
+
* @param query The user id or nick
|
|
27
|
+
* @param byNick Whether to search by nick (Default: false)
|
|
28
|
+
* @example
|
|
29
|
+
* "/users"
|
|
30
|
+
* "/users/:userId"
|
|
31
|
+
* "/users/by_nick/:userNick"
|
|
32
|
+
*/
|
|
33
|
+
static user(query?: string, byNick?: boolean): string;
|
|
34
|
+
/**
|
|
35
|
+
* @param user The user id or nick
|
|
36
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
37
|
+
* @example
|
|
38
|
+
* "/users/:userId/guests"
|
|
39
|
+
* "/users/by_nick/:userNick/guests"
|
|
40
|
+
*/
|
|
41
|
+
static guests(user: string, byNick?: boolean): string;
|
|
42
|
+
/**
|
|
43
|
+
* @param user The user id or nick
|
|
44
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
45
|
+
* @example
|
|
46
|
+
* "/users/:userId/blocked"
|
|
47
|
+
* "/users/by_nick/:userNick/blocked"
|
|
48
|
+
*/
|
|
49
|
+
static blocked(user: string, byNick?: boolean): string;
|
|
50
|
+
/**
|
|
51
|
+
* @param user The user id or nick
|
|
52
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
53
|
+
* @example
|
|
54
|
+
* "/users/:userId/subscribers"
|
|
55
|
+
* "/users/by_nick/:userNick/subscribers"
|
|
56
|
+
*/
|
|
57
|
+
static subscribers(user: string, byNick?: boolean): string;
|
|
58
|
+
/**
|
|
59
|
+
* @param user The user id or nick
|
|
60
|
+
* @param byNick Whether the user is by nick (Default: false)
|
|
61
|
+
* @example
|
|
62
|
+
* "/users/:userId/subscriptions"
|
|
63
|
+
*/
|
|
64
|
+
static subscriptions(user: string, byNick?: boolean): string;
|
|
65
|
+
/**
|
|
66
|
+
* @example
|
|
67
|
+
* "/content"
|
|
68
|
+
* "/content/:contentId"
|
|
69
|
+
*/
|
|
70
|
+
static content(id?: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* @param contentId The content id or array of content ids if adding to reads
|
|
73
|
+
* @example
|
|
74
|
+
* "/content/:contentId/smiles"
|
|
75
|
+
*/
|
|
76
|
+
static smiles(contentId: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* @param contentId The content id
|
|
79
|
+
* @example
|
|
80
|
+
* "/content/:contentId/republished"
|
|
81
|
+
*/
|
|
82
|
+
static republishes(id: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* @example
|
|
85
|
+
* "/content/:contentId/comments"
|
|
86
|
+
*/
|
|
87
|
+
static comments(contentId: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* @param contentId The content id
|
|
90
|
+
* @param commentId The comment id
|
|
91
|
+
* @example
|
|
92
|
+
* "/content/:contentId/comments/:commentId/replies"
|
|
93
|
+
*/
|
|
94
|
+
static replies(contentId: string, commentId: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* @param contentId The content id
|
|
97
|
+
* @example
|
|
98
|
+
* "/content/:contentId/comments/attached_content"
|
|
99
|
+
*/
|
|
100
|
+
static commentAttachment(contentId: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* @param contentId The content id or array of content ids if adding to reads
|
|
103
|
+
* @example
|
|
104
|
+
* "/reads"
|
|
105
|
+
* "/reads/:contentId"
|
|
106
|
+
* "/reads/:contentId1,contentId2..."
|
|
107
|
+
*/
|
|
108
|
+
static reads(contentId?: string | string[]): string;
|
|
109
|
+
/**
|
|
110
|
+
* @param userId The id of the user the ban belongs to
|
|
111
|
+
* @param banId The id of the Ban
|
|
112
|
+
* @example
|
|
113
|
+
* "/users/:userId/bans"
|
|
114
|
+
* "/users/:userId/bans/:banId"
|
|
115
|
+
*/
|
|
116
|
+
static bans(userId: string, banId?: string): string;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/rest/endpoints.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,qBAAqB;IACzC,MAAM,CAAC,QAAQ,CAAC,OAAO,cAAc;IACrC,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAuB;IACjD,MAAM,CAAC,QAAQ,CAAC,QAAQ,eAAe;IACvC,MAAM,CAAC,QAAQ,CAAC,QAAQ,qBAAqB;IAC7C,MAAM,CAAC,QAAQ,CAAC,KAAK,YAAY;IACjC,MAAM,CAAC,QAAQ,CAAC,MAAM,aAAa;IACnC,MAAM,CAAC,QAAQ,CAAC,eAAe,6BAA6B;IAC5D,MAAM,CAAC,QAAQ,CAAC,gBAAgB,qBAAqB;IACrD,MAAM,CAAC,QAAQ,CAAC,SAAS,gBAAgB;IACzC,MAAM,CAAC,QAAQ,CAAC,KAAK,mBAAmB;IAExC,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAuB;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,+BAA+B;IAC1D,MAAM,CAAC,QAAQ,CAAC,QAAQ,8BAA8B;IACtD,MAAM,CAAC,QAAQ,CAAC,SAAS,sBAAsB;IAC/C,MAAM,CAAC,QAAQ,CAAC,kBAAkB,mCAAmC;IACrE,MAAM,CAAC,QAAQ,CAAC,MAAM,aAAa;IAEnC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM;IAInE;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM;IAM5D;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM;IAI5D;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM;IAI7D;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM;IAIjE;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM;IAInE;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAInC;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIxC;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAItC;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI1C;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAI5D;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAInD;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAOnD;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAG1C"}
|
package/types/rest/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
package/types/rest/oauth2.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RESTAPIErrorResponse } from "../
|
|
1
|
+
import { RESTAPIErrorResponse } from "../errors/error";
|
|
2
2
|
export declare type RESTAPIOauth2Login = RESTAPIOauth2LoginSuccess | RESTAPIOauth2LoginError;
|
|
3
3
|
export interface RESTAPIOauth2LoginSuccess {
|
|
4
4
|
/**
|
|
@@ -10,7 +10,9 @@ export interface RESTAPIOauth2LoginSuccess {
|
|
|
10
10
|
*/
|
|
11
11
|
token_type: TOKEN_TYPES.BEARER;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* How long until the token expires\
|
|
14
|
+
* Equivilent to `10 years`\
|
|
15
|
+
* ? In seconds
|
|
14
16
|
*/
|
|
15
17
|
expires_in: 315360000;
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,oBAAY,kBAAkB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;AAErF,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC;IAC/B
|
|
1
|
+
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,oBAAY,kBAAkB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;AAErF,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC;IAC/B;;;;OAIG;IACH,UAAU,EAAE,SAAS,CAAC;CACtB;AAED,oBAAY,WAAW;IACtB,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AAED,oBAAY,YAAY,GAAG,GAAG,WAAW,EAAE,CAAC;AAE5C,oBAAY,uBAAuB,GAAG,oBAAoB,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,IAAI,EAAE;QACL;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;KACX,CAAC;IACF,MAAM,EAAE,GAAG,CAAC;CACZ"}
|
package/types/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|