@membranehq/sdk 0.9.10 → 0.10.10
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 +74 -31
- package/dist/bundle.js +31 -14
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/connections-accessors.d.ts +17 -11
- package/dist/dts/accessors/integrations-accessors.d.ts +14 -11
- package/dist/dts/agent/session.d.ts +5 -0
- package/dist/dts/alerts/index.d.ts +1 -0
- package/dist/dts/alerts/types.d.ts +107 -13
- package/dist/dts/alerts/utils.d.ts +8 -0
- package/dist/dts/config/index.d.ts +1 -0
- package/dist/dts/dto/index.d.ts +3 -0
- package/dist/dts/functions/base.d.ts +2 -2
- package/dist/dts/index.browser.d.ts +1 -0
- package/dist/dts/logging/index.d.ts +9 -0
- package/dist/dts/orgs/types.d.ts +66 -1
- package/dist/dts/platform-users.d.ts +17 -2
- package/dist/dts/usage/types.d.ts +1 -0
- package/dist/dts/webhooks/types.d.ts +4 -2
- package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +6 -2
- package/dist/dts/workspace-elements/api/connections-api.d.ts +18 -3
- package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +3 -1
- package/dist/dts/workspace-elements/api/data-source-instances-api.d.ts +3 -1
- package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +3 -1
- package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +3 -1
- package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +3 -1
- package/dist/dts/workspace-elements/api/field-mapping-instances-api.d.ts +6 -2
- package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +6 -2
- package/dist/dts/workspace-elements/api/flows-api.d.ts +6 -2
- package/dist/dts/workspace-elements/api/integrations-api.d.ts +5 -1
- package/dist/dts/workspace-elements/api/packages-api.d.ts +2 -0
- package/dist/dts/workspace-elements/base/actions/index.d.ts +1 -1
- package/dist/dts/workspace-elements/base/connections/types.d.ts +3 -1
- package/dist/dts/workspace-elements/base/connectors/auth.d.ts +20 -0
- package/dist/dts/workspace-elements/base/connectors/functions.d.ts +12 -490
- package/dist/dts/workspace-elements/base/connectors/functions.test.d.ts +1 -0
- package/dist/dts/workspace-elements/base/connectors/index.d.ts +1 -0
- package/dist/dts/workspace-elements/base/connectors/types.d.ts +922 -478
- package/dist/dts/workspace-elements/base/data-collections/data-locations/collections/methods/base.d.ts +1 -2
- package/dist/dts/workspace-elements/base/packages/index.d.ts +2 -0
- package/dist/dts/workspace-elements/element-utils.d.ts +2 -0
- package/dist/dts/workspace-elements/element-utils.test.d.ts +1 -0
- package/dist/dts/workspace-elements/index.d.ts +1 -0
- package/dist/dts/workspace-elements/types.d.ts +9 -3
- package/dist/dts/workspaces/types.d.ts +39 -1
- package/dist/index.browser.d.mts +1360 -583
- package/dist/index.browser.d.ts +1360 -583
- package/dist/index.browser.js +593 -113
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +570 -114
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +1358 -580
- package/dist/index.node.d.ts +1358 -580
- package/dist/index.node.js +600 -113
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +577 -114
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.browser.js
CHANGED
|
@@ -3477,6 +3477,7 @@ exports.WorkspaceEventType = void 0;
|
|
|
3477
3477
|
WorkspaceEventType["FlowRunCompleted"] = "flowRun.completed";
|
|
3478
3478
|
WorkspaceEventType["FlowRunFailed"] = "flowRun.failed";
|
|
3479
3479
|
WorkspaceEventType["FlowRunStopped"] = "flowRun.stopped";
|
|
3480
|
+
WorkspaceEventType["AlertCreated"] = "alert.created";
|
|
3480
3481
|
})(exports.WorkspaceEventType || (exports.WorkspaceEventType = {}));
|
|
3481
3482
|
exports.WorkspaceElementState = void 0;
|
|
3482
3483
|
(function (WorkspaceElementState) {
|
|
@@ -3527,8 +3528,9 @@ const BaseIntegrationLevelMembraneInterfaceExportProperties = BaseMembraneInterf
|
|
|
3527
3528
|
parentUuid: z.z.string().optional(),
|
|
3528
3529
|
isCustomized: z.z.boolean().optional(),
|
|
3529
3530
|
});
|
|
3531
|
+
const MembraneElementLayer = z.z.enum(['universal', 'integration', 'connection']);
|
|
3530
3532
|
const IntegrationLevelMembraneInterfaceSelectorQuery = z.z.object({
|
|
3531
|
-
layer:
|
|
3533
|
+
layer: MembraneElementLayer.optional(),
|
|
3532
3534
|
integrationKey: z.z.string().optional(),
|
|
3533
3535
|
integrationId: z.z.string().optional(),
|
|
3534
3536
|
connectionId: z.z.string().optional(),
|
|
@@ -3548,8 +3550,7 @@ const WorkspaceElementSearchQuery = z.z.object({
|
|
|
3548
3550
|
});
|
|
3549
3551
|
const WorkspaceElementSearchResult = z.z.object({
|
|
3550
3552
|
elementType: z.z.enum(exports.WorkspaceElementType),
|
|
3551
|
-
|
|
3552
|
-
name: z.z.string(),
|
|
3553
|
+
element: z.z.any(),
|
|
3553
3554
|
});
|
|
3554
3555
|
|
|
3555
3556
|
function mergeWithFormulas(a, b) {
|
|
@@ -3771,7 +3772,9 @@ const BaseConnection = BaseWorkspaceElement.extend({
|
|
|
3771
3772
|
isDefunct: z.z.boolean().optional(),
|
|
3772
3773
|
state: z.z.enum(exports.WorkspaceElementState).optional(),
|
|
3773
3774
|
error: ErrorDataSchema.optional(),
|
|
3774
|
-
integrationId: z.z.string(),
|
|
3775
|
+
integrationId: z.z.string().optional(),
|
|
3776
|
+
connectorId: z.z.string().optional(),
|
|
3777
|
+
connectorVersion: z.z.string().optional(),
|
|
3775
3778
|
authOptionKey: z.z.string().optional(),
|
|
3776
3779
|
createdAt: z.z.string(),
|
|
3777
3780
|
updatedAt: z.z.string(),
|
|
@@ -3857,6 +3860,7 @@ const ConnectorAuthSpec = z.z.object({
|
|
|
3857
3860
|
title: z.z.string().optional(),
|
|
3858
3861
|
description: z.z.string().optional(),
|
|
3859
3862
|
type: z.z.enum(CONNECTOR_AUTH_TYPES),
|
|
3863
|
+
inputSchema: DataSchema.optional(),
|
|
3860
3864
|
ui: z.z
|
|
3861
3865
|
.object({
|
|
3862
3866
|
schema: DataSchema.optional(),
|
|
@@ -3991,7 +3995,7 @@ const ConnectorAuthMethodTypes = {
|
|
|
3991
3995
|
},
|
|
3992
3996
|
};
|
|
3993
3997
|
},
|
|
3994
|
-
getOutputSchema: () => REST_API_CLIENT_SCHEMA,
|
|
3998
|
+
getOutputSchema: () => REST_API_CLIENT_SCHEMA$1,
|
|
3995
3999
|
isRequired: true,
|
|
3996
4000
|
},
|
|
3997
4001
|
test: {
|
|
@@ -4146,7 +4150,7 @@ const REST_API_CLIENT_RESPONSE_HANDLERS_SCHEMA = {
|
|
|
4146
4150
|
},
|
|
4147
4151
|
},
|
|
4148
4152
|
};
|
|
4149
|
-
const REST_API_CLIENT_SCHEMA = {
|
|
4153
|
+
const REST_API_CLIENT_SCHEMA$1 = {
|
|
4150
4154
|
type: 'object',
|
|
4151
4155
|
properties: {
|
|
4152
4156
|
args: {
|
|
@@ -4184,11 +4188,6 @@ const CONNECTOR_DOCS_DIR = 'docs';
|
|
|
4184
4188
|
const CONNECTOR_GLOBAL_WEBHOOKS_DIR = 'global-webhooks';
|
|
4185
4189
|
const CONNECTOR_EVENTS_DIR = 'events';
|
|
4186
4190
|
|
|
4187
|
-
const ConnectorOperationMethodImplementationTypes = [
|
|
4188
|
-
exports.ConnectorMethodImplementationType.restApiMapping,
|
|
4189
|
-
exports.ConnectorMethodImplementationType.javascript,
|
|
4190
|
-
];
|
|
4191
|
-
|
|
4192
4191
|
exports.FunctionType = void 0;
|
|
4193
4192
|
(function (FunctionType) {
|
|
4194
4193
|
FunctionType["mapping"] = "mapping";
|
|
@@ -4208,10 +4207,157 @@ const BaseFunctionDefinition = z.z.object({
|
|
|
4208
4207
|
});
|
|
4209
4208
|
const GenericFunctionDefinition = z.z
|
|
4210
4209
|
.object({
|
|
4211
|
-
type: z.z.enum(['mapping', 'operation-mapping', 'rest-api-mapping', 'graphql-api-mapping', 'javascript']),
|
|
4210
|
+
type: z.z.enum(['mapping', 'operation-mapping', 'rest-api-mapping', 'graphql-api-mapping', 'javascript']).optional(),
|
|
4212
4211
|
})
|
|
4213
4212
|
.loose();
|
|
4214
4213
|
|
|
4214
|
+
function getEffectiveConnectorOption(connector, optionKey) {
|
|
4215
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
4216
|
+
const option = (_a = connector.options) === null || _a === void 0 ? void 0 : _a[optionKey];
|
|
4217
|
+
const connectorInputSchema = (_b = connector.inputSchema) !== null && _b !== void 0 ? _b : (_c = connector.ui) === null || _c === void 0 ? void 0 : _c.schema;
|
|
4218
|
+
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;
|
|
4219
|
+
return {
|
|
4220
|
+
...connector,
|
|
4221
|
+
...option,
|
|
4222
|
+
inputSchema: mergeSchemas([connectorInputSchema, optionInputSchema]),
|
|
4223
|
+
parametersSchema: mergeSchemas([connector.parametersSchema, option === null || option === void 0 ? void 0 : option.parametersSchema]),
|
|
4224
|
+
credentialsSchema: mergeSchemas([connector.credentialsSchema, option === null || option === void 0 ? void 0 : option.credentialsSchema]),
|
|
4225
|
+
makeApiClient: (_f = option === null || option === void 0 ? void 0 : option.makeApiClient) !== null && _f !== void 0 ? _f : connector.makeApiClient,
|
|
4226
|
+
test: (_g = option === null || option === void 0 ? void 0 : option.test) !== null && _g !== void 0 ? _g : connector.test,
|
|
4227
|
+
};
|
|
4228
|
+
}
|
|
4229
|
+
const getDefaultInputSchema = (authConfig) => {
|
|
4230
|
+
var _a, _b, _c;
|
|
4231
|
+
const connectionParameters = (_a = authConfig === null || authConfig === void 0 ? void 0 : authConfig.inputSchema) !== null && _a !== void 0 ? _a : (_b = authConfig === null || authConfig === void 0 ? void 0 : authConfig.ui) === null || _b === void 0 ? void 0 : _b.schema;
|
|
4232
|
+
return {
|
|
4233
|
+
type: 'object',
|
|
4234
|
+
properties: {
|
|
4235
|
+
connectorParameters: (_c = authConfig === null || authConfig === void 0 ? void 0 : authConfig.parametersSchema) !== null && _c !== void 0 ? _c : {},
|
|
4236
|
+
...(connectionParameters && { connectionParameters }),
|
|
4237
|
+
},
|
|
4238
|
+
};
|
|
4239
|
+
};
|
|
4240
|
+
const REST_API_CLIENT_SCHEMA = {
|
|
4241
|
+
type: 'object',
|
|
4242
|
+
properties: {
|
|
4243
|
+
args: {
|
|
4244
|
+
type: 'object',
|
|
4245
|
+
properties: {
|
|
4246
|
+
baseUri: {
|
|
4247
|
+
type: 'string',
|
|
4248
|
+
description: 'This prefix will be added to all relative API requests.',
|
|
4249
|
+
},
|
|
4250
|
+
query: {
|
|
4251
|
+
type: 'object',
|
|
4252
|
+
additionalProperties: true,
|
|
4253
|
+
},
|
|
4254
|
+
headers: {
|
|
4255
|
+
type: 'object',
|
|
4256
|
+
additionalProperties: true,
|
|
4257
|
+
},
|
|
4258
|
+
auth: {
|
|
4259
|
+
type: 'object',
|
|
4260
|
+
description: 'Basic authentication',
|
|
4261
|
+
properties: {
|
|
4262
|
+
username: { type: 'string' },
|
|
4263
|
+
password: { type: 'string' },
|
|
4264
|
+
},
|
|
4265
|
+
},
|
|
4266
|
+
},
|
|
4267
|
+
},
|
|
4268
|
+
},
|
|
4269
|
+
};
|
|
4270
|
+
const ConnectorFunctionSpecs = {
|
|
4271
|
+
getOAuthConfig: {
|
|
4272
|
+
authTypes: ['oauth2', 'oauth1'],
|
|
4273
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4274
|
+
getInputSchema: (authConfig) => {
|
|
4275
|
+
const schema = getDefaultInputSchema(authConfig);
|
|
4276
|
+
return {
|
|
4277
|
+
...schema,
|
|
4278
|
+
properties: {
|
|
4279
|
+
...schema.properties,
|
|
4280
|
+
redirectUri: { type: 'string' },
|
|
4281
|
+
state: { type: 'string' },
|
|
4282
|
+
},
|
|
4283
|
+
};
|
|
4284
|
+
},
|
|
4285
|
+
getOutputSchema: (authConfig) => {
|
|
4286
|
+
return (authConfig === null || authConfig === void 0 ? void 0 : authConfig.type) === 'oauth1' ? OAUTH1_CONFIG_SCHEMA : OAUTH_CONFIG_SCHEMA;
|
|
4287
|
+
},
|
|
4288
|
+
isRequired: true,
|
|
4289
|
+
},
|
|
4290
|
+
getTokenData: {
|
|
4291
|
+
authTypes: ['oauth2'],
|
|
4292
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4293
|
+
getInputSchema: getDefaultInputSchema,
|
|
4294
|
+
getOutputSchema: (authConfig) => {
|
|
4295
|
+
var _a;
|
|
4296
|
+
return (_a = authConfig === null || authConfig === void 0 ? void 0 : authConfig.customCredentialsSchema) !== null && _a !== void 0 ? _a : authConfig === null || authConfig === void 0 ? void 0 : authConfig.credentialsSchema;
|
|
4297
|
+
},
|
|
4298
|
+
isRequired: false,
|
|
4299
|
+
},
|
|
4300
|
+
getCredentialsFromAccessTokenResponse: {
|
|
4301
|
+
authTypes: ['oauth2'],
|
|
4302
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4303
|
+
isRequired: false,
|
|
4304
|
+
},
|
|
4305
|
+
getCredentialsFromRefreshTokenResponse: {
|
|
4306
|
+
authTypes: ['oauth2'],
|
|
4307
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4308
|
+
isRequired: false,
|
|
4309
|
+
},
|
|
4310
|
+
getCredentialsFromConnectionParameters: {
|
|
4311
|
+
authTypes: ['client-credentials', 'oauth2'],
|
|
4312
|
+
getInputSchema: getDefaultInputSchema,
|
|
4313
|
+
getOutputSchema: (authConfig) => {
|
|
4314
|
+
return authConfig === null || authConfig === void 0 ? void 0 : authConfig.credentialsSchema;
|
|
4315
|
+
},
|
|
4316
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4317
|
+
isRequired: false,
|
|
4318
|
+
},
|
|
4319
|
+
refreshCredentials: {
|
|
4320
|
+
authTypes: ['oauth2', 'oauth1', 'client-credentials'],
|
|
4321
|
+
getInputSchema: getDefaultInputSchema,
|
|
4322
|
+
getOutputSchema: (authConfig) => {
|
|
4323
|
+
return authConfig === null || authConfig === void 0 ? void 0 : authConfig.credentialsSchema;
|
|
4324
|
+
},
|
|
4325
|
+
supportedFunctionTypes: [exports.FunctionType.javascript],
|
|
4326
|
+
isRequired: false,
|
|
4327
|
+
},
|
|
4328
|
+
makeApiClient: {
|
|
4329
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4330
|
+
getInputSchema: (authConfig) => {
|
|
4331
|
+
var _a, _b, _c;
|
|
4332
|
+
return {
|
|
4333
|
+
type: 'object',
|
|
4334
|
+
properties: {
|
|
4335
|
+
credentials: mergeSchemas([
|
|
4336
|
+
((_a = authConfig === null || authConfig === void 0 ? void 0 : authConfig.customCredentialsSchema) !== null && _a !== void 0 ? _a : authConfig === null || authConfig === void 0 ? void 0 : authConfig.credentialsSchema),
|
|
4337
|
+
(_b = authConfig === null || authConfig === void 0 ? void 0 : authConfig.inputSchema) !== null && _b !== void 0 ? _b : (_c = authConfig === null || authConfig === void 0 ? void 0 : authConfig.ui) === null || _c === void 0 ? void 0 : _c.schema,
|
|
4338
|
+
]),
|
|
4339
|
+
},
|
|
4340
|
+
};
|
|
4341
|
+
},
|
|
4342
|
+
getOutputSchema: () => REST_API_CLIENT_SCHEMA,
|
|
4343
|
+
isRequired: true,
|
|
4344
|
+
},
|
|
4345
|
+
test: {
|
|
4346
|
+
supportedFunctionTypes: [exports.FunctionType.operationMapping, exports.FunctionType.restApiMapping, exports.FunctionType.javascript],
|
|
4347
|
+
getOutputSchema: () => ({
|
|
4348
|
+
title: 'Success Criteria',
|
|
4349
|
+
description: 'If this value is truthy, the test is considered a success.',
|
|
4350
|
+
type: 'boolean',
|
|
4351
|
+
}),
|
|
4352
|
+
isRequired: true,
|
|
4353
|
+
},
|
|
4354
|
+
};
|
|
4355
|
+
|
|
4356
|
+
const ConnectorOperationMethodImplementationTypes = [
|
|
4357
|
+
exports.ConnectorMethodImplementationType.restApiMapping,
|
|
4358
|
+
exports.ConnectorMethodImplementationType.javascript,
|
|
4359
|
+
];
|
|
4360
|
+
|
|
4215
4361
|
const GraphQLFieldMappingSchema = z.z.lazy(() => z.z.object({
|
|
4216
4362
|
field: z.z.string(),
|
|
4217
4363
|
args: z.z.record(z.z.string(), z.z.any()).optional(),
|
|
@@ -4321,7 +4467,8 @@ const ConnectorSpec = z.z.object({
|
|
|
4321
4467
|
type: z.z.enum(['openapi', 'graphql']),
|
|
4322
4468
|
})
|
|
4323
4469
|
.optional(),
|
|
4324
|
-
ui: ConnectorUiSpec.optional(),
|
|
4470
|
+
ui: ConnectorUiSpec.optional().describe('[INTERNAL] Deprecated: Use inputSchema instead'),
|
|
4471
|
+
inputSchema: DataSchema.optional(),
|
|
4325
4472
|
auth: ConnectorAuth.optional(),
|
|
4326
4473
|
parametersSchema: DataSchema.optional(),
|
|
4327
4474
|
udms: z.z.array(z.z.string()).optional(),
|
|
@@ -4344,14 +4491,10 @@ const ConnectorAuthWithFunctions = z.z.object({
|
|
|
4344
4491
|
type: z.z
|
|
4345
4492
|
.enum(['integration-app-token', 'membrane-token', 'oauth2', 'oauth1', 'client-credentials', 'proxy'])
|
|
4346
4493
|
.optional(),
|
|
4494
|
+
credentialsSchema: DataSchema.optional(),
|
|
4347
4495
|
customCredentialsSchema: DataSchema.optional(),
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
schema: DataSchema.optional(),
|
|
4351
|
-
description: z.z.string().optional(),
|
|
4352
|
-
helpUri: z.z.string().optional(),
|
|
4353
|
-
})
|
|
4354
|
-
.optional(),
|
|
4496
|
+
inputSchema: DataSchema.optional(),
|
|
4497
|
+
parametersSchema: DataSchema.optional(),
|
|
4355
4498
|
getCredentialsFromConnectionParameters: GenericFunctionDefinition.optional(),
|
|
4356
4499
|
refreshCredentials: GenericFunctionDefinition.optional(),
|
|
4357
4500
|
makeApiClient: GenericFunctionDefinition.optional(),
|
|
@@ -4359,18 +4502,40 @@ const ConnectorAuthWithFunctions = z.z.object({
|
|
|
4359
4502
|
getTokenData: GenericFunctionDefinition.optional(),
|
|
4360
4503
|
getCredentialsFromAccessTokenResponse: GenericFunctionDefinition.optional(),
|
|
4361
4504
|
getCredentialsFromRefreshTokenResponse: GenericFunctionDefinition.optional(),
|
|
4505
|
+
test: GenericFunctionDefinition.optional(),
|
|
4362
4506
|
proxyKey: z.z.string().optional(),
|
|
4507
|
+
ui: z.z
|
|
4508
|
+
.object({
|
|
4509
|
+
schema: DataSchema.optional(),
|
|
4510
|
+
description: z.z.string().optional(),
|
|
4511
|
+
helpUri: z.z.string().optional(),
|
|
4512
|
+
})
|
|
4513
|
+
.optional()
|
|
4514
|
+
.describe('[INTERNAL] Deprecated: Use inputSchema instead'),
|
|
4363
4515
|
});
|
|
4364
|
-
const
|
|
4516
|
+
const WriteableConnectorOption = ConnectorAuthWithFunctions.extend({
|
|
4365
4517
|
title: z.z.string().optional(),
|
|
4366
4518
|
description: z.z.string().optional(),
|
|
4367
4519
|
enabled: z.z.any().optional(),
|
|
4520
|
+
}).omit({
|
|
4521
|
+
credentialsSchema: true,
|
|
4522
|
+
});
|
|
4523
|
+
const ConnectorOption = WriteableConnectorOption.extend({
|
|
4524
|
+
credentialsSchema: DataSchema.optional(),
|
|
4525
|
+
});
|
|
4526
|
+
const GeneratedConnectorOption = z.z.object({
|
|
4527
|
+
key: z.z.string(),
|
|
4528
|
+
type: z.z.enum(CONNECTOR_AUTH_TYPES),
|
|
4529
|
+
title: z.z.string().optional(),
|
|
4530
|
+
description: z.z.string().optional(),
|
|
4531
|
+
inputSchema: DataSchema.optional(),
|
|
4368
4532
|
});
|
|
4369
4533
|
const ConnectorOptions = z.z.record(z.z.string(), ConnectorOption);
|
|
4370
4534
|
const WritableConnectorVersionData = ConnectorAuthWithFunctions.extend({
|
|
4371
4535
|
parametersSchema: DataSchema.optional(),
|
|
4372
|
-
|
|
4373
|
-
|
|
4536
|
+
options: z.z.record(z.z.string(), WriteableConnectorOption).optional(),
|
|
4537
|
+
}).omit({
|
|
4538
|
+
credentialsSchema: true,
|
|
4374
4539
|
});
|
|
4375
4540
|
const ConnectorVersionData = z.z
|
|
4376
4541
|
.object({
|
|
@@ -4388,7 +4553,10 @@ const ConnectorVersionData = z.z
|
|
|
4388
4553
|
version: z.z.string(),
|
|
4389
4554
|
credentialsSchema: DataSchema.optional(),
|
|
4390
4555
|
})
|
|
4391
|
-
.extend(WritableConnectorVersionData.shape)
|
|
4556
|
+
.extend(WritableConnectorVersionData.shape)
|
|
4557
|
+
.extend({
|
|
4558
|
+
options: ConnectorOptions.optional(),
|
|
4559
|
+
});
|
|
4392
4560
|
const ConnectorVersion = ConnectorVersionData.extend({
|
|
4393
4561
|
id: z.z.string(),
|
|
4394
4562
|
connectorId: z.z.string(),
|
|
@@ -4403,6 +4571,7 @@ const WriteableConnectorFields = z.z
|
|
|
4403
4571
|
categories: z.z.array(z.z.string()).optional(),
|
|
4404
4572
|
})
|
|
4405
4573
|
.extend(WritableConnectorVersionData.shape);
|
|
4574
|
+
const ConnectorExportProperties = WriteableConnectorFields;
|
|
4406
4575
|
const UpdateConnectorRequest = WriteableConnectorFields;
|
|
4407
4576
|
const CreateConnectorRequest = WriteableConnectorFields.extend({
|
|
4408
4577
|
name: z.z.string(),
|
|
@@ -4412,16 +4581,12 @@ const BaseConnector = z.z.object({
|
|
|
4412
4581
|
id: z.z.string(),
|
|
4413
4582
|
key: z.z.string(),
|
|
4414
4583
|
uuid: z.z.string(),
|
|
4584
|
+
appUuid: z.z.string().optional(),
|
|
4415
4585
|
name: z.z.string(),
|
|
4416
4586
|
logoUri: z.z.string(),
|
|
4417
|
-
appUri: z.z.string(),
|
|
4418
|
-
apiDocsUri: z.z.string(),
|
|
4419
|
-
hasReadme: z.z.boolean(),
|
|
4420
|
-
status: z.z.string().optional(),
|
|
4421
4587
|
categories: z.z.array(z.z.string()).optional(),
|
|
4422
4588
|
isPublic: z.z.boolean().optional(),
|
|
4423
4589
|
popularity: z.z.number().optional(),
|
|
4424
|
-
appUuid: z.z.string().optional(),
|
|
4425
4590
|
});
|
|
4426
4591
|
const Connector = z.z
|
|
4427
4592
|
.object({})
|
|
@@ -4485,8 +4650,8 @@ const DataCollectionMethodCreate = {
|
|
|
4485
4650
|
},
|
|
4486
4651
|
};
|
|
4487
4652
|
},
|
|
4488
|
-
getInputSchema: ({ collectionSpec, method,
|
|
4489
|
-
var _a
|
|
4653
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
4654
|
+
var _a;
|
|
4490
4655
|
let fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
4491
4656
|
if (method === null || method === void 0 ? void 0 : method.fields) {
|
|
4492
4657
|
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields);
|
|
@@ -4496,12 +4661,12 @@ const DataCollectionMethodCreate = {
|
|
|
4496
4661
|
}
|
|
4497
4662
|
return {
|
|
4498
4663
|
type: 'object',
|
|
4499
|
-
properties: {
|
|
4664
|
+
properties: nonEmptyObjectProperties({
|
|
4500
4665
|
fields: (_a = transformVariablesWith(fieldsSchema, (locator) => `fields.${locatorToField(locator)}`)) !== null && _a !== void 0 ? _a : {
|
|
4501
4666
|
type: 'object',
|
|
4502
4667
|
},
|
|
4503
|
-
credentials:
|
|
4504
|
-
},
|
|
4668
|
+
credentials: credentialsSchema,
|
|
4669
|
+
}),
|
|
4505
4670
|
};
|
|
4506
4671
|
},
|
|
4507
4672
|
getOutputSchema: ({}) => ({
|
|
@@ -4516,17 +4681,16 @@ const DataCollectionMethodCreate = {
|
|
|
4516
4681
|
const DataCollectionMethodDelete = {
|
|
4517
4682
|
name: 'Delete',
|
|
4518
4683
|
description: 'Delete a data record from the collection by id',
|
|
4519
|
-
getInputSchema: ({ collectionHandler, parameters,
|
|
4520
|
-
var _a;
|
|
4684
|
+
getInputSchema: ({ collectionHandler, parameters, credentialsSchema }) => {
|
|
4521
4685
|
return {
|
|
4522
4686
|
type: 'object',
|
|
4523
|
-
properties: {
|
|
4687
|
+
properties: nonEmptyObjectProperties({
|
|
4524
4688
|
id: {
|
|
4525
4689
|
type: 'string',
|
|
4526
4690
|
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4527
4691
|
},
|
|
4528
|
-
credentials:
|
|
4529
|
-
},
|
|
4692
|
+
credentials: credentialsSchema,
|
|
4693
|
+
}),
|
|
4530
4694
|
};
|
|
4531
4695
|
},
|
|
4532
4696
|
getOutputSchema: () => null,
|
|
@@ -4550,15 +4714,14 @@ const DataCollectionMethodFind = {
|
|
|
4550
4714
|
},
|
|
4551
4715
|
};
|
|
4552
4716
|
},
|
|
4553
|
-
getInputSchema: ({ collectionSpec, method,
|
|
4554
|
-
var _a;
|
|
4717
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
4555
4718
|
const queryFieldsSchema = pickFieldsFromSchema(collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema, method === null || method === void 0 ? void 0 : method.queryFields);
|
|
4556
4719
|
const schema = {
|
|
4557
4720
|
type: 'object',
|
|
4558
|
-
properties: {
|
|
4721
|
+
properties: nonEmptyObjectProperties({
|
|
4559
4722
|
cursor: { type: 'string' },
|
|
4560
|
-
credentials:
|
|
4561
|
-
},
|
|
4723
|
+
credentials: credentialsSchema,
|
|
4724
|
+
}),
|
|
4562
4725
|
};
|
|
4563
4726
|
if (queryFieldsSchema === null || queryFieldsSchema === void 0 ? void 0 : queryFieldsSchema.properties) {
|
|
4564
4727
|
schema.properties = {
|
|
@@ -4589,19 +4752,16 @@ const DataCollectionMethodFind = {
|
|
|
4589
4752
|
const DataCollectionMethodFindById = {
|
|
4590
4753
|
name: 'Find by ID',
|
|
4591
4754
|
description: 'Find a single data record in the collection by its id',
|
|
4592
|
-
getInputSchema: ({ collectionHandler, parameters,
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
type: 'string',
|
|
4599
|
-
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4600
|
-
},
|
|
4601
|
-
credentials: (_a = connectorSpec === null || connectorSpec === void 0 ? void 0 : connectorSpec.auth) === null || _a === void 0 ? void 0 : _a.credentialsSchema,
|
|
4755
|
+
getInputSchema: ({ collectionHandler, parameters, credentialsSchema }) => ({
|
|
4756
|
+
type: 'object',
|
|
4757
|
+
properties: nonEmptyObjectProperties({
|
|
4758
|
+
id: {
|
|
4759
|
+
type: 'string',
|
|
4760
|
+
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4602
4761
|
},
|
|
4603
|
-
|
|
4604
|
-
|
|
4762
|
+
credentials: credentialsSchema,
|
|
4763
|
+
}),
|
|
4764
|
+
}),
|
|
4605
4765
|
getOutputSchema: ({ collectionSpec }) => {
|
|
4606
4766
|
var _a;
|
|
4607
4767
|
return ({
|
|
@@ -4630,8 +4790,7 @@ const DataCollectionMethodList = {
|
|
|
4630
4790
|
},
|
|
4631
4791
|
};
|
|
4632
4792
|
},
|
|
4633
|
-
getInputSchema: ({ method, collectionSpec,
|
|
4634
|
-
var _a;
|
|
4793
|
+
getInputSchema: ({ method, collectionSpec, credentialsSchema }) => {
|
|
4635
4794
|
const fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
4636
4795
|
let filterSchema;
|
|
4637
4796
|
if (method === null || method === void 0 ? void 0 : method.filterFields) {
|
|
@@ -4645,7 +4804,7 @@ const DataCollectionMethodList = {
|
|
|
4645
4804
|
type: 'string',
|
|
4646
4805
|
description: 'Cursor returned in response to the previous "list" request',
|
|
4647
4806
|
},
|
|
4648
|
-
credentials:
|
|
4807
|
+
credentials: credentialsSchema,
|
|
4649
4808
|
}),
|
|
4650
4809
|
};
|
|
4651
4810
|
},
|
|
@@ -4684,15 +4843,14 @@ const DataCollectionMethodMatch = {
|
|
|
4684
4843
|
},
|
|
4685
4844
|
};
|
|
4686
4845
|
},
|
|
4687
|
-
getInputSchema: ({ collectionSpec, method,
|
|
4688
|
-
var _a;
|
|
4846
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
4689
4847
|
const fieldsSchema = pickFieldsFromSchema(collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema, method === null || method === void 0 ? void 0 : method.fields);
|
|
4690
4848
|
return {
|
|
4691
4849
|
type: 'object',
|
|
4692
|
-
properties: {
|
|
4850
|
+
properties: nonEmptyObjectProperties({
|
|
4693
4851
|
query: transformVariablesWith(fieldsSchema !== null && fieldsSchema !== void 0 ? fieldsSchema : {}, (locator) => `query.${locatorToField(locator)}`),
|
|
4694
|
-
credentials:
|
|
4695
|
-
},
|
|
4852
|
+
credentials: credentialsSchema,
|
|
4853
|
+
}),
|
|
4696
4854
|
};
|
|
4697
4855
|
},
|
|
4698
4856
|
getOutputSchema: ({ collectionSpec }) => {
|
|
@@ -4710,17 +4868,14 @@ const DataCollectionMethodMatch = {
|
|
|
4710
4868
|
const DataCollectionMethodSearch = {
|
|
4711
4869
|
name: 'Search',
|
|
4712
4870
|
description: 'Find data records in a collection by a string query',
|
|
4713
|
-
getInputSchema: ({
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
type: '
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
},
|
|
4722
|
-
});
|
|
4723
|
-
},
|
|
4871
|
+
getInputSchema: ({ credentialsSchema }) => ({
|
|
4872
|
+
type: 'object',
|
|
4873
|
+
properties: nonEmptyObjectProperties({
|
|
4874
|
+
query: { type: 'string' },
|
|
4875
|
+
cursor: { type: 'string' },
|
|
4876
|
+
credentials: credentialsSchema,
|
|
4877
|
+
}),
|
|
4878
|
+
}),
|
|
4724
4879
|
getOutputSchema: ({ collectionSpec }) => {
|
|
4725
4880
|
var _a;
|
|
4726
4881
|
return ({
|
|
@@ -4757,8 +4912,8 @@ const DataCollectionMethodUpdate = {
|
|
|
4757
4912
|
},
|
|
4758
4913
|
};
|
|
4759
4914
|
},
|
|
4760
|
-
getInputSchema: ({ collectionSpec, collectionHandler,
|
|
4761
|
-
var _a
|
|
4915
|
+
getInputSchema: ({ collectionSpec, collectionHandler, credentialsSchema, method, parameters }) => {
|
|
4916
|
+
var _a;
|
|
4762
4917
|
let fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
4763
4918
|
if (method === null || method === void 0 ? void 0 : method.fields) {
|
|
4764
4919
|
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields);
|
|
@@ -4768,7 +4923,7 @@ const DataCollectionMethodUpdate = {
|
|
|
4768
4923
|
}
|
|
4769
4924
|
return {
|
|
4770
4925
|
type: 'object',
|
|
4771
|
-
properties: {
|
|
4926
|
+
properties: nonEmptyObjectProperties({
|
|
4772
4927
|
id: {
|
|
4773
4928
|
type: 'string',
|
|
4774
4929
|
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
@@ -4776,8 +4931,8 @@ const DataCollectionMethodUpdate = {
|
|
|
4776
4931
|
fields: (_a = transformVariablesWith(fieldsSchema, (locator) => `fields.${locatorToField(locator)}`)) !== null && _a !== void 0 ? _a : {
|
|
4777
4932
|
type: 'object',
|
|
4778
4933
|
},
|
|
4779
|
-
credentials:
|
|
4780
|
-
},
|
|
4934
|
+
credentials: credentialsSchema,
|
|
4935
|
+
}),
|
|
4781
4936
|
};
|
|
4782
4937
|
},
|
|
4783
4938
|
getOutputSchema: ({}) => ({
|
|
@@ -9384,6 +9539,7 @@ const PackageCalculatedProperties = z.z.object({
|
|
|
9384
9539
|
key: z.z.string(),
|
|
9385
9540
|
name: z.z.string(),
|
|
9386
9541
|
isCustomized: z.z.boolean().optional(),
|
|
9542
|
+
isPublic: z.z.boolean().optional(),
|
|
9387
9543
|
});
|
|
9388
9544
|
const BasePackage = BaseMembraneInterface.merge(PackageEditableProperties).merge(PackageCalculatedProperties);
|
|
9389
9545
|
const WritablePackageVersionData = z.z.object({
|
|
@@ -9829,6 +9985,7 @@ const FindActionRunLogsResponse = createPaginationResponseSchema(ActionRunLogRec
|
|
|
9829
9985
|
|
|
9830
9986
|
const FindConnectionsQuery = PaginationQuery.merge(SearchQuery).merge(IncludeArchivedQuery).extend({
|
|
9831
9987
|
connectorId: z.z.string().optional(),
|
|
9988
|
+
connectorVersion: z.z.string().optional(),
|
|
9832
9989
|
id: z.z.string().optional(),
|
|
9833
9990
|
userId: z.z.string().optional(),
|
|
9834
9991
|
name: z.z.string().optional(),
|
|
@@ -9878,8 +10035,15 @@ const ConnectionMessagePayload = z.z.discriminatedUnion('type', [
|
|
|
9878
10035
|
type: z.z.literal('newConnectionFailure'),
|
|
9879
10036
|
error: z.z.string(),
|
|
9880
10037
|
errorData: ErrorDataSchema.optional(),
|
|
10038
|
+
connectionId: z.z.string().optional(),
|
|
9881
10039
|
}),
|
|
9882
10040
|
]);
|
|
10041
|
+
const GenerateOptionsRequest = z.z.object({
|
|
10042
|
+
integrationId: z.z.string().optional(),
|
|
10043
|
+
connectorId: z.z.string().optional(),
|
|
10044
|
+
connectorParameters: z.z.any().optional(),
|
|
10045
|
+
connectorVersion: z.z.string().optional(),
|
|
10046
|
+
});
|
|
9883
10047
|
|
|
9884
10048
|
const ListPublicConnectorsQuery = PaginationQuery.extend({
|
|
9885
10049
|
search: z.z.string().optional(),
|
|
@@ -10072,12 +10236,16 @@ const IntegrationAuthOption = z.z.object({
|
|
|
10072
10236
|
type: z.z.enum(CONNECTOR_AUTH_TYPES),
|
|
10073
10237
|
title: z.z.string().optional(),
|
|
10074
10238
|
description: z.z.string().optional(),
|
|
10075
|
-
|
|
10239
|
+
inputSchema: DataSchema.optional(),
|
|
10240
|
+
ui: IntegrationAuthUi.optional().describe('[INTERNAL] Deprecated: Use inputSchema instead'),
|
|
10076
10241
|
});
|
|
10077
10242
|
const IntegrationApiResponse = BaseIntegration.extend({
|
|
10078
10243
|
connection: BaseConnection.optional(),
|
|
10079
10244
|
spec: z.z.any().optional(),
|
|
10080
|
-
authOptions: z.z
|
|
10245
|
+
authOptions: z.z
|
|
10246
|
+
.array(IntegrationAuthOption)
|
|
10247
|
+
.optional()
|
|
10248
|
+
.describe('[INTERNAL] Deprecated: Use POST /connectors/:id/generate-options instead'),
|
|
10081
10249
|
parametersSchema: DataSchema.optional(),
|
|
10082
10250
|
});
|
|
10083
10251
|
|
|
@@ -10418,6 +10586,107 @@ function hasCycles(nodes) {
|
|
|
10418
10586
|
return hasCycles;
|
|
10419
10587
|
}
|
|
10420
10588
|
|
|
10589
|
+
function addUndefinedWriteableProperties(value, schema) {
|
|
10590
|
+
if (!(schema instanceof z.z.ZodObject)) {
|
|
10591
|
+
return value;
|
|
10592
|
+
}
|
|
10593
|
+
const allProperties = Object.keys(schema.shape);
|
|
10594
|
+
for (const key of allProperties) {
|
|
10595
|
+
if (!(key in value)) {
|
|
10596
|
+
value[key] = undefined;
|
|
10597
|
+
}
|
|
10598
|
+
}
|
|
10599
|
+
return value;
|
|
10600
|
+
}
|
|
10601
|
+
function lenientParseWithSchema(data, schema) {
|
|
10602
|
+
if (data === undefined || data === null) {
|
|
10603
|
+
return data;
|
|
10604
|
+
}
|
|
10605
|
+
const def = schema._def;
|
|
10606
|
+
if (!def) {
|
|
10607
|
+
return data;
|
|
10608
|
+
}
|
|
10609
|
+
const typeName = def.typeName || def.type;
|
|
10610
|
+
if (typeName === 'ZodOptional' || typeName === 'optional') {
|
|
10611
|
+
if (data === undefined)
|
|
10612
|
+
return undefined;
|
|
10613
|
+
return lenientParseWithSchema(data, def.innerType);
|
|
10614
|
+
}
|
|
10615
|
+
if (typeName === 'ZodNullable' || typeName === 'nullable') {
|
|
10616
|
+
if (data === null)
|
|
10617
|
+
return null;
|
|
10618
|
+
return lenientParseWithSchema(data, def.innerType);
|
|
10619
|
+
}
|
|
10620
|
+
if (typeName === 'ZodObject' || typeName === 'object') {
|
|
10621
|
+
if (typeof data !== 'object' || Array.isArray(data)) {
|
|
10622
|
+
return data;
|
|
10623
|
+
}
|
|
10624
|
+
const shape = schema.shape;
|
|
10625
|
+
const result = {};
|
|
10626
|
+
if (shape) {
|
|
10627
|
+
for (const key in shape) {
|
|
10628
|
+
if (key in data) {
|
|
10629
|
+
result[key] = lenientParseWithSchema(data[key], shape[key]);
|
|
10630
|
+
}
|
|
10631
|
+
}
|
|
10632
|
+
}
|
|
10633
|
+
const catchall = def.catchall;
|
|
10634
|
+
if (catchall) {
|
|
10635
|
+
const catchallDef = catchall._def;
|
|
10636
|
+
if ((catchallDef === null || catchallDef === void 0 ? void 0 : catchallDef.typeName) === 'ZodNever' || (catchallDef === null || catchallDef === void 0 ? void 0 : catchallDef.type) === 'never') ;
|
|
10637
|
+
else if ((catchallDef === null || catchallDef === void 0 ? void 0 : catchallDef.typeName) === 'ZodAny' || (catchallDef === null || catchallDef === void 0 ? void 0 : catchallDef.type) === 'unknown' || (catchallDef === null || catchallDef === void 0 ? void 0 : catchallDef.type) === 'any') {
|
|
10638
|
+
for (const key in data) {
|
|
10639
|
+
if (!(key in result)) {
|
|
10640
|
+
result[key] = data[key];
|
|
10641
|
+
}
|
|
10642
|
+
}
|
|
10643
|
+
}
|
|
10644
|
+
else {
|
|
10645
|
+
for (const key in data) {
|
|
10646
|
+
if (shape && !(key in shape)) {
|
|
10647
|
+
result[key] = data[key];
|
|
10648
|
+
}
|
|
10649
|
+
}
|
|
10650
|
+
}
|
|
10651
|
+
}
|
|
10652
|
+
return result;
|
|
10653
|
+
}
|
|
10654
|
+
if (typeName === 'ZodArray' || typeName === 'array') {
|
|
10655
|
+
if (!Array.isArray(data)) {
|
|
10656
|
+
return data;
|
|
10657
|
+
}
|
|
10658
|
+
const elementSchema = def.element || def.type;
|
|
10659
|
+
if (!elementSchema) {
|
|
10660
|
+
return data;
|
|
10661
|
+
}
|
|
10662
|
+
return data.map((item) => lenientParseWithSchema(item, elementSchema));
|
|
10663
|
+
}
|
|
10664
|
+
if (typeName === 'ZodRecord' || typeName === 'record') {
|
|
10665
|
+
if (typeof data !== 'object' || data === null || Array.isArray(data)) {
|
|
10666
|
+
return data;
|
|
10667
|
+
}
|
|
10668
|
+
const valueSchema = def.valueType;
|
|
10669
|
+
if (!valueSchema) {
|
|
10670
|
+
return data;
|
|
10671
|
+
}
|
|
10672
|
+
const result = {};
|
|
10673
|
+
for (const key in data) {
|
|
10674
|
+
result[key] = lenientParseWithSchema(data[key], valueSchema);
|
|
10675
|
+
}
|
|
10676
|
+
return result;
|
|
10677
|
+
}
|
|
10678
|
+
return data;
|
|
10679
|
+
}
|
|
10680
|
+
|
|
10681
|
+
function setEditablePropertiesForWorkspaceElement(currentElement, newEditableFields, exportSchema) {
|
|
10682
|
+
const parsedNewFields = lenientParseWithSchema(newEditableFields, exportSchema);
|
|
10683
|
+
const normalizedFields = addUndefinedWriteableProperties(parsedNewFields, exportSchema);
|
|
10684
|
+
return {
|
|
10685
|
+
...currentElement,
|
|
10686
|
+
...normalizedFields,
|
|
10687
|
+
};
|
|
10688
|
+
}
|
|
10689
|
+
|
|
10421
10690
|
const WorkspaceElementSpecs = {
|
|
10422
10691
|
[exports.WorkspaceElementType.Customer]: {
|
|
10423
10692
|
type: exports.WorkspaceElementType.Customer,
|
|
@@ -10444,6 +10713,7 @@ const WorkspaceElementSpecs = {
|
|
|
10444
10713
|
apiPath: 'connectors',
|
|
10445
10714
|
name: 'Connector',
|
|
10446
10715
|
namePlural: 'Connectors',
|
|
10716
|
+
exportPropertiesSchema: ConnectorExportProperties,
|
|
10447
10717
|
},
|
|
10448
10718
|
[exports.WorkspaceElementType.Connection]: {
|
|
10449
10719
|
type: exports.WorkspaceElementType.Connection,
|
|
@@ -10744,6 +11014,26 @@ async function streamToString(stream) {
|
|
|
10744
11014
|
});
|
|
10745
11015
|
});
|
|
10746
11016
|
}
|
|
11017
|
+
function isBlob(value) {
|
|
11018
|
+
var _a;
|
|
11019
|
+
if (value === null || typeof value !== 'object') {
|
|
11020
|
+
return false;
|
|
11021
|
+
}
|
|
11022
|
+
if (typeof Blob !== 'undefined' && value instanceof Blob) {
|
|
11023
|
+
return true;
|
|
11024
|
+
}
|
|
11025
|
+
const obj = value;
|
|
11026
|
+
const hasRequiredProps = typeof obj.size === 'number' && typeof obj.type === 'string' && typeof obj.slice === 'function';
|
|
11027
|
+
if (!hasRequiredProps) {
|
|
11028
|
+
return false;
|
|
11029
|
+
}
|
|
11030
|
+
const hasBlobMethod = typeof obj.stream === 'function' || typeof obj.text === 'function' || typeof obj.arrayBuffer === 'function';
|
|
11031
|
+
if (hasBlobMethod) {
|
|
11032
|
+
return true;
|
|
11033
|
+
}
|
|
11034
|
+
const constructorName = (_a = obj.constructor) === null || _a === void 0 ? void 0 : _a.name;
|
|
11035
|
+
return constructorName === 'Blob' || constructorName === 'File';
|
|
11036
|
+
}
|
|
10747
11037
|
function truncateData(data, depth = 0) {
|
|
10748
11038
|
const maxArrayItems = 500;
|
|
10749
11039
|
const maxObjectKeys = 500;
|
|
@@ -10767,6 +11057,9 @@ function truncateData(data, depth = 0) {
|
|
|
10767
11057
|
else if (Buffer.isBuffer(data)) {
|
|
10768
11058
|
return data.toString('utf-8').slice(0, maxStringLength);
|
|
10769
11059
|
}
|
|
11060
|
+
else if (isBlob(data)) {
|
|
11061
|
+
return `<Blob: size=${data.size}, type=${data.type}>`;
|
|
11062
|
+
}
|
|
10770
11063
|
else if (typeof data === 'object') {
|
|
10771
11064
|
const keys = Object.keys(data);
|
|
10772
11065
|
const result = {};
|
|
@@ -11000,6 +11293,7 @@ exports.UsageType = void 0;
|
|
|
11000
11293
|
UsageType["EXTERNAL_EVENTS_PULL_DURATION"] = "external-events-pull-duration";
|
|
11001
11294
|
UsageType["EXTERNAL_EVENT_PULL_NUMBER"] = "external-event-pull-number";
|
|
11002
11295
|
UsageType["EXTERNAL_EVENT_PULL_LOG_SIZE"] = "external-event-pull-log-size";
|
|
11296
|
+
UsageType["EXTERNAL_EVENT_WEBHOOK_REFRESH_DURATION"] = "external-event-webhook-refresh-duration";
|
|
11003
11297
|
UsageType["APP_EVENTS_NUMBER"] = "app-events-number";
|
|
11004
11298
|
UsageType["APP_EVENTS_SIZE"] = "app-events-size";
|
|
11005
11299
|
UsageType["FILES_UPLOAD_NUMBER"] = "files-upload-number";
|
|
@@ -11114,6 +11408,144 @@ function getFlowRunVariableSchema() {
|
|
|
11114
11408
|
};
|
|
11115
11409
|
}
|
|
11116
11410
|
|
|
11411
|
+
exports.AlertStatus = void 0;
|
|
11412
|
+
(function (AlertStatus) {
|
|
11413
|
+
AlertStatus["ONGOING"] = "ongoing";
|
|
11414
|
+
AlertStatus["RESOLVED"] = "resolved";
|
|
11415
|
+
})(exports.AlertStatus || (exports.AlertStatus = {}));
|
|
11416
|
+
exports.AlertSeverity = void 0;
|
|
11417
|
+
(function (AlertSeverity) {
|
|
11418
|
+
AlertSeverity["CRITICAL"] = "critical";
|
|
11419
|
+
AlertSeverity["WARNING"] = "warning";
|
|
11420
|
+
})(exports.AlertSeverity || (exports.AlertSeverity = {}));
|
|
11421
|
+
exports.AlertType = void 0;
|
|
11422
|
+
(function (AlertType) {
|
|
11423
|
+
AlertType["fileUploadsMbPerHour"] = "fileUploadsMbPerHour";
|
|
11424
|
+
AlertType["apiRequestsPerSecond"] = "apiRequestsPerSecond";
|
|
11425
|
+
AlertType["apiRequestsPerHour"] = "apiRequestsPerHour";
|
|
11426
|
+
AlertType["webhookRequestsPerSecond"] = "webhookRequestsPerSecond";
|
|
11427
|
+
AlertType["webhookRequestsPerHour"] = "webhookRequestsPerHour";
|
|
11428
|
+
AlertType["workspaceElementCreationsPerSecond"] = "workspaceElementCreationsPerSecond";
|
|
11429
|
+
AlertType["workspaceElementCreationsPerHour"] = "workspaceElementCreationsPerHour";
|
|
11430
|
+
AlertType["externalEventsPerCustomerPerDay"] = "externalEventsPerCustomerPerDay";
|
|
11431
|
+
AlertType["totalUsagePerDay"] = "totalUsagePerDay";
|
|
11432
|
+
AlertType["totalUsagePer30Days"] = "totalUsagePer30Days";
|
|
11433
|
+
AlertType["testAlert"] = "testAlert";
|
|
11434
|
+
})(exports.AlertType || (exports.AlertType = {}));
|
|
11435
|
+
exports.AlertCategory = void 0;
|
|
11436
|
+
(function (AlertCategory) {
|
|
11437
|
+
AlertCategory["RATE_LIMIT"] = "rateLimit";
|
|
11438
|
+
AlertCategory["USAGE"] = "usage";
|
|
11439
|
+
AlertCategory["TEST"] = "test";
|
|
11440
|
+
})(exports.AlertCategory || (exports.AlertCategory = {}));
|
|
11441
|
+
const ALERT_TYPE_CATEGORIES = {
|
|
11442
|
+
[exports.AlertType.fileUploadsMbPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11443
|
+
[exports.AlertType.apiRequestsPerSecond]: exports.AlertCategory.RATE_LIMIT,
|
|
11444
|
+
[exports.AlertType.apiRequestsPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11445
|
+
[exports.AlertType.webhookRequestsPerSecond]: exports.AlertCategory.RATE_LIMIT,
|
|
11446
|
+
[exports.AlertType.webhookRequestsPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11447
|
+
[exports.AlertType.workspaceElementCreationsPerSecond]: exports.AlertCategory.RATE_LIMIT,
|
|
11448
|
+
[exports.AlertType.workspaceElementCreationsPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11449
|
+
[exports.AlertType.externalEventsPerCustomerPerDay]: exports.AlertCategory.RATE_LIMIT,
|
|
11450
|
+
[exports.AlertType.totalUsagePerDay]: exports.AlertCategory.USAGE,
|
|
11451
|
+
[exports.AlertType.totalUsagePer30Days]: exports.AlertCategory.USAGE,
|
|
11452
|
+
[exports.AlertType.testAlert]: exports.AlertCategory.TEST,
|
|
11453
|
+
};
|
|
11454
|
+
const AlertSchema = z.z.object({
|
|
11455
|
+
id: z.z.string(),
|
|
11456
|
+
description: z.z.string(),
|
|
11457
|
+
status: z.z.enum(Object.values(exports.AlertStatus)),
|
|
11458
|
+
type: z.z.enum(Object.values(exports.AlertType)),
|
|
11459
|
+
workspaceId: z.z.string(),
|
|
11460
|
+
createdAt: z.z.date(),
|
|
11461
|
+
updatedAt: z.z.date(),
|
|
11462
|
+
lastSeenAt: z.z.date(),
|
|
11463
|
+
resolvedAt: z.z.date().optional(),
|
|
11464
|
+
customerId: z.z.string().optional(),
|
|
11465
|
+
severity: z.z.enum(Object.values(exports.AlertSeverity)),
|
|
11466
|
+
});
|
|
11467
|
+
const ALERT_DELIVERY_METHODS = ['internal', 'webhook', 'email'];
|
|
11468
|
+
const AlertTypeDeliverySettingsSchema = z.z.object({
|
|
11469
|
+
internal: z.z.literal(true),
|
|
11470
|
+
webhook: z.z
|
|
11471
|
+
.object({
|
|
11472
|
+
enabled: z.z.boolean(),
|
|
11473
|
+
})
|
|
11474
|
+
.optional(),
|
|
11475
|
+
email: z.z
|
|
11476
|
+
.object({
|
|
11477
|
+
enabled: z.z.boolean(),
|
|
11478
|
+
})
|
|
11479
|
+
.optional(),
|
|
11480
|
+
});
|
|
11481
|
+
const DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS = {
|
|
11482
|
+
internal: true,
|
|
11483
|
+
webhook: {
|
|
11484
|
+
enabled: false,
|
|
11485
|
+
},
|
|
11486
|
+
email: {
|
|
11487
|
+
enabled: false,
|
|
11488
|
+
},
|
|
11489
|
+
};
|
|
11490
|
+
const AlertDeliverySettingsSchema = z.z.object({
|
|
11491
|
+
alertTypes: z.z.record(z.z.enum(Object.values(exports.AlertType)), AlertTypeDeliverySettingsSchema.optional()).optional(),
|
|
11492
|
+
});
|
|
11493
|
+
const DEFAULT_ALERT_DELIVERY_SETTINGS = {
|
|
11494
|
+
alertTypes: undefined,
|
|
11495
|
+
};
|
|
11496
|
+
|
|
11497
|
+
function isValidAlertType(value) {
|
|
11498
|
+
return Object.values(exports.AlertType).includes(value);
|
|
11499
|
+
}
|
|
11500
|
+
function getAlertTypeDisplayName(alertType) {
|
|
11501
|
+
const names = {
|
|
11502
|
+
[exports.AlertType.fileUploadsMbPerHour]: 'File Uploads MB Per Hour',
|
|
11503
|
+
[exports.AlertType.apiRequestsPerSecond]: 'API Requests Per Second',
|
|
11504
|
+
[exports.AlertType.apiRequestsPerHour]: 'API Requests Per Hour',
|
|
11505
|
+
[exports.AlertType.webhookRequestsPerSecond]: 'Webhook Requests Per Second',
|
|
11506
|
+
[exports.AlertType.webhookRequestsPerHour]: 'Webhook Requests Per Hour',
|
|
11507
|
+
[exports.AlertType.workspaceElementCreationsPerSecond]: 'Workspace Element Creations Per Second',
|
|
11508
|
+
[exports.AlertType.workspaceElementCreationsPerHour]: 'Workspace Element Creations Per Hour',
|
|
11509
|
+
[exports.AlertType.externalEventsPerCustomerPerDay]: 'External Events Per Customer Per Day',
|
|
11510
|
+
[exports.AlertType.totalUsagePerDay]: 'Total Usage Per Day',
|
|
11511
|
+
[exports.AlertType.totalUsagePer30Days]: 'Total Usage Per 30 Days',
|
|
11512
|
+
[exports.AlertType.testAlert]: 'Test Alert',
|
|
11513
|
+
};
|
|
11514
|
+
return names[alertType] || alertType;
|
|
11515
|
+
}
|
|
11516
|
+
function getAlertDeliveryMethodLabel(method) {
|
|
11517
|
+
const labels = {
|
|
11518
|
+
internal: 'Internal Delivery',
|
|
11519
|
+
webhook: 'Webhook Delivery',
|
|
11520
|
+
email: 'Email Delivery',
|
|
11521
|
+
};
|
|
11522
|
+
return labels[method] || method;
|
|
11523
|
+
}
|
|
11524
|
+
function isDeliveryMethodEnabled(settings, method) {
|
|
11525
|
+
var _a;
|
|
11526
|
+
if (method === 'internal') {
|
|
11527
|
+
return true;
|
|
11528
|
+
}
|
|
11529
|
+
if (((_a = settings[method]) !== null && _a !== void 0 ? _a : DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS[method]).enabled) {
|
|
11530
|
+
return true;
|
|
11531
|
+
}
|
|
11532
|
+
return false;
|
|
11533
|
+
}
|
|
11534
|
+
function getAlertCategoryDisplayName(category) {
|
|
11535
|
+
const names = {
|
|
11536
|
+
[exports.AlertCategory.RATE_LIMIT]: 'Rate Limit Alerts',
|
|
11537
|
+
[exports.AlertCategory.USAGE]: 'Usage Alerts',
|
|
11538
|
+
[exports.AlertCategory.TEST]: 'Test',
|
|
11539
|
+
};
|
|
11540
|
+
return names[category] || category;
|
|
11541
|
+
}
|
|
11542
|
+
function getAlertTypesByCategory(category) {
|
|
11543
|
+
return Object.entries(ALERT_TYPE_CATEGORIES)
|
|
11544
|
+
.filter(([, alertCategory]) => alertCategory === category)
|
|
11545
|
+
.map(([alertType]) => alertType)
|
|
11546
|
+
.filter(isValidAlertType);
|
|
11547
|
+
}
|
|
11548
|
+
|
|
11117
11549
|
exports.WorkspaceType = void 0;
|
|
11118
11550
|
(function (WorkspaceType) {
|
|
11119
11551
|
WorkspaceType["PRODUCTION"] = "production";
|
|
@@ -11168,6 +11600,7 @@ const WorkspaceLimitsSchema = z.object({
|
|
|
11168
11600
|
totalNumberOfConnections: WorkspaceLimit.optional(),
|
|
11169
11601
|
totalNumberOfWorkspaceElements: WorkspaceLimit.optional(),
|
|
11170
11602
|
instantTasksQueueSize: WorkspaceLimit.optional(),
|
|
11603
|
+
QueuedTasksQueueSize: WorkspaceLimit.optional(),
|
|
11171
11604
|
parallelApiRequestsPerCustomer: WorkspaceLimit.optional(),
|
|
11172
11605
|
parallelBackgroundJobsPerCustomer: WorkspaceLimit.optional(),
|
|
11173
11606
|
apiRequestsPerCustomerPerSecond: WorkspaceLimit.optional(),
|
|
@@ -11184,6 +11617,7 @@ const EngineWorkspaceSettingsSchema = z.object({
|
|
|
11184
11617
|
enableWebhookLogs: z.boolean().optional(),
|
|
11185
11618
|
enableActionRunLogs: z.boolean().optional(),
|
|
11186
11619
|
disableSecretKeyAuth: z.boolean().optional(),
|
|
11620
|
+
useMembraneUniverse: z.boolean().optional(),
|
|
11187
11621
|
});
|
|
11188
11622
|
const WorkspacePublicKey = z.object({
|
|
11189
11623
|
name: z.string(),
|
|
@@ -11210,6 +11644,7 @@ const AppSchema = z.object({
|
|
|
11210
11644
|
featureFlags: z.array(z.string()).optional(),
|
|
11211
11645
|
limits: WorkspaceLimitsSchema.optional(),
|
|
11212
11646
|
settings: EngineWorkspaceSettingsSchema.optional(),
|
|
11647
|
+
alertDeliverySettings: AlertDeliverySettingsSchema.optional(),
|
|
11213
11648
|
type: z.nativeEnum(exports.WorkspaceType).optional(),
|
|
11214
11649
|
jwksUri: z.string().nullable().optional(),
|
|
11215
11650
|
isTrial: z.boolean().optional(),
|
|
@@ -11387,13 +11822,14 @@ function buildIntegrationsMap(integrations) {
|
|
|
11387
11822
|
return map;
|
|
11388
11823
|
}
|
|
11389
11824
|
|
|
11825
|
+
const IneligibilityReasonSchema = z.z.enum(['disposable', 'blockedDomain', 'notCompanyEmail']);
|
|
11390
11826
|
const PlatformUserSchema = z.z.object({
|
|
11391
11827
|
id: z.z.string(),
|
|
11392
11828
|
email: z.z.string(),
|
|
11393
11829
|
name: z.z.string(),
|
|
11394
11830
|
trialRequested: z.z.boolean(),
|
|
11395
|
-
introVideoStatus: z.z.string().optional(),
|
|
11396
11831
|
isEligible: z.z.boolean().optional(),
|
|
11832
|
+
ineligibilityReason: IneligibilityReasonSchema.optional(),
|
|
11397
11833
|
emailVerified: z.z.boolean().optional(),
|
|
11398
11834
|
});
|
|
11399
11835
|
const FullPlatformUser = z.z.object({
|
|
@@ -11406,8 +11842,8 @@ const FullPlatformUser = z.z.object({
|
|
|
11406
11842
|
isAdmin: z.z.boolean().optional(),
|
|
11407
11843
|
trialRequested: z.z.boolean(),
|
|
11408
11844
|
pat: z.z.string().optional(),
|
|
11409
|
-
introVideoStatus: z.z.string().optional(),
|
|
11410
11845
|
isEligible: z.z.boolean().optional(),
|
|
11846
|
+
ineligibilityReason: IneligibilityReasonSchema.optional(),
|
|
11411
11847
|
emailVerified: z.z.boolean().optional(),
|
|
11412
11848
|
});
|
|
11413
11849
|
|
|
@@ -11418,6 +11854,12 @@ exports.OrgLimitsType = void 0;
|
|
|
11418
11854
|
OrgLimitsType["LAST_THIRTY_DAY_USAGE"] = "lastThirtyDayUsage";
|
|
11419
11855
|
OrgLimitsType["MEMBRANE_EXPERT_CREDITS_CAP"] = "membraneExpertCreditsCapPerMonth";
|
|
11420
11856
|
})(exports.OrgLimitsType || (exports.OrgLimitsType = {}));
|
|
11857
|
+
exports.OrgPlan = void 0;
|
|
11858
|
+
(function (OrgPlan) {
|
|
11859
|
+
OrgPlan["Core"] = "core";
|
|
11860
|
+
OrgPlan["Pro"] = "pro";
|
|
11861
|
+
OrgPlan["Ultimate"] = "ultimate";
|
|
11862
|
+
})(exports.OrgPlan || (exports.OrgPlan = {}));
|
|
11421
11863
|
exports.OrgUserRole = void 0;
|
|
11422
11864
|
(function (OrgUserRole) {
|
|
11423
11865
|
OrgUserRole["Admin"] = "admin";
|
|
@@ -11447,6 +11889,7 @@ const OrgSchema = z.z.object({
|
|
|
11447
11889
|
id: z.z.string(),
|
|
11448
11890
|
key: z.z.string(),
|
|
11449
11891
|
name: z.z.string(),
|
|
11892
|
+
plan: z.z.enum(exports.OrgPlan).optional(),
|
|
11450
11893
|
createdAt: z.z.coerce.date(),
|
|
11451
11894
|
updatedAt: z.z.coerce.date(),
|
|
11452
11895
|
trialEndDate: z.z.string().optional(),
|
|
@@ -11459,11 +11902,19 @@ const OrgSchema = z.z.object({
|
|
|
11459
11902
|
featureFlags: z.z.array(z.z.string()).optional(),
|
|
11460
11903
|
freeAiCredits: z.z.number().optional(),
|
|
11461
11904
|
paidAiCredits: z.z.number().optional(),
|
|
11905
|
+
freeAiMonthlyCredits: z.z.number().nullable().optional(),
|
|
11462
11906
|
stripeCustomerId: z.z.string().optional(),
|
|
11463
11907
|
autoChargeEnabled: z.z.boolean().optional(),
|
|
11464
11908
|
autoChargeThreshold: z.z.number().optional(),
|
|
11465
11909
|
autoChargePurchaseAmount: z.z.number().optional(),
|
|
11466
11910
|
autoChargeMonthlyLimit: z.z.number().optional(),
|
|
11911
|
+
freeInfraCredits: z.z.number().optional(),
|
|
11912
|
+
paidInfraCredits: z.z.number().optional(),
|
|
11913
|
+
freeInfraMonthlyCredits: z.z.number().nullable().optional(),
|
|
11914
|
+
infraAutoChargeEnabled: z.z.boolean().optional(),
|
|
11915
|
+
infraAutoChargeThreshold: z.z.number().optional(),
|
|
11916
|
+
infraAutoChargePurchaseAmount: z.z.number().optional(),
|
|
11917
|
+
infraAutoChargeMonthlyLimit: z.z.number().optional(),
|
|
11467
11918
|
});
|
|
11468
11919
|
const AccountResponse = z.z.object({
|
|
11469
11920
|
user: FullPlatformUser.optional(),
|
|
@@ -11491,26 +11942,10 @@ exports.WebhookTypeEnum = void 0;
|
|
|
11491
11942
|
WebhookTypeEnum["TASK_UPDATED"] = "task-updated";
|
|
11492
11943
|
WebhookTypeEnum["TASK_ACTIVITY_CREATED"] = "task-activity-created";
|
|
11493
11944
|
WebhookTypeEnum["CONNECTOR_VERSION_PUBLISHED"] = "connector-version-published";
|
|
11945
|
+
WebhookTypeEnum["AGENT_SESSION_FINISHED"] = "agent-session-finished";
|
|
11946
|
+
WebhookTypeEnum["SEND_ALERT_EMAIL"] = "send-alert-email";
|
|
11494
11947
|
})(exports.WebhookTypeEnum || (exports.WebhookTypeEnum = {}));
|
|
11495
11948
|
|
|
11496
|
-
exports.AlertStatus = void 0;
|
|
11497
|
-
(function (AlertStatus) {
|
|
11498
|
-
AlertStatus["ONGOING"] = "ongoing";
|
|
11499
|
-
AlertStatus["RESOLVED"] = "resolved";
|
|
11500
|
-
})(exports.AlertStatus || (exports.AlertStatus = {}));
|
|
11501
|
-
exports.AlertSeverity = void 0;
|
|
11502
|
-
(function (AlertSeverity) {
|
|
11503
|
-
AlertSeverity["CRITICAL"] = "critical";
|
|
11504
|
-
AlertSeverity["WARNING"] = "warning";
|
|
11505
|
-
})(exports.AlertSeverity || (exports.AlertSeverity = {}));
|
|
11506
|
-
exports.AlertType = void 0;
|
|
11507
|
-
(function (AlertType) {
|
|
11508
|
-
AlertType["externalEventsPerCustomerPerDay"] = "externalEventsPerCustomerPerDay";
|
|
11509
|
-
AlertType["totalUsagePerDay"] = "totalUsagePerDay";
|
|
11510
|
-
AlertType["totalUsagePer30Days"] = "totalUsagePer30Days";
|
|
11511
|
-
AlertType["membraneAgentUsagePer30Days"] = "membraneAgentUsagePer30Days";
|
|
11512
|
-
})(exports.AlertType || (exports.AlertType = {}));
|
|
11513
|
-
|
|
11514
11949
|
const IntegrationSpecificElementSelector = z.object({
|
|
11515
11950
|
id: z.string().optional(),
|
|
11516
11951
|
key: z.string().optional(),
|
|
@@ -12497,7 +12932,7 @@ class ConnectionAccessor {
|
|
|
12497
12932
|
dataCollection(key, parameters) {
|
|
12498
12933
|
return new ConnectionDataCollectionAccessor(this.client, this, key, parameters);
|
|
12499
12934
|
}
|
|
12500
|
-
async reconnect({ parameters, authOptionKey, connectorParameters, } = {}) {
|
|
12935
|
+
async reconnect({ parameters, authOptionKey, connectorParameters, onPopupClosed, } = {}) {
|
|
12501
12936
|
const connection = await this.get();
|
|
12502
12937
|
const connectorSpec = await this.client.get(`/integrations/${connection.integrationId}/connector-spec`);
|
|
12503
12938
|
return createOrUpdateConnection({
|
|
@@ -12508,6 +12943,7 @@ class ConnectionAccessor {
|
|
|
12508
12943
|
connectorParameters,
|
|
12509
12944
|
apiUri: this.client.apiUri,
|
|
12510
12945
|
token: await this.client.getToken(),
|
|
12946
|
+
onPopupClosed,
|
|
12511
12947
|
});
|
|
12512
12948
|
}
|
|
12513
12949
|
async openReconnectUI({} = {}) {
|
|
@@ -12596,21 +13032,31 @@ class ConnectionProxy {
|
|
|
12596
13032
|
}
|
|
12597
13033
|
}
|
|
12598
13034
|
async function createOrUpdateConnection(options) {
|
|
12599
|
-
const { connectionId, integrationId, name, parameters, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, } = options !== null && options !== void 0 ? options : {};
|
|
13035
|
+
const { connectionId, integrationId, connectorId, connectorVersion, name, parameters, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
|
|
12600
13036
|
const connectionType = getConnectionType({
|
|
12601
13037
|
connectorSpec,
|
|
12602
13038
|
authOptionKey,
|
|
12603
13039
|
redirectUri,
|
|
12604
13040
|
});
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
13041
|
+
let popupPath;
|
|
13042
|
+
if (connectionId) {
|
|
13043
|
+
popupPath = `connection-popup?connectionId=${connectionId}`;
|
|
13044
|
+
}
|
|
13045
|
+
else if (connectorId) {
|
|
13046
|
+
const versionParam = connectorVersion ? `&connectorVersion=${connectorVersion}` : '';
|
|
13047
|
+
popupPath = `connection-popup?connectorId=${connectorId}${versionParam}`;
|
|
13048
|
+
}
|
|
13049
|
+
else {
|
|
13050
|
+
popupPath = `connection-popup?integrationId=${integrationId}`;
|
|
13051
|
+
}
|
|
12608
13052
|
return new Promise((resolve, reject) => {
|
|
12609
13053
|
const requestId = simpleUniqueId() + simpleUniqueId();
|
|
12610
13054
|
const payload = {
|
|
12611
13055
|
token,
|
|
12612
13056
|
connectionParameters: parameters,
|
|
12613
13057
|
connectorParameters,
|
|
13058
|
+
connectorId,
|
|
13059
|
+
connectorVersion,
|
|
12614
13060
|
name,
|
|
12615
13061
|
authOptionKey,
|
|
12616
13062
|
allowMultipleConnections,
|
|
@@ -12656,10 +13102,10 @@ async function createOrUpdateConnection(options) {
|
|
|
12656
13102
|
iframeElement.id = targetElementId;
|
|
12657
13103
|
iframeElement.name = targetElementId;
|
|
12658
13104
|
iframeElement.style.position = 'absolute';
|
|
12659
|
-
iframeElement.style.top = '-
|
|
12660
|
-
iframeElement.style.left = '-
|
|
12661
|
-
iframeElement.style.width = '
|
|
12662
|
-
iframeElement.style.height = '
|
|
13105
|
+
iframeElement.style.top = '-100px';
|
|
13106
|
+
iframeElement.style.left = '-100px';
|
|
13107
|
+
iframeElement.style.width = '1px';
|
|
13108
|
+
iframeElement.style.height = '1px';
|
|
12663
13109
|
iframeElement.style.border = 'none';
|
|
12664
13110
|
iframeElement.style.backgroundColor = 'transparent';
|
|
12665
13111
|
document.body.appendChild(iframeElement);
|
|
@@ -12693,6 +13139,7 @@ async function createOrUpdateConnection(options) {
|
|
|
12693
13139
|
cancelCheckInterval = setInterval(() => {
|
|
12694
13140
|
if (popup === null || popup === void 0 ? void 0 : popup.closed) {
|
|
12695
13141
|
cleanup();
|
|
13142
|
+
onPopupClosed === null || onPopupClosed === void 0 ? void 0 : onPopupClosed();
|
|
12696
13143
|
resolve(null);
|
|
12697
13144
|
}
|
|
12698
13145
|
}, 1000);
|
|
@@ -12724,6 +13171,9 @@ const createConnectionEventHandler = (requestId, onResolve, onReject, onFinally)
|
|
|
12724
13171
|
}
|
|
12725
13172
|
if (message.type == 'newConnectionFailure') {
|
|
12726
13173
|
const error = new MembraneError((_a = message.errorData) !== null && _a !== void 0 ? _a : message.error);
|
|
13174
|
+
if (message.connectionId) {
|
|
13175
|
+
error.data.data = { ...error.data.data, connectionId: message.connectionId };
|
|
13176
|
+
}
|
|
12727
13177
|
onReject(error);
|
|
12728
13178
|
}
|
|
12729
13179
|
onFinally();
|
|
@@ -12903,7 +13353,7 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
12903
13353
|
});
|
|
12904
13354
|
});
|
|
12905
13355
|
}
|
|
12906
|
-
async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
|
|
13356
|
+
async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, } = {}) {
|
|
12907
13357
|
const integration = await this.get();
|
|
12908
13358
|
const connectorSpec = await this.getConnectorSpec();
|
|
12909
13359
|
return createOrUpdateConnection({
|
|
@@ -12917,9 +13367,10 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
12917
13367
|
apiUri: this.client.apiUri,
|
|
12918
13368
|
token: await this.client.getToken(),
|
|
12919
13369
|
redirectUri: sameWindow ? redirectUri : undefined,
|
|
13370
|
+
onPopupClosed,
|
|
12920
13371
|
});
|
|
12921
13372
|
}
|
|
12922
|
-
async createConnection({ parameters, name }) {
|
|
13373
|
+
async createConnection({ parameters, name, }) {
|
|
12923
13374
|
return this.connect({ parameters, name });
|
|
12924
13375
|
}
|
|
12925
13376
|
async getOperations() {
|
|
@@ -13241,6 +13692,7 @@ exports.AgentSessionState = void 0;
|
|
|
13241
13692
|
})(exports.AgentSessionState || (exports.AgentSessionState = {}));
|
|
13242
13693
|
const AgentSession = z.z.object({
|
|
13243
13694
|
id: z.z.string(),
|
|
13695
|
+
workspaceId: z.z.string(),
|
|
13244
13696
|
userId: z.z.string().optional(),
|
|
13245
13697
|
workspaceElementType: z.z.enum(exports.WorkspaceElementType),
|
|
13246
13698
|
workspaceElementId: z.z.string(),
|
|
@@ -13255,6 +13707,7 @@ const AgentSession = z.z.object({
|
|
|
13255
13707
|
state: z.z.enum(exports.AgentSessionState).default(exports.AgentSessionState.BUSY),
|
|
13256
13708
|
usage: z.z.number().optional(),
|
|
13257
13709
|
hasWorker: z.z.boolean(),
|
|
13710
|
+
isExternal: z.z.boolean().optional(),
|
|
13258
13711
|
createdAt: z.z.iso.datetime(),
|
|
13259
13712
|
updatedAt: z.z.iso.datetime(),
|
|
13260
13713
|
});
|
|
@@ -13264,6 +13717,7 @@ const CreateAgentSession = z.z.object({
|
|
|
13264
13717
|
prompt: z.z.string().min(1),
|
|
13265
13718
|
testCustomerId: z.z.string().optional(),
|
|
13266
13719
|
isExternal: z.z.boolean().optional(),
|
|
13720
|
+
modelId: z.z.string().optional(),
|
|
13267
13721
|
});
|
|
13268
13722
|
const AgentSessionInputSchema = z.z.object({
|
|
13269
13723
|
input: z.z.string().min(1),
|
|
@@ -13275,6 +13729,8 @@ const PatchAgentSessionSchema = z.z.object({
|
|
|
13275
13729
|
title: z.z.string().optional(),
|
|
13276
13730
|
summary: z.z.string().optional(),
|
|
13277
13731
|
cost: z.z.number().optional(),
|
|
13732
|
+
error: ErrorDataSchema.optional(),
|
|
13733
|
+
opencodeSessionUuid: z.z.string().optional(),
|
|
13278
13734
|
status: z.z.enum(exports.AgentSessionStatus).optional(),
|
|
13279
13735
|
});
|
|
13280
13736
|
|
|
@@ -13588,6 +14044,8 @@ class MembraneClient extends MembraneApiClient {
|
|
|
13588
14044
|
injectFormulaCatalog(getFormula, isFormula, hasFormulas);
|
|
13589
14045
|
|
|
13590
14046
|
exports.ACTIONS = ACTIONS;
|
|
14047
|
+
exports.ALERT_DELIVERY_METHODS = ALERT_DELIVERY_METHODS;
|
|
14048
|
+
exports.ALERT_TYPE_CATEGORIES = ALERT_TYPE_CATEGORIES;
|
|
13591
14049
|
exports.AccessDeniedError = AccessDeniedError;
|
|
13592
14050
|
exports.AccountResponse = AccountResponse;
|
|
13593
14051
|
exports.ActionAccessor = ActionAccessor;
|
|
@@ -13605,6 +14063,9 @@ exports.ActionRunResponse = ActionRunResponse;
|
|
|
13605
14063
|
exports.ActionsAccessor = ActionsAccessor;
|
|
13606
14064
|
exports.AgentSession = AgentSession;
|
|
13607
14065
|
exports.AgentSessionInputSchema = AgentSessionInputSchema;
|
|
14066
|
+
exports.AlertDeliverySettingsSchema = AlertDeliverySettingsSchema;
|
|
14067
|
+
exports.AlertSchema = AlertSchema;
|
|
14068
|
+
exports.AlertTypeDeliverySettingsSchema = AlertTypeDeliverySettingsSchema;
|
|
13608
14069
|
exports.ApiRequestSpec = ApiRequestSpec;
|
|
13609
14070
|
exports.AppDataSchemaAccessor = AppDataSchemaAccessor;
|
|
13610
14071
|
exports.AppDataSchemaApiResponse = AppDataSchemaApiResponse;
|
|
@@ -13715,6 +14176,8 @@ exports.ConnectorDataCollectionEventImplementationType = ConnectorDataCollection
|
|
|
13715
14176
|
exports.ConnectorDataCollectionMethodKeys = ConnectorDataCollectionMethodKeys;
|
|
13716
14177
|
exports.ConnectorDataLocationTypes = ConnectorDataLocationTypes;
|
|
13717
14178
|
exports.ConnectorEventHandlerMethods = ConnectorEventHandlerMethods;
|
|
14179
|
+
exports.ConnectorExportProperties = ConnectorExportProperties;
|
|
14180
|
+
exports.ConnectorFunctionSpecs = ConnectorFunctionSpecs;
|
|
13718
14181
|
exports.ConnectorMethodImplementation = ConnectorMethodImplementation;
|
|
13719
14182
|
exports.ConnectorMethodImplementationBase = ConnectorMethodImplementationBase;
|
|
13720
14183
|
exports.ConnectorMethodImplementationGraphqlApiMapping = ConnectorMethodImplementationGraphqlApiMapping;
|
|
@@ -13755,6 +14218,8 @@ exports.CustomerApiResponse = CustomerApiResponse;
|
|
|
13755
14218
|
exports.CustomerSelector = CustomerSelector;
|
|
13756
14219
|
exports.CustomersAccessor = CustomersAccessor;
|
|
13757
14220
|
exports.DATA_RECORD_SCHEMA = DATA_RECORD_SCHEMA;
|
|
14221
|
+
exports.DEFAULT_ALERT_DELIVERY_SETTINGS = DEFAULT_ALERT_DELIVERY_SETTINGS;
|
|
14222
|
+
exports.DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS = DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS;
|
|
13758
14223
|
exports.DEFAULT_FULL_SYNC_INTERVAL_SECONDS = DEFAULT_FULL_SYNC_INTERVAL_SECONDS;
|
|
13759
14224
|
exports.DEFAULT_PULL_UPDATES_INTERVAL_SECONDS = DEFAULT_PULL_UPDATES_INTERVAL_SECONDS;
|
|
13760
14225
|
exports.DataCollectionCreateRequest = DataCollectionCreateRequest;
|
|
@@ -13909,6 +14374,8 @@ exports.FlowsAccessor = FlowsAccessor;
|
|
|
13909
14374
|
exports.Formula = Formula;
|
|
13910
14375
|
exports.FullPlatformUser = FullPlatformUser;
|
|
13911
14376
|
exports.FunctionDefinition = FunctionDefinition;
|
|
14377
|
+
exports.GenerateOptionsRequest = GenerateOptionsRequest;
|
|
14378
|
+
exports.GeneratedConnectorOption = GeneratedConnectorOption;
|
|
13912
14379
|
exports.GenericFunctionDefinition = GenericFunctionDefinition;
|
|
13913
14380
|
exports.GraphQLApiMappingSchema = GraphQLApiMappingSchema;
|
|
13914
14381
|
exports.GraphQLFieldMappingSchema = GraphQLFieldMappingSchema;
|
|
@@ -13957,6 +14424,7 @@ exports.MappingSchema = MappingSchema;
|
|
|
13957
14424
|
exports.MembraneAgentKey = MembraneAgentKey;
|
|
13958
14425
|
exports.MembraneAxiosInstance = axios;
|
|
13959
14426
|
exports.MembraneClient = MembraneClient;
|
|
14427
|
+
exports.MembraneElementLayer = MembraneElementLayer;
|
|
13960
14428
|
exports.MembraneError = MembraneError;
|
|
13961
14429
|
exports.MinimalConnector = MinimalConnector;
|
|
13962
14430
|
exports.NotAuthenticatedError = NotAuthenticatedError;
|
|
@@ -14032,9 +14500,11 @@ exports.WorkspacePublicKey = WorkspacePublicKey;
|
|
|
14032
14500
|
exports.WritableConnectorVersionData = WritableConnectorVersionData;
|
|
14033
14501
|
exports.WritablePackageVersionData = WritablePackageVersionData;
|
|
14034
14502
|
exports.WriteableConnectorFields = WriteableConnectorFields;
|
|
14503
|
+
exports.WriteableConnectorOption = WriteableConnectorOption;
|
|
14035
14504
|
exports.__resolveValue = __resolveValue;
|
|
14036
14505
|
exports.addRequiredFieldsToSchema = addRequiredFieldsToSchema;
|
|
14037
14506
|
exports.addUdmFallbackFields = addUdmFallbackFields;
|
|
14507
|
+
exports.addUndefinedWriteableProperties = addUndefinedWriteableProperties;
|
|
14038
14508
|
exports.backwardCompatibleFilterMatch = backwardCompatibleFilterMatch;
|
|
14039
14509
|
exports.buildData = buildData;
|
|
14040
14510
|
exports.buildDataSchema = buildDataSchema;
|
|
@@ -14064,6 +14534,10 @@ exports.findValueLocators = findValueLocators;
|
|
|
14064
14534
|
exports.generateExampleFromSchema = generateExampleFromSchema;
|
|
14065
14535
|
exports.getActionInstanceVariableSchema = getActionInstanceVariableSchema;
|
|
14066
14536
|
exports.getActionRunTimeVariablesSchema = getActionRunTimeVariablesSchema;
|
|
14537
|
+
exports.getAlertCategoryDisplayName = getAlertCategoryDisplayName;
|
|
14538
|
+
exports.getAlertDeliveryMethodLabel = getAlertDeliveryMethodLabel;
|
|
14539
|
+
exports.getAlertTypeDisplayName = getAlertTypeDisplayName;
|
|
14540
|
+
exports.getAlertTypesByCategory = getAlertTypesByCategory;
|
|
14067
14541
|
exports.getAllEventMethodFilePaths = getAllEventMethodFilePaths;
|
|
14068
14542
|
exports.getBusinessDaysBetween = getBusinessDaysBetween;
|
|
14069
14543
|
exports.getChildNodeKeys = getChildNodeKeys;
|
|
@@ -14071,6 +14545,7 @@ exports.getDataCollectionCreateFields = getDataCollectionCreateFields;
|
|
|
14071
14545
|
exports.getDataCollectionUpdateFields = getDataCollectionUpdateFields;
|
|
14072
14546
|
exports.getDataLocationMethodPath = getDataLocationMethodPath;
|
|
14073
14547
|
exports.getDownstreamNodeKeys = getDownstreamNodeKeys;
|
|
14548
|
+
exports.getEffectiveConnectorOption = getEffectiveConnectorOption;
|
|
14074
14549
|
exports.getElementSelector = getElementSelector;
|
|
14075
14550
|
exports.getErrorFromData = getErrorFromData;
|
|
14076
14551
|
exports.getEventMethodFileKey = getEventMethodFileKey;
|
|
@@ -14110,16 +14585,20 @@ exports.getWritableFieldsSchema = getWritableFieldsSchema;
|
|
|
14110
14585
|
exports.hasCycles = hasCycles;
|
|
14111
14586
|
exports.hasFormulas_internalDoNotUse = hasFormulas;
|
|
14112
14587
|
exports.injectFormulaCatalog = injectFormulaCatalog;
|
|
14588
|
+
exports.isBlob = isBlob;
|
|
14113
14589
|
exports.isBusinessDay = isBusinessDay;
|
|
14114
14590
|
exports.isDataActionType = isDataActionType;
|
|
14115
14591
|
exports.isDataLocationMethodSupported = isDataLocationMethodSupported;
|
|
14592
|
+
exports.isDeliveryMethodEnabled = isDeliveryMethodEnabled;
|
|
14116
14593
|
exports.isFormula_internalDoNotUse = isFormula;
|
|
14117
14594
|
exports.isMembraneError = isMembraneError;
|
|
14118
14595
|
exports.isObject = isObject;
|
|
14119
14596
|
exports.isSameDataLocation = isSameDataLocation;
|
|
14120
14597
|
exports.isSchemaEmpty = isSchemaEmpty;
|
|
14121
14598
|
exports.isStream = isStream;
|
|
14599
|
+
exports.isValidAlertType = isValidAlertType;
|
|
14122
14600
|
exports.isValidLocator = isValidLocator;
|
|
14601
|
+
exports.lenientParseWithSchema = lenientParseWithSchema;
|
|
14123
14602
|
exports.locatorToField = locatorToField;
|
|
14124
14603
|
exports.locatorToSteps = locatorToSteps;
|
|
14125
14604
|
exports.locatorToString = locatorToString;
|
|
@@ -14149,6 +14628,7 @@ exports.schemaIsNumber = schemaIsNumber;
|
|
|
14149
14628
|
exports.schemaIsScalar = schemaIsScalar;
|
|
14150
14629
|
exports.schemaTypeFromValue = schemaTypeFromValue;
|
|
14151
14630
|
exports.schemaWithTitle = schemaWithTitle;
|
|
14631
|
+
exports.setEditablePropertiesForWorkspaceElement = setEditablePropertiesForWorkspaceElement;
|
|
14152
14632
|
exports.setSchemaAtLocator = setSchemaAtLocator;
|
|
14153
14633
|
exports.setValueAtLocator = setValueAtLocator;
|
|
14154
14634
|
exports.stepsToLocator = stepsToLocator;
|