twitter-openapi-typescript 0.0.56 → 0.0.57
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 +31 -31
- package/LICENSE.AGPL +660 -660
- package/README.md +75 -75
- package/dist/src/api.d.ts +3 -3
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/api.js +161 -295
- package/dist/src/api.js.map +1 -1
- package/dist/src/apis/defaultApi.d.ts +2 -2
- package/dist/src/apis/defaultApi.d.ts.map +1 -1
- package/dist/src/apis/defaultApi.js +39 -114
- package/dist/src/apis/defaultApi.js.map +1 -1
- package/dist/src/apis/initialStateApi.js +2 -5
- package/dist/src/apis/initialStateApi.js.map +1 -1
- package/dist/src/apis/postApi.d.ts +2 -2
- package/dist/src/apis/postApi.d.ts.map +1 -1
- package/dist/src/apis/postApi.js +140 -251
- package/dist/src/apis/postApi.js.map +1 -1
- package/dist/src/apis/tweetApi.d.ts +6 -3
- package/dist/src/apis/tweetApi.d.ts.map +1 -1
- package/dist/src/apis/tweetApi.js +237 -342
- package/dist/src/apis/tweetApi.js.map +1 -1
- package/dist/src/apis/userApi.d.ts +3 -3
- package/dist/src/apis/userApi.d.ts.map +1 -1
- package/dist/src/apis/userApi.js +43 -108
- package/dist/src/apis/userApi.js.map +1 -1
- package/dist/src/apis/userListApi.d.ts +3 -3
- package/dist/src/apis/userListApi.d.ts.map +1 -1
- package/dist/src/apis/userListApi.js +97 -183
- package/dist/src/apis/userListApi.js.map +1 -1
- package/dist/src/apis/usersApi.d.ts +3 -3
- package/dist/src/apis/usersApi.d.ts.map +1 -1
- package/dist/src/apis/usersApi.js +28 -91
- package/dist/src/apis/usersApi.js.map +1 -1
- package/dist/src/apis/v11GetApi.d.ts +3 -3
- package/dist/src/apis/v11GetApi.d.ts.map +1 -1
- package/dist/src/apis/v11GetApi.js +3 -4
- package/dist/src/apis/v11GetApi.js.map +1 -1
- package/dist/src/apis/v11PostApi.d.ts +3 -3
- package/dist/src/apis/v11PostApi.d.ts.map +1 -1
- package/dist/src/apis/v11PostApi.js +50 -84
- package/dist/src/apis/v11PostApi.js.map +1 -1
- package/dist/src/apis/v20GetApi.d.ts +3 -3
- package/dist/src/apis/v20GetApi.d.ts.map +1 -1
- package/dist/src/apis/v20GetApi.js +3 -4
- package/dist/src/apis/v20GetApi.js.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.js +4 -4
- package/dist/src/models/response.d.ts +1 -1
- package/dist/src/models/response.d.ts.map +1 -1
- package/dist/src/models/timeline.d.ts +1 -1
- package/dist/src/models/timeline.d.ts.map +1 -1
- package/dist/src/models/utils.d.ts +2 -2
- package/dist/src/models/utils.d.ts.map +1 -1
- package/dist/src/utils/api.d.ts +1 -1
- package/dist/src/utils/api.d.ts.map +1 -1
- package/dist/src/utils/api.js +68 -85
- package/dist/src/utils/api.js.map +1 -1
- package/package.json +37 -42
|
@@ -1,364 +1,259 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
66
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
67
|
-
if (ar || !(i in from)) {
|
|
68
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
69
|
-
ar[i] = from[i];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
73
|
-
};
|
|
74
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
3
|
exports.TweetApiUtils = void 0;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
4
|
+
const utils_1 = require("../utils/index.js");
|
|
5
|
+
class TweetApiUtils {
|
|
6
|
+
constructor(api, flag, initOverrides) {
|
|
79
7
|
this.api = api;
|
|
80
8
|
this.flag = flag;
|
|
81
9
|
this.initOverrides = initOverrides;
|
|
82
10
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
11
|
+
async request(param) {
|
|
12
|
+
const apiFn = param.apiFn.bind(this.api);
|
|
13
|
+
const args = (0, utils_1.getKwargs)(this.flag[param.key], param.param);
|
|
14
|
+
const response = await apiFn(args, this.initOverrides(this.flag[param.key]));
|
|
15
|
+
const instruction = param.convertFn(await response.value());
|
|
16
|
+
const entry = (0, utils_1.instructionToEntry)(instruction);
|
|
17
|
+
const data = [...(0, utils_1.tweetEntriesConverter)(entry), ...(0, utils_1.instructionConverter)(instruction)];
|
|
18
|
+
return {
|
|
19
|
+
raw: {
|
|
20
|
+
response: response.raw,
|
|
21
|
+
},
|
|
22
|
+
header: (0, utils_1.buildHeader)(response.raw.headers),
|
|
23
|
+
data: {
|
|
24
|
+
raw: {
|
|
25
|
+
instruction,
|
|
26
|
+
entry,
|
|
27
|
+
},
|
|
28
|
+
cursor: (0, utils_1.entriesCursor)(entry),
|
|
29
|
+
data: data,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async getTweetDetail(param) {
|
|
34
|
+
const args = {
|
|
35
|
+
focalTweetId: param.focalTweetId,
|
|
36
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
37
|
+
...(param.controllerData == undefined ? {} : { controller_data: param.controllerData }),
|
|
38
|
+
...param.extraParam,
|
|
39
|
+
};
|
|
40
|
+
const response = await this.request({
|
|
41
|
+
apiFn: this.api.getTweetDetailRaw,
|
|
42
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.threadedConversationWithInjectionsV2, e.errors).instructions,
|
|
43
|
+
key: 'TweetDetail',
|
|
44
|
+
param: args,
|
|
116
45
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
response = _a.sent();
|
|
133
|
-
return [2 /*return*/, response];
|
|
134
|
-
}
|
|
135
|
-
});
|
|
46
|
+
return response;
|
|
47
|
+
}
|
|
48
|
+
async getSearchTimeline(param) {
|
|
49
|
+
const args = {
|
|
50
|
+
rawQuery: param.rawQuery,
|
|
51
|
+
...(param.product == undefined ? {} : { product: param.product }),
|
|
52
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
53
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
54
|
+
...param.extraParam,
|
|
55
|
+
};
|
|
56
|
+
const response = await this.request({
|
|
57
|
+
apiFn: this.api.getSearchTimelineRaw,
|
|
58
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.searchByRawQuery, e.errors).searchTimeline.timeline.instructions,
|
|
59
|
+
key: 'SearchTimeline',
|
|
60
|
+
param: args,
|
|
136
61
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
})
|
|
62
|
+
return response;
|
|
63
|
+
}
|
|
64
|
+
async getHomeTimeline(param = {}) {
|
|
65
|
+
const args = {
|
|
66
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
67
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
68
|
+
...param.extraParam,
|
|
69
|
+
};
|
|
70
|
+
const response = await this.request({
|
|
71
|
+
apiFn: this.api.getHomeTimelineRaw,
|
|
72
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.home, e.errors).homeTimelineUrt.instructions,
|
|
73
|
+
key: 'HomeTimeline',
|
|
74
|
+
param: args,
|
|
75
|
+
});
|
|
76
|
+
return response;
|
|
77
|
+
}
|
|
78
|
+
async getHomeLatestTimeline(param = {}) {
|
|
79
|
+
const args = {
|
|
80
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
81
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
82
|
+
...param.extraParam,
|
|
83
|
+
};
|
|
84
|
+
const response = await this.request({
|
|
85
|
+
apiFn: this.api.getHomeLatestTimelineRaw,
|
|
86
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.home, e.errors).homeTimelineUrt.instructions,
|
|
87
|
+
key: 'HomeLatestTimeline',
|
|
88
|
+
param: args,
|
|
89
|
+
});
|
|
90
|
+
return response;
|
|
91
|
+
}
|
|
92
|
+
async getListLatestTweetsTimeline(param) {
|
|
93
|
+
const args = {
|
|
94
|
+
listId: param.listId,
|
|
95
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
96
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
97
|
+
...param.extraParam,
|
|
98
|
+
};
|
|
99
|
+
const response = await this.request({
|
|
100
|
+
apiFn: this.api.getListLatestTweetsTimelineRaw,
|
|
101
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.list?.tweetsTimeline.timeline, e.errors).instructions,
|
|
102
|
+
key: 'ListLatestTweetsTimeline',
|
|
103
|
+
param: args,
|
|
156
104
|
});
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
})];
|
|
172
|
-
case 1:
|
|
173
|
-
response = _a.sent();
|
|
174
|
-
return [2 /*return*/, response];
|
|
175
|
-
}
|
|
176
|
-
});
|
|
105
|
+
return response;
|
|
106
|
+
}
|
|
107
|
+
async getUserTweets(param) {
|
|
108
|
+
const args = {
|
|
109
|
+
userId: param.userId,
|
|
110
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
111
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
112
|
+
...param.extraParam,
|
|
113
|
+
};
|
|
114
|
+
const response = await this.request({
|
|
115
|
+
apiFn: this.api.getUserTweetsRaw,
|
|
116
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.user?.result.timeline.timeline, e.errors).instructions,
|
|
117
|
+
key: 'UserTweets',
|
|
118
|
+
param: args,
|
|
177
119
|
});
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
})];
|
|
193
|
-
case 1:
|
|
194
|
-
response = _a.sent();
|
|
195
|
-
return [2 /*return*/, response];
|
|
196
|
-
}
|
|
197
|
-
});
|
|
120
|
+
return response;
|
|
121
|
+
}
|
|
122
|
+
async getUserOriginalsTimeline(param) {
|
|
123
|
+
const args = {
|
|
124
|
+
userId: param.userId,
|
|
125
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
126
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
127
|
+
...param.extraParam,
|
|
128
|
+
};
|
|
129
|
+
const response = await this.request({
|
|
130
|
+
apiFn: this.api.getUserOriginalsTimelineRaw,
|
|
131
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.user?.result.timeline.timeline, e.errors).instructions,
|
|
132
|
+
key: 'UserOriginalsTimeline',
|
|
133
|
+
param: args,
|
|
198
134
|
});
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
case 1:
|
|
214
|
-
response = _a.sent();
|
|
215
|
-
return [2 /*return*/, response];
|
|
216
|
-
}
|
|
217
|
-
});
|
|
135
|
+
return response;
|
|
136
|
+
}
|
|
137
|
+
async getUserRepliesTimeline(param) {
|
|
138
|
+
const args = {
|
|
139
|
+
userId: param.userId,
|
|
140
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
141
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
142
|
+
...param.extraParam,
|
|
143
|
+
};
|
|
144
|
+
const response = await this.request({
|
|
145
|
+
apiFn: this.api.getUserRepliesTimelineRaw,
|
|
146
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.user?.result.timeline.timeline, e.errors).instructions,
|
|
147
|
+
key: 'UserRepliesTimeline',
|
|
148
|
+
param: args,
|
|
218
149
|
});
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
case 1:
|
|
234
|
-
response = _a.sent();
|
|
235
|
-
return [2 /*return*/, response];
|
|
236
|
-
}
|
|
237
|
-
});
|
|
150
|
+
return response;
|
|
151
|
+
}
|
|
152
|
+
async getUserVideoTimeline(param) {
|
|
153
|
+
const args = {
|
|
154
|
+
userId: param.userId,
|
|
155
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
156
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
157
|
+
...param.extraParam,
|
|
158
|
+
};
|
|
159
|
+
const response = await this.request({
|
|
160
|
+
apiFn: this.api.getUserVideoTimelineRaw,
|
|
161
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.user?.result.timeline.timeline, e.errors).instructions,
|
|
162
|
+
key: 'UserVideoTimeline',
|
|
163
|
+
param: args,
|
|
238
164
|
});
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
case 1:
|
|
254
|
-
response = _a.sent();
|
|
255
|
-
return [2 /*return*/, response];
|
|
256
|
-
}
|
|
257
|
-
});
|
|
165
|
+
return response;
|
|
166
|
+
}
|
|
167
|
+
async getUserTweetsAndReplies(param) {
|
|
168
|
+
const args = {
|
|
169
|
+
userId: param.userId,
|
|
170
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
171
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
172
|
+
...param.extraParam,
|
|
173
|
+
};
|
|
174
|
+
const response = await this.request({
|
|
175
|
+
apiFn: this.api.getUserTweetsAndRepliesRaw,
|
|
176
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.user?.result.timeline.timeline, e.errors).instructions,
|
|
177
|
+
key: 'UserTweetsAndReplies',
|
|
178
|
+
param: args,
|
|
258
179
|
});
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
case 1:
|
|
274
|
-
response = _a.sent();
|
|
275
|
-
return [2 /*return*/, response];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
180
|
+
return response;
|
|
181
|
+
}
|
|
182
|
+
async getUserMedia(param) {
|
|
183
|
+
const args = {
|
|
184
|
+
userId: param.userId,
|
|
185
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
186
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
187
|
+
...param.extraParam,
|
|
188
|
+
};
|
|
189
|
+
const response = await this.request({
|
|
190
|
+
apiFn: this.api.getUserMediaRaw,
|
|
191
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.user?.result.timeline.timeline, e.errors).instructions,
|
|
192
|
+
key: 'UserMedia',
|
|
193
|
+
param: args,
|
|
278
194
|
});
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
case 1:
|
|
294
|
-
response = _a.sent();
|
|
295
|
-
return [2 /*return*/, response];
|
|
296
|
-
}
|
|
297
|
-
});
|
|
195
|
+
return response;
|
|
196
|
+
}
|
|
197
|
+
async getLikes(param) {
|
|
198
|
+
const args = {
|
|
199
|
+
userId: param.userId,
|
|
200
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
201
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
202
|
+
...param.extraParam,
|
|
203
|
+
};
|
|
204
|
+
const response = await this.request({
|
|
205
|
+
apiFn: this.api.getLikesRaw,
|
|
206
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data.user?.result.timeline.timeline, e.errors).instructions,
|
|
207
|
+
key: 'Likes',
|
|
208
|
+
param: args,
|
|
298
209
|
});
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
param: args,
|
|
313
|
-
})];
|
|
314
|
-
case 1:
|
|
315
|
-
response = _a.sent();
|
|
316
|
-
return [2 /*return*/, response];
|
|
317
|
-
}
|
|
318
|
-
});
|
|
210
|
+
return response;
|
|
211
|
+
}
|
|
212
|
+
async getBookmarks(param = {}) {
|
|
213
|
+
const args = {
|
|
214
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
215
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
216
|
+
...param.extraParam,
|
|
217
|
+
};
|
|
218
|
+
const response = await this.request({
|
|
219
|
+
apiFn: this.api.getBookmarksRaw,
|
|
220
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data?.bookmarkTimelineV2.timeline, e.errors).instructions,
|
|
221
|
+
key: 'Bookmarks',
|
|
222
|
+
param: args,
|
|
319
223
|
});
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
response = _a.sent();
|
|
336
|
-
return [2 /*return*/, response];
|
|
337
|
-
}
|
|
338
|
-
});
|
|
224
|
+
return response;
|
|
225
|
+
}
|
|
226
|
+
async getCommunityTweetsTimeline(param) {
|
|
227
|
+
const args = {
|
|
228
|
+
communityId: param.communityId,
|
|
229
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
230
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
231
|
+
...(param.rankingMode == undefined ? {} : { rankingMode: param.rankingMode }),
|
|
232
|
+
...param.extraParam,
|
|
233
|
+
};
|
|
234
|
+
const response = await this.request({
|
|
235
|
+
apiFn: this.api.getCommunityTweetsTimelineRaw,
|
|
236
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data?.communityResults.result.rankedCommunityTimeline.timeline, e.errors).instructions,
|
|
237
|
+
key: 'CommunityTweetsTimeline',
|
|
238
|
+
param: args,
|
|
339
239
|
});
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
case 1:
|
|
355
|
-
response = _a.sent();
|
|
356
|
-
return [2 /*return*/, response];
|
|
357
|
-
}
|
|
358
|
-
});
|
|
240
|
+
return response;
|
|
241
|
+
}
|
|
242
|
+
async getCommunityMediaTimeline(param) {
|
|
243
|
+
const args = {
|
|
244
|
+
communityId: param.communityId,
|
|
245
|
+
...(param.count == undefined ? {} : { count: param.count }),
|
|
246
|
+
...(param.cursor == undefined ? {} : { cursor: param.cursor }),
|
|
247
|
+
...param.extraParam,
|
|
248
|
+
};
|
|
249
|
+
const response = await this.request({
|
|
250
|
+
apiFn: this.api.getCommunityMediaTimelineRaw,
|
|
251
|
+
convertFn: (e) => (0, utils_1.errorCheck)(e.data?.communityResults.result.communityMediaTimeline.timeline, e.errors).instructions,
|
|
252
|
+
key: 'CommunityMediaTimeline',
|
|
253
|
+
param: args,
|
|
359
254
|
});
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
255
|
+
return response;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
363
258
|
exports.TweetApiUtils = TweetApiUtils;
|
|
364
259
|
//# sourceMappingURL=tweetApi.js.map
|