@pipedream/twitter 2.0.2 → 2.1.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.
- package/dist/actions/add-user-to-list/add-user-to-list.d.ts +12 -6
- package/dist/actions/add-user-to-list/add-user-to-list.mjs +2 -2
- package/dist/actions/create-tweet/create-tweet.d.ts +4 -2
- package/dist/actions/create-tweet/create-tweet.mjs +2 -2
- package/dist/actions/delete-tweet/delete-tweet.d.ts +8 -4
- package/dist/actions/delete-tweet/delete-tweet.mjs +2 -2
- package/dist/actions/follow-user/follow-user.d.ts +8 -4
- package/dist/actions/follow-user/follow-user.mjs +2 -2
- package/dist/actions/get-tweet/get-tweet.d.ts +8 -4
- package/dist/actions/get-tweet/get-tweet.mjs +2 -2
- package/dist/actions/get-user/get-user.d.ts +8 -4
- package/dist/actions/get-user/get-user.mjs +2 -2
- package/dist/actions/like-tweet/like-tweet.d.ts +8 -4
- package/dist/actions/like-tweet/like-tweet.mjs +2 -2
- package/dist/actions/list-favorites/list-favorites.d.ts +12 -6
- package/dist/actions/list-favorites/list-favorites.mjs +2 -2
- package/dist/actions/list-followers/list-followers.d.ts +12 -6
- package/dist/actions/list-followers/list-followers.mjs +2 -2
- package/dist/actions/list-lists/list-lists.d.ts +12 -6
- package/dist/actions/list-lists/list-lists.mjs +2 -2
- package/dist/actions/list-mentions/list-mentions.d.ts +12 -6
- package/dist/actions/list-mentions/list-mentions.mjs +2 -2
- package/dist/actions/list-user-tweets/list-user-tweets.d.ts +12 -6
- package/dist/actions/list-user-tweets/list-user-tweets.mjs +2 -2
- package/dist/actions/retweet/retweet.d.ts +8 -4
- package/dist/actions/retweet/retweet.mjs +2 -2
- package/dist/actions/send-dm/send-dm.d.ts +144 -0
- package/dist/actions/send-dm/send-dm.mjs +50 -0
- package/dist/actions/simple-search/simple-search.d.ts +12 -6
- package/dist/actions/simple-search/simple-search.mjs +2 -2
- package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +12 -6
- package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +2 -2
- package/dist/actions/unfollow-user/unfollow-user.d.ts +8 -4
- package/dist/actions/unfollow-user/unfollow-user.mjs +2 -2
- package/dist/actions/unlike-tweet/unlike-tweet.d.ts +8 -4
- package/dist/actions/unlike-tweet/unlike-tweet.mjs +2 -2
- package/dist/actions/upload-media/upload-media.d.ts +4 -2
- package/dist/actions/upload-media/upload-media.mjs +13 -10
- package/dist/app/twitter.app.d.ts +6 -4
- package/dist/app/twitter.app.mjs +38 -8
- package/dist/common/dataFields.d.ts +2 -0
- package/dist/common/dataFields.mjs +17 -0
- package/dist/common/expansions.d.ts +1 -0
- package/dist/common/expansions.mjs +6 -0
- package/dist/common/methods.d.ts +7 -0
- package/dist/common/methods.mjs +21 -2
- package/dist/common/types/fields.d.ts +7 -0
- package/dist/common/types/requestParams.d.ts +16 -3
- package/dist/common/types/responseSchemas.d.ts +11 -1
- package/dist/sources/common/base.d.ts +4 -2
- package/dist/sources/common/getItemSummary.d.ts +2 -2
- package/dist/sources/common/getItemSummary.mjs +3 -3
- package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +8 -4
- package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +2 -2
- package/dist/sources/new-list-followed/new-list-followed.d.ts +8 -4
- package/dist/sources/new-list-followed/new-list-followed.mjs +2 -2
- package/dist/sources/new-message/new-message.d.ts +87 -0
- package/dist/sources/new-message/new-message.mjs +35 -0
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +8 -4
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +2 -2
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +8 -4
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +2 -2
- package/dist/sources/new-tweet-metrics/new-tweet-metrics.d.ts +158 -0
- package/dist/sources/new-tweet-metrics/new-tweet-metrics.mjs +66 -0
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +8 -4
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +2 -2
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +8 -4
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +2 -2
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +8 -4
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +2 -2
- package/dist/sources/new-user-followed/new-user-followed.d.ts +8 -4
- package/dist/sources/new-user-followed/new-user-followed.mjs +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -3,7 +3,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
3
3
|
app: import("@pipedream/types").App<{
|
|
4
4
|
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
5
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>>;
|
|
6
|
+
_httpRequest({ $, specialAuth, ...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>>;
|
|
8
8
|
addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
|
|
9
9
|
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
@@ -13,6 +13,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
13
13
|
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
14
14
|
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
15
15
|
getAuthenticatedUserId(): Promise<string>;
|
|
16
|
+
getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
|
|
16
17
|
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
17
18
|
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
18
19
|
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
@@ -25,9 +26,10 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
25
26
|
getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
26
27
|
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
27
28
|
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
29
|
+
sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
|
|
28
30
|
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
29
31
|
unlikeTweet({ tweetId, ...args }: UnlikeTweetParams): Promise<object>;
|
|
30
|
-
uploadMedia(
|
|
32
|
+
uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
|
|
31
33
|
}, {
|
|
32
34
|
maxResults: {
|
|
33
35
|
type: string;
|
|
@@ -66,7 +68,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
66
68
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
67
69
|
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
68
70
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
69
|
-
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
71
|
+
_httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
70
72
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
71
73
|
addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
|
|
72
74
|
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
@@ -76,6 +78,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
76
78
|
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
77
79
|
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
78
80
|
getAuthenticatedUserId(): Promise<string>;
|
|
81
|
+
getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
|
|
79
82
|
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
80
83
|
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
81
84
|
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
@@ -88,9 +91,10 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
88
91
|
getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
89
92
|
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
90
93
|
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
94
|
+
sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
|
|
91
95
|
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
92
96
|
unlikeTweet({ tweetId, ...args }: UnlikeTweetParams): Promise<object>;
|
|
93
|
-
uploadMedia(
|
|
97
|
+
uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
|
|
94
98
|
}, {
|
|
95
99
|
maxResults: {
|
|
96
100
|
type: string;
|
|
@@ -5,8 +5,8 @@ const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/like
|
|
|
5
5
|
export default defineAction({
|
|
6
6
|
key: "twitter-unlike-tweet",
|
|
7
7
|
name: "Unlike Tweet",
|
|
8
|
-
description: `Unlike a tweet specified by its ID. [See
|
|
9
|
-
version: "2.0.
|
|
8
|
+
description: `Unlike a tweet specified by its ID. [See the documentation](${DOCS_LINK})`,
|
|
9
|
+
version: "2.0.3",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
app,
|
|
@@ -2,7 +2,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
2
2
|
app: import("@pipedream/types").App<{
|
|
3
3
|
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
4
4
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
5
|
-
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
5
|
+
_httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
6
6
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
7
7
|
addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
|
|
8
8
|
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
@@ -12,6 +12,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
12
12
|
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
13
13
|
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
14
14
|
getAuthenticatedUserId(): Promise<string>;
|
|
15
|
+
getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
|
|
15
16
|
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
16
17
|
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
17
18
|
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
@@ -24,9 +25,10 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
24
25
|
getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
25
26
|
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
26
27
|
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
28
|
+
sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
|
|
27
29
|
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
28
30
|
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
29
|
-
uploadMedia(
|
|
31
|
+
uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
|
|
30
32
|
}, {
|
|
31
33
|
maxResults: {
|
|
32
34
|
type: string;
|
|
@@ -4,19 +4,20 @@ import { defineAction } from "@pipedream/types";
|
|
|
4
4
|
import constants from "../../common/constants.mjs";
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import { axios } from "@pipedream/platform";
|
|
7
|
+
import FormData from "form-data";
|
|
7
8
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload";
|
|
8
9
|
export default defineAction({
|
|
9
10
|
key: "twitter-upload-media",
|
|
10
11
|
name: "Upload Media",
|
|
11
12
|
description: `Upload new media. [See the documentation](${DOCS_LINK})`,
|
|
12
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.6",
|
|
13
14
|
type: "action",
|
|
14
15
|
props: {
|
|
15
16
|
app,
|
|
16
17
|
filePath: {
|
|
17
18
|
type: "string",
|
|
18
19
|
label: "File Path",
|
|
19
|
-
description: "
|
|
20
|
+
description: "A file URL or a file path in the `/tmp` directory. [See the documentation on working with files.](https://pipedream.com/docs/code/nodejs/working-with-files/)",
|
|
20
21
|
optional: false,
|
|
21
22
|
},
|
|
22
23
|
media_category: {
|
|
@@ -29,18 +30,20 @@ export default defineAction({
|
|
|
29
30
|
},
|
|
30
31
|
async run({ $ }) {
|
|
31
32
|
try {
|
|
32
|
-
const
|
|
33
|
-
? fs.
|
|
34
|
-
|
|
33
|
+
const content = this.filePath.startsWith("/tmp")
|
|
34
|
+
? fs.createReadStream(this.filePath, {
|
|
35
|
+
encoding: "binary",
|
|
36
|
+
})
|
|
37
|
+
: await axios($, {
|
|
35
38
|
url: this.filePath,
|
|
36
39
|
responseType: "arraybuffer",
|
|
37
|
-
})
|
|
40
|
+
});
|
|
41
|
+
const data = new FormData();
|
|
42
|
+
data.append("media", content);
|
|
43
|
+
data.append("media_category", this.media_category);
|
|
38
44
|
const response = await this.app.uploadMedia({
|
|
39
45
|
$,
|
|
40
|
-
|
|
41
|
-
media_category: this.media_category,
|
|
42
|
-
media_data: base64File,
|
|
43
|
-
})),
|
|
46
|
+
data,
|
|
44
47
|
});
|
|
45
48
|
$.export("$summary", `Successfully uploaded media with ID ${response.media_id}`);
|
|
46
49
|
return response;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import OAuth from "oauth-1.0a";
|
|
2
|
-
import { AddUserToListParams, CreateTweetParams, DeleteTweetParams, FollowUserParams, GetUserLikedTweetParams, GetUserOwnedListsParams, GetTweetParams, GetUserFollowedListsParams, GetUserMentionsParams, GetUserParams, GetUserTweetsParams, HttpRequestParams, LikeTweetParams, GetUserFollowersParams, GetUserFollowingParams, PaginatedRequestParams, RetweetParams, SearchTweetsParams, UnfollowUserParams, UnlikeTweetParams, GetListTweetsParams, GetAuthenticatedUserParams, UploadMediaParams } from "../common/types/requestParams.js";
|
|
3
|
-
import { List, PaginatedResponseObject, ResponseObject, Tweet, TwitterEntity, User } from "../common/types/responseSchemas.js";
|
|
2
|
+
import { AddUserToListParams, CreateTweetParams, DeleteTweetParams, FollowUserParams, GetUserLikedTweetParams, GetUserOwnedListsParams, GetTweetParams, GetUserFollowedListsParams, GetUserMentionsParams, GetUserParams, GetUserTweetsParams, HttpRequestParams, LikeTweetParams, GetUserFollowersParams, GetUserFollowingParams, PaginatedRequestParams, RetweetParams, SearchTweetsParams, UnfollowUserParams, UnlikeTweetParams, GetListTweetsParams, GetAuthenticatedUserParams, SendMessageParams, GetDirectMessagesParams, UploadMediaParams } from "../common/types/requestParams.js";
|
|
3
|
+
import { DirectMessage, List, PaginatedResponseObject, ResponseObject, Tweet, TwitterEntity, User } from "../common/types/responseSchemas.js";
|
|
4
4
|
declare const _default: import("@pipedream/types").App<{
|
|
5
5
|
_getAuthHeader(config: HttpRequestParams): OAuth.Header;
|
|
6
6
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
7
|
-
_httpRequest({ $, ...args }: HttpRequestParams): Promise<ResponseObject<TwitterEntity>>;
|
|
7
|
+
_httpRequest({ $, specialAuth, ...args }: HttpRequestParams): Promise<ResponseObject<TwitterEntity>>;
|
|
8
8
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: PaginatedRequestParams): Promise<PaginatedResponseObject<TwitterEntity>>;
|
|
9
9
|
addUserToList({ listId, ...args }: AddUserToListParams): Promise<object>;
|
|
10
10
|
createTweet(args: CreateTweetParams): Promise<object>;
|
|
@@ -14,6 +14,7 @@ declare const _default: import("@pipedream/types").App<{
|
|
|
14
14
|
getTweet({ tweetId, ...args }: GetTweetParams): Promise<ResponseObject<Tweet>>;
|
|
15
15
|
getAuthenticatedUser(args: GetAuthenticatedUserParams): Promise<ResponseObject<User>>;
|
|
16
16
|
getAuthenticatedUserId(): Promise<User["id"]>;
|
|
17
|
+
getDirectMessages(args: GetDirectMessagesParams): Promise<PaginatedResponseObject<DirectMessage>>;
|
|
17
18
|
getUserLikedTweets({ userId, ...args }: GetUserLikedTweetParams): Promise<PaginatedResponseObject<Tweet>>;
|
|
18
19
|
getUserOwnedLists({ userId, ...args }: GetUserOwnedListsParams): Promise<PaginatedResponseObject<List>>;
|
|
19
20
|
getUserFollowedLists({ userId, ...args }: GetUserFollowedListsParams): Promise<PaginatedResponseObject<List>>;
|
|
@@ -26,9 +27,10 @@ declare const _default: import("@pipedream/types").App<{
|
|
|
26
27
|
getUserFollowing({ userId, ...args }: GetUserFollowingParams): Promise<PaginatedResponseObject<User>>;
|
|
27
28
|
retweet(args: RetweetParams): Promise<object>;
|
|
28
29
|
searchTweets(args: SearchTweetsParams): Promise<PaginatedResponseObject<Tweet>>;
|
|
30
|
+
sendMessage({ userId, ...args }: SendMessageParams): Promise<object>;
|
|
29
31
|
unfollowUser({ userId, ...args }: UnfollowUserParams): Promise<object>;
|
|
30
32
|
unlikeTweet({ tweetId, ...args }: UnlikeTweetParams): Promise<object>;
|
|
31
|
-
uploadMedia(
|
|
33
|
+
uploadMedia(args: UploadMediaParams): Promise<object>;
|
|
32
34
|
}, {
|
|
33
35
|
maxResults: {
|
|
34
36
|
type: string;
|
package/dist/app/twitter.app.mjs
CHANGED
|
@@ -89,16 +89,28 @@ export default defineApp({
|
|
|
89
89
|
_getBaseUrl() {
|
|
90
90
|
return "https://api.twitter.com/2";
|
|
91
91
|
},
|
|
92
|
-
async _httpRequest({ $ = this, ...args }) {
|
|
92
|
+
async _httpRequest({ $ = this, specialAuth, ...args }) {
|
|
93
93
|
const config = {
|
|
94
94
|
baseURL: this._getBaseUrl(),
|
|
95
95
|
...args,
|
|
96
96
|
};
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
const authConfig = specialAuth
|
|
98
|
+
? {
|
|
99
|
+
...config,
|
|
100
|
+
params: {},
|
|
101
|
+
data: {},
|
|
102
|
+
}
|
|
103
|
+
: config;
|
|
104
|
+
const request = async () => {
|
|
105
|
+
const headers = {
|
|
106
|
+
...config.headers,
|
|
107
|
+
...this._getAuthHeader(authConfig),
|
|
108
|
+
};
|
|
109
|
+
return axios($, {
|
|
110
|
+
...config,
|
|
111
|
+
headers,
|
|
112
|
+
});
|
|
113
|
+
};
|
|
102
114
|
let response, counter = 1;
|
|
103
115
|
do {
|
|
104
116
|
try {
|
|
@@ -207,6 +219,12 @@ export default defineApp({
|
|
|
207
219
|
const response = await this.getAuthenticatedUser();
|
|
208
220
|
return response.data.id;
|
|
209
221
|
},
|
|
222
|
+
async getDirectMessages(args) {
|
|
223
|
+
return this._paginatedRequest({
|
|
224
|
+
url: "/dm_events",
|
|
225
|
+
...args,
|
|
226
|
+
});
|
|
227
|
+
},
|
|
210
228
|
async getUserLikedTweets({ userId, ...args }) {
|
|
211
229
|
return this._paginatedRequest({
|
|
212
230
|
url: `/users/${userId}/liked_tweets`,
|
|
@@ -282,6 +300,13 @@ export default defineApp({
|
|
|
282
300
|
...args,
|
|
283
301
|
});
|
|
284
302
|
},
|
|
303
|
+
async sendMessage({ userId, ...args }) {
|
|
304
|
+
return this._httpRequest({
|
|
305
|
+
method: "POST",
|
|
306
|
+
url: `/dm_conversations/with/${userId}/messages`,
|
|
307
|
+
...args,
|
|
308
|
+
});
|
|
309
|
+
},
|
|
285
310
|
async unfollowUser({ userId, ...args }) {
|
|
286
311
|
const id = await this.getAuthenticatedUserId();
|
|
287
312
|
return this._httpRequest({
|
|
@@ -298,10 +323,15 @@ export default defineApp({
|
|
|
298
323
|
...args,
|
|
299
324
|
});
|
|
300
325
|
},
|
|
301
|
-
async uploadMedia(
|
|
326
|
+
async uploadMedia(args) {
|
|
302
327
|
return this._httpRequest({
|
|
303
|
-
|
|
328
|
+
baseURL: "https://upload.twitter.com/1.1",
|
|
329
|
+
url: "/media/upload.json",
|
|
304
330
|
method: "POST",
|
|
331
|
+
headers: {
|
|
332
|
+
"Content-Type": `multipart/form-data; boundary=${args.data.getBoundary()}`,
|
|
333
|
+
},
|
|
334
|
+
specialAuth: true,
|
|
305
335
|
...args,
|
|
306
336
|
});
|
|
307
337
|
},
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const LIST_FIELD_OPTIONS: string[];
|
|
2
2
|
export declare const MEDIA_FIELD_OPTIONS: string[];
|
|
3
|
+
export declare const MESSAGE_FIELD_OPTIONS: string[];
|
|
4
|
+
export declare const METRICS_FIELDS: string[];
|
|
3
5
|
export declare const PLACE_FIELD_OPTIONS: string[];
|
|
4
6
|
export declare const POLL_FIELD_OPTIONS: string[];
|
|
5
7
|
export declare const TWEET_FIELD_OPTIONS: string[];
|
|
@@ -21,6 +21,23 @@ export const MEDIA_FIELD_OPTIONS = [
|
|
|
21
21
|
"alt_text",
|
|
22
22
|
"variants",
|
|
23
23
|
];
|
|
24
|
+
export const MESSAGE_FIELD_OPTIONS = [
|
|
25
|
+
"id",
|
|
26
|
+
"text",
|
|
27
|
+
"event_type",
|
|
28
|
+
"created_at",
|
|
29
|
+
"dm_conversation_id",
|
|
30
|
+
"sender_id",
|
|
31
|
+
"participant_ids",
|
|
32
|
+
"referenced_tweets",
|
|
33
|
+
"attachments",
|
|
34
|
+
];
|
|
35
|
+
export const METRICS_FIELDS = [
|
|
36
|
+
"public_metrics",
|
|
37
|
+
"non_public_metrics",
|
|
38
|
+
"organic_metrics",
|
|
39
|
+
"promoted_metrics",
|
|
40
|
+
];
|
|
24
41
|
export const PLACE_FIELD_OPTIONS = [
|
|
25
42
|
"contained_within",
|
|
26
43
|
"country",
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export const LIST_EXPANSION_OPTIONS = [
|
|
2
2
|
"owner_id",
|
|
3
3
|
];
|
|
4
|
+
export const MESSAGE_EXPANSION_OPTIONS = [
|
|
5
|
+
"attachments.media_keys",
|
|
6
|
+
"referenced_tweets.id",
|
|
7
|
+
"sender_id",
|
|
8
|
+
"participant_ids",
|
|
9
|
+
];
|
|
4
10
|
export const TWEET_EXPANSION_OPTIONS = [
|
|
5
11
|
"attachments.poll_ids",
|
|
6
12
|
"attachments.media_keys",
|
package/dist/common/methods.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ export declare function getListFields(): {
|
|
|
5
5
|
"list.fields": string;
|
|
6
6
|
"user.fields": string;
|
|
7
7
|
};
|
|
8
|
+
export declare function getMessageFields(): {
|
|
9
|
+
"dm_event.fields": string;
|
|
10
|
+
expansions: string;
|
|
11
|
+
"media.fields": string;
|
|
12
|
+
"tweet.fields": string;
|
|
13
|
+
"user.fields": string;
|
|
14
|
+
};
|
|
8
15
|
export declare function getTweetFields(): {
|
|
9
16
|
expansions: string;
|
|
10
17
|
"media.fields": string;
|
package/dist/common/methods.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
-
import { LIST_FIELD_OPTIONS, MEDIA_FIELD_OPTIONS, PLACE_FIELD_OPTIONS, POLL_FIELD_OPTIONS, TWEET_FIELD_OPTIONS, USER_FIELD_OPTIONS, } from "./dataFields.mjs";
|
|
3
|
-
import { LIST_EXPANSION_OPTIONS, TWEET_EXPANSION_OPTIONS, USER_EXPANSION_OPTIONS, } from "./expansions.mjs";
|
|
2
|
+
import { LIST_FIELD_OPTIONS, MEDIA_FIELD_OPTIONS, MESSAGE_FIELD_OPTIONS, PLACE_FIELD_OPTIONS, POLL_FIELD_OPTIONS, TWEET_FIELD_OPTIONS, USER_FIELD_OPTIONS, } from "./dataFields.mjs";
|
|
3
|
+
import { LIST_EXPANSION_OPTIONS, MESSAGE_EXPANSION_OPTIONS, TWEET_EXPANSION_OPTIONS, USER_EXPANSION_OPTIONS, } from "./expansions.mjs";
|
|
4
4
|
export async function getUserId() {
|
|
5
5
|
let { userNameOrId: id } = this;
|
|
6
6
|
if (id === "me" || id === undefined) {
|
|
@@ -34,6 +34,25 @@ export function getListFields() {
|
|
|
34
34
|
"user.fields": USER_FIELD_OPTIONS.join(),
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
+
export function getMessageFields() {
|
|
38
|
+
/*
|
|
39
|
+
const {
|
|
40
|
+
includeAllFields,
|
|
41
|
+
expansions,
|
|
42
|
+
mediaFields,
|
|
43
|
+
messageFields,
|
|
44
|
+
tweetFields,
|
|
45
|
+
userFields,
|
|
46
|
+
}: Record<string, string[]> = this;
|
|
47
|
+
*/
|
|
48
|
+
return {
|
|
49
|
+
"dm_event.fields": MESSAGE_FIELD_OPTIONS.join(),
|
|
50
|
+
"expansions": MESSAGE_EXPANSION_OPTIONS.join(),
|
|
51
|
+
"media.fields": MEDIA_FIELD_OPTIONS.join(),
|
|
52
|
+
"tweet.fields": TWEET_FIELD_OPTIONS.join(),
|
|
53
|
+
"user.fields": USER_FIELD_OPTIONS.join(),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
37
56
|
export function getTweetFields() {
|
|
38
57
|
/*
|
|
39
58
|
const {
|
|
@@ -3,6 +3,13 @@ export interface ListFields {
|
|
|
3
3
|
"list.fields"?: string;
|
|
4
4
|
"user.fields"?: string;
|
|
5
5
|
}
|
|
6
|
+
export interface MessageFields {
|
|
7
|
+
expansions?: string;
|
|
8
|
+
"dm_event.fields"?: string;
|
|
9
|
+
"media.fields"?: string;
|
|
10
|
+
"tweet.fields"?: string;
|
|
11
|
+
"user.fields"?: string;
|
|
12
|
+
}
|
|
6
13
|
export interface UserFields {
|
|
7
14
|
expansions?: string;
|
|
8
15
|
"tweet.fields"?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Pipedream } from "@pipedream/types";
|
|
2
|
-
import { ListFields, TweetFields, UserFields } from "./fields.js";
|
|
2
|
+
import { ListFields, MessageFields, TweetFields, UserFields } from "./fields.js";
|
|
3
|
+
import FormData from "form-data";
|
|
3
4
|
interface PdAxiosRequest {
|
|
4
5
|
$: Pipedream;
|
|
5
6
|
}
|
|
@@ -12,8 +13,11 @@ interface PaginatedRequest extends PdAxiosRequest, PaginationParams {
|
|
|
12
13
|
export interface HttpRequestParams extends PdAxiosRequest {
|
|
13
14
|
url: string;
|
|
14
15
|
method: string;
|
|
16
|
+
headers?: object;
|
|
15
17
|
data?: object | string;
|
|
16
18
|
params?: object;
|
|
19
|
+
baseURL?: string;
|
|
20
|
+
specialAuth?: boolean;
|
|
17
21
|
}
|
|
18
22
|
export interface PaginatedRequestParams extends HttpRequestParams, PaginationParams {
|
|
19
23
|
}
|
|
@@ -55,6 +59,11 @@ export interface FollowUserParams extends PdAxiosRequest {
|
|
|
55
59
|
target_user_id: string;
|
|
56
60
|
};
|
|
57
61
|
}
|
|
62
|
+
export interface GetDirectMessagesParams extends PaginatedRequest {
|
|
63
|
+
params?: MessageFields & {
|
|
64
|
+
event_types: "MessageCreate";
|
|
65
|
+
};
|
|
66
|
+
}
|
|
58
67
|
export interface GetUserLikedTweetParams extends PaginatedRequest, UserId {
|
|
59
68
|
params?: TweetFields;
|
|
60
69
|
}
|
|
@@ -98,12 +107,16 @@ export interface SearchTweetsParams extends PaginatedRequest {
|
|
|
98
107
|
query: string;
|
|
99
108
|
};
|
|
100
109
|
}
|
|
110
|
+
export interface SendMessageParams extends PdAxiosRequest, UserId {
|
|
111
|
+
data: {
|
|
112
|
+
text: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
101
115
|
export interface UnfollowUserParams extends PdAxiosRequest, UserId {
|
|
102
116
|
}
|
|
103
117
|
export interface UnlikeTweetParams extends PdAxiosRequest, TweetId {
|
|
104
118
|
}
|
|
105
119
|
export interface UploadMediaParams extends PdAxiosRequest {
|
|
106
|
-
|
|
107
|
-
media_data: string;
|
|
120
|
+
data: FormData;
|
|
108
121
|
}
|
|
109
122
|
export {};
|
|
@@ -2,10 +2,20 @@ export interface TwitterEntity {
|
|
|
2
2
|
id: string;
|
|
3
3
|
}
|
|
4
4
|
export type TwitterEntityMap = Record<string, object>;
|
|
5
|
+
export interface DirectMessage extends TwitterEntity {
|
|
6
|
+
event_type: "MessageCreate";
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
5
9
|
export interface List extends TwitterEntity {
|
|
6
10
|
name: string;
|
|
7
11
|
}
|
|
8
|
-
|
|
12
|
+
interface MetricsFields {
|
|
13
|
+
public_metrics?: string;
|
|
14
|
+
non_public_metrics?: string;
|
|
15
|
+
organic_metrics?: string;
|
|
16
|
+
promoted_metrics?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Tweet extends TwitterEntity, MetricsFields {
|
|
9
19
|
text: string;
|
|
10
20
|
edit_history_tweet_ids: string[];
|
|
11
21
|
referenced_tweets?: ReferencedTweet[];
|
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
app: import("@pipedream/types").App<{
|
|
5
5
|
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
6
6
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
7
|
-
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<TwitterEntity>>;
|
|
7
|
+
_httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<TwitterEntity>>;
|
|
8
8
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<TwitterEntity>>;
|
|
9
9
|
addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
|
|
10
10
|
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
@@ -14,6 +14,7 @@ declare const _default: {
|
|
|
14
14
|
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
15
15
|
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
16
16
|
getAuthenticatedUserId(): Promise<string>;
|
|
17
|
+
getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
|
|
17
18
|
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
18
19
|
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
19
20
|
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
@@ -26,9 +27,10 @@ declare const _default: {
|
|
|
26
27
|
getUserFollowing({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").User>>;
|
|
27
28
|
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
28
29
|
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
30
|
+
sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
|
|
29
31
|
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
30
32
|
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
31
|
-
uploadMedia(
|
|
33
|
+
uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
|
|
32
34
|
}, {
|
|
33
35
|
maxResults: {
|
|
34
36
|
type: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { List, Tweet, User } from "../../common/types/responseSchemas.js";
|
|
1
|
+
import { DirectMessage, List, Tweet, User } from "../../common/types/responseSchemas.js";
|
|
2
2
|
export declare function getListSummary({ name }: List): string;
|
|
3
|
-
export declare function getTweetSummary({ text }: Tweet): string;
|
|
3
|
+
export declare function getTweetSummary({ text }: Tweet | DirectMessage): string;
|
|
4
4
|
export declare function getUserSummary({ username }: User): string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
const SUMMARY_TEXT_MAX_LENGTH = 30;
|
|
1
2
|
export function getListSummary({ name }) {
|
|
2
3
|
return name;
|
|
3
4
|
}
|
|
4
5
|
export function getTweetSummary({ text }) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
? text.slice(0, TWEET_SUMMARY_MAX_LENGTH) + "..."
|
|
6
|
+
return text.length > SUMMARY_TEXT_MAX_LENGTH
|
|
7
|
+
? text.slice(0, SUMMARY_TEXT_MAX_LENGTH) + "..."
|
|
8
8
|
: text;
|
|
9
9
|
}
|
|
10
10
|
export function getUserSummary({ username }) {
|
|
@@ -18,7 +18,7 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
18
18
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
19
19
|
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
20
20
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
21
|
-
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
21
|
+
_httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
22
22
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
23
23
|
addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
|
|
24
24
|
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
@@ -28,6 +28,7 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
28
28
|
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
29
29
|
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<User>>;
|
|
30
30
|
getAuthenticatedUserId(): Promise<string>;
|
|
31
|
+
getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
|
|
31
32
|
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
32
33
|
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
33
34
|
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
@@ -40,9 +41,10 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
40
41
|
getUserFollowing({ userId, ...args }: GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<User>>;
|
|
41
42
|
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
42
43
|
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
44
|
+
sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
|
|
43
45
|
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
44
46
|
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
45
|
-
uploadMedia(
|
|
47
|
+
uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
|
|
46
48
|
}, {
|
|
47
49
|
maxResults: {
|
|
48
50
|
type: string;
|
|
@@ -81,7 +83,7 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
81
83
|
app: import("@pipedream/types").App<{
|
|
82
84
|
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
83
85
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
84
|
-
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
86
|
+
_httpRequest({ $, specialAuth, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
85
87
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
86
88
|
addUserToList({ listId, ...args }: import("../../common/types/requestParams.js").AddUserToListParams): Promise<object>;
|
|
87
89
|
createTweet(args: import("../../common/types/requestParams.js").CreateTweetParams): Promise<object>;
|
|
@@ -91,6 +93,7 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
91
93
|
getTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").GetTweetParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
92
94
|
getAuthenticatedUser(args: import("../../common/types/requestParams.js").GetAuthenticatedUserParams): Promise<import("../../common/types/responseSchemas").ResponseObject<User>>;
|
|
93
95
|
getAuthenticatedUserId(): Promise<string>;
|
|
96
|
+
getDirectMessages(args: import("../../common/types/requestParams.js").GetDirectMessagesParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").DirectMessage>>;
|
|
94
97
|
getUserLikedTweets({ userId, ...args }: import("../../common/types/requestParams.js").GetUserLikedTweetParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
95
98
|
getUserOwnedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserOwnedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
96
99
|
getUserFollowedLists({ userId, ...args }: import("../../common/types/requestParams.js").GetUserFollowedListsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").List>>;
|
|
@@ -103,9 +106,10 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
103
106
|
getUserFollowing({ userId, ...args }: GetUserFollowersParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<User>>;
|
|
104
107
|
retweet(args: import("../../common/types/requestParams.js").LikeTweetParams): Promise<object>;
|
|
105
108
|
searchTweets(args: import("../../common/types/requestParams.js").SearchTweetsParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").Tweet>>;
|
|
109
|
+
sendMessage({ userId, ...args }: import("../../common/types/requestParams.js").SendMessageParams): Promise<object>;
|
|
106
110
|
unfollowUser({ userId, ...args }: import("../../common/types/requestParams.js").UnfollowUserParams): Promise<object>;
|
|
107
111
|
unlikeTweet({ tweetId, ...args }: import("../../common/types/requestParams.js").UnlikeTweetParams): Promise<object>;
|
|
108
|
-
uploadMedia(
|
|
112
|
+
uploadMedia(args: import("../../common/types/requestParams.js").UploadMediaParams): Promise<object>;
|
|
109
113
|
}, {
|
|
110
114
|
maxResults: {
|
|
111
115
|
type: string;
|
|
@@ -9,8 +9,8 @@ export default defineSource({
|
|
|
9
9
|
...common,
|
|
10
10
|
key: "twitter-new-follower-of-user",
|
|
11
11
|
name: "New Follower Received by User",
|
|
12
|
-
description: `Emit new event when the specified User receives a Follower [See
|
|
13
|
-
version: "2.0.
|
|
12
|
+
description: `Emit new event when the specified User receives a Follower [See the documentation](${DOCS_LINK})`,
|
|
13
|
+
version: "2.0.3",
|
|
14
14
|
type: "source",
|
|
15
15
|
props: {
|
|
16
16
|
...common.props,
|