@aviaryhq/cloudglue-js 0.3.6 → 0.3.7

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.
@@ -13,6 +13,7 @@ type Extract = {
13
13
  enable_video_level_entities: boolean;
14
14
  enable_segment_level_entities: boolean;
15
15
  }> | undefined;
16
+ segmentation_id?: string | undefined;
16
17
  data?: Partial<{
17
18
  entities: {};
18
19
  segment_entities: Array<Partial<{
@@ -21,6 +22,9 @@ type Extract = {
21
22
  entities: {};
22
23
  }>>;
23
24
  }> | undefined;
25
+ total?: number | undefined;
26
+ limit?: number | undefined;
27
+ offset?: number | undefined;
24
28
  error?: string | undefined;
25
29
  };
26
30
  type NewExtract = {
@@ -177,12 +181,20 @@ export declare const ExtractApi: import("@zodios/core").ZodiosInstance<[{
177
181
  method: "get";
178
182
  path: "/extract/:job_id";
179
183
  alias: "getExtract";
180
- description: "Retrieve the current state of an extraction job";
184
+ description: "Retrieve the current state of an extraction job. Results are paginated with a default limit of 50 segment entities per request (maximum 100). Use limit and offset parameters to paginate through all segment entities.";
181
185
  requestFormat: "json";
182
186
  parameters: [{
183
187
  name: "job_id";
184
188
  type: "Path";
185
189
  schema: z.ZodString;
190
+ }, {
191
+ name: "limit";
192
+ type: "Query";
193
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
194
+ }, {
195
+ name: "offset";
196
+ type: "Query";
197
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
186
198
  }];
187
199
  response: z.ZodType<Extract, z.ZodTypeDef, Extract>;
188
200
  errors: [{
@@ -338,12 +350,20 @@ export declare function createApiClient(baseUrl: string, options?: ZodiosOptions
338
350
  method: "get";
339
351
  path: "/extract/:job_id";
340
352
  alias: "getExtract";
341
- description: "Retrieve the current state of an extraction job";
353
+ description: "Retrieve the current state of an extraction job. Results are paginated with a default limit of 50 segment entities per request (maximum 100). Use limit and offset parameters to paginate through all segment entities.";
342
354
  requestFormat: "json";
343
355
  parameters: [{
344
356
  name: "job_id";
345
357
  type: "Path";
346
358
  schema: z.ZodString;
359
+ }, {
360
+ name: "limit";
361
+ type: "Query";
362
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
363
+ }, {
364
+ name: "offset";
365
+ type: "Query";
366
+ schema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
347
367
  }];
348
368
  response: z.ZodType<Extract, z.ZodTypeDef, Extract>;
349
369
  errors: [{
@@ -29,6 +29,7 @@ const Extract = zod_1.z
29
29
  .strict()
30
30
  .passthrough()
31
31
  .optional(),
32
+ segmentation_id: zod_1.z.string().optional(),
32
33
  data: zod_1.z
33
34
  .object({
34
35
  entities: zod_1.z.object({}).partial().strict().passthrough(),
@@ -46,6 +47,9 @@ const Extract = zod_1.z
46
47
  .strict()
47
48
  .passthrough()
48
49
  .optional(),
50
+ total: zod_1.z.number().int().optional(),
51
+ limit: zod_1.z.number().int().optional(),
52
+ offset: zod_1.z.number().int().optional(),
49
53
  error: zod_1.z.string().optional(),
50
54
  })
51
55
  .strict()
@@ -190,7 +194,7 @@ const endpoints = (0, core_1.makeApi)([
190
194
  method: "get",
191
195
  path: "/extract/:job_id",
192
196
  alias: "getExtract",
193
- description: `Retrieve the current state of an extraction job`,
197
+ description: `Retrieve the current state of an extraction job. Results are paginated with a default limit of 50 segment entities per request (maximum 100). Use limit and offset parameters to paginate through all segment entities.`,
194
198
  requestFormat: "json",
195
199
  parameters: [
196
200
  {
@@ -198,6 +202,16 @@ const endpoints = (0, core_1.makeApi)([
198
202
  type: "Path",
199
203
  schema: zod_1.z.string(),
200
204
  },
205
+ {
206
+ name: "limit",
207
+ type: "Query",
208
+ schema: zod_1.z.number().int().gte(1).lte(100).optional().default(50),
209
+ },
210
+ {
211
+ name: "offset",
212
+ type: "Query",
213
+ schema: zod_1.z.number().int().gte(0).optional().default(0),
214
+ },
201
215
  ],
202
216
  response: Extract,
203
217
  errors: [
@@ -2625,6 +2625,7 @@ declare class EnhancedExtractApi {
2625
2625
  enable_video_level_entities: boolean;
2626
2626
  enable_segment_level_entities: boolean;
2627
2627
  }> | undefined;
2628
+ segmentation_id?: string | undefined;
2628
2629
  data?: Partial<{
2629
2630
  entities: {};
2630
2631
  segment_entities: Array<Partial<{
@@ -2633,9 +2634,15 @@ declare class EnhancedExtractApi {
2633
2634
  entities: {};
2634
2635
  }>>;
2635
2636
  }> | undefined;
2637
+ total?: number | undefined;
2638
+ limit?: number | undefined;
2639
+ offset?: number | undefined;
2636
2640
  error?: string | undefined;
2637
2641
  }>;
2638
- getExtract(jobId: string): Promise<{
2642
+ getExtract(jobId: string, params?: {
2643
+ limit?: number;
2644
+ offset?: number;
2645
+ }): Promise<{
2639
2646
  job_id: string;
2640
2647
  status: "pending" | "processing" | "completed" | "failed" | "not_applicable";
2641
2648
  url?: string | undefined;
@@ -2646,6 +2653,7 @@ declare class EnhancedExtractApi {
2646
2653
  enable_video_level_entities: boolean;
2647
2654
  enable_segment_level_entities: boolean;
2648
2655
  }> | undefined;
2656
+ segmentation_id?: string | undefined;
2649
2657
  data?: Partial<{
2650
2658
  entities: {};
2651
2659
  segment_entities: Array<Partial<{
@@ -2654,6 +2662,9 @@ declare class EnhancedExtractApi {
2654
2662
  entities: {};
2655
2663
  }>>;
2656
2664
  }> | undefined;
2665
+ total?: number | undefined;
2666
+ limit?: number | undefined;
2667
+ offset?: number | undefined;
2657
2668
  error?: string | undefined;
2658
2669
  }>;
2659
2670
  listExtracts(params?: {
@@ -2676,6 +2687,7 @@ declare class EnhancedExtractApi {
2676
2687
  enable_video_level_entities: boolean;
2677
2688
  enable_segment_level_entities: boolean;
2678
2689
  }> | undefined;
2690
+ segmentation_id?: string | undefined;
2679
2691
  data?: Partial<{
2680
2692
  entities: {};
2681
2693
  segment_entities: Array<Partial<{
@@ -2684,6 +2696,9 @@ declare class EnhancedExtractApi {
2684
2696
  entities: {};
2685
2697
  }>>;
2686
2698
  }> | undefined;
2699
+ total?: number | undefined;
2700
+ limit?: number | undefined;
2701
+ offset?: number | undefined;
2687
2702
  error?: string | undefined;
2688
2703
  }>;
2689
2704
  total: number;
@@ -2710,6 +2725,7 @@ declare class EnhancedExtractApi {
2710
2725
  enable_video_level_entities: boolean;
2711
2726
  enable_segment_level_entities: boolean;
2712
2727
  }> | undefined;
2728
+ segmentation_id?: string | undefined;
2713
2729
  data?: Partial<{
2714
2730
  entities: {};
2715
2731
  segment_entities: Array<Partial<{
@@ -2718,6 +2734,9 @@ declare class EnhancedExtractApi {
2718
2734
  entities: {};
2719
2735
  }>>;
2720
2736
  }> | undefined;
2737
+ total?: number | undefined;
2738
+ limit?: number | undefined;
2739
+ offset?: number | undefined;
2721
2740
  error?: string | undefined;
2722
2741
  }>;
2723
2742
  }
@@ -334,8 +334,11 @@ class EnhancedExtractApi {
334
334
  ...options,
335
335
  });
336
336
  }
337
- async getExtract(jobId) {
338
- return this.api.getExtract({ params: { job_id: jobId } });
337
+ async getExtract(jobId, params = {}) {
338
+ return this.api.getExtract({
339
+ params: { job_id: jobId },
340
+ queries: params
341
+ });
339
342
  }
340
343
  async listExtracts(params = {}) {
341
344
  return this.api.listExtracts({ queries: params });
@@ -625,7 +628,7 @@ class CloudGlue {
625
628
  headers: {
626
629
  Authorization: `Bearer ${this.apiKey}`,
627
630
  'x-sdk-client': 'cloudglue-js',
628
- 'x-sdk-version': '0.3.6',
631
+ 'x-sdk-version': '0.3.7',
629
632
  },
630
633
  baseURL: this.baseUrl,
631
634
  timeout: this.timeout,
package/package.json CHANGED
@@ -1,12 +1,21 @@
1
1
  {
2
2
  "name": "@aviaryhq/cloudglue-js",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Cloudglue API client for Node.js",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
10
+ "scripts": {
11
+ "clean": "rimraf dist",
12
+ "generate": "node generate.js",
13
+ "build": "tsc && node scripts/build.js",
14
+ "watch": "tsc --watch",
15
+ "prepare": "npm run build",
16
+ "prepublishOnly": "npm run build",
17
+ "release": "npm run build && npm publish"
18
+ },
10
19
  "repository": {
11
20
  "type": "git",
12
21
  "url": "git+https://github.com/aviaryhq/cloudglue-js.git"
@@ -35,12 +44,5 @@
35
44
  },
36
45
  "peerDependencies": {
37
46
  "@zodios/core": "^10.0.0"
38
- },
39
- "scripts": {
40
- "clean": "rimraf dist",
41
- "generate": "node generate.js",
42
- "build": "tsc && node scripts/build.js",
43
- "watch": "tsc --watch",
44
- "release": "npm run build && npm publish"
45
47
  }
46
- }
48
+ }