@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.
Files changed (70) hide show
  1. package/dist/actions/add-user-to-list/add-user-to-list.d.ts +1 -1
  2. package/dist/actions/add-user-to-list/add-user-to-list.mjs +1 -1
  3. package/dist/actions/create-tweet/create-tweet.mjs +1 -1
  4. package/dist/actions/delete-tweet/delete-tweet.d.ts +1 -1
  5. package/dist/actions/delete-tweet/delete-tweet.mjs +1 -1
  6. package/dist/actions/follow-user/follow-user.d.ts +1 -1
  7. package/dist/actions/follow-user/follow-user.mjs +1 -1
  8. package/dist/actions/get-tweet/get-tweet.d.ts +1 -1
  9. package/dist/actions/get-tweet/get-tweet.mjs +1 -1
  10. package/dist/actions/get-user/get-user.d.ts +1 -1
  11. package/dist/actions/get-user/get-user.mjs +1 -1
  12. package/dist/actions/like-tweet/like-tweet.d.ts +1 -1
  13. package/dist/actions/like-tweet/like-tweet.mjs +1 -1
  14. package/dist/actions/list-favorites/list-favorites.d.ts +1 -1
  15. package/dist/actions/list-favorites/list-favorites.mjs +1 -1
  16. package/dist/actions/list-followers/list-followers.d.ts +1 -1
  17. package/dist/actions/list-followers/list-followers.mjs +1 -1
  18. package/dist/actions/list-lists/list-lists.d.ts +1 -1
  19. package/dist/actions/list-lists/list-lists.mjs +1 -1
  20. package/dist/actions/list-mentions/list-mentions.d.ts +1 -1
  21. package/dist/actions/list-mentions/list-mentions.mjs +1 -1
  22. package/dist/actions/list-user-tweets/list-user-tweets.d.ts +1 -1
  23. package/dist/actions/list-user-tweets/list-user-tweets.mjs +1 -1
  24. package/dist/actions/retweet/retweet.d.ts +1 -1
  25. package/dist/actions/retweet/retweet.mjs +1 -1
  26. package/dist/actions/send-dm/send-dm.d.ts +1 -1
  27. package/dist/actions/send-dm/send-dm.mjs +1 -1
  28. package/dist/actions/simple-search/simple-search.d.ts +1 -1
  29. package/dist/actions/simple-search/simple-search.mjs +1 -1
  30. package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +1 -1
  31. package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +1 -1
  32. package/dist/actions/unfollow-user/unfollow-user.d.ts +1 -1
  33. package/dist/actions/unfollow-user/unfollow-user.mjs +1 -1
  34. package/dist/actions/unlike-tweet/unlike-tweet.d.ts +1 -1
  35. package/dist/actions/unlike-tweet/unlike-tweet.mjs +1 -1
  36. package/dist/actions/upload-media/upload-media.d.ts +1 -1
  37. package/dist/actions/upload-media/upload-media.mjs +1 -1
  38. package/dist/common/addObjIncludes.d.ts +9 -0
  39. package/dist/common/addObjIncludes.mjs +70 -0
  40. package/dist/common/appValidation.d.ts +1 -1
  41. package/dist/common/appValidation.mjs +5 -5
  42. package/dist/common/types/includeMapping.d.ts +11 -0
  43. package/dist/common/types/includeMapping.mjs +1 -0
  44. package/dist/common/types/responseSchemas.d.ts +35 -5
  45. package/dist/sources/common/base.d.ts +1 -1
  46. package/dist/sources/common/base.mjs +5 -1
  47. package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +1 -1
  48. package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +4 -2
  49. package/dist/sources/new-list-followed/new-list-followed.d.ts +1 -1
  50. package/dist/sources/new-list-followed/new-list-followed.mjs +4 -2
  51. package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.d.ts +1 -1
  52. package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.mjs +4 -2
  53. package/dist/sources/new-message/new-message.d.ts +1 -1
  54. package/dist/sources/new-message/new-message.mjs +4 -2
  55. package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +1 -1
  56. package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +4 -2
  57. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +1 -1
  58. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +4 -2
  59. package/dist/sources/new-tweet-metrics/new-tweet-metrics.d.ts +1 -1
  60. package/dist/sources/new-tweet-metrics/new-tweet-metrics.mjs +1 -1
  61. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +1 -1
  62. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +4 -2
  63. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +1 -1
  64. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +4 -2
  65. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +1 -1
  66. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +4 -2
  67. package/dist/sources/new-user-followed/new-user-followed.d.ts +1 -1
  68. package/dist/sources/new-user-followed/new-user-followed.mjs +4 -2
  69. package/dist/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { getUserId } from "../../common/methods.js";
2
2
  declare const _default: import("@pipedream/types").Action<{
3
3
  getUserId: typeof getUserId;
4
- getTweets(args?: {}): any;
4
+ getRecentTweets(args?: {}): any;
5
5
  }, any>;
6
6
  export default _default;
@@ -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.6",
11
+ version: "2.0.8",
12
12
  type: "action",
13
13
  props: {
14
14
  ...common.props,
@@ -6,7 +6,7 @@ export default defineAction({
6
6
  key: "twitter-create-tweet",
7
7
  name: "Create Tweet",
8
8
  description: `Create a new tweet. [See the documentation](${DOCS_LINK})`,
9
- version: "2.1.4",
9
+ version: "2.1.6",
10
10
  type: "action",
11
11
  props: {
12
12
  app,
@@ -1,4 +1,4 @@
1
1
  declare const _default: import("@pipedream/types").Action<{
2
- getTweets(args?: {}): any;
2
+ getRecentTweets(args?: {}): any;
3
3
  }, any>;
4
4
  export default _default;
@@ -7,7 +7,7 @@ export default defineAction({
7
7
  key: "twitter-delete-tweet",
8
8
  name: "Delete Tweet",
9
9
  description: `Remove a posted tweet. [See the documentation](${DOCS_LINK})`,
10
- version: "2.0.6",
10
+ version: "2.0.8",
11
11
  type: "action",
12
12
  props: {
13
13
  ...common.props,
@@ -1,6 +1,6 @@
1
1
  import { getUserId } from "../../common/methods.js";
2
2
  declare const _default: import("@pipedream/types").Action<{
3
3
  getUserId: typeof getUserId;
4
- getTweets(args?: {}): any;
4
+ getRecentTweets(args?: {}): any;
5
5
  }, any>;
6
6
  export default _default;
@@ -8,7 +8,7 @@ export default defineAction({
8
8
  key: "twitter-follow-user",
9
9
  name: "Follow User",
10
10
  description: `Follow a user. [See the documentation](${DOCS_LINK})`,
11
- version: "2.0.6",
11
+ version: "2.0.8",
12
12
  type: "action",
13
13
  props: {
14
14
  ...common.props,
@@ -1,6 +1,6 @@
1
1
  import { getTweetFields } from "../../common/methods.js";
2
2
  declare const _default: import("@pipedream/types").Action<{
3
3
  getTweetFields: typeof getTweetFields;
4
- getTweets(args?: {}): any;
4
+ getRecentTweets(args?: {}): any;
5
5
  }, any>;
6
6
  export default _default;
@@ -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.6",
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
- getTweets(args?: {}): any;
5
+ getRecentTweets(args?: {}): any;
6
6
  }, any>;
7
7
  export default _default;
@@ -8,7 +8,7 @@ export default defineAction({
8
8
  key: "twitter-get-user",
9
9
  name: "Get User",
10
10
  description: `Get information about a user. [See the documentation](${DOCS_LINK})`,
11
- version: "2.0.6",
11
+ version: "2.0.8",
12
12
  type: "action",
13
13
  props: {
14
14
  ...common.props,
@@ -1,4 +1,4 @@
1
1
  declare const _default: import("@pipedream/types").Action<{
2
- getTweets(args?: {}): any;
2
+ getRecentTweets(args?: {}): any;
3
3
  }, any>;
4
4
  export default _default;
@@ -7,7 +7,7 @@ export default defineAction({
7
7
  key: "twitter-like-tweet",
8
8
  name: "Like Tweet",
9
9
  description: `Like a tweet specified by its ID. [See the documentation](${DOCS_LINK})`,
10
- version: "2.0.6",
10
+ version: "2.0.8",
11
11
  type: "action",
12
12
  props: {
13
13
  ...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
- getTweets(args?: {}): any;
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.6",
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
- getTweets(args?: {}): any;
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.6",
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
- getTweets(args?: {}): any;
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.6",
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
- getTweets(args?: {}): any;
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.7",
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
- getTweets(args?: {}): any;
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.6",
14
+ version: "2.0.8",
15
15
  type: "action",
16
16
  props: {
17
17
  ...common.props,
@@ -1,4 +1,4 @@
1
1
  declare const _default: import("@pipedream/types").Action<{
2
- getTweets(args?: {}): any;
2
+ getRecentTweets(args?: {}): any;
3
3
  }, any>;
4
4
  export default _default;
@@ -7,7 +7,7 @@ export default defineAction({
7
7
  key: "twitter-retweet",
8
8
  name: "Retweet a tweet",
9
9
  description: `Retweet a tweet specified by ID. [See the documentation](${DOCS_LINK})`,
10
- version: "2.0.6",
10
+ version: "2.0.8",
11
11
  type: "action",
12
12
  props: {
13
13
  ...common.props,
@@ -1,6 +1,6 @@
1
1
  import { getUserId } from "../../common/methods.js";
2
2
  declare const _default: import("@pipedream/types").Action<{
3
3
  getUserId: typeof getUserId;
4
- getTweets(args?: {}): any;
4
+ getRecentTweets(args?: {}): any;
5
5
  }, any>;
6
6
  export default _default;
@@ -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.4",
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
- getTweets(args?: {}): any;
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.6",
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
- getTweets(args?: {}): any;
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.6",
14
+ version: "2.0.8",
15
15
  type: "action",
16
16
  props: {
17
17
  ...common.props,
@@ -1,6 +1,6 @@
1
1
  import { getUserId } from "../../common/methods.js";
2
2
  declare const _default: import("@pipedream/types").Action<{
3
3
  getUserId: typeof getUserId;
4
- getTweets(args?: {}): any;
4
+ getRecentTweets(args?: {}): any;
5
5
  }, any>;
6
6
  export default _default;
@@ -8,7 +8,7 @@ export default defineAction({
8
8
  key: "twitter-unfollow-user",
9
9
  name: "Unfollow User",
10
10
  description: `Unfollow a user. [See the documentation](${DOCS_LINK})`,
11
- version: "2.0.6",
11
+ version: "2.0.8",
12
12
  type: "action",
13
13
  props: {
14
14
  ...common.props,
@@ -1,4 +1,4 @@
1
1
  declare const _default: import("@pipedream/types").Action<{
2
- getTweets(args?: {}): any;
2
+ getRecentTweets(args?: {}): any;
3
3
  }, any>;
4
4
  export default _default;
@@ -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.6",
10
+ version: "2.0.8",
11
11
  type: "action",
12
12
  props: {
13
13
  ...common.props,
@@ -1,4 +1,4 @@
1
1
  declare const _default: import("@pipedream/types").Action<{
2
- getTweets(args?: {}): any;
2
+ getRecentTweets(args?: {}): any;
3
3
  }, any>;
4
4
  export default _default;
@@ -11,7 +11,7 @@ export default defineAction({
11
11
  key: "twitter-upload-media",
12
12
  name: "Upload Media",
13
13
  description: `Upload new media. [See the documentation](${DOCS_LINK})`,
14
- version: "0.0.10",
14
+ version: "0.0.12",
15
15
  type: "action",
16
16
  props: {
17
17
  ...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
+ }
@@ -138,7 +138,7 @@ declare const _default: {
138
138
  };
139
139
  additionalProps(): Promise<any>;
140
140
  methods: {
141
- getTweets(args?: {}): any;
141
+ getRecentTweets(args?: {}): any;
142
142
  };
143
143
  };
144
144
  export default _default;
@@ -7,10 +7,10 @@ export default {
7
7
  },
8
8
  },
9
9
  async additionalProps() {
10
- const tweetId = "1228393702244134912";
11
- const data = await this.getTweets({
10
+ const q = "Pipedream";
11
+ const data = await this.getRecentTweets({
12
12
  params: {
13
- ids: tweetId,
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
- getTweets(args = {}) {
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
- export interface Tweet extends TwitterEntity, MetricsFields {
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
- interface ResponseIncludes {
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
- getTweets(args?: {}): any;
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 data = await this.getTweets({
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
- getTweets(args?: {}): any;
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.6",
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
- getTweets(args?: {}): any;
15
+ getRecentTweets(args?: {}): any;
16
16
  }, any>;
17
17
  export default _default;