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

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.
@@ -99,6 +99,7 @@ export declare class Api {
99
99
  listTrunks: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksGet"]>;
100
100
  createTrunk: (organizationId: string, sipTrunkCreate: SipTrunkCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksPost"]>;
101
101
  deleteTrunk: (organizationId: string, trunkId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksTrunkIdDelete"]>;
102
+ assignPhoneNumber: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipPhoneNumbersAssignPost"]>;
102
103
  createDispatchRule: (organizationId: string, dispatchRuleCreate: DispatchRuleCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesPost"]>;
103
104
  deleteDispatchRule: (organizationId: string, dispatchId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesDispatchIdDelete"]>;
104
105
  listPhoneNumbers: (includeAssigned?: boolean, options?: RequestInit) => ReturnType<SIPApi["phoneNumbersGet"]>;
@@ -143,6 +143,7 @@ class Api {
143
143
  listTrunks: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipTrunksGet({ organizationId }, options),
144
144
  createTrunk: (organizationId, sipTrunkCreate, options) => this.sipApi.organizationsOrganizationIdSipTrunksPost({ organizationId, sipTrunkCreate }, options),
145
145
  deleteTrunk: (organizationId, trunkId, options) => this.sipApi.organizationsOrganizationIdSipTrunksTrunkIdDelete({ organizationId, trunkId }, options),
146
+ assignPhoneNumber: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipPhoneNumbersAssignPost({ organizationId }, options),
146
147
  createDispatchRule: (organizationId, dispatchRuleCreate, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesPost({ organizationId, dispatchRuleCreate }, options),
147
148
  deleteDispatchRule: (organizationId, dispatchId, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesDispatchIdDelete({ organizationId, dispatchId }, options),
148
149
  listPhoneNumbers: (includeAssigned, options) => this.sipApi.phoneNumbersGet({ includeAssigned }, options),
@@ -19,6 +19,9 @@ export interface OrganizationsOrganizationIdSipDispatchRulesPostRequest {
19
19
  organizationId: string;
20
20
  dispatchRuleCreate: DispatchRuleCreate;
21
21
  }
22
+ export interface OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest {
23
+ organizationId: string;
24
+ }
22
25
  export interface OrganizationsOrganizationIdSipTrunksGetRequest {
23
26
  organizationId: string;
24
27
  }
@@ -59,6 +62,16 @@ export declare class SIPApi extends runtime.BaseAPI {
59
62
  * Create a dispatch rule (assign agent to trunk)
60
63
  */
61
64
  organizationsOrganizationIdSipDispatchRulesPost(requestParameters: OrganizationsOrganizationIdSipDispatchRulesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrganizationsOrganizationIdSipDispatchRulesPost200Response>;
65
+ /**
66
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
67
+ * Assign an available phone number to the organization
68
+ */
69
+ organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SipTrunkWithAgent>>;
70
+ /**
71
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
72
+ * Assign an available phone number to the organization
73
+ */
74
+ organizationsOrganizationIdSipPhoneNumbersAssignPost(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SipTrunkWithAgent>;
62
75
  /**
63
76
  * List all SIP trunks for an organization
64
77
  */
@@ -111,6 +111,45 @@ class SIPApi extends runtime.BaseAPI {
111
111
  return yield response.value();
112
112
  });
113
113
  }
114
+ /**
115
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
116
+ * Assign an available phone number to the organization
117
+ */
118
+ organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters, initOverrides) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ if (requestParameters['organizationId'] == null) {
121
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersAssignPost().');
122
+ }
123
+ const queryParameters = {};
124
+ const headerParameters = {};
125
+ if (this.configuration && this.configuration.accessToken) {
126
+ const token = this.configuration.accessToken;
127
+ const tokenString = yield token("bearerAuth", []);
128
+ if (tokenString) {
129
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
130
+ }
131
+ }
132
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/assign`;
133
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
134
+ const response = yield this.request({
135
+ path: urlPath,
136
+ method: 'POST',
137
+ headers: headerParameters,
138
+ query: queryParameters,
139
+ }, initOverrides);
140
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SipTrunkWithAgentFromJSON)(jsonValue));
141
+ });
142
+ }
143
+ /**
144
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
145
+ * Assign an available phone number to the organization
146
+ */
147
+ organizationsOrganizationIdSipPhoneNumbersAssignPost(requestParameters, initOverrides) {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ const response = yield this.organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters, initOverrides);
150
+ return yield response.value();
151
+ });
152
+ }
114
153
  /**
115
154
  * List all SIP trunks for an organization
116
155
  */
@@ -99,6 +99,7 @@ export declare class Api {
99
99
  listTrunks: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksGet"]>;
100
100
  createTrunk: (organizationId: string, sipTrunkCreate: SipTrunkCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksPost"]>;
101
101
  deleteTrunk: (organizationId: string, trunkId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksTrunkIdDelete"]>;
102
+ assignPhoneNumber: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipPhoneNumbersAssignPost"]>;
102
103
  createDispatchRule: (organizationId: string, dispatchRuleCreate: DispatchRuleCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesPost"]>;
103
104
  deleteDispatchRule: (organizationId: string, dispatchId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesDispatchIdDelete"]>;
104
105
  listPhoneNumbers: (includeAssigned?: boolean, options?: RequestInit) => ReturnType<SIPApi["phoneNumbersGet"]>;
@@ -140,6 +140,7 @@ export class Api {
140
140
  listTrunks: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipTrunksGet({ organizationId }, options),
141
141
  createTrunk: (organizationId, sipTrunkCreate, options) => this.sipApi.organizationsOrganizationIdSipTrunksPost({ organizationId, sipTrunkCreate }, options),
142
142
  deleteTrunk: (organizationId, trunkId, options) => this.sipApi.organizationsOrganizationIdSipTrunksTrunkIdDelete({ organizationId, trunkId }, options),
143
+ assignPhoneNumber: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipPhoneNumbersAssignPost({ organizationId }, options),
143
144
  createDispatchRule: (organizationId, dispatchRuleCreate, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesPost({ organizationId, dispatchRuleCreate }, options),
144
145
  deleteDispatchRule: (organizationId, dispatchId, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesDispatchIdDelete({ organizationId, dispatchId }, options),
145
146
  listPhoneNumbers: (includeAssigned, options) => this.sipApi.phoneNumbersGet({ includeAssigned }, options),
@@ -19,6 +19,9 @@ export interface OrganizationsOrganizationIdSipDispatchRulesPostRequest {
19
19
  organizationId: string;
20
20
  dispatchRuleCreate: DispatchRuleCreate;
21
21
  }
22
+ export interface OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest {
23
+ organizationId: string;
24
+ }
22
25
  export interface OrganizationsOrganizationIdSipTrunksGetRequest {
23
26
  organizationId: string;
24
27
  }
@@ -59,6 +62,16 @@ export declare class SIPApi extends runtime.BaseAPI {
59
62
  * Create a dispatch rule (assign agent to trunk)
60
63
  */
61
64
  organizationsOrganizationIdSipDispatchRulesPost(requestParameters: OrganizationsOrganizationIdSipDispatchRulesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrganizationsOrganizationIdSipDispatchRulesPost200Response>;
65
+ /**
66
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
67
+ * Assign an available phone number to the organization
68
+ */
69
+ organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SipTrunkWithAgent>>;
70
+ /**
71
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
72
+ * Assign an available phone number to the organization
73
+ */
74
+ organizationsOrganizationIdSipPhoneNumbersAssignPost(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SipTrunkWithAgent>;
62
75
  /**
63
76
  * List all SIP trunks for an organization
64
77
  */
@@ -108,6 +108,45 @@ export class SIPApi extends runtime.BaseAPI {
108
108
  return yield response.value();
109
109
  });
110
110
  }
111
+ /**
112
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
113
+ * Assign an available phone number to the organization
114
+ */
115
+ organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters, initOverrides) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ if (requestParameters['organizationId'] == null) {
118
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersAssignPost().');
119
+ }
120
+ const queryParameters = {};
121
+ const headerParameters = {};
122
+ if (this.configuration && this.configuration.accessToken) {
123
+ const token = this.configuration.accessToken;
124
+ const tokenString = yield token("bearerAuth", []);
125
+ if (tokenString) {
126
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
127
+ }
128
+ }
129
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/assign`;
130
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
131
+ const response = yield this.request({
132
+ path: urlPath,
133
+ method: 'POST',
134
+ headers: headerParameters,
135
+ query: queryParameters,
136
+ }, initOverrides);
137
+ return new runtime.JSONApiResponse(response, (jsonValue) => SipTrunkWithAgentFromJSON(jsonValue));
138
+ });
139
+ }
140
+ /**
141
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
142
+ * Assign an available phone number to the organization
143
+ */
144
+ organizationsOrganizationIdSipPhoneNumbersAssignPost(requestParameters, initOverrides) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ const response = yield this.organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters, initOverrides);
147
+ return yield response.value();
148
+ });
149
+ }
111
150
  /**
112
151
  * List all SIP trunks for an organization
113
152
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l7mp/tivadar-ai-api-sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "TypeScript/JavaScript SDK for Tivadar AI Backend API",
5
5
  "author": "L7mp Technologies",
6
6
  "repository": {
package/src/api-client.ts CHANGED
@@ -127,6 +127,7 @@ export class Api {
127
127
  listTrunks: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksGet"]>;
128
128
  createTrunk: (organizationId: string, sipTrunkCreate: SipTrunkCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksPost"]>;
129
129
  deleteTrunk: (organizationId: string, trunkId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipTrunksTrunkIdDelete"]>;
130
+ assignPhoneNumber: (organizationId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipPhoneNumbersAssignPost"]>;
130
131
  createDispatchRule: (organizationId: string, dispatchRuleCreate: DispatchRuleCreate, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesPost"]>;
131
132
  deleteDispatchRule: (organizationId: string, dispatchId: string, options?: RequestInit) => ReturnType<SIPApi["organizationsOrganizationIdSipDispatchRulesDispatchIdDelete"]>;
132
133
  listPhoneNumbers: (includeAssigned?: boolean, options?: RequestInit) => ReturnType<SIPApi["phoneNumbersGet"]>;
@@ -305,6 +306,7 @@ export class Api {
305
306
  listTrunks: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipTrunksGet({ organizationId }, options),
306
307
  createTrunk: (organizationId, sipTrunkCreate, options) => this.sipApi.organizationsOrganizationIdSipTrunksPost({ organizationId, sipTrunkCreate }, options),
307
308
  deleteTrunk: (organizationId, trunkId, options) => this.sipApi.organizationsOrganizationIdSipTrunksTrunkIdDelete({ organizationId, trunkId }, options),
309
+ assignPhoneNumber: (organizationId, options) => this.sipApi.organizationsOrganizationIdSipPhoneNumbersAssignPost({ organizationId }, options),
308
310
  createDispatchRule: (organizationId, dispatchRuleCreate, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesPost({ organizationId, dispatchRuleCreate }, options),
309
311
  deleteDispatchRule: (organizationId, dispatchId, options) => this.sipApi.organizationsOrganizationIdSipDispatchRulesDispatchIdDelete({ organizationId, dispatchId }, options),
310
312
  listPhoneNumbers: (includeAssigned, options) => this.sipApi.phoneNumbersGet({ includeAssigned }, options),
@@ -47,6 +47,10 @@ export interface OrganizationsOrganizationIdSipDispatchRulesPostRequest {
47
47
  dispatchRuleCreate: DispatchRuleCreate;
48
48
  }
49
49
 
50
+ export interface OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest {
51
+ organizationId: string;
52
+ }
53
+
50
54
  export interface OrganizationsOrganizationIdSipTrunksGetRequest {
51
55
  organizationId: string;
52
56
  }
@@ -185,6 +189,53 @@ export class SIPApi extends runtime.BaseAPI {
185
189
  return await response.value();
186
190
  }
187
191
 
192
+ /**
193
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
194
+ * Assign an available phone number to the organization
195
+ */
196
+ async organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SipTrunkWithAgent>> {
197
+ if (requestParameters['organizationId'] == null) {
198
+ throw new runtime.RequiredError(
199
+ 'organizationId',
200
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersAssignPost().'
201
+ );
202
+ }
203
+
204
+ const queryParameters: any = {};
205
+
206
+ const headerParameters: runtime.HTTPHeaders = {};
207
+
208
+ if (this.configuration && this.configuration.accessToken) {
209
+ const token = this.configuration.accessToken;
210
+ const tokenString = await token("bearerAuth", []);
211
+
212
+ if (tokenString) {
213
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
214
+ }
215
+ }
216
+
217
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/assign`;
218
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
219
+
220
+ const response = await this.request({
221
+ path: urlPath,
222
+ method: 'POST',
223
+ headers: headerParameters,
224
+ query: queryParameters,
225
+ }, initOverrides);
226
+
227
+ return new runtime.JSONApiResponse(response, (jsonValue) => SipTrunkWithAgentFromJSON(jsonValue));
228
+ }
229
+
230
+ /**
231
+ * Automatically picks the first available (unassigned) phone number from the pool, creates a SIP trunk, and assigns it to the organization.
232
+ * Assign an available phone number to the organization
233
+ */
234
+ async organizationsOrganizationIdSipPhoneNumbersAssignPost(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SipTrunkWithAgent> {
235
+ const response = await this.organizationsOrganizationIdSipPhoneNumbersAssignPostRaw(requestParameters, initOverrides);
236
+ return await response.value();
237
+ }
238
+
188
239
  /**
189
240
  * List all SIP trunks for an organization
190
241
  */