telnyx 7.14.0 → 7.16.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.
Files changed (229) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +8 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/calls/actions.d.mts +10 -8
  12. package/resources/calls/actions.d.mts.map +1 -1
  13. package/resources/calls/actions.d.ts +10 -8
  14. package/resources/calls/actions.d.ts.map +1 -1
  15. package/resources/calls/calls.d.mts +5 -5
  16. package/resources/calls/calls.d.mts.map +1 -1
  17. package/resources/calls/calls.d.ts +5 -5
  18. package/resources/calls/calls.d.ts.map +1 -1
  19. package/resources/index.d.mts +3 -1
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +3 -1
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js +7 -3
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs +2 -0
  26. package/resources/index.mjs.map +1 -1
  27. package/resources/meeting-sessions/actions.d.mts +82 -0
  28. package/resources/meeting-sessions/actions.d.mts.map +1 -0
  29. package/resources/meeting-sessions/actions.d.ts +82 -0
  30. package/resources/meeting-sessions/actions.d.ts.map +1 -0
  31. package/resources/meeting-sessions/actions.js +59 -0
  32. package/resources/meeting-sessions/actions.js.map +1 -0
  33. package/resources/meeting-sessions/actions.mjs +55 -0
  34. package/resources/meeting-sessions/actions.mjs.map +1 -0
  35. package/resources/meeting-sessions/artifacts.d.mts +92 -0
  36. package/resources/meeting-sessions/artifacts.d.mts.map +1 -0
  37. package/resources/meeting-sessions/artifacts.d.ts +92 -0
  38. package/resources/meeting-sessions/artifacts.d.ts.map +1 -0
  39. package/resources/meeting-sessions/artifacts.js +62 -0
  40. package/resources/meeting-sessions/artifacts.js.map +1 -0
  41. package/resources/meeting-sessions/artifacts.mjs +58 -0
  42. package/resources/meeting-sessions/artifacts.mjs.map +1 -0
  43. package/resources/meeting-sessions/index.d.mts +4 -0
  44. package/resources/meeting-sessions/index.d.mts.map +1 -0
  45. package/resources/meeting-sessions/index.d.ts +4 -0
  46. package/resources/meeting-sessions/index.d.ts.map +1 -0
  47. package/resources/meeting-sessions/index.js +11 -0
  48. package/resources/meeting-sessions/index.js.map +1 -0
  49. package/resources/meeting-sessions/index.mjs +5 -0
  50. package/resources/meeting-sessions/index.mjs.map +1 -0
  51. package/resources/meeting-sessions/meeting-sessions.d.mts +580 -0
  52. package/resources/meeting-sessions/meeting-sessions.d.mts.map +1 -0
  53. package/resources/meeting-sessions/meeting-sessions.d.ts +580 -0
  54. package/resources/meeting-sessions/meeting-sessions.d.ts.map +1 -0
  55. package/resources/meeting-sessions/meeting-sessions.js +175 -0
  56. package/resources/meeting-sessions/meeting-sessions.js.map +1 -0
  57. package/resources/meeting-sessions/meeting-sessions.mjs +170 -0
  58. package/resources/meeting-sessions/meeting-sessions.mjs.map +1 -0
  59. package/resources/meeting-sessions.d.mts +2 -0
  60. package/resources/meeting-sessions.d.mts.map +1 -0
  61. package/resources/meeting-sessions.d.ts +2 -0
  62. package/resources/meeting-sessions.d.ts.map +1 -0
  63. package/resources/meeting-sessions.js +6 -0
  64. package/resources/meeting-sessions.js.map +1 -0
  65. package/resources/meeting-sessions.mjs +3 -0
  66. package/resources/meeting-sessions.mjs.map +1 -0
  67. package/resources/messaging-profiles/messaging-profiles.d.mts +1 -1
  68. package/resources/messaging-profiles/messaging-profiles.d.ts +1 -1
  69. package/resources/messaging-profiles/messaging-profiles.js +1 -1
  70. package/resources/messaging-profiles/messaging-profiles.mjs +1 -1
  71. package/resources/phone-numbers/voicemail.d.mts +132 -2
  72. package/resources/phone-numbers/voicemail.d.mts.map +1 -1
  73. package/resources/phone-numbers/voicemail.d.ts +132 -2
  74. package/resources/phone-numbers/voicemail.d.ts.map +1 -1
  75. package/resources/phone-numbers/voicemail.js +8 -2
  76. package/resources/phone-numbers/voicemail.js.map +1 -1
  77. package/resources/phone-numbers/voicemail.mjs +8 -2
  78. package/resources/phone-numbers/voicemail.mjs.map +1 -1
  79. package/resources/private-wireless-gateways.d.mts +1 -1
  80. package/resources/private-wireless-gateways.d.ts +1 -1
  81. package/resources/sim-cards/actions.d.mts +69 -3
  82. package/resources/sim-cards/actions.d.mts.map +1 -1
  83. package/resources/sim-cards/actions.d.ts +69 -3
  84. package/resources/sim-cards/actions.d.ts.map +1 -1
  85. package/resources/sim-cards/actions.js +38 -0
  86. package/resources/sim-cards/actions.js.map +1 -1
  87. package/resources/sim-cards/actions.mjs +38 -0
  88. package/resources/sim-cards/actions.mjs.map +1 -1
  89. package/resources/sim-cards/index.d.mts +1 -1
  90. package/resources/sim-cards/index.d.mts.map +1 -1
  91. package/resources/sim-cards/index.d.ts +1 -1
  92. package/resources/sim-cards/index.d.ts.map +1 -1
  93. package/resources/sim-cards/index.js.map +1 -1
  94. package/resources/sim-cards/index.mjs.map +1 -1
  95. package/resources/sim-cards/sim-cards.d.mts +2 -2
  96. package/resources/sim-cards/sim-cards.d.mts.map +1 -1
  97. package/resources/sim-cards/sim-cards.d.ts +2 -2
  98. package/resources/sim-cards/sim-cards.d.ts.map +1 -1
  99. package/resources/sim-cards/sim-cards.js.map +1 -1
  100. package/resources/sim-cards/sim-cards.mjs.map +1 -1
  101. package/resources/storage/index.d.mts +2 -1
  102. package/resources/storage/index.d.mts.map +1 -1
  103. package/resources/storage/index.d.ts +2 -1
  104. package/resources/storage/index.d.ts.map +1 -1
  105. package/resources/storage/index.js +3 -1
  106. package/resources/storage/index.js.map +1 -1
  107. package/resources/storage/index.mjs +1 -0
  108. package/resources/storage/index.mjs.map +1 -1
  109. package/resources/storage/kvs/index.d.mts +1 -1
  110. package/resources/storage/kvs/index.d.mts.map +1 -1
  111. package/resources/storage/kvs/index.d.ts +1 -1
  112. package/resources/storage/kvs/index.d.ts.map +1 -1
  113. package/resources/storage/kvs/index.js.map +1 -1
  114. package/resources/storage/kvs/index.mjs.map +1 -1
  115. package/resources/storage/kvs/kvs.d.mts +7 -1
  116. package/resources/storage/kvs/kvs.d.mts.map +1 -1
  117. package/resources/storage/kvs/kvs.d.ts +7 -1
  118. package/resources/storage/kvs/kvs.d.ts.map +1 -1
  119. package/resources/storage/kvs/kvs.js.map +1 -1
  120. package/resources/storage/kvs/kvs.mjs.map +1 -1
  121. package/resources/storage/sqldbs/actions.d.mts +84 -0
  122. package/resources/storage/sqldbs/actions.d.mts.map +1 -0
  123. package/resources/storage/sqldbs/actions.d.ts +84 -0
  124. package/resources/storage/sqldbs/actions.d.ts.map +1 -0
  125. package/resources/storage/sqldbs/actions.js +29 -0
  126. package/resources/storage/sqldbs/actions.js.map +1 -0
  127. package/resources/storage/sqldbs/actions.mjs +25 -0
  128. package/resources/storage/sqldbs/actions.mjs.map +1 -0
  129. package/resources/storage/sqldbs/index.d.mts +3 -0
  130. package/resources/storage/sqldbs/index.d.mts.map +1 -0
  131. package/resources/storage/sqldbs/index.d.ts +3 -0
  132. package/resources/storage/sqldbs/index.d.ts.map +1 -0
  133. package/resources/storage/sqldbs/index.js +9 -0
  134. package/resources/storage/sqldbs/index.js.map +1 -0
  135. package/resources/storage/sqldbs/index.mjs +4 -0
  136. package/resources/storage/sqldbs/index.mjs.map +1 -0
  137. package/resources/storage/sqldbs/sqldbs.d.mts +116 -0
  138. package/resources/storage/sqldbs/sqldbs.d.mts.map +1 -0
  139. package/resources/storage/sqldbs/sqldbs.d.ts +116 -0
  140. package/resources/storage/sqldbs/sqldbs.d.ts.map +1 -0
  141. package/resources/storage/sqldbs/sqldbs.js +94 -0
  142. package/resources/storage/sqldbs/sqldbs.js.map +1 -0
  143. package/resources/storage/sqldbs/sqldbs.mjs +89 -0
  144. package/resources/storage/sqldbs/sqldbs.mjs.map +1 -0
  145. package/resources/storage/sqldbs.d.mts +2 -0
  146. package/resources/storage/sqldbs.d.mts.map +1 -0
  147. package/resources/storage/sqldbs.d.ts +2 -0
  148. package/resources/storage/sqldbs.d.ts.map +1 -0
  149. package/resources/storage/sqldbs.js +6 -0
  150. package/resources/storage/sqldbs.js.map +1 -0
  151. package/resources/storage/sqldbs.mjs +3 -0
  152. package/resources/storage/sqldbs.mjs.map +1 -0
  153. package/resources/storage/storage.d.mts +6 -2
  154. package/resources/storage/storage.d.mts.map +1 -1
  155. package/resources/storage/storage.d.ts +6 -2
  156. package/resources/storage/storage.d.ts.map +1 -1
  157. package/resources/storage/storage.js +4 -0
  158. package/resources/storage/storage.js.map +1 -1
  159. package/resources/storage/storage.mjs +4 -0
  160. package/resources/storage/storage.mjs.map +1 -1
  161. package/resources/web-search/index.d.mts +3 -0
  162. package/resources/web-search/index.d.mts.map +1 -0
  163. package/resources/web-search/index.d.ts +3 -0
  164. package/resources/web-search/index.d.ts.map +1 -0
  165. package/resources/web-search/index.js +9 -0
  166. package/resources/web-search/index.js.map +1 -0
  167. package/resources/web-search/index.mjs +4 -0
  168. package/resources/web-search/index.mjs.map +1 -0
  169. package/resources/web-search/research.d.mts +148 -0
  170. package/resources/web-search/research.d.mts.map +1 -0
  171. package/resources/web-search/research.d.ts +148 -0
  172. package/resources/web-search/research.d.ts.map +1 -0
  173. package/resources/web-search/research.js +57 -0
  174. package/resources/web-search/research.js.map +1 -0
  175. package/resources/web-search/research.mjs +53 -0
  176. package/resources/web-search/research.mjs.map +1 -0
  177. package/resources/web-search/web-search.d.mts +204 -0
  178. package/resources/web-search/web-search.d.mts.map +1 -0
  179. package/resources/web-search/web-search.d.ts +204 -0
  180. package/resources/web-search/web-search.d.ts.map +1 -0
  181. package/resources/web-search/web-search.js +59 -0
  182. package/resources/web-search/web-search.js.map +1 -0
  183. package/resources/web-search/web-search.mjs +54 -0
  184. package/resources/web-search/web-search.mjs.map +1 -0
  185. package/resources/web-search.d.mts +2 -0
  186. package/resources/web-search.d.mts.map +1 -0
  187. package/resources/web-search.d.ts +2 -0
  188. package/resources/web-search.d.ts.map +1 -0
  189. package/resources/web-search.js +6 -0
  190. package/resources/web-search.js.map +1 -0
  191. package/resources/web-search.mjs +3 -0
  192. package/resources/web-search.mjs.map +1 -0
  193. package/resources/webhooks.d.mts +475 -3
  194. package/resources/webhooks.d.mts.map +1 -1
  195. package/resources/webhooks.d.ts +475 -3
  196. package/resources/webhooks.d.ts.map +1 -1
  197. package/src/client.ts +62 -0
  198. package/src/resources/calls/actions.ts +10 -8
  199. package/src/resources/calls/calls.ts +5 -5
  200. package/src/resources/index.ts +28 -0
  201. package/src/resources/meeting-sessions/actions.ts +108 -0
  202. package/src/resources/meeting-sessions/artifacts.ts +135 -0
  203. package/src/resources/meeting-sessions/index.ts +31 -0
  204. package/src/resources/meeting-sessions/meeting-sessions.ts +771 -0
  205. package/src/resources/meeting-sessions.ts +3 -0
  206. package/src/resources/messaging-profiles/messaging-profiles.ts +1 -1
  207. package/src/resources/phone-numbers/voicemail.ts +144 -2
  208. package/src/resources/private-wireless-gateways.ts +1 -1
  209. package/src/resources/sim-cards/actions.ts +93 -2
  210. package/src/resources/sim-cards/index.ts +3 -0
  211. package/src/resources/sim-cards/sim-cards.ts +6 -0
  212. package/src/resources/storage/index.ts +10 -0
  213. package/src/resources/storage/kvs/index.ts +1 -0
  214. package/src/resources/storage/kvs/kvs.ts +11 -0
  215. package/src/resources/storage/sqldbs/actions.ts +101 -0
  216. package/src/resources/storage/sqldbs/index.ts +12 -0
  217. package/src/resources/storage/sqldbs/sqldbs.ts +179 -0
  218. package/src/resources/storage/sqldbs.ts +3 -0
  219. package/src/resources/storage/storage.ts +24 -0
  220. package/src/resources/web-search/index.ts +17 -0
  221. package/src/resources/web-search/research.ts +180 -0
  222. package/src/resources/web-search/web-search.ts +266 -0
  223. package/src/resources/web-search.ts +3 -0
  224. package/src/resources/webhooks.ts +579 -0
  225. package/src/version.ts +1 -1
  226. package/version.d.mts +1 -1
  227. package/version.d.ts +1 -1
  228. package/version.js +1 -1
  229. package/version.mjs +1 -1
@@ -0,0 +1,179 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as ActionsAPI from './actions';
5
+ import { ActionQueryParams, ActionQueryResponse, Actions } from './actions';
6
+ import { APIPromise } from '../../../core/api-promise';
7
+ import {
8
+ DefaultFlatPagination,
9
+ type DefaultFlatPaginationParams,
10
+ PagePromise,
11
+ } from '../../../core/pagination';
12
+ import { buildHeaders } from '../../../internal/headers';
13
+ import { RequestOptions } from '../../../internal/request-options';
14
+ import { path } from '../../../internal/utils/path';
15
+
16
+ /**
17
+ * Manage SQL databases and run SQL against them
18
+ */
19
+ export class Sqldbs extends APIResource {
20
+ actions: ActionsAPI.Actions = new ActionsAPI.Actions(this._client);
21
+
22
+ /**
23
+ * Lists the SQL databases for the authenticated user's organization. Results use
24
+ * page-based pagination (`page[number]`/`page[size]`) and can be filtered and
25
+ * sorted.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // Automatically fetches more pages as needed.
30
+ * for await (const sqlDatabase of client.storage.sqldbs.list()) {
31
+ * // ...
32
+ * }
33
+ * ```
34
+ */
35
+ list(
36
+ query: SqldbListParams | null | undefined = {},
37
+ options?: RequestOptions,
38
+ ): PagePromise<SqlDatabasesDefaultFlatPagination, SqlDatabase> {
39
+ return this._client.getAPIList('/storage/sqldbs', DefaultFlatPagination<SqlDatabase>, {
40
+ query,
41
+ ...options,
42
+ });
43
+ }
44
+
45
+ /**
46
+ * Creates a new SQL database. Provisioning is asynchronous: the database is
47
+ * returned with status `pending` and becomes usable once it reaches
48
+ * `provision_ok`.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const sqlDatabaseResponseWrapper =
53
+ * await client.storage.sqldbs.create({
54
+ * name: 'my-database',
55
+ * });
56
+ * ```
57
+ */
58
+ create(body: SqldbCreateParams, options?: RequestOptions): APIPromise<SqlDatabaseResponseWrapper> {
59
+ return this._client.post('/storage/sqldbs', { body, ...options });
60
+ }
61
+
62
+ /**
63
+ * Deletes a SQL database and all of the data it holds. Deletion is asynchronous
64
+ * and returns `202` with an empty body — the record is not removed synchronously.
65
+ * Poll `GET /storage/sqldbs/{id}`, which returns `404` once the database has been
66
+ * purged; there is no durable `deleted` state. A database still bound by a
67
+ * function is refused with `409` unless `force=true`.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * await client.storage.sqldbs.delete(
72
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
73
+ * );
74
+ * ```
75
+ */
76
+ delete(
77
+ id: string,
78
+ params: SqldbDeleteParams | null | undefined = {},
79
+ options?: RequestOptions,
80
+ ): APIPromise<void> {
81
+ const { force } = params ?? {};
82
+ return this._client.delete(path`/storage/sqldbs/${id}`, {
83
+ query: { force },
84
+ ...options,
85
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
86
+ });
87
+ }
88
+
89
+ /**
90
+ * Retrieves a SQL database by its ID, including its provisioning status.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * const sqlDatabaseResponseWrapper =
95
+ * await client.storage.sqldbs.retrieve(
96
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
97
+ * );
98
+ * ```
99
+ */
100
+ retrieve(id: string, options?: RequestOptions): APIPromise<SqlDatabaseResponseWrapper> {
101
+ return this._client.get(path`/storage/sqldbs/${id}`, options);
102
+ }
103
+ }
104
+
105
+ export type SqlDatabasesDefaultFlatPagination = DefaultFlatPagination<SqlDatabase>;
106
+
107
+ export interface SqlDatabase {
108
+ id?: string;
109
+
110
+ created_at?: string;
111
+
112
+ name?: string;
113
+
114
+ record_type?: string;
115
+
116
+ /**
117
+ * Provisioning status. A database is usable once `status` is `provision_ok`. Once
118
+ * deletion completes, the database no longer appears in the API.
119
+ */
120
+ status?: 'pending' | 'provision_ok' | 'provision_failed' | 'deleting' | 'delete_failed';
121
+
122
+ updated_at?: string;
123
+ }
124
+
125
+ export interface SqlDatabaseResponseWrapper {
126
+ data?: SqlDatabase;
127
+ }
128
+
129
+ export interface SqldbListParams extends DefaultFlatPaginationParams {
130
+ /**
131
+ * Filter by exact name match.
132
+ */
133
+ 'filter[name]'?: string;
134
+
135
+ /**
136
+ * Filter by provisioning status.
137
+ */
138
+ 'filter[status]'?: 'pending' | 'provision_ok' | 'provision_failed' | 'deleting' | 'delete_failed';
139
+
140
+ /**
141
+ * Sort field; prefix with `-` for descending order.
142
+ */
143
+ sort?: 'name' | '-name' | 'status' | '-status' | 'created_at' | '-created_at';
144
+ }
145
+
146
+ export interface SqldbCreateParams {
147
+ /**
148
+ * Database name. Lowercase letters, numbers, and hyphens only; must start and end
149
+ * with a letter or number.
150
+ */
151
+ name: string;
152
+ }
153
+
154
+ export interface SqldbDeleteParams {
155
+ /**
156
+ * Delete the database even when functions still bind it. Their bindings stop
157
+ * resolving.
158
+ */
159
+ force?: boolean;
160
+ }
161
+
162
+ Sqldbs.Actions = Actions;
163
+
164
+ export declare namespace Sqldbs {
165
+ export {
166
+ type SqlDatabase as SqlDatabase,
167
+ type SqlDatabaseResponseWrapper as SqlDatabaseResponseWrapper,
168
+ type SqlDatabasesDefaultFlatPagination as SqlDatabasesDefaultFlatPagination,
169
+ type SqldbListParams as SqldbListParams,
170
+ type SqldbCreateParams as SqldbCreateParams,
171
+ type SqldbDeleteParams as SqldbDeleteParams,
172
+ };
173
+
174
+ export {
175
+ Actions as Actions,
176
+ type ActionQueryResponse as ActionQueryResponse,
177
+ type ActionQueryParams as ActionQueryParams,
178
+ };
179
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './sqldbs/index';
@@ -27,6 +27,7 @@ import {
27
27
  } from './cloudfs/cloudfs';
28
28
  import * as KvsAPI from './kvs/kvs';
29
29
  import {
30
+ EdgeComputePaginationMeta,
30
31
  KvCreateParams,
31
32
  KvListParams,
32
33
  KvNamespace,
@@ -43,6 +44,16 @@ import {
43
44
  MigrationRetrieveResponse,
44
45
  Migrations,
45
46
  } from './migrations/migrations';
47
+ import * as SqldbsAPI from './sqldbs/sqldbs';
48
+ import {
49
+ SqlDatabase,
50
+ SqlDatabaseResponseWrapper,
51
+ SqlDatabasesDefaultFlatPagination,
52
+ SqldbCreateParams,
53
+ SqldbDeleteParams,
54
+ SqldbListParams,
55
+ Sqldbs,
56
+ } from './sqldbs/sqldbs';
46
57
  import { APIPromise } from '../../core/api-promise';
47
58
  import { RequestOptions } from '../../internal/request-options';
48
59
 
@@ -57,6 +68,7 @@ export class Storage extends APIResource {
57
68
  migrations: MigrationsAPI.Migrations = new MigrationsAPI.Migrations(this._client);
58
69
  kvs: KvsAPI.Kvs = new KvsAPI.Kvs(this._client);
59
70
  cloudfs: CloudfsAPI.Cloudfs = new CloudfsAPI.Cloudfs(this._client);
71
+ sqldbs: SqldbsAPI.Sqldbs = new SqldbsAPI.Sqldbs(this._client);
60
72
 
61
73
  /**
62
74
  * List the external storage providers and regions supported as migration sources.
@@ -99,6 +111,7 @@ Storage.MigrationSources = MigrationSources;
99
111
  Storage.Migrations = Migrations;
100
112
  Storage.Kvs = Kvs;
101
113
  Storage.Cloudfs = Cloudfs;
114
+ Storage.Sqldbs = Sqldbs;
102
115
 
103
116
  export declare namespace Storage {
104
117
  export { type StorageListMigrationSourceCoverageResponse as StorageListMigrationSourceCoverageResponse };
@@ -130,6 +143,7 @@ export declare namespace Storage {
130
143
 
131
144
  export {
132
145
  Kvs as Kvs,
146
+ type EdgeComputePaginationMeta as EdgeComputePaginationMeta,
133
147
  type KvNamespace as KvNamespace,
134
148
  type KvNamespaceResponseWrapper as KvNamespaceResponseWrapper,
135
149
  type KvNamespacesDefaultFlatPagination as KvNamespacesDefaultFlatPagination,
@@ -147,4 +161,14 @@ export declare namespace Storage {
147
161
  type CloudfCreateParams as CloudfCreateParams,
148
162
  type CloudfUpdateParams as CloudfUpdateParams,
149
163
  };
164
+
165
+ export {
166
+ Sqldbs as Sqldbs,
167
+ type SqlDatabase as SqlDatabase,
168
+ type SqlDatabaseResponseWrapper as SqlDatabaseResponseWrapper,
169
+ type SqlDatabasesDefaultFlatPagination as SqlDatabasesDefaultFlatPagination,
170
+ type SqldbListParams as SqldbListParams,
171
+ type SqldbCreateParams as SqldbCreateParams,
172
+ type SqldbDeleteParams as SqldbDeleteParams,
173
+ };
150
174
  }
@@ -0,0 +1,17 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Research,
5
+ type ResearchCitation,
6
+ type ResearchCreateResponse,
7
+ type ResearchRetrieveResponse,
8
+ type ResearchCreateParams,
9
+ } from './research';
10
+ export {
11
+ WebSearch,
12
+ type WebSearchResult,
13
+ type WebSearchCreateResponse,
14
+ type WebSearchContentsResponse,
15
+ type WebSearchCreateParams,
16
+ type WebSearchContentsParams,
17
+ } from './web-search';
@@ -0,0 +1,180 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as ResearchAPI from './research';
5
+ import { APIPromise } from '../../core/api-promise';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ /**
10
+ * Deep research with citations and async task polling.
11
+ */
12
+ export class Research extends APIResource {
13
+ /**
14
+ * Starts a deep research task that runs multiple searches, reads sources, and
15
+ * synthesizes an answer with citations.
16
+ *
17
+ * ## Synchronous mode (default)
18
+ *
19
+ * When `background` is `false` or omitted, the request blocks until the research
20
+ * completes and returns the answer with citations. This can take up to 120 seconds
21
+ * depending on `research_effort`.
22
+ *
23
+ * ## Asynchronous mode
24
+ *
25
+ * When `background` is `true`, the request returns immediately with a `task_id`
26
+ * and `status: pending`. Poll `GET /web_search/research/{task_id}` to check when
27
+ * the research completes and retrieve the answer.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const research = await client.webSearch.research.create({
32
+ * query:
33
+ * 'Compare the performance of RAG vs fine-tuning for domain-specific QA',
34
+ * max_sources: 20,
35
+ * research_effort: 'standard',
36
+ * });
37
+ * ```
38
+ */
39
+ create(body: ResearchCreateParams, options?: RequestOptions): APIPromise<ResearchCreateResponse> {
40
+ return this._client.post('/web_search/research', { body, ...options });
41
+ }
42
+
43
+ /**
44
+ * Polls the status of a previously started asynchronous research task. When the
45
+ * status is `completed`, the response includes the answer and citations. When the
46
+ * status is `failed`, the response includes an error message.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const research = await client.webSearch.research.retrieve(
51
+ * 'bf3026a5-dd57-44dd-b922-200041be3a4b',
52
+ * );
53
+ * ```
54
+ */
55
+ retrieve(taskID: string, options?: RequestOptions): APIPromise<ResearchRetrieveResponse> {
56
+ return this._client.get(path`/web_search/research/${taskID}`, options);
57
+ }
58
+ }
59
+
60
+ export interface ResearchCitation {
61
+ /**
62
+ * Title of the source page.
63
+ */
64
+ title: string;
65
+
66
+ /**
67
+ * Source URL.
68
+ */
69
+ url: string;
70
+
71
+ /**
72
+ * Relevant excerpt from the source (if available).
73
+ */
74
+ snippet?: string;
75
+ }
76
+
77
+ export interface ResearchCreateResponse {
78
+ /**
79
+ * Synchronous research response (when `background` is false or unset).
80
+ */
81
+ data?: ResearchCreateResponse.ResearchResponseSync | ResearchCreateResponse.ResearchResponseAsync;
82
+ }
83
+
84
+ export namespace ResearchCreateResponse {
85
+ /**
86
+ * Synchronous research response (when `background` is false or unset).
87
+ */
88
+ export interface ResearchResponseSync {
89
+ /**
90
+ * The synthesized research answer.
91
+ */
92
+ answer: string;
93
+
94
+ /**
95
+ * Sources cited in the answer.
96
+ */
97
+ citations?: Array<ResearchAPI.ResearchCitation>;
98
+ }
99
+
100
+ /**
101
+ * Asynchronous research response (when `background` is true).
102
+ */
103
+ export interface ResearchResponseAsync {
104
+ /**
105
+ * Current status of the research task.
106
+ */
107
+ status: 'pending' | 'running' | 'completed' | 'failed';
108
+
109
+ /**
110
+ * Unique identifier for the research task. Use this to poll the status.
111
+ */
112
+ task_id: string;
113
+ }
114
+ }
115
+
116
+ export interface ResearchRetrieveResponse {
117
+ data?: ResearchRetrieveResponse.Data;
118
+ }
119
+
120
+ export namespace ResearchRetrieveResponse {
121
+ export interface Data {
122
+ /**
123
+ * Current status of the research task.
124
+ */
125
+ status: 'pending' | 'running' | 'completed' | 'failed';
126
+
127
+ /**
128
+ * The research task identifier.
129
+ */
130
+ task_id: string;
131
+
132
+ /**
133
+ * The synthesized research answer (present when status is `completed`).
134
+ */
135
+ answer?: string;
136
+
137
+ /**
138
+ * Sources cited in the answer (present when status is `completed`).
139
+ */
140
+ citations?: Array<ResearchAPI.ResearchCitation>;
141
+
142
+ /**
143
+ * Always present in poll responses; `null` unless the task failed.
144
+ */
145
+ error?: string | null;
146
+ }
147
+ }
148
+
149
+ export interface ResearchCreateParams {
150
+ /**
151
+ * The research question or topic.
152
+ */
153
+ query: string;
154
+
155
+ /**
156
+ * When `true`, the research runs asynchronously. The response returns a `task_id`
157
+ * immediately instead of waiting for the result. Poll
158
+ * `GET /web_search/research/{task_id}` to check status.
159
+ */
160
+ background?: boolean;
161
+
162
+ /**
163
+ * Maximum number of sources to use.
164
+ */
165
+ max_sources?: number;
166
+
167
+ /**
168
+ * Research depth level. `lite` is fastest, `deep` is most thorough.
169
+ */
170
+ research_effort?: 'lite' | 'standard' | 'deep';
171
+ }
172
+
173
+ export declare namespace Research {
174
+ export {
175
+ type ResearchCitation as ResearchCitation,
176
+ type ResearchCreateResponse as ResearchCreateResponse,
177
+ type ResearchRetrieveResponse as ResearchRetrieveResponse,
178
+ type ResearchCreateParams as ResearchCreateParams,
179
+ };
180
+ }
@@ -0,0 +1,266 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as WebSearchAPI from './web-search';
5
+ import * as ResearchAPI from './research';
6
+ import {
7
+ Research,
8
+ ResearchCitation,
9
+ ResearchCreateParams,
10
+ ResearchCreateResponse,
11
+ ResearchRetrieveResponse,
12
+ } from './research';
13
+ import { APIPromise } from '../../core/api-promise';
14
+ import { RequestOptions } from '../../internal/request-options';
15
+
16
+ export class WebSearch extends APIResource {
17
+ research: ResearchAPI.Research = new ResearchAPI.Research(this._client);
18
+
19
+ /**
20
+ * Performs a real-time web search and returns structured, LLM-ready JSON results
21
+ * with titles, URLs, descriptions, and snippets. Supports filtering by domain,
22
+ * country, safe search, freshness, and live crawl.
23
+ *
24
+ * **Note:** `include_domains` and `exclude_domains` cannot be used in the same
25
+ * request. Use one or the other.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const webSearch = await client.webSearch.create({
30
+ * query: 'latest AI agent frameworks',
31
+ * count: 10,
32
+ * country: 'US',
33
+ * freshness: 'week',
34
+ * include_domains: ['arxiv.org', 'github.com'],
35
+ * safesearch: 'moderate',
36
+ * });
37
+ * ```
38
+ */
39
+ create(body: WebSearchCreateParams, options?: RequestOptions): APIPromise<WebSearchCreateResponse> {
40
+ return this._client.post('/web_search', { body, ...options });
41
+ }
42
+
43
+ /**
44
+ * Retrieves clean HTML or Markdown content from a list of URLs. Supports up to 20
45
+ * URLs per request (public API limit). Specify which formats to return: `html`,
46
+ * `markdown`, `metadata`.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const response = await client.webSearch.contents({
51
+ * urls: [
52
+ * 'https://en.wikipedia.org/wiki/Artificial_intelligence',
53
+ * ],
54
+ * crawl_timeout: 10,
55
+ * formats: ['markdown', 'metadata'],
56
+ * });
57
+ * ```
58
+ */
59
+ contents(body: WebSearchContentsParams, options?: RequestOptions): APIPromise<WebSearchContentsResponse> {
60
+ return this._client.post('/web_search/contents', { body, ...options });
61
+ }
62
+ }
63
+
64
+ export interface WebSearchResult {
65
+ /**
66
+ * Short description or excerpt.
67
+ */
68
+ description: string;
69
+
70
+ /**
71
+ * Relevant text snippets from the page.
72
+ */
73
+ snippets: Array<string>;
74
+
75
+ /**
76
+ * Result title.
77
+ */
78
+ title: string;
79
+
80
+ /**
81
+ * Result URL.
82
+ */
83
+ url: string;
84
+
85
+ /**
86
+ * Favicon URL (if available).
87
+ */
88
+ favicon_url?: string;
89
+
90
+ /**
91
+ * Thumbnail image URL (if available).
92
+ */
93
+ thumbnail_url?: string;
94
+ }
95
+
96
+ export interface WebSearchCreateResponse {
97
+ data?: WebSearchCreateResponse.Data;
98
+ }
99
+
100
+ export namespace WebSearchCreateResponse {
101
+ export interface Data {
102
+ results?: Data.Results;
103
+ }
104
+
105
+ export namespace Data {
106
+ export interface Results {
107
+ /**
108
+ * Web search results.
109
+ */
110
+ web: Array<WebSearchAPI.WebSearchResult>;
111
+
112
+ /**
113
+ * News search results. Present only when the query surfaces news results.
114
+ */
115
+ news?: Array<WebSearchAPI.WebSearchResult>;
116
+ }
117
+ }
118
+ }
119
+
120
+ export interface WebSearchContentsResponse {
121
+ data?: WebSearchContentsResponse.Data;
122
+ }
123
+
124
+ export namespace WebSearchContentsResponse {
125
+ export interface Data {
126
+ results?: Array<Data.Result>;
127
+ }
128
+
129
+ export namespace Data {
130
+ export interface Result {
131
+ /**
132
+ * The source URL.
133
+ */
134
+ url: string;
135
+
136
+ /**
137
+ * Cleaned HTML content (if `html` format requested; may also be present on freshly
138
+ * crawled pages).
139
+ */
140
+ html?: string;
141
+
142
+ /**
143
+ * Markdown content (if `markdown` format requested).
144
+ */
145
+ markdown?: string;
146
+
147
+ /**
148
+ * Page metadata (if `metadata` format requested).
149
+ */
150
+ metadata?: Result.Metadata;
151
+
152
+ /**
153
+ * Page title (if available).
154
+ */
155
+ title?: string;
156
+ }
157
+
158
+ export namespace Result {
159
+ /**
160
+ * Page metadata (if `metadata` format requested).
161
+ */
162
+ export interface Metadata {
163
+ /**
164
+ * Favicon URL (if available).
165
+ */
166
+ favicon_url?: string;
167
+
168
+ /**
169
+ * Site name. Often empty.
170
+ */
171
+ site_name?: string;
172
+
173
+ [k: string]: unknown;
174
+ }
175
+ }
176
+ }
177
+ }
178
+
179
+ export interface WebSearchCreateParams {
180
+ /**
181
+ * The search query text.
182
+ */
183
+ query: string;
184
+
185
+ /**
186
+ * Number of results to return (1-100).
187
+ */
188
+ count?: number;
189
+
190
+ /**
191
+ * Two-letter country code (ISO 3166-1 alpha-2) to bias results.
192
+ */
193
+ country?: string;
194
+
195
+ /**
196
+ * Exclude results from these domains (bare hostnames, e.g. `pinterest.com`).
197
+ */
198
+ exclude_domains?: Array<string>;
199
+
200
+ /**
201
+ * Time-based filter for results. Common values: `day`, `week`, `month`, `year`.
202
+ */
203
+ freshness?: string;
204
+
205
+ /**
206
+ * Restrict results to these domains (bare hostnames, e.g. `arxiv.org`).
207
+ */
208
+ include_domains?: Array<string>;
209
+
210
+ /**
211
+ * When true, the provider crawls pages in real-time for fresh content. The boolean
212
+ * is translated to the provider's internal enum internally; callers always pass
213
+ * `true` or `false`.
214
+ */
215
+ livecrawl?: boolean;
216
+
217
+ /**
218
+ * Safe search filter level.
219
+ */
220
+ safesearch?: 'off' | 'moderate' | 'strict';
221
+ }
222
+
223
+ export interface WebSearchContentsParams {
224
+ /**
225
+ * List of URLs to retrieve content from (max 20 for public API).
226
+ */
227
+ urls: Array<string>;
228
+
229
+ /**
230
+ * Timeout for crawling each URL, in seconds (1-60).
231
+ */
232
+ crawl_timeout?: number;
233
+
234
+ /**
235
+ * Content formats to return. If omitted, `html` and `metadata` are returned by
236
+ * default. Retrieval is best-effort per URL: a format field appears only when that
237
+ * content could be produced, and a freshly crawled page may also include `html`
238
+ * even when not requested.
239
+ */
240
+ formats?: Array<'html' | 'markdown' | 'metadata'>;
241
+
242
+ /**
243
+ * Maximum age of cached content in seconds. `null` means no limit.
244
+ */
245
+ max_age?: number | null;
246
+ }
247
+
248
+ WebSearch.Research = Research;
249
+
250
+ export declare namespace WebSearch {
251
+ export {
252
+ type WebSearchResult as WebSearchResult,
253
+ type WebSearchCreateResponse as WebSearchCreateResponse,
254
+ type WebSearchContentsResponse as WebSearchContentsResponse,
255
+ type WebSearchCreateParams as WebSearchCreateParams,
256
+ type WebSearchContentsParams as WebSearchContentsParams,
257
+ };
258
+
259
+ export {
260
+ Research as Research,
261
+ type ResearchCitation as ResearchCitation,
262
+ type ResearchCreateResponse as ResearchCreateResponse,
263
+ type ResearchRetrieveResponse as ResearchRetrieveResponse,
264
+ type ResearchCreateParams as ResearchCreateParams,
265
+ };
266
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './web-search/index';