@membranehq/sdk 0.9.11 → 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.
Files changed (58) hide show
  1. package/dist/bundle.d.ts +75 -34
  2. package/dist/bundle.js +34 -17
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/dts/accessors/connections-accessors.d.ts +18 -12
  5. package/dist/dts/accessors/integrations-accessors.d.ts +15 -11
  6. package/dist/dts/agent/session.d.ts +10 -0
  7. package/dist/dts/alerts/index.d.ts +1 -0
  8. package/dist/dts/alerts/types.d.ts +106 -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 +68 -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 +19 -4
  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 -4
  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/integrations/index.d.ts +0 -2
  40. package/dist/dts/workspace-elements/base/packages/index.d.ts +2 -0
  41. package/dist/dts/workspace-elements/element-utils.d.ts +2 -0
  42. package/dist/dts/workspace-elements/element-utils.test.d.ts +1 -0
  43. package/dist/dts/workspace-elements/index.d.ts +1 -0
  44. package/dist/dts/workspace-elements/types.d.ts +9 -3
  45. package/dist/dts/workspaces/types.d.ts +39 -1
  46. package/dist/index.browser.d.mts +1420 -641
  47. package/dist/index.browser.d.ts +1420 -641
  48. package/dist/index.browser.js +608 -122
  49. package/dist/index.browser.js.map +1 -1
  50. package/dist/index.browser.mjs +584 -123
  51. package/dist/index.browser.mjs.map +1 -1
  52. package/dist/index.node.d.mts +1370 -590
  53. package/dist/index.node.d.ts +1370 -590
  54. package/dist/index.node.js +615 -122
  55. package/dist/index.node.js.map +1 -1
  56. package/dist/index.node.mjs +591 -123
  57. package/dist/index.node.mjs.map +1 -1
  58. 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
  }
@@ -147,13 +150,16 @@ export declare class ConnectionProxy {
147
150
  export declare function createOrUpdateConnection(options?: {
148
151
  authOptionKey?: string;
149
152
  name?: string;
150
- parameters?: any;
153
+ input?: 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,18 @@ 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, input, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, onPopupClosed, }?: {
36
36
  name?: string;
37
+ input?: any;
37
38
  parameters?: any;
38
39
  connectorParameters?: any;
39
40
  authOptionKey?: string;
40
41
  allowMultipleConnections?: boolean;
42
+ onPopupClosed?: () => void;
41
43
  } & ({
42
44
  sameWindow: true;
43
45
  redirectUri: string;
@@ -48,7 +50,6 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
48
50
  id: string;
49
51
  name: string;
50
52
  userId: string;
51
- integrationId: string;
52
53
  createdAt: string;
53
54
  updatedAt: string;
54
55
  isTest?: boolean | undefined;
@@ -56,6 +57,9 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
56
57
  isDefunct?: boolean | undefined;
57
58
  state?: import("../workspace-elements").WorkspaceElementState | undefined;
58
59
  error?: import("../errors").ErrorDataSchema | undefined;
60
+ integrationId?: string | undefined;
61
+ connectorId?: string | undefined;
62
+ connectorVersion?: string | undefined;
59
63
  authOptionKey?: string | undefined;
60
64
  lastActiveAt?: string | undefined;
61
65
  nextCredentialsRefreshAt?: string | undefined;
@@ -110,11 +114,11 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
110
114
  isDeactivated?: boolean | undefined;
111
115
  authType?: "proxy" | "integration-app-token" | "membrane-token" | "oauth2" | "oauth1" | "client-credentials" | undefined;
112
116
  } | undefined;
113
- } | undefined>;
114
- createConnection({ parameters, name }: {
117
+ } | null>;
118
+ createConnection({ parameters, name, }: {
115
119
  parameters?: any;
116
120
  name?: string;
117
- }): Promise<Connection | undefined>;
121
+ }): Promise<ConnectionApiResponse | null>;
118
122
  getOperations(): Promise<OperationListItem[]>;
119
123
  getOperation(key: string): Promise<OperationSpec>;
120
124
  getDataCollections(): Promise<DataCollectionListItem[]>;
@@ -13,8 +13,13 @@ export declare enum AgentSessionState {
13
13
  BUSY = "busy",
14
14
  IDLE = "idle"
15
15
  }
16
+ export declare enum AgentName {
17
+ MEMBRANE = "membrane",
18
+ SELF_INTEGRATING = "self-integrating"
19
+ }
16
20
  export declare const AgentSession: z.ZodObject<{
17
21
  id: z.ZodString;
22
+ workspaceId: z.ZodString;
18
23
  userId: z.ZodOptional<z.ZodString>;
19
24
  workspaceElementType: z.ZodEnum<typeof WorkspaceElementType>;
20
25
  workspaceElementId: z.ZodString;
@@ -29,6 +34,8 @@ export declare const AgentSession: z.ZodObject<{
29
34
  state: z.ZodDefault<z.ZodEnum<typeof AgentSessionState>>;
30
35
  usage: z.ZodOptional<z.ZodNumber>;
31
36
  hasWorker: z.ZodBoolean;
37
+ isExternal: z.ZodOptional<z.ZodBoolean>;
38
+ agentName: z.ZodOptional<z.ZodEnum<typeof AgentName>>;
32
39
  createdAt: z.ZodISODateTime;
33
40
  updatedAt: z.ZodISODateTime;
34
41
  }, z.core.$strip>;
@@ -39,6 +46,7 @@ export declare const CreateAgentSession: z.ZodObject<{
39
46
  prompt: z.ZodString;
40
47
  testCustomerId: z.ZodOptional<z.ZodString>;
41
48
  isExternal: z.ZodOptional<z.ZodBoolean>;
49
+ modelId: z.ZodOptional<z.ZodString>;
42
50
  }, z.core.$strip>;
43
51
  export type CreateAgentSession = z.infer<typeof CreateAgentSession>;
44
52
  export declare const AgentSessionInputSchema: z.ZodObject<{
@@ -52,6 +60,8 @@ export declare const PatchAgentSessionSchema: z.ZodObject<{
52
60
  title: z.ZodOptional<z.ZodString>;
53
61
  summary: z.ZodOptional<z.ZodString>;
54
62
  cost: z.ZodOptional<z.ZodNumber>;
63
+ error: z.ZodOptional<z.ZodType<ErrorDataSchema, unknown, z.core.$ZodTypeInternals<ErrorDataSchema, unknown>>>;
64
+ opencodeSessionUuid: z.ZodOptional<z.ZodString>;
55
65
  status: z.ZodOptional<z.ZodEnum<typeof AgentSessionStatus>>;
56
66
  }, z.core.$strip>;
57
67
  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,22 +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",
14
21
  testAlert = "testAlert"
15
22
  }
16
- export interface Alert {
17
- id: string;
18
- description: string;
19
- status: AlertStatus;
20
- type: AlertType;
21
- workspaceId: string;
22
- createdAt: Date;
23
- updatedAt: Date;
24
- lastSeenAt: Date;
25
- resolvedAt?: Date;
26
- customerId?: string;
27
- severity: AlertSeverity;
23
+ export declare enum AlertCategory {
24
+ RATE_LIMIT = "rateLimit",
25
+ USAGE = "usage",
26
+ TEST = "test"
28
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;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export type OrgFeatureFlags = Record<string, boolean>;
2
3
  export declare enum OrgLimitsType {
3
4
  NUMBER_OF_WORKSPACES = "numberOfWorkspaces",
4
5
  TODAY_USAGE = "todayUsage",
@@ -16,6 +17,7 @@ export interface Org {
16
17
  key: string;
17
18
  secret?: string;
18
19
  name: string;
20
+ plan?: OrgPlan;
19
21
  createdAt: Date;
20
22
  updatedAt: Date;
21
23
  trialEndDate?: string;
@@ -31,6 +33,19 @@ export interface Org {
31
33
  autoChargeThreshold?: number;
32
34
  autoChargePurchaseAmount?: number;
33
35
  autoChargeMonthlyLimit?: number;
36
+ freeInfraCredits?: number;
37
+ paidInfraCredits?: number;
38
+ freeInfraMonthlyCredits?: number | null;
39
+ infraAutoChargeEnabled?: boolean;
40
+ infraAutoChargeThreshold?: number;
41
+ infraAutoChargePurchaseAmount?: number;
42
+ infraAutoChargeMonthlyLimit?: number;
43
+ effectiveFeatureFlags?: OrgFeatureFlags;
44
+ }
45
+ export declare enum OrgPlan {
46
+ Core = "core",
47
+ Pro = "pro",
48
+ Ultimate = "ultimate"
34
49
  }
35
50
  export declare enum OrgUserRole {
36
51
  Admin = "admin",
@@ -85,10 +100,12 @@ export declare const MembraneAgentKey: z.ZodOptional<z.ZodObject<{
85
100
  key: z.ZodOptional<z.ZodString>;
86
101
  expiresAt: z.ZodOptional<z.ZodString>;
87
102
  }, z.core.$strip>>;
103
+ export declare const OrgFeatureFlagsSchema: z.ZodRecord<z.ZodString, z.ZodBoolean>;
88
104
  export declare const OrgSchema: z.ZodObject<{
89
105
  id: z.ZodString;
90
106
  key: z.ZodString;
91
107
  name: z.ZodString;
108
+ plan: z.ZodOptional<z.ZodEnum<typeof OrgPlan>>;
92
109
  createdAt: z.ZodCoercedDate<unknown>;
93
110
  updatedAt: z.ZodCoercedDate<unknown>;
94
111
  trialEndDate: z.ZodOptional<z.ZodString>;
@@ -113,6 +130,14 @@ export declare const OrgSchema: z.ZodObject<{
113
130
  autoChargeThreshold: z.ZodOptional<z.ZodNumber>;
114
131
  autoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
115
132
  autoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
133
+ freeInfraCredits: z.ZodOptional<z.ZodNumber>;
134
+ paidInfraCredits: z.ZodOptional<z.ZodNumber>;
135
+ freeInfraMonthlyCredits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
136
+ infraAutoChargeEnabled: z.ZodOptional<z.ZodBoolean>;
137
+ infraAutoChargeThreshold: z.ZodOptional<z.ZodNumber>;
138
+ infraAutoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
139
+ infraAutoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
140
+ effectiveFeatureFlags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
116
141
  }, z.core.$strip>;
117
142
  export declare const AccountResponse: z.ZodObject<{
118
143
  user: z.ZodOptional<z.ZodObject<{
@@ -125,8 +150,12 @@ export declare const AccountResponse: z.ZodObject<{
125
150
  isAdmin: z.ZodOptional<z.ZodBoolean>;
126
151
  trialRequested: z.ZodBoolean;
127
152
  pat: z.ZodOptional<z.ZodString>;
128
- introVideoStatus: z.ZodOptional<z.ZodString>;
129
153
  isEligible: z.ZodOptional<z.ZodBoolean>;
154
+ ineligibilityReason: z.ZodOptional<z.ZodEnum<{
155
+ disposable: "disposable";
156
+ blockedDomain: "blockedDomain";
157
+ notCompanyEmail: "notCompanyEmail";
158
+ }>>;
130
159
  emailVerified: z.ZodOptional<z.ZodBoolean>;
131
160
  }, z.core.$strip>>;
132
161
  workspace: z.ZodOptional<z.ZodObject<{
@@ -335,6 +364,11 @@ export declare const AccountResponse: z.ZodObject<{
335
364
  defaultValue: z.ZodOptional<z.ZodNumber>;
336
365
  unit: z.ZodEnum<typeof import("../workspaces").LimitUnits>;
337
366
  }, z.core.$strip>>;
367
+ QueuedTasksQueueSize: z.ZodOptional<z.ZodObject<{
368
+ value: z.ZodOptional<z.ZodNumber>;
369
+ defaultValue: z.ZodOptional<z.ZodNumber>;
370
+ unit: z.ZodEnum<typeof import("../workspaces").LimitUnits>;
371
+ }, z.core.$strip>>;
338
372
  parallelApiRequestsPerCustomer: z.ZodOptional<z.ZodObject<{
339
373
  value: z.ZodOptional<z.ZodNumber>;
340
374
  defaultValue: z.ZodOptional<z.ZodNumber>;
@@ -391,6 +425,30 @@ export declare const AccountResponse: z.ZodObject<{
391
425
  enableWebhookLogs: z.ZodOptional<z.ZodBoolean>;
392
426
  enableActionRunLogs: z.ZodOptional<z.ZodBoolean>;
393
427
  disableSecretKeyAuth: z.ZodOptional<z.ZodBoolean>;
428
+ useMembraneUniverse: z.ZodOptional<z.ZodBoolean>;
429
+ }, z.core.$strip>>;
430
+ alertDeliverySettings: z.ZodOptional<z.ZodObject<{
431
+ alertTypes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
432
+ fileUploadsMbPerHour: import("../alerts").AlertType.fileUploadsMbPerHour;
433
+ apiRequestsPerSecond: import("../alerts").AlertType.apiRequestsPerSecond;
434
+ apiRequestsPerHour: import("../alerts").AlertType.apiRequestsPerHour;
435
+ webhookRequestsPerSecond: import("../alerts").AlertType.webhookRequestsPerSecond;
436
+ webhookRequestsPerHour: import("../alerts").AlertType.webhookRequestsPerHour;
437
+ workspaceElementCreationsPerSecond: import("../alerts").AlertType.workspaceElementCreationsPerSecond;
438
+ workspaceElementCreationsPerHour: import("../alerts").AlertType.workspaceElementCreationsPerHour;
439
+ externalEventsPerCustomerPerDay: import("../alerts").AlertType.externalEventsPerCustomerPerDay;
440
+ totalUsagePerDay: import("../alerts").AlertType.totalUsagePerDay;
441
+ totalUsagePer30Days: import("../alerts").AlertType.totalUsagePer30Days;
442
+ testAlert: import("../alerts").AlertType.testAlert;
443
+ }>, z.ZodOptional<z.ZodObject<{
444
+ internal: z.ZodLiteral<true>;
445
+ webhook: z.ZodOptional<z.ZodObject<{
446
+ enabled: z.ZodBoolean;
447
+ }, z.core.$strip>>;
448
+ email: z.ZodOptional<z.ZodObject<{
449
+ enabled: z.ZodBoolean;
450
+ }, z.core.$strip>>;
451
+ }, z.core.$strip>>>>;
394
452
  }, z.core.$strip>>;
395
453
  type: z.ZodOptional<z.ZodEnum<typeof import("../workspaces").WorkspaceType>>;
396
454
  jwksUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -404,6 +462,7 @@ export declare const AccountResponse: z.ZodObject<{
404
462
  id: z.ZodString;
405
463
  key: z.ZodString;
406
464
  name: z.ZodString;
465
+ plan: z.ZodOptional<z.ZodEnum<typeof OrgPlan>>;
407
466
  createdAt: z.ZodCoercedDate<unknown>;
408
467
  updatedAt: z.ZodCoercedDate<unknown>;
409
468
  trialEndDate: z.ZodOptional<z.ZodString>;
@@ -428,6 +487,14 @@ export declare const AccountResponse: z.ZodObject<{
428
487
  autoChargeThreshold: z.ZodOptional<z.ZodNumber>;
429
488
  autoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
430
489
  autoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
490
+ freeInfraCredits: z.ZodOptional<z.ZodNumber>;
491
+ paidInfraCredits: z.ZodOptional<z.ZodNumber>;
492
+ freeInfraMonthlyCredits: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
493
+ infraAutoChargeEnabled: z.ZodOptional<z.ZodBoolean>;
494
+ infraAutoChargeThreshold: z.ZodOptional<z.ZodNumber>;
495
+ infraAutoChargePurchaseAmount: z.ZodOptional<z.ZodNumber>;
496
+ infraAutoChargeMonthlyLimit: z.ZodOptional<z.ZodNumber>;
497
+ effectiveFeatureFlags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
431
498
  }, z.core.$strip>>>;
432
499
  permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
433
500
  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;