mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
aba3c8ed86
* Plugin arg validation, prompt tag, and some changes needed * Version bumps
25 lines
849 B
JavaScript
25 lines
849 B
JavaScript
// @flow
|
|
import {exportHAR, exportJSON, importRaw, importUri} from '../../common/import';
|
|
|
|
export function init (): {'import': Object, 'export': Object} {
|
|
return {
|
|
'import': {
|
|
async uri (uri: string, options: {workspaceId?: string} = {}): Promise<void> {
|
|
await importUri(options.workspaceId || null, uri);
|
|
},
|
|
async raw (text: string, options: {workspaceId?: string} = {}): Promise<void> {
|
|
await importRaw(options.workspaceId || null, text);
|
|
}
|
|
},
|
|
'export': {
|
|
async insomnia (options: {includePrivate?: boolean} = {}): Promise<string> {
|
|
options = options || {};
|
|
return exportJSON(null, options.includePrivate);
|
|
},
|
|
async har (options: {includePrivate?: boolean} = {}): Promise<string> {
|
|
return exportHAR(null, options.includePrivate);
|
|
}
|
|
}
|
|
};
|
|
}
|