@tableau/taco-toolkit
Version:
Tableau Connector Toolkit
66 lines (65 loc) • 2.86 kB
TypeScript
import * as ajax from '../../shared/app-transport/ajax';
import { OAuthCredentials } from '../../shared/auth-credentials';
import { HandlerInput } from '../../shared/types/handler-input';
import { SecretsType } from '../../shared/types/secrets-type';
import { ConnectorRequestOptions } from './connector-types';
/**
* The Connector class is a facade class used to talk with the eps main server.
*/
export declare class Connector {
private onInitSuccess;
private onInitFailure;
appSnapshot?: object;
/**
* Property to set an array of {@link HandlerInput} instances to be transmitted to connector handlers from the connector app.
*
* Don’t transmit sensitive information through `handlerInputs` because it could be susceptible to logging and internal storage.
*/
handlerInputs?: HandlerInput[];
/**
* Property is used to transmit sensitive information to connector handlers from the connector app.
*
* In Tableau apps, Secrets are excluded from storage within saved workbooks. Secrets are securely retained in Tableau Server’s keychain.
*/
secrets: SecretsType | undefined;
private options?;
private isInsideIframe;
private isInitialized;
private readonly initTimeout;
private permission;
constructor(onInitSuccess?: (connector: Connector) => void, onInitFailure?: (connector: Connector, err: Error) => void);
private initialize;
private initComplete;
/**
* Send a GET request.
*
* By default, it sends the request directly to the endpoint.
* When requestOptions.bypassCorsPolicy is set, the request will be forwarded
* to EPS. This can be used when a server has certain CORS policy. When EPS
* receives the forwarded request, it will validate the connector's permission
* settings defined in the connector.json.
*
* The function also validates the connector's permission settings on the
* client.
*/
get(url: string, requestOptions?: ConnectorRequestOptions): Promise<ajax.AjaxResponse>;
/**
* Send a POST request.
*
* By default, it sends the request directly to the endpoint.
* When requestOptions.bypassCorsPolicy is set, the request will be forwarded
* to EPS. This can be used when a server has certain CORS policy. When EPS
* receives the forwarded request, it will validate the connector's permission
* settings defined in the connector.json.
*
* The function also validates the connector's permission settings on the
* client.
*/
post(url: string, body?: object, requestOptions?: ConnectorRequestOptions): Promise<ajax.AjaxResponse>;
private getIframeMessage;
submit(): Promise<void>;
private validateApiPermission;
private forwardRequest;
cancel(): void;
get oAuthCredentials(): OAuthCredentials;
}