@membranehq/sdk 0.8.4 → 0.9.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.
- package/dist/bundle.d.ts +423 -293
- package/dist/bundle.js +142 -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 +7 -5
- package/dist/dts/accessors/integrations-accessors.d.ts +7 -5
- package/dist/dts/agent/index.d.ts +2 -0
- package/dist/dts/agent/mcp.d.ts +6 -0
- package/dist/dts/agent/session.d.ts +4 -1
- package/dist/dts/alerts/types.d.ts +2 -1
- package/dist/dts/api-version.generated.d.ts +10 -0
- package/dist/dts/apps/types.d.ts +371 -0
- package/dist/dts/entity-repository.d.ts +0 -1
- package/dist/dts/errors/index.d.ts +5 -1
- package/dist/dts/formulas/dataSchemaRef.d.ts +3 -3
- package/dist/dts/index.browser.d.ts +4 -2
- package/dist/dts/orgs/types.d.ts +342 -3
- package/dist/dts/platform-users.d.ts +24 -0
- 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 +15 -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 +9 -3
- package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +9 -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 +11 -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 +10 -7
- package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +10 -7
- package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +9 -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 +24 -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 +18 -14
- package/dist/dts/workspace-elements/api/flows-api.d.ts +133 -29
- package/dist/dts/workspace-elements/api/integrations-api.d.ts +5 -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/action-run-log-records/types.d.ts +2 -0
- 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/connections/types.d.ts +2 -0
- 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/compare.d.ts +16 -0
- package/dist/dts/workspace-elements/compare.test.d.ts +1 -0
- package/dist/dts/workspace-elements/index.d.ts +1 -0
- 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/index.d.ts +1 -0
- package/dist/dts/workspaces/schemas.d.ts +24 -0
- package/dist/dts/workspaces/types.d.ts +3 -9
- package/dist/index.browser.d.mts +9626 -8664
- package/dist/index.browser.d.ts +9626 -8664
- package/dist/index.browser.js +526 -273
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +502 -273
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +9647 -8685
- package/dist/index.node.d.ts +9647 -8685
- package/dist/index.node.js +526 -273
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +502 -273
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -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');
|
|
@@ -10941,6 +10920,7 @@
|
|
|
10941
10920
|
ErrorType["ACTION_INSTANCE_SETUP"] = "action_instance_setup";
|
|
10942
10921
|
ErrorType["UNIT_RUN"] = "unit_run";
|
|
10943
10922
|
ErrorType["CUSTOM_CODE"] = "custom_code";
|
|
10923
|
+
ErrorType["INSUFFICIENT_CREDIT"] = "insufficient_credit";
|
|
10944
10924
|
})(ErrorType || (ErrorType = {}));
|
|
10945
10925
|
var BadRequestErrorKey;
|
|
10946
10926
|
(function (BadRequestErrorKey) {
|
|
@@ -11065,6 +11045,12 @@
|
|
|
11065
11045
|
this.data.type = ErrorType.CUSTOM_CODE;
|
|
11066
11046
|
}
|
|
11067
11047
|
}
|
|
11048
|
+
class InsufficientCreditsError extends MembraneError {
|
|
11049
|
+
constructor(arg) {
|
|
11050
|
+
super(arg);
|
|
11051
|
+
this.data.type = ErrorType.INSUFFICIENT_CREDIT;
|
|
11052
|
+
}
|
|
11053
|
+
}
|
|
11068
11054
|
|
|
11069
11055
|
var FlowRunNodeState;
|
|
11070
11056
|
(function (FlowRunNodeState) {
|
|
@@ -11251,6 +11237,7 @@
|
|
|
11251
11237
|
return Boolean(val);
|
|
11252
11238
|
return Boolean(val);
|
|
11253
11239
|
}, boolean());
|
|
11240
|
+
|
|
11254
11241
|
const IncludeArchivedQuery = object({
|
|
11255
11242
|
includeArchived: zodBooleanCoercion().optional(),
|
|
11256
11243
|
});
|
|
@@ -11303,7 +11290,6 @@
|
|
|
11303
11290
|
WorkspaceElementType["ExternalEventSubscription"] = "external-event-subscription";
|
|
11304
11291
|
WorkspaceElementType["ExternalEventLogRecord"] = "external-event-log-record";
|
|
11305
11292
|
WorkspaceElementType["ExternalEventPull"] = "external-event-pull";
|
|
11306
|
-
WorkspaceElementType["DataCollection"] = "data-collection";
|
|
11307
11293
|
WorkspaceElementType["Screen"] = "screen";
|
|
11308
11294
|
WorkspaceElementType["ActionRunLogRecord"] = "action-run-log-record";
|
|
11309
11295
|
})(WorkspaceElementType || (WorkspaceElementType = {}));
|
|
@@ -11335,9 +11321,9 @@
|
|
|
11335
11321
|
name: string(),
|
|
11336
11322
|
});
|
|
11337
11323
|
const BaseMembraneInterfaceEditableProperties = object({
|
|
11324
|
+
uuid: string().optional(),
|
|
11338
11325
|
key: string().optional(),
|
|
11339
11326
|
name: string().optional(),
|
|
11340
|
-
uuid: string().optional(),
|
|
11341
11327
|
description: string().optional(),
|
|
11342
11328
|
meta: record(string(), any()).optional(),
|
|
11343
11329
|
});
|
|
@@ -11353,14 +11339,20 @@
|
|
|
11353
11339
|
});
|
|
11354
11340
|
const BaseMembraneInterface = BaseWorkspaceElement.merge(BaseMembraneInterfaceEditableProperties).merge(BaseMembraneInterfaceReadOnlyProperties);
|
|
11355
11341
|
const BaseIntegrationLevelMembraneInterfaceEditableProperties = BaseMembraneInterfaceEditableProperties.extend({
|
|
11356
|
-
integrationUuid: string().optional(),
|
|
11357
|
-
parentUuid: string().optional(),
|
|
11358
11342
|
integrationId: string().optional(),
|
|
11343
|
+
integrationUuid: string().optional(),
|
|
11359
11344
|
parentId: string().optional(),
|
|
11345
|
+
parentUuid: string().optional(),
|
|
11346
|
+
connectionId: string().optional(),
|
|
11347
|
+
instanceKey: string().optional(),
|
|
11360
11348
|
});
|
|
11361
11349
|
const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
|
|
11362
11350
|
isCustomized: boolean().optional(),
|
|
11363
11351
|
});
|
|
11352
|
+
BaseMembraneInterfaceEditableProperties.extend({
|
|
11353
|
+
integrationUuid: string().optional(),
|
|
11354
|
+
parentUuid: string().optional(),
|
|
11355
|
+
});
|
|
11364
11356
|
const IntegrationLevelMembraneInterfaceSelectorQuery = object({
|
|
11365
11357
|
layer: _enum(['universal', 'integration', 'connection']).optional(),
|
|
11366
11358
|
integrationKey: string().optional(),
|
|
@@ -12129,6 +12121,36 @@
|
|
|
12129
12121
|
}
|
|
12130
12122
|
}
|
|
12131
12123
|
|
|
12124
|
+
class ActionInstancesAccessor extends ElementInstanceListAccessor {
|
|
12125
|
+
constructor(client) {
|
|
12126
|
+
super(client, 'action-instances');
|
|
12127
|
+
}
|
|
12128
|
+
}
|
|
12129
|
+
class ActionInstanceAccessor extends ElementInstanceAccessor {
|
|
12130
|
+
constructor(client, selector) {
|
|
12131
|
+
super({
|
|
12132
|
+
client,
|
|
12133
|
+
instancePath: 'action-instance',
|
|
12134
|
+
selector,
|
|
12135
|
+
});
|
|
12136
|
+
this.client = client;
|
|
12137
|
+
}
|
|
12138
|
+
async setup() {
|
|
12139
|
+
await this.client.post(this.getPath('setup'));
|
|
12140
|
+
}
|
|
12141
|
+
async reset() {
|
|
12142
|
+
await this.client.post(this.getPath('reset'));
|
|
12143
|
+
}
|
|
12144
|
+
async run(input) {
|
|
12145
|
+
return this.client.post(this.getPath('run'), input);
|
|
12146
|
+
}
|
|
12147
|
+
async open({ onClose = () => { } } = {}) {
|
|
12148
|
+
const id = await this.getId();
|
|
12149
|
+
const uri = await this.client.getEmbedUri(`action-instances/${id}/configuration`);
|
|
12150
|
+
return openIframe(uri, { onClose });
|
|
12151
|
+
}
|
|
12152
|
+
}
|
|
12153
|
+
|
|
12132
12154
|
class DataLinkTablesAccessor extends ElementListAccessor {
|
|
12133
12155
|
constructor(client) {
|
|
12134
12156
|
super(client, 'data-link-tables');
|
|
@@ -16131,6 +16153,18 @@
|
|
|
16131
16153
|
mergeConfig
|
|
16132
16154
|
} = axios$1$1;
|
|
16133
16155
|
|
|
16156
|
+
const API_VERSIONS = {
|
|
16157
|
+
LEGACY: 'legacy',
|
|
16158
|
+
'2025-10-21': '2025-10-21',
|
|
16159
|
+
};
|
|
16160
|
+
const AVAILABLE_VERSIONS = Object.values(API_VERSIONS);
|
|
16161
|
+
const CHRONOLOGICAL_VERSIONS = [
|
|
16162
|
+
API_VERSIONS.LEGACY,
|
|
16163
|
+
...[...AVAILABLE_VERSIONS].filter((v) => v !== API_VERSIONS.LEGACY).sort(),
|
|
16164
|
+
];
|
|
16165
|
+
const LATEST_API_VERSION = CHRONOLOGICAL_VERSIONS[CHRONOLOGICAL_VERSIONS.length - 1];
|
|
16166
|
+
const VERSION_HEADER = 'membrane-api-version';
|
|
16167
|
+
|
|
16134
16168
|
var LogRecordType;
|
|
16135
16169
|
(function (LogRecordType) {
|
|
16136
16170
|
LogRecordType["MSG"] = "message";
|
|
@@ -16162,6 +16196,7 @@
|
|
|
16162
16196
|
[ErrorType.ACTION_INSTANCE_SETUP]: ActionInstanceSetupError,
|
|
16163
16197
|
[ErrorType.UNIT_RUN]: UnitRunError,
|
|
16164
16198
|
[ErrorType.CUSTOM_CODE]: CustomCodeError,
|
|
16199
|
+
[ErrorType.INSUFFICIENT_CREDIT]: InsufficientCreditsError,
|
|
16165
16200
|
};
|
|
16166
16201
|
function getErrorFromData(data) {
|
|
16167
16202
|
if (typeof data === 'object' &&
|
|
@@ -16205,6 +16240,9 @@
|
|
|
16205
16240
|
const DEFAULT_UI_URI = 'https://ui.integration.app';
|
|
16206
16241
|
const REFETCH_EXPIRATION_THRESHOLD = 10 * 1000;
|
|
16207
16242
|
function decodeToken(token) {
|
|
16243
|
+
if (token.startsWith('pat-')) {
|
|
16244
|
+
return null;
|
|
16245
|
+
}
|
|
16208
16246
|
const payload = decodeJWT(token);
|
|
16209
16247
|
if (!payload) {
|
|
16210
16248
|
throw new Error('Access token should be a valid JWT token.');
|
|
@@ -16234,7 +16272,7 @@
|
|
|
16234
16272
|
}
|
|
16235
16273
|
else {
|
|
16236
16274
|
const payload = decodeToken(this.token);
|
|
16237
|
-
if (payload.exp) {
|
|
16275
|
+
if (payload === null || payload === void 0 ? void 0 : payload.exp) {
|
|
16238
16276
|
const willExpireSoon = new Date(payload.exp * 1000).getTime() - new Date().getTime() < REFETCH_EXPIRATION_THRESHOLD;
|
|
16239
16277
|
if (willExpireSoon) {
|
|
16240
16278
|
this.token = await this.fetchToken();
|
|
@@ -16292,6 +16330,7 @@
|
|
|
16292
16330
|
params.headers = {
|
|
16293
16331
|
...(params.headers || {}),
|
|
16294
16332
|
Authorization: `Bearer ${token}`,
|
|
16333
|
+
[VERSION_HEADER]: LATEST_API_VERSION,
|
|
16295
16334
|
};
|
|
16296
16335
|
params.withCredentials = false;
|
|
16297
16336
|
let response;
|