emusks 2.0.4 → 2.0.6
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 +9 -14
- package/package.json +1 -1
- 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 +29 -16
- package/src/static/graphql.js +1 -1
|
@@ -1,271 +1,269 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
...opts.variables,
|
|
10
|
-
},
|
|
1
|
+
export async function create(name, opts = {}) {
|
|
2
|
+
return await this.graphql("CreateCommunity", {
|
|
3
|
+
body: {
|
|
4
|
+
variables: {
|
|
5
|
+
name,
|
|
6
|
+
description: opts.description || "",
|
|
7
|
+
...(opts.rules ? { rules: opts.rules } : {}),
|
|
8
|
+
...opts.variables,
|
|
11
9
|
},
|
|
12
|
-
}
|
|
13
|
-
}
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
}
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
export async function get(communityId) {
|
|
15
|
+
return await this.graphql("CommunityByRestId", {
|
|
16
|
+
variables: { communityId },
|
|
17
|
+
});
|
|
18
|
+
}
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
export async function join(communityId) {
|
|
21
|
+
return await this.graphql("JoinCommunity", {
|
|
22
|
+
body: { variables: { communityId } },
|
|
23
|
+
});
|
|
24
|
+
}
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
async requestJoin(communityId, opts = {}) {
|
|
34
|
-
return await client.graphql("RequestToJoinCommunity", {
|
|
35
|
-
body: {
|
|
36
|
-
variables: {
|
|
37
|
-
communityId,
|
|
38
|
-
...(opts.answer ? { answer: opts.answer } : {}),
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
},
|
|
26
|
+
export async function leave(communityId) {
|
|
27
|
+
return await this.graphql("LeaveCommunity", {
|
|
28
|
+
body: { variables: { communityId } },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
export async function requestJoin(communityId, opts = {}) {
|
|
33
|
+
return await this.graphql("RequestToJoinCommunity", {
|
|
34
|
+
body: {
|
|
46
35
|
variables: {
|
|
47
36
|
communityId,
|
|
48
|
-
|
|
49
|
-
cursor: opts.cursor,
|
|
50
|
-
rankingMode: opts.rankingMode || "Recency",
|
|
51
|
-
withCommunity: true,
|
|
52
|
-
...opts.variables,
|
|
53
|
-
},
|
|
54
|
-
fieldToggles: {
|
|
55
|
-
withArticlePlainText: false,
|
|
56
|
-
withArticleRichContentState: false,
|
|
57
|
-
withAuxiliaryUserLabels: false,
|
|
37
|
+
...(opts.answer ? { answer: opts.answer } : {}),
|
|
58
38
|
},
|
|
59
|
-
}
|
|
60
|
-
}
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
61
42
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}
|
|
43
|
+
export async function timeline(communityId, opts = {}) {
|
|
44
|
+
return await this.graphql("CommunityTweetsTimeline", {
|
|
45
|
+
variables: {
|
|
46
|
+
communityId,
|
|
47
|
+
count: opts.count || 20,
|
|
48
|
+
cursor: opts.cursor,
|
|
49
|
+
rankingMode: opts.rankingMode || "Recency",
|
|
50
|
+
withCommunity: true,
|
|
51
|
+
...opts.variables,
|
|
52
|
+
},
|
|
53
|
+
fieldToggles: {
|
|
54
|
+
withArticlePlainText: false,
|
|
55
|
+
withArticleRichContentState: false,
|
|
56
|
+
withAuxiliaryUserLabels: false,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
78
60
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
61
|
+
export async function media(communityId, opts = {}) {
|
|
62
|
+
return await this.graphql("CommunityMediaTimeline", {
|
|
63
|
+
variables: {
|
|
64
|
+
communityId,
|
|
65
|
+
count: opts.count || 20,
|
|
66
|
+
cursor: opts.cursor,
|
|
67
|
+
withCommunity: true,
|
|
68
|
+
...opts.variables,
|
|
69
|
+
},
|
|
70
|
+
fieldToggles: {
|
|
71
|
+
withArticlePlainText: false,
|
|
72
|
+
withArticleRichContentState: false,
|
|
73
|
+
withAuxiliaryUserLabels: false,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}
|
|
90
77
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
}
|
|
78
|
+
export async function about(communityId, opts = {}) {
|
|
79
|
+
return await this.graphql("CommunityAboutTimeline", {
|
|
80
|
+
variables: {
|
|
81
|
+
communityId,
|
|
82
|
+
count: opts.count || 20,
|
|
83
|
+
cursor: opts.cursor,
|
|
84
|
+
withCommunity: true,
|
|
85
|
+
...opts.variables,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export async function hashtags(communityId, opts = {}) {
|
|
91
|
+
return await this.graphql("CommunityHashtagsTimeline", {
|
|
92
|
+
variables: {
|
|
93
|
+
communityId,
|
|
94
|
+
count: opts.count || 20,
|
|
95
|
+
cursor: opts.cursor,
|
|
96
|
+
...opts.variables,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
101
100
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
export async function editName(communityId, name) {
|
|
102
|
+
return await this.graphql("CommunityEditName", {
|
|
103
|
+
body: { variables: { communityId, name } },
|
|
104
|
+
});
|
|
105
|
+
}
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
export async function editPurpose(communityId, purpose) {
|
|
108
|
+
return await this.graphql("CommunityEditPurpose", {
|
|
109
|
+
body: { variables: { communityId, purpose } },
|
|
110
|
+
});
|
|
111
|
+
}
|
|
113
112
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
export async function editBanner(communityId, mediaId) {
|
|
114
|
+
return await this.graphql("CommunityEditBannerMedia", {
|
|
115
|
+
body: { variables: { communityId, mediaId } },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
export async function removeBanner(communityId) {
|
|
120
|
+
return await this.graphql("CommunityRemoveBannerMedia", {
|
|
121
|
+
body: { variables: { communityId } },
|
|
122
|
+
});
|
|
123
|
+
}
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
125
|
+
export async function createRule(communityId, name, opts = {}) {
|
|
126
|
+
return await this.graphql("CommunityCreateRule", {
|
|
127
|
+
body: {
|
|
128
|
+
variables: {
|
|
129
|
+
communityId,
|
|
130
|
+
name,
|
|
131
|
+
description: opts.description || "",
|
|
134
132
|
},
|
|
135
|
-
}
|
|
136
|
-
}
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
137
136
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
137
|
+
export async function editRule(communityId, ruleId, name, opts = {}) {
|
|
138
|
+
return await this.graphql("CommunityEditRule", {
|
|
139
|
+
body: {
|
|
140
|
+
variables: {
|
|
141
|
+
communityId,
|
|
142
|
+
ruleId,
|
|
143
|
+
name,
|
|
144
|
+
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
147
145
|
},
|
|
148
|
-
}
|
|
149
|
-
}
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
150
149
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
export async function removeRule(communityId, ruleId) {
|
|
151
|
+
return await this.graphql("CommunityRemoveRule", {
|
|
152
|
+
body: { variables: { communityId, ruleId } },
|
|
153
|
+
});
|
|
154
|
+
}
|
|
156
155
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
export async function reorderRules(communityId, ruleIds) {
|
|
157
|
+
return await this.graphql("CommunityReorderRules", {
|
|
158
|
+
body: { variables: { communityId, ruleIds } },
|
|
159
|
+
});
|
|
160
|
+
}
|
|
162
161
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
export async function editQuestion(communityId, question) {
|
|
163
|
+
return await this.graphql("CommunityEditQuestion", {
|
|
164
|
+
body: { variables: { communityId, question } },
|
|
165
|
+
});
|
|
166
|
+
}
|
|
168
167
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
168
|
+
export async function updateRole(communityId, userId, role) {
|
|
169
|
+
return await this.graphql("CommunityUpdateRole", {
|
|
170
|
+
body: { variables: { communityId, userId, role } },
|
|
171
|
+
});
|
|
172
|
+
}
|
|
174
173
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
export async function invite(communityId, userId) {
|
|
175
|
+
return await this.graphql("CommunityUserInvite", {
|
|
176
|
+
body: { variables: { communityId, userId } },
|
|
177
|
+
});
|
|
178
|
+
}
|
|
180
179
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
export async function keepTweet(communityId, tweetId) {
|
|
181
|
+
return await this.graphql("CommunityModerationKeepTweet", {
|
|
182
|
+
body: { variables: { communityId, tweetId } },
|
|
183
|
+
});
|
|
184
|
+
}
|
|
186
185
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
186
|
+
export async function moderationCases(communityId, opts = {}) {
|
|
187
|
+
return await this.graphql("CommunityModerationTweetCasesSlice", {
|
|
188
|
+
variables: {
|
|
189
|
+
communityId,
|
|
190
|
+
count: opts.count || 20,
|
|
191
|
+
cursor: opts.cursor,
|
|
192
|
+
...opts.variables,
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
}
|
|
197
196
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
197
|
+
export async function moderationLog(communityId, opts = {}) {
|
|
198
|
+
return await this.graphql("CommunityTweetModerationLogSlice", {
|
|
199
|
+
variables: {
|
|
200
|
+
communityId,
|
|
201
|
+
count: opts.count || 20,
|
|
202
|
+
cursor: opts.cursor,
|
|
203
|
+
...opts.variables,
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
}
|
|
208
207
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
export async function explore(opts = {}) {
|
|
209
|
+
return await this.graphql("CommunitiesExploreTimeline", {
|
|
210
|
+
variables: {
|
|
211
|
+
count: opts.count || 20,
|
|
212
|
+
cursor: opts.cursor,
|
|
213
|
+
...opts.variables,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
}
|
|
218
217
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
218
|
+
export async function discover(opts = {}) {
|
|
219
|
+
return await this.graphql("CommunitiesMainDiscoveryModule", {
|
|
220
|
+
variables: {
|
|
221
|
+
count: opts.count || 20,
|
|
222
|
+
cursor: opts.cursor,
|
|
223
|
+
...opts.variables,
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
}
|
|
228
227
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
228
|
+
export async function ranked(opts = {}) {
|
|
229
|
+
return await this.graphql("CommunitiesRankedTimeline", {
|
|
230
|
+
variables: {
|
|
231
|
+
count: opts.count || 20,
|
|
232
|
+
cursor: opts.cursor,
|
|
233
|
+
...opts.variables,
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
}
|
|
238
237
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
238
|
+
export async function memberships(userId, opts = {}) {
|
|
239
|
+
return await this.graphql("CommunitiesMembershipsTimeline", {
|
|
240
|
+
variables: {
|
|
241
|
+
userId,
|
|
242
|
+
count: opts.count || 20,
|
|
243
|
+
cursor: opts.cursor,
|
|
244
|
+
...opts.variables,
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
}
|
|
249
248
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
249
|
+
export async function memberSearch(communityId, query, opts = {}) {
|
|
250
|
+
return await this.graphql("CommunityMemberRelationshipTypeahead", {
|
|
251
|
+
variables: {
|
|
252
|
+
communityId,
|
|
253
|
+
query,
|
|
254
|
+
count: opts.count || 20,
|
|
255
|
+
...opts.variables,
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
}
|
|
260
259
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
});
|
|
260
|
+
export async function userSearch(communityId, query, opts = {}) {
|
|
261
|
+
return await this.graphql("CommunityUserRelationshipTypeahead", {
|
|
262
|
+
variables: {
|
|
263
|
+
communityId,
|
|
264
|
+
query,
|
|
265
|
+
count: opts.count || 20,
|
|
266
|
+
...opts.variables,
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
}
|