@pipedream/twitter 2.1.2 → 2.2.1

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 (71) hide show
  1. package/dist/actions/add-user-to-list/add-user-to-list.d.ts +2 -199
  2. package/dist/actions/add-user-to-list/add-user-to-list.mjs +21 -24
  3. package/dist/actions/create-tweet/create-tweet.d.ts +17 -16
  4. package/dist/actions/create-tweet/create-tweet.mjs +29 -34
  5. package/dist/actions/delete-tweet/delete-tweet.d.ts +3 -133
  6. package/dist/actions/delete-tweet/delete-tweet.mjs +14 -18
  7. package/dist/actions/follow-user/follow-user.d.ts +2 -133
  8. package/dist/actions/follow-user/follow-user.mjs +19 -22
  9. package/dist/actions/get-tweet/get-tweet.d.ts +2 -134
  10. package/dist/actions/get-tweet/get-tweet.mjs +16 -19
  11. package/dist/actions/get-user/get-user.d.ts +2 -134
  12. package/dist/actions/get-user/get-user.mjs +19 -22
  13. package/dist/actions/like-tweet/like-tweet.d.ts +3 -133
  14. package/dist/actions/like-tweet/like-tweet.mjs +16 -20
  15. package/dist/actions/list-favorites/list-favorites.d.ts +2 -203
  16. package/dist/actions/list-favorites/list-favorites.mjs +19 -22
  17. package/dist/actions/list-followers/list-followers.d.ts +2 -203
  18. package/dist/actions/list-followers/list-followers.mjs +19 -22
  19. package/dist/actions/list-lists/list-lists.d.ts +2 -203
  20. package/dist/actions/list-lists/list-lists.mjs +19 -22
  21. package/dist/actions/list-mentions/list-mentions.d.ts +4 -203
  22. package/dist/actions/list-mentions/list-mentions.mjs +21 -24
  23. package/dist/actions/list-user-tweets/list-user-tweets.d.ts +2 -203
  24. package/dist/actions/list-user-tweets/list-user-tweets.mjs +19 -22
  25. package/dist/actions/retweet/retweet.d.ts +3 -133
  26. package/dist/actions/retweet/retweet.mjs +18 -22
  27. package/dist/actions/send-dm/send-dm.d.ts +2 -140
  28. package/dist/actions/send-dm/send-dm.mjs +18 -21
  29. package/dist/actions/simple-search/simple-search.d.ts +2 -203
  30. package/dist/actions/simple-search/simple-search.mjs +20 -23
  31. package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +2 -208
  32. package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +23 -26
  33. package/dist/actions/unfollow-user/unfollow-user.d.ts +2 -133
  34. package/dist/actions/unfollow-user/unfollow-user.mjs +15 -18
  35. package/dist/actions/unlike-tweet/unlike-tweet.d.ts +3 -133
  36. package/dist/actions/unlike-tweet/unlike-tweet.mjs +14 -18
  37. package/dist/actions/upload-media/upload-media.d.ts +3 -82
  38. package/dist/actions/upload-media/upload-media.mjs +24 -21
  39. package/dist/app/twitter.app.d.ts +2 -1
  40. package/dist/app/twitter.app.mjs +40 -29
  41. package/dist/common/appValidation.d.ts +144 -0
  42. package/dist/common/appValidation.mjs +24 -0
  43. package/dist/common/errorMessage.d.ts +24 -2
  44. package/dist/common/errorMessage.mjs +25 -1
  45. package/dist/common/types/requestParams.d.ts +26 -22
  46. package/dist/sources/common/base.d.ts +137 -64
  47. package/dist/sources/common/base.mjs +8 -2
  48. package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +2 -140
  49. package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +2 -3
  50. package/dist/sources/new-list-followed/new-list-followed.d.ts +2 -140
  51. package/dist/sources/new-list-followed/new-list-followed.mjs +2 -3
  52. package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.d.ts +17 -0
  53. package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.mjs +44 -0
  54. package/dist/sources/new-message/new-message.d.ts +2 -74
  55. package/dist/sources/new-message/new-message.mjs +1 -1
  56. package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +2 -140
  57. package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +2 -3
  58. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +2 -140
  59. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +2 -3
  60. package/dist/sources/new-tweet-metrics/new-tweet-metrics.d.ts +3 -148
  61. package/dist/sources/new-tweet-metrics/new-tweet-metrics.mjs +2 -3
  62. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +2 -140
  63. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +2 -3
  64. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +2 -140
  65. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +2 -3
  66. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +2 -140
  67. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +2 -3
  68. package/dist/sources/new-user-followed/new-user-followed.d.ts +2 -139
  69. package/dist/sources/new-user-followed/new-user-followed.mjs +2 -3
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/package.json +1 -1
@@ -1,36 +1,32 @@
1
- import app from "../../app/twitter.app.mjs";
1
+ import common from "../../common/appValidation.mjs";
2
2
  import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
3
3
  import { defineAction } from "@pipedream/types";
4
4
  const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/delete-tweets-id";
5
5
  export default defineAction({
6
+ ...common,
6
7
  key: "twitter-delete-tweet",
7
8
  name: "Delete Tweet",
8
9
  description: `Remove a posted tweet. [See the documentation](${DOCS_LINK})`,
9
- version: "2.0.3",
10
+ version: "2.0.4",
10
11
  type: "action",
11
12
  props: {
12
- app,
13
+ ...common.props,
13
14
  tweetId: {
14
15
  propDefinition: [
15
- app,
16
+ common.props.app,
16
17
  "tweetId",
17
18
  ],
18
19
  },
19
20
  },
20
21
  async run({ $ }) {
21
- try {
22
- const { tweetId } = this;
23
- const params = {
24
- $,
25
- tweetId,
26
- };
27
- const response = await this.app.deleteTweet(params);
28
- $.export("$summary", `Successfully deleted tweet (ID ${tweetId})`);
29
- return response;
30
- }
31
- catch (err) {
32
- $.export("error", err);
33
- throw new Error(ACTION_ERROR_MESSAGE);
34
- }
22
+ const { tweetId } = this;
23
+ const params = {
24
+ $,
25
+ tweetId,
26
+ fallbackError: ACTION_ERROR_MESSAGE,
27
+ };
28
+ const response = await this.app.deleteTweet(params);
29
+ $.export("$summary", `Successfully deleted tweet (ID ${tweetId})`);
30
+ return response;
35
31
  },
36
32
  });
@@ -1,137 +1,6 @@
1
1
  import { getUserId } from "../../common/methods.js";
2
- import { FollowUserParams } from "../../common/types/requestParams.js";
3
2
  declare const _default: import("@pipedream/types").Action<{
4
3
  getUserId: typeof getUserId;
5
- }, {
6
- app: import("@pipedream/types").App<{
7
- _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
8
- _getBaseUrl(): "https://api.twitter.com/2";
9
- _httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
10
- _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
11
- addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
12
- createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
13
- deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
14
- followUser(args: FollowUserParams): Promise<object>;
15
- getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
16
- getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
17
- getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
18
- getAuthenticatedUserId(): Promise<string>;
19
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
20
- getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
21
- getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
22
- getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
23
- getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
24
- getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
25
- getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
26
- getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
27
- likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
28
- getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
29
- getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
30
- retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
31
- searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
32
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
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
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
36
- }, {
37
- maxResults: {
38
- type: string;
39
- label: string;
40
- description: string;
41
- optional: boolean;
42
- };
43
- listId: {
44
- type: string;
45
- label: string;
46
- description: string;
47
- options(): Promise<{
48
- label: string;
49
- value: string;
50
- }[]>;
51
- };
52
- userNameOrId: {
53
- type: string;
54
- label: string;
55
- description: string;
56
- optional: boolean;
57
- default: string;
58
- };
59
- tweetId: {
60
- type: string;
61
- label: string;
62
- description: string;
63
- };
64
- query: {
65
- type: string;
66
- label: string;
67
- description: string;
68
- };
69
- }>;
70
- userNameOrId: {
71
- propDefinition: (string | import("@pipedream/types").App<{
72
- _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
73
- _getBaseUrl(): "https://api.twitter.com/2";
74
- _httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
75
- _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
76
- addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
77
- createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
78
- deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
79
- followUser(args: FollowUserParams): Promise<object>;
80
- getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
81
- getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
82
- getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
83
- getAuthenticatedUserId(): Promise<string>;
84
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
85
- getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
86
- getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
87
- getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
88
- getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
89
- getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").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<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
94
- getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
95
- retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
96
- searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
97
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
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
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
101
- }, {
102
- maxResults: {
103
- type: string;
104
- label: string;
105
- description: string;
106
- optional: boolean;
107
- };
108
- listId: {
109
- type: string;
110
- label: string;
111
- description: string;
112
- options(): Promise<{
113
- label: string;
114
- value: string;
115
- }[]>;
116
- };
117
- userNameOrId: {
118
- type: string;
119
- label: string;
120
- description: string;
121
- optional: boolean;
122
- default: string;
123
- };
124
- tweetId: {
125
- type: string;
126
- label: string;
127
- description: string;
128
- };
129
- query: {
130
- type: string;
131
- label: string;
132
- description: string;
133
- };
134
- }>)[];
135
- };
136
- }>;
4
+ getTweets(args?: {}): any;
5
+ }, any>;
137
6
  export default _default;
@@ -1,44 +1,41 @@
1
- import app from "../../app/twitter.app.mjs";
1
+ import common from "../../common/appValidation.mjs";
2
2
  import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
3
3
  import { defineAction } from "@pipedream/types";
4
4
  import { getUserId } from "../../common/methods.mjs";
5
5
  const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following";
6
6
  export default defineAction({
7
+ ...common,
7
8
  key: "twitter-follow-user",
8
9
  name: "Follow User",
9
10
  description: `Follow a user. [See the documentation](${DOCS_LINK})`,
10
- version: "2.0.3",
11
+ version: "2.0.4",
11
12
  type: "action",
12
13
  props: {
13
- app,
14
+ ...common.props,
14
15
  userNameOrId: {
15
16
  propDefinition: [
16
- app,
17
+ common.props.app,
17
18
  "userNameOrId",
18
19
  ],
19
20
  },
20
21
  },
21
22
  methods: {
23
+ ...common.methods,
22
24
  getUserId,
23
25
  },
24
26
  async run({ $ }) {
25
- try {
26
- const userId = await this.getUserId();
27
- const params = {
28
- $,
29
- data: {
30
- target_user_id: userId,
31
- },
32
- };
33
- const response = await this.app.followUser(params);
34
- $.export("$summary", `Successfully ${response.data?.following
35
- ? "followed"
36
- : "requested to follow"} user`);
37
- return response;
38
- }
39
- catch (err) {
40
- $.export("error", err);
41
- throw new Error(ACTION_ERROR_MESSAGE);
42
- }
27
+ const userId = await this.getUserId();
28
+ const params = {
29
+ $,
30
+ data: {
31
+ target_user_id: userId,
32
+ },
33
+ fallbackError: ACTION_ERROR_MESSAGE,
34
+ };
35
+ const response = await this.app.followUser(params);
36
+ $.export("$summary", `Successfully ${response.data?.following
37
+ ? "followed"
38
+ : "requested to follow"} user`);
39
+ return response;
43
40
  },
44
41
  });
@@ -1,138 +1,6 @@
1
- import { GetTweetParams } from "../../common/types/requestParams.js";
2
1
  import { getTweetFields } from "../../common/methods.js";
3
- import { ResponseObject, Tweet } from "../../common/types/responseSchemas.js";
4
2
  declare const _default: import("@pipedream/types").Action<{
5
3
  getTweetFields: typeof getTweetFields;
6
- }, {
7
- app: import("@pipedream/types").App<{
8
- _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
9
- _getBaseUrl(): "https://api.twitter.com/2";
10
- _httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
11
- _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
12
- addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
13
- createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
14
- deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
15
- followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
16
- getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<Tweet>>;
17
- getTweet({ tweetId, ...args }: GetTweetParams): Promise<ResponseObject<Tweet>>;
18
- getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<ResponseObject<import("../../common/types/responseSchemas").User>>;
19
- getAuthenticatedUserId(): Promise<string>;
20
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
21
- getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<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<Tweet>>;
25
- getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<Tweet>>;
26
- getUserByUsername(username: string): Promise<ResponseObject<import("../../common/types/responseSchemas").User>>;
27
- getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<ResponseObject<import("../../common/types/responseSchemas").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<import("../../common/types/responseSchemas").User>>;
30
- getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").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<Tweet>>;
33
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
34
- unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
35
- unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
36
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): 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
- tweetId: {
72
- propDefinition: (string | import("@pipedream/types").App<{
73
- _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
74
- _getBaseUrl(): "https://api.twitter.com/2";
75
- _httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
76
- _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").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<import("../../common/types/responseSchemas").PaginatedResponseObject<Tweet>>;
82
- getTweet({ tweetId, ...args }: GetTweetParams): Promise<ResponseObject<Tweet>>;
83
- getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<ResponseObject<import("../../common/types/responseSchemas").User>>;
84
- getAuthenticatedUserId(): Promise<string>;
85
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
86
- getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<Tweet>>;
87
- getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
88
- getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
89
- getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<Tweet>>;
90
- getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<Tweet>>;
91
- getUserByUsername(username: string): Promise<ResponseObject<import("../../common/types/responseSchemas").User>>;
92
- getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<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<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
95
- getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").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<import("../../common/types/responseSchemas").PaginatedResponseObject<Tweet>>;
98
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
99
- unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
100
- unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
101
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
102
- }, {
103
- maxResults: {
104
- type: string;
105
- label: string;
106
- description: string;
107
- optional: boolean;
108
- };
109
- listId: {
110
- type: string;
111
- label: string;
112
- description: string;
113
- options(): Promise<{
114
- label: string;
115
- value: string;
116
- }[]>;
117
- };
118
- userNameOrId: {
119
- type: string;
120
- label: string;
121
- description: string;
122
- optional: boolean;
123
- default: string;
124
- };
125
- tweetId: {
126
- type: string;
127
- label: string;
128
- description: string;
129
- };
130
- query: {
131
- type: string;
132
- label: string;
133
- description: string;
134
- };
135
- }>)[];
136
- };
137
- }>;
4
+ getTweets(args?: {}): any;
5
+ }, any>;
138
6
  export default _default;
@@ -1,41 +1,38 @@
1
- import app from "../../app/twitter.app.mjs";
1
+ import common from "../../common/appValidation.mjs";
2
2
  import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
3
3
  import { defineAction } from "@pipedream/types";
4
4
  import { getTweetFields } from "../../common/methods.mjs";
5
5
  const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id";
6
6
  export default defineAction({
7
+ ...common,
7
8
  key: "twitter-get-tweet",
8
9
  name: "Get Tweet",
9
10
  description: `Return a single tweet specified by ID. [See the documentation](${DOCS_LINK})`,
10
- version: "2.0.3",
11
+ version: "2.0.4",
11
12
  type: "action",
12
13
  props: {
13
- app,
14
+ ...common.props,
14
15
  tweetId: {
15
16
  propDefinition: [
16
- app,
17
+ common.props.app,
17
18
  "tweetId",
18
19
  ],
19
20
  },
20
21
  },
21
22
  methods: {
23
+ ...common.methods,
22
24
  getTweetFields,
23
25
  },
24
26
  async run({ $ }) {
25
- try {
26
- const { tweetId } = this;
27
- const params = {
28
- $,
29
- params: this.getTweetFields(),
30
- tweetId,
31
- };
32
- const response = await this.app.getTweet(params);
33
- $.export("$summary", `Successfully retrieved tweet (ID ${tweetId})`);
34
- return response;
35
- }
36
- catch (err) {
37
- $.export("error", err);
38
- throw new Error(ACTION_ERROR_MESSAGE);
39
- }
27
+ const { tweetId } = this;
28
+ const params = {
29
+ $,
30
+ params: this.getTweetFields(),
31
+ tweetId,
32
+ fallbackError: ACTION_ERROR_MESSAGE,
33
+ };
34
+ const response = await this.app.getTweet(params);
35
+ $.export("$summary", `Successfully retrieved tweet (ID ${tweetId})`);
36
+ return response;
40
37
  },
41
38
  });
@@ -1,139 +1,7 @@
1
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
2
  declare const _default: import("@pipedream/types").Action<{
5
3
  getUserId: typeof getUserId;
6
4
  getUserFields: typeof getUserFields;
7
- }, {
8
- app: import("@pipedream/types").App<{
9
- _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
10
- _getBaseUrl(): "https://api.twitter.com/2";
11
- _httpRequest({ $, specialAuth, ...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
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
22
- getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
23
- getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
24
- getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
25
- getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
26
- getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
27
- getUserByUsername(username: string): Promise<ResponseObject<User>>;
28
- getUser({ userId, ...args }: GetUserParams): Promise<ResponseObject<User>>;
29
- likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
30
- getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<User>>;
31
- getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<User>>;
32
- retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
33
- searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
34
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
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
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): 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): import("oauth-1.0a").Header;
75
- _getBaseUrl(): "https://api.twitter.com/2";
76
- _httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
77
- _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").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<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
83
- getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
84
- getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<ResponseObject<User>>;
85
- getAuthenticatedUserId(): Promise<string>;
86
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
87
- getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
88
- getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
89
- getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
90
- getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
91
- getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
92
- getUserByUsername(username: string): Promise<ResponseObject<User>>;
93
- getUser({ userId, ...args }: GetUserParams): Promise<ResponseObject<User>>;
94
- likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
95
- getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<User>>;
96
- getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<User>>;
97
- retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
98
- searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
99
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
100
- unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
101
- unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
102
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
103
- }, {
104
- maxResults: {
105
- type: string;
106
- label: string;
107
- description: string;
108
- optional: boolean;
109
- };
110
- listId: {
111
- type: string;
112
- label: string;
113
- description: string;
114
- options(): Promise<{
115
- label: string;
116
- value: string;
117
- }[]>;
118
- };
119
- userNameOrId: {
120
- type: string;
121
- label: string;
122
- description: string;
123
- optional: boolean;
124
- default: string;
125
- };
126
- tweetId: {
127
- type: string;
128
- label: string;
129
- description: string;
130
- };
131
- query: {
132
- type: string;
133
- label: string;
134
- description: string;
135
- };
136
- }>)[];
137
- };
138
- }>;
5
+ getTweets(args?: {}): any;
6
+ }, any>;
139
7
  export default _default;