@l7mp/tivadar-ai-api-sdk 0.2.3 → 0.2.4

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 (46) hide show
  1. package/dist/api-client.d.ts +7 -1
  2. package/dist/api-client.js +6 -0
  3. package/dist/apis/ProfileApi.d.ts +41 -0
  4. package/dist/apis/ProfileApi.js +112 -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 +7 -1
  8. package/dist/esm/api-client.js +6 -0
  9. package/dist/esm/apis/ProfileApi.d.ts +41 -0
  10. package/dist/esm/apis/ProfileApi.js +108 -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/Notification.d.ts +22 -0
  14. package/dist/esm/models/Notification.js +8 -0
  15. package/dist/esm/models/NotificationCreate.d.ts +22 -0
  16. package/dist/esm/models/NotificationCreate.js +6 -0
  17. package/dist/esm/models/NotificationUpdate.d.ts +22 -0
  18. package/dist/esm/models/NotificationUpdate.js +6 -0
  19. package/dist/esm/models/UserPreferences.d.ts +38 -0
  20. package/dist/esm/models/UserPreferences.js +45 -0
  21. package/dist/esm/models/UserPreferencesUpdate.d.ts +32 -0
  22. package/dist/esm/models/UserPreferencesUpdate.js +41 -0
  23. package/dist/esm/models/index.d.ts +2 -0
  24. package/dist/esm/models/index.js +2 -0
  25. package/dist/models/Notification.d.ts +22 -0
  26. package/dist/models/Notification.js +8 -0
  27. package/dist/models/NotificationCreate.d.ts +22 -0
  28. package/dist/models/NotificationCreate.js +6 -0
  29. package/dist/models/NotificationUpdate.d.ts +22 -0
  30. package/dist/models/NotificationUpdate.js +6 -0
  31. package/dist/models/UserPreferences.d.ts +38 -0
  32. package/dist/models/UserPreferences.js +52 -0
  33. package/dist/models/UserPreferencesUpdate.d.ts +32 -0
  34. package/dist/models/UserPreferencesUpdate.js +48 -0
  35. package/dist/models/index.d.ts +2 -0
  36. package/dist/models/index.js +2 -0
  37. package/package.json +1 -1
  38. package/src/api-client.ts +13 -0
  39. package/src/apis/ProfileApi.ts +142 -0
  40. package/src/apis/index.ts +1 -0
  41. package/src/models/Notification.ts +25 -1
  42. package/src/models/NotificationCreate.ts +24 -1
  43. package/src/models/NotificationUpdate.ts +24 -1
  44. package/src/models/UserPreferences.ts +75 -0
  45. package/src/models/UserPreferencesUpdate.ts +66 -0
  46. package/src/models/index.ts +2 -0
@@ -0,0 +1,142 @@
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
+ UserPreferences,
19
+ UserPreferencesUpdate,
20
+ } from '../models/index';
21
+ import {
22
+ UserPreferencesFromJSON,
23
+ UserPreferencesToJSON,
24
+ UserPreferencesUpdateFromJSON,
25
+ UserPreferencesUpdateToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface OrganizationsOrganizationIdProfilePreferencesGetRequest {
29
+ organizationId: string;
30
+ }
31
+
32
+ export interface OrganizationsOrganizationIdProfilePreferencesPutRequest {
33
+ organizationId: string;
34
+ userPreferencesUpdate: UserPreferencesUpdate;
35
+ }
36
+
37
+ /**
38
+ *
39
+ */
40
+ export class ProfileApi extends runtime.BaseAPI {
41
+
42
+ /**
43
+ * Get current user preferences
44
+ */
45
+ async organizationsOrganizationIdProfilePreferencesGetRaw(requestParameters: OrganizationsOrganizationIdProfilePreferencesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserPreferences>> {
46
+ if (requestParameters['organizationId'] == null) {
47
+ throw new runtime.RequiredError(
48
+ 'organizationId',
49
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdProfilePreferencesGet().'
50
+ );
51
+ }
52
+
53
+ const queryParameters: any = {};
54
+
55
+ const headerParameters: runtime.HTTPHeaders = {};
56
+
57
+ if (this.configuration && this.configuration.accessToken) {
58
+ const token = this.configuration.accessToken;
59
+ const tokenString = await token("bearerAuth", []);
60
+
61
+ if (tokenString) {
62
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
63
+ }
64
+ }
65
+
66
+ let urlPath = `/organizations/{organizationId}/profile/preferences`;
67
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
68
+
69
+ const response = await this.request({
70
+ path: urlPath,
71
+ method: 'GET',
72
+ headers: headerParameters,
73
+ query: queryParameters,
74
+ }, initOverrides);
75
+
76
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserPreferencesFromJSON(jsonValue));
77
+ }
78
+
79
+ /**
80
+ * Get current user preferences
81
+ */
82
+ async organizationsOrganizationIdProfilePreferencesGet(requestParameters: OrganizationsOrganizationIdProfilePreferencesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserPreferences> {
83
+ const response = await this.organizationsOrganizationIdProfilePreferencesGetRaw(requestParameters, initOverrides);
84
+ return await response.value();
85
+ }
86
+
87
+ /**
88
+ * Update current user preferences
89
+ */
90
+ async organizationsOrganizationIdProfilePreferencesPutRaw(requestParameters: OrganizationsOrganizationIdProfilePreferencesPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserPreferences>> {
91
+ if (requestParameters['organizationId'] == null) {
92
+ throw new runtime.RequiredError(
93
+ 'organizationId',
94
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdProfilePreferencesPut().'
95
+ );
96
+ }
97
+
98
+ if (requestParameters['userPreferencesUpdate'] == null) {
99
+ throw new runtime.RequiredError(
100
+ 'userPreferencesUpdate',
101
+ 'Required parameter "userPreferencesUpdate" was null or undefined when calling organizationsOrganizationIdProfilePreferencesPut().'
102
+ );
103
+ }
104
+
105
+ const queryParameters: any = {};
106
+
107
+ const headerParameters: runtime.HTTPHeaders = {};
108
+
109
+ headerParameters['Content-Type'] = 'application/json';
110
+
111
+ if (this.configuration && this.configuration.accessToken) {
112
+ const token = this.configuration.accessToken;
113
+ const tokenString = await token("bearerAuth", []);
114
+
115
+ if (tokenString) {
116
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
117
+ }
118
+ }
119
+
120
+ let urlPath = `/organizations/{organizationId}/profile/preferences`;
121
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
122
+
123
+ const response = await this.request({
124
+ path: urlPath,
125
+ method: 'PUT',
126
+ headers: headerParameters,
127
+ query: queryParameters,
128
+ body: UserPreferencesUpdateToJSON(requestParameters['userPreferencesUpdate']),
129
+ }, initOverrides);
130
+
131
+ return new runtime.JSONApiResponse(response, (jsonValue) => UserPreferencesFromJSON(jsonValue));
132
+ }
133
+
134
+ /**
135
+ * Update current user preferences
136
+ */
137
+ async organizationsOrganizationIdProfilePreferencesPut(requestParameters: OrganizationsOrganizationIdProfilePreferencesPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserPreferences> {
138
+ const response = await this.organizationsOrganizationIdProfilePreferencesPutRaw(requestParameters, initOverrides);
139
+ return await response.value();
140
+ }
141
+
142
+ }
package/src/apis/index.ts CHANGED
@@ -11,6 +11,7 @@ export * from './MembersApi';
11
11
  export * from './NotificationsApi';
12
12
  export * from './OrganizationsApi';
13
13
  export * from './PlaygroundApi';
14
+ export * from './ProfileApi';
14
15
  export * from './RAGApi';
15
16
  export * from './RecordingsApi';
16
17
  export * from './SIPApi';
@@ -114,6 +114,24 @@ export interface Notification {
114
114
  * @memberof Notification
115
115
  */
116
116
  expires_at?: Date | null;
117
+ /**
118
+ * Whether an email should also be sent to recipients
119
+ * @type {boolean}
120
+ * @memberof Notification
121
+ */
122
+ send_email: boolean;
123
+ /**
124
+ * Localized notification title/content variants keyed by language tag (for example en, en-US, hu-HU)
125
+ * @type {{ [key: string]: { [key: string]: any; }; }}
126
+ * @memberof Notification
127
+ */
128
+ localized_content?: { [key: string]: { [key: string]: any; }; } | null;
129
+ /**
130
+ * Fallback language key to use when recipient preferred language translation is missing
131
+ * @type {string}
132
+ * @memberof Notification
133
+ */
134
+ default_language?: string | null;
117
135
  /**
118
136
  *
119
137
  * @type {Date}
@@ -153,6 +171,7 @@ export function instanceOfNotification(value: object): value is Notification {
153
171
  if (!('scope' in value) || value['scope'] === undefined) return false;
154
172
  if (!('title' in value) || value['title'] === undefined) return false;
155
173
  if (!('content' in value) || value['content'] === undefined) return false;
174
+ if (!('send_email' in value) || value['send_email'] === undefined) return false;
156
175
  if (!('created_at' in value) || value['created_at'] === undefined) return false;
157
176
  if (!('updated_at' in value) || value['updated_at'] === undefined) return false;
158
177
  return true;
@@ -179,6 +198,9 @@ export function NotificationFromJSONTyped(json: any, ignoreDiscriminator: boolea
179
198
  'user_id': json['user_id'] == null ? undefined : json['user_id'],
180
199
  'created_by': json['created_by'] == null ? undefined : json['created_by'],
181
200
  'expires_at': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
201
+ 'send_email': json['send_email'],
202
+ 'localized_content': json['localized_content'] == null ? undefined : json['localized_content'],
203
+ 'default_language': json['default_language'] == null ? undefined : json['default_language'],
182
204
  'created_at': (new Date(json['created_at'])),
183
205
  'updated_at': (new Date(json['updated_at'])),
184
206
  'read_at': json['read_at'] == null ? undefined : (new Date(json['read_at'])),
@@ -208,10 +230,12 @@ export function NotificationToJSONTyped(value?: Notification | null, ignoreDiscr
208
230
  'user_id': value['user_id'],
209
231
  'created_by': value['created_by'],
210
232
  'expires_at': value['expires_at'] == null ? value['expires_at'] : value['expires_at'].toISOString(),
233
+ 'send_email': value['send_email'],
234
+ 'localized_content': value['localized_content'],
235
+ 'default_language': value['default_language'],
211
236
  'created_at': value['created_at'].toISOString(),
212
237
  'updated_at': value['updated_at'].toISOString(),
213
238
  'read_at': value['read_at'] == null ? value['read_at'] : value['read_at'].toISOString(),
214
239
  'dismissed_at': value['dismissed_at'] == null ? value['dismissed_at'] : value['dismissed_at'].toISOString(),
215
240
  };
216
241
  }
217
-
@@ -96,6 +96,24 @@ export interface NotificationCreate {
96
96
  * @memberof NotificationCreate
97
97
  */
98
98
  expires_at?: Date | null;
99
+ /**
100
+ *
101
+ * @type {boolean}
102
+ * @memberof NotificationCreate
103
+ */
104
+ send_email?: boolean;
105
+ /**
106
+ *
107
+ * @type {{ [key: string]: { [key: string]: any; }; }}
108
+ * @memberof NotificationCreate
109
+ */
110
+ localized_content?: { [key: string]: { [key: string]: any; }; } | null;
111
+ /**
112
+ *
113
+ * @type {string}
114
+ * @memberof NotificationCreate
115
+ */
116
+ default_language?: string | null;
99
117
  }
100
118
 
101
119
 
@@ -127,6 +145,9 @@ export function NotificationCreateFromJSONTyped(json: any, ignoreDiscriminator:
127
145
  'content': json['content'],
128
146
  'user_id': json['user_id'] == null ? undefined : json['user_id'],
129
147
  'expires_at': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
148
+ 'send_email': json['send_email'] == null ? undefined : json['send_email'],
149
+ 'localized_content': json['localized_content'] == null ? undefined : json['localized_content'],
150
+ 'default_language': json['default_language'] == null ? undefined : json['default_language'],
130
151
  };
131
152
  }
132
153
 
@@ -149,6 +170,8 @@ export function NotificationCreateToJSONTyped(value?: NotificationCreate | null,
149
170
  'content': value['content'],
150
171
  'user_id': value['user_id'],
151
172
  'expires_at': value['expires_at'] == null ? value['expires_at'] : value['expires_at'].toISOString(),
173
+ 'send_email': value['send_email'],
174
+ 'localized_content': value['localized_content'],
175
+ 'default_language': value['default_language'],
152
176
  };
153
177
  }
154
-
@@ -64,6 +64,24 @@ export interface NotificationUpdate {
64
64
  * @memberof NotificationUpdate
65
65
  */
66
66
  expires_at?: Date | null;
67
+ /**
68
+ *
69
+ * @type {boolean}
70
+ * @memberof NotificationUpdate
71
+ */
72
+ send_email?: boolean;
73
+ /**
74
+ *
75
+ * @type {{ [key: string]: { [key: string]: any; }; }}
76
+ * @memberof NotificationUpdate
77
+ */
78
+ localized_content?: { [key: string]: { [key: string]: any; }; } | null;
79
+ /**
80
+ *
81
+ * @type {string}
82
+ * @memberof NotificationUpdate
83
+ */
84
+ default_language?: string | null;
67
85
  }
68
86
 
69
87
 
@@ -90,6 +108,9 @@ export function NotificationUpdateFromJSONTyped(json: any, ignoreDiscriminator:
90
108
  'title': json['title'] == null ? undefined : json['title'],
91
109
  'content': json['content'] == null ? undefined : json['content'],
92
110
  'expires_at': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
111
+ 'send_email': json['send_email'] == null ? undefined : json['send_email'],
112
+ 'localized_content': json['localized_content'] == null ? undefined : json['localized_content'],
113
+ 'default_language': json['default_language'] == null ? undefined : json['default_language'],
93
114
  };
94
115
  }
95
116
 
@@ -109,6 +130,8 @@ export function NotificationUpdateToJSONTyped(value?: NotificationUpdate | null,
109
130
  'title': value['title'],
110
131
  'content': value['content'],
111
132
  'expires_at': value['expires_at'] == null ? value['expires_at'] : value['expires_at'].toISOString(),
133
+ 'send_email': value['send_email'],
134
+ 'localized_content': value['localized_content'],
135
+ 'default_language': value['default_language'],
112
136
  };
113
137
  }
114
-
@@ -0,0 +1,75 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface UserPreferences
20
+ */
21
+ export interface UserPreferences {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof UserPreferences
26
+ */
27
+ user_id: string;
28
+ /**
29
+ * User preferred locale in BCP-47 format (for example en, en-US, hu-HU)
30
+ * @type {string}
31
+ * @memberof UserPreferences
32
+ */
33
+ preferred_language?: string | null;
34
+ }
35
+
36
+
37
+
38
+ /**
39
+ * Check if a given object implements the UserPreferences interface.
40
+ */
41
+ export function instanceOfUserPreferences(value: object): value is UserPreferences {
42
+ if (!('user_id' in value) || value['user_id'] === undefined) return false;
43
+ return true;
44
+ }
45
+
46
+ export function UserPreferencesFromJSON(json: any): UserPreferences {
47
+ return UserPreferencesFromJSONTyped(json, false);
48
+ }
49
+
50
+ export function UserPreferencesFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPreferences {
51
+ if (json == null) {
52
+ return json;
53
+ }
54
+ return {
55
+
56
+ 'user_id': json['user_id'],
57
+ 'preferred_language': json['preferred_language'] == null ? undefined : json['preferred_language'],
58
+ };
59
+ }
60
+
61
+ export function UserPreferencesToJSON(json: any): UserPreferences {
62
+ return UserPreferencesToJSONTyped(json, false);
63
+ }
64
+
65
+ export function UserPreferencesToJSONTyped(value?: UserPreferences | null, ignoreDiscriminator: boolean = false): any {
66
+ if (value == null) {
67
+ return value;
68
+ }
69
+
70
+ return {
71
+
72
+ 'user_id': value['user_id'],
73
+ 'preferred_language': value['preferred_language'],
74
+ };
75
+ }
@@ -0,0 +1,66 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface UserPreferencesUpdate
20
+ */
21
+ export interface UserPreferencesUpdate {
22
+ /**
23
+ * User preferred locale in BCP-47 format, or null to unset
24
+ * @type {string}
25
+ * @memberof UserPreferencesUpdate
26
+ */
27
+ preferred_language?: string | null;
28
+ }
29
+
30
+
31
+
32
+ /**
33
+ * Check if a given object implements the UserPreferencesUpdate interface.
34
+ */
35
+ export function instanceOfUserPreferencesUpdate(value: object): value is UserPreferencesUpdate {
36
+ return true;
37
+ }
38
+
39
+ export function UserPreferencesUpdateFromJSON(json: any): UserPreferencesUpdate {
40
+ return UserPreferencesUpdateFromJSONTyped(json, false);
41
+ }
42
+
43
+ export function UserPreferencesUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPreferencesUpdate {
44
+ if (json == null) {
45
+ return json;
46
+ }
47
+ return {
48
+
49
+ 'preferred_language': json['preferred_language'] == null ? undefined : json['preferred_language'],
50
+ };
51
+ }
52
+
53
+ export function UserPreferencesUpdateToJSON(json: any): UserPreferencesUpdate {
54
+ return UserPreferencesUpdateToJSONTyped(json, false);
55
+ }
56
+
57
+ export function UserPreferencesUpdateToJSONTyped(value?: UserPreferencesUpdate | null, ignoreDiscriminator: boolean = false): any {
58
+ if (value == null) {
59
+ return value;
60
+ }
61
+
62
+ return {
63
+
64
+ 'preferred_language': value['preferred_language'],
65
+ };
66
+ }
@@ -85,6 +85,8 @@ export * from './TtsProviderVoice';
85
85
  export * from './UnpauseSubscriptionResponse';
86
86
  export * from './UpdatePlanRequest';
87
87
  export * from './UpdatePlanResponse';
88
+ export * from './UserPreferences';
89
+ export * from './UserPreferencesUpdate';
88
90
  export * from './VoiceAgent';
89
91
  export * from './VoiceAgentCreate';
90
92
  export * from './VoiceAgentMetadata';