@useparagon/connect 2.0.9 → 2.1.0-experimental.2

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.
@@ -1,18 +1,18 @@
1
1
  import { IConnectCredential } from './entities/connectCredential.interface';
2
2
  import { IConnectCredentialConfig } from './entities/connectCredentialConfig.interface';
3
- import { AuthenticationScheme, OauthCallbackResponse } from './entities/credential.interface';
4
- import { IConnectIntegrationWithCredentialInfo, IIntegrationMetadata } from './entities/integration.interface';
3
+ import { OauthCallbackResponse } from './entities/credential.interface';
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
7
  import SDKEventEmitter from './SDKEventEmitter';
8
8
  import { ConnectSdkEnvironments } from './server.types';
9
- import { AccountType, AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, ConnectInputValue, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, DataType, DeleteConfigurationOptions, DisableWorkflowOptions, DynamicDefaultInput, DynamicFieldMappingLoaderType, DynamicFieldMappingOptionsResult, EnumInputValue, EventInfo, GetIntegrationAccountOptions, IConnectSDK, InstallIntegrationOptions, InstallOptions, IntegrationConfig, IntegrationConnectInput, IntegrationInstallEvent, KeyedSource, LoadCustomDropdownOptionsResult, TriggerWorkflowRequest, UninstallOptions, UpdateConfigurationOptions, UpdateWorkflowStateResponse } from './types';
9
+ import { AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, ConnectInputValue, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, DataType, DeleteConfigurationOptions, DisableWorkflowOptions, DynamicDefaultInput, DynamicFieldMappingLoaderType, DynamicFieldMappingOptionsResult, EnumInputValue, EventInfo, GetIntegrationAccountOptions, IConnectSDK, InstallFlowStage, InstallIntegrationOptions, InstallOptions, IntegrationConfig, IntegrationConnectInput, IntegrationInstallEvent, KeyedSource, LoadCustomDropdownOptionsResult, StartOptions, TriggerWorkflowRequest, UninstallOptions, UpdateConfigurationOptions, UpdateWorkflowStateResponse } from './types';
10
10
  export declare const PARAGON_OVERFLOW_EMPTY_VALUE = "PARAGON_OVERFLOW_EMPTY_VALUE";
11
11
  export { ExternalFilePicker };
12
12
  export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
13
13
  root: HTMLIFrameElement | undefined;
14
14
  private rootLoaded;
15
- private isHeadless;
15
+ isHeadless: boolean;
16
16
  /**
17
17
  * sometime DOMContentLoaded event firing twice
18
18
  * so it was creating two iframes see PARA-8749
@@ -130,6 +130,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
130
130
  }, options?: {
131
131
  onSuccess?: (connectCredentialId: string) => void;
132
132
  onError?: (error: unknown) => void;
133
+ oauthTimeout?: number;
133
134
  }): void;
134
135
  private getIntegrationByName;
135
136
  private getSelectedMultipleAccountTypes;
@@ -213,8 +214,8 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
213
214
  * @param integrationKey
214
215
  * @returns
215
216
  */
216
- getIntegrationMetadata(): IIntegrationMetadata[];
217
- getIntegrationMetadata(integrationKey: string): IIntegrationMetadata;
217
+ getIntegrationMetadata(): IntegrationMetadata[];
218
+ getIntegrationMetadata(integrationKey: string): IntegrationMetadata;
218
219
  /**
219
220
  * Closing the portal by invoking this method
220
221
  */
@@ -365,7 +366,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
365
366
  nextPageCursor: string | null;
366
367
  }>;
367
368
  getDataSourceOptions(integrationName: string, action: string): Promise<import("./types").DataSource | undefined>;
368
- getAccountTypeOptions(integrationName: string): AccountType[];
369
+ getAccountTypeOptions(integrationName: string): import("./types").AccountType[];
369
370
  getPreOptions(integrationName: string, accountTypeId?: string): IntegrationConnectInput[];
370
371
  getPostOptions(integrationName: string): IntegrationConnectInput[];
371
372
  /**
@@ -379,49 +380,29 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
379
380
  }
380
381
  export declare class InstallFlow {
381
382
  private readonly paragon;
383
+ private startOptions;
382
384
  private integrationName;
383
385
  private accountType;
384
386
  private preOptions;
385
387
  private postOptions;
386
388
  private credentialId;
387
- private onNext;
388
- private onComplete;
389
389
  constructor(paragon: ConnectSDK);
390
- start(integrationName: string, startOptions?: StartOptions): Promise<void | undefined>;
391
- getScheme(): null | AuthenticationScheme;
390
+ start(integrationName: string, startOptions?: StartOptions): void;
391
+ private asyncStart;
392
+ private handleError;
393
+ private handleNext;
394
+ private handleComplete;
395
+ private getScheme;
396
+ private getIntegrationName;
392
397
  private getSelectedAccountTypeOption;
393
398
  private requiresAccountType;
394
399
  private requiresPreOptions;
395
400
  private requiresPostOptions;
396
- setAccountType(accountType: string, onError: (error: unknown) => void): void;
397
- setPreOptions(options: Record<string, ConnectInputValue>, onError: (error: unknown) => void): void;
398
- setPostOptions(options: Record<string, ConnectInputValue>, onError: (error: unknown) => void): void;
401
+ setAccountType(accountType: string): Promise<void>;
402
+ setPreOptions(options: Record<string, ConnectInputValue>): Promise<void>;
403
+ setPostOptions(options: Record<string, ConnectInputValue>): Promise<void>;
399
404
  getAccountType(): string | null;
400
405
  getPreOptions(): Record<string, ConnectInputValue> | null;
401
406
  getPostOptions(): Record<string, ConnectInputValue> | null;
402
407
  next(): InstallFlowStage;
403
408
  }
404
- type AccountTypeStage = {
405
- stage: 'accountType';
406
- options: AccountType[];
407
- done: false;
408
- };
409
- type PreOptionsStage = {
410
- stage: 'preOptions';
411
- options: IntegrationConnectInput[];
412
- done: false;
413
- };
414
- type PostOptionsStage = {
415
- stage: 'postOptions';
416
- options: IntegrationConnectInput[];
417
- done: false;
418
- };
419
- type DoneStage = {
420
- stage: 'done';
421
- done: true;
422
- };
423
- type InstallFlowStage = AccountTypeStage | PreOptionsStage | PostOptionsStage | DoneStage;
424
- type StartOptions = {
425
- onComplete?: VoidFunction;
426
- onNext?: (nextState: InstallFlowStage) => void;
427
- };