whio-api-sdk 1.0.180-beta → 1.0.184-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[]>;
@@ -123,4 +123,10 @@ export declare class ApiSDK {
123
123
  getTranscribedAudioFiles(): Promise<AudioFile[]>;
124
124
  getProcessingAudioFiles(): Promise<AudioFile[]>;
125
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>;
126
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
  });
@@ -876,4 +880,47 @@ export class ApiSDK {
876
880
  return audioFiles.filter(file => file.status === AudioFileStatus.FAILED);
877
881
  });
878
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
+ }
879
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[];
@@ -282,10 +290,14 @@ export interface Session {
282
290
  templateId: string;
283
291
  userId: string;
284
292
  primaryTranscriptionSummaryId?: string;
293
+ hasSummaryType?: boolean;
294
+ hasServerAudioFile?: boolean;
295
+ hasSummary?: boolean;
285
296
  user?: User;
286
297
  template?: Template;
287
298
  transcriptionSummaries?: TranscriptionSummary[];
288
299
  primaryTranscriptionSummary?: TranscriptionSummary;
300
+ audioFiles?: AudioFile[];
289
301
  }
290
302
  export interface CreateSessionDto {
291
303
  transcript: string;
@@ -403,3 +415,20 @@ export interface UpdateAgentSettingsDto {
403
415
  topP?: number;
404
416
  repetitionPenalty?: number;
405
417
  }
418
+ export interface Workflow {
419
+ id: string;
420
+ name: string;
421
+ createdAt: string;
422
+ updatedAt: string;
423
+ organizationId: string;
424
+ organization?: Organization;
425
+ templates?: Template[];
426
+ }
427
+ export interface CreateWorkflowDto {
428
+ name: string;
429
+ organizationId: string;
430
+ }
431
+ export interface UpdateWorkflowDto {
432
+ name?: string;
433
+ organizationId: string;
434
+ }
@@ -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.180-beta",
3
+ "version": "1.0.184-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}`,
@@ -941,4 +948,42 @@ export class ApiSDK {
941
948
  return audioFiles.filter(file => file.status === AudioFileStatus.FAILED);
942
949
  }
943
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
+
944
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[];
@@ -358,11 +366,17 @@ export interface Session {
358
366
  userId: string;
359
367
  primaryTranscriptionSummaryId?: string;
360
368
 
369
+ // Derived fields (computed by API)
370
+ hasSummaryType?: boolean;
371
+ hasServerAudioFile?: boolean;
372
+ hasSummary?: boolean;
373
+
361
374
  // Relationships (populated by API)
362
375
  user?: User;
363
376
  template?: Template;
364
377
  transcriptionSummaries?: TranscriptionSummary[];
365
378
  primaryTranscriptionSummary?: TranscriptionSummary;
379
+ audioFiles?: AudioFile[];
366
380
  }
367
381
 
368
382
  // Session DTOs
@@ -509,3 +523,27 @@ export interface UpdateAgentSettingsDto {
509
523
  topP?: number;
510
524
  repetitionPenalty?: number;
511
525
  }
526
+
527
+ // Workflow types
528
+ export interface Workflow {
529
+ id: string;
530
+ name: string;
531
+ createdAt: string;
532
+ updatedAt: string;
533
+ organizationId: string;
534
+
535
+ // Relationships (populated by API)
536
+ organization?: Organization;
537
+ templates?: Template[];
538
+ }
539
+
540
+ // Workflow DTOs
541
+ export interface CreateWorkflowDto {
542
+ name: string;
543
+ organizationId: string;
544
+ }
545
+
546
+ export interface UpdateWorkflowDto {
547
+ name?: string;
548
+ organizationId: string;
549
+ }
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;