@pipedream/twitter 1.1.1 → 1.1.3
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 +16 -1
- package/dist/actions/add-user-to-list/add-user-to-list.d.ts +3 -3
- package/dist/actions/add-user-to-list/add-user-to-list.mjs +21 -14
- package/dist/actions/create-tweet/create-tweet.d.ts +1 -1
- package/dist/actions/create-tweet/create-tweet.mjs +35 -28
- package/dist/actions/delete-tweet/delete-tweet.d.ts +2 -2
- package/dist/actions/delete-tweet/delete-tweet.mjs +16 -9
- package/dist/actions/follow-user/follow-user.d.ts +2 -2
- package/dist/actions/follow-user/follow-user.mjs +20 -13
- package/dist/actions/get-tweet/get-tweet.d.ts +2 -2
- package/dist/actions/get-tweet/get-tweet.mjs +17 -10
- package/dist/actions/get-user/get-user.d.ts +2 -2
- package/dist/actions/get-user/get-user.mjs +20 -13
- package/dist/actions/like-tweet/like-tweet.d.ts +2 -2
- package/dist/actions/like-tweet/like-tweet.mjs +18 -11
- package/dist/actions/list-favorites/list-favorites.d.ts +4 -4
- package/dist/actions/list-favorites/list-favorites.mjs +20 -13
- package/dist/actions/list-followers/list-followers.d.ts +4 -4
- package/dist/actions/list-followers/list-followers.mjs +20 -13
- package/dist/actions/list-lists/list-lists.d.ts +4 -4
- package/dist/actions/list-lists/list-lists.mjs +20 -13
- package/dist/actions/list-mentions/list-mentions.d.ts +4 -4
- package/dist/actions/list-mentions/list-mentions.mjs +20 -13
- package/dist/actions/list-user-tweets/list-user-tweets.d.ts +4 -4
- package/dist/actions/list-user-tweets/list-user-tweets.mjs +20 -13
- package/dist/actions/retweet/retweet.d.ts +2 -2
- package/dist/actions/retweet/retweet.mjs +20 -13
- package/dist/actions/simple-search/simple-search.d.ts +4 -4
- package/dist/actions/simple-search/simple-search.mjs +21 -14
- package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +4 -4
- package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +24 -17
- package/dist/actions/unfollow-user/unfollow-user.d.ts +2 -2
- package/dist/actions/unfollow-user/unfollow-user.mjs +16 -9
- package/dist/actions/unlike-tweet/unlike-tweet.d.ts +2 -2
- package/dist/actions/unlike-tweet/unlike-tweet.mjs +16 -9
- package/dist/app/twitter.app.d.ts +1 -1
- package/dist/app/twitter.app.mjs +45 -34
- package/dist/common/dataFields.mjs +6 -6
- package/dist/common/errorMessage.d.ts +2 -0
- package/dist/common/errorMessage.mjs +2 -0
- package/dist/sources/common/base.d.ts +1 -1
- package/dist/sources/common/base.mjs +10 -2
- package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +2 -2
- package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +1 -1
- package/dist/sources/new-list-followed/new-list-followed.d.ts +2 -2
- package/dist/sources/new-list-followed/new-list-followed.mjs +1 -1
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +2 -2
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +1 -1
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +2 -2
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +1 -1
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +2 -2
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +1 -1
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +2 -2
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +1 -1
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +2 -2
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +1 -1
- package/dist/sources/new-user-followed/new-user-followed.d.ts +2 -2
- package/dist/sources/new-user-followed/new-user-followed.mjs +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -15,4 +15,19 @@ In order to connect your Twitter account to Pipedream, you'll need to create a d
|
|
|
15
15
|
4. Enter this URI in the "Callback URI / Redirect URI": `https://api.pipedream.com/connect/oauth/oa_gk6iBa/callback`
|
|
16
16
|
5. Enter a website URL
|
|
17
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 "
|
|
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 "Consumer Keys" section)
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
# Troubleshooting
|
|
23
|
+
Below are some of the most common issues we see.
|
|
24
|
+
|
|
25
|
+
## Issues Connecting Twitter
|
|
26
|
+
If you run into an error during the app connection process, make sure to doublecheck the below configurations:
|
|
27
|
+
1. Ensure that you've entered the correct `developer_consumer_key` and `developer_consumer_secret` in Pipedream. These map to Twitter's "API Key" and "API Key Secret" in the "Keys & Tokens" section in their dashboard.
|
|
28
|
+
2. Make sure the "Callback URI / Redirect URL" that you configure within the "User Authentication settings" for your app in Twitter's developer console exactly matches: `https://api.pipedream.com/connect/oauth/oa_gk6iBa/callback`
|
|
29
|
+
|
|
30
|
+
## Errors from Twitter's API or Twitter Sources and Actions
|
|
31
|
+
1. Free Twitter developer accounts only have access to **write** endpoints (for example, actions like "Create Tweet" and "Create Retweet")
|
|
32
|
+
2. Twitter developer accounts on their Basic plan have access to **write** and **read** endpoints (for example, actions like "Create Tweet" and "Search Tweets", as well as sources like "New Post Matching Query")
|
|
33
|
+
3. If you are getting errors from the Twitter sources or actions, please consult the developer plan to confirm if you have access to those endpoints.
|
|
@@ -4,7 +4,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
4
4
|
getUserId: typeof getUserId;
|
|
5
5
|
}, {
|
|
6
6
|
app: import("@pipedream/types").App<{
|
|
7
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
7
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
8
8
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
9
9
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
10
10
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -66,7 +66,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
66
66
|
}>;
|
|
67
67
|
listId: {
|
|
68
68
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
69
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
69
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
70
70
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
71
71
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
72
72
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -129,7 +129,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
129
129
|
};
|
|
130
130
|
userNameOrId: {
|
|
131
131
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
132
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
132
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
133
133
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
134
134
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
135
135
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getUserId } from "../../common/methods.mjs";
|
|
4
5
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/post-lists-id-members";
|
|
@@ -6,7 +7,7 @@ export default defineAction({
|
|
|
6
7
|
key: "twitter-add-user-to-list",
|
|
7
8
|
name: "Add User To List",
|
|
8
9
|
description: `Add a member to a list owned by the user. [See docs here](${DOCS_LINK})`,
|
|
9
|
-
version: "1.0.
|
|
10
|
+
version: "1.0.4",
|
|
10
11
|
type: "action",
|
|
11
12
|
props: {
|
|
12
13
|
app,
|
|
@@ -27,18 +28,24 @@ export default defineAction({
|
|
|
27
28
|
getUserId,
|
|
28
29
|
},
|
|
29
30
|
async run({ $ }) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
try {
|
|
32
|
+
const userId = await this.getUserId();
|
|
33
|
+
const params = {
|
|
34
|
+
$,
|
|
35
|
+
data: {
|
|
36
|
+
user_id: userId,
|
|
37
|
+
},
|
|
38
|
+
listId: this.listId,
|
|
39
|
+
};
|
|
40
|
+
const response = await this.app.addUserToList(params);
|
|
41
|
+
$.export("$summary", response.data?.is_member !== true
|
|
42
|
+
? "User not added to list"
|
|
43
|
+
: "Successfully added user to list");
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
$.export("error", err);
|
|
48
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
49
|
+
}
|
|
43
50
|
},
|
|
44
51
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateTweetParams } from "../../common/types/requestParams.js";
|
|
2
2
|
declare const _default: import("@pipedream/types").Action<unknown, {
|
|
3
3
|
app: import("@pipedream/types").App<{
|
|
4
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
4
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
5
5
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
6
6
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
7
7
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets";
|
|
4
5
|
export default defineAction({
|
|
5
6
|
key: "twitter-create-tweet",
|
|
6
7
|
name: "Create Tweet",
|
|
7
8
|
description: `Create a new tweet. [See docs here](${DOCS_LINK})`,
|
|
8
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.3",
|
|
9
10
|
type: "action",
|
|
10
11
|
props: {
|
|
11
12
|
app,
|
|
@@ -47,32 +48,38 @@ export default defineAction({
|
|
|
47
48
|
},
|
|
48
49
|
},
|
|
49
50
|
async run({ $ }) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
51
|
+
try {
|
|
52
|
+
const { text, inReplyToTweetId, excludeReplyUserIds, mediaIds, placeId, taggedUserIds, } = this;
|
|
53
|
+
const params = {
|
|
54
|
+
$,
|
|
55
|
+
data: {
|
|
56
|
+
text,
|
|
57
|
+
...((inReplyToTweetId || excludeReplyUserIds) && {
|
|
58
|
+
reply: {
|
|
59
|
+
exclude_reply_user_ids: excludeReplyUserIds,
|
|
60
|
+
in_reply_to_tweet_id: inReplyToTweetId,
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
...((mediaIds || taggedUserIds) && {
|
|
64
|
+
media: {
|
|
65
|
+
media_ids: mediaIds,
|
|
66
|
+
tagged_user_ids: taggedUserIds,
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
...(placeId && {
|
|
70
|
+
geo: {
|
|
71
|
+
place_id: placeId,
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
const response = await this.app.createTweet(params);
|
|
77
|
+
$.export("$summary", `Successfully posted tweet (ID ${response.data?.id})`);
|
|
78
|
+
return response;
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
$.export("error", err);
|
|
82
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
83
|
+
}
|
|
77
84
|
},
|
|
78
85
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeleteTweetParams } from "../../common/types/requestParams.js";
|
|
2
2
|
declare const _default: import("@pipedream/types").Action<unknown, {
|
|
3
3
|
app: import("@pipedream/types").App<{
|
|
4
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
4
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
5
5
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
6
6
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
7
7
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -63,7 +63,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
63
63
|
}>;
|
|
64
64
|
tweetId: {
|
|
65
65
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
66
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
66
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
67
67
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
68
68
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
69
69
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/delete-tweets-id";
|
|
4
5
|
export default defineAction({
|
|
5
6
|
key: "twitter-delete-tweet",
|
|
6
7
|
name: "Delete Tweet",
|
|
7
8
|
description: `Remove a posted tweet. [See docs here](${DOCS_LINK})`,
|
|
8
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.3",
|
|
9
10
|
type: "action",
|
|
10
11
|
props: {
|
|
11
12
|
app,
|
|
@@ -17,13 +18,19 @@ export default defineAction({
|
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
20
|
async run({ $ }) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
try {
|
|
22
|
+
const { tweetId } = this;
|
|
23
|
+
const params = {
|
|
24
|
+
$,
|
|
25
|
+
tweetId,
|
|
26
|
+
};
|
|
27
|
+
const response = await this.app.deleteTweet(params);
|
|
28
|
+
$.export("$summary", `Successfully deleted tweet (ID ${tweetId})`);
|
|
29
|
+
return response;
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
$.export("error", err);
|
|
33
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
34
|
+
}
|
|
28
35
|
},
|
|
29
36
|
});
|
|
@@ -4,7 +4,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
4
4
|
getUserId: typeof getUserId;
|
|
5
5
|
}, {
|
|
6
6
|
app: import("@pipedream/types").App<{
|
|
7
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
7
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
8
8
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
9
9
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
10
10
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -66,7 +66,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
66
66
|
}>;
|
|
67
67
|
userNameOrId: {
|
|
68
68
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
69
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
69
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
70
70
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
71
71
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
72
72
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getUserId } from "../../common/methods.mjs";
|
|
4
5
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following";
|
|
@@ -6,7 +7,7 @@ export default defineAction({
|
|
|
6
7
|
key: "twitter-follow-user",
|
|
7
8
|
name: "Follow User",
|
|
8
9
|
description: `Follow a user. [See docs here](${DOCS_LINK})`,
|
|
9
|
-
version: "1.0.
|
|
10
|
+
version: "1.0.4",
|
|
10
11
|
type: "action",
|
|
11
12
|
props: {
|
|
12
13
|
app,
|
|
@@ -21,17 +22,23 @@ export default defineAction({
|
|
|
21
22
|
getUserId,
|
|
22
23
|
},
|
|
23
24
|
async run({ $ }) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
try {
|
|
26
|
+
const userId = await this.getUserId();
|
|
27
|
+
const params = {
|
|
28
|
+
$,
|
|
29
|
+
data: {
|
|
30
|
+
target_user_id: userId,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const response = await this.app.followUser(params);
|
|
34
|
+
$.export("$summary", `Successfully ${response.data?.following
|
|
35
|
+
? "followed"
|
|
36
|
+
: "requested to follow"} user`);
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
$.export("error", err);
|
|
41
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
42
|
+
}
|
|
36
43
|
},
|
|
37
44
|
});
|
|
@@ -5,7 +5,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
5
5
|
getTweetFields: typeof getTweetFields;
|
|
6
6
|
}, {
|
|
7
7
|
app: import("@pipedream/types").App<{
|
|
8
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
8
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
9
9
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
10
10
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
11
11
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -67,7 +67,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
67
67
|
}>;
|
|
68
68
|
tweetId: {
|
|
69
69
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
70
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
70
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
71
71
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
72
72
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
73
73
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getTweetFields } from "../../common/methods.mjs";
|
|
4
5
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id";
|
|
@@ -6,7 +7,7 @@ export default defineAction({
|
|
|
6
7
|
key: "twitter-get-tweet",
|
|
7
8
|
name: "Get Tweet",
|
|
8
9
|
description: `Return a single tweet specified by ID. [See docs here](${DOCS_LINK})`,
|
|
9
|
-
version: "1.1.
|
|
10
|
+
version: "1.1.3",
|
|
10
11
|
type: "action",
|
|
11
12
|
props: {
|
|
12
13
|
app,
|
|
@@ -21,14 +22,20 @@ export default defineAction({
|
|
|
21
22
|
getTweetFields,
|
|
22
23
|
},
|
|
23
24
|
async run({ $ }) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
try {
|
|
26
|
+
const { tweetId } = this;
|
|
27
|
+
const params = {
|
|
28
|
+
$,
|
|
29
|
+
params: this.getTweetFields(),
|
|
30
|
+
tweetId,
|
|
31
|
+
};
|
|
32
|
+
const response = await this.app.getTweet(params);
|
|
33
|
+
$.export("$summary", `Successfully retrieved tweet (ID ${tweetId})`);
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
$.export("error", err);
|
|
38
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
39
|
+
}
|
|
33
40
|
},
|
|
34
41
|
});
|
|
@@ -6,7 +6,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
6
6
|
getUserFields: typeof getUserFields;
|
|
7
7
|
}, {
|
|
8
8
|
app: import("@pipedream/types").App<{
|
|
9
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
9
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
10
10
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
11
11
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
12
12
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -68,7 +68,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
68
68
|
}>;
|
|
69
69
|
userNameOrId: {
|
|
70
70
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
71
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
71
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
72
72
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
73
73
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
74
74
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getUserId, getUserFields, } from "../../common/methods.mjs";
|
|
4
5
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id";
|
|
@@ -6,7 +7,7 @@ export default defineAction({
|
|
|
6
7
|
key: "twitter-get-user",
|
|
7
8
|
name: "Get User",
|
|
8
9
|
description: `Get information about a user. [See docs here](${DOCS_LINK})`,
|
|
9
|
-
version: "1.1.
|
|
10
|
+
version: "1.1.3",
|
|
10
11
|
type: "action",
|
|
11
12
|
props: {
|
|
12
13
|
app,
|
|
@@ -22,19 +23,25 @@ export default defineAction({
|
|
|
22
23
|
getUserFields,
|
|
23
24
|
},
|
|
24
25
|
async run({ $ }) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
try {
|
|
27
|
+
let response;
|
|
28
|
+
const params = {
|
|
29
|
+
$,
|
|
30
|
+
params: this.getUserFields(),
|
|
31
|
+
};
|
|
32
|
+
if (this.userNameOrId === "me") {
|
|
33
|
+
response = await this.app.getAuthenticatedUser(params);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
params.userId = await this.getUserId();
|
|
37
|
+
response = await this.app.getUser(params);
|
|
38
|
+
}
|
|
39
|
+
$.export("$summary", `Successfully retrieved user "${response.data?.username}"`);
|
|
40
|
+
return response;
|
|
32
41
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
catch (err) {
|
|
43
|
+
$.export("error", err);
|
|
44
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
36
45
|
}
|
|
37
|
-
$.export("$summary", `Successfully retrieved user "${response.data?.username}"`);
|
|
38
|
-
return response;
|
|
39
46
|
},
|
|
40
47
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LikeTweetParams } from "../../common/types/requestParams.js";
|
|
2
2
|
declare const _default: import("@pipedream/types").Action<unknown, {
|
|
3
3
|
app: import("@pipedream/types").App<{
|
|
4
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
4
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
5
5
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
6
6
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
7
7
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -63,7 +63,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
63
63
|
}>;
|
|
64
64
|
tweetId: {
|
|
65
65
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
66
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
66
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
67
67
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
68
68
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
69
69
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-id-likes";
|
|
4
5
|
export default defineAction({
|
|
5
6
|
key: "twitter-like-tweet",
|
|
6
7
|
name: "Like Tweet",
|
|
7
8
|
description: `Like a tweet specified by its ID. [See docs here](${DOCS_LINK})`,
|
|
8
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.3",
|
|
9
10
|
type: "action",
|
|
10
11
|
props: {
|
|
11
12
|
app,
|
|
@@ -17,15 +18,21 @@ export default defineAction({
|
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
20
|
async run({ $ }) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
try {
|
|
22
|
+
const { tweetId } = this;
|
|
23
|
+
const params = {
|
|
24
|
+
$,
|
|
25
|
+
data: {
|
|
26
|
+
tweet_id: tweetId,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const response = await this.app.likeTweet(params);
|
|
30
|
+
$.export("$summary", `Successfully liked tweet (ID ${tweetId})`);
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
$.export("error", err);
|
|
35
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
36
|
+
}
|
|
30
37
|
},
|
|
31
38
|
});
|
|
@@ -9,7 +9,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
9
9
|
getTweetFields: typeof getTweetFields;
|
|
10
10
|
}, {
|
|
11
11
|
app: import("@pipedream/types").App<{
|
|
12
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
12
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
13
13
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
14
14
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
15
15
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -71,7 +71,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
71
71
|
}>;
|
|
72
72
|
userNameOrId: {
|
|
73
73
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
74
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
74
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
75
75
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
76
76
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
77
77
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -134,7 +134,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
134
134
|
};
|
|
135
135
|
maxResults: {
|
|
136
136
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
137
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
137
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
138
138
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
139
139
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
140
140
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -195,7 +195,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
195
195
|
};
|
|
196
196
|
}>)[];
|
|
197
197
|
min: number;
|
|
198
|
-
|
|
198
|
+
description: string;
|
|
199
199
|
default: number;
|
|
200
200
|
};
|
|
201
201
|
}>;
|