@membranehq/sdk 0.2.1 → 0.3.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.
- package/LICENSE +1 -1
- package/README.md +3 -8
- package/dist/bundle.d.ts +724 -223
- package/dist/bundle.js +166 -47
- package/dist/bundle.js.map +1 -1
- package/dist/dts/api-client.d.ts +5 -5
- package/dist/dts/connections/accessors.d.ts +1 -10
- package/dist/dts/connections/types.d.ts +1 -3
- package/dist/dts/connectors/auth.d.ts +6 -3
- package/dist/dts/connectors/data-locations/base.d.ts +3 -3
- package/dist/dts/connectors/data-locations/collections/events/implementation-types/connector-event.d.ts +2 -2
- package/dist/dts/connectors/data-locations/collections/events/implementation-types/custom-pull.d.ts +2 -2
- package/dist/dts/connectors/data-locations/collections/events/implementation-types/pull-latest-records.d.ts +2 -2
- package/dist/dts/connectors/data-locations/collections/events/implementation-types/webhook.d.ts +2 -2
- package/dist/dts/connectors/data-locations/collections/index.d.ts +24 -24
- package/dist/dts/connectors/data-locations/collections/methods/base.d.ts +3 -3
- package/dist/dts/connectors/data-locations/index.d.ts +1 -2
- package/dist/dts/connectors/data-locations/methods.d.ts +2 -2
- package/dist/dts/connectors/data-locations/schemas.d.ts +1329 -0
- package/dist/dts/connectors/data-locations/utils.d.ts +2 -2
- package/dist/dts/connectors/types.d.ts +1 -12
- package/dist/dts/data-builder/formulas/dataSchemaRef.d.ts +2 -2
- package/dist/dts/data-schema/index.d.ts +1 -0
- package/dist/dts/data-schema/schemas.d.ts +4 -0
- package/dist/dts/errors/index.d.ts +3 -10
- package/dist/dts/flow-runs/flow-node-runs.d.ts +347 -15
- package/dist/dts/flows/schemas.d.ts +14 -14
- package/dist/dts/integrations/accessors.d.ts +3 -5
- package/dist/index.d.ts +1708 -354
- package/dist/index.js +191 -87
- package/dist/index.js.map +1 -1
- package/dist/index.module.d.mts +1708 -354
- package/dist/index.module.mjs +166 -85
- package/dist/index.module.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/dts/connectors/data-locations/directories/index.d.ts +0 -17
- package/dist/dts/connectors/data-locations/directories/methods/base.d.ts +0 -18
- package/dist/dts/connectors/data-locations/directories/methods/list.d.ts +0 -2
- package/dist/dts/connectors/data-locations/types.d.ts +0 -258
package/dist/dts/api-client.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ export declare class IntegrationAppApiClient {
|
|
|
19
19
|
constructor({ uiUri, apiUri, accessToken, token, fetchToken, fetchCredentials, credentials, }?: IntegrationAppClientOptions);
|
|
20
20
|
setCredentials(credentials: any): Promise<any>;
|
|
21
21
|
getToken(): Promise<string>;
|
|
22
|
-
get(uri: string, queryParams?: Record<string, any>, options?: AxiosRequestConfig): Promise<
|
|
23
|
-
post(uri: string, data?: any, options?: AxiosRequestConfig): Promise<
|
|
24
|
-
put(uri: string, data?: any, options?: AxiosRequestConfig): Promise<
|
|
25
|
-
patch(uri: string, data?: any, options?: AxiosRequestConfig): Promise<
|
|
26
|
-
delete(uri: string, data?: any, options?: AxiosRequestConfig): Promise<
|
|
22
|
+
get<T = any>(uri: string, queryParams?: Record<string, any>, options?: AxiosRequestConfig): Promise<T>;
|
|
23
|
+
post<T = any>(uri: string, data?: any, options?: AxiosRequestConfig): Promise<T>;
|
|
24
|
+
put<T = any>(uri: string, data?: any, options?: AxiosRequestConfig): Promise<T>;
|
|
25
|
+
patch<T = any>(uri: string, data?: any, options?: AxiosRequestConfig): Promise<T>;
|
|
26
|
+
delete<T = any>(uri: string, data?: any, options?: AxiosRequestConfig): Promise<T>;
|
|
27
27
|
getEmbedUri(page: string, pageParams?: Record<string, any>, options?: {
|
|
28
28
|
embedMode: 'isolated-embed' | 'popup-embed';
|
|
29
29
|
}): Promise<string>;
|
|
@@ -2,7 +2,7 @@ import { CreateConnectionRequest, FindConnectionsQuery, UpdateConnectionRequest
|
|
|
2
2
|
import { ElementInstanceListAccessor } from '../accessors';
|
|
3
3
|
import { ConnectionLevelActionAccessor, ConnectionLevelActionsAccessor } from '../actions';
|
|
4
4
|
import { IntegrationAppApiClient } from '../api-client';
|
|
5
|
-
import { DataCollectionCreateRequest, DataCollectionCreateResponse, DataCollectionDeleteRequest, DataCollectionDeleteResponse, DataCollectionFindByIdRequest, DataCollectionFindByIdResponse, DataCollectionListRequest, DataCollectionListResponse, DataCollectionMatchRequest, DataCollectionMatchResponse, DataCollectionSearchRequest, DataCollectionSearchResponse, DataCollectionSpec, DataCollectionUpdateRequest, DataCollectionUpdateResponse
|
|
5
|
+
import { DataCollectionCreateRequest, DataCollectionCreateResponse, DataCollectionDeleteRequest, DataCollectionDeleteResponse, DataCollectionFindByIdRequest, DataCollectionFindByIdResponse, DataCollectionListRequest, DataCollectionListResponse, DataCollectionMatchRequest, DataCollectionMatchResponse, DataCollectionSearchRequest, DataCollectionSearchResponse, DataCollectionSpec, DataCollectionUpdateRequest, DataCollectionUpdateResponse } from '../connectors';
|
|
6
6
|
import { OperationRunRequest, OperationRunResponse, OperationSpec } from '../connectors/operations/types';
|
|
7
7
|
import { ConnectionLevelDataSourceAccessor, ConnectionLevelDataSourcesAccessor } from '../data-sources';
|
|
8
8
|
import { ConnectionLevelFieldMappingAccessor, ConnectionLevelFieldMappingsAccessor } from '../field-mappings';
|
|
@@ -36,7 +36,6 @@ export declare class ConnectionAccessor {
|
|
|
36
36
|
get proxy(): ConnectionProxy;
|
|
37
37
|
operation(key: string): ConnectionOperationAccessor;
|
|
38
38
|
dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
|
|
39
|
-
dataDirectory(key: string, parameters?: Record<string, any>): ConnectionDataDirectoryAccessor;
|
|
40
39
|
reconnect({ parameters, authOptionKey, connectorParameters, }?: {
|
|
41
40
|
parameters?: any;
|
|
42
41
|
authOptionKey?: string;
|
|
@@ -54,14 +53,6 @@ export declare class ConnectionOperationAccessor {
|
|
|
54
53
|
get(): Promise<OperationSpec>;
|
|
55
54
|
run(request?: OperationRunRequest): Promise<OperationRunResponse>;
|
|
56
55
|
}
|
|
57
|
-
export declare class ConnectionDataDirectoryAccessor {
|
|
58
|
-
client: IntegrationAppApiClient;
|
|
59
|
-
connectionAccessor: ConnectionAccessor;
|
|
60
|
-
key: string;
|
|
61
|
-
parameters: Record<string, any>;
|
|
62
|
-
constructor(client: IntegrationAppApiClient, connectionAccessor: ConnectionAccessor, key: string, parameters: Record<string, any>);
|
|
63
|
-
list(request?: DataDirectoryListRequest): Promise<DataDirectoryListResponse>;
|
|
64
|
-
}
|
|
65
56
|
export declare class ConnectionDataCollectionAccessor {
|
|
66
57
|
client: IntegrationAppApiClient;
|
|
67
58
|
connectionAccessor: ConnectionAccessor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectorUiSpec,
|
|
1
|
+
import { ConnectorUiSpec, ConnectorSpec } from '../connectors/types';
|
|
2
2
|
import { ErrorData } from '../errors';
|
|
3
3
|
import { Integration } from '../integrations/types';
|
|
4
4
|
import { User } from '../users';
|
|
@@ -31,8 +31,6 @@ export declare class Connection {
|
|
|
31
31
|
export interface ConnectionSpec extends ConnectorSpec {
|
|
32
32
|
}
|
|
33
33
|
export type ConnectionUiSpec = ConnectorUiSpec;
|
|
34
|
-
export type ConnectionUdmSpec = ConnectorDataUdmSpec;
|
|
35
|
-
export type ConnectionDataSpec = ConnectorDataSpec;
|
|
36
34
|
export declare class ConnectionSpec {
|
|
37
35
|
constructor(opts: ConnectionSpec);
|
|
38
36
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectorSpec } from './types';
|
|
2
2
|
import { DataSchema } from '../data-schema';
|
|
3
3
|
import { ConnectorMethodImplementation, ConnectorMethodImplementationBase, ConnectorMethodImplementationType } from './methods';
|
|
4
|
-
export declare const CONNECTOR_AUTH_TYPES: readonly ["integration-app-token", "oauth2", "oauth1", "client-credentials", "proxy"];
|
|
4
|
+
export declare const CONNECTOR_AUTH_TYPES: readonly ["integration-app-token", "membrane-token", "oauth2", "oauth1", "client-credentials", "proxy"];
|
|
5
5
|
export type ConnectorAuthType = (typeof CONNECTOR_AUTH_TYPES)[number];
|
|
6
6
|
export type ConnectorAuthSpec = {
|
|
7
7
|
title?: string;
|
|
@@ -58,9 +58,12 @@ export interface ConnectorAuthProxy extends ConnectorAuthHandlerBase {
|
|
|
58
58
|
export interface ConnectorAuthIntegrationAppToken extends ConnectorAuthHandlerBase {
|
|
59
59
|
type: 'integration-app-token';
|
|
60
60
|
}
|
|
61
|
-
export
|
|
61
|
+
export interface ConnectorAuthMembraneToken extends ConnectorAuthHandlerBase {
|
|
62
|
+
type: 'membrane-token';
|
|
63
|
+
}
|
|
64
|
+
export type ConnectorAuth = (ConnectorAuthOAuth2 | ConnectorAuthOAuth1 | ConnectorAuthClientCredentials | ConnectorAuthIntegrationAppToken | ConnectorAuthMembraneToken | ConnectorAuthProxy) & {
|
|
62
65
|
options?: {
|
|
63
|
-
[key: string]: ConnectorAuthOAuth2 | ConnectorAuthOAuth1 | ConnectorAuthClientCredentials | ConnectorAuthIntegrationAppToken | ConnectorAuthProxy;
|
|
66
|
+
[key: string]: ConnectorAuthOAuth2 | ConnectorAuthOAuth1 | ConnectorAuthClientCredentials | ConnectorAuthIntegrationAppToken | ConnectorAuthMembraneToken | ConnectorAuthProxy;
|
|
64
67
|
};
|
|
65
68
|
};
|
|
66
69
|
export interface ConnectorAuthOAuth2Config {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DataCollectionMixin } from './schemas';
|
|
2
2
|
import { DataSchema } from '../../data-schema';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ConnectorDataCollectionBase {
|
|
4
4
|
type: 'collection' | 'directory';
|
|
5
5
|
key: string;
|
|
6
6
|
name: string;
|
|
7
7
|
parametersSchema?: DataSchema;
|
|
8
|
-
extends?:
|
|
8
|
+
extends?: DataCollectionMixin[];
|
|
9
9
|
relatedOperationKeys?: string[];
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DataSchema } from '../../../../../data-schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ConnectorDataCollectionMethod } from '../../../methods';
|
|
3
3
|
import { ConnectorDataCollectionEventMethodType } from '../methods';
|
|
4
4
|
export interface ConnectorEventImplementationFields {
|
|
5
5
|
implementationType: 'connector-event';
|
|
6
6
|
stateSchema?: DataSchema;
|
|
7
|
-
methods: Record<keyof typeof ConnectorEventImplementationType.methods,
|
|
7
|
+
methods: Record<keyof typeof ConnectorEventImplementationType.methods, ConnectorDataCollectionMethod>;
|
|
8
8
|
}
|
|
9
9
|
export declare const ConnectorEventImplementationType: {
|
|
10
10
|
methods: {
|
package/dist/dts/connectors/data-locations/collections/events/implementation-types/custom-pull.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DataSchema } from '../../../../../data-schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ConnectorDataCollectionMethod } from '../../../methods';
|
|
3
3
|
import { ConnectorDataCollectionEventMethodType } from '../methods';
|
|
4
4
|
export interface CustomPullEventImplementationFields {
|
|
5
5
|
implementationType: 'custom-pull';
|
|
6
6
|
stateSchema?: DataSchema;
|
|
7
|
-
methods: Record<keyof typeof CustomPullEventImplementationType.methods,
|
|
7
|
+
methods: Record<keyof typeof CustomPullEventImplementationType.methods, ConnectorDataCollectionMethod>;
|
|
8
8
|
}
|
|
9
9
|
export declare const CustomPullEventImplementationType: {
|
|
10
10
|
methods: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DataRecord } from '../../../../../data-collections';
|
|
2
|
-
import {
|
|
2
|
+
import { ConnectorDataCollectionMethod } from '../../../methods';
|
|
3
3
|
import { ConnectorDataCollectionEventMethodType } from '../methods';
|
|
4
4
|
export interface PullLatestRecordsEventImplementationFields {
|
|
5
5
|
implementationType: 'pull-latest-records';
|
|
6
|
-
methods: Record<keyof typeof PullLatestRecordsEventImplementationType.methods,
|
|
6
|
+
methods: Record<keyof typeof PullLatestRecordsEventImplementationType.methods, ConnectorDataCollectionMethod>;
|
|
7
7
|
}
|
|
8
8
|
export interface PullLatestRecordsEventOutput {
|
|
9
9
|
records: DataRecord[];
|
package/dist/dts/connectors/data-locations/collections/events/implementation-types/webhook.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DataSchema } from '../../../../../data-schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ConnectorDataCollectionMethod } from '../../../methods';
|
|
3
3
|
import { ConnectorDataCollectionEventMethodType } from '../methods';
|
|
4
4
|
export interface WebhookEventImplementationFields {
|
|
5
5
|
implementationType: 'webhook';
|
|
6
6
|
querySchema?: DataSchema;
|
|
7
7
|
dataSchema?: DataSchema;
|
|
8
8
|
stateSchema?: DataSchema;
|
|
9
|
-
methods: Record<keyof typeof WebhookEventImplementationType.methods,
|
|
9
|
+
methods: Record<keyof typeof WebhookEventImplementationType.methods, ConnectorDataCollectionMethod>;
|
|
10
10
|
}
|
|
11
11
|
export declare const WebhookEventImplementationType: {
|
|
12
12
|
methods: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataSchema } from '../../../data-schema';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ConnectorDataCollectionBase } from '../base';
|
|
3
|
+
import { ConnectorDataCollectionMethod } from '../methods';
|
|
4
4
|
import { ConnectorDataCollectionEvent } from './events';
|
|
5
5
|
import { ConnectorDataCollectionMethodType } from './methods/base';
|
|
6
6
|
import { DataCollectionCreateConfigType } from './methods/create';
|
|
@@ -33,38 +33,38 @@ export declare const DataLocationTypeCollection: {
|
|
|
33
33
|
fieldsToApiMapping: ConnectorDataCollectionMethodType<unknown>;
|
|
34
34
|
fieldsToApiCode: ConnectorDataCollectionMethodType<unknown>;
|
|
35
35
|
};
|
|
36
|
-
export interface ConnectorDataCollection extends
|
|
36
|
+
export interface ConnectorDataCollection extends ConnectorDataCollectionBase {
|
|
37
37
|
type: 'collection';
|
|
38
38
|
fieldsSchema?: DataSchema;
|
|
39
39
|
isHidden?: boolean;
|
|
40
40
|
customFields?: boolean;
|
|
41
|
-
customFieldsSchema?:
|
|
42
|
-
spec?:
|
|
43
|
-
recordFromFields?:
|
|
44
|
-
fieldsFromApi?:
|
|
45
|
-
recordFromApi?:
|
|
46
|
-
recordFromApiCode?:
|
|
47
|
-
recordFromApiMapping?:
|
|
48
|
-
recordToApi?:
|
|
49
|
-
fieldsToApi?:
|
|
50
|
-
fieldsToApiCode?:
|
|
51
|
-
fieldsToApiMapping?:
|
|
41
|
+
customFieldsSchema?: ConnectorDataCollectionMethod;
|
|
42
|
+
spec?: ConnectorDataCollectionMethod;
|
|
43
|
+
recordFromFields?: ConnectorDataCollectionMethod;
|
|
44
|
+
fieldsFromApi?: ConnectorDataCollectionMethod;
|
|
45
|
+
recordFromApi?: ConnectorDataCollectionMethod;
|
|
46
|
+
recordFromApiCode?: ConnectorDataCollectionMethod;
|
|
47
|
+
recordFromApiMapping?: ConnectorDataCollectionMethod;
|
|
48
|
+
recordToApi?: ConnectorDataCollectionMethod;
|
|
49
|
+
fieldsToApi?: ConnectorDataCollectionMethod;
|
|
50
|
+
fieldsToApiCode?: ConnectorDataCollectionMethod;
|
|
51
|
+
fieldsToApiMapping?: ConnectorDataCollectionMethod;
|
|
52
52
|
methods?: {
|
|
53
|
-
list?:
|
|
54
|
-
findById?:
|
|
55
|
-
match?:
|
|
56
|
-
search?:
|
|
57
|
-
create?:
|
|
58
|
-
update?:
|
|
59
|
-
delete?:
|
|
60
|
-
find?:
|
|
53
|
+
list?: ConnectorDataCollectionMethod<DataCollectionListConfigType>;
|
|
54
|
+
findById?: ConnectorDataCollectionMethod;
|
|
55
|
+
match?: ConnectorDataCollectionMethod<DataCollectionMatchConfigType>;
|
|
56
|
+
search?: ConnectorDataCollectionMethod;
|
|
57
|
+
create?: ConnectorDataCollectionMethod<DataCollectionCreateConfigType>;
|
|
58
|
+
update?: ConnectorDataCollectionMethod<DataCollectionUpdateConfigType>;
|
|
59
|
+
delete?: ConnectorDataCollectionMethod;
|
|
60
|
+
find?: ConnectorDataCollectionMethod<{
|
|
61
61
|
queryFields?: string[];
|
|
62
62
|
}>;
|
|
63
63
|
};
|
|
64
64
|
events?: Partial<Record<'created' | 'updated' | 'deleted', ConnectorDataCollectionEvent>>;
|
|
65
65
|
udm?: Partial<Record<string, {
|
|
66
|
-
extract?:
|
|
67
|
-
parse?:
|
|
66
|
+
extract?: ConnectorDataCollectionMethod;
|
|
67
|
+
parse?: ConnectorDataCollectionMethod;
|
|
68
68
|
}>>;
|
|
69
69
|
}
|
|
70
70
|
export declare const ConnectorDataCollectionMethodKeys: Array<keyof typeof DataLocationTypeCollection.methods>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ConnectorDataCollection } from '..';
|
|
2
|
+
import { DataCollectionSpec } from '../..';
|
|
2
3
|
import { DataSchema } from '../../../../data-schema';
|
|
3
4
|
import { ConnectorMethodImplementationType } from '../../../methods';
|
|
4
5
|
import { ConnectorSpec } from '../../../types';
|
|
5
|
-
import {
|
|
6
|
-
import { DataCollectionSpec } from '../../types';
|
|
6
|
+
import { ConnectorDataCollectionMethod } from '../../methods';
|
|
7
7
|
export interface ConnectorDataCollectionMethodType<ConfigFields = unknown> {
|
|
8
8
|
name?: string;
|
|
9
9
|
description?: string;
|
|
@@ -15,7 +15,7 @@ export interface ConnectorDataCollectionMethodType<ConfigFields = unknown> {
|
|
|
15
15
|
isDeprecated?: boolean;
|
|
16
16
|
}
|
|
17
17
|
interface ConnectorDataCollectionMethodTypeArgs<ConfigFields = unknown> {
|
|
18
|
-
method?:
|
|
18
|
+
method?: ConnectorDataCollectionMethod<ConfigFields>;
|
|
19
19
|
collectionHandler?: ConnectorDataCollection;
|
|
20
20
|
collectionSpec?: DataCollectionSpec;
|
|
21
21
|
connectorSpec?: ConnectorSpec;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectorMethodImplementation, ConnectorMethodImplementationBase, ConnectorMethodImplementationType } from '../methods';
|
|
2
|
-
import { ApiRequestSpec } from './
|
|
3
|
-
export type
|
|
2
|
+
import { ApiRequestSpec } from './schemas';
|
|
3
|
+
export type ConnectorDataCollectionMethod<ConfigFields = unknown, ImplementationFields extends ConnectorMethodImplementation | ConnectorMethodImplementationBase = ConnectorMethodImplementationBase> = {
|
|
4
4
|
apiRequests?: ApiRequestSpec[];
|
|
5
5
|
} & ImplementationFields & ConfigFields;
|
|
6
6
|
export declare const DataLocationMethodImplementationTypes: ConnectorMethodImplementationType[];
|