x-twitter-scraper 0.5.0 → 0.5.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 +9 -0
- package/client.d.mts +1 -1
- package/client.d.ts +1 -1
- package/client.js +1 -1
- package/client.mjs +1 -1
- package/package.json +1 -1
- package/resources/account.d.mts +2 -2
- package/resources/account.d.ts +2 -2
- package/resources/compose.d.mts +186 -65
- package/resources/compose.d.mts.map +1 -1
- package/resources/compose.d.ts +186 -65
- package/resources/compose.d.ts.map +1 -1
- package/resources/compose.js +5 -2
- package/resources/compose.js.map +1 -1
- package/resources/compose.mjs +5 -2
- package/resources/compose.mjs.map +1 -1
- package/resources/monitors/keywords.d.mts +4 -4
- package/resources/monitors/keywords.d.ts +4 -4
- package/resources/monitors/keywords.js +4 -4
- package/resources/monitors/keywords.mjs +4 -4
- package/resources/monitors/monitors.d.mts +5 -4
- package/resources/monitors/monitors.d.mts.map +1 -1
- package/resources/monitors/monitors.d.ts +5 -4
- package/resources/monitors/monitors.d.ts.map +1 -1
- package/resources/monitors/monitors.js +5 -4
- package/resources/monitors/monitors.js.map +1 -1
- package/resources/monitors/monitors.mjs +5 -4
- package/resources/monitors/monitors.mjs.map +1 -1
- package/src/client.ts +1 -1
- package/src/resources/account.ts +2 -2
- package/src/resources/compose.ts +232 -65
- package/src/resources/monitors/keywords.ts +4 -4
- package/src/resources/monitors/monitors.ts +5 -4
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.1 (2026-07-22)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.5.0...v0.5.1](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.5.0...v0.5.1)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* sync generated SDK contracts ([ff8612e](https://github.com/Xquik-dev/x-twitter-scraper-typescript/commit/ff8612e3b474a71aabae2f709ae93a487d5ad69d))
|
|
10
|
+
* verify final public contract ([bcd7c6a](https://github.com/Xquik-dev/x-twitter-scraper-typescript/commit/bcd7c6adecf0e4f1dd42025a3c9615c3abcd4223))
|
|
11
|
+
|
|
3
12
|
## 0.5.0 (2026-07-22)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.4.1...v0.5.0](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.4.1...v0.5.0)
|
package/client.d.mts
CHANGED
package/client.d.ts
CHANGED
package/client.js
CHANGED
package/client.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-twitter-scraper",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "TypeScript SDK for Xquik API workflows. Xquik is an independent third-party service. Not affiliated with X Corp. \"Twitter\" and \"X\" are trademarks of X Corp.",
|
|
5
5
|
"author": "Xquik <support@xquik.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
package/resources/account.d.mts
CHANGED
|
@@ -63,11 +63,11 @@ export declare namespace AccountRetrieveResponse {
|
|
|
63
63
|
*/
|
|
64
64
|
activeHourlyBurn: string;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Rounded daily estimate for 1 active monitor.
|
|
67
67
|
*/
|
|
68
68
|
creditsPerActiveMonitorDay: string;
|
|
69
69
|
/**
|
|
70
|
-
* Hourly
|
|
70
|
+
* Hourly credits charged for 1 active monitor.
|
|
71
71
|
*/
|
|
72
72
|
creditsPerActiveMonitorHour: string;
|
|
73
73
|
/**
|
package/resources/account.d.ts
CHANGED
|
@@ -63,11 +63,11 @@ export declare namespace AccountRetrieveResponse {
|
|
|
63
63
|
*/
|
|
64
64
|
activeHourlyBurn: string;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Rounded daily estimate for 1 active monitor.
|
|
67
67
|
*/
|
|
68
68
|
creditsPerActiveMonitorDay: string;
|
|
69
69
|
/**
|
|
70
|
-
* Hourly
|
|
70
|
+
* Hourly credits charged for 1 active monitor.
|
|
71
71
|
*/
|
|
72
72
|
creditsPerActiveMonitorHour: string;
|
|
73
73
|
/**
|
package/resources/compose.d.mts
CHANGED
|
@@ -6,83 +6,204 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Compose extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Run one step of Xquik's three-step writing workflow. Compose returns questions
|
|
10
|
+
* and editorial rules. Refine returns goal-specific guidance. Score applies
|
|
11
|
+
* deterministic text checks. It does not predict reach or expose X ranking
|
|
12
|
+
* weights.
|
|
10
13
|
*
|
|
11
14
|
* @example
|
|
12
15
|
* ```ts
|
|
13
16
|
* const compose = await client.compose.create({
|
|
14
17
|
* step: 'compose',
|
|
18
|
+
* topic: 'PostgreSQL query planning',
|
|
15
19
|
* goal: 'engagement',
|
|
16
|
-
* topic: 'AI trends in 2025',
|
|
17
20
|
* });
|
|
18
21
|
* ```
|
|
19
22
|
*/
|
|
20
23
|
create(body: ComposeCreateParams, options?: RequestOptions): APIPromise<ComposeCreateResponse>;
|
|
21
24
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
export type ComposeCreateResponse = ComposeCreateResponse.ComposePrepareResult | ComposeCreateResponse.ComposeRefineResult | ComposeCreateResponse.ComposeScoreResult;
|
|
26
|
+
export declare namespace ComposeCreateResponse {
|
|
27
|
+
interface ComposePrepareResult {
|
|
28
|
+
/**
|
|
29
|
+
* Xquik editorial heuristics, ordered for the goal.
|
|
30
|
+
*/
|
|
31
|
+
contentRules: Array<ComposePrepareResult.ContentRule>;
|
|
32
|
+
/**
|
|
33
|
+
* Published engagement signal names. Production multipliers are not published.
|
|
34
|
+
*/
|
|
35
|
+
engagementMultipliers: Array<ComposePrepareResult.EngagementMultiplier>;
|
|
36
|
+
/**
|
|
37
|
+
* Publication limit for timing and decay claims.
|
|
38
|
+
*/
|
|
39
|
+
engagementVelocity: string;
|
|
40
|
+
followUpQuestions: Array<string>;
|
|
41
|
+
/**
|
|
42
|
+
* X post intent seeded with the topic.
|
|
43
|
+
*/
|
|
44
|
+
intentUrl: string;
|
|
45
|
+
nextStep: string;
|
|
46
|
+
/**
|
|
47
|
+
* Published signal names with unpublished weights as null.
|
|
48
|
+
*/
|
|
49
|
+
scorerWeights: Array<ComposePrepareResult.ScorerWeight>;
|
|
50
|
+
/**
|
|
51
|
+
* Signal source and evidence limits.
|
|
52
|
+
*/
|
|
53
|
+
source: string;
|
|
54
|
+
/**
|
|
55
|
+
* Negative engagement predictions in the public model.
|
|
56
|
+
*/
|
|
57
|
+
topPenalties: Array<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Style analyses saved to the account.
|
|
60
|
+
*/
|
|
61
|
+
savedStyles?: Array<ComposePrepareResult.SavedStyle>;
|
|
62
|
+
/**
|
|
63
|
+
* Next action when no cached style is available.
|
|
64
|
+
*/
|
|
65
|
+
styleNote?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Cached examples for the requested style username.
|
|
68
|
+
*/
|
|
69
|
+
styleTweets?: Array<string>;
|
|
70
|
+
}
|
|
71
|
+
namespace ComposePrepareResult {
|
|
72
|
+
interface ContentRule {
|
|
73
|
+
rule: string;
|
|
74
|
+
}
|
|
75
|
+
interface EngagementMultiplier {
|
|
76
|
+
/**
|
|
77
|
+
* Human-readable published signal name.
|
|
78
|
+
*/
|
|
79
|
+
action: string;
|
|
80
|
+
multiplier: 'Production weight not published by X';
|
|
81
|
+
}
|
|
82
|
+
interface ScorerWeight {
|
|
83
|
+
/**
|
|
84
|
+
* Signal direction and publication limit.
|
|
85
|
+
*/
|
|
86
|
+
context: string;
|
|
87
|
+
/**
|
|
88
|
+
* Signal name from X's public ranking repository.
|
|
89
|
+
*/
|
|
90
|
+
signal: string;
|
|
91
|
+
/**
|
|
92
|
+
* X does not publish the production weight.
|
|
93
|
+
*/
|
|
94
|
+
weight: null;
|
|
95
|
+
}
|
|
96
|
+
interface SavedStyle {
|
|
97
|
+
tweetCount: number;
|
|
98
|
+
username: string;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
interface ComposeRefineResult {
|
|
102
|
+
/**
|
|
103
|
+
* Goal, tone, media, and editorial guidance.
|
|
104
|
+
*/
|
|
105
|
+
compositionGuidance: Array<string>;
|
|
106
|
+
examplePatterns: Array<ComposeRefineResult.ExamplePattern>;
|
|
107
|
+
/**
|
|
108
|
+
* X post intent seeded with the topic.
|
|
109
|
+
*/
|
|
110
|
+
intentUrl: string;
|
|
111
|
+
nextStep: string;
|
|
112
|
+
}
|
|
113
|
+
namespace ComposeRefineResult {
|
|
114
|
+
interface ExamplePattern {
|
|
115
|
+
description: string;
|
|
116
|
+
pattern: string;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
interface ComposeScoreResult {
|
|
120
|
+
/**
|
|
121
|
+
* Deterministic editorial checks. Not a reach prediction.
|
|
122
|
+
*/
|
|
123
|
+
checklist: Array<ComposeScoreResult.Checklist>;
|
|
124
|
+
nextStep: string;
|
|
125
|
+
passed: boolean;
|
|
126
|
+
passedCount: number;
|
|
127
|
+
topSuggestion: string;
|
|
128
|
+
totalChecks: 9;
|
|
129
|
+
/**
|
|
130
|
+
* Present only when every check passes.
|
|
131
|
+
*/
|
|
132
|
+
intentUrl?: string;
|
|
133
|
+
}
|
|
134
|
+
namespace ComposeScoreResult {
|
|
135
|
+
interface Checklist {
|
|
136
|
+
factor: string;
|
|
137
|
+
passed: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Present only when the check fails.
|
|
140
|
+
*/
|
|
141
|
+
suggestion?: string;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
40
144
|
}
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
145
|
+
export type ComposeCreateParams = ComposeCreateParams.ComposePrepareRequest | ComposeCreateParams.ComposeRefineRequest | ComposeCreateParams.ComposeScoreRequest;
|
|
146
|
+
export declare namespace ComposeCreateParams {
|
|
147
|
+
interface ComposePrepareRequest {
|
|
148
|
+
step: 'compose';
|
|
149
|
+
/**
|
|
150
|
+
* Subject for the post.
|
|
151
|
+
*/
|
|
152
|
+
topic: string;
|
|
153
|
+
/**
|
|
154
|
+
* Editorial goal used to order the rules and questions.
|
|
155
|
+
*/
|
|
156
|
+
goal?: 'engagement' | 'followers' | 'authority' | 'conversation';
|
|
157
|
+
/**
|
|
158
|
+
* Username from a style analysis saved to this account.
|
|
159
|
+
*/
|
|
160
|
+
styleUsername?: string;
|
|
161
|
+
[k: string]: unknown;
|
|
162
|
+
}
|
|
163
|
+
interface ComposeRefineRequest {
|
|
164
|
+
/**
|
|
165
|
+
* Editorial goal for the guidance.
|
|
166
|
+
*/
|
|
167
|
+
goal: 'engagement' | 'followers' | 'authority' | 'conversation';
|
|
168
|
+
step: 'refine';
|
|
169
|
+
/**
|
|
170
|
+
* Requested writing tone.
|
|
171
|
+
*/
|
|
172
|
+
tone: string;
|
|
173
|
+
/**
|
|
174
|
+
* Subject for the post.
|
|
175
|
+
*/
|
|
176
|
+
topic: string;
|
|
177
|
+
/**
|
|
178
|
+
* Audience, constraints, sources, or other writing context.
|
|
179
|
+
*/
|
|
180
|
+
additionalContext?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Specific action the draft should request.
|
|
183
|
+
*/
|
|
184
|
+
callToAction?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Planned media type.
|
|
187
|
+
*/
|
|
188
|
+
mediaType?: 'photo' | 'video' | 'none';
|
|
189
|
+
[k: string]: unknown;
|
|
190
|
+
}
|
|
191
|
+
interface ComposeScoreRequest {
|
|
192
|
+
/**
|
|
193
|
+
* Full post text for deterministic editorial checks.
|
|
194
|
+
*/
|
|
195
|
+
draft: string;
|
|
196
|
+
step: 'score';
|
|
197
|
+
/**
|
|
198
|
+
* True when a separate link card is attached.
|
|
199
|
+
*/
|
|
200
|
+
hasLink?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* @deprecated Ignored. Remove this field. Use hasLink for a separate link card.
|
|
203
|
+
*/
|
|
204
|
+
hasMedia?: boolean;
|
|
205
|
+
[k: string]: unknown;
|
|
206
|
+
}
|
|
86
207
|
}
|
|
87
208
|
export declare namespace Compose {
|
|
88
209
|
export { type ComposeCreateResponse as ComposeCreateResponse, type ComposeCreateParams as ComposeCreateParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.mts","sourceRoot":"","sources":["../src/resources/compose.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACj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C,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/compose.d.ts
CHANGED
|
@@ -6,83 +6,204 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Compose extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Run one step of Xquik's three-step writing workflow. Compose returns questions
|
|
10
|
+
* and editorial rules. Refine returns goal-specific guidance. Score applies
|
|
11
|
+
* deterministic text checks. It does not predict reach or expose X ranking
|
|
12
|
+
* weights.
|
|
10
13
|
*
|
|
11
14
|
* @example
|
|
12
15
|
* ```ts
|
|
13
16
|
* const compose = await client.compose.create({
|
|
14
17
|
* step: 'compose',
|
|
18
|
+
* topic: 'PostgreSQL query planning',
|
|
15
19
|
* goal: 'engagement',
|
|
16
|
-
* topic: 'AI trends in 2025',
|
|
17
20
|
* });
|
|
18
21
|
* ```
|
|
19
22
|
*/
|
|
20
23
|
create(body: ComposeCreateParams, options?: RequestOptions): APIPromise<ComposeCreateResponse>;
|
|
21
24
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
export type ComposeCreateResponse = ComposeCreateResponse.ComposePrepareResult | ComposeCreateResponse.ComposeRefineResult | ComposeCreateResponse.ComposeScoreResult;
|
|
26
|
+
export declare namespace ComposeCreateResponse {
|
|
27
|
+
interface ComposePrepareResult {
|
|
28
|
+
/**
|
|
29
|
+
* Xquik editorial heuristics, ordered for the goal.
|
|
30
|
+
*/
|
|
31
|
+
contentRules: Array<ComposePrepareResult.ContentRule>;
|
|
32
|
+
/**
|
|
33
|
+
* Published engagement signal names. Production multipliers are not published.
|
|
34
|
+
*/
|
|
35
|
+
engagementMultipliers: Array<ComposePrepareResult.EngagementMultiplier>;
|
|
36
|
+
/**
|
|
37
|
+
* Publication limit for timing and decay claims.
|
|
38
|
+
*/
|
|
39
|
+
engagementVelocity: string;
|
|
40
|
+
followUpQuestions: Array<string>;
|
|
41
|
+
/**
|
|
42
|
+
* X post intent seeded with the topic.
|
|
43
|
+
*/
|
|
44
|
+
intentUrl: string;
|
|
45
|
+
nextStep: string;
|
|
46
|
+
/**
|
|
47
|
+
* Published signal names with unpublished weights as null.
|
|
48
|
+
*/
|
|
49
|
+
scorerWeights: Array<ComposePrepareResult.ScorerWeight>;
|
|
50
|
+
/**
|
|
51
|
+
* Signal source and evidence limits.
|
|
52
|
+
*/
|
|
53
|
+
source: string;
|
|
54
|
+
/**
|
|
55
|
+
* Negative engagement predictions in the public model.
|
|
56
|
+
*/
|
|
57
|
+
topPenalties: Array<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Style analyses saved to the account.
|
|
60
|
+
*/
|
|
61
|
+
savedStyles?: Array<ComposePrepareResult.SavedStyle>;
|
|
62
|
+
/**
|
|
63
|
+
* Next action when no cached style is available.
|
|
64
|
+
*/
|
|
65
|
+
styleNote?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Cached examples for the requested style username.
|
|
68
|
+
*/
|
|
69
|
+
styleTweets?: Array<string>;
|
|
70
|
+
}
|
|
71
|
+
namespace ComposePrepareResult {
|
|
72
|
+
interface ContentRule {
|
|
73
|
+
rule: string;
|
|
74
|
+
}
|
|
75
|
+
interface EngagementMultiplier {
|
|
76
|
+
/**
|
|
77
|
+
* Human-readable published signal name.
|
|
78
|
+
*/
|
|
79
|
+
action: string;
|
|
80
|
+
multiplier: 'Production weight not published by X';
|
|
81
|
+
}
|
|
82
|
+
interface ScorerWeight {
|
|
83
|
+
/**
|
|
84
|
+
* Signal direction and publication limit.
|
|
85
|
+
*/
|
|
86
|
+
context: string;
|
|
87
|
+
/**
|
|
88
|
+
* Signal name from X's public ranking repository.
|
|
89
|
+
*/
|
|
90
|
+
signal: string;
|
|
91
|
+
/**
|
|
92
|
+
* X does not publish the production weight.
|
|
93
|
+
*/
|
|
94
|
+
weight: null;
|
|
95
|
+
}
|
|
96
|
+
interface SavedStyle {
|
|
97
|
+
tweetCount: number;
|
|
98
|
+
username: string;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
interface ComposeRefineResult {
|
|
102
|
+
/**
|
|
103
|
+
* Goal, tone, media, and editorial guidance.
|
|
104
|
+
*/
|
|
105
|
+
compositionGuidance: Array<string>;
|
|
106
|
+
examplePatterns: Array<ComposeRefineResult.ExamplePattern>;
|
|
107
|
+
/**
|
|
108
|
+
* X post intent seeded with the topic.
|
|
109
|
+
*/
|
|
110
|
+
intentUrl: string;
|
|
111
|
+
nextStep: string;
|
|
112
|
+
}
|
|
113
|
+
namespace ComposeRefineResult {
|
|
114
|
+
interface ExamplePattern {
|
|
115
|
+
description: string;
|
|
116
|
+
pattern: string;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
interface ComposeScoreResult {
|
|
120
|
+
/**
|
|
121
|
+
* Deterministic editorial checks. Not a reach prediction.
|
|
122
|
+
*/
|
|
123
|
+
checklist: Array<ComposeScoreResult.Checklist>;
|
|
124
|
+
nextStep: string;
|
|
125
|
+
passed: boolean;
|
|
126
|
+
passedCount: number;
|
|
127
|
+
topSuggestion: string;
|
|
128
|
+
totalChecks: 9;
|
|
129
|
+
/**
|
|
130
|
+
* Present only when every check passes.
|
|
131
|
+
*/
|
|
132
|
+
intentUrl?: string;
|
|
133
|
+
}
|
|
134
|
+
namespace ComposeScoreResult {
|
|
135
|
+
interface Checklist {
|
|
136
|
+
factor: string;
|
|
137
|
+
passed: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Present only when the check fails.
|
|
140
|
+
*/
|
|
141
|
+
suggestion?: string;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
40
144
|
}
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
145
|
+
export type ComposeCreateParams = ComposeCreateParams.ComposePrepareRequest | ComposeCreateParams.ComposeRefineRequest | ComposeCreateParams.ComposeScoreRequest;
|
|
146
|
+
export declare namespace ComposeCreateParams {
|
|
147
|
+
interface ComposePrepareRequest {
|
|
148
|
+
step: 'compose';
|
|
149
|
+
/**
|
|
150
|
+
* Subject for the post.
|
|
151
|
+
*/
|
|
152
|
+
topic: string;
|
|
153
|
+
/**
|
|
154
|
+
* Editorial goal used to order the rules and questions.
|
|
155
|
+
*/
|
|
156
|
+
goal?: 'engagement' | 'followers' | 'authority' | 'conversation';
|
|
157
|
+
/**
|
|
158
|
+
* Username from a style analysis saved to this account.
|
|
159
|
+
*/
|
|
160
|
+
styleUsername?: string;
|
|
161
|
+
[k: string]: unknown;
|
|
162
|
+
}
|
|
163
|
+
interface ComposeRefineRequest {
|
|
164
|
+
/**
|
|
165
|
+
* Editorial goal for the guidance.
|
|
166
|
+
*/
|
|
167
|
+
goal: 'engagement' | 'followers' | 'authority' | 'conversation';
|
|
168
|
+
step: 'refine';
|
|
169
|
+
/**
|
|
170
|
+
* Requested writing tone.
|
|
171
|
+
*/
|
|
172
|
+
tone: string;
|
|
173
|
+
/**
|
|
174
|
+
* Subject for the post.
|
|
175
|
+
*/
|
|
176
|
+
topic: string;
|
|
177
|
+
/**
|
|
178
|
+
* Audience, constraints, sources, or other writing context.
|
|
179
|
+
*/
|
|
180
|
+
additionalContext?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Specific action the draft should request.
|
|
183
|
+
*/
|
|
184
|
+
callToAction?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Planned media type.
|
|
187
|
+
*/
|
|
188
|
+
mediaType?: 'photo' | 'video' | 'none';
|
|
189
|
+
[k: string]: unknown;
|
|
190
|
+
}
|
|
191
|
+
interface ComposeScoreRequest {
|
|
192
|
+
/**
|
|
193
|
+
* Full post text for deterministic editorial checks.
|
|
194
|
+
*/
|
|
195
|
+
draft: string;
|
|
196
|
+
step: 'score';
|
|
197
|
+
/**
|
|
198
|
+
* True when a separate link card is attached.
|
|
199
|
+
*/
|
|
200
|
+
hasLink?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* @deprecated Ignored. Remove this field. Use hasLink for a separate link card.
|
|
203
|
+
*/
|
|
204
|
+
hasMedia?: boolean;
|
|
205
|
+
[k: string]: unknown;
|
|
206
|
+
}
|
|
86
207
|
}
|
|
87
208
|
export declare namespace Compose {
|
|
88
209
|
export { type ComposeCreateResponse as ComposeCreateResponse, type ComposeCreateParams as ComposeCreateParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/resources/compose.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;GAEG;AACH,qBAA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