@membranehq/sdk 0.1.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 +7 -5
- package/dist/bundle.js +17 -50
- package/dist/bundle.js.map +1 -1
- package/dist/dts/actions/types.d.ts +0 -1
- package/dist/dts/connections/accessors.d.ts +2 -1
- package/dist/dts/connections/create-or-update-connection.d.ts +1 -0
- package/dist/dts/data-schema/types.d.ts +1 -0
- package/dist/dts/flows/types.d.ts +0 -1
- package/dist/dts/integrations/accessors.d.ts +7 -6
- package/dist/dts/integrations/api.d.ts +1 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.module.d.mts +7 -5
- package/dist/index.module.mjs +8 -4
- package/dist/index.module.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bundle.d.ts
CHANGED
|
@@ -305,6 +305,7 @@ interface DataSchema {
|
|
|
305
305
|
examples?: any[];
|
|
306
306
|
anyOf?: DataSchema[];
|
|
307
307
|
isImplied?: boolean;
|
|
308
|
+
isSensitive?: boolean;
|
|
308
309
|
referenceCollectionPath?: string;
|
|
309
310
|
referenceCollectionUri?: string;
|
|
310
311
|
}
|
|
@@ -796,6 +797,7 @@ interface FindIntegrationsQuery extends PaginationQuery, SearchQuery {
|
|
|
796
797
|
interface OpenNewConnectionOptions extends OpenConfigurationOptions {
|
|
797
798
|
allowMultipleConnections?: boolean;
|
|
798
799
|
name?: string;
|
|
800
|
+
connectorParameters?: any;
|
|
799
801
|
}
|
|
800
802
|
|
|
801
803
|
type CreateCustomerRequest = {
|
|
@@ -1119,10 +1121,11 @@ declare class IntegrationAccessor extends ElementAccessor<Integration, UpdateInt
|
|
|
1119
1121
|
setup(): Promise<Integration>;
|
|
1120
1122
|
getConnectorSpec(): Promise<ConnectionSpec>;
|
|
1121
1123
|
open({ onClose }?: OpenIntegrationUIIntegrationConfigurationOptions): Promise<void>;
|
|
1122
|
-
openNewConnection({ allowMultipleConnections, name }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
1123
|
-
connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
1124
|
+
openNewConnection({ allowMultipleConnections, name, connectorParameters, }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
1125
|
+
connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
1124
1126
|
name?: string;
|
|
1125
1127
|
parameters?: any;
|
|
1128
|
+
connectorParameters?: any;
|
|
1126
1129
|
authOptionKey?: string;
|
|
1127
1130
|
allowMultipleConnections?: boolean;
|
|
1128
1131
|
} & ({
|
|
@@ -1567,7 +1570,6 @@ interface Flow extends WorkspaceElement {
|
|
|
1567
1570
|
revision: string;
|
|
1568
1571
|
customized?: boolean;
|
|
1569
1572
|
appliedToIntegrations?: AppliedToIntegrations<Flow>;
|
|
1570
|
-
isDeployed?: boolean;
|
|
1571
1573
|
}
|
|
1572
1574
|
interface FlowInstance extends WorkspaceElement {
|
|
1573
1575
|
userId: string;
|
|
@@ -1881,9 +1883,10 @@ declare class ConnectionAccessor {
|
|
|
1881
1883
|
operation(key: string): ConnectionOperationAccessor;
|
|
1882
1884
|
dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
|
|
1883
1885
|
dataDirectory(key: string, parameters?: Record<string, any>): ConnectionDataDirectoryAccessor;
|
|
1884
|
-
reconnect({ parameters, authOptionKey, }?: {
|
|
1886
|
+
reconnect({ parameters, authOptionKey, connectorParameters, }?: {
|
|
1885
1887
|
parameters?: any;
|
|
1886
1888
|
authOptionKey?: string;
|
|
1889
|
+
connectorParameters?: any;
|
|
1887
1890
|
}): Promise<Connection | undefined>;
|
|
1888
1891
|
openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
|
|
1889
1892
|
refreshCredentials(): Promise<void>;
|
|
@@ -1983,7 +1986,6 @@ interface Action extends ElementTemplateFields {
|
|
|
1983
1986
|
outputSchema?: DataSchema;
|
|
1984
1987
|
appliedToIntegrations?: AppliedToIntegrations<Action>;
|
|
1985
1988
|
dependencies?: WorkspaceElementDependency[];
|
|
1986
|
-
isDeployed?: boolean;
|
|
1987
1989
|
}
|
|
1988
1990
|
interface ActionInstance extends ElementInstanceFields {
|
|
1989
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.
|
|
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
|
-
|
|
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(
|
|
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({
|
|
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.
|
|
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(
|
|
23976
|
-
chain.push(
|
|
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,
|