samsar-js 0.48.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/README.md +233 -0
- package/dist/index.d.ts +977 -0
- package/dist/index.js +859 -0
- package/package.json +38 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,977 @@
|
|
|
1
|
+
type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
type QueryValue = string | number | boolean | null | undefined;
|
|
3
|
+
type QueryParams = Record<string, QueryValue>;
|
|
4
|
+
export interface SamsarClientOptions {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
fetch?: FetchLike;
|
|
9
|
+
defaultHeaders?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export interface SamsarRequestOptions {
|
|
12
|
+
idempotencyKey?: string;
|
|
13
|
+
headers?: Record<string, string>;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
query?: QueryParams;
|
|
16
|
+
}
|
|
17
|
+
export interface SamsarResult<T> {
|
|
18
|
+
data: T;
|
|
19
|
+
status: number;
|
|
20
|
+
headers: Record<string, string>;
|
|
21
|
+
creditsCharged?: number;
|
|
22
|
+
creditsRemaining?: number;
|
|
23
|
+
raw: Response;
|
|
24
|
+
}
|
|
25
|
+
export interface FontOptions {
|
|
26
|
+
key?: string;
|
|
27
|
+
font_key?: string;
|
|
28
|
+
language?: string;
|
|
29
|
+
family?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateVideoFromTextInput {
|
|
32
|
+
prompt: string;
|
|
33
|
+
image_model: string;
|
|
34
|
+
video_model: string;
|
|
35
|
+
duration: number;
|
|
36
|
+
tone?: string;
|
|
37
|
+
aspect_ratio?: string;
|
|
38
|
+
video_model_sub_type?: string;
|
|
39
|
+
font_key?: string;
|
|
40
|
+
fontKey?: string;
|
|
41
|
+
subtitle_font?: string;
|
|
42
|
+
subtitleFont?: string;
|
|
43
|
+
font?: FontOptions;
|
|
44
|
+
language?: string;
|
|
45
|
+
languageString?: string | null;
|
|
46
|
+
enable_subtitles?: boolean;
|
|
47
|
+
enableSubtitles?: boolean;
|
|
48
|
+
session_id?: string;
|
|
49
|
+
sessionId?: string;
|
|
50
|
+
sessionID?: string;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
export interface CreateVideoResponse {
|
|
54
|
+
request_id: string;
|
|
55
|
+
session_id?: string;
|
|
56
|
+
sessionID?: string;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
export interface OutroFocusArea {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
width: number;
|
|
63
|
+
height: number;
|
|
64
|
+
}
|
|
65
|
+
export interface ImageListToVideoItem {
|
|
66
|
+
image_url?: string;
|
|
67
|
+
imageUrl?: string;
|
|
68
|
+
url?: string;
|
|
69
|
+
src?: string;
|
|
70
|
+
enhanced_url?: string;
|
|
71
|
+
enhancedUrl?: string;
|
|
72
|
+
use_enhanced?: boolean;
|
|
73
|
+
useEnhanced?: boolean;
|
|
74
|
+
is_enhanced?: boolean;
|
|
75
|
+
isEnhanced?: boolean;
|
|
76
|
+
from_enhanced_list?: boolean;
|
|
77
|
+
fromEnhancedList?: boolean;
|
|
78
|
+
skip_enhancement?: boolean;
|
|
79
|
+
skipEnhancement?: boolean;
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
}
|
|
82
|
+
export interface CreateVideoFromImageListInput {
|
|
83
|
+
image_urls: Array<string | ImageListToVideoItem>;
|
|
84
|
+
metadata?: Record<string, unknown>;
|
|
85
|
+
prompt?: string;
|
|
86
|
+
language?: string;
|
|
87
|
+
languageString?: string | null;
|
|
88
|
+
font_key?: string;
|
|
89
|
+
fontKey?: string;
|
|
90
|
+
subtitle_font?: string;
|
|
91
|
+
subtitleFont?: string;
|
|
92
|
+
font?: FontOptions;
|
|
93
|
+
enable_subtitles?: boolean;
|
|
94
|
+
enableSubtitles?: boolean;
|
|
95
|
+
session_id?: string;
|
|
96
|
+
sessionId?: string;
|
|
97
|
+
sessionID?: string;
|
|
98
|
+
outro_image_url?: string;
|
|
99
|
+
add_outro_animation?: boolean;
|
|
100
|
+
add_outro_focus_area?: boolean;
|
|
101
|
+
outro_focust_area?: OutroFocusArea | null;
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
}
|
|
104
|
+
export interface TranscriptBuilderPayload {
|
|
105
|
+
prompt?: string;
|
|
106
|
+
imageDescriptionList?: unknown[];
|
|
107
|
+
metadata?: Record<string, unknown>;
|
|
108
|
+
imageList?: string[];
|
|
109
|
+
language?: string;
|
|
110
|
+
languageString?: string | null;
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
}
|
|
113
|
+
export interface CreateVideoFromImageListResponse {
|
|
114
|
+
request_id?: string;
|
|
115
|
+
session_id?: string;
|
|
116
|
+
sessionID?: string;
|
|
117
|
+
status?: string;
|
|
118
|
+
case_type?: string;
|
|
119
|
+
creditsCharged?: number;
|
|
120
|
+
remainingCredits?: number | null;
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}
|
|
123
|
+
export interface TranslateVideoInput {
|
|
124
|
+
videoSessionId?: string;
|
|
125
|
+
video_session_id?: string;
|
|
126
|
+
videoSessionID?: string;
|
|
127
|
+
session_id?: string;
|
|
128
|
+
sessionId?: string;
|
|
129
|
+
sessionID?: string;
|
|
130
|
+
request_id?: string;
|
|
131
|
+
requestId?: string;
|
|
132
|
+
language?: string;
|
|
133
|
+
languageString?: string | null;
|
|
134
|
+
language_code?: string;
|
|
135
|
+
languageCode?: string;
|
|
136
|
+
langauge?: string;
|
|
137
|
+
langauge_code?: string;
|
|
138
|
+
langaugeCode?: string;
|
|
139
|
+
outro_image_url?: string;
|
|
140
|
+
outroImageUrl?: string;
|
|
141
|
+
new_outro_image_url?: string;
|
|
142
|
+
newOutroImageUrl?: string;
|
|
143
|
+
[key: string]: unknown;
|
|
144
|
+
}
|
|
145
|
+
export interface TranslateVideoResponse {
|
|
146
|
+
request_id?: string;
|
|
147
|
+
session_id?: string;
|
|
148
|
+
sessionID?: string;
|
|
149
|
+
creditsCharged?: number;
|
|
150
|
+
remainingCredits?: number | null;
|
|
151
|
+
[key: string]: unknown;
|
|
152
|
+
}
|
|
153
|
+
export interface UpdateVideoOutroImageInput {
|
|
154
|
+
videoSessionId?: string;
|
|
155
|
+
video_session_id?: string;
|
|
156
|
+
videoSessionID?: string;
|
|
157
|
+
session_id?: string;
|
|
158
|
+
sessionId?: string;
|
|
159
|
+
sessionID?: string;
|
|
160
|
+
request_id?: string;
|
|
161
|
+
requestId?: string;
|
|
162
|
+
outro_image_url?: string;
|
|
163
|
+
outroImageUrl?: string;
|
|
164
|
+
new_outro_image_url?: string;
|
|
165
|
+
newOutroImageUrl?: string;
|
|
166
|
+
[key: string]: unknown;
|
|
167
|
+
}
|
|
168
|
+
export interface UpdateVideoOutroImageResponse {
|
|
169
|
+
request_id?: string;
|
|
170
|
+
session_id?: string;
|
|
171
|
+
sessionID?: string;
|
|
172
|
+
creditsCharged?: number;
|
|
173
|
+
remainingCredits?: number | null;
|
|
174
|
+
[key: string]: unknown;
|
|
175
|
+
}
|
|
176
|
+
export interface AddVideoOutroImageInput {
|
|
177
|
+
videoSessionId?: string;
|
|
178
|
+
video_session_id?: string;
|
|
179
|
+
videoSessionID?: string;
|
|
180
|
+
session_id?: string;
|
|
181
|
+
sessionId?: string;
|
|
182
|
+
sessionID?: string;
|
|
183
|
+
request_id?: string;
|
|
184
|
+
requestId?: string;
|
|
185
|
+
outro_image_url?: string;
|
|
186
|
+
outroImageUrl?: string;
|
|
187
|
+
new_outro_image_url?: string;
|
|
188
|
+
newOutroImageUrl?: string;
|
|
189
|
+
add_outro_animation?: boolean;
|
|
190
|
+
addOutroAnimation?: boolean;
|
|
191
|
+
add_outro_focus_area?: boolean;
|
|
192
|
+
addOutroFocusArea?: boolean;
|
|
193
|
+
outro_focust_area?: OutroFocusArea | null;
|
|
194
|
+
outro_focus_area?: OutroFocusArea | null;
|
|
195
|
+
outroFocustArea?: OutroFocusArea | null;
|
|
196
|
+
outroFocusArea?: OutroFocusArea | null;
|
|
197
|
+
[key: string]: unknown;
|
|
198
|
+
}
|
|
199
|
+
export interface AddVideoOutroImageResponse {
|
|
200
|
+
request_id?: string;
|
|
201
|
+
session_id?: string;
|
|
202
|
+
sessionID?: string;
|
|
203
|
+
creditsCharged?: number;
|
|
204
|
+
remainingCredits?: number | null;
|
|
205
|
+
[key: string]: unknown;
|
|
206
|
+
}
|
|
207
|
+
export interface JoinVideosInput {
|
|
208
|
+
session_ids?: string[];
|
|
209
|
+
sessionIds?: string[];
|
|
210
|
+
video_session_ids?: string[];
|
|
211
|
+
videoSessionIds?: string[];
|
|
212
|
+
blend_scenes?: boolean;
|
|
213
|
+
blendScenes?: boolean;
|
|
214
|
+
[key: string]: unknown;
|
|
215
|
+
}
|
|
216
|
+
export interface JoinVideosResponse {
|
|
217
|
+
request_id?: string;
|
|
218
|
+
session_id?: string;
|
|
219
|
+
sessionID?: string;
|
|
220
|
+
creditsCharged?: number;
|
|
221
|
+
remainingCredits?: number | null;
|
|
222
|
+
[key: string]: unknown;
|
|
223
|
+
}
|
|
224
|
+
export interface RemoveSubtitlesInput {
|
|
225
|
+
videoSessionId?: string;
|
|
226
|
+
video_session_id?: string;
|
|
227
|
+
videoSessionID?: string;
|
|
228
|
+
session_id?: string;
|
|
229
|
+
sessionId?: string;
|
|
230
|
+
sessionID?: string;
|
|
231
|
+
request_id?: string;
|
|
232
|
+
requestId?: string;
|
|
233
|
+
[key: string]: unknown;
|
|
234
|
+
}
|
|
235
|
+
export interface RemoveSubtitlesResponse {
|
|
236
|
+
request_id?: string;
|
|
237
|
+
session_id?: string;
|
|
238
|
+
sessionID?: string;
|
|
239
|
+
creditsCharged?: number;
|
|
240
|
+
remainingCredits?: number | null;
|
|
241
|
+
[key: string]: unknown;
|
|
242
|
+
}
|
|
243
|
+
export interface CancelRenderInput {
|
|
244
|
+
videoSessionId?: string;
|
|
245
|
+
video_session_id?: string;
|
|
246
|
+
videoSessionID?: string;
|
|
247
|
+
session_id?: string;
|
|
248
|
+
sessionId?: string;
|
|
249
|
+
sessionID?: string;
|
|
250
|
+
request_id?: string;
|
|
251
|
+
requestId?: string;
|
|
252
|
+
[key: string]: unknown;
|
|
253
|
+
}
|
|
254
|
+
export interface CancelRenderResponse {
|
|
255
|
+
request_id?: string;
|
|
256
|
+
session_id?: string;
|
|
257
|
+
sessionID?: string;
|
|
258
|
+
status?: string;
|
|
259
|
+
cancelled?: boolean;
|
|
260
|
+
message?: string;
|
|
261
|
+
[key: string]: unknown;
|
|
262
|
+
}
|
|
263
|
+
export interface FetchLatestVideoVersionResponse {
|
|
264
|
+
session_id: string;
|
|
265
|
+
result_url?: string;
|
|
266
|
+
status?: string;
|
|
267
|
+
message?: string;
|
|
268
|
+
[key: string]: unknown;
|
|
269
|
+
}
|
|
270
|
+
export interface CompletedVideoSession {
|
|
271
|
+
session_id: string;
|
|
272
|
+
langauge: string;
|
|
273
|
+
language?: string;
|
|
274
|
+
result_url: string;
|
|
275
|
+
[key: string]: unknown;
|
|
276
|
+
}
|
|
277
|
+
export type ListCompletedVideoSessionsResponse = CompletedVideoSession[];
|
|
278
|
+
export interface SupportedTextToVideoModelsResponse {
|
|
279
|
+
IMAGE_MODELS: SupportedTextToVideoModelOption[];
|
|
280
|
+
VIDEO_MODELS: SupportedTextToVideoModelOption[];
|
|
281
|
+
[key: string]: unknown;
|
|
282
|
+
}
|
|
283
|
+
export interface SupportedTextToVideoModelOption {
|
|
284
|
+
label: string;
|
|
285
|
+
value: string;
|
|
286
|
+
basePrice: number | null;
|
|
287
|
+
[key: string]: unknown;
|
|
288
|
+
}
|
|
289
|
+
export interface EnhanceMessageRequest {
|
|
290
|
+
message: string;
|
|
291
|
+
metadata?: Record<string, unknown>;
|
|
292
|
+
language?: string;
|
|
293
|
+
}
|
|
294
|
+
export interface EnhanceMessageResponse {
|
|
295
|
+
content: string;
|
|
296
|
+
[key: string]: unknown;
|
|
297
|
+
}
|
|
298
|
+
export interface EmbeddingStructuredField {
|
|
299
|
+
key: string;
|
|
300
|
+
type: string;
|
|
301
|
+
sampleValues?: unknown[];
|
|
302
|
+
stats?: Record<string, unknown>;
|
|
303
|
+
}
|
|
304
|
+
export interface EmbeddingFieldOptions {
|
|
305
|
+
searchable?: boolean;
|
|
306
|
+
filterable?: boolean;
|
|
307
|
+
retrievable?: boolean;
|
|
308
|
+
}
|
|
309
|
+
export type EmbeddingFieldOptionsInput = Record<string, EmbeddingFieldOptions> | Array<EmbeddingFieldOptions & {
|
|
310
|
+
key?: string;
|
|
311
|
+
field?: string;
|
|
312
|
+
name?: string;
|
|
313
|
+
path?: string;
|
|
314
|
+
column_name?: string;
|
|
315
|
+
columnName?: string;
|
|
316
|
+
}>;
|
|
317
|
+
export interface CreateEmbeddingRequest {
|
|
318
|
+
records: Array<Record<string, unknown>>;
|
|
319
|
+
name?: string;
|
|
320
|
+
embedding_name?: string;
|
|
321
|
+
template_name?: string;
|
|
322
|
+
field_options?: EmbeddingFieldOptionsInput;
|
|
323
|
+
fieldOptions?: EmbeddingFieldOptionsInput;
|
|
324
|
+
[key: string]: unknown;
|
|
325
|
+
}
|
|
326
|
+
export interface CreateEmbeddingResponse {
|
|
327
|
+
template_id: string;
|
|
328
|
+
template_hash?: string;
|
|
329
|
+
hash_link?: string;
|
|
330
|
+
record_count?: number;
|
|
331
|
+
structured_fields?: EmbeddingStructuredField[];
|
|
332
|
+
unstructured_fields?: string[];
|
|
333
|
+
[key: string]: unknown;
|
|
334
|
+
}
|
|
335
|
+
export interface UpdateEmbeddingRequest {
|
|
336
|
+
template_id: string;
|
|
337
|
+
records: Array<Record<string, unknown>>;
|
|
338
|
+
field_options?: EmbeddingFieldOptionsInput;
|
|
339
|
+
fieldOptions?: EmbeddingFieldOptionsInput;
|
|
340
|
+
[key: string]: unknown;
|
|
341
|
+
}
|
|
342
|
+
export interface UpdateEmbeddingResponse {
|
|
343
|
+
template_id: string;
|
|
344
|
+
template_hash?: string;
|
|
345
|
+
record_count?: number;
|
|
346
|
+
structured_fields?: EmbeddingStructuredField[];
|
|
347
|
+
unstructured_fields?: string[];
|
|
348
|
+
[key: string]: unknown;
|
|
349
|
+
}
|
|
350
|
+
export interface DeleteEmbeddingsRequest {
|
|
351
|
+
template_id: string;
|
|
352
|
+
[key: string]: unknown;
|
|
353
|
+
}
|
|
354
|
+
export interface DeleteEmbeddingsResponse {
|
|
355
|
+
template_id: string;
|
|
356
|
+
deleted_count?: number;
|
|
357
|
+
record_count?: number;
|
|
358
|
+
status?: string;
|
|
359
|
+
[key: string]: unknown;
|
|
360
|
+
}
|
|
361
|
+
export interface DeleteEmbeddingRequest {
|
|
362
|
+
template_id: string;
|
|
363
|
+
source_id?: string;
|
|
364
|
+
sourceId?: string;
|
|
365
|
+
source_ids?: string[];
|
|
366
|
+
sourceIds?: string[];
|
|
367
|
+
id?: string;
|
|
368
|
+
ids?: string[];
|
|
369
|
+
record_id?: string;
|
|
370
|
+
recordId?: string;
|
|
371
|
+
record_ids?: string[];
|
|
372
|
+
recordIds?: string[];
|
|
373
|
+
[key: string]: unknown;
|
|
374
|
+
}
|
|
375
|
+
export type DeleteEmbeddingResponse = DeleteEmbeddingsResponse;
|
|
376
|
+
export interface SearchAgainstEmbeddingRequest {
|
|
377
|
+
template_id: string;
|
|
378
|
+
search_term: string;
|
|
379
|
+
search_date?: string;
|
|
380
|
+
searchDate?: string;
|
|
381
|
+
structured_filters?: Record<string, unknown>;
|
|
382
|
+
filters?: Record<string, unknown>;
|
|
383
|
+
search_params?: Record<string, unknown>;
|
|
384
|
+
searchParams?: Record<string, unknown>;
|
|
385
|
+
limit?: number;
|
|
386
|
+
num_candidates?: number;
|
|
387
|
+
rerank?: boolean;
|
|
388
|
+
include_raw?: boolean;
|
|
389
|
+
[key: string]: unknown;
|
|
390
|
+
}
|
|
391
|
+
export interface EmbeddingSearchResult {
|
|
392
|
+
id: string;
|
|
393
|
+
score?: number;
|
|
394
|
+
structured_filters?: Record<string, unknown>;
|
|
395
|
+
record?: Record<string, unknown>;
|
|
396
|
+
[key: string]: unknown;
|
|
397
|
+
}
|
|
398
|
+
export interface SearchAgainstEmbeddingResponse {
|
|
399
|
+
template_id: string;
|
|
400
|
+
template_name?: string | null;
|
|
401
|
+
structured_filters?: Record<string, unknown>;
|
|
402
|
+
results?: EmbeddingSearchResult[];
|
|
403
|
+
[key: string]: unknown;
|
|
404
|
+
}
|
|
405
|
+
export interface SimilarToEmbeddingRequest {
|
|
406
|
+
template_id: string;
|
|
407
|
+
search_term?: string;
|
|
408
|
+
search_date?: string;
|
|
409
|
+
searchDate?: string;
|
|
410
|
+
search_json?: Record<string, unknown>;
|
|
411
|
+
search_record?: Record<string, unknown>;
|
|
412
|
+
searchJson?: Record<string, unknown>;
|
|
413
|
+
searchRecord?: Record<string, unknown>;
|
|
414
|
+
structured_filters?: Record<string, unknown>;
|
|
415
|
+
filters?: Record<string, unknown>;
|
|
416
|
+
search_params?: Record<string, unknown>;
|
|
417
|
+
searchParams?: Record<string, unknown>;
|
|
418
|
+
limit?: number;
|
|
419
|
+
min_results?: number;
|
|
420
|
+
minResults?: number;
|
|
421
|
+
num_candidates?: number;
|
|
422
|
+
[key: string]: unknown;
|
|
423
|
+
}
|
|
424
|
+
export interface SimilarToEmbeddingResponse {
|
|
425
|
+
template_id: string;
|
|
426
|
+
structured_filters?: Record<string, unknown>;
|
|
427
|
+
matches?: Array<{
|
|
428
|
+
id: string;
|
|
429
|
+
score?: number;
|
|
430
|
+
}>;
|
|
431
|
+
[key: string]: unknown;
|
|
432
|
+
}
|
|
433
|
+
export interface EmbeddingTemplateSummary {
|
|
434
|
+
template_id: string;
|
|
435
|
+
name?: string | null;
|
|
436
|
+
template_hash?: string | null;
|
|
437
|
+
hash_link?: string | null;
|
|
438
|
+
record_count?: number;
|
|
439
|
+
structured_fields?: EmbeddingStructuredField[];
|
|
440
|
+
unstructured_fields?: string[];
|
|
441
|
+
embedding_model?: string;
|
|
442
|
+
created_at?: string | null;
|
|
443
|
+
updated_at?: string | null;
|
|
444
|
+
[key: string]: unknown;
|
|
445
|
+
}
|
|
446
|
+
export interface ListEmbeddingTemplatesResponse {
|
|
447
|
+
templates: EmbeddingTemplateSummary[];
|
|
448
|
+
pagination?: {
|
|
449
|
+
total?: number;
|
|
450
|
+
limit?: number;
|
|
451
|
+
offset?: number;
|
|
452
|
+
has_more?: boolean;
|
|
453
|
+
};
|
|
454
|
+
[key: string]: unknown;
|
|
455
|
+
}
|
|
456
|
+
export interface EmbeddingStatusResponse {
|
|
457
|
+
template_id: string;
|
|
458
|
+
has_embeddings: boolean;
|
|
459
|
+
record_count?: number;
|
|
460
|
+
status?: string;
|
|
461
|
+
[key: string]: unknown;
|
|
462
|
+
}
|
|
463
|
+
export interface RemoveBrandingFromImageRequest {
|
|
464
|
+
image_url: string;
|
|
465
|
+
}
|
|
466
|
+
export interface RemoveBrandingFromImageResponse {
|
|
467
|
+
status?: string;
|
|
468
|
+
message?: string;
|
|
469
|
+
request_id?: string;
|
|
470
|
+
session_id?: string;
|
|
471
|
+
global_status_id?: string;
|
|
472
|
+
case_type?: string;
|
|
473
|
+
image_url: string;
|
|
474
|
+
userId?: string;
|
|
475
|
+
creditsCharged?: number;
|
|
476
|
+
remainingCredits?: number;
|
|
477
|
+
[key: string]: unknown;
|
|
478
|
+
}
|
|
479
|
+
export interface ReplaceBrandingFromImageRequest {
|
|
480
|
+
image_urls: string[];
|
|
481
|
+
}
|
|
482
|
+
export interface ReplaceBrandingFromImageResponse {
|
|
483
|
+
status?: string;
|
|
484
|
+
message?: string;
|
|
485
|
+
request_id?: string;
|
|
486
|
+
session_id?: string;
|
|
487
|
+
global_status_id?: string;
|
|
488
|
+
case_type?: string;
|
|
489
|
+
image_urls: string[];
|
|
490
|
+
userId?: string;
|
|
491
|
+
creditsCharged?: number;
|
|
492
|
+
remainingCredits?: number;
|
|
493
|
+
[key: string]: unknown;
|
|
494
|
+
}
|
|
495
|
+
export interface EnhanceImageRequest {
|
|
496
|
+
image_url: string;
|
|
497
|
+
resolution?: '1k' | '2k' | '3k' | '4k';
|
|
498
|
+
aspect_ratio?: string;
|
|
499
|
+
}
|
|
500
|
+
export interface EnhanceImageResponse {
|
|
501
|
+
status?: string;
|
|
502
|
+
message?: string;
|
|
503
|
+
request_id?: string;
|
|
504
|
+
session_id?: string;
|
|
505
|
+
global_status_id?: string;
|
|
506
|
+
case_type?: string;
|
|
507
|
+
image_url: string;
|
|
508
|
+
resolution?: string;
|
|
509
|
+
aspect_ratio?: string;
|
|
510
|
+
userId?: string;
|
|
511
|
+
creditsCharged?: number;
|
|
512
|
+
remainingCredits?: number;
|
|
513
|
+
[key: string]: unknown;
|
|
514
|
+
}
|
|
515
|
+
export interface ExtendImageListRequest {
|
|
516
|
+
image_urls: string[];
|
|
517
|
+
num_images: number;
|
|
518
|
+
prompt?: string;
|
|
519
|
+
metadata?: Record<string, unknown>;
|
|
520
|
+
}
|
|
521
|
+
export interface ExtendImageListResponse {
|
|
522
|
+
status?: string;
|
|
523
|
+
message?: string;
|
|
524
|
+
request_id?: string;
|
|
525
|
+
session_id?: string;
|
|
526
|
+
global_status_id?: string;
|
|
527
|
+
case_type?: string;
|
|
528
|
+
image_urls: string[];
|
|
529
|
+
metadata?: Record<string, unknown>;
|
|
530
|
+
prompt?: string;
|
|
531
|
+
num_images?: number;
|
|
532
|
+
userId?: string;
|
|
533
|
+
creditsCharged?: number;
|
|
534
|
+
remainingCredits?: number;
|
|
535
|
+
[key: string]: unknown;
|
|
536
|
+
}
|
|
537
|
+
export interface RollupBannerOverlay {
|
|
538
|
+
footer?: string | null;
|
|
539
|
+
bottom?: string | null;
|
|
540
|
+
bottom_text?: string | null;
|
|
541
|
+
text?: string | null;
|
|
542
|
+
title?: string | null;
|
|
543
|
+
top_left?: string | null;
|
|
544
|
+
top_right?: string | null;
|
|
545
|
+
topLeft?: string | null;
|
|
546
|
+
topRight?: string | null;
|
|
547
|
+
image_category?: string | null;
|
|
548
|
+
}
|
|
549
|
+
export interface RollupBannerImageItem {
|
|
550
|
+
image_url?: string;
|
|
551
|
+
imageUrl?: string;
|
|
552
|
+
url?: string;
|
|
553
|
+
src?: string;
|
|
554
|
+
overlay?: RollupBannerOverlay | null;
|
|
555
|
+
image_text?: string | null;
|
|
556
|
+
image_title?: string | null;
|
|
557
|
+
title?: string | null;
|
|
558
|
+
name?: string | null;
|
|
559
|
+
image_category?: string | null;
|
|
560
|
+
category?: string | null;
|
|
561
|
+
image_duration?: number | string | null;
|
|
562
|
+
duration?: number | string | null;
|
|
563
|
+
duration_text?: string | null;
|
|
564
|
+
durationText?: string | null;
|
|
565
|
+
activity_id?: number | null;
|
|
566
|
+
enhanced_url?: string | null;
|
|
567
|
+
enhancedUrl?: string | null;
|
|
568
|
+
[key: string]: unknown;
|
|
569
|
+
}
|
|
570
|
+
export type RollupBannerImageInput = string | RollupBannerImageItem;
|
|
571
|
+
export interface RollupBannerFontOptions {
|
|
572
|
+
key?: string;
|
|
573
|
+
language?: string;
|
|
574
|
+
family?: string;
|
|
575
|
+
}
|
|
576
|
+
export interface RollupBannerImageTilingPosition {
|
|
577
|
+
font_key?: string;
|
|
578
|
+
font_family?: string;
|
|
579
|
+
font?: RollupBannerFontOptions;
|
|
580
|
+
top_left?: {
|
|
581
|
+
margin_min?: number;
|
|
582
|
+
margin_ratio?: number;
|
|
583
|
+
diameter_min?: number;
|
|
584
|
+
diameter_max?: number;
|
|
585
|
+
diameter_ratio?: number;
|
|
586
|
+
inner_padding_min?: number;
|
|
587
|
+
inner_padding_ratio?: number;
|
|
588
|
+
};
|
|
589
|
+
top_right?: {
|
|
590
|
+
margin_min?: number;
|
|
591
|
+
margin_ratio?: number;
|
|
592
|
+
max_width_floor?: number;
|
|
593
|
+
min_width?: number;
|
|
594
|
+
padding_left?: number;
|
|
595
|
+
padding_right?: number;
|
|
596
|
+
padding_top?: number;
|
|
597
|
+
padding_bottom?: number;
|
|
598
|
+
overlay_height_min?: number;
|
|
599
|
+
};
|
|
600
|
+
bottom?: {
|
|
601
|
+
inset_min?: number;
|
|
602
|
+
inset_ratio?: number;
|
|
603
|
+
offset_min?: number;
|
|
604
|
+
offset_ratio?: number;
|
|
605
|
+
container_margin_min?: number;
|
|
606
|
+
container_margin_ratio?: number;
|
|
607
|
+
text_inset_min?: number;
|
|
608
|
+
text_inset_ratio?: number;
|
|
609
|
+
overlay_height_min?: number;
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
export interface CreateRollupBannerRequest {
|
|
613
|
+
images?: RollupBannerImageInput[];
|
|
614
|
+
image_list?: RollupBannerImageInput[];
|
|
615
|
+
image_urls?: RollupBannerImageInput[];
|
|
616
|
+
logo_url?: string | null;
|
|
617
|
+
header_image_url?: string | null;
|
|
618
|
+
header_text?: string | null;
|
|
619
|
+
header_cta?: string[] | null;
|
|
620
|
+
footer_text?: string | null;
|
|
621
|
+
footer_image_url?: string | null;
|
|
622
|
+
footer_logo_url?: string | null;
|
|
623
|
+
image_tiling_position?: RollupBannerImageTilingPosition;
|
|
624
|
+
max_tiles?: number;
|
|
625
|
+
columns?: number;
|
|
626
|
+
}
|
|
627
|
+
export interface CreateRollupBannerResponse {
|
|
628
|
+
status?: string;
|
|
629
|
+
message?: string;
|
|
630
|
+
session_id?: string;
|
|
631
|
+
request_id?: string;
|
|
632
|
+
result_url?: string | null;
|
|
633
|
+
thumbnail_url?: string | null;
|
|
634
|
+
result_urls?: string[];
|
|
635
|
+
creditsCharged?: number;
|
|
636
|
+
remainingCredits?: number;
|
|
637
|
+
[key: string]: unknown;
|
|
638
|
+
}
|
|
639
|
+
export interface EnhanceAndGenerateRollupBannerRequest extends CreateRollupBannerRequest {
|
|
640
|
+
}
|
|
641
|
+
export interface EnhanceAndGenerateRollupBannerResponse extends CreateRollupBannerResponse {
|
|
642
|
+
case_type?: string;
|
|
643
|
+
rollup_session_id?: string;
|
|
644
|
+
rollup_request_id?: string;
|
|
645
|
+
input_image_urls?: string[];
|
|
646
|
+
}
|
|
647
|
+
export interface GlobalStatusResponse {
|
|
648
|
+
session_id: string | null;
|
|
649
|
+
request_id: string | null;
|
|
650
|
+
status: string;
|
|
651
|
+
type?: 'image' | 'video' | string;
|
|
652
|
+
provider?: string | null;
|
|
653
|
+
result_url?: string | null;
|
|
654
|
+
thumbnail_url?: string | null;
|
|
655
|
+
result_urls?: string[];
|
|
656
|
+
videoLink?: string | null;
|
|
657
|
+
remoteURL?: string | null;
|
|
658
|
+
expressGenerationStatus?: unknown;
|
|
659
|
+
expressGenerationError?: string | null;
|
|
660
|
+
request_type?: string | null;
|
|
661
|
+
case_type?: string | null;
|
|
662
|
+
message?: string | null;
|
|
663
|
+
[key: string]: unknown;
|
|
664
|
+
}
|
|
665
|
+
export interface CreditTopUpSummary {
|
|
666
|
+
id?: string;
|
|
667
|
+
amountPaidCents?: number;
|
|
668
|
+
currency?: string;
|
|
669
|
+
paymentType?: string;
|
|
670
|
+
paymentStatus?: string;
|
|
671
|
+
billingReason?: string;
|
|
672
|
+
creditsApplied?: number;
|
|
673
|
+
paymentDate?: string;
|
|
674
|
+
stripeInvoiceId?: string;
|
|
675
|
+
stripeInvoiceNumber?: string;
|
|
676
|
+
invoicePdfUrl?: string;
|
|
677
|
+
hostedInvoiceUrl?: string;
|
|
678
|
+
receiptUrl?: string | null;
|
|
679
|
+
receiptAvailable?: boolean;
|
|
680
|
+
productSummary?: string;
|
|
681
|
+
[key: string]: unknown;
|
|
682
|
+
}
|
|
683
|
+
export interface CreditsBalanceResponse {
|
|
684
|
+
remainingCredits: number;
|
|
685
|
+
lastTopUp?: CreditTopUpSummary | null;
|
|
686
|
+
[key: string]: unknown;
|
|
687
|
+
}
|
|
688
|
+
export interface CreateLoginTokenResponse {
|
|
689
|
+
loginToken: string;
|
|
690
|
+
expiresInSeconds?: number;
|
|
691
|
+
expiresAt?: string;
|
|
692
|
+
[key: string]: unknown;
|
|
693
|
+
}
|
|
694
|
+
export interface CreditsRechargeResponse {
|
|
695
|
+
url: string;
|
|
696
|
+
checkoutSessionId?: string | null;
|
|
697
|
+
paymentIntentId?: string | null;
|
|
698
|
+
paymentStatusEndpoint?: string;
|
|
699
|
+
credits: number;
|
|
700
|
+
amountUsd: number;
|
|
701
|
+
amountCents: number;
|
|
702
|
+
currency: string;
|
|
703
|
+
[key: string]: unknown;
|
|
704
|
+
}
|
|
705
|
+
export interface EnableAutoRechargeRequest {
|
|
706
|
+
thresholdCredits?: number;
|
|
707
|
+
amountUsd?: number;
|
|
708
|
+
maxMonthlyUsd?: number;
|
|
709
|
+
requestSetupSession?: boolean;
|
|
710
|
+
paymentMethodId?: string;
|
|
711
|
+
enabled?: boolean;
|
|
712
|
+
[key: string]: unknown;
|
|
713
|
+
}
|
|
714
|
+
export interface AutoRechargeRunSummary {
|
|
715
|
+
status?: string;
|
|
716
|
+
reason?: string;
|
|
717
|
+
invoiceId?: string;
|
|
718
|
+
hostedInvoiceUrl?: string;
|
|
719
|
+
creditsToAdd?: number;
|
|
720
|
+
maxMonthlyUsd?: number;
|
|
721
|
+
monthlyTotalUsd?: number;
|
|
722
|
+
[key: string]: unknown;
|
|
723
|
+
}
|
|
724
|
+
export interface EnableAutoRechargeResponse {
|
|
725
|
+
autoRechargeEnabled?: boolean;
|
|
726
|
+
autoRechargeAmountUsd?: number;
|
|
727
|
+
autoRechargeThreshold?: number;
|
|
728
|
+
autoRechargeMaxMonthlyUsd?: number;
|
|
729
|
+
stripeCustomerId?: string;
|
|
730
|
+
setupSessionUrl?: string | null;
|
|
731
|
+
setupSessionId?: string | null;
|
|
732
|
+
setupIntentId?: string | null;
|
|
733
|
+
checkoutSessionId?: string | null;
|
|
734
|
+
paymentStatusEndpoint?: string;
|
|
735
|
+
url?: string | null;
|
|
736
|
+
hasPaymentMethod?: boolean;
|
|
737
|
+
autoRechargeRun?: AutoRechargeRunSummary | null;
|
|
738
|
+
[key: string]: unknown;
|
|
739
|
+
}
|
|
740
|
+
export interface PaymentStatusRequest {
|
|
741
|
+
checkoutSessionId?: string;
|
|
742
|
+
paymentIntentId?: string;
|
|
743
|
+
setupIntentId?: string;
|
|
744
|
+
}
|
|
745
|
+
export interface PaymentStatusResponse {
|
|
746
|
+
status: 'pending' | 'succeeded' | 'failed';
|
|
747
|
+
mode?: 'payment' | 'setup' | string | null;
|
|
748
|
+
checkoutSessionId?: string | null;
|
|
749
|
+
sessionStatus?: string | null;
|
|
750
|
+
paymentStatus?: string | null;
|
|
751
|
+
paymentIntentId?: string | null;
|
|
752
|
+
paymentIntentStatus?: string | null;
|
|
753
|
+
setupIntentId?: string | null;
|
|
754
|
+
setupIntentStatus?: string | null;
|
|
755
|
+
amountCents?: number | null;
|
|
756
|
+
currency?: string | null;
|
|
757
|
+
[key: string]: unknown;
|
|
758
|
+
}
|
|
759
|
+
export interface UpdateAutoRechargeThresholdRequest {
|
|
760
|
+
thresholdCredits: number;
|
|
761
|
+
[key: string]: unknown;
|
|
762
|
+
}
|
|
763
|
+
export interface UpdateAutoRechargeThresholdResponse {
|
|
764
|
+
autoRechargeEnabled?: boolean;
|
|
765
|
+
autoRechargeThreshold?: number;
|
|
766
|
+
autoRechargeAmountUsd?: number;
|
|
767
|
+
autoRechargeMaxMonthlyUsd?: number;
|
|
768
|
+
[key: string]: unknown;
|
|
769
|
+
}
|
|
770
|
+
export interface SamsarErrorInit {
|
|
771
|
+
status?: number;
|
|
772
|
+
body?: unknown;
|
|
773
|
+
headers?: Record<string, string>;
|
|
774
|
+
url: string;
|
|
775
|
+
creditsCharged?: number;
|
|
776
|
+
creditsRemaining?: number;
|
|
777
|
+
}
|
|
778
|
+
export declare class SamsarRequestError extends Error {
|
|
779
|
+
status?: number;
|
|
780
|
+
body?: unknown;
|
|
781
|
+
headers: Record<string, string>;
|
|
782
|
+
url: string;
|
|
783
|
+
creditsCharged?: number;
|
|
784
|
+
creditsRemaining?: number;
|
|
785
|
+
constructor(message: string, init: SamsarErrorInit);
|
|
786
|
+
}
|
|
787
|
+
export declare class SamsarClient {
|
|
788
|
+
private readonly apiKey;
|
|
789
|
+
private readonly baseUrl;
|
|
790
|
+
private readonly timeoutMs;
|
|
791
|
+
private readonly fetchFn;
|
|
792
|
+
private readonly defaultHeaders;
|
|
793
|
+
constructor(options: SamsarClientOptions);
|
|
794
|
+
/**
|
|
795
|
+
* Create a new video generation job from text.
|
|
796
|
+
*/
|
|
797
|
+
createVideoFromText(input: CreateVideoFromTextInput, options?: {
|
|
798
|
+
webhookUrl?: string;
|
|
799
|
+
} & SamsarRequestOptions): Promise<SamsarResult<CreateVideoResponse>>;
|
|
800
|
+
/**
|
|
801
|
+
* Create a video from a list of image URLs with optional prompt/metadata via the image_list_to_video route.
|
|
802
|
+
*/
|
|
803
|
+
createVideoFromImageList(input: CreateVideoFromImageListInput, options?: {
|
|
804
|
+
webhookUrl?: string;
|
|
805
|
+
} & SamsarRequestOptions): Promise<SamsarResult<CreateVideoFromImageListResponse>>;
|
|
806
|
+
/**
|
|
807
|
+
* Translate an existing video session into a new language.
|
|
808
|
+
* Creates a new session_id and queues generation steps for lip sync + transcription + video render.
|
|
809
|
+
*/
|
|
810
|
+
translateVideo(input: TranslateVideoInput, options?: {
|
|
811
|
+
webhookUrl?: string;
|
|
812
|
+
} & SamsarRequestOptions): Promise<SamsarResult<TranslateVideoResponse>>;
|
|
813
|
+
/**
|
|
814
|
+
* Join multiple existing video sessions into a single session by appending their timelines.
|
|
815
|
+
* Creates a new session_id and queues transcription + frame + video generation.
|
|
816
|
+
*/
|
|
817
|
+
joinVideos(input: JoinVideosInput, options?: {
|
|
818
|
+
webhookUrl?: string;
|
|
819
|
+
} & SamsarRequestOptions): Promise<SamsarResult<JoinVideosResponse>>;
|
|
820
|
+
/**
|
|
821
|
+
* Remove subtitle/transcript text overlays by cloning an existing session and re-running
|
|
822
|
+
* only frame + video generation on the new session.
|
|
823
|
+
*/
|
|
824
|
+
removeSubtitles(input: RemoveSubtitlesInput, options?: {
|
|
825
|
+
webhookUrl?: string;
|
|
826
|
+
} & SamsarRequestOptions): Promise<SamsarResult<RemoveSubtitlesResponse>>;
|
|
827
|
+
/**
|
|
828
|
+
* Cancel an in-progress render for an existing video session.
|
|
829
|
+
*/
|
|
830
|
+
cancelRender(input: CancelRenderInput, options?: SamsarRequestOptions): Promise<SamsarResult<CancelRenderResponse>>;
|
|
831
|
+
/**
|
|
832
|
+
* Update the outro image for an existing video session by cloning it into a new session and re-running
|
|
833
|
+
* only the final video render step.
|
|
834
|
+
*/
|
|
835
|
+
updateVideoOutroImage(input: UpdateVideoOutroImageInput, options?: {
|
|
836
|
+
webhookUrl?: string;
|
|
837
|
+
} & SamsarRequestOptions): Promise<SamsarResult<UpdateVideoOutroImageResponse>>;
|
|
838
|
+
/**
|
|
839
|
+
* Add or replace the outro image for an existing video session by cloning it into a new session and
|
|
840
|
+
* re-running frame/video generation.
|
|
841
|
+
*/
|
|
842
|
+
addVideoOutroImage(input: AddVideoOutroImageInput, options?: {
|
|
843
|
+
webhookUrl?: string;
|
|
844
|
+
} & SamsarRequestOptions): Promise<SamsarResult<AddVideoOutroImageResponse>>;
|
|
845
|
+
/**
|
|
846
|
+
* Fetch the latest available render URL for a given video session id.
|
|
847
|
+
* Maps to GET /video/fetch_latest_version?session_id={sessionId}.
|
|
848
|
+
*/
|
|
849
|
+
fetchLatestVideoVersion(sessionId: string, options?: SamsarRequestOptions): Promise<SamsarResult<FetchLatestVideoVersionResponse>>;
|
|
850
|
+
/**
|
|
851
|
+
* List completed video sessions for the authenticated API key.
|
|
852
|
+
* Maps to GET /video/list_completed_video_sessions.
|
|
853
|
+
*/
|
|
854
|
+
listCompletedVideoSessions(options?: SamsarRequestOptions & {
|
|
855
|
+
limit?: number;
|
|
856
|
+
}): Promise<SamsarResult<ListCompletedVideoSessionsResponse>>;
|
|
857
|
+
/**
|
|
858
|
+
* Fetch the supported image/video model keys for the text_to_video route.
|
|
859
|
+
* Maps to GET /video/supported_models.
|
|
860
|
+
*/
|
|
861
|
+
getSupportedTextToVideoModels(options?: SamsarRequestOptions): Promise<SamsarResult<SupportedTextToVideoModelsResponse>>;
|
|
862
|
+
/**
|
|
863
|
+
* Enhance or rewrite text using the chat enhancement endpoint.
|
|
864
|
+
* Optionally pass `language` (code or name) to enforce the output language.
|
|
865
|
+
*/
|
|
866
|
+
enhanceMessage(payload: EnhanceMessageRequest, options?: SamsarRequestOptions): Promise<SamsarResult<EnhanceMessageResponse>>;
|
|
867
|
+
/**
|
|
868
|
+
* Create a new embedding template and store embeddings for a JSON array.
|
|
869
|
+
*/
|
|
870
|
+
createEmbedding(payload: CreateEmbeddingRequest, options?: SamsarRequestOptions): Promise<SamsarResult<CreateEmbeddingResponse>>;
|
|
871
|
+
/**
|
|
872
|
+
* Update an existing embedding template with additional records.
|
|
873
|
+
*/
|
|
874
|
+
updateEmbedding(payload: UpdateEmbeddingRequest, options?: SamsarRequestOptions): Promise<SamsarResult<UpdateEmbeddingResponse>>;
|
|
875
|
+
/**
|
|
876
|
+
* Delete all embeddings for a template.
|
|
877
|
+
*/
|
|
878
|
+
deleteEmbeddings(payload: DeleteEmbeddingsRequest, options?: SamsarRequestOptions): Promise<SamsarResult<DeleteEmbeddingsResponse>>;
|
|
879
|
+
/**
|
|
880
|
+
* Delete one or more embeddings from a template by record id.
|
|
881
|
+
*/
|
|
882
|
+
deleteEmbedding(payload: DeleteEmbeddingRequest, options?: SamsarRequestOptions): Promise<SamsarResult<DeleteEmbeddingResponse>>;
|
|
883
|
+
/**
|
|
884
|
+
* Search against an embedding template using a natural language query.
|
|
885
|
+
*/
|
|
886
|
+
searchAgainstEmbedding(payload: SearchAgainstEmbeddingRequest, options?: SamsarRequestOptions): Promise<SamsarResult<SearchAgainstEmbeddingResponse>>;
|
|
887
|
+
/**
|
|
888
|
+
* Search against an embedding template using the pluralized endpoint.
|
|
889
|
+
*/
|
|
890
|
+
searchAgainstEmbeddings(payload: SearchAgainstEmbeddingRequest, options?: SamsarRequestOptions): Promise<SamsarResult<SearchAgainstEmbeddingResponse>>;
|
|
891
|
+
/**
|
|
892
|
+
* Find similar records to a query within an embedding template.
|
|
893
|
+
*/
|
|
894
|
+
similarToEmbedding(payload: SimilarToEmbeddingRequest, options?: SamsarRequestOptions): Promise<SamsarResult<SimilarToEmbeddingResponse>>;
|
|
895
|
+
/**
|
|
896
|
+
* List all embedding templates for the API key.
|
|
897
|
+
*/
|
|
898
|
+
listEmbeddingTemplates(options?: SamsarRequestOptions & {
|
|
899
|
+
limit?: number;
|
|
900
|
+
offset?: number;
|
|
901
|
+
}): Promise<SamsarResult<ListEmbeddingTemplatesResponse>>;
|
|
902
|
+
/**
|
|
903
|
+
* Check whether embeddings exist for a template id.
|
|
904
|
+
*/
|
|
905
|
+
getEmbeddingStatus(templateId: string, options?: SamsarRequestOptions): Promise<SamsarResult<EmbeddingStatusResponse>>;
|
|
906
|
+
/**
|
|
907
|
+
* Remove branding/watermark from an image by URL.
|
|
908
|
+
*/
|
|
909
|
+
removeBrandingFromImage(payload: RemoveBrandingFromImageRequest, options?: SamsarRequestOptions): Promise<SamsarResult<RemoveBrandingFromImageResponse>>;
|
|
910
|
+
/**
|
|
911
|
+
* Replace branding/watermark on an image by providing the original and replacement image URLs.
|
|
912
|
+
*/
|
|
913
|
+
replaceBrandingFromImage(payload: ReplaceBrandingFromImageRequest, options?: SamsarRequestOptions): Promise<SamsarResult<ReplaceBrandingFromImageResponse>>;
|
|
914
|
+
/**
|
|
915
|
+
* Enhance an image by upscaling it with the specified resolution.
|
|
916
|
+
*/
|
|
917
|
+
enhanceImage(payload: EnhanceImageRequest, options?: SamsarRequestOptions): Promise<SamsarResult<EnhanceImageResponse>>;
|
|
918
|
+
/**
|
|
919
|
+
* Add or extend a saved image list for the authenticated API key.
|
|
920
|
+
*/
|
|
921
|
+
extendImageList(payload: ExtendImageListRequest, options?: SamsarRequestOptions): Promise<SamsarResult<ExtendImageListResponse>>;
|
|
922
|
+
/**
|
|
923
|
+
* Create a roll-up banner from preprocessed (already enhanced) images.
|
|
924
|
+
*/
|
|
925
|
+
createRollupBanner(payload: CreateRollupBannerRequest, options?: SamsarRequestOptions): Promise<SamsarResult<CreateRollupBannerResponse>>;
|
|
926
|
+
/**
|
|
927
|
+
* Enhance low-resolution images (if needed) and generate a roll-up banner.
|
|
928
|
+
*/
|
|
929
|
+
enhanceAndGenerateRollupBanner(payload: EnhanceAndGenerateRollupBannerRequest, options?: SamsarRequestOptions): Promise<SamsarResult<EnhanceAndGenerateRollupBannerResponse>>;
|
|
930
|
+
/**
|
|
931
|
+
* Fetch the remaining credits and last credit top-up for the API key.
|
|
932
|
+
*/
|
|
933
|
+
getCreditsBalance(options?: SamsarRequestOptions): Promise<SamsarResult<CreditsBalanceResponse>>;
|
|
934
|
+
/**
|
|
935
|
+
* Create a short-lived login token that can be exchanged for an auth token in the client app.
|
|
936
|
+
*/
|
|
937
|
+
createLoginToken(options?: SamsarRequestOptions): Promise<SamsarResult<CreateLoginTokenResponse>>;
|
|
938
|
+
/**
|
|
939
|
+
* Create a Stripe checkout link to recharge a specific number of credits.
|
|
940
|
+
* Business rule: 1 USD = 100 credits.
|
|
941
|
+
*/
|
|
942
|
+
createCreditsRecharge(credits: number, options?: SamsarRequestOptions): Promise<SamsarResult<CreditsRechargeResponse>>;
|
|
943
|
+
/**
|
|
944
|
+
* Enable or update auto-recharge settings for the API key.
|
|
945
|
+
* Returns a Stripe setup URL when a payment method is required.
|
|
946
|
+
*/
|
|
947
|
+
enableAutoRecharge(payload: EnableAutoRechargeRequest, options?: SamsarRequestOptions): Promise<SamsarResult<EnableAutoRechargeResponse>>;
|
|
948
|
+
/**
|
|
949
|
+
* Update the auto-recharge threshold for an enabled account.
|
|
950
|
+
*/
|
|
951
|
+
updateAutoRechargeThreshold(payload: UpdateAutoRechargeThresholdRequest, options?: SamsarRequestOptions): Promise<SamsarResult<UpdateAutoRechargeThresholdResponse>>;
|
|
952
|
+
/**
|
|
953
|
+
* Poll for checkout/payment/setup status using IDs returned by credit recharge or auto-recharge setup.
|
|
954
|
+
*/
|
|
955
|
+
getPaymentStatus(payload: PaymentStatusRequest, options?: SamsarRequestOptions): Promise<SamsarResult<PaymentStatusResponse>>;
|
|
956
|
+
/**
|
|
957
|
+
* Retrieve the status of an asynchronous request by request_id.
|
|
958
|
+
* Defaults to GET /status?request_id={requestId}, but the path can be overridden.
|
|
959
|
+
* Normalizes the response to expose status/result_url for both image and video flows.
|
|
960
|
+
*/
|
|
961
|
+
getStatus(requestId: string, options?: SamsarRequestOptions & {
|
|
962
|
+
path?: string;
|
|
963
|
+
queryParams?: QueryParams;
|
|
964
|
+
}): Promise<SamsarResult<GlobalStatusResponse>>;
|
|
965
|
+
/**
|
|
966
|
+
* Retrieve the status of an image request (maps to GET /image/status).
|
|
967
|
+
*/
|
|
968
|
+
getImageStatus(requestId: string, options?: SamsarRequestOptions & {
|
|
969
|
+
queryParams?: QueryParams;
|
|
970
|
+
}): Promise<SamsarResult<GlobalStatusResponse>>;
|
|
971
|
+
private get;
|
|
972
|
+
private post;
|
|
973
|
+
private request;
|
|
974
|
+
private buildHeaders;
|
|
975
|
+
private buildUrl;
|
|
976
|
+
}
|
|
977
|
+
export default SamsarClient;
|