@aviaryhq/cloudglue-js 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/Collections.d.ts +785 -4
- package/dist/generated/Collections.js +148 -1
- package/dist/generated/Search.d.ts +85 -14
- package/dist/generated/Search.js +37 -6
- package/dist/generated/Segments.d.ts +21 -3
- package/dist/generated/Segments.js +35 -4
- package/dist/src/client.d.ts +173 -18
- package/dist/src/client.js +7 -1
- package/dist/src/types.d.ts +8 -0
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ const Collection = zod_1.z
|
|
|
19
19
|
"media-descriptions",
|
|
20
20
|
"entities",
|
|
21
21
|
"rich-transcripts",
|
|
22
|
+
"face-analysis",
|
|
22
23
|
]),
|
|
23
24
|
extract_config: zod_1.z
|
|
24
25
|
.object({
|
|
@@ -57,6 +58,33 @@ const Collection = zod_1.z
|
|
|
57
58
|
.optional(),
|
|
58
59
|
default_segmentation_config: common_1.SegmentationConfig.optional(),
|
|
59
60
|
default_thumbnails_config: common_2.ThumbnailsConfig.optional(),
|
|
61
|
+
face_detection_config: zod_1.z
|
|
62
|
+
.object({
|
|
63
|
+
frame_extraction_config: zod_1.z
|
|
64
|
+
.object({
|
|
65
|
+
strategy: zod_1.z.literal("uniform"),
|
|
66
|
+
uniform_config: zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
frames_per_second: zod_1.z.number().gte(0.1).lte(30).default(1),
|
|
69
|
+
max_width: zod_1.z.number().gte(64).lte(4096).default(1024),
|
|
70
|
+
})
|
|
71
|
+
.partial()
|
|
72
|
+
.strict()
|
|
73
|
+
.passthrough()
|
|
74
|
+
.optional(),
|
|
75
|
+
})
|
|
76
|
+
.strict()
|
|
77
|
+
.passthrough(),
|
|
78
|
+
thumbnails_config: zod_1.z
|
|
79
|
+
.object({ enable_frame_thumbnails: zod_1.z.boolean().default(true) })
|
|
80
|
+
.partial()
|
|
81
|
+
.strict()
|
|
82
|
+
.passthrough(),
|
|
83
|
+
})
|
|
84
|
+
.partial()
|
|
85
|
+
.strict()
|
|
86
|
+
.passthrough()
|
|
87
|
+
.nullish(),
|
|
60
88
|
created_at: zod_1.z.number().int(),
|
|
61
89
|
file_count: zod_1.z.number().int(),
|
|
62
90
|
})
|
|
@@ -68,6 +96,7 @@ const NewCollection = zod_1.z
|
|
|
68
96
|
"media-descriptions",
|
|
69
97
|
"entities",
|
|
70
98
|
"rich-transcripts",
|
|
99
|
+
"face-analysis",
|
|
71
100
|
]),
|
|
72
101
|
name: zod_1.z.string(),
|
|
73
102
|
description: zod_1.z.string().nullish(),
|
|
@@ -108,6 +137,33 @@ const NewCollection = zod_1.z
|
|
|
108
137
|
.optional(),
|
|
109
138
|
default_segmentation_config: common_1.SegmentationConfig.optional(),
|
|
110
139
|
default_thumbnails_config: common_2.ThumbnailsConfig.optional(),
|
|
140
|
+
face_detection_config: zod_1.z
|
|
141
|
+
.object({
|
|
142
|
+
frame_extraction_config: zod_1.z
|
|
143
|
+
.object({
|
|
144
|
+
strategy: zod_1.z.literal("uniform"),
|
|
145
|
+
uniform_config: zod_1.z
|
|
146
|
+
.object({
|
|
147
|
+
frames_per_second: zod_1.z.number().gte(0.1).lte(30).default(1),
|
|
148
|
+
max_width: zod_1.z.number().gte(64).lte(4096).default(1024),
|
|
149
|
+
})
|
|
150
|
+
.partial()
|
|
151
|
+
.strict()
|
|
152
|
+
.passthrough()
|
|
153
|
+
.optional(),
|
|
154
|
+
})
|
|
155
|
+
.strict()
|
|
156
|
+
.passthrough(),
|
|
157
|
+
thumbnails_config: zod_1.z
|
|
158
|
+
.object({ enable_frame_thumbnails: zod_1.z.boolean().default(true) })
|
|
159
|
+
.partial()
|
|
160
|
+
.strict()
|
|
161
|
+
.passthrough(),
|
|
162
|
+
})
|
|
163
|
+
.partial()
|
|
164
|
+
.strict()
|
|
165
|
+
.passthrough()
|
|
166
|
+
.optional(),
|
|
111
167
|
})
|
|
112
168
|
.strict()
|
|
113
169
|
.passthrough();
|
|
@@ -366,6 +422,34 @@ const CollectionEntitiesList = zod_1.z
|
|
|
366
422
|
})
|
|
367
423
|
.strict()
|
|
368
424
|
.passthrough();
|
|
425
|
+
const FileFaceDetections = zod_1.z
|
|
426
|
+
.object({
|
|
427
|
+
collection_id: zod_1.z.string(),
|
|
428
|
+
file_id: zod_1.z.string(),
|
|
429
|
+
faces: zod_1.z.array(zod_1.z
|
|
430
|
+
.object({
|
|
431
|
+
id: zod_1.z.string().uuid(),
|
|
432
|
+
face_bounding_box: zod_1.z
|
|
433
|
+
.object({
|
|
434
|
+
height: zod_1.z.number().gte(0).lte(1),
|
|
435
|
+
width: zod_1.z.number().gte(0).lte(1),
|
|
436
|
+
top: zod_1.z.number().gte(0).lte(1),
|
|
437
|
+
left: zod_1.z.number().gte(0).lte(1),
|
|
438
|
+
})
|
|
439
|
+
.strict()
|
|
440
|
+
.passthrough(),
|
|
441
|
+
frame_id: zod_1.z.string().uuid(),
|
|
442
|
+
timestamp: zod_1.z.number().gte(0),
|
|
443
|
+
thumbnail_url: zod_1.z.string().optional(),
|
|
444
|
+
})
|
|
445
|
+
.strict()
|
|
446
|
+
.passthrough()),
|
|
447
|
+
total: zod_1.z.number().int(),
|
|
448
|
+
limit: zod_1.z.number().int(),
|
|
449
|
+
offset: zod_1.z.number().int(),
|
|
450
|
+
})
|
|
451
|
+
.strict()
|
|
452
|
+
.passthrough();
|
|
369
453
|
exports.schemas = {
|
|
370
454
|
Collection,
|
|
371
455
|
NewCollection,
|
|
@@ -382,6 +466,7 @@ exports.schemas = {
|
|
|
382
466
|
CollectionFileDelete,
|
|
383
467
|
FileEntities,
|
|
384
468
|
CollectionEntitiesList,
|
|
469
|
+
FileFaceDetections,
|
|
385
470
|
};
|
|
386
471
|
const endpoints = (0, core_1.makeApi)([
|
|
387
472
|
{
|
|
@@ -453,9 +538,24 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
453
538
|
name: "collection_type",
|
|
454
539
|
type: "Query",
|
|
455
540
|
schema: zod_1.z
|
|
456
|
-
.enum([
|
|
541
|
+
.enum([
|
|
542
|
+
"media-descriptions",
|
|
543
|
+
"entities",
|
|
544
|
+
"rich-transcripts",
|
|
545
|
+
"face-analysis",
|
|
546
|
+
])
|
|
457
547
|
.optional(),
|
|
458
548
|
},
|
|
549
|
+
{
|
|
550
|
+
name: "created_after",
|
|
551
|
+
type: "Query",
|
|
552
|
+
schema: zod_1.z.string().datetime({ offset: true }).optional(),
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
name: "created_before",
|
|
556
|
+
type: "Query",
|
|
557
|
+
schema: zod_1.z.string().datetime({ offset: true }).optional(),
|
|
558
|
+
},
|
|
459
559
|
],
|
|
460
560
|
response: CollectionList,
|
|
461
561
|
errors: [
|
|
@@ -1082,6 +1182,53 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
1082
1182
|
},
|
|
1083
1183
|
],
|
|
1084
1184
|
},
|
|
1185
|
+
{
|
|
1186
|
+
method: "get",
|
|
1187
|
+
path: "/collections/:collection_id/videos/:file_id/face-detections",
|
|
1188
|
+
alias: "getFaceDetections",
|
|
1189
|
+
description: `Retrieve face detections for a specific file in a collection. Results are paginated with a default limit of 50 faces per request (maximum 100). Use limit and offset parameters to paginate through all results. This API is only available when the collection is created with collection_type 'face-analysis'`,
|
|
1190
|
+
requestFormat: "json",
|
|
1191
|
+
parameters: [
|
|
1192
|
+
{
|
|
1193
|
+
name: "collection_id",
|
|
1194
|
+
type: "Path",
|
|
1195
|
+
schema: zod_1.z.string(),
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
name: "file_id",
|
|
1199
|
+
type: "Path",
|
|
1200
|
+
schema: zod_1.z.string(),
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
name: "limit",
|
|
1204
|
+
type: "Query",
|
|
1205
|
+
schema: zod_1.z.number().int().gte(1).lte(100).optional().default(50),
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
name: "offset",
|
|
1209
|
+
type: "Query",
|
|
1210
|
+
schema: zod_1.z.number().int().gte(0).optional().default(0),
|
|
1211
|
+
},
|
|
1212
|
+
],
|
|
1213
|
+
response: FileFaceDetections,
|
|
1214
|
+
errors: [
|
|
1215
|
+
{
|
|
1216
|
+
status: 400,
|
|
1217
|
+
description: `Collection type is not 'face-analysis'`,
|
|
1218
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
status: 404,
|
|
1222
|
+
description: `Collection, file, or face detection job not found`,
|
|
1223
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
status: 500,
|
|
1227
|
+
description: `An unexpected error occurred on the server`,
|
|
1228
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
1229
|
+
},
|
|
1230
|
+
],
|
|
1231
|
+
},
|
|
1085
1232
|
]);
|
|
1086
1233
|
exports.CollectionsApi = new core_1.Zodios("https://api.cloudglue.dev/v1", endpoints);
|
|
1087
1234
|
function createApiClient(baseUrl, options) {
|
|
@@ -3,19 +3,13 @@ import { z } from "zod";
|
|
|
3
3
|
type SearchResponse = {
|
|
4
4
|
id: string;
|
|
5
5
|
object: "search";
|
|
6
|
-
query
|
|
7
|
-
scope: "file" | "segment";
|
|
8
|
-
|
|
6
|
+
query?: string | undefined;
|
|
7
|
+
scope: "file" | "segment" | "face";
|
|
8
|
+
search_target?: ("file" | "segment") | undefined;
|
|
9
|
+
results: Array<FileSearchResult | SegmentSearchResult | FaceSearchResult>;
|
|
9
10
|
total: number;
|
|
10
11
|
limit: number;
|
|
11
12
|
};
|
|
12
|
-
type SearchRequest = {
|
|
13
|
-
scope: "file" | "segment";
|
|
14
|
-
collections: Array<string>;
|
|
15
|
-
query: string;
|
|
16
|
-
limit?: number | undefined;
|
|
17
|
-
filter?: SearchFilter | undefined;
|
|
18
|
-
};
|
|
19
13
|
type FileSearchResult = {
|
|
20
14
|
type: "file";
|
|
21
15
|
file_id: string;
|
|
@@ -56,6 +50,22 @@ type SegmentSearchResult = {
|
|
|
56
50
|
}>> | undefined;
|
|
57
51
|
thumbnail_url?: string | undefined;
|
|
58
52
|
};
|
|
53
|
+
type FaceSearchResult = {
|
|
54
|
+
type: "face";
|
|
55
|
+
file_id: string;
|
|
56
|
+
collection_id: string;
|
|
57
|
+
face_id: string;
|
|
58
|
+
frame_id: string;
|
|
59
|
+
score: number;
|
|
60
|
+
timestamp: number;
|
|
61
|
+
face_bounding_box?: {
|
|
62
|
+
height: number;
|
|
63
|
+
width: number;
|
|
64
|
+
top: number;
|
|
65
|
+
left: number;
|
|
66
|
+
} | undefined;
|
|
67
|
+
thumbnail_url?: string | undefined;
|
|
68
|
+
};
|
|
59
69
|
type SearchFilter = Partial<{
|
|
60
70
|
metadata: Array<SearchFilterCriteria>;
|
|
61
71
|
video_info: Array<SearchFilterCriteria & Partial<{
|
|
@@ -73,9 +83,9 @@ type SearchFilterCriteria = {
|
|
|
73
83
|
};
|
|
74
84
|
declare const SearchFilterCriteria: z.ZodType<SearchFilterCriteria>;
|
|
75
85
|
declare const SearchFilter: z.ZodType<SearchFilter>;
|
|
76
|
-
declare const SearchRequest: z.ZodType<SearchRequest>;
|
|
77
86
|
declare const FileSearchResult: z.ZodType<FileSearchResult>;
|
|
78
87
|
declare const SegmentSearchResult: z.ZodType<SegmentSearchResult>;
|
|
88
|
+
declare const FaceSearchResult: z.ZodType<FaceSearchResult>;
|
|
79
89
|
declare const SearchResponse: z.ZodType<SearchResponse>;
|
|
80
90
|
export declare const schemas: {
|
|
81
91
|
SearchFilterCriteria: z.ZodType<SearchFilterCriteria, z.ZodTypeDef, SearchFilterCriteria>;
|
|
@@ -96,9 +106,30 @@ export declare const schemas: {
|
|
|
96
106
|
path: "bytes" | "filename" | "uri" | "created_at" | "id";
|
|
97
107
|
}>>;
|
|
98
108
|
}>>;
|
|
99
|
-
SearchRequest: z.ZodType<
|
|
109
|
+
SearchRequest: z.ZodType<Partial<{
|
|
110
|
+
scope: "file" | "segment" | "face";
|
|
111
|
+
collections: Array<string>;
|
|
112
|
+
query: string;
|
|
113
|
+
source_image: Partial<{
|
|
114
|
+
url: string;
|
|
115
|
+
base64: string;
|
|
116
|
+
}>;
|
|
117
|
+
limit: number;
|
|
118
|
+
filter: SearchFilter;
|
|
119
|
+
}>, z.ZodTypeDef, Partial<{
|
|
120
|
+
scope: "file" | "segment" | "face";
|
|
121
|
+
collections: Array<string>;
|
|
122
|
+
query: string;
|
|
123
|
+
source_image: Partial<{
|
|
124
|
+
url: string;
|
|
125
|
+
base64: string;
|
|
126
|
+
}>;
|
|
127
|
+
limit: number;
|
|
128
|
+
filter: SearchFilter;
|
|
129
|
+
}>>;
|
|
100
130
|
FileSearchResult: z.ZodType<FileSearchResult, z.ZodTypeDef, FileSearchResult>;
|
|
101
131
|
SegmentSearchResult: z.ZodType<SegmentSearchResult, z.ZodTypeDef, SegmentSearchResult>;
|
|
132
|
+
FaceSearchResult: z.ZodType<FaceSearchResult, z.ZodTypeDef, FaceSearchResult>;
|
|
102
133
|
SearchResponse: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
|
|
103
134
|
};
|
|
104
135
|
export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
|
|
@@ -111,7 +142,27 @@ export declare const SearchApi: import("@zodios/core").ZodiosInstance<[{
|
|
|
111
142
|
name: "body";
|
|
112
143
|
description: string;
|
|
113
144
|
type: "Body";
|
|
114
|
-
schema: z.ZodType<
|
|
145
|
+
schema: z.ZodType<Partial<{
|
|
146
|
+
scope: "file" | "segment" | "face";
|
|
147
|
+
collections: Array<string>;
|
|
148
|
+
query: string;
|
|
149
|
+
source_image: Partial<{
|
|
150
|
+
url: string;
|
|
151
|
+
base64: string;
|
|
152
|
+
}>;
|
|
153
|
+
limit: number;
|
|
154
|
+
filter: SearchFilter;
|
|
155
|
+
}>, z.ZodTypeDef, Partial<{
|
|
156
|
+
scope: "file" | "segment" | "face";
|
|
157
|
+
collections: Array<string>;
|
|
158
|
+
query: string;
|
|
159
|
+
source_image: Partial<{
|
|
160
|
+
url: string;
|
|
161
|
+
base64: string;
|
|
162
|
+
}>;
|
|
163
|
+
limit: number;
|
|
164
|
+
filter: SearchFilter;
|
|
165
|
+
}>>;
|
|
115
166
|
}];
|
|
116
167
|
response: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
|
|
117
168
|
errors: [{
|
|
@@ -156,7 +207,27 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
|
|
|
156
207
|
name: "body";
|
|
157
208
|
description: string;
|
|
158
209
|
type: "Body";
|
|
159
|
-
schema: z.ZodType<
|
|
210
|
+
schema: z.ZodType<Partial<{
|
|
211
|
+
scope: "file" | "segment" | "face";
|
|
212
|
+
collections: Array<string>;
|
|
213
|
+
query: string;
|
|
214
|
+
source_image: Partial<{
|
|
215
|
+
url: string;
|
|
216
|
+
base64: string;
|
|
217
|
+
}>;
|
|
218
|
+
limit: number;
|
|
219
|
+
filter: SearchFilter;
|
|
220
|
+
}>, z.ZodTypeDef, Partial<{
|
|
221
|
+
scope: "file" | "segment" | "face";
|
|
222
|
+
collections: Array<string>;
|
|
223
|
+
query: string;
|
|
224
|
+
source_image: Partial<{
|
|
225
|
+
url: string;
|
|
226
|
+
base64: string;
|
|
227
|
+
}>;
|
|
228
|
+
limit: number;
|
|
229
|
+
filter: SearchFilter;
|
|
230
|
+
}>>;
|
|
160
231
|
}];
|
|
161
232
|
response: z.ZodType<SearchResponse, z.ZodTypeDef, SearchResponse>;
|
|
162
233
|
errors: [{
|
package/dist/generated/Search.js
CHANGED
|
@@ -43,12 +43,18 @@ const SearchFilter = zod_1.z
|
|
|
43
43
|
.passthrough();
|
|
44
44
|
const SearchRequest = zod_1.z
|
|
45
45
|
.object({
|
|
46
|
-
scope: zod_1.z.enum(["file", "segment"]),
|
|
46
|
+
scope: zod_1.z.enum(["file", "segment", "face"]),
|
|
47
47
|
collections: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
48
48
|
query: zod_1.z.string().min(1),
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
source_image: zod_1.z
|
|
50
|
+
.object({ url: zod_1.z.string(), base64: zod_1.z.string() })
|
|
51
|
+
.partial()
|
|
52
|
+
.strict()
|
|
53
|
+
.passthrough(),
|
|
54
|
+
limit: zod_1.z.number().int().gte(1).lte(100).default(10),
|
|
55
|
+
filter: SearchFilter,
|
|
51
56
|
})
|
|
57
|
+
.partial()
|
|
52
58
|
.strict()
|
|
53
59
|
.passthrough();
|
|
54
60
|
const FileSearchResult = zod_1.z
|
|
@@ -115,13 +121,37 @@ const SegmentSearchResult = zod_1.z
|
|
|
115
121
|
})
|
|
116
122
|
.strict()
|
|
117
123
|
.passthrough();
|
|
124
|
+
const FaceSearchResult = zod_1.z
|
|
125
|
+
.object({
|
|
126
|
+
type: zod_1.z.literal("face"),
|
|
127
|
+
file_id: zod_1.z.string().uuid(),
|
|
128
|
+
collection_id: zod_1.z.string().uuid(),
|
|
129
|
+
face_id: zod_1.z.string().uuid(),
|
|
130
|
+
frame_id: zod_1.z.string().uuid(),
|
|
131
|
+
score: zod_1.z.number().gte(0).lte(100),
|
|
132
|
+
timestamp: zod_1.z.number().gte(0),
|
|
133
|
+
face_bounding_box: zod_1.z
|
|
134
|
+
.object({
|
|
135
|
+
height: zod_1.z.number().gte(0).lte(1),
|
|
136
|
+
width: zod_1.z.number().gte(0).lte(1),
|
|
137
|
+
top: zod_1.z.number().gte(0).lte(1),
|
|
138
|
+
left: zod_1.z.number().gte(0).lte(1),
|
|
139
|
+
})
|
|
140
|
+
.strict()
|
|
141
|
+
.passthrough()
|
|
142
|
+
.optional(),
|
|
143
|
+
thumbnail_url: zod_1.z.string().optional(),
|
|
144
|
+
})
|
|
145
|
+
.strict()
|
|
146
|
+
.passthrough();
|
|
118
147
|
const SearchResponse = zod_1.z
|
|
119
148
|
.object({
|
|
120
149
|
id: zod_1.z.string().uuid(),
|
|
121
150
|
object: zod_1.z.literal("search"),
|
|
122
|
-
query: zod_1.z.string(),
|
|
123
|
-
scope: zod_1.z.enum(["file", "segment"]),
|
|
124
|
-
|
|
151
|
+
query: zod_1.z.string().optional(),
|
|
152
|
+
scope: zod_1.z.enum(["file", "segment", "face"]),
|
|
153
|
+
search_target: zod_1.z.enum(["file", "segment"]).optional(),
|
|
154
|
+
results: zod_1.z.array(zod_1.z.union([FileSearchResult, SegmentSearchResult, FaceSearchResult])),
|
|
125
155
|
total: zod_1.z.number().int(),
|
|
126
156
|
limit: zod_1.z.number().int(),
|
|
127
157
|
})
|
|
@@ -133,6 +163,7 @@ exports.schemas = {
|
|
|
133
163
|
SearchRequest,
|
|
134
164
|
FileSearchResult,
|
|
135
165
|
SegmentSearchResult,
|
|
166
|
+
FaceSearchResult,
|
|
136
167
|
SearchResponse,
|
|
137
168
|
};
|
|
138
169
|
const endpoints = (0, core_1.makeApi)([
|
|
@@ -25,6 +25,8 @@ type ShotConfig = Partial<{
|
|
|
25
25
|
}>;
|
|
26
26
|
type NarrativeConfig = Partial<{
|
|
27
27
|
prompt: string;
|
|
28
|
+
strategy: "direct" | "long" | "balanced";
|
|
29
|
+
number_of_chapters: number;
|
|
28
30
|
}>;
|
|
29
31
|
type Segment = {
|
|
30
32
|
start_time: number;
|
|
@@ -34,16 +36,27 @@ type Segment = {
|
|
|
34
36
|
};
|
|
35
37
|
type SegmentsList = {
|
|
36
38
|
object: "list";
|
|
37
|
-
data: Array<
|
|
39
|
+
data: Array<SegmentsListItem>;
|
|
38
40
|
total: number;
|
|
39
41
|
limit: number;
|
|
40
42
|
offset: number;
|
|
41
43
|
};
|
|
44
|
+
type SegmentsListItem = {
|
|
45
|
+
job_id: string;
|
|
46
|
+
file_id: string;
|
|
47
|
+
object: "segments";
|
|
48
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
49
|
+
criteria: "shot" | "narrative";
|
|
50
|
+
created_at: number;
|
|
51
|
+
shot_config?: ShotConfig | undefined;
|
|
52
|
+
narrative_config?: NarrativeConfig | undefined;
|
|
53
|
+
};
|
|
42
54
|
declare const ShotConfig: z.ZodType<ShotConfig>;
|
|
43
55
|
declare const NarrativeConfig: z.ZodType<NarrativeConfig>;
|
|
44
56
|
declare const NewSegments: z.ZodType<NewSegments>;
|
|
45
57
|
declare const Segment: z.ZodType<Segment>;
|
|
46
58
|
declare const Segments: z.ZodType<Segments>;
|
|
59
|
+
declare const SegmentsListItem: z.ZodType<SegmentsListItem>;
|
|
47
60
|
declare const SegmentsList: z.ZodType<SegmentsList>;
|
|
48
61
|
export declare const schemas: {
|
|
49
62
|
ShotConfig: z.ZodType<Partial<{
|
|
@@ -57,19 +70,24 @@ export declare const schemas: {
|
|
|
57
70
|
}>>;
|
|
58
71
|
NarrativeConfig: z.ZodType<Partial<{
|
|
59
72
|
prompt: string;
|
|
73
|
+
strategy: "direct" | "long" | "balanced";
|
|
74
|
+
number_of_chapters: number;
|
|
60
75
|
}>, z.ZodTypeDef, Partial<{
|
|
61
76
|
prompt: string;
|
|
77
|
+
strategy: "direct" | "long" | "balanced";
|
|
78
|
+
number_of_chapters: number;
|
|
62
79
|
}>>;
|
|
63
80
|
NewSegments: z.ZodType<NewSegments, z.ZodTypeDef, NewSegments>;
|
|
64
81
|
Segment: z.ZodType<Segment, z.ZodTypeDef, Segment>;
|
|
65
82
|
Segments: z.ZodType<Segments, z.ZodTypeDef, Segments>;
|
|
83
|
+
SegmentsListItem: z.ZodType<SegmentsListItem, z.ZodTypeDef, SegmentsListItem>;
|
|
66
84
|
SegmentsList: z.ZodType<SegmentsList, z.ZodTypeDef, SegmentsList>;
|
|
67
85
|
};
|
|
68
86
|
export declare const SegmentsApi: import("@zodios/core").ZodiosInstance<[{
|
|
69
87
|
method: "post";
|
|
70
88
|
path: "/segments";
|
|
71
89
|
alias: "createSegments";
|
|
72
|
-
description: "Create intelligent video segments based on shot detection or narrative analysis.\n\n**⚠️ Note: YouTube URLs are supported for narrative-based segmentation only.** Shot-based segmentation requires direct video file access. Use Cloudglue Files, HTTP URLs, or files from data connectors for shot-based segmentation.";
|
|
90
|
+
description: "Create intelligent video segments based on shot detection or narrative analysis.\n\n**⚠️ Note: YouTube URLs are supported for narrative-based segmentation only.** Shot-based segmentation requires direct video file access. Use Cloudglue Files, HTTP URLs, or files from data connectors for shot-based segmentation.\n\n**Narrative Segmentation Strategies:**\n\n• **balanced** (default): Uses multimodal describe job for comprehensive analysis.\n Recommended for most videos. Supports YouTube URLs.\n\n• **direct**: Directly analyzes the full video URL with AI.\n Ideal for videos less than 10 minutes long. Provides finer grain control and expressibility with direct integration of your prompt with the Video AI model.\n\n• **long**: Optimized for longer videos beyond 10 minutes.\n Provides finer grain control and expressibility with direct integration of your prompt with the Video AI model.\n\n**YouTube URLs**: Automatically use the 'balanced' strategy. The strategy field is ignored for YouTube URLs, and other strategies will be rejected with an error.";
|
|
73
91
|
requestFormat: "json";
|
|
74
92
|
parameters: [{
|
|
75
93
|
name: "body";
|
|
@@ -253,7 +271,7 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
|
|
|
253
271
|
method: "post";
|
|
254
272
|
path: "/segments";
|
|
255
273
|
alias: "createSegments";
|
|
256
|
-
description: "Create intelligent video segments based on shot detection or narrative analysis.\n\n**⚠️ Note: YouTube URLs are supported for narrative-based segmentation only.** Shot-based segmentation requires direct video file access. Use Cloudglue Files, HTTP URLs, or files from data connectors for shot-based segmentation.";
|
|
274
|
+
description: "Create intelligent video segments based on shot detection or narrative analysis.\n\n**⚠️ Note: YouTube URLs are supported for narrative-based segmentation only.** Shot-based segmentation requires direct video file access. Use Cloudglue Files, HTTP URLs, or files from data connectors for shot-based segmentation.\n\n**Narrative Segmentation Strategies:**\n\n• **balanced** (default): Uses multimodal describe job for comprehensive analysis.\n Recommended for most videos. Supports YouTube URLs.\n\n• **direct**: Directly analyzes the full video URL with AI.\n Ideal for videos less than 10 minutes long. Provides finer grain control and expressibility with direct integration of your prompt with the Video AI model.\n\n• **long**: Optimized for longer videos beyond 10 minutes.\n Provides finer grain control and expressibility with direct integration of your prompt with the Video AI model.\n\n**YouTube URLs**: Automatically use the 'balanced' strategy. The strategy field is ignored for YouTube URLs, and other strategies will be rejected with an error.";
|
|
257
275
|
requestFormat: "json";
|
|
258
276
|
parameters: [{
|
|
259
277
|
name: "body";
|
|
@@ -14,7 +14,11 @@ const ShotConfig = zod_1.z
|
|
|
14
14
|
.strict()
|
|
15
15
|
.passthrough();
|
|
16
16
|
const NarrativeConfig = zod_1.z
|
|
17
|
-
.object({
|
|
17
|
+
.object({
|
|
18
|
+
prompt: zod_1.z.string(),
|
|
19
|
+
strategy: zod_1.z.enum(["direct", "long", "balanced"]).default("balanced"),
|
|
20
|
+
number_of_chapters: zod_1.z.number().int().gte(1),
|
|
21
|
+
})
|
|
18
22
|
.partial()
|
|
19
23
|
.strict()
|
|
20
24
|
.passthrough();
|
|
@@ -51,10 +55,23 @@ const Segments = zod_1.z
|
|
|
51
55
|
})
|
|
52
56
|
.strict()
|
|
53
57
|
.passthrough();
|
|
58
|
+
const SegmentsListItem = zod_1.z
|
|
59
|
+
.object({
|
|
60
|
+
job_id: zod_1.z.string().uuid(),
|
|
61
|
+
file_id: zod_1.z.string().uuid(),
|
|
62
|
+
object: zod_1.z.literal("segments"),
|
|
63
|
+
status: zod_1.z.enum(["pending", "processing", "completed", "failed"]),
|
|
64
|
+
criteria: zod_1.z.enum(["shot", "narrative"]),
|
|
65
|
+
created_at: zod_1.z.number().int(),
|
|
66
|
+
shot_config: ShotConfig.optional(),
|
|
67
|
+
narrative_config: NarrativeConfig.optional(),
|
|
68
|
+
})
|
|
69
|
+
.strict()
|
|
70
|
+
.passthrough();
|
|
54
71
|
const SegmentsList = zod_1.z
|
|
55
72
|
.object({
|
|
56
73
|
object: zod_1.z.literal("list"),
|
|
57
|
-
data: zod_1.z.array(
|
|
74
|
+
data: zod_1.z.array(SegmentsListItem),
|
|
58
75
|
total: zod_1.z.number().int(),
|
|
59
76
|
limit: zod_1.z.number().int(),
|
|
60
77
|
offset: zod_1.z.number().int(),
|
|
@@ -67,6 +84,7 @@ exports.schemas = {
|
|
|
67
84
|
NewSegments,
|
|
68
85
|
Segment,
|
|
69
86
|
Segments,
|
|
87
|
+
SegmentsListItem,
|
|
70
88
|
SegmentsList,
|
|
71
89
|
};
|
|
72
90
|
const endpoints = (0, core_1.makeApi)([
|
|
@@ -76,7 +94,20 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
76
94
|
alias: "createSegments",
|
|
77
95
|
description: `Create intelligent video segments based on shot detection or narrative analysis.
|
|
78
96
|
|
|
79
|
-
**⚠️ Note: YouTube URLs are supported for narrative-based segmentation only.** Shot-based segmentation requires direct video file access. Use Cloudglue Files, HTTP URLs, or files from data connectors for shot-based segmentation
|
|
97
|
+
**⚠️ Note: YouTube URLs are supported for narrative-based segmentation only.** Shot-based segmentation requires direct video file access. Use Cloudglue Files, HTTP URLs, or files from data connectors for shot-based segmentation.
|
|
98
|
+
|
|
99
|
+
**Narrative Segmentation Strategies:**
|
|
100
|
+
|
|
101
|
+
• **balanced** (default): Uses multimodal describe job for comprehensive analysis.
|
|
102
|
+
Recommended for most videos. Supports YouTube URLs.
|
|
103
|
+
|
|
104
|
+
• **direct**: Directly analyzes the full video URL with AI.
|
|
105
|
+
Ideal for videos less than 10 minutes long. Provides finer grain control and expressibility with direct integration of your prompt with the Video AI model.
|
|
106
|
+
|
|
107
|
+
• **long**: Optimized for longer videos beyond 10 minutes.
|
|
108
|
+
Provides finer grain control and expressibility with direct integration of your prompt with the Video AI model.
|
|
109
|
+
|
|
110
|
+
**YouTube URLs**: Automatically use the 'balanced' strategy. The strategy field is ignored for YouTube URLs, and other strategies will be rejected with an error.`,
|
|
80
111
|
requestFormat: "json",
|
|
81
112
|
parameters: [
|
|
82
113
|
{
|
|
@@ -90,7 +121,7 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
90
121
|
errors: [
|
|
91
122
|
{
|
|
92
123
|
status: 400,
|
|
93
|
-
description: `Invalid request, missing required parameters,
|
|
124
|
+
description: `Invalid request, missing required parameters, unsupported URL type (e.g., YouTube URLs with shot-based segmentation), or unsupported strategy for YouTube URLs (YouTube URLs only support 'balanced' strategy)`,
|
|
94
125
|
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
95
126
|
},
|
|
96
127
|
{
|