@membranehq/sdk 0.8.4 → 0.8.5
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 +305 -290
- package/dist/bundle.js +121 -103
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/action-instances-accessors.d.ts +1 -16
- package/dist/dts/accessors/actions-accessors.d.ts +26 -7
- package/dist/dts/accessors/actions-accessors.test.d.ts +1 -0
- package/dist/dts/accessors/connections-accessors.d.ts +5 -5
- package/dist/dts/accessors/integrations-accessors.d.ts +5 -5
- package/dist/dts/alerts/types.d.ts +2 -1
- package/dist/dts/entity-repository.d.ts +0 -1
- package/dist/dts/formulas/dataSchemaRef.d.ts +3 -3
- package/dist/dts/index.browser.d.ts +2 -1
- package/dist/dts/orgs/types.d.ts +5 -4
- package/dist/dts/usage/types.d.ts +4 -2
- package/dist/dts/validation/types.d.ts +2 -0
- package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +11 -11
- package/dist/dts/workspace-elements/api/actions-api.d.ts +57 -55
- package/dist/dts/workspace-elements/api/app-data-schema-instances-api.d.ts +5 -5
- package/dist/dts/workspace-elements/api/app-data-schemas-api.d.ts +2 -2
- package/dist/dts/workspace-elements/api/app-event-log-records-api.d.ts +9 -8
- package/dist/dts/workspace-elements/api/app-event-subscriptions-api.d.ts +9 -8
- package/dist/dts/workspace-elements/api/app-event-types-api.d.ts +3 -2
- package/dist/dts/workspace-elements/api/connections-api.d.ts +3 -3
- package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +7 -7
- package/dist/dts/workspace-elements/api/data-link-tables-api.d.ts +2 -2
- package/dist/dts/workspace-elements/api/data-source-instances-api.d.ts +9 -8
- package/dist/dts/workspace-elements/api/data-sources-api.d.ts +10 -6
- package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +8 -7
- package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +8 -7
- package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +7 -6
- package/dist/dts/workspace-elements/api/external-events-api.d.ts +8 -6
- package/dist/dts/workspace-elements/api/field-mapping-instances-api.d.ts +20 -19
- package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +14 -14
- package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +14 -14
- package/dist/dts/workspace-elements/api/flows-api.d.ts +39 -27
- package/dist/dts/workspace-elements/api/integrations-api.d.ts +3 -3
- package/dist/dts/workspace-elements/api/packages-api.d.ts +30 -18
- package/dist/dts/workspace-elements/base/action-instances/types.d.ts +7 -7
- package/dist/dts/workspace-elements/base/actions/index.d.ts +30 -14
- package/dist/dts/workspace-elements/base/app-data-schema-instances/types.d.ts +1 -1
- package/dist/dts/workspace-elements/base/app-data-schemas/types.d.ts +2 -2
- package/dist/dts/workspace-elements/base/app-event-subscriptions/types.d.ts +2 -2
- package/dist/dts/workspace-elements/base/app-event-types/types.d.ts +3 -2
- package/dist/dts/workspace-elements/base/connectors/types.d.ts +2 -0
- package/dist/dts/workspace-elements/base/data-link-table-instances/types.d.ts +2 -2
- package/dist/dts/workspace-elements/base/data-link-tables/types.d.ts +2 -2
- package/dist/dts/workspace-elements/base/data-source-instances/types.d.ts +3 -3
- package/dist/dts/workspace-elements/base/data-sources/index.d.ts +22 -3
- package/dist/dts/workspace-elements/base/external-event-subscriptions/types.d.ts +6 -4
- package/dist/dts/workspace-elements/base/external-events/types.d.ts +6 -4
- package/dist/dts/workspace-elements/base/field-mapping-instances/types.d.ts +1 -1
- package/dist/dts/workspace-elements/base/field-mappings/index.d.ts +23 -3
- package/dist/dts/workspace-elements/base/flow-instances/types.d.ts +1 -1
- package/dist/dts/workspace-elements/base/flows/index.d.ts +45 -3
- package/dist/dts/workspace-elements/base/integrations/types.d.ts +18 -4
- package/dist/dts/workspace-elements/base/packages/index.d.ts +35 -8
- package/dist/dts/workspace-elements/paths.d.ts +8 -0
- package/dist/dts/workspace-elements/paths.test.d.ts +1 -0
- package/dist/dts/workspace-elements/types.d.ts +21 -9
- package/dist/dts/workspace-elements-catalog/index.d.ts +1 -0
- package/dist/dts/workspaces/types.d.ts +0 -1
- package/dist/index.browser.d.mts +8742 -8687
- package/dist/index.browser.d.ts +8742 -8687
- package/dist/index.browser.js +234 -265
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +224 -265
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +8766 -8711
- package/dist/index.node.d.ts +8766 -8711
- package/dist/index.node.js +234 -265
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +224 -265
- package/dist/index.node.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/dts/connector-copilot/types.d.ts +0 -160
- package/dist/dts/index.d.ts +0 -34
- /package/dist/dts/{connector-copilot → validation}/index.d.ts +0 -0
package/dist/bundle.js
CHANGED
|
@@ -6075,6 +6075,55 @@
|
|
|
6075
6075
|
}
|
|
6076
6076
|
}
|
|
6077
6077
|
|
|
6078
|
+
class ConnectionLevelElementAccessor {
|
|
6079
|
+
constructor(client, connectionSelector, selector, elementKey, query) {
|
|
6080
|
+
this.client = client;
|
|
6081
|
+
this.connectionSelector = connectionSelector;
|
|
6082
|
+
this.selector = selector;
|
|
6083
|
+
this.elementKey = elementKey;
|
|
6084
|
+
this.query = query;
|
|
6085
|
+
this.endpoint = `/connections/${this.connectionSelector}/${elementKey}/${selector}`;
|
|
6086
|
+
}
|
|
6087
|
+
uri(path = '', query = {}) {
|
|
6088
|
+
return this.endpoint + path + '?' + qs.stringify({ ...this.query, ...query });
|
|
6089
|
+
}
|
|
6090
|
+
getUniqueIdentifier() {
|
|
6091
|
+
return this.endpoint;
|
|
6092
|
+
}
|
|
6093
|
+
async get(query = {}) {
|
|
6094
|
+
return this.client.get(this.uri('', query));
|
|
6095
|
+
}
|
|
6096
|
+
async create() {
|
|
6097
|
+
return this.client.put(this.uri());
|
|
6098
|
+
}
|
|
6099
|
+
async patch(data) {
|
|
6100
|
+
return this.client.patch(this.uri(), data);
|
|
6101
|
+
}
|
|
6102
|
+
async put(data) {
|
|
6103
|
+
return this.client.put(this.uri(), data);
|
|
6104
|
+
}
|
|
6105
|
+
async archive() {
|
|
6106
|
+
return this.client.delete(this.uri());
|
|
6107
|
+
}
|
|
6108
|
+
async reset() {
|
|
6109
|
+
return this.client.post(this.uri('/reset'));
|
|
6110
|
+
}
|
|
6111
|
+
async setup() {
|
|
6112
|
+
return this.client.post(this.uri('/setup'));
|
|
6113
|
+
}
|
|
6114
|
+
}
|
|
6115
|
+
class ConnectionLevelElementsListAccessor {
|
|
6116
|
+
constructor(client, connectionSelector, elementKey) {
|
|
6117
|
+
this.client = client;
|
|
6118
|
+
this.connectionSelector = connectionSelector;
|
|
6119
|
+
this.elementKey = elementKey;
|
|
6120
|
+
}
|
|
6121
|
+
async list(query) {
|
|
6122
|
+
const endpoint = `/connections/${this.connectionSelector}/${this.elementKey}?${qs.stringify(query !== null && query !== void 0 ? query : {})}`;
|
|
6123
|
+
return this.client.get(endpoint);
|
|
6124
|
+
}
|
|
6125
|
+
}
|
|
6126
|
+
|
|
6078
6127
|
class IntegrationLevelElementAccessor {
|
|
6079
6128
|
constructor(client, integrationSelector, elementSelector, elementKey) {
|
|
6080
6129
|
this.client = client;
|
|
@@ -6133,6 +6182,15 @@
|
|
|
6133
6182
|
async reset() {
|
|
6134
6183
|
return await this.options.client.post(this.getPath('reset'));
|
|
6135
6184
|
}
|
|
6185
|
+
async run(input, options) {
|
|
6186
|
+
const queryParams = options
|
|
6187
|
+
? {
|
|
6188
|
+
integrationKey: options.integrationKey,
|
|
6189
|
+
connectionId: options.connectionId,
|
|
6190
|
+
}
|
|
6191
|
+
: {};
|
|
6192
|
+
return this.options.client.post(this.getPath('run'), { input }, { params: queryParams });
|
|
6193
|
+
}
|
|
6136
6194
|
}
|
|
6137
6195
|
class IntegrationLevelActionAccessor extends IntegrationLevelElementAccessor {
|
|
6138
6196
|
constructor(client, integrationSelector, actionSelector) {
|
|
@@ -6149,6 +6207,25 @@
|
|
|
6149
6207
|
this.integrationSelector = integrationSelector;
|
|
6150
6208
|
}
|
|
6151
6209
|
}
|
|
6210
|
+
class ConnectionLevelActionAccessor extends ConnectionLevelElementAccessor {
|
|
6211
|
+
constructor(client, connectionSelector, actionSelector, query) {
|
|
6212
|
+
super(client, connectionSelector, actionSelector, 'actions', query);
|
|
6213
|
+
this.client = client;
|
|
6214
|
+
this.connectionSelector = connectionSelector;
|
|
6215
|
+
this.actionSelector = actionSelector;
|
|
6216
|
+
this.query = query;
|
|
6217
|
+
}
|
|
6218
|
+
async run(input) {
|
|
6219
|
+
return this.client.post(this.uri('/run'), input);
|
|
6220
|
+
}
|
|
6221
|
+
}
|
|
6222
|
+
class ConnectionLevelActionsAccessor extends ConnectionLevelElementsListAccessor {
|
|
6223
|
+
constructor(client, connectionSelector) {
|
|
6224
|
+
super(client, connectionSelector, 'actions');
|
|
6225
|
+
this.client = client;
|
|
6226
|
+
this.connectionSelector = connectionSelector;
|
|
6227
|
+
}
|
|
6228
|
+
}
|
|
6152
6229
|
|
|
6153
6230
|
var urlJoin$1 = {exports: {}};
|
|
6154
6231
|
|
|
@@ -6999,104 +7076,6 @@
|
|
|
6999
7076
|
}
|
|
7000
7077
|
}
|
|
7001
7078
|
|
|
7002
|
-
class ConnectionLevelElementAccessor {
|
|
7003
|
-
constructor(client, connectionSelector, selector, elementKey, query) {
|
|
7004
|
-
this.client = client;
|
|
7005
|
-
this.connectionSelector = connectionSelector;
|
|
7006
|
-
this.selector = selector;
|
|
7007
|
-
this.elementKey = elementKey;
|
|
7008
|
-
this.query = query;
|
|
7009
|
-
this.endpoint = `/connections/${this.connectionSelector}/${elementKey}/${selector}`;
|
|
7010
|
-
}
|
|
7011
|
-
uri(path = '', query = {}) {
|
|
7012
|
-
return this.endpoint + path + '?' + qs.stringify({ ...this.query, ...query });
|
|
7013
|
-
}
|
|
7014
|
-
getUniqueIdentifier() {
|
|
7015
|
-
return this.endpoint;
|
|
7016
|
-
}
|
|
7017
|
-
async get(query = {}) {
|
|
7018
|
-
return this.client.get(this.uri('', query));
|
|
7019
|
-
}
|
|
7020
|
-
async create() {
|
|
7021
|
-
return this.client.put(this.uri());
|
|
7022
|
-
}
|
|
7023
|
-
async patch(data) {
|
|
7024
|
-
return this.client.patch(this.uri(), data);
|
|
7025
|
-
}
|
|
7026
|
-
async put(data) {
|
|
7027
|
-
return this.client.put(this.uri(), data);
|
|
7028
|
-
}
|
|
7029
|
-
async archive() {
|
|
7030
|
-
return this.client.delete(this.uri());
|
|
7031
|
-
}
|
|
7032
|
-
async reset() {
|
|
7033
|
-
return this.client.post(this.uri('/reset'));
|
|
7034
|
-
}
|
|
7035
|
-
async setup() {
|
|
7036
|
-
return this.client.post(this.uri('/setup'));
|
|
7037
|
-
}
|
|
7038
|
-
}
|
|
7039
|
-
class ConnectionLevelElementsListAccessor {
|
|
7040
|
-
constructor(client, connectionSelector, elementKey) {
|
|
7041
|
-
this.client = client;
|
|
7042
|
-
this.connectionSelector = connectionSelector;
|
|
7043
|
-
this.elementKey = elementKey;
|
|
7044
|
-
}
|
|
7045
|
-
async list(query) {
|
|
7046
|
-
const endpoint = `/connections/${this.connectionSelector}/${this.elementKey}?${qs.stringify(query !== null && query !== void 0 ? query : {})}`;
|
|
7047
|
-
return this.client.get(endpoint);
|
|
7048
|
-
}
|
|
7049
|
-
}
|
|
7050
|
-
|
|
7051
|
-
class ActionInstancesAccessor extends ElementInstanceListAccessor {
|
|
7052
|
-
constructor(client) {
|
|
7053
|
-
super(client, 'action-instances');
|
|
7054
|
-
}
|
|
7055
|
-
}
|
|
7056
|
-
class ActionInstanceAccessor extends ElementInstanceAccessor {
|
|
7057
|
-
constructor(client, selector) {
|
|
7058
|
-
super({
|
|
7059
|
-
client,
|
|
7060
|
-
instancePath: 'action-instance',
|
|
7061
|
-
selector,
|
|
7062
|
-
});
|
|
7063
|
-
this.client = client;
|
|
7064
|
-
}
|
|
7065
|
-
async setup() {
|
|
7066
|
-
await this.client.post(this.getPath('setup'));
|
|
7067
|
-
}
|
|
7068
|
-
async reset() {
|
|
7069
|
-
await this.client.post(this.getPath('reset'));
|
|
7070
|
-
}
|
|
7071
|
-
async run(input) {
|
|
7072
|
-
return this.client.post(this.getPath('run'), input);
|
|
7073
|
-
}
|
|
7074
|
-
async open({ onClose = () => { } } = {}) {
|
|
7075
|
-
const id = await this.getId();
|
|
7076
|
-
const uri = await this.client.getEmbedUri(`action-instances/${id}/configuration`);
|
|
7077
|
-
return openIframe(uri, { onClose });
|
|
7078
|
-
}
|
|
7079
|
-
}
|
|
7080
|
-
class ConnectionLevelActionAccessor extends ConnectionLevelElementAccessor {
|
|
7081
|
-
constructor(client, connectionSelector, actionSelector, query) {
|
|
7082
|
-
super(client, connectionSelector, actionSelector, 'actions', query);
|
|
7083
|
-
this.client = client;
|
|
7084
|
-
this.connectionSelector = connectionSelector;
|
|
7085
|
-
this.actionSelector = actionSelector;
|
|
7086
|
-
this.query = query;
|
|
7087
|
-
}
|
|
7088
|
-
async run(input) {
|
|
7089
|
-
return this.client.post(this.uri('/run'), input);
|
|
7090
|
-
}
|
|
7091
|
-
}
|
|
7092
|
-
class ConnectionLevelActionsAccessor extends ConnectionLevelElementsListAccessor {
|
|
7093
|
-
constructor(client, connectionSelector) {
|
|
7094
|
-
super(client, connectionSelector, 'actions');
|
|
7095
|
-
this.client = client;
|
|
7096
|
-
this.connectionSelector = connectionSelector;
|
|
7097
|
-
}
|
|
7098
|
-
}
|
|
7099
|
-
|
|
7100
7079
|
class DataSourcesAccessor extends ElementListAccessor {
|
|
7101
7080
|
constructor(client) {
|
|
7102
7081
|
super(client, 'data-sources');
|
|
@@ -11251,6 +11230,7 @@
|
|
|
11251
11230
|
return Boolean(val);
|
|
11252
11231
|
return Boolean(val);
|
|
11253
11232
|
}, boolean());
|
|
11233
|
+
|
|
11254
11234
|
const IncludeArchivedQuery = object({
|
|
11255
11235
|
includeArchived: zodBooleanCoercion().optional(),
|
|
11256
11236
|
});
|
|
@@ -11303,7 +11283,6 @@
|
|
|
11303
11283
|
WorkspaceElementType["ExternalEventSubscription"] = "external-event-subscription";
|
|
11304
11284
|
WorkspaceElementType["ExternalEventLogRecord"] = "external-event-log-record";
|
|
11305
11285
|
WorkspaceElementType["ExternalEventPull"] = "external-event-pull";
|
|
11306
|
-
WorkspaceElementType["DataCollection"] = "data-collection";
|
|
11307
11286
|
WorkspaceElementType["Screen"] = "screen";
|
|
11308
11287
|
WorkspaceElementType["ActionRunLogRecord"] = "action-run-log-record";
|
|
11309
11288
|
})(WorkspaceElementType || (WorkspaceElementType = {}));
|
|
@@ -11335,9 +11314,9 @@
|
|
|
11335
11314
|
name: string(),
|
|
11336
11315
|
});
|
|
11337
11316
|
const BaseMembraneInterfaceEditableProperties = object({
|
|
11317
|
+
uuid: string().optional(),
|
|
11338
11318
|
key: string().optional(),
|
|
11339
11319
|
name: string().optional(),
|
|
11340
|
-
uuid: string().optional(),
|
|
11341
11320
|
description: string().optional(),
|
|
11342
11321
|
meta: record(string(), any()).optional(),
|
|
11343
11322
|
});
|
|
@@ -11353,14 +11332,20 @@
|
|
|
11353
11332
|
});
|
|
11354
11333
|
const BaseMembraneInterface = BaseWorkspaceElement.merge(BaseMembraneInterfaceEditableProperties).merge(BaseMembraneInterfaceReadOnlyProperties);
|
|
11355
11334
|
const BaseIntegrationLevelMembraneInterfaceEditableProperties = BaseMembraneInterfaceEditableProperties.extend({
|
|
11356
|
-
integrationUuid: string().optional(),
|
|
11357
|
-
parentUuid: string().optional(),
|
|
11358
11335
|
integrationId: string().optional(),
|
|
11336
|
+
integrationUuid: string().optional(),
|
|
11359
11337
|
parentId: string().optional(),
|
|
11338
|
+
parentUuid: string().optional(),
|
|
11339
|
+
connectionId: string().optional(),
|
|
11340
|
+
instanceKey: string().optional(),
|
|
11360
11341
|
});
|
|
11361
11342
|
const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
|
|
11362
11343
|
isCustomized: boolean().optional(),
|
|
11363
11344
|
});
|
|
11345
|
+
BaseMembraneInterfaceEditableProperties.extend({
|
|
11346
|
+
integrationUuid: string().optional(),
|
|
11347
|
+
parentUuid: string().optional(),
|
|
11348
|
+
});
|
|
11364
11349
|
const IntegrationLevelMembraneInterfaceSelectorQuery = object({
|
|
11365
11350
|
layer: _enum(['universal', 'integration', 'connection']).optional(),
|
|
11366
11351
|
integrationKey: string().optional(),
|
|
@@ -12129,6 +12114,36 @@
|
|
|
12129
12114
|
}
|
|
12130
12115
|
}
|
|
12131
12116
|
|
|
12117
|
+
class ActionInstancesAccessor extends ElementInstanceListAccessor {
|
|
12118
|
+
constructor(client) {
|
|
12119
|
+
super(client, 'action-instances');
|
|
12120
|
+
}
|
|
12121
|
+
}
|
|
12122
|
+
class ActionInstanceAccessor extends ElementInstanceAccessor {
|
|
12123
|
+
constructor(client, selector) {
|
|
12124
|
+
super({
|
|
12125
|
+
client,
|
|
12126
|
+
instancePath: 'action-instance',
|
|
12127
|
+
selector,
|
|
12128
|
+
});
|
|
12129
|
+
this.client = client;
|
|
12130
|
+
}
|
|
12131
|
+
async setup() {
|
|
12132
|
+
await this.client.post(this.getPath('setup'));
|
|
12133
|
+
}
|
|
12134
|
+
async reset() {
|
|
12135
|
+
await this.client.post(this.getPath('reset'));
|
|
12136
|
+
}
|
|
12137
|
+
async run(input) {
|
|
12138
|
+
return this.client.post(this.getPath('run'), input);
|
|
12139
|
+
}
|
|
12140
|
+
async open({ onClose = () => { } } = {}) {
|
|
12141
|
+
const id = await this.getId();
|
|
12142
|
+
const uri = await this.client.getEmbedUri(`action-instances/${id}/configuration`);
|
|
12143
|
+
return openIframe(uri, { onClose });
|
|
12144
|
+
}
|
|
12145
|
+
}
|
|
12146
|
+
|
|
12132
12147
|
class DataLinkTablesAccessor extends ElementListAccessor {
|
|
12133
12148
|
constructor(client) {
|
|
12134
12149
|
super(client, 'data-link-tables');
|
|
@@ -16205,6 +16220,9 @@
|
|
|
16205
16220
|
const DEFAULT_UI_URI = 'https://ui.integration.app';
|
|
16206
16221
|
const REFETCH_EXPIRATION_THRESHOLD = 10 * 1000;
|
|
16207
16222
|
function decodeToken(token) {
|
|
16223
|
+
if (token.startsWith('pat-')) {
|
|
16224
|
+
return null;
|
|
16225
|
+
}
|
|
16208
16226
|
const payload = decodeJWT(token);
|
|
16209
16227
|
if (!payload) {
|
|
16210
16228
|
throw new Error('Access token should be a valid JWT token.');
|
|
@@ -16234,7 +16252,7 @@
|
|
|
16234
16252
|
}
|
|
16235
16253
|
else {
|
|
16236
16254
|
const payload = decodeToken(this.token);
|
|
16237
|
-
if (payload.exp) {
|
|
16255
|
+
if (payload === null || payload === void 0 ? void 0 : payload.exp) {
|
|
16238
16256
|
const willExpireSoon = new Date(payload.exp * 1000).getTime() - new Date().getTime() < REFETCH_EXPIRATION_THRESHOLD;
|
|
16239
16257
|
if (willExpireSoon) {
|
|
16240
16258
|
this.token = await this.fetchToken();
|