@aviaryhq/cloudglue-js 0.1.2 → 0.1.3

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.
@@ -5,6 +5,7 @@ exports.createApiClient = createApiClient;
5
5
  const core_1 = require("@zodios/core");
6
6
  const zod_1 = require("zod");
7
7
  const common_1 = require("./common");
8
+ const common_2 = require("./common");
8
9
  const FileList = zod_1.z
9
10
  .object({
10
11
  object: zod_1.z.literal("list"),
@@ -15,6 +16,16 @@ const FileList = zod_1.z
15
16
  })
16
17
  .strict()
17
18
  .passthrough();
19
+ const SegmentationList = zod_1.z
20
+ .object({
21
+ object: zod_1.z.literal("list"),
22
+ data: zod_1.z.array(common_2.Segmentation),
23
+ total: zod_1.z.number().int(),
24
+ limit: zod_1.z.number().int(),
25
+ offset: zod_1.z.number().int(),
26
+ })
27
+ .strict()
28
+ .passthrough();
18
29
  const FileUpload = zod_1.z
19
30
  .object({
20
31
  file: zod_1.z.instanceof(File),
@@ -36,6 +47,7 @@ const FileUpdate = zod_1.z
36
47
  .passthrough();
37
48
  exports.schemas = {
38
49
  FileList,
50
+ SegmentationList,
39
51
  FileUpload,
40
52
  FileDelete,
41
53
  FileUpdate,
@@ -224,6 +236,81 @@ const endpoints = (0, core_1.makeApi)([
224
236
  },
225
237
  ],
226
238
  },
239
+ {
240
+ method: "post",
241
+ path: "/files/:file_id/segmentations",
242
+ alias: "createFileSegmentation",
243
+ description: `Create a new segmentation for a file using the specified segmentation configuration`,
244
+ requestFormat: "json",
245
+ parameters: [
246
+ {
247
+ name: "body",
248
+ description: `Segmentation configuration`,
249
+ type: "Body",
250
+ schema: common_2.SegmentationConfig,
251
+ },
252
+ {
253
+ name: "file_id",
254
+ type: "Path",
255
+ schema: zod_1.z.string().uuid(),
256
+ },
257
+ ],
258
+ response: common_2.Segmentation,
259
+ errors: [
260
+ {
261
+ status: 400,
262
+ description: `Invalid request or file duration is less than window size`,
263
+ schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
264
+ },
265
+ {
266
+ status: 404,
267
+ description: `File not found`,
268
+ schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
269
+ },
270
+ {
271
+ status: 500,
272
+ description: `An unexpected error occurred on the server`,
273
+ schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
274
+ },
275
+ ],
276
+ },
277
+ {
278
+ method: "get",
279
+ path: "/files/:file_id/segmentations",
280
+ alias: "listFileSegmentations",
281
+ description: `List all segmentations for a specific file`,
282
+ requestFormat: "json",
283
+ parameters: [
284
+ {
285
+ name: "file_id",
286
+ type: "Path",
287
+ schema: zod_1.z.string().uuid(),
288
+ },
289
+ {
290
+ name: "limit",
291
+ type: "Query",
292
+ schema: zod_1.z.number().int().gte(1).lte(100).optional().default(50),
293
+ },
294
+ {
295
+ name: "offset",
296
+ type: "Query",
297
+ schema: zod_1.z.number().int().gte(0).optional().default(0),
298
+ },
299
+ ],
300
+ response: SegmentationList,
301
+ errors: [
302
+ {
303
+ status: 404,
304
+ description: `File not found`,
305
+ schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
306
+ },
307
+ {
308
+ status: 500,
309
+ description: `An unexpected error occurred on the server`,
310
+ schema: zod_1.z.object({ error: zod_1.z.string() }).strict().passthrough(),
311
+ },
312
+ ],
313
+ },
227
314
  ]);
228
315
  exports.FilesApi = new core_1.Zodios("https://api.cloudglue.dev/v1", endpoints);
229
316
  function createApiClient(baseUrl, options) {