@useparagon/connect 2.5.1 → 2.6.0-experimental.1

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.
@@ -206,6 +206,12 @@ export type CustomDropdownField = {
206
206
  };
207
207
  export type CustomDropdownOptions = {
208
208
  loadOptions: (cursor: string | undefined, search: string | undefined) => LoadCustomDropdownOptionsResult;
209
+ /**
210
+ * Resolve a stored value to its option, used by the Connect Portal to display
211
+ * the label of a saved value that is not in the currently loaded options.
212
+ * Return `null` when the value cannot be resolved.
213
+ */
214
+ resolveOption?: (value: string | number) => Promise<CustomDropdownField | null>;
209
215
  /**
210
216
  * If true, the dropdown options will be reloaded every time the dropdown is opened.
211
217
  * Useful for dependent dropdowns where options depend on other input values.
@@ -139,6 +139,14 @@ export interface IConnectSDK {
139
139
  * @returns {LoadCustomDropdownOptionsResult} - A promise that resolves to the dropdown options.
140
140
  */
141
141
  _loadCustomDropdownOptions(key: string, cursor?: string | undefined, search?: string | undefined): LoadCustomDropdownOptionsResult;
142
+ /**
143
+ * Resolve a stored custom dropdown value to its option for label display.
144
+ *
145
+ * @param {string} key - The key identifier for the dropdown.
146
+ * @param {string | number} value - The stored value to resolve.
147
+ * @returns {Promise<CustomDropdownField | null>} - The matching option, or null when it cannot be resolved.
148
+ */
149
+ _resolveCustomDropdownOption(key: string, value: string | number): Promise<CustomDropdownField | null>;
142
150
  /**
143
151
  * Installs an integration without the need to click on enable button from portal.
144
152
  *
@@ -304,6 +312,14 @@ export interface IConnectSDK {
304
312
  nestedData: DynamicDefaultInput[];
305
313
  nextPageCursor: string | null;
306
314
  }>;
315
+ /**
316
+ * Resolve a stored custom dropdown value to its option for label display.
317
+ */
318
+ resolveFieldOption(options: {
319
+ integration: string;
320
+ action: string;
321
+ value: string | number;
322
+ }): Promise<CustomDropdownField | null>;
307
323
  getDataSourceOptions(integrationName: string, action: string): Promise<DataSource | undefined>;
308
324
  getSourcesForInput(integrationName: string, input: SerializedConnectInput): InputSources | null;
309
325
  getSourcesForActionInput(input: IntentInputKeyConfig): SingleSource | ConditionalSource | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useparagon/connect",
3
- "version": "2.5.1",
3
+ "version": "2.6.0-experimental.1",
4
4
  "description": "Embed integrations into your app with the Paragon SDK",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",