emusks 2.0.3 → 2.0.5
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/build/graphql.js +5 -13
- package/package.json +14 -3
- package/src/graphql.js +34 -12
- package/src/helpers/account.js +267 -269
- package/src/helpers/bookmarks.js +101 -103
- package/src/helpers/communities.js +236 -238
- package/src/helpers/dms.js +129 -131
- package/src/helpers/index.js +50 -31
- package/src/helpers/lists.js +222 -224
- package/src/helpers/media.js +137 -139
- package/src/helpers/notifications.js +42 -44
- package/src/helpers/search.js +117 -119
- package/src/helpers/spaces.js +47 -49
- package/src/helpers/syndication.js +23 -25
- package/src/helpers/timelines.js +76 -78
- package/src/helpers/topics.js +87 -89
- package/src/helpers/trends.js +74 -76
- package/src/helpers/tweets.js +302 -304
- package/src/helpers/users.js +287 -289
- package/src/index.js +23 -19
- package/src/static/graphql.js +1 -1
package/src/helpers/account.js
CHANGED
|
@@ -1,271 +1,269 @@
|
|
|
1
1
|
import parseUser from "../parsers/user.js";
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
});
|
|
3
|
+
export async function settings() {
|
|
4
|
+
const res = await this.v1_1("get:account/settings", {});
|
|
5
|
+
return await res.json();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function updateSettings(params = {}) {
|
|
9
|
+
const res = await this.v1_1("post:account/settings", {
|
|
10
|
+
body: JSON.stringify(params),
|
|
11
|
+
});
|
|
12
|
+
return await res.json();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function verifyPassword(password) {
|
|
16
|
+
const res = await this.v1_1("account/verify_password", {
|
|
17
|
+
body: `password=${encodeURIComponent(password)}`,
|
|
18
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
19
|
+
});
|
|
20
|
+
return await res.json();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function changePassword(currentPassword, newPassword) {
|
|
24
|
+
const res = await this.v1_1("account/change_password", {
|
|
25
|
+
body: JSON.stringify({
|
|
26
|
+
current_password: currentPassword,
|
|
27
|
+
password: newPassword,
|
|
28
|
+
password_confirmation: newPassword,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
return await res.json();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function deactivate() {
|
|
35
|
+
const res = await this.v1_1("account/deactivate", {});
|
|
36
|
+
return await res.json();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function logout() {
|
|
40
|
+
const res = await this.v1_1("account/logout", {});
|
|
41
|
+
return await res.json();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export async function rateLimitStatus(params = {}) {
|
|
45
|
+
const res = await this.v1_1("application/rate_limit_status", { params });
|
|
46
|
+
return await res.json();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function viewer() {
|
|
50
|
+
const res = await this.graphql("Viewer", {
|
|
51
|
+
variables: { withCommunitiesMemberships: true },
|
|
52
|
+
fieldToggles: { withAuxiliaryUserLabels: false },
|
|
53
|
+
});
|
|
54
|
+
const user = res?.data?.viewer?.user_results?.result;
|
|
55
|
+
return user ? parseUser(user) : res;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function sessions() {
|
|
59
|
+
return await this.graphql("UserSessionsList", {
|
|
60
|
+
variables: {},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export async function preferences() {
|
|
65
|
+
return await this.graphql("UserPreferences", {
|
|
66
|
+
variables: {},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function claims() {
|
|
71
|
+
return await this.graphql("GetUserClaims", {
|
|
72
|
+
variables: {},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export async function phoneState() {
|
|
77
|
+
return await this.graphql("ProfileUserPhoneState", {
|
|
78
|
+
variables: {},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export async function passwordStrength(password) {
|
|
83
|
+
const res = await this.v1_1("account/password_strength", {
|
|
84
|
+
body: JSON.stringify({ password }),
|
|
85
|
+
});
|
|
86
|
+
return await res.json();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export async function resendConfirmationEmail() {
|
|
90
|
+
const res = await this.v1_1("account/resend_confirmation_email", {});
|
|
91
|
+
return await res.json();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export async function emailPhoneInfo(params = {}) {
|
|
95
|
+
const res = await this.v1_1("users/email_phone_info", { params });
|
|
96
|
+
return await res.json();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export async function emailAvailable(email) {
|
|
100
|
+
const res = await this.v1_1("users/email_available", {
|
|
101
|
+
params: { email },
|
|
102
|
+
});
|
|
103
|
+
return await res.json();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export async function phoneAvailable(phone) {
|
|
107
|
+
const res = await this.v1_1("users/phone_number_available", {
|
|
108
|
+
params: { phone_number: phone },
|
|
109
|
+
});
|
|
110
|
+
return await res.json();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export async function usernameAvailable(username) {
|
|
114
|
+
return await this.graphql("GetUsernameAvailabilityAndSuggestions", {
|
|
115
|
+
body: { variables: { username } },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export async function backupCode() {
|
|
120
|
+
const res = await this.v1_1("get:account/backup_code", {});
|
|
121
|
+
return await res.json();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export async function generateBackupCode() {
|
|
125
|
+
const res = await this.v1_1("post:account/backup_code", {});
|
|
126
|
+
return await res.json();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export async function disable2FA() {
|
|
130
|
+
const res = await this.v1_1("account/login_verification_enrollment", {});
|
|
131
|
+
return await res.json();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export async function remove2FAMethod(methodId) {
|
|
135
|
+
const res = await this.v1_1("account/login_verification/remove_method", {
|
|
136
|
+
body: JSON.stringify({ method_id: methodId }),
|
|
137
|
+
});
|
|
138
|
+
return await res.json();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export async function tempPassword() {
|
|
142
|
+
const res = await this.v1_1("account/login_verification/temporary_password", {});
|
|
143
|
+
return await res.json();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export async function renameSecurityKey(methodId, name) {
|
|
147
|
+
const res = await this.v1_1("account/login_verification/rename_security_key_method", {
|
|
148
|
+
body: JSON.stringify({ method_id: methodId, name }),
|
|
149
|
+
});
|
|
150
|
+
return await res.json();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export async function connectedApps() {
|
|
154
|
+
const res = await this.v1_1("oauth/list", {});
|
|
155
|
+
return await res.json();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export async function revokeApp(token) {
|
|
159
|
+
const res = await this.v1_1("oauth/revoke", {
|
|
160
|
+
body: JSON.stringify({ token }),
|
|
161
|
+
});
|
|
162
|
+
return await res.json();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export async function deleteSSOConnection(connectionId) {
|
|
166
|
+
const res = await this.v1_1("sso/delete_connection", {
|
|
167
|
+
body: JSON.stringify({ connection_id: connectionId }),
|
|
168
|
+
});
|
|
169
|
+
return await res.json();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export async function personalizationInterests() {
|
|
173
|
+
const res = await this.v1_1("account/personalization/twitter_interests", {});
|
|
174
|
+
return await res.json();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export async function emailYourData() {
|
|
178
|
+
const res = await this.v1_1("account/personalization/email_your_data", {});
|
|
179
|
+
return await res.json();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export async function multiList() {
|
|
183
|
+
const res = await this.v1_1("account/multi/list", {});
|
|
184
|
+
return await res.json();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export async function enableVerifiedPhoneLabel() {
|
|
188
|
+
return await this.graphql("EnableVerifiedPhoneLabel", {
|
|
189
|
+
body: { variables: {} },
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export async function disableVerifiedPhoneLabel() {
|
|
194
|
+
return await this.graphql("DisableVerifiedPhoneLabel", {
|
|
195
|
+
body: { variables: {} },
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export async function dataSaverMode() {
|
|
200
|
+
return await this.graphql("DataSaverMode", {
|
|
201
|
+
variables: {},
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export async function setDataSaver(dataSaverMode) {
|
|
206
|
+
return await this.graphql("WriteDataSaverPreferences", {
|
|
207
|
+
body: { variables: { dataSaverMode } },
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export async function mutedKeywords() {
|
|
212
|
+
const res = await this.v1_1("mutes/keywords/list", {});
|
|
213
|
+
return await res.json();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export async function deleteMutedKeyword(keywordId) {
|
|
217
|
+
const res = await this.v1_1("mutes/keywords/destroy", {
|
|
218
|
+
body: JSON.stringify({ ids: keywordId }),
|
|
219
|
+
});
|
|
220
|
+
return await res.json();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export async function updateMutedKeyword(params = {}) {
|
|
224
|
+
const res = await this.v1_1("mutes/keywords/update", {
|
|
225
|
+
body: JSON.stringify(params),
|
|
226
|
+
});
|
|
227
|
+
return await res.json();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export async function advancedFilters() {
|
|
231
|
+
const res = await this.v1_1("get:mutes/advanced_filters", {});
|
|
232
|
+
return await res.json();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export async function updateAdvancedFilters(params = {}) {
|
|
236
|
+
const res = await this.v1_1("post:mutes/advanced_filters", {
|
|
237
|
+
body: JSON.stringify(params),
|
|
238
|
+
});
|
|
239
|
+
return await res.json();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export async function helpSettings() {
|
|
243
|
+
const res = await this.v1_1("help/settings", {});
|
|
244
|
+
return await res.json();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export async function emailNotificationSettings(params = {}) {
|
|
248
|
+
return await this.graphql("WriteEmailNotificationSettings", {
|
|
249
|
+
body: { variables: { ...params } },
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export async function viewerEmailSettings() {
|
|
254
|
+
return await this.graphql("ViewerEmailSettings", {
|
|
255
|
+
variables: {},
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export async function accountLabel() {
|
|
260
|
+
return await this.graphql("UserAccountLabel", {
|
|
261
|
+
variables: {},
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export async function disableAccountLabel() {
|
|
266
|
+
return await this.graphql("DisableUserAccountLabel", {
|
|
267
|
+
body: { variables: {} },
|
|
268
|
+
});
|
|
269
|
+
}
|