@l7mp/tivadar-ai-api-sdk 0.1.4 → 0.1.6

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 (71) hide show
  1. package/dist/api-client.d.ts +23 -7
  2. package/dist/api-client.js +35 -6
  3. package/dist/apis/CalendarApi.d.ts +64 -48
  4. package/dist/apis/CalendarApi.js +152 -87
  5. package/dist/apis/CallsApi.d.ts +92 -0
  6. package/dist/apis/CallsApi.js +256 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/api-client.d.ts +23 -7
  10. package/dist/esm/api-client.js +35 -6
  11. package/dist/esm/apis/CalendarApi.d.ts +64 -48
  12. package/dist/esm/apis/CalendarApi.js +153 -88
  13. package/dist/esm/apis/CallsApi.d.ts +92 -0
  14. package/dist/esm/apis/CallsApi.js +252 -0
  15. package/dist/esm/apis/index.d.ts +1 -0
  16. package/dist/esm/apis/index.js +1 -0
  17. package/dist/esm/models/Calendar.d.ts +6 -0
  18. package/dist/esm/models/Calendar.js +2 -0
  19. package/dist/esm/models/CalendarCreate.d.ts +32 -0
  20. package/dist/esm/models/CalendarCreate.js +43 -0
  21. package/dist/esm/models/CalendarEventCreate.d.ts +0 -6
  22. package/dist/esm/models/CalendarEventCreate.js +0 -4
  23. package/dist/esm/models/CalendarEventListResponse.d.ts +33 -0
  24. package/dist/esm/models/CalendarEventListResponse.js +44 -0
  25. package/dist/esm/models/CalendarEventUpdate.d.ts +0 -6
  26. package/dist/esm/models/CalendarEventUpdate.js +0 -2
  27. package/dist/esm/models/CalendarUpdate.d.ts +32 -0
  28. package/dist/esm/models/CalendarUpdate.js +41 -0
  29. package/dist/esm/models/Call.d.ts +64 -0
  30. package/dist/esm/models/Call.js +55 -0
  31. package/dist/esm/models/CallCreate.d.ts +52 -0
  32. package/dist/esm/models/CallCreate.js +47 -0
  33. package/dist/esm/models/CallUpdate.d.ts +52 -0
  34. package/dist/esm/models/CallUpdate.js +47 -0
  35. package/dist/esm/models/index.d.ts +6 -2
  36. package/dist/esm/models/index.js +6 -2
  37. package/dist/models/Calendar.d.ts +6 -0
  38. package/dist/models/Calendar.js +2 -0
  39. package/dist/models/CalendarCreate.d.ts +32 -0
  40. package/dist/models/CalendarCreate.js +50 -0
  41. package/dist/models/CalendarEventCreate.d.ts +0 -6
  42. package/dist/models/CalendarEventCreate.js +0 -4
  43. package/dist/models/CalendarEventListResponse.d.ts +33 -0
  44. package/dist/models/CalendarEventListResponse.js +51 -0
  45. package/dist/models/CalendarEventUpdate.d.ts +0 -6
  46. package/dist/models/CalendarEventUpdate.js +0 -2
  47. package/dist/models/CalendarUpdate.d.ts +32 -0
  48. package/dist/models/CalendarUpdate.js +48 -0
  49. package/dist/models/Call.d.ts +64 -0
  50. package/dist/models/Call.js +62 -0
  51. package/dist/models/CallCreate.d.ts +52 -0
  52. package/dist/models/CallCreate.js +54 -0
  53. package/dist/models/CallUpdate.d.ts +52 -0
  54. package/dist/models/CallUpdate.js +54 -0
  55. package/dist/models/index.d.ts +6 -2
  56. package/dist/models/index.js +6 -2
  57. package/package.json +2 -3
  58. package/src/api-client.ts +52 -12
  59. package/src/apis/CalendarApi.ts +227 -107
  60. package/src/apis/CallsApi.ts +352 -0
  61. package/src/apis/index.ts +1 -0
  62. package/src/models/Calendar.ts +8 -0
  63. package/src/models/CalendarCreate.ts +66 -0
  64. package/src/models/CalendarEventCreate.ts +0 -9
  65. package/src/models/CalendarEventListResponse.ts +74 -0
  66. package/src/models/CalendarEventUpdate.ts +0 -8
  67. package/src/models/CalendarUpdate.ts +65 -0
  68. package/src/models/Call.ts +107 -0
  69. package/src/models/CallCreate.ts +89 -0
  70. package/src/models/CallUpdate.ts +89 -0
  71. package/src/models/index.ts +6 -2
@@ -21,19 +21,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { CalendarFromJSON, CalendarEventFromJSON, CalendarEventCreateToJSON, CalendarEventResponseFromJSON, CalendarEventUpdateToJSON, CalendarListResponseFromJSON, } from '../models/index';
24
+ import { CalendarFromJSON, CalendarCreateToJSON, CalendarEventFromJSON, CalendarEventCreateToJSON, CalendarEventListResponseFromJSON, CalendarEventUpdateToJSON, CalendarListResponseFromJSON, CalendarUpdateToJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class CalendarApi extends runtime.BaseAPI {
29
29
  /**
30
- * Returns all calendars with agent information. Each calendar is associated with an agent.
31
- * List all calendars in the organization
30
+ * Deletes the calendar and all associated events.
31
+ * Delete a calendar
32
32
  */
33
- organizationsOrganizationIdCalendarsGetRaw(requestParameters, initOverrides) {
33
+ organizationsOrganizationIdCalendarsCalendarIdDeleteRaw(requestParameters, initOverrides) {
34
34
  return __awaiter(this, void 0, void 0, function* () {
35
35
  if (requestParameters['organizationId'] == null) {
36
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsGet().');
36
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdDelete().');
37
+ }
38
+ if (requestParameters['calendarId'] == null) {
39
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdDelete().');
37
40
  }
38
41
  const queryParameters = {};
39
42
  const headerParameters = {};
@@ -44,37 +47,40 @@ export class CalendarApi extends runtime.BaseAPI {
44
47
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
45
48
  }
46
49
  }
47
- let urlPath = `/organizations/{organizationId}/calendars`;
50
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}`;
48
51
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
52
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
49
53
  const response = yield this.request({
50
54
  path: urlPath,
51
- method: 'GET',
55
+ method: 'DELETE',
52
56
  headers: headerParameters,
53
57
  query: queryParameters,
54
58
  }, initOverrides);
55
- return new runtime.JSONApiResponse(response, (jsonValue) => CalendarListResponseFromJSON(jsonValue));
59
+ return new runtime.VoidApiResponse(response);
56
60
  });
57
61
  }
58
62
  /**
59
- * Returns all calendars with agent information. Each calendar is associated with an agent.
60
- * List all calendars in the organization
63
+ * Deletes the calendar and all associated events.
64
+ * Delete a calendar
61
65
  */
62
- organizationsOrganizationIdCalendarsGet(requestParameters, initOverrides) {
66
+ organizationsOrganizationIdCalendarsCalendarIdDelete(requestParameters, initOverrides) {
63
67
  return __awaiter(this, void 0, void 0, function* () {
64
- const response = yield this.organizationsOrganizationIdCalendarsGetRaw(requestParameters, initOverrides);
65
- return yield response.value();
68
+ yield this.organizationsOrganizationIdCalendarsCalendarIdDeleteRaw(requestParameters, initOverrides);
66
69
  });
67
70
  }
68
71
  /**
69
72
  * Delete a calendar event
70
73
  */
71
- organizationsOrganizationIdEventsEventIdDeleteRaw(requestParameters, initOverrides) {
74
+ organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDeleteRaw(requestParameters, initOverrides) {
72
75
  return __awaiter(this, void 0, void 0, function* () {
73
76
  if (requestParameters['organizationId'] == null) {
74
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsEventIdDelete().');
77
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete().');
78
+ }
79
+ if (requestParameters['calendarId'] == null) {
80
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete().');
75
81
  }
76
82
  if (requestParameters['eventId'] == null) {
77
- throw new runtime.RequiredError('eventId', 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdEventsEventIdDelete().');
83
+ throw new runtime.RequiredError('eventId', 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete().');
78
84
  }
79
85
  const queryParameters = {};
80
86
  const headerParameters = {};
@@ -85,8 +91,9 @@ export class CalendarApi extends runtime.BaseAPI {
85
91
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
86
92
  }
87
93
  }
88
- let urlPath = `/organizations/{organizationId}/events/{eventId}`;
94
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events/{eventId}`;
89
95
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
96
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
90
97
  urlPath = urlPath.replace(`{${"eventId"}}`, encodeURIComponent(String(requestParameters['eventId'])));
91
98
  const response = yield this.request({
92
99
  path: urlPath,
@@ -100,21 +107,24 @@ export class CalendarApi extends runtime.BaseAPI {
100
107
  /**
101
108
  * Delete a calendar event
102
109
  */
103
- organizationsOrganizationIdEventsEventIdDelete(requestParameters, initOverrides) {
110
+ organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDelete(requestParameters, initOverrides) {
104
111
  return __awaiter(this, void 0, void 0, function* () {
105
- yield this.organizationsOrganizationIdEventsEventIdDeleteRaw(requestParameters, initOverrides);
112
+ yield this.organizationsOrganizationIdCalendarsCalendarIdEventsEventIdDeleteRaw(requestParameters, initOverrides);
106
113
  });
107
114
  }
108
115
  /**
109
116
  * Get a single calendar event
110
117
  */
111
- organizationsOrganizationIdEventsEventIdGetRaw(requestParameters, initOverrides) {
118
+ organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGetRaw(requestParameters, initOverrides) {
112
119
  return __awaiter(this, void 0, void 0, function* () {
113
120
  if (requestParameters['organizationId'] == null) {
114
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsEventIdGet().');
121
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet().');
122
+ }
123
+ if (requestParameters['calendarId'] == null) {
124
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet().');
115
125
  }
116
126
  if (requestParameters['eventId'] == null) {
117
- throw new runtime.RequiredError('eventId', 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdEventsEventIdGet().');
127
+ throw new runtime.RequiredError('eventId', 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet().');
118
128
  }
119
129
  const queryParameters = {};
120
130
  const headerParameters = {};
@@ -125,8 +135,9 @@ export class CalendarApi extends runtime.BaseAPI {
125
135
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
126
136
  }
127
137
  }
128
- let urlPath = `/organizations/{organizationId}/events/{eventId}`;
138
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events/{eventId}`;
129
139
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
140
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
130
141
  urlPath = urlPath.replace(`{${"eventId"}}`, encodeURIComponent(String(requestParameters['eventId'])));
131
142
  const response = yield this.request({
132
143
  path: urlPath,
@@ -140,9 +151,9 @@ export class CalendarApi extends runtime.BaseAPI {
140
151
  /**
141
152
  * Get a single calendar event
142
153
  */
143
- organizationsOrganizationIdEventsEventIdGet(requestParameters, initOverrides) {
154
+ organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGet(requestParameters, initOverrides) {
144
155
  return __awaiter(this, void 0, void 0, function* () {
145
- const response = yield this.organizationsOrganizationIdEventsEventIdGetRaw(requestParameters, initOverrides);
156
+ const response = yield this.organizationsOrganizationIdCalendarsCalendarIdEventsEventIdGetRaw(requestParameters, initOverrides);
146
157
  return yield response.value();
147
158
  });
148
159
  }
@@ -150,16 +161,19 @@ export class CalendarApi extends runtime.BaseAPI {
150
161
  * Partial update - only provided fields will be modified
151
162
  * Update a calendar event
152
163
  */
153
- organizationsOrganizationIdEventsEventIdPutRaw(requestParameters, initOverrides) {
164
+ organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPutRaw(requestParameters, initOverrides) {
154
165
  return __awaiter(this, void 0, void 0, function* () {
155
166
  if (requestParameters['organizationId'] == null) {
156
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsEventIdPut().');
167
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().');
168
+ }
169
+ if (requestParameters['calendarId'] == null) {
170
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().');
157
171
  }
158
172
  if (requestParameters['eventId'] == null) {
159
- throw new runtime.RequiredError('eventId', 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdEventsEventIdPut().');
173
+ throw new runtime.RequiredError('eventId', 'Required parameter "eventId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().');
160
174
  }
161
175
  if (requestParameters['calendarEventUpdate'] == null) {
162
- throw new runtime.RequiredError('calendarEventUpdate', 'Required parameter "calendarEventUpdate" was null or undefined when calling organizationsOrganizationIdEventsEventIdPut().');
176
+ throw new runtime.RequiredError('calendarEventUpdate', 'Required parameter "calendarEventUpdate" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut().');
163
177
  }
164
178
  const queryParameters = {};
165
179
  const headerParameters = {};
@@ -171,8 +185,9 @@ export class CalendarApi extends runtime.BaseAPI {
171
185
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
172
186
  }
173
187
  }
174
- let urlPath = `/organizations/{organizationId}/events/{eventId}`;
188
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events/{eventId}`;
175
189
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
190
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
176
191
  urlPath = urlPath.replace(`{${"eventId"}}`, encodeURIComponent(String(requestParameters['eventId'])));
177
192
  const response = yield this.request({
178
193
  path: urlPath,
@@ -188,26 +203,28 @@ export class CalendarApi extends runtime.BaseAPI {
188
203
  * Partial update - only provided fields will be modified
189
204
  * Update a calendar event
190
205
  */
191
- organizationsOrganizationIdEventsEventIdPut(requestParameters, initOverrides) {
206
+ organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPut(requestParameters, initOverrides) {
192
207
  return __awaiter(this, void 0, void 0, function* () {
193
- const response = yield this.organizationsOrganizationIdEventsEventIdPutRaw(requestParameters, initOverrides);
208
+ const response = yield this.organizationsOrganizationIdCalendarsCalendarIdEventsEventIdPutRaw(requestParameters, initOverrides);
194
209
  return yield response.value();
195
210
  });
196
211
  }
197
212
  /**
198
- * Returns events and their associated calendars. Optionally filter by specific calendar IDs.
199
213
  * List calendar events within a date range
200
214
  */
201
- organizationsOrganizationIdEventsGetRaw(requestParameters, initOverrides) {
215
+ organizationsOrganizationIdCalendarsCalendarIdEventsGetRaw(requestParameters, initOverrides) {
202
216
  return __awaiter(this, void 0, void 0, function* () {
203
217
  if (requestParameters['organizationId'] == null) {
204
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsGet().');
218
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().');
219
+ }
220
+ if (requestParameters['calendarId'] == null) {
221
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().');
205
222
  }
206
223
  if (requestParameters['start'] == null) {
207
- throw new runtime.RequiredError('start', 'Required parameter "start" was null or undefined when calling organizationsOrganizationIdEventsGet().');
224
+ throw new runtime.RequiredError('start', 'Required parameter "start" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().');
208
225
  }
209
226
  if (requestParameters['end'] == null) {
210
- throw new runtime.RequiredError('end', 'Required parameter "end" was null or undefined when calling organizationsOrganizationIdEventsGet().');
227
+ throw new runtime.RequiredError('end', 'Required parameter "end" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsGet().');
211
228
  }
212
229
  const queryParameters = {};
213
230
  if (requestParameters['start'] != null) {
@@ -216,9 +233,6 @@ export class CalendarApi extends runtime.BaseAPI {
216
233
  if (requestParameters['end'] != null) {
217
234
  queryParameters['end'] = requestParameters['end'].toISOString();
218
235
  }
219
- if (requestParameters['calendarIds'] != null) {
220
- queryParameters['calendar_ids'] = requestParameters['calendarIds'];
221
- }
222
236
  const headerParameters = {};
223
237
  if (this.configuration && this.configuration.accessToken) {
224
238
  const token = this.configuration.accessToken;
@@ -227,37 +241,40 @@ export class CalendarApi extends runtime.BaseAPI {
227
241
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
228
242
  }
229
243
  }
230
- let urlPath = `/organizations/{organizationId}/events`;
244
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events`;
231
245
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
246
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
232
247
  const response = yield this.request({
233
248
  path: urlPath,
234
249
  method: 'GET',
235
250
  headers: headerParameters,
236
251
  query: queryParameters,
237
252
  }, initOverrides);
238
- return new runtime.JSONApiResponse(response, (jsonValue) => CalendarEventResponseFromJSON(jsonValue));
253
+ return new runtime.JSONApiResponse(response, (jsonValue) => CalendarEventListResponseFromJSON(jsonValue));
239
254
  });
240
255
  }
241
256
  /**
242
- * Returns events and their associated calendars. Optionally filter by specific calendar IDs.
243
257
  * List calendar events within a date range
244
258
  */
245
- organizationsOrganizationIdEventsGet(requestParameters, initOverrides) {
259
+ organizationsOrganizationIdCalendarsCalendarIdEventsGet(requestParameters, initOverrides) {
246
260
  return __awaiter(this, void 0, void 0, function* () {
247
- const response = yield this.organizationsOrganizationIdEventsGetRaw(requestParameters, initOverrides);
261
+ const response = yield this.organizationsOrganizationIdCalendarsCalendarIdEventsGetRaw(requestParameters, initOverrides);
248
262
  return yield response.value();
249
263
  });
250
264
  }
251
265
  /**
252
266
  * Create a new calendar event
253
267
  */
254
- organizationsOrganizationIdEventsPostRaw(requestParameters, initOverrides) {
268
+ organizationsOrganizationIdCalendarsCalendarIdEventsPostRaw(requestParameters, initOverrides) {
255
269
  return __awaiter(this, void 0, void 0, function* () {
256
270
  if (requestParameters['organizationId'] == null) {
257
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdEventsPost().');
271
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsPost().');
272
+ }
273
+ if (requestParameters['calendarId'] == null) {
274
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsPost().');
258
275
  }
259
276
  if (requestParameters['calendarEventCreate'] == null) {
260
- throw new runtime.RequiredError('calendarEventCreate', 'Required parameter "calendarEventCreate" was null or undefined when calling organizationsOrganizationIdEventsPost().');
277
+ throw new runtime.RequiredError('calendarEventCreate', 'Required parameter "calendarEventCreate" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdEventsPost().');
261
278
  }
262
279
  const queryParameters = {};
263
280
  const headerParameters = {};
@@ -269,8 +286,9 @@ export class CalendarApi extends runtime.BaseAPI {
269
286
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
270
287
  }
271
288
  }
272
- let urlPath = `/organizations/{organizationId}/events`;
289
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}/events`;
273
290
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
291
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
274
292
  const response = yield this.request({
275
293
  path: urlPath,
276
294
  method: 'POST',
@@ -284,23 +302,22 @@ export class CalendarApi extends runtime.BaseAPI {
284
302
  /**
285
303
  * Create a new calendar event
286
304
  */
287
- organizationsOrganizationIdEventsPost(requestParameters, initOverrides) {
305
+ organizationsOrganizationIdCalendarsCalendarIdEventsPost(requestParameters, initOverrides) {
288
306
  return __awaiter(this, void 0, void 0, function* () {
289
- const response = yield this.organizationsOrganizationIdEventsPostRaw(requestParameters, initOverrides);
307
+ const response = yield this.organizationsOrganizationIdCalendarsCalendarIdEventsPostRaw(requestParameters, initOverrides);
290
308
  return yield response.value();
291
309
  });
292
310
  }
293
311
  /**
294
- * Deletes the calendar and all associated events for the specified voice agent.
295
- * Delete calendar for a voice agent
312
+ * Get a calendar by ID
296
313
  */
297
- organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDeleteRaw(requestParameters, initOverrides) {
314
+ organizationsOrganizationIdCalendarsCalendarIdGetRaw(requestParameters, initOverrides) {
298
315
  return __awaiter(this, void 0, void 0, function* () {
299
316
  if (requestParameters['organizationId'] == null) {
300
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDelete().');
317
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdGet().');
301
318
  }
302
- if (requestParameters['voiceAgentId'] == null) {
303
- throw new runtime.RequiredError('voiceAgentId', 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDelete().');
319
+ if (requestParameters['calendarId'] == null) {
320
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdGet().');
304
321
  }
305
322
  const queryParameters = {};
306
323
  const headerParameters = {};
@@ -311,41 +328,45 @@ export class CalendarApi extends runtime.BaseAPI {
311
328
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
312
329
  }
313
330
  }
314
- let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/calendar`;
331
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}`;
315
332
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
316
- urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
333
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
317
334
  const response = yield this.request({
318
335
  path: urlPath,
319
- method: 'DELETE',
336
+ method: 'GET',
320
337
  headers: headerParameters,
321
338
  query: queryParameters,
322
339
  }, initOverrides);
323
- return new runtime.VoidApiResponse(response);
340
+ return new runtime.JSONApiResponse(response, (jsonValue) => CalendarFromJSON(jsonValue));
324
341
  });
325
342
  }
326
343
  /**
327
- * Deletes the calendar and all associated events for the specified voice agent.
328
- * Delete calendar for a voice agent
344
+ * Get a calendar by ID
329
345
  */
330
- organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDelete(requestParameters, initOverrides) {
346
+ organizationsOrganizationIdCalendarsCalendarIdGet(requestParameters, initOverrides) {
331
347
  return __awaiter(this, void 0, void 0, function* () {
332
- yield this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarDeleteRaw(requestParameters, initOverrides);
348
+ const response = yield this.organizationsOrganizationIdCalendarsCalendarIdGetRaw(requestParameters, initOverrides);
349
+ return yield response.value();
333
350
  });
334
351
  }
335
352
  /**
336
- * Returns the calendar associated with a specific voice agent.
337
- * Get calendar for a voice agent
353
+ * Re-assign the calendar to a different voice agent in the same organization.
354
+ * Update a calendar
338
355
  */
339
- organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGetRaw(requestParameters, initOverrides) {
356
+ organizationsOrganizationIdCalendarsCalendarIdPutRaw(requestParameters, initOverrides) {
340
357
  return __awaiter(this, void 0, void 0, function* () {
341
358
  if (requestParameters['organizationId'] == null) {
342
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGet().');
359
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdPut().');
343
360
  }
344
- if (requestParameters['voiceAgentId'] == null) {
345
- throw new runtime.RequiredError('voiceAgentId', 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGet().');
361
+ if (requestParameters['calendarId'] == null) {
362
+ throw new runtime.RequiredError('calendarId', 'Required parameter "calendarId" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdPut().');
363
+ }
364
+ if (requestParameters['calendarUpdate'] == null) {
365
+ throw new runtime.RequiredError('calendarUpdate', 'Required parameter "calendarUpdate" was null or undefined when calling organizationsOrganizationIdCalendarsCalendarIdPut().');
346
366
  }
347
367
  const queryParameters = {};
348
368
  const headerParameters = {};
369
+ headerParameters['Content-Type'] = 'application/json';
349
370
  if (this.configuration && this.configuration.accessToken) {
350
371
  const token = this.configuration.accessToken;
351
372
  const tokenString = yield token("bearerAuth", []);
@@ -353,42 +374,86 @@ export class CalendarApi extends runtime.BaseAPI {
353
374
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
354
375
  }
355
376
  }
356
- let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/calendar`;
377
+ let urlPath = `/organizations/{organizationId}/calendars/{calendarId}`;
357
378
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
358
- urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
379
+ urlPath = urlPath.replace(`{${"calendarId"}}`, encodeURIComponent(String(requestParameters['calendarId'])));
359
380
  const response = yield this.request({
360
381
  path: urlPath,
361
- method: 'GET',
382
+ method: 'PUT',
362
383
  headers: headerParameters,
363
384
  query: queryParameters,
385
+ body: CalendarUpdateToJSON(requestParameters['calendarUpdate']),
364
386
  }, initOverrides);
365
387
  return new runtime.JSONApiResponse(response, (jsonValue) => CalendarFromJSON(jsonValue));
366
388
  });
367
389
  }
368
390
  /**
369
- * Returns the calendar associated with a specific voice agent.
370
- * Get calendar for a voice agent
391
+ * Re-assign the calendar to a different voice agent in the same organization.
392
+ * Update a calendar
393
+ */
394
+ organizationsOrganizationIdCalendarsCalendarIdPut(requestParameters, initOverrides) {
395
+ return __awaiter(this, void 0, void 0, function* () {
396
+ const response = yield this.organizationsOrganizationIdCalendarsCalendarIdPutRaw(requestParameters, initOverrides);
397
+ return yield response.value();
398
+ });
399
+ }
400
+ /**
401
+ * Returns all calendars with agent information. Optionally filter by voice_agent_id.
402
+ * List all calendars in the organization
403
+ */
404
+ organizationsOrganizationIdCalendarsGetRaw(requestParameters, initOverrides) {
405
+ return __awaiter(this, void 0, void 0, function* () {
406
+ if (requestParameters['organizationId'] == null) {
407
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsGet().');
408
+ }
409
+ const queryParameters = {};
410
+ if (requestParameters['voiceAgentId'] != null) {
411
+ queryParameters['voice_agent_id'] = requestParameters['voiceAgentId'];
412
+ }
413
+ const headerParameters = {};
414
+ if (this.configuration && this.configuration.accessToken) {
415
+ const token = this.configuration.accessToken;
416
+ const tokenString = yield token("bearerAuth", []);
417
+ if (tokenString) {
418
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
419
+ }
420
+ }
421
+ let urlPath = `/organizations/{organizationId}/calendars`;
422
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
423
+ const response = yield this.request({
424
+ path: urlPath,
425
+ method: 'GET',
426
+ headers: headerParameters,
427
+ query: queryParameters,
428
+ }, initOverrides);
429
+ return new runtime.JSONApiResponse(response, (jsonValue) => CalendarListResponseFromJSON(jsonValue));
430
+ });
431
+ }
432
+ /**
433
+ * Returns all calendars with agent information. Optionally filter by voice_agent_id.
434
+ * List all calendars in the organization
371
435
  */
372
- organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGet(requestParameters, initOverrides) {
436
+ organizationsOrganizationIdCalendarsGet(requestParameters, initOverrides) {
373
437
  return __awaiter(this, void 0, void 0, function* () {
374
- const response = yield this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarGetRaw(requestParameters, initOverrides);
438
+ const response = yield this.organizationsOrganizationIdCalendarsGetRaw(requestParameters, initOverrides);
375
439
  return yield response.value();
376
440
  });
377
441
  }
378
442
  /**
379
- * Creates a new calendar for the specified voice agent. Only one calendar per agent is allowed.
443
+ * Creates a new calendar linked to the specified voice agent. Only one calendar per agent is allowed.
380
444
  * Create a calendar for a voice agent
381
445
  */
382
- organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostRaw(requestParameters, initOverrides) {
446
+ organizationsOrganizationIdCalendarsPostRaw(requestParameters, initOverrides) {
383
447
  return __awaiter(this, void 0, void 0, function* () {
384
448
  if (requestParameters['organizationId'] == null) {
385
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPost().');
449
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCalendarsPost().');
386
450
  }
387
- if (requestParameters['voiceAgentId'] == null) {
388
- throw new runtime.RequiredError('voiceAgentId', 'Required parameter "voiceAgentId" was null or undefined when calling organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPost().');
451
+ if (requestParameters['calendarCreate'] == null) {
452
+ throw new runtime.RequiredError('calendarCreate', 'Required parameter "calendarCreate" was null or undefined when calling organizationsOrganizationIdCalendarsPost().');
389
453
  }
390
454
  const queryParameters = {};
391
455
  const headerParameters = {};
456
+ headerParameters['Content-Type'] = 'application/json';
392
457
  if (this.configuration && this.configuration.accessToken) {
393
458
  const token = this.configuration.accessToken;
394
459
  const tokenString = yield token("bearerAuth", []);
@@ -396,25 +461,25 @@ export class CalendarApi extends runtime.BaseAPI {
396
461
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
397
462
  }
398
463
  }
399
- let urlPath = `/organizations/{organizationId}/voice-agents/{voiceAgentId}/calendar`;
464
+ let urlPath = `/organizations/{organizationId}/calendars`;
400
465
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
401
- urlPath = urlPath.replace(`{${"voiceAgentId"}}`, encodeURIComponent(String(requestParameters['voiceAgentId'])));
402
466
  const response = yield this.request({
403
467
  path: urlPath,
404
468
  method: 'POST',
405
469
  headers: headerParameters,
406
470
  query: queryParameters,
471
+ body: CalendarCreateToJSON(requestParameters['calendarCreate']),
407
472
  }, initOverrides);
408
473
  return new runtime.JSONApiResponse(response, (jsonValue) => CalendarFromJSON(jsonValue));
409
474
  });
410
475
  }
411
476
  /**
412
- * Creates a new calendar for the specified voice agent. Only one calendar per agent is allowed.
477
+ * Creates a new calendar linked to the specified voice agent. Only one calendar per agent is allowed.
413
478
  * Create a calendar for a voice agent
414
479
  */
415
- organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPost(requestParameters, initOverrides) {
480
+ organizationsOrganizationIdCalendarsPost(requestParameters, initOverrides) {
416
481
  return __awaiter(this, void 0, void 0, function* () {
417
- const response = yield this.organizationsOrganizationIdVoiceAgentsVoiceAgentIdCalendarPostRaw(requestParameters, initOverrides);
482
+ const response = yield this.organizationsOrganizationIdCalendarsPostRaw(requestParameters, initOverrides);
418
483
  return yield response.value();
419
484
  });
420
485
  }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Tivadar AI Backend API
3
+ * Unified REST API for Tivadar AI Voice Agents platform
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { Call, CallCreate, CallUpdate } from '../models/index';
14
+ export interface OrganizationsOrganizationIdCallsCallIdDeleteRequest {
15
+ organizationId: string;
16
+ callId: string;
17
+ }
18
+ export interface OrganizationsOrganizationIdCallsCallIdGetRequest {
19
+ organizationId: string;
20
+ callId: string;
21
+ }
22
+ export interface OrganizationsOrganizationIdCallsCallIdPutRequest {
23
+ organizationId: string;
24
+ callId: string;
25
+ callUpdate: CallUpdate;
26
+ }
27
+ export interface OrganizationsOrganizationIdCallsGetRequest {
28
+ organizationId: string;
29
+ voiceAgentId?: string;
30
+ sandbox?: OrganizationsOrganizationIdCallsGetSandboxEnum;
31
+ }
32
+ export interface OrganizationsOrganizationIdCallsPostRequest {
33
+ organizationId: string;
34
+ callCreate: CallCreate;
35
+ }
36
+ /**
37
+ *
38
+ */
39
+ export declare class CallsApi extends runtime.BaseAPI {
40
+ /**
41
+ * Delete a call
42
+ */
43
+ organizationsOrganizationIdCallsCallIdDeleteRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
44
+ /**
45
+ * Delete a call
46
+ */
47
+ organizationsOrganizationIdCallsCallIdDelete(requestParameters: OrganizationsOrganizationIdCallsCallIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
48
+ /**
49
+ * Get a call by ID
50
+ */
51
+ organizationsOrganizationIdCallsCallIdGetRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Call>>;
52
+ /**
53
+ * Get a call by ID
54
+ */
55
+ organizationsOrganizationIdCallsCallIdGet(requestParameters: OrganizationsOrganizationIdCallsCallIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Call>;
56
+ /**
57
+ * Partial update — only provided fields are modified.
58
+ * Update a call
59
+ */
60
+ organizationsOrganizationIdCallsCallIdPutRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Call>>;
61
+ /**
62
+ * Partial update — only provided fields are modified.
63
+ * Update a call
64
+ */
65
+ organizationsOrganizationIdCallsCallIdPut(requestParameters: OrganizationsOrganizationIdCallsCallIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Call>;
66
+ /**
67
+ * Returns calls scoped to the organization via their associated voice agent. Calls without a voice_agent_id are not returned.
68
+ * List calls for an organization
69
+ */
70
+ organizationsOrganizationIdCallsGetRaw(requestParameters: OrganizationsOrganizationIdCallsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Call>>>;
71
+ /**
72
+ * Returns calls scoped to the organization via their associated voice agent. Calls without a voice_agent_id are not returned.
73
+ * List calls for an organization
74
+ */
75
+ organizationsOrganizationIdCallsGet(requestParameters: OrganizationsOrganizationIdCallsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Call>>;
76
+ /**
77
+ * Create a new call record
78
+ */
79
+ organizationsOrganizationIdCallsPostRaw(requestParameters: OrganizationsOrganizationIdCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Call>>;
80
+ /**
81
+ * Create a new call record
82
+ */
83
+ organizationsOrganizationIdCallsPost(requestParameters: OrganizationsOrganizationIdCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Call>;
84
+ }
85
+ /**
86
+ * @export
87
+ */
88
+ export declare const OrganizationsOrganizationIdCallsGetSandboxEnum: {
89
+ readonly True: "true";
90
+ readonly False: "false";
91
+ };
92
+ export type OrganizationsOrganizationIdCallsGetSandboxEnum = typeof OrganizationsOrganizationIdCallsGetSandboxEnum[keyof typeof OrganizationsOrganizationIdCallsGetSandboxEnum];