@pipedream/twitter 1.1.2 → 1.1.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/README.md +16 -1
- package/dist/actions/add-user-to-list/add-user-to-list.d.ts +3 -3
- package/dist/actions/add-user-to-list/add-user-to-list.mjs +21 -14
- package/dist/actions/create-tweet/create-tweet.d.ts +1 -1
- package/dist/actions/create-tweet/create-tweet.mjs +35 -28
- package/dist/actions/delete-tweet/delete-tweet.d.ts +2 -2
- package/dist/actions/delete-tweet/delete-tweet.mjs +16 -9
- package/dist/actions/follow-user/follow-user.d.ts +2 -2
- package/dist/actions/follow-user/follow-user.mjs +20 -13
- package/dist/actions/get-tweet/get-tweet.d.ts +2 -2
- package/dist/actions/get-tweet/get-tweet.mjs +17 -10
- package/dist/actions/get-user/get-user.d.ts +2 -2
- package/dist/actions/get-user/get-user.mjs +20 -13
- package/dist/actions/like-tweet/like-tweet.d.ts +2 -2
- package/dist/actions/like-tweet/like-tweet.mjs +18 -11
- package/dist/actions/list-favorites/list-favorites.d.ts +3 -3
- package/dist/actions/list-favorites/list-favorites.mjs +19 -12
- package/dist/actions/list-followers/list-followers.d.ts +3 -3
- package/dist/actions/list-followers/list-followers.mjs +19 -12
- package/dist/actions/list-lists/list-lists.d.ts +3 -3
- package/dist/actions/list-lists/list-lists.mjs +19 -12
- package/dist/actions/list-mentions/list-mentions.d.ts +3 -3
- package/dist/actions/list-mentions/list-mentions.mjs +19 -12
- package/dist/actions/list-user-tweets/list-user-tweets.d.ts +3 -3
- package/dist/actions/list-user-tweets/list-user-tweets.mjs +19 -12
- package/dist/actions/retweet/retweet.d.ts +2 -2
- package/dist/actions/retweet/retweet.mjs +20 -13
- package/dist/actions/simple-search/simple-search.d.ts +3 -3
- package/dist/actions/simple-search/simple-search.mjs +20 -13
- package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +3 -3
- package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +23 -16
- package/dist/actions/unfollow-user/unfollow-user.d.ts +2 -2
- package/dist/actions/unfollow-user/unfollow-user.mjs +16 -9
- package/dist/actions/unlike-tweet/unlike-tweet.d.ts +2 -2
- package/dist/actions/unlike-tweet/unlike-tweet.mjs +16 -9
- package/dist/app/twitter.app.d.ts +1 -1
- package/dist/app/twitter.app.mjs +27 -24
- package/dist/common/errorMessage.d.ts +3 -0
- package/dist/common/errorMessage.mjs +3 -0
- package/dist/sources/common/base.d.ts +1 -1
- package/dist/sources/common/base.mjs +10 -2
- package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +2 -2
- package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +1 -1
- package/dist/sources/new-list-followed/new-list-followed.d.ts +2 -2
- package/dist/sources/new-list-followed/new-list-followed.mjs +1 -1
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +2 -2
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +1 -1
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +2 -2
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +1 -1
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +2 -2
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +1 -1
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +2 -2
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +1 -1
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +2 -2
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +1 -1
- package/dist/sources/new-user-followed/new-user-followed.d.ts +2 -2
- package/dist/sources/new-user-followed/new-user-followed.mjs +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
9
9
|
getUserFields: typeof getUserFields;
|
|
10
10
|
}, {
|
|
11
11
|
app: import("@pipedream/types").App<{
|
|
12
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
12
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
13
13
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
14
14
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
15
15
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -71,7 +71,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
71
71
|
}>;
|
|
72
72
|
userNameOrId: {
|
|
73
73
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
74
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
74
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
75
75
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
76
76
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
77
77
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -134,7 +134,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
134
134
|
};
|
|
135
135
|
maxResults: {
|
|
136
136
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
137
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
137
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
138
138
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
139
139
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
140
140
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getMultiItemSummary, getUserId, getUserFields, } from "../../common/methods.mjs";
|
|
4
5
|
export const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-followers";
|
|
@@ -9,7 +10,7 @@ export default defineAction({
|
|
|
9
10
|
key: "twitter-list-followers",
|
|
10
11
|
name: "List Followers",
|
|
11
12
|
description: `Return a collection of user objects for users following the specified user. [See docs here](${DOCS_LINK})`,
|
|
12
|
-
version: "1.1.
|
|
13
|
+
version: "1.1.4",
|
|
13
14
|
type: "action",
|
|
14
15
|
props: {
|
|
15
16
|
app,
|
|
@@ -35,16 +36,22 @@ export default defineAction({
|
|
|
35
36
|
getUserFields,
|
|
36
37
|
},
|
|
37
38
|
async run({ $ }) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
try {
|
|
40
|
+
const userId = await this.getUserId();
|
|
41
|
+
const params = {
|
|
42
|
+
$,
|
|
43
|
+
maxPerPage: MAX_RESULTS_PER_PAGE,
|
|
44
|
+
maxResults: this.maxResults,
|
|
45
|
+
params: this.getUserFields(),
|
|
46
|
+
userId,
|
|
47
|
+
};
|
|
48
|
+
const response = await this.app.getUserFollowers(params);
|
|
49
|
+
$.export("$summary", this.getMultiItemSummary("follower", response.data?.length));
|
|
50
|
+
return response;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
$.export("error", err);
|
|
54
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
55
|
+
}
|
|
49
56
|
},
|
|
50
57
|
});
|
|
@@ -7,7 +7,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
7
7
|
getListFields: typeof getListFields;
|
|
8
8
|
}, {
|
|
9
9
|
app: import("@pipedream/types").App<{
|
|
10
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
10
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
11
11
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
12
12
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
13
13
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -69,7 +69,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
69
69
|
}>;
|
|
70
70
|
userNameOrId: {
|
|
71
71
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
72
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
72
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
73
73
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
74
74
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
75
75
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -132,7 +132,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
132
132
|
};
|
|
133
133
|
maxResults: {
|
|
134
134
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
135
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
135
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
136
136
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
137
137
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
138
138
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getMultiItemSummary, getUserId, getListFields, } from "../../common/methods.mjs";
|
|
4
5
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-users-id-owned_lists";
|
|
@@ -9,7 +10,7 @@ export default defineAction({
|
|
|
9
10
|
key: "twitter-list-lists",
|
|
10
11
|
name: "List Lists",
|
|
11
12
|
description: `Get all lists owned by a user. [See docs here](${DOCS_LINK})`,
|
|
12
|
-
version: "1.1.
|
|
13
|
+
version: "1.1.4",
|
|
13
14
|
type: "action",
|
|
14
15
|
props: {
|
|
15
16
|
app,
|
|
@@ -35,16 +36,22 @@ export default defineAction({
|
|
|
35
36
|
getListFields,
|
|
36
37
|
},
|
|
37
38
|
async run({ $ }) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
try {
|
|
40
|
+
const userId = await this.getUserId();
|
|
41
|
+
const params = {
|
|
42
|
+
$,
|
|
43
|
+
maxPerPage: MAX_RESULTS_PER_PAGE,
|
|
44
|
+
maxResults: this.maxResults,
|
|
45
|
+
params: this.getListFields(),
|
|
46
|
+
userId,
|
|
47
|
+
};
|
|
48
|
+
const response = await this.app.getUserOwnedLists(params);
|
|
49
|
+
$.export("$summary", this.getMultiItemSummary("list", response.data?.length));
|
|
50
|
+
return response;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
$.export("error", err);
|
|
54
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
55
|
+
}
|
|
49
56
|
},
|
|
50
57
|
});
|
|
@@ -7,7 +7,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
7
7
|
getTweetFields: typeof getTweetFields;
|
|
8
8
|
}, {
|
|
9
9
|
app: import("@pipedream/types").App<{
|
|
10
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
10
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
11
11
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
12
12
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
13
13
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -69,7 +69,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
69
69
|
}>;
|
|
70
70
|
userNameOrId: {
|
|
71
71
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
72
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
72
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
73
73
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
74
74
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
75
75
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -132,7 +132,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
132
132
|
};
|
|
133
133
|
maxResults: {
|
|
134
134
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
135
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
135
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
136
136
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
137
137
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
138
138
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getMultiItemSummary, getUserId, getTweetFields, } from "../../common/methods.mjs";
|
|
4
5
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-mentions";
|
|
@@ -9,7 +10,7 @@ export default defineAction({
|
|
|
9
10
|
key: "twitter-list-mentions",
|
|
10
11
|
name: "List Mentions",
|
|
11
12
|
description: `Return the most recent mentions for the specified user. [See docs here](${DOCS_LINK})`,
|
|
12
|
-
version: "1.1.
|
|
13
|
+
version: "1.1.4",
|
|
13
14
|
type: "action",
|
|
14
15
|
props: {
|
|
15
16
|
app,
|
|
@@ -35,16 +36,22 @@ export default defineAction({
|
|
|
35
36
|
getTweetFields,
|
|
36
37
|
},
|
|
37
38
|
async run({ $ }) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
try {
|
|
40
|
+
const userId = await this.getUserId();
|
|
41
|
+
const params = {
|
|
42
|
+
$,
|
|
43
|
+
maxPerPage: MAX_RESULTS_PER_PAGE,
|
|
44
|
+
maxResults: this.maxResults,
|
|
45
|
+
params: this.getTweetFields(),
|
|
46
|
+
userId,
|
|
47
|
+
};
|
|
48
|
+
const response = await this.app.getUserMentions(params);
|
|
49
|
+
$.export("$summary", this.getMultiItemSummary("mention", response.data?.length));
|
|
50
|
+
return response;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
$.export("error", err);
|
|
54
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
55
|
+
}
|
|
49
56
|
},
|
|
50
57
|
});
|
|
@@ -9,7 +9,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
9
9
|
getTweetFields: typeof getTweetFields;
|
|
10
10
|
}, {
|
|
11
11
|
app: import("@pipedream/types").App<{
|
|
12
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
12
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
13
13
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
14
14
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
15
15
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -71,7 +71,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
71
71
|
}>;
|
|
72
72
|
userNameOrId: {
|
|
73
73
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
74
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
74
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
75
75
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
76
76
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
77
77
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -134,7 +134,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
134
134
|
};
|
|
135
135
|
maxResults: {
|
|
136
136
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
137
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
137
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
138
138
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
139
139
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
140
140
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getMultiItemSummary, getUserId, getTweetFields, } from "../../common/methods.mjs";
|
|
4
5
|
export const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets";
|
|
@@ -9,7 +10,7 @@ export default defineAction({
|
|
|
9
10
|
key: "twitter-list-user-tweets",
|
|
10
11
|
name: "List User Tweets",
|
|
11
12
|
description: `Return a collection of the most recent tweets posted by a user. [See docs here](${DOCS_LINK})`,
|
|
12
|
-
version: "1.1.
|
|
13
|
+
version: "1.1.4",
|
|
13
14
|
type: "action",
|
|
14
15
|
props: {
|
|
15
16
|
app,
|
|
@@ -35,16 +36,22 @@ export default defineAction({
|
|
|
35
36
|
getTweetFields,
|
|
36
37
|
},
|
|
37
38
|
async run({ $ }) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
try {
|
|
40
|
+
const userId = await this.getUserId();
|
|
41
|
+
const params = {
|
|
42
|
+
$,
|
|
43
|
+
maxPerPage: MAX_RESULTS_PER_PAGE,
|
|
44
|
+
maxResults: this.maxResults,
|
|
45
|
+
params: this.getTweetFields(),
|
|
46
|
+
userId,
|
|
47
|
+
};
|
|
48
|
+
const response = await this.app.getUserTweets(params);
|
|
49
|
+
$.export("$summary", this.getMultiItemSummary("tweet", response.data?.length));
|
|
50
|
+
return response;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
$.export("error", err);
|
|
54
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
55
|
+
}
|
|
49
56
|
},
|
|
50
57
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: import("@pipedream/types").Action<unknown, {
|
|
2
2
|
app: import("@pipedream/types").App<{
|
|
3
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
3
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
4
4
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
5
5
|
_httpRequest({ $, ...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>>;
|
|
@@ -62,7 +62,7 @@ declare const _default: import("@pipedream/types").Action<unknown, {
|
|
|
62
62
|
}>;
|
|
63
63
|
tweetId: {
|
|
64
64
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
65
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
65
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
66
66
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
67
67
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
68
68
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets";
|
|
4
5
|
export default defineAction({
|
|
5
6
|
key: "twitter-retweet",
|
|
6
7
|
name: "Retweet a tweet",
|
|
7
8
|
description: `Retweet a tweet specified by ID. [See docs here](${DOCS_LINK})`,
|
|
8
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.4",
|
|
9
10
|
type: "action",
|
|
10
11
|
props: {
|
|
11
12
|
app,
|
|
@@ -18,17 +19,23 @@ export default defineAction({
|
|
|
18
19
|
},
|
|
19
20
|
},
|
|
20
21
|
async run({ $ }) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
try {
|
|
23
|
+
const { tweetId } = this;
|
|
24
|
+
const params = {
|
|
25
|
+
$,
|
|
26
|
+
data: {
|
|
27
|
+
tweet_id: tweetId,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const response = await this.app.retweet(params);
|
|
31
|
+
$.export("$summary", response.data?.retweeted !== true
|
|
32
|
+
? "Retweet failed"
|
|
33
|
+
: "Tweet successfully retweeted");
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
$.export("error", err);
|
|
38
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
39
|
+
}
|
|
33
40
|
},
|
|
34
41
|
});
|
|
@@ -8,7 +8,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
8
8
|
getTweetFields: typeof getTweetFields;
|
|
9
9
|
}, {
|
|
10
10
|
app: import("@pipedream/types").App<{
|
|
11
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
11
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
12
12
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
13
13
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
14
14
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -70,7 +70,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
70
70
|
}>;
|
|
71
71
|
query: {
|
|
72
72
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
73
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
73
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
74
74
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
75
75
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
76
76
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -133,7 +133,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
133
133
|
};
|
|
134
134
|
maxResults: {
|
|
135
135
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
136
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
136
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
137
137
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
138
138
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
139
139
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getMultiItemSummary, getTweetFields, } from "../../common/methods.mjs";
|
|
4
5
|
export const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent";
|
|
@@ -9,7 +10,7 @@ export default defineAction({
|
|
|
9
10
|
key: "twitter-simple-search",
|
|
10
11
|
name: "Search Tweets",
|
|
11
12
|
description: `Retrieve Tweets from the last seven days that match a query. [See docs here](${DOCS_LINK})`,
|
|
12
|
-
version: "1.1.
|
|
13
|
+
version: "1.1.4",
|
|
13
14
|
type: "action",
|
|
14
15
|
props: {
|
|
15
16
|
app,
|
|
@@ -34,17 +35,23 @@ export default defineAction({
|
|
|
34
35
|
getTweetFields,
|
|
35
36
|
},
|
|
36
37
|
async run({ $ }) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
try {
|
|
39
|
+
const params = {
|
|
40
|
+
$,
|
|
41
|
+
maxPerPage: MAX_RESULTS_PER_PAGE,
|
|
42
|
+
maxResults: this.maxResults,
|
|
43
|
+
params: {
|
|
44
|
+
query: this.query,
|
|
45
|
+
...this.getTweetFields(),
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
const response = await this.app.searchTweets(params);
|
|
49
|
+
$.export("$summary", this.getMultiItemSummary("tweet", response.data?.length));
|
|
50
|
+
return response;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
$.export("error", err);
|
|
54
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
55
|
+
}
|
|
49
56
|
},
|
|
50
57
|
});
|
|
@@ -8,7 +8,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
8
8
|
getTweetFields: typeof getTweetFields;
|
|
9
9
|
}, {
|
|
10
10
|
app: import("@pipedream/types").App<{
|
|
11
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
11
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
12
12
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
13
13
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
14
14
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -70,7 +70,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
70
70
|
}>;
|
|
71
71
|
listId: {
|
|
72
72
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
73
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
73
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
74
74
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
75
75
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
76
76
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -138,7 +138,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
138
138
|
};
|
|
139
139
|
maxResults: {
|
|
140
140
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
141
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
141
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
142
142
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
143
143
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
144
144
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getMultiItemSummary, getTweetFields, } from "../../common/methods.mjs";
|
|
4
5
|
export const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/lists/list-tweets/api-reference/get-lists-id-tweets";
|
|
@@ -9,7 +10,7 @@ export default defineAction({
|
|
|
9
10
|
key: "twitter-simple-search-in-list",
|
|
10
11
|
name: "Search Tweets in List",
|
|
11
12
|
description: `Search Tweets by text in a list. [See docs here](${DOCS_LINK})`,
|
|
12
|
-
version: "1.1.
|
|
13
|
+
version: "1.1.4",
|
|
13
14
|
type: "action",
|
|
14
15
|
props: {
|
|
15
16
|
app,
|
|
@@ -39,20 +40,26 @@ export default defineAction({
|
|
|
39
40
|
getTweetFields,
|
|
40
41
|
},
|
|
41
42
|
async run({ $ }) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
try {
|
|
44
|
+
const { listId, searchTerms, } = this;
|
|
45
|
+
const params = {
|
|
46
|
+
$,
|
|
47
|
+
listId,
|
|
48
|
+
maxPerPage: MAX_RESULTS_PER_PAGE,
|
|
49
|
+
maxResults: this.maxResults,
|
|
50
|
+
params: this.getTweetFields(),
|
|
51
|
+
};
|
|
52
|
+
const response = await this.app.getListTweets(params);
|
|
53
|
+
const { data } = response;
|
|
54
|
+
const filteredTweets = data.filter(({ text }) => searchTerms.every((term) => term.split("|").some((splitTerm) => text.includes(splitTerm))));
|
|
55
|
+
$.export("$summary", this.getMultiItemSummary("tweet", filteredTweets.length));
|
|
56
|
+
return {
|
|
57
|
+
data: filteredTweets,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
$.export("error", err);
|
|
62
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
63
|
+
}
|
|
57
64
|
},
|
|
58
65
|
});
|
|
@@ -4,7 +4,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
4
4
|
getUserId: typeof getUserId;
|
|
5
5
|
}, {
|
|
6
6
|
app: import("@pipedream/types").App<{
|
|
7
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
7
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
8
8
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
9
9
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
10
10
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -66,7 +66,7 @@ declare const _default: import("@pipedream/types").Action<{
|
|
|
66
66
|
}>;
|
|
67
67
|
userNameOrId: {
|
|
68
68
|
propDefinition: (string | import("@pipedream/types").App<{
|
|
69
|
-
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams):
|
|
69
|
+
_getAuthHeader(config: import("../../common/types/requestParams.js").HttpRequestParams): import("oauth-1.0a").Header;
|
|
70
70
|
_getBaseUrl(): "https://api.twitter.com/2";
|
|
71
71
|
_httpRequest({ $, ...args }: import("../../common/types/requestParams.js").HttpRequestParams): Promise<import("../../common/types/responseSchemas").ResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
72
72
|
_paginatedRequest({ maxResults, maxPerPage, params, ...args }: import("../../common/types/requestParams.js").PaginatedRequestParams): Promise<import("../../common/types/responseSchemas").PaginatedResponseObject<import("../../common/types/responseSchemas").TwitterEntity>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import app from "../../app/twitter.app.mjs";
|
|
2
|
+
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
|
|
2
3
|
import { defineAction } from "@pipedream/types";
|
|
3
4
|
import { getUserId } from "../../common/methods.mjs";
|
|
4
5
|
const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/delete-users-source_id-following";
|
|
@@ -6,7 +7,7 @@ export default defineAction({
|
|
|
6
7
|
key: "twitter-unfollow-user",
|
|
7
8
|
name: "Unfollow User",
|
|
8
9
|
description: `Unfollow a user. [See docs here](${DOCS_LINK})`,
|
|
9
|
-
version: "1.0.
|
|
10
|
+
version: "1.0.5",
|
|
10
11
|
type: "action",
|
|
11
12
|
props: {
|
|
12
13
|
app,
|
|
@@ -21,13 +22,19 @@ export default defineAction({
|
|
|
21
22
|
getUserId,
|
|
22
23
|
},
|
|
23
24
|
async run({ $ }) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
try {
|
|
26
|
+
const userId = await this.getUserId();
|
|
27
|
+
const params = {
|
|
28
|
+
$,
|
|
29
|
+
userId,
|
|
30
|
+
};
|
|
31
|
+
const response = await this.app.unfollowUser(params);
|
|
32
|
+
$.export("$summary", "Successfully unfollowed user");
|
|
33
|
+
return response;
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
$.export("error", err);
|
|
37
|
+
throw new Error(ACTION_ERROR_MESSAGE);
|
|
38
|
+
}
|
|
32
39
|
},
|
|
33
40
|
});
|