@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.
- package/CHANGELOG.md +50 -0
- package/README.md +12 -24
- package/bin/migration-config.json +2 -2
- package/client.d.mts +0 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +0 -3
- package/client.d.ts.map +1 -1
- package/client.js +0 -3
- package/client.js.map +1 -1
- package/client.mjs +0 -3
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/resource.d.mts +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/internal/detect-platform.js +3 -3
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +3 -3
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +4 -4
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +4 -4
- package/internal/headers.mjs.map +1 -1
- package/internal/shim-types.d.mts +11 -22
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +11 -22
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +2 -2
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +2 -2
- package/internal/shims.d.ts.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.js +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.d.mts +2 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +2 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +4 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +2 -0
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +1 -4
- package/resources/data-sources/connectors.d.mts +14 -4
- package/resources/data-sources/connectors.d.mts.map +1 -1
- package/resources/data-sources/connectors.d.ts +14 -4
- package/resources/data-sources/connectors.d.ts.map +1 -1
- package/resources/data-sources/data-sources.d.mts +149 -45
- package/resources/data-sources/data-sources.d.mts.map +1 -1
- package/resources/data-sources/data-sources.d.ts +149 -45
- package/resources/data-sources/data-sources.d.ts.map +1 -1
- package/resources/data-sources/data-sources.js.map +1 -1
- package/resources/data-sources/data-sources.mjs.map +1 -1
- package/resources/extractions/content.d.mts +4 -0
- package/resources/extractions/content.d.mts.map +1 -1
- package/resources/extractions/content.d.ts +4 -0
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/index.d.mts +0 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +0 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -1
- package/resources/index.mjs.map +1 -1
- package/resources/vector-stores/files.d.mts +50 -17
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +50 -17
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +19 -18
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +19 -18
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +71 -16
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +71 -16
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +18 -15
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +18 -15
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/client.ts +0 -5
- package/src/core/pagination.ts +1 -1
- package/src/core/resource.ts +1 -1
- package/src/internal/detect-platform.ts +3 -3
- package/src/internal/headers.ts +5 -5
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +2 -2
- package/src/internal/uploads.ts +2 -2
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +1 -1
- package/src/internal/utils/values.ts +3 -0
- package/src/resources/data-sources/connectors.ts +14 -4
- package/src/resources/data-sources/data-sources.ts +181 -48
- package/src/resources/extractions/content.ts +5 -0
- package/src/resources/index.ts +0 -1
- package/src/resources/vector-stores/files.ts +65 -26
- package/src/resources/vector-stores/vector-stores.ts +86 -20
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/chat.d.mts +0 -27
- package/resources/chat.d.mts.map +0 -1
- package/resources/chat.d.ts +0 -27
- package/resources/chat.d.ts.map +0 -1
- package/resources/chat.js +0 -28
- package/resources/chat.js.map +0 -1
- package/resources/chat.mjs +0 -24
- package/resources/chat.mjs.map +0 -1
- package/src/internal/shim-types.d.ts +0 -28
- 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,
|
package/src/core/pagination.ts
CHANGED
package/src/core/resource.ts
CHANGED
@@ -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
|
|
package/src/internal/headers.ts
CHANGED
@@ -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 (
|
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 =
|
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 };
|
package/src/internal/shims.ts
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
* messages in cases where an environment isn't fully supported.
|
8
8
|
*/
|
9
9
|
|
10
|
-
import {
|
11
|
-
import {
|
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') {
|
package/src/internal/uploads.ts
CHANGED
@@ -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:
|
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
|
-
*
|
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:
|
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
|
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
|
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
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
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
|
-
|
213
|
-
|
214
|
-
|
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
|
-
|
218
|
-
|
219
|
-
|
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
|
-
|
223
|
-
|
224
|
-
|
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
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
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
|
-
|
235
|
-
|
236
|
-
|
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
|
-
|
240
|
-
|
241
|
-
|
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 {}
|