@membranehq/sdk 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +5 -6
- package/dist/bundle.js.map +1 -1
- package/dist/config.d.mts +38 -0
- package/dist/config.d.ts +38 -0
- package/dist/config.js +215 -0
- package/dist/config.js.map +1 -0
- package/dist/config.mjs +187 -0
- package/dist/config.mjs.map +1 -0
- package/dist/dts/accessors/connections-accessors.d.ts +0 -1
- package/dist/dts/accessors/connections-accessors.test.d.ts +1 -0
- package/dist/dts/index.node.d.ts +0 -1
- package/dist/dts/workspace-elements/base/integrations/index.d.ts +0 -1
- package/dist/index.browser.d.mts +0 -2
- package/dist/index.browser.d.ts +0 -2
- package/dist/index.browser.js +5 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +5 -6
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +2 -38
- package/dist/index.node.d.ts +2 -38
- package/dist/index.node.js +5 -196
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +6 -189
- package/dist/index.node.mjs.map +1 -1
- package/package.json +12 -1
package/dist/index.browser.mjs
CHANGED
|
@@ -9922,6 +9922,7 @@ const IntegrationEditableProperties = BaseMembraneInterfaceEditableProperties.ex
|
|
|
9922
9922
|
const IntegrationExportProperties = IntegrationEditableProperties.omit({
|
|
9923
9923
|
connectorId: true,
|
|
9924
9924
|
externalAppId: true,
|
|
9925
|
+
parameters: true,
|
|
9925
9926
|
});
|
|
9926
9927
|
const AppliedToIntegrations = (elementSchema) => z.array(z.object({
|
|
9927
9928
|
element: elementSchema,
|
|
@@ -14883,7 +14884,6 @@ class ConnectionAccessor {
|
|
|
14883
14884
|
authOptionKey,
|
|
14884
14885
|
connectorParameters,
|
|
14885
14886
|
apiUri: this.client.apiUri,
|
|
14886
|
-
token: await this.client.getToken(),
|
|
14887
14887
|
onPopupClosed,
|
|
14888
14888
|
});
|
|
14889
14889
|
}
|
|
@@ -14973,16 +14973,17 @@ class ConnectionProxy {
|
|
|
14973
14973
|
}
|
|
14974
14974
|
}
|
|
14975
14975
|
async function createOrUpdateConnection(options) {
|
|
14976
|
-
const { connectionId, integrationKey, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectionRequestId, apiUri,
|
|
14976
|
+
const { client, connectionId, integrationKey, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectionRequestId, apiUri, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
|
|
14977
14977
|
let connectionType = await detectConnectionType(options);
|
|
14978
14978
|
if (redirectUri) {
|
|
14979
14979
|
connectionType = ConnectionType.REDIRECT;
|
|
14980
14980
|
}
|
|
14981
|
+
const freshToken = await client.getToken();
|
|
14981
14982
|
const connectPath = 'connect';
|
|
14982
14983
|
return new Promise((resolve, reject) => {
|
|
14983
14984
|
const requestId = simpleUniqueId() + simpleUniqueId();
|
|
14984
14985
|
const payload = {
|
|
14985
|
-
token,
|
|
14986
|
+
token: freshToken,
|
|
14986
14987
|
input,
|
|
14987
14988
|
connectorParameters,
|
|
14988
14989
|
integrationKey,
|
|
@@ -15011,7 +15012,7 @@ async function createOrUpdateConnection(options) {
|
|
|
15011
15012
|
const { stopSSE } = createSSEListener({
|
|
15012
15013
|
apiUri: apiUri,
|
|
15013
15014
|
requestId,
|
|
15014
|
-
token,
|
|
15015
|
+
token: freshToken,
|
|
15015
15016
|
handler: eventHandler,
|
|
15016
15017
|
});
|
|
15017
15018
|
function cleanup() {
|
|
@@ -15315,7 +15316,6 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
15315
15316
|
authOptionKey,
|
|
15316
15317
|
allowMultipleConnections,
|
|
15317
15318
|
apiUri: this.client.apiUri,
|
|
15318
|
-
token: await this.client.getToken(),
|
|
15319
15319
|
redirectUri: sameWindow ? redirectUri : undefined,
|
|
15320
15320
|
onPopupClosed,
|
|
15321
15321
|
});
|
|
@@ -16170,7 +16170,6 @@ class MembraneClient extends MembraneApiClient {
|
|
|
16170
16170
|
...options,
|
|
16171
16171
|
client: this,
|
|
16172
16172
|
apiUri: this.apiUri,
|
|
16173
|
-
token: await this.getToken(),
|
|
16174
16173
|
redirectUri: options.sameWindow ? options.redirectUri : undefined,
|
|
16175
16174
|
});
|
|
16176
16175
|
}
|