@golpoai/sdk 0.1.9 → 1.0.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/dist/index.d.cts CHANGED
@@ -1,36 +1,57 @@
1
+ interface CreateVideoRecordOptions {
2
+ topic: string;
3
+ userEmail?: string;
4
+ context?: string;
5
+ scenes?: number;
6
+ pipeline?: string;
7
+ shareDocuments?: boolean;
8
+ logoPlacement?: string;
9
+ audioClipUrl?: string;
10
+ requestPayload?: any;
11
+ videoId?: string;
12
+ }
1
13
  interface CreatePodcastOptions {
2
14
  uploads?: string | Iterable<string>;
3
- addMusic?: boolean;
4
15
  voiceInstructions?: string;
5
- personality1?: string;
6
- personality2?: string;
7
- doResearch?: boolean;
8
- ttsModel?: 'accurate' | 'fast';
9
16
  language?: string;
10
- style?: 'conversational' | 'solo-male' | 'solo-female';
11
- bgMusic?: 'jazz' | 'lofi' | 'dramatic' | null;
12
- outputVolume?: number;
17
+ style?: 'solo-male-4' | 'solo-female-4' | 'solo-male-3' | 'solo-female-3';
18
+ bgMusic?: 'jazz' | 'lofi' | 'dramatic' | 'whimsical' | 'engaging' | 'hyper' | 'inspirational' | 'documentary' | null;
13
19
  pollIntervalMs?: number;
14
- concurrency?: number;
15
- no_voice_chunking?: boolean;
20
+ newScript?: string;
21
+ timing?: 0.25 | 0.5 | 1 | 2 | 4 | 8 | 10;
16
22
  }
17
23
  interface CreateVideoOptions {
18
24
  uploads?: string | Iterable<string>;
19
25
  voiceInstructions?: string;
20
- personality1?: string;
21
- doResearch?: boolean;
22
- ttsModel?: 'accurate' | 'fast';
23
26
  language?: string;
24
- style?: 'solo-male' | 'solo-female';
25
- bgMusic?: 'engaging' | 'lofi' | null;
26
- bgVolume?: number;
27
- outputVolume?: number;
27
+ style?: 'solo-male-3' | 'solo-female-3' | 'solo-male-4' | 'solo-female-4';
28
+ bgMusic?: 'jazz' | 'lofi' | 'dramatic' | 'whimsical' | 'engaging' | 'hyper' | 'inspirational' | 'documentary' | null;
28
29
  videoType?: 'short' | 'long';
29
30
  includeWatermark?: boolean;
30
31
  logo?: string;
31
- timing?: '1' | '2';
32
+ timing?: 0.25 | 0.5 | 1 | 2 | 4 | 8 | 10;
32
33
  pollIntervalMs?: number;
33
- concurrency?: number;
34
+ useColor?: boolean;
35
+ newScript?: string;
36
+ logoPlacement?: string;
37
+ videoInstructions?: string;
38
+ useLineart2Style?: string;
39
+ audioClip?: string | string[];
40
+ isPublic?: boolean;
41
+ useAsIs?: string | boolean[];
42
+ skipAnimation?: string | boolean[];
43
+ userImages?: string | string[];
44
+ userImagesDescriptions?: string | string[];
45
+ userVideos?: string | string[];
46
+ userVideosDescription?: string | string[];
47
+ userAudioInVideo?: string;
48
+ use2Style?: boolean;
49
+ imageStyle?: 'neon' | 'whiteboard' | 'modern_minimal' | 'playful' | 'technical' | 'editorial';
50
+ inputImages?: string | string[];
51
+ penStyle?: 'stylus' | 'marker' | 'pen';
52
+ showPencilCursor?: boolean;
53
+ pacing?: 'normal' | 'fast';
54
+ justReturnScript?: boolean;
34
55
  }
35
56
  interface EditVideoOptions {
36
57
  frameIds: string[];
@@ -41,11 +62,35 @@ interface EditVideoOptions {
41
62
  pollIntervalMs?: number;
42
63
  autoCombine?: boolean;
43
64
  }
65
+ interface FrameAnimations {
66
+ [frameId: string]: string;
67
+ }
44
68
  interface CombineVideosOptions {
45
69
  mp4Urls: string[];
46
70
  videoUrl?: string;
47
71
  pollIntervalMs?: number;
48
72
  }
73
+ /**
74
+ * Result of createPodcast or createVideo (generated content URL, script, and job ID).
75
+ */
76
+ interface GenerationResult {
77
+ url: string;
78
+ script: string;
79
+ videoId: string;
80
+ }
81
+ /**
82
+ * Result of editVideo (edited or combined video URL and job ID).
83
+ */
84
+ interface VideoEditResult {
85
+ videoUrl: string;
86
+ jobId: string;
87
+ }
88
+ /**
89
+ * Result of combineVideos (URL of the combined video).
90
+ */
91
+ interface CombinedVideoResult {
92
+ url: string;
93
+ }
49
94
  declare class Golpo {
50
95
  private readonly http;
51
96
  constructor(apiKey: string, baseUrl?: string);
@@ -57,23 +102,20 @@ declare class Golpo {
57
102
  podcastUrl: string;
58
103
  podcastScript: string;
59
104
  }>;
60
- createPodcast(prompt: string, opts?: CreatePodcastOptions): Promise<{
61
- podcastUrl: string;
62
- podcastScript: string;
63
- }>;
64
- createVideo(prompt: string, opts?: CreateVideoOptions): Promise<{
65
- videoUrl: string;
66
- videoScript: string;
67
- }>;
105
+ createPodcast(prompt: string, opts?: CreatePodcastOptions): Promise<GenerationResult>;
106
+ createVideo(prompt: string, opts?: CreateVideoOptions): Promise<GenerationResult>;
107
+ /**
108
+ * Private helper: Get user email from API key
109
+ * Backend resolves: api_key -> user_id -> user_credits.email
110
+ */
111
+ private getUserEmailFromApiKey;
112
+ private createVideoRecord;
68
113
  /**
69
114
  * Edit specific frames of a video and regenerate the video.
70
115
  * This method polls until completion and returns the final edited video URL.
71
116
  * If autoCombine is true, it will also combine all frames into a final video.
72
117
  */
73
- editVideo(videoId: string, opts: EditVideoOptions): Promise<{
74
- videoUrl: string;
75
- jobId: string;
76
- }>;
118
+ editVideo(videoId: string, opts: EditVideoOptions): Promise<VideoEditResult>;
77
119
  /**
78
120
  * Combines edited frames into a final video with audio.
79
121
  * This is a helper method used by editVideo when autoCombine is enabled.
@@ -99,7 +141,7 @@ declare class Golpo {
99
141
  * Returns a dictionary mapping frame indices to animation URLs.
100
142
  * This is a convenience method that extracts frame_animations from getFrameVersions.
101
143
  */
102
- private getFrameAnimations;
144
+ getFrameAnimations(videoId: string): Promise<FrameAnimations>;
103
145
  /**
104
146
  * Get frame versions and animations for a video.
105
147
  * Returns both the current frame_animations and available frame_animation_versions.
@@ -114,10 +156,15 @@ declare class Golpo {
114
156
  * Combine multiple MP4 videos into a single video.
115
157
  * This is used to combine frame animations into a final video.
116
158
  */
117
- combineVideos(opts: CombineVideosOptions): Promise<string>;
159
+ combineVideos(opts: CombineVideosOptions): Promise<CombinedVideoResult>;
118
160
  private pollUntilComplete;
119
161
  private pollEditStatus;
162
+ /**
163
+ * Upload a file using /upload-url endpoint and return the final URL.
164
+ * Replicates the _presign_and_upload_one logic from the backend.
165
+ */
166
+ private uploadFileAndGetUrl;
120
167
  private createFormData;
121
168
  }
122
169
 
123
- export { type CombineVideosOptions, type CreatePodcastOptions, type CreateVideoOptions, type EditVideoOptions, Golpo, Golpo as default };
170
+ export { type CombineVideosOptions, type CombinedVideoResult, type CreatePodcastOptions, type CreateVideoOptions, type CreateVideoRecordOptions, type EditVideoOptions, type GenerationResult, Golpo, type VideoEditResult, Golpo as default };
package/dist/index.d.ts CHANGED
@@ -1,36 +1,57 @@
1
+ interface CreateVideoRecordOptions {
2
+ topic: string;
3
+ userEmail?: string;
4
+ context?: string;
5
+ scenes?: number;
6
+ pipeline?: string;
7
+ shareDocuments?: boolean;
8
+ logoPlacement?: string;
9
+ audioClipUrl?: string;
10
+ requestPayload?: any;
11
+ videoId?: string;
12
+ }
1
13
  interface CreatePodcastOptions {
2
14
  uploads?: string | Iterable<string>;
3
- addMusic?: boolean;
4
15
  voiceInstructions?: string;
5
- personality1?: string;
6
- personality2?: string;
7
- doResearch?: boolean;
8
- ttsModel?: 'accurate' | 'fast';
9
16
  language?: string;
10
- style?: 'conversational' | 'solo-male' | 'solo-female';
11
- bgMusic?: 'jazz' | 'lofi' | 'dramatic' | null;
12
- outputVolume?: number;
17
+ style?: 'solo-male-4' | 'solo-female-4' | 'solo-male-3' | 'solo-female-3';
18
+ bgMusic?: 'jazz' | 'lofi' | 'dramatic' | 'whimsical' | 'engaging' | 'hyper' | 'inspirational' | 'documentary' | null;
13
19
  pollIntervalMs?: number;
14
- concurrency?: number;
15
- no_voice_chunking?: boolean;
20
+ newScript?: string;
21
+ timing?: 0.25 | 0.5 | 1 | 2 | 4 | 8 | 10;
16
22
  }
17
23
  interface CreateVideoOptions {
18
24
  uploads?: string | Iterable<string>;
19
25
  voiceInstructions?: string;
20
- personality1?: string;
21
- doResearch?: boolean;
22
- ttsModel?: 'accurate' | 'fast';
23
26
  language?: string;
24
- style?: 'solo-male' | 'solo-female';
25
- bgMusic?: 'engaging' | 'lofi' | null;
26
- bgVolume?: number;
27
- outputVolume?: number;
27
+ style?: 'solo-male-3' | 'solo-female-3' | 'solo-male-4' | 'solo-female-4';
28
+ bgMusic?: 'jazz' | 'lofi' | 'dramatic' | 'whimsical' | 'engaging' | 'hyper' | 'inspirational' | 'documentary' | null;
28
29
  videoType?: 'short' | 'long';
29
30
  includeWatermark?: boolean;
30
31
  logo?: string;
31
- timing?: '1' | '2';
32
+ timing?: 0.25 | 0.5 | 1 | 2 | 4 | 8 | 10;
32
33
  pollIntervalMs?: number;
33
- concurrency?: number;
34
+ useColor?: boolean;
35
+ newScript?: string;
36
+ logoPlacement?: string;
37
+ videoInstructions?: string;
38
+ useLineart2Style?: string;
39
+ audioClip?: string | string[];
40
+ isPublic?: boolean;
41
+ useAsIs?: string | boolean[];
42
+ skipAnimation?: string | boolean[];
43
+ userImages?: string | string[];
44
+ userImagesDescriptions?: string | string[];
45
+ userVideos?: string | string[];
46
+ userVideosDescription?: string | string[];
47
+ userAudioInVideo?: string;
48
+ use2Style?: boolean;
49
+ imageStyle?: 'neon' | 'whiteboard' | 'modern_minimal' | 'playful' | 'technical' | 'editorial';
50
+ inputImages?: string | string[];
51
+ penStyle?: 'stylus' | 'marker' | 'pen';
52
+ showPencilCursor?: boolean;
53
+ pacing?: 'normal' | 'fast';
54
+ justReturnScript?: boolean;
34
55
  }
35
56
  interface EditVideoOptions {
36
57
  frameIds: string[];
@@ -41,11 +62,35 @@ interface EditVideoOptions {
41
62
  pollIntervalMs?: number;
42
63
  autoCombine?: boolean;
43
64
  }
65
+ interface FrameAnimations {
66
+ [frameId: string]: string;
67
+ }
44
68
  interface CombineVideosOptions {
45
69
  mp4Urls: string[];
46
70
  videoUrl?: string;
47
71
  pollIntervalMs?: number;
48
72
  }
73
+ /**
74
+ * Result of createPodcast or createVideo (generated content URL, script, and job ID).
75
+ */
76
+ interface GenerationResult {
77
+ url: string;
78
+ script: string;
79
+ videoId: string;
80
+ }
81
+ /**
82
+ * Result of editVideo (edited or combined video URL and job ID).
83
+ */
84
+ interface VideoEditResult {
85
+ videoUrl: string;
86
+ jobId: string;
87
+ }
88
+ /**
89
+ * Result of combineVideos (URL of the combined video).
90
+ */
91
+ interface CombinedVideoResult {
92
+ url: string;
93
+ }
49
94
  declare class Golpo {
50
95
  private readonly http;
51
96
  constructor(apiKey: string, baseUrl?: string);
@@ -57,23 +102,20 @@ declare class Golpo {
57
102
  podcastUrl: string;
58
103
  podcastScript: string;
59
104
  }>;
60
- createPodcast(prompt: string, opts?: CreatePodcastOptions): Promise<{
61
- podcastUrl: string;
62
- podcastScript: string;
63
- }>;
64
- createVideo(prompt: string, opts?: CreateVideoOptions): Promise<{
65
- videoUrl: string;
66
- videoScript: string;
67
- }>;
105
+ createPodcast(prompt: string, opts?: CreatePodcastOptions): Promise<GenerationResult>;
106
+ createVideo(prompt: string, opts?: CreateVideoOptions): Promise<GenerationResult>;
107
+ /**
108
+ * Private helper: Get user email from API key
109
+ * Backend resolves: api_key -> user_id -> user_credits.email
110
+ */
111
+ private getUserEmailFromApiKey;
112
+ private createVideoRecord;
68
113
  /**
69
114
  * Edit specific frames of a video and regenerate the video.
70
115
  * This method polls until completion and returns the final edited video URL.
71
116
  * If autoCombine is true, it will also combine all frames into a final video.
72
117
  */
73
- editVideo(videoId: string, opts: EditVideoOptions): Promise<{
74
- videoUrl: string;
75
- jobId: string;
76
- }>;
118
+ editVideo(videoId: string, opts: EditVideoOptions): Promise<VideoEditResult>;
77
119
  /**
78
120
  * Combines edited frames into a final video with audio.
79
121
  * This is a helper method used by editVideo when autoCombine is enabled.
@@ -99,7 +141,7 @@ declare class Golpo {
99
141
  * Returns a dictionary mapping frame indices to animation URLs.
100
142
  * This is a convenience method that extracts frame_animations from getFrameVersions.
101
143
  */
102
- private getFrameAnimations;
144
+ getFrameAnimations(videoId: string): Promise<FrameAnimations>;
103
145
  /**
104
146
  * Get frame versions and animations for a video.
105
147
  * Returns both the current frame_animations and available frame_animation_versions.
@@ -114,10 +156,15 @@ declare class Golpo {
114
156
  * Combine multiple MP4 videos into a single video.
115
157
  * This is used to combine frame animations into a final video.
116
158
  */
117
- combineVideos(opts: CombineVideosOptions): Promise<string>;
159
+ combineVideos(opts: CombineVideosOptions): Promise<CombinedVideoResult>;
118
160
  private pollUntilComplete;
119
161
  private pollEditStatus;
162
+ /**
163
+ * Upload a file using /upload-url endpoint and return the final URL.
164
+ * Replicates the _presign_and_upload_one logic from the backend.
165
+ */
166
+ private uploadFileAndGetUrl;
120
167
  private createFormData;
121
168
  }
122
169
 
123
- export { type CombineVideosOptions, type CreatePodcastOptions, type CreateVideoOptions, type EditVideoOptions, Golpo, Golpo as default };
170
+ export { type CombineVideosOptions, type CombinedVideoResult, type CreatePodcastOptions, type CreateVideoOptions, type CreateVideoRecordOptions, type EditVideoOptions, type GenerationResult, Golpo, type VideoEditResult, Golpo as default };