@pipedream/twitter 0.3.11 → 1.0.0

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.
Files changed (119) hide show
  1. package/README.md +20 -71
  2. package/dist/actions/add-user-to-list/add-user-to-list.d.ts +380 -0
  3. package/dist/actions/add-user-to-list/add-user-to-list.mjs +42 -0
  4. package/dist/actions/create-tweet/create-tweet.d.ts +163 -0
  5. package/dist/actions/create-tweet/create-tweet.mjs +78 -0
  6. package/dist/actions/delete-tweet/delete-tweet.d.ts +252 -0
  7. package/dist/actions/delete-tweet/delete-tweet.mjs +28 -0
  8. package/dist/actions/follow-user/follow-user.d.ts +255 -0
  9. package/dist/actions/follow-user/follow-user.mjs +37 -0
  10. package/dist/actions/get-tweet/get-tweet.d.ts +1006 -0
  11. package/dist/actions/get-tweet/get-tweet.mjs +35 -0
  12. package/dist/actions/get-user/get-user.d.ts +634 -0
  13. package/dist/actions/get-user/get-user.mjs +37 -0
  14. package/dist/actions/like-tweet/like-tweet.d.ts +252 -0
  15. package/dist/actions/like-tweet/like-tweet.mjs +30 -0
  16. package/dist/actions/list-favorites/list-favorites.d.ts +1138 -0
  17. package/dist/actions/list-favorites/list-favorites.mjs +52 -0
  18. package/dist/actions/list-followers/list-followers.d.ts +765 -0
  19. package/dist/actions/list-followers/list-followers.mjs +52 -0
  20. package/dist/actions/list-lists/list-lists.d.ts +762 -0
  21. package/dist/actions/list-lists/list-lists.mjs +52 -0
  22. package/dist/actions/list-mentions/list-mentions.d.ts +1136 -0
  23. package/dist/actions/list-mentions/list-mentions.mjs +52 -0
  24. package/dist/actions/list-user-tweets/list-user-tweets.d.ts +1138 -0
  25. package/dist/actions/list-user-tweets/list-user-tweets.mjs +52 -0
  26. package/dist/actions/retweet/retweet.d.ts +252 -0
  27. package/dist/actions/retweet/retweet.mjs +31 -0
  28. package/dist/actions/simple-search/simple-search.d.ts +1137 -0
  29. package/dist/actions/simple-search/simple-search.mjs +51 -0
  30. package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +1142 -0
  31. package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +60 -0
  32. package/dist/actions/unfollow-user/unfollow-user.d.ts +255 -0
  33. package/dist/actions/unfollow-user/unfollow-user.mjs +33 -0
  34. package/dist/actions/unlike-tweet/unlike-tweet.d.ts +252 -0
  35. package/dist/actions/unlike-tweet/unlike-tweet.mjs +28 -0
  36. package/dist/app/twitter.app.d.ts +127 -0
  37. package/dist/app/twitter.app.mjs +341 -0
  38. package/dist/common/dataFields.d.ts +6 -0
  39. package/dist/common/dataFields.mjs +80 -0
  40. package/dist/common/expansions.d.ts +3 -0
  41. package/dist/common/expansions.mjs +17 -0
  42. package/dist/common/methods.d.ts +20 -0
  43. package/dist/common/methods.mjs +48 -0
  44. package/dist/common/propGroups.d.ts +1509 -0
  45. package/dist/common/propGroups.mjs +82 -0
  46. package/dist/common/types/fields.d.ts +18 -0
  47. package/dist/common/types/fields.mjs +1 -0
  48. package/dist/common/types/requestParams.d.ts +103 -0
  49. package/dist/common/types/requestParams.mjs +1 -0
  50. package/dist/common/types/responseSchemas.d.ts +42 -0
  51. package/dist/common/types/responseSchemas.mjs +1 -0
  52. package/dist/sources/common/base.d.ts +149 -0
  53. package/dist/sources/common/base.mjs +62 -0
  54. package/dist/sources/common/cacheUserId.d.ts +7 -0
  55. package/dist/sources/common/cacheUserId.mjs +18 -0
  56. package/dist/sources/common/getItemSummary.d.ts +4 -0
  57. package/dist/sources/common/getItemSummary.mjs +12 -0
  58. package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +650 -0
  59. package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +49 -0
  60. package/dist/sources/new-list-followed/new-list-followed.d.ts +649 -0
  61. package/dist/sources/new-list-followed/new-list-followed.mjs +50 -0
  62. package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +1021 -0
  63. package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +46 -0
  64. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +1023 -0
  65. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +49 -0
  66. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +1023 -0
  67. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +49 -0
  68. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +1021 -0
  69. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +51 -0
  70. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +273 -0
  71. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +75 -0
  72. package/dist/sources/new-user-followed/new-user-followed.d.ts +649 -0
  73. package/dist/sources/new-user-followed/new-user-followed.mjs +50 -0
  74. package/dist/tsconfig.tsbuildinfo +1 -0
  75. package/package.json +10 -14
  76. package/actions/add-user-to-list/add-user-to-list.mjs +0 -62
  77. package/actions/advanced-search/advanced-search.mjs +0 -113
  78. package/actions/common.mjs +0 -29
  79. package/actions/create-tweet/create-tweet.mjs +0 -146
  80. package/actions/delete-tweet/delete-tweet.mjs +0 -42
  81. package/actions/follow-user/follow-user.mjs +0 -48
  82. package/actions/get-tweet/get-tweet.mjs +0 -42
  83. package/actions/get-user/get-user.mjs +0 -50
  84. package/actions/like-tweet/like-tweet.mjs +0 -42
  85. package/actions/list-favorites/list-favorites.mjs +0 -63
  86. package/actions/list-followers/list-followers.mjs +0 -67
  87. package/actions/list-lists/list-lists.mjs +0 -69
  88. package/actions/list-mentions/list-mentions.mjs +0 -55
  89. package/actions/list-pending-followers/list-pending-followers.mjs +0 -32
  90. package/actions/list-retweets/list-retweets.mjs +0 -54
  91. package/actions/list-user-tweets/list-user-tweets.mjs +0 -80
  92. package/actions/retweet/retweet.mjs +0 -27
  93. package/actions/simple-search/simple-search.mjs +0 -62
  94. package/actions/simple-search-in-list/simple-search-in-list.mjs +0 -48
  95. package/actions/unfollow-user/unfollow-user.mjs +0 -48
  96. package/actions/unlike-tweet/unlike-tweet.mjs +0 -40
  97. package/actions/upload-media/upload-media.mjs +0 -122
  98. package/old.md +0 -169
  99. package/sources/common/followed.mjs +0 -38
  100. package/sources/common/followers.mjs +0 -159
  101. package/sources/common/tweets.mjs +0 -155
  102. package/sources/language-codes.mjs +0 -742
  103. package/sources/my-liked-tweets/my-liked-tweets.mjs +0 -30
  104. package/sources/my-tweets/my-tweets.mjs +0 -48
  105. package/sources/new-follower-of-me/new-follower-of-me.mjs +0 -69
  106. package/sources/new-follower-of-user/new-follower-of-user.mjs +0 -25
  107. package/sources/new-list-followed/new-list-followed.mjs +0 -24
  108. package/sources/new-trends-by-geo/new-trends-by-geo.mjs +0 -40
  109. package/sources/new-tweet-in-list/new-tweet-in-list.mjs +0 -49
  110. package/sources/new-unfollower-of-me/new-unfollower-of-me.mjs +0 -16
  111. package/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +0 -25
  112. package/sources/new-user-followed/new-user-followed.mjs +0 -25
  113. package/sources/search-mentions/search-mentions.mjs +0 -144
  114. package/sources/tweets-liked-by-user/tweets-liked-by-user.mjs +0 -38
  115. package/sources/user-tweets/user-tweets.mjs +0 -49
  116. package/sources/watch-retweets-of-me/watch-retweets-of-me.mjs +0 -36
  117. package/sources/watch-retweets-of-my-tweet/watch-retweets-of-my-tweet.mjs +0 -44
  118. package/sources/watch-retweets-of-user-tweet/watch-retweets-of-user-tweet.mjs +0 -34
  119. package/twitter.app.mjs +0 -1161
@@ -0,0 +1,255 @@
1
+ import { getUserId } from "../../common/methods.js";
2
+ import { FollowUserParams } from "../../common/types/requestParams.js";
3
+ declare const _default: import("@pipedream/types").Action<{
4
+ getUserId: typeof getUserId;
5
+ }, {
6
+ app: import("@pipedream/types").App<{
7
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
8
+ _getBaseUrl(): "https://api.twitter.com/2";
9
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
10
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
11
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
12
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
13
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
14
+ followUser(args: FollowUserParams): Promise<object>;
15
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
16
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
17
+ getAuthenticatedUserId(): Promise<string>;
18
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
19
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
20
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
21
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
22
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
23
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
24
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
25
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
26
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
27
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
28
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
29
+ searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
30
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
31
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
32
+ }, {
33
+ maxResults: {
34
+ type: string;
35
+ label: string;
36
+ description: string;
37
+ optional: boolean;
38
+ };
39
+ listId: {
40
+ type: string;
41
+ label: string;
42
+ description: string;
43
+ options(): Promise<{
44
+ label: string;
45
+ value: string;
46
+ }[]>;
47
+ };
48
+ userNameOrId: {
49
+ type: string;
50
+ label: string;
51
+ description: string;
52
+ optional: boolean;
53
+ default: string;
54
+ };
55
+ tweetId: {
56
+ type: string;
57
+ label: string;
58
+ description: string;
59
+ };
60
+ query: {
61
+ type: string;
62
+ label: string;
63
+ description: string;
64
+ };
65
+ listExpansions: {
66
+ type: string;
67
+ label: string;
68
+ optional: boolean;
69
+ description: string;
70
+ options: string[];
71
+ };
72
+ tweetExpansions: {
73
+ type: string;
74
+ label: string;
75
+ optional: boolean;
76
+ description: string;
77
+ options: string[];
78
+ };
79
+ userExpansions: {
80
+ type: string;
81
+ label: string;
82
+ optional: boolean;
83
+ description: string;
84
+ options: string[];
85
+ };
86
+ listFields: {
87
+ type: string;
88
+ label: string;
89
+ description: string;
90
+ optional: boolean;
91
+ options: string[];
92
+ };
93
+ mediaFields: {
94
+ type: string;
95
+ label: string;
96
+ description: string;
97
+ optional: boolean;
98
+ options: string[];
99
+ };
100
+ placeFields: {
101
+ type: string;
102
+ label: string;
103
+ description: string;
104
+ optional: boolean;
105
+ options: string[];
106
+ };
107
+ pollFields: {
108
+ type: string;
109
+ label: string;
110
+ description: string;
111
+ optional: boolean;
112
+ options: string[];
113
+ };
114
+ tweetFields: {
115
+ type: string;
116
+ label: string;
117
+ description: string;
118
+ optional: boolean;
119
+ options: string[];
120
+ };
121
+ userFields: {
122
+ type: string;
123
+ label: string;
124
+ description: string;
125
+ optional: boolean;
126
+ options: string[];
127
+ };
128
+ }>;
129
+ userNameOrId: {
130
+ propDefinition: (string | import("@pipedream/types").App<{
131
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
132
+ _getBaseUrl(): "https://api.twitter.com/2";
133
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
134
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
135
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
136
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
137
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
138
+ followUser(args: FollowUserParams): Promise<object>;
139
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
140
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
141
+ getAuthenticatedUserId(): Promise<string>;
142
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
143
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
144
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
145
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
146
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
147
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
148
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
149
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
150
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
151
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
152
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
153
+ searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
154
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
155
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
156
+ }, {
157
+ maxResults: {
158
+ type: string;
159
+ label: string;
160
+ description: string;
161
+ optional: boolean;
162
+ };
163
+ listId: {
164
+ type: string;
165
+ label: string;
166
+ description: string;
167
+ options(): Promise<{
168
+ label: string;
169
+ value: string;
170
+ }[]>;
171
+ };
172
+ userNameOrId: {
173
+ type: string;
174
+ label: string;
175
+ description: string;
176
+ optional: boolean;
177
+ default: string;
178
+ };
179
+ tweetId: {
180
+ type: string;
181
+ label: string;
182
+ description: string;
183
+ };
184
+ query: {
185
+ type: string;
186
+ label: string;
187
+ description: string;
188
+ };
189
+ listExpansions: {
190
+ type: string;
191
+ label: string;
192
+ optional: boolean;
193
+ description: string;
194
+ options: string[];
195
+ };
196
+ tweetExpansions: {
197
+ type: string;
198
+ label: string;
199
+ optional: boolean;
200
+ description: string;
201
+ options: string[];
202
+ };
203
+ userExpansions: {
204
+ type: string;
205
+ label: string;
206
+ optional: boolean;
207
+ description: string;
208
+ options: string[];
209
+ };
210
+ listFields: {
211
+ type: string;
212
+ label: string;
213
+ description: string;
214
+ optional: boolean;
215
+ options: string[];
216
+ };
217
+ mediaFields: {
218
+ type: string;
219
+ label: string;
220
+ description: string;
221
+ optional: boolean;
222
+ options: string[];
223
+ };
224
+ placeFields: {
225
+ type: string;
226
+ label: string;
227
+ description: string;
228
+ optional: boolean;
229
+ options: string[];
230
+ };
231
+ pollFields: {
232
+ type: string;
233
+ label: string;
234
+ description: string;
235
+ optional: boolean;
236
+ options: string[];
237
+ };
238
+ tweetFields: {
239
+ type: string;
240
+ label: string;
241
+ description: string;
242
+ optional: boolean;
243
+ options: string[];
244
+ };
245
+ userFields: {
246
+ type: string;
247
+ label: string;
248
+ description: string;
249
+ optional: boolean;
250
+ options: string[];
251
+ };
252
+ }>)[];
253
+ };
254
+ }>;
255
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import app from "../../app/twitter.app.mjs";
2
+ import { defineAction } from "@pipedream/types";
3
+ import { getUserId } from "../../common/methods.mjs";
4
+ const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following";
5
+ export default defineAction({
6
+ key: "twitter-follow-user",
7
+ name: "Follow User",
8
+ description: `Follow a user. [See docs here](${DOCS_LINK})`,
9
+ version: "1.0.0",
10
+ type: "action",
11
+ props: {
12
+ app,
13
+ userNameOrId: {
14
+ propDefinition: [
15
+ app,
16
+ "userNameOrId",
17
+ ],
18
+ },
19
+ },
20
+ methods: {
21
+ getUserId,
22
+ },
23
+ async run({ $ }) {
24
+ const userId = await this.getUserId();
25
+ const params = {
26
+ $,
27
+ data: {
28
+ target_user_id: userId,
29
+ },
30
+ };
31
+ const response = await this.app.followUser(params);
32
+ $.export("$summary", `Successfully ${response.following
33
+ ? "followed"
34
+ : "requested to follow"} user`);
35
+ return response;
36
+ },
37
+ });