@membranehq/sdk 0.26.0 → 0.26.1

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.
@@ -20,7 +20,8 @@ export declare enum UsageType {
20
20
  FILES_UPLOAD_SIZE = "files-upload-size",
21
21
  CUSTOM_CODE_RUNTIME_DURATION = "custom-code-runtime-duration",
22
22
  INSTANT_TASKS_DURATION = "instant-tasks-duration",
23
- MEMBRANE_AGENT = "membrane-agent"
23
+ MEMBRANE_AGENT = "membrane-agent",
24
+ AI_GATEWAY = "ai-gateway"
24
25
  }
25
26
  export interface UsageWithCredits {
26
27
  key: UsageType;
@@ -1,8 +1,9 @@
1
- import { Connector, ConnectorAuthWithFunctions, ConnectorOption } from '.';
1
+ import type { ConnectorVersionData } from '.';
2
+ import { ConnectorAuthWithFunctions, ConnectorOption } from '.';
2
3
  import { DataSchema } from '../../../data-schema';
3
4
  import { FunctionType } from '../../../functions/base';
4
5
  import { ConnectorAuthType } from './auth';
5
- export declare function getEffectiveConnectorOption(connector: Connector, optionKey: string): ConnectorOption;
6
+ export declare function getEffectiveConnectorOption(connector: ConnectorVersionData, optionKey: string): ConnectorOption;
6
7
  export interface ConnectorFunctionSpec {
7
8
  authTypes?: ConnectorAuthType[];
8
9
  getInputSchema?: (authConfig: ConnectorAuthWithFunctions) => DataSchema | undefined;
@@ -2887,6 +2887,7 @@ export declare const ConnectorVersionData: z.ZodObject<{
2887
2887
  credentialsSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
2888
2888
  }, z.core.$strip>>>;
2889
2889
  }, z.core.$strip>;
2890
+ export type ConnectorVersionData = z.infer<typeof ConnectorVersionData>;
2890
2891
  export declare const ConnectorVersion: z.ZodObject<{
2891
2892
  baseUri: z.ZodString;
2892
2893
  revision: z.ZodOptional<z.ZodString>;
@@ -3651,7 +3651,7 @@ declare const GenericFunctionDefinition: z.ZodObject<{
3651
3651
  type GenericFunctionDefinition = z.infer<typeof GenericFunctionDefinition>;
3652
3652
  declare function validateFunctionDefinitions(functions: Record<string, GenericFunctionDefinition>, schema: z.ZodType): void;
3653
3653
 
3654
- declare function getEffectiveConnectorOption(connector: Connector, optionKey: string): ConnectorOption;
3654
+ declare function getEffectiveConnectorOption(connector: ConnectorVersionData, optionKey: string): ConnectorOption;
3655
3655
  interface ConnectorFunctionSpec {
3656
3656
  authTypes?: ConnectorAuthType[];
3657
3657
  getInputSchema?: (authConfig: ConnectorAuthWithFunctions) => DataSchema | undefined;
@@ -6814,6 +6814,7 @@ declare const ConnectorVersionData: z.ZodObject<{
6814
6814
  credentialsSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
6815
6815
  }, z.core.$strip>>>;
6816
6816
  }, z.core.$strip>;
6817
+ type ConnectorVersionData = z.infer<typeof ConnectorVersionData>;
6817
6818
  declare const ConnectorVersion: z.ZodObject<{
6818
6819
  baseUri: z.ZodString;
6819
6820
  revision: z.ZodOptional<z.ZodString>;
@@ -24124,7 +24125,8 @@ declare enum UsageType {
24124
24125
  FILES_UPLOAD_SIZE = "files-upload-size",
24125
24126
  CUSTOM_CODE_RUNTIME_DURATION = "custom-code-runtime-duration",
24126
24127
  INSTANT_TASKS_DURATION = "instant-tasks-duration",
24127
- MEMBRANE_AGENT = "membrane-agent"
24128
+ MEMBRANE_AGENT = "membrane-agent",
24129
+ AI_GATEWAY = "ai-gateway"
24128
24130
  }
24129
24131
  interface UsageWithCredits {
24130
24132
  key: UsageType;
@@ -3651,7 +3651,7 @@ declare const GenericFunctionDefinition: z.ZodObject<{
3651
3651
  type GenericFunctionDefinition = z.infer<typeof GenericFunctionDefinition>;
3652
3652
  declare function validateFunctionDefinitions(functions: Record<string, GenericFunctionDefinition>, schema: z.ZodType): void;
3653
3653
 
3654
- declare function getEffectiveConnectorOption(connector: Connector, optionKey: string): ConnectorOption;
3654
+ declare function getEffectiveConnectorOption(connector: ConnectorVersionData, optionKey: string): ConnectorOption;
3655
3655
  interface ConnectorFunctionSpec {
3656
3656
  authTypes?: ConnectorAuthType[];
3657
3657
  getInputSchema?: (authConfig: ConnectorAuthWithFunctions) => DataSchema | undefined;
@@ -6814,6 +6814,7 @@ declare const ConnectorVersionData: z.ZodObject<{
6814
6814
  credentialsSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
6815
6815
  }, z.core.$strip>>>;
6816
6816
  }, z.core.$strip>;
6817
+ type ConnectorVersionData = z.infer<typeof ConnectorVersionData>;
6817
6818
  declare const ConnectorVersion: z.ZodObject<{
6818
6819
  baseUri: z.ZodString;
6819
6820
  revision: z.ZodOptional<z.ZodString>;
@@ -24124,7 +24125,8 @@ declare enum UsageType {
24124
24125
  FILES_UPLOAD_SIZE = "files-upload-size",
24125
24126
  CUSTOM_CODE_RUNTIME_DURATION = "custom-code-runtime-duration",
24126
24127
  INSTANT_TASKS_DURATION = "instant-tasks-duration",
24127
- MEMBRANE_AGENT = "membrane-agent"
24128
+ MEMBRANE_AGENT = "membrane-agent",
24129
+ AI_GATEWAY = "ai-gateway"
24128
24130
  }
24129
24131
  interface UsageWithCredits {
24130
24132
  key: UsageType;
@@ -4618,6 +4618,9 @@ const CONNECTOR_EVENTS_DIR = 'events';
4618
4618
  function getEffectiveConnectorOption(connector, optionKey) {
4619
4619
  var _a, _b, _c, _d, _e, _f, _g, _h;
4620
4620
  const option = (_a = connector.options) === null || _a === void 0 ? void 0 : _a[optionKey];
4621
+ if (!option) {
4622
+ throw new BadRequestError(`Connector doesn't have auth option ${optionKey}`);
4623
+ }
4621
4624
  const connectorInputSchema = (_b = connector.inputSchema) !== null && _b !== void 0 ? _b : (_c = connector.ui) === null || _c === void 0 ? void 0 : _c.schema;
4622
4625
  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;
4623
4626
  return {
@@ -12882,6 +12885,7 @@ exports.UsageType = void 0;
12882
12885
  UsageType["CUSTOM_CODE_RUNTIME_DURATION"] = "custom-code-runtime-duration";
12883
12886
  UsageType["INSTANT_TASKS_DURATION"] = "instant-tasks-duration";
12884
12887
  UsageType["MEMBRANE_AGENT"] = "membrane-agent";
12888
+ UsageType["AI_GATEWAY"] = "ai-gateway";
12885
12889
  })(exports.UsageType || (exports.UsageType = {}));
12886
12890
 
12887
12891
  function getNodeInputSchema(flow, nodeKey) {