x-twitter-scraper 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/README.md +120 -120
- package/client.d.mts +7 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/activity.d.mts +18 -2
- package/resources/activity.d.mts.map +1 -1
- package/resources/activity.d.ts +18 -2
- package/resources/activity.d.ts.map +1 -1
- package/resources/credits.d.mts +5 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +5 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/extractions.d.mts +153 -5
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +153 -5
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/index.d.mts +1 -1
- package/resources/monitors/index.d.mts.map +1 -1
- package/resources/monitors/index.d.ts +1 -1
- package/resources/monitors/index.d.ts.map +1 -1
- package/resources/monitors/index.js.map +1 -1
- package/resources/monitors/index.mjs.map +1 -1
- package/resources/monitors/monitors.d.mts +38 -1
- package/resources/monitors/monitors.d.mts.map +1 -1
- package/resources/monitors/monitors.d.ts +38 -1
- package/resources/monitors/monitors.d.ts.map +1 -1
- package/resources/monitors/monitors.js +18 -0
- package/resources/monitors/monitors.js.map +1 -1
- package/resources/monitors/monitors.mjs +18 -0
- package/resources/monitors/monitors.mjs.map +1 -1
- package/resources/monitors/posts.d.mts +27 -0
- package/resources/monitors/posts.d.mts.map +1 -1
- package/resources/monitors/posts.d.ts +27 -0
- package/resources/monitors/posts.d.ts.map +1 -1
- package/resources/radar.d.mts +9 -0
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +9 -0
- package/resources/radar.d.ts.map +1 -1
- package/resources/shared.d.mts +175 -5
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +175 -5
- package/resources/shared.d.ts.map +1 -1
- package/resources/x/account-connection-attempts.d.mts +4 -0
- package/resources/x/account-connection-attempts.d.mts.map +1 -1
- package/resources/x/account-connection-attempts.d.ts +4 -0
- package/resources/x/account-connection-attempts.d.ts.map +1 -1
- package/resources/x/account-connection-links.d.mts +159 -0
- package/resources/x/account-connection-links.d.mts.map +1 -0
- package/resources/x/account-connection-links.d.ts +159 -0
- package/resources/x/account-connection-links.d.ts.map +1 -0
- package/resources/x/account-connection-links.js +82 -0
- package/resources/x/account-connection-links.js.map +1 -0
- package/resources/x/account-connection-links.mjs +78 -0
- package/resources/x/account-connection-links.mjs.map +1 -0
- package/resources/x/accounts.d.mts +13 -9
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +13 -9
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/analysis.d.mts +540 -36
- package/resources/x/analysis.d.mts.map +1 -1
- package/resources/x/analysis.d.ts +540 -36
- package/resources/x/analysis.d.ts.map +1 -1
- package/resources/x/bookmarks.d.mts +5 -0
- package/resources/x/bookmarks.d.mts.map +1 -1
- package/resources/x/bookmarks.d.ts +5 -0
- package/resources/x/bookmarks.d.ts.map +1 -1
- package/resources/x/communities/communities.d.mts +19 -2
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +19 -2
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +7 -4
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +7 -4
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +16 -2
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +16 -2
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +4 -4
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +4 -4
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/dm.d.mts +16 -2
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +16 -2
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +4 -4
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +4 -4
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/index.d.mts +2 -1
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +2 -1
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js +3 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs +1 -0
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/media.d.mts +55 -1
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +55 -1
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +2 -2
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs +2 -2
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +24 -3
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +24 -3
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +6 -6
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs +6 -6
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/tweets/bookmark.d.mts +84 -0
- package/resources/x/tweets/bookmark.d.mts.map +1 -0
- package/resources/x/tweets/bookmark.d.ts +84 -0
- package/resources/x/tweets/bookmark.d.ts.map +1 -0
- package/resources/x/tweets/bookmark.js +55 -0
- package/resources/x/tweets/bookmark.js.map +1 -0
- package/resources/x/tweets/bookmark.mjs +51 -0
- package/resources/x/tweets/bookmark.mjs.map +1 -0
- package/resources/x/tweets/index.d.mts +1 -0
- package/resources/x/tweets/index.d.mts.map +1 -1
- package/resources/x/tweets/index.d.ts +1 -0
- package/resources/x/tweets/index.d.ts.map +1 -1
- package/resources/x/tweets/index.js +3 -1
- package/resources/x/tweets/index.js.map +1 -1
- package/resources/x/tweets/index.mjs +1 -0
- package/resources/x/tweets/index.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts +16 -2
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts +16 -2
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.js +4 -4
- package/resources/x/tweets/like.js.map +1 -1
- package/resources/x/tweets/like.mjs +4 -4
- package/resources/x/tweets/like.mjs.map +1 -1
- package/resources/x/tweets/retweet.d.mts +16 -2
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts +16 -2
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.js +4 -4
- package/resources/x/tweets/retweet.js.map +1 -1
- package/resources/x/tweets/retweet.mjs +4 -4
- package/resources/x/tweets/retweet.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +68 -13
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +68 -13
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +8 -4
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +8 -4
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/block.d.mts +84 -0
- package/resources/x/users/block.d.mts.map +1 -0
- package/resources/x/users/block.d.ts +84 -0
- package/resources/x/users/block.d.ts.map +1 -0
- package/resources/x/users/block.js +55 -0
- package/resources/x/users/block.js.map +1 -0
- package/resources/x/users/block.mjs +51 -0
- package/resources/x/users/block.mjs.map +1 -0
- package/resources/x/users/follow.d.mts +16 -2
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts +16 -2
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.js +4 -4
- package/resources/x/users/follow.js.map +1 -1
- package/resources/x/users/follow.mjs +4 -4
- package/resources/x/users/follow.mjs.map +1 -1
- package/resources/x/users/index.d.mts +3 -1
- package/resources/x/users/index.d.mts.map +1 -1
- package/resources/x/users/index.d.ts +3 -1
- package/resources/x/users/index.d.ts.map +1 -1
- package/resources/x/users/index.js +5 -1
- package/resources/x/users/index.js.map +1 -1
- package/resources/x/users/index.mjs +2 -0
- package/resources/x/users/index.mjs.map +1 -1
- package/resources/x/users/mute.d.mts +84 -0
- package/resources/x/users/mute.d.mts.map +1 -0
- package/resources/x/users/mute.d.ts +84 -0
- package/resources/x/users/mute.d.ts.map +1 -0
- package/resources/x/users/mute.js +55 -0
- package/resources/x/users/mute.js.map +1 -0
- package/resources/x/users/mute.mjs +51 -0
- package/resources/x/users/mute.mjs.map +1 -0
- package/resources/x/users/users.d.mts +783 -9
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +783 -9
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +44 -3
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +44 -3
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/write-actions.d.mts +1 -1
- package/resources/x/write-actions.d.mts.map +1 -1
- package/resources/x/write-actions.d.ts +1 -1
- package/resources/x/write-actions.d.ts.map +1 -1
- package/resources/x/x.d.mts +15 -2
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +15 -2
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +4 -0
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +4 -0
- package/resources/x/x.mjs.map +1 -1
- package/src/client.ts +9 -0
- package/src/core/README.md +4 -0
- package/src/internal/README.md +6 -1
- package/src/resources/activity.ts +41 -2
- package/src/resources/credits.ts +6 -0
- package/src/resources/extractions.ts +183 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/monitors/index.ts +2 -0
- package/src/resources/monitors/monitors.ts +49 -0
- package/src/resources/monitors/posts.ts +32 -0
- package/src/resources/radar.ts +10 -0
- package/src/resources/shared.ts +213 -4
- package/src/resources/x/account-connection-attempts.ts +5 -0
- package/src/resources/x/account-connection-links.ts +215 -0
- package/src/resources/x/accounts.ts +15 -14
- package/src/resources/x/analysis.ts +618 -36
- package/src/resources/x/bookmarks.ts +6 -0
- package/src/resources/x/communities/communities.ts +35 -4
- package/src/resources/x/communities/join.ts +32 -4
- package/src/resources/x/dm.ts +32 -4
- package/src/resources/x/index.ts +18 -0
- package/src/resources/x/media.ts +74 -2
- package/src/resources/x/profile.ts +48 -6
- package/src/resources/x/tweets/bookmark.ts +127 -0
- package/src/resources/x/tweets/index.ts +7 -0
- package/src/resources/x/tweets/like.ts +32 -4
- package/src/resources/x/tweets/retweet.ts +32 -4
- package/src/resources/x/tweets/tweets.ts +104 -14
- package/src/resources/x/users/block.ts +119 -0
- package/src/resources/x/users/follow.ts +32 -4
- package/src/resources/x/users/index.ts +23 -0
- package/src/resources/x/users/mute.ts +119 -0
- package/src/resources/x/users/users.ts +1063 -89
- package/src/resources/x/write-actions.ts +6 -0
- package/src/resources/x/x.ts +54 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -24,11 +24,11 @@ export class Follow extends APIResource {
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
create(id: string, params: FollowCreateParams, options?: RequestOptions): APIPromise<FollowCreateResponse> {
|
|
27
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
27
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
28
28
|
return this._client.post(path`/x/users/${id}/follow`, {
|
|
29
29
|
body,
|
|
30
30
|
...options,
|
|
31
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
31
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -51,11 +51,11 @@ export class Follow extends APIResource {
|
|
|
51
51
|
params: FollowDeleteAllParams,
|
|
52
52
|
options?: RequestOptions,
|
|
53
53
|
): APIPromise<FollowDeleteAllResponse> {
|
|
54
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
54
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
55
55
|
return this._client.delete(path`/x/users/${id}/follow`, {
|
|
56
56
|
body,
|
|
57
57
|
...options,
|
|
58
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
58
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -80,8 +80,14 @@ export interface FollowCreateResponse {
|
|
|
80
80
|
| 'unlike'
|
|
81
81
|
| 'retweet'
|
|
82
82
|
| 'unretweet'
|
|
83
|
+
| 'bookmark'
|
|
84
|
+
| 'unbookmark'
|
|
83
85
|
| 'follow'
|
|
84
86
|
| 'unfollow'
|
|
87
|
+
| 'block'
|
|
88
|
+
| 'unblock'
|
|
89
|
+
| 'mute'
|
|
90
|
+
| 'unmute'
|
|
85
91
|
| 'remove_follower'
|
|
86
92
|
| 'send_dm'
|
|
87
93
|
| 'delete_dm'
|
|
@@ -331,8 +337,14 @@ export interface FollowDeleteAllResponse {
|
|
|
331
337
|
| 'unlike'
|
|
332
338
|
| 'retweet'
|
|
333
339
|
| 'unretweet'
|
|
340
|
+
| 'bookmark'
|
|
341
|
+
| 'unbookmark'
|
|
334
342
|
| 'follow'
|
|
335
343
|
| 'unfollow'
|
|
344
|
+
| 'block'
|
|
345
|
+
| 'unblock'
|
|
346
|
+
| 'mute'
|
|
347
|
+
| 'unmute'
|
|
336
348
|
| 'remove_follower'
|
|
337
349
|
| 'send_dm'
|
|
338
350
|
| 'delete_dm'
|
|
@@ -577,6 +589,14 @@ export interface FollowCreateParams {
|
|
|
577
589
|
* days.
|
|
578
590
|
*/
|
|
579
591
|
'Idempotency-Key': string;
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
595
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
596
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
597
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
598
|
+
*/
|
|
599
|
+
Prefer?: string;
|
|
580
600
|
}
|
|
581
601
|
|
|
582
602
|
export interface FollowDeleteAllParams {
|
|
@@ -594,6 +614,14 @@ export interface FollowDeleteAllParams {
|
|
|
594
614
|
* days.
|
|
595
615
|
*/
|
|
596
616
|
'Idempotency-Key': string;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
620
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
621
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
622
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
623
|
+
*/
|
|
624
|
+
Prefer?: string;
|
|
597
625
|
}
|
|
598
626
|
|
|
599
627
|
export declare namespace Follow {
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
//
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
|
+
export {
|
|
6
|
+
Block,
|
|
7
|
+
type BlockCreateResponse,
|
|
8
|
+
type BlockDeleteResponse,
|
|
9
|
+
type BlockCreateParams,
|
|
10
|
+
type BlockDeleteParams,
|
|
11
|
+
} from './block';
|
|
5
12
|
export {
|
|
6
13
|
Follow,
|
|
7
14
|
type FollowCreateResponse,
|
|
@@ -9,11 +16,23 @@ export {
|
|
|
9
16
|
type FollowCreateParams,
|
|
10
17
|
type FollowDeleteAllParams,
|
|
11
18
|
} from './follow';
|
|
19
|
+
export {
|
|
20
|
+
Mute,
|
|
21
|
+
type MuteCreateResponse,
|
|
22
|
+
type MuteDeleteResponse,
|
|
23
|
+
type MuteCreateParams,
|
|
24
|
+
type MuteDeleteParams,
|
|
25
|
+
} from './mute';
|
|
12
26
|
export {
|
|
13
27
|
Users,
|
|
14
28
|
type UserRemoveFollowerResponse,
|
|
15
29
|
type UserRetrieveBatchResponse,
|
|
16
30
|
type UserRetrieveBatchTweetsResponse,
|
|
31
|
+
type UserRetrieveFollowerAuditResponse,
|
|
32
|
+
type FollowerAudit,
|
|
33
|
+
type AuditedFollower,
|
|
34
|
+
type FollowerClass,
|
|
35
|
+
type FollowerValueCount,
|
|
17
36
|
type UserRetrieveFollowerIDsResponse,
|
|
18
37
|
type UserRetrieveFollowersResponse,
|
|
19
38
|
type UserRetrieveFollowingResponse,
|
|
@@ -22,6 +41,8 @@ export {
|
|
|
22
41
|
type UserRetrieveListMembershipsResponse,
|
|
23
42
|
type UserRetrieveListsResponse,
|
|
24
43
|
type UserRetrieveLiveResponse,
|
|
44
|
+
type ShadowbanReport,
|
|
45
|
+
type ShadowbanVerdict,
|
|
25
46
|
type UserRetrieveVerifiedFollowersResponse,
|
|
26
47
|
type UserTranslateBioResponse,
|
|
27
48
|
type UserRetrieveParams,
|
|
@@ -30,6 +51,7 @@ export {
|
|
|
30
51
|
type UserRetrieveArticlesParams,
|
|
31
52
|
type UserRetrieveBatchParams,
|
|
32
53
|
type UserRetrieveBatchTweetsParams,
|
|
54
|
+
type UserRetrieveFollowerAuditParams,
|
|
33
55
|
type UserRetrieveFollowerIDsParams,
|
|
34
56
|
type UserRetrieveFollowersParams,
|
|
35
57
|
type UserRetrieveFollowersYouKnowParams,
|
|
@@ -45,6 +67,7 @@ export {
|
|
|
45
67
|
type UserRetrieveMentionsParams,
|
|
46
68
|
type UserRetrieveRepliesParams,
|
|
47
69
|
type UserRetrieveSearchParams,
|
|
70
|
+
type UserRetrieveShadowbanParams,
|
|
48
71
|
type UserRetrieveSimilarParams,
|
|
49
72
|
type UserRetrieveSubscriptionsParams,
|
|
50
73
|
type UserRetrieveTweetsParams,
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Xquik contributors
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { APIResource } from '../../../core/resource';
|
|
6
|
+
import * as WriteActionsAPI from '../write-actions';
|
|
7
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
8
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
9
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
10
|
+
import { path } from '../../../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* X write actions (tweets, likes, follows, DMs)
|
|
14
|
+
*/
|
|
15
|
+
export class Mute extends APIResource {
|
|
16
|
+
/**
|
|
17
|
+
* Mutes a user through a connected X account. The user's posts leave that
|
|
18
|
+
* account's timelines, and X doesn't tell the user.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const mute = await client.x.users.mute.create('id', {
|
|
23
|
+
* account: '@elonmusk',
|
|
24
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
create(id: string, params: MuteCreateParams, options?: RequestOptions): APIPromise<MuteCreateResponse> {
|
|
29
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
30
|
+
return this._client.post(path`/x/users/${id}/mute`, {
|
|
31
|
+
body,
|
|
32
|
+
...options,
|
|
33
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Unmutes a user through a connected X account.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const response = await client.x.users.mute.delete('id', {
|
|
43
|
+
* account: '@elonmusk',
|
|
44
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
delete(id: string, params: MuteDeleteParams, options?: RequestOptions): APIPromise<MuteDeleteResponse> {
|
|
49
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
50
|
+
return this._client.delete(path`/x/users/${id}/mute`, {
|
|
51
|
+
body,
|
|
52
|
+
...options,
|
|
53
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type MuteCreateResponse = WriteActionsAPI.WriteActionRetrieveResponse;
|
|
59
|
+
|
|
60
|
+
export type MuteDeleteResponse = WriteActionsAPI.WriteActionRetrieveResponse;
|
|
61
|
+
|
|
62
|
+
export interface MuteCreateParams {
|
|
63
|
+
/**
|
|
64
|
+
* Body param: X account identifier (@username or account ID)
|
|
65
|
+
*/
|
|
66
|
+
account: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Header param: Use one unique value per intended write. Reuse it only for an
|
|
70
|
+
* identical retry. A matching retry returns the first answer again, with
|
|
71
|
+
* idempotent: true added. It keeps the first status, body & Retry-After. It sends
|
|
72
|
+
* nothing to X & charges nothing. While the first request runs, a retry returns
|
|
73
|
+
* 202 & the action. Different input returns 409. Protection lasts at least 90
|
|
74
|
+
* days.
|
|
75
|
+
*/
|
|
76
|
+
'Idempotency-Key': string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
80
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
81
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
82
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
83
|
+
*/
|
|
84
|
+
Prefer?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface MuteDeleteParams {
|
|
88
|
+
/**
|
|
89
|
+
* Body param: X account identifier (@username or account ID)
|
|
90
|
+
*/
|
|
91
|
+
account: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Header param: Use one unique value per intended write. Reuse it only for an
|
|
95
|
+
* identical retry. A matching retry returns the first answer again, with
|
|
96
|
+
* idempotent: true added. It keeps the first status, body & Retry-After. It sends
|
|
97
|
+
* nothing to X & charges nothing. While the first request runs, a retry returns
|
|
98
|
+
* 202 & the action. Different input returns 409. Protection lasts at least 90
|
|
99
|
+
* days.
|
|
100
|
+
*/
|
|
101
|
+
'Idempotency-Key': string;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
105
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
106
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
107
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
108
|
+
*/
|
|
109
|
+
Prefer?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare namespace Mute {
|
|
113
|
+
export {
|
|
114
|
+
type MuteCreateResponse as MuteCreateResponse,
|
|
115
|
+
type MuteDeleteResponse as MuteDeleteResponse,
|
|
116
|
+
type MuteCreateParams as MuteCreateParams,
|
|
117
|
+
type MuteDeleteParams as MuteDeleteParams,
|
|
118
|
+
};
|
|
119
|
+
}
|