@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.
@@ -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, token, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
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
  }