emusks 2.0.4 → 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 +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 +23 -19
- package/src/static/graphql.js +1 -1
package/src/helpers/bookmarks.js
CHANGED
|
@@ -1,120 +1,118 @@
|
|
|
1
1
|
import parseTimeline from "../parsers/timeline.js";
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
3
|
+
export async function create(tweetId) {
|
|
4
|
+
return await this.graphql("CreateBookmark", {
|
|
5
|
+
body: { variables: { tweet_id: tweetId } },
|
|
6
|
+
});
|
|
7
|
+
}
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export async function remove(tweetId) {
|
|
10
|
+
return await this.graphql("DeleteBookmark", {
|
|
11
|
+
body: { variables: { tweet_id: tweetId } },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
export async function deleteAll() {
|
|
16
|
+
return await this.graphql("BookmarksAllDelete", {
|
|
17
|
+
body: { variables: {} },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
export async function get(opts = {}) {
|
|
22
|
+
const raw = await this.graphql("Bookmarks", {
|
|
23
|
+
variables: {
|
|
24
|
+
count: opts.count || 20,
|
|
25
|
+
cursor: opts.cursor,
|
|
26
|
+
includePromotedContent: false,
|
|
27
|
+
...opts.variables,
|
|
28
|
+
},
|
|
29
|
+
fieldToggles: {
|
|
30
|
+
withArticlePlainText: false,
|
|
31
|
+
withArticleRichContentState: false,
|
|
32
|
+
withAuxiliaryUserLabels: false,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return parseTimeline(raw);
|
|
36
|
+
}
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
async folders() {
|
|
53
|
-
return await client.graphql("BookmarkFoldersSlice", {
|
|
54
|
-
variables: {},
|
|
55
|
-
});
|
|
56
|
-
},
|
|
38
|
+
export async function search(query, opts = {}) {
|
|
39
|
+
const raw = await this.graphql("BookmarkSearchTimeline", {
|
|
40
|
+
variables: {
|
|
41
|
+
search_query: query,
|
|
42
|
+
count: opts.count || 20,
|
|
43
|
+
cursor: opts.cursor,
|
|
44
|
+
includePromotedContent: false,
|
|
45
|
+
...opts.variables,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
return parseTimeline(raw);
|
|
49
|
+
}
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
export async function folders() {
|
|
52
|
+
return await this.graphql("BookmarkFoldersSlice", {
|
|
53
|
+
variables: {},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
63
56
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
export async function createFolder(name) {
|
|
58
|
+
return await this.graphql("createBookmarkFolder", {
|
|
59
|
+
body: { variables: { bookmark_collection_name: name } },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
69
62
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
bookmark_collection_name: name,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
},
|
|
63
|
+
export async function deleteFolder(folderId) {
|
|
64
|
+
return await this.graphql("DeleteBookmarkFolder", {
|
|
65
|
+
body: { variables: { bookmark_collection_id: folderId } },
|
|
66
|
+
});
|
|
67
|
+
}
|
|
80
68
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
69
|
+
export async function editFolder(folderId, name) {
|
|
70
|
+
return await this.graphql("EditBookmarkFolder", {
|
|
71
|
+
body: {
|
|
72
|
+
variables: {
|
|
73
|
+
bookmark_collection_id: folderId,
|
|
74
|
+
bookmark_collection_name: name,
|
|
88
75
|
},
|
|
89
|
-
}
|
|
90
|
-
}
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
91
79
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
80
|
+
export async function addToFolder(tweetId, folderId) {
|
|
81
|
+
return await this.graphql("bookmarkTweetToFolder", {
|
|
82
|
+
body: {
|
|
83
|
+
variables: {
|
|
84
|
+
tweet_id: tweetId,
|
|
85
|
+
bookmark_collection_id: folderId,
|
|
99
86
|
},
|
|
100
|
-
}
|
|
101
|
-
}
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
102
90
|
|
|
103
|
-
|
|
104
|
-
|
|
91
|
+
export async function removeFromFolder(tweetId, folderId) {
|
|
92
|
+
return await this.graphql("RemoveTweetFromBookmarkFolder", {
|
|
93
|
+
body: {
|
|
105
94
|
variables: {
|
|
95
|
+
tweet_id: tweetId,
|
|
106
96
|
bookmark_collection_id: folderId,
|
|
107
|
-
count: opts.count || 20,
|
|
108
|
-
cursor: opts.cursor,
|
|
109
|
-
includePromotedContent: false,
|
|
110
|
-
...opts.variables,
|
|
111
|
-
},
|
|
112
|
-
fieldToggles: {
|
|
113
|
-
withArticlePlainText: false,
|
|
114
|
-
withArticleRichContentState: false,
|
|
115
|
-
withAuxiliaryUserLabels: false,
|
|
116
97
|
},
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export async function folderTimeline(folderId, opts = {}) {
|
|
103
|
+
const raw = await this.graphql("BookmarkFolderTimeline", {
|
|
104
|
+
variables: {
|
|
105
|
+
bookmark_collection_id: folderId,
|
|
106
|
+
count: opts.count || 20,
|
|
107
|
+
cursor: opts.cursor,
|
|
108
|
+
includePromotedContent: false,
|
|
109
|
+
...opts.variables,
|
|
110
|
+
},
|
|
111
|
+
fieldToggles: {
|
|
112
|
+
withArticlePlainText: false,
|
|
113
|
+
withArticleRichContentState: false,
|
|
114
|
+
withAuxiliaryUserLabels: false,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
return parseTimeline(raw);
|
|
118
|
+
}
|