@l7mp/tivadar-ai-api-sdk 0.1.10 → 0.2.2

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 (76) hide show
  1. package/dist/api-client.d.ts +15 -1
  2. package/dist/api-client.js +8 -0
  3. package/dist/apis/NotificationsApi.d.ts +133 -0
  4. package/dist/apis/NotificationsApi.js +360 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/api-client.d.ts +15 -1
  8. package/dist/esm/api-client.js +8 -0
  9. package/dist/esm/apis/NotificationsApi.d.ts +133 -0
  10. package/dist/esm/apis/NotificationsApi.js +356 -0
  11. package/dist/esm/apis/index.d.ts +1 -0
  12. package/dist/esm/apis/index.js +1 -0
  13. package/dist/esm/models/Call.d.ts +8 -0
  14. package/dist/esm/models/Call.js +2 -0
  15. package/dist/esm/models/CallCreate.d.ts +8 -0
  16. package/dist/esm/models/CallCreate.js +2 -0
  17. package/dist/esm/models/CallUpdate.d.ts +8 -0
  18. package/dist/esm/models/CallUpdate.js +2 -0
  19. package/dist/esm/models/Notification.d.ts +120 -0
  20. package/dist/esm/models/Notification.js +91 -0
  21. package/dist/esm/models/NotificationChannel.d.ts +26 -0
  22. package/dist/esm/models/NotificationChannel.js +44 -0
  23. package/dist/esm/models/NotificationCreate.d.ts +78 -0
  24. package/dist/esm/models/NotificationCreate.js +63 -0
  25. package/dist/esm/models/NotificationScope.d.ts +26 -0
  26. package/dist/esm/models/NotificationScope.js +44 -0
  27. package/dist/esm/models/NotificationSeverity.d.ts +27 -0
  28. package/dist/esm/models/NotificationSeverity.js +45 -0
  29. package/dist/esm/models/NotificationType.d.ts +25 -0
  30. package/dist/esm/models/NotificationType.js +43 -0
  31. package/dist/esm/models/NotificationUpdate.d.ts +58 -0
  32. package/dist/esm/models/NotificationUpdate.js +51 -0
  33. package/dist/esm/models/OrganizationsOrganizationIdNotificationsGet200Response.d.ts +39 -0
  34. package/dist/esm/models/OrganizationsOrganizationIdNotificationsGet200Response.js +44 -0
  35. package/dist/esm/models/index.d.ts +8 -0
  36. package/dist/esm/models/index.js +8 -0
  37. package/dist/models/Call.d.ts +8 -0
  38. package/dist/models/Call.js +2 -0
  39. package/dist/models/CallCreate.d.ts +8 -0
  40. package/dist/models/CallCreate.js +2 -0
  41. package/dist/models/CallUpdate.d.ts +8 -0
  42. package/dist/models/CallUpdate.js +2 -0
  43. package/dist/models/Notification.d.ts +120 -0
  44. package/dist/models/Notification.js +98 -0
  45. package/dist/models/NotificationChannel.d.ts +26 -0
  46. package/dist/models/NotificationChannel.js +52 -0
  47. package/dist/models/NotificationCreate.d.ts +78 -0
  48. package/dist/models/NotificationCreate.js +70 -0
  49. package/dist/models/NotificationScope.d.ts +26 -0
  50. package/dist/models/NotificationScope.js +52 -0
  51. package/dist/models/NotificationSeverity.d.ts +27 -0
  52. package/dist/models/NotificationSeverity.js +53 -0
  53. package/dist/models/NotificationType.d.ts +25 -0
  54. package/dist/models/NotificationType.js +51 -0
  55. package/dist/models/NotificationUpdate.d.ts +58 -0
  56. package/dist/models/NotificationUpdate.js +58 -0
  57. package/dist/models/OrganizationsOrganizationIdNotificationsGet200Response.d.ts +39 -0
  58. package/dist/models/OrganizationsOrganizationIdNotificationsGet200Response.js +51 -0
  59. package/dist/models/index.d.ts +8 -0
  60. package/dist/models/index.js +8 -0
  61. package/package.json +1 -1
  62. package/src/api-client.ts +21 -0
  63. package/src/apis/NotificationsApi.ts +509 -0
  64. package/src/apis/index.ts +1 -0
  65. package/src/models/Call.ts +8 -1
  66. package/src/models/CallCreate.ts +8 -1
  67. package/src/models/CallUpdate.ts +8 -1
  68. package/src/models/Notification.ts +217 -0
  69. package/src/models/NotificationChannel.ts +54 -0
  70. package/src/models/NotificationCreate.ts +154 -0
  71. package/src/models/NotificationScope.ts +54 -0
  72. package/src/models/NotificationSeverity.ts +55 -0
  73. package/src/models/NotificationType.ts +53 -0
  74. package/src/models/NotificationUpdate.ts +114 -0
  75. package/src/models/OrganizationsOrganizationIdNotificationsGet200Response.ts +81 -0
  76. package/src/models/index.ts +8 -0
package/src/api-client.ts CHANGED
@@ -4,6 +4,7 @@ import { ChatAgentsApi } from "./apis/ChatAgentsApi";
4
4
  import { HistoryApi } from "./apis/HistoryApi";
5
5
  import { InvitationsApi } from "./apis/InvitationsApi";
6
6
  import { MembersApi } from "./apis/MembersApi";
7
+ import { NotificationsApi, type OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum, type OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum } from "./apis/NotificationsApi";
7
8
  import { OrganizationsApi } from "./apis/OrganizationsApi";
8
9
  import { PlaygroundApi } from "./apis/PlaygroundApi";
9
10
  import { RAGApi, type OrganizationsOrganizationIdRagRagConfigNameDocumentsGetStatusEnum } from "./apis/RAGApi";
@@ -20,6 +21,10 @@ import { Configuration } from "./runtime";
20
21
  import type {
21
22
  CallCreate,
22
23
  CallUpdate,
24
+ Notification,
25
+ NotificationScope,
26
+ NotificationSeverity,
27
+ NotificationType,
23
28
  VoiceAgentCreate,
24
29
  VoiceAgentUpdate,
25
30
  ChatAgentCreate,
@@ -41,6 +46,7 @@ import type {
41
46
  UpdatePlanRequest,
42
47
  PauseSubscriptionRequest,
43
48
  BillingPortalRequest,
49
+ OrganizationsOrganizationIdNotificationsGet200Response,
44
50
  } from "./models";
45
51
 
46
52
  export interface ApiClientConfig {
@@ -157,6 +163,12 @@ export class Api {
157
163
  public readonly ttsProviders: {
158
164
  list: (organizationId: string, options?: RequestInit) => ReturnType<TTSProvidersApi["organizationsOrganizationIdTtsProvidersGet"]>;
159
165
  };
166
+ public readonly notifications: {
167
+ list: (organizationId: string, filters?: { type?: NotificationType; severity?: NotificationSeverity; scope?: NotificationScope; include_dismissed?: OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum; include_expired?: OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum }, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsGet"]>;
168
+ get: (organizationId: string, notificationId: string, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsNotificationIdGet"]>;
169
+ read: (organizationId: string, notificationId: string, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsNotificationIdReadPost"]>;
170
+ dismiss: (organizationId: string, notificationId: string, options?: RequestInit) => ReturnType<NotificationsApi["organizationsOrganizationIdNotificationsNotificationIdDismissPost"]>;
171
+ };
160
172
  public readonly embeddingProviders: {
161
173
  list: (organizationId: string, options?: RequestInit) => ReturnType<EmbeddingProvidersApi["organizationsOrganizationIdEmbeddingProvidersGet"]>;
162
174
  };
@@ -173,6 +185,7 @@ export class Api {
173
185
  private readonly ragApi: RAGApi;
174
186
  private readonly recordingsApi: RecordingsApi;
175
187
  private readonly sipApi: SIPApi;
188
+ private readonly notificationsApi: NotificationsApi;
176
189
  private readonly subscriptionApi: SubscriptionApi;
177
190
  private readonly embeddingProvidersApi: EmbeddingProvidersApi;
178
191
  private readonly llmProvidersApi: LLMProvidersApi;
@@ -210,6 +223,7 @@ export class Api {
210
223
  this.ragApi = new RAGApi(configuration);
211
224
  this.recordingsApi = new RecordingsApi(configuration);
212
225
  this.sipApi = new SIPApi(configuration);
226
+ this.notificationsApi = new NotificationsApi(configuration);
213
227
  this.subscriptionApi = new SubscriptionApi(configuration);
214
228
  this.embeddingProvidersApi = new EmbeddingProvidersApi(configuration);
215
229
  this.llmProvidersApi = new LLMProvidersApi(configuration);
@@ -314,6 +328,13 @@ export class Api {
314
328
  deletePhoneNumber: (phoneNumberId, options) => this.sipApi.phoneNumbersPhoneNumberIdDelete({ phoneNumberId }, options),
315
329
  };
316
330
 
331
+ this.notifications = {
332
+ list: (organizationId, filters, options) => this.notificationsApi.organizationsOrganizationIdNotificationsGet({ organizationId, type: filters?.type, severity: filters?.severity, scope: filters?.scope, includeDismissed: filters?.include_dismissed, includeExpired: filters?.include_expired }, options),
333
+ get: (organizationId, notificationId, options) => this.notificationsApi.organizationsOrganizationIdNotificationsNotificationIdGet({ organizationId, notificationId }, options),
334
+ read: (organizationId, notificationId, options) => this.notificationsApi.organizationsOrganizationIdNotificationsNotificationIdReadPost({ organizationId, notificationId }, options),
335
+ dismiss: (organizationId, notificationId, options) => this.notificationsApi.organizationsOrganizationIdNotificationsNotificationIdDismissPost({ organizationId, notificationId }, options),
336
+ };
337
+
317
338
  this.subscription = {
318
339
  getStatus: (organizationId, options) => this.subscriptionApi.organizationsOrganizationIdSubscriptionGet({ organizationId }, options),
319
340
  getDetails: (organizationId, options) => this.subscriptionApi.organizationsOrganizationIdSubscriptionDetailsGet({ organizationId }, options),
@@ -0,0 +1,509 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Tivadar AI Backend API
5
+ * Unified REST API for Tivadar AI Voice Agents platform
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ Notification,
19
+ NotificationCreate,
20
+ NotificationScope,
21
+ NotificationSeverity,
22
+ NotificationType,
23
+ NotificationUpdate,
24
+ OrganizationsOrganizationIdNotificationsGet200Response,
25
+ } from '../models/index';
26
+ import {
27
+ NotificationFromJSON,
28
+ NotificationToJSON,
29
+ NotificationCreateFromJSON,
30
+ NotificationCreateToJSON,
31
+ NotificationScopeFromJSON,
32
+ NotificationScopeToJSON,
33
+ NotificationSeverityFromJSON,
34
+ NotificationSeverityToJSON,
35
+ NotificationTypeFromJSON,
36
+ NotificationTypeToJSON,
37
+ NotificationUpdateFromJSON,
38
+ NotificationUpdateToJSON,
39
+ OrganizationsOrganizationIdNotificationsGet200ResponseFromJSON,
40
+ OrganizationsOrganizationIdNotificationsGet200ResponseToJSON,
41
+ } from '../models/index';
42
+
43
+ export interface OrganizationsOrganizationIdNotificationsGetRequest {
44
+ organizationId: string;
45
+ type?: NotificationType;
46
+ severity?: NotificationSeverity;
47
+ scope?: NotificationScope;
48
+ includeDismissed?: OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum;
49
+ includeExpired?: OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum;
50
+ }
51
+
52
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdDeleteRequest {
53
+ organizationId: string;
54
+ notificationId: string;
55
+ }
56
+
57
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdDismissPostRequest {
58
+ organizationId: string;
59
+ notificationId: string;
60
+ }
61
+
62
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdGetRequest {
63
+ organizationId: string;
64
+ notificationId: string;
65
+ }
66
+
67
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdPutRequest {
68
+ organizationId: string;
69
+ notificationId: string;
70
+ notificationUpdate: NotificationUpdate;
71
+ }
72
+
73
+ export interface OrganizationsOrganizationIdNotificationsNotificationIdReadPostRequest {
74
+ organizationId: string;
75
+ notificationId: string;
76
+ }
77
+
78
+ export interface OrganizationsOrganizationIdNotificationsPostRequest {
79
+ organizationId: string;
80
+ notificationCreate: NotificationCreate;
81
+ }
82
+
83
+ /**
84
+ *
85
+ */
86
+ export class NotificationsApi extends runtime.BaseAPI {
87
+
88
+ /**
89
+ * Returns all notifications relevant to the current user within the organization context. Includes global announcements, organization-scoped notifications, and user-specific notifications. Dismissed and expired notifications are excluded by default. Content supports markdown formatting and embedded links.
90
+ * List notifications for the current user
91
+ */
92
+ async organizationsOrganizationIdNotificationsGetRaw(requestParameters: OrganizationsOrganizationIdNotificationsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrganizationsOrganizationIdNotificationsGet200Response>> {
93
+ if (requestParameters['organizationId'] == null) {
94
+ throw new runtime.RequiredError(
95
+ 'organizationId',
96
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsGet().'
97
+ );
98
+ }
99
+
100
+ const queryParameters: any = {};
101
+
102
+ if (requestParameters['type'] != null) {
103
+ queryParameters['type'] = requestParameters['type'];
104
+ }
105
+
106
+ if (requestParameters['severity'] != null) {
107
+ queryParameters['severity'] = requestParameters['severity'];
108
+ }
109
+
110
+ if (requestParameters['scope'] != null) {
111
+ queryParameters['scope'] = requestParameters['scope'];
112
+ }
113
+
114
+ if (requestParameters['includeDismissed'] != null) {
115
+ queryParameters['include_dismissed'] = requestParameters['includeDismissed'];
116
+ }
117
+
118
+ if (requestParameters['includeExpired'] != null) {
119
+ queryParameters['include_expired'] = requestParameters['includeExpired'];
120
+ }
121
+
122
+ const headerParameters: runtime.HTTPHeaders = {};
123
+
124
+ if (this.configuration && this.configuration.accessToken) {
125
+ const token = this.configuration.accessToken;
126
+ const tokenString = await token("bearerAuth", []);
127
+
128
+ if (tokenString) {
129
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
130
+ }
131
+ }
132
+
133
+ let urlPath = `/organizations/{organizationId}/notifications`;
134
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
135
+
136
+ const response = await this.request({
137
+ path: urlPath,
138
+ method: 'GET',
139
+ headers: headerParameters,
140
+ query: queryParameters,
141
+ }, initOverrides);
142
+
143
+ return new runtime.JSONApiResponse(response, (jsonValue) => OrganizationsOrganizationIdNotificationsGet200ResponseFromJSON(jsonValue));
144
+ }
145
+
146
+ /**
147
+ * Returns all notifications relevant to the current user within the organization context. Includes global announcements, organization-scoped notifications, and user-specific notifications. Dismissed and expired notifications are excluded by default. Content supports markdown formatting and embedded links.
148
+ * List notifications for the current user
149
+ */
150
+ async organizationsOrganizationIdNotificationsGet(requestParameters: OrganizationsOrganizationIdNotificationsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrganizationsOrganizationIdNotificationsGet200Response> {
151
+ const response = await this.organizationsOrganizationIdNotificationsGetRaw(requestParameters, initOverrides);
152
+ return await response.value();
153
+ }
154
+
155
+ /**
156
+ * Delete a notification (admin only)
157
+ */
158
+ async organizationsOrganizationIdNotificationsNotificationIdDeleteRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
159
+ if (requestParameters['organizationId'] == null) {
160
+ throw new runtime.RequiredError(
161
+ 'organizationId',
162
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDelete().'
163
+ );
164
+ }
165
+
166
+ if (requestParameters['notificationId'] == null) {
167
+ throw new runtime.RequiredError(
168
+ 'notificationId',
169
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDelete().'
170
+ );
171
+ }
172
+
173
+ const queryParameters: any = {};
174
+
175
+ const headerParameters: runtime.HTTPHeaders = {};
176
+
177
+ if (this.configuration && this.configuration.accessToken) {
178
+ const token = this.configuration.accessToken;
179
+ const tokenString = await token("bearerAuth", []);
180
+
181
+ if (tokenString) {
182
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
183
+ }
184
+ }
185
+
186
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}`;
187
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
188
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
189
+
190
+ const response = await this.request({
191
+ path: urlPath,
192
+ method: 'DELETE',
193
+ headers: headerParameters,
194
+ query: queryParameters,
195
+ }, initOverrides);
196
+
197
+ return new runtime.VoidApiResponse(response);
198
+ }
199
+
200
+ /**
201
+ * Delete a notification (admin only)
202
+ */
203
+ async organizationsOrganizationIdNotificationsNotificationIdDelete(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
204
+ await this.organizationsOrganizationIdNotificationsNotificationIdDeleteRaw(requestParameters, initOverrides);
205
+ }
206
+
207
+ /**
208
+ * Dismisses the notification for the current user. Dismissed notifications are hidden by default.
209
+ * Dismiss a notification
210
+ */
211
+ async organizationsOrganizationIdNotificationsNotificationIdDismissPostRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDismissPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
212
+ if (requestParameters['organizationId'] == null) {
213
+ throw new runtime.RequiredError(
214
+ 'organizationId',
215
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDismissPost().'
216
+ );
217
+ }
218
+
219
+ if (requestParameters['notificationId'] == null) {
220
+ throw new runtime.RequiredError(
221
+ 'notificationId',
222
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdDismissPost().'
223
+ );
224
+ }
225
+
226
+ const queryParameters: any = {};
227
+
228
+ const headerParameters: runtime.HTTPHeaders = {};
229
+
230
+ if (this.configuration && this.configuration.accessToken) {
231
+ const token = this.configuration.accessToken;
232
+ const tokenString = await token("bearerAuth", []);
233
+
234
+ if (tokenString) {
235
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
236
+ }
237
+ }
238
+
239
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}/dismiss`;
240
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
241
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
242
+
243
+ const response = await this.request({
244
+ path: urlPath,
245
+ method: 'POST',
246
+ headers: headerParameters,
247
+ query: queryParameters,
248
+ }, initOverrides);
249
+
250
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
251
+ }
252
+
253
+ /**
254
+ * Dismisses the notification for the current user. Dismissed notifications are hidden by default.
255
+ * Dismiss a notification
256
+ */
257
+ async organizationsOrganizationIdNotificationsNotificationIdDismissPost(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdDismissPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
258
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdDismissPostRaw(requestParameters, initOverrides);
259
+ return await response.value();
260
+ }
261
+
262
+ /**
263
+ * Get a notification by ID
264
+ */
265
+ async organizationsOrganizationIdNotificationsNotificationIdGetRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
266
+ if (requestParameters['organizationId'] == null) {
267
+ throw new runtime.RequiredError(
268
+ 'organizationId',
269
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdGet().'
270
+ );
271
+ }
272
+
273
+ if (requestParameters['notificationId'] == null) {
274
+ throw new runtime.RequiredError(
275
+ 'notificationId',
276
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdGet().'
277
+ );
278
+ }
279
+
280
+ const queryParameters: any = {};
281
+
282
+ const headerParameters: runtime.HTTPHeaders = {};
283
+
284
+ if (this.configuration && this.configuration.accessToken) {
285
+ const token = this.configuration.accessToken;
286
+ const tokenString = await token("bearerAuth", []);
287
+
288
+ if (tokenString) {
289
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
290
+ }
291
+ }
292
+
293
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}`;
294
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
295
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
296
+
297
+ const response = await this.request({
298
+ path: urlPath,
299
+ method: 'GET',
300
+ headers: headerParameters,
301
+ query: queryParameters,
302
+ }, initOverrides);
303
+
304
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
305
+ }
306
+
307
+ /**
308
+ * Get a notification by ID
309
+ */
310
+ async organizationsOrganizationIdNotificationsNotificationIdGet(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
311
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdGetRaw(requestParameters, initOverrides);
312
+ return await response.value();
313
+ }
314
+
315
+ /**
316
+ * Partial update — only provided fields are modified. Content supports markdown.
317
+ * Update a notification (admin only)
318
+ */
319
+ async organizationsOrganizationIdNotificationsNotificationIdPutRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
320
+ if (requestParameters['organizationId'] == null) {
321
+ throw new runtime.RequiredError(
322
+ 'organizationId',
323
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdPut().'
324
+ );
325
+ }
326
+
327
+ if (requestParameters['notificationId'] == null) {
328
+ throw new runtime.RequiredError(
329
+ 'notificationId',
330
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdPut().'
331
+ );
332
+ }
333
+
334
+ if (requestParameters['notificationUpdate'] == null) {
335
+ throw new runtime.RequiredError(
336
+ 'notificationUpdate',
337
+ 'Required parameter "notificationUpdate" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdPut().'
338
+ );
339
+ }
340
+
341
+ const queryParameters: any = {};
342
+
343
+ const headerParameters: runtime.HTTPHeaders = {};
344
+
345
+ headerParameters['Content-Type'] = 'application/json';
346
+
347
+ if (this.configuration && this.configuration.accessToken) {
348
+ const token = this.configuration.accessToken;
349
+ const tokenString = await token("bearerAuth", []);
350
+
351
+ if (tokenString) {
352
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
353
+ }
354
+ }
355
+
356
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}`;
357
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
358
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
359
+
360
+ const response = await this.request({
361
+ path: urlPath,
362
+ method: 'PUT',
363
+ headers: headerParameters,
364
+ query: queryParameters,
365
+ body: NotificationUpdateToJSON(requestParameters['notificationUpdate']),
366
+ }, initOverrides);
367
+
368
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
369
+ }
370
+
371
+ /**
372
+ * Partial update — only provided fields are modified. Content supports markdown.
373
+ * Update a notification (admin only)
374
+ */
375
+ async organizationsOrganizationIdNotificationsNotificationIdPut(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
376
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdPutRaw(requestParameters, initOverrides);
377
+ return await response.value();
378
+ }
379
+
380
+ /**
381
+ * Marks the notification as read for the current user. Idempotent.
382
+ * Mark a notification as read
383
+ */
384
+ async organizationsOrganizationIdNotificationsNotificationIdReadPostRaw(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdReadPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
385
+ if (requestParameters['organizationId'] == null) {
386
+ throw new runtime.RequiredError(
387
+ 'organizationId',
388
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdReadPost().'
389
+ );
390
+ }
391
+
392
+ if (requestParameters['notificationId'] == null) {
393
+ throw new runtime.RequiredError(
394
+ 'notificationId',
395
+ 'Required parameter "notificationId" was null or undefined when calling organizationsOrganizationIdNotificationsNotificationIdReadPost().'
396
+ );
397
+ }
398
+
399
+ const queryParameters: any = {};
400
+
401
+ const headerParameters: runtime.HTTPHeaders = {};
402
+
403
+ if (this.configuration && this.configuration.accessToken) {
404
+ const token = this.configuration.accessToken;
405
+ const tokenString = await token("bearerAuth", []);
406
+
407
+ if (tokenString) {
408
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
409
+ }
410
+ }
411
+
412
+ let urlPath = `/organizations/{organizationId}/notifications/{notificationId}/read`;
413
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
414
+ urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId'])));
415
+
416
+ const response = await this.request({
417
+ path: urlPath,
418
+ method: 'POST',
419
+ headers: headerParameters,
420
+ query: queryParameters,
421
+ }, initOverrides);
422
+
423
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
424
+ }
425
+
426
+ /**
427
+ * Marks the notification as read for the current user. Idempotent.
428
+ * Mark a notification as read
429
+ */
430
+ async organizationsOrganizationIdNotificationsNotificationIdReadPost(requestParameters: OrganizationsOrganizationIdNotificationsNotificationIdReadPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
431
+ const response = await this.organizationsOrganizationIdNotificationsNotificationIdReadPostRaw(requestParameters, initOverrides);
432
+ return await response.value();
433
+ }
434
+
435
+ /**
436
+ * Create a new notification or announcement. Only organization admins can create notifications. Content supports markdown formatting and embedded links. Set scope to \'global\' for announcements visible to all users, \'organization\' for org members only, or \'user\' for a specific user.
437
+ * Create a notification (admin only)
438
+ */
439
+ async organizationsOrganizationIdNotificationsPostRaw(requestParameters: OrganizationsOrganizationIdNotificationsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
440
+ if (requestParameters['organizationId'] == null) {
441
+ throw new runtime.RequiredError(
442
+ 'organizationId',
443
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdNotificationsPost().'
444
+ );
445
+ }
446
+
447
+ if (requestParameters['notificationCreate'] == null) {
448
+ throw new runtime.RequiredError(
449
+ 'notificationCreate',
450
+ 'Required parameter "notificationCreate" was null or undefined when calling organizationsOrganizationIdNotificationsPost().'
451
+ );
452
+ }
453
+
454
+ const queryParameters: any = {};
455
+
456
+ const headerParameters: runtime.HTTPHeaders = {};
457
+
458
+ headerParameters['Content-Type'] = 'application/json';
459
+
460
+ if (this.configuration && this.configuration.accessToken) {
461
+ const token = this.configuration.accessToken;
462
+ const tokenString = await token("bearerAuth", []);
463
+
464
+ if (tokenString) {
465
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
466
+ }
467
+ }
468
+
469
+ let urlPath = `/organizations/{organizationId}/notifications`;
470
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
471
+
472
+ const response = await this.request({
473
+ path: urlPath,
474
+ method: 'POST',
475
+ headers: headerParameters,
476
+ query: queryParameters,
477
+ body: NotificationCreateToJSON(requestParameters['notificationCreate']),
478
+ }, initOverrides);
479
+
480
+ return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
481
+ }
482
+
483
+ /**
484
+ * Create a new notification or announcement. Only organization admins can create notifications. Content supports markdown formatting and embedded links. Set scope to \'global\' for announcements visible to all users, \'organization\' for org members only, or \'user\' for a specific user.
485
+ * Create a notification (admin only)
486
+ */
487
+ async organizationsOrganizationIdNotificationsPost(requestParameters: OrganizationsOrganizationIdNotificationsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
488
+ const response = await this.organizationsOrganizationIdNotificationsPostRaw(requestParameters, initOverrides);
489
+ return await response.value();
490
+ }
491
+
492
+ }
493
+
494
+ /**
495
+ * @export
496
+ */
497
+ export const OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum = {
498
+ True: 'true',
499
+ False: 'false'
500
+ } as const;
501
+ export type OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum = typeof OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum[keyof typeof OrganizationsOrganizationIdNotificationsGetIncludeDismissedEnum];
502
+ /**
503
+ * @export
504
+ */
505
+ export const OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum = {
506
+ True: 'true',
507
+ False: 'false'
508
+ } as const;
509
+ export type OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum = typeof OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum[keyof typeof OrganizationsOrganizationIdNotificationsGetIncludeExpiredEnum];
package/src/apis/index.ts CHANGED
@@ -8,6 +8,7 @@ export * from './HistoryApi';
8
8
  export * from './InvitationsApi';
9
9
  export * from './LLMProvidersApi';
10
10
  export * from './MembersApi';
11
+ export * from './NotificationsApi';
11
12
  export * from './OrganizationsApi';
12
13
  export * from './PlaygroundApi';
13
14
  export * from './RAGApi';
@@ -37,6 +37,12 @@ export interface Call {
37
37
  * @memberof Call
38
38
  */
39
39
  data?: { [key: string]: any; } | null;
40
+ /**
41
+ *
42
+ * @type {{ [key: string]: any; }}
43
+ * @memberof Call
44
+ */
45
+ metadata?: { [key: string]: any; } | null;
40
46
  /**
41
47
  *
42
48
  * @type {string}
@@ -79,6 +85,7 @@ export function CallFromJSONTyped(json: any, ignoreDiscriminator: boolean): Call
79
85
  'id': json['id'],
80
86
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
81
87
  'data': json['data'] == null ? undefined : json['data'],
88
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
82
89
  'caller': json['caller'] == null ? undefined : json['caller'],
83
90
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
84
91
  'created_at': (new Date(json['created_at'])),
@@ -99,9 +106,9 @@ export function CallToJSONTyped(value?: Call | null, ignoreDiscriminator: boolea
99
106
  'id': value['id'],
100
107
  'voice_agent_id': value['voice_agent_id'],
101
108
  'data': value['data'],
109
+ 'metadata': value['metadata'],
102
110
  'caller': value['caller'],
103
111
  'sandbox': value['sandbox'],
104
112
  'created_at': value['created_at'].toISOString(),
105
113
  };
106
114
  }
107
-
@@ -31,6 +31,12 @@ export interface CallCreate {
31
31
  * @memberof CallCreate
32
32
  */
33
33
  data?: { [key: string]: any; } | null;
34
+ /**
35
+ *
36
+ * @type {{ [key: string]: any; }}
37
+ * @memberof CallCreate
38
+ */
39
+ metadata?: { [key: string]: any; } | null;
34
40
  /**
35
41
  *
36
42
  * @type {string}
@@ -64,6 +70,7 @@ export function CallCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean)
64
70
 
65
71
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
66
72
  'data': json['data'] == null ? undefined : json['data'],
73
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
67
74
  'caller': json['caller'] == null ? undefined : json['caller'],
68
75
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
69
76
  };
@@ -82,8 +89,8 @@ export function CallCreateToJSONTyped(value?: CallCreate | null, ignoreDiscrimin
82
89
 
83
90
  'voice_agent_id': value['voice_agent_id'],
84
91
  'data': value['data'],
92
+ 'metadata': value['metadata'],
85
93
  'caller': value['caller'],
86
94
  'sandbox': value['sandbox'],
87
95
  };
88
96
  }
89
-
@@ -31,6 +31,12 @@ export interface CallUpdate {
31
31
  * @memberof CallUpdate
32
32
  */
33
33
  data?: { [key: string]: any; } | null;
34
+ /**
35
+ *
36
+ * @type {{ [key: string]: any; }}
37
+ * @memberof CallUpdate
38
+ */
39
+ metadata?: { [key: string]: any; } | null;
34
40
  /**
35
41
  *
36
42
  * @type {string}
@@ -64,6 +70,7 @@ export function CallUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean)
64
70
 
65
71
  'voice_agent_id': json['voice_agent_id'] == null ? undefined : json['voice_agent_id'],
66
72
  'data': json['data'] == null ? undefined : json['data'],
73
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
67
74
  'caller': json['caller'] == null ? undefined : json['caller'],
68
75
  'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
69
76
  };
@@ -82,8 +89,8 @@ export function CallUpdateToJSONTyped(value?: CallUpdate | null, ignoreDiscrimin
82
89
 
83
90
  'voice_agent_id': value['voice_agent_id'],
84
91
  'data': value['data'],
92
+ 'metadata': value['metadata'],
85
93
  'caller': value['caller'],
86
94
  'sandbox': value['sandbox'],
87
95
  };
88
96
  }
89
-