@chirpie/sdk 1.0.10 → 1.0.12
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 +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +25 -0
- package/dist/index.mjs +25 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -102,6 +102,10 @@ interface CreatePostInput {
|
|
|
102
102
|
account_id: string;
|
|
103
103
|
text: string;
|
|
104
104
|
media_urls?: string[];
|
|
105
|
+
/**
|
|
106
|
+
* ISO 8601 datetime to schedule the post (UTC). Must be in the future.
|
|
107
|
+
* Scheduled posts publish within ~5 minutes of this time.
|
|
108
|
+
*/
|
|
105
109
|
schedule_at?: string;
|
|
106
110
|
}
|
|
107
111
|
interface CreateThreadInput {
|
|
@@ -110,6 +114,10 @@ interface CreateThreadInput {
|
|
|
110
114
|
text: string;
|
|
111
115
|
media_urls?: string[];
|
|
112
116
|
}[];
|
|
117
|
+
/**
|
|
118
|
+
* ISO 8601 datetime to schedule the entire thread (UTC). Must be in the future.
|
|
119
|
+
* Scheduled threads publish within ~5 minutes of this time.
|
|
120
|
+
*/
|
|
113
121
|
schedule_at?: string;
|
|
114
122
|
}
|
|
115
123
|
interface ListPostsOptions {
|
|
@@ -128,6 +136,18 @@ declare class ChirpieClient {
|
|
|
128
136
|
private baseUrl;
|
|
129
137
|
constructor(options: ChirpieClientOptions);
|
|
130
138
|
private request;
|
|
139
|
+
/**
|
|
140
|
+
* Create a post (immediate or scheduled).
|
|
141
|
+
* If `schedule_at` is set, the post is queued and publishes within ~5 minutes
|
|
142
|
+
* of the scheduled time.
|
|
143
|
+
*
|
|
144
|
+
* @param input - Post payload including `account_id`, `text`, optional `media_urls`, and optional `schedule_at`.
|
|
145
|
+
* @returns The created post.
|
|
146
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
147
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
148
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
149
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
150
|
+
*/
|
|
131
151
|
createPost(input: CreatePostInput): Promise<ApiPost>;
|
|
132
152
|
listPosts(options?: ListPostsOptions): Promise<ApiPost[]>;
|
|
133
153
|
getPost(id: string): Promise<ApiPost>;
|
|
@@ -135,6 +155,19 @@ declare class ChirpieClient {
|
|
|
135
155
|
id: string;
|
|
136
156
|
deleted: boolean;
|
|
137
157
|
}>;
|
|
158
|
+
/**
|
|
159
|
+
* Create a thread (immediate or scheduled).
|
|
160
|
+
* If `schedule_at` is set, the thread is queued and publishes within ~5 minutes
|
|
161
|
+
* of the scheduled time. Threads publish atomically — if any post fails, the
|
|
162
|
+
* entire thread is retried.
|
|
163
|
+
*
|
|
164
|
+
* @param input - Thread payload including `account_id`, an array of `posts` (text + optional `media_urls`), and optional `schedule_at`.
|
|
165
|
+
* @returns The created thread, including each post's id and status.
|
|
166
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
167
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
168
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
169
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
170
|
+
*/
|
|
138
171
|
createThread(input: CreateThreadInput): Promise<ApiThread>;
|
|
139
172
|
listAccounts(): Promise<ApiAccount[]>;
|
|
140
173
|
connectXAccount(): Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,10 @@ interface CreatePostInput {
|
|
|
102
102
|
account_id: string;
|
|
103
103
|
text: string;
|
|
104
104
|
media_urls?: string[];
|
|
105
|
+
/**
|
|
106
|
+
* ISO 8601 datetime to schedule the post (UTC). Must be in the future.
|
|
107
|
+
* Scheduled posts publish within ~5 minutes of this time.
|
|
108
|
+
*/
|
|
105
109
|
schedule_at?: string;
|
|
106
110
|
}
|
|
107
111
|
interface CreateThreadInput {
|
|
@@ -110,6 +114,10 @@ interface CreateThreadInput {
|
|
|
110
114
|
text: string;
|
|
111
115
|
media_urls?: string[];
|
|
112
116
|
}[];
|
|
117
|
+
/**
|
|
118
|
+
* ISO 8601 datetime to schedule the entire thread (UTC). Must be in the future.
|
|
119
|
+
* Scheduled threads publish within ~5 minutes of this time.
|
|
120
|
+
*/
|
|
113
121
|
schedule_at?: string;
|
|
114
122
|
}
|
|
115
123
|
interface ListPostsOptions {
|
|
@@ -128,6 +136,18 @@ declare class ChirpieClient {
|
|
|
128
136
|
private baseUrl;
|
|
129
137
|
constructor(options: ChirpieClientOptions);
|
|
130
138
|
private request;
|
|
139
|
+
/**
|
|
140
|
+
* Create a post (immediate or scheduled).
|
|
141
|
+
* If `schedule_at` is set, the post is queued and publishes within ~5 minutes
|
|
142
|
+
* of the scheduled time.
|
|
143
|
+
*
|
|
144
|
+
* @param input - Post payload including `account_id`, `text`, optional `media_urls`, and optional `schedule_at`.
|
|
145
|
+
* @returns The created post.
|
|
146
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
147
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
148
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
149
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
150
|
+
*/
|
|
131
151
|
createPost(input: CreatePostInput): Promise<ApiPost>;
|
|
132
152
|
listPosts(options?: ListPostsOptions): Promise<ApiPost[]>;
|
|
133
153
|
getPost(id: string): Promise<ApiPost>;
|
|
@@ -135,6 +155,19 @@ declare class ChirpieClient {
|
|
|
135
155
|
id: string;
|
|
136
156
|
deleted: boolean;
|
|
137
157
|
}>;
|
|
158
|
+
/**
|
|
159
|
+
* Create a thread (immediate or scheduled).
|
|
160
|
+
* If `schedule_at` is set, the thread is queued and publishes within ~5 minutes
|
|
161
|
+
* of the scheduled time. Threads publish atomically — if any post fails, the
|
|
162
|
+
* entire thread is retried.
|
|
163
|
+
*
|
|
164
|
+
* @param input - Thread payload including `account_id`, an array of `posts` (text + optional `media_urls`), and optional `schedule_at`.
|
|
165
|
+
* @returns The created thread, including each post's id and status.
|
|
166
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
167
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
168
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
169
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
170
|
+
*/
|
|
138
171
|
createThread(input: CreateThreadInput): Promise<ApiThread>;
|
|
139
172
|
listAccounts(): Promise<ApiAccount[]>;
|
|
140
173
|
connectXAccount(): Promise<{
|
package/dist/index.js
CHANGED
|
@@ -90,6 +90,18 @@ var ChirpieClient = class {
|
|
|
90
90
|
return json.data;
|
|
91
91
|
}
|
|
92
92
|
// Posts
|
|
93
|
+
/**
|
|
94
|
+
* Create a post (immediate or scheduled).
|
|
95
|
+
* If `schedule_at` is set, the post is queued and publishes within ~5 minutes
|
|
96
|
+
* of the scheduled time.
|
|
97
|
+
*
|
|
98
|
+
* @param input - Post payload including `account_id`, `text`, optional `media_urls`, and optional `schedule_at`.
|
|
99
|
+
* @returns The created post.
|
|
100
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
101
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
102
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
103
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
104
|
+
*/
|
|
93
105
|
async createPost(input) {
|
|
94
106
|
return this.request("POST", "/posts", input);
|
|
95
107
|
}
|
|
@@ -109,6 +121,19 @@ var ChirpieClient = class {
|
|
|
109
121
|
return this.request("DELETE", `/posts/${id}`);
|
|
110
122
|
}
|
|
111
123
|
// Threads
|
|
124
|
+
/**
|
|
125
|
+
* Create a thread (immediate or scheduled).
|
|
126
|
+
* If `schedule_at` is set, the thread is queued and publishes within ~5 minutes
|
|
127
|
+
* of the scheduled time. Threads publish atomically — if any post fails, the
|
|
128
|
+
* entire thread is retried.
|
|
129
|
+
*
|
|
130
|
+
* @param input - Thread payload including `account_id`, an array of `posts` (text + optional `media_urls`), and optional `schedule_at`.
|
|
131
|
+
* @returns The created thread, including each post's id and status.
|
|
132
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
133
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
134
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
135
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
136
|
+
*/
|
|
112
137
|
async createThread(input) {
|
|
113
138
|
return this.request("POST", "/threads", input);
|
|
114
139
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -58,6 +58,18 @@ var ChirpieClient = class {
|
|
|
58
58
|
return json.data;
|
|
59
59
|
}
|
|
60
60
|
// Posts
|
|
61
|
+
/**
|
|
62
|
+
* Create a post (immediate or scheduled).
|
|
63
|
+
* If `schedule_at` is set, the post is queued and publishes within ~5 minutes
|
|
64
|
+
* of the scheduled time.
|
|
65
|
+
*
|
|
66
|
+
* @param input - Post payload including `account_id`, `text`, optional `media_urls`, and optional `schedule_at`.
|
|
67
|
+
* @returns The created post.
|
|
68
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
69
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
70
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
71
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
72
|
+
*/
|
|
61
73
|
async createPost(input) {
|
|
62
74
|
return this.request("POST", "/posts", input);
|
|
63
75
|
}
|
|
@@ -77,6 +89,19 @@ var ChirpieClient = class {
|
|
|
77
89
|
return this.request("DELETE", `/posts/${id}`);
|
|
78
90
|
}
|
|
79
91
|
// Threads
|
|
92
|
+
/**
|
|
93
|
+
* Create a thread (immediate or scheduled).
|
|
94
|
+
* If `schedule_at` is set, the thread is queued and publishes within ~5 minutes
|
|
95
|
+
* of the scheduled time. Threads publish atomically — if any post fails, the
|
|
96
|
+
* entire thread is retried.
|
|
97
|
+
*
|
|
98
|
+
* @param input - Thread payload including `account_id`, an array of `posts` (text + optional `media_urls`), and optional `schedule_at`.
|
|
99
|
+
* @returns The created thread, including each post's id and status.
|
|
100
|
+
* @throws {ChirpieError} On network/transport failure.
|
|
101
|
+
* @throws {ChirpieApiError} On non-2xx responses (auth, validation, plan limit, platform error) or invalid JSON.
|
|
102
|
+
* X posts whose text contains a link are billed at $0.25 each on paid plans, and are
|
|
103
|
+
* rejected on the Free plan with code `x_link_posts_require_paid_plan` (HTTP 402).
|
|
104
|
+
*/
|
|
80
105
|
async createThread(input) {
|
|
81
106
|
return this.request("POST", "/threads", input);
|
|
82
107
|
}
|