agentphone 1.0.11 → 1.0.12

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.
Files changed (92) hide show
  1. package/README.md +10 -10
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +3 -6
  4. package/dist/cjs/Client.js +25 -30
  5. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +69 -0
  6. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +66 -0
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +69 -0
  8. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +66 -0
  9. package/dist/cjs/api/resources/index.d.ts +2 -4
  10. package/dist/cjs/api/resources/index.js +3 -5
  11. package/dist/cjs/api/resources/registration/client/Client.d.ts +61 -0
  12. package/dist/cjs/api/resources/{agentSignup → registration}/client/Client.js +44 -69
  13. package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.d.ts +61 -0
  14. package/dist/cjs/api/resources/registration/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/types/AgentResponse.d.ts +2 -0
  16. package/dist/cjs/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.ts +0 -6
  17. package/dist/cjs/api/types/AgentVerifyRequest.d.ts +4 -0
  18. package/dist/cjs/api/types/FieldWarning.d.ts +6 -0
  19. package/dist/cjs/api/types/FieldWarning.js +3 -0
  20. package/dist/cjs/api/types/RegistrationResponse.d.ts +8 -0
  21. package/dist/cjs/api/types/RegistrationResponse.js +3 -0
  22. package/dist/cjs/api/types/index.d.ts +4 -0
  23. package/dist/cjs/api/types/index.js +4 -0
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/BaseClient.mjs +2 -2
  27. package/dist/esm/Client.d.mts +3 -6
  28. package/dist/esm/Client.mjs +5 -10
  29. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +69 -0
  30. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +66 -0
  31. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +69 -0
  32. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +66 -0
  33. package/dist/esm/api/resources/index.d.mts +2 -4
  34. package/dist/esm/api/resources/index.mjs +2 -4
  35. package/dist/esm/api/resources/registration/client/Client.d.mts +61 -0
  36. package/dist/esm/api/resources/registration/client/Client.mjs +108 -0
  37. package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.d.mts +61 -0
  38. package/dist/esm/api/resources/registration/client/requests/index.d.mts +1 -0
  39. package/dist/esm/api/types/AgentResponse.d.mts +2 -0
  40. package/dist/esm/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.mts +0 -6
  41. package/dist/esm/api/types/AgentVerifyRequest.d.mts +4 -0
  42. package/dist/esm/api/types/FieldWarning.d.mts +6 -0
  43. package/dist/esm/api/types/FieldWarning.mjs +2 -0
  44. package/dist/esm/api/types/RegistrationResponse.d.mts +8 -0
  45. package/dist/esm/api/types/RegistrationResponse.mjs +2 -0
  46. package/dist/esm/api/types/index.d.mts +4 -0
  47. package/dist/esm/api/types/index.mjs +4 -0
  48. package/dist/esm/version.d.mts +1 -1
  49. package/dist/esm/version.mjs +1 -1
  50. package/package.json +1 -1
  51. package/reference.md +83 -380
  52. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +0 -50
  53. package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +0 -11
  54. package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +0 -2
  55. package/dist/cjs/api/resources/integrations/client/Client.d.ts +0 -64
  56. package/dist/cjs/api/resources/integrations/client/Client.js +0 -268
  57. package/dist/cjs/api/resources/integrations/client/index.d.ts +0 -1
  58. package/dist/cjs/api/resources/integrations/client/index.js +0 -17
  59. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +0 -9
  60. package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +0 -1
  61. package/dist/cjs/api/resources/integrations/client/requests/index.js +0 -2
  62. package/dist/cjs/api/resources/integrations/index.d.ts +0 -1
  63. package/dist/cjs/api/resources/integrations/index.js +0 -17
  64. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +0 -50
  65. package/dist/esm/api/resources/agentSignup/client/Client.mjs +0 -133
  66. package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +0 -11
  67. package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +0 -2
  68. package/dist/esm/api/resources/integrations/client/Client.d.mts +0 -64
  69. package/dist/esm/api/resources/integrations/client/Client.mjs +0 -231
  70. package/dist/esm/api/resources/integrations/client/index.d.mts +0 -1
  71. package/dist/esm/api/resources/integrations/client/index.mjs +0 -1
  72. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +0 -9
  73. package/dist/esm/api/resources/integrations/client/requests/index.d.mts +0 -1
  74. package/dist/esm/api/resources/integrations/client/requests/index.mjs +0 -1
  75. package/dist/esm/api/resources/integrations/index.d.mts +0 -1
  76. package/dist/esm/api/resources/integrations/index.mjs +0 -1
  77. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.d.ts +0 -0
  78. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.js +0 -0
  79. /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentSignUpRequest.js → registration/client/requests/RegistrationRequest.js} +0 -0
  80. /package/dist/cjs/api/resources/{agentSignup → registration}/client/requests/index.js +0 -0
  81. /package/dist/cjs/api/resources/{agentSignup → registration}/index.d.ts +0 -0
  82. /package/dist/cjs/api/resources/{agentSignup → registration}/index.js +0 -0
  83. /package/dist/cjs/api/{resources/agentSignup/client/requests/AgentVerifyRequest.js → types/AgentSignUpRequest.js} +0 -0
  84. /package/dist/cjs/api/{resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js → types/AgentVerifyRequest.js} +0 -0
  85. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.d.mts +0 -0
  86. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.mjs +0 -0
  87. /package/dist/esm/api/resources/{agentSignup/client/requests/AgentSignUpRequest.mjs → registration/client/requests/RegistrationRequest.mjs} +0 -0
  88. /package/dist/esm/api/resources/{agentSignup → registration}/client/requests/index.mjs +0 -0
  89. /package/dist/esm/api/resources/{agentSignup → registration}/index.d.mts +0 -0
  90. /package/dist/esm/api/resources/{agentSignup → registration}/index.mjs +0 -0
  91. /package/dist/esm/api/{resources/agentSignup/client/requests/AgentVerifyRequest.mjs → types/AgentSignUpRequest.mjs} +0 -0
  92. /package/dist/esm/api/{resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs → types/AgentVerifyRequest.mjs} +0 -0
@@ -1,50 +0,0 @@
1
- import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
- import { type NormalizedClientOptions } from "../../../../BaseClient.js";
3
- import * as core from "../../../../core/index.js";
4
- import * as AgentPhone from "../../../index.js";
5
- export declare namespace AgentSignupClient {
6
- type Options = BaseClientOptions;
7
- interface RequestOptions extends BaseRequestOptions {
8
- }
9
- }
10
- export declare class AgentSignupClient {
11
- protected readonly _options: NormalizedClientOptions<AgentSignupClient.Options>;
12
- constructor(options?: AgentSignupClient.Options);
13
- /**
14
- * Kick off agent self-signup.
15
- *
16
- * Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
17
- * until /v0/agent/verify is called with the code.
18
- *
19
- * @param {AgentPhone.AgentSignUpRequest} request
20
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
21
- *
22
- * @throws {@link AgentPhone.UnprocessableEntityError}
23
- *
24
- * @example
25
- * await client.agentSignup.agentSignUp({
26
- * human_email: "human_email"
27
- * })
28
- */
29
- agentSignUp(request: AgentPhone.AgentSignUpRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
30
- private __agentSignUp;
31
- /**
32
- * Verify the OTP and atomically provision everything.
33
- *
34
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
35
- * + first-month charge + API key. Returns the key once — agents must save it.
36
- *
37
- * @param {AgentPhone.AgentVerifyRequest} request
38
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
39
- *
40
- * @throws {@link AgentPhone.UnprocessableEntityError}
41
- *
42
- * @example
43
- * await client.agentSignup.agentVerify({
44
- * verification_id: "verification_id",
45
- * otp_code: "otp_code"
46
- * })
47
- */
48
- agentVerify(request: AgentPhone.AgentVerifyRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
49
- private __agentVerify;
50
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * verification_id: "verification_id",
5
- * otp_code: "otp_code"
6
- * }
7
- */
8
- export interface AgentVerifyRequest {
9
- verification_id: string;
10
- otp_code: string;
11
- }
@@ -1,2 +0,0 @@
1
- export type { AgentSignUpRequest } from "./AgentSignUpRequest.js";
2
- export type { AgentVerifyRequest } from "./AgentVerifyRequest.js";
@@ -1,64 +0,0 @@
1
- import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
- import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
- import * as core from "../../../../core/index.js";
4
- import * as AgentPhone from "../../../index.js";
5
- export declare namespace IntegrationsClient {
6
- type Options = BaseClientOptions;
7
- interface RequestOptions extends BaseRequestOptions {
8
- }
9
- }
10
- export declare class IntegrationsClient {
11
- protected readonly _options: NormalizedClientOptionsWithAuth<IntegrationsClient.Options>;
12
- constructor(options?: IntegrationsClient.Options);
13
- /**
14
- * Exchange a one-time connect code and redirect to Supabase OAuth.
15
- *
16
- * @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
17
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
18
- *
19
- * @throws {@link AgentPhone.UnprocessableEntityError}
20
- *
21
- * @example
22
- * await client.integrations.supabaseConnect({
23
- * code: "code"
24
- * })
25
- */
26
- supabaseConnect(request: AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest, requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
27
- private __supabaseConnect;
28
- /**
29
- * Create a short-lived one-time code for initiating the Supabase OAuth flow.
30
- *
31
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
32
- *
33
- * @example
34
- * await client.integrations.supabaseConnectCode()
35
- */
36
- supabaseConnectCode(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
37
- private __supabaseConnectCode;
38
- /**
39
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
40
- *
41
- * @example
42
- * await client.integrations.supabaseStatus()
43
- */
44
- supabaseStatus(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
45
- private __supabaseStatus;
46
- /**
47
- * Get a valid Supabase access token, auto-refreshing if expired.
48
- *
49
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
50
- *
51
- * @example
52
- * await client.integrations.supabaseToken()
53
- */
54
- supabaseToken(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
55
- private __supabaseToken;
56
- /**
57
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
58
- *
59
- * @example
60
- * await client.integrations.supabaseDisconnect()
61
- */
62
- supabaseDisconnect(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
63
- private __supabaseDisconnect;
64
- }
@@ -1,268 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.IntegrationsClient = void 0;
47
- const BaseClient_js_1 = require("../../../../BaseClient.js");
48
- const headers_js_1 = require("../../../../core/headers.js");
49
- const core = __importStar(require("../../../../core/index.js"));
50
- const environments = __importStar(require("../../../../environments.js"));
51
- const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
- const errors = __importStar(require("../../../../errors/index.js"));
53
- const AgentPhone = __importStar(require("../../../index.js"));
54
- class IntegrationsClient {
55
- constructor(options = {}) {
56
- this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
- }
58
- /**
59
- * Exchange a one-time connect code and redirect to Supabase OAuth.
60
- *
61
- * @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
62
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
63
- *
64
- * @throws {@link AgentPhone.UnprocessableEntityError}
65
- *
66
- * @example
67
- * await client.integrations.supabaseConnect({
68
- * code: "code"
69
- * })
70
- */
71
- supabaseConnect(request, requestOptions) {
72
- return core.HttpResponsePromise.fromPromise(this.__supabaseConnect(request, requestOptions));
73
- }
74
- __supabaseConnect(request, requestOptions) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
- const { code } = request;
78
- const _queryParams = {
79
- code,
80
- };
81
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
82
- const _response = yield core.fetcher({
83
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "integrations/supabase/connect"),
84
- method: "GET",
85
- headers: _headers,
86
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
87
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
88
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
89
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
90
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
91
- logging: this._options.logging,
92
- });
93
- if (_response.ok) {
94
- return { data: _response.body, rawResponse: _response.rawResponse };
95
- }
96
- if (_response.error.reason === "status-code") {
97
- switch (_response.error.statusCode) {
98
- case 422:
99
- throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
100
- default:
101
- throw new errors.AgentPhoneError({
102
- statusCode: _response.error.statusCode,
103
- body: _response.error.body,
104
- rawResponse: _response.rawResponse,
105
- });
106
- }
107
- }
108
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/connect");
109
- });
110
- }
111
- /**
112
- * Create a short-lived one-time code for initiating the Supabase OAuth flow.
113
- *
114
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
115
- *
116
- * @example
117
- * await client.integrations.supabaseConnectCode()
118
- */
119
- supabaseConnectCode(requestOptions) {
120
- return core.HttpResponsePromise.fromPromise(this.__supabaseConnectCode(requestOptions));
121
- }
122
- __supabaseConnectCode(requestOptions) {
123
- return __awaiter(this, void 0, void 0, function* () {
124
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
125
- const _authRequest = yield this._options.authProvider.getAuthRequest();
126
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
127
- const _response = yield core.fetcher({
128
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "integrations/supabase/connect"),
129
- method: "POST",
130
- headers: _headers,
131
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
132
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
133
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
134
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
135
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
136
- logging: this._options.logging,
137
- });
138
- if (_response.ok) {
139
- return { data: _response.body, rawResponse: _response.rawResponse };
140
- }
141
- if (_response.error.reason === "status-code") {
142
- throw new errors.AgentPhoneError({
143
- statusCode: _response.error.statusCode,
144
- body: _response.error.body,
145
- rawResponse: _response.rawResponse,
146
- });
147
- }
148
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/integrations/supabase/connect");
149
- });
150
- }
151
- /**
152
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
153
- *
154
- * @example
155
- * await client.integrations.supabaseStatus()
156
- */
157
- supabaseStatus(requestOptions) {
158
- return core.HttpResponsePromise.fromPromise(this.__supabaseStatus(requestOptions));
159
- }
160
- __supabaseStatus(requestOptions) {
161
- return __awaiter(this, void 0, void 0, function* () {
162
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
163
- const _authRequest = yield this._options.authProvider.getAuthRequest();
164
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
165
- const _response = yield core.fetcher({
166
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "integrations/supabase/status"),
167
- method: "GET",
168
- headers: _headers,
169
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
170
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
171
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
172
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
173
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
174
- logging: this._options.logging,
175
- });
176
- if (_response.ok) {
177
- return { data: _response.body, rawResponse: _response.rawResponse };
178
- }
179
- if (_response.error.reason === "status-code") {
180
- throw new errors.AgentPhoneError({
181
- statusCode: _response.error.statusCode,
182
- body: _response.error.body,
183
- rawResponse: _response.rawResponse,
184
- });
185
- }
186
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/status");
187
- });
188
- }
189
- /**
190
- * Get a valid Supabase access token, auto-refreshing if expired.
191
- *
192
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
193
- *
194
- * @example
195
- * await client.integrations.supabaseToken()
196
- */
197
- supabaseToken(requestOptions) {
198
- return core.HttpResponsePromise.fromPromise(this.__supabaseToken(requestOptions));
199
- }
200
- __supabaseToken(requestOptions) {
201
- return __awaiter(this, void 0, void 0, function* () {
202
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
203
- const _authRequest = yield this._options.authProvider.getAuthRequest();
204
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
205
- const _response = yield core.fetcher({
206
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "integrations/supabase/token"),
207
- method: "GET",
208
- headers: _headers,
209
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
210
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
211
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
212
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
213
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
214
- logging: this._options.logging,
215
- });
216
- if (_response.ok) {
217
- return { data: _response.body, rawResponse: _response.rawResponse };
218
- }
219
- if (_response.error.reason === "status-code") {
220
- throw new errors.AgentPhoneError({
221
- statusCode: _response.error.statusCode,
222
- body: _response.error.body,
223
- rawResponse: _response.rawResponse,
224
- });
225
- }
226
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/token");
227
- });
228
- }
229
- /**
230
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
231
- *
232
- * @example
233
- * await client.integrations.supabaseDisconnect()
234
- */
235
- supabaseDisconnect(requestOptions) {
236
- return core.HttpResponsePromise.fromPromise(this.__supabaseDisconnect(requestOptions));
237
- }
238
- __supabaseDisconnect(requestOptions) {
239
- return __awaiter(this, void 0, void 0, function* () {
240
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
241
- const _authRequest = yield this._options.authProvider.getAuthRequest();
242
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
243
- const _response = yield core.fetcher({
244
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "integrations/supabase"),
245
- method: "DELETE",
246
- headers: _headers,
247
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
248
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
249
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
250
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
251
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
252
- logging: this._options.logging,
253
- });
254
- if (_response.ok) {
255
- return { data: _response.body, rawResponse: _response.rawResponse };
256
- }
257
- if (_response.error.reason === "status-code") {
258
- throw new errors.AgentPhoneError({
259
- statusCode: _response.error.statusCode,
260
- body: _response.error.body,
261
- rawResponse: _response.rawResponse,
262
- });
263
- }
264
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/integrations/supabase");
265
- });
266
- }
267
- }
268
- exports.IntegrationsClient = IntegrationsClient;
@@ -1 +0,0 @@
1
- export * from "./requests/index.js";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./requests/index.js"), exports);
@@ -1,9 +0,0 @@
1
- /**
2
- * @example
3
- * {
4
- * code: "code"
5
- * }
6
- */
7
- export interface SupabaseConnectIntegrationsSupabaseConnectGetRequest {
8
- code: string;
9
- }
@@ -1 +0,0 @@
1
- export type { SupabaseConnectIntegrationsSupabaseConnectGetRequest } from "./SupabaseConnectIntegrationsSupabaseConnectGetRequest.js";
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from "./client/index.js";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client/index.js"), exports);
@@ -1,50 +0,0 @@
1
- import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
- import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
3
- import * as core from "../../../../core/index.mjs";
4
- import * as AgentPhone from "../../../index.mjs";
5
- export declare namespace AgentSignupClient {
6
- type Options = BaseClientOptions;
7
- interface RequestOptions extends BaseRequestOptions {
8
- }
9
- }
10
- export declare class AgentSignupClient {
11
- protected readonly _options: NormalizedClientOptions<AgentSignupClient.Options>;
12
- constructor(options?: AgentSignupClient.Options);
13
- /**
14
- * Kick off agent self-signup.
15
- *
16
- * Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
17
- * until /v0/agent/verify is called with the code.
18
- *
19
- * @param {AgentPhone.AgentSignUpRequest} request
20
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
21
- *
22
- * @throws {@link AgentPhone.UnprocessableEntityError}
23
- *
24
- * @example
25
- * await client.agentSignup.agentSignUp({
26
- * human_email: "human_email"
27
- * })
28
- */
29
- agentSignUp(request: AgentPhone.AgentSignUpRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
30
- private __agentSignUp;
31
- /**
32
- * Verify the OTP and atomically provision everything.
33
- *
34
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
35
- * + first-month charge + API key. Returns the key once — agents must save it.
36
- *
37
- * @param {AgentPhone.AgentVerifyRequest} request
38
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
39
- *
40
- * @throws {@link AgentPhone.UnprocessableEntityError}
41
- *
42
- * @example
43
- * await client.agentSignup.agentVerify({
44
- * verification_id: "verification_id",
45
- * otp_code: "otp_code"
46
- * })
47
- */
48
- agentVerify(request: AgentPhone.AgentVerifyRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
49
- private __agentVerify;
50
- }
@@ -1,133 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- import { normalizeClientOptions } from "../../../../BaseClient.mjs";
12
- import { mergeHeaders } from "../../../../core/headers.mjs";
13
- import * as core from "../../../../core/index.mjs";
14
- import * as environments from "../../../../environments.mjs";
15
- import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
- import * as errors from "../../../../errors/index.mjs";
17
- import * as AgentPhone from "../../../index.mjs";
18
- export class AgentSignupClient {
19
- constructor(options = {}) {
20
- this._options = normalizeClientOptions(options);
21
- }
22
- /**
23
- * Kick off agent self-signup.
24
- *
25
- * Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
26
- * until /v0/agent/verify is called with the code.
27
- *
28
- * @param {AgentPhone.AgentSignUpRequest} request
29
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
30
- *
31
- * @throws {@link AgentPhone.UnprocessableEntityError}
32
- *
33
- * @example
34
- * await client.agentSignup.agentSignUp({
35
- * human_email: "human_email"
36
- * })
37
- */
38
- agentSignUp(request, requestOptions) {
39
- return core.HttpResponsePromise.fromPromise(this.__agentSignUp(request, requestOptions));
40
- }
41
- __agentSignUp(request, requestOptions) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
44
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
- const _response = yield core.fetcher({
46
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v0/agent/sign-up"),
47
- method: "POST",
48
- headers: _headers,
49
- contentType: "application/json",
50
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
51
- requestType: "json",
52
- body: request,
53
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
54
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
55
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
56
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
57
- logging: this._options.logging,
58
- });
59
- if (_response.ok) {
60
- return { data: _response.body, rawResponse: _response.rawResponse };
61
- }
62
- if (_response.error.reason === "status-code") {
63
- switch (_response.error.statusCode) {
64
- case 422:
65
- throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
66
- default:
67
- throw new errors.AgentPhoneError({
68
- statusCode: _response.error.statusCode,
69
- body: _response.error.body,
70
- rawResponse: _response.rawResponse,
71
- });
72
- }
73
- }
74
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/sign-up");
75
- });
76
- }
77
- /**
78
- * Verify the OTP and atomically provision everything.
79
- *
80
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
81
- * + first-month charge + API key. Returns the key once — agents must save it.
82
- *
83
- * @param {AgentPhone.AgentVerifyRequest} request
84
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
85
- *
86
- * @throws {@link AgentPhone.UnprocessableEntityError}
87
- *
88
- * @example
89
- * await client.agentSignup.agentVerify({
90
- * verification_id: "verification_id",
91
- * otp_code: "otp_code"
92
- * })
93
- */
94
- agentVerify(request, requestOptions) {
95
- return core.HttpResponsePromise.fromPromise(this.__agentVerify(request, requestOptions));
96
- }
97
- __agentVerify(request, requestOptions) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
100
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
101
- const _response = yield core.fetcher({
102
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v0/agent/verify"),
103
- method: "POST",
104
- headers: _headers,
105
- contentType: "application/json",
106
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
107
- requestType: "json",
108
- body: request,
109
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
110
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
111
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
112
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
113
- logging: this._options.logging,
114
- });
115
- if (_response.ok) {
116
- return { data: _response.body, rawResponse: _response.rawResponse };
117
- }
118
- if (_response.error.reason === "status-code") {
119
- switch (_response.error.statusCode) {
120
- case 422:
121
- throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
122
- default:
123
- throw new errors.AgentPhoneError({
124
- statusCode: _response.error.statusCode,
125
- body: _response.error.body,
126
- rawResponse: _response.rawResponse,
127
- });
128
- }
129
- }
130
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/verify");
131
- });
132
- }
133
- }