@membranehq/sdk 0.1.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 +7 -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/data-schema/types.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 +7 -5
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.module.d.mts +7 -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
|
@@ -412,6 +412,7 @@ interface DataSchema {
|
|
|
412
412
|
examples?: any[];
|
|
413
413
|
anyOf?: DataSchema[];
|
|
414
414
|
isImplied?: boolean;
|
|
415
|
+
isSensitive?: boolean;
|
|
415
416
|
referenceCollectionPath?: string;
|
|
416
417
|
referenceCollectionUri?: string;
|
|
417
418
|
}
|
|
@@ -1685,6 +1686,7 @@ interface FindIntegrationsResponse extends PaginationResponse<Integration> {
|
|
|
1685
1686
|
interface OpenNewConnectionOptions extends OpenConfigurationOptions {
|
|
1686
1687
|
allowMultipleConnections?: boolean;
|
|
1687
1688
|
name?: string;
|
|
1689
|
+
connectorParameters?: any;
|
|
1688
1690
|
}
|
|
1689
1691
|
|
|
1690
1692
|
type CreateCustomerRequest = {
|
|
@@ -2027,10 +2029,11 @@ declare class IntegrationAccessor extends ElementAccessor<Integration, UpdateInt
|
|
|
2027
2029
|
setup(): Promise<Integration>;
|
|
2028
2030
|
getConnectorSpec(): Promise<ConnectionSpec>;
|
|
2029
2031
|
open({ onClose }?: OpenIntegrationUIIntegrationConfigurationOptions): Promise<void>;
|
|
2030
|
-
openNewConnection({ allowMultipleConnections, name }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
2031
|
-
connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
2032
|
+
openNewConnection({ allowMultipleConnections, name, connectorParameters, }?: OpenNewConnectionOptions): Promise<Connection>;
|
|
2033
|
+
connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
|
|
2032
2034
|
name?: string;
|
|
2033
2035
|
parameters?: any;
|
|
2036
|
+
connectorParameters?: any;
|
|
2034
2037
|
authOptionKey?: string;
|
|
2035
2038
|
allowMultipleConnections?: boolean;
|
|
2036
2039
|
} & ({
|
|
@@ -2535,7 +2538,6 @@ interface Flow extends WorkspaceElement {
|
|
|
2535
2538
|
revision: string;
|
|
2536
2539
|
customized?: boolean;
|
|
2537
2540
|
appliedToIntegrations?: AppliedToIntegrations<Flow>;
|
|
2538
|
-
isDeployed?: boolean;
|
|
2539
2541
|
}
|
|
2540
2542
|
interface FlowInstance extends WorkspaceElement {
|
|
2541
2543
|
userId: string;
|
|
@@ -2942,9 +2944,10 @@ declare class ConnectionAccessor {
|
|
|
2942
2944
|
operation(key: string): ConnectionOperationAccessor;
|
|
2943
2945
|
dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
|
|
2944
2946
|
dataDirectory(key: string, parameters?: Record<string, any>): ConnectionDataDirectoryAccessor;
|
|
2945
|
-
reconnect({ parameters, authOptionKey, }?: {
|
|
2947
|
+
reconnect({ parameters, authOptionKey, connectorParameters, }?: {
|
|
2946
2948
|
parameters?: any;
|
|
2947
2949
|
authOptionKey?: string;
|
|
2950
|
+
connectorParameters?: any;
|
|
2948
2951
|
}): Promise<Connection | undefined>;
|
|
2949
2952
|
openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
|
|
2950
2953
|
refreshCredentials(): Promise<void>;
|
|
@@ -3087,7 +3090,6 @@ interface Action extends ElementTemplateFields {
|
|
|
3087
3090
|
outputSchema?: DataSchema;
|
|
3088
3091
|
appliedToIntegrations?: AppliedToIntegrations<Action>;
|
|
3089
3092
|
dependencies?: WorkspaceElementDependency[];
|
|
3090
|
-
isDeployed?: boolean;
|
|
3091
3093
|
}
|
|
3092
3094
|
interface ActionInstance extends ElementInstanceFields {
|
|
3093
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,
|