@mixedbread/sdk 0.6.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 (135) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +12 -24
  3. package/bin/migration-config.json +2 -2
  4. package/client.d.mts +0 -3
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +0 -3
  7. package/client.d.ts.map +1 -1
  8. package/client.js +0 -3
  9. package/client.js.map +1 -1
  10. package/client.mjs +0 -3
  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 +4 -4
  29. package/internal/headers.js.map +1 -1
  30. package/internal/headers.mjs +4 -4
  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 -4
  66. package/resources/data-sources/connectors.d.mts +14 -4
  67. package/resources/data-sources/connectors.d.mts.map +1 -1
  68. package/resources/data-sources/connectors.d.ts +14 -4
  69. package/resources/data-sources/connectors.d.ts.map +1 -1
  70. package/resources/data-sources/data-sources.d.mts +149 -45
  71. package/resources/data-sources/data-sources.d.mts.map +1 -1
  72. package/resources/data-sources/data-sources.d.ts +149 -45
  73. package/resources/data-sources/data-sources.d.ts.map +1 -1
  74. package/resources/data-sources/data-sources.js.map +1 -1
  75. package/resources/data-sources/data-sources.mjs.map +1 -1
  76. package/resources/extractions/content.d.mts +4 -0
  77. package/resources/extractions/content.d.mts.map +1 -1
  78. package/resources/extractions/content.d.ts +4 -0
  79. package/resources/extractions/content.d.ts.map +1 -1
  80. package/resources/index.d.mts +0 -1
  81. package/resources/index.d.mts.map +1 -1
  82. package/resources/index.d.ts +0 -1
  83. package/resources/index.d.ts.map +1 -1
  84. package/resources/index.js +1 -3
  85. package/resources/index.js.map +1 -1
  86. package/resources/index.mjs +0 -1
  87. package/resources/index.mjs.map +1 -1
  88. package/resources/vector-stores/files.d.mts +50 -17
  89. package/resources/vector-stores/files.d.mts.map +1 -1
  90. package/resources/vector-stores/files.d.ts +50 -17
  91. package/resources/vector-stores/files.d.ts.map +1 -1
  92. package/resources/vector-stores/files.js +19 -18
  93. package/resources/vector-stores/files.js.map +1 -1
  94. package/resources/vector-stores/files.mjs +19 -18
  95. package/resources/vector-stores/files.mjs.map +1 -1
  96. package/resources/vector-stores/vector-stores.d.mts +71 -16
  97. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  98. package/resources/vector-stores/vector-stores.d.ts +71 -16
  99. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  100. package/resources/vector-stores/vector-stores.js +18 -15
  101. package/resources/vector-stores/vector-stores.js.map +1 -1
  102. package/resources/vector-stores/vector-stores.mjs +18 -15
  103. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  104. package/src/client.ts +0 -5
  105. package/src/core/pagination.ts +1 -1
  106. package/src/core/resource.ts +1 -1
  107. package/src/internal/detect-platform.ts +3 -3
  108. package/src/internal/headers.ts +5 -5
  109. package/src/internal/shim-types.ts +26 -0
  110. package/src/internal/shims.ts +2 -2
  111. package/src/internal/uploads.ts +2 -2
  112. package/src/internal/utils/log.ts +1 -1
  113. package/src/internal/utils/path.ts +1 -1
  114. package/src/internal/utils/values.ts +3 -0
  115. package/src/resources/data-sources/connectors.ts +14 -4
  116. package/src/resources/data-sources/data-sources.ts +181 -48
  117. package/src/resources/extractions/content.ts +5 -0
  118. package/src/resources/index.ts +0 -1
  119. package/src/resources/vector-stores/files.ts +65 -26
  120. package/src/resources/vector-stores/vector-stores.ts +86 -20
  121. package/src/version.ts +1 -1
  122. package/version.d.mts +1 -1
  123. package/version.d.ts +1 -1
  124. package/version.js +1 -1
  125. package/version.mjs +1 -1
  126. package/resources/chat.d.mts +0 -27
  127. package/resources/chat.d.mts.map +0 -1
  128. package/resources/chat.d.ts +0 -27
  129. package/resources/chat.d.ts.map +0 -1
  130. package/resources/chat.js +0 -28
  131. package/resources/chat.js.map +0 -1
  132. package/resources/chat.mjs +0 -24
  133. package/resources/chat.mjs.map +0 -1
  134. package/src/internal/shim-types.d.ts +0 -28
  135. package/src/resources/chat.ts +0 -33
package/src/client.ts CHANGED
@@ -41,7 +41,6 @@ import {
41
41
  APIKeys,
42
42
  APIKeysLimitOffset,
43
43
  } from './resources/api-keys';
44
- import { Chat, ChatCreateCompletionResponse } from './resources/chat';
45
44
  import { EmbeddingCreateParams, Embeddings, EncodingFormat, ObjectType } from './resources/embeddings';
46
45
  import {
47
46
  FileCreateParams,
@@ -838,7 +837,6 @@ export class Mixedbread {
838
837
  files: API.Files = new API.Files(this);
839
838
  extractions: API.Extractions = new API.Extractions(this);
840
839
  embeddings: API.Embeddings = new API.Embeddings(this);
841
- chat: API.Chat = new API.Chat(this);
842
840
  dataSources: API.DataSources = new API.DataSources(this);
843
841
  apiKeys: API.APIKeys = new API.APIKeys(this);
844
842
  }
@@ -847,7 +845,6 @@ Mixedbread.Parsing = Parsing;
847
845
  Mixedbread.Files = Files;
848
846
  Mixedbread.Extractions = Extractions;
849
847
  Mixedbread.Embeddings = Embeddings;
850
- Mixedbread.Chat = Chat;
851
848
  Mixedbread.DataSources = DataSources;
852
849
  Mixedbread.APIKeys = APIKeys;
853
850
  export declare namespace Mixedbread {
@@ -908,8 +905,6 @@ export declare namespace Mixedbread {
908
905
  type EmbeddingCreateParams as EmbeddingCreateParams,
909
906
  };
910
907
 
911
- export { Chat as Chat, type ChatCreateCompletionResponse as ChatCreateCompletionResponse };
912
-
913
908
  export {
914
909
  DataSources as DataSources,
915
910
  type DataSource as DataSource,
@@ -99,7 +99,7 @@ export class PagePromise<
99
99
  * console.log(item)
100
100
  * }
101
101
  */
102
- async *[Symbol.asyncIterator]() {
102
+ async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
103
103
  const page = await this;
104
104
  for await (const item of page) {
105
105
  yield item;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import type { Mixedbread } from '../client';
4
4
 
5
- export class APIResource {
5
+ export abstract class APIResource {
6
6
  protected _client: Mixedbread;
7
7
 
8
8
  constructor(client: Mixedbread) {
@@ -85,10 +85,10 @@ const getPlatformProperties = (): PlatformProperties => {
85
85
  return {
86
86
  'X-Stainless-Lang': 'js',
87
87
  'X-Stainless-Package-Version': VERSION,
88
- 'X-Stainless-OS': normalizePlatform((globalThis as any).process.platform),
89
- 'X-Stainless-Arch': normalizeArch((globalThis as any).process.arch),
88
+ 'X-Stainless-OS': normalizePlatform((globalThis as any).process.platform ?? 'unknown'),
89
+ 'X-Stainless-Arch': normalizeArch((globalThis as any).process.arch ?? 'unknown'),
90
90
  'X-Stainless-Runtime': 'node',
91
- 'X-Stainless-Runtime-Version': (globalThis as any).process.version,
91
+ 'X-Stainless-Runtime-Version': (globalThis as any).process.version ?? 'unknown',
92
92
  };
93
93
  }
94
94
 
@@ -1,5 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ import { isReadonlyArray } from './utils/values';
4
+
3
5
  type HeaderValue = string | undefined | null;
4
6
  export type HeadersLike =
5
7
  | Headers
@@ -9,7 +11,7 @@ export type HeadersLike =
9
11
  | null
10
12
  | NullableHeaders;
11
13
 
12
- const brand_privateNullableHeaders = Symbol('brand.privateNullableHeaders');
14
+ const brand_privateNullableHeaders = /* @__PURE__ */ Symbol('brand.privateNullableHeaders');
13
15
 
14
16
  /**
15
17
  * @internal
@@ -25,8 +27,6 @@ export type NullableHeaders = {
25
27
  nulls: Set<string>;
26
28
  };
27
29
 
28
- const isArray = Array.isArray as (val: unknown) => val is readonly unknown[];
29
-
30
30
  function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [string, string | null]> {
31
31
  if (!headers) return;
32
32
 
@@ -43,7 +43,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
43
43
  let iter: Iterable<readonly (HeaderValue | readonly HeaderValue[])[]>;
44
44
  if (headers instanceof Headers) {
45
45
  iter = headers.entries();
46
- } else if (isArray(headers)) {
46
+ } else if (isReadonlyArray(headers)) {
47
47
  iter = headers;
48
48
  } else {
49
49
  shouldClear = true;
@@ -52,7 +52,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
52
52
  for (let row of iter) {
53
53
  const name = row[0];
54
54
  if (typeof name !== 'string') throw new TypeError('expected header name to be a string');
55
- const values = isArray(row[1]) ? row[1] : [row[1]];
55
+ const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];
56
56
  let didClear = false;
57
57
  for (const value of values) {
58
58
  if (value === undefined) continue;
@@ -0,0 +1,26 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ /**
4
+ * Shims for types that we can't always rely on being available globally.
5
+ *
6
+ * Note: these only exist at the type-level, there is no corresponding runtime
7
+ * version for any of these symbols.
8
+ */
9
+
10
+ type NeverToAny<T> = T extends never ? any : T;
11
+
12
+ /** @ts-ignore */
13
+ type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
14
+
15
+ /** @ts-ignore */
16
+ type _NodeReadableStream<R = any> = import('stream/web').ReadableStream<R>;
17
+
18
+ type _ConditionalNodeReadableStream<R = any> =
19
+ typeof globalThis extends { ReadableStream: any } ? never : _NodeReadableStream<R>;
20
+
21
+ type _ReadableStream<R = any> = NeverToAny<
22
+ | ([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>)
23
+ | ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)
24
+ >;
25
+
26
+ export type { _ReadableStream as ReadableStream };
@@ -7,8 +7,8 @@
7
7
  * messages in cases where an environment isn't fully supported.
8
8
  */
9
9
 
10
- import { type Fetch } from './builtin-types';
11
- import { type ReadableStream } from './shim-types';
10
+ import type { Fetch } from './builtin-types';
11
+ import type { ReadableStream } from './shim-types';
12
12
 
13
13
  export function getDefaultFetch(): Fetch {
14
14
  if (typeof fetch !== 'undefined') {
@@ -90,7 +90,7 @@ export const multipartFormRequestOptions = async (
90
90
  return { ...opts, body: await createForm(opts.body, fetch) };
91
91
  };
92
92
 
93
- const supportsFormDataMap = new WeakMap<Fetch, Promise<boolean>>();
93
+ const supportsFormDataMap = /** @__PURE__ */ new WeakMap<Fetch, Promise<boolean>>();
94
94
 
95
95
  /**
96
96
  * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
@@ -138,7 +138,7 @@ export const createForm = async <T = Record<string, unknown>>(
138
138
 
139
139
  // We check for Blob not File because Bun.File doesn't inherit from File,
140
140
  // but they both inherit from Blob and have a `name` property at runtime.
141
- const isNamedBlob = (value: object) => value instanceof Blob && 'name' in value;
141
+ const isNamedBlob = (value: unknown) => value instanceof Blob && 'name' in value;
142
142
 
143
143
  const isUploadable = (value: unknown) =>
144
144
  typeof value === 'object' &&
@@ -58,7 +58,7 @@ const noopLogger = {
58
58
  debug: noop,
59
59
  };
60
60
 
61
- let cachedLoggers = new WeakMap<Logger, [LogLevel, Logger]>();
61
+ let cachedLoggers = /** @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
62
62
 
63
63
  export function loggerFor(client: Mixedbread): Logger {
64
64
  const logger = client.logger;
@@ -62,4 +62,4 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
62
62
  /**
63
63
  * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
64
64
  */
65
- export const path = createPathTagFunction(encodeURIPath);
65
+ export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
@@ -9,6 +9,9 @@ export const isAbsoluteURL = (url: string): boolean => {
9
9
  return startsWithSchemeRegexp.test(url);
10
10
  };
11
11
 
12
+ export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
13
+ export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
14
+
12
15
  /** Returns an object if the given value isn't an object, otherwise returns as-is */
13
16
  export function maybeObj(x: unknown): object {
14
17
  if (typeof x !== 'object') {
@@ -218,9 +218,14 @@ export interface ConnectorCreateParams {
218
218
  metadata?: unknown;
219
219
 
220
220
  /**
221
- * The polling interval of the connector
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
222
227
  */
223
- polling_interval?: string | null;
228
+ polling_interval?: number | string | null;
224
229
  }
225
230
 
226
231
  export interface ConnectorRetrieveParams {
@@ -252,9 +257,14 @@ export interface ConnectorUpdateParams {
252
257
  trigger_sync?: boolean | null;
253
258
 
254
259
  /**
255
- * Body param: The polling interval of the connector
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
256
266
  */
257
- polling_interval?: string | null;
267
+ polling_interval?: number | string | null;
258
268
  }
259
269
 
260
270
  export interface ConnectorListParams extends LimitOffsetParams {}
@@ -118,9 +118,9 @@ export interface DataSource {
118
118
  metadata: unknown;
119
119
 
120
120
  /**
121
- * Authentication parameters for a OAuth data source.
121
+ * Authentication parameters
122
122
  */
123
- auth_params: DataSourceOauth2Params | null;
123
+ auth_params: DataSourceOauth2Params | DataSource.DataSourceAPIKeyParams | null;
124
124
 
125
125
  /**
126
126
  * The type of the object
@@ -128,6 +128,20 @@ export interface DataSource {
128
128
  object?: 'data_source';
129
129
  }
130
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
+
131
145
  /**
132
146
  * Authentication parameters for a OAuth data source.
133
147
  */
@@ -139,25 +153,10 @@ export interface DataSourceOauth2Params {
139
153
  */
140
154
  created_at?: string;
141
155
 
142
- /**
143
- * The OAuth2 client ID
144
- */
145
- client_id: string;
146
-
147
- /**
148
- * The OAuth2 client secret
149
- */
150
- client_secret: string;
151
-
152
- /**
153
- * The OAuth2 redirect URI
154
- */
155
- redirect_uri: string;
156
-
157
156
  /**
158
157
  * The OAuth2 scope
159
158
  */
160
- scope: string;
159
+ scope?: string;
161
160
 
162
161
  /**
163
162
  * The OAuth2 access token
@@ -178,6 +177,11 @@ export interface DataSourceOauth2Params {
178
177
  * The OAuth2 token expiration timestamp
179
178
  */
180
179
  expires_on?: string | null;
180
+
181
+ /**
182
+ * Additional parameters for the OAuth2 flow
183
+ */
184
+ additional_params?: Record<string, unknown> | null;
181
185
  }
182
186
 
183
187
  export type DataSourceType = 'notion' | 'linear';
@@ -202,43 +206,172 @@ export interface DataSourceDeleteResponse {
202
206
  object?: 'data_source';
203
207
  }
204
208
 
205
- export interface DataSourceCreateParams {
206
- /**
207
- * The type of data source to create
208
- */
209
- type: DataSourceType;
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
+ }
210
239
 
211
- /**
212
- * The name of the data source
213
- */
214
- name: string;
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
+ }
215
260
 
216
- /**
217
- * The metadata of the data source
218
- */
219
- metadata?: unknown;
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
+ }
220
282
 
221
- /**
222
- * Authentication parameters for a OAuth data source.
223
- */
224
- auth_params?: DataSourceOauth2Params | null;
283
+ export namespace LinearDataSourceCreateOrUpdateParams {
284
+ /**
285
+ * Base class for OAuth2 create or update parameters.
286
+ */
287
+ export interface AuthParams {
288
+ type?: 'oauth2';
289
+ }
290
+ }
225
291
  }
226
292
 
227
- export interface DataSourceUpdateParams {
228
- /**
229
- * The name of the data source
230
- */
231
- name?: string | null;
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
+ }
232
323
 
233
- /**
234
- * The metadata of the data source
235
- */
236
- metadata?: unknown;
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
+ }
237
344
 
238
- /**
239
- * Authentication parameters for a OAuth data source.
240
- */
241
- auth_params?: DataSourceOauth2Params | null;
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
+ }
242
375
  }
243
376
 
244
377
  export interface DataSourceListParams extends LimitOffsetParams {}
@@ -50,6 +50,11 @@ export namespace ImageURLInput {
50
50
  * The image URL. Can be either a URL or a Data URI.
51
51
  */
52
52
  url: string;
53
+
54
+ /**
55
+ * The image format/mimetype
56
+ */
57
+ format?: string;
53
58
  }
54
59
  }
55
60
 
@@ -10,7 +10,6 @@ export {
10
10
  type APIKeyListParams,
11
11
  type APIKeysLimitOffset,
12
12
  } from './api-keys';
13
- export { Chat, type ChatCreateCompletionResponse } from './chat';
14
13
  export {
15
14
  DataSources,
16
15
  type DataSource,