@chirpie/sdk 1.0.12 → 1.0.14
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/dist/index.d.mts +60 -3
- package/dist/index.d.ts +60 -3
- package/dist/index.js +27 -0
- package/dist/index.mjs +27 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -31,9 +31,42 @@ interface ApiAccount {
|
|
|
31
31
|
display_name: string | null;
|
|
32
32
|
avatar_url: string | null;
|
|
33
33
|
max_post_length: number;
|
|
34
|
+
/**
|
|
35
|
+
* X accounts only. True when the account was connected through your own X
|
|
36
|
+
* developer app, so its posts use your X API credits.
|
|
37
|
+
*/
|
|
38
|
+
byo_keys?: boolean;
|
|
34
39
|
is_active: boolean;
|
|
35
40
|
created_at: string;
|
|
36
41
|
}
|
|
42
|
+
/** Status of your own X developer app. Never includes the client secret. */
|
|
43
|
+
interface XKeysStatus {
|
|
44
|
+
configured: boolean;
|
|
45
|
+
label: string | null;
|
|
46
|
+
/** Last 4 characters of the stored client ID, to confirm which app is saved. */
|
|
47
|
+
client_id_last4: string | null;
|
|
48
|
+
/** The exact callback URI to register on your X app. */
|
|
49
|
+
redirect_uri: string;
|
|
50
|
+
created_at: string | null;
|
|
51
|
+
updated_at: string | null;
|
|
52
|
+
}
|
|
53
|
+
interface SetXKeysInput {
|
|
54
|
+
/** OAuth 2.0 Client ID from developer.x.com. */
|
|
55
|
+
client_id: string;
|
|
56
|
+
/** OAuth 2.0 Client Secret from developer.x.com. Stored encrypted. */
|
|
57
|
+
client_secret: string;
|
|
58
|
+
/** Optional human-readable name for the app. */
|
|
59
|
+
label?: string;
|
|
60
|
+
}
|
|
61
|
+
interface SetXKeysResult extends XKeysStatus {
|
|
62
|
+
required_scopes: string[];
|
|
63
|
+
message: string;
|
|
64
|
+
}
|
|
65
|
+
interface RemoveXKeysResult {
|
|
66
|
+
configured: false;
|
|
67
|
+
removed: true;
|
|
68
|
+
message: string;
|
|
69
|
+
}
|
|
37
70
|
interface ApiAnalytics {
|
|
38
71
|
post_id: string;
|
|
39
72
|
platform: Platform;
|
|
@@ -103,7 +136,9 @@ interface CreatePostInput {
|
|
|
103
136
|
text: string;
|
|
104
137
|
media_urls?: string[];
|
|
105
138
|
/**
|
|
106
|
-
* ISO 8601 datetime to schedule the post
|
|
139
|
+
* ISO 8601 datetime to schedule the post. Must be in the future and carry a
|
|
140
|
+
* timezone — "2026-04-01T14:00:00Z" or "2026-04-01T16:00:00+02:00" both work
|
|
141
|
+
* and are normalized to UTC.
|
|
107
142
|
* Scheduled posts publish within ~5 minutes of this time.
|
|
108
143
|
*/
|
|
109
144
|
schedule_at?: string;
|
|
@@ -115,7 +150,9 @@ interface CreateThreadInput {
|
|
|
115
150
|
media_urls?: string[];
|
|
116
151
|
}[];
|
|
117
152
|
/**
|
|
118
|
-
* ISO 8601 datetime to schedule the entire thread
|
|
153
|
+
* ISO 8601 datetime to schedule the entire thread. Must be in the future and
|
|
154
|
+
* carry a timezone — "2026-04-01T14:00:00Z" or "2026-04-01T16:00:00+02:00"
|
|
155
|
+
* both work and are normalized to UTC.
|
|
119
156
|
* Scheduled threads publish within ~5 minutes of this time.
|
|
120
157
|
*/
|
|
121
158
|
schedule_at?: string;
|
|
@@ -218,6 +255,26 @@ declare class ChirpieClient {
|
|
|
218
255
|
connectAccount(): Promise<{
|
|
219
256
|
authorization_url: string;
|
|
220
257
|
}>;
|
|
258
|
+
/**
|
|
259
|
+
* Register your own X developer app so X accounts connect through it and
|
|
260
|
+
* post against your X API credits instead of Chirpie's. Link posts from
|
|
261
|
+
* accounts connected this way are not surcharged.
|
|
262
|
+
*
|
|
263
|
+
* Add the returned `redirect_uri` as a callback URI on your X app, then
|
|
264
|
+
* reconnect each X account you want to move onto your app — accounts that
|
|
265
|
+
* are already connected keep using whichever app connected them.
|
|
266
|
+
*/
|
|
267
|
+
setXKeys(input: SetXKeysInput): Promise<SetXKeysResult>;
|
|
268
|
+
/**
|
|
269
|
+
* Remove your own X developer app. X accounts connected through it stop
|
|
270
|
+
* refreshing until you re-add the keys or reconnect them through Chirpie.
|
|
271
|
+
*/
|
|
272
|
+
removeXKeys(): Promise<RemoveXKeysResult>;
|
|
273
|
+
/**
|
|
274
|
+
* Check whether your own X developer app is configured. Never returns the
|
|
275
|
+
* client secret.
|
|
276
|
+
*/
|
|
277
|
+
getXKeysStatus(): Promise<XKeysStatus>;
|
|
221
278
|
createKey(name?: string): Promise<{
|
|
222
279
|
key: string;
|
|
223
280
|
prefix: string;
|
|
@@ -263,4 +320,4 @@ declare function deleteConfig(): boolean;
|
|
|
263
320
|
*/
|
|
264
321
|
declare function requireConfig(): ChirpieConfig;
|
|
265
322
|
|
|
266
|
-
export { type ApiAccount, type ApiAnalytics, type ApiKeyInfo, type ApiPost, type ApiThread, ChirpieApiError, ChirpieClient, type ChirpieClientOptions, type ChirpieConfig, ChirpieError, type ConnectBlueskyInput, type ConnectFacebookInput, type ConnectGBPInput, type ConnectInstagramInput, type ConnectLinkedInInput, type ConnectMastodonInput, type ConnectPinterestInput, type ConnectRedditInput, type ConnectSnapchatInput, type ConnectTelegramInput, type ConnectThreadsInput, type ConnectTikTokInput, type ConnectYouTubeInput, type CreatePostInput, type CreateThreadInput, type ListPostsOptions, deleteConfig, getConfig, requireConfig, saveConfig };
|
|
323
|
+
export { type ApiAccount, type ApiAnalytics, type ApiKeyInfo, type ApiPost, type ApiThread, ChirpieApiError, ChirpieClient, type ChirpieClientOptions, type ChirpieConfig, ChirpieError, type ConnectBlueskyInput, type ConnectFacebookInput, type ConnectGBPInput, type ConnectInstagramInput, type ConnectLinkedInInput, type ConnectMastodonInput, type ConnectPinterestInput, type ConnectRedditInput, type ConnectSnapchatInput, type ConnectTelegramInput, type ConnectThreadsInput, type ConnectTikTokInput, type ConnectYouTubeInput, type CreatePostInput, type CreateThreadInput, type ListPostsOptions, type RemoveXKeysResult, type SetXKeysInput, type SetXKeysResult, type XKeysStatus, deleteConfig, getConfig, requireConfig, saveConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,9 +31,42 @@ interface ApiAccount {
|
|
|
31
31
|
display_name: string | null;
|
|
32
32
|
avatar_url: string | null;
|
|
33
33
|
max_post_length: number;
|
|
34
|
+
/**
|
|
35
|
+
* X accounts only. True when the account was connected through your own X
|
|
36
|
+
* developer app, so its posts use your X API credits.
|
|
37
|
+
*/
|
|
38
|
+
byo_keys?: boolean;
|
|
34
39
|
is_active: boolean;
|
|
35
40
|
created_at: string;
|
|
36
41
|
}
|
|
42
|
+
/** Status of your own X developer app. Never includes the client secret. */
|
|
43
|
+
interface XKeysStatus {
|
|
44
|
+
configured: boolean;
|
|
45
|
+
label: string | null;
|
|
46
|
+
/** Last 4 characters of the stored client ID, to confirm which app is saved. */
|
|
47
|
+
client_id_last4: string | null;
|
|
48
|
+
/** The exact callback URI to register on your X app. */
|
|
49
|
+
redirect_uri: string;
|
|
50
|
+
created_at: string | null;
|
|
51
|
+
updated_at: string | null;
|
|
52
|
+
}
|
|
53
|
+
interface SetXKeysInput {
|
|
54
|
+
/** OAuth 2.0 Client ID from developer.x.com. */
|
|
55
|
+
client_id: string;
|
|
56
|
+
/** OAuth 2.0 Client Secret from developer.x.com. Stored encrypted. */
|
|
57
|
+
client_secret: string;
|
|
58
|
+
/** Optional human-readable name for the app. */
|
|
59
|
+
label?: string;
|
|
60
|
+
}
|
|
61
|
+
interface SetXKeysResult extends XKeysStatus {
|
|
62
|
+
required_scopes: string[];
|
|
63
|
+
message: string;
|
|
64
|
+
}
|
|
65
|
+
interface RemoveXKeysResult {
|
|
66
|
+
configured: false;
|
|
67
|
+
removed: true;
|
|
68
|
+
message: string;
|
|
69
|
+
}
|
|
37
70
|
interface ApiAnalytics {
|
|
38
71
|
post_id: string;
|
|
39
72
|
platform: Platform;
|
|
@@ -103,7 +136,9 @@ interface CreatePostInput {
|
|
|
103
136
|
text: string;
|
|
104
137
|
media_urls?: string[];
|
|
105
138
|
/**
|
|
106
|
-
* ISO 8601 datetime to schedule the post
|
|
139
|
+
* ISO 8601 datetime to schedule the post. Must be in the future and carry a
|
|
140
|
+
* timezone — "2026-04-01T14:00:00Z" or "2026-04-01T16:00:00+02:00" both work
|
|
141
|
+
* and are normalized to UTC.
|
|
107
142
|
* Scheduled posts publish within ~5 minutes of this time.
|
|
108
143
|
*/
|
|
109
144
|
schedule_at?: string;
|
|
@@ -115,7 +150,9 @@ interface CreateThreadInput {
|
|
|
115
150
|
media_urls?: string[];
|
|
116
151
|
}[];
|
|
117
152
|
/**
|
|
118
|
-
* ISO 8601 datetime to schedule the entire thread
|
|
153
|
+
* ISO 8601 datetime to schedule the entire thread. Must be in the future and
|
|
154
|
+
* carry a timezone — "2026-04-01T14:00:00Z" or "2026-04-01T16:00:00+02:00"
|
|
155
|
+
* both work and are normalized to UTC.
|
|
119
156
|
* Scheduled threads publish within ~5 minutes of this time.
|
|
120
157
|
*/
|
|
121
158
|
schedule_at?: string;
|
|
@@ -218,6 +255,26 @@ declare class ChirpieClient {
|
|
|
218
255
|
connectAccount(): Promise<{
|
|
219
256
|
authorization_url: string;
|
|
220
257
|
}>;
|
|
258
|
+
/**
|
|
259
|
+
* Register your own X developer app so X accounts connect through it and
|
|
260
|
+
* post against your X API credits instead of Chirpie's. Link posts from
|
|
261
|
+
* accounts connected this way are not surcharged.
|
|
262
|
+
*
|
|
263
|
+
* Add the returned `redirect_uri` as a callback URI on your X app, then
|
|
264
|
+
* reconnect each X account you want to move onto your app — accounts that
|
|
265
|
+
* are already connected keep using whichever app connected them.
|
|
266
|
+
*/
|
|
267
|
+
setXKeys(input: SetXKeysInput): Promise<SetXKeysResult>;
|
|
268
|
+
/**
|
|
269
|
+
* Remove your own X developer app. X accounts connected through it stop
|
|
270
|
+
* refreshing until you re-add the keys or reconnect them through Chirpie.
|
|
271
|
+
*/
|
|
272
|
+
removeXKeys(): Promise<RemoveXKeysResult>;
|
|
273
|
+
/**
|
|
274
|
+
* Check whether your own X developer app is configured. Never returns the
|
|
275
|
+
* client secret.
|
|
276
|
+
*/
|
|
277
|
+
getXKeysStatus(): Promise<XKeysStatus>;
|
|
221
278
|
createKey(name?: string): Promise<{
|
|
222
279
|
key: string;
|
|
223
280
|
prefix: string;
|
|
@@ -263,4 +320,4 @@ declare function deleteConfig(): boolean;
|
|
|
263
320
|
*/
|
|
264
321
|
declare function requireConfig(): ChirpieConfig;
|
|
265
322
|
|
|
266
|
-
export { type ApiAccount, type ApiAnalytics, type ApiKeyInfo, type ApiPost, type ApiThread, ChirpieApiError, ChirpieClient, type ChirpieClientOptions, type ChirpieConfig, ChirpieError, type ConnectBlueskyInput, type ConnectFacebookInput, type ConnectGBPInput, type ConnectInstagramInput, type ConnectLinkedInInput, type ConnectMastodonInput, type ConnectPinterestInput, type ConnectRedditInput, type ConnectSnapchatInput, type ConnectTelegramInput, type ConnectThreadsInput, type ConnectTikTokInput, type ConnectYouTubeInput, type CreatePostInput, type CreateThreadInput, type ListPostsOptions, deleteConfig, getConfig, requireConfig, saveConfig };
|
|
323
|
+
export { type ApiAccount, type ApiAnalytics, type ApiKeyInfo, type ApiPost, type ApiThread, ChirpieApiError, ChirpieClient, type ChirpieClientOptions, type ChirpieConfig, ChirpieError, type ConnectBlueskyInput, type ConnectFacebookInput, type ConnectGBPInput, type ConnectInstagramInput, type ConnectLinkedInInput, type ConnectMastodonInput, type ConnectPinterestInput, type ConnectRedditInput, type ConnectSnapchatInput, type ConnectTelegramInput, type ConnectThreadsInput, type ConnectTikTokInput, type ConnectYouTubeInput, type CreatePostInput, type CreateThreadInput, type ListPostsOptions, type RemoveXKeysResult, type SetXKeysInput, type SetXKeysResult, type XKeysStatus, deleteConfig, getConfig, requireConfig, saveConfig };
|
package/dist/index.js
CHANGED
|
@@ -213,6 +213,33 @@ var ChirpieClient = class {
|
|
|
213
213
|
async connectAccount() {
|
|
214
214
|
return this.connectXAccount();
|
|
215
215
|
}
|
|
216
|
+
// Your own X developer app ("bring your own keys")
|
|
217
|
+
/**
|
|
218
|
+
* Register your own X developer app so X accounts connect through it and
|
|
219
|
+
* post against your X API credits instead of Chirpie's. Link posts from
|
|
220
|
+
* accounts connected this way are not surcharged.
|
|
221
|
+
*
|
|
222
|
+
* Add the returned `redirect_uri` as a callback URI on your X app, then
|
|
223
|
+
* reconnect each X account you want to move onto your app — accounts that
|
|
224
|
+
* are already connected keep using whichever app connected them.
|
|
225
|
+
*/
|
|
226
|
+
async setXKeys(input) {
|
|
227
|
+
return this.request("PUT", "/accounts/x/keys", input);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Remove your own X developer app. X accounts connected through it stop
|
|
231
|
+
* refreshing until you re-add the keys or reconnect them through Chirpie.
|
|
232
|
+
*/
|
|
233
|
+
async removeXKeys() {
|
|
234
|
+
return this.request("DELETE", "/accounts/x/keys");
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Check whether your own X developer app is configured. Never returns the
|
|
238
|
+
* client secret.
|
|
239
|
+
*/
|
|
240
|
+
async getXKeysStatus() {
|
|
241
|
+
return this.request("GET", "/accounts/x/keys");
|
|
242
|
+
}
|
|
216
243
|
// Keys
|
|
217
244
|
async createKey(name) {
|
|
218
245
|
return this.request(
|
package/dist/index.mjs
CHANGED
|
@@ -181,6 +181,33 @@ var ChirpieClient = class {
|
|
|
181
181
|
async connectAccount() {
|
|
182
182
|
return this.connectXAccount();
|
|
183
183
|
}
|
|
184
|
+
// Your own X developer app ("bring your own keys")
|
|
185
|
+
/**
|
|
186
|
+
* Register your own X developer app so X accounts connect through it and
|
|
187
|
+
* post against your X API credits instead of Chirpie's. Link posts from
|
|
188
|
+
* accounts connected this way are not surcharged.
|
|
189
|
+
*
|
|
190
|
+
* Add the returned `redirect_uri` as a callback URI on your X app, then
|
|
191
|
+
* reconnect each X account you want to move onto your app — accounts that
|
|
192
|
+
* are already connected keep using whichever app connected them.
|
|
193
|
+
*/
|
|
194
|
+
async setXKeys(input) {
|
|
195
|
+
return this.request("PUT", "/accounts/x/keys", input);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Remove your own X developer app. X accounts connected through it stop
|
|
199
|
+
* refreshing until you re-add the keys or reconnect them through Chirpie.
|
|
200
|
+
*/
|
|
201
|
+
async removeXKeys() {
|
|
202
|
+
return this.request("DELETE", "/accounts/x/keys");
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Check whether your own X developer app is configured. Never returns the
|
|
206
|
+
* client secret.
|
|
207
|
+
*/
|
|
208
|
+
async getXKeysStatus() {
|
|
209
|
+
return this.request("GET", "/accounts/x/keys");
|
|
210
|
+
}
|
|
184
211
|
// Keys
|
|
185
212
|
async createKey(name) {
|
|
186
213
|
return this.request(
|