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