whio-api-sdk 1.0.8 → 1.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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/src/sdk/exampleuse.d.ts +1 -1
- package/dist/src/sdk/exampleuse.js +6 -1
- package/dist/src/sdk/sdk.d.ts +2 -2
- package/dist/src/sdk/sdk.js +2 -5
- package/dist/src/sdk/types.d.ts +8 -0
- package/index.ts +2 -1
- package/package.json +1 -1
- package/src/sdk/exampleuse.ts +6 -2
- package/src/sdk/sdk.ts +5 -7
- package/src/sdk/types.ts +9 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function main(): Promise<void>;
|
|
@@ -33,7 +33,7 @@ const loginCredentials = {
|
|
|
33
33
|
password: "",
|
|
34
34
|
};
|
|
35
35
|
const sdk = new ApiSDK(config);
|
|
36
|
-
function main() {
|
|
36
|
+
export function main() {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
yield sdk.login(loginCredentials);
|
|
39
39
|
const user = sdk.getCurrentUser();
|
|
@@ -49,6 +49,11 @@ function main() {
|
|
|
49
49
|
//console.log("Updated User Template", updatedUserTemplate);
|
|
50
50
|
const templates = yield sdk.getTemplates();
|
|
51
51
|
const userTemplates = yield sdk.getUserTemplates();
|
|
52
|
+
const filepath = "/Users/rimu/Downloads/combined_1749168962192.m4a"; // Replace with your actual file path
|
|
53
|
+
const formData = new FormData();
|
|
54
|
+
formData.append('file', new Blob([filepath]), 'audio.m4a'); // Adjust the Blob as necessary
|
|
55
|
+
const transcriptionSummary = yield sdk.uploadAudioFile(formData);
|
|
56
|
+
console.log("Transcription Summary:", transcriptionSummary);
|
|
52
57
|
});
|
|
53
58
|
}
|
|
54
59
|
main().catch((error) => {
|
package/dist/src/sdk/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoginResponse, LoginCredentials, SDKConfig, User, Template, Team, UserTemplate, TranscriptionSummary } from './types';
|
|
1
|
+
import { LoginResponse, LoginCredentials, SDKConfig, User, Template, Team, UserTemplate, TranscriptionSummary, TranscriptionAudioUploadResponse } from './types';
|
|
2
2
|
export declare class ApiSDK {
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private storage;
|
|
@@ -37,5 +37,5 @@ export declare class ApiSDK {
|
|
|
37
37
|
generateTranscriptionSummaryFromUserTemplate(transcript: string, userTemplateId: string): Promise<TranscriptionSummary>;
|
|
38
38
|
updateTranscriptionSummary(id: string, content: string): Promise<TranscriptionSummary>;
|
|
39
39
|
uploadLargeAudioFile(formData: FormData): Promise<string>;
|
|
40
|
-
uploadAudioFile(formData: FormData): Promise<
|
|
40
|
+
uploadAudioFile(formData: FormData): Promise<TranscriptionAudioUploadResponse | null>;
|
|
41
41
|
}
|
package/dist/src/sdk/sdk.js
CHANGED
|
@@ -298,11 +298,8 @@ export class ApiSDK {
|
|
|
298
298
|
}
|
|
299
299
|
uploadAudioFile(formData) {
|
|
300
300
|
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
const uploadIdsArray = JSON.parse(uploadIds);
|
|
304
|
-
yield this.storage.setItem('uploadIds', JSON.stringify([...uploadIdsArray, uploadId]));
|
|
305
|
-
return uploadId;
|
|
301
|
+
const data = yield this.request(urls.uploadAudio, 'POST', formData, { 'Content-Type': 'multipart/form-data' });
|
|
302
|
+
return data;
|
|
306
303
|
});
|
|
307
304
|
}
|
|
308
305
|
}
|
package/dist/src/sdk/types.d.ts
CHANGED
|
@@ -215,3 +215,11 @@ export interface Team {
|
|
|
215
215
|
teamRoles?: TeamRole[];
|
|
216
216
|
teamTemplates?: TeamTemplate[];
|
|
217
217
|
}
|
|
218
|
+
export interface TranscriptionAudioUploadResponse {
|
|
219
|
+
success: Boolean;
|
|
220
|
+
transcription: string;
|
|
221
|
+
model_version: string;
|
|
222
|
+
metadata: any[];
|
|
223
|
+
duration: number;
|
|
224
|
+
log: string;
|
|
225
|
+
}
|
package/index.ts
CHANGED
package/package.json
CHANGED
package/src/sdk/exampleuse.ts
CHANGED
|
@@ -35,7 +35,7 @@ const loginCredentials: LoginCredentials = {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const sdk = new ApiSDK(config);
|
|
38
|
-
async function main() {
|
|
38
|
+
export async function main() {
|
|
39
39
|
await sdk.login(loginCredentials);
|
|
40
40
|
const user: User | null = sdk.getCurrentUser();
|
|
41
41
|
const newUser: User = await sdk.createEditorUser(
|
|
@@ -83,7 +83,11 @@ async function main() {
|
|
|
83
83
|
const templates = await sdk.getTemplates();
|
|
84
84
|
const userTemplates = await sdk.getUserTemplates();
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
const filepath = "/Users/rimu/Downloads/combined_1749168962192.m4a"; // Replace with your actual file path
|
|
87
|
+
const formData = new FormData();
|
|
88
|
+
formData.append('file', new Blob([filepath]), 'audio.m4a'); // Adjust the Blob as necessary
|
|
89
|
+
const transcriptionSummary = await sdk.uploadAudioFile(formData);
|
|
90
|
+
console.log("Transcription Summary:", transcriptionSummary);
|
|
87
91
|
|
|
88
92
|
}
|
|
89
93
|
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Team,
|
|
24
24
|
UserTemplate,
|
|
25
25
|
TranscriptionSummary,
|
|
26
|
+
TranscriptionAudioUploadResponse,
|
|
26
27
|
} from './types';
|
|
27
28
|
import urls from './urls';
|
|
28
29
|
import jwtDecode from 'jwt-decode';
|
|
@@ -360,17 +361,14 @@ export class ApiSDK {
|
|
|
360
361
|
return uploadId;
|
|
361
362
|
}
|
|
362
363
|
|
|
363
|
-
public async uploadAudioFile(formData: FormData): Promise<
|
|
364
|
-
const
|
|
365
|
-
urls.
|
|
364
|
+
public async uploadAudioFile(formData: FormData): Promise<TranscriptionAudioUploadResponse | null> {
|
|
365
|
+
const data: TranscriptionAudioUploadResponse = await this.request(
|
|
366
|
+
urls.uploadAudio,
|
|
366
367
|
'POST',
|
|
367
368
|
formData,
|
|
368
369
|
{ 'Content-Type': 'multipart/form-data' }
|
|
369
370
|
);
|
|
370
|
-
|
|
371
|
-
const uploadIdsArray = JSON.parse(uploadIds);
|
|
372
|
-
await this.storage!.setItem('uploadIds', JSON.stringify([...uploadIdsArray, uploadId]));
|
|
373
|
-
return uploadId;
|
|
371
|
+
return data;
|
|
374
372
|
}
|
|
375
373
|
|
|
376
374
|
|
package/src/sdk/types.ts
CHANGED
|
@@ -275,4 +275,13 @@ export interface Team {
|
|
|
275
275
|
teamTemplates?: TeamTemplate[];
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
export interface TranscriptionAudioUploadResponse {
|
|
279
|
+
success: Boolean,
|
|
280
|
+
transcription: string,
|
|
281
|
+
model_version: string,
|
|
282
|
+
metadata: any[],
|
|
283
|
+
duration: number,
|
|
284
|
+
log: string,
|
|
285
|
+
}
|
|
286
|
+
|
|
278
287
|
|