@pipedream/twitter 2.2.4 → 2.3.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.
Files changed (42) hide show
  1. package/README.md +13 -0
  2. package/dist/actions/add-user-to-list/add-user-to-list.mjs +1 -1
  3. package/dist/actions/create-tweet/create-tweet.d.ts +3 -3
  4. package/dist/actions/create-tweet/create-tweet.mjs +1 -1
  5. package/dist/actions/delete-tweet/delete-tweet.mjs +1 -1
  6. package/dist/actions/follow-user/follow-user.mjs +1 -1
  7. package/dist/actions/get-tweet/get-tweet.mjs +1 -1
  8. package/dist/actions/get-user/get-user.mjs +1 -1
  9. package/dist/actions/like-tweet/like-tweet.mjs +1 -1
  10. package/dist/actions/list-favorites/list-favorites.mjs +1 -1
  11. package/dist/actions/list-followers/list-followers.mjs +1 -1
  12. package/dist/actions/list-lists/list-lists.mjs +1 -1
  13. package/dist/actions/list-mentions/list-mentions.mjs +1 -1
  14. package/dist/actions/list-user-tweets/list-user-tweets.mjs +1 -1
  15. package/dist/actions/retweet/retweet.mjs +1 -1
  16. package/dist/actions/send-dm/send-dm.mjs +1 -1
  17. package/dist/actions/simple-search/simple-search.mjs +1 -1
  18. package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +1 -1
  19. package/dist/actions/unfollow-user/unfollow-user.mjs +1 -1
  20. package/dist/actions/unlike-tweet/unlike-tweet.mjs +1 -1
  21. package/dist/actions/upload-media/upload-media.mjs +13 -22
  22. package/dist/common/addObjIncludes.d.ts +9 -0
  23. package/dist/common/addObjIncludes.mjs +70 -0
  24. package/dist/common/additionalProps.mjs +2 -2
  25. package/dist/common/appValidation.d.ts +6 -6
  26. package/dist/common/types/includeMapping.d.ts +11 -0
  27. package/dist/common/types/includeMapping.mjs +1 -0
  28. package/dist/common/types/responseSchemas.d.ts +35 -5
  29. package/dist/sources/common/base.d.ts +6 -6
  30. package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +4 -2
  31. package/dist/sources/new-list-followed/new-list-followed.mjs +4 -2
  32. package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.mjs +4 -2
  33. package/dist/sources/new-message/new-message.mjs +4 -2
  34. package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +4 -2
  35. package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +4 -2
  36. package/dist/sources/new-tweet-metrics/new-tweet-metrics.mjs +1 -1
  37. package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +4 -2
  38. package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +4 -2
  39. package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +4 -2
  40. package/dist/sources/new-user-followed/new-user-followed.mjs +4 -2
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +2 -2
@@ -3,6 +3,7 @@ import common from "../common/base.mjs";
3
3
  import { getListSummary as getItemSummary } from "../common/getItemSummary.mjs";
4
4
  import { getListFields } from "../../common/methods.mjs";
5
5
  import cacheUserId from "../common/cacheUserId.mjs";
6
+ import { getListIncludeIds, getObjIncludes, } from "../../common/addObjIncludes.mjs";
6
7
  const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-users-id-followed_lists";
7
8
  const MAX_RESULTS_PER_PAGE = 100;
8
9
  export default defineSource({
@@ -10,7 +11,7 @@ export default defineSource({
10
11
  key: "twitter-new-list-followed",
11
12
  name: "New List Followed by User",
12
13
  description: `Emit new event when the specified User follows a List [See the documentation](${DOCS_LINK})`,
13
- version: "2.0.7",
14
+ version: "2.1.0",
14
15
  type: "source",
15
16
  props: {
16
17
  ...common.props,
@@ -38,7 +39,8 @@ export default defineSource({
38
39
  params: this.getListFields(),
39
40
  userId,
40
41
  };
41
- const { data } = await this.app.getUserFollowedLists(params);
42
+ const { data, includes, } = await this.app.getUserFollowedLists(params);
43
+ data.forEach((list) => list.includes = getObjIncludes(list, includes, getListIncludeIds));
42
44
  return data;
43
45
  },
44
46
  },
@@ -4,12 +4,13 @@ import { getTweetSummary as getItemSummary } from "../common/getItemSummary.mjs"
4
4
  import { getTweetFields } from "../../common/methods.mjs";
5
5
  import { DOCS_LINK, MAX_RESULTS_PER_PAGE, } from "../../actions/list-mentions/list-mentions.mjs";
6
6
  import cacheUserId from "../common/cacheUserId.mjs";
7
+ import { getObjIncludes, getTweetIncludeIds, } from "../../common/addObjIncludes.mjs";
7
8
  export default defineSource({
8
9
  ...common,
9
10
  key: "twitter-new-mention-received-by-user",
10
11
  name: "New Mention Received by User",
11
12
  description: `Emit new event when the specified User is mentioned in a Tweet [See the documentation](${DOCS_LINK})`,
12
- version: "0.0.5",
13
+ version: "0.1.0",
13
14
  type: "source",
14
15
  props: {
15
16
  ...common.props,
@@ -37,7 +38,8 @@ export default defineSource({
37
38
  params: this.getTweetFields(),
38
39
  userId,
39
40
  };
40
- const { data } = await this.app.getUserMentions(params);
41
+ const { data, includes, } = await this.app.getUserMentions(params);
42
+ data.forEach((tweet) => tweet.includes = getObjIncludes(tweet, includes, getTweetIncludeIds));
41
43
  return data;
42
44
  },
43
45
  },
@@ -2,6 +2,7 @@ import { defineSource } from "@pipedream/types";
2
2
  import common from "../common/base.mjs";
3
3
  import { getTweetSummary as getItemSummary } from "../common/getItemSummary.mjs";
4
4
  import { getMessageFields } from "../../common/methods.mjs";
5
+ import { getDirectMessageIncludeIds, getObjIncludes, } from "../../common/addObjIncludes.mjs";
5
6
  const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_events";
6
7
  const MAX_RESULTS_PER_PAGE = 100;
7
8
  export default defineSource({
@@ -9,7 +10,7 @@ export default defineSource({
9
10
  key: "twitter-new-message",
10
11
  name: "New Message Received",
11
12
  description: `Emit new event when a new Direct Message (DM) is received [See the documentation](${DOCS_LINK})`,
12
- version: "1.0.5",
13
+ version: "1.1.0",
13
14
  type: "source",
14
15
  methods: {
15
16
  ...common.methods,
@@ -28,7 +29,8 @@ export default defineSource({
28
29
  event_types: "MessageCreate",
29
30
  },
30
31
  };
31
- const { data } = await this.app.getDirectMessages(params);
32
+ const { data, includes, } = await this.app.getDirectMessages(params);
33
+ data.forEach((msg) => msg.includes = getObjIncludes(msg, includes, getDirectMessageIncludeIds));
32
34
  return data;
33
35
  },
34
36
  },
@@ -3,12 +3,13 @@ import common from "../common/base.mjs";
3
3
  import { getTweetSummary as getItemSummary } from "../common/getItemSummary.mjs";
4
4
  import { getTweetFields } from "../../common/methods.mjs";
5
5
  import { DOCS_LINK, MAX_RESULTS_PER_PAGE, } from "../../actions/simple-search-in-list/simple-search-in-list.mjs";
6
+ import { getObjIncludes, getTweetIncludeIds, } from "../../common/addObjIncludes.mjs";
6
7
  export default defineSource({
7
8
  ...common,
8
9
  key: "twitter-new-tweet-in-list",
9
10
  name: "New Tweet Posted in List",
10
11
  description: `Emit new event when a Tweet is posted in the specified list [See the documentation](${DOCS_LINK})`,
11
- version: "2.0.7",
12
+ version: "2.1.0",
12
13
  type: "source",
13
14
  props: {
14
15
  ...common.props,
@@ -34,7 +35,8 @@ export default defineSource({
34
35
  maxResults: maxResults ?? MAX_RESULTS_PER_PAGE,
35
36
  params: this.getTweetFields(),
36
37
  };
37
- const { data } = await this.app.getListTweets(params);
38
+ const { data, includes, } = await this.app.getListTweets(params);
39
+ data.forEach((tweet) => tweet.includes = getObjIncludes(tweet, includes, getTweetIncludeIds));
38
40
  return data;
39
41
  },
40
42
  },
@@ -4,12 +4,13 @@ import { getTweetSummary as getItemSummary } from "../common/getItemSummary.mjs"
4
4
  import { getTweetFields } from "../../common/methods.mjs";
5
5
  import { DOCS_LINK, MAX_RESULTS_PER_PAGE, } from "../../actions/list-favorites/list-favorites.mjs";
6
6
  import cacheUserId from "../common/cacheUserId.mjs";
7
+ import { getObjIncludes, getTweetIncludeIds, } from "../../common/addObjIncludes.mjs";
7
8
  export default defineSource({
8
9
  ...common,
9
10
  key: "twitter-new-tweet-liked-by-user",
10
11
  name: "New Tweet Liked by User",
11
12
  description: `Emit new event when a Tweet is liked by the specified User [See the documentation](${DOCS_LINK})`,
12
- version: "2.0.7",
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.getTweetFields(),
38
39
  userId,
39
40
  };
40
- const { data } = await this.app.getUserLikedTweets(params);
41
+ const { data, includes, } = await this.app.getUserLikedTweets(params);
42
+ data.forEach((tweet) => tweet.includes = getObjIncludes(tweet, includes, getTweetIncludeIds));
41
43
  return data;
42
44
  },
43
45
  },
@@ -7,7 +7,7 @@ export default defineSource({
7
7
  key: "twitter-new-tweet-metrics",
8
8
  name: "New Tweet Metrics",
9
9
  description: `Emit new event when a Tweet has new metrics [See the documentation](${DOCS_LINK})`,
10
- version: "1.0.5",
10
+ version: "1.0.6",
11
11
  type: "source",
12
12
  props: {
13
13
  ...common.props,
@@ -4,12 +4,13 @@ import { getTweetSummary as getItemSummary } from "../common/getItemSummary.mjs"
4
4
  import { getTweetFields } from "../../common/methods.mjs";
5
5
  import { DOCS_LINK, MAX_RESULTS_PER_PAGE, } from "../../actions/list-user-tweets/list-user-tweets.mjs";
6
6
  import cacheUserId from "../common/cacheUserId.mjs";
7
+ import { getObjIncludes, getTweetIncludeIds, } from "../../common/addObjIncludes.mjs";
7
8
  export default defineSource({
8
9
  ...common,
9
10
  key: "twitter-new-tweet-posted-by-user",
10
11
  name: "New Tweet Posted by User",
11
12
  description: `Emit new event when the specified User posts a Tweet [See the documentation](${DOCS_LINK})`,
12
- version: "2.0.7",
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.getTweetFields(),
38
39
  userId,
39
40
  };
40
- const { data } = await this.app.getUserTweets(params);
41
+ const { data, includes, } = await this.app.getUserTweets(params);
42
+ data.forEach((tweet) => tweet.includes = getObjIncludes(tweet, includes, getTweetIncludeIds));
41
43
  return data;
42
44
  },
43
45
  },
@@ -3,12 +3,13 @@ import common from "../common/base.mjs";
3
3
  import { getTweetSummary as getItemSummary } from "../common/getItemSummary.mjs";
4
4
  import { getTweetFields } from "../../common/methods.mjs";
5
5
  import { DOCS_LINK, MAX_RESULTS_PER_PAGE, } from "../../actions/simple-search/simple-search.mjs";
6
+ import { getObjIncludes, getTweetIncludeIds, } from "../../common/addObjIncludes.mjs";
6
7
  export default defineSource({
7
8
  ...common,
8
9
  key: "twitter-new-tweet-posted-matching-query",
9
10
  name: "New Tweet Posted Matching Query",
10
11
  description: `Emit new event when a new tweet matching the specified query is posted [See the documentation](${DOCS_LINK})`,
11
- version: "2.0.7",
12
+ version: "2.1.1",
12
13
  type: "source",
13
14
  props: {
14
15
  ...common.props,
@@ -36,7 +37,8 @@ export default defineSource({
36
37
  ...this.getTweetFields(),
37
38
  },
38
39
  };
39
- const { data } = await this.app.searchTweets(params);
40
+ const { data, includes, } = await this.app.searchTweets(params);
41
+ data.forEach((tweet) => tweet.includes = getObjIncludes(tweet, includes, getTweetIncludeIds));
40
42
  return data;
41
43
  },
42
44
  },
@@ -3,12 +3,13 @@ import common from "../common/base.mjs";
3
3
  import { getUserSummary as getItemSummary } from "../common/getItemSummary.mjs";
4
4
  import { DOCS_LINK, MAX_RESULTS_PER_PAGE, } from "../../actions/list-followers/list-followers.mjs";
5
5
  import cacheUserId from "../common/cacheUserId.mjs";
6
+ import { getObjIncludes, getUserIncludeIds, } from "../../common/addObjIncludes.mjs";
6
7
  export default defineSource({
7
8
  ...common,
8
9
  key: "twitter-new-unfollower-of-user",
9
10
  name: "New Unfollower of User",
10
11
  description: `Emit new event when the specified User loses a Follower [See the documentation](${DOCS_LINK})`,
11
- version: "2.0.7",
12
+ version: "2.1.0",
12
13
  type: "source",
13
14
  props: {
14
15
  ...common.props,
@@ -40,7 +41,8 @@ export default defineSource({
40
41
  maxResults: MAX_RESULTS_PER_PAGE,
41
42
  userId,
42
43
  };
43
- const { data } = await this.app.getUserFollowers(params);
44
+ const { data, includes, } = await this.app.getUserFollowers(params);
45
+ data.forEach((user) => user.includes = getObjIncludes(user, includes, getUserIncludeIds));
44
46
  return data;
45
47
  },
46
48
  async getAndProcessData(emit = false) {
@@ -3,6 +3,7 @@ import common from "../common/base.mjs";
3
3
  import { getUserSummary as getItemSummary } from "../common/getItemSummary.mjs";
4
4
  import { getUserFields } from "../../common/methods.mjs";
5
5
  import cacheUserId from "../common/cacheUserId.mjs";
6
+ import { getObjIncludes, getUserIncludeIds, } from "../../common/addObjIncludes.mjs";
6
7
  const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-following";
7
8
  const MAX_RESULTS_PER_PAGE = 1000;
8
9
  export default defineSource({
@@ -10,7 +11,7 @@ export default defineSource({
10
11
  key: "twitter-new-user-followed",
11
12
  name: "New User Followed by User",
12
13
  description: `Emit new event when the specified User follows another User [See the documentation](${DOCS_LINK})`,
13
- version: "2.0.7",
14
+ version: "2.1.0",
14
15
  type: "source",
15
16
  props: {
16
17
  ...common.props,
@@ -38,7 +39,8 @@ export default defineSource({
38
39
  params: this.getUserFields(),
39
40
  userId,
40
41
  };
41
- const { data } = await this.app.getUserFollowing(params);
42
+ const { data, includes, } = await this.app.getUserFollowing(params);
43
+ data.forEach((user) => user.includes = getObjIncludes(user, includes, getUserIncludeIds));
42
44
  return data;
43
45
  },
44
46
  },