@pipedream/twitter 0.3.11 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -71
- package/dist/actions/add-user-to-list/add-user-to-list.d.ts +194 -0
- package/dist/actions/add-user-to-list/add-user-to-list.mjs +44 -0
- package/dist/actions/create-tweet/create-tweet.d.ts +101 -0
- package/dist/actions/create-tweet/create-tweet.mjs +78 -0
- package/dist/actions/delete-tweet/delete-tweet.d.ts +128 -0
- package/dist/actions/delete-tweet/delete-tweet.mjs +29 -0
- package/dist/actions/follow-user/follow-user.d.ts +131 -0
- package/dist/actions/follow-user/follow-user.mjs +37 -0
- package/dist/actions/get-tweet/get-tweet.d.ts +132 -0
- package/dist/actions/get-tweet/get-tweet.mjs +34 -0
- package/dist/actions/get-user/get-user.d.ts +133 -0
- package/dist/actions/get-user/get-user.mjs +40 -0
- package/dist/actions/like-tweet/like-tweet.d.ts +128 -0
- package/dist/actions/like-tweet/like-tweet.mjs +31 -0
- package/dist/actions/list-favorites/list-favorites.d.ts +202 -0
- package/dist/actions/list-favorites/list-favorites.mjs +50 -0
- package/dist/actions/list-followers/list-followers.d.ts +202 -0
- package/dist/actions/list-followers/list-followers.mjs +50 -0
- package/dist/actions/list-lists/list-lists.d.ts +200 -0
- package/dist/actions/list-lists/list-lists.mjs +50 -0
- package/dist/actions/list-mentions/list-mentions.d.ts +200 -0
- package/dist/actions/list-mentions/list-mentions.mjs +50 -0
- package/dist/actions/list-user-tweets/list-user-tweets.d.ts +202 -0
- package/dist/actions/list-user-tweets/list-user-tweets.mjs +50 -0
- package/dist/actions/retweet/retweet.d.ts +128 -0
- package/dist/actions/retweet/retweet.mjs +34 -0
- package/dist/actions/simple-search/simple-search.d.ts +201 -0
- package/dist/actions/simple-search/simple-search.mjs +50 -0
- package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +206 -0
- package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +58 -0
- package/dist/actions/unfollow-user/unfollow-user.d.ts +131 -0
- package/dist/actions/unfollow-user/unfollow-user.mjs +33 -0
- package/dist/actions/unlike-tweet/unlike-tweet.d.ts +128 -0
- package/dist/actions/unlike-tweet/unlike-tweet.mjs +29 -0
- package/dist/app/twitter.app.d.ts +65 -0
- package/dist/app/twitter.app.mjs +291 -0
- package/dist/common/additionalProps.d.ts +0 -0
- package/dist/common/additionalProps.mjs +138 -0
- package/dist/common/dataFields.d.ts +6 -0
- package/dist/common/dataFields.mjs +80 -0
- package/dist/common/expansions.d.ts +3 -0
- package/dist/common/expansions.mjs +17 -0
- package/dist/common/methods.d.ts +20 -0
- package/dist/common/methods.mjs +69 -0
- package/dist/common/types/fields.d.ts +18 -0
- package/dist/common/types/fields.mjs +1 -0
- package/dist/common/types/requestParams.d.ts +105 -0
- package/dist/common/types/requestParams.mjs +1 -0
- package/dist/common/types/responseSchemas.d.ts +42 -0
- package/dist/common/types/responseSchemas.mjs +1 -0
- package/dist/sources/common/base.d.ts +87 -0
- package/dist/sources/common/base.mjs +60 -0
- package/dist/sources/common/cacheUserId.d.ts +7 -0
- package/dist/sources/common/cacheUserId.mjs +18 -0
- package/dist/sources/common/getItemSummary.d.ts +4 -0
- package/dist/sources/common/getItemSummary.mjs +12 -0
- package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +149 -0
- package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +45 -0
- package/dist/sources/new-list-followed/new-list-followed.d.ts +149 -0
- package/dist/sources/new-list-followed/new-list-followed.mjs +46 -0
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +147 -0
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +42 -0
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +149 -0
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +45 -0
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +149 -0
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +45 -0
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +147 -0
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +44 -0
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +149 -0
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +75 -0
- package/dist/sources/new-user-followed/new-user-followed.d.ts +148 -0
- package/dist/sources/new-user-followed/new-user-followed.mjs +46 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +10 -14
- package/actions/add-user-to-list/add-user-to-list.mjs +0 -62
- package/actions/advanced-search/advanced-search.mjs +0 -113
- package/actions/common.mjs +0 -29
- package/actions/create-tweet/create-tweet.mjs +0 -146
- package/actions/delete-tweet/delete-tweet.mjs +0 -42
- package/actions/follow-user/follow-user.mjs +0 -48
- package/actions/get-tweet/get-tweet.mjs +0 -42
- package/actions/get-user/get-user.mjs +0 -50
- package/actions/like-tweet/like-tweet.mjs +0 -42
- package/actions/list-favorites/list-favorites.mjs +0 -63
- package/actions/list-followers/list-followers.mjs +0 -67
- package/actions/list-lists/list-lists.mjs +0 -69
- package/actions/list-mentions/list-mentions.mjs +0 -55
- package/actions/list-pending-followers/list-pending-followers.mjs +0 -32
- package/actions/list-retweets/list-retweets.mjs +0 -54
- package/actions/list-user-tweets/list-user-tweets.mjs +0 -80
- package/actions/retweet/retweet.mjs +0 -27
- package/actions/simple-search/simple-search.mjs +0 -62
- package/actions/simple-search-in-list/simple-search-in-list.mjs +0 -48
- package/actions/unfollow-user/unfollow-user.mjs +0 -48
- package/actions/unlike-tweet/unlike-tweet.mjs +0 -40
- package/actions/upload-media/upload-media.mjs +0 -122
- package/old.md +0 -169
- package/sources/common/followed.mjs +0 -38
- package/sources/common/followers.mjs +0 -159
- package/sources/common/tweets.mjs +0 -155
- package/sources/language-codes.mjs +0 -742
- package/sources/my-liked-tweets/my-liked-tweets.mjs +0 -30
- package/sources/my-tweets/my-tweets.mjs +0 -48
- package/sources/new-follower-of-me/new-follower-of-me.mjs +0 -69
- package/sources/new-follower-of-user/new-follower-of-user.mjs +0 -25
- package/sources/new-list-followed/new-list-followed.mjs +0 -24
- package/sources/new-trends-by-geo/new-trends-by-geo.mjs +0 -40
- package/sources/new-tweet-in-list/new-tweet-in-list.mjs +0 -49
- package/sources/new-unfollower-of-me/new-unfollower-of-me.mjs +0 -16
- package/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +0 -25
- package/sources/new-user-followed/new-user-followed.mjs +0 -25
- package/sources/search-mentions/search-mentions.mjs +0 -144
- package/sources/tweets-liked-by-user/tweets-liked-by-user.mjs +0 -38
- package/sources/user-tweets/user-tweets.mjs +0 -49
- package/sources/watch-retweets-of-me/watch-retweets-of-me.mjs +0 -36
- package/sources/watch-retweets-of-my-tweet/watch-retweets-of-my-tweet.mjs +0 -44
- package/sources/watch-retweets-of-user-tweet/watch-retweets-of-user-tweet.mjs +0 -34
- package/twitter.app.mjs +0 -1161
package/README.md
CHANGED
|
@@ -1,71 +1,18 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- [Search Twitter](https://pipedream.com/sources/new?app=twitter) - Triggers when a new tweet matches your search ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/search-twitter.js))
|
|
21
|
-
- [My Tweets](https://pipedream.com/sources/new?app=twitter) - Triggered when a you tweet a new tweet ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/my-tweets.js))
|
|
22
|
-
- [My Likes](https://pipedream.com/sources/new?app=twitter) - Triggered when like a tweet ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/my-liked-tweets.js))
|
|
23
|
-
- [New Followers](https://pipedream.com/sources/new?app=twitter) - Triggered when you get a new follower ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/new-follower-of-me.js))
|
|
24
|
-
- [New Followers of User](https://pipedream.com/sources/new?app=twitter) - Triggered when a specific user gets a new follower ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/new-follower-of-user.js))
|
|
25
|
-
- [New Trends by Geo](https://pipedream.com/sources/new?app=twitter) - Triggered when there is a new trend in a specific geo ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/new-trends-by-geo.js))
|
|
26
|
-
- [New Likes by User](https://pipedream.com/sources/new?app=twitter) - Triggered when there is a new like from a specific user ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/tweets-liked-by-user.js))
|
|
27
|
-
- [New Tweets by User](https://pipedream.com/sources/new?app=twitter) - Triggered when there is a new tweet from a specific user ([code](https://github.com/PipedreamHQ/pipedream/blob/master/components/twitter/user-tweets.js))
|
|
28
|
-
|
|
29
|
-
Event sources can also be deployed via the [Pipedream CLI](https://docs.pipedream.com/cli/reference/). Once installed, you can deploy an event source by running:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
pd deploy # prompts you to select a component and pass required options
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Workflows
|
|
36
|
-
|
|
37
|
-
Workflows are a sequence of linear [steps](https://docs.pipedream.com/workflows/steps) - just Node.js code - triggered by an event (via event source, HTTP endpoint, or timer). Workflows make it easy to transform data and integrate with 300+ APIs from various apps and services.
|
|
38
|
-
|
|
39
|
-
- Trigger your workflow on any [
|
|
40
|
-
|
|
41
|
-
event](https://pipedream.com/sources/new?app=twitter), a different event (e.g. [HTTP requests](https://docs.pipedream.com/workflows/steps/triggers/#http) or a [schedule](https://docs.pipedream.com/workflows/steps/triggers/#cron-scheduler)).
|
|
42
|
-
|
|
43
|
-
- Add steps to run [Node.js code](https://docs.pipedream.com/workflows/steps/code/) (using virtually any npm package) and [pre-built actions](https://docs.pipedream.com/workflows/steps/actions/).
|
|
44
|
-
- Steps are executed in the order they appear in your workflow.
|
|
45
|
-
- Data is shared between steps via [step exports](https://docs.pipedream.com/workflows/steps/#step-exports).
|
|
46
|
-
|
|
47
|
-
Workflow code is [public by default](https://docs.pipedream.com/public-workflows/) so the community can discover and [copy them](https://docs.pipedream.com/workflows/copy/). Your workflow execution and event data is private.
|
|
48
|
-
|
|
49
|
-
You can copy [this example workflow](https://pipedream.com/@tod/use-http-requests-to-trigger-a-workflow-p_6lCy5y/readme) to get started, or review some [community-developed workflows](https://pipedream.com/explore) to see what others are building.
|
|
50
|
-
|
|
51
|
-
## Other Popular API Integrations
|
|
52
|
-
|
|
53
|
-
- [Airtable](https://github.com/PipedreamHQ/pipedream/tree/master/components/airtable) ([deploy](https://pipedream.com/sources/new?app=airtable))
|
|
54
|
-
- [AWS](https://github.com/PipedreamHQ/pipedream/tree/master/components/aws) ([deploy](https://pipedream.com/sources/new?app=aws))
|
|
55
|
-
- [Dropbox](https://github.com/PipedreamHQ/pipedream/tree/master/components/dropbox) ([deploy](https://pipedream.com/sources/new?app=dropbox))
|
|
56
|
-
- [Github](https://github.com/PipedreamHQ/pipedream/tree/master/components/github) ([deploy](https://pipedream.com/sources/new?app=github))
|
|
57
|
-
- [Google Calendar](https://github.com/PipedreamHQ/pipedream/tree/master/components/google-calendar) ([deploy](https://pipedream.com/sources/new?app=google-calendar))
|
|
58
|
-
- [Google Drive](https://github.com/PipedreamHQ/pipedream/tree/master/components/google-drive) ([deploy](https://pipedream.com/sources/new?app=google-drive))
|
|
59
|
-
- [RSS](https://github.com/PipedreamHQ/pipedream/tree/master/components/rss) ([deploy](https://pipedream.com/sources/new?app=rss))
|
|
60
|
-
|
|
61
|
-
## Pricing
|
|
62
|
-
|
|
63
|
-
Pipedream is currently free, subject to the [limits noted below](https://docs.pipedream.com/limits/). Paid tiers for higher volumes are coming soon.
|
|
64
|
-
|
|
65
|
-
If you exceed any of these limits, please [reach out](https://docs.pipedream.com/support/).
|
|
66
|
-
|
|
67
|
-
## Found a Bug? Have a Feature to suggest?
|
|
68
|
-
|
|
69
|
-
Before adding an issue, please search the [existing issues](https://github.com/PipedreamHQ/pipedream/issues) or [reach out to our team](https://docs.pipedream.com/support/) to see if a similar request already exists.
|
|
70
|
-
|
|
71
|
-
If an issue exists, please [add a reaction](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-conversations-on-github) or comment on your specific use case.
|
|
1
|
+
# Getting Started
|
|
2
|
+
In order to connect your Twitter account to Pipedream, you'll need to create a developer project and app.
|
|
3
|
+
1. First, visit Twitter's [developer dashboard](https://developer.twitter.com/en/portal/dashboard) and sign in
|
|
4
|
+
2. Next, [create a new project](https://developer.twitter.com/en/portal/projects/new) and give it a name, select a use case, and provide a description
|
|
5
|
+
|
|
6
|
+
## Creating a Project and App
|
|
7
|
+
1. Provide a name for your app
|
|
8
|
+
2. Note the API Key and API Key Secret that are displayed (the setup isn't done yet, but note these down)
|
|
9
|
+
3. Click "App settings" at the bottom right of the screen
|
|
10
|
+
|
|
11
|
+
## Configuring Authentication Settings
|
|
12
|
+
1. In the bottom of your app's settings, in the "User Authentication Settings", choose "Set Up"
|
|
13
|
+
2. Select the appropriate app permissions based on your use case
|
|
14
|
+
3. Select "**Web App, Automated App or Bot** (Confidential client)" in the "Type of App" section
|
|
15
|
+
4. Enter this URI in the "Callback URI / Redirect URI": `https://api.pipedream.com/connect/oauth/oa_gk6iBa/callback`
|
|
16
|
+
5. Enter a website URL
|
|
17
|
+
6. Click "Done" (the Client ID and Client Secret that are shown on the next page are not required for this setup)
|
|
18
|
+
7. Enter the API Key and API Key Secret when prompted in Pipedream (if you lose them and need to regenerate new keys, you can do so from the "Keys and tokens" tab in your app's settings in Twitter's developer dashboard, in the "Consume Keys" section)
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { getUserId } from "../../common/methods.js";
|
|
2
|
+
import { AddUserToListParams } from "../../common/types/requestParams.js";
|
|
3
|
+
declare const _default: import("@pipedream/types").Action<{
|
|
4
|
+
getUserId: typeof getUserId;
|
|
5
|
+
}, {
|
|
6
|
+
app: import("@pipedream/types").App<{
|
|
7
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
|
|
8
|
+
_getBaseUrl(): "https://api.twitter.com/2";
|
|
9
|
+
_httpRequest({ $, ...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 }: 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
|
+
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
20
|
+
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
21
|
+
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
22
|
+
getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
23
|
+
getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
24
|
+
getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
25
|
+
getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
26
|
+
likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
27
|
+
getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
28
|
+
getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
29
|
+
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
30
|
+
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
31
|
+
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
32
|
+
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
33
|
+
}, {
|
|
34
|
+
maxResults: {
|
|
35
|
+
type: string;
|
|
36
|
+
label: string;
|
|
37
|
+
description: string;
|
|
38
|
+
optional: boolean;
|
|
39
|
+
};
|
|
40
|
+
listId: {
|
|
41
|
+
type: string;
|
|
42
|
+
label: string;
|
|
43
|
+
description: string;
|
|
44
|
+
options(): Promise<{
|
|
45
|
+
label: string;
|
|
46
|
+
value: string;
|
|
47
|
+
}[]>;
|
|
48
|
+
};
|
|
49
|
+
userNameOrId: {
|
|
50
|
+
type: string;
|
|
51
|
+
label: string;
|
|
52
|
+
description: string;
|
|
53
|
+
optional: boolean;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
tweetId: {
|
|
57
|
+
type: string;
|
|
58
|
+
label: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
query: {
|
|
62
|
+
type: string;
|
|
63
|
+
label: string;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
listId: {
|
|
68
|
+
propDefinition: (string | import("@pipedream/types").App<{
|
|
69
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
|
|
70
|
+
_getBaseUrl(): "https://api.twitter.com/2";
|
|
71
|
+
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
72
|
+
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
73
|
+
addUserToList({ listId, ...args }: AddUserToListParams): Promise<object>;
|
|
74
|
+
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
75
|
+
deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
|
|
76
|
+
followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
|
|
77
|
+
getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
78
|
+
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
79
|
+
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
80
|
+
getAuthenticatedUserId(): Promise<string>;
|
|
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
|
+
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
94
|
+
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
95
|
+
}, {
|
|
96
|
+
maxResults: {
|
|
97
|
+
type: string;
|
|
98
|
+
label: string;
|
|
99
|
+
description: string;
|
|
100
|
+
optional: boolean;
|
|
101
|
+
};
|
|
102
|
+
listId: {
|
|
103
|
+
type: string;
|
|
104
|
+
label: string;
|
|
105
|
+
description: string;
|
|
106
|
+
options(): Promise<{
|
|
107
|
+
label: string;
|
|
108
|
+
value: string;
|
|
109
|
+
}[]>;
|
|
110
|
+
};
|
|
111
|
+
userNameOrId: {
|
|
112
|
+
type: string;
|
|
113
|
+
label: string;
|
|
114
|
+
description: string;
|
|
115
|
+
optional: boolean;
|
|
116
|
+
default: string;
|
|
117
|
+
};
|
|
118
|
+
tweetId: {
|
|
119
|
+
type: string;
|
|
120
|
+
label: string;
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
query: {
|
|
124
|
+
type: string;
|
|
125
|
+
label: string;
|
|
126
|
+
description: string;
|
|
127
|
+
};
|
|
128
|
+
}>)[];
|
|
129
|
+
};
|
|
130
|
+
userNameOrId: {
|
|
131
|
+
propDefinition: (string | import("@pipedream/types").App<{
|
|
132
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
|
|
133
|
+
_getBaseUrl(): "https://api.twitter.com/2";
|
|
134
|
+
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
135
|
+
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
136
|
+
addUserToList({ listId, ...args }: AddUserToListParams): Promise<object>;
|
|
137
|
+
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
138
|
+
deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
|
|
139
|
+
followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
|
|
140
|
+
getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
141
|
+
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
142
|
+
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
143
|
+
getAuthenticatedUserId(): Promise<string>;
|
|
144
|
+
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
145
|
+
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
146
|
+
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
147
|
+
getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
148
|
+
getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
149
|
+
getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
150
|
+
getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
151
|
+
likeTweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
152
|
+
getUserFollowers({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
153
|
+
getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
154
|
+
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
155
|
+
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
156
|
+
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
157
|
+
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
158
|
+
}, {
|
|
159
|
+
maxResults: {
|
|
160
|
+
type: string;
|
|
161
|
+
label: string;
|
|
162
|
+
description: string;
|
|
163
|
+
optional: boolean;
|
|
164
|
+
};
|
|
165
|
+
listId: {
|
|
166
|
+
type: string;
|
|
167
|
+
label: string;
|
|
168
|
+
description: string;
|
|
169
|
+
options(): Promise<{
|
|
170
|
+
label: string;
|
|
171
|
+
value: string;
|
|
172
|
+
}[]>;
|
|
173
|
+
};
|
|
174
|
+
userNameOrId: {
|
|
175
|
+
type: string;
|
|
176
|
+
label: string;
|
|
177
|
+
description: string;
|
|
178
|
+
optional: boolean;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
181
|
+
tweetId: {
|
|
182
|
+
type: string;
|
|
183
|
+
label: string;
|
|
184
|
+
description: string;
|
|
185
|
+
};
|
|
186
|
+
query: {
|
|
187
|
+
type: string;
|
|
188
|
+
label: string;
|
|
189
|
+
description: string;
|
|
190
|
+
};
|
|
191
|
+
}>)[];
|
|
192
|
+
};
|
|
193
|
+
}>;
|
|
194
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { defineAction } from "@pipedream/types";
|
|
3
|
+
import { getUserId } from "../../common/methods.mjs";
|
|
4
|
+
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/post-lists-id-members";
|
|
5
|
+
export default defineAction({
|
|
6
|
+
key: "twitter-add-user-to-list",
|
|
7
|
+
name: "Add User To List",
|
|
8
|
+
description: `Add a member to a list owned by the user. [See docs here](${DOCS_LINK})`,
|
|
9
|
+
version: "1.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
app,
|
|
13
|
+
listId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
app,
|
|
16
|
+
"listId",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
userNameOrId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
app,
|
|
22
|
+
"userNameOrId",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
getUserId,
|
|
28
|
+
},
|
|
29
|
+
async run({ $ }) {
|
|
30
|
+
const userId = await this.getUserId();
|
|
31
|
+
const params = {
|
|
32
|
+
$,
|
|
33
|
+
data: {
|
|
34
|
+
user_id: userId,
|
|
35
|
+
},
|
|
36
|
+
listId: this.listId,
|
|
37
|
+
};
|
|
38
|
+
const response = await this.app.addUserToList(params);
|
|
39
|
+
$.export("$summary", response.data?.is_member !== true
|
|
40
|
+
? "User not added to list"
|
|
41
|
+
: "Successfully added user to list");
|
|
42
|
+
return response;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CreateTweetParams } from "../../common/types/requestParams.js";
|
|
2
|
+
declare const _default: import("@pipedream/types").Action<unknown, {
|
|
3
|
+
app: import("@pipedream/types").App<{
|
|
4
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("oauth-1.0a").Header>;
|
|
5
|
+
_getBaseUrl(): "https://api.twitter.com/2";
|
|
6
|
+
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
7
|
+
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
8
|
+
addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
|
|
9
|
+
createTweet(args: CreateTweetParams): Promise<object>;
|
|
10
|
+
deleteTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").DeleteTweetParams): Promise<object>;
|
|
11
|
+
followUser(args: import("../../common/types/requestParams.js").FollowUserParams): Promise<object>;
|
|
12
|
+
getListTweets({ listId, ...args }: import("../../common/types/requestParams.js").GetListTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
13
|
+
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
14
|
+
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
15
|
+
getAuthenticatedUserId(): Promise<string>;
|
|
16
|
+
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
17
|
+
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
18
|
+
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
19
|
+
getUserMentions({ userId, ...args }: import("../../common/types/requestParams.js").GetUserMentionsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
20
|
+
getUserTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
21
|
+
getUserByUsername(username: string): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
22
|
+
getUser({ userId, ...args }: import("../../common/types/requestParams.js").GetUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
23
|
+
likeTweet(args: 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
|
+
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
29
|
+
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
30
|
+
}, {
|
|
31
|
+
maxResults: {
|
|
32
|
+
type: string;
|
|
33
|
+
label: string;
|
|
34
|
+
description: string;
|
|
35
|
+
optional: boolean;
|
|
36
|
+
};
|
|
37
|
+
listId: {
|
|
38
|
+
type: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description: string;
|
|
41
|
+
options(): Promise<{
|
|
42
|
+
label: string;
|
|
43
|
+
value: string;
|
|
44
|
+
}[]>;
|
|
45
|
+
};
|
|
46
|
+
userNameOrId: {
|
|
47
|
+
type: string;
|
|
48
|
+
label: string;
|
|
49
|
+
description: string;
|
|
50
|
+
optional: boolean;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
tweetId: {
|
|
54
|
+
type: string;
|
|
55
|
+
label: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
query: {
|
|
59
|
+
type: string;
|
|
60
|
+
label: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
text: {
|
|
65
|
+
type: string;
|
|
66
|
+
label: string;
|
|
67
|
+
description: string;
|
|
68
|
+
optional: boolean;
|
|
69
|
+
};
|
|
70
|
+
inReplyToTweetId: {
|
|
71
|
+
type: string;
|
|
72
|
+
label: string;
|
|
73
|
+
description: string;
|
|
74
|
+
optional: boolean;
|
|
75
|
+
};
|
|
76
|
+
excludeReplyUserIds: {
|
|
77
|
+
type: string;
|
|
78
|
+
label: string;
|
|
79
|
+
description: string;
|
|
80
|
+
optional: boolean;
|
|
81
|
+
};
|
|
82
|
+
mediaIds: {
|
|
83
|
+
type: string;
|
|
84
|
+
label: string;
|
|
85
|
+
description: string;
|
|
86
|
+
optional: boolean;
|
|
87
|
+
};
|
|
88
|
+
taggedUserIds: {
|
|
89
|
+
type: string;
|
|
90
|
+
label: string;
|
|
91
|
+
description: string;
|
|
92
|
+
optional: boolean;
|
|
93
|
+
};
|
|
94
|
+
placeId: {
|
|
95
|
+
type: string;
|
|
96
|
+
label: string;
|
|
97
|
+
description: string;
|
|
98
|
+
optional: boolean;
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
export default _default;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { defineAction } from "@pipedream/types";
|
|
3
|
+
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets";
|
|
4
|
+
export default defineAction({
|
|
5
|
+
key: "twitter-create-tweet",
|
|
6
|
+
name: "Create Tweet",
|
|
7
|
+
description: `Create a new tweet. [See docs here](${DOCS_LINK})`,
|
|
8
|
+
version: "1.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
app,
|
|
12
|
+
text: {
|
|
13
|
+
type: "string",
|
|
14
|
+
label: "Text",
|
|
15
|
+
description: "Text of the Tweet being created. Required if `Media IDs` is not set.",
|
|
16
|
+
optional: true,
|
|
17
|
+
},
|
|
18
|
+
inReplyToTweetId: {
|
|
19
|
+
type: "string",
|
|
20
|
+
label: "In Reply To Tweet (ID)",
|
|
21
|
+
description: "Tweet ID of the Tweet being replied to. Please note that this prop needs to be set if `Exclude Reply User IDs` is also set.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
excludeReplyUserIds: {
|
|
25
|
+
type: "string[]",
|
|
26
|
+
label: "Exclude Reply User IDs",
|
|
27
|
+
description: "A list of User IDs to be excluded from the reply Tweet thus removing a user from a thread.",
|
|
28
|
+
optional: true,
|
|
29
|
+
},
|
|
30
|
+
mediaIds: {
|
|
31
|
+
type: "string[]",
|
|
32
|
+
label: "Media IDs",
|
|
33
|
+
description: "A list of Media IDs being attached to the Tweet. This is only required if `Tagged User IDs` is set.",
|
|
34
|
+
optional: true,
|
|
35
|
+
},
|
|
36
|
+
taggedUserIds: {
|
|
37
|
+
type: "string[]",
|
|
38
|
+
label: "Tagged User IDs",
|
|
39
|
+
description: "A list of User IDs being tagged in the Tweet with Media. If the user you're tagging doesn't have photo-tagging enabled, their names won't show up in the list of tagged users even though the Tweet is successfully created.",
|
|
40
|
+
optional: true,
|
|
41
|
+
},
|
|
42
|
+
placeId: {
|
|
43
|
+
type: "string",
|
|
44
|
+
label: "Place ID",
|
|
45
|
+
description: "Place ID being attached to the Tweet for geo location.",
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
async run({ $ }) {
|
|
50
|
+
const { text, inReplyToTweetId, excludeReplyUserIds, mediaIds, placeId, taggedUserIds, } = this;
|
|
51
|
+
const params = {
|
|
52
|
+
$,
|
|
53
|
+
data: {
|
|
54
|
+
text,
|
|
55
|
+
...((inReplyToTweetId || excludeReplyUserIds) && {
|
|
56
|
+
reply: {
|
|
57
|
+
exclude_reply_user_ids: excludeReplyUserIds,
|
|
58
|
+
in_reply_to_tweet_id: inReplyToTweetId,
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
...((mediaIds || taggedUserIds) && {
|
|
62
|
+
media: {
|
|
63
|
+
media_ids: mediaIds,
|
|
64
|
+
tagged_user_ids: taggedUserIds,
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
...(placeId && {
|
|
68
|
+
geo: {
|
|
69
|
+
place_id: placeId,
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
const response = await this.app.createTweet(params);
|
|
75
|
+
$.export("$summary", `Successfully posted tweet (ID ${response.data?.id})`);
|
|
76
|
+
return response;
|
|
77
|
+
},
|
|
78
|
+
});
|