@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.
- package/dist/generated/Chat.d.ts +0 -4
- package/dist/generated/Chat.js +0 -4
- package/dist/generated/Collections.d.ts +6424 -751
- package/dist/generated/Collections.js +243 -35
- package/dist/generated/Describe.d.ts +178 -6841
- package/dist/generated/Describe.js +138 -48
- package/dist/generated/Extract.d.ts +2 -2
- package/dist/generated/Extract.js +2 -2
- package/dist/generated/Search.d.ts +4 -2
- package/dist/generated/Search.js +3 -3
- package/dist/generated/Transcribe.d.ts +2 -2
- package/dist/generated/Transcribe.js +3 -1
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +3 -1
- package/dist/src/client.d.ts +1064 -240
- package/dist/src/client.js +64 -8
- package/dist/src/types.d.ts +18 -0
- package/package.json +1 -1
|
@@ -15,9 +15,9 @@ const Collection = zod_1.z
|
|
|
15
15
|
name: zod_1.z.string(),
|
|
16
16
|
description: zod_1.z.union([zod_1.z.string(), zod_1.z.null()]).optional(),
|
|
17
17
|
collection_type: zod_1.z.enum([
|
|
18
|
+
"media-descriptions",
|
|
18
19
|
"entities",
|
|
19
20
|
"rich-transcripts",
|
|
20
|
-
"media-descriptions",
|
|
21
21
|
]),
|
|
22
22
|
extract_config: zod_1.z
|
|
23
23
|
.object({
|
|
@@ -41,6 +41,17 @@ const Collection = zod_1.z
|
|
|
41
41
|
.strict()
|
|
42
42
|
.passthrough()
|
|
43
43
|
.optional(),
|
|
44
|
+
describe_config: zod_1.z
|
|
45
|
+
.object({
|
|
46
|
+
enable_summary: zod_1.z.boolean().default(true),
|
|
47
|
+
enable_speech: zod_1.z.boolean().default(true),
|
|
48
|
+
enable_scene_text: zod_1.z.boolean().default(true),
|
|
49
|
+
enable_visual_scene_description: zod_1.z.boolean().default(true),
|
|
50
|
+
})
|
|
51
|
+
.partial()
|
|
52
|
+
.strict()
|
|
53
|
+
.passthrough()
|
|
54
|
+
.optional(),
|
|
44
55
|
default_segmentation_config: common_1.SegmentationConfig.optional(),
|
|
45
56
|
default_thumbnails_config: common_2.ThumbnailsConfig.optional(),
|
|
46
57
|
created_at: zod_1.z.number().int(),
|
|
@@ -50,9 +61,24 @@ const Collection = zod_1.z
|
|
|
50
61
|
.passthrough();
|
|
51
62
|
const NewCollection = zod_1.z
|
|
52
63
|
.object({
|
|
53
|
-
collection_type: zod_1.z.enum([
|
|
64
|
+
collection_type: zod_1.z.enum([
|
|
65
|
+
"media-descriptions",
|
|
66
|
+
"entities",
|
|
67
|
+
"rich-transcripts",
|
|
68
|
+
]),
|
|
54
69
|
name: zod_1.z.string(),
|
|
55
70
|
description: zod_1.z.union([zod_1.z.string(), zod_1.z.null()]).optional(),
|
|
71
|
+
describe_config: zod_1.z
|
|
72
|
+
.object({
|
|
73
|
+
enable_summary: zod_1.z.boolean().default(true),
|
|
74
|
+
enable_speech: zod_1.z.boolean().default(true),
|
|
75
|
+
enable_scene_text: zod_1.z.boolean().default(true),
|
|
76
|
+
enable_visual_scene_description: zod_1.z.boolean().default(true),
|
|
77
|
+
})
|
|
78
|
+
.partial()
|
|
79
|
+
.strict()
|
|
80
|
+
.passthrough()
|
|
81
|
+
.optional(),
|
|
56
82
|
extract_config: zod_1.z
|
|
57
83
|
.object({
|
|
58
84
|
prompt: zod_1.z.string(),
|
|
@@ -101,14 +127,6 @@ const AddCollectionFile = zod_1.z
|
|
|
101
127
|
.partial()
|
|
102
128
|
.strict()
|
|
103
129
|
.passthrough());
|
|
104
|
-
const AddYouTubeCollectionFile = zod_1.z
|
|
105
|
-
.object({
|
|
106
|
-
url: zod_1.z.string(),
|
|
107
|
-
metadata: zod_1.z.object({}).partial().strict().passthrough().optional(),
|
|
108
|
-
})
|
|
109
|
-
.strict()
|
|
110
|
-
.passthrough()
|
|
111
|
-
.and(common_4.FileSegmentationConfig);
|
|
112
130
|
const CollectionFile = zod_1.z
|
|
113
131
|
.object({
|
|
114
132
|
collection_id: zod_1.z.string(),
|
|
@@ -331,12 +349,129 @@ const CollectionRichTranscriptsList = zod_1.z
|
|
|
331
349
|
})
|
|
332
350
|
.strict()
|
|
333
351
|
.passthrough();
|
|
352
|
+
const CollectionMediaDescriptionsList = zod_1.z
|
|
353
|
+
.object({
|
|
354
|
+
object: zod_1.z.literal("list"),
|
|
355
|
+
data: zod_1.z.array(zod_1.z
|
|
356
|
+
.object({
|
|
357
|
+
file_id: zod_1.z.string(),
|
|
358
|
+
added_at: zod_1.z.number().int(),
|
|
359
|
+
object: zod_1.z.literal("collection_file"),
|
|
360
|
+
data: zod_1.z
|
|
361
|
+
.object({
|
|
362
|
+
content: zod_1.z.string(),
|
|
363
|
+
title: zod_1.z.string(),
|
|
364
|
+
summary: zod_1.z.string(),
|
|
365
|
+
speech: zod_1.z.array(zod_1.z
|
|
366
|
+
.object({
|
|
367
|
+
text: zod_1.z.string(),
|
|
368
|
+
start_time: zod_1.z.number(),
|
|
369
|
+
end_time: zod_1.z.number(),
|
|
370
|
+
})
|
|
371
|
+
.partial()
|
|
372
|
+
.strict()
|
|
373
|
+
.passthrough()),
|
|
374
|
+
visual_scene_description: zod_1.z.array(zod_1.z
|
|
375
|
+
.object({
|
|
376
|
+
text: zod_1.z.string(),
|
|
377
|
+
start_time: zod_1.z.number(),
|
|
378
|
+
end_time: zod_1.z.number(),
|
|
379
|
+
})
|
|
380
|
+
.partial()
|
|
381
|
+
.strict()
|
|
382
|
+
.passthrough()),
|
|
383
|
+
scene_text: zod_1.z.array(zod_1.z
|
|
384
|
+
.object({
|
|
385
|
+
text: zod_1.z.string(),
|
|
386
|
+
start_time: zod_1.z.number(),
|
|
387
|
+
end_time: zod_1.z.number(),
|
|
388
|
+
})
|
|
389
|
+
.partial()
|
|
390
|
+
.strict()
|
|
391
|
+
.passthrough()),
|
|
392
|
+
segment_summary: zod_1.z.array(zod_1.z
|
|
393
|
+
.object({
|
|
394
|
+
title: zod_1.z.string(),
|
|
395
|
+
summary: zod_1.z.string(),
|
|
396
|
+
start_time: zod_1.z.number(),
|
|
397
|
+
end_time: zod_1.z.number(),
|
|
398
|
+
})
|
|
399
|
+
.partial()
|
|
400
|
+
.strict()
|
|
401
|
+
.passthrough()),
|
|
402
|
+
})
|
|
403
|
+
.partial()
|
|
404
|
+
.strict()
|
|
405
|
+
.passthrough(),
|
|
406
|
+
})
|
|
407
|
+
.strict()
|
|
408
|
+
.passthrough()),
|
|
409
|
+
total: zod_1.z.number().int(),
|
|
410
|
+
limit: zod_1.z.number().int(),
|
|
411
|
+
offset: zod_1.z.number().int(),
|
|
412
|
+
})
|
|
413
|
+
.strict()
|
|
414
|
+
.passthrough();
|
|
415
|
+
const MediaDescription = zod_1.z
|
|
416
|
+
.object({
|
|
417
|
+
collection_id: zod_1.z.string(),
|
|
418
|
+
file_id: zod_1.z.string(),
|
|
419
|
+
content: zod_1.z.string().optional(),
|
|
420
|
+
title: zod_1.z.string().optional(),
|
|
421
|
+
summary: zod_1.z.string().optional(),
|
|
422
|
+
speech: zod_1.z
|
|
423
|
+
.array(zod_1.z
|
|
424
|
+
.object({
|
|
425
|
+
text: zod_1.z.string(),
|
|
426
|
+
start_time: zod_1.z.number(),
|
|
427
|
+
end_time: zod_1.z.number(),
|
|
428
|
+
})
|
|
429
|
+
.partial()
|
|
430
|
+
.strict()
|
|
431
|
+
.passthrough())
|
|
432
|
+
.optional(),
|
|
433
|
+
visual_scene_description: zod_1.z
|
|
434
|
+
.array(zod_1.z
|
|
435
|
+
.object({
|
|
436
|
+
text: zod_1.z.string(),
|
|
437
|
+
start_time: zod_1.z.number(),
|
|
438
|
+
end_time: zod_1.z.number(),
|
|
439
|
+
})
|
|
440
|
+
.partial()
|
|
441
|
+
.strict()
|
|
442
|
+
.passthrough())
|
|
443
|
+
.optional(),
|
|
444
|
+
scene_text: zod_1.z
|
|
445
|
+
.array(zod_1.z
|
|
446
|
+
.object({
|
|
447
|
+
text: zod_1.z.string(),
|
|
448
|
+
start_time: zod_1.z.number(),
|
|
449
|
+
end_time: zod_1.z.number(),
|
|
450
|
+
})
|
|
451
|
+
.partial()
|
|
452
|
+
.strict()
|
|
453
|
+
.passthrough())
|
|
454
|
+
.optional(),
|
|
455
|
+
segment_summary: zod_1.z
|
|
456
|
+
.array(zod_1.z
|
|
457
|
+
.object({
|
|
458
|
+
title: zod_1.z.string(),
|
|
459
|
+
summary: zod_1.z.string(),
|
|
460
|
+
start_time: zod_1.z.number(),
|
|
461
|
+
end_time: zod_1.z.number(),
|
|
462
|
+
})
|
|
463
|
+
.partial()
|
|
464
|
+
.strict()
|
|
465
|
+
.passthrough())
|
|
466
|
+
.optional(),
|
|
467
|
+
})
|
|
468
|
+
.strict()
|
|
469
|
+
.passthrough();
|
|
334
470
|
exports.schemas = {
|
|
335
471
|
Collection,
|
|
336
472
|
NewCollection,
|
|
337
473
|
CollectionList,
|
|
338
474
|
AddCollectionFile,
|
|
339
|
-
AddYouTubeCollectionFile,
|
|
340
475
|
CollectionFile,
|
|
341
476
|
CollectionFileList,
|
|
342
477
|
CollectionDelete,
|
|
@@ -345,6 +480,8 @@ exports.schemas = {
|
|
|
345
480
|
RichTranscript,
|
|
346
481
|
CollectionEntitiesList,
|
|
347
482
|
CollectionRichTranscriptsList,
|
|
483
|
+
CollectionMediaDescriptionsList,
|
|
484
|
+
MediaDescription,
|
|
348
485
|
};
|
|
349
486
|
const endpoints = (0, core_1.makeApi)([
|
|
350
487
|
{
|
|
@@ -416,7 +553,7 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
416
553
|
name: "collection_type",
|
|
417
554
|
type: "Query",
|
|
418
555
|
schema: zod_1.z
|
|
419
|
-
.enum(["
|
|
556
|
+
.enum(["media-descriptions", "entities", "rich-transcripts"])
|
|
420
557
|
.optional(),
|
|
421
558
|
},
|
|
422
559
|
],
|
|
@@ -735,29 +872,53 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
735
872
|
],
|
|
736
873
|
},
|
|
737
874
|
{
|
|
738
|
-
method: "
|
|
739
|
-
path: "/collections/:collection_id/
|
|
740
|
-
alias: "
|
|
741
|
-
description: `
|
|
875
|
+
method: "get",
|
|
876
|
+
path: "/collections/:collection_id/entities",
|
|
877
|
+
alias: "listCollectionEntities",
|
|
878
|
+
description: `List all extracted entities for files in a collection. This API is only available when a collection is created with collection_type 'entities'`,
|
|
742
879
|
requestFormat: "json",
|
|
743
880
|
parameters: [
|
|
744
|
-
{
|
|
745
|
-
name: "body",
|
|
746
|
-
description: `YouTube video URL parameters`,
|
|
747
|
-
type: "Body",
|
|
748
|
-
schema: AddYouTubeCollectionFile,
|
|
749
|
-
},
|
|
750
881
|
{
|
|
751
882
|
name: "collection_id",
|
|
752
883
|
type: "Path",
|
|
753
884
|
schema: zod_1.z.string(),
|
|
754
885
|
},
|
|
886
|
+
{
|
|
887
|
+
name: "limit",
|
|
888
|
+
type: "Query",
|
|
889
|
+
schema: zod_1.z.number().int().lte(100).optional().default(50),
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: "offset",
|
|
893
|
+
type: "Query",
|
|
894
|
+
schema: zod_1.z.number().int().optional().default(0),
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
name: "order",
|
|
898
|
+
type: "Query",
|
|
899
|
+
schema: zod_1.z.enum(["added_at", "filename"]).optional().default("added_at"),
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
name: "sort",
|
|
903
|
+
type: "Query",
|
|
904
|
+
schema: zod_1.z.enum(["asc", "desc"]).optional().default("desc"),
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
name: "added_before",
|
|
908
|
+
type: "Query",
|
|
909
|
+
schema: zod_1.z.string().optional(),
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
name: "added_after",
|
|
913
|
+
type: "Query",
|
|
914
|
+
schema: zod_1.z.string().optional(),
|
|
915
|
+
},
|
|
755
916
|
],
|
|
756
|
-
response:
|
|
917
|
+
response: CollectionEntitiesList,
|
|
757
918
|
errors: [
|
|
758
919
|
{
|
|
759
920
|
status: 400,
|
|
760
|
-
description: `
|
|
921
|
+
description: `Collection type is not 'entities'`,
|
|
761
922
|
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
762
923
|
},
|
|
763
924
|
{
|
|
@@ -774,9 +935,9 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
774
935
|
},
|
|
775
936
|
{
|
|
776
937
|
method: "get",
|
|
777
|
-
path: "/collections/:collection_id/
|
|
778
|
-
alias: "
|
|
779
|
-
description: `List all
|
|
938
|
+
path: "/collections/:collection_id/rich-transcripts",
|
|
939
|
+
alias: "listCollectionRichTranscripts",
|
|
940
|
+
description: `List all rich transcription data for files in a collection. This API is only available when a collection is created with collection_type 'rich-transcripts'`,
|
|
780
941
|
requestFormat: "json",
|
|
781
942
|
parameters: [
|
|
782
943
|
{
|
|
@@ -787,7 +948,7 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
787
948
|
{
|
|
788
949
|
name: "limit",
|
|
789
950
|
type: "Query",
|
|
790
|
-
schema: zod_1.z.number().int().lte(100).optional().default(
|
|
951
|
+
schema: zod_1.z.number().int().lte(100).optional().default(20),
|
|
791
952
|
},
|
|
792
953
|
{
|
|
793
954
|
name: "offset",
|
|
@@ -814,12 +975,17 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
814
975
|
type: "Query",
|
|
815
976
|
schema: zod_1.z.string().optional(),
|
|
816
977
|
},
|
|
978
|
+
{
|
|
979
|
+
name: "response_format",
|
|
980
|
+
type: "Query",
|
|
981
|
+
schema: zod_1.z.enum(["json", "markdown"]).optional().default("json"),
|
|
982
|
+
},
|
|
817
983
|
],
|
|
818
|
-
response:
|
|
984
|
+
response: CollectionRichTranscriptsList,
|
|
819
985
|
errors: [
|
|
820
986
|
{
|
|
821
987
|
status: 400,
|
|
822
|
-
description: `Collection type is not '
|
|
988
|
+
description: `Collection type is not 'rich-transcripts'`,
|
|
823
989
|
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
824
990
|
},
|
|
825
991
|
{
|
|
@@ -836,9 +1002,9 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
836
1002
|
},
|
|
837
1003
|
{
|
|
838
1004
|
method: "get",
|
|
839
|
-
path: "/collections/:collection_id/
|
|
840
|
-
alias: "
|
|
841
|
-
description: `List all
|
|
1005
|
+
path: "/collections/:collection_id/media-descriptions",
|
|
1006
|
+
alias: "listCollectionMediaDescriptions",
|
|
1007
|
+
description: `List all media description data for files in a collection. This API is only available when a collection is created with collection_type 'media-descriptions'`,
|
|
842
1008
|
requestFormat: "json",
|
|
843
1009
|
parameters: [
|
|
844
1010
|
{
|
|
@@ -882,11 +1048,11 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
882
1048
|
schema: zod_1.z.enum(["json", "markdown"]).optional().default("json"),
|
|
883
1049
|
},
|
|
884
1050
|
],
|
|
885
|
-
response:
|
|
1051
|
+
response: CollectionMediaDescriptionsList,
|
|
886
1052
|
errors: [
|
|
887
1053
|
{
|
|
888
1054
|
status: 400,
|
|
889
|
-
description: `Collection type is not '
|
|
1055
|
+
description: `Collection type is not 'media-descriptions'`,
|
|
890
1056
|
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
891
1057
|
},
|
|
892
1058
|
{
|
|
@@ -901,6 +1067,48 @@ const endpoints = (0, core_1.makeApi)([
|
|
|
901
1067
|
},
|
|
902
1068
|
],
|
|
903
1069
|
},
|
|
1070
|
+
{
|
|
1071
|
+
method: "get",
|
|
1072
|
+
path: "/collections/:collection_id/videos/:file_id/media-descriptions",
|
|
1073
|
+
alias: "getMediaDescriptions",
|
|
1074
|
+
description: `Retrieve media description data for a specific file in a collection. This API is only available when the collection is created with collection_type 'media-descriptions'`,
|
|
1075
|
+
requestFormat: "json",
|
|
1076
|
+
parameters: [
|
|
1077
|
+
{
|
|
1078
|
+
name: "collection_id",
|
|
1079
|
+
type: "Path",
|
|
1080
|
+
schema: zod_1.z.string(),
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
name: "file_id",
|
|
1084
|
+
type: "Path",
|
|
1085
|
+
schema: zod_1.z.string(),
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
name: "response_format",
|
|
1089
|
+
type: "Query",
|
|
1090
|
+
schema: zod_1.z.enum(["json", "markdown"]).optional().default("json"),
|
|
1091
|
+
},
|
|
1092
|
+
],
|
|
1093
|
+
response: MediaDescription,
|
|
1094
|
+
errors: [
|
|
1095
|
+
{
|
|
1096
|
+
status: 400,
|
|
1097
|
+
description: `Collection type is not 'media-descriptions'`,
|
|
1098
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
status: 404,
|
|
1102
|
+
description: `Collection or file not found`,
|
|
1103
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
status: 500,
|
|
1107
|
+
description: `An unexpected error occurred on the server`,
|
|
1108
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
1109
|
+
},
|
|
1110
|
+
],
|
|
1111
|
+
},
|
|
904
1112
|
]);
|
|
905
1113
|
exports.CollectionsApi = new core_1.Zodios("https://api.cloudglue.dev/v1", endpoints);
|
|
906
1114
|
function createApiClient(baseUrl, options) {
|