whio-api-sdk 1.0.179-beta → 1.0.181-bet-staging

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.
@@ -45,6 +45,18 @@ export function main() {
45
45
  const updatedTemplate = yield sdk.updateTemplate("Updated Template", "This is an updated test template", template.id);
46
46
  const userTemplate = yield sdk.createUserTemplate("User Template", "This is a user template", template.id);
47
47
  const updatedUserTemplate = yield sdk.updateUserTemplate("User templated updated", "This is an updated user template", userTemplate.id);
48
+ // Create a workflow example
49
+ const workflow = yield sdk.createWorkflow("Test Workflow");
50
+ console.log("Created workflow:", workflow);
51
+ // Create template with workflow and agent IDs
52
+ const templateWithWorkflow = yield sdk.createTemplate("Template with Workflow", "This template has a workflow attached", undefined, // categoryId - will use default
53
+ workflow.id, // workflowId
54
+ undefined // agentId
55
+ );
56
+ console.log("Template with workflow:", templateWithWorkflow);
57
+ // Get workflows
58
+ const workflows = yield sdk.getWorkflows();
59
+ console.log("All workflows:", workflows);
48
60
  //console.log("Usertemplate", userTemplate);
49
61
  //console.log("Updated User Template", updatedUserTemplate);
50
62
  const templates = yield sdk.getTemplates();
@@ -1,4 +1,4 @@
1
- import { LoginResponse, LoginCredentials, SDKConfig, User, UpdateUserDto, Organization, TemplateCategory, Template, Team, UserTemplate, TranscriptionSummary, TranscriptionAudioUploadResponse, PasswordChangeResponse, Session, CreateSessionDto, UpdateSessionDto, Agent, AudioFile, UpdateAudioFileDto, AgentSettings, CreateAgentSettingsDto, UpdateAgentSettingsDto } from './types';
1
+ import { LoginResponse, LoginCredentials, SDKConfig, User, UpdateUserDto, Organization, TemplateCategory, Template, Team, UserTemplate, TranscriptionSummary, TranscriptionAudioUploadResponse, PasswordChangeResponse, Session, CreateSessionDto, UpdateSessionDto, Agent, AudioFile, UpdateAudioFileDto, AgentSettings, CreateAgentSettingsDto, UpdateAgentSettingsDto, Workflow } from './types';
2
2
  export declare class ApiSDK {
3
3
  private baseUrl;
4
4
  private storage;
@@ -32,9 +32,9 @@ export declare class ApiSDK {
32
32
  updateTeam(id: string, name: string, description: string): Promise<Team>;
33
33
  addUserToTeam(teamId: string, userId: string, roleName: string): Promise<any>;
34
34
  removeUserFromTeam(teamId: string, userId: string): Promise<void>;
35
- createTemplate(title: string, content: string, categoryId?: string): Promise<Template>;
35
+ createTemplate(title: string, content: string, categoryId?: string, workflowId?: string, agentId?: string): Promise<Template>;
36
36
  createUserTemplate(title: string, content: string, originalTemplateId: string | undefined): Promise<UserTemplate>;
37
- updateTemplate(title: string, content: string, id: string): Promise<Template>;
37
+ updateTemplate(title: string, content: string, id: string, workflowId?: string, agentId?: string): Promise<Template>;
38
38
  updateUserTemplate(title: string, content: string, id: string): Promise<UserTemplate>;
39
39
  getTemplates(): Promise<Template[]>;
40
40
  getTemplatesByOrganization(): Promise<Template[]>;
@@ -89,6 +89,10 @@ export declare class ApiSDK {
89
89
  updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
90
90
  deleteSession(id: string): Promise<void>;
91
91
  setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
92
+ rerunTranscription(sessionId: string): Promise<{
93
+ message: string;
94
+ sessionId: string;
95
+ }>;
92
96
  createAgent(name: string): Promise<Agent>;
93
97
  getAgents(): Promise<Agent[]>;
94
98
  getAgent(id: string): Promise<Agent>;
@@ -119,4 +123,10 @@ export declare class ApiSDK {
119
123
  getTranscribedAudioFiles(): Promise<AudioFile[]>;
120
124
  getProcessingAudioFiles(): Promise<AudioFile[]>;
121
125
  getFailedAudioFiles(): Promise<AudioFile[]>;
126
+ createWorkflow(name: string, organizationId?: string): Promise<Workflow>;
127
+ getWorkflows(organizationId?: string): Promise<Workflow[]>;
128
+ getWorkflow(id: string): Promise<Workflow>;
129
+ getWorkflowsByOrganization(organizationId?: string): Promise<Workflow[]>;
130
+ updateWorkflow(id: string, name: string, organizationId?: string): Promise<Workflow>;
131
+ deleteWorkflow(id: string): Promise<void>;
122
132
  }
@@ -293,7 +293,7 @@ export class ApiSDK {
293
293
  yield this.request(`${urls.teamRoles}/user/${userId}/team/${teamId}`, 'DELETE');
294
294
  });
295
295
  }
296
- createTemplate(title, content, categoryId) {
296
+ createTemplate(title, content, categoryId, workflowId, agentId) {
297
297
  var _a;
298
298
  return __awaiter(this, void 0, void 0, function* () {
299
299
  let finalCategoryId = categoryId;
@@ -311,6 +311,8 @@ export class ApiSDK {
311
311
  categoryId: finalCategoryId,
312
312
  createdById: this.user.id,
313
313
  organizationId: this.user.organizationId,
314
+ workflowId,
315
+ agentId,
314
316
  };
315
317
  return this.request(urls.templates, 'POST', createTemplateDto);
316
318
  });
@@ -326,13 +328,15 @@ export class ApiSDK {
326
328
  return this.request(urls.userTemplates, 'POST', createUserTemplateDto);
327
329
  });
328
330
  }
329
- updateTemplate(title, content, id) {
331
+ updateTemplate(title, content, id, workflowId, agentId) {
330
332
  return __awaiter(this, void 0, void 0, function* () {
331
333
  const templateDto = {
332
334
  title,
333
335
  content,
334
336
  isGlobal: false,
335
337
  organizationId: this.user.organizationId,
338
+ workflowId,
339
+ agentId,
336
340
  };
337
341
  return this.request(`${urls.templates}/${id}`, 'PATCH', templateDto);
338
342
  });
@@ -682,6 +686,11 @@ export class ApiSDK {
682
686
  return this.request(`${urls.sessions}/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
683
687
  });
684
688
  }
689
+ rerunTranscription(sessionId) {
690
+ return __awaiter(this, void 0, void 0, function* () {
691
+ return this.request(`${urls.sessions}/${sessionId}/rerun-transcription`, 'POST');
692
+ });
693
+ }
685
694
  // ======================
686
695
  // AGENT METHODS
687
696
  // ======================
@@ -871,4 +880,47 @@ export class ApiSDK {
871
880
  return audioFiles.filter(file => file.status === AudioFileStatus.FAILED);
872
881
  });
873
882
  }
883
+ // ======================
884
+ // WORKFLOW METHODS
885
+ // ======================
886
+ createWorkflow(name, organizationId) {
887
+ return __awaiter(this, void 0, void 0, function* () {
888
+ const dto = {
889
+ name,
890
+ organizationId: organizationId || this.user.organizationId,
891
+ };
892
+ return this.request(urls.workflows, 'POST', dto);
893
+ });
894
+ }
895
+ getWorkflows(organizationId) {
896
+ return __awaiter(this, void 0, void 0, function* () {
897
+ const params = organizationId ? `?organizationId=${organizationId}` : '';
898
+ return this.request(`${urls.workflows}${params}`, 'GET');
899
+ });
900
+ }
901
+ getWorkflow(id) {
902
+ return __awaiter(this, void 0, void 0, function* () {
903
+ return this.request(`${urls.workflows}/${id}`, 'GET');
904
+ });
905
+ }
906
+ getWorkflowsByOrganization(organizationId) {
907
+ return __awaiter(this, void 0, void 0, function* () {
908
+ const orgId = organizationId || this.user.organizationId;
909
+ return this.request(`${urls.workflows}?organizationId=${orgId}`, 'GET');
910
+ });
911
+ }
912
+ updateWorkflow(id, name, organizationId) {
913
+ return __awaiter(this, void 0, void 0, function* () {
914
+ const dto = {
915
+ name,
916
+ organizationId: organizationId || this.user.organizationId,
917
+ };
918
+ return this.request(`${urls.workflows}/${id}`, 'PATCH', dto);
919
+ });
920
+ }
921
+ deleteWorkflow(id) {
922
+ return __awaiter(this, void 0, void 0, function* () {
923
+ yield this.request(`${urls.workflows}/${id}`, 'DELETE');
924
+ });
925
+ }
874
926
  }
@@ -84,6 +84,8 @@ export interface CreateTemplateDto {
84
84
  organizationId: string;
85
85
  categoryId: string;
86
86
  createdById: string;
87
+ workflowId?: string;
88
+ agentId?: string;
87
89
  }
88
90
  export interface UpdateTemplateDto {
89
91
  title?: string;
@@ -91,6 +93,8 @@ export interface UpdateTemplateDto {
91
93
  isGlobal?: boolean;
92
94
  organizationId: string;
93
95
  categoryId?: string;
96
+ workflowId?: string;
97
+ agentId?: string;
94
98
  }
95
99
  export interface GenerateTranscriptionSummaryDto {
96
100
  templateId: string;
@@ -158,9 +162,13 @@ export interface Template {
158
162
  organizationId?: string;
159
163
  categoryId: string;
160
164
  createdById: string;
165
+ workflowId?: string;
166
+ agentId?: string;
161
167
  organization?: Organization;
162
168
  category?: TemplateCategory;
163
169
  createdBy?: User;
170
+ workflow?: Workflow;
171
+ agent?: Agent;
164
172
  userTemplates?: UserTemplate[];
165
173
  transcriptionSummaries?: TranscriptionSummary[];
166
174
  teamTemplates?: TeamTemplate[];
@@ -403,3 +411,20 @@ export interface UpdateAgentSettingsDto {
403
411
  topP?: number;
404
412
  repetitionPenalty?: number;
405
413
  }
414
+ export interface Workflow {
415
+ id: string;
416
+ name: string;
417
+ createdAt: string;
418
+ updatedAt: string;
419
+ organizationId: string;
420
+ organization?: Organization;
421
+ templates?: Template[];
422
+ }
423
+ export interface CreateWorkflowDto {
424
+ name: string;
425
+ organizationId: string;
426
+ }
427
+ export interface UpdateWorkflowDto {
428
+ name?: string;
429
+ organizationId: string;
430
+ }
@@ -28,5 +28,6 @@ declare const urls: {
28
28
  agents: string;
29
29
  agentSettings: string;
30
30
  audioFiles: string;
31
+ workflows: string;
31
32
  };
32
33
  export default urls;
@@ -39,5 +39,7 @@ const urls = {
39
39
  agentSettings: '/agent-settings',
40
40
  // Audio Files
41
41
  audioFiles: '/audio-files',
42
+ // Workflows
43
+ workflows: '/workflows',
42
44
  };
43
45
  export default urls;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whio-api-sdk",
3
- "version": "1.0.179-beta",
3
+ "version": "1.0.181-bet-staging",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -77,6 +77,24 @@ export async function main() {
77
77
  userTemplate.id,
78
78
  );
79
79
 
80
+ // Create a workflow example
81
+ const workflow = await sdk.createWorkflow("Test Workflow");
82
+ console.log("Created workflow:", workflow);
83
+
84
+ // Create template with workflow and agent IDs
85
+ const templateWithWorkflow = await sdk.createTemplate(
86
+ "Template with Workflow",
87
+ "This template has a workflow attached",
88
+ undefined, // categoryId - will use default
89
+ workflow.id, // workflowId
90
+ undefined // agentId
91
+ );
92
+ console.log("Template with workflow:", templateWithWorkflow);
93
+
94
+ // Get workflows
95
+ const workflows = await sdk.getWorkflows();
96
+ console.log("All workflows:", workflows);
97
+
80
98
  //console.log("Usertemplate", userTemplate);
81
99
  //console.log("Updated User Template", updatedUserTemplate);
82
100
 
package/src/sdk/sdk.ts CHANGED
@@ -48,6 +48,9 @@ import {
48
48
  AgentSettings,
49
49
  CreateAgentSettingsDto,
50
50
  UpdateAgentSettingsDto,
51
+ Workflow,
52
+ CreateWorkflowDto,
53
+ UpdateWorkflowDto,
51
54
  } from './types';
52
55
  import urls from './urls';
53
56
  import { jwtDecode } from 'jwt-decode';
@@ -374,7 +377,7 @@ export class ApiSDK {
374
377
  public async removeUserFromTeam(teamId: string, userId: string): Promise<void> {
375
378
  await this.request(`${urls.teamRoles}/user/${userId}/team/${teamId}`, 'DELETE');
376
379
  }
377
- public async createTemplate(title: string, content: string, categoryId?: string): Promise<Template> {
380
+ public async createTemplate(title: string, content: string, categoryId?: string, workflowId?: string, agentId?: string): Promise<Template> {
378
381
  let finalCategoryId = categoryId;
379
382
  if (!finalCategoryId) {
380
383
  const templateCategories = await this.request<TemplateCategory[]>(
@@ -394,6 +397,8 @@ export class ApiSDK {
394
397
  categoryId: finalCategoryId,
395
398
  createdById: this.user!.id,
396
399
  organizationId: this.user!.organizationId,
400
+ workflowId,
401
+ agentId,
397
402
  };
398
403
  return this.request<Template>(urls.templates, 'POST', createTemplateDto);
399
404
  }
@@ -410,12 +415,14 @@ export class ApiSDK {
410
415
  }
411
416
 
412
417
  public async updateTemplate(
413
- title: string, content: string, id: string): Promise<Template> {
418
+ title: string, content: string, id: string, workflowId?: string, agentId?: string): Promise<Template> {
414
419
  const templateDto: UpdateTemplateDto = {
415
420
  title,
416
421
  content,
417
422
  isGlobal: false,
418
423
  organizationId: this.user!.organizationId,
424
+ workflowId,
425
+ agentId,
419
426
  };
420
427
  return this.request<Template>(
421
428
  `${urls.templates}/${id}`,
@@ -759,6 +766,10 @@ export class ApiSDK {
759
766
  return this.request<Session>(`${urls.sessions}/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
760
767
  }
761
768
 
769
+ public async rerunTranscription(sessionId: string): Promise<{ message: string; sessionId: string }> {
770
+ return this.request<{ message: string; sessionId: string }>(`${urls.sessions}/${sessionId}/rerun-transcription`, 'POST');
771
+ }
772
+
762
773
  // ======================
763
774
  // AGENT METHODS
764
775
  // ======================
@@ -937,4 +948,42 @@ export class ApiSDK {
937
948
  return audioFiles.filter(file => file.status === AudioFileStatus.FAILED);
938
949
  }
939
950
 
951
+ // ======================
952
+ // WORKFLOW METHODS
953
+ // ======================
954
+
955
+ public async createWorkflow(name: string, organizationId?: string): Promise<Workflow> {
956
+ const dto: CreateWorkflowDto = {
957
+ name,
958
+ organizationId: organizationId || this.user!.organizationId,
959
+ };
960
+ return this.request<Workflow>(urls.workflows, 'POST', dto);
961
+ }
962
+
963
+ public async getWorkflows(organizationId?: string): Promise<Workflow[]> {
964
+ const params = organizationId ? `?organizationId=${organizationId}` : '';
965
+ return this.request<Workflow[]>(`${urls.workflows}${params}`, 'GET');
966
+ }
967
+
968
+ public async getWorkflow(id: string): Promise<Workflow> {
969
+ return this.request<Workflow>(`${urls.workflows}/${id}`, 'GET');
970
+ }
971
+
972
+ public async getWorkflowsByOrganization(organizationId?: string): Promise<Workflow[]> {
973
+ const orgId = organizationId || this.user!.organizationId;
974
+ return this.request<Workflow[]>(`${urls.workflows}?organizationId=${orgId}`, 'GET');
975
+ }
976
+
977
+ public async updateWorkflow(id: string, name: string, organizationId?: string): Promise<Workflow> {
978
+ const dto: UpdateWorkflowDto = {
979
+ name,
980
+ organizationId: organizationId || this.user!.organizationId,
981
+ };
982
+ return this.request<Workflow>(`${urls.workflows}/${id}`, 'PATCH', dto);
983
+ }
984
+
985
+ public async deleteWorkflow(id: string): Promise<void> {
986
+ await this.request(`${urls.workflows}/${id}`, 'DELETE');
987
+ }
988
+
940
989
  }
package/src/sdk/types.ts CHANGED
@@ -112,6 +112,8 @@ export interface CreateTemplateDto {
112
112
  organizationId: string;
113
113
  categoryId: string;
114
114
  createdById: string;
115
+ workflowId?: string;
116
+ agentId?: string;
115
117
  }
116
118
 
117
119
  // Template update DTO
@@ -121,6 +123,8 @@ export interface UpdateTemplateDto {
121
123
  isGlobal?: boolean;
122
124
  organizationId: string;
123
125
  categoryId?: string;
126
+ workflowId?: string;
127
+ agentId?: string;
124
128
  }
125
129
 
126
130
  // Transcription summary generation DTO
@@ -206,10 +210,14 @@ export interface Template {
206
210
  organizationId?: string;
207
211
  categoryId: string;
208
212
  createdById: string;
213
+ workflowId?: string;
214
+ agentId?: string;
209
215
 
210
216
  organization?: Organization;
211
217
  category?: TemplateCategory;
212
218
  createdBy?: User;
219
+ workflow?: Workflow;
220
+ agent?: Agent;
213
221
  userTemplates?: UserTemplate[];
214
222
  transcriptionSummaries?: TranscriptionSummary[];
215
223
  teamTemplates?: TeamTemplate[];
@@ -509,3 +517,27 @@ export interface UpdateAgentSettingsDto {
509
517
  topP?: number;
510
518
  repetitionPenalty?: number;
511
519
  }
520
+
521
+ // Workflow types
522
+ export interface Workflow {
523
+ id: string;
524
+ name: string;
525
+ createdAt: string;
526
+ updatedAt: string;
527
+ organizationId: string;
528
+
529
+ // Relationships (populated by API)
530
+ organization?: Organization;
531
+ templates?: Template[];
532
+ }
533
+
534
+ // Workflow DTOs
535
+ export interface CreateWorkflowDto {
536
+ name: string;
537
+ organizationId: string;
538
+ }
539
+
540
+ export interface UpdateWorkflowDto {
541
+ name?: string;
542
+ organizationId: string;
543
+ }
package/src/sdk/urls.ts CHANGED
@@ -49,6 +49,9 @@ const urls = {
49
49
 
50
50
  // Audio Files
51
51
  audioFiles: '/audio-files',
52
+
53
+ // Workflows
54
+ workflows: '/workflows',
52
55
  }
53
56
 
54
57
  export default urls;