@useparagon/connect 2.2.3-experimental.1 → 2.2.3-experimental.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.
@@ -400,8 +400,4 @@ export type AccountType = {
400
400
  skipPostOAuthInputs?: boolean;
401
401
  };
402
402
  export type InstructionMetadata = Pick<InstructionStage, 'content' | 'ctas' | 'finish' | 'packageInstallUrl'>;
403
- export declare const INTEGRATION_INSTRUCTION_METADATA: Record<string, InstructionMetadata | {
404
- default?: InstructionMetadata;
405
- accountTypes?: Record<string, InstructionMetadata>;
406
- }>;
407
403
  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 } from './sdk';
8
+ import { CredentialConfigOptions, IntegrationInstallEvent } from './sdk';
9
9
  export { CredentialStatus } from '../entities/connectCredential.interface';
10
10
  export type { IntegrationMetadata } from '../entities/integration.interface';
11
11
  export * from './errors';
@@ -217,7 +217,9 @@ export type SDKIntegrationConfig = {
217
217
  dataSources: {
218
218
  [key: string]: DataSource;
219
219
  };
220
- allowedCredentialValues?: Record<string, any>;
220
+ authSchemeOptions?: {
221
+ packageInstallUrl?: string;
222
+ };
221
223
  };
222
224
  /**
223
225
  * The contents of the `integrations` field for an authenticated ConnectUser.
@@ -246,14 +248,17 @@ export declare const SDK_VERSION_HEADER = "X-Paragon-SDK-Version";
246
248
  export type Link = {
247
249
  label: string;
248
250
  type: 'link';
251
+ href: string;
249
252
  };
250
253
  export type FinishButton = {
251
254
  type: 'finishButton';
252
255
  label: string;
256
+ onClick: () => void;
253
257
  };
254
258
  export type CopyButton = {
255
259
  label: string;
256
260
  type: 'copyButton';
261
+ copyText: string;
257
262
  };
258
263
  export type CTA = Link | CopyButton;
259
264
  export type AccountTypeStage = {
@@ -265,7 +270,7 @@ export type InstructionStage = {
265
270
  stage: 'instruction';
266
271
  content: string;
267
272
  ctas: CTA[];
268
- finish?: FinishButton;
273
+ finish: FinishButton;
269
274
  packageInstallUrl: string;
270
275
  done: false;
271
276
  };
@@ -298,7 +303,7 @@ export type StartOptions = {
298
303
  /**
299
304
  * Callback to be called when the installation is complete
300
305
  */
301
- onComplete?: VoidFunction;
306
+ onComplete?: (installationEvent: IntegrationInstallEvent) => void;
302
307
  onNext?: (nextState: InstallFlowStage) => void;
303
308
  /**
304
309
  * Callback to be called when the installation fails.
@@ -320,4 +325,7 @@ export type StartOptions = {
320
325
  * Closes the popup and raises an error if the flow is not completed within the given timeout.
321
326
  */
322
327
  oauthTimeout?: number;
328
+ allowMultipleCredentials?: boolean;
329
+ overrideRedirectUrl?: string;
330
+ selectedCredentialId?: string;
323
331
  };
@@ -1,12 +1,11 @@
1
1
  /// <reference types="google.picker" />
2
- import ConnectSDK from '../ConnectSDK';
2
+ import ConnectSDK, { InstallFlow } from '../ConnectSDK';
3
3
  import { IConnectCredential } from '../entities/connectCredential.interface';
4
4
  import { IConnectCredentialConfig } from '../entities/connectCredentialConfig.interface';
5
5
  import { OauthCallbackResponse } from '../entities/credential.interface';
6
6
  import { IConnectIntegrationWithCredentialInfo, IntegrationMetadata } from '../entities/integration.interface';
7
7
  import { PersonaMeta } from '../entities/persona.interface';
8
8
  import { IConnectUserContext } from '../helpers/ConnectUserContext';
9
- import { InstallFlow } from '../InstallFlow';
10
9
  import { ConnectSdkEnvironments } from '../server.types';
11
10
  import { AuthenticatedConnectUser, DisableWorkflowOptions, DynamicMappingField, DynamicMappingOptions, GetIntegrationAccountOptions, IntegrationWorkflowMeta, IntegrationWorkflowState, SerializedConnectInput, UninstallOptions } from '../types/connect';
12
11
  import { DataSource, DynamicDefaultInput, EnumInputValue } from './action';
@@ -119,7 +118,7 @@ export interface IConnectSDK {
119
118
  * Invoked by the OAuth popup after finishing the credential exchange.
120
119
  * @private
121
120
  */
122
- _oauthCallback(credential: OauthCallbackResponse, credentialId?: string): Promise<void>;
121
+ _oauthCallback(credential: OauthCallbackResponse, credentialId?: string): Promise<IntegrationInstallEvent | undefined>;
123
122
  /**
124
123
  * **Do not call this function directly.**
125
124
  *
@@ -263,7 +262,7 @@ export interface IConnectSDK {
263
262
  getPreOptions(params: string): any;
264
263
  getPostOptions(params: string): any;
265
264
  startOAuthFlow(action: string, apiInstallationOptions: InstallOptions & CredentialConfigOptions, options?: {
266
- onSuccess?: (connectCredentialId: string) => void;
265
+ onSuccess?: (installationEvent: IntegrationInstallEvent) => void;
267
266
  onError?: (error: unknown) => void;
268
267
  }): void;
269
268
  getFieldOptions(options: {
@@ -279,6 +278,7 @@ export interface IConnectSDK {
279
278
  }>;
280
279
  getDataSourceOptions(integrationName: string, action: string): Promise<DataSource | undefined>;
281
280
  installFlow: InstallFlow;
281
+ getAssetUrl(name: string): string;
282
282
  }
283
283
  /**
284
284
  * sdk install options
@@ -441,6 +441,7 @@ export type FilePickerOptions = {
441
441
  googledrive?: {
442
442
  viewMode?: google.picker.DocsViewMode;
443
443
  includeFolders?: boolean;
444
+ enableSharedDrives?: boolean;
444
445
  };
445
446
  box?: {
446
447
  container?: string;
@@ -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.3-experimental.1",
3
+ "version": "2.2.3-experimental.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",
@@ -1,39 +0,0 @@
1
- import type ConnectSDK from './ConnectSDK';
2
- import { ConnectInputValue, InstallFlowStage, StartOptions } from './types';
3
- export declare class InstallFlow {
4
- private readonly paragon;
5
- private startOptions;
6
- private integrationName;
7
- private accountTypeValue;
8
- private preOptionsValue;
9
- private postOptionsValue;
10
- private credentialId;
11
- private hasFinishedInstruction;
12
- constructor(paragon: ConnectSDK);
13
- start(integrationName: string, startOptions?: StartOptions): void;
14
- cancel(): Promise<void>;
15
- private asyncStart;
16
- private handleError;
17
- private handleNext;
18
- private handleComplete;
19
- private getScheme;
20
- private getIntegrationName;
21
- private getSelectedAccountTypeOption;
22
- private requiresAccountType;
23
- private getIntegrationInstructionMetadata;
24
- private requiresInstruction;
25
- private requiresPreOptions;
26
- private requiresPostOptions;
27
- private requiresOAuth;
28
- /** Starts an OAuth authentication flow through a window Pop-up */
29
- private handleOAuth;
30
- setAccountType(accountType: string): Promise<void>;
31
- setPreOptions(options: Record<string, ConnectInputValue>): Promise<void>;
32
- startOAuth(): Promise<void>;
33
- setPostOptions(options: Record<string, ConnectInputValue>): Promise<void>;
34
- setHasFinishedInstruction(): void;
35
- getAccountTypeValue(): string | null;
36
- getPreOptionsValue(): Record<string, ConnectInputValue> | null;
37
- getPostOptionsValue(): Record<string, ConnectInputValue> | null;
38
- next(): InstallFlowStage;
39
- }