@useparagon/connect 2.2.4-experimental.1 → 2.2.4-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.
@@ -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, DynamicFieldMappingConfig, IntegrationInstallEvent, LoadCustomDropdownOptionsResult } 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';
@@ -187,21 +187,6 @@ export type DynamicMappingOptions = {
187
187
  defaultFields?: string[];
188
188
  useBYOFieldMappingOption?: boolean;
189
189
  };
190
- export type FieldMappingConfig = DynamicMappingField[] | DynamicMappingOptions | DynamicFieldMappingConfig;
191
- export type FieldMappingOptionResult = {
192
- mappingKey: string;
193
- source: 'shared' | 'workflow';
194
- workflowId?: string;
195
- } & ({
196
- type: 'static-fields';
197
- fields: DynamicMappingField[];
198
- } | {
199
- type: 'static-options';
200
- config: DynamicMappingOptions;
201
- } | {
202
- type: 'dynamic';
203
- config: DynamicFieldMappingConfig;
204
- });
205
190
  export type AuthenticatedConnectUser = {
206
191
  authenticated: true;
207
192
  token: string;
@@ -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, 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';
@@ -66,26 +66,9 @@ export type CompleteInstallOptions = {
66
66
  };
67
67
  };
68
68
  export type LoadCustomDropdownOptionsResult = Promise<{
69
- options: {
70
- label: string;
71
- value: string;
72
- }[];
69
+ options: CustomDropdownField[];
73
70
  nextPageCursor: string | null;
74
71
  }>;
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
- });
89
72
  export type DynamicFieldMappingOptionsResult = {
90
73
  options: {
91
74
  label: string;
@@ -285,24 +268,13 @@ export interface IConnectSDK {
285
268
  search?: string;
286
269
  cursor?: string | number | false;
287
270
  parameters?: KeyedSource<DataType.ANY>[];
271
+ selectedCredentialId?: string;
288
272
  }): Promise<{
289
273
  data: EnumInputValue[];
290
274
  nestedData: DynamicDefaultInput[];
291
275
  nextPageCursor: string | null;
292
276
  }>;
293
277
  getDataSourceOptions(integrationName: string, action: string): Promise<DataSource | undefined>;
294
- getCustomDropdownOptions(action: string, fieldKey?: string, options?: {
295
- selectedCredentialId: string;
296
- selectedConfigurationId?: string;
297
- }): Record<string, CustomDropdownField[] | CustomDropdownOptions> | CustomDropdownField[] | CustomDropdownOptions;
298
- getFieldMappingOptions(action: string, mappingKey?: string, options?: {
299
- selectedCredentialId: string;
300
- selectedConfigurationId?: string;
301
- }): Record<string, FieldMappingConfig> | FieldMappingConfig;
302
- setDataSources(action: string, dropdowns?: Record<string, CustomDropdownField[] | CustomDropdownOptions>, fieldMappings?: Record<string, FieldMappingConfig>, options?: {
303
- selectedCredentialId: string;
304
- selectedConfigurationId?: string;
305
- }): void;
306
278
  installFlow: InstallFlow;
307
279
  getAssetUrl(name: string): string;
308
280
  }
@@ -398,10 +370,7 @@ export type UserProvidedIntegrationConfig = {
398
370
  };
399
371
  };
400
372
  export type DropdownOptions = {
401
- dropdowns?: Record<string, Array<{
402
- label: string;
403
- value: string;
404
- }>>;
373
+ dropdowns?: Record<string, CustomDropdownField[] | CustomDropdownOptions>;
405
374
  };
406
375
  export type ConnectParams = CallbackMap & UserProvidedIntegrationConfig & InstallOptions & CredentialConfigOptions & DropdownOptions & CredentialConfigOptions & {
407
376
  /**
@@ -487,7 +456,11 @@ export type FilePickerOptions = {
487
456
  };
488
457
  };
489
458
  export type FilePickerInitOptions = {
490
- developerKey: string;
459
+ /**
460
+ * Required for googledrive.
461
+ * @link https://docs.useparagon.com/resources/integrations/google-drive#using-the-google-drive-file-picker
462
+ */
463
+ developerKey?: string;
491
464
  appId?: string;
492
465
  folderId?: string;
493
466
  selectedCredentialId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useparagon/connect",
3
- "version": "2.2.4-experimental.1",
3
+ "version": "2.2.4-experimental.2",
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",