diff --git a/CHANGELOG.md b/CHANGELOG.md index 741a7d0..02a01d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## v2 +### v2.0.0-alpha.2 + +- Fix `AI` resource methods and created nested structure + ### v2.0.0-alpha.1 - Update actions workflow versions to v4 and `.npmignore` to v2 @@ -43,7 +47,6 @@ - Remove duplicated `BulkPhoneNumberCampaigns` resource - Remove duplicated `BulkPhoneNumberOperations` resource - ## v1 ### v1.26.2 diff --git a/VERSION b/VERSION index e05cd46..453787a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0-alpha.1 +2.0.0-alpha.2 diff --git a/package-lock.json b/package-lock.json index 635ce4b..31ae193 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "telnyx", - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "telnyx", - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "license": "MIT", "devDependencies": { "@eslint/js": "^9.10.0", diff --git a/package.json b/package.json index 1c80cac..a6b97c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telnyx", - "version": "2.0.0-alpha.1", + "version": "2.0.0-alpha.2", "description": "Telnyx API Node SDK", "keywords": [ "telnyx", diff --git a/src/resources/AI.ts b/src/resources/AI.ts deleted file mode 100644 index fa22875..0000000 --- a/src/resources/AI.ts +++ /dev/null @@ -1,43 +0,0 @@ -import TelnyxResource from '../TelnyxResource'; -const telnyxMethod = TelnyxResource.method; - -export const AI = TelnyxResource.extend({ - path: 'public_endpoints', - includeBasic: ['list', 'retrieve', 'create', 'delete'], - - GetEmbeddingTask: telnyxMethod({ - method: 'GET', - path: '/ai/embeddings/{task/id}', - urlParams: ['task_id'], - }), - PostEmbedding: telnyxMethod({ - method: 'POST', - path: '/ai/embeddings', - }), - embedding_bucket_files_public_embedding_buckets__bucket_name__delete: - telnyxMethod({ - method: 'DELETE', - path: '/ai/embeddings_buckets/{bucket_name}', - urlParams: ['bucket_name'], - }), - PostInferenceStream: telnyxMethod({ - method: 'POST', - path: '/ai/generate/stream', - }), - PostInference: telnyxMethod({ - method: 'POST', - path: '/ai/generate', - }), - PostSummary: telnyxMethod({ - method: 'POST', - path: '/ai/summarize', - }), - PostEmbeddingSimilaritySearch: telnyxMethod({ - method: 'POST', - path: '/ai/embeddings/similarity-search', - }), - GetEmbeddingBuckets: telnyxMethod({ - method: 'GET', - path: '/ai/embeddings_buckets', - }), -}); diff --git a/src/resources/AiAssistants.ts b/src/resources/AiAssistants.ts new file mode 100644 index 0000000..dddfbeb --- /dev/null +++ b/src/resources/AiAssistants.ts @@ -0,0 +1,25 @@ +import TelnyxResource from '../TelnyxResource'; +const telnyxMethod = TelnyxResource.method; + +export const AiAssistants = TelnyxResource.extend({ + path: 'ai/assistants', + includeBasic: ['list', 'create'], + + retrieve: telnyxMethod({ + method: 'GET', + path: '/{assistant_id}', + urlParams: ['assistant_id'], + }), + + update: telnyxMethod({ + method: 'POST', + path: '/{assistant_id}', + urlParams: ['assistant_id'], + }), + + del: telnyxMethod({ + method: 'DELETE', + path: '/{assistant_id}', + urlParams: ['assistant_id'], + }), +}); diff --git a/src/resources/AiAudioTranscriptions.ts b/src/resources/AiAudioTranscriptions.ts new file mode 100644 index 0000000..c9efdad --- /dev/null +++ b/src/resources/AiAudioTranscriptions.ts @@ -0,0 +1,6 @@ +import TelnyxResource from '../TelnyxResource'; + +export const AiAudioTranscriptions = TelnyxResource.extend({ + path: 'ai/audio/transcriptions', + includeBasic: ['create'], +}); diff --git a/src/resources/AiChatCompletions.ts b/src/resources/AiChatCompletions.ts new file mode 100644 index 0000000..662a12f --- /dev/null +++ b/src/resources/AiChatCompletions.ts @@ -0,0 +1,6 @@ +import TelnyxResource from '../TelnyxResource'; + +export const AiChatCompletions = TelnyxResource.extend({ + path: 'ai/chat/completions', + includeBasic: ['create'], +}); diff --git a/src/resources/AiEmbeddings.ts b/src/resources/AiEmbeddings.ts new file mode 100644 index 0000000..3e1845b --- /dev/null +++ b/src/resources/AiEmbeddings.ts @@ -0,0 +1,13 @@ +import TelnyxResource from '../TelnyxResource'; +const telnyxMethod = TelnyxResource.method; + +export const AiEmbeddings = TelnyxResource.extend({ + path: 'ai/embeddings', + includeBasic: ['list', 'create'], + + retrieve: telnyxMethod({ + method: 'GET', + path: '/{task_id}', + urlParams: ['task_id'], + }), +}); diff --git a/src/resources/AiEmbeddingsBuckets.ts b/src/resources/AiEmbeddingsBuckets.ts new file mode 100644 index 0000000..399644b --- /dev/null +++ b/src/resources/AiEmbeddingsBuckets.ts @@ -0,0 +1,19 @@ +import TelnyxResource from '../TelnyxResource'; +const telnyxMethod = TelnyxResource.method; + +export const AiEmbeddingsBuckets = TelnyxResource.extend({ + path: 'ai/embeddings/buckets', + includeBasic: ['list'], + + retrieve: telnyxMethod({ + method: 'GET', + path: '/{bucket_name}', + urlParams: ['bucket_name'], + }), + + del: telnyxMethod({ + method: 'DELETE', + path: '/{bucket_name}', + urlParams: ['bucket_name'], + }), +}); diff --git a/src/resources/AiEmbeddingsSimilaritySearch.ts b/src/resources/AiEmbeddingsSimilaritySearch.ts new file mode 100644 index 0000000..6010005 --- /dev/null +++ b/src/resources/AiEmbeddingsSimilaritySearch.ts @@ -0,0 +1,6 @@ +import TelnyxResource from '../TelnyxResource'; + +export const AiEmbeddingsSimilaritySearch = TelnyxResource.extend({ + path: 'ai/embeddings/similarity-search', + includeBasic: ['create'], +}); diff --git a/src/resources/AiModels.ts b/src/resources/AiModels.ts new file mode 100644 index 0000000..53e65f9 --- /dev/null +++ b/src/resources/AiModels.ts @@ -0,0 +1,6 @@ +import TelnyxResource from '../TelnyxResource'; + +export const AiModels = TelnyxResource.extend({ + path: 'ai/models', + includeBasic: ['list'], +}); diff --git a/src/resources/AiSummarize.ts b/src/resources/AiSummarize.ts new file mode 100644 index 0000000..65f78d6 --- /dev/null +++ b/src/resources/AiSummarize.ts @@ -0,0 +1,6 @@ +import TelnyxResource from '../TelnyxResource'; + +export const AiSummarize = TelnyxResource.extend({ + path: 'ai/summarize', + includeBasic: ['create'], +}); diff --git a/src/resources/Conferences.ts b/src/resources/Conferences.ts index e0b7ea2..ace7f66 100644 --- a/src/resources/Conferences.ts +++ b/src/resources/Conferences.ts @@ -54,7 +54,6 @@ export const Conferences = TelnyxResource.extend({ participants: telnyxMethod({ method: 'GET', - path: '/{conferenceId}/participants', urlParams: ['conferenceId'], }), diff --git a/src/telnyx.ts b/src/telnyx.ts index f792734..64ee5c7 100644 --- a/src/telnyx.ts +++ b/src/telnyx.ts @@ -13,7 +13,14 @@ import {ActionsSimCards} from './resources/ActionsSimCards'; import {ActivateDeactivateBulkCredentials} from './resources/ActivateDeactivateBulkCredentials'; import {Addresses} from './resources/Addresses'; import {AutorespConfigs} from './resources/AutorespConfigs'; -import {AI} from './resources/AI'; +import {AiAssistants} from './resources/AiAssistants'; +import {AiAudioTranscriptions} from './resources/AiAudioTranscriptions'; +import {AiChatCompletions} from './resources/AiChatCompletions'; +import {AiEmbeddings} from './resources/AiEmbeddings'; +import {AiEmbeddingsBuckets} from './resources/AiEmbeddingsBuckets'; +import {AiEmbeddingsSimilaritySearch} from './resources/AiEmbeddingsSimilaritySearch'; +import {AiModels} from './resources/AiModels'; +import {AiSummarize} from './resources/AiSummarize'; import {AuthenticationProviders} from './resources/AuthenticationProviders'; import {AvailablePhoneNumbers} from './resources/AvailablePhoneNumbers'; import {Balance} from './resources/Balance'; @@ -190,7 +197,14 @@ export function createTelnyx() { ActivateDeactivateBulkCredentials, Addresses, AutorespConfigs, - AI, + AiAssistants, + AiAudioTranscriptions, + AiChatCompletions, + AiEmbeddings, + AiEmbeddingsBuckets, + AiEmbeddingsSimilaritySearch, + AiModels, + AiSummarize, AuthenticationProviders, AvailablePhoneNumbers, Balance, diff --git a/types/AccessIpRangesResource.d.ts b/types/AccessIpRangesResource.d.ts index e984e77..5002f92 100644 --- a/types/AccessIpRangesResource.d.ts +++ b/types/AccessIpRangesResource.d.ts @@ -12,7 +12,7 @@ declare module 'telnyx' { paths['/access_ip_ranges']['get']['parameters']['query']; type AccessIpRangesListResponse = - paths['/access_ip_ranges']['get']['responses']['200']['content']['application/json']['data']; + paths['/access_ip_ranges']['get']['responses']['200']['content']['application/json']; type AccessIpRangesDelId = paths['/access_ip_ranges/{access_ip_range_id}']['delete']['parameters']['path']['access_ip_range_id']; diff --git a/types/AddressesResource.d.ts b/types/AddressesResource.d.ts index b2275d1..afb5f2b 100644 --- a/types/AddressesResource.d.ts +++ b/types/AddressesResource.d.ts @@ -9,25 +9,25 @@ declare module 'telnyx' { paths['/addresses/{id}']['get']['parameters']['query']; type AddressesRetrieveResponse = - paths['/addresses/{id}']['get']['responses']['200']['content']['application/json']['data']; + paths['/addresses/{id}']['get']['responses']['200']['content']['application/json']; type AddressesCreateParams = paths['/addresses']['post']['requestBody']['content']['application/json']; type AddressesCreateResponse = - paths['/addresses']['post']['responses']['200']['content']['application/json']['data']; + paths['/addresses']['post']['responses']['200']['content']['application/json']; type AddressesValidateParams = paths['/addresses/actions/validate']['post']['requestBody']['content']['application/json']; type AddressesValidateResponse = - paths['/addresses/actions/validate']['post']['responses']['200']['content']['application/json']['data']; + paths['/addresses/actions/validate']['post']['responses']['200']['content']['application/json']; type AddressesListParams = paths['/addresses']['get']['parameters']['query']; type AddressesListResponse = - paths['/addresses']['get']['responses']['200']['content']['application/json']['data']; + paths['/addresses']['get']['responses']['200']['content']['application/json']; type AddressesDelId = paths['/addresses/{id}']['delete']['parameters']['path']['id']; @@ -36,7 +36,7 @@ declare module 'telnyx' { paths['/addresses/{id}']['delete']['parameters']['query']; type AddressesDelResponse = - paths['/addresses/{id}']['delete']['responses']['200']['content']['application/json']['data']; + paths['/addresses/{id}']['delete']['responses']['200']['content']['application/json']; type AddressesNestedMethods = { del: AddressesResource['del']; diff --git a/types/AiAssistantsResource.d.ts b/types/AiAssistantsResource.d.ts new file mode 100644 index 0000000..4b9b031 --- /dev/null +++ b/types/AiAssistantsResource.d.ts @@ -0,0 +1,69 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiAssistantsRetrieveId = + paths['/ai/assistants/{assistant_id}']['get']['parameters']['path']['assistant_id']; + + type AiAssistantsRetrieveResponse = + paths['/ai/assistants/{assistant_id}']['get']['responses']['200']['content']['application/json']; + + type AiAssistantsListParams = + paths['/ai/assistants']['get']['parameters']['query']; + + type AiAssistantsListResponse = + paths['/ai/assistants']['get']['responses']['200']['content']['application/json']; + + type AiAssistantsCreateParams = + paths['/ai/assistants']['post']['requestBody']['content']['application/json']; + + type AiAssistantsCreateResponse = + paths['/ai/assistants']['post']['responses']['200']['content']['application/json']; + + type AiAssistantsDelId = + paths['/ai/assistants/{assistant_id}']['delete']['parameters']['path']['assistant_id']; + + type AiAssistantsDelParams = + paths['/ai/assistants/{assistant_id}']['delete']['parameters']['query']; + + type AiAssistantsDelResponse = + paths['/ai/assistants/{assistant_id}']['delete']['responses']['200']['content']['application/json']; + + type AiAssistantsUpdateId = + paths['/ai/assistants/{assistant_id}']['post']['parameters']['path']['assistant_id']; + + type AiAssistantsUpdateParams = + paths['/ai/assistants/{assistant_id}']['post']['requestBody']['content']['application/json']; + + type AiAssistantsUpdateResponse = + paths['/ai/assistants/{assistant_id}']['post']['responses']['200']['content']['application/json']; + + class AiAssistantsResource { + retrieve( + id: AiAssistantsRetrieveId, + options?: RequestOptions, + ): Promise>; + + list( + params?: AiAssistantsListParams, + options?: RequestOptions, + ): Promise>; + + create( + params: AiAssistantsCreateParams, + options?: RequestOptions, + ): Promise>; + + del( + id: AiAssistantsDelId, + options?: RequestOptions, + ): Promise>; + + update( + id: AiAssistantsUpdateId, + params: AiAssistantsUpdateParams, + options?: RequestOptions, + ): Promise>; + } + } +} diff --git a/types/AiAudioTranscriptionsResource.d.ts b/types/AiAudioTranscriptionsResource.d.ts new file mode 100644 index 0000000..e133053 --- /dev/null +++ b/types/AiAudioTranscriptionsResource.d.ts @@ -0,0 +1,18 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiAudioTranscriptionsCreateParams = + paths['/ai/audio/transcriptions']['post']['requestBody']['content']['multipart/form-data']; + + type AiAudioTranscriptionsCreateResponse = + paths['/ai/audio/transcriptions']['post']['responses']['200']['content']['application/json']; + + class AiAudioTranscriptionsResource { + create( + params: AiAudioTranscriptionsCreateParams, + options?: RequestOptions, + ): Promise>; + } + } +} diff --git a/types/AiChatCompletionsResource.d.ts b/types/AiChatCompletionsResource.d.ts new file mode 100644 index 0000000..dbc72f4 --- /dev/null +++ b/types/AiChatCompletionsResource.d.ts @@ -0,0 +1,18 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiChatCompletionsCreateParams = + paths['/ai/chat/completions']['post']['requestBody']['content']['application/json']; + + type AiChatCompletionsCreateResponse = + paths['/ai/chat/completions']['post']['responses']['200']['content']['application/json']; + + class AiChatCompletionsResource { + create( + params: AiChatCompletionsCreateParams, + options?: RequestOptions, + ): Promise>; + } + } +} diff --git a/types/AiEmbeddingsBucketsResource.d.ts b/types/AiEmbeddingsBucketsResource.d.ts new file mode 100644 index 0000000..4d9cd3a --- /dev/null +++ b/types/AiEmbeddingsBucketsResource.d.ts @@ -0,0 +1,46 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiEmbeddingsBucketsListParams = + paths['/ai/embeddings/buckets']['get']['parameters']['query']; + + type AiEmbeddingsBucketsListResponse = + paths['/ai/embeddings/buckets']['get']['responses']['200']['content']['application/json']; + + type AiEmbeddingsBucketsRetrieveId = + paths['/ai/embeddings/buckets/{bucket_name}']['get']['parameters']['path']['bucket_name']; + + type AiEmbeddingsBucketsRetrieveParams = + paths['/ai/embeddings/buckets/{bucket_name}']['get']['parameters']['query']; + + type AiEmbeddingsBucketsRetrieveResponse = + paths['/ai/embeddings/buckets/{bucket_name}']['get']['responses']['200']['content']['application/json']; + + type AiEmbeddingsBucketsDelId = + paths['/ai/embeddings/buckets/{bucket_name}']['delete']['parameters']['path']['bucket_name']; + + type AiEmbeddingsBucketsDelParams = + paths['/ai/embeddings/buckets/{bucket_name}']['delete']['parameters']['query']; + + type AiEmbeddingsBucketsDelResponse = + paths['/ai/embeddings/buckets/{bucket_name}']['delete']['responses']['200']['content']; + + class AiEmbeddingsBucketsResource { + list( + params?: AiEmbeddingsBucketsListParams, + options?: RequestOptions, + ): Promise>; + + retrieve( + id: AiEmbeddingsBucketsRetrieveId, + options?: RequestOptions, + ): Promise>; + + del( + id: AiEmbeddingsBucketsDelId, + options?: RequestOptions, + ): Promise>; + } + } +} diff --git a/types/AiEmbeddingsResource.d.ts b/types/AiEmbeddingsResource.d.ts new file mode 100644 index 0000000..7403856 --- /dev/null +++ b/types/AiEmbeddingsResource.d.ts @@ -0,0 +1,43 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiEmbeddingsRetrieveId = + paths['/ai/embeddings/{task_id}']['get']['parameters']['path']['task_id']; + + type AiEmbeddingsRetrieveParams = + paths['/ai/embeddings/{task_id}']['get']['parameters']['query']; + + type AiEmbeddingsRetrieveResponse = + paths['/ai/embeddings/{task_id}']['get']['responses']['200']['content']['application/json']; + + type AiEmbeddingsListParams = + paths['/ai/embeddings']['get']['parameters']['query']; + + type AiEmbeddingsListResponse = + paths['/ai/embeddings']['get']['responses']['200']['content']['application/json']; + + type AiEmbeddingsCreateParams = + paths['/ai/embeddings']['post']['requestBody']['content']['application/json']; + + type AiEmbeddingsCreateResponse = + paths['/ai/embeddings']['post']['responses']['200']['content']['application/json']; + + class AiEmbeddingsResource { + retrieve( + id: AiEmbeddingsRetrieveId, + options?: RequestOptions, + ): Promise>; + + list( + params?: AiEmbeddingsListParams, + options?: RequestOptions, + ): Promise>; + + create( + params: AiEmbeddingsCreateParams, + options?: RequestOptions, + ): Promise>; + } + } +} diff --git a/types/AiEmbeddingsSimilaritySearchResource.d.ts b/types/AiEmbeddingsSimilaritySearchResource.d.ts new file mode 100644 index 0000000..01068cb --- /dev/null +++ b/types/AiEmbeddingsSimilaritySearchResource.d.ts @@ -0,0 +1,20 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiEmbeddingsSimilaritySearchCreateParams = + paths['/ai/embeddings/similarity-search']['post']['requestBody']['content']['application/json']; + + type AiEmbeddingsSimilaritySearchCreateResponse = + paths['/ai/embeddings/similarity-search']['post']['responses']['200']['content']['application/json']; + + class AiEmbeddingsSimilaritySearchResource { + create( + params: AiEmbeddingsSimilaritySearchCreateParams, + options?: RequestOptions, + ): Promise< + Telnyx.Response + >; + } + } +} diff --git a/types/AiModelsResource.d.ts b/types/AiModelsResource.d.ts new file mode 100644 index 0000000..c5802a8 --- /dev/null +++ b/types/AiModelsResource.d.ts @@ -0,0 +1,17 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiModelsListParams = paths['/ai/models']['get']['parameters']['query']; + + type AiModelsListResponse = + paths['/ai/models']['get']['responses']['200']['content']['application/json']; + + class AiModelsResource { + list( + params?: AiModelsListParams, + options?: RequestOptions, + ): Promise>; + } + } +} diff --git a/types/AiSummarizeResource.d.ts b/types/AiSummarizeResource.d.ts new file mode 100644 index 0000000..f9ac272 --- /dev/null +++ b/types/AiSummarizeResource.d.ts @@ -0,0 +1,18 @@ +import {paths} from './TelnyxAPI.js'; + +declare module 'telnyx' { + namespace Telnyx { + type AiSummarizeCreateParams = + paths['/ai/summarize']['post']['requestBody']['content']['application/json']; + + type AiSummarizeCreateResponse = + paths['/ai/summarize']['post']['responses']['200']['content']['application/json']; + + class AiSummarizeResource { + create( + params: AiSummarizeCreateParams, + options?: RequestOptions, + ): Promise>; + } + } +} diff --git a/types/AutorespConfigsResource.d.ts b/types/AutorespConfigsResource.d.ts index 4ef1142..6f145ee 100644 --- a/types/AutorespConfigsResource.d.ts +++ b/types/AutorespConfigsResource.d.ts @@ -6,7 +6,7 @@ declare module 'telnyx' { paths['/messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}']['get']['parameters']['path']; type AutorespConfigsRetrieveResponse = - paths['/messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}']['get']['responses']['200']['content']['application/json']; type AutorespConfigsCreatePathParams = paths['/messaging_profiles/{profile_id}/autoresp_configs']['post']['parameters']['path']; @@ -15,7 +15,7 @@ declare module 'telnyx' { paths['/messaging_profiles/{profile_id}/autoresp_configs']['post']['requestBody']['content']['application/json']; type AutorespConfigsCreateResponse = - paths['/messaging_profiles/{profile_id}/autoresp_configs']['post']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{profile_id}/autoresp_configs']['post']['responses']['200']['content']['application/json']; type AutorespConfigsListPathParams = paths['/messaging_profiles/{profile_id}/autoresp_configs']['get']['parameters']['path']; @@ -24,7 +24,7 @@ declare module 'telnyx' { paths['/messaging_profiles/{profile_id}/autoresp_configs']['get']['parameters']['query']; type AutorespConfigsListResponse = - paths['/messaging_profiles/{profile_id}/autoresp_configs']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{profile_id}/autoresp_configs']['get']['responses']['200']['content']['application/json']; type AutorespConfigsDelPathParams = paths['/messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}']['delete']['parameters']['path']; @@ -39,7 +39,7 @@ declare module 'telnyx' { paths['/messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}']['put']['requestBody']['content']['application/json']; type AutorespConfigsUpdateResponse = - paths['/messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}']['put']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{profile_id}/autoresp_configs/{autoresp_cfg_id}']['put']['responses']['200']['content']['application/json']; class AutorespConfigsResource { retrieve( diff --git a/types/AvailablePhoneNumbersResource.d.ts b/types/AvailablePhoneNumbersResource.d.ts index b4dc8ab..3aeb4fc 100644 --- a/types/AvailablePhoneNumbersResource.d.ts +++ b/types/AvailablePhoneNumbersResource.d.ts @@ -6,7 +6,7 @@ declare module 'telnyx' { paths['/available_phone_numbers']['get']['parameters']['query']; type AvailablePhoneNumbersListResponse = - paths['/available_phone_numbers']['get']['responses']['200']['content']['application/json']['data']; + paths['/available_phone_numbers']['get']['responses']['200']['content']['application/json']; class AvailablePhoneNumbersResource { list( diff --git a/types/BalanceResource.d.ts b/types/BalanceResource.d.ts index 99afb8e..c9b92a9 100644 --- a/types/BalanceResource.d.ts +++ b/types/BalanceResource.d.ts @@ -6,7 +6,7 @@ declare module 'telnyx' { paths['/balance']['get']['parameters']['query']; type BalanceRetrieveResponse = - paths['/balance']['get']['responses']['200']['content']['application/json']['data']; + paths['/balance']['get']['responses']['200']['content']['application/json']; class BalanceResource { /** Get user balance details */ diff --git a/types/BillingGroupsResource.d.ts b/types/BillingGroupsResource.d.ts index d13772c..ac60679 100644 --- a/types/BillingGroupsResource.d.ts +++ b/types/BillingGroupsResource.d.ts @@ -9,19 +9,19 @@ declare module 'telnyx' { paths['/billing_groups/{id}']['get']['parameters']['query']; type BillingGroupsRetrieveResponse = - paths['/billing_groups/{id}']['get']['responses']['200']['content']['application/json']['data']; + paths['/billing_groups/{id}']['get']['responses']['200']['content']['application/json']; type BillingGroupsListParams = paths['/billing_groups']['get']['parameters']['query']; type BillingGroupsListResponse = - paths['/billing_groups']['get']['responses']['200']['content']['application/json']['data']; + paths['/billing_groups']['get']['responses']['200']['content']['application/json']; type BillingGroupsCreateParams = paths['/billing_groups']['post']['requestBody']['content']['application/json']; type BillingGroupsCreateResponse = - paths['/billing_groups']['post']['responses']['200']['content']['application/json']['data']; + paths['/billing_groups']['post']['responses']['200']['content']['application/json']; type BillingGroupsDelId = paths['/billing_groups/{id}']['delete']['parameters']['path']['id']; @@ -30,7 +30,7 @@ declare module 'telnyx' { paths['/billing_groups/{id}']['delete']['parameters']['query']; type BillingGroupsDelResponse = - paths['/billing_groups/{id}']['delete']['responses']['200']['content']['application/json']['data']; + paths['/billing_groups/{id}']['delete']['responses']['200']['content']['application/json']; type BillingGroupsUpdateId = paths['/billing_groups/{id}']['patch']['parameters']['path']['id']; @@ -39,7 +39,7 @@ declare module 'telnyx' { paths['/billing_groups/{id}']['patch']['requestBody']['content']['application/json']; type BillingGroupsUpdateResponse = - paths['/billing_groups/{id}']['patch']['responses']['200']['content']['application/json']['data']; + paths['/billing_groups/{id}']['patch']['responses']['200']['content']['application/json']; class BillingGroupsResource { retrieve( diff --git a/types/CallsResource.d.ts b/types/CallsResource.d.ts index 2115709..c0d2f73 100644 --- a/types/CallsResource.d.ts +++ b/types/CallsResource.d.ts @@ -9,13 +9,13 @@ declare module 'telnyx' { paths['/calls/{call_control_id}']['get']['parameters']['query']; type CallsRetrieveResponse = - paths['/calls/{call_control_id}']['get']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}']['get']['responses']['200']['content']['application/json']; type CallsCreateParams = paths['/calls']['post']['requestBody']['content']['application/json']; type CallsCreateResponse = - paths['/calls']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls']['post']['responses']['200']['content']['application/json']; type CallsAnswerParams = paths['/calls/{call_control_id}/actions/answer']['post']['requestBody']['content']['application/json']; @@ -75,61 +75,61 @@ declare module 'telnyx' { paths['/calls/{call_control_id}/actions/leave_queue']['post']['requestBody']['content']['application/json']; type CallsAnswerResponse = - paths['/calls/{call_control_id}/actions/answer']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/answer']['post']['responses']['200']['content']['application/json']; type CallsRejectResponse = - paths['/calls/{call_control_id}/actions/reject']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/reject']['post']['responses']['200']['content']['application/json']; type CallsHangupResponse = - paths['/calls/{call_control_id}/actions/hangup']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/hangup']['post']['responses']['200']['content']['application/json']; type CallsBridgeResponse = - paths['/calls/{call_control_id}/actions/bridge']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/bridge']['post']['responses']['200']['content']['application/json']; type CallsSpeakResponse = - paths['/calls/{call_control_id}/actions/speak']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/speak']['post']['responses']['200']['content']['application/json']; type CallsForkStartResponse = - paths['/calls/{call_control_id}/actions/fork_start']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/fork_start']['post']['responses']['200']['content']['application/json']; type CallsForkStopResponse = - paths['/calls/{call_control_id}/actions/fork_stop']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/fork_stop']['post']['responses']['200']['content']['application/json']; type CallsGatherResponse = - paths['/calls/{call_control_id}/actions/gather']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/gather']['post']['responses']['200']['content']['application/json']; type CallsGatherUsingAudioResponse = - paths['/calls/{call_control_id}/actions/gather_using_audio']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/gather_using_audio']['post']['responses']['200']['content']['application/json']; type CallsGatherUsingSpeakResponse = - paths['/calls/{call_control_id}/actions/gather_using_speak']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/gather_using_speak']['post']['responses']['200']['content']['application/json']; type CallsGatherStopResponse = - paths['/calls/{call_control_id}/actions/gather_stop']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/gather_stop']['post']['responses']['200']['content']['application/json']; type CallsPlaybackStartResponse = - paths['/calls/{call_control_id}/actions/playback_start']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/playback_start']['post']['responses']['200']['content']['application/json']; type CallsPlaybackStopResponse = - paths['/calls/{call_control_id}/actions/playback_stop']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/playback_stop']['post']['responses']['200']['content']['application/json']; type CallsRecordStartResponse = - paths['/calls/{call_control_id}/actions/record_start']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/record_start']['post']['responses']['200']['content']['application/json']; type CallsRecordStopResponse = - paths['/calls/{call_control_id}/actions/record_stop']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/record_stop']['post']['responses']['200']['content']['application/json']; type CallsRecordPauseResponse = - paths['/calls/{call_control_id}/actions/record_pause']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/record_pause']['post']['responses']['200']['content']['application/json']; type CallsRecordResumeResponse = - paths['/calls/{call_control_id}/actions/record_resume']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/record_resume']['post']['responses']['200']['content']['application/json']; type CallsReferResponse = - paths['/calls/{call_control_id}/actions/refer']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/refer']['post']['responses']['200']['content']['application/json']; type CallsSendDtmfResponse = - paths['/calls/{call_control_id}/actions/send_dtmf']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/send_dtmf']['post']['responses']['200']['content']['application/json']; type CallsStreamingStartResponse = - paths['/calls/{call_control_id}/actions/streaming_start']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/streaming_start']['post']['responses']['200']['content']['application/json']; type CallsStreamingStopResponse = - paths['/calls/{call_control_id}/actions/streaming_stop']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/streaming_stop']['post']['responses']['200']['content']['application/json']; type CallsSuppressionStartResponse = - paths['/calls/{call_control_id}/actions/suppression_start']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/suppression_start']['post']['responses']['200']['content']['application/json']; type CallsSuppressionStopResponse = - paths['/calls/{call_control_id}/actions/suppression_stop']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/suppression_stop']['post']['responses']['200']['content']['application/json']; type CallsTransferResponse = - paths['/calls/{call_control_id}/actions/transfer']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/transfer']['post']['responses']['200']['content']['application/json']; type CallsTranscriptionStartResponse = - paths['/calls/{call_control_id}/actions/transcription_start']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/transcription_start']['post']['responses']['200']['content']['application/json']; type CallsTranscriptionStopResponse = - paths['/calls/{call_control_id}/actions/transcription_stop']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/transcription_stop']['post']['responses']['200']['content']['application/json']; type CallsEnqueueResponse = - paths['/calls/{call_control_id}/actions/enqueue']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/enqueue']['post']['responses']['200']['content']['application/json']; type CallsLeaveQueueResponse = - paths['/calls/{call_control_id}/actions/leave_queue']['post']['responses']['200']['content']['application/json']['data']; + paths['/calls/{call_control_id}/actions/leave_queue']['post']['responses']['200']['content']['application/json']; type CallsNestedMethods = { answer: CallsResource['answer']; diff --git a/types/MessagingProfileMetricsResource.d.ts b/types/MessagingProfileMetricsResource.d.ts index dab0492..b39d8f4 100644 --- a/types/MessagingProfileMetricsResource.d.ts +++ b/types/MessagingProfileMetricsResource.d.ts @@ -6,7 +6,7 @@ declare module 'telnyx' { paths['/messaging_profile_metrics']['get']['parameters']['query']; type MessagingProfilesListMetricsResponse = - paths['/messaging_profile_metrics']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profile_metrics']['get']['responses']['200']['content']['application/json']; class MessagingProfileMetricsResource { listMetrics( diff --git a/types/MessagingProfilesResource.d.ts b/types/MessagingProfilesResource.d.ts index 0145398..119db7e 100644 --- a/types/MessagingProfilesResource.d.ts +++ b/types/MessagingProfilesResource.d.ts @@ -21,37 +21,37 @@ declare module 'telnyx' { paths['/messaging_profiles/{id}']['patch']['requestBody']['content']['application/json']; type MessagingProfilesRetrieveResponse = - paths['/messaging_profiles/{id}']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{id}']['get']['responses']['200']['content']['application/json']; type MessagingProfilesDelResponse = - paths['/messaging_profiles/{id}']['delete']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{id}']['delete']['responses']['200']['content']['application/json']; type MessagingProfilesUpdateResponse = - paths['/messaging_profiles/{id}']['patch']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{id}']['patch']['responses']['200']['content']['application/json']; type MessagingProfilesListParams = paths['/messaging_profiles']['get']['parameters']['query']; type MessagingProfilesListResponse = - paths['/messaging_profiles']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles']['get']['responses']['200']['content']['application/json']; type MessagingProfilesCreateParams = paths['/messaging_profiles']['post']['requestBody']['content']['application/json']; type MessagingProfilesCreateResponse = - paths['/messaging_profiles']['post']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles']['post']['responses']['200']['content']['application/json']; type MessagingProfilesListPhoneNumbersParams = paths['/messaging_profiles/{id}/phone_numbers']['get']['parameters']['query']; type MessagingProfilesListPhoneNumbersResponse = - paths['/messaging_profiles/{id}/phone_numbers']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{id}/phone_numbers']['get']['responses']['200']['content']['application/json']; type MessagingProfilesListShortCodesParams = paths['/messaging_profiles/{id}/short_codes']['get']['parameters']['query']; type MessagingProfilesListShortCodesResponse = - paths['/messaging_profiles/{id}/short_codes']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{id}/short_codes']['get']['responses']['200']['content']['application/json']; type MessagingProfilesRetrieveMetricsId = paths['/messaging_profiles/{id}/metrics']['get']['parameters']['path']['id']; @@ -60,7 +60,7 @@ declare module 'telnyx' { paths['/messaging_profiles/{id}/metrics']['get']['parameters']['query']; type MessagingProfilesRetrieveMetricsResponse = - paths['/messaging_profiles/{id}/metrics']['get']['responses']['200']['content']['application/json']['data']; + paths['/messaging_profiles/{id}/metrics']['get']['responses']['200']['content']['application/json']; type MessagingProfilesNestedMethods = { del: MessagingProfilesResource['del']; diff --git a/types/StorageBucketsResource.d.ts b/types/StorageBucketsResource.d.ts index 0de4fc3..0b65968 100644 --- a/types/StorageBucketsResource.d.ts +++ b/types/StorageBucketsResource.d.ts @@ -6,13 +6,13 @@ declare module 'telnyx' { paths['/storage/buckets/{bucketName}/usage/storage']['get']['parameters']['path']['bucketName']; type StorageBucketsUsageResponse = - paths['/storage/buckets/{bucketName}/usage/storage']['get']['responses']['200']['content']['application/json']['data']; + paths['/storage/buckets/{bucketName}/usage/storage']['get']['responses']['200']['content']['application/json']; type StorageBucketsAPIUsageName = paths['/storage/buckets/{bucketName}/usage/api']['get']['parameters']['path']['bucketName']; type StorageBucketsAPIUsageResponse = - paths['/storage/buckets/{bucketName}/usage/api']['get']['responses']['200']['content']['application/json']['data']; + paths['/storage/buckets/{bucketName}/usage/api']['get']['responses']['200']['content']['application/json']; type StorageBucketsSSLCertificateName = paths['/storage/buckets/{bucketName}/ssl_certificate']['get']['parameters']['path']['bucketName']; @@ -35,13 +35,13 @@ declare module 'telnyx' { : never; type StorageBucketsSSLCertificateResponse = - paths['/storage/buckets/{bucketName}/ssl_certificate']['get']['responses']['200']['content']['application/json']['data']; + paths['/storage/buckets/{bucketName}/ssl_certificate']['get']['responses']['200']['content']['application/json']; type StorageBucketsAddSSLCertificateResponse = - paths['/storage/buckets/{bucketName}/ssl_certificate']['put']['responses']['200']['content']['application/json']['data']; + paths['/storage/buckets/{bucketName}/ssl_certificate']['put']['responses']['200']['content']['application/json']; type StorageBucketsDelSSLCertificateResponse = - paths['/storage/buckets/{bucketName}/ssl_certificate']['delete']['responses']['200']['content']['application/json']['data']; + paths['/storage/buckets/{bucketName}/ssl_certificate']['delete']['responses']['200']['content']['application/json']; class StorageBucketsResource { usage( diff --git a/types/index.d.ts b/types/index.d.ts index bb7d7d4..773884e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -6,6 +6,15 @@ /// // Resources Imports +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// @@ -35,6 +44,14 @@ declare module 'telnyx' { TelnyxResource: Telnyx.TelnyxResource; // Resources + aiAssistants: Telnyx.AiAssistantsResource; + aiAudioTranscriptions: Telnyx.AiAudioTranscriptionsResource; + aiChatCompletions: Telnyx.AiChatCompletionsResource; + aiEmbeddings: Telnyx.AiEmbeddingsResource; + aiEmbeddingsBuckets: Telnyx.AiEmbeddingsBucketsResource; + aiEmbeddingsSimilaritySearch: Telnyx.AiEmbeddingsSimilaritySearchResource; + aiModels: Telnyx.AiModelsResource; + aiSummarize: Telnyx.AiSummarizeResource; accessIpAddress: Telnyx.AccessIpAddressResource; accessIpRanges: Telnyx.AccessIpRangesResource; autorespConfigs: Telnyx.AutorespConfigsResource; diff --git a/types/lib.d.ts b/types/lib.d.ts index 53a305d..0260d22 100644 --- a/types/lib.d.ts +++ b/types/lib.d.ts @@ -33,7 +33,7 @@ declare module 'telnyx' { headers?: Record; } - export type Response = {data: T} & { + export type Response = T & { lastResponse: { headers: Record; requestId: string;