@membranehq/sdk 0.9.10 → 0.10.10

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 (57) hide show
  1. package/dist/bundle.d.ts +74 -31
  2. package/dist/bundle.js +31 -14
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/dts/accessors/connections-accessors.d.ts +17 -11
  5. package/dist/dts/accessors/integrations-accessors.d.ts +14 -11
  6. package/dist/dts/agent/session.d.ts +5 -0
  7. package/dist/dts/alerts/index.d.ts +1 -0
  8. package/dist/dts/alerts/types.d.ts +107 -13
  9. package/dist/dts/alerts/utils.d.ts +8 -0
  10. package/dist/dts/config/index.d.ts +1 -0
  11. package/dist/dts/dto/index.d.ts +3 -0
  12. package/dist/dts/functions/base.d.ts +2 -2
  13. package/dist/dts/index.browser.d.ts +1 -0
  14. package/dist/dts/logging/index.d.ts +9 -0
  15. package/dist/dts/orgs/types.d.ts +66 -1
  16. package/dist/dts/platform-users.d.ts +17 -2
  17. package/dist/dts/usage/types.d.ts +1 -0
  18. package/dist/dts/webhooks/types.d.ts +4 -2
  19. package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +6 -2
  20. package/dist/dts/workspace-elements/api/connections-api.d.ts +18 -3
  21. package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +3 -1
  22. package/dist/dts/workspace-elements/api/data-source-instances-api.d.ts +3 -1
  23. package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +3 -1
  24. package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +3 -1
  25. package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +3 -1
  26. package/dist/dts/workspace-elements/api/field-mapping-instances-api.d.ts +6 -2
  27. package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +6 -2
  28. package/dist/dts/workspace-elements/api/flows-api.d.ts +6 -2
  29. package/dist/dts/workspace-elements/api/integrations-api.d.ts +5 -1
  30. package/dist/dts/workspace-elements/api/packages-api.d.ts +2 -0
  31. package/dist/dts/workspace-elements/base/actions/index.d.ts +1 -1
  32. package/dist/dts/workspace-elements/base/connections/types.d.ts +3 -1
  33. package/dist/dts/workspace-elements/base/connectors/auth.d.ts +20 -0
  34. package/dist/dts/workspace-elements/base/connectors/functions.d.ts +12 -490
  35. package/dist/dts/workspace-elements/base/connectors/functions.test.d.ts +1 -0
  36. package/dist/dts/workspace-elements/base/connectors/index.d.ts +1 -0
  37. package/dist/dts/workspace-elements/base/connectors/types.d.ts +922 -478
  38. package/dist/dts/workspace-elements/base/data-collections/data-locations/collections/methods/base.d.ts +1 -2
  39. package/dist/dts/workspace-elements/base/packages/index.d.ts +2 -0
  40. package/dist/dts/workspace-elements/element-utils.d.ts +2 -0
  41. package/dist/dts/workspace-elements/element-utils.test.d.ts +1 -0
  42. package/dist/dts/workspace-elements/index.d.ts +1 -0
  43. package/dist/dts/workspace-elements/types.d.ts +9 -3
  44. package/dist/dts/workspaces/types.d.ts +39 -1
  45. package/dist/index.browser.d.mts +1360 -583
  46. package/dist/index.browser.d.ts +1360 -583
  47. package/dist/index.browser.js +593 -113
  48. package/dist/index.browser.js.map +1 -1
  49. package/dist/index.browser.mjs +570 -114
  50. package/dist/index.browser.mjs.map +1 -1
  51. package/dist/index.node.d.mts +1358 -580
  52. package/dist/index.node.d.ts +1358 -580
  53. package/dist/index.node.js +600 -113
  54. package/dist/index.node.js.map +1 -1
  55. package/dist/index.node.mjs +577 -114
  56. package/dist/index.node.mjs.map +1 -1
  57. package/package.json +2 -1
@@ -6,13 +6,13 @@ import { ConnectionLevelFlowAccessor, ConnectionLevelFlowsAccessor } from './flo
6
6
  import { MembraneApiClient } from '../api-client';
7
7
  import { OpenConfigurationOptions } from '../iframe';
8
8
  import { InstanceKeyQuery } from '../integration-elements/common';
9
- import { Connection, CreateConnectionRequest, FindConnectionsQuery, UpdateConnectionRequest } from '../workspace-elements/api/connections-api';
9
+ import { ConnectionApiResponse, CreateConnectionRequest, FindConnectionsQuery, UpdateConnectionRequest } from '../workspace-elements/api/connections-api';
10
10
  import { ConnectorSpec } from '../workspace-elements/base/connectors';
11
11
  import { OperationRunRequest, OperationRunResponse, OperationSpec } from '../workspace-elements/base/connectors/operations/types';
12
12
  import { DataCollectionSpec, DataCollectionCreateRequest, DataCollectionCreateResponse, DataCollectionDeleteRequest, DataCollectionDeleteResponse, DataCollectionFindByIdRequest, DataCollectionFindByIdResponse, DataCollectionListRequest, DataCollectionListResponse, DataCollectionMatchRequest, DataCollectionMatchResponse, DataCollectionSearchRequest, DataCollectionSearchResponse, DataCollectionUpdateRequest, DataCollectionUpdateResponse } from '../workspace-elements/base/data-collections';
13
- export declare class ConnectionsAccessor extends ElementInstanceListAccessor<Connection, FindConnectionsQuery> {
13
+ export declare class ConnectionsAccessor extends ElementInstanceListAccessor<ConnectionApiResponse, FindConnectionsQuery> {
14
14
  constructor(client: MembraneApiClient);
15
- create(data: CreateConnectionRequest): Promise<Connection>;
15
+ create(data: CreateConnectionRequest): Promise<ConnectionApiResponse>;
16
16
  }
17
17
  export declare class ConnectionAccessor {
18
18
  client: MembraneApiClient;
@@ -28,23 +28,23 @@ export declare class ConnectionAccessor {
28
28
  fieldMapping(fieldMappingSelector: string, query?: InstanceKeyQuery): ConnectionLevelFieldMappingAccessor;
29
29
  get(query?: {
30
30
  includeSecrets?: boolean;
31
- }): Promise<Connection>;
32
- patch(data: UpdateConnectionRequest): Promise<Connection>;
33
- put(data: UpdateConnectionRequest): Promise<Connection>;
31
+ }): Promise<ConnectionApiResponse>;
32
+ patch(data: UpdateConnectionRequest): Promise<ConnectionApiResponse>;
33
+ put(data: UpdateConnectionRequest): Promise<ConnectionApiResponse>;
34
34
  archive(): Promise<void>;
35
35
  request(path: string, data?: any): Promise<any>;
36
36
  get proxy(): ConnectionProxy;
37
37
  operation(key: string): ConnectionOperationAccessor;
38
38
  dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
39
- reconnect({ parameters, authOptionKey, connectorParameters, }?: {
39
+ reconnect({ parameters, authOptionKey, connectorParameters, onPopupClosed, }?: {
40
40
  parameters?: any;
41
41
  authOptionKey?: string;
42
42
  connectorParameters?: any;
43
+ onPopupClosed?: () => void;
43
44
  }): Promise<{
44
45
  id: string;
45
46
  name: string;
46
47
  userId: string;
47
- integrationId: string;
48
48
  createdAt: string;
49
49
  updatedAt: string;
50
50
  isTest?: boolean | undefined;
@@ -52,6 +52,9 @@ export declare class ConnectionAccessor {
52
52
  isDefunct?: boolean | undefined;
53
53
  state?: import("../workspace-elements").WorkspaceElementState | undefined;
54
54
  error?: import("../errors").ErrorDataSchema | undefined;
55
+ integrationId?: string | undefined;
56
+ connectorId?: string | undefined;
57
+ connectorVersion?: string | undefined;
55
58
  authOptionKey?: string | undefined;
56
59
  lastActiveAt?: string | undefined;
57
60
  nextCredentialsRefreshAt?: string | undefined;
@@ -106,8 +109,8 @@ export declare class ConnectionAccessor {
106
109
  isDeactivated?: boolean | undefined;
107
110
  authType?: "proxy" | "integration-app-token" | "membrane-token" | "oauth2" | "oauth1" | "client-credentials" | undefined;
108
111
  } | undefined;
109
- } | undefined>;
110
- openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
112
+ } | null>;
113
+ openReconnectUI({}?: OpenConfigurationOptions): Promise<ConnectionApiResponse | null>;
111
114
  refreshCredentials(): Promise<void>;
112
115
  getPath(subpath?: string, query?: Record<string, any>): string;
113
116
  }
@@ -150,10 +153,13 @@ export declare function createOrUpdateConnection(options?: {
150
153
  parameters?: any;
151
154
  connectorParameters?: any;
152
155
  integrationId?: string;
156
+ connectorId?: string;
157
+ connectorVersion?: string;
153
158
  connectionId?: string;
154
159
  connectorSpec?: ConnectorSpec;
155
160
  allowMultipleConnections?: boolean;
156
161
  token: string;
157
162
  apiUri: string;
158
163
  redirectUri?: string;
159
- }): Promise<Connection | undefined>;
164
+ onPopupClosed?: () => void;
165
+ }): Promise<ConnectionApiResponse | null>;
@@ -5,17 +5,17 @@ import { IntegrationLevelFieldMappingAccessor, IntegrationLevelFieldMappingsList
5
5
  import { IntegrationLevelFlowAccessor, IntegrationLevelFlowsListAccessor } from './flows-accessors';
6
6
  import { MembraneApiClient } from '../api-client';
7
7
  import { OpenConfigurationOptions } from '../iframe';
8
- import { Connection } from '../workspace-elements/api/connections-api';
9
- import { CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, OpenNewConnectionOptions, Integration } from '../workspace-elements/api/integrations-api';
8
+ import { ConnectionApiResponse } from '../workspace-elements/api/connections-api';
9
+ import { CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, OpenNewConnectionOptions, IntegrationApiResponse } from '../workspace-elements/api/integrations-api';
10
10
  import { ConnectionSpec } from '../workspace-elements/base/connections';
11
11
  import { OperationListItem, OperationSpec } from '../workspace-elements/base/connectors';
12
12
  import { DataCollectionListItem, DataCollectionSpec } from '../workspace-elements/base/data-collections';
13
13
  interface OpenIntegrationUIIntegrationConfigurationOptions extends OpenConfigurationOptions {
14
14
  }
15
- export declare class IntegrationsAccessor extends ElementListAccessor<Integration, FindIntegrationsQuery, CreateIntegrationRequest> {
15
+ export declare class IntegrationsAccessor extends ElementListAccessor<IntegrationApiResponse, FindIntegrationsQuery, CreateIntegrationRequest> {
16
16
  constructor(client: MembraneApiClient);
17
17
  }
18
- export declare class IntegrationAccessor extends ElementAccessor<Integration, UpdateIntegrationRequest> {
18
+ export declare class IntegrationAccessor extends ElementAccessor<IntegrationApiResponse, UpdateIntegrationRequest> {
19
19
  private client;
20
20
  private integrationSelector;
21
21
  baseUri: string;
@@ -28,16 +28,17 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
28
28
  dataSource(dataSourceSelector: string): IntegrationLevelDataSourceAccessor;
29
29
  get fieldMappings(): IntegrationLevelFieldMappingsListAccessor;
30
30
  fieldMapping(fieldMappingSelector: string): IntegrationLevelFieldMappingAccessor;
31
- setup(): Promise<Integration>;
31
+ setup(): Promise<IntegrationApiResponse>;
32
32
  getConnectorSpec(): Promise<ConnectionSpec>;
33
33
  open({ onClose }?: OpenIntegrationUIIntegrationConfigurationOptions): Promise<void>;
34
- openNewConnection({ allowMultipleConnections, name, connectorParameters, }?: OpenNewConnectionOptions): Promise<Connection>;
35
- connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
34
+ openNewConnection({ allowMultipleConnections, name, connectorParameters, }?: OpenNewConnectionOptions): Promise<ConnectionApiResponse | null>;
35
+ connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, }?: {
36
36
  name?: string;
37
37
  parameters?: any;
38
38
  connectorParameters?: any;
39
39
  authOptionKey?: string;
40
40
  allowMultipleConnections?: boolean;
41
+ onPopupClosed?: () => void;
41
42
  } & ({
42
43
  sameWindow: true;
43
44
  redirectUri: string;
@@ -48,7 +49,6 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
48
49
  id: string;
49
50
  name: string;
50
51
  userId: string;
51
- integrationId: string;
52
52
  createdAt: string;
53
53
  updatedAt: string;
54
54
  isTest?: boolean | undefined;
@@ -56,6 +56,9 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
56
56
  isDefunct?: boolean | undefined;
57
57
  state?: import("../workspace-elements").WorkspaceElementState | undefined;
58
58
  error?: import("../errors").ErrorDataSchema | undefined;
59
+ integrationId?: string | undefined;
60
+ connectorId?: string | undefined;
61
+ connectorVersion?: string | undefined;
59
62
  authOptionKey?: string | undefined;
60
63
  lastActiveAt?: string | undefined;
61
64
  nextCredentialsRefreshAt?: string | undefined;
@@ -110,11 +113,11 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
110
113
  isDeactivated?: boolean | undefined;
111
114
  authType?: "proxy" | "integration-app-token" | "membrane-token" | "oauth2" | "oauth1" | "client-credentials" | undefined;
112
115
  } | undefined;
113
- } | undefined>;
114
- createConnection({ parameters, name }: {
116
+ } | null>;
117
+ createConnection({ parameters, name, }: {
115
118
  parameters?: any;
116
119
  name?: string;
117
- }): Promise<Connection | undefined>;
120
+ }): Promise<ConnectionApiResponse | null>;
118
121
  getOperations(): Promise<OperationListItem[]>;
119
122
  getOperation(key: string): Promise<OperationSpec>;
120
123
  getDataCollections(): Promise<DataCollectionListItem[]>;
@@ -15,6 +15,7 @@ export declare enum AgentSessionState {
15
15
  }
16
16
  export declare const AgentSession: z.ZodObject<{
17
17
  id: z.ZodString;
18
+ workspaceId: z.ZodString;
18
19
  userId: z.ZodOptional<z.ZodString>;
19
20
  workspaceElementType: z.ZodEnum<typeof WorkspaceElementType>;
20
21
  workspaceElementId: z.ZodString;
@@ -29,6 +30,7 @@ export declare const AgentSession: z.ZodObject<{
29
30
  state: z.ZodDefault<z.ZodEnum<typeof AgentSessionState>>;
30
31
  usage: z.ZodOptional<z.ZodNumber>;
31
32
  hasWorker: z.ZodBoolean;
33
+ isExternal: z.ZodOptional<z.ZodBoolean>;
32
34
  createdAt: z.ZodISODateTime;
33
35
  updatedAt: z.ZodISODateTime;
34
36
  }, z.core.$strip>;
@@ -39,6 +41,7 @@ export declare const CreateAgentSession: z.ZodObject<{
39
41
  prompt: z.ZodString;
40
42
  testCustomerId: z.ZodOptional<z.ZodString>;
41
43
  isExternal: z.ZodOptional<z.ZodBoolean>;
44
+ modelId: z.ZodOptional<z.ZodString>;
42
45
  }, z.core.$strip>;
43
46
  export type CreateAgentSession = z.infer<typeof CreateAgentSession>;
44
47
  export declare const AgentSessionInputSchema: z.ZodObject<{
@@ -52,6 +55,8 @@ export declare const PatchAgentSessionSchema: z.ZodObject<{
52
55
  title: z.ZodOptional<z.ZodString>;
53
56
  summary: z.ZodOptional<z.ZodString>;
54
57
  cost: z.ZodOptional<z.ZodNumber>;
58
+ error: z.ZodOptional<z.ZodType<ErrorDataSchema, unknown, z.core.$ZodTypeInternals<ErrorDataSchema, unknown>>>;
59
+ opencodeSessionUuid: z.ZodOptional<z.ZodString>;
55
60
  status: z.ZodOptional<z.ZodEnum<typeof AgentSessionStatus>>;
56
61
  }, z.core.$strip>;
57
62
  export type PatchAgentSession = z.infer<typeof PatchAgentSessionSchema>;
@@ -1 +1,2 @@
1
1
  export * from './types';
2
+ export * from './utils';
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod';
1
2
  export declare enum AlertStatus {
2
3
  ONGOING = "ongoing",
3
4
  RESOLVED = "resolved"
@@ -7,21 +8,114 @@ export declare enum AlertSeverity {
7
8
  WARNING = "warning"
8
9
  }
9
10
  export declare enum AlertType {
11
+ fileUploadsMbPerHour = "fileUploadsMbPerHour",
12
+ apiRequestsPerSecond = "apiRequestsPerSecond",
13
+ apiRequestsPerHour = "apiRequestsPerHour",
14
+ webhookRequestsPerSecond = "webhookRequestsPerSecond",
15
+ webhookRequestsPerHour = "webhookRequestsPerHour",
16
+ workspaceElementCreationsPerSecond = "workspaceElementCreationsPerSecond",
17
+ workspaceElementCreationsPerHour = "workspaceElementCreationsPerHour",
10
18
  externalEventsPerCustomerPerDay = "externalEventsPerCustomerPerDay",
11
19
  totalUsagePerDay = "totalUsagePerDay",
12
20
  totalUsagePer30Days = "totalUsagePer30Days",
13
- membraneAgentUsagePer30Days = "membraneAgentUsagePer30Days"
21
+ testAlert = "testAlert"
14
22
  }
15
- export interface Alert {
16
- id: string;
17
- description: string;
18
- status: AlertStatus;
19
- type: AlertType;
20
- workspaceId: string;
21
- createdAt: Date;
22
- updatedAt: Date;
23
- lastSeenAt: Date;
24
- resolvedAt?: Date;
25
- customerId?: string;
26
- severity: AlertSeverity;
23
+ export declare enum AlertCategory {
24
+ RATE_LIMIT = "rateLimit",
25
+ USAGE = "usage",
26
+ TEST = "test"
27
27
  }
28
+ export declare const ALERT_TYPE_CATEGORIES: {
29
+ readonly fileUploadsMbPerHour: AlertCategory.RATE_LIMIT;
30
+ readonly apiRequestsPerSecond: AlertCategory.RATE_LIMIT;
31
+ readonly apiRequestsPerHour: AlertCategory.RATE_LIMIT;
32
+ readonly webhookRequestsPerSecond: AlertCategory.RATE_LIMIT;
33
+ readonly webhookRequestsPerHour: AlertCategory.RATE_LIMIT;
34
+ readonly workspaceElementCreationsPerSecond: AlertCategory.RATE_LIMIT;
35
+ readonly workspaceElementCreationsPerHour: AlertCategory.RATE_LIMIT;
36
+ readonly externalEventsPerCustomerPerDay: AlertCategory.RATE_LIMIT;
37
+ readonly totalUsagePerDay: AlertCategory.USAGE;
38
+ readonly totalUsagePer30Days: AlertCategory.USAGE;
39
+ readonly testAlert: AlertCategory.TEST;
40
+ };
41
+ type AlertsByCategory<C extends AlertCategory> = {
42
+ [K in keyof typeof ALERT_TYPE_CATEGORIES]: (typeof ALERT_TYPE_CATEGORIES)[K] extends C ? K : never;
43
+ }[keyof typeof ALERT_TYPE_CATEGORIES];
44
+ export type RateLimitAlerts = AlertsByCategory<AlertCategory.RATE_LIMIT>;
45
+ export type UsageAlerts = AlertsByCategory<AlertCategory.USAGE>;
46
+ export type TestAlerts = AlertsByCategory<AlertCategory.TEST>;
47
+ export declare const AlertSchema: z.ZodObject<{
48
+ id: z.ZodString;
49
+ description: z.ZodString;
50
+ status: z.ZodEnum<{
51
+ ongoing: AlertStatus.ONGOING;
52
+ resolved: AlertStatus.RESOLVED;
53
+ }>;
54
+ type: z.ZodEnum<{
55
+ fileUploadsMbPerHour: AlertType.fileUploadsMbPerHour;
56
+ apiRequestsPerSecond: AlertType.apiRequestsPerSecond;
57
+ apiRequestsPerHour: AlertType.apiRequestsPerHour;
58
+ webhookRequestsPerSecond: AlertType.webhookRequestsPerSecond;
59
+ webhookRequestsPerHour: AlertType.webhookRequestsPerHour;
60
+ workspaceElementCreationsPerSecond: AlertType.workspaceElementCreationsPerSecond;
61
+ workspaceElementCreationsPerHour: AlertType.workspaceElementCreationsPerHour;
62
+ externalEventsPerCustomerPerDay: AlertType.externalEventsPerCustomerPerDay;
63
+ totalUsagePerDay: AlertType.totalUsagePerDay;
64
+ totalUsagePer30Days: AlertType.totalUsagePer30Days;
65
+ testAlert: AlertType.testAlert;
66
+ }>;
67
+ workspaceId: z.ZodString;
68
+ createdAt: z.ZodDate;
69
+ updatedAt: z.ZodDate;
70
+ lastSeenAt: z.ZodDate;
71
+ resolvedAt: z.ZodOptional<z.ZodDate>;
72
+ customerId: z.ZodOptional<z.ZodString>;
73
+ severity: z.ZodEnum<{
74
+ critical: AlertSeverity.CRITICAL;
75
+ warning: AlertSeverity.WARNING;
76
+ }>;
77
+ }, z.core.$strip>;
78
+ export type Alert = z.infer<typeof AlertSchema>;
79
+ export declare const ALERT_DELIVERY_METHODS: readonly ["internal", "webhook", "email"];
80
+ export type AlertDeliveryMethod = (typeof ALERT_DELIVERY_METHODS)[number];
81
+ export declare const AlertTypeDeliverySettingsSchema: z.ZodObject<{
82
+ internal: z.ZodLiteral<true>;
83
+ webhook: z.ZodOptional<z.ZodObject<{
84
+ enabled: z.ZodBoolean;
85
+ }, z.core.$strip>>;
86
+ email: z.ZodOptional<z.ZodObject<{
87
+ enabled: z.ZodBoolean;
88
+ }, z.core.$strip>>;
89
+ }, z.core.$strip>;
90
+ export type AlertTypeDeliverySettings = z.infer<typeof AlertTypeDeliverySettingsSchema> & {
91
+ [key: string]: true | {
92
+ enabled: boolean;
93
+ };
94
+ };
95
+ export declare const DEFAULT_ALERT_TYPE_DELIVERY_SETTINGS: Required<AlertTypeDeliverySettings>;
96
+ export declare const AlertDeliverySettingsSchema: z.ZodObject<{
97
+ alertTypes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
98
+ fileUploadsMbPerHour: AlertType.fileUploadsMbPerHour;
99
+ apiRequestsPerSecond: AlertType.apiRequestsPerSecond;
100
+ apiRequestsPerHour: AlertType.apiRequestsPerHour;
101
+ webhookRequestsPerSecond: AlertType.webhookRequestsPerSecond;
102
+ webhookRequestsPerHour: AlertType.webhookRequestsPerHour;
103
+ workspaceElementCreationsPerSecond: AlertType.workspaceElementCreationsPerSecond;
104
+ workspaceElementCreationsPerHour: AlertType.workspaceElementCreationsPerHour;
105
+ externalEventsPerCustomerPerDay: AlertType.externalEventsPerCustomerPerDay;
106
+ totalUsagePerDay: AlertType.totalUsagePerDay;
107
+ totalUsagePer30Days: AlertType.totalUsagePer30Days;
108
+ testAlert: AlertType.testAlert;
109
+ }>, z.ZodOptional<z.ZodObject<{
110
+ internal: z.ZodLiteral<true>;
111
+ webhook: z.ZodOptional<z.ZodObject<{
112
+ enabled: z.ZodBoolean;
113
+ }, z.core.$strip>>;
114
+ email: z.ZodOptional<z.ZodObject<{
115
+ enabled: z.ZodBoolean;
116
+ }, z.core.$strip>>;
117
+ }, z.core.$strip>>>>;
118
+ }, z.core.$strip>;
119
+ export type AlertDeliverySettings = z.infer<typeof AlertDeliverySettingsSchema>;
120
+ export declare const DEFAULT_ALERT_DELIVERY_SETTINGS: AlertDeliverySettings;
121
+ export {};
@@ -0,0 +1,8 @@
1
+ import { AlertCategory, AlertType } from './types';
2
+ import type { AlertDeliveryMethod, AlertTypeDeliverySettings } from './types';
3
+ export declare function isValidAlertType(value: string): value is AlertType;
4
+ export declare function getAlertTypeDisplayName(alertType: AlertType): string;
5
+ export declare function getAlertDeliveryMethodLabel(method: AlertDeliveryMethod): string;
6
+ export declare function isDeliveryMethodEnabled(settings: AlertTypeDeliverySettings, method: AlertDeliveryMethod): boolean;
7
+ export declare function getAlertCategoryDisplayName(category: AlertCategory): string;
8
+ export declare function getAlertTypesByCategory(category: AlertCategory): readonly AlertType[];
@@ -6,6 +6,7 @@ export declare const membraneConfigSchema: z.ZodObject<{
6
6
  apiUri: z.ZodOptional<z.ZodString>;
7
7
  consoleUri: z.ZodOptional<z.ZodString>;
8
8
  testCustomerId: z.ZodOptional<z.ZodString>;
9
+ accessToken: z.ZodOptional<z.ZodString>;
9
10
  }, z.core.$strip>;
10
11
  export type MembraneConfig = z.infer<typeof membraneConfigSchema>;
11
12
  export type PartialMembraneConfig = Partial<MembraneConfig>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ export declare function addUndefinedWriteableProperties<T extends z.ZodTypeAny>(value: Record<string, unknown>, schema: T): z.infer<T>;
3
+ export declare function lenientParseWithSchema<T extends z.ZodTypeAny>(data: unknown, schema: T): z.infer<T>;
@@ -17,12 +17,12 @@ export declare const BaseFunctionDefinition: z.ZodObject<{
17
17
  }, z.core.$strip>;
18
18
  export type BaseFunctionDefinition = z.infer<typeof BaseFunctionDefinition>;
19
19
  export declare const GenericFunctionDefinition: z.ZodObject<{
20
- type: z.ZodEnum<{
20
+ type: z.ZodOptional<z.ZodEnum<{
21
21
  mapping: "mapping";
22
22
  "operation-mapping": "operation-mapping";
23
23
  "rest-api-mapping": "rest-api-mapping";
24
24
  "graphql-api-mapping": "graphql-api-mapping";
25
25
  javascript: "javascript";
26
- }>;
26
+ }>>;
27
27
  }, z.core.$loose>;
28
28
  export type GenericFunctionDefinition = z.infer<typeof GenericFunctionDefinition>;
@@ -31,6 +31,7 @@ export * from './scenario-templates';
31
31
  export * from './agent';
32
32
  export * from './validation';
33
33
  export * from './functions';
34
+ export * from './dto';
34
35
  export { MembraneClient as IntegrationAppClient } from './client';
35
36
  export { MembraneClient as MembraneClient } from './client';
36
37
  export { axios as MembraneAxiosInstance } from './api-client';
@@ -5,4 +5,13 @@ export type WithExecutionLogs<T extends Record<string, any>> = T & {
5
5
  };
6
6
  export declare function isStream(obj: any): boolean;
7
7
  export declare function streamToString(stream: Readable): Promise<string>;
8
+ interface BlobLike {
9
+ readonly size: number;
10
+ readonly type: string;
11
+ slice(start?: number, end?: number, contentType?: string): BlobLike;
12
+ stream(): ReadableStream<Uint8Array> | NodeJS.ReadableStream;
13
+ text(): Promise<string>;
14
+ arrayBuffer(): Promise<ArrayBuffer>;
15
+ }
16
+ export declare function isBlob(value: unknown): value is BlobLike;
8
17
  export declare function truncateData(data: any, depth?: number): any;
@@ -16,6 +16,7 @@ export interface Org {
16
16
  key: string;
17
17
  secret?: string;
18
18
  name: string;
19
+ plan?: OrgPlan;
19
20
  createdAt: Date;
20
21
  updatedAt: Date;
21
22
  trialEndDate?: string;
@@ -26,10 +27,23 @@ export interface Org {
26
27
  featureFlags?: string[];
27
28
  freeAiCredits?: number;
28
29
  paidAiCredits?: number;
30
+ freeAiMonthlyCredits?: number | null;
29
31
  autoChargeEnabled?: boolean;
30
32
  autoChargeThreshold?: number;
31
33
  autoChargePurchaseAmount?: number;
32
34
  autoChargeMonthlyLimit?: number;
35
+ freeInfraCredits?: number;
36
+ paidInfraCredits?: number;
37
+ freeInfraMonthlyCredits?: number | null;
38
+ infraAutoChargeEnabled?: boolean;
39
+ infraAutoChargeThreshold?: number;
40
+ infraAutoChargePurchaseAmount?: number;
41
+ infraAutoChargeMonthlyLimit?: number;
42
+ }
43
+ export declare enum OrgPlan {
44
+ Core = "core",
45
+ Pro = "pro",
46
+ Ultimate = "ultimate"
33
47
  }
34
48
  export declare enum OrgUserRole {
35
49
  Admin = "admin",
@@ -88,6 +102,7 @@ export declare const OrgSchema: z.ZodObject<{
88
102
  id: z.ZodString;
89
103
  key: z.ZodString;
90
104
  name: z.ZodString;
105
+ plan: z.ZodOptional<z.ZodEnum<typeof OrgPlan>>;
91
106
  createdAt: z.ZodCoercedDate<unknown>;
92
107
  updatedAt: z.ZodCoercedDate<unknown>;
93
108
  trialEndDate: z.ZodOptional<z.ZodString>;
@@ -106,11 +121,19 @@ export declare const OrgSchema: z.ZodObject<{
106
121
  featureFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
107
122
  freeAiCredits: z.ZodOptional<z.ZodNumber>;
108
123
  paidAiCredits: z.ZodOptional<z.ZodNumber>;
124
+ freeAiMonthlyCredits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
109
125
  stripeCustomerId: z.ZodOptional<z.ZodString>;
110
126
  autoChargeEnabled: z.ZodOptional<z.ZodBoolean>;
111
127
  autoChargeThreshold: z.ZodOptional<z.ZodNumber>;
112
128
  autoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
113
129
  autoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
130
+ freeInfraCredits: z.ZodOptional<z.ZodNumber>;
131
+ paidInfraCredits: z.ZodOptional<z.ZodNumber>;
132
+ freeInfraMonthlyCredits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
133
+ infraAutoChargeEnabled: z.ZodOptional<z.ZodBoolean>;
134
+ infraAutoChargeThreshold: z.ZodOptional<z.ZodNumber>;
135
+ infraAutoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
136
+ infraAutoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
114
137
  }, z.core.$strip>;
115
138
  export declare const AccountResponse: z.ZodObject<{
116
139
  user: z.ZodOptional<z.ZodObject<{
@@ -123,8 +146,12 @@ export declare const AccountResponse: z.ZodObject<{
123
146
  isAdmin: z.ZodOptional<z.ZodBoolean>;
124
147
  trialRequested: z.ZodBoolean;
125
148
  pat: z.ZodOptional<z.ZodString>;
126
- introVideoStatus: z.ZodOptional<z.ZodString>;
127
149
  isEligible: z.ZodOptional<z.ZodBoolean>;
150
+ ineligibilityReason: z.ZodOptional<z.ZodEnum<{
151
+ disposable: "disposable";
152
+ blockedDomain: "blockedDomain";
153
+ notCompanyEmail: "notCompanyEmail";
154
+ }>>;
128
155
  emailVerified: z.ZodOptional<z.ZodBoolean>;
129
156
  }, z.core.$strip>>;
130
157
  workspace: z.ZodOptional<z.ZodObject<{
@@ -333,6 +360,11 @@ export declare const AccountResponse: z.ZodObject<{
333
360
  defaultValue: z.ZodOptional<z.ZodNumber>;
334
361
  unit: z.ZodEnum<typeof import("../workspaces").LimitUnits>;
335
362
  }, z.core.$strip>>;
363
+ QueuedTasksQueueSize: z.ZodOptional<z.ZodObject<{
364
+ value: z.ZodOptional<z.ZodNumber>;
365
+ defaultValue: z.ZodOptional<z.ZodNumber>;
366
+ unit: z.ZodEnum<typeof import("../workspaces").LimitUnits>;
367
+ }, z.core.$strip>>;
336
368
  parallelApiRequestsPerCustomer: z.ZodOptional<z.ZodObject<{
337
369
  value: z.ZodOptional<z.ZodNumber>;
338
370
  defaultValue: z.ZodOptional<z.ZodNumber>;
@@ -389,6 +421,30 @@ export declare const AccountResponse: z.ZodObject<{
389
421
  enableWebhookLogs: z.ZodOptional<z.ZodBoolean>;
390
422
  enableActionRunLogs: z.ZodOptional<z.ZodBoolean>;
391
423
  disableSecretKeyAuth: z.ZodOptional<z.ZodBoolean>;
424
+ useMembraneUniverse: z.ZodOptional<z.ZodBoolean>;
425
+ }, z.core.$strip>>;
426
+ alertDeliverySettings: z.ZodOptional<z.ZodObject<{
427
+ alertTypes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
428
+ fileUploadsMbPerHour: import("../alerts").AlertType.fileUploadsMbPerHour;
429
+ apiRequestsPerSecond: import("../alerts").AlertType.apiRequestsPerSecond;
430
+ apiRequestsPerHour: import("../alerts").AlertType.apiRequestsPerHour;
431
+ webhookRequestsPerSecond: import("../alerts").AlertType.webhookRequestsPerSecond;
432
+ webhookRequestsPerHour: import("../alerts").AlertType.webhookRequestsPerHour;
433
+ workspaceElementCreationsPerSecond: import("../alerts").AlertType.workspaceElementCreationsPerSecond;
434
+ workspaceElementCreationsPerHour: import("../alerts").AlertType.workspaceElementCreationsPerHour;
435
+ externalEventsPerCustomerPerDay: import("../alerts").AlertType.externalEventsPerCustomerPerDay;
436
+ totalUsagePerDay: import("../alerts").AlertType.totalUsagePerDay;
437
+ totalUsagePer30Days: import("../alerts").AlertType.totalUsagePer30Days;
438
+ testAlert: import("../alerts").AlertType.testAlert;
439
+ }>, z.ZodOptional<z.ZodObject<{
440
+ internal: z.ZodLiteral<true>;
441
+ webhook: z.ZodOptional<z.ZodObject<{
442
+ enabled: z.ZodBoolean;
443
+ }, z.core.$strip>>;
444
+ email: z.ZodOptional<z.ZodObject<{
445
+ enabled: z.ZodBoolean;
446
+ }, z.core.$strip>>;
447
+ }, z.core.$strip>>>>;
392
448
  }, z.core.$strip>>;
393
449
  type: z.ZodOptional<z.ZodEnum<typeof import("../workspaces").WorkspaceType>>;
394
450
  jwksUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -402,6 +458,7 @@ export declare const AccountResponse: z.ZodObject<{
402
458
  id: z.ZodString;
403
459
  key: z.ZodString;
404
460
  name: z.ZodString;
461
+ plan: z.ZodOptional<z.ZodEnum<typeof OrgPlan>>;
405
462
  createdAt: z.ZodCoercedDate<unknown>;
406
463
  updatedAt: z.ZodCoercedDate<unknown>;
407
464
  trialEndDate: z.ZodOptional<z.ZodString>;
@@ -420,11 +477,19 @@ export declare const AccountResponse: z.ZodObject<{
420
477
  featureFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
421
478
  freeAiCredits: z.ZodOptional<z.ZodNumber>;
422
479
  paidAiCredits: z.ZodOptional<z.ZodNumber>;
480
+ freeAiMonthlyCredits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
423
481
  stripeCustomerId: z.ZodOptional<z.ZodString>;
424
482
  autoChargeEnabled: z.ZodOptional<z.ZodBoolean>;
425
483
  autoChargeThreshold: z.ZodOptional<z.ZodNumber>;
426
484
  autoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
427
485
  autoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
486
+ freeInfraCredits: z.ZodOptional<z.ZodNumber>;
487
+ paidInfraCredits: z.ZodOptional<z.ZodNumber>;
488
+ freeInfraMonthlyCredits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
489
+ infraAutoChargeEnabled: z.ZodOptional<z.ZodBoolean>;
490
+ infraAutoChargeThreshold: z.ZodOptional<z.ZodNumber>;
491
+ infraAutoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
492
+ infraAutoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
428
493
  }, z.core.$strip>>>;
429
494
  permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
430
495
  message: z.ZodOptional<z.ZodString>;
@@ -1,11 +1,21 @@
1
1
  import { z } from 'zod';
2
+ declare const IneligibilityReasonSchema: z.ZodEnum<{
3
+ disposable: "disposable";
4
+ blockedDomain: "blockedDomain";
5
+ notCompanyEmail: "notCompanyEmail";
6
+ }>;
7
+ export type IneligibilityReason = z.infer<typeof IneligibilityReasonSchema>;
2
8
  export declare const PlatformUserSchema: z.ZodObject<{
3
9
  id: z.ZodString;
4
10
  email: z.ZodString;
5
11
  name: z.ZodString;
6
12
  trialRequested: z.ZodBoolean;
7
- introVideoStatus: z.ZodOptional<z.ZodString>;
8
13
  isEligible: z.ZodOptional<z.ZodBoolean>;
14
+ ineligibilityReason: z.ZodOptional<z.ZodEnum<{
15
+ disposable: "disposable";
16
+ blockedDomain: "blockedDomain";
17
+ notCompanyEmail: "notCompanyEmail";
18
+ }>>;
9
19
  emailVerified: z.ZodOptional<z.ZodBoolean>;
10
20
  }, z.core.$strip>;
11
21
  export declare const FullPlatformUser: z.ZodObject<{
@@ -18,7 +28,12 @@ export declare const FullPlatformUser: z.ZodObject<{
18
28
  isAdmin: z.ZodOptional<z.ZodBoolean>;
19
29
  trialRequested: z.ZodBoolean;
20
30
  pat: z.ZodOptional<z.ZodString>;
21
- introVideoStatus: z.ZodOptional<z.ZodString>;
22
31
  isEligible: z.ZodOptional<z.ZodBoolean>;
32
+ ineligibilityReason: z.ZodOptional<z.ZodEnum<{
33
+ disposable: "disposable";
34
+ blockedDomain: "blockedDomain";
35
+ notCompanyEmail: "notCompanyEmail";
36
+ }>>;
23
37
  emailVerified: z.ZodOptional<z.ZodBoolean>;
24
38
  }, z.core.$strip>;
39
+ export {};
@@ -12,6 +12,7 @@ export declare enum UsageType {
12
12
  EXTERNAL_EVENTS_PULL_DURATION = "external-events-pull-duration",
13
13
  EXTERNAL_EVENT_PULL_NUMBER = "external-event-pull-number",
14
14
  EXTERNAL_EVENT_PULL_LOG_SIZE = "external-event-pull-log-size",
15
+ EXTERNAL_EVENT_WEBHOOK_REFRESH_DURATION = "external-event-webhook-refresh-duration",
15
16
  APP_EVENTS_NUMBER = "app-events-number",
16
17
  APP_EVENTS_SIZE = "app-events-size",
17
18
  FILES_UPLOAD_NUMBER = "files-upload-number",
@@ -5,9 +5,11 @@ export declare enum WebhookTypeEnum {
5
5
  TASK_CREATED = "task-created",
6
6
  TASK_UPDATED = "task-updated",
7
7
  TASK_ACTIVITY_CREATED = "task-activity-created",
8
- CONNECTOR_VERSION_PUBLISHED = "connector-version-published"
8
+ CONNECTOR_VERSION_PUBLISHED = "connector-version-published",
9
+ AGENT_SESSION_FINISHED = "agent-session-finished",
10
+ SEND_ALERT_EMAIL = "send-alert-email"
9
11
  }
10
- export type WebhookType = WebhookTypeEnum.USER_INVITED_TO_ORG | WebhookTypeEnum.ORG_ACCESS_REQUESTED | WebhookTypeEnum.ORG_CREATED | WebhookTypeEnum.TASK_CREATED | WebhookTypeEnum.TASK_UPDATED | WebhookTypeEnum.TASK_ACTIVITY_CREATED | WebhookTypeEnum.CONNECTOR_VERSION_PUBLISHED;
12
+ export type WebhookType = WebhookTypeEnum.USER_INVITED_TO_ORG | WebhookTypeEnum.ORG_ACCESS_REQUESTED | WebhookTypeEnum.ORG_CREATED | WebhookTypeEnum.TASK_CREATED | WebhookTypeEnum.TASK_UPDATED | WebhookTypeEnum.TASK_ACTIVITY_CREATED | WebhookTypeEnum.CONNECTOR_VERSION_PUBLISHED | WebhookTypeEnum.AGENT_SESSION_FINISHED | WebhookTypeEnum.SEND_ALERT_EMAIL;
11
13
  export interface Webhook {
12
14
  type: WebhookType;
13
15
  url: string;
@@ -124,7 +124,9 @@ export declare const ActionRunLogRecordApiResponse: z.ZodObject<{
124
124
  isDefunct: z.ZodOptional<z.ZodBoolean>;
125
125
  state: z.ZodOptional<z.ZodEnum<typeof import("..").WorkspaceElementState>>;
126
126
  error: z.ZodOptional<z.ZodType<import("../../errors").ErrorDataSchema, unknown, z.core.$ZodTypeInternals<import("../../errors").ErrorDataSchema, unknown>>>;
127
- integrationId: z.ZodString;
127
+ integrationId: z.ZodOptional<z.ZodString>;
128
+ connectorId: z.ZodOptional<z.ZodString>;
129
+ connectorVersion: z.ZodOptional<z.ZodString>;
128
130
  authOptionKey: z.ZodOptional<z.ZodString>;
129
131
  createdAt: z.ZodString;
130
132
  updatedAt: z.ZodString;
@@ -288,7 +290,9 @@ export declare const FindActionRunLogsResponse: z.ZodObject<{
288
290
  isDefunct: z.ZodOptional<z.ZodBoolean>;
289
291
  state: z.ZodOptional<z.ZodEnum<typeof import("..").WorkspaceElementState>>;
290
292
  error: z.ZodOptional<z.ZodType<import("../../errors").ErrorDataSchema, unknown, z.core.$ZodTypeInternals<import("../../errors").ErrorDataSchema, unknown>>>;
291
- integrationId: z.ZodString;
293
+ integrationId: z.ZodOptional<z.ZodString>;
294
+ connectorId: z.ZodOptional<z.ZodString>;
295
+ connectorVersion: z.ZodOptional<z.ZodString>;
292
296
  authOptionKey: z.ZodOptional<z.ZodString>;
293
297
  createdAt: z.ZodString;
294
298
  updatedAt: z.ZodString;