UNPKG

@tableau/taco-toolkit

Version:
49 lines (48 loc) 1.92 kB
import { ColumnHeader } from '../types/column-header'; import { ExtractorHealth } from './extractor-health'; import { TableManager } from './table-manager'; export default class ExtractorApi { private readonly callerId; private readonly epsInstanceId; private readonly extractorId; private readonly connectionId; private readonly tableManager; private app; constructor(callerId: string, epsInstanceId: string, extractorId: string, connectionId: string, health: ExtractorHealth, tableManager: TableManager); interceptRequests(health: ExtractorHealth): void; createGetTables(): void; /** /tables/<name>/metadata?sort=original returns the original order of the columns from the source. /tables/<name>/metadata sorts column by id to work with a monolith dependency on sorted columns. */ createGetMetadata(): void; createGetRows(): void; /** * Endpoint: /tables/:tablename/datarows?offset=500&limit=2 // default offset: 0, limit: 100 * Successful response { “data”: [ [a1, b1, c1, ....], [a2, b2, c2, ....], ... ], “hasMoreRows”: false “offset”: 0 “limit”: 1000 } */ createGetDataRows(): void; createHasMoreRows(): void; createGetRowCount(): void; /** Starts extractor HTTP server */ start(port: number): Promise<void>; } /** * Sort the given column header array into unicode order. The sorted result is * the columns order that extractor API responses (when 'original' param is not present). * Tableau monolith expects EPS to send the column header in a particular order. * Based on the observation, sorting by unicode order works properly. * * Note the function mutates the original input array. */ export declare function sortColumnHeaderList(columns: ColumnHeader[]): void;