@widecast/sdk 0.1.0
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 +21 -0
- package/LICENSE +190 -0
- package/README.md +94 -0
- package/dist/index.cjs +849 -0
- package/dist/index.d.cts +448 -0
- package/dist/index.d.ts +448 -0
- package/dist/index.js +788 -0
- package/package.json +55 -0
- package/src/index.ts +1109 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WideCast.ai TypeScript / JavaScript SDK — thin client for the public API.
|
|
3
|
+
*
|
|
4
|
+
* Works in Node 18+, Deno, Bun, browsers — uses the global `fetch`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* import Widecast from "@widecast/sdk";
|
|
8
|
+
* const client = new Widecast({ apiKey: "wc_live_REPLACE_ME" });
|
|
9
|
+
* const video = await client.create_video({ script }).then(v => v.wait());
|
|
10
|
+
* console.log(video.review_url);
|
|
11
|
+
*/
|
|
12
|
+
declare const VERSION = "0.1.0";
|
|
13
|
+
declare const SCRIPT_MIN_WORDS = 80;
|
|
14
|
+
declare const SCRIPT_MAX_WORDS = 500;
|
|
15
|
+
declare const IDEA_MIN_WORDS = 5;
|
|
16
|
+
declare const IDEA_MAX_WORDS = 1000;
|
|
17
|
+
declare const BLOG_MIN_WORDS = 30;
|
|
18
|
+
declare const BLOG_MAX_WORDS = 3000;
|
|
19
|
+
declare const OUTPUT_TYPES: readonly ["text", "scene", "video"];
|
|
20
|
+
type OutputType = (typeof OUTPUT_TYPES)[number];
|
|
21
|
+
declare const SOURCES: readonly ["text", "idea", "blog", "video_url", "video_file", "audio_url", "audio_file"];
|
|
22
|
+
type Source = (typeof SOURCES)[number];
|
|
23
|
+
declare const FACELESS_SOURCES: readonly ["text", "idea", "blog"];
|
|
24
|
+
declare const CONTENT_TYPES: readonly ["blog", "facebook", "x", "linkedin"];
|
|
25
|
+
type ContentType = (typeof CONTENT_TYPES)[number];
|
|
26
|
+
declare const INTERVENTION_LEVELS: readonly [0, 1, 2];
|
|
27
|
+
type InterventionLevel = (typeof INTERVENTION_LEVELS)[number];
|
|
28
|
+
declare const PUBLISH_PLATFORMS: readonly ["youtube", "tiktok", "instagram", "facebook", "linkedin", "x", "threads", "pinterest", "reddit", "bluesky", "google_business"];
|
|
29
|
+
type PublishPlatform = (typeof PUBLISH_PLATFORMS)[number];
|
|
30
|
+
/** Options for client.create_content(). */
|
|
31
|
+
interface CreateContentOptions {
|
|
32
|
+
/** A URL, an idea/topic, or pasted text the content is created from. */
|
|
33
|
+
content: string;
|
|
34
|
+
/** "blog" (default) / "facebook" / "x" / "linkedin". */
|
|
35
|
+
content_type?: ContentType;
|
|
36
|
+
/** Output language (e.g. "English"). Default "English". */
|
|
37
|
+
language?: string;
|
|
38
|
+
callback_url?: string;
|
|
39
|
+
metadata?: Record<string, unknown>;
|
|
40
|
+
idempotency_key?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Options for client.enhance_script(). */
|
|
43
|
+
interface EnhanceScriptOptions {
|
|
44
|
+
/** The DRAFT script to enhance. */
|
|
45
|
+
script_text: string;
|
|
46
|
+
/** Output language; "" (default) keeps the draft's original language. */
|
|
47
|
+
language?: string;
|
|
48
|
+
/** 0=segment only, 1=natural enhance (default), 2=maximum rewrite. */
|
|
49
|
+
intervention_level?: InterventionLevel;
|
|
50
|
+
callback_url?: string;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
idempotency_key?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Options for client.suggest_ideas(). */
|
|
55
|
+
interface SuggestIdeasOptions {
|
|
56
|
+
/** Industry name (e.g. "Real Estate"). Falls back to your account industry if omitted. */
|
|
57
|
+
industry_id?: string;
|
|
58
|
+
/** How many ideas (1–20, default 5). */
|
|
59
|
+
num_topics?: number;
|
|
60
|
+
sub_industry?: string;
|
|
61
|
+
user_location?: string;
|
|
62
|
+
idempotency_key?: string;
|
|
63
|
+
}
|
|
64
|
+
/** Options for client.collect_ideas(). */
|
|
65
|
+
interface CollectIdeasOptions {
|
|
66
|
+
/** Product/service description (≥10 chars) to brainstorm ideas from. */
|
|
67
|
+
product_service_input: string;
|
|
68
|
+
sub_industry?: string;
|
|
69
|
+
user_location?: string;
|
|
70
|
+
idempotency_key?: string;
|
|
71
|
+
}
|
|
72
|
+
/** Options for client.publish(). Provide EXACTLY ONE of topic_id / text / video_url. */
|
|
73
|
+
interface PublishOptions {
|
|
74
|
+
/** Publish an existing WideCast video OR blog/social post (auto-detected). */
|
|
75
|
+
topic_id?: string;
|
|
76
|
+
/** Post arbitrary text (optionally with photo_urls). */
|
|
77
|
+
text?: string;
|
|
78
|
+
/** A direct video file URL to download + publish. Requires `title`. */
|
|
79
|
+
video_url?: string;
|
|
80
|
+
/** Caption/title. Required for video_url; optional override for topic_id. */
|
|
81
|
+
title?: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
/** Image URLs to attach (with `text`). */
|
|
84
|
+
photo_urls?: string[];
|
|
85
|
+
/** Target platforms. Defaults to ALL connected platforms. */
|
|
86
|
+
platforms?: PublishPlatform[];
|
|
87
|
+
scheduled_date?: string;
|
|
88
|
+
timezone?: string;
|
|
89
|
+
callback_url?: string;
|
|
90
|
+
metadata?: Record<string, unknown>;
|
|
91
|
+
idempotency_key?: string;
|
|
92
|
+
}
|
|
93
|
+
/** Accepted-publish envelope (HTTP 202) returned by client.publish(). */
|
|
94
|
+
interface PublishResponse {
|
|
95
|
+
object: string;
|
|
96
|
+
/** Primary upstream request_id — poll get_status(id). */
|
|
97
|
+
id: string;
|
|
98
|
+
/** All upstream request_ids (article spanning text+photo may return two). */
|
|
99
|
+
request_ids: string[];
|
|
100
|
+
status: "processing";
|
|
101
|
+
platforms: string[];
|
|
102
|
+
skipped?: string[];
|
|
103
|
+
metadata?: Record<string, unknown>;
|
|
104
|
+
links?: {
|
|
105
|
+
status?: string;
|
|
106
|
+
};
|
|
107
|
+
meta?: {
|
|
108
|
+
request_id?: string;
|
|
109
|
+
widecast_version?: string;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/** One idea in an IdeasResponse. */
|
|
113
|
+
interface Idea {
|
|
114
|
+
title: string;
|
|
115
|
+
description: string;
|
|
116
|
+
industry?: string;
|
|
117
|
+
audience?: string;
|
|
118
|
+
professional?: string;
|
|
119
|
+
level?: string;
|
|
120
|
+
}
|
|
121
|
+
/** Synchronous response of suggest_ideas / collect_ideas. */
|
|
122
|
+
interface IdeasResponse {
|
|
123
|
+
object: string;
|
|
124
|
+
industry?: string;
|
|
125
|
+
ideas: Idea[];
|
|
126
|
+
}
|
|
127
|
+
declare const MEDIA_SOURCES: {
|
|
128
|
+
readonly video_url: {
|
|
129
|
+
readonly media_type: "video";
|
|
130
|
+
readonly input_kind: "url";
|
|
131
|
+
readonly field: "video_url";
|
|
132
|
+
};
|
|
133
|
+
readonly video_file: {
|
|
134
|
+
readonly media_type: "video";
|
|
135
|
+
readonly input_kind: "file";
|
|
136
|
+
readonly field: "video_file";
|
|
137
|
+
};
|
|
138
|
+
readonly audio_url: {
|
|
139
|
+
readonly media_type: "audio";
|
|
140
|
+
readonly input_kind: "url";
|
|
141
|
+
readonly field: "audio_url";
|
|
142
|
+
};
|
|
143
|
+
readonly audio_file: {
|
|
144
|
+
readonly media_type: "audio";
|
|
145
|
+
readonly input_kind: "file";
|
|
146
|
+
readonly field: "audio_file";
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
declare const MEDIA_MAX_DURATION_SECONDS = 120;
|
|
150
|
+
declare const MEDIA_MAX_FILE_BYTES: number;
|
|
151
|
+
declare const VIDEO_LENGTHS: readonly ["short", "normal"];
|
|
152
|
+
type VideoLength = (typeof VIDEO_LENGTHS)[number];
|
|
153
|
+
declare const LANGUAGES: readonly ["English", "Vietnamese"];
|
|
154
|
+
type Language = (typeof LANGUAGES)[number];
|
|
155
|
+
type VideoStatus = "pending" | "processing" | "completed" | "failed";
|
|
156
|
+
type ErrorCode = "account_expired" | "credit_exhausted" | "render_failed" | "unknown_error" | "scenes_not_ready" | "export_failed" | "script_too_short" | "script_too_long" | "invalid_output_type";
|
|
157
|
+
interface StatusResult {
|
|
158
|
+
review_url: string;
|
|
159
|
+
/** Direct MP4 URL. Present only when output_type="video" OR after
|
|
160
|
+
* /v1/export_video completes. */
|
|
161
|
+
video_url?: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Fine-grained worker state surfaced from the legacy row.
|
|
165
|
+
* ⚠ DELIBERATE NAME CLASH: `details.status` is a free-form legacy string
|
|
166
|
+
* (e.g. "Completed", "Avatar videos downloaded"), DISTINCT from the
|
|
167
|
+
* top-level `status` enum. Gate logic on the top-level field only.
|
|
168
|
+
*/
|
|
169
|
+
interface ProcessingDetails {
|
|
170
|
+
step: number;
|
|
171
|
+
status: string;
|
|
172
|
+
notes: string;
|
|
173
|
+
updated_at?: string;
|
|
174
|
+
}
|
|
175
|
+
interface StatusError {
|
|
176
|
+
code: ErrorCode | string;
|
|
177
|
+
message: string;
|
|
178
|
+
}
|
|
179
|
+
interface VideoResource {
|
|
180
|
+
object: "status";
|
|
181
|
+
id: string;
|
|
182
|
+
topic_id: string;
|
|
183
|
+
type: "video";
|
|
184
|
+
status: VideoStatus;
|
|
185
|
+
stage: string;
|
|
186
|
+
progress: number;
|
|
187
|
+
details: ProcessingDetails | null;
|
|
188
|
+
result: StatusResult | null;
|
|
189
|
+
error: StatusError | null;
|
|
190
|
+
callback_url?: string | null;
|
|
191
|
+
metadata: Record<string, unknown>;
|
|
192
|
+
usage: Record<string, unknown> | null;
|
|
193
|
+
links: {
|
|
194
|
+
self: string;
|
|
195
|
+
};
|
|
196
|
+
meta: {
|
|
197
|
+
request_id: string;
|
|
198
|
+
widecast_version: string;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
interface CreateVideoOptions {
|
|
202
|
+
/** Input flow: "text" (default — backward-compat) requires `script_text`;
|
|
203
|
+
* "idea" requires `idea_text` (+ optional language / video_length /
|
|
204
|
+
* research_enabled). */
|
|
205
|
+
source?: Source;
|
|
206
|
+
/** Plain text script — required when `source="text"`. Used VERBATIM by the
|
|
207
|
+
* narrator (no AI rewriting). Must be `SCRIPT_MIN_WORDS`–`SCRIPT_MAX_WORDS`
|
|
208
|
+
* words (80–500, ~20s–2min). Word count = whitespace split.
|
|
209
|
+
* May contain inline image/video file URLs in either form:
|
|
210
|
+
* - Markdown image syntax (recommended for AI-chat callers; chat hosts
|
|
211
|
+
* render the picture inline so the end-user can visually approve each
|
|
212
|
+
* scene): ``.
|
|
213
|
+
* - Raw URL on its own line (backward compat): `… https://… …`.
|
|
214
|
+
* Direct file links only — .png/.jpg/.jpeg/.gif/.webp/.bmp/.avif/.svg or
|
|
215
|
+
* .mp4/.webm/.mov/.m4v/.avi (optional ?query). WideCast strips both forms
|
|
216
|
+
* from the narration and uses them as that scene's visual instead of
|
|
217
|
+
* auto-sourced B-roll. Page links (e.g. youtube.com/watch) are NOT
|
|
218
|
+
* inlined; use `source="video_url"` for a whole clip. */
|
|
219
|
+
script_text?: string;
|
|
220
|
+
/** Short idea description — required when `source="idea"`. Server writes
|
|
221
|
+
* a narration from this (AI) then continues into scene-sourcing. Bounds:
|
|
222
|
+
* `IDEA_MIN_WORDS` (5) min, `IDEA_MAX_WORDS` (1000) max — over-max is
|
|
223
|
+
* auto-truncated server-side, NOT rejected. Original word count surfaces
|
|
224
|
+
* in `details.input_truncated_from`. */
|
|
225
|
+
idea_text?: string;
|
|
226
|
+
/** Blog/article to repurpose — required when `source="blog"`. Same AI
|
|
227
|
+
* script-writer + pipeline as idea, just a longer input. Bounds:
|
|
228
|
+
* `BLOG_MIN_WORDS` (30) min, `BLOG_MAX_WORDS` (3000) max — over-max
|
|
229
|
+
* auto-truncated, surfaced in `details.input_truncated_from`. */
|
|
230
|
+
blog_text?: string;
|
|
231
|
+
/** Media URL (YouTube/TikTok/Facebook) — required when source="video_url" /
|
|
232
|
+
* "audio_url" (A49). The media's own audio becomes the narration / footage
|
|
233
|
+
* becomes b-roll. */
|
|
234
|
+
video_url?: string;
|
|
235
|
+
audio_url?: string;
|
|
236
|
+
/** Media file to upload — required when source="video_file" / "audio_file"
|
|
237
|
+
* (A49). Sent as multipart/form-data. Pass a Blob/File (in Node 18+ build one
|
|
238
|
+
* with `new Blob([buffer])` or `await openAsBlob(path)`). */
|
|
239
|
+
video_file?: Blob;
|
|
240
|
+
audio_file?: Blob;
|
|
241
|
+
/** Narration language (generative sources only). Default "English". Locked
|
|
242
|
+
* enum v0.1.0: see `LANGUAGES`. */
|
|
243
|
+
language?: Language;
|
|
244
|
+
/** Target video length (generative sources only). Default "short". "normal"
|
|
245
|
+
* caps at ~3 min. See `VIDEO_LENGTHS`. */
|
|
246
|
+
video_length?: VideoLength;
|
|
247
|
+
/** Whether the AI does research / fact-check during narration generation
|
|
248
|
+
* (generative sources only). Default true. */
|
|
249
|
+
research_enabled?: boolean;
|
|
250
|
+
/** Pipeline depth. "text" stops after the source→script phase (review_url →
|
|
251
|
+
* Script Editor; generative sources only, NOT source="text"). "scene"
|
|
252
|
+
* (default) stops at scenes-ready-for-review. "video" auto-chains into the
|
|
253
|
+
* renderer for the final MP4. */
|
|
254
|
+
output_type?: OutputType;
|
|
255
|
+
/** If true, every scene is B-roll (no narrator A-roll anywhere) — a
|
|
256
|
+
* "faceless" video. Default false (scenes mix A-roll + B-roll). Only valid
|
|
257
|
+
* with output_type scene/video for sources text/idea/blog (FACELESS_SOURCES);
|
|
258
|
+
* otherwise the server returns invalid_faceless. */
|
|
259
|
+
faceless?: boolean;
|
|
260
|
+
/** Extra direct image/video URLs you couldn't confidently place inline →
|
|
261
|
+
* added to the first scene's media library so the scene editor lists them
|
|
262
|
+
* for the user to drop into any scene. Direct file links only. */
|
|
263
|
+
media_pool?: string[];
|
|
264
|
+
wait_for_render?: boolean;
|
|
265
|
+
callback_url?: string;
|
|
266
|
+
metadata?: Record<string, unknown>;
|
|
267
|
+
idempotency_key?: string;
|
|
268
|
+
}
|
|
269
|
+
interface WidecastConfig {
|
|
270
|
+
apiKey?: string;
|
|
271
|
+
baseUrl?: string;
|
|
272
|
+
timeoutMs?: number;
|
|
273
|
+
maxRetries?: number;
|
|
274
|
+
userAgent?: string;
|
|
275
|
+
fetchImpl?: typeof fetch;
|
|
276
|
+
}
|
|
277
|
+
interface WaitOptions {
|
|
278
|
+
timeoutMs?: number;
|
|
279
|
+
initialIntervalMs?: number;
|
|
280
|
+
maxIntervalMs?: number;
|
|
281
|
+
backoffMultiplier?: number;
|
|
282
|
+
}
|
|
283
|
+
declare class WidecastError extends Error {
|
|
284
|
+
code: string;
|
|
285
|
+
requestId: string;
|
|
286
|
+
status: number;
|
|
287
|
+
docUrl: string;
|
|
288
|
+
param?: string;
|
|
289
|
+
responseJson: unknown;
|
|
290
|
+
constructor(message: string, opts?: Partial<{
|
|
291
|
+
code: string;
|
|
292
|
+
requestId: string;
|
|
293
|
+
status: number;
|
|
294
|
+
docUrl: string;
|
|
295
|
+
param: string;
|
|
296
|
+
responseJson: unknown;
|
|
297
|
+
}>);
|
|
298
|
+
}
|
|
299
|
+
declare class InvalidRequestError extends WidecastError {
|
|
300
|
+
constructor(m: string, o?: {});
|
|
301
|
+
}
|
|
302
|
+
declare class NotFoundError extends WidecastError {
|
|
303
|
+
constructor(m: string, o?: {});
|
|
304
|
+
}
|
|
305
|
+
declare class PreconditionFailedError extends WidecastError {
|
|
306
|
+
constructor(m: string, o?: {});
|
|
307
|
+
}
|
|
308
|
+
declare class RateLimitError extends WidecastError {
|
|
309
|
+
constructor(m: string, o?: {});
|
|
310
|
+
}
|
|
311
|
+
declare class APIError extends WidecastError {
|
|
312
|
+
constructor(m: string, o?: {});
|
|
313
|
+
}
|
|
314
|
+
declare class Video implements VideoResource {
|
|
315
|
+
#private;
|
|
316
|
+
object: "status";
|
|
317
|
+
id: string;
|
|
318
|
+
topic_id: string;
|
|
319
|
+
type: "video";
|
|
320
|
+
status: VideoStatus;
|
|
321
|
+
stage: string;
|
|
322
|
+
progress: number;
|
|
323
|
+
details: ProcessingDetails | null;
|
|
324
|
+
result: StatusResult | null;
|
|
325
|
+
error: StatusError | null;
|
|
326
|
+
callback_url?: string | null;
|
|
327
|
+
metadata: Record<string, unknown>;
|
|
328
|
+
usage: Record<string, unknown> | null;
|
|
329
|
+
links: {
|
|
330
|
+
self: string;
|
|
331
|
+
};
|
|
332
|
+
meta: VideoResource["meta"];
|
|
333
|
+
constructor(data: VideoResource, client: Widecast);
|
|
334
|
+
get isTerminal(): boolean;
|
|
335
|
+
/** URL where the user reviews the rendered scenes + audio. Present from the
|
|
336
|
+
* first response (pending / processing / completed) — the review page
|
|
337
|
+
* handles early arrival itself (spinner + in-page polling), so this is
|
|
338
|
+
* safe to share with the user before status='completed'. */
|
|
339
|
+
get review_url(): string | null;
|
|
340
|
+
/** Direct MP4 URL — present only when status='completed' AND the video was
|
|
341
|
+
* created with output_type='video' (or exported via client.export_video). */
|
|
342
|
+
get video_url(): string | null;
|
|
343
|
+
/** Poll /v1/status until terminal or timeout.
|
|
344
|
+
* Default: fixed 5-second polling (no backoff). Override kwargs for
|
|
345
|
+
* long-running polls where backoff is preferred. */
|
|
346
|
+
wait(opts?: WaitOptions): Promise<Video>;
|
|
347
|
+
}
|
|
348
|
+
declare class Widecast {
|
|
349
|
+
#private;
|
|
350
|
+
apiKey?: string;
|
|
351
|
+
baseUrl: string;
|
|
352
|
+
timeoutMs: number;
|
|
353
|
+
maxRetries: number;
|
|
354
|
+
userAgent: string;
|
|
355
|
+
constructor(cfg?: WidecastConfig);
|
|
356
|
+
create_video(opts: CreateVideoOptions): Promise<Video>;
|
|
357
|
+
/** POST /v1/export_video — kick the final-MP4 renderer for an existing
|
|
358
|
+
* scene-output video. Idempotent: calling twice is a no-op.
|
|
359
|
+
* Throws `PreconditionFailedError` if scenes are not yet ready. */
|
|
360
|
+
export_video(videoId: string): Promise<Video>;
|
|
361
|
+
get_status(videoId: string): Promise<Video>;
|
|
362
|
+
/** POST /v1/create_content — generate written content (blog / social post)
|
|
363
|
+
* from a URL, an idea/topic, or pasted text. Async: returns a Video with
|
|
364
|
+
* `review_url` (the public content viewer) already populated — safe to
|
|
365
|
+
* share before completion; the viewer shows a spinner while content
|
|
366
|
+
* generates. Poll with `.wait()` for the final state. */
|
|
367
|
+
create_content(opts: CreateContentOptions): Promise<Video>;
|
|
368
|
+
/** POST /v1/enhance_script — improve a DRAFT script with AI. Async: returns
|
|
369
|
+
* a Video with `review_url` (the Script Editor) already populated — safe
|
|
370
|
+
* to share before completion; the editor shows a spinner while enhancing.
|
|
371
|
+
* Poll with `.wait()` for the final enhanced script. */
|
|
372
|
+
enhance_script(opts: EnhanceScriptOptions): Promise<Video>;
|
|
373
|
+
/** POST /v1/suggest_ideas — SYNCHRONOUS. Returns video topic ideas for an
|
|
374
|
+
* industry immediately (no polling). `industry_id` falls back to your
|
|
375
|
+
* account industry if omitted. Consumes credits. */
|
|
376
|
+
suggest_ideas(opts?: SuggestIdeasOptions): Promise<IdeasResponse>;
|
|
377
|
+
/** POST /v1/collect_ideas — SYNCHRONOUS. Returns video ideas derived from a
|
|
378
|
+
* product/service description (≥10 chars) immediately. Consumes credits. */
|
|
379
|
+
collect_ideas(opts: CollectIdeasOptions): Promise<IdeasResponse>;
|
|
380
|
+
/** POST /v1/publish — distribute content to connected social platforms.
|
|
381
|
+
* Provide EXACTLY ONE of topic_id / text / video_url. `platforms` defaults
|
|
382
|
+
* to ALL connected. Charges 1 credit. Returns the accepted-publish envelope
|
|
383
|
+
* (HTTP 202) — publishing is async on the platform side, so poll
|
|
384
|
+
* get_status(id) (with any of `request_ids`) for per-platform post URLs. */
|
|
385
|
+
publish(opts: PublishOptions): Promise<PublishResponse>;
|
|
386
|
+
/** GET /v1/videos — list the account's recent videos (20/page). Free. */
|
|
387
|
+
list_videos(opts?: {
|
|
388
|
+
from_record?: number;
|
|
389
|
+
}): Promise<any>;
|
|
390
|
+
/** GET /v1/search — search the account's content by keywords. Free. */
|
|
391
|
+
search(query: string, opts?: {
|
|
392
|
+
limit?: number;
|
|
393
|
+
}): Promise<any>;
|
|
394
|
+
/** GET /v1/account — account profile + remaining credits. Free. */
|
|
395
|
+
account(): Promise<any>;
|
|
396
|
+
/** GET /v1/analytics — social analytics dashboard. Free but SLOW. */
|
|
397
|
+
analytics(opts?: {
|
|
398
|
+
period?: string;
|
|
399
|
+
start_date?: string;
|
|
400
|
+
end_date?: string;
|
|
401
|
+
}): Promise<any>;
|
|
402
|
+
/** GET /v1/roadmap — the account's content roadmap. Free. */
|
|
403
|
+
roadmap(opts?: {
|
|
404
|
+
cycle?: number;
|
|
405
|
+
}): Promise<any>;
|
|
406
|
+
/** GET /v1/production_plan — the weekly production plan. Free.
|
|
407
|
+
* NOTE: passing both week_start + week_end may backfill rows upstream. */
|
|
408
|
+
production_plan(opts?: {
|
|
409
|
+
page?: number;
|
|
410
|
+
week_start?: string;
|
|
411
|
+
week_end?: string;
|
|
412
|
+
}): Promise<any>;
|
|
413
|
+
/** GET /v1/foundation_videos — curated foundation-video templates. Free. */
|
|
414
|
+
foundation_videos(opts?: {
|
|
415
|
+
industry?: string;
|
|
416
|
+
sub_industry?: string;
|
|
417
|
+
page?: number;
|
|
418
|
+
}): Promise<any>;
|
|
419
|
+
/** GET /v1/recommendations — recommended video ideas for an industry. Free. */
|
|
420
|
+
recommendations(opts?: {
|
|
421
|
+
industry?: string;
|
|
422
|
+
page?: number;
|
|
423
|
+
}): Promise<IdeasResponse>;
|
|
424
|
+
/** POST /v1/connect — get an OAuth link to connect a social platform. Free.
|
|
425
|
+
* Returns `{object:"connect", url, expires_in, ...}` — the USER opens `url`
|
|
426
|
+
* to complete the connection on the web (WideCast never performs the OAuth). */
|
|
427
|
+
connect(opts?: {
|
|
428
|
+
platform?: PublishPlatform;
|
|
429
|
+
}): Promise<any>;
|
|
430
|
+
/** GET /v1/accounts — list the account's connected social platforms. Free. */
|
|
431
|
+
accounts(): Promise<any>;
|
|
432
|
+
/** GET /v1/platform_settings — load saved per-platform publish settings. Free. */
|
|
433
|
+
platform_settings(): Promise<any>;
|
|
434
|
+
/** POST /v1/platform_settings — save one platform's publish settings. Free. */
|
|
435
|
+
set_platform_settings(platform: PublishPlatform, settings: Record<string, unknown>): Promise<any>;
|
|
436
|
+
}
|
|
437
|
+
declare class WebhookVerificationError extends Error {
|
|
438
|
+
constructor(m: string);
|
|
439
|
+
}
|
|
440
|
+
interface VerifyWebhookOptions {
|
|
441
|
+
body: string;
|
|
442
|
+
signatureHeader: string;
|
|
443
|
+
secret: string;
|
|
444
|
+
toleranceSeconds?: number;
|
|
445
|
+
}
|
|
446
|
+
declare function verifyWebhook(opts: VerifyWebhookOptions): Promise<any>;
|
|
447
|
+
|
|
448
|
+
export { APIError, BLOG_MAX_WORDS, BLOG_MIN_WORDS, CONTENT_TYPES, type CollectIdeasOptions, type ContentType, type CreateContentOptions, type CreateVideoOptions, type EnhanceScriptOptions, type ErrorCode, FACELESS_SOURCES, IDEA_MAX_WORDS, IDEA_MIN_WORDS, INTERVENTION_LEVELS, type Idea, type IdeasResponse, type InterventionLevel, InvalidRequestError, LANGUAGES, type Language, MEDIA_MAX_DURATION_SECONDS, MEDIA_MAX_FILE_BYTES, MEDIA_SOURCES, NotFoundError, OUTPUT_TYPES, type OutputType, PUBLISH_PLATFORMS, PreconditionFailedError, type ProcessingDetails, type PublishOptions, type PublishPlatform, type PublishResponse, RateLimitError, SCRIPT_MAX_WORDS, SCRIPT_MIN_WORDS, SOURCES, type Source, type StatusError, type StatusResult, type SuggestIdeasOptions, VERSION, VIDEO_LENGTHS, type VerifyWebhookOptions, Video, type VideoLength, type VideoResource, type VideoStatus, type WaitOptions, WebhookVerificationError, Widecast, type WidecastConfig, WidecastError, Widecast as default, verifyWebhook };
|