@aviaryhq/cloudglue-js 0.5.4 → 0.5.5
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 +41 -11
- package/dist/generated/Chat.js +16 -2
- package/dist/generated/Files.d.ts +80 -125
- package/dist/generated/Files.js +59 -13
- package/dist/generated/Search.d.ts +1 -41
- package/dist/generated/Search.js +2 -44
- package/dist/generated/Share.d.ts +464 -0
- package/dist/generated/Share.js +219 -0
- package/dist/generated/common.d.ts +235 -0
- package/dist/generated/common.js +42 -1
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +3 -1
- package/dist/src/api/chat-completion.api.d.ts +33 -3
- package/dist/src/api/files.api.d.ts +38 -18
- package/dist/src/api/files.api.js +6 -0
- package/dist/src/api/shareable.api.d.ts +155 -0
- package/dist/src/api/shareable.api.js +40 -0
- package/dist/src/client.d.ts +6 -0
- package/dist/src/client.js +6 -1
- package/dist/src/types.d.ts +7 -2
- package/package.json +1 -1
|
@@ -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<
|
|
612
|
-
id:
|
|
613
|
-
file_id:
|
|
614
|
-
start_time:
|
|
615
|
-
end_time:
|
|
616
|
-
thumbnail_url:
|
|
617
|
-
metadata
|
|
618
|
-
segmentation_id
|
|
619
|
-
}
|
|
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<
|
|
623
|
-
id:
|
|
624
|
-
file_id:
|
|
625
|
-
start_time:
|
|
626
|
-
end_time:
|
|
627
|
-
thumbnail_url:
|
|
628
|
-
metadata
|
|
629
|
-
segmentation_id
|
|
630
|
-
}
|
|
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,155 @@
|
|
|
1
|
+
import { ShareApi } from '../../generated';
|
|
2
|
+
export declare class EnhancedShareableApi {
|
|
3
|
+
private readonly api;
|
|
4
|
+
constructor(api: typeof ShareApi);
|
|
5
|
+
listShareableAssets(data: {
|
|
6
|
+
accountId: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
offset?: number;
|
|
9
|
+
createdBefore?: string;
|
|
10
|
+
createdAfter?: string;
|
|
11
|
+
fileId?: string;
|
|
12
|
+
fileSegmentId?: string;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
object: "list";
|
|
15
|
+
data: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
file_id: string;
|
|
18
|
+
file_segment_id?: string | undefined;
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
description?: string | undefined;
|
|
21
|
+
metadata?: {} | undefined;
|
|
22
|
+
preview_url?: string | undefined;
|
|
23
|
+
media_download_url?: string | undefined;
|
|
24
|
+
media_download_expires_at?: (number | null) | undefined;
|
|
25
|
+
share_url?: string | undefined;
|
|
26
|
+
status?: ("pending" | "processing" | "completed" | "failed") | undefined;
|
|
27
|
+
asset_type?: ("file" | "file_segment") | undefined;
|
|
28
|
+
created_at: number;
|
|
29
|
+
object?: "share" | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
total: number;
|
|
32
|
+
limit: number;
|
|
33
|
+
offset: number;
|
|
34
|
+
}>;
|
|
35
|
+
createShareableAsset(data: {
|
|
36
|
+
file_id: string;
|
|
37
|
+
file_segment_id?: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
account_id: string;
|
|
42
|
+
preview_url?: string;
|
|
43
|
+
media_download_url: string;
|
|
44
|
+
media_download_expires_at: Date;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
id: string;
|
|
47
|
+
file_id: string;
|
|
48
|
+
file_segment_id?: string | undefined;
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
metadata?: {} | undefined;
|
|
52
|
+
preview_url?: string | undefined;
|
|
53
|
+
media_download_url?: string | undefined;
|
|
54
|
+
media_download_expires_at?: (number | null) | undefined;
|
|
55
|
+
share_url?: string | undefined;
|
|
56
|
+
status?: ("pending" | "processing" | "completed" | "failed") | undefined;
|
|
57
|
+
asset_type?: ("file" | "file_segment") | undefined;
|
|
58
|
+
created_at: number;
|
|
59
|
+
object?: "share" | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
getShareableAsset(id: string): Promise<{
|
|
62
|
+
id: string;
|
|
63
|
+
file_id: string;
|
|
64
|
+
file_segment_id?: string | undefined;
|
|
65
|
+
title?: string | undefined;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
metadata?: {} | undefined;
|
|
68
|
+
preview_url?: string | undefined;
|
|
69
|
+
media_download_url?: string | undefined;
|
|
70
|
+
media_download_expires_at?: (number | null) | undefined;
|
|
71
|
+
share_url?: string | undefined;
|
|
72
|
+
status?: ("pending" | "processing" | "completed" | "failed") | undefined;
|
|
73
|
+
asset_type?: ("file" | "file_segment") | undefined;
|
|
74
|
+
created_at: number;
|
|
75
|
+
object?: "share" | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
updateShareableAsset(id: string, data: {
|
|
78
|
+
title?: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
metadata?: Record<string, unknown>;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
id: string;
|
|
83
|
+
file_id: string;
|
|
84
|
+
file_segment_id?: string | undefined;
|
|
85
|
+
title?: string | undefined;
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
metadata?: {} | undefined;
|
|
88
|
+
preview_url?: string | undefined;
|
|
89
|
+
media_download_url?: string | undefined;
|
|
90
|
+
media_download_expires_at?: (number | null) | undefined;
|
|
91
|
+
share_url?: string | undefined;
|
|
92
|
+
status?: ("pending" | "processing" | "completed" | "failed") | undefined;
|
|
93
|
+
asset_type?: ("file" | "file_segment") | undefined;
|
|
94
|
+
created_at: number;
|
|
95
|
+
object?: "share" | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
deleteShareableAsset(id: string): Promise<import("zod").objectOutputType<{
|
|
98
|
+
id: import("zod").ZodString;
|
|
99
|
+
object: import("zod").ZodLiteral<"share">;
|
|
100
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
101
|
+
getFileShareableAsset(fileId: string, queries: {
|
|
102
|
+
limit?: number;
|
|
103
|
+
offset?: number;
|
|
104
|
+
createdBefore?: string;
|
|
105
|
+
createdAfter?: string;
|
|
106
|
+
}): Promise<{
|
|
107
|
+
object: "list";
|
|
108
|
+
data: Array<{
|
|
109
|
+
id: string;
|
|
110
|
+
file_id: string;
|
|
111
|
+
file_segment_id?: string | undefined;
|
|
112
|
+
title?: string | undefined;
|
|
113
|
+
description?: string | undefined;
|
|
114
|
+
metadata?: {} | undefined;
|
|
115
|
+
preview_url?: string | undefined;
|
|
116
|
+
media_download_url?: string | undefined;
|
|
117
|
+
media_download_expires_at?: (number | null) | undefined;
|
|
118
|
+
share_url?: string | undefined;
|
|
119
|
+
status?: ("pending" | "processing" | "completed" | "failed") | undefined;
|
|
120
|
+
asset_type?: ("file" | "file_segment") | undefined;
|
|
121
|
+
created_at: number;
|
|
122
|
+
object?: "share" | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
total: number;
|
|
125
|
+
limit: number;
|
|
126
|
+
offset: number;
|
|
127
|
+
}>;
|
|
128
|
+
getFileSegmentShareableAsset(fileId: string, segmentId: string, queries: {
|
|
129
|
+
limit?: number;
|
|
130
|
+
offset?: number;
|
|
131
|
+
createdBefore?: string;
|
|
132
|
+
createdAfter?: string;
|
|
133
|
+
}): Promise<{
|
|
134
|
+
object: "list";
|
|
135
|
+
data: Array<{
|
|
136
|
+
id: string;
|
|
137
|
+
file_id: string;
|
|
138
|
+
file_segment_id?: string | undefined;
|
|
139
|
+
title?: string | undefined;
|
|
140
|
+
description?: string | undefined;
|
|
141
|
+
metadata?: {} | undefined;
|
|
142
|
+
preview_url?: string | undefined;
|
|
143
|
+
media_download_url?: string | undefined;
|
|
144
|
+
media_download_expires_at?: (number | null) | undefined;
|
|
145
|
+
share_url?: string | undefined;
|
|
146
|
+
status?: ("pending" | "processing" | "completed" | "failed") | undefined;
|
|
147
|
+
asset_type?: ("file" | "file_segment") | undefined;
|
|
148
|
+
created_at: number;
|
|
149
|
+
object?: "share" | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
total: number;
|
|
152
|
+
limit: number;
|
|
153
|
+
offset: number;
|
|
154
|
+
}>;
|
|
155
|
+
}
|
|
@@ -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;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/src/client.js
CHANGED
|
@@ -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.
|
|
51
|
+
'x-sdk-version': '0.5.5',
|
|
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;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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>;
|