@aviaryhq/cloudglue-js 0.1.9 → 0.2.1

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.
@@ -4,57 +4,81 @@ exports.DescribeApi = exports.schemas = void 0;
4
4
  exports.createApiClient = createApiClient;
5
5
  const core_1 = require("@zodios/core");
6
6
  const zod_1 = require("zod");
7
+ const common_1 = require("./common");
8
+ const common_2 = require("./common");
9
+ const NewDescribe = zod_1.z
10
+ .object({
11
+ url: zod_1.z.string(),
12
+ enable_summary: zod_1.z.boolean().optional().default(true),
13
+ enable_speech: zod_1.z.boolean().optional().default(true),
14
+ enable_visual_scene_description: zod_1.z.boolean().optional().default(true),
15
+ enable_scene_text: zod_1.z.boolean().optional().default(true),
16
+ thumbnails_config: common_1.ThumbnailsConfig.optional(),
17
+ })
18
+ .strict()
19
+ .passthrough()
20
+ .and(common_2.FileSegmentationConfig);
7
21
  const Describe = zod_1.z
8
22
  .object({
9
23
  job_id: zod_1.z.string(),
10
24
  status: zod_1.z.enum([
11
25
  "pending",
12
26
  "processing",
13
- "ready",
14
27
  "completed",
15
28
  "failed",
16
29
  "not_applicable",
17
30
  ]),
31
+ url: zod_1.z.string().optional(),
32
+ created_at: zod_1.z.number().int().optional(),
33
+ describe_config: zod_1.z
34
+ .object({
35
+ enable_summary: zod_1.z.boolean(),
36
+ enable_speech: zod_1.z.boolean(),
37
+ enable_visual_scene_description: zod_1.z.boolean(),
38
+ enable_scene_text: zod_1.z.boolean(),
39
+ })
40
+ .partial()
41
+ .strict()
42
+ .passthrough()
43
+ .optional(),
18
44
  data: zod_1.z
19
45
  .object({
20
- url: zod_1.z.string(),
46
+ content: zod_1.z.string(),
21
47
  title: zod_1.z.string(),
22
48
  summary: zod_1.z.string(),
23
- segment_docs: zod_1.z.array(zod_1.z
49
+ speech: zod_1.z.array(zod_1.z
24
50
  .object({
25
- segment_id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]),
51
+ text: zod_1.z.string(),
26
52
  start_time: zod_1.z.number(),
27
53
  end_time: zod_1.z.number(),
54
+ })
55
+ .partial()
56
+ .strict()
57
+ .passthrough()),
58
+ visual_scene_description: zod_1.z.array(zod_1.z
59
+ .object({
60
+ text: zod_1.z.string(),
61
+ start_time: zod_1.z.number(),
62
+ end_time: zod_1.z.number(),
63
+ })
64
+ .partial()
65
+ .strict()
66
+ .passthrough()),
67
+ scene_text: zod_1.z.array(zod_1.z
68
+ .object({
69
+ text: zod_1.z.string(),
70
+ start_time: zod_1.z.number(),
71
+ end_time: zod_1.z.number(),
72
+ })
73
+ .partial()
74
+ .strict()
75
+ .passthrough()),
76
+ segment_summary: zod_1.z.array(zod_1.z
77
+ .object({
28
78
  title: zod_1.z.string(),
29
79
  summary: zod_1.z.string(),
30
- visual_description: zod_1.z.array(zod_1.z
31
- .object({
32
- text: zod_1.z.string(),
33
- start_time: zod_1.z.number(),
34
- end_time: zod_1.z.number(),
35
- })
36
- .partial()
37
- .strict()
38
- .passthrough()),
39
- scene_text: zod_1.z.array(zod_1.z
40
- .object({
41
- text: zod_1.z.string(),
42
- start_time: zod_1.z.number(),
43
- end_time: zod_1.z.number(),
44
- })
45
- .partial()
46
- .strict()
47
- .passthrough()),
48
- speech: zod_1.z.array(zod_1.z
49
- .object({
50
- speaker: zod_1.z.string(),
51
- text: zod_1.z.string(),
52
- start_time: zod_1.z.number(),
53
- end_time: zod_1.z.number(),
54
- })
55
- .partial()
56
- .strict()
57
- .passthrough()),
80
+ start_time: zod_1.z.number(),
81
+ end_time: zod_1.z.number(),
58
82
  })
59
83
  .partial()
60
84
  .strict()
@@ -68,30 +92,31 @@ const Describe = zod_1.z
68
92
  })
69
93
  .strict()
70
94
  .passthrough();
71
- const NewDescribe = zod_1.z
95
+ const DescribeList = zod_1.z
72
96
  .object({
73
- url: zod_1.z.string(),
74
- enable_speech: zod_1.z.boolean().optional().default(true),
75
- enable_scene_text: zod_1.z.boolean().optional().default(true),
76
- enable_visual_scene_description: zod_1.z.boolean().optional().default(true),
97
+ object: zod_1.z.literal("list"),
98
+ data: zod_1.z.array(Describe),
99
+ total: zod_1.z.number().int(),
100
+ limit: zod_1.z.number().int(),
77
101
  })
78
102
  .strict()
79
103
  .passthrough();
80
104
  exports.schemas = {
81
- Describe,
82
105
  NewDescribe,
106
+ Describe,
107
+ DescribeList,
83
108
  };
84
109
  const endpoints = (0, core_1.makeApi)([
85
110
  {
86
111
  method: "post",
87
112
  path: "/describe",
88
113
  alias: "createDescribe",
89
- description: `Creates a new describe job for comprehensive video description and transcription`,
114
+ description: `Get a comprehensive multimodal description of a video`,
90
115
  requestFormat: "json",
91
116
  parameters: [
92
117
  {
93
118
  name: "body",
94
- description: `Generate rich, multimodal descriptions of video content`,
119
+ description: `Media description job parameters`,
95
120
  type: "Body",
96
121
  schema: NewDescribe,
97
122
  },
@@ -100,27 +125,87 @@ const endpoints = (0, core_1.makeApi)([
100
125
  errors: [
101
126
  {
102
127
  status: 400,
103
- description: `Invalid request or describe config requires at least one option enabled`,
128
+ description: `Invalid request or missing required url/file_id`,
104
129
  schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
105
130
  },
106
131
  {
107
132
  status: 404,
108
- description: `Describe job not found`,
133
+ description: `File not found`,
109
134
  schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
110
135
  },
111
136
  {
112
137
  status: 429,
113
- description: `Too many requests`,
138
+ description: `Chat completion limits reached (monthly or daily)`,
114
139
  schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
115
140
  },
116
141
  {
117
- status: 500,
118
- description: `An unexpected error occurred on the server`,
142
+ status: 509,
143
+ description: `Monthly description jobs limit reached`,
119
144
  schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
120
145
  },
146
+ ],
147
+ },
148
+ {
149
+ method: "get",
150
+ path: "/describe",
151
+ alias: "listDescribes",
152
+ description: `List all media description jobs with optional filtering`,
153
+ requestFormat: "json",
154
+ parameters: [
121
155
  {
122
- status: 509,
123
- description: `Monthly describe jobs limit reached`,
156
+ name: "limit",
157
+ type: "Query",
158
+ schema: zod_1.z.number().int().lte(100).optional().default(20),
159
+ },
160
+ {
161
+ name: "offset",
162
+ type: "Query",
163
+ schema: zod_1.z.number().int().optional().default(0),
164
+ },
165
+ {
166
+ name: "status",
167
+ type: "Query",
168
+ schema: zod_1.z
169
+ .enum([
170
+ "pending",
171
+ "processing",
172
+ "completed",
173
+ "failed",
174
+ "not_applicable",
175
+ ])
176
+ .optional(),
177
+ },
178
+ {
179
+ name: "created_before",
180
+ type: "Query",
181
+ schema: zod_1.z.string().optional(),
182
+ },
183
+ {
184
+ name: "created_after",
185
+ type: "Query",
186
+ schema: zod_1.z.string().optional(),
187
+ },
188
+ {
189
+ name: "url",
190
+ type: "Query",
191
+ schema: zod_1.z.string().optional(),
192
+ },
193
+ {
194
+ name: "response_format",
195
+ type: "Query",
196
+ schema: zod_1.z.enum(["json", "markdown"]).optional().default("json"),
197
+ },
198
+ ],
199
+ response: DescribeList,
200
+ errors: [
201
+ {
202
+ status: 400,
203
+ description: `Invalid request parameters`,
204
+ schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
205
+ },
206
+ {
207
+ status: 500,
208
+ description: `An unexpected error occurred on the server`,
124
209
  schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
125
210
  },
126
211
  ],
@@ -129,7 +214,7 @@ const endpoints = (0, core_1.makeApi)([
129
214
  method: "get",
130
215
  path: "/describe/:job_id",
131
216
  alias: "getDescribe",
132
- description: `Retrieve the current state of a describe job`,
217
+ description: `Retrieve the current state of a media description job`,
133
218
  requestFormat: "json",
134
219
  parameters: [
135
220
  {
@@ -137,6 +222,11 @@ const endpoints = (0, core_1.makeApi)([
137
222
  type: "Path",
138
223
  schema: zod_1.z.string(),
139
224
  },
225
+ {
226
+ name: "response_format",
227
+ type: "Query",
228
+ schema: zod_1.z.enum(["json", "markdown"]).optional().default("json"),
229
+ },
140
230
  ],
141
231
  response: Describe,
142
232
  errors: [
@@ -50,7 +50,7 @@ export declare const ExtractApi: import("@zodios/core").ZodiosInstance<[{
50
50
  method: "post";
51
51
  path: "/extract";
52
52
  alias: "createExtract";
53
- description: "Creates a new extract";
53
+ description: "Extract structured data from a video";
54
54
  requestFormat: "json";
55
55
  parameters: [{
56
56
  name: "body";
@@ -211,7 +211,7 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
211
211
  method: "post";
212
212
  path: "/extract";
213
213
  alias: "createExtract";
214
- description: "Creates a new extract";
214
+ description: "Extract structured data from a video";
215
215
  requestFormat: "json";
216
216
  parameters: [{
217
217
  name: "body";
@@ -82,12 +82,12 @@ const endpoints = (0, core_1.makeApi)([
82
82
  method: "post",
83
83
  path: "/extract",
84
84
  alias: "createExtract",
85
- description: `Creates a new extract`,
85
+ description: `Extract structured data from a video`,
86
86
  requestFormat: "json",
87
87
  parameters: [
88
88
  {
89
89
  name: "body",
90
- description: `Extract structured data from a video`,
90
+ description: `Extract job parameters`,
91
91
  type: "Body",
92
92
  schema: NewExtract,
93
93
  },
@@ -24,6 +24,7 @@ type FileSearchResult = {
24
24
  filename?: (string | null) | undefined;
25
25
  summary?: (string | null) | undefined;
26
26
  generated_title?: (string | null) | undefined;
27
+ thumbnail_url?: string | undefined;
27
28
  };
28
29
  type SegmentSearchResult = {
29
30
  type: "segment";
@@ -51,6 +52,7 @@ type SegmentSearchResult = {
51
52
  start_time: number;
52
53
  end_time: number;
53
54
  }>> | undefined;
55
+ thumbnail_url?: string | undefined;
54
56
  };
55
57
  type SearchFilter = Partial<{
56
58
  metadata: Array<SearchFilterCriteria>;
@@ -101,7 +103,7 @@ export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
101
103
  method: "post";
102
104
  path: "/search";
103
105
  alias: "searchContent";
104
- description: "Search for videos or video segments in collections to find relevant videos or moments/clips in a video. Supports filtering by metadata, video info, and file properties.\n\n**Important:** Currently only rich-transcript collections support search. For file-level search (scope&#x3D;&#x27;file&#x27;), the collection must be configured with &#x27;enable_summary: true&#x27; in the transcribe_config.";
106
+ description: "Search for videos or video segments in collections to find relevant videos or moments/clips in a video";
105
107
  requestFormat: "json";
106
108
  parameters: [{
107
109
  name: "body";
@@ -146,7 +148,7 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
146
148
  method: "post";
147
149
  path: "/search";
148
150
  alias: "searchContent";
149
- description: "Search for videos or video segments in collections to find relevant videos or moments/clips in a video. Supports filtering by metadata, video info, and file properties.\n\n**Important:** Currently only rich-transcript collections support search. For file-level search (scope&#x3D;&#x27;file&#x27;), the collection must be configured with &#x27;enable_summary: true&#x27; in the transcribe_config.";
151
+ description: "Search for videos or video segments in collections to find relevant videos or moments/clips in a video";
150
152
  requestFormat: "json";
151
153
  parameters: [{
152
154
  name: "body";
@@ -60,6 +60,7 @@ const FileSearchResult = zod_1.z
60
60
  filename: zod_1.z.string().nullish(),
61
61
  summary: zod_1.z.string().nullish(),
62
62
  generated_title: zod_1.z.string().nullish(),
63
+ thumbnail_url: zod_1.z.string().url().optional(),
63
64
  })
64
65
  .strict()
65
66
  .passthrough();
@@ -108,6 +109,7 @@ const SegmentSearchResult = zod_1.z
108
109
  .strict()
109
110
  .passthrough())
110
111
  .optional(),
112
+ thumbnail_url: zod_1.z.string().url().optional(),
111
113
  })
112
114
  .strict()
113
115
  .passthrough();
@@ -135,9 +137,7 @@ const endpoints = (0, core_1.makeApi)([
135
137
  method: "post",
136
138
  path: "/search",
137
139
  alias: "searchContent",
138
- description: `Search for videos or video segments in collections to find relevant videos or moments/clips in a video. Supports filtering by metadata, video info, and file properties.
139
-
140
- **Important:** Currently only rich-transcript collections support search. For file-level search (scope&#x3D;&#x27;file&#x27;), the collection must be configured with &#x27;enable_summary: true&#x27; in the transcribe_config.`,
140
+ description: `Search for videos or video segments in collections to find relevant videos or moments/clips in a video`,
141
141
  requestFormat: "json",
142
142
  parameters: [
143
143
  {
@@ -67,7 +67,7 @@ export declare const TranscribeApi: import("@zodios/core").ZodiosInstance<[{
67
67
  method: "post";
68
68
  path: "/transcribe";
69
69
  alias: "createTranscribe";
70
- description: "Creates a new transcription job for video content";
70
+ description: "Creates a new transcription job for video content.\n\nNote: For most use cases, you should use the &#x60;/describe&#x60; endpoint instead. This API will be deprecated in the future and only supports speech level understanding.";
71
71
  requestFormat: "json";
72
72
  parameters: [{
73
73
  name: "body";
@@ -216,7 +216,7 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
216
216
  method: "post";
217
217
  path: "/transcribe";
218
218
  alias: "createTranscribe";
219
- description: "Creates a new transcription job for video content";
219
+ description: "Creates a new transcription job for video content.\n\nNote: For most use cases, you should use the &#x60;/describe&#x60; endpoint instead. This API will be deprecated in the future and only supports speech level understanding.";
220
220
  requestFormat: "json";
221
221
  parameters: [{
222
222
  name: "body";
@@ -111,7 +111,9 @@ const endpoints = (0, core_1.makeApi)([
111
111
  method: "post",
112
112
  path: "/transcribe",
113
113
  alias: "createTranscribe",
114
- description: `Creates a new transcription job for video content`,
114
+ description: `Creates a new transcription job for video content.
115
+
116
+ Note: For most use cases, you should use the &#x60;/describe&#x60; endpoint instead. This API will be deprecated in the future and only supports speech level understanding.`,
115
117
  requestFormat: "json",
116
118
  parameters: [
117
119
  {
@@ -3,6 +3,7 @@ export { FilesApi } from "./Files";
3
3
  export { CollectionsApi } from "./Collections";
4
4
  export { ChatApi } from "./Chat";
5
5
  export { TranscribeApi } from "./Transcribe";
6
+ export { DescribeApi } from "./Describe";
6
7
  export { WebhooksApi } from "./Webhooks";
7
8
  export { SearchApi } from "./Search";
8
9
  export { SegmentationsApi } from "./Segmentations";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SegmentationsApi = exports.SearchApi = exports.WebhooksApi = exports.TranscribeApi = exports.ChatApi = exports.CollectionsApi = exports.FilesApi = exports.ExtractApi = void 0;
3
+ exports.SegmentationsApi = exports.SearchApi = exports.WebhooksApi = exports.DescribeApi = exports.TranscribeApi = exports.ChatApi = exports.CollectionsApi = exports.FilesApi = exports.ExtractApi = void 0;
4
4
  var Extract_1 = require("./Extract");
5
5
  Object.defineProperty(exports, "ExtractApi", { enumerable: true, get: function () { return Extract_1.ExtractApi; } });
6
6
  var Files_1 = require("./Files");
@@ -11,6 +11,8 @@ var Chat_1 = require("./Chat");
11
11
  Object.defineProperty(exports, "ChatApi", { enumerable: true, get: function () { return Chat_1.ChatApi; } });
12
12
  var Transcribe_1 = require("./Transcribe");
13
13
  Object.defineProperty(exports, "TranscribeApi", { enumerable: true, get: function () { return Transcribe_1.TranscribeApi; } });
14
+ var Describe_1 = require("./Describe");
15
+ Object.defineProperty(exports, "DescribeApi", { enumerable: true, get: function () { return Describe_1.DescribeApi; } });
14
16
  var Webhooks_1 = require("./Webhooks");
15
17
  Object.defineProperty(exports, "WebhooksApi", { enumerable: true, get: function () { return Webhooks_1.WebhooksApi; } });
16
18
  var Search_1 = require("./Search");