@pipedream/twitter 0.3.11 → 1.1.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 +18 -71
  2. package/dist/actions/add-user-to-list/add-user-to-list.d.ts +194 -0
  3. package/dist/actions/add-user-to-list/add-user-to-list.mjs +44 -0
  4. package/dist/actions/create-tweet/create-tweet.d.ts +101 -0
  5. package/dist/actions/create-tweet/create-tweet.mjs +78 -0
  6. package/dist/actions/delete-tweet/delete-tweet.d.ts +128 -0
  7. package/dist/actions/delete-tweet/delete-tweet.mjs +29 -0
  8. package/dist/actions/follow-user/follow-user.d.ts +131 -0
  9. package/dist/actions/follow-user/follow-user.mjs +37 -0
  10. package/dist/actions/get-tweet/get-tweet.d.ts +132 -0
  11. package/dist/actions/get-tweet/get-tweet.mjs +34 -0
  12. package/dist/actions/get-user/get-user.d.ts +133 -0
  13. package/dist/actions/get-user/get-user.mjs +40 -0
  14. package/dist/actions/like-tweet/like-tweet.d.ts +128 -0
  15. package/dist/actions/like-tweet/like-tweet.mjs +31 -0
  16. package/dist/actions/list-favorites/list-favorites.d.ts +202 -0
  17. package/dist/actions/list-favorites/list-favorites.mjs +50 -0
  18. package/dist/actions/list-followers/list-followers.d.ts +202 -0
  19. package/dist/actions/list-followers/list-followers.mjs +50 -0
  20. package/dist/actions/list-lists/list-lists.d.ts +200 -0
  21. package/dist/actions/list-lists/list-lists.mjs +50 -0
  22. package/dist/actions/list-mentions/list-mentions.d.ts +200 -0
  23. package/dist/actions/list-mentions/list-mentions.mjs +50 -0
  24. package/dist/actions/list-user-tweets/list-user-tweets.d.ts +202 -0
  25. package/dist/actions/list-user-tweets/list-user-tweets.mjs +50 -0
  26. package/dist/actions/retweet/retweet.d.ts +128 -0
  27. package/dist/actions/retweet/retweet.mjs +34 -0
  28. package/dist/actions/simple-search/simple-search.d.ts +201 -0
  29. package/dist/actions/simple-search/simple-search.mjs +50 -0
  30. package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +206 -0
  31. package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +58 -0
  32. package/dist/actions/unfollow-user/unfollow-user.d.ts +131 -0
  33. package/dist/actions/unfollow-user/unfollow-user.mjs +33 -0
  34. package/dist/actions/unlike-tweet/unlike-tweet.d.ts +128 -0
  35. package/dist/actions/unlike-tweet/unlike-tweet.mjs +29 -0
  36. package/dist/app/twitter.app.d.ts +65 -0
  37. package/dist/app/twitter.app.mjs +291 -0
  38. package/dist/common/additionalProps.d.ts +0 -0
  39. package/dist/common/additionalProps.mjs +138 -0
  40. package/dist/common/dataFields.d.ts +6 -0
  41. package/dist/common/dataFields.mjs +80 -0
  42. package/dist/common/expansions.d.ts +3 -0
  43. package/dist/common/expansions.mjs +17 -0
  44. package/dist/common/methods.d.ts +20 -0
  45. package/dist/common/methods.mjs +69 -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 +105 -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 +87 -0
  53. package/dist/sources/common/base.mjs +60 -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 +149 -0
  59. package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +45 -0
  60. package/dist/sources/new-list-followed/new-list-followed.d.ts +149 -0
  61. package/dist/sources/new-list-followed/new-list-followed.mjs +46 -0
  62. package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +147 -0
  63. package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +42 -0
  64. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +149 -0
  65. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +45 -0
  66. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +149 -0
  67. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +45 -0
  68. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +147 -0
  69. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +44 -0
  70. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +149 -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 +148 -0
  73. package/dist/sources/new-user-followed/new-user-followed.mjs +46 -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,128 @@
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
+ getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
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 }: import("../../common/types/requestParams.js").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
+ }>;
63
+ tweetId: {
64
+ propDefinition: (string | import("@pipedream/types").App<{
65
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
66
+ _getBaseUrl(): "https://api.twitter.com/2";
67
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
68
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
69
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
70
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
71
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
72
+ followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
73
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
74
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
75
+ getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
76
+ getAuthenticatedUserId(): Promise<string>;
77
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
78
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
79
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
80
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
81
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
82
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
83
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
84
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
85
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
86
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
87
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
88
+ searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
89
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
90
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
91
+ }, {
92
+ maxResults: {
93
+ type: string;
94
+ label: string;
95
+ description: string;
96
+ optional: boolean;
97
+ };
98
+ listId: {
99
+ type: string;
100
+ label: string;
101
+ description: string;
102
+ options(): Promise<{
103
+ label: string;
104
+ value: string;
105
+ }[]>;
106
+ };
107
+ userNameOrId: {
108
+ type: string;
109
+ label: string;
110
+ description: string;
111
+ optional: boolean;
112
+ default: string;
113
+ };
114
+ tweetId: {
115
+ type: string;
116
+ label: string;
117
+ description: string;
118
+ };
119
+ query: {
120
+ type: string;
121
+ label: string;
122
+ description: string;
123
+ };
124
+ }>)[];
125
+ description: string;
126
+ };
127
+ }>;
128
+ export default _default;
@@ -0,0 +1,34 @@
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.1",
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 { tweetId } = this;
22
+ const params = {
23
+ $,
24
+ data: {
25
+ tweet_id: tweetId,
26
+ },
27
+ };
28
+ const response = await this.app.retweet(params);
29
+ $.export("$summary", response.data?.retweeted !== true
30
+ ? "Retweet failed"
31
+ : "Tweet successfully retweeted");
32
+ return response;
33
+ },
34
+ });
@@ -0,0 +1,201 @@
1
+ import { getMultiItemSummary, getTweetFields } from "../../common/methods.js";
2
+ import { SearchTweetsParams } from "../../common/types/requestParams.js";
3
+ import { PaginatedResponseObject, Tweet } from "../../common/types/responseSchemas.js";
4
+ export declare const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent";
5
+ export declare const MAX_RESULTS_PER_PAGE = 100;
6
+ declare const _default: import("@pipedream/types").Action<{
7
+ getMultiItemSummary: typeof getMultiItemSummary;
8
+ getTweetFields: typeof getTweetFields;
9
+ }, {
10
+ app: import("@pipedream/types").App<{
11
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
12
+ _getBaseUrl(): "https://api.twitter.com/2";
13
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
14
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
15
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
16
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
17
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
18
+ followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
19
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
20
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<Tweet>>;
21
+ getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
22
+ getAuthenticatedUserId(): Promise<string>;
23
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<PaginatedResponseObject<Tweet>>;
24
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
25
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
26
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<PaginatedResponseObject<Tweet>>;
27
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
28
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
29
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
30
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
31
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
32
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
33
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
34
+ searchTweets(args: SearchTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
35
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
36
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
37
+ }, {
38
+ maxResults: {
39
+ type: string;
40
+ label: string;
41
+ description: string;
42
+ optional: boolean;
43
+ };
44
+ listId: {
45
+ type: string;
46
+ label: string;
47
+ description: string;
48
+ options(): Promise<{
49
+ label: string;
50
+ value: string;
51
+ }[]>;
52
+ };
53
+ userNameOrId: {
54
+ type: string;
55
+ label: string;
56
+ description: string;
57
+ optional: boolean;
58
+ default: string;
59
+ };
60
+ tweetId: {
61
+ type: string;
62
+ label: string;
63
+ description: string;
64
+ };
65
+ query: {
66
+ type: string;
67
+ label: string;
68
+ description: string;
69
+ };
70
+ }>;
71
+ query: {
72
+ propDefinition: (string | import("@pipedream/types").App<{
73
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
74
+ _getBaseUrl(): "https://api.twitter.com/2";
75
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
76
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
77
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
78
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
79
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
80
+ followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
81
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
82
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<Tweet>>;
83
+ getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
84
+ getAuthenticatedUserId(): Promise<string>;
85
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<PaginatedResponseObject<Tweet>>;
86
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
87
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
88
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<PaginatedResponseObject<Tweet>>;
89
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
90
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
91
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
92
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
93
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
94
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
95
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
96
+ searchTweets(args: SearchTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
97
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
98
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
99
+ }, {
100
+ maxResults: {
101
+ type: string;
102
+ label: string;
103
+ description: string;
104
+ optional: boolean;
105
+ };
106
+ listId: {
107
+ type: string;
108
+ label: string;
109
+ description: string;
110
+ options(): Promise<{
111
+ label: string;
112
+ value: string;
113
+ }[]>;
114
+ };
115
+ userNameOrId: {
116
+ type: string;
117
+ label: string;
118
+ description: string;
119
+ optional: boolean;
120
+ default: string;
121
+ };
122
+ tweetId: {
123
+ type: string;
124
+ label: string;
125
+ description: string;
126
+ };
127
+ query: {
128
+ type: string;
129
+ label: string;
130
+ description: string;
131
+ };
132
+ }>)[];
133
+ };
134
+ maxResults: {
135
+ propDefinition: (string | import("@pipedream/types").App<{
136
+ _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
137
+ _getBaseUrl(): "https://api.twitter.com/2";
138
+ _httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
139
+ _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
140
+ addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
141
+ createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
142
+ deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
143
+ followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
144
+ getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
145
+ getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<Tweet>>;
146
+ getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
147
+ getAuthenticatedUserId(): Promise<string>;
148
+ getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<PaginatedResponseObject<Tweet>>;
149
+ getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
150
+ getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
151
+ getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<PaginatedResponseObject<Tweet>>;
152
+ getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
153
+ getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
154
+ getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
155
+ likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
156
+ getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
157
+ getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
158
+ retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
159
+ searchTweets(args: SearchTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
160
+ unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
161
+ unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
162
+ }, {
163
+ maxResults: {
164
+ type: string;
165
+ label: string;
166
+ description: string;
167
+ optional: boolean;
168
+ };
169
+ listId: {
170
+ type: string;
171
+ label: string;
172
+ description: string;
173
+ options(): Promise<{
174
+ label: string;
175
+ value: string;
176
+ }[]>;
177
+ };
178
+ userNameOrId: {
179
+ type: string;
180
+ label: string;
181
+ description: string;
182
+ optional: boolean;
183
+ default: string;
184
+ };
185
+ tweetId: {
186
+ type: string;
187
+ label: string;
188
+ description: string;
189
+ };
190
+ query: {
191
+ type: string;
192
+ label: string;
193
+ description: string;
194
+ };
195
+ }>)[];
196
+ min: number;
197
+ max: number;
198
+ default: number;
199
+ };
200
+ }>;
201
+ export default _default;
@@ -0,0 +1,50 @@
1
+ import app from "../../app/twitter.app.mjs";
2
+ import { defineAction } from "@pipedream/types";
3
+ import { getMultiItemSummary, getTweetFields, } from "../../common/methods.mjs";
4
+ export const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent";
5
+ const MIN_RESULTS = 10;
6
+ const DEFAULT_RESULTS = 10;
7
+ export const MAX_RESULTS_PER_PAGE = 100;
8
+ export default defineAction({
9
+ key: "twitter-simple-search",
10
+ name: "Search Tweets",
11
+ description: `Retrieve Tweets from the last seven days that match a query. [See docs here](${DOCS_LINK})`,
12
+ version: "1.1.0",
13
+ type: "action",
14
+ props: {
15
+ app,
16
+ query: {
17
+ propDefinition: [
18
+ app,
19
+ "query",
20
+ ],
21
+ },
22
+ maxResults: {
23
+ propDefinition: [
24
+ app,
25
+ "maxResults",
26
+ ],
27
+ min: MIN_RESULTS,
28
+ max: MAX_RESULTS_PER_PAGE * 5,
29
+ default: DEFAULT_RESULTS,
30
+ },
31
+ },
32
+ methods: {
33
+ getMultiItemSummary,
34
+ getTweetFields,
35
+ },
36
+ async run({ $ }) {
37
+ const params = {
38
+ $,
39
+ maxPerPage: MAX_RESULTS_PER_PAGE,
40
+ maxResults: this.maxResults,
41
+ params: {
42
+ query: this.query,
43
+ ...this.getTweetFields(),
44
+ },
45
+ };
46
+ const response = await this.app.searchTweets(params);
47
+ $.export("$summary", this.getMultiItemSummary("tweet", response.data?.length));
48
+ return response;
49
+ },
50
+ });