@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
package/dist/index.module.d.mts
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.module.mjs
CHANGED
|
@@ -9250,7 +9250,7 @@ var ConnectionType;
|
|
|
9250
9250
|
ConnectionType["REDIRECT"] = "redirect";
|
|
9251
9251
|
})(ConnectionType || (ConnectionType = {}));
|
|
9252
9252
|
async function createOrUpdateConnection(options) {
|
|
9253
|
-
const { connectionId, integrationId, name, parameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, } = options !== null && options !== void 0 ? options : {};
|
|
9253
|
+
const { connectionId, integrationId, name, parameters, connectorParameters, allowMultipleConnections, authOptionKey, connectorSpec, apiUri, token, redirectUri, } = options !== null && options !== void 0 ? options : {};
|
|
9254
9254
|
const connectionType = getConnectionType({
|
|
9255
9255
|
connectorSpec,
|
|
9256
9256
|
authOptionKey,
|
|
@@ -9264,6 +9264,7 @@ async function createOrUpdateConnection(options) {
|
|
|
9264
9264
|
const payload = {
|
|
9265
9265
|
token,
|
|
9266
9266
|
connectionParameters: parameters,
|
|
9267
|
+
connectorParameters,
|
|
9267
9268
|
name,
|
|
9268
9269
|
authOptionKey,
|
|
9269
9270
|
allowMultipleConnections,
|
|
@@ -10317,7 +10318,7 @@ class ConnectionAccessor {
|
|
|
10317
10318
|
dataDirectory(key, parameters) {
|
|
10318
10319
|
return new ConnectionDataDirectoryAccessor(this.client, this, key, parameters);
|
|
10319
10320
|
}
|
|
10320
|
-
async reconnect({ parameters, authOptionKey, } = {}) {
|
|
10321
|
+
async reconnect({ parameters, authOptionKey, connectorParameters, } = {}) {
|
|
10321
10322
|
const connection = await this.get();
|
|
10322
10323
|
const connectorSpec = await this.client.get(`/integrations/${connection.integrationId}/connector-spec`);
|
|
10323
10324
|
return createOrUpdateConnection({
|
|
@@ -10325,6 +10326,7 @@ class ConnectionAccessor {
|
|
|
10325
10326
|
connectorSpec,
|
|
10326
10327
|
parameters,
|
|
10327
10328
|
authOptionKey,
|
|
10329
|
+
connectorParameters,
|
|
10328
10330
|
apiUri: this.client.apiUri,
|
|
10329
10331
|
token: await this.client.getToken(),
|
|
10330
10332
|
});
|
|
@@ -10920,10 +10922,11 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
10920
10922
|
onClose,
|
|
10921
10923
|
});
|
|
10922
10924
|
}
|
|
10923
|
-
async openNewConnection({ allowMultipleConnections, name } = {}) {
|
|
10925
|
+
async openNewConnection({ allowMultipleConnections, name, connectorParameters, } = {}) {
|
|
10924
10926
|
const uri = await this.client.getEmbedUri(`integrations/${this.integrationSelector}/connect`, {
|
|
10925
10927
|
allowMultipleConnections: allowMultipleConnections ? '1' : '',
|
|
10926
10928
|
name,
|
|
10929
|
+
connectorParameters: connectorParameters ? JSON.stringify(connectorParameters) : undefined,
|
|
10927
10930
|
});
|
|
10928
10931
|
return new Promise((resolve) => {
|
|
10929
10932
|
return openIframe(uri, {
|
|
@@ -10932,7 +10935,7 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
10932
10935
|
});
|
|
10933
10936
|
});
|
|
10934
10937
|
}
|
|
10935
|
-
async connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
|
|
10938
|
+
async connect({ name, parameters, connectorParameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, } = {}) {
|
|
10936
10939
|
const integration = await this.get();
|
|
10937
10940
|
const connectorSpec = await this.getConnectorSpec();
|
|
10938
10941
|
return createOrUpdateConnection({
|
|
@@ -10940,6 +10943,7 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
10940
10943
|
connectorSpec,
|
|
10941
10944
|
name,
|
|
10942
10945
|
parameters,
|
|
10946
|
+
connectorParameters,
|
|
10943
10947
|
authOptionKey,
|
|
10944
10948
|
allowMultipleConnections,
|
|
10945
10949
|
apiUri: this.client.apiUri,
|