@integration-app/sdk
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -682,5 +682,3 @@ (function (global, factory) { | ||
close(); | ||
console.log('Setting handshake timeout'); | ||
handshakeTimeout = setTimeout(() => { | ||
console.log('Handhsake timeout expired'); | ||
console.error('It takes too long for Integration UI to load. Something must be wrong.'); | ||
@@ -774,5 +772,6 @@ close(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.openNewFlow = exports.init = void 0; | ||
exports.startImport = exports.init = void 0; | ||
const DEFAULT_UI_URI = 'https://ui.integration.app'; | ||
const IMPORT_BLUEPRINT_KEY = 'import-data-to-browser'; | ||
// Global values set in .init | ||
@@ -786,8 +785,8 @@ let appKey; | ||
exports.init = init; | ||
function openNewFlow(options) { | ||
function startImport(options) { | ||
const uri = getEmbedUri('flows/new', options, { | ||
blueprintKey: options.blueprintKey, | ||
flowConfig: options.flowConfig | ||
? JSON.stringify(options.flowConfig) | ||
: undefined, | ||
blueprintKey: IMPORT_BLUEPRINT_KEY, | ||
flowConfig: JSON.stringify({ | ||
schema: options.schema, | ||
}), | ||
}); | ||
@@ -798,3 +797,3 @@ iframe.openIframe(uri, { | ||
} | ||
exports.openNewFlow = openNewFlow; | ||
exports.startImport = startImport; | ||
function getEmbedUri(page, options, params) { | ||
@@ -822,3 +821,3 @@ const key = appKey || options.appKey; | ||
var index = unwrapExports(dist); | ||
var dist_1 = dist.openNewFlow; | ||
var dist_1 = dist.startImport; | ||
var dist_2 = dist.init; | ||
@@ -828,3 +827,3 @@ | ||
exports.init = dist_2; | ||
exports.openNewFlow = dist_1; | ||
exports.startImport = dist_1; | ||
@@ -831,0 +830,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -34,5 +34,3 @@ "use strict"; | ||
close(); | ||
console.log('Setting handshake timeout'); | ||
handshakeTimeout = setTimeout(() => { | ||
console.log('Handhsake timeout expired'); | ||
console.error('It takes too long for Integration UI to load. Something must be wrong.'); | ||
@@ -39,0 +37,0 @@ close(); |
export declare function init(options: InitOptions): void; | ||
export declare function openNewFlow(options: NewFlowUriOptions): void; | ||
export declare function startImport(options: NewImportOptions): void; | ||
interface InitOptions { | ||
@@ -8,7 +8,6 @@ uiUri?: string; | ||
} | ||
interface NewFlowUriOptions extends InitOptions { | ||
blueprintKey: string; | ||
flowConfig?: any; | ||
interface NewImportOptions extends InitOptions { | ||
schema: any; | ||
onData: (...args: any) => void; | ||
} | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.openNewFlow = exports.init = void 0; | ||
exports.startImport = exports.init = void 0; | ||
const iframe_1 = require("./iframe"); | ||
const DEFAULT_UI_URI = 'https://ui.integration.app'; | ||
const IMPORT_BLUEPRINT_KEY = 'import-data-to-browser'; | ||
// Global values set in .init | ||
@@ -15,8 +16,8 @@ let appKey; | ||
exports.init = init; | ||
function openNewFlow(options) { | ||
function startImport(options) { | ||
const uri = getEmbedUri('flows/new', options, { | ||
blueprintKey: options.blueprintKey, | ||
flowConfig: options.flowConfig | ||
? JSON.stringify(options.flowConfig) | ||
: undefined, | ||
blueprintKey: IMPORT_BLUEPRINT_KEY, | ||
flowConfig: JSON.stringify({ | ||
schema: options.schema, | ||
}), | ||
}); | ||
@@ -27,3 +28,3 @@ iframe_1.openIframe(uri, { | ||
} | ||
exports.openNewFlow = openNewFlow; | ||
exports.startImport = startImport; | ||
function getEmbedUri(page, options, params) { | ||
@@ -30,0 +31,0 @@ const key = appKey || options.appKey; |
{ | ||
"name": "@integration-app/sdk", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "JavaScript SDK for Integration.app", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import { openIframe } from './iframe' | ||
const DEFAULT_UI_URI = 'https://ui.integration.app' | ||
const IMPORT_BLUEPRINT_KEY = 'import-data-to-browser' | ||
@@ -14,8 +15,8 @@ // Global values set in .init | ||
export function openNewFlow(options: NewFlowUriOptions) { | ||
export function startImport(options: NewImportOptions) { | ||
const uri = getEmbedUri('flows/new', options, { | ||
blueprintKey: options.blueprintKey, | ||
flowConfig: options.flowConfig | ||
? JSON.stringify(options.flowConfig) | ||
: undefined, | ||
blueprintKey: IMPORT_BLUEPRINT_KEY, | ||
flowConfig: JSON.stringify({ | ||
schema: options.schema, | ||
}), | ||
}) | ||
@@ -59,6 +60,5 @@ openIframe(uri, { | ||
interface NewFlowUriOptions extends InitOptions { | ||
blueprintKey: string | ||
flowConfig?: any | ||
interface NewImportOptions extends InitOptions { | ||
schema: any | ||
onData: (...args: any) => void | ||
} |
Sorry, the diff of this file is not supported yet
163248
1302