@integration-app/sdk
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -684,3 +684,3 @@ (function (global, factory) { | ||
console.error('It takes too long for Integration UI to load. Something must be wrong.'); | ||
close(); | ||
close(callbacks.onClose); | ||
}, 5000); | ||
@@ -700,3 +700,3 @@ function handshake() { | ||
iframe, | ||
methods: Object.assign(Object.assign({}, callbacks), { close, handshake }), | ||
methods: Object.assign(Object.assign({}, callbacks), { close: () => close(callbacks.onClose), handshake }), | ||
}); | ||
@@ -720,3 +720,3 @@ } | ||
exports.openIframe = openIframe; | ||
function close() { | ||
function close(callback) { | ||
document.body.classList.remove(BODY_CLASS); | ||
@@ -729,2 +729,5 @@ const container = document.getElementById(CONTAINER_ELEMENT_ID); | ||
} | ||
if (callback) { | ||
callback(); | ||
} | ||
} | ||
@@ -796,2 +799,3 @@ clearHandshakeTimeout(); | ||
onData: options.onData, | ||
onClose: options.onClose, | ||
}); | ||
@@ -805,3 +809,6 @@ } | ||
}); | ||
iframe.openIframe(uri); | ||
iframe.openIframe(uri, { | ||
onFlowRunComplete: options.onFlowRunComplete, | ||
onClose: options.onClose, | ||
}); | ||
} | ||
@@ -808,0 +815,0 @@ exports.openNewFlow = openNewFlow; |
@@ -36,3 +36,3 @@ "use strict"; | ||
console.error('It takes too long for Integration UI to load. Something must be wrong.'); | ||
close(); | ||
close(callbacks.onClose); | ||
}, 5000); | ||
@@ -52,3 +52,3 @@ function handshake() { | ||
iframe, | ||
methods: Object.assign(Object.assign({}, callbacks), { close, handshake }), | ||
methods: Object.assign(Object.assign({}, callbacks), { close: () => close(callbacks.onClose), handshake }), | ||
}); | ||
@@ -72,3 +72,3 @@ } | ||
exports.openIframe = openIframe; | ||
function close() { | ||
function close(callback) { | ||
document.body.classList.remove(BODY_CLASS); | ||
@@ -81,2 +81,5 @@ const container = document.getElementById(CONTAINER_ELEMENT_ID); | ||
} | ||
if (callback) { | ||
callback(); | ||
} | ||
} | ||
@@ -83,0 +86,0 @@ clearHandshakeTimeout(); |
@@ -12,2 +12,3 @@ export declare function init(options: InitOptions): void; | ||
onData: (...args: any) => void; | ||
onClose: (...args: any) => void; | ||
} | ||
@@ -17,3 +18,5 @@ interface NewFlowOptions extends InitOptions { | ||
flowConfig: any; | ||
onFlowRunComplete: (...args: any) => void; | ||
onClose: (...args: any) => void; | ||
} | ||
export {}; |
@@ -25,2 +25,3 @@ "use strict"; | ||
onData: options.onData, | ||
onClose: options.onClose, | ||
}); | ||
@@ -34,3 +35,6 @@ } | ||
}); | ||
iframe_1.openIframe(uri); | ||
iframe_1.openIframe(uri, { | ||
onFlowRunComplete: options.onFlowRunComplete, | ||
onClose: options.onClose, | ||
}); | ||
} | ||
@@ -37,0 +41,0 @@ exports.openNewFlow = openNewFlow; |
{ | ||
"name": "@integration-app/sdk", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "JavaScript SDK for Integration.app", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -33,3 +33,3 @@ import { connectToChild } from 'penpal' | ||
) | ||
close() | ||
close(callbacks.onClose) | ||
}, 5000) | ||
@@ -51,3 +51,7 @@ | ||
iframe, | ||
methods: { ...callbacks, close, handshake }, | ||
methods: { | ||
...callbacks, | ||
close: () => close(callbacks.onClose), | ||
handshake, | ||
}, | ||
}) | ||
@@ -73,3 +77,3 @@ } else { | ||
function close() { | ||
function close(callback?: (...args: any) => void) { | ||
document.body.classList.remove(BODY_CLASS) | ||
@@ -82,2 +86,5 @@ const container = document.getElementById(CONTAINER_ELEMENT_ID) | ||
} | ||
if (callback) { | ||
callback() | ||
} | ||
} | ||
@@ -84,0 +91,0 @@ clearHandshakeTimeout() |
@@ -24,2 +24,3 @@ import { openIframe } from './iframe' | ||
onData: options.onData, | ||
onClose: options.onClose, | ||
}) | ||
@@ -33,3 +34,6 @@ } | ||
}) | ||
openIframe(uri) | ||
openIframe(uri, { | ||
onFlowRunComplete: options.onFlowRunComplete, | ||
onClose: options.onClose, | ||
}) | ||
} | ||
@@ -72,2 +76,3 @@ | ||
onData: (...args: any) => void | ||
onClose: (...args: any) => void | ||
} | ||
@@ -78,2 +83,4 @@ | ||
flowConfig: any | ||
onFlowRunComplete: (...args: any) => void | ||
onClose: (...args: any) => void | ||
} |
Sorry, the diff of this file is not supported yet
166507
1367