@useparagon/connect 2.2.8-experimental-18633.2 → 2.2.8-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.
@@ -6,7 +6,7 @@ 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 { AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, ConnectInputValue, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, CustomDropdownField, DataType, DeleteConfigurationOptions, DisableWorkflowOptions, DynamicDataSource, DynamicDefaultInput, DynamicFieldMappingLoaderType, DynamicFieldMappingOptionsResult, EnumInputValue, EventInfo, GetIntegrationAccountOptions, IConnectSDK, InputSources, InstallFlowStage, InstallIntegrationOptions, InstallOptions, IntegrationConfig, IntegrationConnectInput, IntegrationInstallEvent, KeyedSource, LoadCustomDropdownOptionsResult, ProxyRequestOptions, SerializedConnectInput, SetDataSourcesConfig, StartOptions, TriggerWorkflowRequest, UninstallOptions, UpdateConfigurationOptions, UpdateWorkflowStateResponse, UserProvidedIntegrationConfig } 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';
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 {
@@ -51,10 +51,6 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
51
51
  * Dynamic field mapping loaders for handling dynamic object types and integration fields
52
52
  */
53
53
  private dynamicFieldMappingLoaders;
54
- private globalDropdownOptions;
55
- private globalMapObjectFields;
56
- private integrationSpecificDropdownOptions;
57
- private integrationSpecificMapObjectFields;
58
54
  installFlow: InstallFlow;
59
55
  constructor(environmentsOrHost?: ConnectSdkEnvironments | string, flags?: {
60
56
  skipBootstrapWithLastKnownState?: boolean;
@@ -79,6 +75,18 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
79
75
  * @param validateIsEnabled boolean
80
76
  */
81
77
  validateAction(action: string): void;
78
+ /**
79
+ * Validates that the provided `externalId` and `selectedCredentialId` install options are
80
+ * mutually exclusive, and that the `externalId` is not already in use for the given integration.
81
+ *
82
+ * `selectedCredentialId` accepts either a Paragon credential UUID, a plain `externalId` string,
83
+ * or an `ext:<value>` prefixed string — all resolve to a credential by its customer-supplied `externalId`.
84
+ * The `ext:` prefix is optional and only required when the externalId value itself looks like a UUID.
85
+ *
86
+ * Throws a descriptive error in either case so the developer gets actionable feedback before
87
+ * the OAuth popup opens.
88
+ */
89
+ private validateExternalIdOptions;
82
90
  /**
83
91
  * checks if the integration is installed.
84
92
  * Assumes that the user is authenticated
@@ -179,17 +187,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
179
187
  }): Promise<IntegrationInstallEvent | undefined>;
180
188
  _oauthErrorCallback(errorMessage: string | object, event?: MessageEvent): Promise<void>;
181
189
  customDropdownOptionsLoaders: Record<string, (cursor?: string | undefined, search?: string | undefined) => LoadCustomDropdownOptionsResult>;
182
- /**
183
- * Display the Paragon Connect modal
184
- */
185
190
  _loadCustomDropdownOptions(key: string, cursor?: string | undefined, search?: string | undefined): LoadCustomDropdownOptionsResult;
186
- setDataSources(config: SetDataSourcesConfig): void;
187
- private processDropdownSources;
188
- private processMapObjectFieldSources;
189
- resolveCustomDropdownSource(key: string | undefined, integrationName: string): CustomDropdownField[] | null;
190
- private resolveMapObjectFieldSource;
191
- private isDynamicFieldMappingConfig;
192
- hasCustomDropdownLoader(key: string | undefined): boolean;
193
191
  /**
194
192
  * Send a Connect API request. Automatically handles authorization and errors.
195
193
  *
@@ -359,7 +357,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
359
357
  * @param userSettingsUpdate - A partial map of input IDs <> values to update the workflow's settings
360
358
  * @param settings - Optional object with selectedCredentialId or selectedConfigurationId
361
359
  * @returns Promise with the new user state and an array of errors, if any were found
362
- * @throws Error if the workflow is not enabled or if the integration is not found
360
+ * @throws Error if the workflow ID is not found in the configuration
363
361
  */
364
362
  updateWorkflowUserSettings(integration: string, workflowId: string, userSettingsUpdate: Record<string, any>, settings?: CredentialConfigOptions): Promise<{
365
363
  userState: AuthenticatedConnectUser;
@@ -386,10 +384,9 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
386
384
  * @param parameters - Optional array of parameters to be used in the request.
387
385
  * @returns A promise that resolves with the field options or logs an error if the request fails.
388
386
  */
389
- getFieldOptions({ integration, action, source, search, cursor, parameters, selectedCredentialId, }: {
387
+ getFieldOptions({ integration, action, search, cursor, parameters, selectedCredentialId, }: {
390
388
  integration: string;
391
- action?: string;
392
- source?: DynamicDataSource<any>;
389
+ action: string;
393
390
  search?: string;
394
391
  cursor?: string | number | false;
395
392
  parameters?: KeyedSource<DataType.ANY>[];
@@ -400,7 +397,6 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
400
397
  nextPageCursor: string | null;
401
398
  }>;
402
399
  getDataSourceOptions(integrationName: string, action: string): Promise<import("./types").DataSource | undefined>;
403
- getSourcesForInput(integrationName: string, action: string, input: SerializedConnectInput): InputSources | null;
404
400
  getAccountTypeOptions(integrationName: string): import("./types").AccountType[];
405
401
  getPreOptions(integrationName: string, accountTypeId?: string): IntegrationConnectInput[];
406
402
  getPostOptions(integrationName: string): IntegrationConnectInput[];