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