@l7mp/tivadar-ai-api-sdk 0.2.10 → 0.2.11
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.
- package/dist/api-client.d.ts +29 -4
- package/dist/api-client.js +22 -3
- package/dist/apis/AdminSubscriptionsApi.d.ts +82 -0
- package/dist/apis/AdminSubscriptionsApi.js +242 -0
- package/dist/apis/SubscriptionApi.d.ts +54 -75
- package/dist/apis/SubscriptionApi.js +95 -114
- package/dist/apis/VoiceUsageApi.d.ts +31 -0
- package/dist/apis/VoiceUsageApi.js +73 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +2 -0
- package/dist/esm/api-client.d.ts +29 -4
- package/dist/esm/api-client.js +22 -3
- package/dist/esm/apis/AdminSubscriptionsApi.d.ts +82 -0
- package/dist/esm/apis/AdminSubscriptionsApi.js +238 -0
- package/dist/esm/apis/SubscriptionApi.d.ts +54 -75
- package/dist/esm/apis/SubscriptionApi.js +96 -115
- package/dist/esm/apis/VoiceUsageApi.d.ts +31 -0
- package/dist/esm/apis/VoiceUsageApi.js +69 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +2 -0
- package/dist/esm/models/AdminGrantMinutesRequest.d.ts +38 -0
- package/dist/esm/models/AdminGrantMinutesRequest.js +45 -0
- package/dist/esm/models/AdminSetSubscriptionRequest.d.ts +86 -0
- package/dist/esm/models/AdminSetSubscriptionRequest.js +71 -0
- package/dist/esm/models/BillingPortalRequest.d.ts +1 -1
- package/dist/esm/models/BillingPortalResponse.d.ts +1 -1
- package/dist/esm/models/CancelSubscriptionRequest.d.ts +2 -2
- package/dist/esm/models/CheckoutSessionResponse.d.ts +2 -2
- package/dist/esm/models/CreateCheckoutSessionRequest.d.ts +21 -7
- package/dist/esm/models/CreateCheckoutSessionRequest.js +18 -5
- package/dist/esm/models/CurrentPeriodUsage.d.ts +59 -0
- package/dist/esm/models/CurrentPeriodUsage.js +62 -0
- package/dist/esm/models/LifecycleResponse.d.ts +50 -0
- package/dist/esm/models/LifecycleResponse.js +51 -0
- package/dist/esm/models/PauseSubscriptionRequest.d.ts +1 -1
- package/dist/esm/models/PlanCatalogEntry.d.ts +90 -0
- package/dist/esm/models/PlanCatalogEntry.js +73 -0
- package/dist/esm/models/PlanCatalogEntryOverageInner.d.ts +44 -0
- package/dist/esm/models/PlanCatalogEntryOverageInner.js +45 -0
- package/dist/esm/models/PlanCatalogPrice.d.ts +58 -0
- package/dist/esm/models/PlanCatalogPrice.js +60 -0
- package/dist/esm/models/SubscriptionPlanSummary.d.ts +83 -0
- package/dist/esm/models/SubscriptionPlanSummary.js +70 -0
- package/dist/esm/models/SubscriptionPlanSummaryOverageRate.d.ts +38 -0
- package/dist/esm/models/SubscriptionPlanSummaryOverageRate.js +43 -0
- package/dist/esm/models/SubscriptionStatus.d.ts +103 -10
- package/dist/esm/models/SubscriptionStatus.js +58 -9
- package/dist/esm/models/SubscriptionUsageSummary.d.ts +56 -0
- package/dist/esm/models/SubscriptionUsageSummary.js +57 -0
- package/dist/esm/models/UpdatePlanRequest.d.ts +13 -5
- package/dist/esm/models/UpdatePlanRequest.js +12 -3
- package/dist/esm/models/UsageBreakdownByAgent.d.ts +44 -0
- package/dist/esm/models/UsageBreakdownByAgent.js +49 -0
- package/dist/esm/models/UsageBreakdownByDay.d.ts +44 -0
- package/dist/esm/models/UsageBreakdownByDay.js +51 -0
- package/dist/esm/models/UsageHistoryResponse.d.ts +39 -0
- package/dist/esm/models/UsageHistoryResponse.js +48 -0
- package/dist/esm/models/UsageRecordDto.d.ts +80 -0
- package/dist/esm/models/UsageRecordDto.js +65 -0
- package/dist/esm/models/VoiceUsageReportRequest.d.ts +62 -0
- package/dist/esm/models/VoiceUsageReportRequest.js +57 -0
- package/dist/esm/models/VoiceUsageReportResponse.d.ts +51 -0
- package/dist/esm/models/VoiceUsageReportResponse.js +52 -0
- package/dist/esm/models/index.d.ts +16 -13
- package/dist/esm/models/index.js +16 -13
- package/dist/models/AdminGrantMinutesRequest.d.ts +38 -0
- package/dist/models/AdminGrantMinutesRequest.js +52 -0
- package/dist/models/AdminSetSubscriptionRequest.d.ts +86 -0
- package/dist/models/AdminSetSubscriptionRequest.js +79 -0
- package/dist/models/BillingPortalRequest.d.ts +1 -1
- package/dist/models/BillingPortalResponse.d.ts +1 -1
- package/dist/models/CancelSubscriptionRequest.d.ts +2 -2
- package/dist/models/CheckoutSessionResponse.d.ts +2 -2
- package/dist/models/CreateCheckoutSessionRequest.d.ts +21 -7
- package/dist/models/CreateCheckoutSessionRequest.js +19 -5
- package/dist/models/CurrentPeriodUsage.d.ts +59 -0
- package/dist/models/CurrentPeriodUsage.js +69 -0
- package/dist/models/LifecycleResponse.d.ts +50 -0
- package/dist/models/LifecycleResponse.js +58 -0
- package/dist/models/PauseSubscriptionRequest.d.ts +1 -1
- package/dist/models/PlanCatalogEntry.d.ts +90 -0
- package/dist/models/PlanCatalogEntry.js +80 -0
- package/dist/models/PlanCatalogEntryOverageInner.d.ts +44 -0
- package/dist/models/PlanCatalogEntryOverageInner.js +52 -0
- package/dist/models/PlanCatalogPrice.d.ts +58 -0
- package/dist/models/PlanCatalogPrice.js +68 -0
- package/dist/models/SubscriptionPlanSummary.d.ts +83 -0
- package/dist/models/SubscriptionPlanSummary.js +77 -0
- package/dist/models/SubscriptionPlanSummaryOverageRate.d.ts +38 -0
- package/dist/models/SubscriptionPlanSummaryOverageRate.js +50 -0
- package/dist/models/SubscriptionStatus.d.ts +103 -10
- package/dist/models/SubscriptionStatus.js +59 -9
- package/dist/models/SubscriptionUsageSummary.d.ts +56 -0
- package/dist/models/SubscriptionUsageSummary.js +64 -0
- package/dist/models/UpdatePlanRequest.d.ts +13 -5
- package/dist/models/UpdatePlanRequest.js +13 -3
- package/dist/models/UsageBreakdownByAgent.d.ts +44 -0
- package/dist/models/UsageBreakdownByAgent.js +56 -0
- package/dist/models/UsageBreakdownByDay.d.ts +44 -0
- package/dist/models/UsageBreakdownByDay.js +58 -0
- package/dist/models/UsageHistoryResponse.d.ts +39 -0
- package/dist/models/UsageHistoryResponse.js +55 -0
- package/dist/models/UsageRecordDto.d.ts +80 -0
- package/dist/models/UsageRecordDto.js +72 -0
- package/dist/models/VoiceUsageReportRequest.d.ts +62 -0
- package/dist/models/VoiceUsageReportRequest.js +64 -0
- package/dist/models/VoiceUsageReportResponse.d.ts +51 -0
- package/dist/models/VoiceUsageReportResponse.js +59 -0
- package/dist/models/index.d.ts +16 -13
- package/dist/models/index.js +16 -13
- package/package.json +1 -1
- package/src/api-client.ts +42 -6
- package/src/apis/AdminSubscriptionsApi.ts +327 -0
- package/src/apis/SubscriptionApi.ts +130 -162
- package/src/apis/VoiceUsageApi.ts +86 -0
- package/src/apis/index.ts +2 -0
- package/src/models/AdminGrantMinutesRequest.ts +74 -0
- package/src/models/AdminSetSubscriptionRequest.ts +136 -0
- package/src/models/BillingPortalRequest.ts +1 -1
- package/src/models/BillingPortalResponse.ts +1 -1
- package/src/models/CancelSubscriptionRequest.ts +2 -2
- package/src/models/CheckoutSessionResponse.ts +2 -2
- package/src/models/CreateCheckoutSessionRequest.ts +33 -12
- package/src/models/CurrentPeriodUsage.ts +124 -0
- package/src/models/LifecycleResponse.ts +91 -0
- package/src/models/PauseSubscriptionRequest.ts +1 -1
- package/src/models/PlanCatalogEntry.ts +158 -0
- package/src/models/PlanCatalogEntryOverageInner.ts +81 -0
- package/src/models/PlanCatalogPrice.ts +103 -0
- package/src/models/SubscriptionPlanSummary.ts +143 -0
- package/src/models/SubscriptionPlanSummaryOverageRate.ts +73 -0
- package/src/models/SubscriptionStatus.ts +150 -32
- package/src/models/SubscriptionUsageSummary.ts +101 -0
- package/src/models/UpdatePlanRequest.ts +20 -8
- package/src/models/UsageBreakdownByAgent.ts +83 -0
- package/src/models/UsageBreakdownByDay.ts +84 -0
- package/src/models/UsageHistoryResponse.ts +83 -0
- package/src/models/UsageRecordDto.ts +133 -0
- package/src/models/VoiceUsageReportRequest.ts +108 -0
- package/src/models/VoiceUsageReportResponse.ts +99 -0
- package/src/models/index.ts +16 -13
|
@@ -30,8 +30,7 @@ const index_1 = require("../models/index");
|
|
|
30
30
|
*/
|
|
31
31
|
class SubscriptionApi extends runtime.BaseAPI {
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
* Create billing portal session
|
|
33
|
+
* Create a Stripe billing portal session
|
|
35
34
|
*/
|
|
36
35
|
organizationsOrganizationIdSubscriptionBillingPortalPostRaw(requestParameters, initOverrides) {
|
|
37
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -64,8 +63,7 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
65
|
/**
|
|
67
|
-
*
|
|
68
|
-
* Create billing portal session
|
|
66
|
+
* Create a Stripe billing portal session
|
|
69
67
|
*/
|
|
70
68
|
organizationsOrganizationIdSubscriptionBillingPortalPost(requestParameters, initOverrides) {
|
|
71
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -74,8 +72,7 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
74
|
/**
|
|
77
|
-
*
|
|
78
|
-
* Cancel subscription
|
|
75
|
+
* Cancel the subscription (at period end by default)
|
|
79
76
|
*/
|
|
80
77
|
organizationsOrganizationIdSubscriptionCancelPostRaw(requestParameters, initOverrides) {
|
|
81
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -101,12 +98,11 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
101
98
|
query: queryParameters,
|
|
102
99
|
body: (0, index_1.CancelSubscriptionRequestToJSON)(requestParameters['cancelSubscriptionRequest']),
|
|
103
100
|
}, initOverrides);
|
|
104
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
101
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionStatusFromJSON)(jsonValue));
|
|
105
102
|
});
|
|
106
103
|
}
|
|
107
104
|
/**
|
|
108
|
-
*
|
|
109
|
-
* Cancel subscription
|
|
105
|
+
* Cancel the subscription (at period end by default)
|
|
110
106
|
*/
|
|
111
107
|
organizationsOrganizationIdSubscriptionCancelPost(requestParameters, initOverrides) {
|
|
112
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -115,8 +111,7 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
115
111
|
});
|
|
116
112
|
}
|
|
117
113
|
/**
|
|
118
|
-
*
|
|
119
|
-
* Create a checkout session for subscription
|
|
114
|
+
* Create a Stripe Checkout session
|
|
120
115
|
*/
|
|
121
116
|
organizationsOrganizationIdSubscriptionCheckoutPostRaw(requestParameters, initOverrides) {
|
|
122
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -149,8 +144,7 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
149
144
|
});
|
|
150
145
|
}
|
|
151
146
|
/**
|
|
152
|
-
*
|
|
153
|
-
* Create a checkout session for subscription
|
|
147
|
+
* Create a Stripe Checkout session
|
|
154
148
|
*/
|
|
155
149
|
organizationsOrganizationIdSubscriptionCheckoutPost(requestParameters, initOverrides) {
|
|
156
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -159,13 +153,12 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
159
153
|
});
|
|
160
154
|
}
|
|
161
155
|
/**
|
|
162
|
-
*
|
|
163
|
-
* Get credit balances for an organization
|
|
156
|
+
* Get subscription status with current-period usage
|
|
164
157
|
*/
|
|
165
|
-
|
|
158
|
+
organizationsOrganizationIdSubscriptionGetRaw(requestParameters, initOverrides) {
|
|
166
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
160
|
if (requestParameters['organizationId'] == null) {
|
|
168
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
161
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionGet().');
|
|
169
162
|
}
|
|
170
163
|
const queryParameters = {};
|
|
171
164
|
const headerParameters = {};
|
|
@@ -176,7 +169,7 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
176
169
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
177
170
|
}
|
|
178
171
|
}
|
|
179
|
-
let urlPath = `/organizations/{organizationId}/subscription
|
|
172
|
+
let urlPath = `/organizations/{organizationId}/subscription`;
|
|
180
173
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
181
174
|
const response = yield this.request({
|
|
182
175
|
path: urlPath,
|
|
@@ -184,39 +177,29 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
184
177
|
headers: headerParameters,
|
|
185
178
|
query: queryParameters,
|
|
186
179
|
}, initOverrides);
|
|
187
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
180
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionStatusFromJSON)(jsonValue));
|
|
188
181
|
});
|
|
189
182
|
}
|
|
190
183
|
/**
|
|
191
|
-
*
|
|
192
|
-
* Get credit balances for an organization
|
|
184
|
+
* Get subscription status with current-period usage
|
|
193
185
|
*/
|
|
194
|
-
|
|
186
|
+
organizationsOrganizationIdSubscriptionGet(requestParameters, initOverrides) {
|
|
195
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
-
const response = yield this.
|
|
188
|
+
const response = yield this.organizationsOrganizationIdSubscriptionGetRaw(requestParameters, initOverrides);
|
|
197
189
|
return yield response.value();
|
|
198
190
|
});
|
|
199
191
|
}
|
|
200
192
|
/**
|
|
201
|
-
*
|
|
202
|
-
* Get credit transaction history
|
|
193
|
+
* Pause payment collection
|
|
203
194
|
*/
|
|
204
|
-
|
|
195
|
+
organizationsOrganizationIdSubscriptionPausePostRaw(requestParameters, initOverrides) {
|
|
205
196
|
return __awaiter(this, void 0, void 0, function* () {
|
|
206
197
|
if (requestParameters['organizationId'] == null) {
|
|
207
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
198
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionPausePost().');
|
|
208
199
|
}
|
|
209
200
|
const queryParameters = {};
|
|
210
|
-
if (requestParameters['creditType'] != null) {
|
|
211
|
-
queryParameters['credit_type'] = requestParameters['creditType'];
|
|
212
|
-
}
|
|
213
|
-
if (requestParameters['limit'] != null) {
|
|
214
|
-
queryParameters['limit'] = requestParameters['limit'];
|
|
215
|
-
}
|
|
216
|
-
if (requestParameters['offset'] != null) {
|
|
217
|
-
queryParameters['offset'] = requestParameters['offset'];
|
|
218
|
-
}
|
|
219
201
|
const headerParameters = {};
|
|
202
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
220
203
|
if (this.configuration && this.configuration.accessToken) {
|
|
221
204
|
const token = this.configuration.accessToken;
|
|
222
205
|
const tokenString = yield token("bearerAuth", []);
|
|
@@ -224,38 +207,41 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
224
207
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
225
208
|
}
|
|
226
209
|
}
|
|
227
|
-
let urlPath = `/organizations/{organizationId}/subscription/
|
|
210
|
+
let urlPath = `/organizations/{organizationId}/subscription/pause`;
|
|
228
211
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
229
212
|
const response = yield this.request({
|
|
230
213
|
path: urlPath,
|
|
231
|
-
method: '
|
|
214
|
+
method: 'POST',
|
|
232
215
|
headers: headerParameters,
|
|
233
216
|
query: queryParameters,
|
|
217
|
+
body: (0, index_1.PauseSubscriptionRequestToJSON)(requestParameters['pauseSubscriptionRequest']),
|
|
234
218
|
}, initOverrides);
|
|
235
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
219
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionStatusFromJSON)(jsonValue));
|
|
236
220
|
});
|
|
237
221
|
}
|
|
238
222
|
/**
|
|
239
|
-
*
|
|
240
|
-
* Get credit transaction history
|
|
223
|
+
* Pause payment collection
|
|
241
224
|
*/
|
|
242
|
-
|
|
225
|
+
organizationsOrganizationIdSubscriptionPausePost(requestParameters, initOverrides) {
|
|
243
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
-
const response = yield this.
|
|
227
|
+
const response = yield this.organizationsOrganizationIdSubscriptionPausePostRaw(requestParameters, initOverrides);
|
|
245
228
|
return yield response.value();
|
|
246
229
|
});
|
|
247
230
|
}
|
|
248
231
|
/**
|
|
249
|
-
*
|
|
250
|
-
* Get detailed subscription information
|
|
232
|
+
* Change subscription plan
|
|
251
233
|
*/
|
|
252
|
-
|
|
234
|
+
organizationsOrganizationIdSubscriptionPlanPatchRaw(requestParameters, initOverrides) {
|
|
253
235
|
return __awaiter(this, void 0, void 0, function* () {
|
|
254
236
|
if (requestParameters['organizationId'] == null) {
|
|
255
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
237
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionPlanPatch().');
|
|
238
|
+
}
|
|
239
|
+
if (requestParameters['updatePlanRequest'] == null) {
|
|
240
|
+
throw new runtime.RequiredError('updatePlanRequest', 'Required parameter "updatePlanRequest" was null or undefined when calling organizationsOrganizationIdSubscriptionPlanPatch().');
|
|
256
241
|
}
|
|
257
242
|
const queryParameters = {};
|
|
258
243
|
const headerParameters = {};
|
|
244
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
259
245
|
if (this.configuration && this.configuration.accessToken) {
|
|
260
246
|
const token = this.configuration.accessToken;
|
|
261
247
|
const tokenString = yield token("bearerAuth", []);
|
|
@@ -263,35 +249,34 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
263
249
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
264
250
|
}
|
|
265
251
|
}
|
|
266
|
-
let urlPath = `/organizations/{organizationId}/subscription/
|
|
252
|
+
let urlPath = `/organizations/{organizationId}/subscription/plan`;
|
|
267
253
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
268
254
|
const response = yield this.request({
|
|
269
255
|
path: urlPath,
|
|
270
|
-
method: '
|
|
256
|
+
method: 'PATCH',
|
|
271
257
|
headers: headerParameters,
|
|
272
258
|
query: queryParameters,
|
|
259
|
+
body: (0, index_1.UpdatePlanRequestToJSON)(requestParameters['updatePlanRequest']),
|
|
273
260
|
}, initOverrides);
|
|
274
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
261
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionStatusFromJSON)(jsonValue));
|
|
275
262
|
});
|
|
276
263
|
}
|
|
277
264
|
/**
|
|
278
|
-
*
|
|
279
|
-
* Get detailed subscription information
|
|
265
|
+
* Change subscription plan
|
|
280
266
|
*/
|
|
281
|
-
|
|
267
|
+
organizationsOrganizationIdSubscriptionPlanPatch(requestParameters, initOverrides) {
|
|
282
268
|
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
-
const response = yield this.
|
|
269
|
+
const response = yield this.organizationsOrganizationIdSubscriptionPlanPatchRaw(requestParameters, initOverrides);
|
|
284
270
|
return yield response.value();
|
|
285
271
|
});
|
|
286
272
|
}
|
|
287
273
|
/**
|
|
288
|
-
*
|
|
289
|
-
* Check subscription status for an organization
|
|
274
|
+
* List available plans and their prices
|
|
290
275
|
*/
|
|
291
|
-
|
|
276
|
+
organizationsOrganizationIdSubscriptionPlansGetRaw(requestParameters, initOverrides) {
|
|
292
277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
293
278
|
if (requestParameters['organizationId'] == null) {
|
|
294
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
279
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionPlansGet().');
|
|
295
280
|
}
|
|
296
281
|
const queryParameters = {};
|
|
297
282
|
const headerParameters = {};
|
|
@@ -302,7 +287,7 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
302
287
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
303
288
|
}
|
|
304
289
|
}
|
|
305
|
-
let urlPath = `/organizations/{organizationId}/subscription`;
|
|
290
|
+
let urlPath = `/organizations/{organizationId}/subscription/plans`;
|
|
306
291
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
307
292
|
const response = yield this.request({
|
|
308
293
|
path: urlPath,
|
|
@@ -310,31 +295,28 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
310
295
|
headers: headerParameters,
|
|
311
296
|
query: queryParameters,
|
|
312
297
|
}, initOverrides);
|
|
313
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (
|
|
298
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.PlanCatalogEntryFromJSON));
|
|
314
299
|
});
|
|
315
300
|
}
|
|
316
301
|
/**
|
|
317
|
-
*
|
|
318
|
-
* Check subscription status for an organization
|
|
302
|
+
* List available plans and their prices
|
|
319
303
|
*/
|
|
320
|
-
|
|
304
|
+
organizationsOrganizationIdSubscriptionPlansGet(requestParameters, initOverrides) {
|
|
321
305
|
return __awaiter(this, void 0, void 0, function* () {
|
|
322
|
-
const response = yield this.
|
|
306
|
+
const response = yield this.organizationsOrganizationIdSubscriptionPlansGetRaw(requestParameters, initOverrides);
|
|
323
307
|
return yield response.value();
|
|
324
308
|
});
|
|
325
309
|
}
|
|
326
310
|
/**
|
|
327
|
-
*
|
|
328
|
-
* Pause subscription
|
|
311
|
+
* Resume a subscription scheduled for cancellation
|
|
329
312
|
*/
|
|
330
|
-
|
|
313
|
+
organizationsOrganizationIdSubscriptionResumePostRaw(requestParameters, initOverrides) {
|
|
331
314
|
return __awaiter(this, void 0, void 0, function* () {
|
|
332
315
|
if (requestParameters['organizationId'] == null) {
|
|
333
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
316
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionResumePost().');
|
|
334
317
|
}
|
|
335
318
|
const queryParameters = {};
|
|
336
319
|
const headerParameters = {};
|
|
337
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
338
320
|
if (this.configuration && this.configuration.accessToken) {
|
|
339
321
|
const token = this.configuration.accessToken;
|
|
340
322
|
const tokenString = yield token("bearerAuth", []);
|
|
@@ -342,43 +324,36 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
342
324
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
343
325
|
}
|
|
344
326
|
}
|
|
345
|
-
let urlPath = `/organizations/{organizationId}/subscription/
|
|
327
|
+
let urlPath = `/organizations/{organizationId}/subscription/resume`;
|
|
346
328
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
347
329
|
const response = yield this.request({
|
|
348
330
|
path: urlPath,
|
|
349
331
|
method: 'POST',
|
|
350
332
|
headers: headerParameters,
|
|
351
333
|
query: queryParameters,
|
|
352
|
-
body: (0, index_1.PauseSubscriptionRequestToJSON)(requestParameters['pauseSubscriptionRequest']),
|
|
353
334
|
}, initOverrides);
|
|
354
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
335
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionStatusFromJSON)(jsonValue));
|
|
355
336
|
});
|
|
356
337
|
}
|
|
357
338
|
/**
|
|
358
|
-
*
|
|
359
|
-
* Pause subscription
|
|
339
|
+
* Resume a subscription scheduled for cancellation
|
|
360
340
|
*/
|
|
361
|
-
|
|
341
|
+
organizationsOrganizationIdSubscriptionResumePost(requestParameters, initOverrides) {
|
|
362
342
|
return __awaiter(this, void 0, void 0, function* () {
|
|
363
|
-
const response = yield this.
|
|
343
|
+
const response = yield this.organizationsOrganizationIdSubscriptionResumePostRaw(requestParameters, initOverrides);
|
|
364
344
|
return yield response.value();
|
|
365
345
|
});
|
|
366
346
|
}
|
|
367
347
|
/**
|
|
368
|
-
*
|
|
369
|
-
* Update subscription plan
|
|
348
|
+
* Resume payment collection
|
|
370
349
|
*/
|
|
371
|
-
|
|
350
|
+
organizationsOrganizationIdSubscriptionUnpausePostRaw(requestParameters, initOverrides) {
|
|
372
351
|
return __awaiter(this, void 0, void 0, function* () {
|
|
373
352
|
if (requestParameters['organizationId'] == null) {
|
|
374
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
375
|
-
}
|
|
376
|
-
if (requestParameters['updatePlanRequest'] == null) {
|
|
377
|
-
throw new runtime.RequiredError('updatePlanRequest', 'Required parameter "updatePlanRequest" was null or undefined when calling organizationsOrganizationIdSubscriptionPlanPatch().');
|
|
353
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionUnpausePost().');
|
|
378
354
|
}
|
|
379
355
|
const queryParameters = {};
|
|
380
356
|
const headerParameters = {};
|
|
381
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
382
357
|
if (this.configuration && this.configuration.accessToken) {
|
|
383
358
|
const token = this.configuration.accessToken;
|
|
384
359
|
const tokenString = yield token("bearerAuth", []);
|
|
@@ -386,36 +361,33 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
386
361
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
387
362
|
}
|
|
388
363
|
}
|
|
389
|
-
let urlPath = `/organizations/{organizationId}/subscription/
|
|
364
|
+
let urlPath = `/organizations/{organizationId}/subscription/unpause`;
|
|
390
365
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
391
366
|
const response = yield this.request({
|
|
392
367
|
path: urlPath,
|
|
393
|
-
method: '
|
|
368
|
+
method: 'POST',
|
|
394
369
|
headers: headerParameters,
|
|
395
370
|
query: queryParameters,
|
|
396
|
-
body: (0, index_1.UpdatePlanRequestToJSON)(requestParameters['updatePlanRequest']),
|
|
397
371
|
}, initOverrides);
|
|
398
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
372
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionStatusFromJSON)(jsonValue));
|
|
399
373
|
});
|
|
400
374
|
}
|
|
401
375
|
/**
|
|
402
|
-
*
|
|
403
|
-
* Update subscription plan
|
|
376
|
+
* Resume payment collection
|
|
404
377
|
*/
|
|
405
|
-
|
|
378
|
+
organizationsOrganizationIdSubscriptionUnpausePost(requestParameters, initOverrides) {
|
|
406
379
|
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
-
const response = yield this.
|
|
380
|
+
const response = yield this.organizationsOrganizationIdSubscriptionUnpausePostRaw(requestParameters, initOverrides);
|
|
408
381
|
return yield response.value();
|
|
409
382
|
});
|
|
410
383
|
}
|
|
411
384
|
/**
|
|
412
|
-
*
|
|
413
|
-
* Resume subscription
|
|
385
|
+
* Get current-period voice usage breakdown
|
|
414
386
|
*/
|
|
415
|
-
|
|
387
|
+
organizationsOrganizationIdSubscriptionUsageGetRaw(requestParameters, initOverrides) {
|
|
416
388
|
return __awaiter(this, void 0, void 0, function* () {
|
|
417
389
|
if (requestParameters['organizationId'] == null) {
|
|
418
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
390
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionUsageGet().');
|
|
419
391
|
}
|
|
420
392
|
const queryParameters = {};
|
|
421
393
|
const headerParameters = {};
|
|
@@ -426,37 +398,47 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
426
398
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
427
399
|
}
|
|
428
400
|
}
|
|
429
|
-
let urlPath = `/organizations/{organizationId}/subscription/
|
|
401
|
+
let urlPath = `/organizations/{organizationId}/subscription/usage`;
|
|
430
402
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
431
403
|
const response = yield this.request({
|
|
432
404
|
path: urlPath,
|
|
433
|
-
method: '
|
|
405
|
+
method: 'GET',
|
|
434
406
|
headers: headerParameters,
|
|
435
407
|
query: queryParameters,
|
|
436
408
|
}, initOverrides);
|
|
437
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
409
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CurrentPeriodUsageFromJSON)(jsonValue));
|
|
438
410
|
});
|
|
439
411
|
}
|
|
440
412
|
/**
|
|
441
|
-
*
|
|
442
|
-
* Resume subscription
|
|
413
|
+
* Get current-period voice usage breakdown
|
|
443
414
|
*/
|
|
444
|
-
|
|
415
|
+
organizationsOrganizationIdSubscriptionUsageGet(requestParameters, initOverrides) {
|
|
445
416
|
return __awaiter(this, void 0, void 0, function* () {
|
|
446
|
-
const response = yield this.
|
|
417
|
+
const response = yield this.organizationsOrganizationIdSubscriptionUsageGetRaw(requestParameters, initOverrides);
|
|
447
418
|
return yield response.value();
|
|
448
419
|
});
|
|
449
420
|
}
|
|
450
421
|
/**
|
|
451
|
-
*
|
|
452
|
-
* Unpause subscription
|
|
422
|
+
* List individual usage records (paginated)
|
|
453
423
|
*/
|
|
454
|
-
|
|
424
|
+
organizationsOrganizationIdSubscriptionUsageHistoryGetRaw(requestParameters, initOverrides) {
|
|
455
425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
456
426
|
if (requestParameters['organizationId'] == null) {
|
|
457
|
-
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling
|
|
427
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSubscriptionUsageHistoryGet().');
|
|
458
428
|
}
|
|
459
429
|
const queryParameters = {};
|
|
430
|
+
if (requestParameters['from'] != null) {
|
|
431
|
+
queryParameters['from'] = requestParameters['from'].toISOString();
|
|
432
|
+
}
|
|
433
|
+
if (requestParameters['to'] != null) {
|
|
434
|
+
queryParameters['to'] = requestParameters['to'].toISOString();
|
|
435
|
+
}
|
|
436
|
+
if (requestParameters['limit'] != null) {
|
|
437
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
438
|
+
}
|
|
439
|
+
if (requestParameters['offset'] != null) {
|
|
440
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
441
|
+
}
|
|
460
442
|
const headerParameters = {};
|
|
461
443
|
if (this.configuration && this.configuration.accessToken) {
|
|
462
444
|
const token = this.configuration.accessToken;
|
|
@@ -465,24 +447,23 @@ class SubscriptionApi extends runtime.BaseAPI {
|
|
|
465
447
|
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
466
448
|
}
|
|
467
449
|
}
|
|
468
|
-
let urlPath = `/organizations/{organizationId}/subscription/
|
|
450
|
+
let urlPath = `/organizations/{organizationId}/subscription/usage/history`;
|
|
469
451
|
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
470
452
|
const response = yield this.request({
|
|
471
453
|
path: urlPath,
|
|
472
|
-
method: '
|
|
454
|
+
method: 'GET',
|
|
473
455
|
headers: headerParameters,
|
|
474
456
|
query: queryParameters,
|
|
475
457
|
}, initOverrides);
|
|
476
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.
|
|
458
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UsageHistoryResponseFromJSON)(jsonValue));
|
|
477
459
|
});
|
|
478
460
|
}
|
|
479
461
|
/**
|
|
480
|
-
*
|
|
481
|
-
* Unpause subscription
|
|
462
|
+
* List individual usage records (paginated)
|
|
482
463
|
*/
|
|
483
|
-
|
|
464
|
+
organizationsOrganizationIdSubscriptionUsageHistoryGet(requestParameters, initOverrides) {
|
|
484
465
|
return __awaiter(this, void 0, void 0, function* () {
|
|
485
|
-
const response = yield this.
|
|
466
|
+
const response = yield this.organizationsOrganizationIdSubscriptionUsageHistoryGetRaw(requestParameters, initOverrides);
|
|
486
467
|
return yield response.value();
|
|
487
468
|
});
|
|
488
469
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { VoiceUsageReportRequest, VoiceUsageReportResponse } from '../models/index';
|
|
14
|
+
export interface VoiceUsageReportPostRequest {
|
|
15
|
+
voiceUsageReportRequest: VoiceUsageReportRequest;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare class VoiceUsageApi extends runtime.BaseAPI {
|
|
21
|
+
/**
|
|
22
|
+
* Records voice-minute usage and reports overage to Stripe\'s Meter Events API when the included-minutes threshold is crossed. The request must be authenticated as a member of the target organization (or via the null provider in dev). Idempotent on `idempotencyKey`.
|
|
23
|
+
* Report voice usage for a call (used by agent runtimes)
|
|
24
|
+
*/
|
|
25
|
+
voiceUsageReportPostRaw(requestParameters: VoiceUsageReportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VoiceUsageReportResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* Records voice-minute usage and reports overage to Stripe\'s Meter Events API when the included-minutes threshold is crossed. The request must be authenticated as a member of the target organization (or via the null provider in dev). Idempotent on `idempotencyKey`.
|
|
28
|
+
* Report voice usage for a call (used by agent runtimes)
|
|
29
|
+
*/
|
|
30
|
+
voiceUsageReportPost(requestParameters: VoiceUsageReportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VoiceUsageReportResponse>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Tivadar AI Backend API
|
|
6
|
+
* Unified REST API for Tivadar AI Voice Agents platform
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.VoiceUsageApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class VoiceUsageApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Records voice-minute usage and reports overage to Stripe\'s Meter Events API when the included-minutes threshold is crossed. The request must be authenticated as a member of the target organization (or via the null provider in dev). Idempotent on `idempotencyKey`.
|
|
34
|
+
* Report voice usage for a call (used by agent runtimes)
|
|
35
|
+
*/
|
|
36
|
+
voiceUsageReportPostRaw(requestParameters, initOverrides) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (requestParameters['voiceUsageReportRequest'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('voiceUsageReportRequest', 'Required parameter "voiceUsageReportRequest" was null or undefined when calling voiceUsageReportPost().');
|
|
40
|
+
}
|
|
41
|
+
const queryParameters = {};
|
|
42
|
+
const headerParameters = {};
|
|
43
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
44
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
45
|
+
const token = this.configuration.accessToken;
|
|
46
|
+
const tokenString = yield token("bearerAuth", []);
|
|
47
|
+
if (tokenString) {
|
|
48
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let urlPath = `/voice-usage/report`;
|
|
52
|
+
const response = yield this.request({
|
|
53
|
+
path: urlPath,
|
|
54
|
+
method: 'POST',
|
|
55
|
+
headers: headerParameters,
|
|
56
|
+
query: queryParameters,
|
|
57
|
+
body: (0, index_1.VoiceUsageReportRequestToJSON)(requestParameters['voiceUsageReportRequest']),
|
|
58
|
+
}, initOverrides);
|
|
59
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.VoiceUsageReportResponseFromJSON)(jsonValue));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Records voice-minute usage and reports overage to Stripe\'s Meter Events API when the included-minutes threshold is crossed. The request must be authenticated as a member of the target organization (or via the null provider in dev). Idempotent on `idempotencyKey`.
|
|
64
|
+
* Report voice usage for a call (used by agent runtimes)
|
|
65
|
+
*/
|
|
66
|
+
voiceUsageReportPost(requestParameters, initOverrides) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const response = yield this.voiceUsageReportPostRaw(requestParameters, initOverrides);
|
|
69
|
+
return yield response.value();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.VoiceUsageApi = VoiceUsageApi;
|
package/dist/apis/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './AdminSubscriptionsApi';
|
|
1
2
|
export * from './CalendarApi';
|
|
2
3
|
export * from './CallsApi';
|
|
3
4
|
export * from './ChatAgentsApi';
|
|
@@ -19,3 +20,4 @@ export * from './SubscriptionApi';
|
|
|
19
20
|
export * from './TTSProvidersApi';
|
|
20
21
|
export * from './ToolsApi';
|
|
21
22
|
export * from './VoiceAgentsApi';
|
|
23
|
+
export * from './VoiceUsageApi';
|
package/dist/apis/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./AdminSubscriptionsApi"), exports);
|
|
19
20
|
__exportStar(require("./CalendarApi"), exports);
|
|
20
21
|
__exportStar(require("./CallsApi"), exports);
|
|
21
22
|
__exportStar(require("./ChatAgentsApi"), exports);
|
|
@@ -37,3 +38,4 @@ __exportStar(require("./SubscriptionApi"), exports);
|
|
|
37
38
|
__exportStar(require("./TTSProvidersApi"), exports);
|
|
38
39
|
__exportStar(require("./ToolsApi"), exports);
|
|
39
40
|
__exportStar(require("./VoiceAgentsApi"), exports);
|
|
41
|
+
__exportStar(require("./VoiceUsageApi"), exports);
|