@useparagon/connect 2.2.3-experimental.3 → 2.2.4-experimental-15311.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.
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AuthenticationScheme } from '../entities/credential.interface';
3
- import { CustomDropdownField, DynamicMappingField, DynamicMappingOptions, InstructionStage, SidebarInput } from './connect';
3
+ import { CustomDropdownField, DynamicMappingField, DynamicMappingOptions, SidebarInput } from './connect';
4
4
  import { DataType, KeyedSource, Source } from './resolvers';
5
5
  export declare enum SidebarInputType {
6
6
  Auth = "AUTH",
@@ -399,5 +399,4 @@ export type AccountType = {
399
399
  */
400
400
  skipPostOAuthInputs?: boolean;
401
401
  };
402
- export type InstructionMetadata = Pick<InstructionStage, 'content' | 'ctas' | 'finish' | 'packageInstallUrl'>;
403
402
  export {};
@@ -5,7 +5,7 @@ import { PersonaMeta } from '../entities/persona.interface';
5
5
  import { AccountType, BooleanInput, ComboInput, CopyableButtonInput, CustomDropdownInput, DataSource, DynamicComboInput, DynamicEnumInput, EmailInput, FieldMapperInput, FileInput, IntegrationConnectInput, NumberInput, PasswordInput, PermissionInput, SidebarInputType, SwitchInput, URLInput, ValueTextInput } from './action';
6
6
  import { InstallFlowError } from './errors';
7
7
  import { OrConditions } from './resolvers';
8
- import { CredentialConfigOptions, IntegrationInstallEvent } from './sdk';
8
+ import { CredentialConfigOptions, IntegrationInstallEvent, LoadCustomDropdownOptionsResult } from './sdk';
9
9
  export { CredentialStatus } from '../entities/connectCredential.interface';
10
10
  export type { IntegrationMetadata } from '../entities/integration.interface';
11
11
  export * from './errors';
@@ -173,6 +173,9 @@ export type CustomDropdownField = {
173
173
  label: string;
174
174
  value: string;
175
175
  };
176
+ export type CustomDropdownOptions = {
177
+ loadOptions: (cursor: string | undefined, search: string | undefined) => LoadCustomDropdownOptionsResult;
178
+ };
176
179
  export type DynamicMappingField = {
177
180
  label: string;
178
181
  value: string;
@@ -217,9 +220,6 @@ export type SDKIntegrationConfig = {
217
220
  dataSources: {
218
221
  [key: string]: DataSource;
219
222
  };
220
- authSchemeOptions?: {
221
- packageInstallUrl?: string;
222
- };
223
223
  };
224
224
  /**
225
225
  * The contents of the `integrations` field for an authenticated ConnectUser.
@@ -245,35 +245,11 @@ export declare const INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS = "auto";
245
245
  export declare const SELECTED_CREDENTIAL_ID_HEADER = "X-Paragon-Credential";
246
246
  export declare const SELECTED_CREDENTIAL_CONFIG_ID_HEADER = "X-Paragon-Configuration-Id";
247
247
  export declare const SDK_VERSION_HEADER = "X-Paragon-SDK-Version";
248
- export type Link = {
249
- label: string;
250
- type: 'link';
251
- href: string;
252
- };
253
- export type FinishButton = {
254
- type: 'finishButton';
255
- label: string;
256
- onClick: () => void;
257
- };
258
- export type CopyButton = {
259
- label: string;
260
- type: 'copyButton';
261
- copyText: string;
262
- };
263
- export type CTA = Link | CopyButton;
264
248
  export type AccountTypeStage = {
265
249
  stage: 'accountType';
266
250
  options: AccountType[];
267
251
  done: false;
268
252
  };
269
- export type InstructionStage = {
270
- stage: 'instruction';
271
- content: string;
272
- ctas: CTA[];
273
- finish: FinishButton;
274
- packageInstallUrl: string;
275
- done: false;
276
- };
277
253
  export type PreOptionsStage = {
278
254
  stage: 'preOptions';
279
255
  options: IntegrationConnectInput[];
@@ -284,15 +260,11 @@ export type PostOptionsStage = {
284
260
  options: IntegrationConnectInput[];
285
261
  done: false;
286
262
  };
287
- export type OAuthStage = {
288
- stage: 'oauth';
289
- done: false;
290
- };
291
263
  export type DoneStage = {
292
264
  stage: 'done';
293
265
  done: true;
294
266
  };
295
- export type InstallFlowStage = AccountTypeStage | InstructionStage | PreOptionsStage | OAuthStage | PostOptionsStage | DoneStage;
267
+ export type InstallFlowStage = AccountTypeStage | PreOptionsStage | PostOptionsStage | DoneStage;
296
268
  export type OnErrorContext = {
297
269
  /**
298
270
  * The stage of the install flow that failed.
@@ -7,7 +7,7 @@ import { IConnectIntegrationWithCredentialInfo, IntegrationMetadata } from '../e
7
7
  import { PersonaMeta } from '../entities/persona.interface';
8
8
  import { IConnectUserContext } from '../helpers/ConnectUserContext';
9
9
  import { ConnectSdkEnvironments } from '../server.types';
10
- import { AuthenticatedConnectUser, DisableWorkflowOptions, DynamicMappingField, DynamicMappingOptions, GetIntegrationAccountOptions, IntegrationWorkflowMeta, IntegrationWorkflowState, SerializedConnectInput, UninstallOptions } from '../types/connect';
10
+ import { AuthenticatedConnectUser, CustomDropdownField, CustomDropdownOptions, DisableWorkflowOptions, DynamicMappingField, DynamicMappingOptions, GetIntegrationAccountOptions, IntegrationWorkflowMeta, IntegrationWorkflowState, SerializedConnectInput, UninstallOptions } from '../types/connect';
11
11
  import { DataSource, DynamicDefaultInput, EnumInputValue } from './action';
12
12
  import { Props as ConnectModalProps } from './connectModal';
13
13
  import { DataType, KeyedSource } from './resolvers';
@@ -72,6 +72,20 @@ export type LoadCustomDropdownOptionsResult = Promise<{
72
72
  }[];
73
73
  nextPageCursor: string | null;
74
74
  }>;
75
+ export type CustomDropdownOptionResult = {
76
+ fieldKey: string;
77
+ source: 'shared' | 'workflow';
78
+ workflowId?: string;
79
+ } & ({
80
+ type: 'static';
81
+ options: Array<{
82
+ label: string;
83
+ value: string;
84
+ }>;
85
+ } | {
86
+ type: 'dynamic';
87
+ loadOptions: (cursor?: string, search?: string) => LoadCustomDropdownOptionsResult;
88
+ });
75
89
  export type DynamicFieldMappingOptionsResult = {
76
90
  options: {
77
91
  label: string;
@@ -277,8 +291,9 @@ export interface IConnectSDK {
277
291
  nextPageCursor: string | null;
278
292
  }>;
279
293
  getDataSourceOptions(integrationName: string, action: string): Promise<DataSource | undefined>;
294
+ setCustomDropdownOptions(action: string, dropdowns: Record<string, CustomDropdownField[] | CustomDropdownOptions>): void;
295
+ getCustomDropdownOptions(action: string, fieldKey?: string): CustomDropdownOptionResult[];
280
296
  installFlow: InstallFlow;
281
- getAssetUrl(name: string): string;
282
297
  }
283
298
  /**
284
299
  * sdk install options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useparagon/connect",
3
- "version": "2.2.3-experimental.3",
3
+ "version": "2.2.4-experimental-15311.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",
@@ -1 +0,0 @@
1
- export declare function dedent(str: string): string;