@membranehq/sdk 0.4.0 → 0.5.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 (62) hide show
  1. package/dist/bundle.d.ts +8370 -1268
  2. package/dist/bundle.js +2216 -2085
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/dts/accessors/connections-accessors.d.ts +57 -1
  5. package/dist/dts/accessors/integrations-accessors.d.ts +57 -1
  6. package/dist/dts/api-client.d.ts +1 -0
  7. package/dist/dts/client.d.ts +1 -0
  8. package/dist/dts/data-schema/types.d.ts +4 -3
  9. package/dist/dts/entity-repository.d.ts +87 -20
  10. package/dist/dts/formulas/dataSchemaRef.d.ts +2 -2
  11. package/dist/dts/http-requests.d.ts +20 -6
  12. package/dist/dts/iframe.d.ts +12 -4
  13. package/dist/dts/index.d.ts +2 -1
  14. package/dist/dts/sse/index.d.ts +1 -0
  15. package/dist/dts/sse/workspace-elements.d.ts +9 -0
  16. package/dist/dts/workspace-elements/api/actions-api.d.ts +702 -40
  17. package/dist/dts/workspace-elements/api/connections-api.d.ts +702 -41
  18. package/dist/dts/workspace-elements/api/customers-api.d.ts +56 -13
  19. package/dist/dts/workspace-elements/api/data-sources-api.d.ts +834 -77
  20. package/dist/dts/workspace-elements/api/external-events-api.d.ts +440 -6
  21. package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +586 -6
  22. package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +1 -1
  23. package/dist/dts/workspace-elements/api/flows-api.d.ts +2417 -50
  24. package/dist/dts/workspace-elements/api/integrations-api.d.ts +253 -24
  25. package/dist/dts/workspace-elements/api/scenarios-api.d.ts +397 -34
  26. package/dist/dts/workspace-elements/api/screens-api.d.ts +2 -2
  27. package/dist/dts/workspace-elements/base/action-instances/types.d.ts +61 -14
  28. package/dist/dts/workspace-elements/base/action-run-log-records/types.d.ts +30 -7
  29. package/dist/dts/workspace-elements/base/actions/types.d.ts +60 -17
  30. package/dist/dts/workspace-elements/base/app-data-schema-instances/types.d.ts +42 -7
  31. package/dist/dts/workspace-elements/base/app-data-schemas/types.d.ts +35 -7
  32. package/dist/dts/workspace-elements/base/app-event-subscriptions/types.d.ts +78 -9
  33. package/dist/dts/workspace-elements/base/app-event-types/types.d.ts +70 -7
  34. package/dist/dts/workspace-elements/base/connections/types.d.ts +76 -20
  35. package/dist/dts/workspace-elements/base/connectors/types.d.ts +14 -2
  36. package/dist/dts/workspace-elements/base/customers/index.d.ts +26 -6
  37. package/dist/dts/workspace-elements/base/data-collections/schemas.d.ts +75 -74
  38. package/dist/dts/workspace-elements/base/data-link-table-instances/types.d.ts +61 -11
  39. package/dist/dts/workspace-elements/base/data-link-tables/types.d.ts +26 -4
  40. package/dist/dts/workspace-elements/base/data-source-instances/types.d.ts +1030 -19
  41. package/dist/dts/workspace-elements/base/data-sources/types.d.ts +89 -22
  42. package/dist/dts/workspace-elements/base/external-event-log-records/types.d.ts +31 -8
  43. package/dist/dts/workspace-elements/base/external-event-pulls/types.d.ts +35 -8
  44. package/dist/dts/workspace-elements/base/external-event-subscriptions/types.d.ts +199 -23
  45. package/dist/dts/workspace-elements/base/external-events/types.d.ts +145 -5
  46. package/dist/dts/workspace-elements/base/field-mapping-instances/types.d.ts +74 -16
  47. package/dist/dts/workspace-elements/base/field-mappings/types.d.ts +91 -14
  48. package/dist/dts/workspace-elements/base/flow-instances/schemas.d.ts +39 -39
  49. package/dist/dts/workspace-elements/base/flow-instances/types.d.ts +155 -24
  50. package/dist/dts/workspace-elements/base/flow-runs/flow-node-runs.d.ts +20 -20
  51. package/dist/dts/workspace-elements/base/flow-runs/types.d.ts +114 -19
  52. package/dist/dts/workspace-elements/base/flows/types.d.ts +220 -26
  53. package/dist/dts/workspace-elements/base/integrations/types.d.ts +497 -24
  54. package/dist/dts/workspace-elements/base/scenarios/types.d.ts +723 -23
  55. package/dist/dts/workspace-elements/base/screens/types.d.ts +40 -6
  56. package/dist/index.d.ts +12141 -2138
  57. package/dist/index.js +1555 -522
  58. package/dist/index.js.map +1 -1
  59. package/dist/index.module.d.mts +12141 -2138
  60. package/dist/index.module.mjs +1414 -490
  61. package/dist/index.module.mjs.map +1 -1
  62. package/package.json +1 -1
@@ -40,7 +40,63 @@ export declare class ConnectionAccessor {
40
40
  parameters?: any;
41
41
  authOptionKey?: string;
42
42
  connectorParameters?: any;
43
- }): Promise<Connection | undefined>;
43
+ }): Promise<{
44
+ id: string;
45
+ name: string;
46
+ userId: string;
47
+ integrationId: string;
48
+ createdAt: string;
49
+ updatedAt: string;
50
+ error?: any;
51
+ integration?: {
52
+ key: string;
53
+ id: string;
54
+ name: string;
55
+ baseUri: string;
56
+ logoUri: string;
57
+ state?: import("..").WorkspaceElementState | undefined;
58
+ errors?: any[] | undefined;
59
+ parameters?: any;
60
+ parametersSchema?: import("..").DataSchema | undefined;
61
+ archivedAt?: string | undefined;
62
+ isTest?: boolean | undefined;
63
+ connectorId?: string | undefined;
64
+ connectorVersion?: string | undefined;
65
+ authOptions?: any[] | undefined;
66
+ oAuthCallbackUri?: string | undefined;
67
+ hasMissingParameters?: boolean | undefined;
68
+ hasDocumentation?: boolean | undefined;
69
+ hasOperations?: boolean | undefined;
70
+ hasData?: boolean | undefined;
71
+ hasEvents?: boolean | undefined;
72
+ hasGlobalWebhooks?: boolean | undefined;
73
+ hasUdm?: boolean | undefined;
74
+ appUuid?: string | undefined;
75
+ isDeactivated?: boolean | undefined;
76
+ authType?: "proxy" | "integration-app-token" | "membrane-token" | "oauth2" | "oauth1" | "client-credentials" | undefined;
77
+ } | undefined;
78
+ state?: import("..").WorkspaceElementState | undefined;
79
+ errors?: any[] | undefined;
80
+ accessToken?: string | undefined;
81
+ credentials?: unknown;
82
+ parameters?: unknown;
83
+ connectorParameters?: unknown;
84
+ user?: {
85
+ id: string;
86
+ name: string;
87
+ internalId: string;
88
+ credentials?: any;
89
+ fields?: Record<string, any> | undefined;
90
+ lastActiveAt?: string | undefined;
91
+ isTest?: boolean | undefined;
92
+ isBillable?: boolean | undefined;
93
+ } | undefined;
94
+ disconnected?: boolean | undefined;
95
+ refreshToken?: string | undefined;
96
+ lastActiveAt?: string | undefined;
97
+ nextCredentialsRefreshAt?: string | undefined;
98
+ archivedAt?: string | undefined;
99
+ } | undefined>;
44
100
  openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
45
101
  refreshCredentials(): Promise<void>;
46
102
  getPath(subpath?: string, query?: Record<string, any>): string;
@@ -44,7 +44,63 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
44
44
  } | {
45
45
  sameWindow?: false;
46
46
  redirectUri?: never;
47
- })): Promise<Connection | undefined>;
47
+ })): Promise<{
48
+ id: string;
49
+ name: string;
50
+ userId: string;
51
+ integrationId: string;
52
+ createdAt: string;
53
+ updatedAt: string;
54
+ error?: any;
55
+ integration?: {
56
+ key: string;
57
+ id: string;
58
+ name: string;
59
+ baseUri: string;
60
+ logoUri: string;
61
+ state?: import("..").WorkspaceElementState | undefined;
62
+ errors?: any[] | undefined;
63
+ parameters?: any;
64
+ parametersSchema?: import("..").DataSchema | undefined;
65
+ archivedAt?: string | undefined;
66
+ isTest?: boolean | undefined;
67
+ connectorId?: string | undefined;
68
+ connectorVersion?: string | undefined;
69
+ authOptions?: any[] | undefined;
70
+ oAuthCallbackUri?: string | undefined;
71
+ hasMissingParameters?: boolean | undefined;
72
+ hasDocumentation?: boolean | undefined;
73
+ hasOperations?: boolean | undefined;
74
+ hasData?: boolean | undefined;
75
+ hasEvents?: boolean | undefined;
76
+ hasGlobalWebhooks?: boolean | undefined;
77
+ hasUdm?: boolean | undefined;
78
+ appUuid?: string | undefined;
79
+ isDeactivated?: boolean | undefined;
80
+ authType?: "proxy" | "integration-app-token" | "membrane-token" | "oauth2" | "oauth1" | "client-credentials" | undefined;
81
+ } | undefined;
82
+ state?: import("..").WorkspaceElementState | undefined;
83
+ errors?: any[] | undefined;
84
+ accessToken?: string | undefined;
85
+ credentials?: unknown;
86
+ parameters?: unknown;
87
+ connectorParameters?: unknown;
88
+ user?: {
89
+ id: string;
90
+ name: string;
91
+ internalId: string;
92
+ credentials?: any;
93
+ fields?: Record<string, any> | undefined;
94
+ lastActiveAt?: string | undefined;
95
+ isTest?: boolean | undefined;
96
+ isBillable?: boolean | undefined;
97
+ } | undefined;
98
+ disconnected?: boolean | undefined;
99
+ refreshToken?: string | undefined;
100
+ lastActiveAt?: string | undefined;
101
+ nextCredentialsRefreshAt?: string | undefined;
102
+ archivedAt?: string | undefined;
103
+ } | undefined>;
48
104
  createConnection({ parameters, name }: {
49
105
  parameters?: any;
50
106
  name?: string;
@@ -24,6 +24,7 @@ export declare class IntegrationAppApiClient {
24
24
  put<T = any>(uri: string, data?: any, options?: AxiosRequestConfig): Promise<T>;
25
25
  patch<T = any>(uri: string, data?: any, options?: AxiosRequestConfig): Promise<T>;
26
26
  delete<T = any>(uri: string, data?: any, options?: AxiosRequestConfig): Promise<T>;
27
+ createEventSource(uri: string, queryParams?: Record<string, any>): Promise<EventSource>;
27
28
  getEmbedUri(page: string, pageParams?: Record<string, any>, options?: {
28
29
  embedMode: 'isolated-embed' | 'popup-embed';
29
30
  }): Promise<string>;
@@ -51,6 +51,7 @@ export declare class IntegrationAppClient extends IntegrationAppApiClient {
51
51
  get customers(): CustomersAccessor;
52
52
  scenario(selector: string): ScenarioAccessor;
53
53
  get scenarios(): ScenariosAccessor;
54
+ createEventSource(uri: string, queryParams?: Record<string, any>): Promise<EventSource>;
54
55
  connectionRequest(connectionId: string, uri: string, data?: any): Promise<any>;
55
56
  }
56
57
  export {};
@@ -1,4 +1,4 @@
1
- import { DataRecord } from '../workspace-elements/base/data-collections';
1
+ import { z } from 'zod';
2
2
  export interface DataSchema {
3
3
  title?: string;
4
4
  description?: string;
@@ -10,9 +10,9 @@ export interface DataSchema {
10
10
  items?: DataSchema;
11
11
  additionalProperties?: boolean | DataSchema;
12
12
  enum?: string[];
13
- referenceRecords?: DataRecord[];
13
+ referenceRecords?: any[];
14
14
  referenceCollection?: {
15
- key: any;
15
+ key?: any;
16
16
  parameters?: Record<string, any>;
17
17
  };
18
18
  referenceUdm?: string;
@@ -34,3 +34,4 @@ export interface DataSchema {
34
34
  referenceCollectionPath?: string;
35
35
  referenceCollectionUri?: string;
36
36
  }
37
+ export declare const DataSchema: z.ZodType<DataSchema>;
@@ -1,23 +1,90 @@
1
- export type CommonListElementsQuery = SearchQuery & PaginationQuery & IncludeArchivedQuery;
2
- export type CommonInstancesListQuery = CommonListElementsQuery & {
3
- userId?: string;
4
- instanceKey?: string;
5
- };
6
- export type CommonIntegrationOrConnectionQuery = {
7
- connectionId?: string;
8
- integrationId?: string;
9
- integrationKey?: string;
10
- };
11
- export type IncludeArchivedQuery = {
12
- includeArchived?: boolean;
13
- };
14
- export type SearchQuery = {
15
- search?: string;
16
- };
17
- export type PaginationQuery = {
18
- limit?: number;
19
- cursor?: string;
20
- };
1
+ import { z } from 'zod';
2
+ export declare const IncludeArchivedQuery: z.ZodObject<{
3
+ includeArchived: z.ZodOptional<z.ZodBoolean>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ includeArchived?: boolean | undefined;
6
+ }, {
7
+ includeArchived?: boolean | undefined;
8
+ }>;
9
+ export type IncludeArchivedQuery = z.infer<typeof IncludeArchivedQuery>;
10
+ export declare const SearchQuery: z.ZodObject<{
11
+ search: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ search?: string | undefined;
14
+ }, {
15
+ search?: string | undefined;
16
+ }>;
17
+ export type SearchQuery = z.infer<typeof SearchQuery>;
18
+ export declare const PaginationQuery: z.ZodObject<{
19
+ limit: z.ZodOptional<z.ZodNumber>;
20
+ cursor: z.ZodOptional<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ limit?: number | undefined;
23
+ cursor?: string | undefined;
24
+ }, {
25
+ limit?: number | undefined;
26
+ cursor?: string | undefined;
27
+ }>;
28
+ export type PaginationQuery = z.infer<typeof PaginationQuery>;
29
+ export declare const CommonListElementsQuery: z.ZodObject<{
30
+ search: z.ZodOptional<z.ZodString>;
31
+ } & {
32
+ limit: z.ZodOptional<z.ZodNumber>;
33
+ cursor: z.ZodOptional<z.ZodString>;
34
+ } & {
35
+ includeArchived: z.ZodOptional<z.ZodBoolean>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ search?: string | undefined;
38
+ includeArchived?: boolean | undefined;
39
+ limit?: number | undefined;
40
+ cursor?: string | undefined;
41
+ }, {
42
+ search?: string | undefined;
43
+ includeArchived?: boolean | undefined;
44
+ limit?: number | undefined;
45
+ cursor?: string | undefined;
46
+ }>;
47
+ export type CommonListElementsQuery = z.infer<typeof CommonListElementsQuery>;
48
+ export declare const CommonInstancesListQuery: z.ZodObject<{
49
+ search: z.ZodOptional<z.ZodString>;
50
+ } & {
51
+ limit: z.ZodOptional<z.ZodNumber>;
52
+ cursor: z.ZodOptional<z.ZodString>;
53
+ } & {
54
+ includeArchived: z.ZodOptional<z.ZodBoolean>;
55
+ } & {
56
+ userId: z.ZodOptional<z.ZodString>;
57
+ instanceKey: z.ZodOptional<z.ZodString>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ search?: string | undefined;
60
+ includeArchived?: boolean | undefined;
61
+ limit?: number | undefined;
62
+ cursor?: string | undefined;
63
+ userId?: string | undefined;
64
+ instanceKey?: string | undefined;
65
+ }, {
66
+ search?: string | undefined;
67
+ includeArchived?: boolean | undefined;
68
+ limit?: number | undefined;
69
+ cursor?: string | undefined;
70
+ userId?: string | undefined;
71
+ instanceKey?: string | undefined;
72
+ }>;
73
+ export type CommonInstancesListQuery = z.infer<typeof CommonInstancesListQuery>;
74
+ export declare const CommonIntegrationOrConnectionQuery: z.ZodObject<{
75
+ connectionId: z.ZodOptional<z.ZodString>;
76
+ integrationId: z.ZodOptional<z.ZodString>;
77
+ integrationKey: z.ZodOptional<z.ZodString>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ connectionId?: string | undefined;
80
+ integrationId?: string | undefined;
81
+ integrationKey?: string | undefined;
82
+ }, {
83
+ connectionId?: string | undefined;
84
+ integrationId?: string | undefined;
85
+ integrationKey?: string | undefined;
86
+ }>;
87
+ export type CommonIntegrationOrConnectionQuery = z.infer<typeof CommonIntegrationOrConnectionQuery>;
21
88
  export declare class PaginationResponse<T> {
22
89
  items: T[];
23
90
  cursor?: string;
@@ -13,8 +13,8 @@ export declare class DataSchemaRef extends DataBuilderFormulaBase<DataSchemaRefA
13
13
  value: any;
14
14
  constructor(value: any);
15
15
  getValue(): undefined;
16
- resolveValue(params: ResolveFormulaParams): Promise<any>;
17
- resolveDataCollection(args: DataSchemaRegArgsDataCollection, params: ResolveFormulaParams): Promise<any>;
16
+ resolveValue(params: ResolveFormulaParams): Promise<import("..").DataSchema | undefined>;
17
+ resolveDataCollection(args: DataSchemaRegArgsDataCollection, params: ResolveFormulaParams): Promise<import("..").DataSchema | undefined>;
18
18
  resolveInternalDataSchema(args: DataSchemaRegArgsInternalDataSchema, params: ResolveFormulaParams): Promise<import("..").DataSchema | undefined>;
19
19
  getSchema(): {
20
20
  type: string;
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod';
1
2
  export declare enum HttpRequestMethod {
2
3
  GET = "GET",
3
4
  POST = "POST",
@@ -5,13 +6,26 @@ export declare enum HttpRequestMethod {
5
6
  PUT = "PUT",
6
7
  DELETE = "DELETE"
7
8
  }
8
- export interface HttpRequestSpec {
9
- method?: HttpRequestMethod;
10
- uri: any;
11
- headers?: Record<string, any>;
12
- query?: Record<string, any>;
9
+ export declare const HttpRequestSpec: z.ZodObject<{
10
+ method: z.ZodOptional<z.ZodNativeEnum<typeof HttpRequestMethod>>;
11
+ uri: z.ZodAny;
12
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
13
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
14
+ body: z.ZodOptional<z.ZodAny>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ headers?: Record<string, any> | undefined;
17
+ method?: HttpRequestMethod | undefined;
13
18
  body?: any;
14
- }
19
+ uri?: any;
20
+ query?: Record<string, any> | undefined;
21
+ }, {
22
+ headers?: Record<string, any> | undefined;
23
+ method?: HttpRequestMethod | undefined;
24
+ body?: any;
25
+ uri?: any;
26
+ query?: Record<string, any> | undefined;
27
+ }>;
28
+ export type HttpRequestSpec = z.infer<typeof HttpRequestSpec>;
15
29
  export declare const HTTP_REQUEST_SCHEMA: {
16
30
  type: string;
17
31
  properties: {
@@ -1,8 +1,16 @@
1
+ import { z } from 'zod';
1
2
  export declare const POPUP_ELEMENT_ID = "__integration-app-popup";
2
- export interface OpenConfigurationOptions {
3
- onClose?: () => void;
4
- showPoweredBy?: boolean;
5
- }
3
+ export declare const OpenConfigurationOptions: z.ZodObject<{
4
+ onClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
5
+ showPoweredBy: z.ZodOptional<z.ZodBoolean>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ onClose?: ((...args: unknown[]) => unknown) | undefined;
8
+ showPoweredBy?: boolean | undefined;
9
+ }, {
10
+ onClose?: ((...args: unknown[]) => unknown) | undefined;
11
+ showPoweredBy?: boolean | undefined;
12
+ }>;
13
+ export type OpenConfigurationOptions = z.infer<typeof OpenConfigurationOptions>;
6
14
  export type OpenIframeOptions = OpenConfigurationOptions & {
7
15
  [key: string]: (...args: any[]) => void;
8
16
  };
@@ -24,5 +24,6 @@ export * from './workspace-updates';
24
24
  export * from './orgs';
25
25
  export * from './webhooks';
26
26
  export * from './alerts';
27
- export * from './accessors/';
27
+ export * from './accessors';
28
+ export * from './sse';
28
29
  export { IntegrationAppClient } from './client';
@@ -0,0 +1 @@
1
+ export * from './workspace-elements';
@@ -0,0 +1,9 @@
1
+ import { WorkspaceElementType } from '../workspace-elements';
2
+ export declare enum WorkspaceSyncEventType {
3
+ ElementUpdate = "element-update"
4
+ }
5
+ export interface WorkspaceSyncEvent {
6
+ type: WorkspaceSyncEventType;
7
+ elementType: WorkspaceElementType;
8
+ elementId: string;
9
+ }