x-twitter-scraper 0.3.0 → 0.3.2

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2 (2026-05-05)
4
+
5
+ Full Changelog: [v0.3.1...v0.3.2](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.3.1...v0.3.2)
6
+
7
+ ### Bug Fixes
8
+
9
+ * remove stale integrations resource from the TypeScript SDK package
10
+
11
+ ## 0.3.1 (2026-05-05)
12
+
13
+ Full Changelog: [v0.3.0...v0.3.1](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.3.0...v0.3.1)
14
+
15
+ ### Chores
16
+
17
+ * improve npm package discoverability metadata
18
+
3
19
  ## 0.3.0 (2026-04-25)
4
20
 
5
21
  Full Changelog: [v0.2.1...v0.3.0](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.2.1...v0.3.0)
package/README.md CHANGED
@@ -1,13 +1,61 @@
1
- # X Twitter Scraper TypeScript API Library
1
+ # Xquik TypeScript SDK for X (Twitter) Scraper API
2
2
 
3
3
  [![NPM version](<https://img.shields.io/npm/v/x-twitter-scraper.svg?label=npm%20(stable)>)](https://npmjs.org/package/x-twitter-scraper) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/x-twitter-scraper)
4
4
 
5
- This library provides convenient access to the X Twitter Scraper REST API from server-side TypeScript or JavaScript.
5
+ Xquik TypeScript SDK for the X (Twitter) Scraper API: typed REST, HMAC webhooks, MCP, and docs at https://docs.xquik.com/api-reference/overview.
6
6
 
7
- The REST API documentation can be found on [xquik.com](https://xquik.com). The full API of this library can be found in [api.md](api.md).
7
+ Use it to search tweets, look up users, monitor accounts, run giveaway draws, and connect AI agents to X data without maintaining scraping infrastructure.
8
+
9
+ [SDK API](api.md) | [REST API Docs](https://docs.xquik.com/api-reference/overview) | [OpenAPI Spec](https://xquik.com/openapi.json) | [Webhooks](https://docs.xquik.com/api-reference/webhooks/create) | [MCP Server](https://xquik.com/mcp) | [Python SDK](https://github.com/Xquik-dev/x-twitter-scraper-python)
8
10
 
9
11
  It is generated with [Stainless](https://www.stainless.com/).
10
12
 
13
+ ## Tweet Search & User Lookup
14
+
15
+ Build TypeScript services that search tweets, fetch user profiles, check follower relationships, download media, and inspect timeline data through one typed REST client.
16
+
17
+ ## Real-Time Monitoring & Webhooks
18
+
19
+ Create monitors for X accounts, receive HMAC-signed webhook events, and query event history from the same SDK surface.
20
+
21
+ ## AI Agent Workflows With MCP
22
+
23
+ Connect agent systems to Xquik through the MCP server while keeping custom product code on the typed REST SDK.
24
+
25
+ ## Giveaway Draws & Extractions
26
+
27
+ Run giveaway draws, export winners, and launch extraction jobs for replies, reposts, quotes, followers, lists, communities, threads, articles, and tweet search.
28
+
29
+ ## Xquik SDK vs Building From Scratch
30
+
31
+ | Need | Xquik TypeScript SDK | Building From Scratch |
32
+ | --- | --- | --- |
33
+ | Typed REST calls | Generated request and response types | Hand-maintained schemas |
34
+ | Real-time events | Monitors plus HMAC webhooks | Separate queue and signing work |
35
+ | AI agent access | REST SDK plus MCP server | Custom bridge layer |
36
+ | X data workflows | Search, user lookup, draws, exports, and monitoring | Many separate integrations |
37
+
38
+ ## Package & Registry Trust
39
+
40
+ - Package: [npm `x-twitter-scraper`](https://www.npmjs.com/package/x-twitter-scraper)
41
+ - Source: [Xquik-dev/x-twitter-scraper-typescript](https://github.com/Xquik-dev/x-twitter-scraper-typescript)
42
+ - License: Apache-2.0
43
+ - Citation metadata: [CITATION.cff](CITATION.cff)
44
+
45
+ ## FAQ
46
+
47
+ ### Is this SDK only for browser apps?
48
+
49
+ No. It is designed for server-side TypeScript and JavaScript runtimes.
50
+
51
+ ### Where are the REST endpoints documented?
52
+
53
+ Start with the [REST API overview](https://docs.xquik.com/api-reference/overview), then use [api.md](api.md) for generated method names.
54
+
55
+ ### Can this work with AI agents?
56
+
57
+ Yes. Use the SDK in your app code and the [MCP server](https://xquik.com/mcp) for MCP-compatible agent clients.
58
+
11
59
  ## Installation
12
60
 
13
61
  ```sh
package/package.json CHANGED
@@ -1,12 +1,30 @@
1
1
  {
2
2
  "name": "x-twitter-scraper",
3
- "version": "0.3.0",
4
- "description": "The official TypeScript library for the X Twitter Scraper API",
3
+ "version": "0.3.2",
4
+ "description": "Official TypeScript SDK for the Xquik X (Twitter) Scraper API, webhooks, monitoring, and agent workflows",
5
5
  "author": "X Twitter Scraper <support@xquik.com>",
6
6
  "types": "./index.d.ts",
7
7
  "main": "./index.js",
8
8
  "type": "commonjs",
9
- "repository": "github:Xquik-dev/x-twitter-scraper-typescript",
9
+ "homepage": "https://docs.xquik.com/sdks/typescript",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/Xquik-dev/x-twitter-scraper-typescript.git"
13
+ },
14
+ "keywords": [
15
+ "x-api",
16
+ "twitter-api",
17
+ "twitter-scraper",
18
+ "x-twitter-scraper",
19
+ "xquik",
20
+ "typescript-sdk",
21
+ "nodejs",
22
+ "api-client",
23
+ "webhooks",
24
+ "monitoring",
25
+ "mcp",
26
+ "social-media-api"
27
+ ],
10
28
  "license": "Apache-2.0",
11
29
  "files": [
12
30
  "**/*"
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.3.2'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.0";
1
+ export declare const VERSION = "0.3.2";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.0";
1
+ export declare const VERSION = "0.3.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.3.0'; // x-release-please-version
4
+ exports.VERSION = '0.3.2'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.3.2'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,192 +0,0 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import * as Shared from "./shared.mjs";
3
- import { APIPromise } from "../core/api-promise.mjs";
4
- import { RequestOptions } from "../internal/request-options.mjs";
5
- /**
6
- * Push notification integrations (Telegram)
7
- */
8
- export declare class Integrations extends APIResource {
9
- /**
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
- * ```
21
- */
22
- create(body: IntegrationCreateParams, options?: RequestOptions): APIPromise<Integration>;
23
- /**
24
- * Get integration details
25
- *
26
- * @example
27
- * ```ts
28
- * const integration = await client.integrations.retrieve(
29
- * 'id',
30
- * );
31
- * ```
32
- */
33
- retrieve(id: string, options?: RequestOptions): APIPromise<Integration>;
34
- /**
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
- * ```
44
- */
45
- update(id: string, body: IntegrationUpdateParams, options?: RequestOptions): APIPromise<Integration>;
46
- /**
47
- * List integrations
48
- *
49
- * @example
50
- * ```ts
51
- * const integrations = await client.integrations.list();
52
- * ```
53
- */
54
- list(options?: RequestOptions): APIPromise<IntegrationListResponse>;
55
- /**
56
- * Delete integration
57
- *
58
- * @example
59
- * ```ts
60
- * const integration = await client.integrations.delete('id');
61
- * ```
62
- */
63
- delete(id: string, options?: RequestOptions): APIPromise<IntegrationDeleteResponse>;
64
- /**
65
- * List integration delivery history
66
- *
67
- * @example
68
- * ```ts
69
- * const response = await client.integrations.listDeliveries(
70
- * 'id',
71
- * );
72
- * ```
73
- */
74
- listDeliveries(id: string, query?: IntegrationListDeliveriesParams | null | undefined, options?: RequestOptions): APIPromise<IntegrationListDeliveriesResponse>;
75
- /**
76
- * Send test delivery
77
- *
78
- * @example
79
- * ```ts
80
- * const response = await client.integrations.sendTest('id');
81
- * ```
82
- */
83
- sendTest(id: string, options?: RequestOptions): APIPromise<IntegrationSendTestResponse>;
84
- }
85
- /**
86
- * Third-party integration (e.g. Telegram) subscribed to monitor events.
87
- */
88
- export interface Integration {
89
- id: string;
90
- /**
91
- * Integration config — shape varies by type (JSON)
92
- */
93
- config: {
94
- [key: string]: unknown;
95
- };
96
- createdAt: string;
97
- /**
98
- * Array of event types to subscribe to.
99
- */
100
- eventTypes: Array<Shared.EventType>;
101
- isActive: boolean;
102
- name: string;
103
- type: 'telegram';
104
- /**
105
- * Event filter rules (JSON)
106
- */
107
- filters?: {
108
- [key: string]: unknown;
109
- };
110
- messageTemplate?: string;
111
- scopeAllMonitors?: boolean;
112
- silentPush?: boolean;
113
- }
114
- /**
115
- * Integration delivery attempt record with status and retry count.
116
- */
117
- export interface IntegrationDelivery {
118
- id: string;
119
- attempts: number;
120
- createdAt: string;
121
- eventType: string;
122
- status: string;
123
- deliveredAt?: string;
124
- lastError?: string;
125
- lastStatusCode?: number;
126
- sourceId?: string;
127
- sourceType?: string;
128
- }
129
- export interface IntegrationListResponse {
130
- integrations: Array<Integration>;
131
- }
132
- export interface IntegrationDeleteResponse {
133
- success: true;
134
- }
135
- export interface IntegrationListDeliveriesResponse {
136
- deliveries: Array<IntegrationDelivery>;
137
- }
138
- export interface IntegrationSendTestResponse {
139
- success: true;
140
- }
141
- export interface IntegrationCreateParams {
142
- /**
143
- * Integration config (e.g. Telegram chatId)
144
- */
145
- config: IntegrationCreateParams.Config;
146
- /**
147
- * Array of event types to subscribe to.
148
- */
149
- eventTypes: Array<Shared.EventType>;
150
- name: string;
151
- type: 'telegram';
152
- }
153
- export declare namespace IntegrationCreateParams {
154
- /**
155
- * Integration config (e.g. Telegram chatId)
156
- */
157
- interface Config {
158
- chatId: string;
159
- }
160
- }
161
- export interface IntegrationUpdateParams {
162
- /**
163
- * Array of event types to subscribe to.
164
- */
165
- eventTypes?: Array<Shared.EventType>;
166
- /**
167
- * Event filter rules (JSON)
168
- */
169
- filters?: {
170
- [key: string]: unknown;
171
- };
172
- isActive?: boolean;
173
- /**
174
- * Custom message template (JSON)
175
- */
176
- messageTemplate?: {
177
- [key: string]: unknown;
178
- };
179
- name?: string;
180
- scopeAllMonitors?: boolean;
181
- silentPush?: boolean;
182
- }
183
- export interface IntegrationListDeliveriesParams {
184
- /**
185
- * Maximum number of items to return (1-100, default 50)
186
- */
187
- limit?: number;
188
- }
189
- export declare namespace Integrations {
190
- export { type Integration as Integration, type IntegrationDelivery as IntegrationDelivery, type IntegrationListResponse as IntegrationListResponse, type IntegrationDeleteResponse as IntegrationDeleteResponse, type IntegrationListDeliveriesResponse as IntegrationListDeliveriesResponse, type IntegrationSendTestResponse as IntegrationSendTestResponse, type IntegrationCreateParams as IntegrationCreateParams, type IntegrationUpdateParams as IntegrationUpdateParams, type IntegrationListDeliveriesParams as IntegrationListDeliveriesParams, };
191
- }
192
- //# sourceMappingURL=integrations.d.mts.map
@@ -1 +0,0 @@
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,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IAErC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,eAAe,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"}
@@ -1,192 +0,0 @@
1
- import { APIResource } from "../core/resource.js";
2
- import * as Shared from "./shared.js";
3
- import { APIPromise } from "../core/api-promise.js";
4
- import { RequestOptions } from "../internal/request-options.js";
5
- /**
6
- * Push notification integrations (Telegram)
7
- */
8
- export declare class Integrations extends APIResource {
9
- /**
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
- * ```
21
- */
22
- create(body: IntegrationCreateParams, options?: RequestOptions): APIPromise<Integration>;
23
- /**
24
- * Get integration details
25
- *
26
- * @example
27
- * ```ts
28
- * const integration = await client.integrations.retrieve(
29
- * 'id',
30
- * );
31
- * ```
32
- */
33
- retrieve(id: string, options?: RequestOptions): APIPromise<Integration>;
34
- /**
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
- * ```
44
- */
45
- update(id: string, body: IntegrationUpdateParams, options?: RequestOptions): APIPromise<Integration>;
46
- /**
47
- * List integrations
48
- *
49
- * @example
50
- * ```ts
51
- * const integrations = await client.integrations.list();
52
- * ```
53
- */
54
- list(options?: RequestOptions): APIPromise<IntegrationListResponse>;
55
- /**
56
- * Delete integration
57
- *
58
- * @example
59
- * ```ts
60
- * const integration = await client.integrations.delete('id');
61
- * ```
62
- */
63
- delete(id: string, options?: RequestOptions): APIPromise<IntegrationDeleteResponse>;
64
- /**
65
- * List integration delivery history
66
- *
67
- * @example
68
- * ```ts
69
- * const response = await client.integrations.listDeliveries(
70
- * 'id',
71
- * );
72
- * ```
73
- */
74
- listDeliveries(id: string, query?: IntegrationListDeliveriesParams | null | undefined, options?: RequestOptions): APIPromise<IntegrationListDeliveriesResponse>;
75
- /**
76
- * Send test delivery
77
- *
78
- * @example
79
- * ```ts
80
- * const response = await client.integrations.sendTest('id');
81
- * ```
82
- */
83
- sendTest(id: string, options?: RequestOptions): APIPromise<IntegrationSendTestResponse>;
84
- }
85
- /**
86
- * Third-party integration (e.g. Telegram) subscribed to monitor events.
87
- */
88
- export interface Integration {
89
- id: string;
90
- /**
91
- * Integration config — shape varies by type (JSON)
92
- */
93
- config: {
94
- [key: string]: unknown;
95
- };
96
- createdAt: string;
97
- /**
98
- * Array of event types to subscribe to.
99
- */
100
- eventTypes: Array<Shared.EventType>;
101
- isActive: boolean;
102
- name: string;
103
- type: 'telegram';
104
- /**
105
- * Event filter rules (JSON)
106
- */
107
- filters?: {
108
- [key: string]: unknown;
109
- };
110
- messageTemplate?: string;
111
- scopeAllMonitors?: boolean;
112
- silentPush?: boolean;
113
- }
114
- /**
115
- * Integration delivery attempt record with status and retry count.
116
- */
117
- export interface IntegrationDelivery {
118
- id: string;
119
- attempts: number;
120
- createdAt: string;
121
- eventType: string;
122
- status: string;
123
- deliveredAt?: string;
124
- lastError?: string;
125
- lastStatusCode?: number;
126
- sourceId?: string;
127
- sourceType?: string;
128
- }
129
- export interface IntegrationListResponse {
130
- integrations: Array<Integration>;
131
- }
132
- export interface IntegrationDeleteResponse {
133
- success: true;
134
- }
135
- export interface IntegrationListDeliveriesResponse {
136
- deliveries: Array<IntegrationDelivery>;
137
- }
138
- export interface IntegrationSendTestResponse {
139
- success: true;
140
- }
141
- export interface IntegrationCreateParams {
142
- /**
143
- * Integration config (e.g. Telegram chatId)
144
- */
145
- config: IntegrationCreateParams.Config;
146
- /**
147
- * Array of event types to subscribe to.
148
- */
149
- eventTypes: Array<Shared.EventType>;
150
- name: string;
151
- type: 'telegram';
152
- }
153
- export declare namespace IntegrationCreateParams {
154
- /**
155
- * Integration config (e.g. Telegram chatId)
156
- */
157
- interface Config {
158
- chatId: string;
159
- }
160
- }
161
- export interface IntegrationUpdateParams {
162
- /**
163
- * Array of event types to subscribe to.
164
- */
165
- eventTypes?: Array<Shared.EventType>;
166
- /**
167
- * Event filter rules (JSON)
168
- */
169
- filters?: {
170
- [key: string]: unknown;
171
- };
172
- isActive?: boolean;
173
- /**
174
- * Custom message template (JSON)
175
- */
176
- messageTemplate?: {
177
- [key: string]: unknown;
178
- };
179
- name?: string;
180
- scopeAllMonitors?: boolean;
181
- silentPush?: boolean;
182
- }
183
- export interface IntegrationListDeliveriesParams {
184
- /**
185
- * Maximum number of items to return (1-100, default 50)
186
- */
187
- limit?: number;
188
- }
189
- export declare namespace Integrations {
190
- export { type Integration as Integration, type IntegrationDelivery as IntegrationDelivery, type IntegrationListResponse as IntegrationListResponse, type IntegrationDeleteResponse as IntegrationDeleteResponse, type IntegrationListDeliveriesResponse as IntegrationListDeliveriesResponse, type IntegrationSendTestResponse as IntegrationSendTestResponse, type IntegrationCreateParams as IntegrationCreateParams, type IntegrationUpdateParams as IntegrationUpdateParams, type IntegrationListDeliveriesParams as IntegrationListDeliveriesParams, };
191
- }
192
- //# sourceMappingURL=integrations.d.ts.map
@@ -1 +0,0 @@
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;IAIvE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAIpG;;;;;;;OAOG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAInE;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAInF;;;;;;;;;OASG;IACH,cAAc,CACZ,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,+BAA+B,GAAG,IAAI,GAAG,SAAc,EAC9D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAIhD;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAGxF;AAED;;GAEG;AACH,MA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+0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Integrations = void 0;
5
- const resource_1 = require("../core/resource.js");
6
- const path_1 = require("../internal/utils/path.js");
7
- /**
8
- * Push notification integrations (Telegram)
9
- */
10
- class Integrations extends resource_1.APIResource {
11
- /**
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
- * ```
23
- */
24
- create(body, options) {
25
- return this._client.post('/integrations', { body, ...options });
26
- }
27
- /**
28
- * Get integration details
29
- *
30
- * @example
31
- * ```ts
32
- * const integration = await client.integrations.retrieve(
33
- * 'id',
34
- * );
35
- * ```
36
- */
37
- retrieve(id, options) {
38
- return this._client.get((0, path_1.path) `/integrations/${id}`, options);
39
- }
40
- /**
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
- * ```
50
- */
51
- update(id, body, options) {
52
- return this._client.patch((0, path_1.path) `/integrations/${id}`, { body, ...options });
53
- }
54
- /**
55
- * List integrations
56
- *
57
- * @example
58
- * ```ts
59
- * const integrations = await client.integrations.list();
60
- * ```
61
- */
62
- list(options) {
63
- return this._client.get('/integrations', options);
64
- }
65
- /**
66
- * Delete integration
67
- *
68
- * @example
69
- * ```ts
70
- * const integration = await client.integrations.delete('id');
71
- * ```
72
- */
73
- delete(id, options) {
74
- return this._client.delete((0, path_1.path) `/integrations/${id}`, options);
75
- }
76
- /**
77
- * List integration delivery history
78
- *
79
- * @example
80
- * ```ts
81
- * const response = await client.integrations.listDeliveries(
82
- * 'id',
83
- * );
84
- * ```
85
- */
86
- listDeliveries(id, query = {}, options) {
87
- return this._client.get((0, path_1.path) `/integrations/${id}/deliveries`, { query, ...options });
88
- }
89
- /**
90
- * Send test delivery
91
- *
92
- * @example
93
- * ```ts
94
- * const response = await client.integrations.sendTest('id');
95
- * ```
96
- */
97
- sendTest(id, options) {
98
- return this._client.post((0, path_1.path) `/integrations/${id}/test`, options);
99
- }
100
- }
101
- exports.Integrations = Integrations;
102
- //# sourceMappingURL=integrations.js.map
@@ -1 +0,0 @@
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"}
@@ -1,98 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../core/resource.mjs";
3
- import { path } from "../internal/utils/path.mjs";
4
- /**
5
- * Push notification integrations (Telegram)
6
- */
7
- export class Integrations extends APIResource {
8
- /**
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
- * ```
20
- */
21
- create(body, options) {
22
- return this._client.post('/integrations', { body, ...options });
23
- }
24
- /**
25
- * Get integration details
26
- *
27
- * @example
28
- * ```ts
29
- * const integration = await client.integrations.retrieve(
30
- * 'id',
31
- * );
32
- * ```
33
- */
34
- retrieve(id, options) {
35
- return this._client.get(path `/integrations/${id}`, options);
36
- }
37
- /**
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
- * ```
47
- */
48
- update(id, body, options) {
49
- return this._client.patch(path `/integrations/${id}`, { body, ...options });
50
- }
51
- /**
52
- * List integrations
53
- *
54
- * @example
55
- * ```ts
56
- * const integrations = await client.integrations.list();
57
- * ```
58
- */
59
- list(options) {
60
- return this._client.get('/integrations', options);
61
- }
62
- /**
63
- * Delete integration
64
- *
65
- * @example
66
- * ```ts
67
- * const integration = await client.integrations.delete('id');
68
- * ```
69
- */
70
- delete(id, options) {
71
- return this._client.delete(path `/integrations/${id}`, options);
72
- }
73
- /**
74
- * List integration delivery history
75
- *
76
- * @example
77
- * ```ts
78
- * const response = await client.integrations.listDeliveries(
79
- * 'id',
80
- * );
81
- * ```
82
- */
83
- listDeliveries(id, query = {}, options) {
84
- return this._client.get(path `/integrations/${id}/deliveries`, { query, ...options });
85
- }
86
- /**
87
- * Send test delivery
88
- *
89
- * @example
90
- * ```ts
91
- * const response = await client.integrations.sendTest('id');
92
- * ```
93
- */
94
- sendTest(id, options) {
95
- return this._client.post(path `/integrations/${id}/test`, options);
96
- }
97
- }
98
- //# sourceMappingURL=integrations.mjs.map
@@ -1 +0,0 @@
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"}
@@ -1,260 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import * as Shared from './shared';
5
- import { APIPromise } from '../core/api-promise';
6
- import { RequestOptions } from '../internal/request-options';
7
- import { path } from '../internal/utils/path';
8
-
9
- /**
10
- * Push notification integrations (Telegram)
11
- */
12
- export class Integrations extends APIResource {
13
- /**
14
- * Create integration
15
- *
16
- * @example
17
- * ```ts
18
- * const integration = await client.integrations.create({
19
- * config: { chatId: '-1001234567890' },
20
- * eventTypes: ['tweet.new', 'follower.gained'],
21
- * name: 'My Telegram Bot',
22
- * type: 'telegram',
23
- * });
24
- * ```
25
- */
26
- create(body: IntegrationCreateParams, options?: RequestOptions): APIPromise<Integration> {
27
- return this._client.post('/integrations', { body, ...options });
28
- }
29
-
30
- /**
31
- * Get integration details
32
- *
33
- * @example
34
- * ```ts
35
- * const integration = await client.integrations.retrieve(
36
- * 'id',
37
- * );
38
- * ```
39
- */
40
- retrieve(id: string, options?: RequestOptions): APIPromise<Integration> {
41
- return this._client.get(path`/integrations/${id}`, options);
42
- }
43
-
44
- /**
45
- * Update integration
46
- *
47
- * @example
48
- * ```ts
49
- * const integration = await client.integrations.update('id', {
50
- * isActive: true,
51
- * name: 'My Telegram Bot',
52
- * });
53
- * ```
54
- */
55
- update(id: string, body: IntegrationUpdateParams, options?: RequestOptions): APIPromise<Integration> {
56
- return this._client.patch(path`/integrations/${id}`, { body, ...options });
57
- }
58
-
59
- /**
60
- * List integrations
61
- *
62
- * @example
63
- * ```ts
64
- * const integrations = await client.integrations.list();
65
- * ```
66
- */
67
- list(options?: RequestOptions): APIPromise<IntegrationListResponse> {
68
- return this._client.get('/integrations', options);
69
- }
70
-
71
- /**
72
- * Delete integration
73
- *
74
- * @example
75
- * ```ts
76
- * const integration = await client.integrations.delete('id');
77
- * ```
78
- */
79
- delete(id: string, options?: RequestOptions): APIPromise<IntegrationDeleteResponse> {
80
- return this._client.delete(path`/integrations/${id}`, options);
81
- }
82
-
83
- /**
84
- * List integration delivery history
85
- *
86
- * @example
87
- * ```ts
88
- * const response = await client.integrations.listDeliveries(
89
- * 'id',
90
- * );
91
- * ```
92
- */
93
- listDeliveries(
94
- id: string,
95
- query: IntegrationListDeliveriesParams | null | undefined = {},
96
- options?: RequestOptions,
97
- ): APIPromise<IntegrationListDeliveriesResponse> {
98
- return this._client.get(path`/integrations/${id}/deliveries`, { query, ...options });
99
- }
100
-
101
- /**
102
- * Send test delivery
103
- *
104
- * @example
105
- * ```ts
106
- * const response = await client.integrations.sendTest('id');
107
- * ```
108
- */
109
- sendTest(id: string, options?: RequestOptions): APIPromise<IntegrationSendTestResponse> {
110
- return this._client.post(path`/integrations/${id}/test`, options);
111
- }
112
- }
113
-
114
- /**
115
- * Third-party integration (e.g. Telegram) subscribed to monitor events.
116
- */
117
- export interface Integration {
118
- id: string;
119
-
120
- /**
121
- * Integration config — shape varies by type (JSON)
122
- */
123
- config: { [key: string]: unknown };
124
-
125
- createdAt: string;
126
-
127
- /**
128
- * Array of event types to subscribe to.
129
- */
130
- eventTypes: Array<Shared.EventType>;
131
-
132
- isActive: boolean;
133
-
134
- name: string;
135
-
136
- type: 'telegram';
137
-
138
- /**
139
- * Event filter rules (JSON)
140
- */
141
- filters?: { [key: string]: unknown };
142
-
143
- messageTemplate?: string;
144
-
145
- scopeAllMonitors?: boolean;
146
-
147
- silentPush?: boolean;
148
- }
149
-
150
- /**
151
- * Integration delivery attempt record with status and retry count.
152
- */
153
- export interface IntegrationDelivery {
154
- id: string;
155
-
156
- attempts: number;
157
-
158
- createdAt: string;
159
-
160
- eventType: string;
161
-
162
- status: string;
163
-
164
- deliveredAt?: string;
165
-
166
- lastError?: string;
167
-
168
- lastStatusCode?: number;
169
-
170
- sourceId?: string;
171
-
172
- sourceType?: string;
173
- }
174
-
175
- export interface IntegrationListResponse {
176
- integrations: Array<Integration>;
177
- }
178
-
179
- export interface IntegrationDeleteResponse {
180
- success: true;
181
- }
182
-
183
- export interface IntegrationListDeliveriesResponse {
184
- deliveries: Array<IntegrationDelivery>;
185
- }
186
-
187
- export interface IntegrationSendTestResponse {
188
- success: true;
189
- }
190
-
191
- export interface IntegrationCreateParams {
192
- /**
193
- * Integration config (e.g. Telegram chatId)
194
- */
195
- config: IntegrationCreateParams.Config;
196
-
197
- /**
198
- * Array of event types to subscribe to.
199
- */
200
- eventTypes: Array<Shared.EventType>;
201
-
202
- name: string;
203
-
204
- type: 'telegram';
205
- }
206
-
207
- export namespace IntegrationCreateParams {
208
- /**
209
- * Integration config (e.g. Telegram chatId)
210
- */
211
- export interface Config {
212
- chatId: string;
213
- }
214
- }
215
-
216
- export interface IntegrationUpdateParams {
217
- /**
218
- * Array of event types to subscribe to.
219
- */
220
- eventTypes?: Array<Shared.EventType>;
221
-
222
- /**
223
- * Event filter rules (JSON)
224
- */
225
- filters?: { [key: string]: unknown };
226
-
227
- isActive?: boolean;
228
-
229
- /**
230
- * Custom message template (JSON)
231
- */
232
- messageTemplate?: { [key: string]: unknown };
233
-
234
- name?: string;
235
-
236
- scopeAllMonitors?: boolean;
237
-
238
- silentPush?: boolean;
239
- }
240
-
241
- export interface IntegrationListDeliveriesParams {
242
- /**
243
- * Maximum number of items to return (1-100, default 50)
244
- */
245
- limit?: number;
246
- }
247
-
248
- export declare namespace Integrations {
249
- export {
250
- type Integration as Integration,
251
- type IntegrationDelivery as IntegrationDelivery,
252
- type IntegrationListResponse as IntegrationListResponse,
253
- type IntegrationDeleteResponse as IntegrationDeleteResponse,
254
- type IntegrationListDeliveriesResponse as IntegrationListDeliveriesResponse,
255
- type IntegrationSendTestResponse as IntegrationSendTestResponse,
256
- type IntegrationCreateParams as IntegrationCreateParams,
257
- type IntegrationUpdateParams as IntegrationUpdateParams,
258
- type IntegrationListDeliveriesParams as IntegrationListDeliveriesParams,
259
- };
260
- }