@l7mp/tivadar-ai-api-sdk 0.2.9 → 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/VoiceAgentMetadata.d.ts +6 -0
- package/dist/esm/models/VoiceAgentMetadata.js +2 -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/VoiceAgentMetadata.d.ts +6 -0
- package/dist/models/VoiceAgentMetadata.js +2 -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/VoiceAgentMetadata.ts +8 -0
- package/src/models/VoiceUsageReportRequest.ts +108 -0
- package/src/models/VoiceUsageReportResponse.ts +99 -0
- package/src/models/index.ts +16 -13
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
VoiceUsageReportRequest,
|
|
19
|
+
VoiceUsageReportResponse,
|
|
20
|
+
} from '../models/index';
|
|
21
|
+
import {
|
|
22
|
+
VoiceUsageReportRequestFromJSON,
|
|
23
|
+
VoiceUsageReportRequestToJSON,
|
|
24
|
+
VoiceUsageReportResponseFromJSON,
|
|
25
|
+
VoiceUsageReportResponseToJSON,
|
|
26
|
+
} from '../models/index';
|
|
27
|
+
|
|
28
|
+
export interface VoiceUsageReportPostRequest {
|
|
29
|
+
voiceUsageReportRequest: VoiceUsageReportRequest;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
export class VoiceUsageApi extends runtime.BaseAPI {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 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`.
|
|
39
|
+
* Report voice usage for a call (used by agent runtimes)
|
|
40
|
+
*/
|
|
41
|
+
async voiceUsageReportPostRaw(requestParameters: VoiceUsageReportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VoiceUsageReportResponse>> {
|
|
42
|
+
if (requestParameters['voiceUsageReportRequest'] == null) {
|
|
43
|
+
throw new runtime.RequiredError(
|
|
44
|
+
'voiceUsageReportRequest',
|
|
45
|
+
'Required parameter "voiceUsageReportRequest" was null or undefined when calling voiceUsageReportPost().'
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const queryParameters: any = {};
|
|
50
|
+
|
|
51
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
52
|
+
|
|
53
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
54
|
+
|
|
55
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
56
|
+
const token = this.configuration.accessToken;
|
|
57
|
+
const tokenString = await token("bearerAuth", []);
|
|
58
|
+
|
|
59
|
+
if (tokenString) {
|
|
60
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
let urlPath = `/voice-usage/report`;
|
|
65
|
+
|
|
66
|
+
const response = await this.request({
|
|
67
|
+
path: urlPath,
|
|
68
|
+
method: 'POST',
|
|
69
|
+
headers: headerParameters,
|
|
70
|
+
query: queryParameters,
|
|
71
|
+
body: VoiceUsageReportRequestToJSON(requestParameters['voiceUsageReportRequest']),
|
|
72
|
+
}, initOverrides);
|
|
73
|
+
|
|
74
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VoiceUsageReportResponseFromJSON(jsonValue));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 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`.
|
|
79
|
+
* Report voice usage for a call (used by agent runtimes)
|
|
80
|
+
*/
|
|
81
|
+
async voiceUsageReportPost(requestParameters: VoiceUsageReportPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VoiceUsageReportResponse> {
|
|
82
|
+
const response = await this.voiceUsageReportPostRaw(requestParameters, initOverrides);
|
|
83
|
+
return await response.value();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export * from './AdminSubscriptionsApi';
|
|
3
4
|
export * from './CalendarApi';
|
|
4
5
|
export * from './CallsApi';
|
|
5
6
|
export * from './ChatAgentsApi';
|
|
@@ -21,3 +22,4 @@ export * from './SubscriptionApi';
|
|
|
21
22
|
export * from './TTSProvidersApi';
|
|
22
23
|
export * from './ToolsApi';
|
|
23
24
|
export * from './VoiceAgentsApi';
|
|
25
|
+
export * from './VoiceUsageApi';
|
|
@@ -0,0 +1,74 @@
|
|
|
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 AdminGrantMinutesRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface AdminGrantMinutesRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Positive to grant (credit), negative to deduct.
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof AdminGrantMinutesRequest
|
|
26
|
+
*/
|
|
27
|
+
minutes: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AdminGrantMinutesRequest
|
|
32
|
+
*/
|
|
33
|
+
note?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the AdminGrantMinutesRequest interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfAdminGrantMinutesRequest(value: object): value is AdminGrantMinutesRequest {
|
|
40
|
+
if (!('minutes' in value) || value['minutes'] === undefined) return false;
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function AdminGrantMinutesRequestFromJSON(json: any): AdminGrantMinutesRequest {
|
|
45
|
+
return AdminGrantMinutesRequestFromJSONTyped(json, false);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function AdminGrantMinutesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminGrantMinutesRequest {
|
|
49
|
+
if (json == null) {
|
|
50
|
+
return json;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
|
|
54
|
+
'minutes': json['minutes'],
|
|
55
|
+
'note': json['note'] == null ? undefined : json['note'],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function AdminGrantMinutesRequestToJSON(json: any): AdminGrantMinutesRequest {
|
|
60
|
+
return AdminGrantMinutesRequestToJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function AdminGrantMinutesRequestToJSONTyped(value?: AdminGrantMinutesRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
64
|
+
if (value == null) {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
|
|
70
|
+
'minutes': value['minutes'],
|
|
71
|
+
'note': value['note'],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
@@ -0,0 +1,136 @@
|
|
|
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 AdminSetSubscriptionRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface AdminSetSubscriptionRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AdminSetSubscriptionRequest
|
|
26
|
+
*/
|
|
27
|
+
planSlug: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AdminSetSubscriptionRequest
|
|
32
|
+
*/
|
|
33
|
+
status?: AdminSetSubscriptionRequestStatusEnum;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof AdminSetSubscriptionRequest
|
|
38
|
+
*/
|
|
39
|
+
billingInterval?: AdminSetSubscriptionRequestBillingIntervalEnum | null;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof AdminSetSubscriptionRequest
|
|
44
|
+
*/
|
|
45
|
+
currency?: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {Date}
|
|
49
|
+
* @memberof AdminSetSubscriptionRequest
|
|
50
|
+
*/
|
|
51
|
+
currentPeriodStart?: Date;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {Date}
|
|
55
|
+
* @memberof AdminSetSubscriptionRequest
|
|
56
|
+
*/
|
|
57
|
+
currentPeriodEnd?: Date;
|
|
58
|
+
/**
|
|
59
|
+
* Stored on the audit event for context.
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof AdminSetSubscriptionRequest
|
|
62
|
+
*/
|
|
63
|
+
note?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @export
|
|
69
|
+
*/
|
|
70
|
+
export const AdminSetSubscriptionRequestStatusEnum = {
|
|
71
|
+
Active: 'active',
|
|
72
|
+
Trialing: 'trialing',
|
|
73
|
+
Paused: 'paused',
|
|
74
|
+
Canceled: 'canceled'
|
|
75
|
+
} as const;
|
|
76
|
+
export type AdminSetSubscriptionRequestStatusEnum = typeof AdminSetSubscriptionRequestStatusEnum[keyof typeof AdminSetSubscriptionRequestStatusEnum];
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @export
|
|
80
|
+
*/
|
|
81
|
+
export const AdminSetSubscriptionRequestBillingIntervalEnum = {
|
|
82
|
+
Monthly: 'monthly',
|
|
83
|
+
Yearly: 'yearly'
|
|
84
|
+
} as const;
|
|
85
|
+
export type AdminSetSubscriptionRequestBillingIntervalEnum = typeof AdminSetSubscriptionRequestBillingIntervalEnum[keyof typeof AdminSetSubscriptionRequestBillingIntervalEnum];
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Check if a given object implements the AdminSetSubscriptionRequest interface.
|
|
90
|
+
*/
|
|
91
|
+
export function instanceOfAdminSetSubscriptionRequest(value: object): value is AdminSetSubscriptionRequest {
|
|
92
|
+
if (!('planSlug' in value) || value['planSlug'] === undefined) return false;
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function AdminSetSubscriptionRequestFromJSON(json: any): AdminSetSubscriptionRequest {
|
|
97
|
+
return AdminSetSubscriptionRequestFromJSONTyped(json, false);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function AdminSetSubscriptionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminSetSubscriptionRequest {
|
|
101
|
+
if (json == null) {
|
|
102
|
+
return json;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
|
|
106
|
+
'planSlug': json['planSlug'],
|
|
107
|
+
'status': json['status'] == null ? undefined : json['status'],
|
|
108
|
+
'billingInterval': json['billingInterval'] == null ? undefined : json['billingInterval'],
|
|
109
|
+
'currency': json['currency'] == null ? undefined : json['currency'],
|
|
110
|
+
'currentPeriodStart': json['currentPeriodStart'] == null ? undefined : (new Date(json['currentPeriodStart'])),
|
|
111
|
+
'currentPeriodEnd': json['currentPeriodEnd'] == null ? undefined : (new Date(json['currentPeriodEnd'])),
|
|
112
|
+
'note': json['note'] == null ? undefined : json['note'],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function AdminSetSubscriptionRequestToJSON(json: any): AdminSetSubscriptionRequest {
|
|
117
|
+
return AdminSetSubscriptionRequestToJSONTyped(json, false);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function AdminSetSubscriptionRequestToJSONTyped(value?: AdminSetSubscriptionRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
121
|
+
if (value == null) {
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
|
|
127
|
+
'planSlug': value['planSlug'],
|
|
128
|
+
'status': value['status'],
|
|
129
|
+
'billingInterval': value['billingInterval'],
|
|
130
|
+
'currency': value['currency'],
|
|
131
|
+
'currentPeriodStart': value['currentPeriodStart'] == null ? value['currentPeriodStart'] : value['currentPeriodStart'].toISOString(),
|
|
132
|
+
'currentPeriodEnd': value['currentPeriodEnd'] == null ? value['currentPeriodEnd'] : value['currentPeriodEnd'].toISOString(),
|
|
133
|
+
'note': value['note'],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
@@ -20,13 +20,13 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface CancelSubscriptionRequest {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
24
|
* @type {boolean}
|
|
25
25
|
* @memberof CancelSubscriptionRequest
|
|
26
26
|
*/
|
|
27
27
|
cancelImmediately?: boolean;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
*
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @memberof CancelSubscriptionRequest
|
|
32
32
|
*/
|
|
@@ -20,13 +20,13 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface CheckoutSessionResponse {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof CheckoutSessionResponse
|
|
26
26
|
*/
|
|
27
27
|
id: string;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
*
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @memberof CheckoutSessionResponse
|
|
32
32
|
*/
|
|
@@ -20,37 +20,56 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface CreateCheckoutSessionRequest {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof CreateCheckoutSessionRequest
|
|
26
26
|
*/
|
|
27
27
|
planSlug: string;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
*
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @memberof CreateCheckoutSessionRequest
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
interval: CreateCheckoutSessionRequestIntervalEnum;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* ISO-4217 lowercase. Defaults to the org subscription currency or the system default.
|
|
36
36
|
* @type {string}
|
|
37
37
|
* @memberof CreateCheckoutSessionRequest
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
currency?: string;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
*
|
|
42
42
|
* @type {string}
|
|
43
43
|
* @memberof CreateCheckoutSessionRequest
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
successUrl: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof CreateCheckoutSessionRequest
|
|
50
|
+
*/
|
|
51
|
+
cancelUrl: string;
|
|
46
52
|
}
|
|
47
53
|
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @export
|
|
57
|
+
*/
|
|
58
|
+
export const CreateCheckoutSessionRequestIntervalEnum = {
|
|
59
|
+
Monthly: 'monthly',
|
|
60
|
+
Yearly: 'yearly'
|
|
61
|
+
} as const;
|
|
62
|
+
export type CreateCheckoutSessionRequestIntervalEnum = typeof CreateCheckoutSessionRequestIntervalEnum[keyof typeof CreateCheckoutSessionRequestIntervalEnum];
|
|
63
|
+
|
|
64
|
+
|
|
48
65
|
/**
|
|
49
66
|
* Check if a given object implements the CreateCheckoutSessionRequest interface.
|
|
50
67
|
*/
|
|
51
68
|
export function instanceOfCreateCheckoutSessionRequest(value: object): value is CreateCheckoutSessionRequest {
|
|
52
69
|
if (!('planSlug' in value) || value['planSlug'] === undefined) return false;
|
|
53
|
-
if (!('
|
|
70
|
+
if (!('interval' in value) || value['interval'] === undefined) return false;
|
|
71
|
+
if (!('successUrl' in value) || value['successUrl'] === undefined) return false;
|
|
72
|
+
if (!('cancelUrl' in value) || value['cancelUrl'] === undefined) return false;
|
|
54
73
|
return true;
|
|
55
74
|
}
|
|
56
75
|
|
|
@@ -65,9 +84,10 @@ export function CreateCheckoutSessionRequestFromJSONTyped(json: any, ignoreDiscr
|
|
|
65
84
|
return {
|
|
66
85
|
|
|
67
86
|
'planSlug': json['planSlug'],
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
87
|
+
'interval': json['interval'],
|
|
88
|
+
'currency': json['currency'] == null ? undefined : json['currency'],
|
|
89
|
+
'successUrl': json['successUrl'],
|
|
90
|
+
'cancelUrl': json['cancelUrl'],
|
|
71
91
|
};
|
|
72
92
|
}
|
|
73
93
|
|
|
@@ -83,7 +103,8 @@ export function CreateCheckoutSessionRequestToJSONTyped(value?: CreateCheckoutSe
|
|
|
83
103
|
return {
|
|
84
104
|
|
|
85
105
|
'planSlug': value['planSlug'],
|
|
86
|
-
'
|
|
106
|
+
'interval': value['interval'],
|
|
107
|
+
'currency': value['currency'],
|
|
87
108
|
'successUrl': value['successUrl'],
|
|
88
109
|
'cancelUrl': value['cancelUrl'],
|
|
89
110
|
};
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
import type { UsageBreakdownByDay } from './UsageBreakdownByDay';
|
|
17
|
+
import {
|
|
18
|
+
UsageBreakdownByDayFromJSON,
|
|
19
|
+
UsageBreakdownByDayFromJSONTyped,
|
|
20
|
+
UsageBreakdownByDayToJSON,
|
|
21
|
+
UsageBreakdownByDayToJSONTyped,
|
|
22
|
+
} from './UsageBreakdownByDay';
|
|
23
|
+
import type { SubscriptionUsageSummary } from './SubscriptionUsageSummary';
|
|
24
|
+
import {
|
|
25
|
+
SubscriptionUsageSummaryFromJSON,
|
|
26
|
+
SubscriptionUsageSummaryFromJSONTyped,
|
|
27
|
+
SubscriptionUsageSummaryToJSON,
|
|
28
|
+
SubscriptionUsageSummaryToJSONTyped,
|
|
29
|
+
} from './SubscriptionUsageSummary';
|
|
30
|
+
import type { UsageBreakdownByAgent } from './UsageBreakdownByAgent';
|
|
31
|
+
import {
|
|
32
|
+
UsageBreakdownByAgentFromJSON,
|
|
33
|
+
UsageBreakdownByAgentFromJSONTyped,
|
|
34
|
+
UsageBreakdownByAgentToJSON,
|
|
35
|
+
UsageBreakdownByAgentToJSONTyped,
|
|
36
|
+
} from './UsageBreakdownByAgent';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @export
|
|
41
|
+
* @interface CurrentPeriodUsage
|
|
42
|
+
*/
|
|
43
|
+
export interface CurrentPeriodUsage {
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @type {Date}
|
|
47
|
+
* @memberof CurrentPeriodUsage
|
|
48
|
+
*/
|
|
49
|
+
periodStart: Date | null;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @type {Date}
|
|
53
|
+
* @memberof CurrentPeriodUsage
|
|
54
|
+
*/
|
|
55
|
+
periodEnd: Date | null;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @type {SubscriptionUsageSummary}
|
|
59
|
+
* @memberof CurrentPeriodUsage
|
|
60
|
+
*/
|
|
61
|
+
usage: SubscriptionUsageSummary;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @type {Array<UsageBreakdownByDay>}
|
|
65
|
+
* @memberof CurrentPeriodUsage
|
|
66
|
+
*/
|
|
67
|
+
byDay: Array<UsageBreakdownByDay>;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @type {Array<UsageBreakdownByAgent>}
|
|
71
|
+
* @memberof CurrentPeriodUsage
|
|
72
|
+
*/
|
|
73
|
+
byAgent: Array<UsageBreakdownByAgent>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Check if a given object implements the CurrentPeriodUsage interface.
|
|
78
|
+
*/
|
|
79
|
+
export function instanceOfCurrentPeriodUsage(value: object): value is CurrentPeriodUsage {
|
|
80
|
+
if (!('periodStart' in value) || value['periodStart'] === undefined) return false;
|
|
81
|
+
if (!('periodEnd' in value) || value['periodEnd'] === undefined) return false;
|
|
82
|
+
if (!('usage' in value) || value['usage'] === undefined) return false;
|
|
83
|
+
if (!('byDay' in value) || value['byDay'] === undefined) return false;
|
|
84
|
+
if (!('byAgent' in value) || value['byAgent'] === undefined) return false;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function CurrentPeriodUsageFromJSON(json: any): CurrentPeriodUsage {
|
|
89
|
+
return CurrentPeriodUsageFromJSONTyped(json, false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function CurrentPeriodUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): CurrentPeriodUsage {
|
|
93
|
+
if (json == null) {
|
|
94
|
+
return json;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
|
|
98
|
+
'periodStart': (json['periodStart'] == null ? null : new Date(json['periodStart'])),
|
|
99
|
+
'periodEnd': (json['periodEnd'] == null ? null : new Date(json['periodEnd'])),
|
|
100
|
+
'usage': SubscriptionUsageSummaryFromJSON(json['usage']),
|
|
101
|
+
'byDay': ((json['byDay'] as Array<any>).map(UsageBreakdownByDayFromJSON)),
|
|
102
|
+
'byAgent': ((json['byAgent'] as Array<any>).map(UsageBreakdownByAgentFromJSON)),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function CurrentPeriodUsageToJSON(json: any): CurrentPeriodUsage {
|
|
107
|
+
return CurrentPeriodUsageToJSONTyped(json, false);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function CurrentPeriodUsageToJSONTyped(value?: CurrentPeriodUsage | null, ignoreDiscriminator: boolean = false): any {
|
|
111
|
+
if (value == null) {
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
|
|
117
|
+
'periodStart': value['periodStart'] == null ? value['periodStart'] : value['periodStart'].toISOString(),
|
|
118
|
+
'periodEnd': value['periodEnd'] == null ? value['periodEnd'] : value['periodEnd'].toISOString(),
|
|
119
|
+
'usage': SubscriptionUsageSummaryToJSON(value['usage']),
|
|
120
|
+
'byDay': ((value['byDay'] as Array<any>).map(UsageBreakdownByDayToJSON)),
|
|
121
|
+
'byAgent': ((value['byAgent'] as Array<any>).map(UsageBreakdownByAgentToJSON)),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
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 LifecycleResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface LifecycleResponse {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof LifecycleResponse
|
|
26
|
+
*/
|
|
27
|
+
subscriptionId: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof LifecycleResponse
|
|
32
|
+
*/
|
|
33
|
+
status: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof LifecycleResponse
|
|
38
|
+
*/
|
|
39
|
+
cancelAtPeriodEnd?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {Date}
|
|
43
|
+
* @memberof LifecycleResponse
|
|
44
|
+
*/
|
|
45
|
+
currentPeriodEnd?: Date | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the LifecycleResponse interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfLifecycleResponse(value: object): value is LifecycleResponse {
|
|
52
|
+
if (!('subscriptionId' in value) || value['subscriptionId'] === undefined) return false;
|
|
53
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function LifecycleResponseFromJSON(json: any): LifecycleResponse {
|
|
58
|
+
return LifecycleResponseFromJSONTyped(json, false);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function LifecycleResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): LifecycleResponse {
|
|
62
|
+
if (json == null) {
|
|
63
|
+
return json;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
|
|
67
|
+
'subscriptionId': json['subscriptionId'],
|
|
68
|
+
'status': json['status'],
|
|
69
|
+
'cancelAtPeriodEnd': json['cancelAtPeriodEnd'] == null ? undefined : json['cancelAtPeriodEnd'],
|
|
70
|
+
'currentPeriodEnd': json['currentPeriodEnd'] == null ? undefined : (new Date(json['currentPeriodEnd'])),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function LifecycleResponseToJSON(json: any): LifecycleResponse {
|
|
75
|
+
return LifecycleResponseToJSONTyped(json, false);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function LifecycleResponseToJSONTyped(value?: LifecycleResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
79
|
+
if (value == null) {
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
|
|
85
|
+
'subscriptionId': value['subscriptionId'],
|
|
86
|
+
'status': value['status'],
|
|
87
|
+
'cancelAtPeriodEnd': value['cancelAtPeriodEnd'],
|
|
88
|
+
'currentPeriodEnd': value['currentPeriodEnd'] == null ? value['currentPeriodEnd'] : value['currentPeriodEnd'].toISOString(),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|