@useparagon/connect 1.0.2 → 1.0.3-experimental.3
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/src/ConnectSDK.d.ts +39 -6
- package/dist/src/entities/integration.interface.d.ts +3 -0
- package/dist/src/helpers/index.d.ts +8 -0
- package/dist/src/helpers/oauth.d.ts +0 -14
- package/dist/src/index.js +257 -202
- package/dist/src/types/action.d.ts +0 -9
- package/dist/src/types/connect.d.ts +17 -8
- package/dist/src/types/index.d.ts +0 -1
- package/dist/src/types/sdk.d.ts +17 -3
- package/dist/src/utils/http.d.ts +26 -0
- package/package.json +16 -6
- package/changelog.md +0 -4
- package/dist/src/types/oauth.d.ts +0 -3
package/dist/src/ConnectSDK.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { OauthCallbackResponse } from './entities/credential.interface';
|
|
|
2
2
|
import { IIntegrationMetadata } from './entities/integration.interface';
|
|
3
3
|
import { PersonaMeta } from './entities/persona.interface';
|
|
4
4
|
import SDKEventEmitter from './SDKEventEmitter';
|
|
5
|
-
import { AuthenticateOptions, AuthenticatedConnectUser, Props as ConnectModalProps, ConnectParams, ConnectUser, EventInfo, IConnectSDK, InstallOptions, TriggerWorkflowRequest } from './types';
|
|
5
|
+
import { AuthenticateOptions, AuthenticatedConnectUser, Props as ConnectModalProps, ConnectParams, ConnectUser, DisableWorkflowOptions, EventInfo, IConnectSDK, InstallOptions, TriggerWorkflowRequest, UninstallOptions } from './types';
|
|
6
6
|
export declare const PARAGON_OVERFLOW_EMPTY_VALUE = "PARAGON_OVERFLOW_EMPTY_VALUE";
|
|
7
7
|
export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
8
8
|
root: HTMLIFrameElement | undefined;
|
|
@@ -34,7 +34,6 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
34
34
|
* so that we will be able to know whether style is added in body or not
|
|
35
35
|
*/
|
|
36
36
|
private originalBodyOverflow;
|
|
37
|
-
private configs;
|
|
38
37
|
constructor();
|
|
39
38
|
/**
|
|
40
39
|
* post message handler
|
|
@@ -43,7 +42,24 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
43
42
|
private eventMessageHandler;
|
|
44
43
|
private functionInvocationHandler;
|
|
45
44
|
private createReactRoot;
|
|
45
|
+
/**
|
|
46
|
+
* checks
|
|
47
|
+
* - if integartion name is valid
|
|
48
|
+
* - if integration is setup in project
|
|
49
|
+
* - if integration is active in project
|
|
50
|
+
* throws error if any of these is not met
|
|
51
|
+
* @param action
|
|
52
|
+
* @param validateIsEnabled boolean
|
|
53
|
+
*/
|
|
46
54
|
private validateAction;
|
|
55
|
+
/**
|
|
56
|
+
* checks if the integration is installed.
|
|
57
|
+
* Assumes that the user is authenticated
|
|
58
|
+
* @param action
|
|
59
|
+
* @param userState
|
|
60
|
+
* @returns boolean value
|
|
61
|
+
*/
|
|
62
|
+
private isAlreadyInstalled;
|
|
47
63
|
private bootstrapSDKState;
|
|
48
64
|
setModalState(statePartial: Partial<ConnectModalProps>): void;
|
|
49
65
|
/**
|
|
@@ -114,6 +130,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
114
130
|
* @returns api request response
|
|
115
131
|
*/
|
|
116
132
|
request<TResponse>(action: string, path: string, init: {
|
|
133
|
+
selectedCredentialId?: string;
|
|
117
134
|
method: RequestInit['method'];
|
|
118
135
|
body: RequestInit['body'] | object;
|
|
119
136
|
headers: RequestInit['headers'];
|
|
@@ -147,7 +164,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
147
164
|
* @param workflowId
|
|
148
165
|
* @param payload
|
|
149
166
|
*/
|
|
150
|
-
workflow(workflowId: string, { body, query, headers }?: TriggerWorkflowRequest): Promise<object | undefined>;
|
|
167
|
+
workflow(workflowId: string, { selectedCredentialId, body, query, headers }?: TriggerWorkflowRequest): Promise<object | undefined>;
|
|
151
168
|
/**
|
|
152
169
|
* for programmatically installing an integration
|
|
153
170
|
*/
|
|
@@ -156,8 +173,9 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
156
173
|
* gates headless feature to pro and enterprise users
|
|
157
174
|
*/
|
|
158
175
|
ensureHeadlessIsSupported(): void;
|
|
159
|
-
uninstallIntegration(action: string): Promise<void>;
|
|
160
|
-
disableWorkflow(workflowId: string): Promise<void>;
|
|
176
|
+
uninstallIntegration(action: string, options?: UninstallOptions): Promise<void>;
|
|
177
|
+
disableWorkflow(workflowId: string, options?: DisableWorkflowOptions): Promise<void>;
|
|
178
|
+
private getIntegrationForWorkflow;
|
|
161
179
|
private updateLocalState;
|
|
162
180
|
/**
|
|
163
181
|
* also returns false if unable to find workflow in configured workflow property of any integration
|
|
@@ -178,7 +196,6 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
178
196
|
*/
|
|
179
197
|
private updateIntegrations;
|
|
180
198
|
setUserMetadata(meta: PersonaMeta): Promise<AuthenticatedConnectUser>;
|
|
181
|
-
getIntegrationConfigs(actionNames: string[]): Promise<void>;
|
|
182
199
|
/**
|
|
183
200
|
* @param {host: string;} domain
|
|
184
201
|
* sets the domain for making http service request
|
|
@@ -187,4 +204,20 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
187
204
|
configureGlobal(param: {
|
|
188
205
|
host: string;
|
|
189
206
|
}): void;
|
|
207
|
+
/**
|
|
208
|
+
* some integration required flow in which user recieve authorization code
|
|
209
|
+
* from marketplace oauth flow , so needed this method see PARA-8385
|
|
210
|
+
*/
|
|
211
|
+
completeInstall(action: string, options: {
|
|
212
|
+
authorizationCode: string;
|
|
213
|
+
showPortalAfterInstall?: boolean;
|
|
214
|
+
redirectUrl?: string;
|
|
215
|
+
integrationOptions?: Record<string, unknown>;
|
|
216
|
+
}): Promise<void>;
|
|
217
|
+
/**
|
|
218
|
+
* update credential data in integration
|
|
219
|
+
* @param newCredential
|
|
220
|
+
* @param integration
|
|
221
|
+
*/
|
|
222
|
+
private updateCredentialData;
|
|
190
223
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKIntegration } from '../types/connect';
|
|
1
2
|
import { DataType, KeyedSource } from '../types/resolvers';
|
|
2
3
|
import { NonNullUndefinedField } from '../types/sdk';
|
|
3
4
|
/**
|
|
@@ -13,3 +14,10 @@ export declare function parseKeyedSource(param: KeyedSource<DataType.ANY>[]): Re
|
|
|
13
14
|
* @returns
|
|
14
15
|
*/
|
|
15
16
|
export declare function stripUndefinedAndNull<T extends object>(obj: T): NonNullUndefinedField<T>;
|
|
17
|
+
/**
|
|
18
|
+
* provides the action state object after a credential is deleted.
|
|
19
|
+
* @param `deletedCredentialId` (string): The ID of the credential that was deleted.
|
|
20
|
+
* @param `deletedActionState` (`SDKIntegration`): The user state for the action whose credential was deleted
|
|
21
|
+
* @returns an object of type `SDKIntegration`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getActionStateForCredentialDelete: (deletedCredentialId: string, deletedActionState: SDKIntegration) => SDKIntegration;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { AuthenticationScheme } from '../entities/credential.interface';
|
|
2
1
|
import { IConnectIntegrationWithCredentialInfo } from '../entities/integration.interface';
|
|
3
|
-
import { IntegrationConnectInput } from '../types/action';
|
|
4
2
|
import { DataType, KeyedSource } from '../types/resolvers';
|
|
5
3
|
import { IConnectUserContext } from './ConnectUserContext';
|
|
6
|
-
/**
|
|
7
|
-
* this check if inputs needs to be shown before oauth
|
|
8
|
-
* @param integration
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export declare const shouldShowPreAuthInputs: ({ integration, authScheme, endUserSuppliedValues, isAccountTypeSupported, }: {
|
|
12
|
-
integration: IConnectIntegrationWithCredentialInfo;
|
|
13
|
-
provider?: string | undefined;
|
|
14
|
-
authScheme?: AuthenticationScheme | undefined;
|
|
15
|
-
endUserSuppliedValues?: IntegrationConnectInput[] | undefined;
|
|
16
|
-
isAccountTypeSupported: boolean;
|
|
17
|
-
}) => boolean;
|
|
18
4
|
/**
|
|
19
5
|
* start oauth flow with new popup
|
|
20
6
|
* @param param0
|