@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,52 @@
1
+ import app from "../../app/twitter.app.mjs";
2
+ import { defineAction } from "@pipedream/types";
3
+ import { getMultiItemSummary, getUserId, getTweetFields, } from "../../common/methods.mjs";
4
+ import { tweetFieldProps } from "../../common/propGroups.mjs";
5
+ export const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets";
6
+ const MIN_RESULTS = 5;
7
+ const DEFAULT_RESULTS = 10;
8
+ export const MAX_RESULTS_PER_PAGE = 100;
9
+ export default defineAction({
10
+ key: "twitter-list-user-tweets",
11
+ name: "List User Tweets",
12
+ description: `Return a collection of the most recent tweets posted by a user. [See docs here](${DOCS_LINK})`,
13
+ version: "1.0.0",
14
+ type: "action",
15
+ props: {
16
+ app,
17
+ userNameOrId: {
18
+ propDefinition: [
19
+ app,
20
+ "userNameOrId",
21
+ ],
22
+ },
23
+ ...tweetFieldProps,
24
+ maxResults: {
25
+ propDefinition: [
26
+ app,
27
+ "maxResults",
28
+ ],
29
+ min: MIN_RESULTS,
30
+ max: MAX_RESULTS_PER_PAGE * 5,
31
+ default: DEFAULT_RESULTS,
32
+ },
33
+ },
34
+ methods: {
35
+ getMultiItemSummary,
36
+ getUserId,
37
+ getTweetFields,
38
+ },
39
+ async run({ $ }) {
40
+ const userId = await this.getUserId();
41
+ const params = {
42
+ $,
43
+ maxPerPage: MAX_RESULTS_PER_PAGE,
44
+ maxResults: this.maxResults,
45
+ params: this.getTweetFields(),
46
+ userId,
47
+ };
48
+ const response = await this.app.getUserTweets(params);
49
+ $.export("$summary", this.getMultiItemSummary("tweet", response.data?.length));
50
+ return response;
51
+ },
52
+ });
@@ -0,0 +1,252 @@
1
+ declare const _default: import("@pipedream/types").Action<unknown, {
2
+ app: import("@pipedream/types").App<{
3
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
4
+ _getBaseUrl(): "https://api.twitter.com/2";
5
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
6
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
7
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
8
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
9
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
10
+ followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
11
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
12
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
13
+ getAuthenticatedUserId(): Promise<string>;
14
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
15
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
16
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
17
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
18
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
19
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
20
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
21
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
22
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
23
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
24
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
25
+ searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
26
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
27
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
28
+ }, {
29
+ maxResults: {
30
+ type: string;
31
+ label: string;
32
+ description: string;
33
+ optional: boolean;
34
+ };
35
+ listId: {
36
+ type: string;
37
+ label: string;
38
+ description: string;
39
+ options(): Promise<{
40
+ label: string;
41
+ value: string;
42
+ }[]>;
43
+ };
44
+ userNameOrId: {
45
+ type: string;
46
+ label: string;
47
+ description: string;
48
+ optional: boolean;
49
+ default: string;
50
+ };
51
+ tweetId: {
52
+ type: string;
53
+ label: string;
54
+ description: string;
55
+ };
56
+ query: {
57
+ type: string;
58
+ label: string;
59
+ description: string;
60
+ };
61
+ listExpansions: {
62
+ type: string;
63
+ label: string;
64
+ optional: boolean;
65
+ description: string;
66
+ options: string[];
67
+ };
68
+ tweetExpansions: {
69
+ type: string;
70
+ label: string;
71
+ optional: boolean;
72
+ description: string;
73
+ options: string[];
74
+ };
75
+ userExpansions: {
76
+ type: string;
77
+ label: string;
78
+ optional: boolean;
79
+ description: string;
80
+ options: string[];
81
+ };
82
+ listFields: {
83
+ type: string;
84
+ label: string;
85
+ description: string;
86
+ optional: boolean;
87
+ options: string[];
88
+ };
89
+ mediaFields: {
90
+ type: string;
91
+ label: string;
92
+ description: string;
93
+ optional: boolean;
94
+ options: string[];
95
+ };
96
+ placeFields: {
97
+ type: string;
98
+ label: string;
99
+ description: string;
100
+ optional: boolean;
101
+ options: string[];
102
+ };
103
+ pollFields: {
104
+ type: string;
105
+ label: string;
106
+ description: string;
107
+ optional: boolean;
108
+ options: string[];
109
+ };
110
+ tweetFields: {
111
+ type: string;
112
+ label: string;
113
+ description: string;
114
+ optional: boolean;
115
+ options: string[];
116
+ };
117
+ userFields: {
118
+ type: string;
119
+ label: string;
120
+ description: string;
121
+ optional: boolean;
122
+ options: string[];
123
+ };
124
+ }>;
125
+ tweetId: {
126
+ propDefinition: (string | import("@pipedream/types").App<{
127
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
128
+ _getBaseUrl(): "https://api.twitter.com/2";
129
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
130
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
131
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
132
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
133
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
134
+ followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
135
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
136
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
137
+ getAuthenticatedUserId(): Promise<string>;
138
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
139
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
140
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
141
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
142
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
143
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
144
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
145
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
146
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
147
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
148
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
149
+ searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
150
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
151
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
152
+ }, {
153
+ maxResults: {
154
+ type: string;
155
+ label: string;
156
+ description: string;
157
+ optional: boolean;
158
+ };
159
+ listId: {
160
+ type: string;
161
+ label: string;
162
+ description: string;
163
+ options(): Promise<{
164
+ label: string;
165
+ value: string;
166
+ }[]>;
167
+ };
168
+ userNameOrId: {
169
+ type: string;
170
+ label: string;
171
+ description: string;
172
+ optional: boolean;
173
+ default: string;
174
+ };
175
+ tweetId: {
176
+ type: string;
177
+ label: string;
178
+ description: string;
179
+ };
180
+ query: {
181
+ type: string;
182
+ label: string;
183
+ description: string;
184
+ };
185
+ listExpansions: {
186
+ type: string;
187
+ label: string;
188
+ optional: boolean;
189
+ description: string;
190
+ options: string[];
191
+ };
192
+ tweetExpansions: {
193
+ type: string;
194
+ label: string;
195
+ optional: boolean;
196
+ description: string;
197
+ options: string[];
198
+ };
199
+ userExpansions: {
200
+ type: string;
201
+ label: string;
202
+ optional: boolean;
203
+ description: string;
204
+ options: string[];
205
+ };
206
+ listFields: {
207
+ type: string;
208
+ label: string;
209
+ description: string;
210
+ optional: boolean;
211
+ options: string[];
212
+ };
213
+ mediaFields: {
214
+ type: string;
215
+ label: string;
216
+ description: string;
217
+ optional: boolean;
218
+ options: string[];
219
+ };
220
+ placeFields: {
221
+ type: string;
222
+ label: string;
223
+ description: string;
224
+ optional: boolean;
225
+ options: string[];
226
+ };
227
+ pollFields: {
228
+ type: string;
229
+ label: string;
230
+ description: string;
231
+ optional: boolean;
232
+ options: string[];
233
+ };
234
+ tweetFields: {
235
+ type: string;
236
+ label: string;
237
+ description: string;
238
+ optional: boolean;
239
+ options: string[];
240
+ };
241
+ userFields: {
242
+ type: string;
243
+ label: string;
244
+ description: string;
245
+ optional: boolean;
246
+ options: string[];
247
+ };
248
+ }>)[];
249
+ description: string;
250
+ };
251
+ }>;
252
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import app from "../../app/twitter.app.mjs";
2
+ import { defineAction } from "@pipedream/types";
3
+ const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets";
4
+ export default defineAction({
5
+ key: "twitter-retweet",
6
+ name: "Retweet a tweet",
7
+ description: `Retweet a tweet specified by ID. [See docs here](${DOCS_LINK})`,
8
+ version: "1.0.0",
9
+ type: "action",
10
+ props: {
11
+ app,
12
+ tweetId: {
13
+ propDefinition: [
14
+ app,
15
+ "tweetId",
16
+ ],
17
+ description: "The ID of the tweet you'd like to retweet",
18
+ },
19
+ },
20
+ async run({ $ }) {
21
+ const params = {
22
+ $,
23
+ data: {
24
+ tweet_id: this.tweetId,
25
+ },
26
+ };
27
+ const response = await this.app.retweet(params);
28
+ $.export("$summary", "Tweet successfully retweeted");
29
+ return response;
30
+ },
31
+ });