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