Collection of React hooks for building your self-service data warehouse syncing feature in your webapp. See our documentation for usage and examples.
Function |
Type |
getDefaultAuthMethod |
(vendor: string) => AuthMethod |
Function |
Type |
getDefaultBucketVendor |
(vendor: string) => BucketVendor or undefined |
Function |
Type |
getDefaultMetastore |
(vendor: string) => Metastore or undefined |
Function |
Type |
getDefaultDestination |
() => { type: DestinationType.Destination; name: string; vendor: string; id_in_provider_system?: string or undefined; recipient_id?: string or undefined; use_ssh_tunnel?: boolean or undefined; ... 53 more ...; secondary_public_key?: string or undefined; } |
getDefaultExistingDestination
Function |
Type |
getDefaultExistingDestination |
() => { vendor: string; name: string; id_in_provider_system?: string or undefined; recipient_id?: string or undefined; frequency_minutes?: FrequencyMinutes or undefined; ... 33 more ...; updated_at: string; } |
Function |
Type |
encodeCursor |
(c: PaginationCursor) => string |
Function |
Type |
decodeCursor |
(s: string) => PaginationCursor |
prepareDestinationWithForm
Function to prepare a destination using the given destination data and form.
This function takes a destination and an optional form, and returns a prepared destination
that includes the necessary updates and modifications from the form.
Function |
Type |
prepareDestinationWithForm |
(d: Destination, f: Form or undefined) => PreparedDestination |
Parameters:
-
d
: - The destination data to be prepared.
-
f
: - The optional form containing updates and modifications for the destination.
Function to parse a service account key from a JSON string.
This function takes an optional JSON string representing a service account key
and returns the parsed service account key object. If the input string is
undefined or cannot be parsed, it returns undefined.
Function |
Type |
parseServiceAccountKey |
(k?: string or undefined) => ServiceAccountKey or undefined |
Parameters:
-
k
: - The optional JSON string representing the service account key.
Function to parse GCP IAM role metadata from a JSON string.
This function takes an optional JSON string representing GCP IAM role metadata
and returns the parsed metadata object. If the input string is undefined or cannot be parsed,
it returns undefined.
Function |
Type |
parseGcpIamRoleMetadata |
(string?: string or undefined) => GcpExternalAccountMetadata or undefined |
Parameters:
-
string
: - The optional JSON string representing the GCP IAM role metadata.
prepareDestinationFromExisting
Function to prepare a destination from an existing destination.
This function takes an existing destination and transforms it into a new destination
object, ready for further processing or updates.
Function |
Type |
prepareDestinationFromExisting |
(e: ExistingDestination) => Destination |
Parameters:
-
e
: - The existing destination to be transformed.
Function to compute the changed fields between an existing destination and a prepared destination.
This function takes an existing destination, a prepared destination, and an optional partial prepared destination.
It returns the fields that have changed between the existing and prepared destinations, optionally including additional changes.
Function |
Type |
computeChangedFields |
(e: ExistingDestination, d: PreparedDestination) => Partial<PreparedDestination> |
Parameters:
-
e
: - The existing destination to compare.
-
d
: - The prepared destination with potential changes.
Custom hook to create a new destination.
This hook returns an asynchronous function that creates a new destination
using the provided token, origin, and an optional host. It utilizes a token
fetched from a prepared destination.
Function |
Type |
useCreateDestination |
(fetchToken: FetchAuthTokenWithPreparedDestination, origin: string, host?: string or undefined) => (destination: PreparedDestination) => Promise<...> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token using a prepared destination.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. Defaults to PREQUEL_US if not provided.
Examples:
import { useCreateDestination, prepareDestinationWithForm } from "@prequel/react";
const createDestination = useCreateDestination(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
// prepareDestinationWithForm usage elided...
async function onFormSubmit() {
const response = await createDestination(preparedDestination);
if (response.status === "success") {
// handle creation success
} else {
// handle creation failure
}
}
Custom hook to delete an existing destination.
This hook returns an asynchronous function that deletes an existing destination
using the provided token, origin, and an optional host. It utilizes a token
fetched from an existing destination.
Function |
Type |
useDeleteDestination |
(fetchToken: FetchAuthTokenWithExistingDestination, origin: string, host?: string or undefined) => (destination: ExistingDestination) => Promise<...> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token using an existing destination.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. Defaults to PREQUEL_US if not provided.
Examples:
import { useDeleteDestination } from "@prequel/react";
const deleteDestination = useDeleteDestination(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
async function onSubmitDelete() {
const response = await deleteDestination(existingDestination);
if (response.status === "success") {
// handle update success
} else {
// handle update failure
}
}
Custom hook to manage the state of a destination.
This hook initializes the destination state with a default or provided initial state,
and returns the current destination state along with a function to update it partially.
Function |
Type |
useDestination |
(initialState?: Partial<Destination> or undefined) => [Destination, Dispatch<SetStateAction<Partial<Destination>>>] |
Parameters:
-
initialState
: - Optional initial state to override the default destination state.
Examples:
import { useDestination } from "@prequel/react";
const [destination, setDestination] = useDestination({ name: "Example Destination" });
console.log("Destination Name:", destination.name); // "Example Destination"
setDestination((currentDestination) => ({ ...currentDestination, name: "Updated Destination Name" }));
console.log("Destination Name:", destination.name); // "Updated Destination Name"
Custom hook to manage the state and behavior of a destination form.
This hook creates a form state for a given destination and organization ID,
with optional settings to include internal fields, specify a host, and provide
a vendor query.
Function |
Type |
useDestinationForm |
(destination: Destination, orgId: string, options?: UseDestinationFormOptions or undefined) => Form |
Parameters:
-
destination
: - The destination for which the form is created.
-
orgId
: - The organization ID associated with the form.
-
options
: - Optional settings for the form behavior.
-
options.includeInternalFields
: - Whether to include internal fields in the form.
-
options.host
: - The host to which the form data is submitted.
-
options.vendorQuery
: - A query string to filter vendors.
Examples:
import { useDestination, useDestinationForm } from "@prequel/react";
const [destination, setDestination] = useDestination();
const destinationForm = useDestinationForm(
destination,
"your-prequel-org-uuid",
);
return (
<div>
{destinationForm.map((section) => (
// Render the section...
{section.fields((field) => (
// Render the field...
)}
))}
</div>
);
Custom hook to fetch a list of destinations.
This hook returns an asynchronous function that retrieves a list of destinations
using the provided token, origin, and an optional host.
Function |
Type |
useGetDestinations |
(fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => () => Promise<GetDestinationsResponse> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. If not provided, a default host will be used.
Examples:
import { useGetDestinations } from "@prequel/react";
const getDestinations = useGetDestinations(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
const destinations = getDestinations();
Custom hook to fetch the models available for a particular recipient.
This hook returns an asynchronous function that retrieves a list of models
using the provided token, origin, and an optional host. The models are scoped
to the Recipient ID that was declared when creating the token.
Function |
Type |
useGetModelsForRecipient |
(fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => () => Promise<ModelsResponse> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. If not provided, a default host will be used.
Examples:
import { useGetModelsForRecipient } from "@prequel/react";
const getModels = useGetModelsForRecipient(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
const models = getModels();
Custom hook to fetch a list of transfers for a given destination.
This hook returns an asynchronous function that retrieves a list of transfers
using the provided token, origin, destination, and optional host and parameters.
Function |
Type |
useGetTransfers |
(fetchToken: FetchAuthTokenWithExistingDestination, origin: string, host?: string or undefined) => (destination: ExistingDestination, params?: GetTransfersParams or undefined) => Promise<...> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token using an existing destination.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. If not provided, a default host will be used.
Examples:
import { useGetTransfers, TransferStatus } from "@prequel/react";
// destination fetching elided...
const getTransfers = useGetTransfers(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
// Get all transfers for destination
const allTransfers = getTransfers(destination);
// Get transfers for destination with limit
const someTransfers = getTransfers(destination, { count: 5 });
// Get all transfers for destination with success status
const successfulTransfers = getTransfers(destination, { status: TransferStatus.SUCCESS });
Custom hook to fetch a paginated list of transfers for a destination.
This hook returns an asynchronous function with optional pagination parameters
that fetches a list of transfers for the given destination alongside pagination
metadata using the provided token, origin, and an optional host.
Function |
Type |
useListTransfers |
(fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => (d: ExistingDestination, p?: ListResourceParameters or undefined) => Promise<...> |
Parameters:
-
fetchToken
: - A function that retrieves an authorization token to access the API.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. If not provided, a default host will be used.
Function |
Type |
useFetchResource |
<T>(fetchToken: FetchAuthToken, origin: string, url: string) => APIResponse<T> or undefined |
Custom hook to fetch a list of models.
This hook returns the response containing a list of models
using the provided token, origin, and an optional host.
Function |
Type |
useModels |
(fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => ModelsResponse |
Parameters:
-
fetchToken
: - A function to fetch the authentication token.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. If not provided, a default host will be used.
Examples:
import { useModels } from "@prequel/react";
const models = useModels(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
Function |
Type |
useProducts |
(fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => ProductsResponse |
Function |
Type |
useDestinationVendors |
(host?: string or undefined) => DestinationVendorsResponse |
Custom hook to test the connection to a prepared destination.
This hook returns an asynchronous function that tests the connection
to a given prepared destination using the provided token, origin, and an optional host.
Function |
Type |
useTestConnection |
(fetchToken: FetchAuthTokenWithPreparedDestination, origin: string, host?: string or undefined) => (destination: PreparedDestination) => Promise<...> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token using a prepared destination.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. Defaults to PREQUEL_US if not provided.
Examples:
import { useTestConnection } from "@prequel/react";
const testConnection = useTestConnection(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
async function testDestinationConnection() {
const { data, status, message } = await testConnection(preparedDestination);
if (response.status === "success") {
// handle test success
} else {
// handle test failure
}
}
useTestExistingConnection
Custom hook to test the existing connection to a destination.
This hook returns an asynchronous function that tests the connection
between a given existing destination and a prepared destination.
It utilizes a token fetched from an existing destination.
Function |
Type |
useTestExistingConnection |
(fetchToken: FetchAuthTokenWithExistingDestination, origin: string, host?: string or undefined) => (destination: ExistingDestination, updated: PreparedDestination) => Promise<...> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token using an existing destination.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. If not provided, a default host will be used.
Custom hook to update an existing destination.
This hook returns an asynchronous function that updates an existing destination
with the provided changes using the given token, origin, and an optional host.
Function |
Type |
useUpdateDestination |
(fetchToken: FetchAuthTokenWithExistingDestination, origin: string, host?: string or undefined) => (destination: ExistingDestination, updated: PreparedDestination) => Promise<...> |
Parameters:
-
fetchToken
: - A function to fetch the authentication token using an existing destination.
-
origin
: - The origin from where the request is made.
-
host
: - Optional host to which the request is made. Defaults to PREQUEL_US if not provided.
Examples:
const { useUpdateDestination } from "@prequel/react";
const updateDestination = useUpdateDestination(
fetchToken,
"app.example.co",
PREQUEL_HOST
);
// destination edits and preparation elided...
async function onSubmitUpdate() {
const response = await updateDestination(existingDestination, editedPreparedDestination);
if (response.status === "success") {
// handle update success
} else {
// handle update failure
}
}
Constant |
Type |
PAGE_SIZE_SEARCH_PARAM |
"page_size" |
Constant |
Type |
CURSOR_SEARCH_PARAM |
"cursor" |
Constant |
Type |
HOST_PLACEHOLDER |
"{{host}}" |
Constant |
Type |
ID_PLACEHOLDER |
"{{id_in_provider_system}}" |
Constant |
Type |
PREQUEL_US |
"https://api.prequel.co" |
Constant |
Type |
PREQUEL_EU |
"https://eu-api.prequel.co" |
SCOPED_AUTH_HEADER_KEY
Constant |
Type |
SCOPED_AUTH_HEADER_KEY |
"X-APP-ID" |
PREQUEL_API_VERSION_HEADER
Constant |
Type |
PREQUEL_API_VERSION_HEADER |
"X-Prequel-Api-Version" |
PREQUEL_API_VERSION_2023_12_01
Constant |
Type |
PREQUEL_API_VERSION_2023_12_01 |
"2023-12-01" |
TOP_LEVEL_DESTINATION_FIELDS
Constant |
Type |
TOP_LEVEL_DESTINATION_FIELDS |
string[] |
Constant |
Type |
BUCKET_AUTH_FIELD_PARENT |
{ access_id: string; secret_key: string; secret: string; access_key: string; } |
Property |
Type |
Description |
CANCELLED |
"CANCELLED" |
|
ERROR |
"ERROR" |
|
EXPIRED |
"EXPIRED" |
|
PARTIAL_FAILURE |
"PARTIAL_FAILURE" |
|
PENDING |
"PENDING" |
|
RUNNING |
"RUNNING" |
|
SUCCESS |
"SUCCESS" |
|
ORPHANED |
"ORPHANED" |
|
Property |
Type |
Description |
Destination |
`` |
|
PreparedDestination |
`` |
|
ExistingDestination |
`` |
|
AzureServiceSharedAccessSignature
Type |
Type |
AzureServiceSharedAccessSignature |
{ shared_access_signature_token: string; // The shared access signature token to use for authentication. } |
Type |
Type |
ABSDestinationOptions |
{ folder: string; container_name: string; storage_account_name: string; auth_method: "azure_service_shared_access_signature"; azure_service_shared_access_signature: AzureServiceSharedAccessSignature; } |
Type |
Type |
AthenaDestinationOptions |
{ workgroup: string; connection_database: string; write_database: string; auth_method: "aws_iam_role" or "aws_access_keys"; aws_iam_role?: AWSIAMRole; aws_access_keys?: AWSAccessKeys; bucket_s3: S3BucketParams; } |
Type |
Type |
TransferError |
{ readonly error_code: string; readonly title: string; readonly blame: string; readonly documentation_url: string; readonly trace: string; readonly message: string; } |
Type |
Type |
TransferModelMetrics |
{ readonly model_name: string; readonly model_id: string; readonly rows_transferred: number; readonly volume_transferred_in_mb: number; readonly most_recent_last_updated_at: string; readonly error?: TransferError; } |
Type |
Type |
Transfer |
{ readonly id: string; readonly source_id: string; readonly destination_id: string; readonly status: TransferStatus; readonly model_metrics?: TransferModelMetrics[]; readonly models: string[]; readonly log: string; readonly submitted_at: string; readonly started_at?: string; readonly ended_at?: string; readonly rows_transferred: number; readonly volume_transferred_in_mb: number; } |
Type |
Type |
MySQLDestinationOptions |
{ host: string; // The hostname of the MySQL server. port: number; // The port of the MySQL server. connection_database: string; // The name of the database to connect to. write_database: string; // The name of the database where final data will be written. auth_method: "password_auth"; // Placeholder value in case authentication options are added. Currently must be set to password_auth. password_auth: PasswordAuth; // Required details for username/password authentication. disable_ssl?: boolean; // Whether to disable SSL for the MySQL connection. } and SSHTunnelOptions |
PostgresDestinationOptions
Type |
Type |
PostgresDestinationOptions |
{ host: string; // The hostname of the PostgreSQL server. port: number; // The port of the PostgreSQL server. database: string; // The name of the database to connect to. schema: string; // The name of the schema to write to. auth_method: "password_auth"; // Placeholder value in case authentication options are added. Currently must be set to password_auth. password_auth: PasswordAuth; // Required details for username/password authentication. disable_ssl?: boolean; // Whether to disable SSL for the PostgreSQL connection. connection_timeout_in_seconds?: number; // Duration to wait for successful connection to Postgres } and SSHTunnelOptions |
BigQueryDestinationOptions
Type |
Type |
BigQueryDestinationOptions |
{ project_id: string; // The BigQuery project ID. schema: string; // The name of the schema to write to. auth_method: or "gcp_service_account_role" or "gcp_service_account_key" or "federated_gcp_service_account_role"; // The method of authentication to use for this destination. gcp_service_account_role?: GCPServiceAccountRole; // Required details if authenticating using a GCP service account role. federated_gcp_service_account_role?: FederatedGCPServiceAccountRole; gcp_service_account_key?: GCPServiceAccountKey; // Required details if authenticating using a GCP service account key. bucket_gcs: BigQueryGCSBucketParams; // Required details about the GCS bucket used for staging data. } |
ClickhouseDestinationOptions
Type |
Type |
ClickhouseDestinationOptions |
{ host: string; // The hostname of the ClickHouse server. port: number; // The port of the ClickHouse server. cluster?: string; // The name of the ClickHouse cluster to use for this destination. connection_database: string; // The name of the database to connect to. write_database: string; // The name of the database where final data will be written. auth_method: "password_auth"; // Placeholder value in case authentication options are added. Currently must be set to password_auth. password_auth: PasswordAuth; // Required details for username/password authentication. bucket_vendor: "bucket_s3" or "bucket_gcs" or "bucket_implicit"; // Where the staging bucket is hosted. bucket_s3?: ClickhouseS3BucketParams; // Required details about the S3 bucket used for staging data. bucket_gcs?: ClickhouseGCSBucketParams; // Required details about the GCS bucket used for staging data. disable_ssl?: boolean; // Whether to disable SSL for the ClickHouse connection. } |
DatabricksDestinationOptions
Type |
Type |
DatabricksDestinationOptions |
{ host: string; // The hostname of the Databricks server. port: number; // The port of the Databricks server. schema: string; // The name of the schema to write to. catalog: string; // The name of the catalog to write to. http_path: string; // The HTTP path to use for the Databricks connection. auth_method: "access_token_auth"; // Placeholder value in case authentication options are added. Currently must be set to access_token_auth. access_token_auth?: DatabricksAccessToken; // The access token authentication object. metastore: "hive" or "unity_catalog"; // The metastore configuration. hive?: DatabricksHiveOptions; // Optional Hive configuration. } |
Type |
Type |
DatabricksAccessToken |
{ access_token: string; // The access token to use for the Databricks connection. } |
Type |
Type |
DatabricksHiveOptions |
{ bucket_vendor: string; // Where the staging bucket is hosted. bucket_s3?: DatabricksS3BucketParams; // Required details if using an S3 bucket for staging data. } |
Type |
Type |
DatabricksS3BucketParams |
{ bucket_name: string; // The name of the S3 bucket. bucket_region: string; // The name of the S3 bucket region. aws_access_keys: AWSAccessKeys; // Required details if authenticating using AWS access keys. } |
Type |
Type |
GCSDestinationOptions |
{ folder: string; // The folder to write to. The folder will be created if it does not exist. bucket_name: string; // Required details about the GCS bucket used for staging data. auth_method: "gcp_service_account_role" or "gcs_hmac_keys"; // The method of authentication to use for this destination. gcp_service_account_role?: GCPServiceAccountRole; // Required details if authenticating using a GCP service account role. gcs_hmac_keys?: GCSAccessKeys; // Required details if authenticating using GCS HMAC keys. } |
MongoDBDestinationOptions
Type |
Type |
MongoDBDestinationOptions |
{ host: string; // The hostname of the MongoDB server. port: number; // The port of the MongoDB server. authentication_database: string; // The name of the MongoDB Authentication Database. write_database: string; // The name of the MongoDB database to write to. auth_method: "aws_iam_role" or "password_auth"; // The method of authentication to use for this destination. aws_iam_role?: AWSIAMRole; // Required details if authenticating using an AWS IAM role. password_auth?: PasswordAuth; // Required details if authenticating with username/password. disable_ssl?: boolean; // Whether to disable SSL for the MongoDB connection. } and SSHTunnelOptions |
RedshiftDestinationOptions
Type |
Type |
RedshiftDestinationOptions |
{ host: string; // The hostname of the Redshift server. port: number; // The port of the Redshift server. database: string; // The name of the database to connect to. schema: string; // The name of the schema to write to. cluster?: string; // The name of the Redshift cluster to connect to. username: string; // The name of the Redshift user to connect as. auth_method: "aws_iam_role" or "aws_access_keys"; // Placeholder value in case authentication options are added. Currently must be set to password_auth. aws_iam_role?: AWSIAMRole; // Required details if authenticating using an AWS IAM role. aws_access_keys?: RedshiftAccessKeys; // Required details if authenticating using AWS access keys. bucket_s3: RedshiftS3BucketParams; // Required details about the S3 bucket used for staging data. } |
RedshiftServerlessDestinationOptions
Type |
Type |
RedshiftServerlessDestinationOptions |
{ workgroup: string; // The name of the Redshift Serverless workgroup. host: string; // The hostname to use to connect. port: number; // The port to use to connect. database: string; // The name of the database to connect to. schema: string; // The name of the schema to write to. auth_method: "aws_iam_role" or "aws_access_keys"; aws_iam_role?: AWSIAMRole; // Required details if authenticating using an AWS IAM role. aws_access_keys?: AWSAccessKeys; // Required details if authenticating using AWS access keys. bucket_s3: RedshiftS3BucketParams; // Required details about the S3 bucket used for staging data. } |
Type |
Type |
SFTPDestinationOptions |
{ username: string; // The username to use for the SFTP connection. host: string; // The hostname of the SFTP server. port: number; // The port of the SFTP server. folder: string; // The folder to write to. The folder will be created if it does not exist. file_format: "csv"; // Placeholder representing the format of the files to write to the SFTP server. Currently must be set to CSV. csv: FileFormatCSV; // Required details for writing CSV file format. auth_method: "public_key_auth"; // Placeholder value in case authentication options are added. Currently must be set to public_key_auth. public_key_auth: PublicKeyAuth; // Required details for public key authentication. } |
SnowflakeDestinationOptions
Type |
Type |
SnowflakeDestinationOptions |
{ host: string; // The hostname of the Snowflake server. port: number; // The port of the Snowflake server. database: string; // The name of the database to connect to. schema: string; // The name of the schema to write to. auth_method: "password_auth"; // Placeholder value in case authentication options are added. Currently must be set to password_auth. password_auth: PasswordAuth; // Required details for username/password authentication. } |
Type |
Type |
S3DestinationOptions |
{ folder: string; // The folder to write to. The folder will be created if it does not exist. bucket_name: string; // The name of the S3 bucket. bucket_region: string; // The name of the S3 bucket region. auth_method: "aws_iam_role" or "aws_access_keys"; // The method of authentication to use for this destination. aws_iam_role?: AWSIAMRole; // Required details if authenticating using an AWS IAM role. aws_access_keys?: AWSAccessKeys; // Required details if authenticating using AWS access keys. } |
S3CompatibleDestinationOptions
Type |
Type |
S3CompatibleDestinationOptions |
{ host: string; // The hostname of the S3-compatible server. folder: string; // The folder to write to. The folder will be created if it does not exist. bucket_name: string; // The name of the S3-compatible bucket to write to. disable_ssl?: boolean; // Whether to disable SSL for the S3-compatible connection. auth_method: "access_keys"; // Placeholder value in case authentication options are added. Currently must be set to access_keys. access_keys: AccessKeys; // Required details for access key authentication. } |
GoogleSheetsDestinationOptions
Type |
Type |
GoogleSheetsDestinationOptions |
{ host: string; // The URL of the Google Sheet. } |
Type |
Type |
OracleSSLOptions |
{ wallet?: string; } |
Type |
Type |
OracleDestinationOptions |
{ host: string; // The hostname of the MySQL server. port: number; // The port of the MySQL server. database: string; // The name of the database to connect to. schema: string; // The name of the database where final data will be written. auth_method: "password_auth"; // Placeholder value in case authentication options are added. Currently must be set to password_auth. password_auth: PasswordAuth; // Required details for username/password authentication. disable_ssl?: boolean; // Whether to disable SSL for the MySQL connection. ssl_options?: OracleSSLOptions; } and SSHTunnelOptions |
Type |
Type |
Metastore |
hive" or "unity_catalog |
Type |
Type |
BucketAuthMethod |
` |
Type |
Type |
BucketVendor |
bucket_s3" or "bucket_gcs" or "bucket_implicit |
Type |
Type |
FileFormat |
parquet" or "csv" or "json" or "jsonl |
Type |
Type |
FrequencyMinutes |
0 or 15 or 60 or 360 or 720 or 1440 |
Type |
Type |
Destination |
{ readonly type: DestinationType.Destination; name: string; vendor: string; id_in_provider_system?: string; recipient_id?: string; use_ssh_tunnel?: boolean; is_enabled: boolean; created_at?: string; updated_at?: string; frequency_minutes?: FrequencyMinutes; host?: string; port?: string; cluster?: string; database?: string; schema?: string; username?: string; user?: string; password?: string; service_account_key?: string; auth_method?: AuthMethod; bucket_auth_method?: BucketAuthMethod; file_format?: FileFormat; aws_iam_role_arn?: string; service_account_email?: string; workload_identity_federation_metadata?: string; bucket_vendor?: BucketVendor; bucket_name?: string; bucket_region?: string; access_id?: string; access_key?: string; secret_key?: string; access_token?: string; ssh_tunnel_host?: string; ssh_tunnel_port?: string; ssh_tunnel_username?: string; ssh_public_key?: string; key_to_edit?: string; products?: string[]; enabled_models?: string[]; disable_ssl?: boolean; metastore?: Metastore; authentication_database?: string; catalog?: string; connection_database?: string; container_name?: string; delimiter?: string; folder?: string; http_path?: string; project_id?: string; public_key?: string; secret?: string; service_account?: string; shared_access_signature_token?: string; storage_account_name?: string; wallet?: string; workgroup?: string; write_database?: string; connection_timeout_in_seconds?: string; readonly primary_public_key?: string; readonly secondary_public_key?: string; } |
Type |
Type |
PreparedDestination |
{ readonly type: DestinationType.PreparedDestination; vendor: string; name: string; id_in_provider_system?: string; recipient_id?: string; frequency_minutes?: FrequencyMinutes; is_enabled: boolean; products?: string[]; enabled_models?: string[]; abs?: ABSDestinationOptions; athena?: AthenaDestinationOptions; aurora_mysql?: MySQLDestinationOptions; aurora_postgres?: PostgresDestinationOptions; bigquery?: BigQueryDestinationOptions; clickhouse?: ClickhouseDestinationOptions; databricks?: DatabricksDestinationOptions; gcs?: GCSDestinationOptions; google_sheets?: GoogleSheetsDestinationOptions; mock?: MockDestinationOptions; mongodb?: MongoDBDestinationOptions; mysql?: MySQLDestinationOptions; oracle?: OracleDestinationOptions; planetscale?: MySQLDestinationOptions; postgres?: PostgresDestinationOptions; redshift?: RedshiftDestinationOptions; redshift_serverless?: RedshiftServerlessDestinationOptions; sftp?: SFTPDestinationOptions; singlestore?: MySQLDestinationOptions; snowflake?: SnowflakeDestinationOptions; sql_server?: MySQLDestinationOptions; s3?: S3DestinationOptions; s3_compatible?: S3CompatibleDestinationOptions; // These two fields are to accommodate scoped auth until we move the entire SDK to use the new API version host?: string; bucket_name?: string; } |
Type |
Type |
ExistingDestination |
Omit< PreparedDestination, "type" or "products" or "enabled_models" > and { readonly type: DestinationType.ExistingDestination; readonly id: string; products: string[]; enabled_models: string[]; last_successful_transfer_ended_at: string or null; last_completed_transfer?: Transfer; readonly created_at: string; readonly updated_at: string; } |
Type |
Type |
ServiceAccountKey |
{ type: string; project_id: string; private_key_id: string; client_email: string; client_id: string; auth_url: string; token_uri: string; auth_provider_x509_cert_url: string; client_x509_cert_url: string; } |
Type |
Type |
GCPServiceAccountKey |
{ service_account_email: string; // The email of the GCP service account to use for authentication. service_account_key?: ServiceAccountKey; // The full Google-generated JSON service account key object. } |
Type |
Type |
S3BucketParams |
{ bucket_name: string; // The name of the S3 bucket. bucket_region: string; // The name of the S3 bucket region. } |
Type |
Type |
GCSBucketParams |
{ bucket_name: string; // The name of the GCS bucket. } |
Type |
Type |
BigQueryGCSBucketParams |
{ bucket_name: string; // The name of the GCS bucket. bucket_region: string; // The name of the GCS bucket region; } |
Type |
Type |
GCSAccessKeys |
{ access_key: string; // The access key to use for authentication secret: string; // The secret to use for authentication } |
Type |
Type |
ClickhouseS3BucketParams |
{ bucket_name: string; // The name of the S3 bucket. bucket_region: string; // The name of the S3 bucket region; aws_access_keys: AWSAccessKeys; // Required details for access key authentication. } |
ClickhouseGCSBucketParams
Type |
Type |
ClickhouseGCSBucketParams |
{ bucket_name: string; // The name of the GCS bucket. gcs_hmac_keys: GCSAccessKeys; // Required details for GCS HMAC key authentication. } |
Type |
Type |
RedshiftS3BucketParams |
{ bucket_name: string; // The name of the S3 bucket. bucket_region: string; // The name of the S3 bucket region; } |
Type |
Type |
RedshiftAccessKeys |
{ password: string; access_id: string; secret_key: string; } |
Type |
Type |
FileFormatCSV |
{ delimiter: string; // The delimiter to use for the CSV file. Must be a single character. } |
Type |
Type |
PasswordAuth |
{ username: string; // The username to use for authentication. password?: string; // The password to use for authentication. } |
Type |
Type |
AccessKeys |
{ access_id: string; // The access key ID to use for authentication. secret_key: string; // The secret key to use for authentication. } |
Type |
Type |
PublicKeyAuth |
{ public_key: string; // The public key to use for authentication. } |
Type |
Type |
AWSIAMRole |
{ aws_iam_role_arn: string; // The ARN of the IAM role to use for authentication. } |
Type |
Type |
AWSAccessKeys |
{ access_id: string; // The access key ID to use for authentication. secret_key: string; // The secret key to use for authentication. } |
Type |
Type |
GCPServiceAccountRole |
{ service_account_email: string; // The email of the GCP service account to use for authentication. } |
FederatedGCPServiceAccountRole
Type |
Type |
FederatedGCPServiceAccountRole |
GCPServiceAccountRole and { workload_identity_federation_metadata?: GcpExternalAccountMetadata; // The federation metadata to use for authentication. } |
Type |
Type |
CredentialSource |
{ environment_id: string; region_url: string; url: string; regional_cred_verification_url: string; } |
GcpExternalAccountMetadata
Type |
Type |
GcpExternalAccountMetadata |
{ type: string; audience: string; subject_token_type: string; service_account_impersonation_url: string; token_url: string; credential_source: CredentialSource; } |
Type |
Type |
SSHTunnelOptions |
{ use_ssh_tunnel: boolean; // Whether to use an SSH tunnel for the connection. ssh_tunnel?: SSHTunnelParams; // Required details if using SSH tunneling. } |
Type |
Type |
SSHTunnelParams |
{ ssh_tunnel_host: string; // The hostname of the SSH tunnel server. ssh_tunnel_port: number; // The port of the SSH tunnel server. ssh_tunnel_username: string; // The username to use for the SSH tunnel connection. ssh_public_key?: string; // The public key to use for the SSH tunnel connection. } |
Type |
Type |
DestinationForm |
{ sections: Section[]; form: FormNode; } |
Type |
Type |
Section |
{ id: number; title: string; subtitle: string or null; } |
Type |
Type |
EnumObject |
{ key: string or boolean or number; display: string; docs?: string; icon_url?: string; disabled?: boolean; } |
Type |
Type |
KeyFormat |
ssh_rsa" or "pkcs8 |
Type |
Type |
FormNode |
{ parent: string or boolean; name: keyof Destination or "trust_policy" or "role" or "service_account"; required: boolean; type: "string" or "number" or "boolean" or "json"; enum?: EnumObject[]; const?: string or object; attributes: { section_id: number; internal: boolean; label: string; placeholder: string; description: string; form_element: "select" or "input" or "radio" or "textarea" or "div"; input_type?: "text" or "password" or "number"; key_format?: KeyFormat; }; children: FormNode[] or null; } |
Type |
Type |
FormField |
{ readonly prepared_destination_path: string; name: keyof Destination; required: boolean; type: "string" or "number" or "boolean" or "json"; label: string; description: string; placeholder: string; section_id: number; internal: boolean; const?: string or object; } and ( or { form_element: "input"; input_type: "text" or "password" or "number"; } or { form_element: "textarea"; } or { form_element: "radio"; enum: EnumObject[]; } or { form_element: "select"; enum?: EnumObject[]; } or { form_element: "div"; } ) |
Type |
Type |
FormSection |
{ id: number; title: string; subtitle: string or null; fields: FormField[]; } |
Type |
Type |
Form |
FormSection[] |
Type |
Type |
SSHPublicKey |
{ [K in KeyFormat]: string; } |
Type |
Type |
ModelConfigColumn |
{ data_type: string; is_last_modified: boolean; is_primary_key: boolean; name_in_destination: string; name_in_source: string; description: string; } |
Type |
Type |
ModelConfig |
{ model_name: string; columns: ModelConfigColumn[]; source_table: string; source_schema: string; description: string; organization_column: string; source_name?: string; } |
Type |
Type |
ProductConfig |
{ product_name: string; models: string[]; } |
PaginationCursor
Type |
Type |
PaginationCursor |
{ lastSeenID: string; lastSeenSortValue: string; } |
Type |
Type |
ListResourceParameters |
{ pageSize?: number; cursor?: PaginationCursor; } |
Type |
Type |
FetchAuthToken |
() => Promise<string> |
FetchAuthTokenWithPreparedDestination
Type |
Type |
FetchAuthTokenWithPreparedDestination |
( d: PreparedDestination ) => Promise<string> |
FetchAuthTokenWithExistingDestination
Type |
Type |
FetchAuthTokenWithExistingDestination |
( d: ExistingDestination ) => Promise<string> |
CreateOrUpdateDestinationAPIResponse
Type |
Type |
CreateOrUpdateDestinationAPIResponse |
APIResponse<{ destination: ExistingDestination; }> |
DeleteDestinationAPIResponse
Type |
Type |
DeleteDestinationAPIResponse |
APIResponse<{}> |
Type |
Type |
GetDestinationsResponse |
ExistingDestination[] |
Type |
Type |
GetTransfersResponse |
Transfer[] |
Type |
Type |
ListResponse |
{ results: T[]; hasNext: boolean; cursor: PaginationCursor or undefined; } |
Type |
Type |
ModelsResponse |
ModelConfig[] or undefined |
Type |
Type |
ProductsResponse |
ProductConfig[] or undefined |
DestinationVendorsResponse
Type |
Type |
DestinationVendorsResponse |
EnumObject[] or undefined |
Type |
Type |
TestConnectionResponse |
{ status: string } |
Type |
Type |
APIResponse |
{ status: "success" or "error"; data: T or null; message: string; has_next?: boolean; next_url?: string; } |
GetDestinationsAPIResponse
Type |
Type |
GetDestinationsAPIResponse |
APIResponse< { destinations: GetDestinationsResponse } or undefined > |
GetModelsForRecipientAPIResponse
Type |
Type |
GetModelsForRecipientAPIResponse |
APIResponse< { models: ModelConfig[] } or undefined > |
GetDestinationFormAPIResponse
Type |
Type |
GetDestinationFormAPIResponse |
APIResponse<DestinationForm> |
GenerateSSHKeyAPIResponse
Type |
Type |
GenerateSSHKeyAPIResponse |
APIResponse< { public_key: string; public_key_pkcs8: string } or undefined > |
GetDestinationVendorsAPIResponse
Type |
Type |
GetDestinationVendorsAPIResponse |
APIResponse< EnumObject[] or undefined > |
Type |
Type |
GetTransfersAPIResponse |
APIResponse< { transfers: Transfer[] } or undefined > |
Type |
Type |
ListTransfersAPIResponse |
APIResponse< { transfers: GetTransfersResponse } or undefined > |
TestConnectionAPIResponse
Type |
Type |
TestConnectionAPIResponse |
APIResponse<TestConnectionResponse> |
Type |
Type |
GetModelsAPIResponse |
{ models: ModelConfig[] } |
Type |
Type |
GetProductsAPIResponse |
{ products: ProductConfig[] } |
Type |
Type |
IamRole |
{ id: string; name?: string; federated_id?: string; region?: string; } |
Type |
Type |
AwsPolicyStatement |
{ Effect: string; Action: string[]; Principal: { [key: string]: string; }; Condition?: { [key: string]: { [key: string]: string; }; }; } |
Type |
Type |
AwsTrustPolicy |
{ Version: string; Statement: AwsPolicyStatement[]; } |
UseDestinationFormOptions
Type |
Type |
UseDestinationFormOptions |
{ includeInternalFields?: boolean; host?: string; vendorQuery?: string; } |
Type |
Type |
GetTransfersParams |
{ count?: number; status?: TransferStatus; } |