@useparagon/connect 4.0.0-experimental.1 → 4.0.0-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/ConnectInstallFlowClient.d.ts +21 -0
- package/dist/src/ConnectSDK.d.ts +7 -44
- package/dist/src/ConnectSDK.js +1 -1
- package/dist/src/helpers/oauth.d.ts +8 -10
- package/dist/src/index.js +1 -1
- package/dist/src/install-flow/InstallFlow.d.ts +52 -0
- package/dist/src/install-flow/InstallFlowClient.d.ts +83 -0
- package/dist/src/install-flow/derivation.d.ts +33 -0
- package/dist/src/install-flow/index.d.ts +6 -0
- package/dist/src/install-flow/index.js +2 -0
- package/dist/src/install-flow/index.js.LICENSE.txt +44 -0
- package/dist/src/install-flow/oauth.d.ts +68 -0
- package/dist/src/install-flow/salesforceInstruction.d.ts +17 -0
- package/dist/src/install-flow/viewCondition.d.ts +27 -0
- package/dist/src/types/action.d.ts +17 -0
- package/dist/src/types/connect.d.ts +10 -5
- package/dist/src/types/errors.d.ts +3 -0
- package/dist/src/types/sdk.d.ts +2 -1
- package/package.json +3 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type ConnectSDK from './ConnectSDK';
|
|
2
|
+
import { CompleteSetupParams, InstallFlowClient, InstallFlowIntegrationConfig, OAuthHandlers, OAuthStartParams, SaveCredentialParams, UninstallParams } from './install-flow/InstallFlowClient';
|
|
3
|
+
/**
|
|
4
|
+
* SDK-side InstallFlowClient: delegates every operation to the host
|
|
5
|
+
* ConnectSDK's existing methods, so the SDK's install flow keeps its exact
|
|
6
|
+
* historical behavior while InstallFlow itself stays consumer-agnostic.
|
|
7
|
+
*
|
|
8
|
+
* The headless-mode gate lives in getIntegrationConfig — the first read
|
|
9
|
+
* InstallFlow performs at start() — so a non-headless SDK surfaces
|
|
10
|
+
* HeadlessModeNotEnabledError through the flow's normal onError path.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ConnectInstallFlowClient implements InstallFlowClient {
|
|
13
|
+
private readonly sdk;
|
|
14
|
+
constructor(sdk: ConnectSDK);
|
|
15
|
+
getIntegrationConfig(name: string): InstallFlowIntegrationConfig;
|
|
16
|
+
getAssetUrl(name: string): string;
|
|
17
|
+
startOAuth(params: OAuthStartParams, handlers: OAuthHandlers): void;
|
|
18
|
+
saveCredential({ integrationId, payload, installOptions }: SaveCredentialParams): Promise<import("./types").IntegrationInstallEvent | undefined>;
|
|
19
|
+
completeSetup({ integrationId, credentialId, payload, installOptions }: CompleteSetupParams): Promise<import("./types").IntegrationInstallEvent | undefined>;
|
|
20
|
+
uninstall({ integrationName, credentialId }: UninstallParams): Promise<void>;
|
|
21
|
+
}
|
package/dist/src/ConnectSDK.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ import { OauthCallbackResponse } from './entities/credential.interface';
|
|
|
4
4
|
import { IConnectIntegrationWithCredentialInfo, IntegrationMetadata } from './entities/integration.interface';
|
|
5
5
|
import { PersonaMeta } from './entities/persona.interface';
|
|
6
6
|
import { ExternalFilePicker } from './file-picker/types';
|
|
7
|
+
import { InstallFlow } from './install-flow/InstallFlow';
|
|
7
8
|
import SDKEventEmitter from './SDKEventEmitter';
|
|
8
9
|
import { ConnectSdkEnvironments } from './server.types';
|
|
9
|
-
import { AccountType, AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, ConditionalSource, ConnectInputValue, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, CustomDropdownField, DataType, DeleteConfigurationOptions, DisableWorkflowOptions, DynamicDataSource, DynamicDefaultInput, DynamicFieldMappingLoaderType, DynamicFieldMappingOptionsResult, EnumInputValue, EnumSection, EventInfo, GetIntegrationAccountOptions, GetTriggerTypesResponse, IConnectSDK, InputSources,
|
|
10
|
+
import { AccountType, AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, ConditionalSource, ConnectInputValue, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, CustomDropdownField, DataType, DeleteConfigurationOptions, DisableWorkflowOptions, DynamicDataSource, DynamicDefaultInput, DynamicFieldMappingLoaderType, DynamicFieldMappingOptionsResult, EnumInputValue, EnumSection, EventInfo, GetIntegrationAccountOptions, GetTriggerTypesResponse, IConnectSDK, InputSources, InstallIntegrationOptions, InstallOptions, IntegrationConfig, IntegrationInstallEvent, IntentInputKeyConfig, KeyedSource, LoadCustomDropdownOptionsResult, ProxyRequestOptions, SerializedConnectInput, SetDataSourcesConfig, SingleSource, TriggerWorkflowRequest, UninstallOptions, UpdateConfigurationOptions, UpdateWorkflowStateResponse, UserProvidedIntegrationConfig } from './types';
|
|
10
11
|
export declare const PARAGON_OVERFLOW_EMPTY_VALUE = "PARAGON_OVERFLOW_EMPTY_VALUE";
|
|
11
12
|
export { ExternalFilePicker };
|
|
13
|
+
export { InstallFlow };
|
|
12
14
|
export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
13
15
|
private sdkVersion;
|
|
14
16
|
root: HTMLIFrameElement | undefined;
|
|
@@ -176,8 +178,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
176
178
|
* see PARA-1505
|
|
177
179
|
*/
|
|
178
180
|
private getAccountName;
|
|
179
|
-
private
|
|
180
|
-
private hasAccountType;
|
|
181
|
+
private validateAccountTypeNotUsedWithApplicationType;
|
|
181
182
|
private validateAccountType;
|
|
182
183
|
/**
|
|
183
184
|
* Set dynamic field mapping loaders for the given action
|
|
@@ -370,6 +371,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
370
371
|
* @returns
|
|
371
372
|
*/
|
|
372
373
|
getIntegrationConfig(integration: string): IntegrationConfig;
|
|
374
|
+
private rejectAmbiguousCredential;
|
|
373
375
|
private getCredentialPair;
|
|
374
376
|
private updateConfig;
|
|
375
377
|
/**
|
|
@@ -454,8 +456,8 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
454
456
|
*/
|
|
455
457
|
getSourcesForActionInput(input: IntentInputKeyConfig): SingleSource | ConditionalSource | null;
|
|
456
458
|
getAccountTypeOptions(integrationName: string): AccountType[];
|
|
457
|
-
getPreOptions(integrationName: string, accountTypeId?: string): IntegrationConnectInput[];
|
|
458
|
-
getPostOptions(integrationName: string): IntegrationConnectInput[];
|
|
459
|
+
getPreOptions(integrationName: string, accountTypeId?: string): import("./types").IntegrationConnectInput[];
|
|
460
|
+
getPostOptions(integrationName: string): import("./types").IntegrationConnectInput[];
|
|
459
461
|
/**
|
|
460
462
|
* fetch dynamic field mapping options (object types or integration fields)
|
|
461
463
|
*/
|
|
@@ -465,42 +467,3 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
|
|
|
465
467
|
search?: string;
|
|
466
468
|
}): Promise<DynamicFieldMappingOptionsResult>;
|
|
467
469
|
}
|
|
468
|
-
export declare class InstallFlow {
|
|
469
|
-
private readonly paragon;
|
|
470
|
-
private startOptions;
|
|
471
|
-
private integrationName;
|
|
472
|
-
private accountTypeValue;
|
|
473
|
-
private preOptionsValue;
|
|
474
|
-
private postOptionsValue;
|
|
475
|
-
private credentialId;
|
|
476
|
-
private hasFinishedInstruction;
|
|
477
|
-
private oauthAbortController;
|
|
478
|
-
constructor(paragon: ConnectSDK);
|
|
479
|
-
start(integrationName: string, startOptions?: StartOptions): void;
|
|
480
|
-
cancel(): Promise<void>;
|
|
481
|
-
private getInstallOptions;
|
|
482
|
-
private asyncStart;
|
|
483
|
-
private handleError;
|
|
484
|
-
private handleNext;
|
|
485
|
-
private handleComplete;
|
|
486
|
-
private getScheme;
|
|
487
|
-
private getIntegrationName;
|
|
488
|
-
private getSelectedAccountTypeOption;
|
|
489
|
-
private requiresAccountType;
|
|
490
|
-
private getIntegrationInstructionMetadata;
|
|
491
|
-
private getSalesforceInstructionMetadata;
|
|
492
|
-
private requiresInstruction;
|
|
493
|
-
private requiresPreOptions;
|
|
494
|
-
private requiresPostOptions;
|
|
495
|
-
private requiresOAuth;
|
|
496
|
-
/** Starts an OAuth authentication flow through a window Pop-up */
|
|
497
|
-
private handleOAuth;
|
|
498
|
-
setAccountType(accountType: string): Promise<void>;
|
|
499
|
-
setPreOptions(options: Record<string, ConnectInputValue>): Promise<void>;
|
|
500
|
-
setPostOptions(options: Record<string, ConnectInputValue>): Promise<void>;
|
|
501
|
-
private setHasFinishedInstruction;
|
|
502
|
-
getAccountTypeValue(): string | null;
|
|
503
|
-
getPreOptionsValue(): Record<string, ConnectInputValue> | null;
|
|
504
|
-
getPostOptionsValue(): Record<string, ConnectInputValue> | null;
|
|
505
|
-
next(): InstallFlowStage;
|
|
506
|
-
}
|