@aviaryhq/cloudglue-js 0.0.9
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/LICENSE.md +44 -0
- package/README.md +105 -0
- package/dist/client.d.ts +156 -0
- package/dist/client.js +189 -0
- package/dist/generated/Chat.d.ts +416 -0
- package/dist/generated/Chat.js +182 -0
- package/dist/generated/Collections.d.ts +2940 -0
- package/dist/generated/Collections.js +666 -0
- package/dist/generated/Describe.d.ts +7027 -0
- package/dist/generated/Describe.js +159 -0
- package/dist/generated/Extract.d.ts +1168 -0
- package/dist/generated/Extract.js +128 -0
- package/dist/generated/Files.d.ts +735 -0
- package/dist/generated/Files.js +190 -0
- package/dist/generated/common.d.ts +99 -0
- package/dist/generated/common.js +37 -0
- package/dist/generated/index.d.ts +5 -0
- package/dist/generated/index.js +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +18 -0
- package/dist/src/client.d.ts +1550 -0
- package/dist/src/client.js +189 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.js +18 -0
- package/dist/src/types.d.ts +70 -0
- package/dist/src/types.js +2 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.js +2 -0
- package/package.json +46 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtractApi = exports.schemas = void 0;
|
|
4
|
+
exports.createApiClient = createApiClient;
|
|
5
|
+
const core_1 = require("@zodios/core");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const Extract = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
job_id: zod_1.z.string(),
|
|
10
|
+
status: zod_1.z.enum([
|
|
11
|
+
"pending",
|
|
12
|
+
"processing",
|
|
13
|
+
"ready",
|
|
14
|
+
"completed",
|
|
15
|
+
"failed",
|
|
16
|
+
"not_applicable",
|
|
17
|
+
]),
|
|
18
|
+
data: zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
url: zod_1.z.string(),
|
|
21
|
+
entities: zod_1.z.object({}).partial().strict().passthrough(),
|
|
22
|
+
segment_entities: zod_1.z.array(zod_1.z
|
|
23
|
+
.object({
|
|
24
|
+
segment_id: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]),
|
|
25
|
+
start_time: zod_1.z.number(),
|
|
26
|
+
end_time: zod_1.z.number(),
|
|
27
|
+
entities: zod_1.z.object({}).partial().strict().passthrough(),
|
|
28
|
+
})
|
|
29
|
+
.partial()
|
|
30
|
+
.strict()
|
|
31
|
+
.passthrough()),
|
|
32
|
+
})
|
|
33
|
+
.partial()
|
|
34
|
+
.strict()
|
|
35
|
+
.passthrough()
|
|
36
|
+
.optional(),
|
|
37
|
+
error: zod_1.z.string().optional(),
|
|
38
|
+
})
|
|
39
|
+
.strict()
|
|
40
|
+
.passthrough();
|
|
41
|
+
const NewExtract = zod_1.z
|
|
42
|
+
.object({
|
|
43
|
+
url: zod_1.z.string(),
|
|
44
|
+
prompt: zod_1.z.string().optional(),
|
|
45
|
+
schema: zod_1.z.object({}).partial().strict().passthrough().optional(),
|
|
46
|
+
})
|
|
47
|
+
.strict()
|
|
48
|
+
.passthrough();
|
|
49
|
+
exports.schemas = {
|
|
50
|
+
Extract,
|
|
51
|
+
NewExtract,
|
|
52
|
+
};
|
|
53
|
+
const endpoints = (0, core_1.makeApi)([
|
|
54
|
+
{
|
|
55
|
+
method: "post",
|
|
56
|
+
path: "/extract",
|
|
57
|
+
alias: "createExtract",
|
|
58
|
+
description: `Creates a new extract`,
|
|
59
|
+
requestFormat: "json",
|
|
60
|
+
parameters: [
|
|
61
|
+
{
|
|
62
|
+
name: "body",
|
|
63
|
+
description: `Extract structured data from a video`,
|
|
64
|
+
type: "Body",
|
|
65
|
+
schema: NewExtract,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
response: Extract,
|
|
69
|
+
errors: [
|
|
70
|
+
{
|
|
71
|
+
status: 400,
|
|
72
|
+
description: `Invalid request or missing required prompt/schema`,
|
|
73
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
status: 404,
|
|
77
|
+
description: `Extract job not found`,
|
|
78
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
status: 429,
|
|
82
|
+
description: `Too many requests`,
|
|
83
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
status: 500,
|
|
87
|
+
description: `An unexpected error occurred on the server`,
|
|
88
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
status: 509,
|
|
92
|
+
description: `Monthly extract jobs limit reached`,
|
|
93
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
method: "get",
|
|
99
|
+
path: "/extract/:job_id",
|
|
100
|
+
alias: "getExtract",
|
|
101
|
+
description: `Retrieve the current state of an extraction job`,
|
|
102
|
+
requestFormat: "json",
|
|
103
|
+
parameters: [
|
|
104
|
+
{
|
|
105
|
+
name: "job_id",
|
|
106
|
+
type: "Path",
|
|
107
|
+
schema: zod_1.z.string(),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
response: Extract,
|
|
111
|
+
errors: [
|
|
112
|
+
{
|
|
113
|
+
status: 404,
|
|
114
|
+
description: `Job not found`,
|
|
115
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
status: 500,
|
|
119
|
+
description: `An unexpected error occurred on the server`,
|
|
120
|
+
schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
]);
|
|
125
|
+
exports.ExtractApi = new core_1.Zodios("https://api.cloudglue.dev/v1", endpoints);
|
|
126
|
+
function createApiClient(baseUrl, options) {
|
|
127
|
+
return new core_1.Zodios(baseUrl, endpoints, options);
|
|
128
|
+
}
|