@pipedream/twitter 2.2.3 → 2.3.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/dist/actions/add-user-to-list/add-user-to-list.d.ts +1 -1
- package/dist/actions/add-user-to-list/add-user-to-list.mjs +1 -1
- package/dist/actions/create-tweet/create-tweet.mjs +1 -1
- package/dist/actions/delete-tweet/delete-tweet.d.ts +1 -1
- package/dist/actions/delete-tweet/delete-tweet.mjs +1 -1
- package/dist/actions/follow-user/follow-user.d.ts +1 -1
- package/dist/actions/follow-user/follow-user.mjs +1 -1
- package/dist/actions/get-tweet/get-tweet.d.ts +1 -1
- package/dist/actions/get-tweet/get-tweet.mjs +1 -1
- package/dist/actions/get-user/get-user.d.ts +1 -1
- package/dist/actions/get-user/get-user.mjs +1 -1
- package/dist/actions/like-tweet/like-tweet.d.ts +1 -1
- package/dist/actions/like-tweet/like-tweet.mjs +1 -1
- package/dist/actions/list-favorites/list-favorites.d.ts +1 -1
- package/dist/actions/list-favorites/list-favorites.mjs +1 -1
- package/dist/actions/list-followers/list-followers.d.ts +1 -1
- package/dist/actions/list-followers/list-followers.mjs +1 -1
- package/dist/actions/list-lists/list-lists.d.ts +1 -1
- package/dist/actions/list-lists/list-lists.mjs +1 -1
- package/dist/actions/list-mentions/list-mentions.d.ts +1 -1
- package/dist/actions/list-mentions/list-mentions.mjs +1 -1
- package/dist/actions/list-user-tweets/list-user-tweets.d.ts +1 -1
- package/dist/actions/list-user-tweets/list-user-tweets.mjs +1 -1
- package/dist/actions/retweet/retweet.d.ts +1 -1
- package/dist/actions/retweet/retweet.mjs +1 -1
- package/dist/actions/send-dm/send-dm.d.ts +1 -1
- package/dist/actions/send-dm/send-dm.mjs +1 -1
- package/dist/actions/simple-search/simple-search.d.ts +1 -1
- package/dist/actions/simple-search/simple-search.mjs +1 -1
- package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +1 -1
- package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +1 -1
- package/dist/actions/unfollow-user/unfollow-user.d.ts +1 -1
- package/dist/actions/unfollow-user/unfollow-user.mjs +1 -1
- package/dist/actions/unlike-tweet/unlike-tweet.d.ts +1 -1
- package/dist/actions/unlike-tweet/unlike-tweet.mjs +1 -1
- package/dist/actions/upload-media/upload-media.d.ts +1 -1
- package/dist/actions/upload-media/upload-media.mjs +1 -1
- package/dist/common/addObjIncludes.d.ts +9 -0
- package/dist/common/addObjIncludes.mjs +70 -0
- package/dist/common/appValidation.d.ts +1 -1
- package/dist/common/appValidation.mjs +5 -5
- package/dist/common/types/includeMapping.d.ts +11 -0
- package/dist/common/types/includeMapping.mjs +1 -0
- package/dist/common/types/responseSchemas.d.ts +35 -5
- package/dist/sources/common/base.d.ts +1 -1
- package/dist/sources/common/base.mjs +5 -1
- package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +1 -1
- package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +4 -2
- package/dist/sources/new-list-followed/new-list-followed.d.ts +1 -1
- package/dist/sources/new-list-followed/new-list-followed.mjs +4 -2
- package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.d.ts +1 -1
- package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.mjs +4 -2
- package/dist/sources/new-message/new-message.d.ts +1 -1
- package/dist/sources/new-message/new-message.mjs +4 -2
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +1 -1
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +4 -2
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +1 -1
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +4 -2
- package/dist/sources/new-tweet-metrics/new-tweet-metrics.d.ts +1 -1
- package/dist/sources/new-tweet-metrics/new-tweet-metrics.mjs +1 -1
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +1 -1
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +4 -2
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +1 -1
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +4 -2
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +1 -1
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +4 -2
- package/dist/sources/new-user-followed/new-user-followed.d.ts +1 -1
- package/dist/sources/new-user-followed/new-user-followed.mjs +4 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ export default defineAction({
|
|
|
8
8
|
key: "twitter-add-user-to-list",
|
|
9
9
|
name: "Add User To List",
|
|
10
10
|
description: `Add a member to a list owned by the user. [See the documentation](${DOCS_LINK})`,
|
|
11
|
-
version: "2.0.
|
|
11
|
+
version: "2.0.8",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
...common.props,
|
|
@@ -8,7 +8,7 @@ export default defineAction({
|
|
|
8
8
|
key: "twitter-get-tweet",
|
|
9
9
|
name: "Get Tweet",
|
|
10
10
|
description: `Return a single tweet specified by ID. [See the documentation](${DOCS_LINK})`,
|
|
11
|
-
version: "2.0.
|
|
11
|
+
version: "2.0.8",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
...common.props,
|
|
@@ -2,6 +2,6 @@ import { getUserId, getUserFields } from "../../common/methods.js";
|
|
|
2
2
|
declare const _default: import("@pipedream/types").Action<{
|
|
3
3
|
getUserId: typeof getUserId;
|
|
4
4
|
getUserFields: typeof getUserFields;
|
|
5
|
-
|
|
5
|
+
getRecentTweets(args?: {}): any;
|
|
6
6
|
}, any>;
|
|
7
7
|
export default _default;
|
|
@@ -5,6 +5,6 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
5
5
|
getMultiItemSummary: typeof getMultiItemSummary;
|
|
6
6
|
getUserId: typeof getUserId;
|
|
7
7
|
getTweetFields: typeof getTweetFields;
|
|
8
|
-
|
|
8
|
+
getRecentTweets(args?: {}): any;
|
|
9
9
|
}, any>;
|
|
10
10
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
key: "twitter-list-favorites",
|
|
12
12
|
name: "List Liked Tweets",
|
|
13
13
|
description: `Return the most recent tweets liked by you or the specified user. [See the documentation](${DOCS_LINK})`,
|
|
14
|
-
version: "2.0.
|
|
14
|
+
version: "2.0.8",
|
|
15
15
|
type: "action",
|
|
16
16
|
props: {
|
|
17
17
|
...common.props,
|
|
@@ -5,6 +5,6 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
5
5
|
getMultiItemSummary: typeof getMultiItemSummary;
|
|
6
6
|
getUserId: typeof getUserId;
|
|
7
7
|
getUserFields: typeof getUserFields;
|
|
8
|
-
|
|
8
|
+
getRecentTweets(args?: {}): any;
|
|
9
9
|
}, any>;
|
|
10
10
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
key: "twitter-list-followers",
|
|
12
12
|
name: "List Followers",
|
|
13
13
|
description: `Return a collection of user objects for users following the specified user. [See the documentation](${DOCS_LINK})`,
|
|
14
|
-
version: "2.0.
|
|
14
|
+
version: "2.0.8",
|
|
15
15
|
type: "action",
|
|
16
16
|
props: {
|
|
17
17
|
...common.props,
|
|
@@ -3,6 +3,6 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
3
3
|
getMultiItemSummary: typeof getMultiItemSummary;
|
|
4
4
|
getUserId: typeof getUserId;
|
|
5
5
|
getListFields: typeof getListFields;
|
|
6
|
-
|
|
6
|
+
getRecentTweets(args?: {}): any;
|
|
7
7
|
}, any>;
|
|
8
8
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
key: "twitter-list-lists",
|
|
12
12
|
name: "List Lists",
|
|
13
13
|
description: `Get all lists owned by a user. [See the documentation](${DOCS_LINK})`,
|
|
14
|
-
version: "2.0.
|
|
14
|
+
version: "2.0.8",
|
|
15
15
|
type: "action",
|
|
16
16
|
props: {
|
|
17
17
|
...common.props,
|
|
@@ -5,6 +5,6 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
5
5
|
getMultiItemSummary: typeof getMultiItemSummary;
|
|
6
6
|
getUserId: typeof getUserId;
|
|
7
7
|
getTweetFields: typeof getTweetFields;
|
|
8
|
-
|
|
8
|
+
getRecentTweets(args?: {}): any;
|
|
9
9
|
}, any>;
|
|
10
10
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
key: "twitter-list-mentions",
|
|
12
12
|
name: "List Mentions",
|
|
13
13
|
description: `Return the most recent mentions for the specified user. [See the documentation](${DOCS_LINK})`,
|
|
14
|
-
version: "2.0.
|
|
14
|
+
version: "2.0.9",
|
|
15
15
|
type: "action",
|
|
16
16
|
props: {
|
|
17
17
|
...common.props,
|
|
@@ -5,6 +5,6 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
5
5
|
getMultiItemSummary: typeof getMultiItemSummary;
|
|
6
6
|
getUserId: typeof getUserId;
|
|
7
7
|
getTweetFields: typeof getTweetFields;
|
|
8
|
-
|
|
8
|
+
getRecentTweets(args?: {}): any;
|
|
9
9
|
}, any>;
|
|
10
10
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
key: "twitter-list-user-tweets",
|
|
12
12
|
name: "List User Tweets",
|
|
13
13
|
description: `Return a collection of the most recent tweets posted by a user. [See the documentation](${DOCS_LINK})`,
|
|
14
|
-
version: "2.0.
|
|
14
|
+
version: "2.0.8",
|
|
15
15
|
type: "action",
|
|
16
16
|
props: {
|
|
17
17
|
...common.props,
|
|
@@ -8,7 +8,7 @@ export default defineAction({
|
|
|
8
8
|
key: "twitter-send-dm",
|
|
9
9
|
name: "Send Direct Message (DM)",
|
|
10
10
|
description: `Send a message to a user. [See the documentation](${DOCS_LINK})`,
|
|
11
|
-
version: "1.0.
|
|
11
|
+
version: "1.0.6",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
...common.props,
|
|
@@ -4,6 +4,6 @@ export declare const MAX_RESULTS_PER_PAGE = 100;
|
|
|
4
4
|
declare const _default: import("@pipedream/types").Action<{
|
|
5
5
|
getMultiItemSummary: typeof getMultiItemSummary;
|
|
6
6
|
getTweetFields: typeof getTweetFields;
|
|
7
|
-
|
|
7
|
+
getRecentTweets(args?: {}): any;
|
|
8
8
|
}, any>;
|
|
9
9
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
key: "twitter-simple-search",
|
|
12
12
|
name: "Search Tweets",
|
|
13
13
|
description: `Retrieve Tweets from the last seven days that match a query. [See the documentation](${DOCS_LINK})`,
|
|
14
|
-
version: "2.0.
|
|
14
|
+
version: "2.0.8",
|
|
15
15
|
type: "action",
|
|
16
16
|
props: {
|
|
17
17
|
...common.props,
|
|
@@ -4,6 +4,6 @@ export declare const MAX_RESULTS_PER_PAGE = 100;
|
|
|
4
4
|
declare const _default: import("@pipedream/types").Action<{
|
|
5
5
|
getMultiItemSummary: typeof getMultiItemSummary;
|
|
6
6
|
getTweetFields: typeof getTweetFields;
|
|
7
|
-
|
|
7
|
+
getRecentTweets(args?: {}): any;
|
|
8
8
|
}, any>;
|
|
9
9
|
export default _default;
|
|
@@ -11,7 +11,7 @@ export default defineAction({
|
|
|
11
11
|
key: "twitter-simple-search-in-list",
|
|
12
12
|
name: "Search Tweets in List",
|
|
13
13
|
description: `Search Tweets by text in a list. [See the documentation](${DOCS_LINK})`,
|
|
14
|
-
version: "2.0.
|
|
14
|
+
version: "2.0.8",
|
|
15
15
|
type: "action",
|
|
16
16
|
props: {
|
|
17
17
|
...common.props,
|
|
@@ -7,7 +7,7 @@ export default defineAction({
|
|
|
7
7
|
key: "twitter-unlike-tweet",
|
|
8
8
|
name: "Unlike Tweet",
|
|
9
9
|
description: `Unlike a tweet specified by its ID. [See the documentation](${DOCS_LINK})`,
|
|
10
|
-
version: "2.0.
|
|
10
|
+
version: "2.0.8",
|
|
11
11
|
type: "action",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IncludesIdCollectionFlattened } from "./types/includeMapping.js";
|
|
2
|
+
import { DirectMessage, List, ResponseIncludes, Tweet, TwitterEntity, User } from "./types/responseSchemas.js";
|
|
3
|
+
export declare function getDirectMessageIncludeIds(obj: DirectMessage): IncludesIdCollectionFlattened;
|
|
4
|
+
export declare function getListIncludeIds(obj: List): IncludesIdCollectionFlattened;
|
|
5
|
+
export declare function getUserIncludeIds(obj: User): IncludesIdCollectionFlattened;
|
|
6
|
+
export declare function getTweetIncludeIds(obj: Tweet): IncludesIdCollectionFlattened;
|
|
7
|
+
export declare function getObjIncludes(obj: TwitterEntity, includes: ResponseIncludes, getIncludeIds: (o: TwitterEntity) => IncludesIdCollectionFlattened): {
|
|
8
|
+
[k: string]: any;
|
|
9
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// https://developer.twitter.com/en/docs/twitter-api/expansions
|
|
2
|
+
function flatClearIncludeIds(obj) {
|
|
3
|
+
return Object.fromEntries(Object.entries(obj).map(([key, value,]) => [
|
|
4
|
+
key,
|
|
5
|
+
value.filter((e) => e !== undefined).flat(),
|
|
6
|
+
]));
|
|
7
|
+
}
|
|
8
|
+
export function getDirectMessageIncludeIds(obj) {
|
|
9
|
+
return flatClearIncludeIds({
|
|
10
|
+
userIds: [
|
|
11
|
+
obj.sender_id,
|
|
12
|
+
obj.participant_ids,
|
|
13
|
+
],
|
|
14
|
+
mediaKeys: [
|
|
15
|
+
obj.attachments?.media_keys,
|
|
16
|
+
],
|
|
17
|
+
tweetIds: [
|
|
18
|
+
obj.referenced_tweets?.map(({ id }) => id),
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function getListIncludeIds(obj) {
|
|
23
|
+
return flatClearIncludeIds({
|
|
24
|
+
userIds: [
|
|
25
|
+
obj.owner_id,
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export function getUserIncludeIds(obj) {
|
|
30
|
+
return flatClearIncludeIds({
|
|
31
|
+
tweetIds: [
|
|
32
|
+
obj.pinned_tweet_id,
|
|
33
|
+
],
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function getTweetIncludeIds(obj) {
|
|
37
|
+
return flatClearIncludeIds({
|
|
38
|
+
userIds: [
|
|
39
|
+
obj.author_id,
|
|
40
|
+
obj.in_reply_to_user_id,
|
|
41
|
+
],
|
|
42
|
+
userNames: [
|
|
43
|
+
obj.entities?.mentions?.map(({ username }) => username),
|
|
44
|
+
],
|
|
45
|
+
tweetIds: [
|
|
46
|
+
obj.edit_history_tweet_ids,
|
|
47
|
+
obj.referenced_tweets?.map(({ id }) => id),
|
|
48
|
+
],
|
|
49
|
+
pollIds: [
|
|
50
|
+
obj.attachments?.poll_ids,
|
|
51
|
+
],
|
|
52
|
+
placeIds: [
|
|
53
|
+
obj.geo?.place_id,
|
|
54
|
+
],
|
|
55
|
+
mediaKeys: [
|
|
56
|
+
obj.attachments?.media_keys,
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function getObjIncludes(obj, includes = {}, getIncludeIds) {
|
|
61
|
+
const { userIds, userNames, tweetIds, pollIds, placeIds, mediaKeys, } = getIncludeIds(obj);
|
|
62
|
+
const result = {
|
|
63
|
+
media: includes.media?.filter((item) => mediaKeys?.includes(item.media_key)),
|
|
64
|
+
users: includes.users?.filter((item) => userIds?.includes(item.id) || userNames?.includes(item.username)),
|
|
65
|
+
places: includes.places?.filter((item) => placeIds?.includes(item.id)),
|
|
66
|
+
polls: includes.polls?.filter((item) => pollIds?.includes(item.id)),
|
|
67
|
+
tweets: includes.tweets?.filter((item) => tweetIds?.includes(item.id)),
|
|
68
|
+
};
|
|
69
|
+
return Object.fromEntries(Object.entries(result).filter(([, value,]) => value?.length > 0));
|
|
70
|
+
}
|
|
@@ -7,10 +7,10 @@ export default {
|
|
|
7
7
|
},
|
|
8
8
|
},
|
|
9
9
|
async additionalProps() {
|
|
10
|
-
const
|
|
11
|
-
const data = await this.
|
|
10
|
+
const q = "Pipedream";
|
|
11
|
+
const data = await this.getRecentTweets({
|
|
12
12
|
params: {
|
|
13
|
-
|
|
13
|
+
query: q,
|
|
14
14
|
},
|
|
15
15
|
validateStatus: () => true,
|
|
16
16
|
});
|
|
@@ -18,9 +18,9 @@ export default {
|
|
|
18
18
|
return {};
|
|
19
19
|
},
|
|
20
20
|
methods: {
|
|
21
|
-
|
|
21
|
+
getRecentTweets(args = {}) {
|
|
22
22
|
return this.app._httpRequest({
|
|
23
|
-
url: "/tweets",
|
|
23
|
+
url: "/tweets/search/recent",
|
|
24
24
|
...args,
|
|
25
25
|
});
|
|
26
26
|
},
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type IncludesIdMap<T> = {
|
|
2
|
+
mediaKeys?: T;
|
|
3
|
+
placeIds?: T;
|
|
4
|
+
pollIds?: T;
|
|
5
|
+
tweetIds?: T;
|
|
6
|
+
userIds?: T;
|
|
7
|
+
userNames?: T;
|
|
8
|
+
};
|
|
9
|
+
export type IncludesIdCollection = IncludesIdMap<(string | string[])[]>;
|
|
10
|
+
export type IncludesIdCollectionFlattened = IncludesIdMap<string[]>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,12 +2,15 @@ export interface TwitterEntity {
|
|
|
2
2
|
id: string;
|
|
3
3
|
}
|
|
4
4
|
export type TwitterEntityMap = Record<string, object>;
|
|
5
|
-
export interface DirectMessage extends TwitterEntity {
|
|
5
|
+
export interface DirectMessage extends TwitterEntity, HasMediaAttachments, HasReferencedTweets {
|
|
6
6
|
event_type: "MessageCreate";
|
|
7
7
|
text: string;
|
|
8
|
+
sender_id?: string;
|
|
9
|
+
participant_ids?: string[];
|
|
8
10
|
}
|
|
9
11
|
export interface List extends TwitterEntity {
|
|
10
12
|
name: string;
|
|
13
|
+
owner_id?: string;
|
|
11
14
|
}
|
|
12
15
|
interface MetricsFields {
|
|
13
16
|
public_metrics?: string;
|
|
@@ -15,10 +18,28 @@ interface MetricsFields {
|
|
|
15
18
|
organic_metrics?: string;
|
|
16
19
|
promoted_metrics?: string;
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
text: string;
|
|
20
|
-
edit_history_tweet_ids: string[];
|
|
21
|
+
interface HasReferencedTweets {
|
|
21
22
|
referenced_tweets?: ReferencedTweet[];
|
|
23
|
+
}
|
|
24
|
+
interface HasMediaAttachments {
|
|
25
|
+
attachments?: {
|
|
26
|
+
media_keys?: string[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface Tweet extends TwitterEntity, MetricsFields, HasReferencedTweets {
|
|
30
|
+
text: string;
|
|
31
|
+
author_id?: string;
|
|
32
|
+
edit_history_tweet_ids?: string[];
|
|
33
|
+
in_reply_to_user_id?: string;
|
|
34
|
+
attachments?: HasMediaAttachments["attachments"] & {
|
|
35
|
+
poll_ids: string[];
|
|
36
|
+
};
|
|
37
|
+
geo?: {
|
|
38
|
+
place_id: string;
|
|
39
|
+
};
|
|
40
|
+
entities?: {
|
|
41
|
+
mentions?: User[];
|
|
42
|
+
};
|
|
22
43
|
includes?: {
|
|
23
44
|
tweets?: Tweet[];
|
|
24
45
|
};
|
|
@@ -30,10 +51,16 @@ export interface ReferencedTweet {
|
|
|
30
51
|
export interface User extends TwitterEntity {
|
|
31
52
|
name: string;
|
|
32
53
|
username: string;
|
|
54
|
+
pinned_tweet_id?: string;
|
|
33
55
|
}
|
|
34
|
-
|
|
56
|
+
type Poll = TwitterEntity;
|
|
57
|
+
type Place = TwitterEntity;
|
|
58
|
+
export interface ResponseIncludes {
|
|
59
|
+
places?: Place[];
|
|
60
|
+
polls?: Poll[];
|
|
35
61
|
users?: User[];
|
|
36
62
|
tweets?: Tweet[];
|
|
63
|
+
media?: MediaItem[];
|
|
37
64
|
}
|
|
38
65
|
interface ResponseBase {
|
|
39
66
|
includes?: ResponseIncludes;
|
|
@@ -49,4 +76,7 @@ export type PaginatedResponseObject<T extends TwitterEntity> = ResponseBase & {
|
|
|
49
76
|
result_count: number;
|
|
50
77
|
};
|
|
51
78
|
};
|
|
79
|
+
interface MediaItem {
|
|
80
|
+
media_key: string;
|
|
81
|
+
}
|
|
52
82
|
export {};
|
|
@@ -155,7 +155,7 @@ declare const _default: {
|
|
|
155
155
|
setSavedIds(data: string[]): void;
|
|
156
156
|
getAndProcessData(maxResults?: number): Promise<void>;
|
|
157
157
|
emitEvent(data: TwitterEntity): void;
|
|
158
|
-
|
|
158
|
+
getRecentTweets(args?: {}): any;
|
|
159
159
|
};
|
|
160
160
|
run(): Promise<void>;
|
|
161
161
|
additionalProps(): Promise<any>;
|
|
@@ -15,7 +15,11 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
hooks: {
|
|
17
17
|
async deploy() {
|
|
18
|
-
const
|
|
18
|
+
const q = "Pipedream";
|
|
19
|
+
const data = await this.getRecentTweets({
|
|
20
|
+
params: {
|
|
21
|
+
query: q,
|
|
22
|
+
},
|
|
19
23
|
validateStatus: () => true,
|
|
20
24
|
});
|
|
21
25
|
this.app.throwError(data);
|
|
@@ -12,6 +12,6 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
12
12
|
setSavedIds(data: string[]): void;
|
|
13
13
|
getAndProcessData(maxResults?: number): Promise<void>;
|
|
14
14
|
emitEvent(data: import("../../common/types/responseSchemas.js").TwitterEntity): void;
|
|
15
|
-
|
|
15
|
+
getRecentTweets(args?: {}): any;
|
|
16
16
|
}, any>;
|
|
17
17
|
export default _default;
|
|
@@ -4,12 +4,13 @@ import { getUserSummary as getItemSummary } from "../common/getItemSummary.mjs";
|
|
|
4
4
|
import { getUserFields } from "../../common/methods.mjs";
|
|
5
5
|
import { DOCS_LINK, MAX_RESULTS_PER_PAGE, } from "../../actions/list-followers/list-followers.mjs";
|
|
6
6
|
import cacheUserId from "../common/cacheUserId.mjs";
|
|
7
|
+
import { getObjIncludes, getUserIncludeIds, } from "../../common/addObjIncludes.mjs";
|
|
7
8
|
export default defineSource({
|
|
8
9
|
...common,
|
|
9
10
|
key: "twitter-new-follower-of-user",
|
|
10
11
|
name: "New Follower Received by User",
|
|
11
12
|
description: `Emit new event when the specified User receives a Follower [See the documentation](${DOCS_LINK})`,
|
|
12
|
-
version: "2.0
|
|
13
|
+
version: "2.1.0",
|
|
13
14
|
type: "source",
|
|
14
15
|
props: {
|
|
15
16
|
...common.props,
|
|
@@ -37,7 +38,8 @@ export default defineSource({
|
|
|
37
38
|
params: this.getUserFields(),
|
|
38
39
|
userId,
|
|
39
40
|
};
|
|
40
|
-
const { data } = await this.app.getUserFollowers(params);
|
|
41
|
+
const { data, includes, } = await this.app.getUserFollowers(params);
|
|
42
|
+
data.forEach((user) => user.includes = getObjIncludes(user, includes, getUserIncludeIds));
|
|
41
43
|
return data;
|
|
42
44
|
},
|
|
43
45
|
},
|
|
@@ -12,6 +12,6 @@ declare const _default: import("@pipedream/types").Source<{
|
|
|
12
12
|
setSavedIds(data: string[]): void;
|
|
13
13
|
getAndProcessData(maxResults?: number): Promise<void>;
|
|
14
14
|
emitEvent(data: import("../../common/types/responseSchemas.js").TwitterEntity): void;
|
|
15
|
-
|
|
15
|
+
getRecentTweets(args?: {}): any;
|
|
16
16
|
}, any>;
|
|
17
17
|
export default _default;
|