@membranehq/sdk 0.28.0 → 0.28.2
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 +60 -4
- package/dist/bundle.js +233 -126
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/actions-accessors.d.ts +1 -0
- package/dist/dts/accessors/connections-accessors.d.ts +3 -0
- package/dist/dts/accessors/integrations-accessors.d.ts +2 -0
- package/dist/dts/agent/index.d.ts +1 -0
- package/dist/dts/agent/session-cost.d.ts +1 -0
- package/dist/dts/agent/session.d.ts +10 -2
- package/dist/dts/ai-gateway/models.d.ts +43 -0
- package/dist/dts/ai-gateway/models.test.d.ts +1 -0
- package/dist/dts/alerts/types.d.ts +7 -0
- package/dist/dts/api-client.d.ts +22 -3
- package/dist/dts/api-version.generated.d.ts +1 -1
- package/dist/dts/index.browser.d.ts +1 -0
- package/dist/dts/membrane-instances/types.d.ts +19 -35
- package/dist/dts/membrane-instances/types.test.d.ts +1 -0
- package/dist/dts/oauth/types.d.ts +11 -5
- package/dist/dts/orgs/types.d.ts +154 -281
- package/dist/dts/webhooks/types.d.ts +4 -2
- package/dist/dts/workspace-elements/api/act-api.d.ts +33 -0
- package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +4 -0
- package/dist/dts/workspace-elements/api/actions-api.d.ts +3 -0
- package/dist/dts/workspace-elements/api/connected-products-api.d.ts +6 -21
- package/dist/dts/workspace-elements/api/connection-attempt-logs-api.d.ts +53 -0
- package/dist/dts/workspace-elements/api/connections-api.d.ts +15 -0
- package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +3 -0
- package/dist/dts/workspace-elements/api/data-sources-api.d.ts +6 -0
- package/dist/dts/workspace-elements/api/external-api-logs-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +5 -1
- package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +6 -0
- package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +4 -0
- package/dist/dts/workspace-elements/api/flows-api.d.ts +5 -0
- package/dist/dts/workspace-elements/api/incoming-webhooks-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/index.d.ts +2 -0
- package/dist/dts/workspace-elements/api/integrations-api.d.ts +113 -0
- package/dist/dts/workspace-elements/api/packages-api.d.ts +1 -0
- package/dist/dts/workspace-elements/base/connected-products/index.d.ts +9 -14
- package/dist/dts/workspace-elements/base/connection-attempt-logs/index.d.ts +21 -0
- package/dist/dts/workspace-elements/base/connection-requests/index.d.ts +2 -0
- package/dist/dts/workspace-elements/base/connections/index.d.ts +3 -0
- package/dist/dts/workspace-elements/base/connectors/functions.d.ts +1 -1
- package/dist/dts/workspace-elements/base/connectors/index.d.ts +2 -0
- package/dist/dts/workspace-elements/base/connectors/rest-api.d.ts +1 -1
- package/dist/dts/workspace-elements/base/index.d.ts +1 -0
- package/dist/dts/workspace-elements/paths.d.ts +2 -2
- package/dist/dts/workspace-elements/types.d.ts +4 -1
- package/dist/dts/workspaces/api.d.ts +20 -0
- package/dist/dts/workspaces/compare.d.ts +1 -1
- package/dist/dts/workspaces/types.d.ts +29 -0
- package/dist/index.browser.d.mts +637 -373
- package/dist/index.browser.d.ts +637 -373
- package/dist/index.browser.js +307 -47
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +287 -44
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +637 -373
- package/dist/index.node.d.ts +637 -373
- package/dist/index.node.js +307 -47
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +287 -44
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.node.js
CHANGED
|
@@ -3523,6 +3523,7 @@ exports.WorkspaceElementState = void 0;
|
|
|
3523
3523
|
WorkspaceElementState["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
|
3524
3524
|
WorkspaceElementState["SETUP_FAILED"] = "SETUP_FAILED";
|
|
3525
3525
|
WorkspaceElementState["READY"] = "READY";
|
|
3526
|
+
WorkspaceElementState["DISCONNECTING"] = "DISCONNECTING";
|
|
3526
3527
|
})(exports.WorkspaceElementState || (exports.WorkspaceElementState = {}));
|
|
3527
3528
|
exports.WorkspaceElementDependencyType = void 0;
|
|
3528
3529
|
(function (WorkspaceElementDependencyType) {
|
|
@@ -3664,6 +3665,12 @@ const IntegrationLevelMembraneInterfaceSelectorQuery = z.z.object({
|
|
|
3664
3665
|
filterTitle: 'Connection',
|
|
3665
3666
|
referenceElementType: exports.WorkspaceElementType.Connection,
|
|
3666
3667
|
}),
|
|
3668
|
+
connectionKey: z.z
|
|
3669
|
+
.string()
|
|
3670
|
+
.optional()
|
|
3671
|
+
.meta({
|
|
3672
|
+
hidden: true,
|
|
3673
|
+
}),
|
|
3667
3674
|
instanceKey: z.z
|
|
3668
3675
|
.string()
|
|
3669
3676
|
.optional()
|
|
@@ -3997,6 +4004,7 @@ const CreateConnectionRequestPayload = z.z.object({
|
|
|
3997
4004
|
connectorKey: z.z.string().optional(),
|
|
3998
4005
|
connectorVersion: z.z.string().optional(),
|
|
3999
4006
|
connectionId: z.z.string().optional(),
|
|
4007
|
+
connectionKey: z.z.string().min(1).max(100).optional(),
|
|
4000
4008
|
name: z.z.string().optional(),
|
|
4001
4009
|
allowMultipleConnections: z.z.boolean().optional(),
|
|
4002
4010
|
connectorParameters: z.z.record(z.z.string(), z.z.unknown()).optional(),
|
|
@@ -4013,6 +4021,7 @@ const ConnectionRequest = z.z.object({
|
|
|
4013
4021
|
connectorKey: z.z.string().optional(),
|
|
4014
4022
|
connectorVersion: z.z.string().optional(),
|
|
4015
4023
|
connectionId: z.z.string().optional(),
|
|
4024
|
+
connectionKey: z.z.string().optional(),
|
|
4016
4025
|
name: z.z.string().optional(),
|
|
4017
4026
|
allowMultipleConnections: z.z.boolean().optional(),
|
|
4018
4027
|
connectorParameters: z.z.record(z.z.string(), z.z.unknown()).optional(),
|
|
@@ -4029,6 +4038,7 @@ const ConnectionEditableProperties = z.z.object({
|
|
|
4029
4038
|
name: z.z.string().optional(),
|
|
4030
4039
|
meta: z.z.record(z.z.string(), z.z.any()).optional(),
|
|
4031
4040
|
authOptionKey: z.z.string().optional(),
|
|
4041
|
+
key: z.z.string().min(1).max(100).optional().nullable(),
|
|
4032
4042
|
integrationId: z.z.string().optional(),
|
|
4033
4043
|
integrationUuid: z.z.string().optional(),
|
|
4034
4044
|
integrationKey: z.z.string().optional(),
|
|
@@ -4051,8 +4061,10 @@ const ConnectionClientAction = z.z.object({
|
|
|
4051
4061
|
const BaseConnection = BaseWorkspaceElement.extend({
|
|
4052
4062
|
...TenantLayerElement.shape,
|
|
4053
4063
|
name: z.z.string(),
|
|
4064
|
+
key: z.z.string().optional(),
|
|
4054
4065
|
isTest: z.z.boolean().optional(),
|
|
4055
|
-
|
|
4066
|
+
connected: z.z.boolean().optional(),
|
|
4067
|
+
disconnected: z.z.boolean().optional().describe('[DEPRECATED] Use `connected` instead.'),
|
|
4056
4068
|
isDefunct: z.z.boolean().optional(),
|
|
4057
4069
|
state: z.z.enum(exports.WorkspaceElementState).optional(),
|
|
4058
4070
|
errors: z.z.array(ErrorDataSchema).optional(),
|
|
@@ -4623,7 +4635,7 @@ function getEffectiveConnectorOption(connector, optionKey) {
|
|
|
4623
4635
|
if (optionKey === '') {
|
|
4624
4636
|
return connector;
|
|
4625
4637
|
}
|
|
4626
|
-
|
|
4638
|
+
return undefined;
|
|
4627
4639
|
}
|
|
4628
4640
|
const connectorInputSchema = (_b = connector.inputSchema) !== null && _b !== void 0 ? _b : (_c = connector.ui) === null || _c === void 0 ? void 0 : _c.schema;
|
|
4629
4641
|
const optionInputSchema = (_d = option === null || option === void 0 ? void 0 : option.inputSchema) !== null && _d !== void 0 ? _d : (_e = option === null || option === void 0 ? void 0 : option.ui) === null || _e === void 0 ? void 0 : _e.schema;
|
|
@@ -9304,6 +9316,7 @@ const BaseConnector = z.z.object({
|
|
|
9304
9316
|
isPublic: z.z.boolean().optional(),
|
|
9305
9317
|
popularity: z.z.number().optional(),
|
|
9306
9318
|
tenantId: z.z.string().optional(),
|
|
9319
|
+
archivedAt: z.z.string().optional().describe('When set, the connector is archived (soft-deleted).'),
|
|
9307
9320
|
});
|
|
9308
9321
|
const Connector = z.z.object({}).extend(BaseConnector.shape).extend(ConnectorVersionData.shape);
|
|
9309
9322
|
const MinimalConnector = z.z.object({
|
|
@@ -10280,10 +10293,22 @@ const BaseActionRunLogRecord = ActivityLogRecord.extend({
|
|
|
10280
10293
|
const ConnectedProductType = z.z.enum(['ai-agent', 'app']);
|
|
10281
10294
|
const ConnectedProductAudience = z.z.enum(['personal', 'customers']);
|
|
10282
10295
|
const AiAgentAudience = ConnectedProductAudience;
|
|
10283
|
-
const AiAgentType = z.z.enum([
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10296
|
+
const AiAgentType = z.z.enum([
|
|
10297
|
+
'claude-code',
|
|
10298
|
+
'codex',
|
|
10299
|
+
'openclaw',
|
|
10300
|
+
'cursor',
|
|
10301
|
+
'copilot',
|
|
10302
|
+
'windsurf',
|
|
10303
|
+
'claude',
|
|
10304
|
+
'chatgpt',
|
|
10305
|
+
'custom',
|
|
10306
|
+
]);
|
|
10307
|
+
const AiAgentParameters = z.z
|
|
10308
|
+
.object({
|
|
10309
|
+
agentType: z.z.string().optional(),
|
|
10310
|
+
})
|
|
10311
|
+
.passthrough();
|
|
10287
10312
|
const BaseConnectedProduct = z.z.object({
|
|
10288
10313
|
id: z.z.string(),
|
|
10289
10314
|
name: z.z.string(),
|
|
@@ -10297,6 +10322,61 @@ const BaseConnectedProduct = z.z.object({
|
|
|
10297
10322
|
archivedAt: z.z.string().optional(),
|
|
10298
10323
|
});
|
|
10299
10324
|
|
|
10325
|
+
const BaseConnectionAttemptLog = ActivityLogRecord.extend({
|
|
10326
|
+
connectorId: z.z.string().optional(),
|
|
10327
|
+
connectorVersion: z.z.string().optional(),
|
|
10328
|
+
authOptionKey: z.z.string().optional(),
|
|
10329
|
+
connectionRequestId: z.z.string().optional(),
|
|
10330
|
+
status: z.z.enum(['success', 'error']),
|
|
10331
|
+
error: ErrorDataSchema.optional(),
|
|
10332
|
+
createdAt: z.z.string(),
|
|
10333
|
+
});
|
|
10334
|
+
|
|
10335
|
+
const ActApiDispatch = z.z.object({
|
|
10336
|
+
method: z.z.enum(exports.HttpRequestMethod).describe('HTTP method to use.'),
|
|
10337
|
+
path: z.z.string().optional().describe("Path appended to the connection's base URL, e.g. `/v2/users/me`. Required."),
|
|
10338
|
+
body: z.z.any().optional().describe('Request body. For JSON APIs, pass a plain object.'),
|
|
10339
|
+
headers: z.z.record(z.z.string(), z.z.string()).optional().describe('Additional HTTP headers.'),
|
|
10340
|
+
query: z.z
|
|
10341
|
+
.record(z.z.string(), z.z.union([z.z.string(), z.z.number(), z.z.boolean()]))
|
|
10342
|
+
.optional()
|
|
10343
|
+
.describe('Query-string parameters.'),
|
|
10344
|
+
url: z.z.string().optional().describe('[INTERNAL] Alias for `path`. Normalized to `path` on the server.'),
|
|
10345
|
+
data: z.z.any().optional().describe('[INTERNAL] Alias for `body`. Normalized to `body` on the server.'),
|
|
10346
|
+
});
|
|
10347
|
+
const ActRequest = z.z
|
|
10348
|
+
.object({
|
|
10349
|
+
id: z.z.string().optional().describe('ID of the action to run.'),
|
|
10350
|
+
key: z.z
|
|
10351
|
+
.string()
|
|
10352
|
+
.optional()
|
|
10353
|
+
.describe('Key of the action to run. If the same key exists across multiple integrations, also pass `integrationId`, `integrationKey`, or `connectionId` so we know which one you mean.'),
|
|
10354
|
+
api: ActApiDispatch.optional().describe("Inline HTTP request spec, sent through the resolved connection's auth layer and base URL. Pair with `connectionId`, `connectionKey`, `integrationId`, or `integrationKey` to pick the connection."),
|
|
10355
|
+
code: z.z
|
|
10356
|
+
.string()
|
|
10357
|
+
.optional()
|
|
10358
|
+
.describe('Inline JavaScript executed in a sandbox. The module must export a function that receives `{ input, membrane, ... }`. Its return value becomes the action output.'),
|
|
10359
|
+
integrationId: z.z
|
|
10360
|
+
.string()
|
|
10361
|
+
.optional()
|
|
10362
|
+
.describe("ID of the integration to run the action on. When `key` is provided, looks up the action within this integration. When no connection is specified, runs against this integration's default connection."),
|
|
10363
|
+
integrationKey: z.z
|
|
10364
|
+
.string()
|
|
10365
|
+
.optional()
|
|
10366
|
+
.describe("Key of the integration to run the action on. When `key` is provided, looks up the action within this integration. When no connection is specified, runs against this integration's default connection."),
|
|
10367
|
+
connectionId: z.z
|
|
10368
|
+
.string()
|
|
10369
|
+
.optional()
|
|
10370
|
+
.describe('ID of the connection to run the action against. If a connection-level version of the action exists on this connection, that version is used; otherwise the integration-level or universal action is used.'),
|
|
10371
|
+
connectionKey: z.z
|
|
10372
|
+
.string()
|
|
10373
|
+
.optional()
|
|
10374
|
+
.describe('Key of the connection to run the action against. Use when you have a stable key for the connection instead of an ID.'),
|
|
10375
|
+
input: z.z.any().optional().describe('Input passed to the action, matching its input schema.'),
|
|
10376
|
+
meta: z.z.record(z.z.string(), z.z.any()).optional().describe('Arbitrary metadata stored on the action run log.'),
|
|
10377
|
+
})
|
|
10378
|
+
.strict();
|
|
10379
|
+
|
|
10300
10380
|
const ActionApiResponse = BaseAction.extend({
|
|
10301
10381
|
integration: BaseIntegration.optional(),
|
|
10302
10382
|
user: BaseCustomer.optional(),
|
|
@@ -10453,11 +10533,19 @@ const FindConnectionsQuery = PaginationQuery.merge(SearchQuery)
|
|
|
10453
10533
|
filterTitle: 'External App',
|
|
10454
10534
|
referenceElementType: exports.WorkspaceElementType.App,
|
|
10455
10535
|
}),
|
|
10536
|
+
connected: zodBooleanCoercion()
|
|
10537
|
+
.optional()
|
|
10538
|
+
.meta({
|
|
10539
|
+
filterTitle: 'Connected',
|
|
10540
|
+
isFlag: true,
|
|
10541
|
+
}),
|
|
10456
10542
|
disconnected: zodBooleanCoercion()
|
|
10457
10543
|
.optional()
|
|
10544
|
+
.describe('[DEPRECATED] Use `connected` instead.')
|
|
10458
10545
|
.meta({
|
|
10459
10546
|
filterTitle: 'Disconnected',
|
|
10460
10547
|
isFlag: true,
|
|
10548
|
+
hidden: true,
|
|
10461
10549
|
}),
|
|
10462
10550
|
isTest: zodBooleanCoercion()
|
|
10463
10551
|
.optional()
|
|
@@ -10545,6 +10633,7 @@ const ConnectionSelector = z.z.object({
|
|
|
10545
10633
|
integrationKey: z.z.string().optional(),
|
|
10546
10634
|
integrationId: z.z.string().optional(),
|
|
10547
10635
|
connectionId: z.z.string().optional(),
|
|
10636
|
+
connectionKey: z.z.string().optional(),
|
|
10548
10637
|
});
|
|
10549
10638
|
const ConnectionApiResponse = BaseConnection.extend({
|
|
10550
10639
|
user: BaseCustomer.optional(),
|
|
@@ -10588,6 +10677,7 @@ const ConnectPayload = z.z.object({
|
|
|
10588
10677
|
connectorKey: z.z.string().optional(),
|
|
10589
10678
|
connectorVersion: z.z.string().optional(),
|
|
10590
10679
|
connectionId: z.z.string().optional(),
|
|
10680
|
+
connectionKey: z.z.string().min(1).max(100).optional(),
|
|
10591
10681
|
name: z.z.string().optional(),
|
|
10592
10682
|
input: z.z.record(z.z.string(), z.z.unknown()).optional(),
|
|
10593
10683
|
connectionParameters: z.z.any().optional().describe('[INTERNAL] Deprecated: Use input instead'),
|
|
@@ -10597,6 +10687,7 @@ const ConnectPayload = z.z.object({
|
|
|
10597
10687
|
redirectUri: z.z.string().optional(),
|
|
10598
10688
|
customState: z.z.string().optional(),
|
|
10599
10689
|
connectionRequestId: z.z.string().optional(),
|
|
10690
|
+
intent: z.z.string().optional(),
|
|
10600
10691
|
});
|
|
10601
10692
|
const ConnectUIOptions = ConnectPayload.omit({ input: true, redirectUri: true }).extend({
|
|
10602
10693
|
theme: z.z.enum(['light', 'dark', 'auto']).optional(),
|
|
@@ -10831,6 +10922,18 @@ const UpdateIntegrationRequest = IntegrationEditableProperties.partial();
|
|
|
10831
10922
|
const FindIntegrationsQuery = z.z
|
|
10832
10923
|
.object({
|
|
10833
10924
|
appUuid: z.z.string().optional(),
|
|
10925
|
+
connectors: z.z.coerce
|
|
10926
|
+
.number()
|
|
10927
|
+
.optional()
|
|
10928
|
+
.describe('Override auto-generate integrations from connectors: 1 to enable, 0 to disable'),
|
|
10929
|
+
externalApps: z.z.coerce
|
|
10930
|
+
.number()
|
|
10931
|
+
.optional()
|
|
10932
|
+
.describe('Override auto-generate integrations from external apps: 1 to enable, 0 to disable'),
|
|
10933
|
+
websearch: z.z.coerce
|
|
10934
|
+
.number()
|
|
10935
|
+
.optional()
|
|
10936
|
+
.describe('Override auto-generate integrations from web search: 1 to enable, 0 to disable'),
|
|
10834
10937
|
})
|
|
10835
10938
|
.merge(PaginationQuery)
|
|
10836
10939
|
.merge(SearchQuery)
|
|
@@ -10855,6 +10958,11 @@ const IntegrationApiResponse = BaseIntegration.extend({
|
|
|
10855
10958
|
.optional()
|
|
10856
10959
|
.describe('[INTERNAL] Deprecated: Use POST /connectors/:id/generate-options instead'),
|
|
10857
10960
|
});
|
|
10961
|
+
const IntegrationListItem = IntegrationApiResponse.extend({
|
|
10962
|
+
id: z.z.string().optional(),
|
|
10963
|
+
logoUri: z.z.string().optional(),
|
|
10964
|
+
appUri: z.z.string().optional(),
|
|
10965
|
+
});
|
|
10858
10966
|
|
|
10859
10967
|
const PackageElementApi = z.z.object({
|
|
10860
10968
|
id: z.z.string(),
|
|
@@ -11385,6 +11493,12 @@ const ListExternalEventSubscriptionsQuery = PaginationQuery.merge(IncludeArchive
|
|
|
11385
11493
|
externalAppId: z.z.string().optional().meta({
|
|
11386
11494
|
hidden: true,
|
|
11387
11495
|
}),
|
|
11496
|
+
status: z.z
|
|
11497
|
+
.enum(exports.ExternalEventSubscriptionStatus)
|
|
11498
|
+
.optional()
|
|
11499
|
+
.meta({
|
|
11500
|
+
filterTitle: 'Status',
|
|
11501
|
+
}),
|
|
11388
11502
|
});
|
|
11389
11503
|
const ExternalEventSubscriptionApiResponse = BaseExternalEventSubscription.extend({
|
|
11390
11504
|
user: BaseCustomer.optional(),
|
|
@@ -11594,6 +11708,14 @@ const FindConnectedProductsQuery = z.z
|
|
|
11594
11708
|
.merge(IncludeArchivedQuery);
|
|
11595
11709
|
const ConnectedProductApiResponse = BaseConnectedProduct;
|
|
11596
11710
|
|
|
11711
|
+
const ConnectionAttemptLogApiResponse = BaseConnectionAttemptLog;
|
|
11712
|
+
const FindConnectionAttemptLogsQuery = PaginationQuery.extend({
|
|
11713
|
+
connectionId: z.z.string().optional(),
|
|
11714
|
+
integrationId: z.z.string().optional(),
|
|
11715
|
+
status: z.z.enum(['success', 'error']).optional(),
|
|
11716
|
+
});
|
|
11717
|
+
const FindConnectionAttemptLogsResponse = createPaginationResponseSchema(ConnectionAttemptLogApiResponse);
|
|
11718
|
+
|
|
11597
11719
|
class DependencyError extends MembraneError {
|
|
11598
11720
|
constructor(arg, workspaceElementReference) {
|
|
11599
11721
|
super(arg);
|
|
@@ -11844,6 +11966,28 @@ function getFilterFieldMeta(meta) {
|
|
|
11844
11966
|
return undefined;
|
|
11845
11967
|
}
|
|
11846
11968
|
|
|
11969
|
+
const AI_GATEWAY_SUPPORTED_MODELS = [
|
|
11970
|
+
{ id: 'anthropic/claude-sonnet-4.6', name: 'Claude Sonnet 4.6' },
|
|
11971
|
+
{ id: 'anthropic/claude-opus-4.6', name: 'Claude Opus 4.6' },
|
|
11972
|
+
{ id: 'anthropic/claude-sonnet-4.5', name: 'Claude Sonnet 4.5' },
|
|
11973
|
+
{ id: 'anthropic/claude-opus-4.5', name: 'Claude Opus 4.5' },
|
|
11974
|
+
{ id: 'openai/gpt-5.2', name: 'GPT-5.2' },
|
|
11975
|
+
{ id: 'openai/gpt-5-nano', name: 'GPT-5 Nano' },
|
|
11976
|
+
{ id: 'google/gemini-3-pro-preview', name: 'Gemini 3 Pro' },
|
|
11977
|
+
{ id: 'moonshotai/kimi-k2.5', name: 'Kimi K2.5' },
|
|
11978
|
+
];
|
|
11979
|
+
const AI_GATEWAY_SUPPORTED_MODEL_IDS = AI_GATEWAY_SUPPORTED_MODELS.map((model) => model.id);
|
|
11980
|
+
if (AI_GATEWAY_SUPPORTED_MODEL_IDS.length === 0) {
|
|
11981
|
+
throw new Error('AI_GATEWAY_SUPPORTED_MODEL_IDS must not be empty');
|
|
11982
|
+
}
|
|
11983
|
+
const AIGatewaySupportedModelIdSchema = z.z.enum(AI_GATEWAY_SUPPORTED_MODEL_IDS);
|
|
11984
|
+
const DEFAULT_AI_GATEWAY_MODEL_ID = 'anthropic/claude-sonnet-4.6';
|
|
11985
|
+
const AI_GATEWAY_PROVIDER_MODELS = Object.fromEntries(AI_GATEWAY_SUPPORTED_MODELS.map((model) => [model.id, { name: model.name }]));
|
|
11986
|
+
const aiGatewaySupportedModelIdSet = new Set(AI_GATEWAY_SUPPORTED_MODEL_IDS);
|
|
11987
|
+
function isAIGatewaySupportedModelId(modelId) {
|
|
11988
|
+
return aiGatewaySupportedModelIdSet.has(modelId);
|
|
11989
|
+
}
|
|
11990
|
+
|
|
11847
11991
|
exports.AgentSessionStatus = void 0;
|
|
11848
11992
|
(function (AgentSessionStatus) {
|
|
11849
11993
|
AgentSessionStatus["QUEUED"] = "queued";
|
|
@@ -11886,7 +12030,6 @@ const AgentSession = z.z.object({
|
|
|
11886
12030
|
summary: z.z.string().optional(),
|
|
11887
12031
|
cost: z.z.number().optional(),
|
|
11888
12032
|
state: z.z.enum(exports.AgentSessionState).default(exports.AgentSessionState.BUSY),
|
|
11889
|
-
usage: z.z.number().optional(),
|
|
11890
12033
|
hasWorker: z.z.boolean(),
|
|
11891
12034
|
isExternal: z.z.boolean().optional(),
|
|
11892
12035
|
agentName: z.z.enum(exports.AgentName).optional(),
|
|
@@ -11904,7 +12047,7 @@ const CreateAgentSession = z.z.object({
|
|
|
11904
12047
|
prompt: z.z.string().min(1),
|
|
11905
12048
|
testCustomerId: z.z.string().optional(),
|
|
11906
12049
|
isExternal: z.z.boolean().optional(),
|
|
11907
|
-
modelId:
|
|
12050
|
+
modelId: AIGatewaySupportedModelIdSchema.optional(),
|
|
11908
12051
|
agentName: z.z.enum(exports.AgentName).optional(),
|
|
11909
12052
|
promptAttachments: z.z.array(AgentSessionAttachment).optional(),
|
|
11910
12053
|
});
|
|
@@ -12460,14 +12603,14 @@ function parseMembraneElementPath(relativePath) {
|
|
|
12460
12603
|
}
|
|
12461
12604
|
return undefined;
|
|
12462
12605
|
}
|
|
12463
|
-
function getConnectorSpecPath(
|
|
12606
|
+
function getConnectorSpecPath(connectorUuid) {
|
|
12464
12607
|
const connectorsPath = WorkspaceElementSpecs[exports.WorkspaceElementType.Connector].apiPath;
|
|
12465
|
-
return `${connectorsPath}/${
|
|
12608
|
+
return `${connectorsPath}/${connectorUuid}/${connectorUuid}.yml`;
|
|
12466
12609
|
}
|
|
12467
|
-
function getConnectorVersionPath(
|
|
12610
|
+
function getConnectorVersionPath(connectorUuid, version) {
|
|
12468
12611
|
const connectorsPath = WorkspaceElementSpecs[exports.WorkspaceElementType.Connector].apiPath;
|
|
12469
12612
|
const versionDir = version === CONNECTOR_VERSION_DEVELOPMENT ? 'development' : version;
|
|
12470
|
-
return `${connectorsPath}/${
|
|
12613
|
+
return `${connectorsPath}/${connectorUuid}/${versionDir}/src.zip`;
|
|
12471
12614
|
}
|
|
12472
12615
|
|
|
12473
12616
|
class SelfAccessor {
|
|
@@ -13025,6 +13168,7 @@ exports.AlertType = void 0;
|
|
|
13025
13168
|
AlertType["parallelApiRequestsPerCustomer"] = "parallelApiRequestsPerCustomer";
|
|
13026
13169
|
AlertType["engineCreditsExhaustionProjected"] = "engineCreditsExhaustionProjected";
|
|
13027
13170
|
AlertType["engineCreditsExhaustionActual"] = "engineCreditsExhaustionActual";
|
|
13171
|
+
AlertType["aiCreditsDebtAccumulated"] = "aiCreditsDebtAccumulated";
|
|
13028
13172
|
AlertType["totalNumberOfDatabaseEntitiesPerCustomer"] = "totalNumberOfDatabaseEntitiesPerCustomer";
|
|
13029
13173
|
AlertType["totalNumberOfCustomers"] = "totalNumberOfCustomers";
|
|
13030
13174
|
AlertType["totalNumberOfConnections"] = "totalNumberOfConnections";
|
|
@@ -13062,6 +13206,7 @@ const ALERT_TYPE_CATEGORIES = {
|
|
|
13062
13206
|
[exports.AlertType.parallelApiRequestsPerCustomer]: exports.AlertCategory.CUSTOMER_RATE_LIMIT,
|
|
13063
13207
|
[exports.AlertType.engineCreditsExhaustionProjected]: exports.AlertCategory.USAGE,
|
|
13064
13208
|
[exports.AlertType.engineCreditsExhaustionActual]: exports.AlertCategory.USAGE,
|
|
13209
|
+
[exports.AlertType.aiCreditsDebtAccumulated]: exports.AlertCategory.USAGE,
|
|
13065
13210
|
[exports.AlertType.totalNumberOfDatabaseEntitiesPerCustomer]: exports.AlertCategory.WORKSPACE_SIZE,
|
|
13066
13211
|
[exports.AlertType.testAlert]: exports.AlertCategory.TEST,
|
|
13067
13212
|
[exports.AlertType.totalNumberOfCustomers]: exports.AlertCategory.WORKSPACE_SIZE,
|
|
@@ -13162,6 +13307,7 @@ function getAlertTypeDisplayName(alertType) {
|
|
|
13162
13307
|
[exports.AlertType.parallelApiRequestsPerCustomer]: 'Parallel API Requests Per Customer',
|
|
13163
13308
|
[exports.AlertType.engineCreditsExhaustionProjected]: 'Engine Credits Exhaustion Projected',
|
|
13164
13309
|
[exports.AlertType.engineCreditsExhaustionActual]: 'Engine Credits Exhaustion Actual',
|
|
13310
|
+
[exports.AlertType.aiCreditsDebtAccumulated]: 'AI Credits Debt Accumulated',
|
|
13165
13311
|
[exports.AlertType.totalNumberOfDatabaseEntitiesPerCustomer]: 'Database Entities Per Customer',
|
|
13166
13312
|
[exports.AlertType.testAlert]: 'Test Alert',
|
|
13167
13313
|
[exports.AlertType.totalNumberOfCustomers]: 'Total Number of Customers',
|
|
@@ -13318,6 +13464,7 @@ const WorkspaceLimitsSchema = z.object({
|
|
|
13318
13464
|
totalNumberOfConnections: WorkspaceLimit.optional(),
|
|
13319
13465
|
totalNumberOfWorkspaceElements: WorkspaceLimit.optional(),
|
|
13320
13466
|
totalNumberOfWorkspaceDatabaseRecords: WorkspaceLimit.optional(),
|
|
13467
|
+
flowRunsQueueSizePerConnection: WorkspaceLimit.optional(),
|
|
13321
13468
|
instantTasksQueueSize: WorkspaceLimit.optional(),
|
|
13322
13469
|
QueuedTasksQueueSize: WorkspaceLimit.optional(),
|
|
13323
13470
|
parallelApiRequestsPerCustomer: WorkspaceLimit.optional(),
|
|
@@ -13338,6 +13485,9 @@ const WorkspaceSettingsSchema = z.object({
|
|
|
13338
13485
|
disableSecretKeyAuth: z.boolean().optional(),
|
|
13339
13486
|
useMembraneUniverse: z.boolean().optional(),
|
|
13340
13487
|
useRemoteRepository: z.boolean().optional(),
|
|
13488
|
+
autoGenerateIntegrationsFromConnectors: z.boolean().optional(),
|
|
13489
|
+
autoGenerateIntegrationsFromExternalApps: z.boolean().optional(),
|
|
13490
|
+
autoGenerateIntegrationsFromWebSearch: z.boolean().optional(),
|
|
13341
13491
|
});
|
|
13342
13492
|
const EngineWorkspaceSettingsSchema = WorkspaceSettingsSchema;
|
|
13343
13493
|
const WorkspacePublicKey = z.object({
|
|
@@ -13424,6 +13574,13 @@ const ListWorkspacesQuery = z.z
|
|
|
13424
13574
|
})
|
|
13425
13575
|
.merge(IncludeArchivedQuery);
|
|
13426
13576
|
const GetWorkspaceQuery = IncludeArchivedQuery;
|
|
13577
|
+
const MembraneCredentials = z.z.object({
|
|
13578
|
+
apiUri: z.z.string().describe('Uri for Membrane API'),
|
|
13579
|
+
workspaceKey: z.z.string().describe('Workspace key'),
|
|
13580
|
+
workspaceSecret: z.z.string().optional().describe('Workspace secret for signing tokens (never expose in browser code)'),
|
|
13581
|
+
tenantKey: z.z.string().optional().describe('Tenant key for the current test tenant'),
|
|
13582
|
+
notes: z.z.string().optional().describe('Usage notes'),
|
|
13583
|
+
});
|
|
13427
13584
|
|
|
13428
13585
|
const PARALLEL_EXECUTION_LIMITS = [
|
|
13429
13586
|
'parallelEventPulls',
|
|
@@ -13452,6 +13609,7 @@ const WORKSPACE_SIZE_LIMITS = [
|
|
|
13452
13609
|
'totalNumberOfConnections',
|
|
13453
13610
|
'totalNumberOfWorkspaceElements',
|
|
13454
13611
|
'totalNumberOfWorkspaceDatabaseRecords',
|
|
13612
|
+
'flowRunsQueueSizePerConnection',
|
|
13455
13613
|
];
|
|
13456
13614
|
const EDITABLE_LIMITS = [
|
|
13457
13615
|
'parallelApiRequestsPerCustomer',
|
|
@@ -13479,7 +13637,7 @@ function compareWorkspaceExports(baseExport, targetExport, options = { includeDe
|
|
|
13479
13637
|
[exports.WorkspaceElementChangeType.UPDATE]: new Set(),
|
|
13480
13638
|
[exports.WorkspaceElementChangeType.DELETE]: new Set(),
|
|
13481
13639
|
};
|
|
13482
|
-
const
|
|
13640
|
+
const baseUuidByTargetUuid = new Map();
|
|
13483
13641
|
const diffs = [];
|
|
13484
13642
|
const integrationMap = buildIntegrationsMap([
|
|
13485
13643
|
...(baseExport[exports.WorkspaceElementType.Integration] || []),
|
|
@@ -13510,7 +13668,7 @@ function compareWorkspaceExports(baseExport, targetExport, options = { includeDe
|
|
|
13510
13668
|
const base = baseMap.get(selector);
|
|
13511
13669
|
const target = targetMap.get(selector);
|
|
13512
13670
|
if (base && target && base.element.uuid !== target.element.uuid) {
|
|
13513
|
-
|
|
13671
|
+
baseUuidByTargetUuid.set(target.element.uuid, base.element.uuid);
|
|
13514
13672
|
}
|
|
13515
13673
|
const change = compareElementExports(base === null || base === void 0 ? void 0 : base.element, target === null || target === void 0 ? void 0 : target.element);
|
|
13516
13674
|
if (options.includeDeletions === false && (change === null || change === void 0 ? void 0 : change.type) === exports.WorkspaceElementChangeType.DELETE) {
|
|
@@ -13530,7 +13688,7 @@ function compareWorkspaceExports(baseExport, targetExport, options = { includeDe
|
|
|
13530
13688
|
diffs.push(diff.createTwoFilesPatch(`a/${path}`, `b/${path}`, baseYaml, targetYaml));
|
|
13531
13689
|
}
|
|
13532
13690
|
}
|
|
13533
|
-
const result = { comparison, changes,
|
|
13691
|
+
const result = { comparison, changes, baseUuidByTargetUuid };
|
|
13534
13692
|
if (options.includeDiff) {
|
|
13535
13693
|
result.diff = diffs.join('\n').trim();
|
|
13536
13694
|
}
|
|
@@ -13715,6 +13873,7 @@ const WorkspaceEditableFields = z.z.object({
|
|
|
13715
13873
|
alertDeliverySettings: AlertDeliverySettingsSchema.optional(),
|
|
13716
13874
|
jwksUri: z.z.string().nullable().optional(),
|
|
13717
13875
|
type: z.z.enum(exports.WorkspaceType).optional().describe('Workspace type (production or development)'),
|
|
13876
|
+
isReadOnly: z.z.boolean().optional().describe('Whether the workspace is in read-only mode'),
|
|
13718
13877
|
});
|
|
13719
13878
|
const OrgWorkspace = z.z
|
|
13720
13879
|
.object({
|
|
@@ -13739,12 +13898,38 @@ const OrgWorkspaceUpdateRequest = z.z
|
|
|
13739
13898
|
logoUri: z.z.string().optional(),
|
|
13740
13899
|
})
|
|
13741
13900
|
.merge(WorkspaceEditableFields);
|
|
13901
|
+
const WorkspaceOnboardingData = z.z
|
|
13902
|
+
.object({
|
|
13903
|
+
productSetup: z.z
|
|
13904
|
+
.object({
|
|
13905
|
+
type: ConnectedProductType.optional(),
|
|
13906
|
+
agentType: z.z.string().optional(),
|
|
13907
|
+
name: z.z.string().optional(),
|
|
13908
|
+
connectedProductId: z.z.string().optional(),
|
|
13909
|
+
})
|
|
13910
|
+
.optional(),
|
|
13911
|
+
connections: z.z
|
|
13912
|
+
.object({
|
|
13913
|
+
apps: z.z.array(z.z.object({
|
|
13914
|
+
externalAppId: z.z.string().optional(),
|
|
13915
|
+
name: z.z.string().optional(),
|
|
13916
|
+
url: z.z.string().optional(),
|
|
13917
|
+
status: z.z.enum(['pending', 'connected', 'skipped']).optional(),
|
|
13918
|
+
})),
|
|
13919
|
+
})
|
|
13920
|
+
.optional(),
|
|
13921
|
+
})
|
|
13922
|
+
.passthrough();
|
|
13742
13923
|
const OrgWorkspaceUser = z.z.object({
|
|
13743
13924
|
id: z.z.string(),
|
|
13744
13925
|
workspaceId: z.z.string(),
|
|
13745
13926
|
testCustomerId: z.z.string(),
|
|
13746
13927
|
userId: z.z.string(),
|
|
13747
13928
|
role: z.z.string(),
|
|
13929
|
+
onboardingData: WorkspaceOnboardingData.optional().describe('[INTERNAL]'),
|
|
13930
|
+
});
|
|
13931
|
+
const PatchUserWorkspaceSettings = z.z.object({
|
|
13932
|
+
onboardingData: WorkspaceOnboardingData.optional().describe('[INTERNAL]'),
|
|
13748
13933
|
});
|
|
13749
13934
|
const CreateOrgRequest = z.z.object({
|
|
13750
13935
|
name: z.z.string(),
|
|
@@ -13755,9 +13940,7 @@ const CreateOrgRequest = z.z.object({
|
|
|
13755
13940
|
referralSource: z.z.string().optional(),
|
|
13756
13941
|
builder: z.z.array(z.z.enum(['me', 'team'])).optional(),
|
|
13757
13942
|
stripeCustomerId: z.z.string().optional(),
|
|
13758
|
-
signupSource: z.z
|
|
13759
|
-
.enum(['web', 'membrane-cli', 'claude', 'cursor', 'chatgpt', 'warp', 'lovable', 'openclaw', 'other'])
|
|
13760
|
-
.optional(),
|
|
13943
|
+
signupSource: z.z.string().optional(),
|
|
13761
13944
|
});
|
|
13762
13945
|
const UpdateOrgRequest = z.z.object({
|
|
13763
13946
|
name: z.z.string().min(1).optional(),
|
|
@@ -13828,7 +14011,7 @@ const RotateOrgWorkspaceSecretResponse = z.z.object({
|
|
|
13828
14011
|
const AccountResponse = z.z.object({
|
|
13829
14012
|
user: FullPlatformUser.optional(),
|
|
13830
14013
|
workspace: OrgWorkspace.optional(),
|
|
13831
|
-
|
|
14014
|
+
hasWorkspaces: z.z.boolean().optional(),
|
|
13832
14015
|
workspaceUser: OrgWorkspaceUser.extend({
|
|
13833
14016
|
testCustomerId: z.z.string(),
|
|
13834
14017
|
}).optional(),
|
|
@@ -13856,6 +14039,8 @@ exports.WebhookTypeEnum = void 0;
|
|
|
13856
14039
|
WebhookTypeEnum["AGENT_SESSION_FINISHED"] = "agent-session-finished";
|
|
13857
14040
|
WebhookTypeEnum["SEND_ALERT_EMAIL"] = "send-alert-email";
|
|
13858
14041
|
WebhookTypeEnum["PUBLIC_PACKAGE_ACTION_RUN_FAILED"] = "public-package-action-run-failed";
|
|
14042
|
+
WebhookTypeEnum["BETTER_AUTH_SIGNUP_VERIFY"] = "better-auth-signup-verify";
|
|
14043
|
+
WebhookTypeEnum["BETTER_AUTH_RESET_PASSWORD"] = "better-auth-reset-password";
|
|
13859
14044
|
})(exports.WebhookTypeEnum || (exports.WebhookTypeEnum = {}));
|
|
13860
14045
|
|
|
13861
14046
|
const IntegrationSpecificElementSelector = z.object({
|
|
@@ -14107,6 +14292,7 @@ class ActionAccessor extends ElementAccessor {
|
|
|
14107
14292
|
? {
|
|
14108
14293
|
integrationKey: options.integrationKey,
|
|
14109
14294
|
connectionId: options.connectionId,
|
|
14295
|
+
connectionKey: options.connectionKey,
|
|
14110
14296
|
}
|
|
14111
14297
|
: {};
|
|
14112
14298
|
return this.options.client.post(this.getPath('run'), { input }, { params: queryParams });
|
|
@@ -15176,7 +15362,7 @@ class ConnectionProxy {
|
|
|
15176
15362
|
}
|
|
15177
15363
|
}
|
|
15178
15364
|
async function createOrUpdateConnection(options) {
|
|
15179
|
-
const { client, connectionId, integrationKey, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectionRequestId, apiUri, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
|
|
15365
|
+
const { client, connectionId, connectionKey, integrationKey, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectionRequestId, apiUri, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
|
|
15180
15366
|
let connectionType = await detectConnectionType(options);
|
|
15181
15367
|
if (redirectUri) {
|
|
15182
15368
|
connectionType = ConnectionType.REDIRECT;
|
|
@@ -15194,6 +15380,7 @@ async function createOrUpdateConnection(options) {
|
|
|
15194
15380
|
connectorId,
|
|
15195
15381
|
connectorVersion,
|
|
15196
15382
|
connectionId,
|
|
15383
|
+
connectionKey,
|
|
15197
15384
|
name,
|
|
15198
15385
|
authOptionKey,
|
|
15199
15386
|
allowMultipleConnections,
|
|
@@ -15832,6 +16019,12 @@ const ScenarioTemplate = z.z.object({
|
|
|
15832
16019
|
handyElements: z.z.array(HandyScenarioTemplateElement).optional(),
|
|
15833
16020
|
});
|
|
15834
16021
|
|
|
16022
|
+
function formatSessionCost(cost) {
|
|
16023
|
+
if (cost === undefined || cost === null)
|
|
16024
|
+
return '-';
|
|
16025
|
+
return cost.toFixed(2);
|
|
16026
|
+
}
|
|
16027
|
+
|
|
15835
16028
|
const SessionCredentials = z.z.object({
|
|
15836
16029
|
accessKeyId: z.z.string().min(1),
|
|
15837
16030
|
secretAccessKey: z.z.string().min(1),
|
|
@@ -15921,22 +16114,14 @@ const ClientTokenListResponse = z.z.object({
|
|
|
15921
16114
|
});
|
|
15922
16115
|
|
|
15923
16116
|
const MEMBRANE_CLI_CLIENT_ID = 'membrane-cli';
|
|
15924
|
-
const
|
|
15925
|
-
const
|
|
15926
|
-
const
|
|
15927
|
-
const
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
return scopes[0];
|
|
15933
|
-
for (const priorityScope of SCOPE_PRIORITY) {
|
|
15934
|
-
if (scopes.includes(priorityScope)) {
|
|
15935
|
-
return priorityScope;
|
|
15936
|
-
}
|
|
15937
|
-
}
|
|
15938
|
-
return scopes[0];
|
|
15939
|
-
}
|
|
16117
|
+
const OAUTH_TOKEN_TYPE_PLATFORM_USER = 'platform-user';
|
|
16118
|
+
const OAUTH_TOKEN_TYPE_TENANT = 'tenant';
|
|
16119
|
+
const OAUTH_TOKEN_TYPE_CONNECTION = 'connection';
|
|
16120
|
+
const OAUTH_TOKEN_TYPES = [
|
|
16121
|
+
OAUTH_TOKEN_TYPE_PLATFORM_USER,
|
|
16122
|
+
OAUTH_TOKEN_TYPE_TENANT,
|
|
16123
|
+
OAUTH_TOKEN_TYPE_CONNECTION,
|
|
16124
|
+
];
|
|
15940
16125
|
const OAuthTokenResponse = z.z.object({
|
|
15941
16126
|
access_token: z.z.string(),
|
|
15942
16127
|
token_type: z.z.string(),
|
|
@@ -15945,6 +16130,7 @@ const OAuthTokenResponse = z.z.object({
|
|
|
15945
16130
|
default_workspace_key: z.z.string().optional(),
|
|
15946
16131
|
default_tenant_key: z.z.string().optional(),
|
|
15947
16132
|
email: z.z.string().optional(),
|
|
16133
|
+
org_id: z.z.string().optional(),
|
|
15948
16134
|
});
|
|
15949
16135
|
|
|
15950
16136
|
const CONSOLE_ACCOUNT_API_TOKEN_PATH = 'settings/account/api-token';
|
|
@@ -15989,6 +16175,8 @@ const MembraneInstance = z.z.object({
|
|
|
15989
16175
|
lastReportedAt: z.z.coerce.date().optional(),
|
|
15990
16176
|
activeTenants: z.z.number().optional(),
|
|
15991
16177
|
billableTenants: z.z.number().optional(),
|
|
16178
|
+
});
|
|
16179
|
+
const membraneInstanceInfraFields = {
|
|
15992
16180
|
clusterName: z.z.string().optional(),
|
|
15993
16181
|
argoCdUrl: z.z.url().optional(),
|
|
15994
16182
|
grafanaUrl: z.z.url().optional(),
|
|
@@ -15997,6 +16185,11 @@ const MembraneInstance = z.z.object({
|
|
|
15997
16185
|
helmValuesPath: z.z.url().optional(),
|
|
15998
16186
|
awsAccountName: z.z.string().optional(),
|
|
15999
16187
|
awsSsoUrl: z.z.url().optional(),
|
|
16188
|
+
};
|
|
16189
|
+
const MembraneInstanceAdmin = MembraneInstance.extend({
|
|
16190
|
+
...membraneInstanceInfraFields,
|
|
16191
|
+
orgName: z.z.string().optional(),
|
|
16192
|
+
workspaceCount: z.z.number().optional(),
|
|
16000
16193
|
});
|
|
16001
16194
|
const CreateMembraneInstanceRequest = z.z.object({
|
|
16002
16195
|
name: z.z.string().min(1),
|
|
@@ -16024,10 +16217,6 @@ const ListMembraneInstancesQuery = PaginationQuery.extend({
|
|
|
16024
16217
|
orgId: z.z.string().optional(),
|
|
16025
16218
|
});
|
|
16026
16219
|
const ListMembraneInstancesResponse = createPaginationResponseSchema(MembraneInstance);
|
|
16027
|
-
const MembraneInstanceAdmin = MembraneInstance.extend({
|
|
16028
|
-
orgName: z.z.string().optional(),
|
|
16029
|
-
workspaceCount: z.z.number().optional(),
|
|
16030
|
-
});
|
|
16031
16220
|
|
|
16032
16221
|
const OrgInstanceType = z.z.enum(['membrane-hosted', 'self-hosted']);
|
|
16033
16222
|
const OrgInstanceWorkspace = z.z.object({
|
|
@@ -16103,6 +16292,9 @@ const membraneClientOptionsSchema = z.z
|
|
|
16103
16292
|
apiUri: z.z.string().nullish(),
|
|
16104
16293
|
uiUri: z.z.string().nullish(),
|
|
16105
16294
|
accessToken: z.z.string().nullish(),
|
|
16295
|
+
workspaceKey: z.z.string().nullish(),
|
|
16296
|
+
workspaceSecret: z.z.string().nullish(),
|
|
16297
|
+
tenantKey: z.z.string().nullish(),
|
|
16106
16298
|
})
|
|
16107
16299
|
.strict();
|
|
16108
16300
|
function validateClientOptions(options) {
|
|
@@ -16117,6 +16309,8 @@ function validateClientOptions(options) {
|
|
|
16117
16309
|
}
|
|
16118
16310
|
}
|
|
16119
16311
|
const REFETCH_EXPIRATION_THRESHOLD = 10 * 1000;
|
|
16312
|
+
const TOKEN_TTL_SECONDS = 3600;
|
|
16313
|
+
const TOKEN_MINT_THRESHOLD_SECONDS = 60;
|
|
16120
16314
|
function decodeToken(token) {
|
|
16121
16315
|
if (token.startsWith('pat-')) {
|
|
16122
16316
|
return null;
|
|
@@ -16131,11 +16325,25 @@ class MembraneApiClient {
|
|
|
16131
16325
|
constructor(options = {}) {
|
|
16132
16326
|
this.logs = [];
|
|
16133
16327
|
validateClientOptions(options);
|
|
16134
|
-
const { uiUri, apiUri,
|
|
16328
|
+
const { uiUri, apiUri, fetchCredentials, credentials } = options;
|
|
16135
16329
|
this.apiUri = apiUri !== null && apiUri !== void 0 ? apiUri : DEFAULT_API_URI;
|
|
16136
16330
|
this.uiUri = uiUri !== null && uiUri !== void 0 ? uiUri : DEFAULT_UI_URI;
|
|
16137
|
-
|
|
16138
|
-
|
|
16331
|
+
if ('workspaceSecret' in options && options.workspaceSecret) {
|
|
16332
|
+
if (typeof window !== 'undefined') {
|
|
16333
|
+
throw new Error('MembraneClient: workspaceSecret must not be used in browser code. ' +
|
|
16334
|
+
'The workspace secret is a server-side credential that would be exposed to end users if included in a browser bundle.');
|
|
16335
|
+
}
|
|
16336
|
+
this._workspaceKey = options.workspaceKey;
|
|
16337
|
+
this._workspaceSecret = options.workspaceSecret;
|
|
16338
|
+
this._tenantKey = options.tenantKey;
|
|
16339
|
+
}
|
|
16340
|
+
else {
|
|
16341
|
+
const token = 'token' in options ? options.token : undefined;
|
|
16342
|
+
const accessToken = 'accessToken' in options ? options.accessToken : undefined;
|
|
16343
|
+
const fetchToken = 'fetchToken' in options ? options.fetchToken : undefined;
|
|
16344
|
+
this.token = token !== null && token !== void 0 ? token : accessToken;
|
|
16345
|
+
this.fetchToken = fetchToken;
|
|
16346
|
+
}
|
|
16139
16347
|
if (fetchCredentials) {
|
|
16140
16348
|
void fetchCredentials().then((c) => this.setCredentials(c));
|
|
16141
16349
|
}
|
|
@@ -16147,6 +16355,9 @@ class MembraneApiClient {
|
|
|
16147
16355
|
return this.patch('/self', { credentials });
|
|
16148
16356
|
}
|
|
16149
16357
|
async getToken() {
|
|
16358
|
+
if (this._workspaceSecret) {
|
|
16359
|
+
return this.mintToken();
|
|
16360
|
+
}
|
|
16150
16361
|
if (this.fetchToken) {
|
|
16151
16362
|
if (!this.token) {
|
|
16152
16363
|
this.token = await this.fetchToken();
|
|
@@ -16167,6 +16378,38 @@ class MembraneApiClient {
|
|
|
16167
16378
|
decodeToken(this.token);
|
|
16168
16379
|
return this.token;
|
|
16169
16380
|
}
|
|
16381
|
+
async mintToken() {
|
|
16382
|
+
if (this.token) {
|
|
16383
|
+
const payload = decodeToken(this.token);
|
|
16384
|
+
if (payload === null || payload === void 0 ? void 0 : payload.exp) {
|
|
16385
|
+
const remainingSeconds = payload.exp - Math.floor(Date.now() / 1000);
|
|
16386
|
+
if (remainingSeconds > TOKEN_MINT_THRESHOLD_SECONDS) {
|
|
16387
|
+
return this.token;
|
|
16388
|
+
}
|
|
16389
|
+
}
|
|
16390
|
+
}
|
|
16391
|
+
const payload = {
|
|
16392
|
+
id: this._tenantKey,
|
|
16393
|
+
iss: this._workspaceKey,
|
|
16394
|
+
exp: Math.floor(Date.now() / 1000) + TOKEN_TTL_SECONDS,
|
|
16395
|
+
};
|
|
16396
|
+
const header = { alg: 'HS256', typ: 'JWT' };
|
|
16397
|
+
const encoder = new TextEncoder();
|
|
16398
|
+
const toB64Url = (bytes) => {
|
|
16399
|
+
let s = '';
|
|
16400
|
+
for (let i = 0; i < bytes.length; i++)
|
|
16401
|
+
s += String.fromCharCode(bytes[i]);
|
|
16402
|
+
return btoa(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
16403
|
+
};
|
|
16404
|
+
const headerB64 = toB64Url(encoder.encode(JSON.stringify(header)));
|
|
16405
|
+
const payloadB64 = toB64Url(encoder.encode(JSON.stringify(payload)));
|
|
16406
|
+
const input = `${headerB64}.${payloadB64}`;
|
|
16407
|
+
const key = await crypto.subtle.importKey('raw', encoder.encode(this._workspaceSecret), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']);
|
|
16408
|
+
const signatureBuffer = await crypto.subtle.sign('HMAC', key, encoder.encode(input));
|
|
16409
|
+
const signature = toB64Url(new Uint8Array(signatureBuffer));
|
|
16410
|
+
this.token = `${input}.${signature}`;
|
|
16411
|
+
return this.token;
|
|
16412
|
+
}
|
|
16170
16413
|
async get(uri, queryParams, options) {
|
|
16171
16414
|
if (queryParams) {
|
|
16172
16415
|
uri += `${uri.includes('?') ? '&' : '?'}${new URLSearchParams(omitBy(queryParams, isEmptyValue)).toString()}`;
|
|
@@ -16510,10 +16753,16 @@ injectFormulaCatalog(getFormula, isFormula, hasFormulas);
|
|
|
16510
16753
|
|
|
16511
16754
|
exports.ACTIONS = ACTIONS;
|
|
16512
16755
|
exports.AGENTIC_CONNECTION_REQUEST_SCREEN_PATH = AGENTIC_CONNECTION_REQUEST_SCREEN_PATH;
|
|
16756
|
+
exports.AIGatewaySupportedModelIdSchema = AIGatewaySupportedModelIdSchema;
|
|
16757
|
+
exports.AI_GATEWAY_PROVIDER_MODELS = AI_GATEWAY_PROVIDER_MODELS;
|
|
16758
|
+
exports.AI_GATEWAY_SUPPORTED_MODELS = AI_GATEWAY_SUPPORTED_MODELS;
|
|
16759
|
+
exports.AI_GATEWAY_SUPPORTED_MODEL_IDS = AI_GATEWAY_SUPPORTED_MODEL_IDS;
|
|
16513
16760
|
exports.ALERT_DELIVERY_METHODS = ALERT_DELIVERY_METHODS;
|
|
16514
16761
|
exports.ALERT_TYPE_CATEGORIES = ALERT_TYPE_CATEGORIES;
|
|
16515
16762
|
exports.AccessDeniedError = AccessDeniedError;
|
|
16516
16763
|
exports.AccountResponse = AccountResponse;
|
|
16764
|
+
exports.ActApiDispatch = ActApiDispatch;
|
|
16765
|
+
exports.ActRequest = ActRequest;
|
|
16517
16766
|
exports.ActionAccessor = ActionAccessor;
|
|
16518
16767
|
exports.ActionApiResponse = ActionApiResponse;
|
|
16519
16768
|
exports.ActionDependency = ActionDependency;
|
|
@@ -16574,6 +16823,7 @@ exports.BaseAppEventSubscription = BaseAppEventSubscription;
|
|
|
16574
16823
|
exports.BaseAppEventType = BaseAppEventType;
|
|
16575
16824
|
exports.BaseConnectedProduct = BaseConnectedProduct;
|
|
16576
16825
|
exports.BaseConnection = BaseConnection;
|
|
16826
|
+
exports.BaseConnectionAttemptLog = BaseConnectionAttemptLog;
|
|
16577
16827
|
exports.BaseConnector = BaseConnector;
|
|
16578
16828
|
exports.BaseCustomer = BaseCustomer;
|
|
16579
16829
|
exports.BaseDataLinkTable = BaseDataLinkTable;
|
|
@@ -16637,6 +16887,7 @@ exports.ConnectedProductType = ConnectedProductType;
|
|
|
16637
16887
|
exports.ConnectionAccessor = ConnectionAccessor;
|
|
16638
16888
|
exports.ConnectionApiResponse = ConnectionApiResponse;
|
|
16639
16889
|
exports.ConnectionApiResponseWithSecrets = ConnectionApiResponseWithSecrets;
|
|
16890
|
+
exports.ConnectionAttemptLogApiResponse = ConnectionAttemptLogApiResponse;
|
|
16640
16891
|
exports.ConnectionClientAction = ConnectionClientAction;
|
|
16641
16892
|
exports.ConnectionDataCollectionAccessor = ConnectionDataCollectionAccessor;
|
|
16642
16893
|
exports.ConnectionEditableProperties = ConnectionEditableProperties;
|
|
@@ -16735,6 +16986,7 @@ exports.CustomerApiResponse = CustomerApiResponse;
|
|
|
16735
16986
|
exports.CustomerSelector = CustomerSelector;
|
|
16736
16987
|
exports.CustomersAccessor = CustomersAccessor;
|
|
16737
16988
|
exports.DATA_RECORD_SCHEMA = DATA_RECORD_SCHEMA;
|
|
16989
|
+
exports.DEFAULT_AI_GATEWAY_MODEL_ID = DEFAULT_AI_GATEWAY_MODEL_ID;
|
|
16738
16990
|
exports.DEFAULT_ALERT_DELIVERY_SETTINGS = DEFAULT_ALERT_DELIVERY_SETTINGS;
|
|
16739
16991
|
exports.DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS = DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS;
|
|
16740
16992
|
exports.DEFAULT_FULL_SYNC_INTERVAL_SECONDS = DEFAULT_FULL_SYNC_INTERVAL_SECONDS;
|
|
@@ -16865,6 +17117,8 @@ exports.FindAppEventSubscriptionsQuery = FindAppEventSubscriptionsQuery;
|
|
|
16865
17117
|
exports.FindAppEventTypesQuery = FindAppEventTypesQuery;
|
|
16866
17118
|
exports.FindAppEventsQuery = FindAppEventsQuery;
|
|
16867
17119
|
exports.FindConnectedProductsQuery = FindConnectedProductsQuery;
|
|
17120
|
+
exports.FindConnectionAttemptLogsQuery = FindConnectionAttemptLogsQuery;
|
|
17121
|
+
exports.FindConnectionAttemptLogsResponse = FindConnectionAttemptLogsResponse;
|
|
16868
17122
|
exports.FindConnectionsQuery = FindConnectionsQuery;
|
|
16869
17123
|
exports.FindConnectionsResponse = FindConnectionsResponse;
|
|
16870
17124
|
exports.FindCustomersQuery = FindCustomersQuery;
|
|
@@ -16959,6 +17213,7 @@ exports.IntegrationLevelFieldMappingsListAccessor = IntegrationLevelFieldMapping
|
|
|
16959
17213
|
exports.IntegrationLevelFlowAccessor = IntegrationLevelFlowAccessor;
|
|
16960
17214
|
exports.IntegrationLevelFlowsListAccessor = IntegrationLevelFlowsListAccessor;
|
|
16961
17215
|
exports.IntegrationLevelMembraneInterfaceSelectorQuery = IntegrationLevelMembraneInterfaceSelectorQuery;
|
|
17216
|
+
exports.IntegrationListItem = IntegrationListItem;
|
|
16962
17217
|
exports.IntegrationOptionConfig = IntegrationOptionConfig;
|
|
16963
17218
|
exports.IntegrationOptions = IntegrationOptions;
|
|
16964
17219
|
exports.IntegrationSpecificElementSelector = IntegrationSpecificElementSelector;
|
|
@@ -16995,6 +17250,7 @@ exports.MappingSchema = MappingSchema;
|
|
|
16995
17250
|
exports.MembraneAgentKey = MembraneAgentKey;
|
|
16996
17251
|
exports.MembraneAxiosInstance = axios;
|
|
16997
17252
|
exports.MembraneClient = MembraneClient;
|
|
17253
|
+
exports.MembraneCredentials = MembraneCredentials;
|
|
16998
17254
|
exports.MembraneElementLayer = MembraneElementLayer;
|
|
16999
17255
|
exports.MembraneError = MembraneError;
|
|
17000
17256
|
exports.MembraneInstance = MembraneInstance;
|
|
@@ -17005,9 +17261,10 @@ exports.NotAuthenticatedError = NotAuthenticatedError;
|
|
|
17005
17261
|
exports.NotFoundError = NotFoundError;
|
|
17006
17262
|
exports.OAUTH1_CONFIG_SCHEMA = OAUTH1_CONFIG_SCHEMA;
|
|
17007
17263
|
exports.OAUTH_CONFIG_SCHEMA = OAUTH_CONFIG_SCHEMA;
|
|
17008
|
-
exports.
|
|
17009
|
-
exports.
|
|
17010
|
-
exports.
|
|
17264
|
+
exports.OAUTH_TOKEN_TYPES = OAUTH_TOKEN_TYPES;
|
|
17265
|
+
exports.OAUTH_TOKEN_TYPE_CONNECTION = OAUTH_TOKEN_TYPE_CONNECTION;
|
|
17266
|
+
exports.OAUTH_TOKEN_TYPE_PLATFORM_USER = OAUTH_TOKEN_TYPE_PLATFORM_USER;
|
|
17267
|
+
exports.OAUTH_TOKEN_TYPE_TENANT = OAUTH_TOKEN_TYPE_TENANT;
|
|
17011
17268
|
exports.OAuthTokenResponse = OAuthTokenResponse;
|
|
17012
17269
|
exports.OpenRouterNotConfiguredError = OpenRouterNotConfiguredError;
|
|
17013
17270
|
exports.OpenapiMappingSchema = OpenapiMappingSchema;
|
|
@@ -17041,6 +17298,7 @@ exports.PaginationQuery = PaginationQuery;
|
|
|
17041
17298
|
exports.PaginationResponse = PaginationResponse;
|
|
17042
17299
|
exports.PatchAgentSessionSchema = PatchAgentSessionSchema;
|
|
17043
17300
|
exports.PatchConnectionRequestPayload = PatchConnectionRequestPayload;
|
|
17301
|
+
exports.PatchUserWorkspaceSettings = PatchUserWorkspaceSettings;
|
|
17044
17302
|
exports.PendingQueueCountSchema = PendingQueueCountSchema;
|
|
17045
17303
|
exports.PendingTasksSummarySchema = PendingTasksSummarySchema;
|
|
17046
17304
|
exports.PlatformUser = PlatformUser;
|
|
@@ -17114,6 +17372,7 @@ exports.WorkspaceElementSearchResult = WorkspaceElementSearchResult;
|
|
|
17114
17372
|
exports.WorkspaceElementSpecs = WorkspaceElementSpecs;
|
|
17115
17373
|
exports.WorkspaceElementsStatsSchema = WorkspaceElementsStatsSchema;
|
|
17116
17374
|
exports.WorkspaceLimitsSchema = WorkspaceLimitsSchema;
|
|
17375
|
+
exports.WorkspaceOnboardingData = WorkspaceOnboardingData;
|
|
17117
17376
|
exports.WorkspacePublicKey = WorkspacePublicKey;
|
|
17118
17377
|
exports.WorkspaceSettingsSchema = WorkspaceSettingsSchema;
|
|
17119
17378
|
exports.WritableConnectorVersionData = WritableConnectorVersionData;
|
|
@@ -17150,6 +17409,7 @@ exports.findUdmCollectionMapping = findUdmCollectionMapping;
|
|
|
17150
17409
|
exports.findUdmDefaultCollection = findUdmDefaultCollection;
|
|
17151
17410
|
exports.findUdmRootLocation = findUdmRootLocation;
|
|
17152
17411
|
exports.findValueLocators = findValueLocators;
|
|
17412
|
+
exports.formatSessionCost = formatSessionCost;
|
|
17153
17413
|
exports.generateExampleFromSchema = generateExampleFromSchema;
|
|
17154
17414
|
exports.getActionInstanceVariableSchema = getActionInstanceVariableSchema;
|
|
17155
17415
|
exports.getActionRunTimeVariablesSchema = getActionRunTimeVariablesSchema;
|
|
@@ -17211,6 +17471,7 @@ exports.getWritableFieldsSchema = getWritableFieldsSchema;
|
|
|
17211
17471
|
exports.hasCycles = hasCycles;
|
|
17212
17472
|
exports.hasFormulas_internalDoNotUse = hasFormulas;
|
|
17213
17473
|
exports.injectFormulaCatalog = injectFormulaCatalog;
|
|
17474
|
+
exports.isAIGatewaySupportedModelId = isAIGatewaySupportedModelId;
|
|
17214
17475
|
exports.isBlob = isBlob;
|
|
17215
17476
|
exports.isBusinessDay = isBusinessDay;
|
|
17216
17477
|
exports.isDataActionType = isDataActionType;
|
|
@@ -17259,7 +17520,6 @@ exports.schemaIsNumber = schemaIsNumber;
|
|
|
17259
17520
|
exports.schemaIsScalar = schemaIsScalar;
|
|
17260
17521
|
exports.schemaTypeFromValue = schemaTypeFromValue;
|
|
17261
17522
|
exports.schemaWithTitle = schemaWithTitle;
|
|
17262
|
-
exports.selectHighestPriorityScope = selectHighestPriorityScope;
|
|
17263
17523
|
exports.setEditablePropertiesForWorkspaceElement = setEditablePropertiesForWorkspaceElement;
|
|
17264
17524
|
exports.setSchemaAtLocator = setSchemaAtLocator;
|
|
17265
17525
|
exports.setValueAtLocator = setValueAtLocator;
|