@membranehq/sdk 0.9.6 → 0.9.8

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.
@@ -9,9 +9,14 @@ export declare enum AgentSessionStatus {
9
9
  FAILED = "failed",
10
10
  CANCELLED = "cancelled"
11
11
  }
12
+ export declare enum AgentSessionState {
13
+ BUSY = "busy",
14
+ IDLE = "idle"
15
+ }
12
16
  export declare const AgentSession: z.ZodObject<{
13
17
  id: z.ZodString;
14
18
  workspaceId: z.ZodString;
19
+ userId: z.ZodOptional<z.ZodString>;
15
20
  workspaceElementType: z.ZodEnum<typeof WorkspaceElementType>;
16
21
  workspaceElementId: z.ZodString;
17
22
  type: z.ZodString;
@@ -29,6 +34,7 @@ export declare const AgentSession: z.ZodObject<{
29
34
  logs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
30
35
  usage: z.ZodOptional<z.ZodNumber>;
31
36
  summary: z.ZodOptional<z.ZodString>;
37
+ state: z.ZodDefault<z.ZodEnum<typeof AgentSessionState>>;
32
38
  }, z.core.$strip>;
33
39
  export type AgentSession = z.infer<typeof AgentSession>;
34
40
  export declare const CreateAgentSession: z.ZodObject<{
@@ -36,6 +42,7 @@ export declare const CreateAgentSession: z.ZodObject<{
36
42
  workspaceElementId: z.ZodOptional<z.ZodString>;
37
43
  prompt: z.ZodString;
38
44
  testCustomerId: z.ZodOptional<z.ZodString>;
45
+ isExternal: z.ZodOptional<z.ZodBoolean>;
39
46
  }, z.core.$strip>;
40
47
  export type CreateAgentSession = z.infer<typeof CreateAgentSession>;
41
48
  export declare const AgentSessionInputSchema: z.ZodObject<{
@@ -43,3 +50,10 @@ export declare const AgentSessionInputSchema: z.ZodObject<{
43
50
  synthetic: z.ZodOptional<z.ZodBoolean>;
44
51
  }, z.core.$strip>;
45
52
  export type AgentSessionInput = z.infer<typeof AgentSessionInputSchema>;
53
+ export declare const PatchAgentSessionSchema: z.ZodObject<{
54
+ state: z.ZodOptional<z.ZodEnum<typeof AgentSessionState>>;
55
+ lastActivityAt: z.ZodOptional<z.ZodISODateTime>;
56
+ summary: z.ZodOptional<z.ZodString>;
57
+ status: z.ZodOptional<z.ZodEnum<typeof AgentSessionStatus>>;
58
+ }, z.core.$strip>;
59
+ export type PatchAgentSession = z.infer<typeof PatchAgentSessionSchema>;
@@ -4,6 +4,7 @@ export declare const membraneConfigSchema: z.ZodObject<{
4
4
  workspaceKey: z.ZodString;
5
5
  workspaceSecret: z.ZodString;
6
6
  apiUri: z.ZodOptional<z.ZodString>;
7
+ consoleUri: z.ZodOptional<z.ZodString>;
7
8
  testCustomerId: z.ZodOptional<z.ZodString>;
8
9
  }, z.core.$strip>;
9
10
  export type MembraneConfig = z.infer<typeof membraneConfigSchema>;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ export declare enum FunctionType {
3
+ mapping = "mapping",
4
+ operationMapping = "operation-mapping",
5
+ restApiMapping = "rest-api-mapping",
6
+ graphqlApiMapping = "graphql-api-mapping",
7
+ javascript = "javascript"
8
+ }
9
+ export declare const BaseFunctionDefinition: z.ZodObject<{
10
+ type: z.ZodEnum<{
11
+ mapping: FunctionType.mapping;
12
+ "operation-mapping": FunctionType.operationMapping;
13
+ "rest-api-mapping": FunctionType.restApiMapping;
14
+ "graphql-api-mapping": FunctionType.graphqlApiMapping;
15
+ javascript: FunctionType.javascript;
16
+ }>;
17
+ }, z.core.$strip>;
18
+ export type BaseFunctionDefinition = z.infer<typeof BaseFunctionDefinition>;
19
+ export declare const GenericFunctionDefinition: z.ZodObject<{
20
+ type: z.ZodEnum<{
21
+ mapping: "mapping";
22
+ "operation-mapping": "operation-mapping";
23
+ "rest-api-mapping": "rest-api-mapping";
24
+ "graphql-api-mapping": "graphql-api-mapping";
25
+ javascript: "javascript";
26
+ }>;
27
+ }, z.core.$loose>;
28
+ export type GenericFunctionDefinition = z.infer<typeof GenericFunctionDefinition>;
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod';
2
+ import { FunctionType } from '../base';
3
+ export declare const GraphQLFieldMappingSchema: z.ZodType<{
4
+ field: string;
5
+ args?: Record<string, any>;
6
+ subFields?: Array<{
7
+ field: string;
8
+ args?: Record<string, any>;
9
+ subFields?: any;
10
+ }>;
11
+ }>;
12
+ export type GraphQLFieldMappingSchema = z.infer<typeof GraphQLFieldMappingSchema>;
13
+ export declare const GraphQLApiMappingSchema: z.ZodObject<{
14
+ path: z.ZodString;
15
+ operationType: z.ZodEnum<{
16
+ query: "query";
17
+ mutation: "mutation";
18
+ }>;
19
+ requestMapping: z.ZodArray<z.ZodType<{
20
+ field: string;
21
+ args?: Record<string, any>;
22
+ subFields?: Array<{
23
+ field: string;
24
+ args?: Record<string, any>;
25
+ subFields?: any;
26
+ }>;
27
+ }, unknown, z.core.$ZodTypeInternals<{
28
+ field: string;
29
+ args?: Record<string, any>;
30
+ subFields?: Array<{
31
+ field: string;
32
+ args?: Record<string, any>;
33
+ subFields?: any;
34
+ }>;
35
+ }, unknown>>>;
36
+ responseMapping: z.ZodOptional<z.ZodAny>;
37
+ }, z.core.$strip>;
38
+ export type GraphQLApiMappingSchema = z.infer<typeof GraphQLApiMappingSchema>;
39
+ export declare const GraphqlApiMappingFunction: z.ZodObject<{
40
+ type: z.ZodLiteral<FunctionType.graphqlApiMapping>;
41
+ mapping: z.ZodObject<{
42
+ path: z.ZodString;
43
+ operationType: z.ZodEnum<{
44
+ query: "query";
45
+ mutation: "mutation";
46
+ }>;
47
+ requestMapping: z.ZodArray<z.ZodType<{
48
+ field: string;
49
+ args?: Record<string, any>;
50
+ subFields?: Array<{
51
+ field: string;
52
+ args?: Record<string, any>;
53
+ subFields?: any;
54
+ }>;
55
+ }, unknown, z.core.$ZodTypeInternals<{
56
+ field: string;
57
+ args?: Record<string, any>;
58
+ subFields?: Array<{
59
+ field: string;
60
+ args?: Record<string, any>;
61
+ subFields?: any;
62
+ }>;
63
+ }, unknown>>>;
64
+ responseMapping: z.ZodOptional<z.ZodAny>;
65
+ }, z.core.$strip>;
66
+ }, z.core.$strip>;
67
+ export type GraphqlApiMappingFunction = z.infer<typeof GraphqlApiMappingFunction>;
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod';
2
+ export * from './mapping';
3
+ export * from './operation-mapping';
4
+ export * from './rest-api-mapping';
5
+ export * from './graphql-api-mapping';
6
+ export * from './javascript';
7
+ export declare const FunctionDefinition: z.ZodUnion<readonly [z.ZodObject<{
8
+ type: z.ZodLiteral<import("..").FunctionType.mapping>;
9
+ mapping: z.ZodAny;
10
+ }, z.core.$strip>, z.ZodObject<{
11
+ type: z.ZodLiteral<import("..").FunctionType.operationMapping>;
12
+ mapping: z.ZodObject<{
13
+ operationKey: z.ZodString;
14
+ inputMapping: z.ZodOptional<z.ZodAny>;
15
+ outputMapping: z.ZodOptional<z.ZodAny>;
16
+ }, z.core.$strip>;
17
+ }, z.core.$strip>, z.ZodObject<{
18
+ type: z.ZodLiteral<import("..").FunctionType.restApiMapping>;
19
+ mapping: z.ZodObject<{
20
+ path: z.ZodString;
21
+ method: z.ZodString;
22
+ requestMapping: z.ZodObject<{
23
+ pathParameters: z.ZodOptional<z.ZodAny>;
24
+ query: z.ZodOptional<z.ZodAny>;
25
+ data: z.ZodOptional<z.ZodAny>;
26
+ headers: z.ZodOptional<z.ZodAny>;
27
+ }, z.core.$strip>;
28
+ responseMapping: z.ZodOptional<z.ZodAny>;
29
+ }, z.core.$strip>;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ type: z.ZodLiteral<import("..").FunctionType.graphqlApiMapping>;
32
+ mapping: z.ZodObject<{
33
+ path: z.ZodString;
34
+ operationType: z.ZodEnum<{
35
+ query: "query";
36
+ mutation: "mutation";
37
+ }>;
38
+ requestMapping: z.ZodArray<z.ZodType<{
39
+ field: string;
40
+ args?: Record<string, any>;
41
+ subFields?: Array<{
42
+ field: string;
43
+ args?: Record<string, any>;
44
+ subFields?: any;
45
+ }>;
46
+ }, unknown, z.core.$ZodTypeInternals<{
47
+ field: string;
48
+ args?: Record<string, any>;
49
+ subFields?: Array<{
50
+ field: string;
51
+ args?: Record<string, any>;
52
+ subFields?: any;
53
+ }>;
54
+ }, unknown>>>;
55
+ responseMapping: z.ZodOptional<z.ZodAny>;
56
+ }, z.core.$strip>;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ type: z.ZodLiteral<import("..").FunctionType.javascript>;
59
+ code: z.ZodString;
60
+ }, z.core.$strip>]>;
61
+ export type FunctionDefinition = z.infer<typeof FunctionDefinition>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { FunctionType } from '../base';
3
+ export declare const JavascriptFunction: z.ZodObject<{
4
+ type: z.ZodLiteral<FunctionType.javascript>;
5
+ code: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type JavascriptFunction = z.infer<typeof JavascriptFunction>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { FunctionType } from '../base';
3
+ export declare const MappingSchema: z.ZodAny;
4
+ export type MappingSchema = z.infer<typeof MappingSchema>;
5
+ export declare const MappingFunction: z.ZodObject<{
6
+ type: z.ZodLiteral<FunctionType.mapping>;
7
+ mapping: z.ZodAny;
8
+ }, z.core.$strip>;
9
+ export type MappingFunction = z.infer<typeof MappingFunction>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { FunctionType } from '../base';
3
+ export declare const OperationMappingSchema: z.ZodObject<{
4
+ operationKey: z.ZodString;
5
+ inputMapping: z.ZodOptional<z.ZodAny>;
6
+ outputMapping: z.ZodOptional<z.ZodAny>;
7
+ }, z.core.$strip>;
8
+ export type OperationMappingSchema = z.infer<typeof OperationMappingSchema>;
9
+ export declare const OperationMappingFunction: z.ZodObject<{
10
+ type: z.ZodLiteral<FunctionType.operationMapping>;
11
+ mapping: z.ZodObject<{
12
+ operationKey: z.ZodString;
13
+ inputMapping: z.ZodOptional<z.ZodAny>;
14
+ outputMapping: z.ZodOptional<z.ZodAny>;
15
+ }, z.core.$strip>;
16
+ }, z.core.$strip>;
17
+ export type OperationMappingFunction = z.infer<typeof OperationMappingFunction>;
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ import { FunctionType } from '../base';
3
+ export declare const RequestMappingSchema: z.ZodObject<{
4
+ pathParameters: z.ZodOptional<z.ZodAny>;
5
+ query: z.ZodOptional<z.ZodAny>;
6
+ data: z.ZodOptional<z.ZodAny>;
7
+ headers: z.ZodOptional<z.ZodAny>;
8
+ }, z.core.$strip>;
9
+ export type RequestMappingSchema = z.infer<typeof RequestMappingSchema>;
10
+ export declare const RestApiMappingSchema: z.ZodObject<{
11
+ path: z.ZodString;
12
+ method: z.ZodString;
13
+ requestMapping: z.ZodObject<{
14
+ pathParameters: z.ZodOptional<z.ZodAny>;
15
+ query: z.ZodOptional<z.ZodAny>;
16
+ data: z.ZodOptional<z.ZodAny>;
17
+ headers: z.ZodOptional<z.ZodAny>;
18
+ }, z.core.$strip>;
19
+ responseMapping: z.ZodOptional<z.ZodAny>;
20
+ }, z.core.$strip>;
21
+ export type RestApiMappingSchema = z.infer<typeof RestApiMappingSchema>;
22
+ export declare const OpenapiMappingSchema: z.ZodObject<{
23
+ path: z.ZodString;
24
+ method: z.ZodString;
25
+ requestMapping: z.ZodObject<{
26
+ pathParameters: z.ZodOptional<z.ZodAny>;
27
+ query: z.ZodOptional<z.ZodAny>;
28
+ data: z.ZodOptional<z.ZodAny>;
29
+ headers: z.ZodOptional<z.ZodAny>;
30
+ }, z.core.$strip>;
31
+ responseMapping: z.ZodOptional<z.ZodAny>;
32
+ }, z.core.$strip>;
33
+ export type OpenapiMappingSchema = z.infer<typeof OpenapiMappingSchema>;
34
+ export declare const RestApiMappingFunction: z.ZodObject<{
35
+ type: z.ZodLiteral<FunctionType.restApiMapping>;
36
+ mapping: z.ZodObject<{
37
+ path: z.ZodString;
38
+ method: z.ZodString;
39
+ requestMapping: z.ZodObject<{
40
+ pathParameters: z.ZodOptional<z.ZodAny>;
41
+ query: z.ZodOptional<z.ZodAny>;
42
+ data: z.ZodOptional<z.ZodAny>;
43
+ headers: z.ZodOptional<z.ZodAny>;
44
+ }, z.core.$strip>;
45
+ responseMapping: z.ZodOptional<z.ZodAny>;
46
+ }, z.core.$strip>;
47
+ }, z.core.$strip>;
48
+ export type RestApiMappingFunction = z.infer<typeof RestApiMappingFunction>;
@@ -0,0 +1,2 @@
1
+ export * from './base';
2
+ export * from './function-types';
@@ -30,6 +30,7 @@ export * from './sse';
30
30
  export * from './scenario-templates';
31
31
  export * from './agent';
32
32
  export * from './validation';
33
+ export * from './functions';
33
34
  export { MembraneClient as IntegrationAppClient } from './client';
34
35
  export { MembraneClient as MembraneClient } from './client';
35
36
  export { axios as MembraneAxiosInstance } from './api-client';
@@ -42,8 +42,8 @@ export declare const ActionExportProperties: z.ZodObject<{
42
42
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
43
43
  integrationUuid: z.ZodOptional<z.ZodString>;
44
44
  parentUuid: z.ZodOptional<z.ZodString>;
45
- inputSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
46
45
  outputMapping: z.ZodOptional<z.ZodAny>;
46
+ inputSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
47
47
  customOutputSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
48
48
  }, z.core.$strip>;
49
49
  export type ActionExportProperties = z.infer<typeof ActionExportProperties>;