@prequel/react
v1.1.0
Published
React hooks and components for adding Prequel to your app.
Downloads
1,825
Keywords
Readme
Prequel React SDK
Collection of React hooks for building your self-service data warehouse syncing feature in your webapp. See our documentation for usage and examples.
Functions
- getDefaultAuthMethod
- getDefaultBucketVendor
- getDefaultMetastore
- getDefaultDestination
- getDefaultExistingDestination
- encodeCursor
- decodeCursor
- prepareDestinationWithForm
- parseServiceAccountKey
- parseGcpIamRoleMetadata
- prepareDestinationFromExisting
- computeChangedFields
- useDestination
- useDestinationForm
- useGetDestinations
- useGetModelsForRecipient
- useListTransfers
- useFetchResource
- useModels
- useProducts
- useDestinationVendors
- useTestConnection
- useTestExistingConnection
- useUpdateDestination
getDefaultAuthMethod
| Function | Type |
| ---------- | ---------- |
| getDefaultAuthMethod
| (vendor: string) => AuthMethod
|
getDefaultBucketVendor
| Function | Type |
| ---------- | ---------- |
| getDefaultBucketVendor
| (vendor: string) => BucketVendor or undefined
|
getDefaultMetastore
| Function | Type |
| ---------- | ---------- |
| getDefaultMetastore
| (vendor: string) => Metastore or undefined
|
getDefaultDestination
| 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; ... 50 more ...; connection_timeout_in_seconds?: 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; }
|
encodeCursor
| Function | Type |
| ---------- | ---------- |
| encodeCursor
| (c: PaginationCursor) => string
|
decodeCursor
| 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.
parseServiceAccountKey
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.
parseGcpIamRoleMetadata
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.
computeChangedFields
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.
useDestination
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.
useDestinationForm
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.
useGetDestinations
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.
useGetModelsForRecipient
| Function | Type |
| ---------- | ---------- |
| useGetModelsForRecipient
| (fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => () => Promise<ModelsResponse>
|
useListTransfers
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.
useFetchResource
| Function | Type |
| ---------- | ---------- |
| useFetchResource
| <T>(fetchToken: FetchAuthToken, origin: string, url: string) => APIResponse<T> or undefined
|
useModels
| Function | Type |
| ---------- | ---------- |
| useModels
| (fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => ModelsResponse
|
useProducts
| Function | Type |
| ---------- | ---------- |
| useProducts
| (fetchToken: FetchAuthToken, origin: string, host?: string or undefined) => ProductsResponse
|
useDestinationVendors
| Function | Type |
| ---------- | ---------- |
| useDestinationVendors
| (host?: string or undefined) => DestinationVendorsResponse
|
useTestConnection
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.
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.
useUpdateDestination
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.
Constants
- PAGE_SIZE_SEARCH_PARAM
- CURSOR_SEARCH_PARAM
- HOST_PLACEHOLDER
- ID_PLACEHOLDER
- PREQUEL_US
- PREQUEL_EU
- SCOPED_AUTH_HEADER_KEY
- PREQUEL_API_VERSION_HEADER
- PREQUEL_API_VERSION_2023_12_01
- TOP_LEVEL_DESTINATION_FIELDS
- BUCKET_AUTH_FIELD_PARENT
PAGE_SIZE_SEARCH_PARAM
| Constant | Type |
| ---------- | ---------- |
| PAGE_SIZE_SEARCH_PARAM
| "page_size"
|
CURSOR_SEARCH_PARAM
| Constant | Type |
| ---------- | ---------- |
| CURSOR_SEARCH_PARAM
| "cursor"
|
HOST_PLACEHOLDER
| Constant | Type |
| ---------- | ---------- |
| HOST_PLACEHOLDER
| "{{host}}"
|
ID_PLACEHOLDER
| Constant | Type |
| ---------- | ---------- |
| ID_PLACEHOLDER
| "{{id_in_provider_system}}"
|
PREQUEL_US
| Constant | Type |
| ---------- | ---------- |
| PREQUEL_US
| "https://api.prequel.co"
|
PREQUEL_EU
| 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[]
|
BUCKET_AUTH_FIELD_PARENT
| Constant | Type |
| ---------- | ---------- |
| BUCKET_AUTH_FIELD_PARENT
| { access_id: string; secret_key: string; secret: string; access_key: string; }
|
Enum
TransferStatus
| Property | Type | Description |
| ---------- | ---------- | ---------- |
| CANCELLED
| "CANCELLED"
| |
| ERROR
| "ERROR"
| |
| EXPIRED
| "EXPIRED"
| |
| PARTIAL_FAILURE
| "PARTIAL_FAILURE"
| |
| PENDING
| "PENDING"
| |
| RUNNING
| "RUNNING"
| |
| SUCCESS
| "SUCCESS"
| |
| ORPHANED
| "ORPHANED"
| |
DestinationType
| Property | Type | Description |
| ---------- | ---------- | ---------- |
| Destination
| | |
| `PreparedDestination` |
| |
| ExistingDestination
| `` | |
Types
- AzureServiceSharedAccessSignature
- ABSDestinationOptions
- AthenaDestinationOptions
- TransferError
- TransferModelMetrics
- Transfer
- MySQLDestinationOptions
- PostgresDestinationOptions
- BigQueryDestinationOptions
- ClickhouseDestinationOptions
- DatabricksDestinationOptions
- DatabricksAccessToken
- DatabricksHiveOptions
- DatabricksS3BucketParams
- GCSDestinationOptions
- MongoDBDestinationOptions
- RedshiftDestinationOptions
- RedshiftServerlessDestinationOptions
- SFTPDestinationOptions
- SnowflakeDestinationOptions
- S3DestinationOptions
- S3CompatibleDestinationOptions
- GoogleSheetsDestinationOptions
- OracleSSLOptions
- OracleDestinationOptions
- AuthMethod
- Metastore
- BucketAuthMethod
- BucketVendor
- FileFormat
- FrequencyMinutes
- Destination
- PreparedDestination
- ExistingDestination
- ServiceAccountKey
- GCPServiceAccountKey
- S3BucketParams
- GCSBucketParams
- BigQueryGCSBucketParams
- GCSAccessKeys
- ClickhouseS3BucketParams
- ClickhouseGCSBucketParams
- RedshiftS3BucketParams
- RedshiftAccessKeys
- FileFormatCSV
- PasswordAuth
- AccessKeys
- PublicKeyAuth
- AWSIAMRole
- AWSAccessKeys
- GCPServiceAccountRole
- FederatedGCPServiceAccountRole
- CredentialSource
- GcpExternalAccountMetadata
- SSHTunnelOptions
- SSHTunnelParams
- DestinationForm
- Section
- EnumObject
- KeyFormat
- FormNode
- FormField
- FormSection
- Form
- SSHPublicKey
- ModelConfigColumn
- ModelConfig
- ProductConfig
- PaginationCursor
- ListResourceParameters
- FetchAuthToken
- FetchAuthTokenWithPreparedDestination
- FetchAuthTokenWithExistingDestination
- CreateOrUpdateDestinationAPIResponse
- DeleteDestinationAPIResponse
- GetDestinationsResponse
- GetTransfersResponse
- ListResponse
- ModelsResponse
- ProductsResponse
- DestinationVendorsResponse
- TestConnectionResponse
- APIResponse
- GetDestinationsAPIResponse
- GetModelsForRecipientAPIResponse
- GetDestinationFormAPIResponse
- GenerateSSHKeyAPIResponse
- GetDestinationVendorsAPIResponse
- GetTransfersAPIResponse
- ListTransfersAPIResponse
- TestConnectionAPIResponse
- GetModelsAPIResponse
- GetProductsAPIResponse
- IamRole
- AwsPolicyStatement
- AwsTrustPolicy
- UseDestinationFormOptions
AzureServiceSharedAccessSignature
| Type | Type |
| ---------- | ---------- |
| AzureServiceSharedAccessSignature
| { shared_access_signature_token: string; // The shared access signature token to use for authentication. }
|
ABSDestinationOptions
| 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; }
|
AthenaDestinationOptions
| 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; }
|
TransferError
| Type | Type |
| ---------- | ---------- |
| TransferError
| { readonly error_code: string; readonly title: string; readonly blame: string; readonly documentation_url: string; readonly trace: string; readonly message: string; }
|
TransferModelMetrics
| 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; }
|
Transfer
| 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; }
|
MySQLDestinationOptions
| 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. }
|
DatabricksAccessToken
| Type | Type |
| ---------- | ---------- |
| DatabricksAccessToken
| { access_token: string; // The access token to use for the Databricks connection. }
|
DatabricksHiveOptions
| 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. }
|
DatabricksS3BucketParams
| 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. }
|
GCSDestinationOptions
| 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. }
|
SFTPDestinationOptions
| 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. }
|
S3DestinationOptions
| 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. }
|
OracleSSLOptions
| Type | Type |
| ---------- | ---------- |
| OracleSSLOptions
| { wallet?: string; }
|
OracleDestinationOptions
| 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
|
AuthMethod
| Type | Type |
| ---------- | ---------- |
| AuthMethod
| | "password_auth" or "gcp_service_account_role" or "gcp_service_account_key" or "federated_gcp_service_account_role" or "aws_iam_role" or "aws_access_keys" or "azure_service_shared_access_signature" or "gcs_hmac_keys" or "access_keys" or "access_token_auth" or "public_key_auth
|
Metastore
| Type | Type |
| ---------- | ---------- |
| Metastore
| hive" or "unity_catalog
|
BucketAuthMethod
| Type | Type |
| ---------- | ---------- |
| BucketAuthMethod
| | "aws_iam_role" or "aws_access_keys" or "gcs_hmac_keys
|
BucketVendor
| Type | Type |
| ---------- | ---------- |
| BucketVendor
| bucket_s3" or "bucket_gcs" or "bucket_implicit
|
FileFormat
| Type | Type |
| ---------- | ---------- |
| FileFormat
| csv
|
FrequencyMinutes
| Type | Type |
| ---------- | ---------- |
| FrequencyMinutes
| 0 or 15 or 60 or 360 or 720 or 1440
|
Destination
| 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; 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; }
|
PreparedDestination
| 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; }
|
ExistingDestination
| 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; }
|
ServiceAccountKey
| 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; }
|
GCPServiceAccountKey
| 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. }
|
S3BucketParams
| Type | Type |
| ---------- | ---------- |
| S3BucketParams
| { bucket_name: string; // The name of the S3 bucket. bucket_region: string; // The name of the S3 bucket region. }
|
GCSBucketParams
| Type | Type |
| ---------- | ---------- |
| GCSBucketParams
| { bucket_name: string; // The name of the GCS bucket. }
|
BigQueryGCSBucketParams
| Type | Type |
| ---------- | ---------- |
| BigQueryGCSBucketParams
| { bucket_name: string; // The name of the GCS bucket. bucket_region: string; // The name of the GCS bucket region; }
|
GCSAccessKeys
| Type | Type |
| ---------- | ---------- |
| GCSAccessKeys
| { access_key: string; // The access key to use for authentication secret: string; // The secret to use for authentication }
|
ClickhouseS3BucketParams
| 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. }
|
RedshiftS3BucketParams
| Type | Type |
| ---------- | ---------- |
| RedshiftS3BucketParams
| { bucket_name: string; // The name of the S3 bucket. bucket_region: string; // The name of the S3 bucket region; }
|
RedshiftAccessKeys
| Type | Type |
| ---------- | ---------- |
| RedshiftAccessKeys
| { password: string; access_id: string; secret_key: string; }
|
FileFormatCSV
| Type | Type |
| ---------- | ---------- |
| FileFormatCSV
| { delimiter: string; // The delimiter to use for the CSV file. Must be a single character. }
|
PasswordAuth
| Type | Type |
| ---------- | ---------- |
| PasswordAuth
| { username: string; // The username to use for authentication. password?: string; // The password to use for authentication. }
|
AccessKeys
| Type | Type |
| ---------- | ---------- |
| AccessKeys
| { access_id: string; // The access key ID to use for authentication. secret_key: string; // The secret key to use for authentication. }
|
PublicKeyAuth
| Type | Type |
| ---------- | ---------- |
| PublicKeyAuth
| { public_key: string; // The public key to use for authentication. }
|
AWSIAMRole
| Type | Type |
| ---------- | ---------- |
| AWSIAMRole
| { aws_iam_role_arn: string; // The ARN of the IAM role to use for authentication. }
|
AWSAccessKeys
| Type | Type |
| ---------- | ---------- |
| AWSAccessKeys
| { access_id: string; // The access key ID to use for authentication. secret_key: string; // The secret key to use for authentication. }
|
GCPServiceAccountRole
| 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. }
|
CredentialSource
| 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; }
|
SSHTunnelOptions
| 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. }
|
SSHTunnelParams
| 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. }
|
DestinationForm
| Type | Type |
| ---------- | ---------- |
| DestinationForm
| { sections: Section[]; form: FormNode; }
|
Section
| Type | Type |
| ---------- | ---------- |
| Section
| { id: number; title: string; subtitle: string or null; }
|
EnumObject
| Type | Type |
| ---------- | ---------- |
| EnumObject
| { key: string or boolean or number; display: string; docs?: string; icon_url?: string; disabled?: boolean; }
|
KeyFormat
| Type | Type |
| ---------- | ---------- |
| KeyFormat
| ssh_rsa" or "pkcs8
|
FormNode
| 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; }
|
FormField
| 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"; } )
|
FormSection
| Type | Type |
| ---------- | ---------- |
| FormSection
| { id: number; title: string; subtitle: string or null; fields: FormField[]; }
|
Form
| Type | Type |
| ---------- | ---------- |
| Form
| FormSection[]
|
SSHPublicKey
| Type | Type |
| ---------- | ---------- |
| SSHPublicKey
| { [K in KeyFormat]: string; }
|
ModelConfigColumn
| Type | Type |
| ---------- | ---------- |
| ModelConfigColumn
| { data_type: string; is_last_modified: boolean; is_primary_key: boolean; name_in_destination: string; name_in_source: string; description: string; }
|
ModelConfig
| Type | Type |
| ---------- | ---------- |
| ModelConfig
| { model_name: string; columns: ModelConfigColumn[]; source_table: string; source_schema: string; description: string; organization_column: string; source_name?: string; }
|
ProductConfig
| Type | Type |
| ---------- | ---------- |
| ProductConfig
| { product_name: string; models: string[]; }
|
PaginationCursor
| Type | Type |
| ---------- | ---------- |
| PaginationCursor
| { lastSeenID: string; lastSeenSortValue: string; }
|
ListResourceParameters
| Type | Type |
| ---------- | ---------- |
| ListResourceParameters
| { pageSize?: number; cursor?: PaginationCursor; }
|
FetchAuthToken
| 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<{}>
|
GetDestinationsResponse
| Type | Type |
| ---------- | ---------- |
| GetDestinationsResponse
| ExistingDestination[]
|
GetTransfersResponse
| Type | Type |
| ---------- | ---------- |
| GetTransfersResponse
| Transfer[]
|
ListResponse
| Type | Type |
| ---------- | ---------- |
| ListResponse
| { results: T[]; hasNext: boolean; cursor: PaginationCursor or undefined; }
|
ModelsResponse
| Type | Type |
| ---------- | ---------- |
| ModelsResponse
| ModelConfig[] or undefined
|
ProductsResponse
| Type | Type |
| ---------- | ---------- |
| ProductsResponse
| ProductConfig[] or undefined
|
DestinationVendorsResponse
| Type | Type |
| ---------- | ---------- |
| DestinationVendorsResponse
| EnumObject[] or undefined
|
TestConnectionResponse
| Type | Type |
| ---------- | ---------- |
| TestConnectionResponse
| { status: string }
|
APIResponse
| 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 >
|
GetTransfersAPIResponse
| Type | Type |
| ---------- | ---------- |
| GetTransfersAPIResponse
| APIResponse< { transfers: Transfer[] } or undefined >
|
ListTransfersAPIResponse
| Type | Type |
| ---------- | ---------- |
| ListTransfersAPIResponse
| APIResponse< { transfers: GetTransfersResponse } or undefined >
|
TestConnectionAPIResponse
| Type | Type |
| ---------- | ---------- |
| TestConnectionAPIResponse
| APIResponse<TestConnectionResponse>
|
GetModelsAPIResponse
| Type | Type |
| ---------- | ---------- |
| GetModelsAPIResponse
| { models: ModelConfig[] }
|
GetProductsAPIResponse
| Type | Type |
| ---------- | ---------- |
| GetProductsAPIResponse
| { products: ProductConfig[] }
|
IamRole
| Type | Type |
| ---------- | ---------- |
| IamRole
| { id: string; name?: string; federated_id?: string; region?: string; }
|
AwsPolicyStatement
| Type | Type |
| ---------- | ---------- |
| AwsPolicyStatement
| { Effect: string; Action: string[]; Principal: { [key: string]: string; }; Condition?: { [key: string]: { [key: string]: string; }; }; }
|
AwsTrustPolicy
| Type | Type |
| ---------- | ---------- |
| AwsTrustPolicy
| { Version: string; Statement: AwsPolicyStatement[]; }
|
UseDestinationFormOptions
| Type | Type |
| ---------- | ---------- |
| UseDestinationFormOptions
| { includeInternalFields?: boolean; host?: string; vendorQuery?: string; }
|