@useparagon/connect 2.0.9 → 2.0.10

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
@@ -213,8 +213,8 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
213
213
  * @param integrationKey
214
214
  * @returns
215
215
  */
216
- getIntegrationMetadata(): IIntegrationMetadata[];
217
- getIntegrationMetadata(integrationKey: string): IIntegrationMetadata;
216
+ getIntegrationMetadata(): IntegrationMetadata[];
217
+ getIntegrationMetadata(integrationKey: string): IntegrationMetadata;
218
218
  /**
219
219
  * Closing the portal by invoking this method
220
220
  */
@@ -365,7 +365,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
365
365
  nextPageCursor: string | null;
366
366
  }>;
367
367
  getDataSourceOptions(integrationName: string, action: string): Promise<import("./types").DataSource | undefined>;
368
- getAccountTypeOptions(integrationName: string): AccountType[];
368
+ getAccountTypeOptions(integrationName: string): import("./types").AccountType[];
369
369
  getPreOptions(integrationName: string, accountTypeId?: string): IntegrationConnectInput[];
370
370
  getPostOptions(integrationName: string): IntegrationConnectInput[];
371
371
  /**
@@ -379,49 +379,29 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
379
379
  }
380
380
  export declare class InstallFlow {
381
381
  private readonly paragon;
382
+ private startOptions;
382
383
  private integrationName;
383
384
  private accountType;
384
385
  private preOptions;
385
386
  private postOptions;
386
387
  private credentialId;
387
- private onNext;
388
- private onComplete;
389
388
  constructor(paragon: ConnectSDK);
390
- start(integrationName: string, startOptions?: StartOptions): Promise<void | undefined>;
391
- getScheme(): null | AuthenticationScheme;
389
+ start(integrationName: string, startOptions?: StartOptions): void;
390
+ private asyncStart;
391
+ private handleError;
392
+ private handleNext;
393
+ private handleComplete;
394
+ private getScheme;
395
+ private getIntegrationName;
392
396
  private getSelectedAccountTypeOption;
393
397
  private requiresAccountType;
394
398
  private requiresPreOptions;
395
399
  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;
400
+ setAccountType(accountType: string): Promise<void>;
401
+ setPreOptions(options: Record<string, ConnectInputValue>): Promise<void>;
402
+ setPostOptions(options: Record<string, ConnectInputValue>): Promise<void>;
399
403
  getAccountType(): string | null;
400
404
  getPreOptions(): Record<string, ConnectInputValue> | null;
401
405
  getPostOptions(): Record<string, ConnectInputValue> | null;
402
406
  next(): InstallFlowStage;
403
407
  }
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
- };