@pipedream/twitter 2.2.0 → 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 +2 -203
  22. package/dist/actions/list-mentions/list-mentions.mjs +19 -22
  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 +2 -140
  53. package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.mjs +2 -3
  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,134 +1,4 @@
1
- declare const _default: import("@pipedream/types").Action<unknown, {
2
- app: import("@pipedream/types").App<{
3
- _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
4
- _getBaseUrl(): "https://api.twitter.com/2";
5
- _httpRequest({ $, specialAuth, ...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
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
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: import("../../common/types/requestParams.js").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: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
27
- searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
28
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
29
- unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
30
- unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
31
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
32
- }, {
33
- maxResults: {
34
- type: string;
35
- label: string;
36
- description: string;
37
- optional: boolean;
38
- };
39
- listId: {
40
- type: string;
41
- label: string;
42
- description: string;
43
- options(): Promise<{
44
- label: string;
45
- value: string;
46
- }[]>;
47
- };
48
- userNameOrId: {
49
- type: string;
50
- label: string;
51
- description: string;
52
- optional: boolean;
53
- default: string;
54
- };
55
- tweetId: {
56
- type: string;
57
- label: string;
58
- description: string;
59
- };
60
- query: {
61
- type: string;
62
- label: string;
63
- description: string;
64
- };
65
- }>;
66
- tweetId: {
67
- propDefinition: (string | import("@pipedream/types").App<{
68
- _getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
69
- _getBaseUrl(): "https://api.twitter.com/2";
70
- _httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
71
- _paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
72
- addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
73
- createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
74
- deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
75
- followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
76
- getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
77
- getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
78
- getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
79
- getAuthenticatedUserId(): Promise<string>;
80
- getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
81
- getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
82
- getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
83
- getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
84
- getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
85
- getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
86
- getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
87
- getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
88
- likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
89
- getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
90
- getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
91
- retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
92
- searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
93
- sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
94
- unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
95
- unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
96
- uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): 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
- description: string;
132
- };
133
- }>;
1
+ declare const _default: import("@pipedream/types").Action<{
2
+ getTweets(args?: {}): any;
3
+ }, any>;
134
4
  export default _default;
@@ -1,41 +1,37 @@
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/retweets/api-reference/post-users-id-retweets";
5
5
  export default defineAction({
6
+ ...common,
6
7
  key: "twitter-retweet",
7
8
  name: "Retweet a tweet",
8
9
  description: `Retweet a tweet specified by ID. [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
  description: "The ID of the tweet you'd like to retweet",
19
20
  },
20
21
  },
21
22
  async run({ $ }) {
22
- try {
23
- const { tweetId } = this;
24
- const params = {
25
- $,
26
- data: {
27
- tweet_id: tweetId,
28
- },
29
- };
30
- const response = await this.app.retweet(params);
31
- $.export("$summary", response.data?.retweeted !== true
32
- ? "Retweet failed"
33
- : "Tweet successfully retweeted");
34
- return response;
35
- }
36
- catch (err) {
37
- $.export("error", err);
38
- throw new Error(ACTION_ERROR_MESSAGE);
39
- }
23
+ const { tweetId } = this;
24
+ const params = {
25
+ $,
26
+ data: {
27
+ tweet_id: tweetId,
28
+ },
29
+ fallbackError: ACTION_ERROR_MESSAGE,
30
+ };
31
+ const response = await this.app.retweet(params);
32
+ $.export("$summary", response.data?.retweeted !== true
33
+ ? "Retweet failed"
34
+ : "Tweet successfully retweeted");
35
+ return response;
40
36
  },
41
37
  });
@@ -1,144 +1,6 @@
1
1
  import { getUserId } from "../../common/methods.js";
2
- import { SendMessageParams } 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: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
15
- getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
16
- getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
17
- 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 }: 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: import("../../common/types/requestParams.js").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 }: 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
- label: string;
136
- optional: boolean;
137
- };
138
- text: {
139
- type: string;
140
- label: string;
141
- description: string;
142
- };
143
- }>;
4
+ getTweets(args?: {}): any;
5
+ }, any>;
144
6
  export default _default;
@@ -1,19 +1,20 @@
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/direct-messages/manage/api-reference/post-dm_conversations-with-participant_id-messages";
6
6
  export default defineAction({
7
+ ...common,
7
8
  key: "twitter-send-dm",
8
9
  name: "Send Direct Message (DM)",
9
10
  description: `Send a message to a user. [See the documentation](${DOCS_LINK})`,
10
- version: "1.0.1",
11
+ version: "1.0.2",
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
  label: "Recipient Name or ID",
@@ -26,25 +27,21 @@ export default defineAction({
26
27
  },
27
28
  },
28
29
  methods: {
30
+ ...common.methods,
29
31
  getUserId,
30
32
  },
31
33
  async run({ $ }) {
32
- try {
33
- const userId = await this.getUserId();
34
- const params = {
35
- $,
36
- userId,
37
- data: {
38
- text: this.text,
39
- },
40
- };
41
- const response = await this.app.sendMessage(params);
42
- $.export("$summary", `Successfully sent message (event ID ${response.data?.dm_event_id})`);
43
- return response;
44
- }
45
- catch (err) {
46
- $.export("error", err);
47
- throw new Error(ACTION_ERROR_MESSAGE);
48
- }
34
+ const userId = await this.getUserId();
35
+ const params = {
36
+ $,
37
+ userId,
38
+ data: {
39
+ text: this.text,
40
+ },
41
+ fallbackError: ACTION_ERROR_MESSAGE,
42
+ };
43
+ const response = await this.app.sendMessage(params);
44
+ $.export("$summary", `Successfully sent message (event ID ${response.data?.dm_event_id})`);
45
+ return response;
49
46
  },
50
47
  });