telnyx 7.29.0 → 7.30.0
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/CHANGELOG.md +7 -0
- package/README.md +27 -0
- package/client.d.mts +9 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -10
- package/client.d.ts.map +1 -1
- package/client.js +0 -3
- package/client.js.map +1 -1
- package/client.mjs +0 -3
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +20 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +20 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +25 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +23 -0
- package/core/pagination.mjs.map +1 -1
- package/lib/login-token.d.mts +91 -0
- package/lib/login-token.d.mts.map +1 -0
- package/lib/login-token.d.ts +91 -0
- package/lib/login-token.d.ts.map +1 -0
- package/lib/login-token.js +190 -0
- package/lib/login-token.js.map +1 -0
- package/lib/login-token.mjs +151 -0
- package/lib/login-token.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +9 -4
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +9 -4
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/assistants/assistants.d.mts +191 -109
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +191 -109
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/assistants/index.d.mts +1 -1
- package/resources/ai/assistants/index.d.mts.map +1 -1
- package/resources/ai/assistants/index.d.ts +1 -1
- package/resources/ai/assistants/index.d.ts.map +1 -1
- package/resources/ai/assistants/index.js.map +1 -1
- package/resources/ai/assistants/index.mjs.map +1 -1
- package/resources/ai/chat.d.mts +3 -5
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +3 -5
- package/resources/ai/chat.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.d.mts +27 -2
- package/resources/ai/conversations/conversations.d.mts.map +1 -1
- package/resources/ai/conversations/conversations.d.ts +27 -2
- package/resources/ai/conversations/conversations.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.js +23 -1
- package/resources/ai/conversations/conversations.js.map +1 -1
- package/resources/ai/conversations/conversations.mjs +23 -1
- package/resources/ai/conversations/conversations.mjs.map +1 -1
- package/resources/ai/conversations/index.d.mts +1 -1
- package/resources/ai/conversations/index.d.mts.map +1 -1
- package/resources/ai/conversations/index.d.ts +1 -1
- package/resources/ai/conversations/index.d.ts.map +1 -1
- package/resources/ai/conversations/index.js.map +1 -1
- package/resources/ai/conversations/index.mjs.map +1 -1
- package/resources/ai/index.d.mts +2 -2
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +2 -2
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/memory/namespaces/index.d.mts +1 -1
- package/resources/ai/memory/namespaces/index.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/index.d.ts +1 -1
- package/resources/ai/memory/namespaces/index.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/index.js.map +1 -1
- package/resources/ai/memory/namespaces/index.mjs +1 -1
- package/resources/ai/memory/namespaces/index.mjs.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.d.mts +2 -2
- package/resources/ai/memory/namespaces/namespaces.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.d.ts +2 -2
- package/resources/ai/memory/namespaces/namespaces.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.js.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.mjs +1 -1
- package/resources/ai/memory/namespaces/namespaces.mjs.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.d.mts +3 -3
- package/resources/ai/memory/namespaces/profiles/profiles.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.d.ts +3 -3
- package/resources/ai/memory/namespaces/profiles/profiles.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.js.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.mjs.map +1 -1
- package/resources/ai/memory/namespaces/settings.d.mts +23 -27
- package/resources/ai/memory/namespaces/settings.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/settings.d.ts +23 -27
- package/resources/ai/memory/namespaces/settings.d.ts.map +1 -1
- package/resources/ai/openai/chat.d.mts +3 -5
- package/resources/ai/openai/chat.d.mts.map +1 -1
- package/resources/ai/openai/chat.d.ts +3 -5
- package/resources/ai/openai/chat.d.ts.map +1 -1
- package/resources/ai/tests/test-framework/v1/v1.d.mts +15 -5
- package/resources/ai/tests/test-framework/v1/v1.d.mts.map +1 -1
- package/resources/ai/tests/test-framework/v1/v1.d.ts +15 -5
- package/resources/ai/tests/test-framework/v1/v1.d.ts.map +1 -1
- package/resources/ai/tools.d.mts +222 -0
- package/resources/ai/tools.d.mts.map +1 -1
- package/resources/ai/tools.d.ts +222 -0
- package/resources/ai/tools.d.ts.map +1 -1
- package/resources/browser-sessions/actions.d.mts +13 -7
- package/resources/browser-sessions/actions.d.mts.map +1 -1
- package/resources/browser-sessions/actions.d.ts +13 -7
- package/resources/browser-sessions/actions.d.ts.map +1 -1
- package/resources/browser-sessions/browser-sessions.d.mts +6 -2
- package/resources/browser-sessions/browser-sessions.d.mts.map +1 -1
- package/resources/browser-sessions/browser-sessions.d.ts +6 -2
- package/resources/browser-sessions/browser-sessions.d.ts.map +1 -1
- package/resources/compute/funcs/export.d.mts +33 -35
- package/resources/compute/funcs/export.d.mts.map +1 -1
- package/resources/compute/funcs/export.d.ts +33 -35
- package/resources/compute/funcs/export.d.ts.map +1 -1
- package/resources/compute/funcs/funcs.d.mts +2 -2
- package/resources/compute/funcs/funcs.d.mts.map +1 -1
- package/resources/compute/funcs/funcs.d.ts +2 -2
- package/resources/compute/funcs/funcs.d.ts.map +1 -1
- package/resources/compute/funcs/funcs.js.map +1 -1
- package/resources/compute/funcs/funcs.mjs.map +1 -1
- package/resources/compute/funcs/index.d.mts +1 -1
- package/resources/compute/funcs/index.d.mts.map +1 -1
- package/resources/compute/funcs/index.d.ts +1 -1
- package/resources/compute/funcs/index.d.ts.map +1 -1
- package/resources/compute/funcs/index.js.map +1 -1
- package/resources/compute/funcs/index.mjs +1 -1
- package/resources/compute/funcs/index.mjs.map +1 -1
- package/resources/email/dedicated-ips/dedicated-ips.d.mts.map +1 -1
- package/resources/email/dedicated-ips/dedicated-ips.d.ts.map +1 -1
- package/resources/email/dedicated-ips/dedicated-ips.js +2 -2
- package/resources/email/dedicated-ips/dedicated-ips.js.map +1 -1
- package/resources/email/dedicated-ips/dedicated-ips.mjs +2 -2
- package/resources/email/dedicated-ips/dedicated-ips.mjs.map +1 -1
- package/resources/email-events.d.mts +84 -106
- package/resources/email-events.d.mts.map +1 -1
- package/resources/email-events.d.ts +84 -106
- package/resources/email-events.d.ts.map +1 -1
- package/resources/email-events.js +5 -1
- package/resources/email-events.js.map +1 -1
- package/resources/email-events.mjs +5 -1
- package/resources/email-events.mjs.map +1 -1
- package/resources/email-messages/email-messages.d.mts +1 -7
- package/resources/email-messages/email-messages.d.mts.map +1 -1
- package/resources/email-messages/email-messages.d.ts +1 -7
- package/resources/email-messages/email-messages.d.ts.map +1 -1
- package/resources/email-messages/email-messages.js.map +1 -1
- package/resources/email-messages/email-messages.mjs.map +1 -1
- package/resources/email-templates.d.mts +16 -70
- package/resources/email-templates.d.mts.map +1 -1
- package/resources/email-templates.d.ts +16 -70
- package/resources/email-templates.d.ts.map +1 -1
- package/resources/enterprises/enterprises.d.mts +2 -2
- package/resources/enterprises/enterprises.d.mts.map +1 -1
- package/resources/enterprises/enterprises.d.ts +2 -2
- package/resources/enterprises/enterprises.d.ts.map +1 -1
- package/resources/enterprises/enterprises.js.map +1 -1
- package/resources/enterprises/enterprises.mjs.map +1 -1
- package/resources/enterprises/index.d.mts +1 -1
- package/resources/enterprises/index.d.mts.map +1 -1
- package/resources/enterprises/index.d.ts +1 -1
- package/resources/enterprises/index.d.ts.map +1 -1
- package/resources/enterprises/index.js.map +1 -1
- package/resources/enterprises/index.mjs.map +1 -1
- package/resources/enterprises/reputation/external-verification.d.mts +26 -29
- package/resources/enterprises/reputation/external-verification.d.mts.map +1 -1
- package/resources/enterprises/reputation/external-verification.d.ts +26 -29
- package/resources/enterprises/reputation/external-verification.d.ts.map +1 -1
- package/resources/enterprises/reputation/external-verification.js +3 -3
- package/resources/enterprises/reputation/external-verification.js.map +1 -1
- package/resources/enterprises/reputation/external-verification.mjs +1 -1
- package/resources/enterprises/reputation/external-verification.mjs.map +1 -1
- package/resources/enterprises/reputation/index.d.mts +1 -1
- package/resources/enterprises/reputation/index.d.mts.map +1 -1
- package/resources/enterprises/reputation/index.d.ts +1 -1
- package/resources/enterprises/reputation/index.d.ts.map +1 -1
- package/resources/enterprises/reputation/index.js +2 -2
- package/resources/enterprises/reputation/index.js.map +1 -1
- package/resources/enterprises/reputation/index.mjs +1 -1
- package/resources/enterprises/reputation/index.mjs.map +1 -1
- package/resources/enterprises/reputation/reputation.d.mts +3 -3
- package/resources/enterprises/reputation/reputation.d.mts.map +1 -1
- package/resources/enterprises/reputation/reputation.d.ts +3 -3
- package/resources/enterprises/reputation/reputation.d.ts.map +1 -1
- package/resources/enterprises/reputation/reputation.js +2 -2
- package/resources/enterprises/reputation/reputation.js.map +1 -1
- package/resources/enterprises/reputation/reputation.mjs +3 -3
- package/resources/enterprises/reputation/reputation.mjs.map +1 -1
- package/resources/enterprises/verify-email.d.mts +27 -29
- package/resources/enterprises/verify-email.d.mts.map +1 -1
- package/resources/enterprises/verify-email.d.ts +27 -29
- package/resources/enterprises/verify-email.d.ts.map +1 -1
- package/resources/index.d.mts +3 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +32 -2
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +32 -2
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/messaging-profiles/messaging-profiles.d.mts +11 -0
- package/resources/messaging-profiles/messaging-profiles.d.mts.map +1 -1
- package/resources/messaging-profiles/messaging-profiles.d.ts +11 -0
- package/resources/messaging-profiles/messaging-profiles.d.ts.map +1 -1
- package/resources/messaging-profiles/messaging-profiles.js.map +1 -1
- package/resources/messaging-profiles/messaging-profiles.mjs.map +1 -1
- package/resources/number-lookup.d.mts +5 -0
- package/resources/number-lookup.d.mts.map +1 -1
- package/resources/number-lookup.d.ts +5 -0
- package/resources/number-lookup.d.ts.map +1 -1
- package/resources/pay-connectors.d.mts +7 -7
- package/resources/pay-connectors.d.mts.map +1 -1
- package/resources/pay-connectors.d.ts +7 -7
- package/resources/pay-connectors.d.ts.map +1 -1
- package/resources/phone-numbers/index.d.mts +1 -1
- package/resources/phone-numbers/index.d.mts.map +1 -1
- package/resources/phone-numbers/index.d.ts +1 -1
- package/resources/phone-numbers/index.d.ts.map +1 -1
- package/resources/phone-numbers/index.js.map +1 -1
- package/resources/phone-numbers/index.mjs.map +1 -1
- package/resources/phone-numbers/jobs.d.mts +21 -57
- package/resources/phone-numbers/jobs.d.mts.map +1 -1
- package/resources/phone-numbers/jobs.d.ts +21 -57
- package/resources/phone-numbers/jobs.d.ts.map +1 -1
- package/resources/phone-numbers/phone-numbers.d.mts +2 -2
- package/resources/phone-numbers/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers/phone-numbers.d.ts +2 -2
- package/resources/phone-numbers/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers/phone-numbers.js.map +1 -1
- package/resources/phone-numbers/phone-numbers.mjs.map +1 -1
- package/resources/portouts/portouts.d.mts +2 -1
- package/resources/portouts/portouts.d.mts.map +1 -1
- package/resources/portouts/portouts.d.ts +2 -1
- package/resources/portouts/portouts.d.ts.map +1 -1
- package/resources/portouts/portouts.js +2 -1
- package/resources/portouts/portouts.js.map +1 -1
- package/resources/portouts/portouts.mjs +2 -1
- package/resources/portouts/portouts.mjs.map +1 -1
- package/resources/telephony-credentials.d.mts +78 -2
- package/resources/telephony-credentials.d.mts.map +1 -1
- package/resources/telephony-credentials.d.ts +78 -2
- package/resources/telephony-credentials.d.ts.map +1 -1
- package/resources/telephony-credentials.js +50 -2
- package/resources/telephony-credentials.js.map +1 -1
- package/resources/telephony-credentials.mjs +50 -2
- package/resources/telephony-credentials.mjs.map +1 -1
- package/resources/voice-clones.d.mts +4 -4
- package/resources/voice-clones.d.mts.map +1 -1
- package/resources/voice-clones.d.ts +4 -4
- package/resources/voice-clones.d.ts.map +1 -1
- package/resources/webhooks.d.mts +10 -20
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +10 -20
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/whatsapp/business-accounts/business-accounts.d.mts +2 -2
- package/resources/whatsapp/business-accounts/business-accounts.d.mts.map +1 -1
- package/resources/whatsapp/business-accounts/business-accounts.d.ts +2 -2
- package/resources/whatsapp/business-accounts/business-accounts.d.ts.map +1 -1
- package/resources/whatsapp/business-accounts/business-accounts.js.map +1 -1
- package/resources/whatsapp/business-accounts/business-accounts.mjs.map +1 -1
- package/resources/whatsapp/business-accounts/index.d.mts +1 -1
- package/resources/whatsapp/business-accounts/index.d.mts.map +1 -1
- package/resources/whatsapp/business-accounts/index.d.ts +1 -1
- package/resources/whatsapp/business-accounts/index.d.ts.map +1 -1
- package/resources/whatsapp/business-accounts/index.js.map +1 -1
- package/resources/whatsapp/business-accounts/index.mjs.map +1 -1
- package/resources/whatsapp/business-accounts/phone-numbers.d.mts +7 -66
- package/resources/whatsapp/business-accounts/phone-numbers.d.mts.map +1 -1
- package/resources/whatsapp/business-accounts/phone-numbers.d.ts +7 -66
- package/resources/whatsapp/business-accounts/phone-numbers.d.ts.map +1 -1
- package/resources/whatsapp/business-accounts/phone-numbers.js +1 -1
- package/resources/whatsapp/business-accounts/phone-numbers.js.map +1 -1
- package/resources/whatsapp/business-accounts/phone-numbers.mjs +1 -1
- package/resources/whatsapp/business-accounts/phone-numbers.mjs.map +1 -1
- package/resources/whatsapp/hosted-signups.d.mts +11 -73
- package/resources/whatsapp/hosted-signups.d.mts.map +1 -1
- package/resources/whatsapp/hosted-signups.d.ts +11 -73
- package/resources/whatsapp/hosted-signups.d.ts.map +1 -1
- package/resources/whatsapp/hosted-signups.js +5 -2
- package/resources/whatsapp/hosted-signups.js.map +1 -1
- package/resources/whatsapp/hosted-signups.mjs +5 -2
- package/resources/whatsapp/hosted-signups.mjs.map +1 -1
- package/resources/whatsapp/index.d.mts +2 -2
- package/resources/whatsapp/index.d.mts.map +1 -1
- package/resources/whatsapp/index.d.ts +2 -2
- package/resources/whatsapp/index.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/index.d.mts +1 -1
- package/resources/whatsapp/phone-numbers/index.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/index.d.ts +1 -1
- package/resources/whatsapp/phone-numbers/index.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.d.mts +9 -135
- package/resources/whatsapp/phone-numbers/phone-numbers.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.d.ts +9 -135
- package/resources/whatsapp/phone-numbers/phone-numbers.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.js +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.js.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.mjs +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.mjs.map +1 -1
- package/resources/whatsapp/whatsapp.d.mts +4 -4
- package/resources/whatsapp/whatsapp.d.mts.map +1 -1
- package/resources/whatsapp/whatsapp.d.ts +4 -4
- package/resources/whatsapp/whatsapp.d.ts.map +1 -1
- package/resources/whatsapp/whatsapp.mjs.map +1 -1
- package/src/client.ts +16 -5
- package/src/core/pagination.ts +58 -0
- package/src/lib/login-token.ts +223 -0
- package/src/resources/ai/ai.ts +12 -0
- package/src/resources/ai/assistants/assistants.ts +227 -144
- package/src/resources/ai/assistants/index.ts +2 -0
- package/src/resources/ai/chat.ts +3 -5
- package/src/resources/ai/conversations/conversations.ts +39 -1
- package/src/resources/ai/conversations/index.ts +1 -0
- package/src/resources/ai/index.ts +3 -0
- package/src/resources/ai/memory/namespaces/index.ts +7 -1
- package/src/resources/ai/memory/namespaces/namespaces.ts +9 -1
- package/src/resources/ai/memory/namespaces/profiles/profiles.ts +5 -3
- package/src/resources/ai/memory/namespaces/settings.ts +25 -27
- package/src/resources/ai/openai/chat.ts +3 -5
- package/src/resources/ai/tests/test-framework/v1/v1.ts +5 -5
- package/src/resources/ai/tools.ts +366 -0
- package/src/resources/browser-sessions/actions.ts +7 -7
- package/src/resources/browser-sessions/browser-sessions.ts +2 -2
- package/src/resources/compute/funcs/export.ts +41 -42
- package/src/resources/compute/funcs/funcs.ts +2 -1
- package/src/resources/compute/funcs/index.ts +6 -1
- package/src/resources/email/dedicated-ips/dedicated-ips.ts +3 -2
- package/src/resources/email-events.ts +128 -147
- package/src/resources/email-messages/email-messages.ts +1 -7
- package/src/resources/email-templates.ts +17 -78
- package/src/resources/enterprises/enterprises.ts +2 -0
- package/src/resources/enterprises/index.ts +1 -0
- package/src/resources/enterprises/reputation/external-verification.ts +32 -34
- package/src/resources/enterprises/reputation/index.ts +2 -1
- package/src/resources/enterprises/reputation/reputation.ts +6 -4
- package/src/resources/enterprises/verify-email.ts +29 -30
- package/src/resources/index.ts +4 -1
- package/src/resources/messages/messages.ts +32 -2
- package/src/resources/messaging-profiles/messaging-profiles.ts +12 -0
- package/src/resources/number-lookup.ts +6 -0
- package/src/resources/pay-connectors.ts +7 -7
- package/src/resources/phone-numbers/index.ts +2 -0
- package/src/resources/phone-numbers/jobs.ts +22 -60
- package/src/resources/phone-numbers/phone-numbers.ts +4 -0
- package/src/resources/portouts/portouts.ts +2 -1
- package/src/resources/telephony-credentials.ts +108 -2
- package/src/resources/voice-clones.ts +4 -4
- package/src/resources/webhooks.ts +10 -20
- package/src/resources/whatsapp/business-accounts/business-accounts.ts +0 -4
- package/src/resources/whatsapp/business-accounts/index.ts +0 -2
- package/src/resources/whatsapp/business-accounts/phone-numbers.ts +7 -98
- package/src/resources/whatsapp/hosted-signups.ts +18 -97
- package/src/resources/whatsapp/index.ts +4 -4
- package/src/resources/whatsapp/phone-numbers/index.ts +2 -2
- package/src/resources/whatsapp/phone-numbers/phone-numbers.ts +11 -197
- package/src/resources/whatsapp/whatsapp.ts +8 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/tts-integrations/actions.d.mts +0 -4
- package/resources/tts-integrations/actions.d.mts.map +0 -1
- package/resources/tts-integrations/actions.d.ts +0 -4
- package/resources/tts-integrations/actions.d.ts.map +0 -1
- package/resources/tts-integrations/actions.js +0 -9
- package/resources/tts-integrations/actions.js.map +0 -1
- package/resources/tts-integrations/actions.mjs +0 -5
- package/resources/tts-integrations/actions.mjs.map +0 -1
- package/resources/tts-integrations/index.d.mts +0 -3
- package/resources/tts-integrations/index.d.mts.map +0 -1
- package/resources/tts-integrations/index.d.ts +0 -3
- package/resources/tts-integrations/index.d.ts.map +0 -1
- package/resources/tts-integrations/index.js +0 -9
- package/resources/tts-integrations/index.js.map +0 -1
- package/resources/tts-integrations/index.mjs +0 -4
- package/resources/tts-integrations/index.mjs.map +0 -1
- package/resources/tts-integrations/tts-integrations.d.mts +0 -10
- package/resources/tts-integrations/tts-integrations.d.mts.map +0 -1
- package/resources/tts-integrations/tts-integrations.d.ts +0 -10
- package/resources/tts-integrations/tts-integrations.d.ts.map +0 -1
- package/resources/tts-integrations/tts-integrations.js +0 -17
- package/resources/tts-integrations/tts-integrations.js.map +0 -1
- package/resources/tts-integrations/tts-integrations.mjs +0 -12
- package/resources/tts-integrations/tts-integrations.mjs.map +0 -1
- package/resources/tts-integrations.d.mts +0 -2
- package/resources/tts-integrations.d.mts.map +0 -1
- package/resources/tts-integrations.d.ts +0 -2
- package/resources/tts-integrations.d.ts.map +0 -1
- package/resources/tts-integrations.js +0 -6
- package/resources/tts-integrations.js.map +0 -1
- package/resources/tts-integrations.mjs +0 -3
- package/resources/tts-integrations.mjs.map +0 -1
- package/src/resources/tts-integrations/actions.ts +0 -5
- package/src/resources/tts-integrations/index.ts +0 -4
- package/src/resources/tts-integrations/tts-integrations.ts +0 -15
- package/src/resources/tts-integrations.ts +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import * as HostedSignupsAPI from "./hosted-signups.mjs";
|
|
3
|
-
import { HostedSignupCreateParams, HostedSignupCreateResponse, HostedSignupListParams,
|
|
3
|
+
import { HostedSignupCreateParams, HostedSignupCreateResponse, HostedSignupListParams, HostedSignupRetrieveResponse, HostedSignups, WhatsappHostedSignup, WhatsappHostedSignupsDefaultFlatPagination } from "./hosted-signups.mjs";
|
|
4
4
|
import * as SignupAPI from "./signup.mjs";
|
|
5
5
|
import { Signup, SignupListParams, SignupListResponse, SignupListResponsesDefaultFlatPagination, SignupRetrieveStatusResponse } from "./signup.mjs";
|
|
6
6
|
import * as TemplatesAPI from "./templates.mjs";
|
|
@@ -10,7 +10,7 @@ import { UserData, UserDataRetrieveResponse, UserDataUpdateParams, UserDataUpdat
|
|
|
10
10
|
import * as BusinessAccountsAPI from "./business-accounts/business-accounts.mjs";
|
|
11
11
|
import { BusinessAccountListParams, BusinessAccountListResponse, BusinessAccountListResponsesDefaultFlatPagination, BusinessAccountRetrieveResponse, BusinessAccounts } from "./business-accounts/business-accounts.mjs";
|
|
12
12
|
import * as PhoneNumbersAPI from "./phone-numbers/phone-numbers.mjs";
|
|
13
|
-
import { PhoneNumberGetParams, PhoneNumberGetResponse, PhoneNumberListParams,
|
|
13
|
+
import { PhoneNumberGetParams, PhoneNumberGetResponse, PhoneNumberListParams, PhoneNumberResendVerificationParams, PhoneNumberRetrieveConversationWindowParams, PhoneNumberRetrieveConversationWindowResponse, PhoneNumberRetrievePhoneNumberResponse, PhoneNumberVerifyParams, PhoneNumbers, WhatsappPhoneResponse, WhatsappPhoneResponsesDefaultFlatPagination } from "./phone-numbers/phone-numbers.mjs";
|
|
14
14
|
export declare class Whatsapp extends APIResource {
|
|
15
15
|
businessAccounts: BusinessAccountsAPI.BusinessAccounts;
|
|
16
16
|
templates: TemplatesAPI.Templates;
|
|
@@ -22,9 +22,9 @@ export declare class Whatsapp extends APIResource {
|
|
|
22
22
|
export declare namespace Whatsapp {
|
|
23
23
|
export { BusinessAccounts as BusinessAccounts, type BusinessAccountRetrieveResponse as BusinessAccountRetrieveResponse, type BusinessAccountListResponse as BusinessAccountListResponse, type BusinessAccountListResponsesDefaultFlatPagination as BusinessAccountListResponsesDefaultFlatPagination, type BusinessAccountListParams as BusinessAccountListParams, };
|
|
24
24
|
export { Templates as Templates, type WhatsappTemplateBodyComponent as WhatsappTemplateBodyComponent, type WhatsappTemplateButtonsComponent as WhatsappTemplateButtonsComponent, type WhatsappTemplateCarouselComponent as WhatsappTemplateCarouselComponent, type WhatsappTemplateFooterComponent as WhatsappTemplateFooterComponent, type WhatsappTemplateHeaderComponent as WhatsappTemplateHeaderComponent, type TemplateCreateResponse as TemplateCreateResponse, type TemplateListParams as TemplateListParams, type TemplateCreateParams as TemplateCreateParams, };
|
|
25
|
-
export { PhoneNumbers as PhoneNumbers, type
|
|
25
|
+
export { PhoneNumbers as PhoneNumbers, type WhatsappPhoneResponse as WhatsappPhoneResponse, type PhoneNumberGetResponse as PhoneNumberGetResponse, type PhoneNumberRetrieveConversationWindowResponse as PhoneNumberRetrieveConversationWindowResponse, type PhoneNumberRetrievePhoneNumberResponse as PhoneNumberRetrievePhoneNumberResponse, type WhatsappPhoneResponsesDefaultFlatPagination as WhatsappPhoneResponsesDefaultFlatPagination, type PhoneNumberListParams as PhoneNumberListParams, type PhoneNumberResendVerificationParams as PhoneNumberResendVerificationParams, type PhoneNumberVerifyParams as PhoneNumberVerifyParams, type PhoneNumberRetrieveConversationWindowParams as PhoneNumberRetrieveConversationWindowParams, type PhoneNumberGetParams as PhoneNumberGetParams, };
|
|
26
26
|
export { UserData as UserData, type WhatsappUserData as WhatsappUserData, type UserDataRetrieveResponse as UserDataRetrieveResponse, type UserDataUpdateResponse as UserDataUpdateResponse, type UserDataUpdateParams as UserDataUpdateParams, };
|
|
27
27
|
export { Signup as Signup, type SignupListResponse as SignupListResponse, type SignupRetrieveStatusResponse as SignupRetrieveStatusResponse, type SignupListResponsesDefaultFlatPagination as SignupListResponsesDefaultFlatPagination, type SignupListParams as SignupListParams, };
|
|
28
|
-
export { HostedSignups as HostedSignups, type
|
|
28
|
+
export { HostedSignups as HostedSignups, type WhatsappHostedSignup as WhatsappHostedSignup, type HostedSignupCreateResponse as HostedSignupCreateResponse, type HostedSignupRetrieveResponse as HostedSignupRetrieveResponse, type WhatsappHostedSignupsDefaultFlatPagination as WhatsappHostedSignupsDefaultFlatPagination, type HostedSignupListParams as HostedSignupListParams, type HostedSignupCreateParams as HostedSignupCreateParams, };
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=whatsapp.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.d.mts","sourceRoot":"","sources":["../../src/resources/whatsapp/whatsapp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,gBAAgB,6BAAyB;AACrD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"whatsapp.d.mts","sourceRoot":"","sources":["../../src/resources/whatsapp/whatsapp.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as HostedSignupsAPI from "./hosted-signups.js";
|
|
3
|
-
import { HostedSignupCreateParams, HostedSignupCreateResponse, HostedSignupListParams,
|
|
3
|
+
import { HostedSignupCreateParams, HostedSignupCreateResponse, HostedSignupListParams, HostedSignupRetrieveResponse, HostedSignups, WhatsappHostedSignup, WhatsappHostedSignupsDefaultFlatPagination } from "./hosted-signups.js";
|
|
4
4
|
import * as SignupAPI from "./signup.js";
|
|
5
5
|
import { Signup, SignupListParams, SignupListResponse, SignupListResponsesDefaultFlatPagination, SignupRetrieveStatusResponse } from "./signup.js";
|
|
6
6
|
import * as TemplatesAPI from "./templates.js";
|
|
@@ -10,7 +10,7 @@ import { UserData, UserDataRetrieveResponse, UserDataUpdateParams, UserDataUpdat
|
|
|
10
10
|
import * as BusinessAccountsAPI from "./business-accounts/business-accounts.js";
|
|
11
11
|
import { BusinessAccountListParams, BusinessAccountListResponse, BusinessAccountListResponsesDefaultFlatPagination, BusinessAccountRetrieveResponse, BusinessAccounts } from "./business-accounts/business-accounts.js";
|
|
12
12
|
import * as PhoneNumbersAPI from "./phone-numbers/phone-numbers.js";
|
|
13
|
-
import { PhoneNumberGetParams, PhoneNumberGetResponse, PhoneNumberListParams,
|
|
13
|
+
import { PhoneNumberGetParams, PhoneNumberGetResponse, PhoneNumberListParams, PhoneNumberResendVerificationParams, PhoneNumberRetrieveConversationWindowParams, PhoneNumberRetrieveConversationWindowResponse, PhoneNumberRetrievePhoneNumberResponse, PhoneNumberVerifyParams, PhoneNumbers, WhatsappPhoneResponse, WhatsappPhoneResponsesDefaultFlatPagination } from "./phone-numbers/phone-numbers.js";
|
|
14
14
|
export declare class Whatsapp extends APIResource {
|
|
15
15
|
businessAccounts: BusinessAccountsAPI.BusinessAccounts;
|
|
16
16
|
templates: TemplatesAPI.Templates;
|
|
@@ -22,9 +22,9 @@ export declare class Whatsapp extends APIResource {
|
|
|
22
22
|
export declare namespace Whatsapp {
|
|
23
23
|
export { BusinessAccounts as BusinessAccounts, type BusinessAccountRetrieveResponse as BusinessAccountRetrieveResponse, type BusinessAccountListResponse as BusinessAccountListResponse, type BusinessAccountListResponsesDefaultFlatPagination as BusinessAccountListResponsesDefaultFlatPagination, type BusinessAccountListParams as BusinessAccountListParams, };
|
|
24
24
|
export { Templates as Templates, type WhatsappTemplateBodyComponent as WhatsappTemplateBodyComponent, type WhatsappTemplateButtonsComponent as WhatsappTemplateButtonsComponent, type WhatsappTemplateCarouselComponent as WhatsappTemplateCarouselComponent, type WhatsappTemplateFooterComponent as WhatsappTemplateFooterComponent, type WhatsappTemplateHeaderComponent as WhatsappTemplateHeaderComponent, type TemplateCreateResponse as TemplateCreateResponse, type TemplateListParams as TemplateListParams, type TemplateCreateParams as TemplateCreateParams, };
|
|
25
|
-
export { PhoneNumbers as PhoneNumbers, type
|
|
25
|
+
export { PhoneNumbers as PhoneNumbers, type WhatsappPhoneResponse as WhatsappPhoneResponse, type PhoneNumberGetResponse as PhoneNumberGetResponse, type PhoneNumberRetrieveConversationWindowResponse as PhoneNumberRetrieveConversationWindowResponse, type PhoneNumberRetrievePhoneNumberResponse as PhoneNumberRetrievePhoneNumberResponse, type WhatsappPhoneResponsesDefaultFlatPagination as WhatsappPhoneResponsesDefaultFlatPagination, type PhoneNumberListParams as PhoneNumberListParams, type PhoneNumberResendVerificationParams as PhoneNumberResendVerificationParams, type PhoneNumberVerifyParams as PhoneNumberVerifyParams, type PhoneNumberRetrieveConversationWindowParams as PhoneNumberRetrieveConversationWindowParams, type PhoneNumberGetParams as PhoneNumberGetParams, };
|
|
26
26
|
export { UserData as UserData, type WhatsappUserData as WhatsappUserData, type UserDataRetrieveResponse as UserDataRetrieveResponse, type UserDataUpdateResponse as UserDataUpdateResponse, type UserDataUpdateParams as UserDataUpdateParams, };
|
|
27
27
|
export { Signup as Signup, type SignupListResponse as SignupListResponse, type SignupRetrieveStatusResponse as SignupRetrieveStatusResponse, type SignupListResponsesDefaultFlatPagination as SignupListResponsesDefaultFlatPagination, type SignupListParams as SignupListParams, };
|
|
28
|
-
export { HostedSignups as HostedSignups, type
|
|
28
|
+
export { HostedSignups as HostedSignups, type WhatsappHostedSignup as WhatsappHostedSignup, type HostedSignupCreateResponse as HostedSignupCreateResponse, type HostedSignupRetrieveResponse as HostedSignupRetrieveResponse, type WhatsappHostedSignupsDefaultFlatPagination as WhatsappHostedSignupsDefaultFlatPagination, type HostedSignupListParams as HostedSignupListParams, type HostedSignupCreateParams as HostedSignupCreateParams, };
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=whatsapp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../src/resources/whatsapp/whatsapp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,gBAAgB,4BAAyB;AACrD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../src/resources/whatsapp/whatsapp.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.mjs","sourceRoot":"","sources":["../../src/resources/whatsapp/whatsapp.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,gBAAgB,6BAAyB;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"whatsapp.mjs","sourceRoot":"","sources":["../../src/resources/whatsapp/whatsapp.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,gBAAgB,6BAAyB;AACrD,OAAO,EAKL,aAAa,GAGd,6BAAyB;AAC1B,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EACL,MAAM,GAKP,qBAAiB;AAClB,OAAO,KAAK,YAAY,wBAAoB;AAC5C,OAAO,EAIL,SAAS,GAMV,wBAAoB;AACrB,OAAO,KAAK,WAAW,wBAAoB;AAC3C,OAAO,EACL,QAAQ,GAKT,wBAAoB;AACrB,OAAO,KAAK,mBAAmB,kDAA8C;AAC7E,OAAO,EAKL,gBAAgB,GACjB,kDAA8C;AAC/C,OAAO,KAAK,eAAe,0CAAsC;AACjE,OAAO,EASL,YAAY,GAGb,0CAAsC;AAEvC,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;QACF,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAED,QAAQ,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AAC7C,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;AAC/B,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AACrC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;AACzB,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC"}
|
package/src/client.ts
CHANGED
|
@@ -37,6 +37,8 @@ import {
|
|
|
37
37
|
EmailBracketCursorPaginationResponse,
|
|
38
38
|
type EmailCursorPaginationParams,
|
|
39
39
|
EmailCursorPaginationResponse,
|
|
40
|
+
type EmailEventsCursorPaginationParams,
|
|
41
|
+
EmailEventsCursorPaginationResponse,
|
|
40
42
|
type PerPagePaginationParams,
|
|
41
43
|
PerPagePaginationResponse,
|
|
42
44
|
type PerPagePaginationV2Params,
|
|
@@ -303,6 +305,7 @@ import {
|
|
|
303
305
|
import {
|
|
304
306
|
EmailEventListParams,
|
|
305
307
|
EmailEventListResponse,
|
|
308
|
+
EmailEventListResponsesEmailEventsCursorPagination,
|
|
306
309
|
EmailEventRetrieveStatsParams,
|
|
307
310
|
EmailEventRetrieveStatsResponse,
|
|
308
311
|
EmailEventType,
|
|
@@ -323,6 +326,7 @@ import {
|
|
|
323
326
|
EmailTemplates,
|
|
324
327
|
EmailTemplatesEmailCursorPagination,
|
|
325
328
|
UpdateEmailTemplateRequest,
|
|
329
|
+
VariableSchemaEntry,
|
|
326
330
|
} from './resources/email-templates';
|
|
327
331
|
import {
|
|
328
332
|
EmailThreadListParams,
|
|
@@ -966,10 +970,12 @@ import {
|
|
|
966
970
|
TelephonyCredentialDeleteResponse,
|
|
967
971
|
TelephonyCredentialListParams,
|
|
968
972
|
TelephonyCredentialRetrieveResponse,
|
|
973
|
+
TelephonyCredentialRetrieveTokenMaterialResponse,
|
|
969
974
|
TelephonyCredentialUpdateParams,
|
|
970
975
|
TelephonyCredentialUpdateResponse,
|
|
971
976
|
TelephonyCredentials,
|
|
972
977
|
TelephonyCredentialsDefaultFlatPagination,
|
|
978
|
+
TokenMaterial,
|
|
973
979
|
} from './resources/telephony-credentials';
|
|
974
980
|
import {
|
|
975
981
|
TexmlApplication,
|
|
@@ -1857,7 +1863,6 @@ import {
|
|
|
1857
1863
|
TextToSpeechListVoicesResponse,
|
|
1858
1864
|
TextToSpeechRetrieveSpeechParams,
|
|
1859
1865
|
} from './resources/text-to-speech/text-to-speech';
|
|
1860
|
-
import { TtsIntegrations } from './resources/tts-integrations/tts-integrations';
|
|
1861
1866
|
import {
|
|
1862
1867
|
Tunnel,
|
|
1863
1868
|
TunnelCreateParams,
|
|
@@ -3413,7 +3418,6 @@ export class Telnyx {
|
|
|
3413
3418
|
* Call information
|
|
3414
3419
|
*/
|
|
3415
3420
|
dialMetrics: API.DialMetrics = new API.DialMetrics(this);
|
|
3416
|
-
ttsIntegrations: API.TtsIntegrations = new API.TtsIntegrations(this);
|
|
3417
3421
|
/**
|
|
3418
3422
|
* Tailscale Subnet Router operations
|
|
3419
3423
|
*/
|
|
@@ -3630,7 +3634,6 @@ Telnyx.SpendLimits = SpendLimits;
|
|
|
3630
3634
|
Telnyx.LlmTokenGateway = LlmTokenGateway;
|
|
3631
3635
|
Telnyx.SipRegistrationStatus = SipRegistrationStatus;
|
|
3632
3636
|
Telnyx.DialMetrics = DialMetrics;
|
|
3633
|
-
Telnyx.TtsIntegrations = TtsIntegrations;
|
|
3634
3637
|
Telnyx.TailscaleSubnetRouters = TailscaleSubnetRouters;
|
|
3635
3638
|
Telnyx.ArtifactDownloads = ArtifactDownloads;
|
|
3636
3639
|
Telnyx.Email = Email;
|
|
@@ -3701,6 +3704,12 @@ export declare namespace Telnyx {
|
|
|
3701
3704
|
type EmailCursorPaginationResponse as EmailCursorPaginationResponse,
|
|
3702
3705
|
};
|
|
3703
3706
|
|
|
3707
|
+
export import EmailEventsCursorPagination = Pagination.EmailEventsCursorPagination;
|
|
3708
|
+
export {
|
|
3709
|
+
type EmailEventsCursorPaginationParams as EmailEventsCursorPaginationParams,
|
|
3710
|
+
type EmailEventsCursorPaginationResponse as EmailEventsCursorPaginationResponse,
|
|
3711
|
+
};
|
|
3712
|
+
|
|
3704
3713
|
export import EmailBracketCursorPagination = Pagination.EmailBracketCursorPagination;
|
|
3705
3714
|
export {
|
|
3706
3715
|
type EmailBracketCursorPaginationParams as EmailBracketCursorPaginationParams,
|
|
@@ -5137,11 +5146,13 @@ export declare namespace Telnyx {
|
|
|
5137
5146
|
export {
|
|
5138
5147
|
TelephonyCredentials as TelephonyCredentials,
|
|
5139
5148
|
type TelephonyCredential as TelephonyCredential,
|
|
5149
|
+
type TokenMaterial as TokenMaterial,
|
|
5140
5150
|
type TelephonyCredentialCreateResponse as TelephonyCredentialCreateResponse,
|
|
5141
5151
|
type TelephonyCredentialRetrieveResponse as TelephonyCredentialRetrieveResponse,
|
|
5142
5152
|
type TelephonyCredentialUpdateResponse as TelephonyCredentialUpdateResponse,
|
|
5143
5153
|
type TelephonyCredentialDeleteResponse as TelephonyCredentialDeleteResponse,
|
|
5144
5154
|
type TelephonyCredentialCreateTokenResponse as TelephonyCredentialCreateTokenResponse,
|
|
5155
|
+
type TelephonyCredentialRetrieveTokenMaterialResponse as TelephonyCredentialRetrieveTokenMaterialResponse,
|
|
5145
5156
|
type TelephonyCredentialsDefaultFlatPagination as TelephonyCredentialsDefaultFlatPagination,
|
|
5146
5157
|
type TelephonyCredentialListParams as TelephonyCredentialListParams,
|
|
5147
5158
|
type TelephonyCredentialCreateParams as TelephonyCredentialCreateParams,
|
|
@@ -5600,6 +5611,7 @@ export declare namespace Telnyx {
|
|
|
5600
5611
|
type TimeRange as TimeRange,
|
|
5601
5612
|
type EmailEventListResponse as EmailEventListResponse,
|
|
5602
5613
|
type EmailEventRetrieveStatsResponse as EmailEventRetrieveStatsResponse,
|
|
5614
|
+
type EmailEventListResponsesEmailEventsCursorPagination as EmailEventListResponsesEmailEventsCursorPagination,
|
|
5603
5615
|
type EmailEventListParams as EmailEventListParams,
|
|
5604
5616
|
type EmailEventRetrieveStatsParams as EmailEventRetrieveStatsParams,
|
|
5605
5617
|
};
|
|
@@ -5637,6 +5649,7 @@ export declare namespace Telnyx {
|
|
|
5637
5649
|
type EmailTemplateCommon as EmailTemplateCommon,
|
|
5638
5650
|
type EmailTemplateResponse as EmailTemplateResponse,
|
|
5639
5651
|
type UpdateEmailTemplateRequest as UpdateEmailTemplateRequest,
|
|
5652
|
+
type VariableSchemaEntry as VariableSchemaEntry,
|
|
5640
5653
|
type EmailTemplateRenderResponse as EmailTemplateRenderResponse,
|
|
5641
5654
|
type EmailTemplatesEmailCursorPagination as EmailTemplatesEmailCursorPagination,
|
|
5642
5655
|
type EmailTemplateListParams as EmailTemplateListParams,
|
|
@@ -5760,8 +5773,6 @@ export declare namespace Telnyx {
|
|
|
5760
5773
|
type DialMetricListParams as DialMetricListParams,
|
|
5761
5774
|
};
|
|
5762
5775
|
|
|
5763
|
-
export { TtsIntegrations as TtsIntegrations };
|
|
5764
|
-
|
|
5765
5776
|
export {
|
|
5766
5777
|
TailscaleSubnetRouters as TailscaleSubnetRouters,
|
|
5767
5778
|
type TailscaleSubnetRouter as TailscaleSubnetRouter,
|
package/src/core/pagination.ts
CHANGED
|
@@ -663,6 +663,64 @@ export class EmailCursorPagination<Item>
|
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
|
|
666
|
+
export interface EmailEventsCursorPaginationResponse<Item> {
|
|
667
|
+
data: Array<Item>;
|
|
668
|
+
|
|
669
|
+
meta: EmailEventsCursorPaginationResponse.Meta;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export namespace EmailEventsCursorPaginationResponse {
|
|
673
|
+
export interface Meta {
|
|
674
|
+
page_cursor?: string;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export interface EmailEventsCursorPaginationParams {
|
|
679
|
+
'page[cursor]'?: string;
|
|
680
|
+
|
|
681
|
+
page_size?: number;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export class EmailEventsCursorPagination<Item>
|
|
685
|
+
extends AbstractPage<Item>
|
|
686
|
+
implements EmailEventsCursorPaginationResponse<Item>
|
|
687
|
+
{
|
|
688
|
+
data: Array<Item>;
|
|
689
|
+
|
|
690
|
+
meta: EmailEventsCursorPaginationResponse.Meta;
|
|
691
|
+
|
|
692
|
+
constructor(
|
|
693
|
+
client: Telnyx,
|
|
694
|
+
response: Response,
|
|
695
|
+
body: EmailEventsCursorPaginationResponse<Item>,
|
|
696
|
+
options: FinalRequestOptions,
|
|
697
|
+
) {
|
|
698
|
+
super(client, response, body, options);
|
|
699
|
+
|
|
700
|
+
this.data = body.data || [];
|
|
701
|
+
this.meta = body.meta || {};
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
getPaginatedItems(): Item[] {
|
|
705
|
+
return this.data ?? [];
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
nextPageRequestOptions(): PageRequestOptions | null {
|
|
709
|
+
const cursor = this.meta?.page_cursor;
|
|
710
|
+
if (!cursor) {
|
|
711
|
+
return null;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
return {
|
|
715
|
+
...this.options,
|
|
716
|
+
query: {
|
|
717
|
+
...maybeObj(this.options.query),
|
|
718
|
+
'page[cursor]': cursor,
|
|
719
|
+
},
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
666
724
|
export interface EmailBracketCursorPaginationResponse<Item> {
|
|
667
725
|
data: Array<Item>;
|
|
668
726
|
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebRTC login tokens minted locally, with no request to Telnyx.
|
|
3
|
+
*
|
|
4
|
+
* The token has the same shape as the one
|
|
5
|
+
* `POST /v2/telephony_credentials/{id}/token` returns, so it is used the same
|
|
6
|
+
* way: pass it to the WebRTC SDK as `login_token`. Telnyx verifies it on login.
|
|
7
|
+
* It is the same computation as `TelephonyCredential#to_jwt` in telnyx-ruby.
|
|
8
|
+
*
|
|
9
|
+
* The signing material comes from the credential: `token_material` is in the
|
|
10
|
+
* response of `POST /v2/telephony_credentials` and of
|
|
11
|
+
* `GET /v2/telephony_credentials/{id}/token_material`. It is as sensitive as
|
|
12
|
+
* the SIP password, so keep it on the server; never ship it to a browser.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { data: credential } = await client.telephonyCredentials.create({
|
|
16
|
+
* connection_id: '123',
|
|
17
|
+
* include: 'token_material', // the API returns the material only when asked
|
|
18
|
+
* });
|
|
19
|
+
* const loginToken = await client.telephonyCredentials.toJwt(credential); // 1 hour
|
|
20
|
+
* const shortLived = await client.telephonyCredentials.toJwt(credential, { ttl: 600 });
|
|
21
|
+
*
|
|
22
|
+
* To mint later with no request at all, store these with the user the credential
|
|
23
|
+
* belongs to, server side: `id`, `user_id`, `sip_username`, `expires_at` and
|
|
24
|
+
* `token_material`. The token is built from all of them.
|
|
25
|
+
*
|
|
26
|
+
* @example From stored values, without a request at all
|
|
27
|
+
* import { createLoginToken } from 'telnyx/lib/login-token';
|
|
28
|
+
* const loginToken = await createLoginToken({
|
|
29
|
+
* id: '...', user_id: '...', sip_username: 'gencred...', expires_at: '2027-01-01T00:00:00Z',
|
|
30
|
+
* token_material: { kid: 'v1', tel_token: '...', signing_secret: '...' },
|
|
31
|
+
* });
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import { TelnyxError } from '../core/error';
|
|
35
|
+
import { fromBase64, toBase64 } from '../internal/utils/base64';
|
|
36
|
+
import { decodeUTF8, encodeUTF8 } from '../internal/utils/bytes';
|
|
37
|
+
|
|
38
|
+
/** Token lifetime when `ttl` is not given: one hour. */
|
|
39
|
+
export const LOGIN_TOKEN_DEFAULT_TTL = 3600;
|
|
40
|
+
/** Longest lifetime a login token can have: one day, the same as API-minted tokens. */
|
|
41
|
+
export const LOGIN_TOKEN_MAX_TTL = 86400;
|
|
42
|
+
/** `cty` header of a locally minted token; voice-sdk-proxy selects the verification path by it. */
|
|
43
|
+
export const LOGIN_TOKEN_CONTENT_TYPE = 'telnyx-webrtc;v=1';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* What the API returns as `token_material`. `signing_secret` is base64url
|
|
47
|
+
* (unpadded) bytes of the HS256 key; `tel_token` goes into the token as is.
|
|
48
|
+
*
|
|
49
|
+
* Same shape as the generated `TokenMaterial` in `resources/telephony-credentials`,
|
|
50
|
+
* so a credential from the API can be passed as is; `createLoginToken` rejects
|
|
51
|
+
* material with a field missing.
|
|
52
|
+
*/
|
|
53
|
+
export interface TokenMaterial {
|
|
54
|
+
/** Which key the material was derived with (`v1` today). Goes in the JWT header. */
|
|
55
|
+
kid?: string | undefined;
|
|
56
|
+
/** The SIP credential encrypted for the gateway, the same value `/token` puts in the `tel_token` claim. */
|
|
57
|
+
tel_token?: string | undefined;
|
|
58
|
+
/** The HS256 key the token is signed with, base64url. */
|
|
59
|
+
signing_secret?: string | undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** The fields of a telephony credential that a login token is built from. */
|
|
63
|
+
export interface LoginTokenCredential {
|
|
64
|
+
/** The telephony credential `id`. */
|
|
65
|
+
id?: string | undefined;
|
|
66
|
+
/** The credential's `user_id`. */
|
|
67
|
+
user_id?: string | undefined;
|
|
68
|
+
/** The credential's `sip_username`; the token's `identity`. */
|
|
69
|
+
sip_username?: string | undefined;
|
|
70
|
+
/** The credential's `expires_at`, as the API returns it, or null. */
|
|
71
|
+
expires_at?: string | null | undefined;
|
|
72
|
+
/** `kid`, `tel_token`, `signing_secret`; present on a credential from `create`. */
|
|
73
|
+
token_material?: TokenMaterial | undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface LoginTokenOptions {
|
|
77
|
+
/** Token lifetime in seconds, 1..86400. Default one hour. */
|
|
78
|
+
ttl?: number | undefined;
|
|
79
|
+
/** Signing material to use instead of `credential.token_material`. */
|
|
80
|
+
tokenMaterial?: TokenMaterial | undefined;
|
|
81
|
+
/** The token's issue time; defaults to now. */
|
|
82
|
+
now?: Date | number | undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class TelnyxLoginTokenError extends TelnyxError {
|
|
86
|
+
constructor(message: string) {
|
|
87
|
+
super(message);
|
|
88
|
+
this.name = 'TelnyxLoginTokenError';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Mints a login token for `credential`, valid from `now` for `ttl` seconds.
|
|
94
|
+
* Pure computation: HMAC-SHA256 over the token with `token_material.signing_secret`.
|
|
95
|
+
*/
|
|
96
|
+
export async function createLoginToken(
|
|
97
|
+
credential: LoginTokenCredential,
|
|
98
|
+
options: LoginTokenOptions = {},
|
|
99
|
+
): Promise<string> {
|
|
100
|
+
const credentialId = required(credential.id, 'id');
|
|
101
|
+
const userId = required(credential.user_id, 'user_id');
|
|
102
|
+
const identity = required(credential.sip_username, 'sip_username');
|
|
103
|
+
const material = normalizeMaterial(options.tokenMaterial ?? credential.token_material);
|
|
104
|
+
const ttl = clampTtl(options.ttl);
|
|
105
|
+
const now = options.now === undefined ? Date.now() : Number(options.now);
|
|
106
|
+
const iat = Math.floor(now / 1000);
|
|
107
|
+
|
|
108
|
+
// Same field order as the Ruby SDK, so the two produce the same bytes.
|
|
109
|
+
const header = { alg: 'HS256', typ: 'JWT', cty: LOGIN_TOKEN_CONTENT_TYPE, kid: material.kid };
|
|
110
|
+
const payload = {
|
|
111
|
+
sub: credentialId,
|
|
112
|
+
user_id: userId,
|
|
113
|
+
identity,
|
|
114
|
+
cred_exp: credential.expires_at ?? null,
|
|
115
|
+
tel_token: material.tel_token,
|
|
116
|
+
iat,
|
|
117
|
+
nbf: iat,
|
|
118
|
+
exp: iat + ttl,
|
|
119
|
+
jti: `${credentialId}-${iat}`,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const signingInput = `${base64url(JSON.stringify(header))}.${base64url(JSON.stringify(payload))}`;
|
|
123
|
+
return `${signingInput}.${base64url(await sign(signingInput, material.signing_secret))}`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Checks a token minted by `createLoginToken` against `signingSecret` and
|
|
128
|
+
* returns its claims. For tests and debugging: Telnyx does the real
|
|
129
|
+
* verification on login.
|
|
130
|
+
*/
|
|
131
|
+
export async function decodeLoginToken(jwt: string, signingSecret: string): Promise<Record<string, unknown>> {
|
|
132
|
+
const [head, body, sig, ...rest] = String(jwt).split('.');
|
|
133
|
+
if (!head || !body || sig === undefined || rest.length) {
|
|
134
|
+
throw new TelnyxLoginTokenError('not a JWT');
|
|
135
|
+
}
|
|
136
|
+
const expected = await sign(`${head}.${body}`, signingSecret);
|
|
137
|
+
const given = fromBase64url(sig);
|
|
138
|
+
if (!bytesEqual(given, expected)) {
|
|
139
|
+
throw new TelnyxLoginTokenError('Signature is invalid and does not match the payload');
|
|
140
|
+
}
|
|
141
|
+
return JSON.parse(decodeUTF8(fromBase64url(body))) as Record<string, unknown>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function required(value: string | null | undefined, name: string): string {
|
|
145
|
+
if (value === undefined || value === null || String(value) === '') {
|
|
146
|
+
throw new TelnyxLoginTokenError(`${name} is required to mint a token`);
|
|
147
|
+
}
|
|
148
|
+
return String(value);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function normalizeMaterial(material: TokenMaterial | null | undefined): Record<keyof TokenMaterial, string> {
|
|
152
|
+
if (!material || typeof material !== 'object') {
|
|
153
|
+
throw new TelnyxLoginTokenError('token_material is required to mint a token');
|
|
154
|
+
}
|
|
155
|
+
const out = {} as Record<keyof TokenMaterial, string>;
|
|
156
|
+
for (const field of ['kid', 'tel_token', 'signing_secret'] as const) {
|
|
157
|
+
const value = material[field];
|
|
158
|
+
if (value === undefined || value === null || String(value) === '') {
|
|
159
|
+
throw new TelnyxLoginTokenError(`token_material.${field} is missing`);
|
|
160
|
+
}
|
|
161
|
+
out[field] = String(value);
|
|
162
|
+
}
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function clampTtl(ttl: number | undefined): number {
|
|
167
|
+
const n = ttl === undefined ? LOGIN_TOKEN_DEFAULT_TTL : Math.trunc(Number(ttl));
|
|
168
|
+
if (!Number.isFinite(n)) return LOGIN_TOKEN_DEFAULT_TTL;
|
|
169
|
+
return Math.min(LOGIN_TOKEN_MAX_TTL, Math.max(1, n));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function base64url(data: string | Uint8Array): string {
|
|
173
|
+
// Base64 pads with at most two '=': a bounded match keeps this linear on any input.
|
|
174
|
+
return toBase64(data)
|
|
175
|
+
.replace(/\+/g, '-')
|
|
176
|
+
.replace(/\//g, '_')
|
|
177
|
+
.replace(/={1,2}$/, '');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function fromBase64url(str: string): Uint8Array {
|
|
181
|
+
const b64 = str.replace(/-/g, '+').replace(/_/g, '/');
|
|
182
|
+
return fromBase64(b64 + '='.repeat((4 - (b64.length % 4)) % 4));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function bytesEqual(a: Uint8Array, b: Uint8Array): boolean {
|
|
186
|
+
if (a.length !== b.length) return false;
|
|
187
|
+
let diff = 0;
|
|
188
|
+
for (let i = 0; i < a.length; i++) diff |= a[i]! ^ b[i]!;
|
|
189
|
+
return diff === 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// HMAC-SHA256 through WebCrypto, which Node, Deno, Bun, browsers and edge runtimes all provide.
|
|
193
|
+
interface SubtleCryptoLike {
|
|
194
|
+
importKey(
|
|
195
|
+
format: string,
|
|
196
|
+
keyData: Uint8Array,
|
|
197
|
+
algorithm: { name: string; hash: string },
|
|
198
|
+
extractable: boolean,
|
|
199
|
+
keyUsages: string[],
|
|
200
|
+
): Promise<unknown>;
|
|
201
|
+
sign(algorithm: string, key: unknown, data: Uint8Array): Promise<ArrayBuffer>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async function getSubtle(): Promise<SubtleCryptoLike> {
|
|
205
|
+
if (typeof globalThis.crypto !== 'undefined' && globalThis.crypto.subtle) {
|
|
206
|
+
return globalThis.crypto.subtle as unknown as SubtleCryptoLike;
|
|
207
|
+
}
|
|
208
|
+
// Node.js < 19 may need webcrypto from crypto module
|
|
209
|
+
const nodeCrypto = await import('crypto');
|
|
210
|
+
return (nodeCrypto.webcrypto as unknown as { subtle: SubtleCryptoLike }).subtle;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async function sign(signingInput: string, signingSecret: string): Promise<Uint8Array> {
|
|
214
|
+
const subtle = await getSubtle();
|
|
215
|
+
const key = await subtle.importKey(
|
|
216
|
+
'raw',
|
|
217
|
+
fromBase64url(signingSecret),
|
|
218
|
+
{ name: 'HMAC', hash: 'SHA-256' },
|
|
219
|
+
false,
|
|
220
|
+
['sign'],
|
|
221
|
+
);
|
|
222
|
+
return new Uint8Array(await subtle.sign('HMAC', key, encodeUTF8(signingInput)));
|
|
223
|
+
}
|
package/src/resources/ai/ai.ts
CHANGED
|
@@ -124,7 +124,9 @@ import {
|
|
|
124
124
|
TelnyxAvatarSettings,
|
|
125
125
|
ToolNode,
|
|
126
126
|
ToolNodeReq,
|
|
127
|
+
TranscriptionChallenger,
|
|
127
128
|
TranscriptionEndpointingPlan,
|
|
129
|
+
TranscriptionFallbackModel,
|
|
128
130
|
TranscriptionSettings,
|
|
129
131
|
TranscriptionSettingsConfig,
|
|
130
132
|
TransferTool,
|
|
@@ -148,6 +150,7 @@ import {
|
|
|
148
150
|
Conversation,
|
|
149
151
|
ConversationAddMessageParams,
|
|
150
152
|
ConversationCreateParams,
|
|
153
|
+
ConversationDeleteDeleteParams,
|
|
151
154
|
ConversationListParams,
|
|
152
155
|
ConversationListResponse,
|
|
153
156
|
ConversationRetrieveConversationsInsightsResponse,
|
|
@@ -403,6 +406,12 @@ export interface ModelMetadata {
|
|
|
403
406
|
*/
|
|
404
407
|
base_model?: string | null;
|
|
405
408
|
|
|
409
|
+
/**
|
|
410
|
+
* Whether the model is in beta. New Telnyx-hosted models launch with `beta: true`;
|
|
411
|
+
* the label is removed once the model is established.
|
|
412
|
+
*/
|
|
413
|
+
beta?: boolean;
|
|
414
|
+
|
|
406
415
|
/**
|
|
407
416
|
* Short, human-readable summary of what the model is best suited for.
|
|
408
417
|
*/
|
|
@@ -741,7 +750,9 @@ export declare namespace AI {
|
|
|
741
750
|
type TelnyxAvatarSettings as TelnyxAvatarSettings,
|
|
742
751
|
type ToolNode as ToolNode,
|
|
743
752
|
type ToolNodeReq as ToolNodeReq,
|
|
753
|
+
type TranscriptionChallenger as TranscriptionChallenger,
|
|
744
754
|
type TranscriptionEndpointingPlan as TranscriptionEndpointingPlan,
|
|
755
|
+
type TranscriptionFallbackModel as TranscriptionFallbackModel,
|
|
745
756
|
type TranscriptionSettings as TranscriptionSettings,
|
|
746
757
|
type TranscriptionSettingsConfig as TranscriptionSettingsConfig,
|
|
747
758
|
type TransferTool as TransferTool,
|
|
@@ -808,6 +819,7 @@ export declare namespace AI {
|
|
|
808
819
|
type ConversationCreateParams as ConversationCreateParams,
|
|
809
820
|
type ConversationUpdateParams as ConversationUpdateParams,
|
|
810
821
|
type ConversationAddMessageParams as ConversationAddMessageParams,
|
|
822
|
+
type ConversationDeleteDeleteParams as ConversationDeleteDeleteParams,
|
|
811
823
|
};
|
|
812
824
|
|
|
813
825
|
export {
|