@relayapi/sdk 0.2.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/dist/api-promise.d.ts +2 -0
- package/dist/api-promise.js +18 -0
- package/dist/client.d.ts +225 -0
- package/dist/client.js +552 -0
- package/dist/core/api-promise.d.ts +45 -0
- package/dist/core/api-promise.js +83 -0
- package/dist/core/error.d.ts +45 -0
- package/dist/core/error.js +112 -0
- package/dist/core/resource.d.ts +5 -0
- package/dist/core/resource.js +10 -0
- package/dist/core/uploads.d.ts +2 -0
- package/dist/core/uploads.js +5 -0
- package/dist/error.d.ts +2 -0
- package/dist/error.js +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +26 -0
- package/dist/internal/builtin-types.d.ts +72 -0
- package/dist/internal/builtin-types.js +3 -0
- package/dist/internal/detect-platform.d.ts +14 -0
- package/dist/internal/detect-platform.js +161 -0
- package/dist/internal/errors.d.ts +2 -0
- package/dist/internal/errors.js +40 -0
- package/dist/internal/headers.d.ts +19 -0
- package/dist/internal/headers.js +78 -0
- package/dist/internal/parse.d.ts +11 -0
- package/dist/internal/parse.js +39 -0
- package/dist/internal/request-options.d.ts +74 -0
- package/dist/internal/request-options.js +13 -0
- package/dist/internal/shim-types.d.ts +16 -0
- package/dist/internal/shim-types.js +3 -0
- package/dist/internal/shims.d.ts +23 -0
- package/dist/internal/shims.js +90 -0
- package/dist/internal/to-file.d.ts +44 -0
- package/dist/internal/to-file.js +90 -0
- package/dist/internal/types.d.ts +68 -0
- package/dist/internal/types.js +3 -0
- package/dist/internal/uploads.d.ts +41 -0
- package/dist/internal/uploads.js +140 -0
- package/dist/internal/utils/base64.d.ts +2 -0
- package/dist/internal/utils/base64.js +37 -0
- package/dist/internal/utils/bytes.d.ts +3 -0
- package/dist/internal/utils/bytes.js +30 -0
- package/dist/internal/utils/env.d.ts +8 -0
- package/dist/internal/utils/env.js +21 -0
- package/dist/internal/utils/log.d.ts +36 -0
- package/dist/internal/utils/log.js +84 -0
- package/dist/internal/utils/path.d.ts +14 -0
- package/dist/internal/utils/path.js +78 -0
- package/dist/internal/utils/query.d.ts +4 -0
- package/dist/internal/utils/query.js +22 -0
- package/dist/internal/utils/sleep.d.ts +1 -0
- package/dist/internal/utils/sleep.js +6 -0
- package/dist/internal/utils/uuid.d.ts +4 -0
- package/dist/internal/utils/uuid.js +18 -0
- package/dist/internal/utils/values.d.ts +17 -0
- package/dist/internal/utils/values.js +111 -0
- package/dist/internal/utils.d.ts +7 -0
- package/dist/internal/utils.js +24 -0
- package/dist/resource.d.ts +2 -0
- package/dist/resource.js +18 -0
- package/dist/resources/account-groups.d.ts +52 -0
- package/dist/resources/account-groups.js +37 -0
- package/dist/resources/accounts/accounts.d.ts +148 -0
- package/dist/resources/accounts/accounts.js +101 -0
- package/dist/resources/accounts/facebook-pages.d.ts +48 -0
- package/dist/resources/accounts/facebook-pages.js +21 -0
- package/dist/resources/accounts/gmb-locations.d.ts +48 -0
- package/dist/resources/accounts/gmb-locations.js +21 -0
- package/dist/resources/accounts/health.d.ts +49 -0
- package/dist/resources/accounts/health.js +21 -0
- package/dist/resources/accounts/index.d.ts +8 -0
- package/dist/resources/accounts/index.js +20 -0
- package/dist/resources/accounts/linkedin-organizations.d.ts +52 -0
- package/dist/resources/accounts/linkedin-organizations.js +21 -0
- package/dist/resources/accounts/pinterest-boards.d.ts +48 -0
- package/dist/resources/accounts/pinterest-boards.js +21 -0
- package/dist/resources/accounts/reddit-flairs.d.ts +27 -0
- package/dist/resources/accounts/reddit-flairs.js +15 -0
- package/dist/resources/accounts/reddit-subreddits.d.ts +48 -0
- package/dist/resources/accounts/reddit-subreddits.js +21 -0
- package/dist/resources/accounts.d.ts +1 -0
- package/dist/resources/accounts.js +18 -0
- package/dist/resources/analytics/analytics.d.ts +369 -0
- package/dist/resources/analytics/analytics.js +84 -0
- package/dist/resources/analytics/index.d.ts +2 -0
- package/dist/resources/analytics/index.js +8 -0
- package/dist/resources/analytics/youtube.d.ts +49 -0
- package/dist/resources/analytics/youtube.js +14 -0
- package/dist/resources/analytics.d.ts +1 -0
- package/dist/resources/analytics.js +18 -0
- package/dist/resources/api-keys.d.ts +110 -0
- package/dist/resources/api-keys.js +32 -0
- package/dist/resources/connect/connect.d.ts +188 -0
- package/dist/resources/connect/connect.js +97 -0
- package/dist/resources/connect/facebook/facebook.d.ts +9 -0
- package/dist/resources/connect/facebook/facebook.js +48 -0
- package/dist/resources/connect/facebook/index.d.ts +2 -0
- package/dist/resources/connect/facebook/index.js +8 -0
- package/dist/resources/connect/facebook/pages.d.ts +70 -0
- package/dist/resources/connect/facebook/pages.js +20 -0
- package/dist/resources/connect/facebook.d.ts +1 -0
- package/dist/resources/connect/facebook.js +18 -0
- package/dist/resources/connect/googlebusiness/googlebusiness.d.ts +9 -0
- package/dist/resources/connect/googlebusiness/googlebusiness.js +48 -0
- package/dist/resources/connect/googlebusiness/index.d.ts +2 -0
- package/dist/resources/connect/googlebusiness/index.js +8 -0
- package/dist/resources/connect/googlebusiness/locations.d.ts +70 -0
- package/dist/resources/connect/googlebusiness/locations.js +20 -0
- package/dist/resources/connect/googlebusiness.d.ts +1 -0
- package/dist/resources/connect/googlebusiness.js +18 -0
- package/dist/resources/connect/index.d.ts +8 -0
- package/dist/resources/connect/index.js +20 -0
- package/dist/resources/connect/linkedin/index.d.ts +2 -0
- package/dist/resources/connect/linkedin/index.js +8 -0
- package/dist/resources/connect/linkedin/linkedin.d.ts +9 -0
- package/dist/resources/connect/linkedin/linkedin.js +48 -0
- package/dist/resources/connect/linkedin/organizations.d.ts +85 -0
- package/dist/resources/connect/linkedin/organizations.js +20 -0
- package/dist/resources/connect/linkedin.d.ts +1 -0
- package/dist/resources/connect/linkedin.js +18 -0
- package/dist/resources/connect/pinterest/boards.d.ts +70 -0
- package/dist/resources/connect/pinterest/boards.js +20 -0
- package/dist/resources/connect/pinterest/index.d.ts +2 -0
- package/dist/resources/connect/pinterest/index.js +8 -0
- package/dist/resources/connect/pinterest/pinterest.d.ts +9 -0
- package/dist/resources/connect/pinterest/pinterest.js +48 -0
- package/dist/resources/connect/pinterest.d.ts +1 -0
- package/dist/resources/connect/pinterest.js +18 -0
- package/dist/resources/connect/snapchat/index.d.ts +2 -0
- package/dist/resources/connect/snapchat/index.js +8 -0
- package/dist/resources/connect/snapchat/profiles.d.ts +74 -0
- package/dist/resources/connect/snapchat/profiles.js +20 -0
- package/dist/resources/connect/snapchat/snapchat.d.ts +9 -0
- package/dist/resources/connect/snapchat/snapchat.js +48 -0
- package/dist/resources/connect/snapchat.d.ts +1 -0
- package/dist/resources/connect/snapchat.js +18 -0
- package/dist/resources/connect/telegram.d.ts +122 -0
- package/dist/resources/connect/telegram.js +26 -0
- package/dist/resources/connect/whatsapp.d.ts +92 -0
- package/dist/resources/connect/whatsapp.js +26 -0
- package/dist/resources/connect.d.ts +1 -0
- package/dist/resources/connect.js +18 -0
- package/dist/resources/connections.d.ts +55 -0
- package/dist/resources/connections.js +14 -0
- package/dist/resources/inbox/comments/comments.d.ts +220 -0
- package/dist/resources/inbox/comments/comments.js +83 -0
- package/dist/resources/inbox/comments/hide.d.ts +36 -0
- package/dist/resources/inbox/comments/hide.js +21 -0
- package/dist/resources/inbox/comments/index.d.ts +3 -0
- package/dist/resources/inbox/comments/index.js +10 -0
- package/dist/resources/inbox/comments/like.d.ts +36 -0
- package/dist/resources/inbox/comments/like.js +21 -0
- package/dist/resources/inbox/comments.d.ts +1 -0
- package/dist/resources/inbox/comments.js +18 -0
- package/dist/resources/inbox/inbox.d.ts +17 -0
- package/dist/resources/inbox/inbox.js +56 -0
- package/dist/resources/inbox/index.d.ts +4 -0
- package/dist/resources/inbox/index.js +12 -0
- package/dist/resources/inbox/messages.d.ts +205 -0
- package/dist/resources/inbox/messages.js +40 -0
- package/dist/resources/inbox/reviews/index.d.ts +2 -0
- package/dist/resources/inbox/reviews/index.js +8 -0
- package/dist/resources/inbox/reviews/reply.d.ts +38 -0
- package/dist/resources/inbox/reviews/reply.js +21 -0
- package/dist/resources/inbox/reviews/reviews.d.ts +76 -0
- package/dist/resources/inbox/reviews/reviews.js +54 -0
- package/dist/resources/inbox/reviews.d.ts +1 -0
- package/dist/resources/inbox/reviews.js +18 -0
- package/dist/resources/inbox.d.ts +1 -0
- package/dist/resources/inbox.js +18 -0
- package/dist/resources/index.d.ts +16 -0
- package/dist/resources/index.js +36 -0
- package/dist/resources/media.d.ts +177 -0
- package/dist/resources/media.js +51 -0
- package/dist/resources/posts/index.d.ts +2 -0
- package/dist/resources/posts/index.js +8 -0
- package/dist/resources/posts/logs.d.ts +134 -0
- package/dist/resources/posts/logs.js +31 -0
- package/dist/resources/posts/posts.d.ts +607 -0
- package/dist/resources/posts/posts.js +149 -0
- package/dist/resources/posts.d.ts +1 -0
- package/dist/resources/posts.js +18 -0
- package/dist/resources/queue/index.d.ts +2 -0
- package/dist/resources/queue/index.js +8 -0
- package/dist/resources/queue/queue.d.ts +42 -0
- package/dist/resources/queue/queue.js +60 -0
- package/dist/resources/queue/slots.d.ts +215 -0
- package/dist/resources/queue/slots.js +36 -0
- package/dist/resources/queue.d.ts +1 -0
- package/dist/resources/queue.js +18 -0
- package/dist/resources/reddit.d.ts +186 -0
- package/dist/resources/reddit.js +20 -0
- package/dist/resources/tools/index.d.ts +3 -0
- package/dist/resources/tools/index.js +10 -0
- package/dist/resources/tools/instagram.d.ts +41 -0
- package/dist/resources/tools/instagram.js +22 -0
- package/dist/resources/tools/tools.d.ts +13 -0
- package/dist/resources/tools/tools.js +52 -0
- package/dist/resources/tools/validate.d.ts +689 -0
- package/dist/resources/tools/validate.js +63 -0
- package/dist/resources/tools.d.ts +1 -0
- package/dist/resources/tools.js +18 -0
- package/dist/resources/twitter/bookmark.d.ts +48 -0
- package/dist/resources/twitter/bookmark.js +20 -0
- package/dist/resources/twitter/follow.d.ts +48 -0
- package/dist/resources/twitter/follow.js +20 -0
- package/dist/resources/twitter/index.d.ts +4 -0
- package/dist/resources/twitter/index.js +12 -0
- package/dist/resources/twitter/retweet.d.ts +48 -0
- package/dist/resources/twitter/retweet.js +20 -0
- package/dist/resources/twitter/twitter.d.ts +17 -0
- package/dist/resources/twitter/twitter.js +56 -0
- package/dist/resources/twitter.d.ts +1 -0
- package/dist/resources/twitter.js +18 -0
- package/dist/resources/usage.d.ts +97 -0
- package/dist/resources/usage.js +14 -0
- package/dist/resources/webhooks.d.ts +205 -0
- package/dist/resources/webhooks.js +50 -0
- package/dist/resources/whatsapp/broadcasts.d.ts +291 -0
- package/dist/resources/whatsapp/broadcasts.js +49 -0
- package/dist/resources/whatsapp/business-profile.d.ts +85 -0
- package/dist/resources/whatsapp/business-profile.js +20 -0
- package/dist/resources/whatsapp/contacts.d.ts +250 -0
- package/dist/resources/whatsapp/contacts.js +49 -0
- package/dist/resources/whatsapp/groups.d.ts +87 -0
- package/dist/resources/whatsapp/groups.js +31 -0
- package/dist/resources/whatsapp/index.d.ts +6 -0
- package/dist/resources/whatsapp/index.js +16 -0
- package/dist/resources/whatsapp/templates.d.ts +250 -0
- package/dist/resources/whatsapp/templates.js +39 -0
- package/dist/resources/whatsapp/whatsapp.d.ts +148 -0
- package/dist/resources/whatsapp/whatsapp.js +76 -0
- package/dist/resources/whatsapp.d.ts +1 -0
- package/dist/resources/whatsapp.js +18 -0
- package/dist/resources.d.ts +1 -0
- package/dist/resources.js +17 -0
- package/dist/uploads.d.ts +2 -0
- package/dist/uploads.js +18 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/package.json +28 -0
- package/src/index.ts +22 -0
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource';
|
|
2
|
+
import * as LogsAPI from './logs';
|
|
3
|
+
import { LogListParams, LogListResponse, LogRetrieveResponse, Logs } from './logs';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
export declare class Posts extends APIResource {
|
|
7
|
+
logs: LogsAPI.Logs;
|
|
8
|
+
/**
|
|
9
|
+
* Create a post. Use scheduled_at: "now" to publish immediately, "draft" to save
|
|
10
|
+
* as draft, or an ISO timestamp to schedule.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const post = await client.posts.create({
|
|
15
|
+
* scheduled_at: 'now',
|
|
16
|
+
* targets: ['string'],
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(body: PostCreateParams, options?: RequestOptions): APIPromise<PostCreateResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Get a post
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const post = await client.posts.retrieve('id');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<PostRetrieveResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Update a draft or scheduled post.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const post = await client.posts.update('id');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
update(id: string, body?: PostUpdateParams | null | undefined, options?: RequestOptions): APIPromise<PostUpdateResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* List posts
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const posts = await client.posts.list();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
list(query?: PostListParams | null | undefined, options?: RequestOptions): APIPromise<PostListResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete a draft or scheduled post.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* await client.posts.delete('id');
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Create multiple posts in a single request. Each item follows the same schema as
|
|
59
|
+
* single post creation.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const response = await client.posts.bulkCreate({
|
|
64
|
+
* posts: [{ scheduled_at: 'now', targets: ['string'] }],
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
bulkCreate(body: PostBulkCreateParams, options?: RequestOptions): APIPromise<PostBulkCreateResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* Retry publishing for failed targets on a post.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const response = await client.posts.retry('id');
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
retry(id: string, options?: RequestOptions): APIPromise<PostRetryResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Attempt to delete the post from each platform and set the post status to
|
|
80
|
+
* cancelled.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const response = await client.posts.unpublish('id');
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
unpublish(id: string, options?: RequestOptions): APIPromise<PostUnpublishResponse>;
|
|
88
|
+
}
|
|
89
|
+
export interface PostCreateResponse {
|
|
90
|
+
/**
|
|
91
|
+
* Post ID
|
|
92
|
+
*/
|
|
93
|
+
id: string;
|
|
94
|
+
content: string | null;
|
|
95
|
+
created_at: string;
|
|
96
|
+
media: Array<PostCreateResponse.Media> | null;
|
|
97
|
+
scheduled_at: string | null;
|
|
98
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
99
|
+
/**
|
|
100
|
+
* Per-target results
|
|
101
|
+
*/
|
|
102
|
+
targets: {
|
|
103
|
+
[key: string]: PostCreateResponse.Targets;
|
|
104
|
+
};
|
|
105
|
+
updated_at: string;
|
|
106
|
+
}
|
|
107
|
+
export declare namespace PostCreateResponse {
|
|
108
|
+
interface Media {
|
|
109
|
+
/**
|
|
110
|
+
* Public URL of the media file
|
|
111
|
+
*/
|
|
112
|
+
url: string;
|
|
113
|
+
/**
|
|
114
|
+
* Media type. Inferred from URL extension if omitted.
|
|
115
|
+
*/
|
|
116
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
117
|
+
}
|
|
118
|
+
interface Targets {
|
|
119
|
+
platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
|
|
120
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed';
|
|
121
|
+
accounts?: Array<Targets.Account>;
|
|
122
|
+
error?: Targets.Error;
|
|
123
|
+
}
|
|
124
|
+
namespace Targets {
|
|
125
|
+
interface Account {
|
|
126
|
+
id: string;
|
|
127
|
+
/**
|
|
128
|
+
* Published post URL on the platform
|
|
129
|
+
*/
|
|
130
|
+
url: string | null;
|
|
131
|
+
username: string | null;
|
|
132
|
+
}
|
|
133
|
+
interface Error {
|
|
134
|
+
code: string;
|
|
135
|
+
message: string;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export interface PostRetrieveResponse {
|
|
140
|
+
/**
|
|
141
|
+
* Post ID
|
|
142
|
+
*/
|
|
143
|
+
id: string;
|
|
144
|
+
content: string | null;
|
|
145
|
+
created_at: string;
|
|
146
|
+
media: Array<PostRetrieveResponse.Media> | null;
|
|
147
|
+
scheduled_at: string | null;
|
|
148
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
149
|
+
/**
|
|
150
|
+
* Per-target results
|
|
151
|
+
*/
|
|
152
|
+
targets: {
|
|
153
|
+
[key: string]: PostRetrieveResponse.Targets;
|
|
154
|
+
};
|
|
155
|
+
updated_at: string;
|
|
156
|
+
}
|
|
157
|
+
export declare namespace PostRetrieveResponse {
|
|
158
|
+
interface Media {
|
|
159
|
+
/**
|
|
160
|
+
* Public URL of the media file
|
|
161
|
+
*/
|
|
162
|
+
url: string;
|
|
163
|
+
/**
|
|
164
|
+
* Media type. Inferred from URL extension if omitted.
|
|
165
|
+
*/
|
|
166
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
167
|
+
}
|
|
168
|
+
interface Targets {
|
|
169
|
+
platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
|
|
170
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed';
|
|
171
|
+
accounts?: Array<Targets.Account>;
|
|
172
|
+
error?: Targets.Error;
|
|
173
|
+
}
|
|
174
|
+
namespace Targets {
|
|
175
|
+
interface Account {
|
|
176
|
+
id: string;
|
|
177
|
+
/**
|
|
178
|
+
* Published post URL on the platform
|
|
179
|
+
*/
|
|
180
|
+
url: string | null;
|
|
181
|
+
username: string | null;
|
|
182
|
+
}
|
|
183
|
+
interface Error {
|
|
184
|
+
code: string;
|
|
185
|
+
message: string;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
export interface PostUpdateResponse {
|
|
190
|
+
/**
|
|
191
|
+
* Post ID
|
|
192
|
+
*/
|
|
193
|
+
id: string;
|
|
194
|
+
content: string | null;
|
|
195
|
+
created_at: string;
|
|
196
|
+
media: Array<PostUpdateResponse.Media> | null;
|
|
197
|
+
scheduled_at: string | null;
|
|
198
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
199
|
+
/**
|
|
200
|
+
* Per-target results
|
|
201
|
+
*/
|
|
202
|
+
targets: {
|
|
203
|
+
[key: string]: PostUpdateResponse.Targets;
|
|
204
|
+
};
|
|
205
|
+
updated_at: string;
|
|
206
|
+
}
|
|
207
|
+
export declare namespace PostUpdateResponse {
|
|
208
|
+
interface Media {
|
|
209
|
+
/**
|
|
210
|
+
* Public URL of the media file
|
|
211
|
+
*/
|
|
212
|
+
url: string;
|
|
213
|
+
/**
|
|
214
|
+
* Media type. Inferred from URL extension if omitted.
|
|
215
|
+
*/
|
|
216
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
217
|
+
}
|
|
218
|
+
interface Targets {
|
|
219
|
+
platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
|
|
220
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed';
|
|
221
|
+
accounts?: Array<Targets.Account>;
|
|
222
|
+
error?: Targets.Error;
|
|
223
|
+
}
|
|
224
|
+
namespace Targets {
|
|
225
|
+
interface Account {
|
|
226
|
+
id: string;
|
|
227
|
+
/**
|
|
228
|
+
* Published post URL on the platform
|
|
229
|
+
*/
|
|
230
|
+
url: string | null;
|
|
231
|
+
username: string | null;
|
|
232
|
+
}
|
|
233
|
+
interface Error {
|
|
234
|
+
code: string;
|
|
235
|
+
message: string;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export interface PostListResponse {
|
|
240
|
+
data: Array<PostListResponse.Data>;
|
|
241
|
+
/**
|
|
242
|
+
* Whether more items exist
|
|
243
|
+
*/
|
|
244
|
+
has_more: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Cursor for next page
|
|
247
|
+
*/
|
|
248
|
+
next_cursor: string | null;
|
|
249
|
+
}
|
|
250
|
+
export declare namespace PostListResponse {
|
|
251
|
+
interface Data {
|
|
252
|
+
/**
|
|
253
|
+
* Post ID
|
|
254
|
+
*/
|
|
255
|
+
id: string;
|
|
256
|
+
content: string | null;
|
|
257
|
+
created_at: string;
|
|
258
|
+
media: Array<Data.Media> | null;
|
|
259
|
+
scheduled_at: string | null;
|
|
260
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
261
|
+
/**
|
|
262
|
+
* Per-target results
|
|
263
|
+
*/
|
|
264
|
+
targets: {
|
|
265
|
+
[key: string]: Data.Targets;
|
|
266
|
+
};
|
|
267
|
+
updated_at: string;
|
|
268
|
+
}
|
|
269
|
+
namespace Data {
|
|
270
|
+
interface Media {
|
|
271
|
+
/**
|
|
272
|
+
* Public URL of the media file
|
|
273
|
+
*/
|
|
274
|
+
url: string;
|
|
275
|
+
/**
|
|
276
|
+
* Media type. Inferred from URL extension if omitted.
|
|
277
|
+
*/
|
|
278
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
279
|
+
}
|
|
280
|
+
interface Targets {
|
|
281
|
+
platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
|
|
282
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed';
|
|
283
|
+
accounts?: Array<Targets.Account>;
|
|
284
|
+
error?: Targets.Error;
|
|
285
|
+
}
|
|
286
|
+
namespace Targets {
|
|
287
|
+
interface Account {
|
|
288
|
+
id: string;
|
|
289
|
+
/**
|
|
290
|
+
* Published post URL on the platform
|
|
291
|
+
*/
|
|
292
|
+
url: string | null;
|
|
293
|
+
username: string | null;
|
|
294
|
+
}
|
|
295
|
+
interface Error {
|
|
296
|
+
code: string;
|
|
297
|
+
message: string;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
export interface PostBulkCreateResponse {
|
|
303
|
+
data: Array<PostBulkCreateResponse.Data>;
|
|
304
|
+
summary: PostBulkCreateResponse.Summary;
|
|
305
|
+
}
|
|
306
|
+
export declare namespace PostBulkCreateResponse {
|
|
307
|
+
interface Data {
|
|
308
|
+
/**
|
|
309
|
+
* Post ID
|
|
310
|
+
*/
|
|
311
|
+
id: string;
|
|
312
|
+
content: string | null;
|
|
313
|
+
created_at: string;
|
|
314
|
+
media: Array<Data.Media> | null;
|
|
315
|
+
scheduled_at: string | null;
|
|
316
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
317
|
+
/**
|
|
318
|
+
* Per-target results
|
|
319
|
+
*/
|
|
320
|
+
targets: {
|
|
321
|
+
[key: string]: Data.Targets;
|
|
322
|
+
};
|
|
323
|
+
updated_at: string;
|
|
324
|
+
}
|
|
325
|
+
namespace Data {
|
|
326
|
+
interface Media {
|
|
327
|
+
/**
|
|
328
|
+
* Public URL of the media file
|
|
329
|
+
*/
|
|
330
|
+
url: string;
|
|
331
|
+
/**
|
|
332
|
+
* Media type. Inferred from URL extension if omitted.
|
|
333
|
+
*/
|
|
334
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
335
|
+
}
|
|
336
|
+
interface Targets {
|
|
337
|
+
platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
|
|
338
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed';
|
|
339
|
+
accounts?: Array<Targets.Account>;
|
|
340
|
+
error?: Targets.Error;
|
|
341
|
+
}
|
|
342
|
+
namespace Targets {
|
|
343
|
+
interface Account {
|
|
344
|
+
id: string;
|
|
345
|
+
/**
|
|
346
|
+
* Published post URL on the platform
|
|
347
|
+
*/
|
|
348
|
+
url: string | null;
|
|
349
|
+
username: string | null;
|
|
350
|
+
}
|
|
351
|
+
interface Error {
|
|
352
|
+
code: string;
|
|
353
|
+
message: string;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
interface Summary {
|
|
358
|
+
failed: number;
|
|
359
|
+
succeeded: number;
|
|
360
|
+
total: number;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
export interface PostRetryResponse {
|
|
364
|
+
/**
|
|
365
|
+
* Post ID
|
|
366
|
+
*/
|
|
367
|
+
id: string;
|
|
368
|
+
content: string | null;
|
|
369
|
+
created_at: string;
|
|
370
|
+
media: Array<PostRetryResponse.Media> | null;
|
|
371
|
+
scheduled_at: string | null;
|
|
372
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
373
|
+
/**
|
|
374
|
+
* Per-target results
|
|
375
|
+
*/
|
|
376
|
+
targets: {
|
|
377
|
+
[key: string]: PostRetryResponse.Targets;
|
|
378
|
+
};
|
|
379
|
+
updated_at: string;
|
|
380
|
+
}
|
|
381
|
+
export declare namespace PostRetryResponse {
|
|
382
|
+
interface Media {
|
|
383
|
+
/**
|
|
384
|
+
* Public URL of the media file
|
|
385
|
+
*/
|
|
386
|
+
url: string;
|
|
387
|
+
/**
|
|
388
|
+
* Media type. Inferred from URL extension if omitted.
|
|
389
|
+
*/
|
|
390
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
391
|
+
}
|
|
392
|
+
interface Targets {
|
|
393
|
+
platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
|
|
394
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed';
|
|
395
|
+
accounts?: Array<Targets.Account>;
|
|
396
|
+
error?: Targets.Error;
|
|
397
|
+
}
|
|
398
|
+
namespace Targets {
|
|
399
|
+
interface Account {
|
|
400
|
+
id: string;
|
|
401
|
+
/**
|
|
402
|
+
* Published post URL on the platform
|
|
403
|
+
*/
|
|
404
|
+
url: string | null;
|
|
405
|
+
username: string | null;
|
|
406
|
+
}
|
|
407
|
+
interface Error {
|
|
408
|
+
code: string;
|
|
409
|
+
message: string;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
export interface PostUnpublishResponse {
|
|
414
|
+
/**
|
|
415
|
+
* Post ID
|
|
416
|
+
*/
|
|
417
|
+
id: string;
|
|
418
|
+
content: string | null;
|
|
419
|
+
created_at: string;
|
|
420
|
+
media: Array<PostUnpublishResponse.Media> | null;
|
|
421
|
+
scheduled_at: string | null;
|
|
422
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
423
|
+
/**
|
|
424
|
+
* Per-target results
|
|
425
|
+
*/
|
|
426
|
+
targets: {
|
|
427
|
+
[key: string]: PostUnpublishResponse.Targets;
|
|
428
|
+
};
|
|
429
|
+
updated_at: string;
|
|
430
|
+
}
|
|
431
|
+
export declare namespace PostUnpublishResponse {
|
|
432
|
+
interface Media {
|
|
433
|
+
/**
|
|
434
|
+
* Public URL of the media file
|
|
435
|
+
*/
|
|
436
|
+
url: string;
|
|
437
|
+
/**
|
|
438
|
+
* Media type. Inferred from URL extension if omitted.
|
|
439
|
+
*/
|
|
440
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
441
|
+
}
|
|
442
|
+
interface Targets {
|
|
443
|
+
platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
|
|
444
|
+
status: 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed';
|
|
445
|
+
accounts?: Array<Targets.Account>;
|
|
446
|
+
error?: Targets.Error;
|
|
447
|
+
}
|
|
448
|
+
namespace Targets {
|
|
449
|
+
interface Account {
|
|
450
|
+
id: string;
|
|
451
|
+
/**
|
|
452
|
+
* Published post URL on the platform
|
|
453
|
+
*/
|
|
454
|
+
url: string | null;
|
|
455
|
+
username: string | null;
|
|
456
|
+
}
|
|
457
|
+
interface Error {
|
|
458
|
+
code: string;
|
|
459
|
+
message: string;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
export interface PostCreateParams {
|
|
464
|
+
/**
|
|
465
|
+
* Publish intent. Use "now" to publish immediately, "draft" to save as draft, or
|
|
466
|
+
* an ISO 8601 timestamp to schedule.
|
|
467
|
+
*/
|
|
468
|
+
scheduled_at: string;
|
|
469
|
+
/**
|
|
470
|
+
* Account IDs or platform names to publish to
|
|
471
|
+
*/
|
|
472
|
+
targets: Array<string>;
|
|
473
|
+
/**
|
|
474
|
+
* Post text. Optional if target_options provide per-target content.
|
|
475
|
+
*/
|
|
476
|
+
content?: string;
|
|
477
|
+
/**
|
|
478
|
+
* Media attachments
|
|
479
|
+
*/
|
|
480
|
+
media?: Array<PostCreateParams.Media>;
|
|
481
|
+
/**
|
|
482
|
+
* Per-target customizations keyed by target value (account ID or platform name)
|
|
483
|
+
*/
|
|
484
|
+
target_options?: {
|
|
485
|
+
[key: string]: {
|
|
486
|
+
[key: string]: unknown;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
/**
|
|
490
|
+
* IANA timezone for scheduling
|
|
491
|
+
*/
|
|
492
|
+
timezone?: string;
|
|
493
|
+
}
|
|
494
|
+
export declare namespace PostCreateParams {
|
|
495
|
+
interface Media {
|
|
496
|
+
/**
|
|
497
|
+
* Public URL of the media file
|
|
498
|
+
*/
|
|
499
|
+
url: string;
|
|
500
|
+
/**
|
|
501
|
+
* Media type. Inferred from URL extension if omitted.
|
|
502
|
+
*/
|
|
503
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
export interface PostUpdateParams {
|
|
507
|
+
/**
|
|
508
|
+
* Post text
|
|
509
|
+
*/
|
|
510
|
+
content?: string;
|
|
511
|
+
/**
|
|
512
|
+
* Updated media
|
|
513
|
+
*/
|
|
514
|
+
media?: Array<PostUpdateParams.Media>;
|
|
515
|
+
/**
|
|
516
|
+
* Publish intent. Use "now" to publish immediately, "draft" to save as draft, or
|
|
517
|
+
* an ISO 8601 timestamp to schedule.
|
|
518
|
+
*/
|
|
519
|
+
scheduled_at?: string;
|
|
520
|
+
target_options?: {
|
|
521
|
+
[key: string]: {
|
|
522
|
+
[key: string]: unknown;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Updated targets
|
|
527
|
+
*/
|
|
528
|
+
targets?: Array<string>;
|
|
529
|
+
timezone?: string;
|
|
530
|
+
}
|
|
531
|
+
export declare namespace PostUpdateParams {
|
|
532
|
+
interface Media {
|
|
533
|
+
/**
|
|
534
|
+
* Public URL of the media file
|
|
535
|
+
*/
|
|
536
|
+
url: string;
|
|
537
|
+
/**
|
|
538
|
+
* Media type. Inferred from URL extension if omitted.
|
|
539
|
+
*/
|
|
540
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
export interface PostListParams {
|
|
544
|
+
/**
|
|
545
|
+
* Pagination cursor
|
|
546
|
+
*/
|
|
547
|
+
cursor?: string;
|
|
548
|
+
/**
|
|
549
|
+
* Number of items per page
|
|
550
|
+
*/
|
|
551
|
+
limit?: number;
|
|
552
|
+
}
|
|
553
|
+
export interface PostBulkCreateParams {
|
|
554
|
+
/**
|
|
555
|
+
* Array of posts to create (max 50)
|
|
556
|
+
*/
|
|
557
|
+
posts: Array<PostBulkCreateParams.Post>;
|
|
558
|
+
}
|
|
559
|
+
export declare namespace PostBulkCreateParams {
|
|
560
|
+
interface Post {
|
|
561
|
+
/**
|
|
562
|
+
* Publish intent. Use "now" to publish immediately, "draft" to save as draft, or
|
|
563
|
+
* an ISO 8601 timestamp to schedule.
|
|
564
|
+
*/
|
|
565
|
+
scheduled_at: string;
|
|
566
|
+
/**
|
|
567
|
+
* Account IDs or platform names to publish to
|
|
568
|
+
*/
|
|
569
|
+
targets: Array<string>;
|
|
570
|
+
/**
|
|
571
|
+
* Post text. Optional if target_options provide per-target content.
|
|
572
|
+
*/
|
|
573
|
+
content?: string;
|
|
574
|
+
/**
|
|
575
|
+
* Media attachments
|
|
576
|
+
*/
|
|
577
|
+
media?: Array<Post.Media>;
|
|
578
|
+
/**
|
|
579
|
+
* Per-target customizations keyed by target value (account ID or platform name)
|
|
580
|
+
*/
|
|
581
|
+
target_options?: {
|
|
582
|
+
[key: string]: {
|
|
583
|
+
[key: string]: unknown;
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* IANA timezone for scheduling
|
|
588
|
+
*/
|
|
589
|
+
timezone?: string;
|
|
590
|
+
}
|
|
591
|
+
namespace Post {
|
|
592
|
+
interface Media {
|
|
593
|
+
/**
|
|
594
|
+
* Public URL of the media file
|
|
595
|
+
*/
|
|
596
|
+
url: string;
|
|
597
|
+
/**
|
|
598
|
+
* Media type. Inferred from URL extension if omitted.
|
|
599
|
+
*/
|
|
600
|
+
type?: 'image' | 'video' | 'gif' | 'document';
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
export declare namespace Posts {
|
|
605
|
+
export { type PostCreateResponse as PostCreateResponse, type PostRetrieveResponse as PostRetrieveResponse, type PostUpdateResponse as PostUpdateResponse, type PostListResponse as PostListResponse, type PostBulkCreateResponse as PostBulkCreateResponse, type PostRetryResponse as PostRetryResponse, type PostUnpublishResponse as PostUnpublishResponse, type PostCreateParams as PostCreateParams, type PostUpdateParams as PostUpdateParams, type PostListParams as PostListParams, type PostBulkCreateParams as PostBulkCreateParams, };
|
|
606
|
+
export { Logs as Logs, type LogRetrieveResponse as LogRetrieveResponse, type LogListResponse as LogListResponse, type LogListParams as LogListParams, };
|
|
607
|
+
}
|