@ifunny/ifunny-api-types 0.3.0 → 0.3.1
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 +13 -0
- package/dist/rest/index.js +1 -0
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/oauth2.js +9 -0
- package/dist/rest/oauth2.js.map +1 -0
- package/dist/utils/rest.js +4 -0
- package/dist/utils/rest.js.map +1 -1
- package/package.json +3 -3
- package/types/rest/index.d.ts +1 -0
- package/types/rest/index.d.ts.map +1 -1
- package/types/rest/oauth2.d.ts +18 -0
- package/types/rest/oauth2.d.ts.map +1 -0
- package/types/utils/rest.d.ts +19 -0
- package/types/utils/rest.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
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.3.0](https://github.com/ifunny-co/ifunny-api-types/compare/v0.3.0...v0.3.0) - 2022-07-28
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Fixes
|
|
9
|
+
|
|
10
|
+
* Updated scripts @MakeShiftArtist ([`e6573e8`](https://github.com/ifunny-co/ifunny-api-types/commit/e6573e84cea7fa1c27ac5bed63fba04727583474))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
* Updated Changelog @MakeShiftArtist ([`c8f151e`](https://github.com/ifunny-co/ifunny-api-types/commit/c8f151e1cd66f3c99413c4b738ebd1ab72fe114f))
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
## [v0.3.0](https://github.com/ifunny-co/ifunny-api-types/compare/v0.2.1...v0.3.0) - 2022-07-28
|
|
6
19
|
|
|
7
20
|
### Features
|
package/dist/rest/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./explore"), exports);
|
|
18
18
|
__exportStar(require("./issues"), exports);
|
|
19
19
|
__exportStar(require("./account"), exports);
|
|
20
|
+
__exportStar(require("./oauth2"), exports);
|
|
20
21
|
//# 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,2CAAyB;AACzB,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenTypes = void 0;
|
|
4
|
+
var TokenTypes;
|
|
5
|
+
(function (TokenTypes) {
|
|
6
|
+
TokenTypes["Bearer"] = "bearer";
|
|
7
|
+
TokenTypes["Basic"] = "basic";
|
|
8
|
+
})(TokenTypes = exports.TokenTypes || (exports.TokenTypes = {}));
|
|
9
|
+
//# sourceMappingURL=oauth2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth2.js","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":";;;AAiBA,IAAY,UAGX;AAHD,WAAY,UAAU;IACrB,+BAAiB,CAAA;IACjB,6BAAe,CAAA;AAChB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"}
|
package/dist/utils/rest.js
CHANGED
package/dist/utils/rest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest.js","sourceRoot":"","sources":["../../src/utils/rest.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"rest.js","sourceRoot":"","sources":["../../src/utils/rest.ts"],"names":[],"mappings":";;AAUA,IAAK,YAEJ;AAFD,WAAK,YAAY;IAChB,2CAA2B,CAAA;AAC5B,CAAC,EAFI,YAAY,KAAZ,YAAY,QAEhB"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifunny/ifunny-api-types",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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
|
-
"build": "npm run build-js
|
|
10
|
-
"changelog": "auto-changelog -p && git add CHANGELOG.md",
|
|
9
|
+
"build": "npm run build-js",
|
|
10
|
+
"changelog": "auto-changelog -p && git add CHANGELOG.md && git commit -m \"Doc: Update CHANGELOG.md\"",
|
|
11
11
|
"test": "tsc --noEmit",
|
|
12
12
|
"link": "npm run build && npm link"
|
|
13
13
|
},
|
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,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,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RESTAPIErrorResponse, RESTAPICaptchaError, RESTAPIExpiredBearerError } from "../utils/rest";
|
|
2
|
+
export declare type RESTAPIOauth2Login = RESTAPIOauth2LoginSuccess | RESTAPIOauth2LoginError | RESTAPICaptchaError;
|
|
3
|
+
export interface RESTAPIOauth2LoginSuccess {
|
|
4
|
+
access_token: string;
|
|
5
|
+
token_type: `bearer`;
|
|
6
|
+
expires_in: 315360000;
|
|
7
|
+
}
|
|
8
|
+
export declare enum TokenTypes {
|
|
9
|
+
Bearer = "bearer",
|
|
10
|
+
Basic = "basic"
|
|
11
|
+
}
|
|
12
|
+
export interface RESTAPIOauth2LoginInvalidCreds extends RESTAPIErrorResponse {
|
|
13
|
+
error: "invalid_grant";
|
|
14
|
+
error_description: "Wrong user credentials";
|
|
15
|
+
status: 400;
|
|
16
|
+
}
|
|
17
|
+
export declare type RESTAPIOauth2LoginError = RESTAPIOauth2LoginInvalidCreds | RESTAPICaptchaError | RESTAPIExpiredBearerError;
|
|
18
|
+
//# sourceMappingURL=oauth2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth2.d.ts","sourceRoot":"","sources":["../../src/rest/oauth2.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,MAAM,eAAe,CAAC;AAEvB,oBAAY,kBAAkB,GAC3B,yBAAyB,GACzB,uBAAuB,GACvB,mBAAmB,CAAC;AAEvB,MAAM,WAAW,yBAAyB;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,SAAS,CAAC;CACtB;AAED,oBAAY,UAAU;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AAED,MAAM,WAAW,8BAA+B,SAAQ,oBAAoB;IAC3E,KAAK,EAAE,eAAe,CAAC;IACvB,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,MAAM,EAAE,GAAG,CAAC;CACZ;AAED,oBAAY,uBAAuB,GAChC,8BAA8B,GAC9B,mBAAmB,GACnB,yBAAyB,CAAC"}
|
package/types/utils/rest.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
export interface RESTAPICaptchaError extends RESTAPIErrorResponse {
|
|
2
|
+
error: "captcha_required";
|
|
3
|
+
error_description: "Human verification is required";
|
|
4
|
+
data: {
|
|
5
|
+
captcha_url: string;
|
|
6
|
+
type: CaptchaType;
|
|
7
|
+
};
|
|
8
|
+
status: 403;
|
|
9
|
+
}
|
|
10
|
+
declare enum CaptchaTypes {
|
|
11
|
+
FUN_CAPTCHA = "fun_captcha"
|
|
12
|
+
}
|
|
13
|
+
declare type CaptchaType = `${CaptchaTypes}`;
|
|
14
|
+
export interface RESTAPIExpiredBearerError extends RESTAPIErrorResponse {
|
|
15
|
+
status: 401;
|
|
16
|
+
error: "invalid_grant";
|
|
17
|
+
error_description: "token is expired";
|
|
18
|
+
}
|
|
1
19
|
/**
|
|
2
20
|
* Returns when the request throws an error.
|
|
3
21
|
*/
|
|
@@ -62,4 +80,5 @@ export interface RESTAPICursors {
|
|
|
62
80
|
*/
|
|
63
81
|
prev?: string;
|
|
64
82
|
}
|
|
83
|
+
export {};
|
|
65
84
|
//# sourceMappingURL=rest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../../src/utils/rest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,OAAO;IACxD;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IACR;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,SAAS,OAAO;IACjD;;OAEG;IACH,KAAK,EAAE,IAAI,EAAE,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,aAAa,CA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