@pipedream/twitter 2.3.2 → 2.3.4
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.mjs +545 -45
- package/dist/actions/create-tweet/create-tweet.mjs +542 -76
- package/dist/actions/delete-tweet/delete-tweet.mjs +513 -29
- package/dist/actions/follow-user/follow-user.mjs +538 -38
- package/dist/actions/get-tweet/get-tweet.mjs +622 -35
- package/dist/actions/get-user/get-user.mjs +596 -39
- package/dist/actions/like-tweet/like-tweet.mjs +515 -31
- package/dist/actions/list-favorites/list-favorites.mjs +657 -51
- package/dist/actions/list-followers/list-followers.mjs +614 -51
- package/dist/actions/list-lists/list-lists.mjs +597 -51
- package/dist/actions/list-mentions/list-mentions.mjs +657 -51
- package/dist/actions/list-user-tweets/list-user-tweets.mjs +657 -51
- package/dist/actions/retweet/retweet.mjs +519 -34
- package/dist/actions/send-dm/send-dm.mjs +546 -44
- package/dist/actions/simple-search/simple-search.mjs +646 -51
- package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +656 -58
- package/dist/actions/unfollow-user/unfollow-user.mjs +533 -34
- package/dist/actions/unlike-tweet/unlike-tweet.mjs +513 -29
- package/dist/actions/upload-media/upload-media.mjs +549 -52
- package/dist/app/twitter.app.mjs +443 -342
- package/dist/common/addObjIncludes.mjs +89 -63
- package/dist/common/additionalProps.mjs +0 -138
- package/dist/common/appValidation.mjs +475 -24
- package/dist/common/constants.mjs +11 -7
- package/dist/common/dataFields.mjs +100 -89
- package/dist/common/errorMessage.mjs +32 -26
- package/dist/common/expansions.mjs +26 -19
- package/dist/common/methods.mjs +170 -81
- package/dist/common/types/fields.mjs +0 -1
- package/dist/common/types/includeMapping.mjs +0 -1
- package/dist/common/types/requestParams.mjs +0 -1
- package/dist/common/types/responseSchemas.mjs +0 -1
- package/dist/sources/common/base.mjs +546 -69
- package/dist/sources/common/cacheUserId.mjs +32 -15
- package/dist/sources/common/getItemSummary.mjs +13 -9
- package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +799 -40
- package/dist/sources/new-list-followed/new-list-followed.mjs +722 -41
- package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.mjs +860 -40
- package/dist/sources/new-message/new-message.mjs +738 -32
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +839 -37
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +860 -40
- package/dist/sources/new-tweet-metrics/new-tweet-metrics.mjs +629 -59
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +860 -40
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +830 -39
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +829 -70
- package/dist/sources/new-user-followed/new-user-followed.mjs +737 -41
- package/package.json +3 -3
- package/dist/actions/add-user-to-list/add-user-to-list.d.ts +0 -6
- package/dist/actions/create-tweet/create-tweet.d.ts +0 -105
- package/dist/actions/delete-tweet/delete-tweet.d.ts +0 -4
- package/dist/actions/follow-user/follow-user.d.ts +0 -6
- package/dist/actions/get-tweet/get-tweet.d.ts +0 -6
- package/dist/actions/get-user/get-user.d.ts +0 -7
- package/dist/actions/like-tweet/like-tweet.d.ts +0 -4
- package/dist/actions/list-favorites/list-favorites.d.ts +0 -10
- package/dist/actions/list-followers/list-followers.d.ts +0 -10
- package/dist/actions/list-lists/list-lists.d.ts +0 -8
- package/dist/actions/list-mentions/list-mentions.d.ts +0 -10
- package/dist/actions/list-user-tweets/list-user-tweets.d.ts +0 -10
- package/dist/actions/retweet/retweet.d.ts +0 -4
- package/dist/actions/send-dm/send-dm.d.ts +0 -6
- package/dist/actions/simple-search/simple-search.d.ts +0 -9
- package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +0 -9
- package/dist/actions/unfollow-user/unfollow-user.d.ts +0 -6
- package/dist/actions/unlike-tweet/unlike-tweet.d.ts +0 -4
- package/dist/actions/upload-media/upload-media.d.ts +0 -4
- package/dist/app/twitter.app.d.ts +0 -69
- package/dist/common/addObjIncludes.d.ts +0 -9
- package/dist/common/additionalProps.d.ts +0 -0
- package/dist/common/appValidation.d.ts +0 -144
- package/dist/common/constants.d.ts +0 -7
- package/dist/common/dataFields.d.ts +0 -8
- package/dist/common/errorMessage.d.ts +0 -25
- package/dist/common/expansions.d.ts +0 -4
- package/dist/common/methods.d.ts +0 -27
- package/dist/common/types/fields.d.ts +0 -25
- package/dist/common/types/includeMapping.d.ts +0 -11
- package/dist/common/types/requestParams.d.ts +0 -126
- package/dist/common/types/responseSchemas.d.ts +0 -82
- package/dist/sources/common/base.d.ts +0 -163
- package/dist/sources/common/cacheUserId.d.ts +0 -7
- package/dist/sources/common/getItemSummary.d.ts +0 -4
- package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +0 -17
- package/dist/sources/new-list-followed/new-list-followed.d.ts +0 -17
- package/dist/sources/new-mention-received-by-user/new-mention-received-by-user.d.ts +0 -17
- package/dist/sources/new-message/new-message.d.ts +0 -15
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +0 -15
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +0 -17
- package/dist/sources/new-tweet-metrics/new-tweet-metrics.d.ts +0 -13
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +0 -17
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +0 -15
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +0 -17
- package/dist/sources/new-user-followed/new-user-followed.d.ts +0 -17
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,97 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
// components/twitter/common/dataFields.ts
|
|
2
|
+
var LIST_FIELD_OPTIONS = [
|
|
3
|
+
"created_at",
|
|
4
|
+
"follower_count",
|
|
5
|
+
"member_count",
|
|
6
|
+
"private",
|
|
7
|
+
"description",
|
|
8
|
+
"owner_id"
|
|
8
9
|
];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
var MEDIA_FIELD_OPTIONS = [
|
|
11
|
+
"duration_ms",
|
|
12
|
+
"height",
|
|
13
|
+
"media_key",
|
|
14
|
+
"preview_image_url",
|
|
15
|
+
"type",
|
|
16
|
+
"url",
|
|
17
|
+
"width",
|
|
18
|
+
"public_metrics",
|
|
19
|
+
// "non_public_metrics",
|
|
20
|
+
// "organic_metrics",
|
|
21
|
+
// "promoted_metrics",
|
|
22
|
+
"alt_text",
|
|
23
|
+
"variants"
|
|
23
24
|
];
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
var MESSAGE_FIELD_OPTIONS = [
|
|
26
|
+
"id",
|
|
27
|
+
"text",
|
|
28
|
+
"event_type",
|
|
29
|
+
"created_at",
|
|
30
|
+
"dm_conversation_id",
|
|
31
|
+
"sender_id",
|
|
32
|
+
"participant_ids",
|
|
33
|
+
"referenced_tweets",
|
|
34
|
+
"attachments"
|
|
34
35
|
];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
var METRICS_FIELDS = [
|
|
37
|
+
"public_metrics",
|
|
38
|
+
"non_public_metrics",
|
|
39
|
+
"organic_metrics",
|
|
40
|
+
"promoted_metrics"
|
|
40
41
|
];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
var PLACE_FIELD_OPTIONS = [
|
|
43
|
+
"contained_within",
|
|
44
|
+
"country",
|
|
45
|
+
"country_code",
|
|
46
|
+
"full_name",
|
|
47
|
+
"geo",
|
|
48
|
+
"id",
|
|
49
|
+
"name",
|
|
50
|
+
"place_type"
|
|
50
51
|
];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
var POLL_FIELD_OPTIONS = [
|
|
53
|
+
"duration_minutes",
|
|
54
|
+
"end_datetime",
|
|
55
|
+
"id",
|
|
56
|
+
"options",
|
|
57
|
+
"voting_status"
|
|
57
58
|
];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
59
|
+
var TWEET_FIELD_OPTIONS = [
|
|
60
|
+
"attachments",
|
|
61
|
+
"author_id",
|
|
62
|
+
"context_annotations",
|
|
63
|
+
"conversation_id",
|
|
64
|
+
"created_at",
|
|
65
|
+
"edit_controls",
|
|
66
|
+
"entities",
|
|
67
|
+
"geo",
|
|
68
|
+
"id",
|
|
69
|
+
"in_reply_to_user_id",
|
|
70
|
+
"lang",
|
|
71
|
+
// "non_public_metrics",
|
|
72
|
+
"public_metrics",
|
|
73
|
+
// "organic_metrics",
|
|
74
|
+
// "promoted_metrics",
|
|
75
|
+
"possibly_sensitive",
|
|
76
|
+
"referenced_tweets",
|
|
77
|
+
"reply_settings",
|
|
78
|
+
"source",
|
|
79
|
+
"text",
|
|
80
|
+
"withheld"
|
|
80
81
|
];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
82
|
+
var USER_FIELD_OPTIONS = [
|
|
83
|
+
"created_at",
|
|
84
|
+
"description",
|
|
85
|
+
"entities",
|
|
86
|
+
"id",
|
|
87
|
+
"location",
|
|
88
|
+
"name",
|
|
89
|
+
"pinned_tweet_id",
|
|
90
|
+
"profile_image_url",
|
|
91
|
+
"protected",
|
|
92
|
+
"public_metrics",
|
|
93
|
+
"url",
|
|
94
|
+
"username",
|
|
95
|
+
"verified",
|
|
96
|
+
"verified_type",
|
|
97
|
+
"withheld"
|
|
97
98
|
];
|
|
99
|
+
export {
|
|
100
|
+
LIST_FIELD_OPTIONS,
|
|
101
|
+
MEDIA_FIELD_OPTIONS,
|
|
102
|
+
MESSAGE_FIELD_OPTIONS,
|
|
103
|
+
METRICS_FIELDS,
|
|
104
|
+
PLACE_FIELD_OPTIONS,
|
|
105
|
+
POLL_FIELD_OPTIONS,
|
|
106
|
+
TWEET_FIELD_OPTIONS,
|
|
107
|
+
USER_FIELD_OPTIONS
|
|
108
|
+
};
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
// components/twitter/common/errorMessage.ts
|
|
2
|
+
var ERROR_URL = "https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#item0";
|
|
3
|
+
var ERROR_MESSAGE = `Check if your app is properly configured on the [Twitter Developer Portal](${ERROR_URL}), and if your plan has access to the endpoint used by this component.`;
|
|
4
|
+
var ACTION_ERROR_MESSAGE = `${ERROR_MESSAGE} Additional debugging information has been exported from the step.`;
|
|
5
|
+
var PROBLEM_BASE_URL = "https://api.twitter.com/2/problems";
|
|
6
|
+
var ERROR_BY_TYPE = {
|
|
7
|
+
[`${PROBLEM_BASE_URL}/client-forbidden`]: "This X (Twitter) account appears to be on the Free plan, which only has access to **Create Tweets**. [Refer to Twitter's developer docs](https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve) for the latest info on API access.",
|
|
8
|
+
["about:blank"]: "A generic problem with no additional information beyond that provided by the HTTP status code.",
|
|
9
|
+
[`${PROBLEM_BASE_URL}/invalid-request`]: "A problem that indicates this request is invalid. If your request takes a POST body, ensure the contents is valid JSON and matches the [OpenAPI spec](https://api.twitter.com/2/openapi.json).",
|
|
10
|
+
[`${PROBLEM_BASE_URL}/resource-not-found`]: "A problem that indicates that a given Post, User, etc. does not exist.",
|
|
11
|
+
[`${PROBLEM_BASE_URL}/not-authorized-for-resource`]: "A problem that indicates you are not allowed to see a particular Post, User, etc.",
|
|
12
|
+
[`${PROBLEM_BASE_URL}/disallowed-resource`]: "A problem that indicates that the resource requested violates the precepts of this API.",
|
|
13
|
+
[`${PROBLEM_BASE_URL}/unsupported-authentication`]: "A problem that indicates that the authentication used is not supported.",
|
|
14
|
+
[`${PROBLEM_BASE_URL}/usage-capped`]: "A problem that indicates that a usage cap has been exceeded.",
|
|
15
|
+
[`${PROBLEM_BASE_URL}/streaming-connection`]: "A problem that indicates something is wrong with the connection.",
|
|
16
|
+
[`${PROBLEM_BASE_URL}/client-disconnected`]: "Your client has gone away.",
|
|
17
|
+
[`${PROBLEM_BASE_URL}/operational-disconnect`]: "You have been disconnected for operational reasons.",
|
|
18
|
+
[`${PROBLEM_BASE_URL}/rule-cap`]: "You have exceeded the maximum number of rules.",
|
|
19
|
+
[`${PROBLEM_BASE_URL}/rule-length`]: "You have exceeded the maximum number of characters allowed on your query or rule based on your access level. See [access levels](https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api.html#Access).",
|
|
20
|
+
[`${PROBLEM_BASE_URL}/invalid-rules`]: "The rule you have submitted is invalid.",
|
|
21
|
+
[`${PROBLEM_BASE_URL}/duplicate-rules`]: "The rule you have submitted is a duplicate.",
|
|
22
|
+
[`${PROBLEM_BASE_URL}/conflict`]: "The rule you have submitted is in conflict with another rule.",
|
|
23
|
+
[`${PROBLEM_BASE_URL}/noncompliant-rules`]: "The rule you have submitted is not compliant with Twitter's Automation Rules",
|
|
24
|
+
[`${PROBLEM_BASE_URL}/not-authorized-for-field`]: "A problem that indicates you are not allowed to see a particular field.",
|
|
25
|
+
[`${PROBLEM_BASE_URL}/oauth1-permissions`]: "A problem that indicates you are not allowed to see a particular field.",
|
|
26
|
+
[`${PROBLEM_BASE_URL}/resource-unavailable`]: "A problem that indicates that a given Post, User, etc. is temporarily unavailable."
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
ACTION_ERROR_MESSAGE,
|
|
30
|
+
ERROR_BY_TYPE,
|
|
31
|
+
ERROR_MESSAGE,
|
|
32
|
+
ERROR_URL
|
|
27
33
|
};
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// components/twitter/common/expansions.ts
|
|
2
|
+
var LIST_EXPANSION_OPTIONS = [
|
|
3
|
+
"owner_id"
|
|
3
4
|
];
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
var MESSAGE_EXPANSION_OPTIONS = [
|
|
6
|
+
"attachments.media_keys",
|
|
7
|
+
"referenced_tweets.id",
|
|
8
|
+
"sender_id",
|
|
9
|
+
"participant_ids"
|
|
9
10
|
];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
var TWEET_EXPANSION_OPTIONS = [
|
|
12
|
+
"attachments.poll_ids",
|
|
13
|
+
"attachments.media_keys",
|
|
14
|
+
"author_id",
|
|
15
|
+
"edit_history_tweet_ids",
|
|
16
|
+
"entities.mentions.username",
|
|
17
|
+
"geo.place_id",
|
|
18
|
+
"in_reply_to_user_id",
|
|
19
|
+
"referenced_tweets.id",
|
|
20
|
+
"referenced_tweets.id.author_id"
|
|
20
21
|
];
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
var USER_EXPANSION_OPTIONS = [
|
|
23
|
+
"pinned_tweet_id"
|
|
23
24
|
];
|
|
25
|
+
export {
|
|
26
|
+
LIST_EXPANSION_OPTIONS,
|
|
27
|
+
MESSAGE_EXPANSION_OPTIONS,
|
|
28
|
+
TWEET_EXPANSION_OPTIONS,
|
|
29
|
+
USER_EXPANSION_OPTIONS
|
|
30
|
+
};
|
package/dist/common/methods.mjs
CHANGED
|
@@ -1,88 +1,177 @@
|
|
|
1
|
+
// components/twitter/common/methods.ts
|
|
1
2
|
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
|
|
4
|
+
// components/twitter/common/dataFields.ts
|
|
5
|
+
var LIST_FIELD_OPTIONS = [
|
|
6
|
+
"created_at",
|
|
7
|
+
"follower_count",
|
|
8
|
+
"member_count",
|
|
9
|
+
"private",
|
|
10
|
+
"description",
|
|
11
|
+
"owner_id"
|
|
12
|
+
];
|
|
13
|
+
var MEDIA_FIELD_OPTIONS = [
|
|
14
|
+
"duration_ms",
|
|
15
|
+
"height",
|
|
16
|
+
"media_key",
|
|
17
|
+
"preview_image_url",
|
|
18
|
+
"type",
|
|
19
|
+
"url",
|
|
20
|
+
"width",
|
|
21
|
+
"public_metrics",
|
|
22
|
+
// "non_public_metrics",
|
|
23
|
+
// "organic_metrics",
|
|
24
|
+
// "promoted_metrics",
|
|
25
|
+
"alt_text",
|
|
26
|
+
"variants"
|
|
27
|
+
];
|
|
28
|
+
var MESSAGE_FIELD_OPTIONS = [
|
|
29
|
+
"id",
|
|
30
|
+
"text",
|
|
31
|
+
"event_type",
|
|
32
|
+
"created_at",
|
|
33
|
+
"dm_conversation_id",
|
|
34
|
+
"sender_id",
|
|
35
|
+
"participant_ids",
|
|
36
|
+
"referenced_tweets",
|
|
37
|
+
"attachments"
|
|
38
|
+
];
|
|
39
|
+
var PLACE_FIELD_OPTIONS = [
|
|
40
|
+
"contained_within",
|
|
41
|
+
"country",
|
|
42
|
+
"country_code",
|
|
43
|
+
"full_name",
|
|
44
|
+
"geo",
|
|
45
|
+
"id",
|
|
46
|
+
"name",
|
|
47
|
+
"place_type"
|
|
48
|
+
];
|
|
49
|
+
var POLL_FIELD_OPTIONS = [
|
|
50
|
+
"duration_minutes",
|
|
51
|
+
"end_datetime",
|
|
52
|
+
"id",
|
|
53
|
+
"options",
|
|
54
|
+
"voting_status"
|
|
55
|
+
];
|
|
56
|
+
var TWEET_FIELD_OPTIONS = [
|
|
57
|
+
"attachments",
|
|
58
|
+
"author_id",
|
|
59
|
+
"context_annotations",
|
|
60
|
+
"conversation_id",
|
|
61
|
+
"created_at",
|
|
62
|
+
"edit_controls",
|
|
63
|
+
"entities",
|
|
64
|
+
"geo",
|
|
65
|
+
"id",
|
|
66
|
+
"in_reply_to_user_id",
|
|
67
|
+
"lang",
|
|
68
|
+
// "non_public_metrics",
|
|
69
|
+
"public_metrics",
|
|
70
|
+
// "organic_metrics",
|
|
71
|
+
// "promoted_metrics",
|
|
72
|
+
"possibly_sensitive",
|
|
73
|
+
"referenced_tweets",
|
|
74
|
+
"reply_settings",
|
|
75
|
+
"source",
|
|
76
|
+
"text",
|
|
77
|
+
"withheld"
|
|
78
|
+
];
|
|
79
|
+
var USER_FIELD_OPTIONS = [
|
|
80
|
+
"created_at",
|
|
81
|
+
"description",
|
|
82
|
+
"entities",
|
|
83
|
+
"id",
|
|
84
|
+
"location",
|
|
85
|
+
"name",
|
|
86
|
+
"pinned_tweet_id",
|
|
87
|
+
"profile_image_url",
|
|
88
|
+
"protected",
|
|
89
|
+
"public_metrics",
|
|
90
|
+
"url",
|
|
91
|
+
"username",
|
|
92
|
+
"verified",
|
|
93
|
+
"verified_type",
|
|
94
|
+
"withheld"
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
// components/twitter/common/expansions.ts
|
|
98
|
+
var LIST_EXPANSION_OPTIONS = [
|
|
99
|
+
"owner_id"
|
|
100
|
+
];
|
|
101
|
+
var MESSAGE_EXPANSION_OPTIONS = [
|
|
102
|
+
"attachments.media_keys",
|
|
103
|
+
"referenced_tweets.id",
|
|
104
|
+
"sender_id",
|
|
105
|
+
"participant_ids"
|
|
106
|
+
];
|
|
107
|
+
var TWEET_EXPANSION_OPTIONS = [
|
|
108
|
+
"attachments.poll_ids",
|
|
109
|
+
"attachments.media_keys",
|
|
110
|
+
"author_id",
|
|
111
|
+
"edit_history_tweet_ids",
|
|
112
|
+
"entities.mentions.username",
|
|
113
|
+
"geo.place_id",
|
|
114
|
+
"in_reply_to_user_id",
|
|
115
|
+
"referenced_tweets.id",
|
|
116
|
+
"referenced_tweets.id.author_id"
|
|
117
|
+
];
|
|
118
|
+
var USER_EXPANSION_OPTIONS = [
|
|
119
|
+
"pinned_tweet_id"
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
// components/twitter/common/methods.ts
|
|
123
|
+
async function getUserId() {
|
|
124
|
+
let { userNameOrId: id } = this;
|
|
125
|
+
if (id === "me" || id === void 0) {
|
|
126
|
+
id = await this.app.getAuthenticatedUserId();
|
|
127
|
+
} else if (id.startsWith("@")) {
|
|
128
|
+
const userData = await this.app.getUserByUsername(id.slice(1));
|
|
129
|
+
id = userData?.data?.id;
|
|
130
|
+
if (!id) throw new ConfigurationError("**User not found!** Check the `User Name or ID` prop.");
|
|
131
|
+
}
|
|
132
|
+
return id;
|
|
16
133
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
? `Successfully obtained ${length} ${name}${length === 1
|
|
20
|
-
? ""
|
|
21
|
-
: "s"}`
|
|
22
|
-
: `No ${name}s were found`;
|
|
134
|
+
function getMultiItemSummary(name, length) {
|
|
135
|
+
return length ? `Successfully obtained ${length} ${name}${length === 1 ? "" : "s"}` : `No ${name}s were found`;
|
|
23
136
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*/
|
|
31
|
-
return {
|
|
32
|
-
"expansions": LIST_EXPANSION_OPTIONS.join(),
|
|
33
|
-
"list.fields": LIST_FIELD_OPTIONS.join(),
|
|
34
|
-
"user.fields": USER_FIELD_OPTIONS.join(),
|
|
35
|
-
};
|
|
137
|
+
function getListFields() {
|
|
138
|
+
return {
|
|
139
|
+
"expansions": LIST_EXPANSION_OPTIONS.join(),
|
|
140
|
+
"list.fields": LIST_FIELD_OPTIONS.join(),
|
|
141
|
+
"user.fields": USER_FIELD_OPTIONS.join()
|
|
142
|
+
};
|
|
36
143
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
};
|
|
144
|
+
function getMessageFields() {
|
|
145
|
+
return {
|
|
146
|
+
"dm_event.fields": MESSAGE_FIELD_OPTIONS.join(),
|
|
147
|
+
"expansions": MESSAGE_EXPANSION_OPTIONS.join(),
|
|
148
|
+
"media.fields": MEDIA_FIELD_OPTIONS.join(),
|
|
149
|
+
"tweet.fields": TWEET_FIELD_OPTIONS.join(),
|
|
150
|
+
"user.fields": USER_FIELD_OPTIONS.join()
|
|
151
|
+
};
|
|
55
152
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
userFields,
|
|
66
|
-
}: Record<string, string[]> = this;
|
|
67
|
-
*/
|
|
68
|
-
return {
|
|
69
|
-
"expansions": TWEET_EXPANSION_OPTIONS.join(),
|
|
70
|
-
"media.fields": MEDIA_FIELD_OPTIONS.join(),
|
|
71
|
-
"place.fields": PLACE_FIELD_OPTIONS.join(),
|
|
72
|
-
"poll.fields": POLL_FIELD_OPTIONS.join(),
|
|
73
|
-
"tweet.fields": TWEET_FIELD_OPTIONS.join(),
|
|
74
|
-
"user.fields": USER_FIELD_OPTIONS.join(),
|
|
75
|
-
};
|
|
153
|
+
function getTweetFields() {
|
|
154
|
+
return {
|
|
155
|
+
"expansions": TWEET_EXPANSION_OPTIONS.join(),
|
|
156
|
+
"media.fields": MEDIA_FIELD_OPTIONS.join(),
|
|
157
|
+
"place.fields": PLACE_FIELD_OPTIONS.join(),
|
|
158
|
+
"poll.fields": POLL_FIELD_OPTIONS.join(),
|
|
159
|
+
"tweet.fields": TWEET_FIELD_OPTIONS.join(),
|
|
160
|
+
"user.fields": USER_FIELD_OPTIONS.join()
|
|
161
|
+
};
|
|
76
162
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
"expansions": USER_EXPANSION_OPTIONS.join(),
|
|
85
|
-
"tweet.fields": TWEET_FIELD_OPTIONS.join(),
|
|
86
|
-
"user.fields": USER_FIELD_OPTIONS.join(),
|
|
87
|
-
};
|
|
163
|
+
function getUserFields() {
|
|
164
|
+
return {
|
|
165
|
+
"expansions": USER_EXPANSION_OPTIONS.join(),
|
|
166
|
+
"tweet.fields": TWEET_FIELD_OPTIONS.join(),
|
|
167
|
+
"user.fields": USER_FIELD_OPTIONS.join()
|
|
168
|
+
};
|
|
88
169
|
}
|
|
170
|
+
export {
|
|
171
|
+
getListFields,
|
|
172
|
+
getMessageFields,
|
|
173
|
+
getMultiItemSummary,
|
|
174
|
+
getTweetFields,
|
|
175
|
+
getUserFields,
|
|
176
|
+
getUserId
|
|
177
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|