@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
package/dist/index.module.d.mts
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.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,
|