x-twitter-scraper 0.1.0 → 0.2.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.
- package/CHANGELOG.md +31 -0
- package/README.md +5 -5
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -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/account.d.mts +19 -0
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +19 -0
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +20 -1
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +20 -1
- package/resources/account.mjs.map +1 -1
- package/resources/api-keys.d.mts +20 -0
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +20 -0
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +20 -3
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +20 -3
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compose.d.mts +28 -3
- package/resources/compose.d.mts.map +1 -1
- package/resources/compose.d.ts +28 -3
- package/resources/compose.d.ts.map +1 -1
- package/resources/compose.js +9 -0
- package/resources/compose.js.map +1 -1
- package/resources/compose.mjs +9 -0
- package/resources/compose.mjs.map +1 -1
- package/resources/credits.d.mts +12 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +12 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js +12 -0
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs +12 -0
- package/resources/credits.mjs.map +1 -1
- package/resources/drafts.d.mts +33 -0
- package/resources/drafts.d.mts.map +1 -1
- package/resources/drafts.d.ts +33 -0
- package/resources/drafts.d.ts.map +1 -1
- package/resources/drafts.js +24 -0
- package/resources/drafts.js.map +1 -1
- package/resources/drafts.mjs +24 -0
- package/resources/drafts.mjs.map +1 -1
- package/resources/draws.d.mts +46 -1
- package/resources/draws.d.mts.map +1 -1
- package/resources/draws.d.ts +46 -1
- package/resources/draws.d.ts.map +1 -1
- package/resources/draws.js +27 -0
- package/resources/draws.js.map +1 -1
- package/resources/draws.mjs +27 -0
- package/resources/draws.mjs.map +1 -1
- package/resources/events.d.mts +25 -1
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +25 -1
- package/resources/events.d.ts.map +1 -1
- package/resources/extractions.d.mts +74 -5
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +74 -5
- package/resources/extractions.d.ts.map +1 -1
- package/resources/extractions.js +36 -0
- package/resources/extractions.js.map +1 -1
- package/resources/extractions.mjs +36 -0
- package/resources/extractions.mjs.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/integrations.d.mts +77 -0
- package/resources/integrations.d.mts.map +1 -1
- package/resources/integrations.d.ts +77 -0
- package/resources/integrations.d.ts.map +1 -1
- package/resources/integrations.js +47 -0
- package/resources/integrations.js.map +1 -1
- package/resources/integrations.mjs +47 -0
- package/resources/integrations.mjs.map +1 -1
- package/resources/monitors.d.mts +46 -0
- package/resources/monitors.d.mts.map +1 -1
- package/resources/monitors.d.ts +46 -0
- package/resources/monitors.d.ts.map +1 -1
- package/resources/monitors.js +31 -0
- package/resources/monitors.js.map +1 -1
- package/resources/monitors.mjs +31 -0
- package/resources/monitors.mjs.map +1 -1
- package/resources/radar.d.mts +4 -1
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +4 -1
- package/resources/radar.d.ts.map +1 -1
- package/resources/shared.d.mts +12 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +12 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/styles.d.mts +63 -4
- package/resources/styles.d.mts.map +1 -1
- package/resources/styles.d.ts +63 -4
- package/resources/styles.d.ts.map +1 -1
- package/resources/styles.js +55 -8
- package/resources/styles.js.map +1 -1
- package/resources/styles.mjs +55 -8
- package/resources/styles.mjs.map +1 -1
- package/resources/support/tickets.d.mts +34 -0
- package/resources/support/tickets.d.mts.map +1 -1
- package/resources/support/tickets.d.ts +34 -0
- package/resources/support/tickets.d.ts.map +1 -1
- package/resources/support/tickets.js +34 -0
- package/resources/support/tickets.js.map +1 -1
- package/resources/support/tickets.mjs +34 -0
- package/resources/support/tickets.mjs.map +1 -1
- package/resources/trends.d.mts +4 -1
- package/resources/trends.d.mts.map +1 -1
- package/resources/trends.d.ts +4 -1
- package/resources/trends.d.ts.map +1 -1
- package/resources/trends.js +1 -1
- package/resources/trends.mjs +1 -1
- package/resources/webhooks.d.mts +54 -0
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +54 -0
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +36 -0
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +36 -0
- package/resources/webhooks.mjs.map +1 -1
- package/resources/x/accounts.d.mts +59 -3
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +59 -3
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +55 -5
- package/resources/x/accounts.js.map +1 -1
- package/resources/x/accounts.mjs +55 -5
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/bookmarks.d.mts +11 -1
- package/resources/x/bookmarks.d.mts.map +1 -1
- package/resources/x/bookmarks.d.ts +11 -1
- package/resources/x/bookmarks.d.ts.map +1 -1
- package/resources/x/bookmarks.js +10 -0
- package/resources/x/bookmarks.js.map +1 -1
- package/resources/x/bookmarks.mjs +10 -0
- package/resources/x/bookmarks.mjs.map +1 -1
- package/resources/x/communities/communities.d.mts +118 -11
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +118 -11
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +45 -16
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +45 -16
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/index.d.mts +1 -1
- package/resources/x/communities/index.d.mts.map +1 -1
- package/resources/x/communities/index.d.ts +1 -1
- package/resources/x/communities/index.d.ts.map +1 -1
- package/resources/x/communities/index.js.map +1 -1
- package/resources/x/communities/index.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +18 -2
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +18 -2
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +16 -0
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +16 -0
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/communities/tweets.d.mts +28 -5
- package/resources/x/communities/tweets.d.mts.map +1 -1
- package/resources/x/communities/tweets.d.ts +28 -5
- package/resources/x/communities/tweets.d.ts.map +1 -1
- package/resources/x/communities/tweets.js +20 -6
- package/resources/x/communities/tweets.js.map +1 -1
- package/resources/x/communities/tweets.mjs +20 -6
- package/resources/x/communities/tweets.mjs.map +1 -1
- package/resources/x/dm.d.mts +19 -2
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +19 -2
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +17 -0
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +17 -0
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/followers.d.mts +8 -0
- package/resources/x/followers.d.mts.map +1 -1
- package/resources/x/followers.d.ts +8 -0
- package/resources/x/followers.d.ts.map +1 -1
- package/resources/x/followers.js +8 -0
- package/resources/x/followers.js.map +1 -1
- package/resources/x/followers.mjs +8 -0
- package/resources/x/followers.mjs.map +1 -1
- package/resources/x/index.d.mts +2 -2
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +2 -2
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/lists.d.mts +27 -6
- package/resources/x/lists.d.mts.map +1 -1
- package/resources/x/lists.d.ts +27 -6
- package/resources/x/lists.d.ts.map +1 -1
- package/resources/x/lists.js +23 -16
- package/resources/x/lists.js.map +1 -1
- package/resources/x/lists.mjs +23 -16
- package/resources/x/lists.mjs.map +1 -1
- package/resources/x/media.d.mts +17 -1
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +17 -1
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +16 -0
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs +16 -0
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +30 -3
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +30 -3
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +27 -0
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs +27 -0
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts +18 -4
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts +18 -4
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.js +18 -4
- package/resources/x/tweets/like.js.map +1 -1
- package/resources/x/tweets/like.mjs +18 -4
- package/resources/x/tweets/like.mjs.map +1 -1
- package/resources/x/tweets/retweet.d.mts +18 -4
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts +18 -4
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.js +18 -4
- package/resources/x/tweets/retweet.js.map +1 -1
- package/resources/x/tweets/retweet.mjs +18 -4
- package/resources/x/tweets/retweet.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +146 -15
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +146 -15
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +74 -10
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +74 -10
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/follow.d.mts +19 -4
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts +19 -4
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.js +19 -4
- package/resources/x/users/follow.js.map +1 -1
- package/resources/x/users/follow.mjs +19 -4
- package/resources/x/users/follow.mjs.map +1 -1
- package/resources/x/users/users.d.mts +94 -21
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +94 -21
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +78 -33
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +78 -33
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/x.d.mts +42 -6
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +42 -6
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +21 -5
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +21 -5
- package/resources/x/x.mjs.map +1 -1
- package/src/client.ts +2 -0
- package/src/resources/account.ts +20 -1
- package/src/resources/api-keys.ts +23 -3
- package/src/resources/compose.ts +32 -1
- package/src/resources/credits.ts +12 -0
- package/src/resources/drafts.ts +33 -0
- package/src/resources/draws.ts +46 -1
- package/src/resources/events.ts +25 -1
- package/src/resources/extractions.ts +74 -5
- package/src/resources/index.ts +1 -0
- package/src/resources/integrations.ts +77 -0
- package/src/resources/monitors.ts +46 -0
- package/src/resources/radar.ts +4 -1
- package/src/resources/shared.ts +12 -0
- package/src/resources/styles.ts +67 -8
- package/src/resources/support/tickets.ts +34 -0
- package/src/resources/trends.ts +4 -1
- package/src/resources/webhooks.ts +54 -0
- package/src/resources/x/accounts.ts +72 -7
- package/src/resources/x/bookmarks.ts +11 -1
- package/src/resources/x/communities/communities.ts +142 -26
- package/src/resources/x/communities/index.ts +1 -1
- package/src/resources/x/communities/join.ts +18 -2
- package/src/resources/x/communities/tweets.ts +41 -11
- package/src/resources/x/dm.ts +19 -2
- package/src/resources/x/followers.ts +8 -0
- package/src/resources/x/index.ts +2 -0
- package/src/resources/x/lists.ts +30 -22
- package/src/resources/x/media.ts +17 -1
- package/src/resources/x/profile.ts +30 -3
- package/src/resources/x/tweets/like.ts +20 -6
- package/src/resources/x/tweets/retweet.ts +20 -14
- package/src/resources/x/tweets/tweets.ts +157 -27
- package/src/resources/x/users/follow.ts +21 -10
- package/src/resources/x/users/users.ts +103 -52
- package/src/resources/x/x.ts +50 -8
- 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
|
@@ -8,43 +8,102 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
8
8
|
export declare class Integrations extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Create integration
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const integration = await client.integrations.create({
|
|
15
|
+
* config: { chatId: '-1001234567890' },
|
|
16
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
17
|
+
* name: 'My Telegram Bot',
|
|
18
|
+
* type: 'telegram',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
11
21
|
*/
|
|
12
22
|
create(body: IntegrationCreateParams, options?: RequestOptions): APIPromise<Integration>;
|
|
13
23
|
/**
|
|
14
24
|
* Get integration details
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const integration = await client.integrations.retrieve(
|
|
29
|
+
* 'id',
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
15
32
|
*/
|
|
16
33
|
retrieve(id: string, options?: RequestOptions): APIPromise<Integration>;
|
|
17
34
|
/**
|
|
18
35
|
* Update integration
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const integration = await client.integrations.update('id', {
|
|
40
|
+
* isActive: true,
|
|
41
|
+
* name: 'My Telegram Bot',
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
19
44
|
*/
|
|
20
45
|
update(id: string, body: IntegrationUpdateParams, options?: RequestOptions): APIPromise<Integration>;
|
|
21
46
|
/**
|
|
22
47
|
* List integrations
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const integrations = await client.integrations.list();
|
|
52
|
+
* ```
|
|
23
53
|
*/
|
|
24
54
|
list(options?: RequestOptions): APIPromise<IntegrationListResponse>;
|
|
25
55
|
/**
|
|
26
56
|
* Delete integration
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const integration = await client.integrations.delete('id');
|
|
61
|
+
* ```
|
|
27
62
|
*/
|
|
28
63
|
delete(id: string, options?: RequestOptions): APIPromise<IntegrationDeleteResponse>;
|
|
29
64
|
/**
|
|
30
65
|
* List integration delivery history
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const response = await client.integrations.listDeliveries(
|
|
70
|
+
* 'id',
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
31
73
|
*/
|
|
32
74
|
listDeliveries(id: string, query?: IntegrationListDeliveriesParams | null | undefined, options?: RequestOptions): APIPromise<IntegrationListDeliveriesResponse>;
|
|
33
75
|
/**
|
|
34
76
|
* Send test delivery
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const response = await client.integrations.sendTest('id');
|
|
81
|
+
* ```
|
|
35
82
|
*/
|
|
36
83
|
sendTest(id: string, options?: RequestOptions): APIPromise<IntegrationSendTestResponse>;
|
|
37
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Third-party integration (e.g. Telegram) subscribed to monitor events.
|
|
87
|
+
*/
|
|
38
88
|
export interface Integration {
|
|
39
89
|
id: string;
|
|
90
|
+
/**
|
|
91
|
+
* Integration config — shape varies by type (JSON)
|
|
92
|
+
*/
|
|
40
93
|
config: {
|
|
41
94
|
[key: string]: unknown;
|
|
42
95
|
};
|
|
43
96
|
createdAt: string;
|
|
97
|
+
/**
|
|
98
|
+
* Array of event types to subscribe to.
|
|
99
|
+
*/
|
|
44
100
|
eventTypes: Array<Shared.EventType>;
|
|
45
101
|
isActive: boolean;
|
|
46
102
|
name: string;
|
|
47
103
|
type: 'telegram';
|
|
104
|
+
/**
|
|
105
|
+
* Event filter rules (JSON)
|
|
106
|
+
*/
|
|
48
107
|
filters?: {
|
|
49
108
|
[key: string]: unknown;
|
|
50
109
|
};
|
|
@@ -52,6 +111,9 @@ export interface Integration {
|
|
|
52
111
|
scopeAllMonitors?: boolean;
|
|
53
112
|
silentPush?: boolean;
|
|
54
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Integration delivery attempt record with status and retry count.
|
|
116
|
+
*/
|
|
55
117
|
export interface IntegrationDelivery {
|
|
56
118
|
id: string;
|
|
57
119
|
attempts: number;
|
|
@@ -81,6 +143,9 @@ export interface IntegrationCreateParams {
|
|
|
81
143
|
* Integration config (e.g. Telegram chatId)
|
|
82
144
|
*/
|
|
83
145
|
config: IntegrationCreateParams.Config;
|
|
146
|
+
/**
|
|
147
|
+
* Array of event types to subscribe to.
|
|
148
|
+
*/
|
|
84
149
|
eventTypes: Array<Shared.EventType>;
|
|
85
150
|
name: string;
|
|
86
151
|
type: 'telegram';
|
|
@@ -94,11 +159,20 @@ export declare namespace IntegrationCreateParams {
|
|
|
94
159
|
}
|
|
95
160
|
}
|
|
96
161
|
export interface IntegrationUpdateParams {
|
|
162
|
+
/**
|
|
163
|
+
* Array of event types to subscribe to.
|
|
164
|
+
*/
|
|
97
165
|
eventTypes?: Array<Shared.EventType>;
|
|
166
|
+
/**
|
|
167
|
+
* Event filter rules (JSON)
|
|
168
|
+
*/
|
|
98
169
|
filters?: {
|
|
99
170
|
[key: string]: unknown;
|
|
100
171
|
};
|
|
101
172
|
isActive?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Custom message template (JSON)
|
|
175
|
+
*/
|
|
102
176
|
messageTemplate?: {
|
|
103
177
|
[key: string]: unknown;
|
|
104
178
|
};
|
|
@@ -107,6 +181,9 @@ export interface IntegrationUpdateParams {
|
|
|
107
181
|
silentPush?: boolean;
|
|
108
182
|
}
|
|
109
183
|
export interface IntegrationListDeliveriesParams {
|
|
184
|
+
/**
|
|
185
|
+
* Maximum number of items to return (1-100, default 50)
|
|
186
|
+
*/
|
|
110
187
|
limit?: number;
|
|
111
188
|
}
|
|
112
189
|
export declare namespace Integrations {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.d.mts","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"integrations.d.mts","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAIxF;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAIvE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAA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KAAE,CAAC;IAE7C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
|
@@ -8,43 +8,102 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
8
8
|
export declare class Integrations extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Create integration
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const integration = await client.integrations.create({
|
|
15
|
+
* config: { chatId: '-1001234567890' },
|
|
16
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
17
|
+
* name: 'My Telegram Bot',
|
|
18
|
+
* type: 'telegram',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
11
21
|
*/
|
|
12
22
|
create(body: IntegrationCreateParams, options?: RequestOptions): APIPromise<Integration>;
|
|
13
23
|
/**
|
|
14
24
|
* Get integration details
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const integration = await client.integrations.retrieve(
|
|
29
|
+
* 'id',
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
15
32
|
*/
|
|
16
33
|
retrieve(id: string, options?: RequestOptions): APIPromise<Integration>;
|
|
17
34
|
/**
|
|
18
35
|
* Update integration
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const integration = await client.integrations.update('id', {
|
|
40
|
+
* isActive: true,
|
|
41
|
+
* name: 'My Telegram Bot',
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
19
44
|
*/
|
|
20
45
|
update(id: string, body: IntegrationUpdateParams, options?: RequestOptions): APIPromise<Integration>;
|
|
21
46
|
/**
|
|
22
47
|
* List integrations
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const integrations = await client.integrations.list();
|
|
52
|
+
* ```
|
|
23
53
|
*/
|
|
24
54
|
list(options?: RequestOptions): APIPromise<IntegrationListResponse>;
|
|
25
55
|
/**
|
|
26
56
|
* Delete integration
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const integration = await client.integrations.delete('id');
|
|
61
|
+
* ```
|
|
27
62
|
*/
|
|
28
63
|
delete(id: string, options?: RequestOptions): APIPromise<IntegrationDeleteResponse>;
|
|
29
64
|
/**
|
|
30
65
|
* List integration delivery history
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const response = await client.integrations.listDeliveries(
|
|
70
|
+
* 'id',
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
31
73
|
*/
|
|
32
74
|
listDeliveries(id: string, query?: IntegrationListDeliveriesParams | null | undefined, options?: RequestOptions): APIPromise<IntegrationListDeliveriesResponse>;
|
|
33
75
|
/**
|
|
34
76
|
* Send test delivery
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const response = await client.integrations.sendTest('id');
|
|
81
|
+
* ```
|
|
35
82
|
*/
|
|
36
83
|
sendTest(id: string, options?: RequestOptions): APIPromise<IntegrationSendTestResponse>;
|
|
37
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Third-party integration (e.g. Telegram) subscribed to monitor events.
|
|
87
|
+
*/
|
|
38
88
|
export interface Integration {
|
|
39
89
|
id: string;
|
|
90
|
+
/**
|
|
91
|
+
* Integration config — shape varies by type (JSON)
|
|
92
|
+
*/
|
|
40
93
|
config: {
|
|
41
94
|
[key: string]: unknown;
|
|
42
95
|
};
|
|
43
96
|
createdAt: string;
|
|
97
|
+
/**
|
|
98
|
+
* Array of event types to subscribe to.
|
|
99
|
+
*/
|
|
44
100
|
eventTypes: Array<Shared.EventType>;
|
|
45
101
|
isActive: boolean;
|
|
46
102
|
name: string;
|
|
47
103
|
type: 'telegram';
|
|
104
|
+
/**
|
|
105
|
+
* Event filter rules (JSON)
|
|
106
|
+
*/
|
|
48
107
|
filters?: {
|
|
49
108
|
[key: string]: unknown;
|
|
50
109
|
};
|
|
@@ -52,6 +111,9 @@ export interface Integration {
|
|
|
52
111
|
scopeAllMonitors?: boolean;
|
|
53
112
|
silentPush?: boolean;
|
|
54
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Integration delivery attempt record with status and retry count.
|
|
116
|
+
*/
|
|
55
117
|
export interface IntegrationDelivery {
|
|
56
118
|
id: string;
|
|
57
119
|
attempts: number;
|
|
@@ -81,6 +143,9 @@ export interface IntegrationCreateParams {
|
|
|
81
143
|
* Integration config (e.g. Telegram chatId)
|
|
82
144
|
*/
|
|
83
145
|
config: IntegrationCreateParams.Config;
|
|
146
|
+
/**
|
|
147
|
+
* Array of event types to subscribe to.
|
|
148
|
+
*/
|
|
84
149
|
eventTypes: Array<Shared.EventType>;
|
|
85
150
|
name: string;
|
|
86
151
|
type: 'telegram';
|
|
@@ -94,11 +159,20 @@ export declare namespace IntegrationCreateParams {
|
|
|
94
159
|
}
|
|
95
160
|
}
|
|
96
161
|
export interface IntegrationUpdateParams {
|
|
162
|
+
/**
|
|
163
|
+
* Array of event types to subscribe to.
|
|
164
|
+
*/
|
|
97
165
|
eventTypes?: Array<Shared.EventType>;
|
|
166
|
+
/**
|
|
167
|
+
* Event filter rules (JSON)
|
|
168
|
+
*/
|
|
98
169
|
filters?: {
|
|
99
170
|
[key: string]: unknown;
|
|
100
171
|
};
|
|
101
172
|
isActive?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Custom message template (JSON)
|
|
175
|
+
*/
|
|
102
176
|
messageTemplate?: {
|
|
103
177
|
[key: string]: unknown;
|
|
104
178
|
};
|
|
@@ -107,6 +181,9 @@ export interface IntegrationUpdateParams {
|
|
|
107
181
|
silentPush?: boolean;
|
|
108
182
|
}
|
|
109
183
|
export interface IntegrationListDeliveriesParams {
|
|
184
|
+
/**
|
|
185
|
+
* Maximum number of items to return (1-100, default 50)
|
|
186
|
+
*/
|
|
110
187
|
limit?: number;
|
|
111
188
|
}
|
|
112
189
|
export declare namespace Integrations {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAIxF;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC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Ae,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAE7C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
|
@@ -10,42 +10,89 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
10
10
|
class Integrations extends resource_1.APIResource {
|
|
11
11
|
/**
|
|
12
12
|
* Create integration
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const integration = await client.integrations.create({
|
|
17
|
+
* config: { chatId: '-1001234567890' },
|
|
18
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
19
|
+
* name: 'My Telegram Bot',
|
|
20
|
+
* type: 'telegram',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
13
23
|
*/
|
|
14
24
|
create(body, options) {
|
|
15
25
|
return this._client.post('/integrations', { body, ...options });
|
|
16
26
|
}
|
|
17
27
|
/**
|
|
18
28
|
* Get integration details
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const integration = await client.integrations.retrieve(
|
|
33
|
+
* 'id',
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
19
36
|
*/
|
|
20
37
|
retrieve(id, options) {
|
|
21
38
|
return this._client.get((0, path_1.path) `/integrations/${id}`, options);
|
|
22
39
|
}
|
|
23
40
|
/**
|
|
24
41
|
* Update integration
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const integration = await client.integrations.update('id', {
|
|
46
|
+
* isActive: true,
|
|
47
|
+
* name: 'My Telegram Bot',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
25
50
|
*/
|
|
26
51
|
update(id, body, options) {
|
|
27
52
|
return this._client.patch((0, path_1.path) `/integrations/${id}`, { body, ...options });
|
|
28
53
|
}
|
|
29
54
|
/**
|
|
30
55
|
* List integrations
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const integrations = await client.integrations.list();
|
|
60
|
+
* ```
|
|
31
61
|
*/
|
|
32
62
|
list(options) {
|
|
33
63
|
return this._client.get('/integrations', options);
|
|
34
64
|
}
|
|
35
65
|
/**
|
|
36
66
|
* Delete integration
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const integration = await client.integrations.delete('id');
|
|
71
|
+
* ```
|
|
37
72
|
*/
|
|
38
73
|
delete(id, options) {
|
|
39
74
|
return this._client.delete((0, path_1.path) `/integrations/${id}`, options);
|
|
40
75
|
}
|
|
41
76
|
/**
|
|
42
77
|
* List integration delivery history
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const response = await client.integrations.listDeliveries(
|
|
82
|
+
* 'id',
|
|
83
|
+
* );
|
|
84
|
+
* ```
|
|
43
85
|
*/
|
|
44
86
|
listDeliveries(id, query = {}, options) {
|
|
45
87
|
return this._client.get((0, path_1.path) `/integrations/${id}/deliveries`, { query, ...options });
|
|
46
88
|
}
|
|
47
89
|
/**
|
|
48
90
|
* Send test delivery
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const response = await client.integrations.sendTest('id');
|
|
95
|
+
* ```
|
|
49
96
|
*/
|
|
50
97
|
sendTest(id, options) {
|
|
51
98
|
return this._client.post((0, path_1.path) `/integrations/${id}/test`, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAA8C;AAE9C;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAA8C;AAE9C;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAU,EAAE,IAA6B,EAAE,OAAwB;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;OASG;IACH,cAAc,CACZ,EAAU,EACV,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF;AApGD,oCAoGC"}
|
|
@@ -7,42 +7,89 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
7
7
|
export class Integrations extends APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create integration
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const integration = await client.integrations.create({
|
|
14
|
+
* config: { chatId: '-1001234567890' },
|
|
15
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
16
|
+
* name: 'My Telegram Bot',
|
|
17
|
+
* type: 'telegram',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
10
20
|
*/
|
|
11
21
|
create(body, options) {
|
|
12
22
|
return this._client.post('/integrations', { body, ...options });
|
|
13
23
|
}
|
|
14
24
|
/**
|
|
15
25
|
* Get integration details
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const integration = await client.integrations.retrieve(
|
|
30
|
+
* 'id',
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
16
33
|
*/
|
|
17
34
|
retrieve(id, options) {
|
|
18
35
|
return this._client.get(path `/integrations/${id}`, options);
|
|
19
36
|
}
|
|
20
37
|
/**
|
|
21
38
|
* Update integration
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const integration = await client.integrations.update('id', {
|
|
43
|
+
* isActive: true,
|
|
44
|
+
* name: 'My Telegram Bot',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
22
47
|
*/
|
|
23
48
|
update(id, body, options) {
|
|
24
49
|
return this._client.patch(path `/integrations/${id}`, { body, ...options });
|
|
25
50
|
}
|
|
26
51
|
/**
|
|
27
52
|
* List integrations
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const integrations = await client.integrations.list();
|
|
57
|
+
* ```
|
|
28
58
|
*/
|
|
29
59
|
list(options) {
|
|
30
60
|
return this._client.get('/integrations', options);
|
|
31
61
|
}
|
|
32
62
|
/**
|
|
33
63
|
* Delete integration
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const integration = await client.integrations.delete('id');
|
|
68
|
+
* ```
|
|
34
69
|
*/
|
|
35
70
|
delete(id, options) {
|
|
36
71
|
return this._client.delete(path `/integrations/${id}`, options);
|
|
37
72
|
}
|
|
38
73
|
/**
|
|
39
74
|
* List integration delivery history
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const response = await client.integrations.listDeliveries(
|
|
79
|
+
* 'id',
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
40
82
|
*/
|
|
41
83
|
listDeliveries(id, query = {}, options) {
|
|
42
84
|
return this._client.get(path `/integrations/${id}/deliveries`, { query, ...options });
|
|
43
85
|
}
|
|
44
86
|
/**
|
|
45
87
|
* Send test delivery
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const response = await client.integrations.sendTest('id');
|
|
92
|
+
* ```
|
|
46
93
|
*/
|
|
47
94
|
sendTest(id, options) {
|
|
48
95
|
return this._client.post(path `/integrations/${id}/test`, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.mjs","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"integrations.mjs","sourceRoot":"","sources":["../src/resources/integrations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAA6B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAU,EAAE,IAA6B,EAAE,OAAwB;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,iBAAiB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;OASG;IACH,cAAc,CACZ,EAAU,EACV,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,iBAAiB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF"}
|
package/resources/monitors.d.mts
CHANGED
|
@@ -8,28 +8,65 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
8
8
|
export declare class Monitors extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Create monitor
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const monitor = await client.monitors.create({
|
|
15
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
16
|
+
* username: 'elonmusk',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
11
19
|
*/
|
|
12
20
|
create(body: MonitorCreateParams, options?: RequestOptions): APIPromise<MonitorCreateResponse>;
|
|
13
21
|
/**
|
|
14
22
|
* Get monitor
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const monitor = await client.monitors.retrieve('id');
|
|
27
|
+
* ```
|
|
15
28
|
*/
|
|
16
29
|
retrieve(id: string, options?: RequestOptions): APIPromise<Monitor>;
|
|
17
30
|
/**
|
|
18
31
|
* Update monitor
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const monitor = await client.monitors.update('id', {
|
|
36
|
+
* eventTypes: ['tweet.new'],
|
|
37
|
+
* isActive: true,
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
19
40
|
*/
|
|
20
41
|
update(id: string, body: MonitorUpdateParams, options?: RequestOptions): APIPromise<Monitor>;
|
|
21
42
|
/**
|
|
22
43
|
* List monitors
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const monitors = await client.monitors.list();
|
|
48
|
+
* ```
|
|
23
49
|
*/
|
|
24
50
|
list(options?: RequestOptions): APIPromise<MonitorListResponse>;
|
|
25
51
|
/**
|
|
26
52
|
* Deactivate monitor
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const response = await client.monitors.deactivate('id');
|
|
57
|
+
* ```
|
|
27
58
|
*/
|
|
28
59
|
deactivate(id: string, options?: RequestOptions): APIPromise<MonitorDeactivateResponse>;
|
|
29
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Account monitor that tracks activity for a given X user.
|
|
63
|
+
*/
|
|
30
64
|
export interface Monitor {
|
|
31
65
|
id: string;
|
|
32
66
|
createdAt: string;
|
|
67
|
+
/**
|
|
68
|
+
* Array of event types to subscribe to.
|
|
69
|
+
*/
|
|
33
70
|
eventTypes: Array<Shared.EventType>;
|
|
34
71
|
isActive: boolean;
|
|
35
72
|
username: string;
|
|
@@ -38,6 +75,9 @@ export interface Monitor {
|
|
|
38
75
|
export interface MonitorCreateResponse {
|
|
39
76
|
id: string;
|
|
40
77
|
createdAt: string;
|
|
78
|
+
/**
|
|
79
|
+
* Array of event types to subscribe to.
|
|
80
|
+
*/
|
|
41
81
|
eventTypes: Array<Shared.EventType>;
|
|
42
82
|
username: string;
|
|
43
83
|
xUserId: string;
|
|
@@ -50,6 +90,9 @@ export interface MonitorDeactivateResponse {
|
|
|
50
90
|
success: true;
|
|
51
91
|
}
|
|
52
92
|
export interface MonitorCreateParams {
|
|
93
|
+
/**
|
|
94
|
+
* Array of event types to subscribe to.
|
|
95
|
+
*/
|
|
53
96
|
eventTypes: Array<Shared.EventType>;
|
|
54
97
|
/**
|
|
55
98
|
* X username (without @)
|
|
@@ -57,6 +100,9 @@ export interface MonitorCreateParams {
|
|
|
57
100
|
username: string;
|
|
58
101
|
}
|
|
59
102
|
export interface MonitorUpdateParams {
|
|
103
|
+
/**
|
|
104
|
+
* Array of event types to subscribe to.
|
|
105
|
+
*/
|
|
60
106
|
eventTypes?: Array<Shared.EventType>;
|
|
61
107
|
isActive?: boolean;
|
|
62
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitors.d.mts","sourceRoot":"","sources":["../src/resources/monitors.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"monitors.d.mts","sourceRoot":"","sources":["../src/resources/monitors.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInE;;;;;;;;;;OAUG;IACH,MA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