rettiwt-api 2.2.0 → 2.2.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/LICENSE +21 -0
- package/dist/models/CursoredData.js +2 -2
- package/dist/models/CursoredData.js.map +1 -1
- package/dist/services/UserService.js +1 -1
- package/dist/services/UserService.js.map +1 -1
- package/package.json +3 -3
- package/src/models/CursoredData.ts +2 -2
- package/src/services/UserService.ts +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Rishikant Sahu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -25,11 +25,11 @@ var CursoredData = /** @class */ (function () {
|
|
|
25
25
|
for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
|
|
26
26
|
var item = list_1[_i];
|
|
27
27
|
// If the item is a valid raw tweet
|
|
28
|
-
if (item.__typename == 'Tweet' && item.rest_id) {
|
|
28
|
+
if (item && item.__typename == 'Tweet' && item.rest_id) {
|
|
29
29
|
this.list.push(new Tweet_1.Tweet(item));
|
|
30
30
|
}
|
|
31
31
|
// If the item is a valid raw user
|
|
32
|
-
else if (item.__typename == 'User' && item.rest_id && item.id) {
|
|
32
|
+
else if (item && item.__typename == 'User' && item.rest_id && item.id) {
|
|
33
33
|
this.list.push(new User_1.User(item));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../src/models/CursoredData.ts"],"names":[],"mappings":";;;AAGA,SAAS;AACT,iCAAgC;AAChC,+BAA8B;AAK9B;;;;;;GAMG;AACH;IAOC;;;OAGG;IACH,sBAAY,IAAmC,EAAE,IAAiB;QAAtD,qBAAA,EAAA,SAAmC;QAAE,qBAAA,EAAA,SAAiB;QAVlE,0CAA0C;QAC1C,SAAI,GAAQ,EAAE,CAAC;QAUd,8DAA8D;QAC9D,KAAmB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;YAApB,IAAM,IAAI,aAAA;YACd,mCAAmC;YACnC,IAAI,IAAI,CAAC,UAAU,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../src/models/CursoredData.ts"],"names":[],"mappings":";;;AAGA,SAAS;AACT,iCAAgC;AAChC,+BAA8B;AAK9B;;;;;;GAMG;AACH;IAOC;;;OAGG;IACH,sBAAY,IAAmC,EAAE,IAAiB;QAAtD,qBAAA,EAAA,SAAmC;QAAE,qBAAA,EAAA,SAAiB;QAVlE,0CAA0C;QAC1C,SAAI,GAAQ,EAAE,CAAC;QAUd,8DAA8D;QAC9D,KAAmB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;YAApB,IAAM,IAAI,aAAA;YACd,mCAAmC;YACnC,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE;gBACvD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,aAAK,CAAC,IAAiB,CAAM,CAAC,CAAC;aAClD;YACD,kCAAkC;iBAC7B,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,IAAI,IAAI,CAAC,OAAO,IAAK,IAAiB,CAAC,EAAE,EAAE;gBACpF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAI,CAAC,IAAgB,CAAM,CAAC,CAAC;aAChD;SACD;QAED,uBAAuB;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACF,mBAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,oCAAY;AA6BzB;;;;GAIG;AACH;IAIC;;;;OAIG;IACH,gBAAY,SAAiB;QAC5B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACxB,CAAC;IACF,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM"}
|
|
@@ -86,7 +86,7 @@ var UserService = /** @class */ (function (_super) {
|
|
|
86
86
|
return __generator(this, function (_a) {
|
|
87
87
|
switch (_a.label) {
|
|
88
88
|
case 0:
|
|
89
|
-
if (!isNaN(
|
|
89
|
+
if (!isNaN(Number(id))) return [3 /*break*/, 2];
|
|
90
90
|
return [4 /*yield*/, this.fetch(rettiwt_core_1.EResourceType.USER_DETAILS, { id: id })];
|
|
91
91
|
case 1:
|
|
92
92
|
// Fetching the requested data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../src/services/UserService.ts"],"names":[],"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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rettiwt-api",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"description": "An API for fetching data from TwitterAPI, without any rate limits!",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"homepage": "https://rishikant181.github.io/Rettiwt-API/",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"axios": "1.3.2",
|
|
30
|
-
"https-proxy-agent": "
|
|
30
|
+
"https-proxy-agent": "7.0.2",
|
|
31
31
|
"rettiwt-auth": "1.2.0",
|
|
32
|
-
"rettiwt-core": "3.2.0
|
|
32
|
+
"rettiwt-core": "3.2.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "20.4.1",
|
|
@@ -30,11 +30,11 @@ export class CursoredData<T extends Tweet | User> implements ICursoredData<T> {
|
|
|
30
30
|
// Deserializing the input raw data and storing it in the list
|
|
31
31
|
for (const item of list) {
|
|
32
32
|
// If the item is a valid raw tweet
|
|
33
|
-
if (item.__typename == 'Tweet' && item.rest_id) {
|
|
33
|
+
if (item && item.__typename == 'Tweet' && item.rest_id) {
|
|
34
34
|
this.list.push(new Tweet(item as IRawTweet) as T);
|
|
35
35
|
}
|
|
36
36
|
// If the item is a valid raw user
|
|
37
|
-
else if (item.__typename == 'User' && item.rest_id && (item as IRawUser).id) {
|
|
37
|
+
else if (item && item.__typename == 'User' && item.rest_id && (item as IRawUser).id) {
|
|
38
38
|
this.list.push(new User(item as IRawUser) as T);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -39,7 +39,7 @@ export class UserService extends FetcherService {
|
|
|
39
39
|
let data: CursoredData<User>;
|
|
40
40
|
|
|
41
41
|
// If username is given
|
|
42
|
-
if (isNaN(
|
|
42
|
+
if (isNaN(Number(id))) {
|
|
43
43
|
// Fetching the requested data
|
|
44
44
|
data = await this.fetch<User>(EResourceType.USER_DETAILS, { id: id });
|
|
45
45
|
}
|