@useparagon/connect 2.2.3-experimental.1 → 2.2.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.
@@ -4,10 +4,9 @@ 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 './InstallFlow';
8
7
  import SDKEventEmitter from './SDKEventEmitter';
9
8
  import { ConnectSdkEnvironments } from './server.types';
10
- import { 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, ProxyRequestOptions, 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, ProxyRequestOptions, StartOptions, TriggerWorkflowRequest, UninstallOptions, UpdateConfigurationOptions, UpdateWorkflowStateResponse, UserProvidedIntegrationConfig } from './types';
11
10
  export declare const PARAGON_OVERFLOW_EMPTY_VALUE = "PARAGON_OVERFLOW_EMPTY_VALUE";
12
11
  export { ExternalFilePicker };
13
12
  export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
@@ -57,6 +56,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
57
56
  skipBootstrapWithLastKnownState?: boolean;
58
57
  });
59
58
  setHeadless(headless: boolean): void;
59
+ getAssetUrl(name: string): string;
60
60
  /**
61
61
  * post message handler
62
62
  * @param event
@@ -134,8 +134,9 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
134
134
  private removeOptionDuplicates;
135
135
  startOAuthFlow(action: string, apiInstallationOptions: InstallOptions & CredentialConfigOptions & {
136
136
  endUserSuppliedValues?: Record<string, ConnectInputValue>;
137
+ userProvidedIntegrationConfig?: UserProvidedIntegrationConfig;
137
138
  }, options?: {
138
- onSuccess?: (connectCredentialId: string) => void;
139
+ onSuccess?: (installationEvent: IntegrationInstallEvent) => void;
139
140
  onError?: (error: unknown) => void;
140
141
  oauthTimeout?: number;
141
142
  }): void;
@@ -165,7 +166,9 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
165
166
  */
166
167
  _getIntegration(integrationId: string): IConnectIntegrationWithCredentialInfo | undefined;
167
168
  getIntegrationBySlug(integrationName: string): IConnectIntegrationWithCredentialInfo;
168
- _oauthCallback(oauthResponse: OauthCallbackResponse, credentialId?: string): Promise<void>;
169
+ _oauthCallback(oauthResponse: OauthCallbackResponse, credentialId?: string, options?: {
170
+ installOptions?: InstallOptions;
171
+ }): Promise<IntegrationInstallEvent | undefined>;
169
172
  _oauthErrorCallback(errorMessage: string | object, event?: MessageEvent): Promise<void>;
170
173
  customDropdownOptionsLoaders: Record<string, (cursor?: string | undefined, search?: string | undefined) => LoadCustomDropdownOptionsResult>;
171
174
  /**
@@ -387,3 +390,41 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
387
390
  search?: string;
388
391
  }): Promise<DynamicFieldMappingOptionsResult>;
389
392
  }
393
+ export declare class InstallFlow {
394
+ private readonly paragon;
395
+ private startOptions;
396
+ private integrationName;
397
+ private accountTypeValue;
398
+ private preOptionsValue;
399
+ private postOptionsValue;
400
+ private credentialId;
401
+ private hasFinishedInstruction;
402
+ constructor(paragon: ConnectSDK);
403
+ start(integrationName: string, startOptions?: StartOptions): void;
404
+ cancel(): Promise<void>;
405
+ private getInstallOptions;
406
+ private asyncStart;
407
+ private handleError;
408
+ private handleNext;
409
+ private handleComplete;
410
+ private getScheme;
411
+ private getIntegrationName;
412
+ private getSelectedAccountTypeOption;
413
+ private requiresAccountType;
414
+ private getIntegrationInstructionMetadata;
415
+ private getSalesforceInstructionMetadata;
416
+ private requiresInstruction;
417
+ private requiresPreOptions;
418
+ private requiresPostOptions;
419
+ private requiresOAuth;
420
+ /** Starts an OAuth authentication flow through a window Pop-up */
421
+ private handleOAuth;
422
+ setAccountType(accountType: string): Promise<void>;
423
+ setPreOptions(options: Record<string, ConnectInputValue>): Promise<void>;
424
+ setPostOptions(options: Record<string, ConnectInputValue>): Promise<void>;
425
+ private setHasFinishedInstruction;
426
+ getAccountTypeValue(): string | null;
427
+ getPreOptionsValue(): Record<string, ConnectInputValue> | null;
428
+ getPostOptionsValue(): Record<string, ConnectInputValue> | null;
429
+ next(): InstallFlowStage;
430
+ }