@chirpie/sdk 1.0.12 → 1.0.13

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 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;
@@ -218,6 +251,26 @@ declare class ChirpieClient {
218
251
  connectAccount(): Promise<{
219
252
  authorization_url: string;
220
253
  }>;
254
+ /**
255
+ * Register your own X developer app so X accounts connect through it and
256
+ * post against your X API credits instead of Chirpie's. Link posts from
257
+ * accounts connected this way are not surcharged.
258
+ *
259
+ * Add the returned `redirect_uri` as a callback URI on your X app, then
260
+ * reconnect each X account you want to move onto your app — accounts that
261
+ * are already connected keep using whichever app connected them.
262
+ */
263
+ setXKeys(input: SetXKeysInput): Promise<SetXKeysResult>;
264
+ /**
265
+ * Remove your own X developer app. X accounts connected through it stop
266
+ * refreshing until you re-add the keys or reconnect them through Chirpie.
267
+ */
268
+ removeXKeys(): Promise<RemoveXKeysResult>;
269
+ /**
270
+ * Check whether your own X developer app is configured. Never returns the
271
+ * client secret.
272
+ */
273
+ getXKeysStatus(): Promise<XKeysStatus>;
221
274
  createKey(name?: string): Promise<{
222
275
  key: string;
223
276
  prefix: string;
@@ -263,4 +316,4 @@ declare function deleteConfig(): boolean;
263
316
  */
264
317
  declare function requireConfig(): ChirpieConfig;
265
318
 
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 };
319
+ 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;
@@ -218,6 +251,26 @@ declare class ChirpieClient {
218
251
  connectAccount(): Promise<{
219
252
  authorization_url: string;
220
253
  }>;
254
+ /**
255
+ * Register your own X developer app so X accounts connect through it and
256
+ * post against your X API credits instead of Chirpie's. Link posts from
257
+ * accounts connected this way are not surcharged.
258
+ *
259
+ * Add the returned `redirect_uri` as a callback URI on your X app, then
260
+ * reconnect each X account you want to move onto your app — accounts that
261
+ * are already connected keep using whichever app connected them.
262
+ */
263
+ setXKeys(input: SetXKeysInput): Promise<SetXKeysResult>;
264
+ /**
265
+ * Remove your own X developer app. X accounts connected through it stop
266
+ * refreshing until you re-add the keys or reconnect them through Chirpie.
267
+ */
268
+ removeXKeys(): Promise<RemoveXKeysResult>;
269
+ /**
270
+ * Check whether your own X developer app is configured. Never returns the
271
+ * client secret.
272
+ */
273
+ getXKeysStatus(): Promise<XKeysStatus>;
221
274
  createKey(name?: string): Promise<{
222
275
  key: string;
223
276
  prefix: string;
@@ -263,4 +316,4 @@ declare function deleteConfig(): boolean;
263
316
  */
264
317
  declare function requireConfig(): ChirpieConfig;
265
318
 
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 };
319
+ 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(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chirpie/sdk",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Chirpie SDK — TypeScript client for the Chirpie social media API",
5
5
  "repository": {
6
6
  "type": "git",