@useparagon/connect 2.2.4-experimental-15312.1 → 2.2.4-experimental-15312.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.
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AuthenticationScheme } from '../entities/credential.interface';
3
- import { CustomDropdownField, DynamicMappingField, DynamicMappingOptions, SidebarInput } from './connect';
3
+ import { CustomDropdownField, DynamicMappingField, DynamicMappingOptions, InstructionStage, SidebarInput } from './connect';
4
4
  import { DataType, KeyedSource, Source } from './resolvers';
5
5
  export declare enum SidebarInputType {
6
6
  Auth = "AUTH",
@@ -399,4 +399,5 @@ export type AccountType = {
399
399
  */
400
400
  skipPostOAuthInputs?: boolean;
401
401
  };
402
+ export type InstructionMetadata = Pick<InstructionStage, 'content' | 'ctas' | 'finish' | 'packageInstallUrl'>;
402
403
  export {};
@@ -235,6 +235,9 @@ export type SDKIntegrationConfig = {
235
235
  dataSources: {
236
236
  [key: string]: DataSource;
237
237
  };
238
+ authSchemeOptions?: {
239
+ packageInstallUrl?: string;
240
+ };
238
241
  };
239
242
  /**
240
243
  * The contents of the `integrations` field for an authenticated ConnectUser.
@@ -260,11 +263,35 @@ export declare const INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS = "auto";
260
263
  export declare const SELECTED_CREDENTIAL_ID_HEADER = "X-Paragon-Credential";
261
264
  export declare const SELECTED_CREDENTIAL_CONFIG_ID_HEADER = "X-Paragon-Configuration-Id";
262
265
  export declare const SDK_VERSION_HEADER = "X-Paragon-SDK-Version";
266
+ export type Link = {
267
+ label: string;
268
+ type: 'link';
269
+ href: string;
270
+ };
271
+ export type FinishButton = {
272
+ type: 'finishButton';
273
+ label: string;
274
+ onClick: () => void;
275
+ };
276
+ export type CopyButton = {
277
+ label: string;
278
+ type: 'copyButton';
279
+ copyText: string;
280
+ };
281
+ export type CTA = Link | CopyButton;
263
282
  export type AccountTypeStage = {
264
283
  stage: 'accountType';
265
284
  options: AccountType[];
266
285
  done: false;
267
286
  };
287
+ export type InstructionStage = {
288
+ stage: 'instruction';
289
+ content: string;
290
+ ctas: CTA[];
291
+ finish: FinishButton;
292
+ packageInstallUrl: string;
293
+ done: false;
294
+ };
268
295
  export type PreOptionsStage = {
269
296
  stage: 'preOptions';
270
297
  options: IntegrationConnectInput[];
@@ -275,11 +302,15 @@ export type PostOptionsStage = {
275
302
  options: IntegrationConnectInput[];
276
303
  done: false;
277
304
  };
305
+ export type OAuthStage = {
306
+ stage: 'oauth';
307
+ done: false;
308
+ };
278
309
  export type DoneStage = {
279
310
  stage: 'done';
280
311
  done: true;
281
312
  };
282
- export type InstallFlowStage = AccountTypeStage | PreOptionsStage | PostOptionsStage | DoneStage;
313
+ export type InstallFlowStage = AccountTypeStage | InstructionStage | PreOptionsStage | OAuthStage | PostOptionsStage | DoneStage;
283
314
  export type OnErrorContext = {
284
315
  /**
285
316
  * 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, CustomDropdownField, CustomDropdownOptions, DisableWorkflowOptions, DynamicMappingField, DynamicMappingOptions, FieldMappingConfig, FieldMappingOptionResult, GetIntegrationAccountOptions, IntegrationWorkflowMeta, IntegrationWorkflowState, SerializedConnectInput, UninstallOptions } from '../types/connect';
10
+ import { AuthenticatedConnectUser, CustomDropdownField, CustomDropdownOptions, DisableWorkflowOptions, DynamicMappingField, DynamicMappingOptions, FieldMappingConfig, 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';
@@ -291,11 +291,24 @@ export interface IConnectSDK {
291
291
  nextPageCursor: string | null;
292
292
  }>;
293
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[];
296
- setFieldMappingOptions(action: string, fieldMappings: Record<string, FieldMappingConfig>): void;
297
- getFieldMappingOptions(action: string, mappingKey?: string): FieldMappingOptionResult[];
294
+ setCustomDropdownOptions(action: string, dropdowns: Record<string, CustomDropdownField[] | CustomDropdownOptions>, options?: {
295
+ selectedCredentialId: string;
296
+ selectedConfigurationId?: string;
297
+ }): void;
298
+ getCustomDropdownOptions(action: string, fieldKey?: string, options?: {
299
+ selectedCredentialId: string;
300
+ selectedConfigurationId?: string;
301
+ }): Record<string, CustomDropdownField[] | CustomDropdownOptions> | CustomDropdownField[] | CustomDropdownOptions;
302
+ setFieldMappingOptions(action: string, fieldMappings: Record<string, FieldMappingConfig>, options?: {
303
+ selectedCredentialId: string;
304
+ selectedConfigurationId?: string;
305
+ }): void;
306
+ getFieldMappingOptions(action: string, mappingKey?: string, options?: {
307
+ selectedCredentialId: string;
308
+ selectedConfigurationId?: string;
309
+ }): Record<string, FieldMappingConfig> | FieldMappingConfig;
298
310
  installFlow: InstallFlow;
311
+ getAssetUrl(name: string): string;
299
312
  }
300
313
  /**
301
314
  * sdk install options
@@ -0,0 +1 @@
1
+ export declare function dedent(str: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useparagon/connect",
3
- "version": "2.2.4-experimental-15312.1",
3
+ "version": "2.2.4-experimental-15312.3",
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",