@mixedbread/sdk 0.5.0 → 0.7.2

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 (228) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +12 -24
  3. package/bin/migration-config.json +105 -2
  4. package/client.d.mts +12 -28
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +12 -28
  7. package/client.d.ts.map +1 -1
  8. package/client.js +6 -22
  9. package/client.js.map +1 -1
  10. package/client.mjs +6 -22
  11. package/client.mjs.map +1 -1
  12. package/core/pagination.d.mts +1 -1
  13. package/core/pagination.d.mts.map +1 -1
  14. package/core/pagination.d.ts +1 -1
  15. package/core/pagination.d.ts.map +1 -1
  16. package/core/resource.d.mts +1 -1
  17. package/core/resource.d.mts.map +1 -1
  18. package/core/resource.d.ts +1 -1
  19. package/core/resource.d.ts.map +1 -1
  20. package/core/resource.js.map +1 -1
  21. package/core/resource.mjs.map +1 -1
  22. package/internal/detect-platform.js +3 -3
  23. package/internal/detect-platform.js.map +1 -1
  24. package/internal/detect-platform.mjs +3 -3
  25. package/internal/detect-platform.mjs.map +1 -1
  26. package/internal/headers.d.mts.map +1 -1
  27. package/internal/headers.d.ts.map +1 -1
  28. package/internal/headers.js +5 -5
  29. package/internal/headers.js.map +1 -1
  30. package/internal/headers.mjs +5 -5
  31. package/internal/headers.mjs.map +1 -1
  32. package/internal/shim-types.d.mts +11 -22
  33. package/internal/shim-types.d.mts.map +1 -0
  34. package/internal/shim-types.d.ts +11 -22
  35. package/internal/shim-types.d.ts.map +1 -0
  36. package/internal/shim-types.js +4 -0
  37. package/internal/shim-types.js.map +1 -0
  38. package/internal/shim-types.mjs +3 -0
  39. package/internal/shim-types.mjs.map +1 -0
  40. package/internal/shims.d.mts +2 -2
  41. package/internal/shims.d.mts.map +1 -1
  42. package/internal/shims.d.ts +2 -2
  43. package/internal/shims.d.ts.map +1 -1
  44. package/internal/uploads.js +1 -1
  45. package/internal/uploads.js.map +1 -1
  46. package/internal/uploads.mjs +1 -1
  47. package/internal/uploads.mjs.map +1 -1
  48. package/internal/utils/log.js +1 -1
  49. package/internal/utils/log.js.map +1 -1
  50. package/internal/utils/log.mjs +1 -1
  51. package/internal/utils/log.mjs.map +1 -1
  52. package/internal/utils/path.d.mts.map +1 -1
  53. package/internal/utils/path.d.ts.map +1 -1
  54. package/internal/utils/path.js.map +1 -1
  55. package/internal/utils/path.mjs +1 -1
  56. package/internal/utils/path.mjs.map +1 -1
  57. package/internal/utils/values.d.mts +2 -0
  58. package/internal/utils/values.d.mts.map +1 -1
  59. package/internal/utils/values.d.ts +2 -0
  60. package/internal/utils/values.d.ts.map +1 -1
  61. package/internal/utils/values.js +4 -1
  62. package/internal/utils/values.js.map +1 -1
  63. package/internal/utils/values.mjs +2 -0
  64. package/internal/utils/values.mjs.map +1 -1
  65. package/package.json +1 -7
  66. package/resources/api-keys.d.mts +171 -0
  67. package/resources/api-keys.d.mts.map +1 -0
  68. package/resources/api-keys.d.ts +171 -0
  69. package/resources/api-keys.d.ts.map +1 -0
  70. package/resources/api-keys.js +76 -0
  71. package/resources/api-keys.js.map +1 -0
  72. package/resources/api-keys.mjs +72 -0
  73. package/resources/api-keys.mjs.map +1 -0
  74. package/resources/data-sources/connectors.d.mts +203 -0
  75. package/resources/data-sources/connectors.d.mts.map +1 -0
  76. package/resources/data-sources/connectors.d.ts +203 -0
  77. package/resources/data-sources/connectors.d.ts.map +1 -0
  78. package/resources/data-sources/connectors.js +73 -0
  79. package/resources/data-sources/connectors.js.map +1 -0
  80. package/resources/data-sources/connectors.mjs +69 -0
  81. package/resources/data-sources/connectors.mjs.map +1 -0
  82. package/resources/data-sources/data-sources.d.mts +287 -0
  83. package/resources/data-sources/data-sources.d.mts.map +1 -0
  84. package/resources/data-sources/data-sources.d.ts +287 -0
  85. package/resources/data-sources/data-sources.d.ts.map +1 -0
  86. package/resources/data-sources/data-sources.js +66 -0
  87. package/resources/data-sources/data-sources.js.map +1 -0
  88. package/resources/data-sources/data-sources.mjs +61 -0
  89. package/resources/data-sources/data-sources.mjs.map +1 -0
  90. package/resources/data-sources/index.d.mts +3 -0
  91. package/resources/data-sources/index.d.mts.map +1 -0
  92. package/resources/data-sources/index.d.ts +3 -0
  93. package/resources/data-sources/index.d.ts.map +1 -0
  94. package/resources/data-sources/index.js +9 -0
  95. package/resources/data-sources/index.js.map +1 -0
  96. package/resources/data-sources/index.mjs +4 -0
  97. package/resources/data-sources/index.mjs.map +1 -0
  98. package/resources/data-sources.d.mts +2 -0
  99. package/resources/data-sources.d.mts.map +1 -0
  100. package/resources/data-sources.d.ts +2 -0
  101. package/resources/data-sources.d.ts.map +1 -0
  102. package/resources/data-sources.js +6 -0
  103. package/resources/data-sources.js.map +1 -0
  104. package/resources/data-sources.mjs +3 -0
  105. package/resources/data-sources.mjs.map +1 -0
  106. package/resources/embeddings.d.mts +7 -11
  107. package/resources/embeddings.d.mts.map +1 -1
  108. package/resources/embeddings.d.ts +7 -11
  109. package/resources/embeddings.d.ts.map +1 -1
  110. package/resources/embeddings.js +0 -9
  111. package/resources/embeddings.js.map +1 -1
  112. package/resources/embeddings.mjs +0 -9
  113. package/resources/embeddings.mjs.map +1 -1
  114. package/resources/extractions/content.d.mts +44 -42
  115. package/resources/extractions/content.d.mts.map +1 -1
  116. package/resources/extractions/content.d.ts +44 -42
  117. package/resources/extractions/content.d.ts.map +1 -1
  118. package/resources/extractions/extractions.d.mts +2 -2
  119. package/resources/extractions/extractions.d.mts.map +1 -1
  120. package/resources/extractions/extractions.d.ts +2 -2
  121. package/resources/extractions/extractions.d.ts.map +1 -1
  122. package/resources/extractions/extractions.js.map +1 -1
  123. package/resources/extractions/extractions.mjs.map +1 -1
  124. package/resources/extractions/index.d.mts +1 -1
  125. package/resources/extractions/index.d.mts.map +1 -1
  126. package/resources/extractions/index.d.ts +1 -1
  127. package/resources/extractions/index.d.ts.map +1 -1
  128. package/resources/extractions/index.js.map +1 -1
  129. package/resources/extractions/index.mjs +1 -1
  130. package/resources/extractions/index.mjs.map +1 -1
  131. package/resources/extractions/jobs.d.mts +2 -1
  132. package/resources/extractions/jobs.d.mts.map +1 -1
  133. package/resources/extractions/jobs.d.ts +2 -1
  134. package/resources/extractions/jobs.d.ts.map +1 -1
  135. package/resources/extractions/jobs.js.map +1 -1
  136. package/resources/extractions/jobs.mjs.map +1 -1
  137. package/resources/files.d.mts +18 -1
  138. package/resources/files.d.mts.map +1 -1
  139. package/resources/files.d.ts +18 -1
  140. package/resources/files.d.ts.map +1 -1
  141. package/resources/index.d.mts +5 -3
  142. package/resources/index.d.mts.map +1 -1
  143. package/resources/index.d.ts +5 -3
  144. package/resources/index.d.ts.map +1 -1
  145. package/resources/index.js +5 -1
  146. package/resources/index.js.map +1 -1
  147. package/resources/index.mjs +2 -0
  148. package/resources/index.mjs.map +1 -1
  149. package/resources/parsing/index.d.mts +1 -1
  150. package/resources/parsing/index.d.mts.map +1 -1
  151. package/resources/parsing/index.d.ts +1 -1
  152. package/resources/parsing/index.d.ts.map +1 -1
  153. package/resources/parsing/index.js.map +1 -1
  154. package/resources/parsing/index.mjs.map +1 -1
  155. package/resources/parsing/jobs.d.mts +24 -10
  156. package/resources/parsing/jobs.d.mts.map +1 -1
  157. package/resources/parsing/jobs.d.ts +24 -10
  158. package/resources/parsing/jobs.d.ts.map +1 -1
  159. package/resources/parsing/jobs.js.map +1 -1
  160. package/resources/parsing/jobs.mjs.map +1 -1
  161. package/resources/parsing/parsing.d.mts +2 -2
  162. package/resources/parsing/parsing.d.mts.map +1 -1
  163. package/resources/parsing/parsing.d.ts +2 -2
  164. package/resources/parsing/parsing.d.ts.map +1 -1
  165. package/resources/parsing/parsing.js.map +1 -1
  166. package/resources/parsing/parsing.mjs.map +1 -1
  167. package/resources/top-level.d.mts +5 -4
  168. package/resources/top-level.d.mts.map +1 -1
  169. package/resources/top-level.d.ts +5 -4
  170. package/resources/top-level.d.ts.map +1 -1
  171. package/resources/vector-stores/files.d.mts +79 -19
  172. package/resources/vector-stores/files.d.mts.map +1 -1
  173. package/resources/vector-stores/files.d.ts +79 -19
  174. package/resources/vector-stores/files.d.ts.map +1 -1
  175. package/resources/vector-stores/files.js +19 -18
  176. package/resources/vector-stores/files.js.map +1 -1
  177. package/resources/vector-stores/files.mjs +19 -18
  178. package/resources/vector-stores/files.mjs.map +1 -1
  179. package/resources/vector-stores/index.d.mts +1 -1
  180. package/resources/vector-stores/index.d.mts.map +1 -1
  181. package/resources/vector-stores/index.d.ts +1 -1
  182. package/resources/vector-stores/index.d.ts.map +1 -1
  183. package/resources/vector-stores/index.js.map +1 -1
  184. package/resources/vector-stores/index.mjs.map +1 -1
  185. package/resources/vector-stores/vector-stores.d.mts +275 -90
  186. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  187. package/resources/vector-stores/vector-stores.d.ts +275 -90
  188. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  189. package/resources/vector-stores/vector-stores.js +18 -15
  190. package/resources/vector-stores/vector-stores.js.map +1 -1
  191. package/resources/vector-stores/vector-stores.mjs +18 -15
  192. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  193. package/src/client.ts +63 -30
  194. package/src/core/pagination.ts +1 -1
  195. package/src/core/resource.ts +1 -1
  196. package/src/internal/detect-platform.ts +3 -3
  197. package/src/internal/headers.ts +6 -6
  198. package/src/internal/shim-types.ts +26 -0
  199. package/src/internal/shims.ts +2 -2
  200. package/src/internal/uploads.ts +2 -2
  201. package/src/internal/utils/log.ts +1 -1
  202. package/src/internal/utils/path.ts +1 -1
  203. package/src/internal/utils/values.ts +3 -0
  204. package/src/resources/api-keys.ts +225 -0
  205. package/src/resources/data-sources/connectors.ts +290 -0
  206. package/src/resources/data-sources/data-sources.ts +404 -0
  207. package/src/resources/data-sources/index.ts +24 -0
  208. package/src/resources/data-sources.ts +3 -0
  209. package/src/resources/embeddings.ts +25 -19
  210. package/src/resources/extractions/content.ts +51 -43
  211. package/src/resources/extractions/extractions.ts +3 -1
  212. package/src/resources/extractions/index.ts +7 -1
  213. package/src/resources/extractions/jobs.ts +2 -1
  214. package/src/resources/files.ts +21 -0
  215. package/src/resources/index.ts +26 -4
  216. package/src/resources/parsing/index.ts +4 -0
  217. package/src/resources/parsing/jobs.ts +42 -44
  218. package/src/resources/parsing/parsing.ts +8 -0
  219. package/src/resources/top-level.ts +5 -44
  220. package/src/resources/vector-stores/files.ts +104 -28
  221. package/src/resources/vector-stores/index.ts +4 -3
  222. package/src/resources/vector-stores/vector-stores.ts +330 -102
  223. package/src/version.ts +1 -1
  224. package/version.d.mts +1 -1
  225. package/version.d.ts +1 -1
  226. package/version.js +1 -1
  227. package/version.mjs +1 -1
  228. package/src/internal/shim-types.d.ts +0 -28
@@ -0,0 +1,290 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { LimitOffset, type LimitOffsetParams, PagePromise } from '../../core/pagination';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Connectors extends APIResource {
10
+ /**
11
+ * Create a new connector.
12
+ *
13
+ * Args: data_source_id: The ID of the data source to create a connector for.
14
+ * params: The connector to create.
15
+ *
16
+ * Returns: The created connector.
17
+ */
18
+ create(
19
+ dataSourceID: string,
20
+ body: ConnectorCreateParams,
21
+ options?: RequestOptions,
22
+ ): APIPromise<DataSourceConnector> {
23
+ return this._client.post(path`/v1/data_sources/${dataSourceID}/connectors`, { body, ...options });
24
+ }
25
+
26
+ /**
27
+ * Get a connector by ID.
28
+ *
29
+ * Args: data_source_id: The ID of the data source to get a connector for.
30
+ * connector_id: The ID of the connector to get.
31
+ *
32
+ * Returns: The connector.
33
+ */
34
+ retrieve(
35
+ connectorID: string,
36
+ params: ConnectorRetrieveParams,
37
+ options?: RequestOptions,
38
+ ): APIPromise<DataSourceConnector> {
39
+ const { data_source_id } = params;
40
+ return this._client.get(path`/v1/data_sources/${data_source_id}/connectors/${connectorID}`, options);
41
+ }
42
+
43
+ /**
44
+ * Update a connector.
45
+ *
46
+ * Args: data_source_id: The ID of the data source to update a connector for.
47
+ * connector_id: The ID of the connector to update. params: The connector to
48
+ * update.
49
+ *
50
+ * Returns: The updated connector.
51
+ */
52
+ update(
53
+ connectorID: string,
54
+ params: ConnectorUpdateParams,
55
+ options?: RequestOptions,
56
+ ): APIPromise<DataSourceConnector> {
57
+ const { data_source_id, ...body } = params;
58
+ return this._client.put(path`/v1/data_sources/${data_source_id}/connectors/${connectorID}`, {
59
+ body,
60
+ ...options,
61
+ });
62
+ }
63
+
64
+ /**
65
+ * Get all connectors for a data source.
66
+ *
67
+ * Args: data_source_id: The ID of the data source to get connectors for.
68
+ * pagination: The pagination options.
69
+ *
70
+ * Returns: The list of connectors.
71
+ */
72
+ list(
73
+ dataSourceID: string,
74
+ query: ConnectorListParams | null | undefined = {},
75
+ options?: RequestOptions,
76
+ ): PagePromise<DataSourceConnectorsLimitOffset, DataSourceConnector> {
77
+ return this._client.getAPIList(
78
+ path`/v1/data_sources/${dataSourceID}/connectors`,
79
+ LimitOffset<DataSourceConnector>,
80
+ { query, ...options },
81
+ );
82
+ }
83
+
84
+ /**
85
+ * Delete a connector.
86
+ *
87
+ * Args: data_source_id: The ID of the data source to delete a connector for.
88
+ * connector_id: The ID of the connector to delete.
89
+ *
90
+ * Returns: The deleted connector.
91
+ */
92
+ delete(
93
+ connectorID: string,
94
+ params: ConnectorDeleteParams,
95
+ options?: RequestOptions,
96
+ ): APIPromise<ConnectorDeleteResponse> {
97
+ const { data_source_id } = params;
98
+ return this._client.delete(path`/v1/data_sources/${data_source_id}/connectors/${connectorID}`, options);
99
+ }
100
+ }
101
+
102
+ export type DataSourceConnectorsLimitOffset = LimitOffset<DataSourceConnector>;
103
+
104
+ /**
105
+ * Service-level representation of a connector.
106
+ */
107
+ export interface DataSourceConnector {
108
+ /**
109
+ * The ID of the connector
110
+ */
111
+ id: string;
112
+
113
+ /**
114
+ * The creation time of the connector
115
+ */
116
+ created_at: string;
117
+
118
+ /**
119
+ * The last update time of the connector
120
+ */
121
+ updated_at: string;
122
+
123
+ /**
124
+ * The ID of the vector store
125
+ */
126
+ vector_store_id: string;
127
+
128
+ /**
129
+ * The ID of the data source
130
+ */
131
+ data_source_id: string;
132
+
133
+ /**
134
+ * The name of the connector
135
+ */
136
+ name?: string;
137
+
138
+ /**
139
+ * The metadata of the connector
140
+ */
141
+ metadata: unknown;
142
+
143
+ /**
144
+ * The polling interval of the connector
145
+ */
146
+ polling_interval: string;
147
+
148
+ /**
149
+ * The start time of the connector
150
+ */
151
+ started_at: string | null;
152
+
153
+ /**
154
+ * The finish time of the connector
155
+ */
156
+ finished_at: string | null;
157
+
158
+ /**
159
+ * The last sync time of the connector
160
+ */
161
+ last_synced_at: string | null;
162
+
163
+ /**
164
+ * The sync status of the connector
165
+ */
166
+ status: 'idle' | 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
167
+
168
+ /**
169
+ * The sync error of the connector
170
+ */
171
+ error: string | null;
172
+
173
+ /**
174
+ * The type of the object
175
+ */
176
+ object?: 'data_source.connector';
177
+ }
178
+
179
+ /**
180
+ * Deleted connector.
181
+ */
182
+ export interface ConnectorDeleteResponse {
183
+ /**
184
+ * The ID of the connector
185
+ */
186
+ id: string;
187
+
188
+ /**
189
+ * Whether the connector was deleted
190
+ */
191
+ deleted?: boolean;
192
+
193
+ /**
194
+ * The type of the object
195
+ */
196
+ object?: 'data_source.connector';
197
+ }
198
+
199
+ export interface ConnectorCreateParams {
200
+ /**
201
+ * The ID of the vector store
202
+ */
203
+ vector_store_id: string;
204
+
205
+ /**
206
+ * The name of the connector
207
+ */
208
+ name?: string;
209
+
210
+ /**
211
+ * Whether the connector should be synced after creation
212
+ */
213
+ trigger_sync?: boolean;
214
+
215
+ /**
216
+ * The metadata of the connector
217
+ */
218
+ metadata?: unknown;
219
+
220
+ /**
221
+ * Polling interval for the connector. Defaults to 30 minutes if not specified. Can
222
+ * be provided as:
223
+ *
224
+ * - int: Number of seconds (e.g., 1800 for 30 minutes)
225
+ * - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
226
+ * 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
227
+ */
228
+ polling_interval?: number | string | null;
229
+ }
230
+
231
+ export interface ConnectorRetrieveParams {
232
+ /**
233
+ * The ID of the data source to get a connector for
234
+ */
235
+ data_source_id: string;
236
+ }
237
+
238
+ export interface ConnectorUpdateParams {
239
+ /**
240
+ * Path param: The ID of the data source to update a connector for
241
+ */
242
+ data_source_id: string;
243
+
244
+ /**
245
+ * Body param: The name of the connector
246
+ */
247
+ name?: string | null;
248
+
249
+ /**
250
+ * Body param: The metadata of the connector
251
+ */
252
+ metadata?: Record<string, unknown> | null;
253
+
254
+ /**
255
+ * Body param: Whether the connector should be synced after update
256
+ */
257
+ trigger_sync?: boolean | null;
258
+
259
+ /**
260
+ * Body param: Polling interval for the connector. Defaults to 30 minutes if not
261
+ * specified. Can be provided as:
262
+ *
263
+ * - int: Number of seconds (e.g., 1800 for 30 minutes)
264
+ * - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
265
+ * 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
266
+ */
267
+ polling_interval?: number | string | null;
268
+ }
269
+
270
+ export interface ConnectorListParams extends LimitOffsetParams {}
271
+
272
+ export interface ConnectorDeleteParams {
273
+ /**
274
+ * The ID of the data source to delete a connector for
275
+ */
276
+ data_source_id: string;
277
+ }
278
+
279
+ export declare namespace Connectors {
280
+ export {
281
+ type DataSourceConnector as DataSourceConnector,
282
+ type ConnectorDeleteResponse as ConnectorDeleteResponse,
283
+ type DataSourceConnectorsLimitOffset as DataSourceConnectorsLimitOffset,
284
+ type ConnectorCreateParams as ConnectorCreateParams,
285
+ type ConnectorRetrieveParams as ConnectorRetrieveParams,
286
+ type ConnectorUpdateParams as ConnectorUpdateParams,
287
+ type ConnectorListParams as ConnectorListParams,
288
+ type ConnectorDeleteParams as ConnectorDeleteParams,
289
+ };
290
+ }
@@ -0,0 +1,404 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as ConnectorsAPI from './connectors';
5
+ import {
6
+ ConnectorCreateParams,
7
+ ConnectorDeleteParams,
8
+ ConnectorDeleteResponse,
9
+ ConnectorListParams,
10
+ ConnectorRetrieveParams,
11
+ ConnectorUpdateParams,
12
+ Connectors,
13
+ DataSourceConnector,
14
+ DataSourceConnectorsLimitOffset,
15
+ } from './connectors';
16
+ import { APIPromise } from '../../core/api-promise';
17
+ import { LimitOffset, type LimitOffsetParams, PagePromise } from '../../core/pagination';
18
+ import { RequestOptions } from '../../internal/request-options';
19
+ import { path } from '../../internal/utils/path';
20
+
21
+ export class DataSources extends APIResource {
22
+ connectors: ConnectorsAPI.Connectors = new ConnectorsAPI.Connectors(this._client);
23
+
24
+ /**
25
+ * Create a new data source.
26
+ *
27
+ * Args: params: The data source to create.
28
+ *
29
+ * Returns: The created data source.
30
+ */
31
+ create(body: DataSourceCreateParams, options?: RequestOptions): APIPromise<DataSource> {
32
+ return this._client.post('/v1/data_sources/', { body, ...options });
33
+ }
34
+
35
+ /**
36
+ * Get a data source by ID.
37
+ *
38
+ * Args: data_source_id: The ID of the data source to fetch.
39
+ *
40
+ * Returns: The data source.
41
+ */
42
+ retrieve(dataSourceID: string, options?: RequestOptions): APIPromise<DataSource> {
43
+ return this._client.get(path`/v1/data_sources/${dataSourceID}`, options);
44
+ }
45
+
46
+ /**
47
+ * Update a data source.
48
+ *
49
+ * Args: data_source_id: The ID of the data source to update. params: The data
50
+ * source to update.
51
+ *
52
+ * Returns: The updated data source.
53
+ */
54
+ update(
55
+ dataSourceID: string,
56
+ body: DataSourceUpdateParams,
57
+ options?: RequestOptions,
58
+ ): APIPromise<DataSource> {
59
+ return this._client.put(path`/v1/data_sources/${dataSourceID}`, { body, ...options });
60
+ }
61
+
62
+ /**
63
+ * Get all data sources.
64
+ *
65
+ * Returns: The list of data sources.
66
+ */
67
+ list(
68
+ query: DataSourceListParams | null | undefined = {},
69
+ options?: RequestOptions,
70
+ ): PagePromise<DataSourcesLimitOffset, DataSource> {
71
+ return this._client.getAPIList('/v1/data_sources/', LimitOffset<DataSource>, { query, ...options });
72
+ }
73
+
74
+ /**
75
+ * Delete a data source.
76
+ *
77
+ * Args: data_source_id: The ID of the data source to delete.
78
+ */
79
+ delete(dataSourceID: string, options?: RequestOptions): APIPromise<DataSourceDeleteResponse> {
80
+ return this._client.delete(path`/v1/data_sources/${dataSourceID}`, options);
81
+ }
82
+ }
83
+
84
+ export type DataSourcesLimitOffset = LimitOffset<DataSource>;
85
+
86
+ /**
87
+ * Service-level representation of a data source.
88
+ */
89
+ export interface DataSource {
90
+ /**
91
+ * The ID of the data source
92
+ */
93
+ id: string;
94
+
95
+ /**
96
+ * The creation time of the data source
97
+ */
98
+ created_at: string;
99
+
100
+ /**
101
+ * The last update time of the data source
102
+ */
103
+ updated_at: string;
104
+
105
+ /**
106
+ * The type of data source
107
+ */
108
+ type: DataSourceType;
109
+
110
+ /**
111
+ * The name of the data source
112
+ */
113
+ name: string;
114
+
115
+ /**
116
+ * The metadata of the data source
117
+ */
118
+ metadata: unknown;
119
+
120
+ /**
121
+ * Authentication parameters
122
+ */
123
+ auth_params: DataSourceOauth2Params | DataSource.DataSourceAPIKeyParams | null;
124
+
125
+ /**
126
+ * The type of the object
127
+ */
128
+ object?: 'data_source';
129
+ }
130
+
131
+ export namespace DataSource {
132
+ /**
133
+ * Authentication parameters for a API key data source.
134
+ */
135
+ export interface DataSourceAPIKeyParams {
136
+ type?: 'api_key';
137
+
138
+ /**
139
+ * The API key
140
+ */
141
+ api_key: string;
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Authentication parameters for a OAuth data source.
147
+ */
148
+ export interface DataSourceOauth2Params {
149
+ type?: 'oauth2';
150
+
151
+ /**
152
+ * The timestamp when the OAuth2 credentials were created
153
+ */
154
+ created_at?: string;
155
+
156
+ /**
157
+ * The OAuth2 scope
158
+ */
159
+ scope?: string;
160
+
161
+ /**
162
+ * The OAuth2 access token
163
+ */
164
+ access_token?: string | null;
165
+
166
+ /**
167
+ * The OAuth2 refresh token
168
+ */
169
+ refresh_token?: string | null;
170
+
171
+ /**
172
+ * The OAuth2 token type
173
+ */
174
+ token_type?: string | null;
175
+
176
+ /**
177
+ * The OAuth2 token expiration timestamp
178
+ */
179
+ expires_on?: string | null;
180
+
181
+ /**
182
+ * Additional parameters for the OAuth2 flow
183
+ */
184
+ additional_params?: Record<string, unknown> | null;
185
+ }
186
+
187
+ export type DataSourceType = 'notion' | 'linear';
188
+
189
+ /**
190
+ * Deleted data source.
191
+ */
192
+ export interface DataSourceDeleteResponse {
193
+ /**
194
+ * The ID of the data source
195
+ */
196
+ id: string;
197
+
198
+ /**
199
+ * Whether the data source was deleted
200
+ */
201
+ deleted?: boolean;
202
+
203
+ /**
204
+ * The type of the object
205
+ */
206
+ object?: 'data_source';
207
+ }
208
+
209
+ export type DataSourceCreateParams =
210
+ | DataSourceCreateParams.NotionDataSourceCreateOrUpdateParams
211
+ | DataSourceCreateParams.LinearDataSourceCreateOrUpdateParams;
212
+
213
+ export declare namespace DataSourceCreateParams {
214
+ export interface NotionDataSourceCreateOrUpdateParams {
215
+ /**
216
+ * The type of data source to create
217
+ */
218
+ type?: DataSourceType;
219
+
220
+ /**
221
+ * The name of the data source
222
+ */
223
+ name: string;
224
+
225
+ /**
226
+ * The metadata of the data source
227
+ */
228
+ metadata?: unknown;
229
+
230
+ /**
231
+ * The authentication parameters of the data source. Notion supports OAuth2 and API
232
+ * key.
233
+ */
234
+ auth_params?:
235
+ | NotionDataSourceCreateOrUpdateParams.OAuth2CreateOrUpdateParams
236
+ | NotionDataSourceCreateOrUpdateParams.APIKeyCreateOrUpdateParams
237
+ | null;
238
+ }
239
+
240
+ export namespace NotionDataSourceCreateOrUpdateParams {
241
+ /**
242
+ * Base class for OAuth2 create or update parameters.
243
+ */
244
+ export interface OAuth2CreateOrUpdateParams {
245
+ type?: 'oauth2';
246
+ }
247
+
248
+ /**
249
+ * Base class for API key create or update parameters.
250
+ */
251
+ export interface APIKeyCreateOrUpdateParams {
252
+ type?: 'api_key';
253
+
254
+ /**
255
+ * The API key
256
+ */
257
+ api_key: string;
258
+ }
259
+ }
260
+
261
+ export interface LinearDataSourceCreateOrUpdateParams {
262
+ /**
263
+ * The type of data source to create
264
+ */
265
+ type?: DataSourceType;
266
+
267
+ /**
268
+ * The name of the data source
269
+ */
270
+ name: string;
271
+
272
+ /**
273
+ * The metadata of the data source
274
+ */
275
+ metadata?: unknown;
276
+
277
+ /**
278
+ * Base class for OAuth2 create or update parameters.
279
+ */
280
+ auth_params?: LinearDataSourceCreateOrUpdateParams.AuthParams | null;
281
+ }
282
+
283
+ export namespace LinearDataSourceCreateOrUpdateParams {
284
+ /**
285
+ * Base class for OAuth2 create or update parameters.
286
+ */
287
+ export interface AuthParams {
288
+ type?: 'oauth2';
289
+ }
290
+ }
291
+ }
292
+
293
+ export type DataSourceUpdateParams =
294
+ | DataSourceUpdateParams.NotionDataSourceCreateOrUpdateParams
295
+ | DataSourceUpdateParams.LinearDataSourceCreateOrUpdateParams;
296
+
297
+ export declare namespace DataSourceUpdateParams {
298
+ export interface NotionDataSourceCreateOrUpdateParams {
299
+ /**
300
+ * The type of data source to create
301
+ */
302
+ type?: DataSourceType;
303
+
304
+ /**
305
+ * The name of the data source
306
+ */
307
+ name: string;
308
+
309
+ /**
310
+ * The metadata of the data source
311
+ */
312
+ metadata?: unknown;
313
+
314
+ /**
315
+ * The authentication parameters of the data source. Notion supports OAuth2 and API
316
+ * key.
317
+ */
318
+ auth_params?:
319
+ | NotionDataSourceCreateOrUpdateParams.OAuth2CreateOrUpdateParams
320
+ | NotionDataSourceCreateOrUpdateParams.APIKeyCreateOrUpdateParams
321
+ | null;
322
+ }
323
+
324
+ export namespace NotionDataSourceCreateOrUpdateParams {
325
+ /**
326
+ * Base class for OAuth2 create or update parameters.
327
+ */
328
+ export interface OAuth2CreateOrUpdateParams {
329
+ type?: 'oauth2';
330
+ }
331
+
332
+ /**
333
+ * Base class for API key create or update parameters.
334
+ */
335
+ export interface APIKeyCreateOrUpdateParams {
336
+ type?: 'api_key';
337
+
338
+ /**
339
+ * The API key
340
+ */
341
+ api_key: string;
342
+ }
343
+ }
344
+
345
+ export interface LinearDataSourceCreateOrUpdateParams {
346
+ /**
347
+ * The type of data source to create
348
+ */
349
+ type?: DataSourceType;
350
+
351
+ /**
352
+ * The name of the data source
353
+ */
354
+ name: string;
355
+
356
+ /**
357
+ * The metadata of the data source
358
+ */
359
+ metadata?: unknown;
360
+
361
+ /**
362
+ * Base class for OAuth2 create or update parameters.
363
+ */
364
+ auth_params?: LinearDataSourceCreateOrUpdateParams.AuthParams | null;
365
+ }
366
+
367
+ export namespace LinearDataSourceCreateOrUpdateParams {
368
+ /**
369
+ * Base class for OAuth2 create or update parameters.
370
+ */
371
+ export interface AuthParams {
372
+ type?: 'oauth2';
373
+ }
374
+ }
375
+ }
376
+
377
+ export interface DataSourceListParams extends LimitOffsetParams {}
378
+
379
+ DataSources.Connectors = Connectors;
380
+
381
+ export declare namespace DataSources {
382
+ export {
383
+ type DataSource as DataSource,
384
+ type DataSourceOauth2Params as DataSourceOauth2Params,
385
+ type DataSourceType as DataSourceType,
386
+ type DataSourceDeleteResponse as DataSourceDeleteResponse,
387
+ type DataSourcesLimitOffset as DataSourcesLimitOffset,
388
+ type DataSourceCreateParams as DataSourceCreateParams,
389
+ type DataSourceUpdateParams as DataSourceUpdateParams,
390
+ type DataSourceListParams as DataSourceListParams,
391
+ };
392
+
393
+ export {
394
+ Connectors as Connectors,
395
+ type DataSourceConnector as DataSourceConnector,
396
+ type ConnectorDeleteResponse as ConnectorDeleteResponse,
397
+ type DataSourceConnectorsLimitOffset as DataSourceConnectorsLimitOffset,
398
+ type ConnectorCreateParams as ConnectorCreateParams,
399
+ type ConnectorRetrieveParams as ConnectorRetrieveParams,
400
+ type ConnectorUpdateParams as ConnectorUpdateParams,
401
+ type ConnectorListParams as ConnectorListParams,
402
+ type ConnectorDeleteParams as ConnectorDeleteParams,
403
+ };
404
+ }
@@ -0,0 +1,24 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Connectors,
5
+ type DataSourceConnector,
6
+ type ConnectorDeleteResponse,
7
+ type ConnectorCreateParams,
8
+ type ConnectorRetrieveParams,
9
+ type ConnectorUpdateParams,
10
+ type ConnectorListParams,
11
+ type ConnectorDeleteParams,
12
+ type DataSourceConnectorsLimitOffset,
13
+ } from './connectors';
14
+ export {
15
+ DataSources,
16
+ type DataSource,
17
+ type DataSourceOauth2Params,
18
+ type DataSourceType,
19
+ type DataSourceDeleteResponse,
20
+ type DataSourceCreateParams,
21
+ type DataSourceUpdateParams,
22
+ type DataSourceListParams,
23
+ type DataSourcesLimitOffset,
24
+ } from './data-sources';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './data-sources/index';