@useparagon/connect 2.2.8-experimental.1 → 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.
@@ -75,6 +75,18 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
75
75
  * @param validateIsEnabled boolean
76
76
  */
77
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;
78
90
  /**
79
91
  * checks if the integration is installed.
80
92
  * Assumes that the user is authenticated
@@ -175,9 +187,6 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
175
187
  }): Promise<IntegrationInstallEvent | undefined>;
176
188
  _oauthErrorCallback(errorMessage: string | object, event?: MessageEvent): Promise<void>;
177
189
  customDropdownOptionsLoaders: Record<string, (cursor?: string | undefined, search?: string | undefined) => LoadCustomDropdownOptionsResult>;
178
- /**
179
- * Display the Paragon Connect modal
180
- */
181
190
  _loadCustomDropdownOptions(key: string, cursor?: string | undefined, search?: string | undefined): LoadCustomDropdownOptionsResult;
182
191
  /**
183
192
  * Send a Connect API request. Automatically handles authorization and errors.
@@ -254,8 +263,12 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
254
263
  private getIntegrationForWorkflow;
255
264
  private updateLocalState;
256
265
  /**
257
- * gets the user data from api `/sdk/me`
258
- * userMeta header is passed to support user metadata upsert based on authentication options
266
+ * Sends user metadata to the API via PATCH /sdk/me (request body supports non-ASCII).
267
+ */
268
+ private patchUserMetadata;
269
+ /**
270
+ * Gets the user data from api `/sdk/me`.
271
+ * User metadata is set via PATCH after this succeeds when provided in authenticate (see updateLocalState).
259
272
  */
260
273
  private fetchUserData;
261
274
  /**
@@ -344,7 +357,7 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {
344
357
  * @param userSettingsUpdate - A partial map of input IDs <> values to update the workflow's settings
345
358
  * @param settings - Optional object with selectedCredentialId or selectedConfigurationId
346
359
  * @returns Promise with the new user state and an array of errors, if any were found
347
- * @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
348
361
  */
349
362
  updateWorkflowUserSettings(integration: string, workflowId: string, userSettingsUpdate: Record<string, any>, settings?: CredentialConfigOptions): Promise<{
350
363
  userState: AuthenticatedConnectUser;