@membranehq/sdk 0.10.10 → 0.11.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 +201 -4
- package/dist/bundle.js +182 -53
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/connections-accessors.d.ts +8 -1
- package/dist/dts/accessors/integrations-accessors.d.ts +9 -1
- package/dist/dts/agent/session.d.ts +5 -0
- package/dist/dts/alerts/types.d.ts +18 -0
- package/dist/dts/index.browser.d.ts +1 -0
- package/dist/dts/orgs/types.d.ts +17 -0
- package/dist/dts/stats/index.d.ts +33 -0
- package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +18 -0
- package/dist/dts/workspace-elements/api/actions-api.d.ts +34 -0
- package/dist/dts/workspace-elements/api/app-data-schema-instances-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/app-event-log-records-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/app-event-subscriptions-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/connections-api.d.ts +22 -1
- package/dist/dts/workspace-elements/api/customers-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +7 -0
- package/dist/dts/workspace-elements/api/data-source-instances-api.d.ts +8 -0
- package/dist/dts/workspace-elements/api/data-sources-api.d.ts +14 -0
- package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +7 -0
- package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +7 -0
- package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +7 -0
- package/dist/dts/workspace-elements/api/external-events-api.d.ts +4 -0
- package/dist/dts/workspace-elements/api/field-mapping-instances-api.d.ts +16 -0
- package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +14 -0
- package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +14 -0
- package/dist/dts/workspace-elements/api/flows-api.d.ts +38 -0
- package/dist/dts/workspace-elements/api/integrations-api.d.ts +16 -3
- package/dist/dts/workspace-elements/api/packages-api.d.ts +10 -0
- package/dist/dts/workspace-elements/base/action-instances/types.d.ts +1 -0
- package/dist/dts/workspace-elements/base/actions/index.d.ts +3 -0
- package/dist/dts/workspace-elements/base/connections/types.d.ts +2 -0
- package/dist/dts/workspace-elements/base/customers/index.d.ts +1 -0
- package/dist/dts/workspace-elements/base/data-sources/index.d.ts +3 -0
- package/dist/dts/workspace-elements/base/external-apps/index.d.ts +1 -0
- package/dist/dts/workspace-elements/base/field-mappings/index.d.ts +2 -0
- package/dist/dts/workspace-elements/base/flows/index.d.ts +2 -0
- package/dist/dts/workspace-elements/base/integrations/index.d.ts +28 -2
- package/dist/dts/workspace-elements/base/packages/index.d.ts +2 -0
- package/dist/dts/workspace-elements/filter-meta.d.ts +9 -0
- package/dist/dts/workspace-elements/index.d.ts +1 -0
- package/dist/dts/workspace-elements/types.d.ts +4 -0
- package/dist/dts/workspaces/types.d.ts +276 -34
- package/dist/index.browser.d.mts +665 -41
- package/dist/index.browser.d.ts +665 -41
- package/dist/index.browser.js +202 -24
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +191 -25
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +665 -41
- package/dist/index.node.d.ts +665 -41
- package/dist/index.node.js +202 -24
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +191 -25
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -4954,10 +4954,32 @@
|
|
|
4954
4954
|
hasRequiredUtils = 1;
|
|
4955
4955
|
|
|
4956
4956
|
var formats = /*@__PURE__*/ requireFormats();
|
|
4957
|
+
var getSideChannel = requireSideChannel();
|
|
4957
4958
|
|
|
4958
4959
|
var has = Object.prototype.hasOwnProperty;
|
|
4959
4960
|
var isArray = Array.isArray;
|
|
4960
4961
|
|
|
4962
|
+
// Track objects created from arrayLimit overflow using side-channel
|
|
4963
|
+
// Stores the current max numeric index for O(1) lookup
|
|
4964
|
+
var overflowChannel = getSideChannel();
|
|
4965
|
+
|
|
4966
|
+
var markOverflow = function markOverflow(obj, maxIndex) {
|
|
4967
|
+
overflowChannel.set(obj, maxIndex);
|
|
4968
|
+
return obj;
|
|
4969
|
+
};
|
|
4970
|
+
|
|
4971
|
+
var isOverflow = function isOverflow(obj) {
|
|
4972
|
+
return overflowChannel.has(obj);
|
|
4973
|
+
};
|
|
4974
|
+
|
|
4975
|
+
var getMaxIndex = function getMaxIndex(obj) {
|
|
4976
|
+
return overflowChannel.get(obj);
|
|
4977
|
+
};
|
|
4978
|
+
|
|
4979
|
+
var setMaxIndex = function setMaxIndex(obj, maxIndex) {
|
|
4980
|
+
overflowChannel.set(obj, maxIndex);
|
|
4981
|
+
};
|
|
4982
|
+
|
|
4961
4983
|
var hexTable = (function () {
|
|
4962
4984
|
var array = [];
|
|
4963
4985
|
for (var i = 0; i < 256; ++i) {
|
|
@@ -5007,7 +5029,12 @@
|
|
|
5007
5029
|
if (isArray(target)) {
|
|
5008
5030
|
target.push(source);
|
|
5009
5031
|
} else if (target && typeof target === 'object') {
|
|
5010
|
-
if (
|
|
5032
|
+
if (isOverflow(target)) {
|
|
5033
|
+
// Add at next numeric index for overflow objects
|
|
5034
|
+
var newIndex = getMaxIndex(target) + 1;
|
|
5035
|
+
target[newIndex] = source;
|
|
5036
|
+
setMaxIndex(target, newIndex);
|
|
5037
|
+
} else if (
|
|
5011
5038
|
(options && (options.plainObjects || options.allowPrototypes))
|
|
5012
5039
|
|| !has.call(Object.prototype, source)
|
|
5013
5040
|
) {
|
|
@@ -5021,6 +5048,18 @@
|
|
|
5021
5048
|
}
|
|
5022
5049
|
|
|
5023
5050
|
if (!target || typeof target !== 'object') {
|
|
5051
|
+
if (isOverflow(source)) {
|
|
5052
|
+
// Create new object with target at 0, source values shifted by 1
|
|
5053
|
+
var sourceKeys = Object.keys(source);
|
|
5054
|
+
var result = options && options.plainObjects
|
|
5055
|
+
? { __proto__: null, 0: target }
|
|
5056
|
+
: { 0: target };
|
|
5057
|
+
for (var m = 0; m < sourceKeys.length; m++) {
|
|
5058
|
+
var oldKey = parseInt(sourceKeys[m], 10);
|
|
5059
|
+
result[oldKey + 1] = source[sourceKeys[m]];
|
|
5060
|
+
}
|
|
5061
|
+
return markOverflow(result, getMaxIndex(source) + 1);
|
|
5062
|
+
}
|
|
5024
5063
|
return [target].concat(source);
|
|
5025
5064
|
}
|
|
5026
5065
|
|
|
@@ -5192,8 +5231,20 @@
|
|
|
5192
5231
|
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
5193
5232
|
};
|
|
5194
5233
|
|
|
5195
|
-
var combine = function combine(a, b) {
|
|
5196
|
-
|
|
5234
|
+
var combine = function combine(a, b, arrayLimit, plainObjects) {
|
|
5235
|
+
// If 'a' is already an overflow object, add to it
|
|
5236
|
+
if (isOverflow(a)) {
|
|
5237
|
+
var newIndex = getMaxIndex(a) + 1;
|
|
5238
|
+
a[newIndex] = b;
|
|
5239
|
+
setMaxIndex(a, newIndex);
|
|
5240
|
+
return a;
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
var result = [].concat(a, b);
|
|
5244
|
+
if (result.length > arrayLimit) {
|
|
5245
|
+
return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);
|
|
5246
|
+
}
|
|
5247
|
+
return result;
|
|
5197
5248
|
};
|
|
5198
5249
|
|
|
5199
5250
|
var maybeMap = function maybeMap(val, fn) {
|
|
@@ -5215,6 +5266,7 @@
|
|
|
5215
5266
|
decode: decode,
|
|
5216
5267
|
encode: encode,
|
|
5217
5268
|
isBuffer: isBuffer,
|
|
5269
|
+
isOverflow: isOverflow,
|
|
5218
5270
|
isRegExp: isRegExp,
|
|
5219
5271
|
maybeMap: maybeMap,
|
|
5220
5272
|
merge: merge
|
|
@@ -5701,16 +5753,18 @@
|
|
|
5701
5753
|
} else {
|
|
5702
5754
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
5703
5755
|
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5756
|
+
if (key !== null) {
|
|
5757
|
+
val = utils.maybeMap(
|
|
5758
|
+
parseArrayValue(
|
|
5759
|
+
part.slice(pos + 1),
|
|
5760
|
+
options,
|
|
5761
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
5762
|
+
),
|
|
5763
|
+
function (encodedVal) {
|
|
5764
|
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
5765
|
+
}
|
|
5766
|
+
);
|
|
5767
|
+
}
|
|
5714
5768
|
}
|
|
5715
5769
|
|
|
5716
5770
|
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
@@ -5721,11 +5775,18 @@
|
|
|
5721
5775
|
val = isArray(val) ? [val] : val;
|
|
5722
5776
|
}
|
|
5723
5777
|
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5778
|
+
if (key !== null) {
|
|
5779
|
+
var existing = has.call(obj, key);
|
|
5780
|
+
if (existing && options.duplicates === 'combine') {
|
|
5781
|
+
obj[key] = utils.combine(
|
|
5782
|
+
obj[key],
|
|
5783
|
+
val,
|
|
5784
|
+
options.arrayLimit,
|
|
5785
|
+
options.plainObjects
|
|
5786
|
+
);
|
|
5787
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
5788
|
+
obj[key] = val;
|
|
5789
|
+
}
|
|
5729
5790
|
}
|
|
5730
5791
|
}
|
|
5731
5792
|
|
|
@@ -5746,9 +5807,19 @@
|
|
|
5746
5807
|
var root = chain[i];
|
|
5747
5808
|
|
|
5748
5809
|
if (root === '[]' && options.parseArrays) {
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5810
|
+
if (utils.isOverflow(leaf)) {
|
|
5811
|
+
// leaf is already an overflow object, preserve it
|
|
5812
|
+
obj = leaf;
|
|
5813
|
+
} else {
|
|
5814
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
5815
|
+
? []
|
|
5816
|
+
: utils.combine(
|
|
5817
|
+
[],
|
|
5818
|
+
leaf,
|
|
5819
|
+
options.arrayLimit,
|
|
5820
|
+
options.plainObjects
|
|
5821
|
+
);
|
|
5822
|
+
}
|
|
5752
5823
|
} else {
|
|
5753
5824
|
obj = options.plainObjects ? { __proto__: null } : {};
|
|
5754
5825
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
@@ -5776,29 +5847,28 @@
|
|
|
5776
5847
|
return leaf;
|
|
5777
5848
|
};
|
|
5778
5849
|
|
|
5779
|
-
var
|
|
5780
|
-
if (!givenKey) {
|
|
5781
|
-
return;
|
|
5782
|
-
}
|
|
5783
|
-
|
|
5784
|
-
// Transform dot notation to bracket notation
|
|
5850
|
+
var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
|
|
5785
5851
|
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
5786
5852
|
|
|
5787
|
-
|
|
5853
|
+
if (options.depth <= 0) {
|
|
5854
|
+
if (!options.plainObjects && has.call(Object.prototype, key)) {
|
|
5855
|
+
if (!options.allowPrototypes) {
|
|
5856
|
+
return;
|
|
5857
|
+
}
|
|
5858
|
+
}
|
|
5859
|
+
|
|
5860
|
+
return [key];
|
|
5861
|
+
}
|
|
5788
5862
|
|
|
5789
5863
|
var brackets = /(\[[^[\]]*])/;
|
|
5790
5864
|
var child = /(\[[^[\]]*])/g;
|
|
5791
5865
|
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
var segment = options.depth > 0 && brackets.exec(key);
|
|
5866
|
+
var segment = brackets.exec(key);
|
|
5795
5867
|
var parent = segment ? key.slice(0, segment.index) : key;
|
|
5796
5868
|
|
|
5797
|
-
// Stash the parent if it exists
|
|
5798
|
-
|
|
5799
5869
|
var keys = [];
|
|
5870
|
+
|
|
5800
5871
|
if (parent) {
|
|
5801
|
-
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
5802
5872
|
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
5803
5873
|
if (!options.allowPrototypes) {
|
|
5804
5874
|
return;
|
|
@@ -5808,28 +5878,42 @@
|
|
|
5808
5878
|
keys.push(parent);
|
|
5809
5879
|
}
|
|
5810
5880
|
|
|
5811
|
-
// Loop through children appending to the array until we hit depth
|
|
5812
|
-
|
|
5813
5881
|
var i = 0;
|
|
5814
|
-
while (
|
|
5882
|
+
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
5815
5883
|
i += 1;
|
|
5816
|
-
|
|
5884
|
+
|
|
5885
|
+
var segmentContent = segment[1].slice(1, -1);
|
|
5886
|
+
if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
|
|
5817
5887
|
if (!options.allowPrototypes) {
|
|
5818
5888
|
return;
|
|
5819
5889
|
}
|
|
5820
5890
|
}
|
|
5891
|
+
|
|
5821
5892
|
keys.push(segment[1]);
|
|
5822
5893
|
}
|
|
5823
5894
|
|
|
5824
|
-
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
5825
|
-
|
|
5826
5895
|
if (segment) {
|
|
5827
5896
|
if (options.strictDepth === true) {
|
|
5828
5897
|
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
5829
5898
|
}
|
|
5899
|
+
|
|
5830
5900
|
keys.push('[' + key.slice(segment.index) + ']');
|
|
5831
5901
|
}
|
|
5832
5902
|
|
|
5903
|
+
return keys;
|
|
5904
|
+
};
|
|
5905
|
+
|
|
5906
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
5907
|
+
if (!givenKey) {
|
|
5908
|
+
return;
|
|
5909
|
+
}
|
|
5910
|
+
|
|
5911
|
+
var keys = splitKeyIntoSegments(givenKey, options);
|
|
5912
|
+
|
|
5913
|
+
if (!keys) {
|
|
5914
|
+
return;
|
|
5915
|
+
}
|
|
5916
|
+
|
|
5833
5917
|
return parseObject(keys, val, options, valuesParsed);
|
|
5834
5918
|
};
|
|
5835
5919
|
|
|
@@ -20090,6 +20174,7 @@
|
|
|
20090
20174
|
parentUuid: string$1().optional(),
|
|
20091
20175
|
connectionId: string$1().optional(),
|
|
20092
20176
|
instanceKey: string$1().optional(),
|
|
20177
|
+
isUniversal: boolean$1().optional(),
|
|
20093
20178
|
});
|
|
20094
20179
|
const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
|
|
20095
20180
|
isCustomized: boolean$1().optional(),
|
|
@@ -20101,16 +20186,60 @@
|
|
|
20101
20186
|
});
|
|
20102
20187
|
const MembraneElementLayer = _enum(['universal', 'integration', 'connection']);
|
|
20103
20188
|
const IntegrationLevelMembraneInterfaceSelectorQuery = object({
|
|
20104
|
-
layer: MembraneElementLayer.optional()
|
|
20105
|
-
|
|
20106
|
-
|
|
20107
|
-
|
|
20108
|
-
|
|
20189
|
+
layer: MembraneElementLayer.optional().meta({
|
|
20190
|
+
filterTitle: 'Layer',
|
|
20191
|
+
}),
|
|
20192
|
+
integrationKey: string$1()
|
|
20193
|
+
.optional()
|
|
20194
|
+
.meta({
|
|
20195
|
+
hidden: true,
|
|
20196
|
+
}),
|
|
20197
|
+
integrationId: string$1()
|
|
20198
|
+
.optional()
|
|
20199
|
+
.meta({
|
|
20200
|
+
filterTitle: 'Integration',
|
|
20201
|
+
referenceElementType: WorkspaceElementType.Integration,
|
|
20202
|
+
}),
|
|
20203
|
+
connectionId: string$1()
|
|
20204
|
+
.optional()
|
|
20205
|
+
.meta({
|
|
20206
|
+
filterTitle: 'Connection',
|
|
20207
|
+
referenceElementType: WorkspaceElementType.Connection,
|
|
20208
|
+
}),
|
|
20209
|
+
instanceKey: string$1()
|
|
20210
|
+
.optional()
|
|
20211
|
+
.meta({
|
|
20212
|
+
filterTitle: 'Instance Key',
|
|
20213
|
+
}),
|
|
20109
20214
|
});
|
|
20110
20215
|
IntegrationLevelMembraneInterfaceSelectorQuery.extend(CommonListElementsQuery.shape).extend({
|
|
20111
|
-
parentId: string$1()
|
|
20112
|
-
|
|
20113
|
-
|
|
20216
|
+
parentId: string$1()
|
|
20217
|
+
.optional()
|
|
20218
|
+
.meta({
|
|
20219
|
+
filterTitle: 'Parent',
|
|
20220
|
+
referenceElementType: 'self',
|
|
20221
|
+
}),
|
|
20222
|
+
universalParentId: string$1()
|
|
20223
|
+
.optional()
|
|
20224
|
+
.meta({
|
|
20225
|
+
filterTitle: 'Universal Parent',
|
|
20226
|
+
referenceElementType: 'self',
|
|
20227
|
+
}),
|
|
20228
|
+
tenantId: string$1()
|
|
20229
|
+
.optional()
|
|
20230
|
+
.meta({
|
|
20231
|
+
filterTitle: 'Customer',
|
|
20232
|
+
referenceElementType: WorkspaceElementType.Customer,
|
|
20233
|
+
}),
|
|
20234
|
+
userId: string$1().optional().meta({
|
|
20235
|
+
hidden: true,
|
|
20236
|
+
}),
|
|
20237
|
+
isUniversal: zodBooleanCoercion()
|
|
20238
|
+
.optional()
|
|
20239
|
+
.meta({
|
|
20240
|
+
filterTitle: 'Is Universal',
|
|
20241
|
+
isFlag: true,
|
|
20242
|
+
}),
|
|
20114
20243
|
});
|
|
20115
20244
|
BaseMembraneInterface.merge(BaseIntegrationLevelMembraneInterfaceEditableProperties).merge(BaseIntegrationLevelMembraneInterfaceReadOnlyProperties);
|
|
20116
20245
|
object({
|
|
@@ -20400,7 +20529,7 @@
|
|
|
20400
20529
|
return createOrUpdateConnection({
|
|
20401
20530
|
connectionId: connection.id,
|
|
20402
20531
|
connectorSpec,
|
|
20403
|
-
parameters,
|
|
20532
|
+
input: parameters,
|
|
20404
20533
|
authOptionKey,
|
|
20405
20534
|
connectorParameters,
|
|
20406
20535
|
apiUri: this.client.apiUri,
|
|
@@ -20494,7 +20623,7 @@
|
|
|
20494
20623
|
}
|
|
20495
20624
|
}
|
|
20496
20625
|
async function createOrUpdateConnection(options) {
|
|
20497
|
-
const { connectionId, integrationId, connectorId, connectorVersion, name,
|
|
20626
|
+
const { connectionId, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
|
|
20498
20627
|
const connectionType = getConnectionType({
|
|
20499
20628
|
connectorSpec,
|
|
20500
20629
|
authOptionKey,
|
|
@@ -20515,7 +20644,7 @@
|
|
|
20515
20644
|
const requestId = simpleUniqueId() + simpleUniqueId();
|
|
20516
20645
|
const payload = {
|
|
20517
20646
|
token,
|
|
20518
|
-
|
|
20647
|
+
input,
|
|
20519
20648
|
connectorParameters,
|
|
20520
20649
|
connectorId,
|
|
20521
20650
|
connectorVersion,
|
|
@@ -20815,14 +20944,14 @@
|
|
|
20815
20944
|
});
|
|
20816
20945
|
});
|
|
20817
20946
|
}
|
|
20818
|
-
async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, } = {}) {
|
|
20947
|
+
async connect({ name, input, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, } = {}) {
|
|
20819
20948
|
const integration = await this.get();
|
|
20820
20949
|
const connectorSpec = await this.getConnectorSpec();
|
|
20821
20950
|
return createOrUpdateConnection({
|
|
20822
20951
|
integrationId: integration.id,
|
|
20823
20952
|
connectorSpec,
|
|
20824
20953
|
name,
|
|
20825
|
-
parameters,
|
|
20954
|
+
input: input !== null && input !== void 0 ? input : parameters,
|
|
20826
20955
|
connectorParameters,
|
|
20827
20956
|
authOptionKey,
|
|
20828
20957
|
allowMultipleConnections,
|