telnyx 7.22.0 → 7.23.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/client.d.mts +34 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +34 -4
- package/client.d.ts.map +1 -1
- package/client.js +30 -0
- package/client.js.map +1 -1
- package/client.mjs +30 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +6 -2
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +6 -2
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +4 -0
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +5 -1
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/assistants/assistants.d.mts +256 -46
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +256 -46
- 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/versions.d.mts +34 -12
- package/resources/ai/assistants/versions.d.mts.map +1 -1
- package/resources/ai/assistants/versions.d.ts +34 -12
- package/resources/ai/assistants/versions.d.ts.map +1 -1
- package/resources/ai/audio.d.mts +78 -43
- package/resources/ai/audio.d.mts.map +1 -1
- package/resources/ai/audio.d.ts +78 -43
- package/resources/ai/audio.d.ts.map +1 -1
- package/resources/ai/audio.js.map +1 -1
- package/resources/ai/audio.mjs.map +1 -1
- package/resources/ai/chat.d.mts +2 -10
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +2 -10
- package/resources/ai/chat.d.ts.map +1 -1
- package/resources/ai/chat.js.map +1 -1
- package/resources/ai/chat.mjs.map +1 -1
- package/resources/ai/index.d.mts +2 -1
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +2 -1
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js +3 -1
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs +2 -1
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/openai/chat.d.mts +10 -11
- package/resources/ai/openai/chat.d.mts.map +1 -1
- package/resources/ai/openai/chat.d.ts +10 -11
- package/resources/ai/openai/chat.d.ts.map +1 -1
- package/resources/ai/openai/chat.js.map +1 -1
- package/resources/ai/openai/chat.mjs.map +1 -1
- package/resources/ai/openai/index.d.mts +1 -1
- package/resources/ai/openai/index.d.mts.map +1 -1
- package/resources/ai/openai/index.d.ts +1 -1
- package/resources/ai/openai/index.d.ts.map +1 -1
- package/resources/ai/openai/index.js.map +1 -1
- package/resources/ai/openai/index.mjs +1 -1
- package/resources/ai/openai/index.mjs.map +1 -1
- package/resources/ai/openai/openai.d.mts +2 -2
- package/resources/ai/openai/openai.d.mts.map +1 -1
- package/resources/ai/openai/openai.d.ts +2 -2
- package/resources/ai/openai/openai.d.ts.map +1 -1
- package/resources/ai/openai/openai.js.map +1 -1
- package/resources/ai/openai/openai.mjs.map +1 -1
- package/resources/ai/typesafe/index.d.mts +3 -0
- package/resources/ai/typesafe/index.d.mts.map +1 -0
- package/resources/ai/typesafe/index.d.ts +3 -0
- package/resources/ai/typesafe/index.d.ts.map +1 -0
- package/resources/ai/typesafe/index.js +9 -0
- package/resources/ai/typesafe/index.js.map +1 -0
- package/resources/ai/typesafe/index.mjs +4 -0
- package/resources/ai/typesafe/index.mjs.map +1 -0
- package/resources/ai/typesafe/typesafe.d.mts +10 -0
- package/resources/ai/typesafe/typesafe.d.mts.map +1 -0
- package/resources/ai/typesafe/typesafe.d.ts +10 -0
- package/resources/ai/typesafe/typesafe.d.ts.map +1 -0
- package/resources/ai/typesafe/typesafe.js +17 -0
- package/resources/ai/typesafe/typesafe.js.map +1 -0
- package/resources/ai/typesafe/typesafe.mjs +12 -0
- package/resources/ai/typesafe/typesafe.mjs.map +1 -0
- package/resources/ai/typesafe/v1.d.mts +274 -0
- package/resources/ai/typesafe/v1.d.mts.map +1 -0
- package/resources/ai/typesafe/v1.d.ts +274 -0
- package/resources/ai/typesafe/v1.d.ts.map +1 -0
- package/resources/ai/typesafe/v1.js +67 -0
- package/resources/ai/typesafe/v1.js.map +1 -0
- package/resources/ai/typesafe/v1.mjs +63 -0
- package/resources/ai/typesafe/v1.mjs.map +1 -0
- package/resources/ai/typesafe.d.mts +2 -0
- package/resources/ai/typesafe.d.mts.map +1 -0
- package/resources/ai/typesafe.d.ts +2 -0
- package/resources/ai/typesafe.d.ts.map +1 -0
- package/resources/ai/typesafe.js +6 -0
- package/resources/ai/typesafe.js.map +1 -0
- package/resources/ai/typesafe.mjs +3 -0
- package/resources/ai/typesafe.mjs.map +1 -0
- package/resources/bot-challenge.d.mts +80 -0
- package/resources/bot-challenge.d.mts.map +1 -0
- package/resources/bot-challenge.d.ts +80 -0
- package/resources/bot-challenge.d.ts.map +1 -0
- package/resources/bot-challenge.js +35 -0
- package/resources/bot-challenge.js.map +1 -0
- package/resources/bot-challenge.mjs +31 -0
- package/resources/bot-challenge.mjs.map +1 -0
- package/resources/bot-sessions.d.mts +49 -0
- package/resources/bot-sessions.d.mts.map +1 -0
- package/resources/bot-sessions.d.ts +49 -0
- package/resources/bot-sessions.d.ts.map +1 -0
- package/resources/bot-sessions.js +28 -0
- package/resources/bot-sessions.js.map +1 -0
- package/resources/bot-sessions.mjs +24 -0
- package/resources/bot-sessions.mjs.map +1 -0
- package/resources/bot-signup.d.mts +114 -0
- package/resources/bot-signup.d.mts.map +1 -0
- package/resources/bot-signup.d.ts +114 -0
- package/resources/bot-signup.d.ts.map +1 -0
- package/resources/bot-signup.js +63 -0
- package/resources/bot-signup.js.map +1 -0
- package/resources/bot-signup.mjs +59 -0
- package/resources/bot-signup.mjs.map +1 -0
- package/resources/calls/actions.d.mts +57 -11
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +57 -11
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/calls.d.mts +45 -5
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +45 -5
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/compute/compute.d.mts +2 -2
- package/resources/compute/compute.d.mts.map +1 -1
- package/resources/compute/compute.d.ts +2 -2
- package/resources/compute/compute.d.ts.map +1 -1
- package/resources/compute/compute.js +2 -2
- package/resources/compute/compute.js.map +1 -1
- package/resources/compute/compute.mjs +2 -2
- package/resources/compute/compute.mjs.map +1 -1
- package/resources/compute/funcs/export.d.mts +121 -0
- package/resources/compute/funcs/export.d.mts.map +1 -0
- package/resources/compute/funcs/export.d.ts +121 -0
- package/resources/compute/funcs/export.d.ts.map +1 -0
- package/resources/compute/funcs/export.js +68 -0
- package/resources/compute/funcs/export.js.map +1 -0
- package/resources/compute/funcs/export.mjs +64 -0
- package/resources/compute/funcs/export.mjs.map +1 -0
- package/resources/compute/funcs/funcs.d.mts +214 -0
- package/resources/compute/funcs/funcs.d.mts.map +1 -0
- package/resources/compute/funcs/funcs.d.ts +214 -0
- package/resources/compute/funcs/funcs.d.ts.map +1 -0
- package/resources/compute/funcs/funcs.js +80 -0
- package/resources/compute/funcs/funcs.js.map +1 -0
- package/resources/compute/funcs/funcs.mjs +75 -0
- package/resources/compute/funcs/funcs.mjs.map +1 -0
- package/resources/compute/funcs/index.d.mts +3 -0
- package/resources/compute/funcs/index.d.mts.map +1 -0
- package/resources/compute/funcs/index.d.ts +3 -0
- package/resources/compute/funcs/index.d.ts.map +1 -0
- package/resources/compute/funcs/index.js +9 -0
- package/resources/compute/funcs/index.js.map +1 -0
- package/resources/compute/funcs/index.mjs +4 -0
- package/resources/compute/funcs/index.mjs.map +1 -0
- package/resources/compute/funcs.d.mts +1 -178
- package/resources/compute/funcs.d.mts.map +1 -1
- package/resources/compute/funcs.d.ts +1 -178
- package/resources/compute/funcs.d.ts.map +1 -1
- package/resources/compute/funcs.js +2 -37
- package/resources/compute/funcs.js.map +1 -1
- package/resources/compute/funcs.mjs +1 -35
- package/resources/compute/funcs.mjs.map +1 -1
- package/resources/compute/index.d.mts +1 -1
- package/resources/compute/index.d.mts.map +1 -1
- package/resources/compute/index.d.ts +1 -1
- package/resources/compute/index.d.ts.map +1 -1
- package/resources/compute/index.js +2 -2
- package/resources/compute/index.js.map +1 -1
- package/resources/compute/index.mjs +1 -1
- package/resources/compute/index.mjs.map +1 -1
- package/resources/connections.d.mts +109 -1
- package/resources/connections.d.mts.map +1 -1
- package/resources/connections.d.ts +109 -1
- package/resources/connections.d.ts.map +1 -1
- package/resources/connections.js +8 -0
- package/resources/connections.js.map +1 -1
- package/resources/connections.mjs +8 -0
- package/resources/connections.mjs.map +1 -1
- package/resources/detail-records.d.mts +18 -1
- package/resources/detail-records.d.mts.map +1 -1
- package/resources/detail-records.d.ts +18 -1
- package/resources/detail-records.d.ts.map +1 -1
- package/resources/email-messages/email-messages.d.mts +5 -3
- package/resources/email-messages/email-messages.d.mts.map +1 -1
- package/resources/email-messages/email-messages.d.ts +5 -3
- package/resources/email-messages/email-messages.d.ts.map +1 -1
- package/resources/email-messages/email-messages.js +5 -3
- package/resources/email-messages/email-messages.js.map +1 -1
- package/resources/email-messages/email-messages.mjs +5 -3
- package/resources/email-messages/email-messages.mjs.map +1 -1
- package/resources/index.d.mts +7 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +14 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -0
- package/resources/index.mjs.map +1 -1
- package/resources/machine-payments.d.mts +142 -0
- package/resources/machine-payments.d.mts.map +1 -0
- package/resources/machine-payments.d.ts +142 -0
- package/resources/machine-payments.d.ts.map +1 -0
- package/resources/machine-payments.js +56 -0
- package/resources/machine-payments.js.map +1 -0
- package/resources/machine-payments.mjs +52 -0
- package/resources/machine-payments.mjs.map +1 -0
- package/resources/messages/messages.d.mts +135 -23
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +135 -23
- 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/noise-suppression-engines.d.mts +42 -0
- package/resources/noise-suppression-engines.d.mts.map +1 -0
- package/resources/noise-suppression-engines.d.ts +42 -0
- package/resources/noise-suppression-engines.d.ts.map +1 -0
- package/resources/noise-suppression-engines.js +21 -0
- package/resources/noise-suppression-engines.js.map +1 -0
- package/resources/noise-suppression-engines.mjs +17 -0
- package/resources/noise-suppression-engines.mjs.map +1 -0
- package/resources/speech-to-text/speech-to-text.d.mts +1 -1
- package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
- package/resources/texml/accounts/calls/calls.d.mts +117 -0
- package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
- package/resources/texml/accounts/calls/calls.d.ts +117 -0
- package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
- package/resources/texml/accounts/calls/calls.js.map +1 -1
- package/resources/texml/accounts/calls/calls.mjs.map +1 -1
- package/resources/texml/accounts/conferences/participants.d.mts +39 -0
- package/resources/texml/accounts/conferences/participants.d.mts.map +1 -1
- package/resources/texml/accounts/conferences/participants.d.ts +39 -0
- package/resources/texml/accounts/conferences/participants.d.ts.map +1 -1
- package/resources/texml/calls.d.mts +71 -0
- package/resources/texml/calls.d.mts.map +1 -0
- package/resources/texml/calls.d.ts +71 -0
- package/resources/texml/calls.d.ts.map +1 -0
- package/resources/texml/calls.js +33 -0
- package/resources/texml/calls.js.map +1 -0
- package/resources/texml/calls.mjs +29 -0
- package/resources/texml/calls.mjs.map +1 -0
- package/resources/texml/index.d.mts +1 -0
- package/resources/texml/index.d.mts.map +1 -1
- package/resources/texml/index.d.ts +1 -0
- package/resources/texml/index.d.ts.map +1 -1
- package/resources/texml/index.js +3 -1
- package/resources/texml/index.js.map +1 -1
- package/resources/texml/index.mjs +1 -0
- package/resources/texml/index.mjs.map +1 -1
- package/resources/texml/texml.d.mts +43 -0
- package/resources/texml/texml.d.mts.map +1 -1
- package/resources/texml/texml.d.ts +43 -0
- package/resources/texml/texml.d.ts.map +1 -1
- package/resources/texml/texml.js +4 -0
- package/resources/texml/texml.js.map +1 -1
- package/resources/texml/texml.mjs +4 -0
- package/resources/texml/texml.mjs.map +1 -1
- package/resources/voice-clones.d.mts +6 -4
- package/resources/voice-clones.d.mts.map +1 -1
- package/resources/voice-clones.d.ts +6 -4
- package/resources/voice-clones.d.ts.map +1 -1
- package/resources/voice-clones.js +4 -2
- package/resources/voice-clones.js.map +1 -1
- package/resources/voice-clones.mjs +4 -2
- package/resources/voice-clones.mjs.map +1 -1
- package/resources/webhooks.d.mts +26 -49
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +26 -49
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +80 -0
- package/src/resources/ai/ai.ts +13 -1
- package/src/resources/ai/assistants/assistants.ts +281 -45
- package/src/resources/ai/assistants/versions.ts +34 -12
- package/src/resources/ai/audio.ts +93 -45
- package/src/resources/ai/chat.ts +2 -11
- package/src/resources/ai/index.ts +7 -1
- package/src/resources/ai/openai/chat.ts +11 -11
- package/src/resources/ai/openai/index.ts +6 -1
- package/src/resources/ai/openai/openai.ts +2 -1
- package/src/resources/ai/typesafe/index.ts +4 -0
- package/src/resources/ai/typesafe/typesafe.ts +19 -0
- package/src/resources/ai/typesafe/v1.ts +298 -0
- package/src/resources/ai/typesafe.ts +3 -0
- package/src/resources/bot-challenge.ts +101 -0
- package/src/resources/bot-sessions.ts +61 -0
- package/src/resources/bot-signup.ts +140 -0
- package/src/resources/calls/actions.ts +65 -10
- package/src/resources/calls/calls.ts +52 -5
- package/src/resources/compute/compute.ts +2 -2
- package/src/resources/compute/funcs/export.ts +156 -0
- package/src/resources/compute/funcs/funcs.ts +341 -0
- package/src/resources/compute/funcs/index.ts +15 -0
- package/src/resources/compute/funcs.ts +1 -296
- package/src/resources/compute/index.ts +1 -1
- package/src/resources/connections.ts +133 -0
- package/src/resources/detail-records.ts +18 -1
- package/src/resources/email-messages/email-messages.ts +5 -3
- package/src/resources/index.ts +23 -0
- package/src/resources/machine-payments.ts +169 -0
- package/src/resources/messages/messages.ts +168 -23
- package/src/resources/noise-suppression-engines.ts +51 -0
- package/src/resources/speech-to-text/speech-to-text.ts +1 -0
- package/src/resources/texml/accounts/calls/calls.ts +138 -0
- package/src/resources/texml/accounts/conferences/participants.ts +46 -0
- package/src/resources/texml/calls.ts +90 -0
- package/src/resources/texml/index.ts +1 -0
- package/src/resources/texml/texml.ts +56 -0
- package/src/resources/voice-clones.ts +6 -4
- package/src/resources/webhooks.ts +31 -58
- 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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Beta API for evaluating shared context with typed questions and structured answers. Telnyx manages model selection.
|
|
5
|
+
*/
|
|
6
|
+
export class V1 extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* **Beta API.** Telnyx controls model selection.
|
|
9
|
+
*
|
|
10
|
+
* Evaluate shared context using named choice, noul (yes/no), and score questions.
|
|
11
|
+
* Returns TypeSafe System One-compatible answer shapes, an opaque compatibility
|
|
12
|
+
* identifier, and token usage. See the
|
|
13
|
+
* [decision model guide](https://developers.telnyx.com/docs/inference/decision-models)
|
|
14
|
+
* for examples and compatibility limits.
|
|
15
|
+
*
|
|
16
|
+
* The supported request subset requires instructions for every question, string
|
|
17
|
+
* descriptions for criteria (or null for choice descriptions), 1–64 questions, and
|
|
18
|
+
* 2–64 options for choice and score questions. The SDK-supplied model value is
|
|
19
|
+
* ignored and cannot select a model. Other unknown fields are rejected. The
|
|
20
|
+
* endpoint is synchronous and does not stream.
|
|
21
|
+
*
|
|
22
|
+
* Use the TypeSafe Python SDK with base_url set to
|
|
23
|
+
* https://api.telnyx.com/v2/ai/typesafe and a Telnyx API key. The SDK appends
|
|
24
|
+
* /v1/systemone. Compatibility covers this operation and the documented request
|
|
25
|
+
* subset; it does not include TypeSafe model listing. Scores describe relative
|
|
26
|
+
* preference, not calibrated correctness.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const response = await client.ai.typesafe.v1.systemone({
|
|
31
|
+
* questions: {
|
|
32
|
+
* team: {
|
|
33
|
+
* type: 'choice',
|
|
34
|
+
* instructions:
|
|
35
|
+
* 'Choose the team that should handle this incident.',
|
|
36
|
+
* criteria: {
|
|
37
|
+
* billing: 'Payments and refunds',
|
|
38
|
+
* technical_support:
|
|
39
|
+
* 'Service faults and technical problems',
|
|
40
|
+
* sales: 'New purchases',
|
|
41
|
+
* },
|
|
42
|
+
* },
|
|
43
|
+
* production_incident: {
|
|
44
|
+
* type: 'noul',
|
|
45
|
+
* instructions:
|
|
46
|
+
* 'Does the message describe an active production incident?',
|
|
47
|
+
* },
|
|
48
|
+
* urgency: {
|
|
49
|
+
* type: 'score',
|
|
50
|
+
* instructions: 'Rate operational urgency.',
|
|
51
|
+
* criteria: ['Low', 'Normal', 'High', 'Critical'],
|
|
52
|
+
* },
|
|
53
|
+
* },
|
|
54
|
+
* state:
|
|
55
|
+
* 'Our production calls are failing. Every customer is affected.',
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
systemone(body, options) {
|
|
60
|
+
return this._client.post('/ai/typesafe/v1/systemone', { body, ...options });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=v1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../../src/resources/ai/typesafe/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAIrD;;GAEG;AACH,MAAM,OAAO,EAAG,SAAQ,WAAW;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,SAAS,CAAC,IAAuB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesafe.d.mts","sourceRoot":"","sources":["../../src/resources/ai/typesafe.ts"],"names":[],"mappings":"AAEA,qCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesafe.d.ts","sourceRoot":"","sources":["../../src/resources/ai/typesafe.ts"],"names":[],"mappings":"AAEA,oCAAiC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./typesafe/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=typesafe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesafe.js","sourceRoot":"","sources":["../../src/resources/ai/typesafe.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typesafe.mjs","sourceRoot":"","sources":["../../src/resources/ai/typesafe.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,qCAAiC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BotChallenge extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Generates a reverse-CAPTCHA challenge used to gate the bot signup flow. A random
|
|
10
|
+
* active problem is selected from the pool; math problems are returned obfuscated
|
|
11
|
+
* (case randomization, symbol injection, spacing noise) with an unobfuscated
|
|
12
|
+
* rounding instruction appended, while string and binary problems are returned
|
|
13
|
+
* as-is. The response contains a single-use nonce, the problem text, and the
|
|
14
|
+
* current terms-and-conditions and privacy-policy URLs, which must be echoed back
|
|
15
|
+
* on the signup request. Challenges expire after a short window (10 minutes by
|
|
16
|
+
* default) and can only be answered once. This endpoint is public and
|
|
17
|
+
* unauthenticated.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const botChallenge = await client.botChallenge.create({
|
|
22
|
+
* llm_model_name: 'claude-opus-4',
|
|
23
|
+
* llm_parameter_count: '175B',
|
|
24
|
+
* llm_quantization: 'int8',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
create(body?: BotChallengeCreateParams | null | undefined, options?: RequestOptions): APIPromise<BotChallengeCreateResponse>;
|
|
29
|
+
}
|
|
30
|
+
export interface BotChallengeCreateResponse {
|
|
31
|
+
data: BotChallengeCreateResponse.Data;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace BotChallengeCreateResponse {
|
|
34
|
+
interface Data {
|
|
35
|
+
/**
|
|
36
|
+
* Type of challenge.
|
|
37
|
+
*/
|
|
38
|
+
challenge_type: 'math' | 'string' | 'binary';
|
|
39
|
+
/**
|
|
40
|
+
* Single-use challenge identifier. Submit it as `bot_challenge_nonce` on the
|
|
41
|
+
* signup request.
|
|
42
|
+
*/
|
|
43
|
+
nonce: string;
|
|
44
|
+
/**
|
|
45
|
+
* Current privacy-policy URL. Echo this back on the signup request.
|
|
46
|
+
*/
|
|
47
|
+
privacy_policy_url: string;
|
|
48
|
+
/**
|
|
49
|
+
* Problem text to solve. Math problems are obfuscated and end with an unobfuscated
|
|
50
|
+
* rounding instruction; string and binary problems are returned as-is.
|
|
51
|
+
*/
|
|
52
|
+
problem: string;
|
|
53
|
+
/**
|
|
54
|
+
* Current terms-and-conditions URL. Echo this back on the signup request.
|
|
55
|
+
*/
|
|
56
|
+
terms_and_conditions_url: string;
|
|
57
|
+
/**
|
|
58
|
+
* Decimal places expected in the answer. Present only for math challenges.
|
|
59
|
+
*/
|
|
60
|
+
precision?: number;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export interface BotChallengeCreateParams {
|
|
64
|
+
/**
|
|
65
|
+
* Name of the LLM the client is using.
|
|
66
|
+
*/
|
|
67
|
+
llm_model_name?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Parameter count of the client LLM.
|
|
70
|
+
*/
|
|
71
|
+
llm_parameter_count?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Quantization of the client LLM.
|
|
74
|
+
*/
|
|
75
|
+
llm_quantization?: string;
|
|
76
|
+
}
|
|
77
|
+
export declare namespace BotChallenge {
|
|
78
|
+
export { type BotChallengeCreateResponse as BotChallengeCreateResponse, type BotChallengeCreateParams as BotChallengeCreateParams, };
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=bot-challenge.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-challenge.d.mts","sourceRoot":"","sources":["../src/resources/bot-challenge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CACJ,IAAI,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;CAG1C;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,0BAA0B,CAAC,IAAI,CAAC;CACvC;AAED,yBAAiB,0BAA0B,CAAC;IAC1C,UAAiB,IAAI;QACnB;;WAEG;QACH,cAAc,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;QAE7C;;;WAGG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,wBAAwB,EAAE,MAAM,CAAC;QAEjC;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BotChallenge extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Generates a reverse-CAPTCHA challenge used to gate the bot signup flow. A random
|
|
10
|
+
* active problem is selected from the pool; math problems are returned obfuscated
|
|
11
|
+
* (case randomization, symbol injection, spacing noise) with an unobfuscated
|
|
12
|
+
* rounding instruction appended, while string and binary problems are returned
|
|
13
|
+
* as-is. The response contains a single-use nonce, the problem text, and the
|
|
14
|
+
* current terms-and-conditions and privacy-policy URLs, which must be echoed back
|
|
15
|
+
* on the signup request. Challenges expire after a short window (10 minutes by
|
|
16
|
+
* default) and can only be answered once. This endpoint is public and
|
|
17
|
+
* unauthenticated.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const botChallenge = await client.botChallenge.create({
|
|
22
|
+
* llm_model_name: 'claude-opus-4',
|
|
23
|
+
* llm_parameter_count: '175B',
|
|
24
|
+
* llm_quantization: 'int8',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
create(body?: BotChallengeCreateParams | null | undefined, options?: RequestOptions): APIPromise<BotChallengeCreateResponse>;
|
|
29
|
+
}
|
|
30
|
+
export interface BotChallengeCreateResponse {
|
|
31
|
+
data: BotChallengeCreateResponse.Data;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace BotChallengeCreateResponse {
|
|
34
|
+
interface Data {
|
|
35
|
+
/**
|
|
36
|
+
* Type of challenge.
|
|
37
|
+
*/
|
|
38
|
+
challenge_type: 'math' | 'string' | 'binary';
|
|
39
|
+
/**
|
|
40
|
+
* Single-use challenge identifier. Submit it as `bot_challenge_nonce` on the
|
|
41
|
+
* signup request.
|
|
42
|
+
*/
|
|
43
|
+
nonce: string;
|
|
44
|
+
/**
|
|
45
|
+
* Current privacy-policy URL. Echo this back on the signup request.
|
|
46
|
+
*/
|
|
47
|
+
privacy_policy_url: string;
|
|
48
|
+
/**
|
|
49
|
+
* Problem text to solve. Math problems are obfuscated and end with an unobfuscated
|
|
50
|
+
* rounding instruction; string and binary problems are returned as-is.
|
|
51
|
+
*/
|
|
52
|
+
problem: string;
|
|
53
|
+
/**
|
|
54
|
+
* Current terms-and-conditions URL. Echo this back on the signup request.
|
|
55
|
+
*/
|
|
56
|
+
terms_and_conditions_url: string;
|
|
57
|
+
/**
|
|
58
|
+
* Decimal places expected in the answer. Present only for math challenges.
|
|
59
|
+
*/
|
|
60
|
+
precision?: number;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export interface BotChallengeCreateParams {
|
|
64
|
+
/**
|
|
65
|
+
* Name of the LLM the client is using.
|
|
66
|
+
*/
|
|
67
|
+
llm_model_name?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Parameter count of the client LLM.
|
|
70
|
+
*/
|
|
71
|
+
llm_parameter_count?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Quantization of the client LLM.
|
|
74
|
+
*/
|
|
75
|
+
llm_quantization?: string;
|
|
76
|
+
}
|
|
77
|
+
export declare namespace BotChallenge {
|
|
78
|
+
export { type BotChallengeCreateResponse as BotChallengeCreateResponse, type BotChallengeCreateParams as BotChallengeCreateParams, };
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=bot-challenge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-challenge.d.ts","sourceRoot":"","sources":["../src/resources/bot-challenge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CACJ,IAAI,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;CAG1C;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,0BAA0B,CAAC,IAAI,CAAC;CACvC;AAED,yBAAiB,0BAA0B,CAAC;IAC1C,UAAiB,IAAI;QACnB;;WAEG;QACH,cAAc,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;QAE7C;;;WAGG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,wBAAwB,EAAE,MAAM,CAAC;QAEjC;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BotChallenge = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
8
|
+
*/
|
|
9
|
+
class BotChallenge extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Generates a reverse-CAPTCHA challenge used to gate the bot signup flow. A random
|
|
12
|
+
* active problem is selected from the pool; math problems are returned obfuscated
|
|
13
|
+
* (case randomization, symbol injection, spacing noise) with an unobfuscated
|
|
14
|
+
* rounding instruction appended, while string and binary problems are returned
|
|
15
|
+
* as-is. The response contains a single-use nonce, the problem text, and the
|
|
16
|
+
* current terms-and-conditions and privacy-policy URLs, which must be echoed back
|
|
17
|
+
* on the signup request. Challenges expire after a short window (10 minutes by
|
|
18
|
+
* default) and can only be answered once. This endpoint is public and
|
|
19
|
+
* unauthenticated.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const botChallenge = await client.botChallenge.create({
|
|
24
|
+
* llm_model_name: 'claude-opus-4',
|
|
25
|
+
* llm_parameter_count: '175B',
|
|
26
|
+
* llm_quantization: 'int8',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
create(body = {}, options) {
|
|
31
|
+
return this._client.post('/v2/bot_challenge', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.BotChallenge = BotChallenge;
|
|
35
|
+
//# sourceMappingURL=bot-challenge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-challenge.js","sourceRoot":"","sources":["../src/resources/bot-challenge.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CACJ,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AA3BD,oCA2BC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
5
|
+
*/
|
|
6
|
+
export class BotChallenge extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Generates a reverse-CAPTCHA challenge used to gate the bot signup flow. A random
|
|
9
|
+
* active problem is selected from the pool; math problems are returned obfuscated
|
|
10
|
+
* (case randomization, symbol injection, spacing noise) with an unobfuscated
|
|
11
|
+
* rounding instruction appended, while string and binary problems are returned
|
|
12
|
+
* as-is. The response contains a single-use nonce, the problem text, and the
|
|
13
|
+
* current terms-and-conditions and privacy-policy URLs, which must be echoed back
|
|
14
|
+
* on the signup request. Challenges expire after a short window (10 minutes by
|
|
15
|
+
* default) and can only be answered once. This endpoint is public and
|
|
16
|
+
* unauthenticated.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const botChallenge = await client.botChallenge.create({
|
|
21
|
+
* llm_model_name: 'claude-opus-4',
|
|
22
|
+
* llm_parameter_count: '175B',
|
|
23
|
+
* llm_quantization: 'int8',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
create(body = {}, options) {
|
|
28
|
+
return this._client.post('/v2/bot_challenge', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=bot-challenge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-challenge.mjs","sourceRoot":"","sources":["../src/resources/bot-challenge.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CACJ,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BotSessions extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Consumes the one-time portal redirect (magic link) token emailed during bot
|
|
10
|
+
* signup and returns an API session. The token is a UUIDv7 that encodes its
|
|
11
|
+
* creation time; it expires after a configurable validity window (15 minutes by
|
|
12
|
+
* default) and is cleared on first use. Although the action creates a session, the
|
|
13
|
+
* route uses the GET verb because it is opened from an email link. On first use
|
|
14
|
+
* the account is also initialized. For bot signup (freemium) accounts the response
|
|
15
|
+
* is a minimal envelope containing only the `api_v2_token`; accounts that are
|
|
16
|
+
* permitted to use magic links but are not freemium accounts may instead receive
|
|
17
|
+
* an extended session payload when additional steps (such as two-factor
|
|
18
|
+
* authentication or identity verification) are required. This endpoint is public;
|
|
19
|
+
* the magic link token in the query string is the credential.
|
|
20
|
+
*/
|
|
21
|
+
list(query: BotSessionListParams, options?: RequestOptions): APIPromise<BotSessionListResponse>;
|
|
22
|
+
}
|
|
23
|
+
export interface BotSessionListResponse {
|
|
24
|
+
data: BotSessionListResponse.Data;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace BotSessionListResponse {
|
|
27
|
+
interface Data {
|
|
28
|
+
/**
|
|
29
|
+
* API v2 session token for the signed-in user. Use it as a bearer token on
|
|
30
|
+
* authenticated endpoints.
|
|
31
|
+
*/
|
|
32
|
+
api_v2_token: string;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export interface BotSessionListParams {
|
|
36
|
+
/**
|
|
37
|
+
* Email address associated with the magic link token.
|
|
38
|
+
*/
|
|
39
|
+
email: string;
|
|
40
|
+
/**
|
|
41
|
+
* Single-use portal redirect (magic link) token, a UUIDv7 sent to the account
|
|
42
|
+
* owner's email.
|
|
43
|
+
*/
|
|
44
|
+
portal_redirect_token: string;
|
|
45
|
+
}
|
|
46
|
+
export declare namespace BotSessions {
|
|
47
|
+
export { type BotSessionListResponse as BotSessionListResponse, type BotSessionListParams as BotSessionListParams, };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=bot-sessions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-sessions.d.mts","sourceRoot":"","sources":["../src/resources/bot-sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAK,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;CAGhG;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAAC;CACnC;AAED,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,IAAI;QACnB;;;WAGG;QACH,YAAY,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BotSessions extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Consumes the one-time portal redirect (magic link) token emailed during bot
|
|
10
|
+
* signup and returns an API session. The token is a UUIDv7 that encodes its
|
|
11
|
+
* creation time; it expires after a configurable validity window (15 minutes by
|
|
12
|
+
* default) and is cleared on first use. Although the action creates a session, the
|
|
13
|
+
* route uses the GET verb because it is opened from an email link. On first use
|
|
14
|
+
* the account is also initialized. For bot signup (freemium) accounts the response
|
|
15
|
+
* is a minimal envelope containing only the `api_v2_token`; accounts that are
|
|
16
|
+
* permitted to use magic links but are not freemium accounts may instead receive
|
|
17
|
+
* an extended session payload when additional steps (such as two-factor
|
|
18
|
+
* authentication or identity verification) are required. This endpoint is public;
|
|
19
|
+
* the magic link token in the query string is the credential.
|
|
20
|
+
*/
|
|
21
|
+
list(query: BotSessionListParams, options?: RequestOptions): APIPromise<BotSessionListResponse>;
|
|
22
|
+
}
|
|
23
|
+
export interface BotSessionListResponse {
|
|
24
|
+
data: BotSessionListResponse.Data;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace BotSessionListResponse {
|
|
27
|
+
interface Data {
|
|
28
|
+
/**
|
|
29
|
+
* API v2 session token for the signed-in user. Use it as a bearer token on
|
|
30
|
+
* authenticated endpoints.
|
|
31
|
+
*/
|
|
32
|
+
api_v2_token: string;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export interface BotSessionListParams {
|
|
36
|
+
/**
|
|
37
|
+
* Email address associated with the magic link token.
|
|
38
|
+
*/
|
|
39
|
+
email: string;
|
|
40
|
+
/**
|
|
41
|
+
* Single-use portal redirect (magic link) token, a UUIDv7 sent to the account
|
|
42
|
+
* owner's email.
|
|
43
|
+
*/
|
|
44
|
+
portal_redirect_token: string;
|
|
45
|
+
}
|
|
46
|
+
export declare namespace BotSessions {
|
|
47
|
+
export { type BotSessionListResponse as BotSessionListResponse, type BotSessionListParams as BotSessionListParams, };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=bot-sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-sessions.d.ts","sourceRoot":"","sources":["../src/resources/bot-sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAAK,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;CAGhG;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAAC;CACnC;AAED,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,IAAI;QACnB;;;WAGG;QACH,YAAY,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BotSessions = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
/**
|
|
7
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
8
|
+
*/
|
|
9
|
+
class BotSessions extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Consumes the one-time portal redirect (magic link) token emailed during bot
|
|
12
|
+
* signup and returns an API session. The token is a UUIDv7 that encodes its
|
|
13
|
+
* creation time; it expires after a configurable validity window (15 minutes by
|
|
14
|
+
* default) and is cleared on first use. Although the action creates a session, the
|
|
15
|
+
* route uses the GET verb because it is opened from an email link. On first use
|
|
16
|
+
* the account is also initialized. For bot signup (freemium) accounts the response
|
|
17
|
+
* is a minimal envelope containing only the `api_v2_token`; accounts that are
|
|
18
|
+
* permitted to use magic links but are not freemium accounts may instead receive
|
|
19
|
+
* an extended session payload when additional steps (such as two-factor
|
|
20
|
+
* authentication or identity verification) are required. This endpoint is public;
|
|
21
|
+
* the magic link token in the query string is the credential.
|
|
22
|
+
*/
|
|
23
|
+
list(query, options) {
|
|
24
|
+
return this._client.get('/v2/bot_sessions', { query, ...options });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.BotSessions = BotSessions;
|
|
28
|
+
//# sourceMappingURL=bot-sessions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-sessions.js","sourceRoot":"","sources":["../src/resources/bot-sessions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAA2B,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;CACF;AAjBD,kCAiBC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
5
|
+
*/
|
|
6
|
+
export class BotSessions extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Consumes the one-time portal redirect (magic link) token emailed during bot
|
|
9
|
+
* signup and returns an API session. The token is a UUIDv7 that encodes its
|
|
10
|
+
* creation time; it expires after a configurable validity window (15 minutes by
|
|
11
|
+
* default) and is cleared on first use. Although the action creates a session, the
|
|
12
|
+
* route uses the GET verb because it is opened from an email link. On first use
|
|
13
|
+
* the account is also initialized. For bot signup (freemium) accounts the response
|
|
14
|
+
* is a minimal envelope containing only the `api_v2_token`; accounts that are
|
|
15
|
+
* permitted to use magic links but are not freemium accounts may instead receive
|
|
16
|
+
* an extended session payload when additional steps (such as two-factor
|
|
17
|
+
* authentication or identity verification) are required. This endpoint is public;
|
|
18
|
+
* the magic link token in the query string is the credential.
|
|
19
|
+
*/
|
|
20
|
+
list(query, options) {
|
|
21
|
+
return this._client.get('/v2/bot_sessions', { query, ...options });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=bot-sessions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-sessions.mjs","sourceRoot":"","sources":["../src/resources/bot-sessions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,KAA2B,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Agentic (bot) signup for Telnyx accounts. An AI agent solves a reverse-CAPTCHA challenge designed to be easy for LLMs and hard for humans, registers an account, and signs in by consuming a magic link emailed to the account owner. All endpoints are public and unauthenticated; signup endpoints are additionally gated by the freemium feature flags and per-country availability.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BotSignup extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a freemium Telnyx account through the agentic signup flow. The request
|
|
10
|
+
* must carry a valid answer to a previously issued bot challenge
|
|
11
|
+
* (`bot_challenge_nonce` and `bot_challenge_answer`), accept the terms of service,
|
|
12
|
+
* and echo the exact terms-and-conditions and privacy-policy URLs returned by the
|
|
13
|
+
* challenge endpoint. When EU consent enforcement is enabled,
|
|
14
|
+
* `terms_of_service_eu` and `terms_and_conditions_eu_url` are also required. On
|
|
15
|
+
* success a one-time sign-in (magic) link is emailed to the address provided; if
|
|
16
|
+
* the email address belongs to an existing account, a sign-in link is sent instead
|
|
17
|
+
* of creating a duplicate account. `email` may only be omitted when
|
|
18
|
+
* placeholder-email registration is enabled server-side. This endpoint is public
|
|
19
|
+
* and unauthenticated, gated by the freemium feature flags and per-country
|
|
20
|
+
* availability, and subject to per-IP and per-domain registration limits.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const successResponse = await client.botSignup.create({
|
|
25
|
+
* bot_challenge_answer: '35',
|
|
26
|
+
* bot_challenge_nonce:
|
|
27
|
+
* 'c6feda4e-6501-4db9-a21f-665e5b4ce2ba',
|
|
28
|
+
* privacy_policy_url: 'https://telnyx.com/privacy-policy',
|
|
29
|
+
* terms_and_conditions_url:
|
|
30
|
+
* 'https://telnyx.com/terms-and-conditions-of-service',
|
|
31
|
+
* terms_of_service: true,
|
|
32
|
+
* email: 'agent-owner@example.com',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
create(body: BotSignupCreateParams, options?: RequestOptions): APIPromise<SuccessResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Resends the one-time sign-in (magic) link for an eligible bot signup account.
|
|
39
|
+
* Eligibility (account exists, was registered through bot signup, is active, and
|
|
40
|
+
* has not exceeded the resend limit or rate window) is evaluated server-side; the
|
|
41
|
+
* response is intentionally uniform and does not reveal whether the account exists
|
|
42
|
+
* or whether a link was actually sent. This endpoint is public and
|
|
43
|
+
* unauthenticated, gated by the freemium feature flags and per-country
|
|
44
|
+
* availability.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const successResponse =
|
|
49
|
+
* await client.botSignup.resendMagicLink({
|
|
50
|
+
* email: 'agent-owner@example.com',
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
resendMagicLink(body: BotSignupResendMagicLinkParams, options?: RequestOptions): APIPromise<SuccessResponse>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Status envelope used by the signup and magic-link flows.
|
|
58
|
+
*/
|
|
59
|
+
export interface SuccessResponse {
|
|
60
|
+
/**
|
|
61
|
+
* Human-readable status message.
|
|
62
|
+
*/
|
|
63
|
+
message: string;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the request was accepted.
|
|
66
|
+
*/
|
|
67
|
+
success: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface BotSignupCreateParams {
|
|
70
|
+
/**
|
|
71
|
+
* Answer to the issued bot challenge.
|
|
72
|
+
*/
|
|
73
|
+
bot_challenge_answer: string;
|
|
74
|
+
/**
|
|
75
|
+
* Nonce from a previously issued bot challenge.
|
|
76
|
+
*/
|
|
77
|
+
bot_challenge_nonce: string;
|
|
78
|
+
/**
|
|
79
|
+
* Must exactly match the privacy-policy URL returned by the challenge endpoint.
|
|
80
|
+
*/
|
|
81
|
+
privacy_policy_url: string;
|
|
82
|
+
/**
|
|
83
|
+
* Must exactly match the terms-and-conditions URL returned by the challenge
|
|
84
|
+
* endpoint.
|
|
85
|
+
*/
|
|
86
|
+
terms_and_conditions_url: string;
|
|
87
|
+
/**
|
|
88
|
+
* Must be true to accept the terms of service.
|
|
89
|
+
*/
|
|
90
|
+
terms_of_service: true;
|
|
91
|
+
/**
|
|
92
|
+
* Email address for the new account. The magic link is sent here. May only be
|
|
93
|
+
* omitted when placeholder-email registration is enabled server-side.
|
|
94
|
+
*/
|
|
95
|
+
email?: string;
|
|
96
|
+
/**
|
|
97
|
+
* EU terms-and-conditions URL. Required when EU consent enforcement is enabled.
|
|
98
|
+
*/
|
|
99
|
+
terms_and_conditions_eu_url?: string;
|
|
100
|
+
/**
|
|
101
|
+
* EU terms-of-service acceptance. Required when EU consent enforcement is enabled.
|
|
102
|
+
*/
|
|
103
|
+
terms_of_service_eu?: true;
|
|
104
|
+
}
|
|
105
|
+
export interface BotSignupResendMagicLinkParams {
|
|
106
|
+
/**
|
|
107
|
+
* Email address of the bot signup account to resend the magic link to.
|
|
108
|
+
*/
|
|
109
|
+
email: string;
|
|
110
|
+
}
|
|
111
|
+
export declare namespace BotSignup {
|
|
112
|
+
export { type SuccessResponse as SuccessResponse, type BotSignupCreateParams as BotSignupCreateParams, type BotSignupResendMagicLinkParams as BotSignupResendMagicLinkParams, };
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=bot-signup.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-signup.d.mts","sourceRoot":"","sources":["../src/resources/bot-signup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,eAAe,CAAC;IAI1F;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CACb,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,eAAe,CAAC;CAG/B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,gBAAgB,EAAE,IAAI,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAErC;;OAEG;IACH,mBAAmB,CAAC,EAAE,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
|