@membranehq/sdk 0.9.11 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +75 -34
- package/dist/bundle.js +34 -17
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/connections-accessors.d.ts +18 -12
- package/dist/dts/accessors/integrations-accessors.d.ts +15 -11
- package/dist/dts/agent/session.d.ts +10 -0
- package/dist/dts/alerts/index.d.ts +1 -0
- package/dist/dts/alerts/types.d.ts +106 -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 +68 -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 +19 -4
- 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 -4
- 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/integrations/index.d.ts +0 -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 +1420 -641
- package/dist/index.browser.d.ts +1420 -641
- package/dist/index.browser.js +608 -122
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +584 -123
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +1370 -590
- package/dist/index.node.d.ts +1370 -590
- package/dist/index.node.js +615 -122
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +591 -123
- 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(),
|
|
@@ -3886,11 +3890,12 @@ function getAuthSpec(spec, authOptionKey) {
|
|
|
3886
3890
|
const getDefaultAuthInputSchema = (args) => {
|
|
3887
3891
|
var _a, _b, _c, _d, _e, _f;
|
|
3888
3892
|
const authSpec = getAuthSpec(args.connectorSpec, args.authOptionKey);
|
|
3893
|
+
const inputSchema = (_b = (_a = authSpec === null || authSpec === void 0 ? void 0 : authSpec.ui) === null || _a === void 0 ? void 0 : _a.schema) !== null && _b !== void 0 ? _b : (_d = (_c = args.connectorSpec) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.schema;
|
|
3889
3894
|
return {
|
|
3890
3895
|
type: 'object',
|
|
3891
3896
|
properties: {
|
|
3892
|
-
connectorParameters: (
|
|
3893
|
-
|
|
3897
|
+
connectorParameters: (_f = (_e = args.connectorSpec) === null || _e === void 0 ? void 0 : _e.parametersSchema) !== null && _f !== void 0 ? _f : {},
|
|
3898
|
+
connectionInput: inputSchema,
|
|
3894
3899
|
},
|
|
3895
3900
|
};
|
|
3896
3901
|
};
|
|
@@ -3991,7 +3996,7 @@ const ConnectorAuthMethodTypes = {
|
|
|
3991
3996
|
},
|
|
3992
3997
|
};
|
|
3993
3998
|
},
|
|
3994
|
-
getOutputSchema: () => REST_API_CLIENT_SCHEMA,
|
|
3999
|
+
getOutputSchema: () => REST_API_CLIENT_SCHEMA$1,
|
|
3995
4000
|
isRequired: true,
|
|
3996
4001
|
},
|
|
3997
4002
|
test: {
|
|
@@ -4146,7 +4151,7 @@ const REST_API_CLIENT_RESPONSE_HANDLERS_SCHEMA = {
|
|
|
4146
4151
|
},
|
|
4147
4152
|
},
|
|
4148
4153
|
};
|
|
4149
|
-
const REST_API_CLIENT_SCHEMA = {
|
|
4154
|
+
const REST_API_CLIENT_SCHEMA$1 = {
|
|
4150
4155
|
type: 'object',
|
|
4151
4156
|
properties: {
|
|
4152
4157
|
args: {
|
|
@@ -4184,11 +4189,6 @@ const CONNECTOR_DOCS_DIR = 'docs';
|
|
|
4184
4189
|
const CONNECTOR_GLOBAL_WEBHOOKS_DIR = 'global-webhooks';
|
|
4185
4190
|
const CONNECTOR_EVENTS_DIR = 'events';
|
|
4186
4191
|
|
|
4187
|
-
const ConnectorOperationMethodImplementationTypes = [
|
|
4188
|
-
exports.ConnectorMethodImplementationType.restApiMapping,
|
|
4189
|
-
exports.ConnectorMethodImplementationType.javascript,
|
|
4190
|
-
];
|
|
4191
|
-
|
|
4192
4192
|
exports.FunctionType = void 0;
|
|
4193
4193
|
(function (FunctionType) {
|
|
4194
4194
|
FunctionType["mapping"] = "mapping";
|
|
@@ -4208,10 +4208,157 @@ const BaseFunctionDefinition = z.z.object({
|
|
|
4208
4208
|
});
|
|
4209
4209
|
const GenericFunctionDefinition = z.z
|
|
4210
4210
|
.object({
|
|
4211
|
-
type: z.z.enum(['mapping', 'operation-mapping', 'rest-api-mapping', 'graphql-api-mapping', 'javascript']),
|
|
4211
|
+
type: z.z.enum(['mapping', 'operation-mapping', 'rest-api-mapping', 'graphql-api-mapping', 'javascript']).optional(),
|
|
4212
4212
|
})
|
|
4213
4213
|
.loose();
|
|
4214
4214
|
|
|
4215
|
+
function getEffectiveConnectorOption(connector, optionKey) {
|
|
4216
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
4217
|
+
const option = (_a = connector.options) === null || _a === void 0 ? void 0 : _a[optionKey];
|
|
4218
|
+
const connectorInputSchema = (_b = connector.inputSchema) !== null && _b !== void 0 ? _b : (_c = connector.ui) === null || _c === void 0 ? void 0 : _c.schema;
|
|
4219
|
+
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;
|
|
4220
|
+
return {
|
|
4221
|
+
...connector,
|
|
4222
|
+
...option,
|
|
4223
|
+
inputSchema: mergeSchemas([connectorInputSchema, optionInputSchema]),
|
|
4224
|
+
parametersSchema: mergeSchemas([connector.parametersSchema, option === null || option === void 0 ? void 0 : option.parametersSchema]),
|
|
4225
|
+
credentialsSchema: mergeSchemas([connector.credentialsSchema, option === null || option === void 0 ? void 0 : option.credentialsSchema]),
|
|
4226
|
+
makeApiClient: (_f = option === null || option === void 0 ? void 0 : option.makeApiClient) !== null && _f !== void 0 ? _f : connector.makeApiClient,
|
|
4227
|
+
test: (_g = option === null || option === void 0 ? void 0 : option.test) !== null && _g !== void 0 ? _g : connector.test,
|
|
4228
|
+
};
|
|
4229
|
+
}
|
|
4230
|
+
const getDefaultInputSchema = (authConfig) => {
|
|
4231
|
+
var _a, _b, _c;
|
|
4232
|
+
const inputSchema = (_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;
|
|
4233
|
+
return {
|
|
4234
|
+
type: 'object',
|
|
4235
|
+
properties: {
|
|
4236
|
+
connectorParameters: (_c = authConfig === null || authConfig === void 0 ? void 0 : authConfig.parametersSchema) !== null && _c !== void 0 ? _c : {},
|
|
4237
|
+
...(inputSchema && { connectionInput: inputSchema }),
|
|
4238
|
+
},
|
|
4239
|
+
};
|
|
4240
|
+
};
|
|
4241
|
+
const REST_API_CLIENT_SCHEMA = {
|
|
4242
|
+
type: 'object',
|
|
4243
|
+
properties: {
|
|
4244
|
+
args: {
|
|
4245
|
+
type: 'object',
|
|
4246
|
+
properties: {
|
|
4247
|
+
baseUri: {
|
|
4248
|
+
type: 'string',
|
|
4249
|
+
description: 'This prefix will be added to all relative API requests.',
|
|
4250
|
+
},
|
|
4251
|
+
query: {
|
|
4252
|
+
type: 'object',
|
|
4253
|
+
additionalProperties: true,
|
|
4254
|
+
},
|
|
4255
|
+
headers: {
|
|
4256
|
+
type: 'object',
|
|
4257
|
+
additionalProperties: true,
|
|
4258
|
+
},
|
|
4259
|
+
auth: {
|
|
4260
|
+
type: 'object',
|
|
4261
|
+
description: 'Basic authentication',
|
|
4262
|
+
properties: {
|
|
4263
|
+
username: { type: 'string' },
|
|
4264
|
+
password: { type: 'string' },
|
|
4265
|
+
},
|
|
4266
|
+
},
|
|
4267
|
+
},
|
|
4268
|
+
},
|
|
4269
|
+
},
|
|
4270
|
+
};
|
|
4271
|
+
const ConnectorFunctionSpecs = {
|
|
4272
|
+
getOAuthConfig: {
|
|
4273
|
+
authTypes: ['oauth2', 'oauth1'],
|
|
4274
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4275
|
+
getInputSchema: (authConfig) => {
|
|
4276
|
+
const schema = getDefaultInputSchema(authConfig);
|
|
4277
|
+
return {
|
|
4278
|
+
...schema,
|
|
4279
|
+
properties: {
|
|
4280
|
+
...schema.properties,
|
|
4281
|
+
redirectUri: { type: 'string' },
|
|
4282
|
+
state: { type: 'string' },
|
|
4283
|
+
},
|
|
4284
|
+
};
|
|
4285
|
+
},
|
|
4286
|
+
getOutputSchema: (authConfig) => {
|
|
4287
|
+
return (authConfig === null || authConfig === void 0 ? void 0 : authConfig.type) === 'oauth1' ? OAUTH1_CONFIG_SCHEMA : OAUTH_CONFIG_SCHEMA;
|
|
4288
|
+
},
|
|
4289
|
+
isRequired: true,
|
|
4290
|
+
},
|
|
4291
|
+
getTokenData: {
|
|
4292
|
+
authTypes: ['oauth2'],
|
|
4293
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4294
|
+
getInputSchema: getDefaultInputSchema,
|
|
4295
|
+
getOutputSchema: (authConfig) => {
|
|
4296
|
+
var _a;
|
|
4297
|
+
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;
|
|
4298
|
+
},
|
|
4299
|
+
isRequired: false,
|
|
4300
|
+
},
|
|
4301
|
+
getCredentialsFromAccessTokenResponse: {
|
|
4302
|
+
authTypes: ['oauth2'],
|
|
4303
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4304
|
+
isRequired: false,
|
|
4305
|
+
},
|
|
4306
|
+
getCredentialsFromRefreshTokenResponse: {
|
|
4307
|
+
authTypes: ['oauth2'],
|
|
4308
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4309
|
+
isRequired: false,
|
|
4310
|
+
},
|
|
4311
|
+
getCredentialsFromConnectionParameters: {
|
|
4312
|
+
authTypes: ['client-credentials', 'oauth2'],
|
|
4313
|
+
getInputSchema: getDefaultInputSchema,
|
|
4314
|
+
getOutputSchema: (authConfig) => {
|
|
4315
|
+
return authConfig === null || authConfig === void 0 ? void 0 : authConfig.credentialsSchema;
|
|
4316
|
+
},
|
|
4317
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4318
|
+
isRequired: false,
|
|
4319
|
+
},
|
|
4320
|
+
refreshCredentials: {
|
|
4321
|
+
authTypes: ['oauth2', 'oauth1', 'client-credentials'],
|
|
4322
|
+
getInputSchema: getDefaultInputSchema,
|
|
4323
|
+
getOutputSchema: (authConfig) => {
|
|
4324
|
+
return authConfig === null || authConfig === void 0 ? void 0 : authConfig.credentialsSchema;
|
|
4325
|
+
},
|
|
4326
|
+
supportedFunctionTypes: [exports.FunctionType.javascript],
|
|
4327
|
+
isRequired: false,
|
|
4328
|
+
},
|
|
4329
|
+
makeApiClient: {
|
|
4330
|
+
supportedFunctionTypes: [exports.FunctionType.mapping, exports.FunctionType.javascript],
|
|
4331
|
+
getInputSchema: (authConfig) => {
|
|
4332
|
+
var _a, _b, _c;
|
|
4333
|
+
return {
|
|
4334
|
+
type: 'object',
|
|
4335
|
+
properties: {
|
|
4336
|
+
credentials: mergeSchemas([
|
|
4337
|
+
((_a = authConfig === null || authConfig === void 0 ? void 0 : authConfig.customCredentialsSchema) !== null && _a !== void 0 ? _a : authConfig === null || authConfig === void 0 ? void 0 : authConfig.credentialsSchema),
|
|
4338
|
+
(_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,
|
|
4339
|
+
]),
|
|
4340
|
+
},
|
|
4341
|
+
};
|
|
4342
|
+
},
|
|
4343
|
+
getOutputSchema: () => REST_API_CLIENT_SCHEMA,
|
|
4344
|
+
isRequired: true,
|
|
4345
|
+
},
|
|
4346
|
+
test: {
|
|
4347
|
+
supportedFunctionTypes: [exports.FunctionType.operationMapping, exports.FunctionType.restApiMapping, exports.FunctionType.javascript],
|
|
4348
|
+
getOutputSchema: () => ({
|
|
4349
|
+
title: 'Success Criteria',
|
|
4350
|
+
description: 'If this value is truthy, the test is considered a success.',
|
|
4351
|
+
type: 'boolean',
|
|
4352
|
+
}),
|
|
4353
|
+
isRequired: true,
|
|
4354
|
+
},
|
|
4355
|
+
};
|
|
4356
|
+
|
|
4357
|
+
const ConnectorOperationMethodImplementationTypes = [
|
|
4358
|
+
exports.ConnectorMethodImplementationType.restApiMapping,
|
|
4359
|
+
exports.ConnectorMethodImplementationType.javascript,
|
|
4360
|
+
];
|
|
4361
|
+
|
|
4215
4362
|
const GraphQLFieldMappingSchema = z.z.lazy(() => z.z.object({
|
|
4216
4363
|
field: z.z.string(),
|
|
4217
4364
|
args: z.z.record(z.z.string(), z.z.any()).optional(),
|
|
@@ -4321,7 +4468,8 @@ const ConnectorSpec = z.z.object({
|
|
|
4321
4468
|
type: z.z.enum(['openapi', 'graphql']),
|
|
4322
4469
|
})
|
|
4323
4470
|
.optional(),
|
|
4324
|
-
ui: ConnectorUiSpec.optional(),
|
|
4471
|
+
ui: ConnectorUiSpec.optional().describe('[INTERNAL] Deprecated: Use inputSchema instead'),
|
|
4472
|
+
inputSchema: DataSchema.optional(),
|
|
4325
4473
|
auth: ConnectorAuth.optional(),
|
|
4326
4474
|
parametersSchema: DataSchema.optional(),
|
|
4327
4475
|
udms: z.z.array(z.z.string()).optional(),
|
|
@@ -4344,14 +4492,10 @@ const ConnectorAuthWithFunctions = z.z.object({
|
|
|
4344
4492
|
type: z.z
|
|
4345
4493
|
.enum(['integration-app-token', 'membrane-token', 'oauth2', 'oauth1', 'client-credentials', 'proxy'])
|
|
4346
4494
|
.optional(),
|
|
4495
|
+
credentialsSchema: DataSchema.optional(),
|
|
4347
4496
|
customCredentialsSchema: DataSchema.optional(),
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
schema: DataSchema.optional(),
|
|
4351
|
-
description: z.z.string().optional(),
|
|
4352
|
-
helpUri: z.z.string().optional(),
|
|
4353
|
-
})
|
|
4354
|
-
.optional(),
|
|
4497
|
+
inputSchema: DataSchema.optional(),
|
|
4498
|
+
parametersSchema: DataSchema.optional(),
|
|
4355
4499
|
getCredentialsFromConnectionParameters: GenericFunctionDefinition.optional(),
|
|
4356
4500
|
refreshCredentials: GenericFunctionDefinition.optional(),
|
|
4357
4501
|
makeApiClient: GenericFunctionDefinition.optional(),
|
|
@@ -4359,18 +4503,40 @@ const ConnectorAuthWithFunctions = z.z.object({
|
|
|
4359
4503
|
getTokenData: GenericFunctionDefinition.optional(),
|
|
4360
4504
|
getCredentialsFromAccessTokenResponse: GenericFunctionDefinition.optional(),
|
|
4361
4505
|
getCredentialsFromRefreshTokenResponse: GenericFunctionDefinition.optional(),
|
|
4506
|
+
test: GenericFunctionDefinition.optional(),
|
|
4362
4507
|
proxyKey: z.z.string().optional(),
|
|
4508
|
+
ui: z.z
|
|
4509
|
+
.object({
|
|
4510
|
+
schema: DataSchema.optional(),
|
|
4511
|
+
description: z.z.string().optional(),
|
|
4512
|
+
helpUri: z.z.string().optional(),
|
|
4513
|
+
})
|
|
4514
|
+
.optional()
|
|
4515
|
+
.describe('[INTERNAL] Deprecated: Use inputSchema instead'),
|
|
4363
4516
|
});
|
|
4364
|
-
const
|
|
4517
|
+
const WriteableConnectorOption = ConnectorAuthWithFunctions.extend({
|
|
4365
4518
|
title: z.z.string().optional(),
|
|
4366
4519
|
description: z.z.string().optional(),
|
|
4367
4520
|
enabled: z.z.any().optional(),
|
|
4521
|
+
}).omit({
|
|
4522
|
+
credentialsSchema: true,
|
|
4523
|
+
});
|
|
4524
|
+
const ConnectorOption = WriteableConnectorOption.extend({
|
|
4525
|
+
credentialsSchema: DataSchema.optional(),
|
|
4526
|
+
});
|
|
4527
|
+
const GeneratedConnectorOption = z.z.object({
|
|
4528
|
+
key: z.z.string(),
|
|
4529
|
+
type: z.z.enum(CONNECTOR_AUTH_TYPES),
|
|
4530
|
+
title: z.z.string().optional(),
|
|
4531
|
+
description: z.z.string().optional(),
|
|
4532
|
+
inputSchema: DataSchema.optional(),
|
|
4368
4533
|
});
|
|
4369
4534
|
const ConnectorOptions = z.z.record(z.z.string(), ConnectorOption);
|
|
4370
4535
|
const WritableConnectorVersionData = ConnectorAuthWithFunctions.extend({
|
|
4371
4536
|
parametersSchema: DataSchema.optional(),
|
|
4372
|
-
|
|
4373
|
-
|
|
4537
|
+
options: z.z.record(z.z.string(), WriteableConnectorOption).optional(),
|
|
4538
|
+
}).omit({
|
|
4539
|
+
credentialsSchema: true,
|
|
4374
4540
|
});
|
|
4375
4541
|
const ConnectorVersionData = z.z
|
|
4376
4542
|
.object({
|
|
@@ -4388,7 +4554,10 @@ const ConnectorVersionData = z.z
|
|
|
4388
4554
|
version: z.z.string(),
|
|
4389
4555
|
credentialsSchema: DataSchema.optional(),
|
|
4390
4556
|
})
|
|
4391
|
-
.extend(WritableConnectorVersionData.shape)
|
|
4557
|
+
.extend(WritableConnectorVersionData.shape)
|
|
4558
|
+
.extend({
|
|
4559
|
+
options: ConnectorOptions.optional(),
|
|
4560
|
+
});
|
|
4392
4561
|
const ConnectorVersion = ConnectorVersionData.extend({
|
|
4393
4562
|
id: z.z.string(),
|
|
4394
4563
|
connectorId: z.z.string(),
|
|
@@ -4403,6 +4572,7 @@ const WriteableConnectorFields = z.z
|
|
|
4403
4572
|
categories: z.z.array(z.z.string()).optional(),
|
|
4404
4573
|
})
|
|
4405
4574
|
.extend(WritableConnectorVersionData.shape);
|
|
4575
|
+
const ConnectorExportProperties = WriteableConnectorFields;
|
|
4406
4576
|
const UpdateConnectorRequest = WriteableConnectorFields;
|
|
4407
4577
|
const CreateConnectorRequest = WriteableConnectorFields.extend({
|
|
4408
4578
|
name: z.z.string(),
|
|
@@ -4412,16 +4582,12 @@ const BaseConnector = z.z.object({
|
|
|
4412
4582
|
id: z.z.string(),
|
|
4413
4583
|
key: z.z.string(),
|
|
4414
4584
|
uuid: z.z.string(),
|
|
4585
|
+
appUuid: z.z.string().optional(),
|
|
4415
4586
|
name: z.z.string(),
|
|
4416
4587
|
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
4588
|
categories: z.z.array(z.z.string()).optional(),
|
|
4422
4589
|
isPublic: z.z.boolean().optional(),
|
|
4423
4590
|
popularity: z.z.number().optional(),
|
|
4424
|
-
appUuid: z.z.string().optional(),
|
|
4425
4591
|
});
|
|
4426
4592
|
const Connector = z.z
|
|
4427
4593
|
.object({})
|
|
@@ -4485,8 +4651,8 @@ const DataCollectionMethodCreate = {
|
|
|
4485
4651
|
},
|
|
4486
4652
|
};
|
|
4487
4653
|
},
|
|
4488
|
-
getInputSchema: ({ collectionSpec, method,
|
|
4489
|
-
var _a
|
|
4654
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
4655
|
+
var _a;
|
|
4490
4656
|
let fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
4491
4657
|
if (method === null || method === void 0 ? void 0 : method.fields) {
|
|
4492
4658
|
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields);
|
|
@@ -4496,12 +4662,12 @@ const DataCollectionMethodCreate = {
|
|
|
4496
4662
|
}
|
|
4497
4663
|
return {
|
|
4498
4664
|
type: 'object',
|
|
4499
|
-
properties: {
|
|
4665
|
+
properties: nonEmptyObjectProperties({
|
|
4500
4666
|
fields: (_a = transformVariablesWith(fieldsSchema, (locator) => `fields.${locatorToField(locator)}`)) !== null && _a !== void 0 ? _a : {
|
|
4501
4667
|
type: 'object',
|
|
4502
4668
|
},
|
|
4503
|
-
credentials:
|
|
4504
|
-
},
|
|
4669
|
+
credentials: credentialsSchema,
|
|
4670
|
+
}),
|
|
4505
4671
|
};
|
|
4506
4672
|
},
|
|
4507
4673
|
getOutputSchema: ({}) => ({
|
|
@@ -4516,17 +4682,16 @@ const DataCollectionMethodCreate = {
|
|
|
4516
4682
|
const DataCollectionMethodDelete = {
|
|
4517
4683
|
name: 'Delete',
|
|
4518
4684
|
description: 'Delete a data record from the collection by id',
|
|
4519
|
-
getInputSchema: ({ collectionHandler, parameters,
|
|
4520
|
-
var _a;
|
|
4685
|
+
getInputSchema: ({ collectionHandler, parameters, credentialsSchema }) => {
|
|
4521
4686
|
return {
|
|
4522
4687
|
type: 'object',
|
|
4523
|
-
properties: {
|
|
4688
|
+
properties: nonEmptyObjectProperties({
|
|
4524
4689
|
id: {
|
|
4525
4690
|
type: 'string',
|
|
4526
4691
|
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4527
4692
|
},
|
|
4528
|
-
credentials:
|
|
4529
|
-
},
|
|
4693
|
+
credentials: credentialsSchema,
|
|
4694
|
+
}),
|
|
4530
4695
|
};
|
|
4531
4696
|
},
|
|
4532
4697
|
getOutputSchema: () => null,
|
|
@@ -4550,15 +4715,14 @@ const DataCollectionMethodFind = {
|
|
|
4550
4715
|
},
|
|
4551
4716
|
};
|
|
4552
4717
|
},
|
|
4553
|
-
getInputSchema: ({ collectionSpec, method,
|
|
4554
|
-
var _a;
|
|
4718
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
4555
4719
|
const queryFieldsSchema = pickFieldsFromSchema(collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema, method === null || method === void 0 ? void 0 : method.queryFields);
|
|
4556
4720
|
const schema = {
|
|
4557
4721
|
type: 'object',
|
|
4558
|
-
properties: {
|
|
4722
|
+
properties: nonEmptyObjectProperties({
|
|
4559
4723
|
cursor: { type: 'string' },
|
|
4560
|
-
credentials:
|
|
4561
|
-
},
|
|
4724
|
+
credentials: credentialsSchema,
|
|
4725
|
+
}),
|
|
4562
4726
|
};
|
|
4563
4727
|
if (queryFieldsSchema === null || queryFieldsSchema === void 0 ? void 0 : queryFieldsSchema.properties) {
|
|
4564
4728
|
schema.properties = {
|
|
@@ -4589,19 +4753,16 @@ const DataCollectionMethodFind = {
|
|
|
4589
4753
|
const DataCollectionMethodFindById = {
|
|
4590
4754
|
name: 'Find by ID',
|
|
4591
4755
|
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,
|
|
4756
|
+
getInputSchema: ({ collectionHandler, parameters, credentialsSchema }) => ({
|
|
4757
|
+
type: 'object',
|
|
4758
|
+
properties: nonEmptyObjectProperties({
|
|
4759
|
+
id: {
|
|
4760
|
+
type: 'string',
|
|
4761
|
+
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
4602
4762
|
},
|
|
4603
|
-
|
|
4604
|
-
|
|
4763
|
+
credentials: credentialsSchema,
|
|
4764
|
+
}),
|
|
4765
|
+
}),
|
|
4605
4766
|
getOutputSchema: ({ collectionSpec }) => {
|
|
4606
4767
|
var _a;
|
|
4607
4768
|
return ({
|
|
@@ -4630,8 +4791,7 @@ const DataCollectionMethodList = {
|
|
|
4630
4791
|
},
|
|
4631
4792
|
};
|
|
4632
4793
|
},
|
|
4633
|
-
getInputSchema: ({ method, collectionSpec,
|
|
4634
|
-
var _a;
|
|
4794
|
+
getInputSchema: ({ method, collectionSpec, credentialsSchema }) => {
|
|
4635
4795
|
const fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
4636
4796
|
let filterSchema;
|
|
4637
4797
|
if (method === null || method === void 0 ? void 0 : method.filterFields) {
|
|
@@ -4645,7 +4805,7 @@ const DataCollectionMethodList = {
|
|
|
4645
4805
|
type: 'string',
|
|
4646
4806
|
description: 'Cursor returned in response to the previous "list" request',
|
|
4647
4807
|
},
|
|
4648
|
-
credentials:
|
|
4808
|
+
credentials: credentialsSchema,
|
|
4649
4809
|
}),
|
|
4650
4810
|
};
|
|
4651
4811
|
},
|
|
@@ -4684,15 +4844,14 @@ const DataCollectionMethodMatch = {
|
|
|
4684
4844
|
},
|
|
4685
4845
|
};
|
|
4686
4846
|
},
|
|
4687
|
-
getInputSchema: ({ collectionSpec, method,
|
|
4688
|
-
var _a;
|
|
4847
|
+
getInputSchema: ({ collectionSpec, method, credentialsSchema }) => {
|
|
4689
4848
|
const fieldsSchema = pickFieldsFromSchema(collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema, method === null || method === void 0 ? void 0 : method.fields);
|
|
4690
4849
|
return {
|
|
4691
4850
|
type: 'object',
|
|
4692
|
-
properties: {
|
|
4851
|
+
properties: nonEmptyObjectProperties({
|
|
4693
4852
|
query: transformVariablesWith(fieldsSchema !== null && fieldsSchema !== void 0 ? fieldsSchema : {}, (locator) => `query.${locatorToField(locator)}`),
|
|
4694
|
-
credentials:
|
|
4695
|
-
},
|
|
4853
|
+
credentials: credentialsSchema,
|
|
4854
|
+
}),
|
|
4696
4855
|
};
|
|
4697
4856
|
},
|
|
4698
4857
|
getOutputSchema: ({ collectionSpec }) => {
|
|
@@ -4710,17 +4869,14 @@ const DataCollectionMethodMatch = {
|
|
|
4710
4869
|
const DataCollectionMethodSearch = {
|
|
4711
4870
|
name: 'Search',
|
|
4712
4871
|
description: 'Find data records in a collection by a string query',
|
|
4713
|
-
getInputSchema: ({
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
type: '
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
},
|
|
4722
|
-
});
|
|
4723
|
-
},
|
|
4872
|
+
getInputSchema: ({ credentialsSchema }) => ({
|
|
4873
|
+
type: 'object',
|
|
4874
|
+
properties: nonEmptyObjectProperties({
|
|
4875
|
+
query: { type: 'string' },
|
|
4876
|
+
cursor: { type: 'string' },
|
|
4877
|
+
credentials: credentialsSchema,
|
|
4878
|
+
}),
|
|
4879
|
+
}),
|
|
4724
4880
|
getOutputSchema: ({ collectionSpec }) => {
|
|
4725
4881
|
var _a;
|
|
4726
4882
|
return ({
|
|
@@ -4757,8 +4913,8 @@ const DataCollectionMethodUpdate = {
|
|
|
4757
4913
|
},
|
|
4758
4914
|
};
|
|
4759
4915
|
},
|
|
4760
|
-
getInputSchema: ({ collectionSpec, collectionHandler,
|
|
4761
|
-
var _a
|
|
4916
|
+
getInputSchema: ({ collectionSpec, collectionHandler, credentialsSchema, method, parameters }) => {
|
|
4917
|
+
var _a;
|
|
4762
4918
|
let fieldsSchema = collectionSpec === null || collectionSpec === void 0 ? void 0 : collectionSpec.fieldsSchema;
|
|
4763
4919
|
if (method === null || method === void 0 ? void 0 : method.fields) {
|
|
4764
4920
|
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields);
|
|
@@ -4768,7 +4924,7 @@ const DataCollectionMethodUpdate = {
|
|
|
4768
4924
|
}
|
|
4769
4925
|
return {
|
|
4770
4926
|
type: 'object',
|
|
4771
|
-
properties: {
|
|
4927
|
+
properties: nonEmptyObjectProperties({
|
|
4772
4928
|
id: {
|
|
4773
4929
|
type: 'string',
|
|
4774
4930
|
referenceCollection: { key: collectionHandler === null || collectionHandler === void 0 ? void 0 : collectionHandler.key, parameters },
|
|
@@ -4776,8 +4932,8 @@ const DataCollectionMethodUpdate = {
|
|
|
4776
4932
|
fields: (_a = transformVariablesWith(fieldsSchema, (locator) => `fields.${locatorToField(locator)}`)) !== null && _a !== void 0 ? _a : {
|
|
4777
4933
|
type: 'object',
|
|
4778
4934
|
},
|
|
4779
|
-
credentials:
|
|
4780
|
-
},
|
|
4935
|
+
credentials: credentialsSchema,
|
|
4936
|
+
}),
|
|
4781
4937
|
};
|
|
4782
4938
|
},
|
|
4783
4939
|
getOutputSchema: ({}) => ({
|
|
@@ -9343,7 +9499,6 @@ const BaseIntegration = BaseMembraneInterface.extend({
|
|
|
9343
9499
|
authType: z.z.enum(CONNECTOR_AUTH_TYPES).optional(),
|
|
9344
9500
|
});
|
|
9345
9501
|
const IntegrationEditableProperties = BaseMembraneInterfaceEditableProperties.extend({
|
|
9346
|
-
baseUri: z.z.string().optional(),
|
|
9347
9502
|
logoUri: z.z.string().optional(),
|
|
9348
9503
|
appUuid: z.z.string().optional(),
|
|
9349
9504
|
oAuthCallbackUri: z.z.url().or(z.z.literal('')).optional(),
|
|
@@ -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(),
|
|
@@ -9862,7 +10019,7 @@ const ConnectionApiResponse = BaseConnection.extend({
|
|
|
9862
10019
|
});
|
|
9863
10020
|
const ConnectionApiResponseWithSecrets = ConnectionApiResponse.extend({
|
|
9864
10021
|
credentials: z.z.unknown().optional(),
|
|
9865
|
-
|
|
10022
|
+
input: z.z.unknown().optional(),
|
|
9866
10023
|
connectorParameters: z.z.unknown().optional(),
|
|
9867
10024
|
});
|
|
9868
10025
|
const ConnectionMessagePayload = z.z.discriminatedUnion('type', [
|
|
@@ -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,13 +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
|
|
10081
|
-
|
|
10245
|
+
authOptions: z.z
|
|
10246
|
+
.array(IntegrationAuthOption)
|
|
10247
|
+
.optional()
|
|
10248
|
+
.describe('[INTERNAL] Deprecated: Use POST /connectors/:id/generate-options instead'),
|
|
10082
10249
|
});
|
|
10083
10250
|
|
|
10084
10251
|
const PackageElementApi = z.z.object({
|
|
@@ -10418,6 +10585,107 @@ function hasCycles(nodes) {
|
|
|
10418
10585
|
return hasCycles;
|
|
10419
10586
|
}
|
|
10420
10587
|
|
|
10588
|
+
function addUndefinedWriteableProperties(value, schema) {
|
|
10589
|
+
if (!(schema instanceof z.z.ZodObject)) {
|
|
10590
|
+
return value;
|
|
10591
|
+
}
|
|
10592
|
+
const allProperties = Object.keys(schema.shape);
|
|
10593
|
+
for (const key of allProperties) {
|
|
10594
|
+
if (!(key in value)) {
|
|
10595
|
+
value[key] = undefined;
|
|
10596
|
+
}
|
|
10597
|
+
}
|
|
10598
|
+
return value;
|
|
10599
|
+
}
|
|
10600
|
+
function lenientParseWithSchema(data, schema) {
|
|
10601
|
+
if (data === undefined || data === null) {
|
|
10602
|
+
return data;
|
|
10603
|
+
}
|
|
10604
|
+
const def = schema._def;
|
|
10605
|
+
if (!def) {
|
|
10606
|
+
return data;
|
|
10607
|
+
}
|
|
10608
|
+
const typeName = def.typeName || def.type;
|
|
10609
|
+
if (typeName === 'ZodOptional' || typeName === 'optional') {
|
|
10610
|
+
if (data === undefined)
|
|
10611
|
+
return undefined;
|
|
10612
|
+
return lenientParseWithSchema(data, def.innerType);
|
|
10613
|
+
}
|
|
10614
|
+
if (typeName === 'ZodNullable' || typeName === 'nullable') {
|
|
10615
|
+
if (data === null)
|
|
10616
|
+
return null;
|
|
10617
|
+
return lenientParseWithSchema(data, def.innerType);
|
|
10618
|
+
}
|
|
10619
|
+
if (typeName === 'ZodObject' || typeName === 'object') {
|
|
10620
|
+
if (typeof data !== 'object' || Array.isArray(data)) {
|
|
10621
|
+
return data;
|
|
10622
|
+
}
|
|
10623
|
+
const shape = schema.shape;
|
|
10624
|
+
const result = {};
|
|
10625
|
+
if (shape) {
|
|
10626
|
+
for (const key in shape) {
|
|
10627
|
+
if (key in data) {
|
|
10628
|
+
result[key] = lenientParseWithSchema(data[key], shape[key]);
|
|
10629
|
+
}
|
|
10630
|
+
}
|
|
10631
|
+
}
|
|
10632
|
+
const catchall = def.catchall;
|
|
10633
|
+
if (catchall) {
|
|
10634
|
+
const catchallDef = catchall._def;
|
|
10635
|
+
if ((catchallDef === null || catchallDef === void 0 ? void 0 : catchallDef.typeName) === 'ZodNever' || (catchallDef === null || catchallDef === void 0 ? void 0 : catchallDef.type) === 'never') ;
|
|
10636
|
+
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') {
|
|
10637
|
+
for (const key in data) {
|
|
10638
|
+
if (!(key in result)) {
|
|
10639
|
+
result[key] = data[key];
|
|
10640
|
+
}
|
|
10641
|
+
}
|
|
10642
|
+
}
|
|
10643
|
+
else {
|
|
10644
|
+
for (const key in data) {
|
|
10645
|
+
if (shape && !(key in shape)) {
|
|
10646
|
+
result[key] = data[key];
|
|
10647
|
+
}
|
|
10648
|
+
}
|
|
10649
|
+
}
|
|
10650
|
+
}
|
|
10651
|
+
return result;
|
|
10652
|
+
}
|
|
10653
|
+
if (typeName === 'ZodArray' || typeName === 'array') {
|
|
10654
|
+
if (!Array.isArray(data)) {
|
|
10655
|
+
return data;
|
|
10656
|
+
}
|
|
10657
|
+
const elementSchema = def.element || def.type;
|
|
10658
|
+
if (!elementSchema) {
|
|
10659
|
+
return data;
|
|
10660
|
+
}
|
|
10661
|
+
return data.map((item) => lenientParseWithSchema(item, elementSchema));
|
|
10662
|
+
}
|
|
10663
|
+
if (typeName === 'ZodRecord' || typeName === 'record') {
|
|
10664
|
+
if (typeof data !== 'object' || data === null || Array.isArray(data)) {
|
|
10665
|
+
return data;
|
|
10666
|
+
}
|
|
10667
|
+
const valueSchema = def.valueType;
|
|
10668
|
+
if (!valueSchema) {
|
|
10669
|
+
return data;
|
|
10670
|
+
}
|
|
10671
|
+
const result = {};
|
|
10672
|
+
for (const key in data) {
|
|
10673
|
+
result[key] = lenientParseWithSchema(data[key], valueSchema);
|
|
10674
|
+
}
|
|
10675
|
+
return result;
|
|
10676
|
+
}
|
|
10677
|
+
return data;
|
|
10678
|
+
}
|
|
10679
|
+
|
|
10680
|
+
function setEditablePropertiesForWorkspaceElement(currentElement, newEditableFields, exportSchema) {
|
|
10681
|
+
const parsedNewFields = lenientParseWithSchema(newEditableFields, exportSchema);
|
|
10682
|
+
const normalizedFields = addUndefinedWriteableProperties(parsedNewFields, exportSchema);
|
|
10683
|
+
return {
|
|
10684
|
+
...currentElement,
|
|
10685
|
+
...normalizedFields,
|
|
10686
|
+
};
|
|
10687
|
+
}
|
|
10688
|
+
|
|
10421
10689
|
const WorkspaceElementSpecs = {
|
|
10422
10690
|
[exports.WorkspaceElementType.Customer]: {
|
|
10423
10691
|
type: exports.WorkspaceElementType.Customer,
|
|
@@ -10444,6 +10712,7 @@ const WorkspaceElementSpecs = {
|
|
|
10444
10712
|
apiPath: 'connectors',
|
|
10445
10713
|
name: 'Connector',
|
|
10446
10714
|
namePlural: 'Connectors',
|
|
10715
|
+
exportPropertiesSchema: ConnectorExportProperties,
|
|
10447
10716
|
},
|
|
10448
10717
|
[exports.WorkspaceElementType.Connection]: {
|
|
10449
10718
|
type: exports.WorkspaceElementType.Connection,
|
|
@@ -10744,6 +11013,26 @@ async function streamToString(stream) {
|
|
|
10744
11013
|
});
|
|
10745
11014
|
});
|
|
10746
11015
|
}
|
|
11016
|
+
function isBlob(value) {
|
|
11017
|
+
var _a;
|
|
11018
|
+
if (value === null || typeof value !== 'object') {
|
|
11019
|
+
return false;
|
|
11020
|
+
}
|
|
11021
|
+
if (typeof Blob !== 'undefined' && value instanceof Blob) {
|
|
11022
|
+
return true;
|
|
11023
|
+
}
|
|
11024
|
+
const obj = value;
|
|
11025
|
+
const hasRequiredProps = typeof obj.size === 'number' && typeof obj.type === 'string' && typeof obj.slice === 'function';
|
|
11026
|
+
if (!hasRequiredProps) {
|
|
11027
|
+
return false;
|
|
11028
|
+
}
|
|
11029
|
+
const hasBlobMethod = typeof obj.stream === 'function' || typeof obj.text === 'function' || typeof obj.arrayBuffer === 'function';
|
|
11030
|
+
if (hasBlobMethod) {
|
|
11031
|
+
return true;
|
|
11032
|
+
}
|
|
11033
|
+
const constructorName = (_a = obj.constructor) === null || _a === void 0 ? void 0 : _a.name;
|
|
11034
|
+
return constructorName === 'Blob' || constructorName === 'File';
|
|
11035
|
+
}
|
|
10747
11036
|
function truncateData(data, depth = 0) {
|
|
10748
11037
|
const maxArrayItems = 500;
|
|
10749
11038
|
const maxObjectKeys = 500;
|
|
@@ -10767,6 +11056,9 @@ function truncateData(data, depth = 0) {
|
|
|
10767
11056
|
else if (Buffer.isBuffer(data)) {
|
|
10768
11057
|
return data.toString('utf-8').slice(0, maxStringLength);
|
|
10769
11058
|
}
|
|
11059
|
+
else if (isBlob(data)) {
|
|
11060
|
+
return `<Blob: size=${data.size}, type=${data.type}>`;
|
|
11061
|
+
}
|
|
10770
11062
|
else if (typeof data === 'object') {
|
|
10771
11063
|
const keys = Object.keys(data);
|
|
10772
11064
|
const result = {};
|
|
@@ -11000,6 +11292,7 @@ exports.UsageType = void 0;
|
|
|
11000
11292
|
UsageType["EXTERNAL_EVENTS_PULL_DURATION"] = "external-events-pull-duration";
|
|
11001
11293
|
UsageType["EXTERNAL_EVENT_PULL_NUMBER"] = "external-event-pull-number";
|
|
11002
11294
|
UsageType["EXTERNAL_EVENT_PULL_LOG_SIZE"] = "external-event-pull-log-size";
|
|
11295
|
+
UsageType["EXTERNAL_EVENT_WEBHOOK_REFRESH_DURATION"] = "external-event-webhook-refresh-duration";
|
|
11003
11296
|
UsageType["APP_EVENTS_NUMBER"] = "app-events-number";
|
|
11004
11297
|
UsageType["APP_EVENTS_SIZE"] = "app-events-size";
|
|
11005
11298
|
UsageType["FILES_UPLOAD_NUMBER"] = "files-upload-number";
|
|
@@ -11114,6 +11407,144 @@ function getFlowRunVariableSchema() {
|
|
|
11114
11407
|
};
|
|
11115
11408
|
}
|
|
11116
11409
|
|
|
11410
|
+
exports.AlertStatus = void 0;
|
|
11411
|
+
(function (AlertStatus) {
|
|
11412
|
+
AlertStatus["ONGOING"] = "ongoing";
|
|
11413
|
+
AlertStatus["RESOLVED"] = "resolved";
|
|
11414
|
+
})(exports.AlertStatus || (exports.AlertStatus = {}));
|
|
11415
|
+
exports.AlertSeverity = void 0;
|
|
11416
|
+
(function (AlertSeverity) {
|
|
11417
|
+
AlertSeverity["CRITICAL"] = "critical";
|
|
11418
|
+
AlertSeverity["WARNING"] = "warning";
|
|
11419
|
+
})(exports.AlertSeverity || (exports.AlertSeverity = {}));
|
|
11420
|
+
exports.AlertType = void 0;
|
|
11421
|
+
(function (AlertType) {
|
|
11422
|
+
AlertType["fileUploadsMbPerHour"] = "fileUploadsMbPerHour";
|
|
11423
|
+
AlertType["apiRequestsPerSecond"] = "apiRequestsPerSecond";
|
|
11424
|
+
AlertType["apiRequestsPerHour"] = "apiRequestsPerHour";
|
|
11425
|
+
AlertType["webhookRequestsPerSecond"] = "webhookRequestsPerSecond";
|
|
11426
|
+
AlertType["webhookRequestsPerHour"] = "webhookRequestsPerHour";
|
|
11427
|
+
AlertType["workspaceElementCreationsPerSecond"] = "workspaceElementCreationsPerSecond";
|
|
11428
|
+
AlertType["workspaceElementCreationsPerHour"] = "workspaceElementCreationsPerHour";
|
|
11429
|
+
AlertType["externalEventsPerCustomerPerDay"] = "externalEventsPerCustomerPerDay";
|
|
11430
|
+
AlertType["totalUsagePerDay"] = "totalUsagePerDay";
|
|
11431
|
+
AlertType["totalUsagePer30Days"] = "totalUsagePer30Days";
|
|
11432
|
+
AlertType["testAlert"] = "testAlert";
|
|
11433
|
+
})(exports.AlertType || (exports.AlertType = {}));
|
|
11434
|
+
exports.AlertCategory = void 0;
|
|
11435
|
+
(function (AlertCategory) {
|
|
11436
|
+
AlertCategory["RATE_LIMIT"] = "rateLimit";
|
|
11437
|
+
AlertCategory["USAGE"] = "usage";
|
|
11438
|
+
AlertCategory["TEST"] = "test";
|
|
11439
|
+
})(exports.AlertCategory || (exports.AlertCategory = {}));
|
|
11440
|
+
const ALERT_TYPE_CATEGORIES = {
|
|
11441
|
+
[exports.AlertType.fileUploadsMbPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11442
|
+
[exports.AlertType.apiRequestsPerSecond]: exports.AlertCategory.RATE_LIMIT,
|
|
11443
|
+
[exports.AlertType.apiRequestsPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11444
|
+
[exports.AlertType.webhookRequestsPerSecond]: exports.AlertCategory.RATE_LIMIT,
|
|
11445
|
+
[exports.AlertType.webhookRequestsPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11446
|
+
[exports.AlertType.workspaceElementCreationsPerSecond]: exports.AlertCategory.RATE_LIMIT,
|
|
11447
|
+
[exports.AlertType.workspaceElementCreationsPerHour]: exports.AlertCategory.RATE_LIMIT,
|
|
11448
|
+
[exports.AlertType.externalEventsPerCustomerPerDay]: exports.AlertCategory.RATE_LIMIT,
|
|
11449
|
+
[exports.AlertType.totalUsagePerDay]: exports.AlertCategory.USAGE,
|
|
11450
|
+
[exports.AlertType.totalUsagePer30Days]: exports.AlertCategory.USAGE,
|
|
11451
|
+
[exports.AlertType.testAlert]: exports.AlertCategory.TEST,
|
|
11452
|
+
};
|
|
11453
|
+
const AlertSchema = z.z.object({
|
|
11454
|
+
id: z.z.string(),
|
|
11455
|
+
description: z.z.string(),
|
|
11456
|
+
status: z.z.enum(Object.values(exports.AlertStatus)),
|
|
11457
|
+
type: z.z.enum(Object.values(exports.AlertType)),
|
|
11458
|
+
workspaceId: z.z.string(),
|
|
11459
|
+
createdAt: z.z.date(),
|
|
11460
|
+
updatedAt: z.z.date(),
|
|
11461
|
+
lastSeenAt: z.z.date(),
|
|
11462
|
+
resolvedAt: z.z.date().optional(),
|
|
11463
|
+
customerId: z.z.string().optional(),
|
|
11464
|
+
severity: z.z.enum(Object.values(exports.AlertSeverity)),
|
|
11465
|
+
});
|
|
11466
|
+
const ALERT_DELIVERY_METHODS = ['internal', 'webhook', 'email'];
|
|
11467
|
+
const AlertTypeDeliverySettingsSchema = z.z.object({
|
|
11468
|
+
internal: z.z.literal(true),
|
|
11469
|
+
webhook: z.z
|
|
11470
|
+
.object({
|
|
11471
|
+
enabled: z.z.boolean(),
|
|
11472
|
+
})
|
|
11473
|
+
.optional(),
|
|
11474
|
+
email: z.z
|
|
11475
|
+
.object({
|
|
11476
|
+
enabled: z.z.boolean(),
|
|
11477
|
+
})
|
|
11478
|
+
.optional(),
|
|
11479
|
+
});
|
|
11480
|
+
const DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS = {
|
|
11481
|
+
internal: true,
|
|
11482
|
+
webhook: {
|
|
11483
|
+
enabled: false,
|
|
11484
|
+
},
|
|
11485
|
+
email: {
|
|
11486
|
+
enabled: false,
|
|
11487
|
+
},
|
|
11488
|
+
};
|
|
11489
|
+
const AlertDeliverySettingsSchema = z.z.object({
|
|
11490
|
+
alertTypes: z.z.record(z.z.enum(Object.values(exports.AlertType)), AlertTypeDeliverySettingsSchema.optional()).optional(),
|
|
11491
|
+
});
|
|
11492
|
+
const DEFAULT_ALERT_DELIVERY_SETTINGS = {
|
|
11493
|
+
alertTypes: undefined,
|
|
11494
|
+
};
|
|
11495
|
+
|
|
11496
|
+
function isValidAlertType(value) {
|
|
11497
|
+
return Object.values(exports.AlertType).includes(value);
|
|
11498
|
+
}
|
|
11499
|
+
function getAlertTypeDisplayName(alertType) {
|
|
11500
|
+
const names = {
|
|
11501
|
+
[exports.AlertType.fileUploadsMbPerHour]: 'File Uploads MB Per Hour',
|
|
11502
|
+
[exports.AlertType.apiRequestsPerSecond]: 'API Requests Per Second',
|
|
11503
|
+
[exports.AlertType.apiRequestsPerHour]: 'API Requests Per Hour',
|
|
11504
|
+
[exports.AlertType.webhookRequestsPerSecond]: 'Webhook Requests Per Second',
|
|
11505
|
+
[exports.AlertType.webhookRequestsPerHour]: 'Webhook Requests Per Hour',
|
|
11506
|
+
[exports.AlertType.workspaceElementCreationsPerSecond]: 'Workspace Element Creations Per Second',
|
|
11507
|
+
[exports.AlertType.workspaceElementCreationsPerHour]: 'Workspace Element Creations Per Hour',
|
|
11508
|
+
[exports.AlertType.externalEventsPerCustomerPerDay]: 'External Events Per Customer Per Day',
|
|
11509
|
+
[exports.AlertType.totalUsagePerDay]: 'Total Usage Per Day',
|
|
11510
|
+
[exports.AlertType.totalUsagePer30Days]: 'Total Usage Per 30 Days',
|
|
11511
|
+
[exports.AlertType.testAlert]: 'Test Alert',
|
|
11512
|
+
};
|
|
11513
|
+
return names[alertType] || alertType;
|
|
11514
|
+
}
|
|
11515
|
+
function getAlertDeliveryMethodLabel(method) {
|
|
11516
|
+
const labels = {
|
|
11517
|
+
internal: 'Internal Delivery',
|
|
11518
|
+
webhook: 'Webhook Delivery',
|
|
11519
|
+
email: 'Email Delivery',
|
|
11520
|
+
};
|
|
11521
|
+
return labels[method] || method;
|
|
11522
|
+
}
|
|
11523
|
+
function isDeliveryMethodEnabled(settings, method) {
|
|
11524
|
+
var _a;
|
|
11525
|
+
if (method === 'internal') {
|
|
11526
|
+
return true;
|
|
11527
|
+
}
|
|
11528
|
+
if (((_a = settings[method]) !== null && _a !== void 0 ? _a : DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS[method]).enabled) {
|
|
11529
|
+
return true;
|
|
11530
|
+
}
|
|
11531
|
+
return false;
|
|
11532
|
+
}
|
|
11533
|
+
function getAlertCategoryDisplayName(category) {
|
|
11534
|
+
const names = {
|
|
11535
|
+
[exports.AlertCategory.RATE_LIMIT]: 'Rate Limit Alerts',
|
|
11536
|
+
[exports.AlertCategory.USAGE]: 'Usage Alerts',
|
|
11537
|
+
[exports.AlertCategory.TEST]: 'Test',
|
|
11538
|
+
};
|
|
11539
|
+
return names[category] || category;
|
|
11540
|
+
}
|
|
11541
|
+
function getAlertTypesByCategory(category) {
|
|
11542
|
+
return Object.entries(ALERT_TYPE_CATEGORIES)
|
|
11543
|
+
.filter(([, alertCategory]) => alertCategory === category)
|
|
11544
|
+
.map(([alertType]) => alertType)
|
|
11545
|
+
.filter(isValidAlertType);
|
|
11546
|
+
}
|
|
11547
|
+
|
|
11117
11548
|
exports.WorkspaceType = void 0;
|
|
11118
11549
|
(function (WorkspaceType) {
|
|
11119
11550
|
WorkspaceType["PRODUCTION"] = "production";
|
|
@@ -11168,6 +11599,7 @@ const WorkspaceLimitsSchema = z.object({
|
|
|
11168
11599
|
totalNumberOfConnections: WorkspaceLimit.optional(),
|
|
11169
11600
|
totalNumberOfWorkspaceElements: WorkspaceLimit.optional(),
|
|
11170
11601
|
instantTasksQueueSize: WorkspaceLimit.optional(),
|
|
11602
|
+
QueuedTasksQueueSize: WorkspaceLimit.optional(),
|
|
11171
11603
|
parallelApiRequestsPerCustomer: WorkspaceLimit.optional(),
|
|
11172
11604
|
parallelBackgroundJobsPerCustomer: WorkspaceLimit.optional(),
|
|
11173
11605
|
apiRequestsPerCustomerPerSecond: WorkspaceLimit.optional(),
|
|
@@ -11184,6 +11616,7 @@ const EngineWorkspaceSettingsSchema = z.object({
|
|
|
11184
11616
|
enableWebhookLogs: z.boolean().optional(),
|
|
11185
11617
|
enableActionRunLogs: z.boolean().optional(),
|
|
11186
11618
|
disableSecretKeyAuth: z.boolean().optional(),
|
|
11619
|
+
useMembraneUniverse: z.boolean().optional(),
|
|
11187
11620
|
});
|
|
11188
11621
|
const WorkspacePublicKey = z.object({
|
|
11189
11622
|
name: z.string(),
|
|
@@ -11210,6 +11643,7 @@ const AppSchema = z.object({
|
|
|
11210
11643
|
featureFlags: z.array(z.string()).optional(),
|
|
11211
11644
|
limits: WorkspaceLimitsSchema.optional(),
|
|
11212
11645
|
settings: EngineWorkspaceSettingsSchema.optional(),
|
|
11646
|
+
alertDeliverySettings: AlertDeliverySettingsSchema.optional(),
|
|
11213
11647
|
type: z.nativeEnum(exports.WorkspaceType).optional(),
|
|
11214
11648
|
jwksUri: z.string().nullable().optional(),
|
|
11215
11649
|
isTrial: z.boolean().optional(),
|
|
@@ -11387,13 +11821,14 @@ function buildIntegrationsMap(integrations) {
|
|
|
11387
11821
|
return map;
|
|
11388
11822
|
}
|
|
11389
11823
|
|
|
11824
|
+
const IneligibilityReasonSchema = z.z.enum(['disposable', 'blockedDomain', 'notCompanyEmail']);
|
|
11390
11825
|
const PlatformUserSchema = z.z.object({
|
|
11391
11826
|
id: z.z.string(),
|
|
11392
11827
|
email: z.z.string(),
|
|
11393
11828
|
name: z.z.string(),
|
|
11394
11829
|
trialRequested: z.z.boolean(),
|
|
11395
|
-
introVideoStatus: z.z.string().optional(),
|
|
11396
11830
|
isEligible: z.z.boolean().optional(),
|
|
11831
|
+
ineligibilityReason: IneligibilityReasonSchema.optional(),
|
|
11397
11832
|
emailVerified: z.z.boolean().optional(),
|
|
11398
11833
|
});
|
|
11399
11834
|
const FullPlatformUser = z.z.object({
|
|
@@ -11406,8 +11841,8 @@ const FullPlatformUser = z.z.object({
|
|
|
11406
11841
|
isAdmin: z.z.boolean().optional(),
|
|
11407
11842
|
trialRequested: z.z.boolean(),
|
|
11408
11843
|
pat: z.z.string().optional(),
|
|
11409
|
-
introVideoStatus: z.z.string().optional(),
|
|
11410
11844
|
isEligible: z.z.boolean().optional(),
|
|
11845
|
+
ineligibilityReason: IneligibilityReasonSchema.optional(),
|
|
11411
11846
|
emailVerified: z.z.boolean().optional(),
|
|
11412
11847
|
});
|
|
11413
11848
|
|
|
@@ -11418,6 +11853,12 @@ exports.OrgLimitsType = void 0;
|
|
|
11418
11853
|
OrgLimitsType["LAST_THIRTY_DAY_USAGE"] = "lastThirtyDayUsage";
|
|
11419
11854
|
OrgLimitsType["MEMBRANE_EXPERT_CREDITS_CAP"] = "membraneExpertCreditsCapPerMonth";
|
|
11420
11855
|
})(exports.OrgLimitsType || (exports.OrgLimitsType = {}));
|
|
11856
|
+
exports.OrgPlan = void 0;
|
|
11857
|
+
(function (OrgPlan) {
|
|
11858
|
+
OrgPlan["Core"] = "core";
|
|
11859
|
+
OrgPlan["Pro"] = "pro";
|
|
11860
|
+
OrgPlan["Ultimate"] = "ultimate";
|
|
11861
|
+
})(exports.OrgPlan || (exports.OrgPlan = {}));
|
|
11421
11862
|
exports.OrgUserRole = void 0;
|
|
11422
11863
|
(function (OrgUserRole) {
|
|
11423
11864
|
OrgUserRole["Admin"] = "admin";
|
|
@@ -11443,10 +11884,12 @@ const MembraneAgentKey = z.z
|
|
|
11443
11884
|
expiresAt: z.z.string().optional(),
|
|
11444
11885
|
})
|
|
11445
11886
|
.optional();
|
|
11887
|
+
const OrgFeatureFlagsSchema = z.z.record(z.z.string(), z.z.boolean());
|
|
11446
11888
|
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(),
|
|
@@ -11465,6 +11908,14 @@ const OrgSchema = z.z.object({
|
|
|
11465
11908
|
autoChargeThreshold: z.z.number().optional(),
|
|
11466
11909
|
autoChargePurchaseAmount: z.z.number().optional(),
|
|
11467
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(),
|
|
11918
|
+
effectiveFeatureFlags: OrgFeatureFlagsSchema.optional(),
|
|
11468
11919
|
});
|
|
11469
11920
|
const AccountResponse = z.z.object({
|
|
11470
11921
|
user: FullPlatformUser.optional(),
|
|
@@ -11492,27 +11943,10 @@ exports.WebhookTypeEnum = void 0;
|
|
|
11492
11943
|
WebhookTypeEnum["TASK_UPDATED"] = "task-updated";
|
|
11493
11944
|
WebhookTypeEnum["TASK_ACTIVITY_CREATED"] = "task-activity-created";
|
|
11494
11945
|
WebhookTypeEnum["CONNECTOR_VERSION_PUBLISHED"] = "connector-version-published";
|
|
11946
|
+
WebhookTypeEnum["AGENT_SESSION_FINISHED"] = "agent-session-finished";
|
|
11947
|
+
WebhookTypeEnum["SEND_ALERT_EMAIL"] = "send-alert-email";
|
|
11495
11948
|
})(exports.WebhookTypeEnum || (exports.WebhookTypeEnum = {}));
|
|
11496
11949
|
|
|
11497
|
-
exports.AlertStatus = void 0;
|
|
11498
|
-
(function (AlertStatus) {
|
|
11499
|
-
AlertStatus["ONGOING"] = "ongoing";
|
|
11500
|
-
AlertStatus["RESOLVED"] = "resolved";
|
|
11501
|
-
})(exports.AlertStatus || (exports.AlertStatus = {}));
|
|
11502
|
-
exports.AlertSeverity = void 0;
|
|
11503
|
-
(function (AlertSeverity) {
|
|
11504
|
-
AlertSeverity["CRITICAL"] = "critical";
|
|
11505
|
-
AlertSeverity["WARNING"] = "warning";
|
|
11506
|
-
})(exports.AlertSeverity || (exports.AlertSeverity = {}));
|
|
11507
|
-
exports.AlertType = void 0;
|
|
11508
|
-
(function (AlertType) {
|
|
11509
|
-
AlertType["externalEventsPerCustomerPerDay"] = "externalEventsPerCustomerPerDay";
|
|
11510
|
-
AlertType["totalUsagePerDay"] = "totalUsagePerDay";
|
|
11511
|
-
AlertType["totalUsagePer30Days"] = "totalUsagePer30Days";
|
|
11512
|
-
AlertType["membraneAgentUsagePer30Days"] = "membraneAgentUsagePer30Days";
|
|
11513
|
-
AlertType["testAlert"] = "testAlert";
|
|
11514
|
-
})(exports.AlertType || (exports.AlertType = {}));
|
|
11515
|
-
|
|
11516
11950
|
const IntegrationSpecificElementSelector = z.object({
|
|
11517
11951
|
id: z.string().optional(),
|
|
11518
11952
|
key: z.string().optional(),
|
|
@@ -12499,17 +12933,18 @@ class ConnectionAccessor {
|
|
|
12499
12933
|
dataCollection(key, parameters) {
|
|
12500
12934
|
return new ConnectionDataCollectionAccessor(this.client, this, key, parameters);
|
|
12501
12935
|
}
|
|
12502
|
-
async reconnect({ parameters, authOptionKey, connectorParameters, } = {}) {
|
|
12936
|
+
async reconnect({ parameters, authOptionKey, connectorParameters, onPopupClosed, } = {}) {
|
|
12503
12937
|
const connection = await this.get();
|
|
12504
12938
|
const connectorSpec = await this.client.get(`/integrations/${connection.integrationId}/connector-spec`);
|
|
12505
12939
|
return createOrUpdateConnection({
|
|
12506
12940
|
connectionId: connection.id,
|
|
12507
12941
|
connectorSpec,
|
|
12508
|
-
parameters,
|
|
12942
|
+
input: parameters,
|
|
12509
12943
|
authOptionKey,
|
|
12510
12944
|
connectorParameters,
|
|
12511
12945
|
apiUri: this.client.apiUri,
|
|
12512
12946
|
token: await this.client.getToken(),
|
|
12947
|
+
onPopupClosed,
|
|
12513
12948
|
});
|
|
12514
12949
|
}
|
|
12515
12950
|
async openReconnectUI({} = {}) {
|
|
@@ -12598,21 +13033,31 @@ class ConnectionProxy {
|
|
|
12598
13033
|
}
|
|
12599
13034
|
}
|
|
12600
13035
|
async function createOrUpdateConnection(options) {
|
|
12601
|
-
const { connectionId, integrationId, name,
|
|
13036
|
+
const { connectionId, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
|
|
12602
13037
|
const connectionType = getConnectionType({
|
|
12603
13038
|
connectorSpec,
|
|
12604
13039
|
authOptionKey,
|
|
12605
13040
|
redirectUri,
|
|
12606
13041
|
});
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
13042
|
+
let popupPath;
|
|
13043
|
+
if (connectionId) {
|
|
13044
|
+
popupPath = `connection-popup?connectionId=${connectionId}`;
|
|
13045
|
+
}
|
|
13046
|
+
else if (connectorId) {
|
|
13047
|
+
const versionParam = connectorVersion ? `&connectorVersion=${connectorVersion}` : '';
|
|
13048
|
+
popupPath = `connection-popup?connectorId=${connectorId}${versionParam}`;
|
|
13049
|
+
}
|
|
13050
|
+
else {
|
|
13051
|
+
popupPath = `connection-popup?integrationId=${integrationId}`;
|
|
13052
|
+
}
|
|
12610
13053
|
return new Promise((resolve, reject) => {
|
|
12611
13054
|
const requestId = simpleUniqueId() + simpleUniqueId();
|
|
12612
13055
|
const payload = {
|
|
12613
13056
|
token,
|
|
12614
|
-
|
|
13057
|
+
input,
|
|
12615
13058
|
connectorParameters,
|
|
13059
|
+
connectorId,
|
|
13060
|
+
connectorVersion,
|
|
12616
13061
|
name,
|
|
12617
13062
|
authOptionKey,
|
|
12618
13063
|
allowMultipleConnections,
|
|
@@ -12658,10 +13103,10 @@ async function createOrUpdateConnection(options) {
|
|
|
12658
13103
|
iframeElement.id = targetElementId;
|
|
12659
13104
|
iframeElement.name = targetElementId;
|
|
12660
13105
|
iframeElement.style.position = 'absolute';
|
|
12661
|
-
iframeElement.style.top = '-
|
|
12662
|
-
iframeElement.style.left = '-
|
|
12663
|
-
iframeElement.style.width = '
|
|
12664
|
-
iframeElement.style.height = '
|
|
13106
|
+
iframeElement.style.top = '-100px';
|
|
13107
|
+
iframeElement.style.left = '-100px';
|
|
13108
|
+
iframeElement.style.width = '1px';
|
|
13109
|
+
iframeElement.style.height = '1px';
|
|
12665
13110
|
iframeElement.style.border = 'none';
|
|
12666
13111
|
iframeElement.style.backgroundColor = 'transparent';
|
|
12667
13112
|
document.body.appendChild(iframeElement);
|
|
@@ -12695,6 +13140,7 @@ async function createOrUpdateConnection(options) {
|
|
|
12695
13140
|
cancelCheckInterval = setInterval(() => {
|
|
12696
13141
|
if (popup === null || popup === void 0 ? void 0 : popup.closed) {
|
|
12697
13142
|
cleanup();
|
|
13143
|
+
onPopupClosed === null || onPopupClosed === void 0 ? void 0 : onPopupClosed();
|
|
12698
13144
|
resolve(null);
|
|
12699
13145
|
}
|
|
12700
13146
|
}, 1000);
|
|
@@ -12726,6 +13172,9 @@ const createConnectionEventHandler = (requestId, onResolve, onReject, onFinally)
|
|
|
12726
13172
|
}
|
|
12727
13173
|
if (message.type == 'newConnectionFailure') {
|
|
12728
13174
|
const error = new MembraneError((_a = message.errorData) !== null && _a !== void 0 ? _a : message.error);
|
|
13175
|
+
if (message.connectionId) {
|
|
13176
|
+
error.data.data = { ...error.data.data, connectionId: message.connectionId };
|
|
13177
|
+
}
|
|
12729
13178
|
onReject(error);
|
|
12730
13179
|
}
|
|
12731
13180
|
onFinally();
|
|
@@ -12905,23 +13354,24 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
12905
13354
|
});
|
|
12906
13355
|
});
|
|
12907
13356
|
}
|
|
12908
|
-
async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
|
|
13357
|
+
async connect({ name, input, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, } = {}) {
|
|
12909
13358
|
const integration = await this.get();
|
|
12910
13359
|
const connectorSpec = await this.getConnectorSpec();
|
|
12911
13360
|
return createOrUpdateConnection({
|
|
12912
13361
|
integrationId: integration.id,
|
|
12913
13362
|
connectorSpec,
|
|
12914
13363
|
name,
|
|
12915
|
-
parameters,
|
|
13364
|
+
input: input !== null && input !== void 0 ? input : parameters,
|
|
12916
13365
|
connectorParameters,
|
|
12917
13366
|
authOptionKey,
|
|
12918
13367
|
allowMultipleConnections,
|
|
12919
13368
|
apiUri: this.client.apiUri,
|
|
12920
13369
|
token: await this.client.getToken(),
|
|
12921
13370
|
redirectUri: sameWindow ? redirectUri : undefined,
|
|
13371
|
+
onPopupClosed,
|
|
12922
13372
|
});
|
|
12923
13373
|
}
|
|
12924
|
-
async createConnection({ parameters, name }) {
|
|
13374
|
+
async createConnection({ parameters, name, }) {
|
|
12925
13375
|
return this.connect({ parameters, name });
|
|
12926
13376
|
}
|
|
12927
13377
|
async getOperations() {
|
|
@@ -13241,8 +13691,14 @@ exports.AgentSessionState = void 0;
|
|
|
13241
13691
|
AgentSessionState["BUSY"] = "busy";
|
|
13242
13692
|
AgentSessionState["IDLE"] = "idle";
|
|
13243
13693
|
})(exports.AgentSessionState || (exports.AgentSessionState = {}));
|
|
13694
|
+
exports.AgentName = void 0;
|
|
13695
|
+
(function (AgentName) {
|
|
13696
|
+
AgentName["MEMBRANE"] = "membrane";
|
|
13697
|
+
AgentName["SELF_INTEGRATING"] = "self-integrating";
|
|
13698
|
+
})(exports.AgentName || (exports.AgentName = {}));
|
|
13244
13699
|
const AgentSession = z.z.object({
|
|
13245
13700
|
id: z.z.string(),
|
|
13701
|
+
workspaceId: z.z.string(),
|
|
13246
13702
|
userId: z.z.string().optional(),
|
|
13247
13703
|
workspaceElementType: z.z.enum(exports.WorkspaceElementType),
|
|
13248
13704
|
workspaceElementId: z.z.string(),
|
|
@@ -13257,6 +13713,8 @@ const AgentSession = z.z.object({
|
|
|
13257
13713
|
state: z.z.enum(exports.AgentSessionState).default(exports.AgentSessionState.BUSY),
|
|
13258
13714
|
usage: z.z.number().optional(),
|
|
13259
13715
|
hasWorker: z.z.boolean(),
|
|
13716
|
+
isExternal: z.z.boolean().optional(),
|
|
13717
|
+
agentName: z.z.enum(exports.AgentName).optional(),
|
|
13260
13718
|
createdAt: z.z.iso.datetime(),
|
|
13261
13719
|
updatedAt: z.z.iso.datetime(),
|
|
13262
13720
|
});
|
|
@@ -13266,6 +13724,7 @@ const CreateAgentSession = z.z.object({
|
|
|
13266
13724
|
prompt: z.z.string().min(1),
|
|
13267
13725
|
testCustomerId: z.z.string().optional(),
|
|
13268
13726
|
isExternal: z.z.boolean().optional(),
|
|
13727
|
+
modelId: z.z.string().optional(),
|
|
13269
13728
|
});
|
|
13270
13729
|
const AgentSessionInputSchema = z.z.object({
|
|
13271
13730
|
input: z.z.string().min(1),
|
|
@@ -13277,6 +13736,8 @@ const PatchAgentSessionSchema = z.z.object({
|
|
|
13277
13736
|
title: z.z.string().optional(),
|
|
13278
13737
|
summary: z.z.string().optional(),
|
|
13279
13738
|
cost: z.z.number().optional(),
|
|
13739
|
+
error: ErrorDataSchema.optional(),
|
|
13740
|
+
opencodeSessionUuid: z.z.string().optional(),
|
|
13280
13741
|
status: z.z.enum(exports.AgentSessionStatus).optional(),
|
|
13281
13742
|
});
|
|
13282
13743
|
|
|
@@ -13590,6 +14051,8 @@ class MembraneClient extends MembraneApiClient {
|
|
|
13590
14051
|
injectFormulaCatalog(getFormula, isFormula, hasFormulas);
|
|
13591
14052
|
|
|
13592
14053
|
exports.ACTIONS = ACTIONS;
|
|
14054
|
+
exports.ALERT_DELIVERY_METHODS = ALERT_DELIVERY_METHODS;
|
|
14055
|
+
exports.ALERT_TYPE_CATEGORIES = ALERT_TYPE_CATEGORIES;
|
|
13593
14056
|
exports.AccessDeniedError = AccessDeniedError;
|
|
13594
14057
|
exports.AccountResponse = AccountResponse;
|
|
13595
14058
|
exports.ActionAccessor = ActionAccessor;
|
|
@@ -13607,6 +14070,9 @@ exports.ActionRunResponse = ActionRunResponse;
|
|
|
13607
14070
|
exports.ActionsAccessor = ActionsAccessor;
|
|
13608
14071
|
exports.AgentSession = AgentSession;
|
|
13609
14072
|
exports.AgentSessionInputSchema = AgentSessionInputSchema;
|
|
14073
|
+
exports.AlertDeliverySettingsSchema = AlertDeliverySettingsSchema;
|
|
14074
|
+
exports.AlertSchema = AlertSchema;
|
|
14075
|
+
exports.AlertTypeDeliverySettingsSchema = AlertTypeDeliverySettingsSchema;
|
|
13610
14076
|
exports.ApiRequestSpec = ApiRequestSpec;
|
|
13611
14077
|
exports.AppDataSchemaAccessor = AppDataSchemaAccessor;
|
|
13612
14078
|
exports.AppDataSchemaApiResponse = AppDataSchemaApiResponse;
|
|
@@ -13717,6 +14183,8 @@ exports.ConnectorDataCollectionEventImplementationType = ConnectorDataCollection
|
|
|
13717
14183
|
exports.ConnectorDataCollectionMethodKeys = ConnectorDataCollectionMethodKeys;
|
|
13718
14184
|
exports.ConnectorDataLocationTypes = ConnectorDataLocationTypes;
|
|
13719
14185
|
exports.ConnectorEventHandlerMethods = ConnectorEventHandlerMethods;
|
|
14186
|
+
exports.ConnectorExportProperties = ConnectorExportProperties;
|
|
14187
|
+
exports.ConnectorFunctionSpecs = ConnectorFunctionSpecs;
|
|
13720
14188
|
exports.ConnectorMethodImplementation = ConnectorMethodImplementation;
|
|
13721
14189
|
exports.ConnectorMethodImplementationBase = ConnectorMethodImplementationBase;
|
|
13722
14190
|
exports.ConnectorMethodImplementationGraphqlApiMapping = ConnectorMethodImplementationGraphqlApiMapping;
|
|
@@ -13757,6 +14225,8 @@ exports.CustomerApiResponse = CustomerApiResponse;
|
|
|
13757
14225
|
exports.CustomerSelector = CustomerSelector;
|
|
13758
14226
|
exports.CustomersAccessor = CustomersAccessor;
|
|
13759
14227
|
exports.DATA_RECORD_SCHEMA = DATA_RECORD_SCHEMA;
|
|
14228
|
+
exports.DEFAULT_ALERT_DELIVERY_SETTINGS = DEFAULT_ALERT_DELIVERY_SETTINGS;
|
|
14229
|
+
exports.DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS = DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS;
|
|
13760
14230
|
exports.DEFAULT_FULL_SYNC_INTERVAL_SECONDS = DEFAULT_FULL_SYNC_INTERVAL_SECONDS;
|
|
13761
14231
|
exports.DEFAULT_PULL_UPDATES_INTERVAL_SECONDS = DEFAULT_PULL_UPDATES_INTERVAL_SECONDS;
|
|
13762
14232
|
exports.DataCollectionCreateRequest = DataCollectionCreateRequest;
|
|
@@ -13911,6 +14381,8 @@ exports.FlowsAccessor = FlowsAccessor;
|
|
|
13911
14381
|
exports.Formula = Formula;
|
|
13912
14382
|
exports.FullPlatformUser = FullPlatformUser;
|
|
13913
14383
|
exports.FunctionDefinition = FunctionDefinition;
|
|
14384
|
+
exports.GenerateOptionsRequest = GenerateOptionsRequest;
|
|
14385
|
+
exports.GeneratedConnectorOption = GeneratedConnectorOption;
|
|
13914
14386
|
exports.GenericFunctionDefinition = GenericFunctionDefinition;
|
|
13915
14387
|
exports.GraphQLApiMappingSchema = GraphQLApiMappingSchema;
|
|
13916
14388
|
exports.GraphQLFieldMappingSchema = GraphQLFieldMappingSchema;
|
|
@@ -13959,6 +14431,7 @@ exports.MappingSchema = MappingSchema;
|
|
|
13959
14431
|
exports.MembraneAgentKey = MembraneAgentKey;
|
|
13960
14432
|
exports.MembraneAxiosInstance = axios;
|
|
13961
14433
|
exports.MembraneClient = MembraneClient;
|
|
14434
|
+
exports.MembraneElementLayer = MembraneElementLayer;
|
|
13962
14435
|
exports.MembraneError = MembraneError;
|
|
13963
14436
|
exports.MinimalConnector = MinimalConnector;
|
|
13964
14437
|
exports.NotAuthenticatedError = NotAuthenticatedError;
|
|
@@ -13968,6 +14441,7 @@ exports.OAUTH_CONFIG_SCHEMA = OAUTH_CONFIG_SCHEMA;
|
|
|
13968
14441
|
exports.OpenapiMappingSchema = OpenapiMappingSchema;
|
|
13969
14442
|
exports.OperationMappingFunction = OperationMappingFunction;
|
|
13970
14443
|
exports.OperationMappingSchema = OperationMappingSchema;
|
|
14444
|
+
exports.OrgFeatureFlagsSchema = OrgFeatureFlagsSchema;
|
|
13971
14445
|
exports.OrgLimits = OrgLimits;
|
|
13972
14446
|
exports.OrgSchema = OrgSchema;
|
|
13973
14447
|
exports.OrgWorkspaceSchema = OrgWorkspaceSchema;
|
|
@@ -14034,9 +14508,11 @@ exports.WorkspacePublicKey = WorkspacePublicKey;
|
|
|
14034
14508
|
exports.WritableConnectorVersionData = WritableConnectorVersionData;
|
|
14035
14509
|
exports.WritablePackageVersionData = WritablePackageVersionData;
|
|
14036
14510
|
exports.WriteableConnectorFields = WriteableConnectorFields;
|
|
14511
|
+
exports.WriteableConnectorOption = WriteableConnectorOption;
|
|
14037
14512
|
exports.__resolveValue = __resolveValue;
|
|
14038
14513
|
exports.addRequiredFieldsToSchema = addRequiredFieldsToSchema;
|
|
14039
14514
|
exports.addUdmFallbackFields = addUdmFallbackFields;
|
|
14515
|
+
exports.addUndefinedWriteableProperties = addUndefinedWriteableProperties;
|
|
14040
14516
|
exports.backwardCompatibleFilterMatch = backwardCompatibleFilterMatch;
|
|
14041
14517
|
exports.buildData = buildData;
|
|
14042
14518
|
exports.buildDataSchema = buildDataSchema;
|
|
@@ -14066,6 +14542,10 @@ exports.findValueLocators = findValueLocators;
|
|
|
14066
14542
|
exports.generateExampleFromSchema = generateExampleFromSchema;
|
|
14067
14543
|
exports.getActionInstanceVariableSchema = getActionInstanceVariableSchema;
|
|
14068
14544
|
exports.getActionRunTimeVariablesSchema = getActionRunTimeVariablesSchema;
|
|
14545
|
+
exports.getAlertCategoryDisplayName = getAlertCategoryDisplayName;
|
|
14546
|
+
exports.getAlertDeliveryMethodLabel = getAlertDeliveryMethodLabel;
|
|
14547
|
+
exports.getAlertTypeDisplayName = getAlertTypeDisplayName;
|
|
14548
|
+
exports.getAlertTypesByCategory = getAlertTypesByCategory;
|
|
14069
14549
|
exports.getAllEventMethodFilePaths = getAllEventMethodFilePaths;
|
|
14070
14550
|
exports.getBusinessDaysBetween = getBusinessDaysBetween;
|
|
14071
14551
|
exports.getChildNodeKeys = getChildNodeKeys;
|
|
@@ -14073,6 +14553,7 @@ exports.getDataCollectionCreateFields = getDataCollectionCreateFields;
|
|
|
14073
14553
|
exports.getDataCollectionUpdateFields = getDataCollectionUpdateFields;
|
|
14074
14554
|
exports.getDataLocationMethodPath = getDataLocationMethodPath;
|
|
14075
14555
|
exports.getDownstreamNodeKeys = getDownstreamNodeKeys;
|
|
14556
|
+
exports.getEffectiveConnectorOption = getEffectiveConnectorOption;
|
|
14076
14557
|
exports.getElementSelector = getElementSelector;
|
|
14077
14558
|
exports.getErrorFromData = getErrorFromData;
|
|
14078
14559
|
exports.getEventMethodFileKey = getEventMethodFileKey;
|
|
@@ -14112,16 +14593,20 @@ exports.getWritableFieldsSchema = getWritableFieldsSchema;
|
|
|
14112
14593
|
exports.hasCycles = hasCycles;
|
|
14113
14594
|
exports.hasFormulas_internalDoNotUse = hasFormulas;
|
|
14114
14595
|
exports.injectFormulaCatalog = injectFormulaCatalog;
|
|
14596
|
+
exports.isBlob = isBlob;
|
|
14115
14597
|
exports.isBusinessDay = isBusinessDay;
|
|
14116
14598
|
exports.isDataActionType = isDataActionType;
|
|
14117
14599
|
exports.isDataLocationMethodSupported = isDataLocationMethodSupported;
|
|
14600
|
+
exports.isDeliveryMethodEnabled = isDeliveryMethodEnabled;
|
|
14118
14601
|
exports.isFormula_internalDoNotUse = isFormula;
|
|
14119
14602
|
exports.isMembraneError = isMembraneError;
|
|
14120
14603
|
exports.isObject = isObject;
|
|
14121
14604
|
exports.isSameDataLocation = isSameDataLocation;
|
|
14122
14605
|
exports.isSchemaEmpty = isSchemaEmpty;
|
|
14123
14606
|
exports.isStream = isStream;
|
|
14607
|
+
exports.isValidAlertType = isValidAlertType;
|
|
14124
14608
|
exports.isValidLocator = isValidLocator;
|
|
14609
|
+
exports.lenientParseWithSchema = lenientParseWithSchema;
|
|
14125
14610
|
exports.locatorToField = locatorToField;
|
|
14126
14611
|
exports.locatorToSteps = locatorToSteps;
|
|
14127
14612
|
exports.locatorToString = locatorToString;
|
|
@@ -14151,6 +14636,7 @@ exports.schemaIsNumber = schemaIsNumber;
|
|
|
14151
14636
|
exports.schemaIsScalar = schemaIsScalar;
|
|
14152
14637
|
exports.schemaTypeFromValue = schemaTypeFromValue;
|
|
14153
14638
|
exports.schemaWithTitle = schemaWithTitle;
|
|
14639
|
+
exports.setEditablePropertiesForWorkspaceElement = setEditablePropertiesForWorkspaceElement;
|
|
14154
14640
|
exports.setSchemaAtLocator = setSchemaAtLocator;
|
|
14155
14641
|
exports.setValueAtLocator = setValueAtLocator;
|
|
14156
14642
|
exports.stepsToLocator = stepsToLocator;
|