@mixedbread/sdk 0.4.0 → 0.6.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.
- package/CHANGELOG.md +69 -0
- package/README.md +2 -2
- package/api-promise.js +2 -15
- package/api-promise.js.map +1 -1
- package/bin/cli +52 -0
- package/bin/migration-config.json +176 -0
- package/client.d.mts +20 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -8
- package/client.d.ts.map +1 -1
- package/client.js +45 -50
- package/client.js.map +1 -1
- package/client.mjs +37 -19
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +0 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +0 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js +4 -14
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +1 -11
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +0 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +0 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts +0 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +0 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +3 -13
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +1 -11
- package/core/pagination.mjs.map +1 -1
- package/error.js +2 -15
- package/error.js.map +1 -1
- package/internal/builtin-types.d.mts +0 -2
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts +0 -2
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js +2 -2
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.d.mts +1 -2
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts +1 -2
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +3 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +3 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts +0 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +0 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +1 -2
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +0 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +0 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.js +5 -6
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/to-file.d.mts +0 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts +0 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.js +4 -4
- package/internal/to-file.js.map +1 -1
- package/internal/to-file.mjs +3 -2
- package/internal/to-file.mjs.map +1 -1
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +0 -1
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +0 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts +1 -3
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +1 -3
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +16 -6
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +12 -3
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js +12 -7
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +12 -7
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts +0 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +0 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -2
- package/internal/utils/log.js.map +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 +2 -2
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/sleep.d.mts.map +1 -1
- package/internal/utils/sleep.d.ts.map +1 -1
- package/internal/utils/uuid.d.mts +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +1 -2
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +1 -2
- package/internal/utils/uuid.mjs.map +1 -1
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.js +7 -20
- package/internal/utils.js.map +1 -1
- package/lib/polling.js +1 -2
- package/lib/polling.js.map +1 -1
- package/lib/polling.mjs.map +1 -1
- package/package.json +5 -6
- package/pagination.js +2 -15
- package/pagination.js.map +1 -1
- package/resource.js +2 -15
- package/resource.js.map +1 -1
- package/resources/api-keys.d.mts +171 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +171 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +76 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +72 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/chat.d.mts +27 -0
- package/resources/chat.d.mts.map +1 -0
- package/resources/chat.d.ts +27 -0
- package/resources/chat.d.ts.map +1 -0
- package/resources/chat.js +28 -0
- package/resources/chat.js.map +1 -0
- package/resources/chat.mjs +24 -0
- package/resources/chat.mjs.map +1 -0
- package/resources/data-sources/connectors.d.mts +193 -0
- package/resources/data-sources/connectors.d.mts.map +1 -0
- package/resources/data-sources/connectors.d.ts +193 -0
- package/resources/data-sources/connectors.d.ts.map +1 -0
- package/resources/data-sources/connectors.js +73 -0
- package/resources/data-sources/connectors.js.map +1 -0
- package/resources/data-sources/connectors.mjs +69 -0
- package/resources/data-sources/connectors.mjs.map +1 -0
- package/resources/data-sources/data-sources.d.mts +183 -0
- package/resources/data-sources/data-sources.d.mts.map +1 -0
- package/resources/data-sources/data-sources.d.ts +183 -0
- package/resources/data-sources/data-sources.d.ts.map +1 -0
- package/resources/data-sources/data-sources.js +66 -0
- package/resources/data-sources/data-sources.js.map +1 -0
- package/resources/data-sources/data-sources.mjs +61 -0
- package/resources/data-sources/data-sources.mjs.map +1 -0
- package/resources/data-sources/index.d.mts +3 -0
- package/resources/data-sources/index.d.mts.map +1 -0
- package/resources/data-sources/index.d.ts +3 -0
- package/resources/data-sources/index.d.ts.map +1 -0
- package/resources/data-sources/index.js +9 -0
- package/resources/data-sources/index.js.map +1 -0
- package/resources/data-sources/index.mjs +4 -0
- package/resources/data-sources/index.mjs.map +1 -0
- package/resources/data-sources.d.mts +2 -0
- package/resources/data-sources.d.mts.map +1 -0
- package/resources/data-sources.d.ts +2 -0
- package/resources/data-sources.d.ts.map +1 -0
- package/resources/data-sources.js +6 -0
- package/resources/data-sources.js.map +1 -0
- package/resources/data-sources.mjs +3 -0
- package/resources/data-sources.mjs.map +1 -0
- package/resources/embeddings.d.mts +7 -2
- package/resources/embeddings.d.mts.map +1 -1
- package/resources/embeddings.d.ts +7 -2
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/extractions/content.d.mts +46 -2
- package/resources/extractions/content.d.mts.map +1 -1
- package/resources/extractions/content.d.ts +46 -2
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/extractions/extractions.d.mts +2 -2
- package/resources/extractions/extractions.d.mts.map +1 -1
- package/resources/extractions/extractions.d.ts +2 -2
- package/resources/extractions/extractions.d.ts.map +1 -1
- package/resources/extractions/extractions.js +4 -26
- package/resources/extractions/extractions.js.map +1 -1
- package/resources/extractions/extractions.mjs.map +1 -1
- package/resources/extractions/index.d.mts +1 -1
- package/resources/extractions/index.d.mts.map +1 -1
- package/resources/extractions/index.d.ts +1 -1
- package/resources/extractions/index.d.ts.map +1 -1
- package/resources/extractions/index.js.map +1 -1
- package/resources/extractions/index.mjs +1 -1
- package/resources/extractions/index.mjs.map +1 -1
- package/resources/extractions/jobs.d.mts +2 -1
- package/resources/extractions/jobs.d.mts.map +1 -1
- package/resources/extractions/jobs.d.ts +2 -1
- package/resources/extractions/jobs.d.ts.map +1 -1
- package/resources/extractions/jobs.js.map +1 -1
- package/resources/extractions/jobs.mjs.map +1 -1
- package/resources/extractions.js +2 -15
- package/resources/extractions.js.map +1 -1
- package/resources/files.d.mts +18 -2
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +18 -2
- package/resources/files.d.ts.map +1 -1
- package/resources/index.d.mts +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -16
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/parsing/index.d.mts +1 -1
- package/resources/parsing/index.d.mts.map +1 -1
- package/resources/parsing/index.d.ts +1 -1
- package/resources/parsing/index.d.ts.map +1 -1
- package/resources/parsing/index.js.map +1 -1
- package/resources/parsing/index.mjs.map +1 -1
- package/resources/parsing/jobs.d.mts +29 -11
- package/resources/parsing/jobs.d.mts.map +1 -1
- package/resources/parsing/jobs.d.ts +29 -11
- package/resources/parsing/jobs.d.ts.map +1 -1
- package/resources/parsing/jobs.js +2 -24
- package/resources/parsing/jobs.js.map +1 -1
- package/resources/parsing/jobs.mjs.map +1 -1
- package/resources/parsing/parsing.d.mts +2 -2
- package/resources/parsing/parsing.d.mts.map +1 -1
- package/resources/parsing/parsing.d.ts +2 -2
- package/resources/parsing/parsing.d.ts.map +1 -1
- package/resources/parsing/parsing.js +2 -24
- package/resources/parsing/parsing.js.map +1 -1
- package/resources/parsing/parsing.mjs.map +1 -1
- package/resources/parsing.js +2 -15
- package/resources/parsing.js.map +1 -1
- package/resources/top-level.d.mts +9 -4
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +9 -4
- package/resources/top-level.d.ts.map +1 -1
- package/resources/vector-stores/files.d.mts +29 -2
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +29 -2
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +2 -24
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/index.d.mts +1 -1
- package/resources/vector-stores/index.d.mts.map +1 -1
- package/resources/vector-stores/index.d.ts +1 -1
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +223 -81
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +223 -81
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +2 -24
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/vector-stores.js +2 -15
- package/resources/vector-stores.js.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/client.ts +94 -16
- package/src/internal/headers.ts +4 -3
- package/src/internal/to-file.ts +4 -2
- package/src/internal/uploads.ts +16 -4
- package/src/internal/utils/base64.ts +13 -10
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/uuid.ts +1 -3
- package/src/resources/api-keys.ts +225 -0
- package/src/resources/chat.ts +33 -0
- package/src/resources/data-sources/connectors.ts +280 -0
- package/src/resources/data-sources/data-sources.ts +271 -0
- package/src/resources/data-sources/index.ts +24 -0
- package/src/resources/data-sources.ts +3 -0
- package/src/resources/embeddings.ts +25 -10
- package/src/resources/extractions/content.ts +57 -2
- package/src/resources/extractions/extractions.ts +3 -1
- package/src/resources/extractions/index.ts +7 -1
- package/src/resources/extractions/jobs.ts +2 -1
- package/src/resources/files.ts +21 -0
- package/src/resources/index.ts +27 -4
- package/src/resources/parsing/index.ts +4 -0
- package/src/resources/parsing/jobs.ts +48 -45
- package/src/resources/parsing/parsing.ts +8 -0
- package/src/resources/top-level.ts +10 -40
- package/src/resources/vector-stores/files.ts +39 -2
- package/src/resources/vector-stores/index.ts +4 -3
- package/src/resources/vector-stores/vector-stores.ts +269 -91
- package/src/version.ts +1 -1
- package/uploads.js +2 -15
- package/uploads.js.map +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/internal/shims/crypto.d.mts +0 -13
- package/internal/shims/crypto.d.mts.map +0 -1
- package/internal/shims/crypto.d.ts +0 -13
- package/internal/shims/crypto.d.ts.map +0 -1
- package/internal/shims/crypto.js +0 -13
- package/internal/shims/crypto.js.map +0 -1
- package/internal/shims/crypto.mjs +0 -9
- package/internal/shims/crypto.mjs.map +0 -1
- package/internal/shims/file.d.mts +0 -23
- package/internal/shims/file.d.mts.map +0 -1
- package/internal/shims/file.d.ts +0 -23
- package/internal/shims/file.d.ts.map +0 -1
- package/internal/shims/file.js +0 -16
- package/internal/shims/file.js.map +0 -1
- package/internal/shims/file.mjs +0 -12
- package/internal/shims/file.mjs.map +0 -1
- package/internal/shims/getBuiltinModule.d.mts +0 -11
- package/internal/shims/getBuiltinModule.d.mts.map +0 -1
- package/internal/shims/getBuiltinModule.d.ts +0 -11
- package/internal/shims/getBuiltinModule.d.ts.map +0 -1
- package/internal/shims/getBuiltinModule.js +0 -68
- package/internal/shims/getBuiltinModule.js.map +0 -1
- package/internal/shims/getBuiltinModule.mjs +0 -64
- package/internal/shims/getBuiltinModule.mjs.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.js +0 -5
- package/internal/shims/nullGetBuiltinModule.js.map +0 -1
- package/internal/shims/nullGetBuiltinModule.mjs +0 -2
- package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
- package/src/internal/shims/crypto.ts +0 -18
- package/src/internal/shims/file.ts +0 -32
- package/src/internal/shims/getBuiltinModule.ts +0 -64
- package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
@@ -0,0 +1,193 @@
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
3
|
+
import { LimitOffset, type LimitOffsetParams, PagePromise } from "../../core/pagination.mjs";
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
5
|
+
export declare class Connectors extends APIResource {
|
6
|
+
/**
|
7
|
+
* Create a new connector.
|
8
|
+
*
|
9
|
+
* Args: data_source_id: The ID of the data source to create a connector for.
|
10
|
+
* params: The connector to create.
|
11
|
+
*
|
12
|
+
* Returns: The created connector.
|
13
|
+
*/
|
14
|
+
create(dataSourceID: string, body: ConnectorCreateParams, options?: RequestOptions): APIPromise<DataSourceConnector>;
|
15
|
+
/**
|
16
|
+
* Get a connector by ID.
|
17
|
+
*
|
18
|
+
* Args: data_source_id: The ID of the data source to get a connector for.
|
19
|
+
* connector_id: The ID of the connector to get.
|
20
|
+
*
|
21
|
+
* Returns: The connector.
|
22
|
+
*/
|
23
|
+
retrieve(connectorID: string, params: ConnectorRetrieveParams, options?: RequestOptions): APIPromise<DataSourceConnector>;
|
24
|
+
/**
|
25
|
+
* Update a connector.
|
26
|
+
*
|
27
|
+
* Args: data_source_id: The ID of the data source to update a connector for.
|
28
|
+
* connector_id: The ID of the connector to update. params: The connector to
|
29
|
+
* update.
|
30
|
+
*
|
31
|
+
* Returns: The updated connector.
|
32
|
+
*/
|
33
|
+
update(connectorID: string, params: ConnectorUpdateParams, options?: RequestOptions): APIPromise<DataSourceConnector>;
|
34
|
+
/**
|
35
|
+
* Get all connectors for a data source.
|
36
|
+
*
|
37
|
+
* Args: data_source_id: The ID of the data source to get connectors for.
|
38
|
+
* pagination: The pagination options.
|
39
|
+
*
|
40
|
+
* Returns: The list of connectors.
|
41
|
+
*/
|
42
|
+
list(dataSourceID: string, query?: ConnectorListParams | null | undefined, options?: RequestOptions): PagePromise<DataSourceConnectorsLimitOffset, DataSourceConnector>;
|
43
|
+
/**
|
44
|
+
* Delete a connector.
|
45
|
+
*
|
46
|
+
* Args: data_source_id: The ID of the data source to delete a connector for.
|
47
|
+
* connector_id: The ID of the connector to delete.
|
48
|
+
*
|
49
|
+
* Returns: The deleted connector.
|
50
|
+
*/
|
51
|
+
delete(connectorID: string, params: ConnectorDeleteParams, options?: RequestOptions): APIPromise<ConnectorDeleteResponse>;
|
52
|
+
}
|
53
|
+
export type DataSourceConnectorsLimitOffset = LimitOffset<DataSourceConnector>;
|
54
|
+
/**
|
55
|
+
* Service-level representation of a connector.
|
56
|
+
*/
|
57
|
+
export interface DataSourceConnector {
|
58
|
+
/**
|
59
|
+
* The ID of the connector
|
60
|
+
*/
|
61
|
+
id: string;
|
62
|
+
/**
|
63
|
+
* The creation time of the connector
|
64
|
+
*/
|
65
|
+
created_at: string;
|
66
|
+
/**
|
67
|
+
* The last update time of the connector
|
68
|
+
*/
|
69
|
+
updated_at: string;
|
70
|
+
/**
|
71
|
+
* The ID of the vector store
|
72
|
+
*/
|
73
|
+
vector_store_id: string;
|
74
|
+
/**
|
75
|
+
* The ID of the data source
|
76
|
+
*/
|
77
|
+
data_source_id: string;
|
78
|
+
/**
|
79
|
+
* The name of the connector
|
80
|
+
*/
|
81
|
+
name?: string;
|
82
|
+
/**
|
83
|
+
* The metadata of the connector
|
84
|
+
*/
|
85
|
+
metadata: unknown;
|
86
|
+
/**
|
87
|
+
* The polling interval of the connector
|
88
|
+
*/
|
89
|
+
polling_interval: string;
|
90
|
+
/**
|
91
|
+
* The start time of the connector
|
92
|
+
*/
|
93
|
+
started_at: string | null;
|
94
|
+
/**
|
95
|
+
* The finish time of the connector
|
96
|
+
*/
|
97
|
+
finished_at: string | null;
|
98
|
+
/**
|
99
|
+
* The last sync time of the connector
|
100
|
+
*/
|
101
|
+
last_synced_at: string | null;
|
102
|
+
/**
|
103
|
+
* The sync status of the connector
|
104
|
+
*/
|
105
|
+
status: 'idle' | 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
106
|
+
/**
|
107
|
+
* The sync error of the connector
|
108
|
+
*/
|
109
|
+
error: string | null;
|
110
|
+
/**
|
111
|
+
* The type of the object
|
112
|
+
*/
|
113
|
+
object?: 'data_source.connector';
|
114
|
+
}
|
115
|
+
/**
|
116
|
+
* Deleted connector.
|
117
|
+
*/
|
118
|
+
export interface ConnectorDeleteResponse {
|
119
|
+
/**
|
120
|
+
* The ID of the connector
|
121
|
+
*/
|
122
|
+
id: string;
|
123
|
+
/**
|
124
|
+
* Whether the connector was deleted
|
125
|
+
*/
|
126
|
+
deleted?: boolean;
|
127
|
+
/**
|
128
|
+
* The type of the object
|
129
|
+
*/
|
130
|
+
object?: 'data_source.connector';
|
131
|
+
}
|
132
|
+
export interface ConnectorCreateParams {
|
133
|
+
/**
|
134
|
+
* The ID of the vector store
|
135
|
+
*/
|
136
|
+
vector_store_id: string;
|
137
|
+
/**
|
138
|
+
* The name of the connector
|
139
|
+
*/
|
140
|
+
name?: string;
|
141
|
+
/**
|
142
|
+
* Whether the connector should be synced after creation
|
143
|
+
*/
|
144
|
+
trigger_sync?: boolean;
|
145
|
+
/**
|
146
|
+
* The metadata of the connector
|
147
|
+
*/
|
148
|
+
metadata?: unknown;
|
149
|
+
/**
|
150
|
+
* The polling interval of the connector
|
151
|
+
*/
|
152
|
+
polling_interval?: string | null;
|
153
|
+
}
|
154
|
+
export interface ConnectorRetrieveParams {
|
155
|
+
/**
|
156
|
+
* The ID of the data source to get a connector for
|
157
|
+
*/
|
158
|
+
data_source_id: string;
|
159
|
+
}
|
160
|
+
export interface ConnectorUpdateParams {
|
161
|
+
/**
|
162
|
+
* Path param: The ID of the data source to update a connector for
|
163
|
+
*/
|
164
|
+
data_source_id: string;
|
165
|
+
/**
|
166
|
+
* Body param: The name of the connector
|
167
|
+
*/
|
168
|
+
name?: string | null;
|
169
|
+
/**
|
170
|
+
* Body param: The metadata of the connector
|
171
|
+
*/
|
172
|
+
metadata?: Record<string, unknown> | null;
|
173
|
+
/**
|
174
|
+
* Body param: Whether the connector should be synced after update
|
175
|
+
*/
|
176
|
+
trigger_sync?: boolean | null;
|
177
|
+
/**
|
178
|
+
* Body param: The polling interval of the connector
|
179
|
+
*/
|
180
|
+
polling_interval?: string | null;
|
181
|
+
}
|
182
|
+
export interface ConnectorListParams extends LimitOffsetParams {
|
183
|
+
}
|
184
|
+
export interface ConnectorDeleteParams {
|
185
|
+
/**
|
186
|
+
* The ID of the data source to delete a connector for
|
187
|
+
*/
|
188
|
+
data_source_id: string;
|
189
|
+
}
|
190
|
+
export declare namespace Connectors {
|
191
|
+
export { type DataSourceConnector as DataSourceConnector, type ConnectorDeleteResponse as ConnectorDeleteResponse, type DataSourceConnectorsLimitOffset as DataSourceConnectorsLimitOffset, type ConnectorCreateParams as ConnectorCreateParams, type ConnectorRetrieveParams as ConnectorRetrieveParams, type ConnectorUpdateParams as ConnectorUpdateParams, type ConnectorListParams as ConnectorListParams, type ConnectorDeleteParams as ConnectorDeleteParams, };
|
192
|
+
}
|
193
|
+
//# sourceMappingURL=connectors.d.mts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"connectors.d.mts","sourceRoot":"","sources":["../../src/resources/data-sources/connectors.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,WAAW,EAAE;OACpD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;OAOG;IACH,MAAM,CACJ,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;;OAOG;IACH,QAAQ,CACN,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAKlC;;;;;;;;OAQG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAQlC;;;;;;;OAOG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,mBAAmB,CAAC;IAQpE;;;;;;;OAOG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;CAIvC;AAED,MAAM,MAAM,+BAA+B,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAE/E;;GAEG;AACH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WAAW,uBAAuB;IACtC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE1C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;CAAG;AAEjE,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
@@ -0,0 +1,193 @@
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
3
|
+
import { LimitOffset, type LimitOffsetParams, PagePromise } from "../../core/pagination.js";
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
5
|
+
export declare class Connectors extends APIResource {
|
6
|
+
/**
|
7
|
+
* Create a new connector.
|
8
|
+
*
|
9
|
+
* Args: data_source_id: The ID of the data source to create a connector for.
|
10
|
+
* params: The connector to create.
|
11
|
+
*
|
12
|
+
* Returns: The created connector.
|
13
|
+
*/
|
14
|
+
create(dataSourceID: string, body: ConnectorCreateParams, options?: RequestOptions): APIPromise<DataSourceConnector>;
|
15
|
+
/**
|
16
|
+
* Get a connector by ID.
|
17
|
+
*
|
18
|
+
* Args: data_source_id: The ID of the data source to get a connector for.
|
19
|
+
* connector_id: The ID of the connector to get.
|
20
|
+
*
|
21
|
+
* Returns: The connector.
|
22
|
+
*/
|
23
|
+
retrieve(connectorID: string, params: ConnectorRetrieveParams, options?: RequestOptions): APIPromise<DataSourceConnector>;
|
24
|
+
/**
|
25
|
+
* Update a connector.
|
26
|
+
*
|
27
|
+
* Args: data_source_id: The ID of the data source to update a connector for.
|
28
|
+
* connector_id: The ID of the connector to update. params: The connector to
|
29
|
+
* update.
|
30
|
+
*
|
31
|
+
* Returns: The updated connector.
|
32
|
+
*/
|
33
|
+
update(connectorID: string, params: ConnectorUpdateParams, options?: RequestOptions): APIPromise<DataSourceConnector>;
|
34
|
+
/**
|
35
|
+
* Get all connectors for a data source.
|
36
|
+
*
|
37
|
+
* Args: data_source_id: The ID of the data source to get connectors for.
|
38
|
+
* pagination: The pagination options.
|
39
|
+
*
|
40
|
+
* Returns: The list of connectors.
|
41
|
+
*/
|
42
|
+
list(dataSourceID: string, query?: ConnectorListParams | null | undefined, options?: RequestOptions): PagePromise<DataSourceConnectorsLimitOffset, DataSourceConnector>;
|
43
|
+
/**
|
44
|
+
* Delete a connector.
|
45
|
+
*
|
46
|
+
* Args: data_source_id: The ID of the data source to delete a connector for.
|
47
|
+
* connector_id: The ID of the connector to delete.
|
48
|
+
*
|
49
|
+
* Returns: The deleted connector.
|
50
|
+
*/
|
51
|
+
delete(connectorID: string, params: ConnectorDeleteParams, options?: RequestOptions): APIPromise<ConnectorDeleteResponse>;
|
52
|
+
}
|
53
|
+
export type DataSourceConnectorsLimitOffset = LimitOffset<DataSourceConnector>;
|
54
|
+
/**
|
55
|
+
* Service-level representation of a connector.
|
56
|
+
*/
|
57
|
+
export interface DataSourceConnector {
|
58
|
+
/**
|
59
|
+
* The ID of the connector
|
60
|
+
*/
|
61
|
+
id: string;
|
62
|
+
/**
|
63
|
+
* The creation time of the connector
|
64
|
+
*/
|
65
|
+
created_at: string;
|
66
|
+
/**
|
67
|
+
* The last update time of the connector
|
68
|
+
*/
|
69
|
+
updated_at: string;
|
70
|
+
/**
|
71
|
+
* The ID of the vector store
|
72
|
+
*/
|
73
|
+
vector_store_id: string;
|
74
|
+
/**
|
75
|
+
* The ID of the data source
|
76
|
+
*/
|
77
|
+
data_source_id: string;
|
78
|
+
/**
|
79
|
+
* The name of the connector
|
80
|
+
*/
|
81
|
+
name?: string;
|
82
|
+
/**
|
83
|
+
* The metadata of the connector
|
84
|
+
*/
|
85
|
+
metadata: unknown;
|
86
|
+
/**
|
87
|
+
* The polling interval of the connector
|
88
|
+
*/
|
89
|
+
polling_interval: string;
|
90
|
+
/**
|
91
|
+
* The start time of the connector
|
92
|
+
*/
|
93
|
+
started_at: string | null;
|
94
|
+
/**
|
95
|
+
* The finish time of the connector
|
96
|
+
*/
|
97
|
+
finished_at: string | null;
|
98
|
+
/**
|
99
|
+
* The last sync time of the connector
|
100
|
+
*/
|
101
|
+
last_synced_at: string | null;
|
102
|
+
/**
|
103
|
+
* The sync status of the connector
|
104
|
+
*/
|
105
|
+
status: 'idle' | 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
106
|
+
/**
|
107
|
+
* The sync error of the connector
|
108
|
+
*/
|
109
|
+
error: string | null;
|
110
|
+
/**
|
111
|
+
* The type of the object
|
112
|
+
*/
|
113
|
+
object?: 'data_source.connector';
|
114
|
+
}
|
115
|
+
/**
|
116
|
+
* Deleted connector.
|
117
|
+
*/
|
118
|
+
export interface ConnectorDeleteResponse {
|
119
|
+
/**
|
120
|
+
* The ID of the connector
|
121
|
+
*/
|
122
|
+
id: string;
|
123
|
+
/**
|
124
|
+
* Whether the connector was deleted
|
125
|
+
*/
|
126
|
+
deleted?: boolean;
|
127
|
+
/**
|
128
|
+
* The type of the object
|
129
|
+
*/
|
130
|
+
object?: 'data_source.connector';
|
131
|
+
}
|
132
|
+
export interface ConnectorCreateParams {
|
133
|
+
/**
|
134
|
+
* The ID of the vector store
|
135
|
+
*/
|
136
|
+
vector_store_id: string;
|
137
|
+
/**
|
138
|
+
* The name of the connector
|
139
|
+
*/
|
140
|
+
name?: string;
|
141
|
+
/**
|
142
|
+
* Whether the connector should be synced after creation
|
143
|
+
*/
|
144
|
+
trigger_sync?: boolean;
|
145
|
+
/**
|
146
|
+
* The metadata of the connector
|
147
|
+
*/
|
148
|
+
metadata?: unknown;
|
149
|
+
/**
|
150
|
+
* The polling interval of the connector
|
151
|
+
*/
|
152
|
+
polling_interval?: string | null;
|
153
|
+
}
|
154
|
+
export interface ConnectorRetrieveParams {
|
155
|
+
/**
|
156
|
+
* The ID of the data source to get a connector for
|
157
|
+
*/
|
158
|
+
data_source_id: string;
|
159
|
+
}
|
160
|
+
export interface ConnectorUpdateParams {
|
161
|
+
/**
|
162
|
+
* Path param: The ID of the data source to update a connector for
|
163
|
+
*/
|
164
|
+
data_source_id: string;
|
165
|
+
/**
|
166
|
+
* Body param: The name of the connector
|
167
|
+
*/
|
168
|
+
name?: string | null;
|
169
|
+
/**
|
170
|
+
* Body param: The metadata of the connector
|
171
|
+
*/
|
172
|
+
metadata?: Record<string, unknown> | null;
|
173
|
+
/**
|
174
|
+
* Body param: Whether the connector should be synced after update
|
175
|
+
*/
|
176
|
+
trigger_sync?: boolean | null;
|
177
|
+
/**
|
178
|
+
* Body param: The polling interval of the connector
|
179
|
+
*/
|
180
|
+
polling_interval?: string | null;
|
181
|
+
}
|
182
|
+
export interface ConnectorListParams extends LimitOffsetParams {
|
183
|
+
}
|
184
|
+
export interface ConnectorDeleteParams {
|
185
|
+
/**
|
186
|
+
* The ID of the data source to delete a connector for
|
187
|
+
*/
|
188
|
+
data_source_id: string;
|
189
|
+
}
|
190
|
+
export declare namespace Connectors {
|
191
|
+
export { type DataSourceConnector as DataSourceConnector, type ConnectorDeleteResponse as ConnectorDeleteResponse, type DataSourceConnectorsLimitOffset as DataSourceConnectorsLimitOffset, type ConnectorCreateParams as ConnectorCreateParams, type ConnectorRetrieveParams as ConnectorRetrieveParams, type ConnectorUpdateParams as ConnectorUpdateParams, type ConnectorListParams as ConnectorListParams, type ConnectorDeleteParams as ConnectorDeleteParams, };
|
192
|
+
}
|
193
|
+
//# sourceMappingURL=connectors.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../src/resources/data-sources/connectors.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,WAAW,EAAE;OACpD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;OAOG;IACH,MAAM,CACJ,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;;OAOG;IACH,QAAQ,CACN,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAKlC;;;;;;;;OAQG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAQlC;;;;;;;OAOG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,mBAAmB,CAAC;IAQpE;;;;;;;OAOG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,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;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE1C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;CAAG;AAEjE,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
"use strict";
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.Connectors = void 0;
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
6
|
+
const pagination_1 = require("../../core/pagination.js");
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
8
|
+
class Connectors extends resource_1.APIResource {
|
9
|
+
/**
|
10
|
+
* Create a new connector.
|
11
|
+
*
|
12
|
+
* Args: data_source_id: The ID of the data source to create a connector for.
|
13
|
+
* params: The connector to create.
|
14
|
+
*
|
15
|
+
* Returns: The created connector.
|
16
|
+
*/
|
17
|
+
create(dataSourceID, body, options) {
|
18
|
+
return this._client.post((0, path_1.path) `/v1/data_sources/${dataSourceID}/connectors`, { body, ...options });
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Get a connector by ID.
|
22
|
+
*
|
23
|
+
* Args: data_source_id: The ID of the data source to get a connector for.
|
24
|
+
* connector_id: The ID of the connector to get.
|
25
|
+
*
|
26
|
+
* Returns: The connector.
|
27
|
+
*/
|
28
|
+
retrieve(connectorID, params, options) {
|
29
|
+
const { data_source_id } = params;
|
30
|
+
return this._client.get((0, path_1.path) `/v1/data_sources/${data_source_id}/connectors/${connectorID}`, options);
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Update a connector.
|
34
|
+
*
|
35
|
+
* Args: data_source_id: The ID of the data source to update a connector for.
|
36
|
+
* connector_id: The ID of the connector to update. params: The connector to
|
37
|
+
* update.
|
38
|
+
*
|
39
|
+
* Returns: The updated connector.
|
40
|
+
*/
|
41
|
+
update(connectorID, params, options) {
|
42
|
+
const { data_source_id, ...body } = params;
|
43
|
+
return this._client.put((0, path_1.path) `/v1/data_sources/${data_source_id}/connectors/${connectorID}`, {
|
44
|
+
body,
|
45
|
+
...options,
|
46
|
+
});
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Get all connectors for a data source.
|
50
|
+
*
|
51
|
+
* Args: data_source_id: The ID of the data source to get connectors for.
|
52
|
+
* pagination: The pagination options.
|
53
|
+
*
|
54
|
+
* Returns: The list of connectors.
|
55
|
+
*/
|
56
|
+
list(dataSourceID, query = {}, options) {
|
57
|
+
return this._client.getAPIList((0, path_1.path) `/v1/data_sources/${dataSourceID}/connectors`, (pagination_1.LimitOffset), { query, ...options });
|
58
|
+
}
|
59
|
+
/**
|
60
|
+
* Delete a connector.
|
61
|
+
*
|
62
|
+
* Args: data_source_id: The ID of the data source to delete a connector for.
|
63
|
+
* connector_id: The ID of the connector to delete.
|
64
|
+
*
|
65
|
+
* Returns: The deleted connector.
|
66
|
+
*/
|
67
|
+
delete(connectorID, params, options) {
|
68
|
+
const { data_source_id } = params;
|
69
|
+
return this._client.delete((0, path_1.path) `/v1/data_sources/${data_source_id}/connectors/${connectorID}`, options);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
exports.Connectors = Connectors;
|
73
|
+
//# sourceMappingURL=connectors.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../src/resources/data-sources/connectors.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,yDAAyF;AAEzF,uDAAiD;AAEjD,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;OAOG;IACH,MAAM,CACJ,YAAoB,EACpB,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,oBAAoB,YAAY,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CACN,WAAmB,EACnB,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,cAAc,eAAe,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IACvG,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,cAAc,eAAe,WAAW,EAAE,EAAE;YAC1F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,YAAoB,EACpB,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,oBAAoB,YAAY,aAAa,EACjD,CAAA,wBAAgC,CAAA,EAChC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,cAAc,eAAe,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1G,CAAC;CACF;AA3FD,gCA2FC"}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
3
|
+
import { LimitOffset } from "../../core/pagination.mjs";
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
5
|
+
export class Connectors extends APIResource {
|
6
|
+
/**
|
7
|
+
* Create a new connector.
|
8
|
+
*
|
9
|
+
* Args: data_source_id: The ID of the data source to create a connector for.
|
10
|
+
* params: The connector to create.
|
11
|
+
*
|
12
|
+
* Returns: The created connector.
|
13
|
+
*/
|
14
|
+
create(dataSourceID, body, options) {
|
15
|
+
return this._client.post(path `/v1/data_sources/${dataSourceID}/connectors`, { body, ...options });
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* Get a connector by ID.
|
19
|
+
*
|
20
|
+
* Args: data_source_id: The ID of the data source to get a connector for.
|
21
|
+
* connector_id: The ID of the connector to get.
|
22
|
+
*
|
23
|
+
* Returns: The connector.
|
24
|
+
*/
|
25
|
+
retrieve(connectorID, params, options) {
|
26
|
+
const { data_source_id } = params;
|
27
|
+
return this._client.get(path `/v1/data_sources/${data_source_id}/connectors/${connectorID}`, options);
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* Update a connector.
|
31
|
+
*
|
32
|
+
* Args: data_source_id: The ID of the data source to update a connector for.
|
33
|
+
* connector_id: The ID of the connector to update. params: The connector to
|
34
|
+
* update.
|
35
|
+
*
|
36
|
+
* Returns: The updated connector.
|
37
|
+
*/
|
38
|
+
update(connectorID, params, options) {
|
39
|
+
const { data_source_id, ...body } = params;
|
40
|
+
return this._client.put(path `/v1/data_sources/${data_source_id}/connectors/${connectorID}`, {
|
41
|
+
body,
|
42
|
+
...options,
|
43
|
+
});
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* Get all connectors for a data source.
|
47
|
+
*
|
48
|
+
* Args: data_source_id: The ID of the data source to get connectors for.
|
49
|
+
* pagination: The pagination options.
|
50
|
+
*
|
51
|
+
* Returns: The list of connectors.
|
52
|
+
*/
|
53
|
+
list(dataSourceID, query = {}, options) {
|
54
|
+
return this._client.getAPIList(path `/v1/data_sources/${dataSourceID}/connectors`, (LimitOffset), { query, ...options });
|
55
|
+
}
|
56
|
+
/**
|
57
|
+
* Delete a connector.
|
58
|
+
*
|
59
|
+
* Args: data_source_id: The ID of the data source to delete a connector for.
|
60
|
+
* connector_id: The ID of the connector to delete.
|
61
|
+
*
|
62
|
+
* Returns: The deleted connector.
|
63
|
+
*/
|
64
|
+
delete(connectorID, params, options) {
|
65
|
+
const { data_source_id } = params;
|
66
|
+
return this._client.delete(path `/v1/data_sources/${data_source_id}/connectors/${connectorID}`, options);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
//# sourceMappingURL=connectors.mj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