Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export function validUploadType(type: string): type is UploadType {

export type Direction = 'all' | 'incoming' | 'outgoing';

export interface OptionsSpec {
axiosRequestConfig?: AxiosRequestConfig;
}

export interface TablesOptionsSpec {
type?: TableType;
}
Expand All @@ -75,7 +79,7 @@ export type EdgesOptionsSpec = OffsetLimitSpec & {
direction?: Direction;
};

export interface FileUploadOptionsSpec {
export interface FileUploadOptionsSpec extends OptionsSpec {
type: UploadType;
data: string | File;
key?: string;
Expand Down Expand Up @@ -177,8 +181,9 @@ class MultinetAPI {
}

public async uploadTable(
workspace: string, table: string, options: FileUploadOptionsSpec, config?: AxiosRequestConfig
workspace: string, table: string, options: FileUploadOptionsSpec
): Promise<Array<{}>> {
const config = options.axiosRequestConfig;
const headers = config ? config.headers : undefined;
const params = config ? config.params : undefined;
const { type, data, key, overwrite } = options;
Expand Down