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.
@@ -1,99 +1,97 @@
1
- export default (client) => ({
2
- async follow(topicId) {
3
- return await client.graphql("TopicFollow", {
4
- body: { variables: { topic_id: topicId } },
5
- });
6
- },
1
+ export async function follow(topicId) {
2
+ return await this.graphql("TopicFollow", {
3
+ body: { variables: { topic_id: topicId } },
4
+ });
5
+ }
7
6
 
8
- async unfollow(topicId) {
9
- return await client.graphql("TopicUnfollow", {
10
- body: { variables: { topic_id: topicId } },
11
- });
12
- },
7
+ export async function unfollow(topicId) {
8
+ return await this.graphql("TopicUnfollow", {
9
+ body: { variables: { topic_id: topicId } },
10
+ });
11
+ }
13
12
 
14
- async notInterested(topicId) {
15
- return await client.graphql("TopicNotInterested", {
16
- body: { variables: { topic_id: topicId } },
17
- });
18
- },
13
+ export async function notInterested(topicId) {
14
+ return await this.graphql("TopicNotInterested", {
15
+ body: { variables: { topic_id: topicId } },
16
+ });
17
+ }
19
18
 
20
- async undoNotInterested(topicId) {
21
- return await client.graphql("TopicUndoNotInterested", {
22
- body: { variables: { topic_id: topicId } },
23
- });
24
- },
19
+ export async function undoNotInterested(topicId) {
20
+ return await this.graphql("TopicUndoNotInterested", {
21
+ body: { variables: { topic_id: topicId } },
22
+ });
23
+ }
25
24
 
26
- async get(topicId) {
27
- return await client.graphql("TopicByRestId", {
28
- variables: { topicId },
29
- });
30
- },
25
+ export async function get(topicId) {
26
+ return await this.graphql("TopicByRestId", {
27
+ variables: { topicId },
28
+ });
29
+ }
31
30
 
32
- async landingPage(topicId, opts = {}) {
33
- return await client.graphql("TopicLandingPage", {
34
- variables: {
35
- topicId,
36
- count: opts.count || 20,
37
- cursor: opts.cursor,
38
- ...opts.variables,
39
- },
40
- fieldToggles: {
41
- withArticlePlainText: false,
42
- withArticleRichContentState: false,
43
- withAuxiliaryUserLabels: false,
44
- },
45
- });
46
- },
31
+ export async function landingPage(topicId, opts = {}) {
32
+ return await this.graphql("TopicLandingPage", {
33
+ variables: {
34
+ topicId,
35
+ count: opts.count || 20,
36
+ cursor: opts.cursor,
37
+ ...opts.variables,
38
+ },
39
+ fieldToggles: {
40
+ withArticlePlainText: false,
41
+ withArticleRichContentState: false,
42
+ withAuxiliaryUserLabels: false,
43
+ },
44
+ });
45
+ }
47
46
 
48
- async toFollow(opts = {}) {
49
- return await client.graphql("TopicToFollowSidebar", {
50
- variables: {
51
- count: opts.count || 20,
52
- cursor: opts.cursor,
53
- ...opts.variables,
54
- },
55
- });
56
- },
47
+ export async function toFollow(opts = {}) {
48
+ return await this.graphql("TopicToFollowSidebar", {
49
+ variables: {
50
+ count: opts.count || 20,
51
+ cursor: opts.cursor,
52
+ ...opts.variables,
53
+ },
54
+ });
55
+ }
57
56
 
58
- async manage(opts = {}) {
59
- return await client.graphql("TopicsManagementPage", {
60
- variables: {
61
- count: opts.count || 20,
62
- cursor: opts.cursor,
63
- ...opts.variables,
64
- },
65
- });
66
- },
57
+ export async function manage(opts = {}) {
58
+ return await this.graphql("TopicsManagementPage", {
59
+ variables: {
60
+ count: opts.count || 20,
61
+ cursor: opts.cursor,
62
+ ...opts.variables,
63
+ },
64
+ });
65
+ }
67
66
 
68
- async picker(opts = {}) {
69
- return await client.graphql("TopicsPickerPage", {
70
- variables: {
71
- count: opts.count || 20,
72
- cursor: opts.cursor,
73
- ...opts.variables,
74
- },
75
- });
76
- },
67
+ export async function picker(opts = {}) {
68
+ return await this.graphql("TopicsPickerPage", {
69
+ variables: {
70
+ count: opts.count || 20,
71
+ cursor: opts.cursor,
72
+ ...opts.variables,
73
+ },
74
+ });
75
+ }
77
76
 
78
- async pickerById(topicId, opts = {}) {
79
- return await client.graphql("TopicsPickerPageById", {
80
- variables: {
81
- topicId,
82
- count: opts.count || 20,
83
- cursor: opts.cursor,
84
- ...opts.variables,
85
- },
86
- });
87
- },
77
+ export async function pickerById(topicId, opts = {}) {
78
+ return await this.graphql("TopicsPickerPageById", {
79
+ variables: {
80
+ topicId,
81
+ count: opts.count || 20,
82
+ cursor: opts.cursor,
83
+ ...opts.variables,
84
+ },
85
+ });
86
+ }
88
87
 
89
- async viewing(userId, opts = {}) {
90
- return await client.graphql("ViewingOtherUsersTopicsPage", {
91
- variables: {
92
- userId,
93
- count: opts.count || 20,
94
- cursor: opts.cursor,
95
- ...opts.variables,
96
- },
97
- });
98
- },
99
- });
88
+ export async function viewing(userId, opts = {}) {
89
+ return await this.graphql("ViewingOtherUsersTopicsPage", {
90
+ variables: {
91
+ userId,
92
+ count: opts.count || 20,
93
+ cursor: opts.cursor,
94
+ ...opts.variables,
95
+ },
96
+ });
97
+ }
@@ -1,86 +1,84 @@
1
- export default (client) => ({
2
- async available() {
3
- const res = await client.v1_1("trends/available", {});
4
- return await res.json();
5
- },
1
+ export async function available() {
2
+ const res = await this.v1_1("trends/available", {});
3
+ return await res.json();
4
+ }
6
5
 
7
- async history(opts = {}) {
8
- return await client.graphql("TrendHistory", {
9
- variables: {
10
- count: opts.count || 20,
11
- cursor: opts.cursor,
12
- ...opts.variables,
13
- },
14
- });
15
- },
6
+ export async function history(opts = {}) {
7
+ return await this.graphql("TrendHistory", {
8
+ variables: {
9
+ count: opts.count || 20,
10
+ cursor: opts.cursor,
11
+ ...opts.variables,
12
+ },
13
+ });
14
+ }
16
15
 
17
- async relevantUsers(trendName, opts = {}) {
18
- return await client.graphql("TrendRelevantUsers", {
19
- variables: {
20
- trend_name: trendName,
21
- ...opts.variables,
22
- },
23
- });
24
- },
16
+ export async function relevantUsers(trendName, opts = {}) {
17
+ return await this.graphql("TrendRelevantUsers", {
18
+ variables: {
19
+ trend_name: trendName,
20
+ ...opts.variables,
21
+ },
22
+ });
23
+ }
25
24
 
26
- async explore(opts = {}) {
27
- return await client.graphql("ExplorePage", {
28
- variables: {
29
- count: opts.count || 20,
30
- cursor: opts.cursor,
31
- ...opts.variables,
32
- },
33
- fieldToggles: {
34
- withArticlePlainText: false,
35
- withArticleRichContentState: false,
36
- withAuxiliaryUserLabels: false,
37
- },
38
- });
39
- },
25
+ export async function explore(opts = {}) {
26
+ return await this.graphql("ExplorePage", {
27
+ variables: {
28
+ count: opts.count || 20,
29
+ cursor: opts.cursor,
30
+ ...opts.variables,
31
+ },
32
+ fieldToggles: {
33
+ withArticlePlainText: false,
34
+ withArticleRichContentState: false,
35
+ withAuxiliaryUserLabels: false,
36
+ },
37
+ });
38
+ }
40
39
 
41
- async exploreSidebar(opts = {}) {
42
- return await client.graphql("ExploreSidebar", {
43
- variables: {
44
- count: opts.count || 20,
45
- cursor: opts.cursor,
46
- ...opts.variables,
47
- },
48
- });
49
- },
40
+ export async function exploreSidebar(opts = {}) {
41
+ return await this.graphql("ExploreSidebar", {
42
+ variables: {
43
+ count: opts.count || 20,
44
+ cursor: opts.cursor,
45
+ ...opts.variables,
46
+ },
47
+ });
48
+ }
50
49
 
51
- async report(trendId) {
52
- return await client.graphql("ReportTrend", {
53
- body: { variables: { trend_id: trendId } },
54
- });
55
- },
50
+ export async function report(trendId) {
51
+ return await this.graphql("ReportTrend", {
52
+ body: { variables: { trend_id: trendId } },
53
+ });
54
+ }
56
55
 
57
- async save(trendId) {
58
- return await client.graphql("SaveTrend", {
59
- body: { variables: { trend_id: trendId } },
60
- });
61
- },
56
+ export async function save(trendId) {
57
+ return await this.graphql("SaveTrend", {
58
+ body: { variables: { trend_id: trendId } },
59
+ });
60
+ }
62
61
 
63
- async action(trendId, action) {
64
- return await client.graphql("ActionTrend", {
65
- body: { variables: { trend_id: trendId, action } },
66
- });
67
- },
62
+ export async function action(trendId, action) {
63
+ return await this.graphql("ActionTrend", {
64
+ body: { variables: { trend_id: trendId, action } },
65
+ });
66
+ }
68
67
 
69
- async getById(trendId) {
70
- return await client.graphql("AiTrendByRestId", {
71
- variables: { trendId },
72
- });
73
- },
68
+ export async function getById(trendId) {
69
+ return await this.graphql("AiTrendByRestId", {
70
+ variables: { trendId },
71
+ });
72
+ }
74
73
 
75
- async exploreSettings() {
76
- const res = await client.v2("guide/get_explore_settings", {});
77
- return await res.json();
78
- },
74
+ export async function exploreSettings() {
75
+ const res = await this.v2("guide/get_explore_settings", {});
76
+ return await res.json();
77
+ }
79
78
 
80
- async setExploreSettings(params = {}) {
81
- const res = await client.v2("guide/set_explore_settings", {
82
- body: JSON.stringify(params),
83
- });
84
- return await res.json();
85
- },
86
- });
79
+ export async function setExploreSettings(params = {}) {
80
+ const res = await this.v2("guide/set_explore_settings", {
81
+ body: JSON.stringify(params),
82
+ });
83
+ return await res.json();
84
+ }