@membranehq/sdk 0.2.0 → 0.2.1

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.d.ts CHANGED
@@ -797,6 +797,7 @@ interface FindIntegrationsQuery extends PaginationQuery, SearchQuery {
797
797
  interface OpenNewConnectionOptions extends OpenConfigurationOptions {
798
798
  allowMultipleConnections?: boolean;
799
799
  name?: string;
800
+ connectorParameters?: any;
800
801
  }
801
802
 
802
803
  type CreateCustomerRequest = {
@@ -1120,10 +1121,11 @@ declare class IntegrationAccessor extends ElementAccessor<Integration, UpdateInt
1120
1121
  setup(): Promise<Integration>;
1121
1122
  getConnectorSpec(): Promise<ConnectionSpec>;
1122
1123
  open({ onClose }?: OpenIntegrationUIIntegrationConfigurationOptions): Promise<void>;
1123
- openNewConnection({ allowMultipleConnections, name }?: OpenNewConnectionOptions): Promise<Connection>;
1124
- connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
1124
+ openNewConnection({ allowMultipleConnections, name, connectorParameters, }?: OpenNewConnectionOptions): Promise<Connection>;
1125
+ connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
1125
1126
  name?: string;
1126
1127
  parameters?: any;
1128
+ connectorParameters?: any;
1127
1129
  authOptionKey?: string;
1128
1130
  allowMultipleConnections?: boolean;
1129
1131
  } & ({
@@ -1568,7 +1570,6 @@ interface Flow extends WorkspaceElement {
1568
1570
  revision: string;
1569
1571
  customized?: boolean;
1570
1572
  appliedToIntegrations?: AppliedToIntegrations<Flow>;
1571
- isDeployed?: boolean;
1572
1573
  }
1573
1574
  interface FlowInstance extends WorkspaceElement {
1574
1575
  userId: string;
@@ -1882,9 +1883,10 @@ declare class ConnectionAccessor {
1882
1883
  operation(key: string): ConnectionOperationAccessor;
1883
1884
  dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
1884
1885
  dataDirectory(key: string, parameters?: Record<string, any>): ConnectionDataDirectoryAccessor;
1885
- reconnect({ parameters, authOptionKey, }?: {
1886
+ reconnect({ parameters, authOptionKey, connectorParameters, }?: {
1886
1887
  parameters?: any;
1887
1888
  authOptionKey?: string;
1889
+ connectorParameters?: any;
1888
1890
  }): Promise<Connection | undefined>;
1889
1891
  openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
1890
1892
  refreshCredentials(): Promise<void>;
@@ -1984,7 +1986,6 @@ interface Action extends ElementTemplateFields {
1984
1986
  outputSchema?: DataSchema;
1985
1987
  appliedToIntegrations?: AppliedToIntegrations<Action>;
1986
1988
  dependencies?: WorkspaceElementDependency[];
1987
- isDeployed?: boolean;
1988
1989
  }
1989
1990
  interface ActionInstance extends ElementInstanceFields {
1990
1991
  type: ActionType;
package/dist/bundle.js CHANGED
@@ -20606,7 +20606,7 @@
20606
20606
  ActionRunLogStatus["ERROR"] = "error";
20607
20607
  })(ActionRunLogStatus || (ActionRunLogStatus = {}));
20608
20608
 
20609
- /*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
20609
+ /*! Axios v1.10.0 Copyright (c) 2025 Matt Zabriskie and contributors */
20610
20610
  function bind(fn, thisArg) {
20611
20611
  return function wrap() {
20612
20612
  return fn.apply(thisArg, arguments);
@@ -20747,27 +20747,6 @@
20747
20747
  return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
20748
20748
  };
20749
20749
 
20750
- /**
20751
- * Determine if a value is an empty object (safely handles Buffers)
20752
- *
20753
- * @param {*} val The value to test
20754
- *
20755
- * @returns {boolean} True if value is an empty object, otherwise false
20756
- */
20757
- const isEmptyObject = (val) => {
20758
- // Early return for non-objects or Buffers to prevent RangeError
20759
- if (!isObject(val) || isBuffer(val)) {
20760
- return false;
20761
- }
20762
-
20763
- try {
20764
- return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
20765
- } catch (e) {
20766
- // Fallback for any other objects that might cause RangeError with Object.keys()
20767
- return false;
20768
- }
20769
- };
20770
-
20771
20750
  /**
20772
20751
  * Determine if a value is a Date
20773
20752
  *
@@ -20890,11 +20869,6 @@
20890
20869
  fn.call(null, obj[i], i, obj);
20891
20870
  }
20892
20871
  } else {
20893
- // Buffer check
20894
- if (isBuffer(obj)) {
20895
- return;
20896
- }
20897
-
20898
20872
  // Iterate over object keys
20899
20873
  const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
20900
20874
  const len = keys.length;
@@ -20908,10 +20882,6 @@
20908
20882
  }
20909
20883
 
20910
20884
  function findKey(obj, key) {
20911
- if (isBuffer(obj)){
20912
- return null;
20913
- }
20914
-
20915
20885
  key = key.toLowerCase();
20916
20886
  const keys = Object.keys(obj);
20917
20887
  let i = keys.length;
@@ -21265,11 +21235,6 @@
21265
21235
  return;
21266
21236
  }
21267
21237
 
21268
- //Buffer check
21269
- if (isBuffer(source)) {
21270
- return source;
21271
- }
21272
-
21273
21238
  if(!('toJSON' in source)) {
21274
21239
  stack[i] = source;
21275
21240
  const target = isArray(source) ? [] : {};
@@ -21341,7 +21306,6 @@
21341
21306
  isBoolean,
21342
21307
  isObject,
21343
21308
  isPlainObject,
21344
- isEmptyObject,
21345
21309
  isReadableStream,
21346
21310
  isRequest,
21347
21311
  isResponse,
@@ -21973,7 +21937,7 @@
21973
21937
  };
21974
21938
 
21975
21939
  function toURLEncodedForm(data, options) {
21976
- return toFormData$1(data, new platform.classes.URLSearchParams(), {
21940
+ return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
21977
21941
  visitor: function(value, key, path, helpers) {
21978
21942
  if (platform.isNode && utils$1.isBuffer(value)) {
21979
21943
  this.append(key, value.toString('base64'));
@@ -21981,9 +21945,8 @@
21981
21945
  }
21982
21946
 
21983
21947
  return helpers.defaultVisitor.apply(this, arguments);
21984
- },
21985
- ...options
21986
- });
21948
+ }
21949
+ }, options));
21987
21950
  }
21988
21951
 
21989
21952
  /**
@@ -22736,7 +22699,7 @@
22736
22699
  clearTimeout(timer);
22737
22700
  timer = null;
22738
22701
  }
22739
- fn(...args);
22702
+ fn.apply(null, args);
22740
22703
  };
22741
22704
 
22742
22705
  const throttled = (...args) => {
@@ -22992,7 +22955,7 @@
22992
22955
  headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
22993
22956
  };
22994
22957
 
22995
- utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
22958
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
22996
22959
  const merge = mergeMap[prop] || mergeDeepProperties;
22997
22960
  const configValue = merge(config1[prop], config2[prop], prop);
22998
22961
  (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -23733,7 +23696,7 @@
23733
23696
  });
23734
23697
  }
23735
23698
 
23736
- const VERSION$1 = "1.11.0";
23699
+ const VERSION$1 = "1.10.0";
23737
23700
 
23738
23701
  const validators$1 = {};
23739
23702
 
@@ -23972,8 +23935,8 @@
23972
23935
 
23973
23936
  if (!synchronousRequestInterceptors) {
23974
23937
  const chain = [dispatchRequest.bind(this), undefined];
23975
- chain.unshift(...requestInterceptorChain);
23976
- chain.push(...responseInterceptorChain);
23938
+ chain.unshift.apply(chain, requestInterceptorChain);
23939
+ chain.push.apply(chain, responseInterceptorChain);
23977
23940
  len = chain.length;
23978
23941
 
23979
23942
  promise = Promise.resolve(config);
@@ -24617,7 +24580,7 @@
24617
24580
  ConnectionType["REDIRECT"] = "redirect";
24618
24581
  })(ConnectionType || (ConnectionType = {}));
24619
24582
  async function createOrUpdateConnection(options) {
24620
- const { connectionId, integrationId, name, parameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, } = options !== null && options !== void 0 ? options : {};
24583
+ const { connectionId, integrationId, name, parameters, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, } = options !== null && options !== void 0 ? options : {};
24621
24584
  const connectionType = getConnectionType({
24622
24585
  connectorSpec,
24623
24586
  authOptionKey,
@@ -24631,6 +24594,7 @@
24631
24594
  const payload = {
24632
24595
  token,
24633
24596
  connectionParameters: parameters,
24597
+ connectorParameters,
24634
24598
  name,
24635
24599
  authOptionKey,
24636
24600
  allowMultipleConnections,
@@ -25546,7 +25510,7 @@
25546
25510
  dataDirectory(key, parameters) {
25547
25511
  return new ConnectionDataDirectoryAccessor(this.client, this, key, parameters);
25548
25512
  }
25549
- async reconnect({ parameters, authOptionKey, } = {}) {
25513
+ async reconnect({ parameters, authOptionKey, connectorParameters, } = {}) {
25550
25514
  const connection = await this.get();
25551
25515
  const connectorSpec = await this.client.get(`/integrations/${connection.integrationId}/connector-spec`);
25552
25516
  return createOrUpdateConnection({
@@ -25554,6 +25518,7 @@
25554
25518
  connectorSpec,
25555
25519
  parameters,
25556
25520
  authOptionKey,
25521
+ connectorParameters,
25557
25522
  apiUri: this.client.apiUri,
25558
25523
  token: await this.client.getToken(),
25559
25524
  });
@@ -25826,10 +25791,11 @@
25826
25791
  onClose,
25827
25792
  });
25828
25793
  }
25829
- async openNewConnection({ allowMultipleConnections, name } = {}) {
25794
+ async openNewConnection({ allowMultipleConnections, name, connectorParameters, } = {}) {
25830
25795
  const uri = await this.client.getEmbedUri(`integrations/${this.integrationSelector}/connect`, {
25831
25796
  allowMultipleConnections: allowMultipleConnections ? '1' : '',
25832
25797
  name,
25798
+ connectorParameters: connectorParameters ? JSON.stringify(connectorParameters) : undefined,
25833
25799
  });
25834
25800
  return new Promise((resolve) => {
25835
25801
  return openIframe(uri, {
@@ -25838,7 +25804,7 @@
25838
25804
  });
25839
25805
  });
25840
25806
  }
25841
- async connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
25807
+ async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
25842
25808
  const integration = await this.get();
25843
25809
  const connectorSpec = await this.getConnectorSpec();
25844
25810
  return createOrUpdateConnection({
@@ -25846,6 +25812,7 @@
25846
25812
  connectorSpec,
25847
25813
  name,
25848
25814
  parameters,
25815
+ connectorParameters,
25849
25816
  authOptionKey,
25850
25817
  allowMultipleConnections,
25851
25818
  apiUri: this.client.apiUri,