whio-api-sdk 1.0.192-bet-staging → 1.0.194-beta-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.
Files changed (94) hide show
  1. package/dist/src/sdk/modules/agent.module.d.ts +17 -0
  2. package/dist/src/sdk/modules/agent.module.js +93 -0
  3. package/dist/src/sdk/modules/audio.module.d.ts +31 -0
  4. package/dist/src/sdk/modules/audio.module.js +147 -0
  5. package/dist/src/sdk/modules/auth.module.d.ts +9 -0
  6. package/dist/src/sdk/modules/auth.module.js +59 -0
  7. package/dist/src/sdk/modules/base-client.d.ts +25 -0
  8. package/dist/src/sdk/modules/base-client.js +183 -0
  9. package/dist/src/sdk/modules/debug.module.d.ts +20 -0
  10. package/dist/src/sdk/modules/debug.module.js +54 -0
  11. package/dist/src/sdk/modules/external-integration.module.d.ts +9 -0
  12. package/dist/src/sdk/modules/external-integration.module.js +38 -0
  13. package/dist/src/sdk/modules/log.module.d.ts +63 -0
  14. package/dist/src/sdk/modules/log.module.js +222 -0
  15. package/dist/src/sdk/modules/organization.module.d.ts +11 -0
  16. package/dist/src/sdk/modules/organization.module.js +50 -0
  17. package/dist/src/sdk/modules/session.module.d.ts +16 -0
  18. package/dist/src/sdk/modules/session.module.js +58 -0
  19. package/dist/src/sdk/modules/team.module.d.ts +13 -0
  20. package/dist/src/sdk/modules/team.module.js +72 -0
  21. package/dist/src/sdk/modules/template.module.d.ts +33 -0
  22. package/dist/src/sdk/modules/template.module.js +240 -0
  23. package/dist/src/sdk/modules/user.module.d.ts +17 -0
  24. package/dist/src/sdk/modules/user.module.js +104 -0
  25. package/dist/src/sdk/modules/workflow.module.d.ts +10 -0
  26. package/dist/src/sdk/modules/workflow.module.js +53 -0
  27. package/dist/src/sdk/sdk.d.ts +167 -206
  28. package/dist/src/sdk/sdk.js +375 -853
  29. package/dist/src/sdk/sdk.old.d.ts +222 -0
  30. package/dist/src/sdk/sdk.old.js +1238 -0
  31. package/dist/src/sdk/types/agent.types.d.ts +51 -0
  32. package/dist/src/sdk/types/agent.types.js +1 -0
  33. package/dist/src/sdk/types/audio.types.d.ts +72 -0
  34. package/dist/src/sdk/types/audio.types.js +8 -0
  35. package/dist/src/sdk/types/auth.types.d.ts +21 -0
  36. package/dist/src/sdk/types/auth.types.js +1 -0
  37. package/dist/src/sdk/types/common.types.d.ts +20 -0
  38. package/dist/src/sdk/types/common.types.js +9 -0
  39. package/dist/src/sdk/types/external-integration.types.d.ts +31 -0
  40. package/dist/src/sdk/types/external-integration.types.js +1 -0
  41. package/dist/src/sdk/types/index.d.ts +12 -0
  42. package/dist/src/sdk/types/index.js +13 -0
  43. package/dist/src/sdk/types/log.types.d.ts +61 -0
  44. package/dist/src/sdk/types/log.types.js +1 -0
  45. package/dist/src/sdk/types/organization.types.d.ts +42 -0
  46. package/dist/src/sdk/types/organization.types.js +6 -0
  47. package/dist/src/sdk/types/session.types.d.ts +54 -0
  48. package/dist/src/sdk/types/session.types.js +1 -0
  49. package/dist/src/sdk/types/team.types.d.ts +39 -0
  50. package/dist/src/sdk/types/team.types.js +1 -0
  51. package/dist/src/sdk/types/template.types.d.ts +118 -0
  52. package/dist/src/sdk/types/template.types.js +1 -0
  53. package/dist/src/sdk/types/user.types.d.ts +41 -0
  54. package/dist/src/sdk/types/user.types.js +1 -0
  55. package/dist/src/sdk/types/workflow.types.d.ts +19 -0
  56. package/dist/src/sdk/types/workflow.types.js +1 -0
  57. package/dist/src/sdk/types.d.ts +1 -517
  58. package/dist/src/sdk/types.js +2 -23
  59. package/dist/src/sdk/types.old.d.ts +517 -0
  60. package/dist/src/sdk/types.old.js +23 -0
  61. package/dist/src/sdk/urls.d.ts +1 -0
  62. package/dist/src/sdk/urls.js +2 -0
  63. package/package.json +1 -1
  64. package/src/sdk/modules/agent.module.ts +74 -0
  65. package/src/sdk/modules/audio.module.ts +131 -0
  66. package/src/sdk/modules/auth.module.ts +53 -0
  67. package/src/sdk/modules/base-client.ts +214 -0
  68. package/src/sdk/modules/debug.module.ts +44 -0
  69. package/src/sdk/modules/external-integration.module.ts +50 -0
  70. package/src/sdk/modules/log.module.ts +213 -0
  71. package/src/sdk/modules/organization.module.ts +35 -0
  72. package/src/sdk/modules/session.module.ts +41 -0
  73. package/src/sdk/modules/team.module.ts +55 -0
  74. package/src/sdk/modules/template.module.ts +242 -0
  75. package/src/sdk/modules/user.module.ts +89 -0
  76. package/src/sdk/modules/workflow.module.ts +39 -0
  77. package/src/sdk/sdk.old.ts +1312 -0
  78. package/src/sdk/sdk.ts +393 -1074
  79. package/src/sdk/types/agent.types.ts +65 -0
  80. package/src/sdk/types/audio.types.ts +89 -0
  81. package/src/sdk/types/auth.types.ts +29 -0
  82. package/src/sdk/types/common.types.ts +26 -0
  83. package/src/sdk/types/external-integration.types.ts +37 -0
  84. package/src/sdk/types/index.ts +13 -0
  85. package/src/sdk/types/log.types.ts +68 -0
  86. package/src/sdk/types/organization.types.ts +55 -0
  87. package/src/sdk/types/session.types.ts +63 -0
  88. package/src/sdk/types/team.types.ts +48 -0
  89. package/src/sdk/types/template.types.ts +142 -0
  90. package/src/sdk/types/user.types.ts +50 -0
  91. package/src/sdk/types/workflow.types.ts +26 -0
  92. package/src/sdk/types.old.ts +649 -0
  93. package/src/sdk/types.ts +2 -649
  94. package/src/sdk/urls.ts +3 -0
@@ -0,0 +1,240 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { BaseClient } from './base-client';
11
+ import urls from '../urls';
12
+ export class TemplateModule extends BaseClient {
13
+ // ======================
14
+ // TEMPLATE METHODS
15
+ // ======================
16
+ createTemplate(title, content, categoryId, workflowId, agentId) {
17
+ var _a;
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ let finalCategoryId = categoryId;
20
+ if (!finalCategoryId) {
21
+ const templateCategories = yield this.request(urls.templateCategories, 'GET');
22
+ finalCategoryId = (_a = templateCategories[0]) === null || _a === void 0 ? void 0 : _a.id;
23
+ if (!finalCategoryId) {
24
+ throw new Error('No template categories available. Please create one first.');
25
+ }
26
+ }
27
+ const createTemplateDto = {
28
+ title,
29
+ content,
30
+ isGlobal: false,
31
+ categoryId: finalCategoryId,
32
+ createdById: this.user.id,
33
+ organizationId: this.user.organizationId,
34
+ workflowId,
35
+ agentId,
36
+ };
37
+ return this.request(urls.templates, 'POST', createTemplateDto);
38
+ });
39
+ }
40
+ updateTemplate(title, content, id, workflowId, agentId) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const templateDto = {
43
+ title,
44
+ content,
45
+ isGlobal: false,
46
+ organizationId: this.user.organizationId,
47
+ workflowId,
48
+ agentId,
49
+ };
50
+ return this.request(`${urls.templates}/${id}`, 'PATCH', templateDto);
51
+ });
52
+ }
53
+ getTemplates() {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ return this.request(urls.templates, 'GET');
56
+ });
57
+ }
58
+ getTemplatesByOrganization() {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ return this.request(`${urls.templates}/organization`, 'GET');
61
+ });
62
+ }
63
+ getTemplate(id) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ return this.request(`${urls.templates}/${id}`, 'GET');
66
+ });
67
+ }
68
+ deleteTemplate(id) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ yield this.request(`${urls.templates}/${id}`, 'DELETE');
71
+ });
72
+ }
73
+ // ======================
74
+ // USER TEMPLATE METHODS
75
+ // ======================
76
+ createUserTemplate(title, content, originalTemplateId) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ const createUserTemplateDto = {
79
+ title,
80
+ content,
81
+ originalTemplateId,
82
+ userId: this.user.id,
83
+ };
84
+ return this.request(urls.userTemplates, 'POST', createUserTemplateDto);
85
+ });
86
+ }
87
+ updateUserTemplate(title, content, id) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ const userTemplateDto = {
90
+ title,
91
+ content,
92
+ };
93
+ return this.request(`${urls.userTemplates}/${id}`, 'PATCH', userTemplateDto);
94
+ });
95
+ }
96
+ getUserTemplates() {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ const url = `${urls.userTemplates}/user/${this.user.id}`;
99
+ return this.request(url, 'GET');
100
+ });
101
+ }
102
+ getUserTemplate(id) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ return this.request(`${urls.userTemplates}/${id}`, 'GET');
105
+ });
106
+ }
107
+ deleteUserTemplate(id) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ yield this.request(`${urls.userTemplates}/${id}`, 'DELETE');
110
+ });
111
+ }
112
+ // ======================
113
+ // TEMPLATE CATEGORY METHODS
114
+ // ======================
115
+ getTemplateCategories() {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ return this.request(urls.templateCategories, 'GET');
118
+ });
119
+ }
120
+ getTemplateCategory(id) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ return this.request(`${urls.templateCategories}/${id}`, 'GET');
123
+ });
124
+ }
125
+ createTemplateCategory(name) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ const dto = { name };
128
+ return this.request(urls.templateCategories, 'POST', dto);
129
+ });
130
+ }
131
+ updateTemplateCategory(id, name) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ const dto = { name };
134
+ return this.request(`${urls.templateCategories}/${id}`, 'PATCH', dto);
135
+ });
136
+ }
137
+ deleteTemplateCategory(id) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ yield this.request(`${urls.templateCategories}/${id}`, 'DELETE');
140
+ });
141
+ }
142
+ // ======================
143
+ // TEAM TEMPLATE METHODS
144
+ // ======================
145
+ assignTemplateToTeam(teamId, templateId) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ const dto = { teamId, templateId };
148
+ yield this.request(urls.teamTemplates, 'POST', dto);
149
+ });
150
+ }
151
+ removeTemplateFromTeam(teamId, templateId) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ yield this.request(`${urls.teamTemplates}/team/${teamId}/template/${templateId}`, 'DELETE');
154
+ });
155
+ }
156
+ // ======================
157
+ // TRANSCRIPTION SUMMARY METHODS
158
+ // ======================
159
+ generateTranscriptionSummary(templateId, sessionId) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const generateSummaryDto = {
162
+ templateId,
163
+ userId: this.user.id,
164
+ fromUserTemplate: false,
165
+ sessionId: sessionId,
166
+ };
167
+ const transcriptionSummary = yield this.request(urls.transcriptionSummary, 'POST', generateSummaryDto);
168
+ return transcriptionSummary;
169
+ });
170
+ }
171
+ generateTranscriptionSummaryFromUserTemplate(userTemplateId, sessionId) {
172
+ return __awaiter(this, void 0, void 0, function* () {
173
+ const generateSummaryDto = {
174
+ templateId: userTemplateId,
175
+ userId: this.user.id,
176
+ fromUserTemplate: true,
177
+ sessionId: sessionId,
178
+ };
179
+ const transcriptionSummary = yield this.request(urls.transcriptionSummary, 'POST', generateSummaryDto);
180
+ return transcriptionSummary;
181
+ });
182
+ }
183
+ updateTranscriptionSummary(id, content) {
184
+ return __awaiter(this, void 0, void 0, function* () {
185
+ const updateSummaryDto = {
186
+ content,
187
+ };
188
+ return this.request(`${urls.transcriptionSummary}/${id}`, 'PATCH', updateSummaryDto);
189
+ });
190
+ }
191
+ getTranscriptionSummaries() {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ return this.request(urls.transcriptionSummaries, 'GET');
194
+ });
195
+ }
196
+ getTranscriptionSummary(id) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ return this.request(`${urls.transcriptionSummaries}/${id}`, 'GET');
199
+ });
200
+ }
201
+ getTranscriptionSummariesByUser(userId) {
202
+ return __awaiter(this, void 0, void 0, function* () {
203
+ return this.request(`${urls.transcriptionSummaries}/user/${userId}`, 'GET');
204
+ });
205
+ }
206
+ getByOrganizationTranscriptionSummaries(organizationId) {
207
+ return __awaiter(this, void 0, void 0, function* () {
208
+ return this.request(`${urls.transcriptionSummaries}/organization/${organizationId}`, 'GET');
209
+ });
210
+ }
211
+ deleteTranscriptionSummary(id) {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ yield this.request(`${urls.transcriptionSummaries}/${id}`, 'DELETE');
214
+ });
215
+ }
216
+ // ======================
217
+ // AUDIO UPLOAD METHODS (for transcription)
218
+ // ======================
219
+ uploadLargeAudioFile(formData) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ const uploadId = yield this.fileUploadRequest(urls.uploadAudioLarge, formData);
222
+ const uploadIds = (yield this.storage.getItem('uploadIds')) || '[]';
223
+ const uploadIdsArray = JSON.parse(uploadIds);
224
+ yield this.storage.setItem('uploadIds', JSON.stringify([...uploadIdsArray, uploadId]));
225
+ return uploadId;
226
+ });
227
+ }
228
+ uploadAudioFile(formData) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ const data = yield this.fileUploadRequest(urls.uploadAudio, formData);
231
+ return data;
232
+ });
233
+ }
234
+ transcribeBase64Audio(base64String) {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ const transcript = yield this.request(urls.transcribeBase64Audio, 'POST', { base64Audio: base64String });
237
+ return transcript.transcript;
238
+ });
239
+ }
240
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseClient } from './base-client';
2
+ import { User, UpdateUserDto } from '../types';
3
+ export declare class UserModule extends BaseClient {
4
+ createUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
5
+ private assignRoleToUser;
6
+ assignEditorToRoleToUser(userId: string, organizationId?: string): Promise<User>;
7
+ assignAdminToRoleToUser(userId: string, organizationId?: string): Promise<User>;
8
+ assignDisabledToRoleToUser(userId: string, organizationId?: string): Promise<User>;
9
+ createEditorUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
10
+ createAdminUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
11
+ createDisabledUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
12
+ getUsers(): Promise<User[]>;
13
+ getUser(id: string): Promise<User>;
14
+ getUsersByOrganization(organizationId: string): Promise<User[]>;
15
+ updateUser(id: string, data: UpdateUserDto): Promise<User>;
16
+ deleteUser(id: string): Promise<void>;
17
+ }
@@ -0,0 +1,104 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { BaseClient } from './base-client';
11
+ import { OrganizationRoleType } from '../types';
12
+ import urls from '../urls';
13
+ export class UserModule extends BaseClient {
14
+ createUser(firstName, lastName, email, password) {
15
+ var _a;
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const createUserDto = {
18
+ firstName,
19
+ lastName,
20
+ email,
21
+ password,
22
+ organizationId: (_a = this.user) === null || _a === void 0 ? void 0 : _a.organizationId,
23
+ };
24
+ const user = yield this.request(urls.users, 'POST', createUserDto);
25
+ return user;
26
+ });
27
+ }
28
+ assignRoleToUser(userId, roleName, organizationId) {
29
+ var _a;
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ const orgId = organizationId || ((_a = this.user) === null || _a === void 0 ? void 0 : _a.organizationId);
32
+ const organization = yield this.request(`${urls.organizations}/${orgId}`, 'GET');
33
+ const orgRoleEditor = organization.roles.find(r => r.name === roleName);
34
+ const assignRoleDto = {
35
+ userId: userId,
36
+ organizationRoleId: orgRoleEditor.id,
37
+ };
38
+ this.request(urls.userOrganizationRoles, 'POST', assignRoleDto);
39
+ const userWithOrgRole = yield this.request(`${urls.user}/${userId}`, 'GET');
40
+ return userWithOrgRole;
41
+ });
42
+ }
43
+ assignEditorToRoleToUser(userId, organizationId) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ return this.assignRoleToUser(userId, OrganizationRoleType.EDITOR, organizationId);
46
+ });
47
+ }
48
+ assignAdminToRoleToUser(userId, organizationId) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ return this.assignRoleToUser(userId, OrganizationRoleType.ADMIN, organizationId);
51
+ });
52
+ }
53
+ assignDisabledToRoleToUser(userId, organizationId) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ return this.assignRoleToUser(userId, OrganizationRoleType.DISABLED, organizationId);
56
+ });
57
+ }
58
+ createEditorUser(firstName, lastName, email, password) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const user = yield this.createUser(firstName, lastName, email, password);
61
+ const userWithOrgRole = yield this.assignEditorToRoleToUser(user.id);
62
+ return userWithOrgRole;
63
+ });
64
+ }
65
+ createAdminUser(firstName, lastName, email, password) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ const user = yield this.createUser(firstName, lastName, email, password);
68
+ const userWithOrgRole = yield this.assignAdminToRoleToUser(user.id);
69
+ return userWithOrgRole;
70
+ });
71
+ }
72
+ createDisabledUser(firstName, lastName, email, password) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const user = yield this.createUser(firstName, lastName, email, password);
75
+ const userWithOrgRole = yield this.assignDisabledToRoleToUser(user.id);
76
+ return userWithOrgRole;
77
+ });
78
+ }
79
+ getUsers() {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ return this.request(urls.users, 'GET');
82
+ });
83
+ }
84
+ getUser(id) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ return this.request(`${urls.users}/${id}`, 'GET');
87
+ });
88
+ }
89
+ getUsersByOrganization(organizationId) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ return this.request(`${urls.users}/organization/${organizationId}`, 'GET');
92
+ });
93
+ }
94
+ updateUser(id, data) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ return this.request(`${urls.users}/${id}`, 'PATCH', data);
97
+ });
98
+ }
99
+ deleteUser(id) {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ yield this.request(`${urls.users}/${id}`, 'DELETE');
102
+ });
103
+ }
104
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseClient } from './base-client';
2
+ import { Workflow } from '../types';
3
+ export declare class WorkflowModule extends BaseClient {
4
+ createWorkflow(name: string, organizationId?: string): Promise<Workflow>;
5
+ getWorkflows(organizationId?: string): Promise<Workflow[]>;
6
+ getWorkflow(id: string): Promise<Workflow>;
7
+ getWorkflowsByOrganization(organizationId?: string): Promise<Workflow[]>;
8
+ updateWorkflow(id: string, name: string, organizationId?: string): Promise<Workflow>;
9
+ deleteWorkflow(id: string): Promise<void>;
10
+ }
@@ -0,0 +1,53 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { BaseClient } from './base-client';
11
+ import urls from '../urls';
12
+ export class WorkflowModule extends BaseClient {
13
+ createWorkflow(name, organizationId) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ const dto = {
16
+ name,
17
+ organizationId: organizationId || this.user.organizationId,
18
+ };
19
+ return this.request(urls.workflows, 'POST', dto);
20
+ });
21
+ }
22
+ getWorkflows(organizationId) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const params = organizationId ? `?organizationId=${organizationId}` : '';
25
+ return this.request(`${urls.workflows}${params}`, 'GET');
26
+ });
27
+ }
28
+ getWorkflow(id) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ return this.request(`${urls.workflows}/${id}`, 'GET');
31
+ });
32
+ }
33
+ getWorkflowsByOrganization(organizationId) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const orgId = organizationId || this.user.organizationId;
36
+ return this.request(`${urls.workflows}?organizationId=${orgId}`, 'GET');
37
+ });
38
+ }
39
+ updateWorkflow(id, name, organizationId) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const dto = {
42
+ name,
43
+ organizationId: organizationId || this.user.organizationId,
44
+ };
45
+ return this.request(`${urls.workflows}/${id}`, 'PATCH', dto);
46
+ });
47
+ }
48
+ deleteWorkflow(id) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ yield this.request(`${urls.workflows}/${id}`, 'DELETE');
51
+ });
52
+ }
53
+ }