@membranehq/sdk 0.9.7 → 0.9.9

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.
Files changed (36) hide show
  1. package/dist/bundle.d.ts +9 -8
  2. package/dist/bundle.js +12251 -3514
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/dts/accessors/base-accessors.d.ts +8 -6
  5. package/dist/dts/agent/session.d.ts +10 -10
  6. package/dist/dts/functions/base.d.ts +28 -0
  7. package/dist/dts/functions/function-types/graphql-api-mapping.d.ts +67 -0
  8. package/dist/dts/functions/function-types/index.d.ts +61 -0
  9. package/dist/dts/functions/function-types/javascript.d.ts +7 -0
  10. package/dist/dts/functions/function-types/mapping.d.ts +9 -0
  11. package/dist/dts/functions/function-types/operation-mapping.d.ts +17 -0
  12. package/dist/dts/functions/function-types/rest-api-mapping.d.ts +48 -0
  13. package/dist/dts/functions/index.d.ts +2 -0
  14. package/dist/dts/index.browser.d.ts +1 -0
  15. package/dist/dts/workspace-elements/api/actions-api.d.ts +1 -1
  16. package/dist/dts/workspace-elements/base/actions/index.d.ts +2 -1
  17. package/dist/dts/workspace-elements/base/connectors/functions.d.ts +491 -0
  18. package/dist/dts/workspace-elements/base/connectors/types.d.ts +1521 -3043
  19. package/dist/dts/workspace-elements/base/data-sources/index.d.ts +1 -0
  20. package/dist/dts/workspace-elements/base/field-mappings/index.d.ts +1 -0
  21. package/dist/dts/workspace-elements/base/flows/index.d.ts +1 -0
  22. package/dist/dts/workspace-elements/base/packages/index.d.ts +1 -0
  23. package/dist/dts/workspace-elements/types.d.ts +1 -0
  24. package/dist/index.browser.d.mts +1769 -3057
  25. package/dist/index.browser.d.ts +1769 -3057
  26. package/dist/index.browser.js +184 -15
  27. package/dist/index.browser.js.map +1 -1
  28. package/dist/index.browser.mjs +163 -16
  29. package/dist/index.browser.mjs.map +1 -1
  30. package/dist/index.node.d.mts +1769 -3057
  31. package/dist/index.node.d.ts +1769 -3057
  32. package/dist/index.node.js +184 -15
  33. package/dist/index.node.js.map +1 -1
  34. package/dist/index.node.mjs +163 -16
  35. package/dist/index.node.mjs.map +1 -1
  36. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import z from 'zod';
1
2
  import { MembraneApiClient } from '../api-client';
2
3
  import { PaginationResponse } from '../entity-repository';
3
4
  import { WorkspaceElementType } from '../workspace-elements/types';
@@ -12,12 +13,13 @@ export interface ElementInstanceSelector {
12
13
  parentKey?: string;
13
14
  parentId?: string;
14
15
  }
15
- export interface IntegrationSpecificElementSelector {
16
- id?: string;
17
- key?: string;
18
- integrationId?: string;
19
- integrationKey?: string;
20
- }
16
+ export declare const IntegrationSpecificElementSelector: z.ZodObject<{
17
+ id: z.ZodOptional<z.ZodString>;
18
+ key: z.ZodOptional<z.ZodString>;
19
+ integrationId: z.ZodOptional<z.ZodString>;
20
+ integrationKey: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ export type IntegrationSpecificElementSelector = z.infer<typeof IntegrationSpecificElementSelector>;
21
23
  type SelectorType = {
22
24
  id?: string;
23
25
  } | string;
@@ -15,25 +15,22 @@ export declare enum AgentSessionState {
15
15
  }
16
16
  export declare const AgentSession: z.ZodObject<{
17
17
  id: z.ZodString;
18
- workspaceId: z.ZodString;
18
+ userId: z.ZodOptional<z.ZodString>;
19
19
  workspaceElementType: z.ZodEnum<typeof WorkspaceElementType>;
20
20
  workspaceElementId: z.ZodString;
21
21
  type: z.ZodString;
22
22
  status: z.ZodEnum<typeof AgentSessionStatus>;
23
- workerId: z.ZodOptional<z.ZodString>;
24
- workerUrl: z.ZodOptional<z.ZodString>;
25
23
  prompt: z.ZodString;
26
24
  error: z.ZodOptional<z.ZodType<ErrorDataSchema, unknown, z.core.$ZodTypeInternals<ErrorDataSchema, unknown>>>;
27
- createdBy: z.ZodString;
28
25
  lastActivityAt: z.ZodISODateTime;
29
- createdAt: z.ZodISODateTime;
30
- updatedAt: z.ZodISODateTime;
31
- storedMessagesUri: z.ZodOptional<z.ZodString>;
32
- sessionFilesZipUri: z.ZodOptional<z.ZodString>;
33
- logs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
34
- usage: z.ZodOptional<z.ZodNumber>;
26
+ title: z.ZodOptional<z.ZodString>;
35
27
  summary: z.ZodOptional<z.ZodString>;
28
+ cost: z.ZodOptional<z.ZodNumber>;
36
29
  state: z.ZodDefault<z.ZodEnum<typeof AgentSessionState>>;
30
+ usage: z.ZodOptional<z.ZodNumber>;
31
+ hasWorker: z.ZodBoolean;
32
+ createdAt: z.ZodISODateTime;
33
+ updatedAt: z.ZodISODateTime;
37
34
  }, z.core.$strip>;
38
35
  export type AgentSession = z.infer<typeof AgentSession>;
39
36
  export declare const CreateAgentSession: z.ZodObject<{
@@ -41,6 +38,7 @@ export declare const CreateAgentSession: z.ZodObject<{
41
38
  workspaceElementId: z.ZodOptional<z.ZodString>;
42
39
  prompt: z.ZodString;
43
40
  testCustomerId: z.ZodOptional<z.ZodString>;
41
+ isExternal: z.ZodOptional<z.ZodBoolean>;
44
42
  }, z.core.$strip>;
45
43
  export type CreateAgentSession = z.infer<typeof CreateAgentSession>;
46
44
  export declare const AgentSessionInputSchema: z.ZodObject<{
@@ -51,7 +49,9 @@ export type AgentSessionInput = z.infer<typeof AgentSessionInputSchema>;
51
49
  export declare const PatchAgentSessionSchema: z.ZodObject<{
52
50
  state: z.ZodOptional<z.ZodEnum<typeof AgentSessionState>>;
53
51
  lastActivityAt: z.ZodOptional<z.ZodISODateTime>;
52
+ title: z.ZodOptional<z.ZodString>;
54
53
  summary: z.ZodOptional<z.ZodString>;
54
+ cost: z.ZodOptional<z.ZodNumber>;
55
55
  status: z.ZodOptional<z.ZodEnum<typeof AgentSessionStatus>>;
56
56
  }, z.core.$strip>;
57
57
  export type PatchAgentSession = z.infer<typeof PatchAgentSessionSchema>;
@@ -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';
@@ -293,7 +293,7 @@ export declare const RunActionRequest: z.ZodObject<{
293
293
  export type RunActionRequest = z.infer<typeof RunActionRequest>;
294
294
  export declare const ActionRunResponse: z.ZodObject<{
295
295
  output: z.ZodOptional<z.ZodAny>;
296
- logs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
296
+ actionRunId: z.ZodOptional<z.ZodString>;
297
297
  }, z.core.$strip>;
298
298
  export type ActionRunResponse<RunOutput = any> = Omit<z.infer<typeof ActionRunResponse>, 'output'> & {
299
299
  output: RunOutput;
@@ -42,8 +42,9 @@ 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>>>;
45
+ isCustomized: z.ZodOptional<z.ZodBoolean>;
46
46
  outputMapping: z.ZodOptional<z.ZodAny>;
47
+ inputSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
47
48
  customOutputSchema: z.ZodOptional<z.ZodType<DataSchema, unknown, z.core.$ZodTypeInternals<DataSchema, unknown>>>;
48
49
  }, z.core.$strip>;
49
50
  export type ActionExportProperties = z.infer<typeof ActionExportProperties>;