@membranehq/sdk 0.10.10 → 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.
@@ -3890,11 +3890,12 @@ function getAuthSpec(spec, authOptionKey) {
3890
3890
  const getDefaultAuthInputSchema = (args) => {
3891
3891
  var _a, _b, _c, _d, _e, _f;
3892
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;
3893
3894
  return {
3894
3895
  type: 'object',
3895
3896
  properties: {
3896
- connectorParameters: (_b = (_a = args.connectorSpec) === null || _a === void 0 ? void 0 : _a.parametersSchema) !== null && _b !== void 0 ? _b : {},
3897
- connectionParameters: (_d = (_c = authSpec === null || authSpec === void 0 ? void 0 : authSpec.ui) === null || _c === void 0 ? void 0 : _c.schema) !== null && _d !== void 0 ? _d : (_f = (_e = args.connectorSpec) === null || _e === void 0 ? void 0 : _e.ui) === null || _f === void 0 ? void 0 : _f.schema,
3897
+ connectorParameters: (_f = (_e = args.connectorSpec) === null || _e === void 0 ? void 0 : _e.parametersSchema) !== null && _f !== void 0 ? _f : {},
3898
+ connectionInput: inputSchema,
3898
3899
  },
3899
3900
  };
3900
3901
  };
@@ -4228,12 +4229,12 @@ function getEffectiveConnectorOption(connector, optionKey) {
4228
4229
  }
4229
4230
  const getDefaultInputSchema = (authConfig) => {
4230
4231
  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
+ 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;
4232
4233
  return {
4233
4234
  type: 'object',
4234
4235
  properties: {
4235
4236
  connectorParameters: (_c = authConfig === null || authConfig === void 0 ? void 0 : authConfig.parametersSchema) !== null && _c !== void 0 ? _c : {},
4236
- ...(connectionParameters && { connectionParameters }),
4237
+ ...(inputSchema && { connectionInput: inputSchema }),
4237
4238
  },
4238
4239
  };
4239
4240
  };
@@ -9498,7 +9499,6 @@ const BaseIntegration = BaseMembraneInterface.extend({
9498
9499
  authType: z.z.enum(CONNECTOR_AUTH_TYPES).optional(),
9499
9500
  });
9500
9501
  const IntegrationEditableProperties = BaseMembraneInterfaceEditableProperties.extend({
9501
- baseUri: z.z.string().optional(),
9502
9502
  logoUri: z.z.string().optional(),
9503
9503
  appUuid: z.z.string().optional(),
9504
9504
  oAuthCallbackUri: z.z.url().or(z.z.literal('')).optional(),
@@ -10019,7 +10019,7 @@ const ConnectionApiResponse = BaseConnection.extend({
10019
10019
  });
10020
10020
  const ConnectionApiResponseWithSecrets = ConnectionApiResponse.extend({
10021
10021
  credentials: z.z.unknown().optional(),
10022
- parameters: z.z.unknown().optional(),
10022
+ input: z.z.unknown().optional(),
10023
10023
  connectorParameters: z.z.unknown().optional(),
10024
10024
  });
10025
10025
  const ConnectionMessagePayload = z.z.discriminatedUnion('type', [
@@ -10246,7 +10246,6 @@ const IntegrationApiResponse = BaseIntegration.extend({
10246
10246
  .array(IntegrationAuthOption)
10247
10247
  .optional()
10248
10248
  .describe('[INTERNAL] Deprecated: Use POST /connectors/:id/generate-options instead'),
10249
- parametersSchema: DataSchema.optional(),
10250
10249
  });
10251
10250
 
10252
10251
  const PackageElementApi = z.z.object({
@@ -11885,6 +11884,7 @@ const MembraneAgentKey = z.z
11885
11884
  expiresAt: z.z.string().optional(),
11886
11885
  })
11887
11886
  .optional();
11887
+ const OrgFeatureFlagsSchema = z.z.record(z.z.string(), z.z.boolean());
11888
11888
  const OrgSchema = z.z.object({
11889
11889
  id: z.z.string(),
11890
11890
  key: z.z.string(),
@@ -11915,6 +11915,7 @@ const OrgSchema = z.z.object({
11915
11915
  infraAutoChargeThreshold: z.z.number().optional(),
11916
11916
  infraAutoChargePurchaseAmount: z.z.number().optional(),
11917
11917
  infraAutoChargeMonthlyLimit: z.z.number().optional(),
11918
+ effectiveFeatureFlags: OrgFeatureFlagsSchema.optional(),
11918
11919
  });
11919
11920
  const AccountResponse = z.z.object({
11920
11921
  user: FullPlatformUser.optional(),
@@ -12938,7 +12939,7 @@ class ConnectionAccessor {
12938
12939
  return createOrUpdateConnection({
12939
12940
  connectionId: connection.id,
12940
12941
  connectorSpec,
12941
- parameters,
12942
+ input: parameters,
12942
12943
  authOptionKey,
12943
12944
  connectorParameters,
12944
12945
  apiUri: this.client.apiUri,
@@ -13032,7 +13033,7 @@ class ConnectionProxy {
13032
13033
  }
13033
13034
  }
13034
13035
  async function createOrUpdateConnection(options) {
13035
- const { connectionId, integrationId, connectorId, connectorVersion, name, parameters, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
13036
+ const { connectionId, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
13036
13037
  const connectionType = getConnectionType({
13037
13038
  connectorSpec,
13038
13039
  authOptionKey,
@@ -13053,7 +13054,7 @@ async function createOrUpdateConnection(options) {
13053
13054
  const requestId = simpleUniqueId() + simpleUniqueId();
13054
13055
  const payload = {
13055
13056
  token,
13056
- connectionParameters: parameters,
13057
+ input,
13057
13058
  connectorParameters,
13058
13059
  connectorId,
13059
13060
  connectorVersion,
@@ -13353,14 +13354,14 @@ class IntegrationAccessor extends ElementAccessor {
13353
13354
  });
13354
13355
  });
13355
13356
  }
13356
- async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, } = {}) {
13357
+ async connect({ name, input, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, } = {}) {
13357
13358
  const integration = await this.get();
13358
13359
  const connectorSpec = await this.getConnectorSpec();
13359
13360
  return createOrUpdateConnection({
13360
13361
  integrationId: integration.id,
13361
13362
  connectorSpec,
13362
13363
  name,
13363
- parameters,
13364
+ input: input !== null && input !== void 0 ? input : parameters,
13364
13365
  connectorParameters,
13365
13366
  authOptionKey,
13366
13367
  allowMultipleConnections,
@@ -13690,6 +13691,11 @@ exports.AgentSessionState = void 0;
13690
13691
  AgentSessionState["BUSY"] = "busy";
13691
13692
  AgentSessionState["IDLE"] = "idle";
13692
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 = {}));
13693
13699
  const AgentSession = z.z.object({
13694
13700
  id: z.z.string(),
13695
13701
  workspaceId: z.z.string(),
@@ -13708,6 +13714,7 @@ const AgentSession = z.z.object({
13708
13714
  usage: z.z.number().optional(),
13709
13715
  hasWorker: z.z.boolean(),
13710
13716
  isExternal: z.z.boolean().optional(),
13717
+ agentName: z.z.enum(exports.AgentName).optional(),
13711
13718
  createdAt: z.z.iso.datetime(),
13712
13719
  updatedAt: z.z.iso.datetime(),
13713
13720
  });
@@ -14434,6 +14441,7 @@ exports.OAUTH_CONFIG_SCHEMA = OAUTH_CONFIG_SCHEMA;
14434
14441
  exports.OpenapiMappingSchema = OpenapiMappingSchema;
14435
14442
  exports.OperationMappingFunction = OperationMappingFunction;
14436
14443
  exports.OperationMappingSchema = OperationMappingSchema;
14444
+ exports.OrgFeatureFlagsSchema = OrgFeatureFlagsSchema;
14437
14445
  exports.OrgLimits = OrgLimits;
14438
14446
  exports.OrgSchema = OrgSchema;
14439
14447
  exports.OrgWorkspaceSchema = OrgWorkspaceSchema;