@elastic.io/component-commons-library
Version:
Library for most common component development cases
159 lines (158 loc) • 5.36 kB
TypeScript
import { PlatformApiRestClient } from './PlatformApiRestClient';
interface AllFlowsForWorkspaceOptions {
objectsPerPage?: number;
parallelCalls?: number;
workspaceId?: string;
}
interface WorkspaceListOptions {
objectsPerPage?: number;
parallelCalls?: number;
}
export declare class PlatformApiLogicClient extends PlatformApiRestClient {
workspaceList: any;
makeRequest: any;
emitter: any;
/**
* Fetch all flows for a given workspace
* @param {string} options.workspaceId Id of the workspace to search
* @returns {Promise<[]>} An array of flows
*/
fetchAllFlowsForWorkspace(options?: AllFlowsForWorkspaceOptions): Promise<any[]>;
/**
* Fetch all credentials for a given workspace
* @param {string} options.workspaceId
* @returns {Promise<[{{
* credentialId: string,
* credentialName: string,
* componentId: string,
* }}]>}
*/
fetchAllCredentialsForWorkspace(options?: any): Promise<any>;
/**
* Fetch all credentials for a given workspace
* @param {string} options.workspaceId
* @returns {Promise<[{{
* secretId: string,
* secretName: string,
* componentIds: string[],
* }}]>}
*/
fetchAllSecretsForWorkspace(options?: any): Promise<any>;
/**
* Fetch secret by id for a given workspace
* @param {string} options.secretId
* @returns {Promise<{
* id: string,
* type: string,
* links: object,
* attributes: object,
* relationships: object,
* }>}
*/
fetchSecretById(options?: any): Promise<any>;
/**
* Refresh token by secret id for a given workspace
* @param {string} options.secretId
* @returns {Promise<{
* id: string,
* type: string,
* links: object,
* attributes: object,
* relationships: object,
* }>}
*/
refreshTokenBySecretId(options?: any): Promise<any>;
/**
* Fetch All Components Accessible From a Given Workspace
* @param {string} options.contractId Contract ID
* @returns {Promise<[{{
* componentId: string,
* componentName: string,
* componentDevTeam: string
* }}]>}
*/
fetchComponentsAccessibleFromContract(options?: any): Promise<any>;
splitParallelization(maxParallelization: any, splitFactor: any): {
realSplitFactor: number;
parallelizationPerTask: number;
};
/**
* Fetches a list of flows
* @param.workspaceId {string} Optional Workspace ID to limit results
* @returns {Promise<[{{
* flowDetails: object,
* flowId: string,
* flowName: string,
* workspaceId: string,
* workspaceName: string,
* contractId: string,
* contractName: string,
* contractDetails: object,
* workspaceDetails: object
* }}]>}
*/
fetchFlowList(options?: any): Promise<any>;
/**
* Fetch a list of all workspaces across all contracts for a user
* @param options
* @returns {Promise<[{{
* workspaceId: string,
* workspaceName: string,
* contractId: string,
* contractName: string,
* contractDetails: object,
* workspaceDetails: object
* }}]>}
*/
fetchWorkspaceList(options?: WorkspaceListOptions): Promise<any>;
/**
* Given a set of unique criteria, find the workspace that matches
* @param {{
* value: {}
* }} workspaceUniqueCriteria
* @returns {Promise<{{
* workspaceId: string,
* workspaceName: string,
* contractId: string,
* contractName: string,
* contractDetails: object,
* workspaceDetails: object
* }}>}
*/
fetchWorkspaceId(workspaceUniqueCriteria: any): Promise<any>;
/**
* Given a flow, remove the properties of the flow that are regularly changed
* by the system such as last executed time
* @param {{}} flow
* @param {boolean} Should keep data samples in returned object
* @returns {{}} A copy of the flow with these properties removed
*/
removeNonWritableProperties(flow: any, includeDataSamples: any): any;
/**
* Given a set of unique criteria for a flow, find the corresponding flow
* TODO: Below implementation is correct but can be made more efficient for some cases
* @param {{
* value: {}
* }} Criteria which uniquely describes a flow
* @returns {Promise<null|{{}}>} Returns null if there are no matches.
* Otherwise returns the content of the flow.
*/
fetchFlowId(flowUniqueCriteria: any): Promise<any>;
fetchFlowById(id: any): Promise<any>;
fetchFlowByNameAndWorkspaceId(flowName: any, workspaceId: any): Promise<any>;
/**
* Given a flow, change the flow to a given state (running, stopped, etc)
* and wait for that change to take effect
* @param {{
* action: string,
* desiredStatus: string,
* flowId: string
* }} - Info for the request
* @returns {Promise<>}
*/
changeFlowState(options?: any): Promise<void>;
startFlow(flowId: any, options?: {}): Promise<void>;
stopFlow(flowId: any, options?: {}): Promise<void>;
hydrateFlow(options?: any): Promise<any>;
}
export {};