@membranehq/sdk 0.2.0 → 0.2.1
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/dist/bundle.d.ts +6 -5
- package/dist/bundle.js +17 -50
- package/dist/bundle.js.map +1 -1
- package/dist/dts/actions/types.d.ts +0 -1
- package/dist/dts/connections/accessors.d.ts +2 -1
- package/dist/dts/connections/create-or-update-connection.d.ts +1 -0
- package/dist/dts/flows/types.d.ts +0 -1
- package/dist/dts/integrations/accessors.d.ts +7 -6
- package/dist/dts/integrations/api.d.ts +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.module.d.mts +6 -5
- package/dist/index.module.mjs +8 -4
- package/dist/index.module.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -27,7 +27,6 @@ export interface Action extends ElementTemplateFields {
|
|
|
27
27
|
outputSchema?: DataSchema;
|
|
28
28
|
appliedToIntegrations?: AppliedToIntegrations<Action>;
|
|
29
29
|
dependencies?: WorkspaceElementDependency[];
|
|
30
|
-
isDeployed?: boolean;
|
|
31
30
|
}
|
|
32
31
|
export interface ActionInstance extends ElementInstanceFields {
|
|
33
32
|
type: ActionType;
|
|
@@ -37,9 +37,10 @@ export declare class ConnectionAccessor {
|
|
|
37
37
|
operation(key: string): ConnectionOperationAccessor;
|
|
38
38
|
dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
|
|
39
39
|
dataDirectory(key: string, parameters?: Record<string, any>): ConnectionDataDirectoryAccessor;
|
|
40
|
-
reconnect({ parameters, authOptionKey, }?: {
|
|
40
|
+
reconnect({ parameters, authOptionKey, connectorParameters, }?: {
|
|
41
41
|
parameters?: any;
|
|
42
42
|
authOptionKey?: string;
|
|
43
|
+
connectorParameters?: any;
|
|
43
44
|
}): Promise<Connection | undefined>;
|
|
44
45
|
openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
|
|
45
46
|
refreshCredentials(): Promise<void>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ElementAccessor, ElementListAccessor } from '../accessors';
|
|
2
|
+
import { IntegrationLevelActionAccessor, IntegrationLevelActionsListAccessor } from '../actions';
|
|
2
3
|
import { IntegrationAppApiClient } from '../api-client';
|
|
3
4
|
import { Connection, ConnectionSpec } from '../connections';
|
|
4
5
|
import { DataLocationListItem, DataLocationSpec, OperationListItem, OperationSpec } from '../connectors';
|
|
5
|
-
import { OpenConfigurationOptions } from '../iframe';
|
|
6
|
-
import { CreateIntegrationRequest, UpdateIntegrationRequest } from './api';
|
|
7
|
-
import { IntegrationLevelActionAccessor, IntegrationLevelActionsListAccessor } from '../actions';
|
|
8
6
|
import { IntegrationLevelDataSourceAccessor, IntegrationLevelDataSourcesListAccessor } from '../data-sources';
|
|
9
7
|
import { IntegrationLevelFieldMappingAccessor, IntegrationLevelFieldMappingsListAccessor } from '../field-mappings';
|
|
10
8
|
import { IntegrationLevelFlowAccessor, IntegrationLevelFlowsListAccessor } from '../flows';
|
|
11
|
-
import {
|
|
9
|
+
import { OpenConfigurationOptions } from '../iframe';
|
|
10
|
+
import { CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, OpenNewConnectionOptions } from './api';
|
|
11
|
+
import { Integration } from './types';
|
|
12
12
|
interface OpenIntegrationUIIntegrationConfigurationOptions extends OpenConfigurationOptions {
|
|
13
13
|
}
|
|
14
14
|
export declare class IntegrationsAccessor extends ElementListAccessor<Integration, FindIntegrationsQuery, CreateIntegrationRequest> {
|
|
@@ -30,10 +30,11 @@ export declare class IntegrationAccessor extends ElementAccessor<Integration, Up
|
|
|
30
30
|
setup(): Promise<Integration>;
|
|
31
31
|
getConnectorSpec(): Promise<ConnectionSpec>;
|
|
32
32
|
open({ onClose }?: OpenIntegrationUIIntegrationConfigurationOptions): Promise<void>;
|
|
33
|
-
openNewConnection({ allowMultipleConnections, name }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
34
|
-
connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
33
|
+
openNewConnection({ allowMultipleConnections, name, connectorParameters, }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
34
|
+
connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
35
35
|
name?: string;
|
|
36
36
|
parameters?: any;
|
|
37
|
+
connectorParameters?: any;
|
|
37
38
|
authOptionKey?: string;
|
|
38
39
|
allowMultipleConnections?: boolean;
|
|
39
40
|
} & ({
|
package/dist/index.d.ts
CHANGED
|
@@ -1686,6 +1686,7 @@ interface FindIntegrationsResponse extends PaginationResponse<Integration> {
|
|
|
1686
1686
|
interface OpenNewConnectionOptions extends OpenConfigurationOptions {
|
|
1687
1687
|
allowMultipleConnections?: boolean;
|
|
1688
1688
|
name?: string;
|
|
1689
|
+
connectorParameters?: any;
|
|
1689
1690
|
}
|
|
1690
1691
|
|
|
1691
1692
|
type CreateCustomerRequest = {
|
|
@@ -2028,10 +2029,11 @@ declare class IntegrationAccessor extends ElementAccessor<Integration, UpdateInt
|
|
|
2028
2029
|
setup(): Promise<Integration>;
|
|
2029
2030
|
getConnectorSpec(): Promise<ConnectionSpec>;
|
|
2030
2031
|
open({ onClose }?: OpenIntegrationUIIntegrationConfigurationOptions): Promise<void>;
|
|
2031
|
-
openNewConnection({ allowMultipleConnections, name }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
2032
|
-
connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
2032
|
+
openNewConnection({ allowMultipleConnections, name, connectorParameters, }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
2033
|
+
connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
2033
2034
|
name?: string;
|
|
2034
2035
|
parameters?: any;
|
|
2036
|
+
connectorParameters?: any;
|
|
2035
2037
|
authOptionKey?: string;
|
|
2036
2038
|
allowMultipleConnections?: boolean;
|
|
2037
2039
|
} & ({
|
|
@@ -2536,7 +2538,6 @@ interface Flow extends WorkspaceElement {
|
|
|
2536
2538
|
revision: string;
|
|
2537
2539
|
customized?: boolean;
|
|
2538
2540
|
appliedToIntegrations?: AppliedToIntegrations<Flow>;
|
|
2539
|
-
isDeployed?: boolean;
|
|
2540
2541
|
}
|
|
2541
2542
|
interface FlowInstance extends WorkspaceElement {
|
|
2542
2543
|
userId: string;
|
|
@@ -2943,9 +2944,10 @@ declare class ConnectionAccessor {
|
|
|
2943
2944
|
operation(key: string): ConnectionOperationAccessor;
|
|
2944
2945
|
dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
|
|
2945
2946
|
dataDirectory(key: string, parameters?: Record<string, any>): ConnectionDataDirectoryAccessor;
|
|
2946
|
-
reconnect({ parameters, authOptionKey, }?: {
|
|
2947
|
+
reconnect({ parameters, authOptionKey, connectorParameters, }?: {
|
|
2947
2948
|
parameters?: any;
|
|
2948
2949
|
authOptionKey?: string;
|
|
2950
|
+
connectorParameters?: any;
|
|
2949
2951
|
}): Promise<Connection | undefined>;
|
|
2950
2952
|
openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
|
|
2951
2953
|
refreshCredentials(): Promise<void>;
|
|
@@ -3088,7 +3090,6 @@ interface Action extends ElementTemplateFields {
|
|
|
3088
3090
|
outputSchema?: DataSchema;
|
|
3089
3091
|
appliedToIntegrations?: AppliedToIntegrations<Action>;
|
|
3090
3092
|
dependencies?: WorkspaceElementDependency[];
|
|
3091
|
-
isDeployed?: boolean;
|
|
3092
3093
|
}
|
|
3093
3094
|
interface ActionInstance extends ElementInstanceFields {
|
|
3094
3095
|
type: ActionType;
|
package/dist/index.js
CHANGED
|
@@ -9252,7 +9252,7 @@ var ConnectionType;
|
|
|
9252
9252
|
ConnectionType["REDIRECT"] = "redirect";
|
|
9253
9253
|
})(ConnectionType || (ConnectionType = {}));
|
|
9254
9254
|
async function createOrUpdateConnection(options) {
|
|
9255
|
-
const { connectionId, integrationId, name, parameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, } = options !== null && options !== void 0 ? options : {};
|
|
9255
|
+
const { connectionId, integrationId, name, parameters, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, } = options !== null && options !== void 0 ? options : {};
|
|
9256
9256
|
const connectionType = getConnectionType({
|
|
9257
9257
|
connectorSpec,
|
|
9258
9258
|
authOptionKey,
|
|
@@ -9266,6 +9266,7 @@ async function createOrUpdateConnection(options) {
|
|
|
9266
9266
|
const payload = {
|
|
9267
9267
|
token,
|
|
9268
9268
|
connectionParameters: parameters,
|
|
9269
|
+
connectorParameters,
|
|
9269
9270
|
name,
|
|
9270
9271
|
authOptionKey,
|
|
9271
9272
|
allowMultipleConnections,
|
|
@@ -10319,7 +10320,7 @@ class ConnectionAccessor {
|
|
|
10319
10320
|
dataDirectory(key, parameters) {
|
|
10320
10321
|
return new ConnectionDataDirectoryAccessor(this.client, this, key, parameters);
|
|
10321
10322
|
}
|
|
10322
|
-
async reconnect({ parameters, authOptionKey, } = {}) {
|
|
10323
|
+
async reconnect({ parameters, authOptionKey, connectorParameters, } = {}) {
|
|
10323
10324
|
const connection = await this.get();
|
|
10324
10325
|
const connectorSpec = await this.client.get(`/integrations/${connection.integrationId}/connector-spec`);
|
|
10325
10326
|
return createOrUpdateConnection({
|
|
@@ -10327,6 +10328,7 @@ class ConnectionAccessor {
|
|
|
10327
10328
|
connectorSpec,
|
|
10328
10329
|
parameters,
|
|
10329
10330
|
authOptionKey,
|
|
10331
|
+
connectorParameters,
|
|
10330
10332
|
apiUri: this.client.apiUri,
|
|
10331
10333
|
token: await this.client.getToken(),
|
|
10332
10334
|
});
|
|
@@ -10922,10 +10924,11 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
10922
10924
|
onClose,
|
|
10923
10925
|
});
|
|
10924
10926
|
}
|
|
10925
|
-
async openNewConnection({ allowMultipleConnections, name } = {}) {
|
|
10927
|
+
async openNewConnection({ allowMultipleConnections, name, connectorParameters, } = {}) {
|
|
10926
10928
|
const uri = await this.client.getEmbedUri(`integrations/${this.integrationSelector}/connect`, {
|
|
10927
10929
|
allowMultipleConnections: allowMultipleConnections ? '1' : '',
|
|
10928
10930
|
name,
|
|
10931
|
+
connectorParameters: connectorParameters ? JSON.stringify(connectorParameters) : undefined,
|
|
10929
10932
|
});
|
|
10930
10933
|
return new Promise((resolve) => {
|
|
10931
10934
|
return openIframe(uri, {
|
|
@@ -10934,7 +10937,7 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
10934
10937
|
});
|
|
10935
10938
|
});
|
|
10936
10939
|
}
|
|
10937
|
-
async connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
|
|
10940
|
+
async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
|
|
10938
10941
|
const integration = await this.get();
|
|
10939
10942
|
const connectorSpec = await this.getConnectorSpec();
|
|
10940
10943
|
return createOrUpdateConnection({
|
|
@@ -10942,6 +10945,7 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
10942
10945
|
connectorSpec,
|
|
10943
10946
|
name,
|
|
10944
10947
|
parameters,
|
|
10948
|
+
connectorParameters,
|
|
10945
10949
|
authOptionKey,
|
|
10946
10950
|
allowMultipleConnections,
|
|
10947
10951
|
apiUri: this.client.apiUri,
|