@useparagon/connect 2.2.8-experimental-18633.2 → 2.2.8-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.
- package/dist/src/ConnectSDK.d.ts +16 -20
- package/dist/src/ConnectSDK.js +1 -1
- package/dist/src/entities/connectCredential.interface.d.ts +7 -0
- package/dist/src/file-picker/integrations/box.d.ts +3 -0
- package/dist/src/index.js +1 -1
- package/dist/src/types/action.d.ts +4 -4
- package/dist/src/types/connect.d.ts +19 -21
- package/dist/src/types/sdk.d.ts +34 -36
- package/package.json +1 -1
|
@@ -221,7 +221,7 @@ export declare enum TokenType {
|
|
|
221
221
|
ZOHO_CRM_ACCOUNTS_SERVER = "ZOHO_CRM_ACCOUNTS_SERVER",
|
|
222
222
|
ZOHO_CRM_API_DOMAIN = "ZOHO_CRM_API_DOMAIN"
|
|
223
223
|
}
|
|
224
|
-
export type DataSource = DynamicDataSource<any> | StaticEnumDataSource | FieldMapperDataSource | ComboInputDataSource
|
|
224
|
+
export type DataSource = DynamicDataSource<any> | StaticEnumDataSource | FieldMapperDataSource | ComboInputDataSource;
|
|
225
225
|
type BasicDataSource = {
|
|
226
226
|
/**
|
|
227
227
|
* title for data source
|
|
@@ -247,7 +247,7 @@ type BasicDataSource = {
|
|
|
247
247
|
*/
|
|
248
248
|
supportPagination?: boolean;
|
|
249
249
|
};
|
|
250
|
-
|
|
250
|
+
type DynamicDataSource<TValues = EnumInputValue[]> = BasicDataSource & {
|
|
251
251
|
type: DataSourceType.DYNAMIC;
|
|
252
252
|
/**
|
|
253
253
|
* If provided, the response from the refresh method will be saved into the step.
|
|
@@ -302,7 +302,7 @@ declare enum ActionResponseType {
|
|
|
302
302
|
ALERT = "ALERT",
|
|
303
303
|
DISPATCH = "DISPATCH"
|
|
304
304
|
}
|
|
305
|
-
|
|
305
|
+
type StaticEnumDataSource = BasicDataSource & {
|
|
306
306
|
type: DataSourceType.STATIC_ENUM;
|
|
307
307
|
/**
|
|
308
308
|
* id for data source
|
|
@@ -347,7 +347,7 @@ type BaseActionStepParameters = {
|
|
|
347
347
|
retryOnFailure?: boolean;
|
|
348
348
|
ignoreFailure?: boolean;
|
|
349
349
|
};
|
|
350
|
-
|
|
350
|
+
declare enum DataSourceType {
|
|
351
351
|
DYNAMIC = "DYNAMIC_DATA_SOURCE",
|
|
352
352
|
STATIC_ENUM = "STATIC_ENUM_DATA_SOURCE",
|
|
353
353
|
FIELD_MAPPER = "FIELD_MAPPER_DATA_SOURCE",
|
|
@@ -2,7 +2,7 @@ import { IConnectSDKProject } from 'src/entities/project.interface';
|
|
|
2
2
|
import { ConnectCredentialProviderData, CredentialStatus, IConnectCredential } from '../entities/connectCredential.interface';
|
|
3
3
|
import { ConnectCredentialConfigMeta, IConnectCredentialConfig } from '../entities/connectCredentialConfig.interface';
|
|
4
4
|
import { PersonaMeta } from '../entities/persona.interface';
|
|
5
|
-
import { AccountType, BooleanInput, ComboInput, CopyableButtonInput, CustomDropdownInput, DataSource, DynamicComboInput,
|
|
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
8
|
import { CredentialConfigOptions, IntegrationInstallEvent, LoadCustomDropdownOptionsResult } from './sdk';
|
|
@@ -14,7 +14,9 @@ export interface SDKConnectCredentialConfig {
|
|
|
14
14
|
workflowSettings?: IntegrationWorkflowStateMap;
|
|
15
15
|
configMeta?: ConnectCredentialConfigMeta;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* The `externalId` of the active credential **config** (i.e. `IConnectCredentialConfig.externalId`).
|
|
18
|
+
* This is a config-level identifier set via `createConfiguration({ externalId })` and is unrelated
|
|
19
|
+
* to the credential-level `externalId` set at install time via `InstallOptions.externalId`.
|
|
18
20
|
*/
|
|
19
21
|
externalId?: string;
|
|
20
22
|
/**
|
|
@@ -127,25 +129,6 @@ export type SerializedConnectInput<TInputType extends SupportedConnectInputType
|
|
|
127
129
|
}[TInputType] & {
|
|
128
130
|
tooltip?: string;
|
|
129
131
|
};
|
|
130
|
-
export type SingleSource = {
|
|
131
|
-
kind: 'single';
|
|
132
|
-
source: DynamicDataSource<any> | StaticEnumDataSource;
|
|
133
|
-
};
|
|
134
|
-
export type FieldMapperSources = {
|
|
135
|
-
kind: 'fieldMapper';
|
|
136
|
-
recordSource: DynamicDataSource<any>;
|
|
137
|
-
fieldSource: DynamicDataSource<any>;
|
|
138
|
-
dependentInputSource?: DynamicDataSource<any>;
|
|
139
|
-
dependentFieldInputSource?: DynamicDataSource<any>;
|
|
140
|
-
mapObjectFieldOptions?: DynamicMappingOptions | DynamicMappingField[];
|
|
141
|
-
};
|
|
142
|
-
export type DefaultFieldValueSources = {
|
|
143
|
-
kind: 'defaultFieldValue';
|
|
144
|
-
mainInputSource: DynamicDataSource<any>;
|
|
145
|
-
dependentInputSource: DynamicDataSource<any>;
|
|
146
|
-
variableInputSource?: DynamicDataSource<any>;
|
|
147
|
-
};
|
|
148
|
-
export type InputSources = SingleSource | FieldMapperSources | DefaultFieldValueSources;
|
|
149
132
|
type IntegrationWorkflowMetaMap = {
|
|
150
133
|
[id: string]: IntegrationWorkflowMeta;
|
|
151
134
|
};
|
|
@@ -194,6 +177,12 @@ export type CustomDropdownField = {
|
|
|
194
177
|
};
|
|
195
178
|
export type CustomDropdownOptions = {
|
|
196
179
|
loadOptions: (cursor: string | undefined, search: string | undefined) => LoadCustomDropdownOptionsResult;
|
|
180
|
+
/**
|
|
181
|
+
* If true, the dropdown options will be reloaded every time the dropdown is opened.
|
|
182
|
+
* Useful for dependent dropdowns where options depend on other input values.
|
|
183
|
+
* @default false
|
|
184
|
+
*/
|
|
185
|
+
refreshOnOpen?: boolean;
|
|
197
186
|
};
|
|
198
187
|
export type DynamicMappingField = {
|
|
199
188
|
label: string;
|
|
@@ -350,4 +339,13 @@ export type StartOptions = {
|
|
|
350
339
|
allowMultipleCredentials?: boolean;
|
|
351
340
|
overrideRedirectUrl?: string;
|
|
352
341
|
selectedCredentialId?: string;
|
|
342
|
+
/**
|
|
343
|
+
* A customer-supplied external identifier to associate with the credential being installed.
|
|
344
|
+
* Distinct from the config-level `externalId` in `createConfiguration({ externalId })`.
|
|
345
|
+
* Forwarded to the backend in `installOptions` and stored on the resulting credential.
|
|
346
|
+
*
|
|
347
|
+
* Cannot be combined with `selectedCredentialId` — `externalId` labels a new credential;
|
|
348
|
+
* `selectedCredentialId` targets an existing credential for re-authentication.
|
|
349
|
+
*/
|
|
350
|
+
externalId?: string;
|
|
353
351
|
};
|
package/dist/src/types/sdk.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ 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, GetIntegrationAccountOptions,
|
|
11
|
-
import { DataSource,
|
|
10
|
+
import { AuthenticatedConnectUser, CustomDropdownField, CustomDropdownOptions, DisableWorkflowOptions, DynamicMappingField, DynamicMappingOptions, GetIntegrationAccountOptions, IntegrationWorkflowMeta, IntegrationWorkflowState, SerializedConnectInput, UninstallOptions } from '../types/connect';
|
|
11
|
+
import { DataSource, DynamicDefaultInput, EnumInputValue } from './action';
|
|
12
12
|
import { Props as ConnectModalProps } from './connectModal';
|
|
13
13
|
import { DataType, KeyedSource } from './resolvers';
|
|
14
14
|
export type ConnectUser = {
|
|
@@ -107,6 +107,12 @@ export type DynamicFieldMappingConfig = {
|
|
|
107
107
|
};
|
|
108
108
|
export interface IConnectSDK {
|
|
109
109
|
authenticate(projectId: string, token: string, options?: AuthenticateOptions): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Displays the Paragon Connect modal for the given integration.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} action - The integration type to connect (e.g. `"gmail"`).
|
|
114
|
+
* @param {ConnectParams} options - Optional connect configuration (extends `InstallOptions`).
|
|
115
|
+
*/
|
|
110
116
|
connect(action: string, options: ConnectParams): void;
|
|
111
117
|
getVersion(): string;
|
|
112
118
|
getUser(): ConnectUser;
|
|
@@ -125,18 +131,22 @@ export interface IConnectSDK {
|
|
|
125
131
|
*/
|
|
126
132
|
_oauthErrorCallback(errorMessage: string, event?: MessageEvent): Promise<void>;
|
|
127
133
|
/**
|
|
128
|
-
*
|
|
129
|
-
* TODO(UI/UX): Create type
|
|
130
|
-
* Destroys an existing configuration using the provided instance ID.
|
|
134
|
+
* Load custom dropdown options with pagination and search support.
|
|
131
135
|
*
|
|
132
|
-
* @param {string}
|
|
133
|
-
* @
|
|
136
|
+
* @param {string} key - The key identifier for the dropdown.
|
|
137
|
+
* @param {string} cursor - Optional cursor for pagination.
|
|
138
|
+
* @param {string} search - Optional search term to filter options.
|
|
139
|
+
* @returns {LoadCustomDropdownOptionsResult} - A promise that resolves to the dropdown options.
|
|
134
140
|
*/
|
|
135
141
|
_loadCustomDropdownOptions(key: string, cursor?: string | undefined, search?: string | undefined): LoadCustomDropdownOptionsResult;
|
|
136
142
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
143
|
+
* Installs an integration without the need to click on enable button from portal.
|
|
144
|
+
*
|
|
145
|
+
* @param {string} name - The integration type to install (e.g. `"gmail"`).
|
|
146
|
+
* @param {InstallIntegrationOptions} options - Optional install configuration.
|
|
147
|
+
* @param {boolean} options.showPortalAfterInstall - If `true`, shows the portal with configuration
|
|
148
|
+
* view after installation completes.
|
|
149
|
+
* @returns {Promise<void | IntegrationInstallEvent>}
|
|
140
150
|
*/
|
|
141
151
|
installIntegration(name: string, options?: InstallIntegrationOptions): Promise<void | IntegrationInstallEvent>;
|
|
142
152
|
/**
|
|
@@ -255,7 +265,6 @@ export interface IConnectSDK {
|
|
|
255
265
|
}>;
|
|
256
266
|
updateWorkflowState(workflowStateUpdate: Record<string, boolean>, options?: CredentialConfigOptions): Promise<UpdateWorkflowStateResponse>;
|
|
257
267
|
setHeadless(headless: boolean): void;
|
|
258
|
-
setDataSources(config: SetDataSourcesConfig): void;
|
|
259
268
|
getIntegrationId(action: string): string;
|
|
260
269
|
getAccountTypeOptions(params: string): any;
|
|
261
270
|
getPreOptions(params: string): any;
|
|
@@ -276,20 +285,7 @@ export interface IConnectSDK {
|
|
|
276
285
|
nestedData: DynamicDefaultInput[];
|
|
277
286
|
nextPageCursor: string | null;
|
|
278
287
|
}>;
|
|
279
|
-
getFieldOptions(options: {
|
|
280
|
-
integration: string;
|
|
281
|
-
source: DynamicDataSource<any>;
|
|
282
|
-
search?: string;
|
|
283
|
-
cursor?: string | number | false;
|
|
284
|
-
parameters?: KeyedSource<DataType.ANY>[];
|
|
285
|
-
selectedCredentialId?: string;
|
|
286
|
-
}): Promise<{
|
|
287
|
-
data: EnumInputValue[];
|
|
288
|
-
nestedData: DynamicDefaultInput[];
|
|
289
|
-
nextPageCursor: string | null;
|
|
290
|
-
}>;
|
|
291
288
|
getDataSourceOptions(integrationName: string, action: string): Promise<DataSource | undefined>;
|
|
292
|
-
getSourcesForInput(integrationName: string, action: string, input: SerializedConnectInput): InputSources | null;
|
|
293
289
|
installFlow: InstallFlow;
|
|
294
290
|
getAssetUrl(name: string): string;
|
|
295
291
|
}
|
|
@@ -318,6 +314,16 @@ export type InstallOptions = {
|
|
|
318
314
|
* used to override redirect url passed in getAuthUrl instead of our passport url
|
|
319
315
|
*/
|
|
320
316
|
overrideRedirectUrl?: string;
|
|
317
|
+
/**
|
|
318
|
+
* A customer-supplied external identifier to associate with the credential being installed.
|
|
319
|
+
* Distinct from the config-level `externalId` in `createConfiguration({ externalId })`.
|
|
320
|
+
* Forwarded to the backend in `installOptions` and stored on the resulting credential,
|
|
321
|
+
* accessible via `paragon.getUser().integrations[x].allCredentials[i].externalId`.
|
|
322
|
+
*
|
|
323
|
+
* Cannot be combined with `selectedCredentialId` — `externalId` labels a new credential;
|
|
324
|
+
* `selectedCredentialId` targets an existing credential for re-authentication.
|
|
325
|
+
*/
|
|
326
|
+
externalId?: string;
|
|
321
327
|
};
|
|
322
328
|
export type CredentialConfigOptions = {
|
|
323
329
|
selectedCredentialId?: string;
|
|
@@ -387,18 +393,6 @@ export type UserProvidedIntegrationConfig = {
|
|
|
387
393
|
export type DropdownOptions = {
|
|
388
394
|
dropdowns?: Record<string, CustomDropdownField[] | CustomDropdownOptions>;
|
|
389
395
|
};
|
|
390
|
-
export type SetDataSourcesConfig = {
|
|
391
|
-
dropdowns?: Record<string, CustomDropdownField[] | CustomDropdownOptions>;
|
|
392
|
-
mapObjectFields?: {
|
|
393
|
-
[objectName: string]: DynamicMappingField[] | DynamicMappingOptions | DynamicFieldMappingConfig;
|
|
394
|
-
};
|
|
395
|
-
integrationSpecificSources?: Record<string, {
|
|
396
|
-
dropdowns?: Record<string, CustomDropdownField[] | CustomDropdownOptions>;
|
|
397
|
-
mapObjectFields?: {
|
|
398
|
-
[objectName: string]: DynamicMappingField[] | DynamicMappingOptions | DynamicFieldMappingConfig;
|
|
399
|
-
};
|
|
400
|
-
}>;
|
|
401
|
-
};
|
|
402
396
|
export type ConnectParams = CallbackMap & UserProvidedIntegrationConfig & InstallOptions & CredentialConfigOptions & DropdownOptions & CredentialConfigOptions & {
|
|
403
397
|
/**
|
|
404
398
|
* OAuth timeout used only in headless mode
|
|
@@ -466,6 +460,10 @@ export type FilePickerOptions = {
|
|
|
466
460
|
enableSharedDrives?: boolean;
|
|
467
461
|
};
|
|
468
462
|
box?: {
|
|
463
|
+
/**
|
|
464
|
+
* If true, the UI elements will be rendered in a scoped iframe to avoid conflicts with global styles defined by Box.
|
|
465
|
+
*/
|
|
466
|
+
scopeCSS?: boolean;
|
|
469
467
|
container?: string;
|
|
470
468
|
maxSelectable?: number;
|
|
471
469
|
canUpload?: boolean;
|
package/package.json
CHANGED