@aviaryhq/cloudglue-js 0.5.4 → 0.5.6

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.
@@ -608,26 +608,26 @@ export declare class EnhancedFilesApi {
608
608
  offset: import("zod").ZodNumber;
609
609
  }, import("zod").ZodTypeAny, "passthrough">>>;
610
610
  }, import("zod").ZodTypeAny, "passthrough">>;
611
- getFileSegment(fileId: string, segmentId: string): Promise<import("zod").objectOutputType<{
612
- id: import("zod").ZodString;
613
- file_id: import("zod").ZodString;
614
- start_time: import("zod").ZodNumber;
615
- end_time: import("zod").ZodNumber;
616
- thumbnail_url: import("zod").ZodString;
617
- metadata: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
618
- segmentation_id: import("zod").ZodOptional<import("zod").ZodString>;
619
- }, import("zod").ZodTypeAny, "passthrough">>;
611
+ getFileSegment(fileId: string, segmentId: string): Promise<{
612
+ id: string;
613
+ file_id: string;
614
+ start_time: number;
615
+ end_time: number;
616
+ thumbnail_url: string;
617
+ metadata?: {} | undefined;
618
+ segmentation_id?: string | undefined;
619
+ }>;
620
620
  updateFileSegment(fileId: string, segmentId: string, body: {
621
621
  metadata?: Record<string, any>;
622
- }): Promise<import("zod").objectOutputType<{
623
- id: import("zod").ZodString;
624
- file_id: import("zod").ZodString;
625
- start_time: import("zod").ZodNumber;
626
- end_time: import("zod").ZodNumber;
627
- thumbnail_url: import("zod").ZodString;
628
- metadata: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
629
- segmentation_id: import("zod").ZodOptional<import("zod").ZodString>;
630
- }, import("zod").ZodTypeAny, "passthrough">>;
622
+ }): Promise<{
623
+ id: string;
624
+ file_id: string;
625
+ start_time: number;
626
+ end_time: number;
627
+ thumbnail_url: string;
628
+ metadata?: {} | undefined;
629
+ segmentation_id?: string | undefined;
630
+ }>;
631
631
  getFileTags(fileId: string): Promise<{
632
632
  object: "list";
633
633
  total: number;
@@ -662,6 +662,26 @@ export declare class EnhancedFilesApi {
662
662
  segment_id: import("zod").ZodOptional<import("zod").ZodString>;
663
663
  }, import("zod").ZodTypeAny, "passthrough">[] | undefined;
664
664
  }>;
665
+ listFileSegments(fileId: string, params: {
666
+ limit?: number;
667
+ offset?: number;
668
+ startTimeAfter?: number;
669
+ endTimeBefore?: number;
670
+ }): Promise<{
671
+ object: "list";
672
+ data: Array<{
673
+ id: string;
674
+ file_id: string;
675
+ start_time: number;
676
+ end_time: number;
677
+ thumbnail_url: string;
678
+ metadata?: {} | undefined;
679
+ segmentation_id?: string | undefined;
680
+ }>;
681
+ total: number;
682
+ limit: number;
683
+ offset: number;
684
+ }>;
665
685
  /**
666
686
  * Waits for a file to finish processing by polling the getFile endpoint until the file
667
687
  * reaches a terminal state (completed, failed, or not_applicable) or until maxAttempts is reached.
@@ -115,6 +115,12 @@ class EnhancedFilesApi {
115
115
  params: { file_id: fileId, segment_id: segmentId },
116
116
  });
117
117
  }
118
+ async listFileSegments(fileId, params) {
119
+ return this.api.listFileSegments({
120
+ params: { file_id: fileId },
121
+ queries: params,
122
+ });
123
+ }
118
124
  /**
119
125
  * Waits for a file to finish processing by polling the getFile endpoint until the file
120
126
  * reaches a terminal state (completed, failed, or not_applicable) or until maxAttempts is reached.
@@ -0,0 +1,153 @@
1
+ import { ShareApi } from '../../generated';
2
+ export declare class EnhancedShareableApi {
3
+ private readonly api;
4
+ constructor(api: typeof ShareApi);
5
+ listShareableAssets(data: {
6
+ limit?: number;
7
+ offset?: number;
8
+ createdBefore?: string;
9
+ createdAfter?: string;
10
+ fileId?: string;
11
+ fileSegmentId?: string;
12
+ }): Promise<{
13
+ object: "list";
14
+ data: Array<{
15
+ id: string;
16
+ file_id: string;
17
+ file_segment_id?: string | undefined;
18
+ title?: string | undefined;
19
+ description?: string | undefined;
20
+ metadata?: {} | undefined;
21
+ preview_url?: string | undefined;
22
+ media_download_url?: string | undefined;
23
+ media_download_expires_at?: (number | null) | undefined;
24
+ share_url?: string | undefined;
25
+ status?: ("pending" | "processing" | "completed" | "failed") | undefined;
26
+ asset_type?: ("file" | "file_segment") | undefined;
27
+ created_at: number;
28
+ object?: "share" | undefined;
29
+ }>;
30
+ total: number;
31
+ limit: number;
32
+ offset: number;
33
+ }>;
34
+ createShareableAsset(data: {
35
+ file_id: string;
36
+ file_segment_id?: string;
37
+ title?: string;
38
+ description?: string;
39
+ metadata?: Record<string, unknown>;
40
+ preview_url?: string;
41
+ media_download_url: string;
42
+ media_download_expires_at: Date;
43
+ }): Promise<{
44
+ id: string;
45
+ file_id: string;
46
+ file_segment_id?: string | undefined;
47
+ title?: string | undefined;
48
+ description?: string | undefined;
49
+ metadata?: {} | undefined;
50
+ preview_url?: string | undefined;
51
+ media_download_url?: string | undefined;
52
+ media_download_expires_at?: (number | null) | undefined;
53
+ share_url?: string | undefined;
54
+ status?: ("pending" | "processing" | "completed" | "failed") | undefined;
55
+ asset_type?: ("file" | "file_segment") | undefined;
56
+ created_at: number;
57
+ object?: "share" | undefined;
58
+ }>;
59
+ getShareableAsset(id: string): Promise<{
60
+ id: string;
61
+ file_id: string;
62
+ file_segment_id?: string | undefined;
63
+ title?: string | undefined;
64
+ description?: string | undefined;
65
+ metadata?: {} | undefined;
66
+ preview_url?: string | undefined;
67
+ media_download_url?: string | undefined;
68
+ media_download_expires_at?: (number | null) | undefined;
69
+ share_url?: string | undefined;
70
+ status?: ("pending" | "processing" | "completed" | "failed") | undefined;
71
+ asset_type?: ("file" | "file_segment") | undefined;
72
+ created_at: number;
73
+ object?: "share" | undefined;
74
+ }>;
75
+ updateShareableAsset(id: string, data: {
76
+ title?: string;
77
+ description?: string;
78
+ metadata?: Record<string, unknown>;
79
+ }): Promise<{
80
+ id: string;
81
+ file_id: string;
82
+ file_segment_id?: string | undefined;
83
+ title?: string | undefined;
84
+ description?: string | undefined;
85
+ metadata?: {} | undefined;
86
+ preview_url?: string | undefined;
87
+ media_download_url?: string | undefined;
88
+ media_download_expires_at?: (number | null) | undefined;
89
+ share_url?: string | undefined;
90
+ status?: ("pending" | "processing" | "completed" | "failed") | undefined;
91
+ asset_type?: ("file" | "file_segment") | undefined;
92
+ created_at: number;
93
+ object?: "share" | undefined;
94
+ }>;
95
+ deleteShareableAsset(id: string): Promise<import("zod").objectOutputType<{
96
+ id: import("zod").ZodString;
97
+ object: import("zod").ZodLiteral<"share">;
98
+ }, import("zod").ZodTypeAny, "passthrough">>;
99
+ getFileShareableAsset(fileId: string, queries: {
100
+ limit?: number;
101
+ offset?: number;
102
+ createdBefore?: string;
103
+ createdAfter?: string;
104
+ }): Promise<{
105
+ object: "list";
106
+ data: Array<{
107
+ id: string;
108
+ file_id: string;
109
+ file_segment_id?: string | undefined;
110
+ title?: string | undefined;
111
+ description?: string | undefined;
112
+ metadata?: {} | undefined;
113
+ preview_url?: string | undefined;
114
+ media_download_url?: string | undefined;
115
+ media_download_expires_at?: (number | null) | undefined;
116
+ share_url?: string | undefined;
117
+ status?: ("pending" | "processing" | "completed" | "failed") | undefined;
118
+ asset_type?: ("file" | "file_segment") | undefined;
119
+ created_at: number;
120
+ object?: "share" | undefined;
121
+ }>;
122
+ total: number;
123
+ limit: number;
124
+ offset: number;
125
+ }>;
126
+ getFileSegmentShareableAsset(fileId: string, segmentId: string, queries: {
127
+ limit?: number;
128
+ offset?: number;
129
+ createdBefore?: string;
130
+ createdAfter?: string;
131
+ }): Promise<{
132
+ object: "list";
133
+ data: Array<{
134
+ id: string;
135
+ file_id: string;
136
+ file_segment_id?: string | undefined;
137
+ title?: string | undefined;
138
+ description?: string | undefined;
139
+ metadata?: {} | undefined;
140
+ preview_url?: string | undefined;
141
+ media_download_url?: string | undefined;
142
+ media_download_expires_at?: (number | null) | undefined;
143
+ share_url?: string | undefined;
144
+ status?: ("pending" | "processing" | "completed" | "failed") | undefined;
145
+ asset_type?: ("file" | "file_segment") | undefined;
146
+ created_at: number;
147
+ object?: "share" | undefined;
148
+ }>;
149
+ total: number;
150
+ limit: number;
151
+ offset: number;
152
+ }>;
153
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnhancedShareableApi = void 0;
4
+ class EnhancedShareableApi {
5
+ constructor(api) {
6
+ this.api = api;
7
+ }
8
+ async listShareableAssets(data) {
9
+ return this.api.listShareableAssets({ queries: data });
10
+ }
11
+ async createShareableAsset(data) {
12
+ return this.api.createShareableAsset(data);
13
+ }
14
+ async getShareableAsset(id) {
15
+ return this.api.getShareableAsset({
16
+ params: { id },
17
+ });
18
+ }
19
+ async updateShareableAsset(id, data) {
20
+ return this.api.updateShareableAsset(data, {
21
+ params: { id },
22
+ });
23
+ }
24
+ async deleteShareableAsset(id) {
25
+ return this.api.deleteShareableAsset(undefined, {
26
+ params: { id },
27
+ });
28
+ }
29
+ async getFileShareableAsset(fileId, queries) {
30
+ return this.api.listShareableAssets({
31
+ queries: { file_id: fileId, ...queries },
32
+ });
33
+ }
34
+ async getFileSegmentShareableAsset(fileId, segmentId, queries) {
35
+ return this.api.listShareableAssets({
36
+ queries: { file_id: fileId, file_segment_id: segmentId, ...queries },
37
+ });
38
+ }
39
+ }
40
+ exports.EnhancedShareableApi = EnhancedShareableApi;
@@ -13,6 +13,7 @@ import { EnhancedSegmentsApi } from './api/segments.api';
13
13
  import { EnhancedTranscribeApi } from './api/transcribe.api';
14
14
  import { EnhancedChatApi } from './api/chat-completion.api';
15
15
  import { EnhancedCollectionsApi } from './api/collections.api';
16
+ import { EnhancedShareableApi } from './api/shareable.api';
16
17
  /**
17
18
  * Main CloudGlue client class that provides access to all API functionality
18
19
  * through enhanced, user-friendly interfaces
@@ -87,5 +88,10 @@ export declare class CloudGlue {
87
88
  * Provides methods for creating and managing tags
88
89
  */
89
90
  readonly tags: EnhancedTagsApi;
91
+ /**
92
+ * Shareable API for managing shareable assets
93
+ * Provides methods for creating and managing shareable assets
94
+ */
95
+ readonly shareable: EnhancedShareableApi;
90
96
  constructor(config?: CloudGlueConfig);
91
97
  }
@@ -15,6 +15,7 @@ const Frames_1 = require("../generated/Frames");
15
15
  const Face_Detection_1 = require("../generated/Face_Detection");
16
16
  const Face_Match_1 = require("../generated/Face_Match");
17
17
  const Tags_1 = require("../generated/Tags");
18
+ const Share_1 = require("../generated/Share");
18
19
  const webhooks_api_1 = require("./api/webhooks.api");
19
20
  const tags_api_1 = require("./api/tags.api");
20
21
  const error_1 = require("./error");
@@ -30,6 +31,7 @@ const segments_api_1 = require("./api/segments.api");
30
31
  const transcribe_api_1 = require("./api/transcribe.api");
31
32
  const chat_completion_api_1 = require("./api/chat-completion.api");
32
33
  const collections_api_1 = require("./api/collections.api");
34
+ const shareable_api_1 = require("./api/shareable.api");
33
35
  /**
34
36
  * Main CloudGlue client class that provides access to all API functionality
35
37
  * through enhanced, user-friendly interfaces
@@ -46,7 +48,7 @@ class CloudGlue {
46
48
  headers: {
47
49
  Authorization: `Bearer ${this.apiKey}`,
48
50
  'x-sdk-client': 'cloudglue-js',
49
- 'x-sdk-version': '0.5.4',
51
+ 'x-sdk-version': '0.5.6',
50
52
  },
51
53
  baseURL: this.baseUrl,
52
54
  timeout: this.timeout,
@@ -72,6 +74,7 @@ class CloudGlue {
72
74
  const faceMatchApi = (0, Face_Match_1.createApiClient)(this.baseUrl, sharedConfig);
73
75
  const webhooksApi = (0, Webhooks_1.createApiClient)(this.baseUrl, sharedConfig);
74
76
  const tagsApi = (0, Tags_1.createApiClient)(this.baseUrl, sharedConfig);
77
+ const shareableApi = (0, Share_1.createApiClient)(this.baseUrl, sharedConfig);
75
78
  // Configure base URL and axios config for all clients
76
79
  [
77
80
  filesApi,
@@ -88,6 +91,7 @@ class CloudGlue {
88
91
  faceMatchApi,
89
92
  webhooksApi,
90
93
  tagsApi,
94
+ shareableApi,
91
95
  ].forEach((client) => {
92
96
  Object.assign(client.axios.defaults, axiosConfig);
93
97
  client.axios.interceptors.response.use((response) => {
@@ -121,6 +125,7 @@ class CloudGlue {
121
125
  this.faceMatch = new face_match_api_1.EnhancedFaceMatchApi(faceMatchApi);
122
126
  this.webhooks = new webhooks_api_1.EnhancedWebhooksApi(webhooksApi);
123
127
  this.tags = new tags_api_1.EnhancedTagsApi(tagsApi);
128
+ this.shareable = new shareable_api_1.EnhancedShareableApi(shareableApi);
124
129
  }
125
130
  }
126
131
  exports.CloudGlue = CloudGlue;
@@ -14,6 +14,7 @@ import { schemas as faceDetectionSchemas } from '../generated/Face_Detection';
14
14
  import { schemas as faceMatchSchemas } from '../generated/Face_Match';
15
15
  import { FilterOperator } from './enums';
16
16
  import { schemas as tagsSchemas } from '../generated/Tags';
17
+ import { schemas as shareableSchemas } from '../generated/Share';
17
18
  /**
18
19
  * Represents a video file in the Cloudglue system
19
20
  * Contains metadata about the file including its status, size, and video information
@@ -143,11 +144,11 @@ export type FaceGroupResult = z.infer<typeof searchSchemas.FaceGroupResult>;
143
144
  /**
144
145
  * Represents search filter criteria for filtering results
145
146
  */
146
- export type SearchFilterCriteria = z.infer<typeof searchSchemas.SearchFilterCriteria>;
147
+ export type SearchFilterCriteria = z.infer<typeof searchSchemas.SearchRequest>;
147
148
  /**
148
149
  * Represents search filter options for metadata, video info, and file properties
149
150
  */
150
- export type SearchFilter = z.infer<typeof searchSchemas.SearchFilter>;
151
+ export type SearchFilter = z.infer<typeof searchSchemas.SearchRequest>['filter'];
151
152
  /**
152
153
  * Represents the result of a video description request
153
154
  * Contains detailed information about the video content including speech, text, and visual descriptions
@@ -268,3 +269,7 @@ export type ThumbnailType = 'segment' | 'keyframe' | 'file' | 'frame';
268
269
  export type CreateVideoTagParams = z.infer<typeof tagsSchemas.CreateVideoTagRequest>;
269
270
  export type UpdateVideoTagParams = z.infer<typeof tagsSchemas.UpdateVideoTagRequest>;
270
271
  export type { ListVideoTagsResponse, VideoTag };
272
+ export type ShareableAsset = z.infer<typeof shareableSchemas.ShareableAsset>;
273
+ export type ShareableAssetListResponse = z.infer<typeof shareableSchemas.ShareableAssetListResponse>;
274
+ export type CreateShareableAssetRequest = z.infer<typeof shareableSchemas.CreateShareableAssetRequest>;
275
+ export type UpdateShareableAssetRequest = z.infer<typeof shareableSchemas.UpdateShareableAssetRequest>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aviaryhq/cloudglue-js",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Cloudglue API client for Node.js",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",