@useparagon/connect 1.0.39 → 1.0.40
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 +158 -3
- package/dist/src/ConnectSDK.js +1 -1
- package/dist/src/entities/integration.interface.d.ts +6 -0
- package/dist/src/file-picker/helpers/microsoftPicker.d.ts +1 -1
- package/dist/src/file-picker/integrations/box.d.ts +1 -1
- package/dist/src/file-picker/integrations/googledrive.d.ts +1 -1
- package/dist/src/helpers/oauth.d.ts +2 -1
- package/dist/src/index.js +1 -1
- package/dist/src/types/action.d.ts +138 -6
- package/dist/src/types/connect.d.ts +18 -8
- package/dist/src/types/connectModal.d.ts +4 -0
- package/dist/src/types/sdk.d.ts +90 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { AuthenticationScheme } from '../entities/credential.interface';
|
|
3
|
-
import { 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",
|
|
@@ -14,6 +14,7 @@ export declare enum SidebarInputType {
|
|
|
14
14
|
Code = "CODE",
|
|
15
15
|
ActionButton = "ACTION_BUTTON",
|
|
16
16
|
Conditional = "CONDITIONAL",
|
|
17
|
+
CustomDropdown = "CUSTOM_DROPDOWN",
|
|
17
18
|
DynamicConditional = "DYNAMIC_CONDITIONAL",
|
|
18
19
|
NestedList = "NESTED_LIST",
|
|
19
20
|
File = "FILE",
|
|
@@ -32,8 +33,30 @@ export declare enum SidebarInputType {
|
|
|
32
33
|
FieldMapper = "FIELD_MAPPER",
|
|
33
34
|
ComboInput = "COMBO_INPUT",
|
|
34
35
|
Password = "PASSWORD",
|
|
35
|
-
Switch = "SWITCH"
|
|
36
|
+
Switch = "SWITCH",
|
|
37
|
+
DynamicComboInput = "DYNAMIC_COMBO_INPUT",
|
|
38
|
+
CopyableButtonInput = "COPYABLE_BUTTON_INPUT",
|
|
39
|
+
Permission = "PERMISSION"
|
|
36
40
|
}
|
|
41
|
+
export declare enum VariableInputType {
|
|
42
|
+
MultiSelect = "multi",
|
|
43
|
+
String = "string",
|
|
44
|
+
Dropdown = "dropdown",
|
|
45
|
+
MultiSelectCheckbox = "multiCheckbox",
|
|
46
|
+
Number = "number"
|
|
47
|
+
}
|
|
48
|
+
export type DynamicDefaultInput = {
|
|
49
|
+
required: boolean;
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
type: VariableInputType;
|
|
53
|
+
items: EnumInputValue[];
|
|
54
|
+
supportDifferentTextFormat: boolean;
|
|
55
|
+
textFormat: string;
|
|
56
|
+
identifierKey: string;
|
|
57
|
+
supportAddItem?: boolean;
|
|
58
|
+
returnsArrayStrings?: boolean;
|
|
59
|
+
};
|
|
37
60
|
interface BaseInput {
|
|
38
61
|
id: string;
|
|
39
62
|
title: string;
|
|
@@ -55,6 +78,90 @@ interface BaseInput {
|
|
|
55
78
|
*/
|
|
56
79
|
readOnly?: boolean;
|
|
57
80
|
}
|
|
81
|
+
export interface BooleanInput extends BaseInput {
|
|
82
|
+
type: SidebarInputType.BooleanInput;
|
|
83
|
+
}
|
|
84
|
+
export interface ValueTextInput extends BaseInput {
|
|
85
|
+
type: SidebarInputType.ValueText;
|
|
86
|
+
inputType?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface NumberInput extends BaseInput {
|
|
89
|
+
type: SidebarInputType.Number;
|
|
90
|
+
}
|
|
91
|
+
export interface EmailInput extends BaseInput {
|
|
92
|
+
type: SidebarInputType.Email;
|
|
93
|
+
}
|
|
94
|
+
export interface PasswordInput extends BaseInput {
|
|
95
|
+
type: SidebarInputType.Password;
|
|
96
|
+
}
|
|
97
|
+
export interface URLInput extends BaseInput {
|
|
98
|
+
type: SidebarInputType.URL;
|
|
99
|
+
}
|
|
100
|
+
export interface CustomDropdownInput extends BaseInput {
|
|
101
|
+
type: SidebarInputType.CustomDropdown;
|
|
102
|
+
key: string;
|
|
103
|
+
keyIsDefault: boolean;
|
|
104
|
+
customDropdownOptions?: CustomDropdownField[];
|
|
105
|
+
}
|
|
106
|
+
export interface EnumInput extends BaseInput {
|
|
107
|
+
type: SidebarInputType.Enum;
|
|
108
|
+
getValues: (options: ActionStepParameters, inputs: SidebarInput[], activeInput: SidebarInput) => EnumInputValue[];
|
|
109
|
+
}
|
|
110
|
+
export type DynamicInput<TValues = EnumInputValue[]> = BaseInput & {
|
|
111
|
+
source: DynamicDataSource<TValues>;
|
|
112
|
+
};
|
|
113
|
+
export interface DynamicEnumInput<TValues = EnumInputValue[]> extends Omit<EnumInput, 'type'>, DynamicInput<TValues> {
|
|
114
|
+
type: SidebarInputType.DynamicEnum;
|
|
115
|
+
source: DynamicDataSource<TValues>;
|
|
116
|
+
}
|
|
117
|
+
export interface ComboInput extends BaseInput {
|
|
118
|
+
type: SidebarInputType.ComboInput;
|
|
119
|
+
source: ComboInputDataSource;
|
|
120
|
+
savedFieldMappings?: {
|
|
121
|
+
label: string;
|
|
122
|
+
}[];
|
|
123
|
+
}
|
|
124
|
+
export interface DynamicComboInput extends BaseInput {
|
|
125
|
+
type: SidebarInputType.DynamicComboInput;
|
|
126
|
+
source: DynamicComboInputDataSource;
|
|
127
|
+
useDynamicFields?: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface FieldMapperInput extends BaseInput {
|
|
130
|
+
type: SidebarInputType.FieldMapper;
|
|
131
|
+
source: FieldMapperDataSource;
|
|
132
|
+
useDynamicMapper?: boolean;
|
|
133
|
+
dynamicObjectName?: string;
|
|
134
|
+
dynamicObjectOptions?: DynamicMappingOptions | DynamicMappingField[];
|
|
135
|
+
/**
|
|
136
|
+
* Represents the array of field mappings that this input should be used for. For every field
|
|
137
|
+
* mapping included in this array, a nested input will be included that is backed by the
|
|
138
|
+
* `source.fieldSource`.
|
|
139
|
+
*/
|
|
140
|
+
savedFieldMappings: {
|
|
141
|
+
label: string;
|
|
142
|
+
}[];
|
|
143
|
+
}
|
|
144
|
+
export interface CopyableButtonInput extends BaseInput {
|
|
145
|
+
type: SidebarInputType.CopyableButtonInput;
|
|
146
|
+
}
|
|
147
|
+
export type ScopeValue = {
|
|
148
|
+
name: string;
|
|
149
|
+
description: string;
|
|
150
|
+
label?: string;
|
|
151
|
+
required?: boolean;
|
|
152
|
+
};
|
|
153
|
+
export interface PermissionInput extends BaseInput {
|
|
154
|
+
type: SidebarInputType.Permission;
|
|
155
|
+
requiredScopes: string[];
|
|
156
|
+
scopes: {
|
|
157
|
+
values: ScopeValue[];
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export interface SwitchInput extends BaseInput {
|
|
161
|
+
type: SidebarInputType.Switch;
|
|
162
|
+
toolTipText?: string;
|
|
163
|
+
titleText?: string;
|
|
164
|
+
}
|
|
58
165
|
export interface IntegrationConnectInput extends BaseInput {
|
|
59
166
|
type: SidebarInputType.ValueText | SidebarInputType.Password | SidebarInputType.DynamicEnum | SidebarInputType.ComboInput | SidebarInputType.Enum | SidebarInputType.Switch | SidebarInputType.ValueTextArea;
|
|
60
167
|
inputType?: string;
|
|
@@ -68,7 +175,7 @@ type EnumSection<T = any> = {
|
|
|
68
175
|
title: string;
|
|
69
176
|
items: EnumInputValue<T>[];
|
|
70
177
|
};
|
|
71
|
-
type EnumInputValue<T = any> = {
|
|
178
|
+
export type EnumInputValue<T = any> = {
|
|
72
179
|
value: T;
|
|
73
180
|
label: string;
|
|
74
181
|
/**
|
|
@@ -204,23 +311,33 @@ type StaticEnumDataSource = BasicDataSource & {
|
|
|
204
311
|
* A FieldMapperDataSource refers to a source that is able to drive an input that is responsible
|
|
205
312
|
* for mapping remote/integration fields to local/project fields.
|
|
206
313
|
*/
|
|
207
|
-
type FieldMapperDataSource = BasicDataSource & {
|
|
314
|
+
export type FieldMapperDataSource = BasicDataSource & {
|
|
208
315
|
id: string;
|
|
209
316
|
type: DataSourceType.FIELD_MAPPER;
|
|
210
317
|
recordSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
318
|
+
dependentInputSource?: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
319
|
+
dependentFieldInputSource?: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
211
320
|
fieldSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
212
321
|
};
|
|
213
322
|
/**
|
|
214
323
|
* A ComboInputDataSource refers to a source that is able to drive an input that is responsible
|
|
215
324
|
* for combining the remote/integration fields to local/project fields.
|
|
216
325
|
*/
|
|
217
|
-
type ComboInputDataSource = BasicDataSource & {
|
|
326
|
+
export type ComboInputDataSource = BasicDataSource & {
|
|
218
327
|
id: string;
|
|
219
328
|
type: DataSourceType.COMBO_INPUT;
|
|
220
329
|
mainInputSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
221
330
|
dependentInputSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
222
331
|
fieldSource?: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
223
332
|
};
|
|
333
|
+
export type DynamicComboInputDataSource = BasicDataSource & {
|
|
334
|
+
id: string;
|
|
335
|
+
type: DataSourceType.DYNAMIC_COMBO_INPUT;
|
|
336
|
+
mainInputSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
337
|
+
dependentInputSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
338
|
+
variableInputSource?: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
339
|
+
hoverDisplayText: string;
|
|
340
|
+
};
|
|
224
341
|
type BaseActionStepParameters = {
|
|
225
342
|
actionType: string;
|
|
226
343
|
credentials: string[];
|
|
@@ -231,7 +348,8 @@ declare enum DataSourceType {
|
|
|
231
348
|
DYNAMIC = "DYNAMIC_DATA_SOURCE",
|
|
232
349
|
STATIC_ENUM = "STATIC_ENUM_DATA_SOURCE",
|
|
233
350
|
FIELD_MAPPER = "FIELD_MAPPER_DATA_SOURCE",
|
|
234
|
-
COMBO_INPUT = "COMBO_INPUT_DATA_SOURCE"
|
|
351
|
+
COMBO_INPUT = "COMBO_INPUT_DATA_SOURCE",
|
|
352
|
+
DYNAMIC_COMBO_INPUT = "DYNAMIC_COMBO_INPUT_DATA_SOURCE"
|
|
235
353
|
}
|
|
236
354
|
type ActionStepParameters = BaseActionStepParameters & {
|
|
237
355
|
intent: string;
|
|
@@ -263,5 +381,19 @@ export type AccountType = {
|
|
|
263
381
|
* or subdomain prefix for a service that is a part of the OAuth authorization URL.
|
|
264
382
|
*/
|
|
265
383
|
endUserSuppliedValues?: IntegrationConnectInput[];
|
|
384
|
+
/**
|
|
385
|
+
* Specify a string to be interpolated into the "Add new {accountDescription} for
|
|
386
|
+
* {providerType}" button. Should be a descriptor for the account, in lowercase. The default
|
|
387
|
+
* value is "account".
|
|
388
|
+
*
|
|
389
|
+
* @example "sandbox account"
|
|
390
|
+
* @example "service account"
|
|
391
|
+
* @default "account"
|
|
392
|
+
*/
|
|
393
|
+
accountDescription?: string;
|
|
394
|
+
/**
|
|
395
|
+
* Specify whether to skip the postOAuth input or not
|
|
396
|
+
*/
|
|
397
|
+
skipPostOAuthInputs?: boolean;
|
|
266
398
|
};
|
|
267
399
|
export {};
|
|
@@ -2,9 +2,11 @@ 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, DataSource, IntegrationConnectInput, SidebarInputType } from './action';
|
|
5
|
+
import { AccountType, BooleanInput, ComboInput, CopyableButtonInput, CustomDropdownInput, DataSource, DynamicComboInput, DynamicEnumInput, EmailInput, FieldMapperInput, IntegrationConnectInput, NumberInput, PasswordInput, PermissionInput, SidebarInputType, SwitchInput, URLInput, ValueTextInput } from './action';
|
|
6
6
|
import { OrConditions } from './resolvers';
|
|
7
7
|
import { CredentialConfigOptions } from './sdk';
|
|
8
|
+
export { CredentialStatus } from '../entities/connectCredential.interface';
|
|
9
|
+
export type { IIntegrationMetadata } from '../entities/integration.interface';
|
|
8
10
|
export interface SDKConnectCredentialConfig {
|
|
9
11
|
sharedSettings?: IntegrationSharedInputStateMap;
|
|
10
12
|
workflowSettings?: IntegrationWorkflowStateMap;
|
|
@@ -18,7 +20,7 @@ export interface SDKConnectCredentialConfig {
|
|
|
18
20
|
*/
|
|
19
21
|
configuredWorkflows?: IntegrationWorkflowStateMap;
|
|
20
22
|
}
|
|
21
|
-
type ConnectInputValue = string | number | boolean | FieldMappingValue | ComboInputValue | undefined;
|
|
23
|
+
export type ConnectInputValue = string | number | boolean | FieldMappingValue | ComboInputValue | undefined;
|
|
22
24
|
type FieldMappingValue = {
|
|
23
25
|
objectMapping?: string;
|
|
24
26
|
fieldMappings?: {
|
|
@@ -89,9 +91,9 @@ type IntegrationSharedMeta = {
|
|
|
89
91
|
*/
|
|
90
92
|
inputs?: SerializedConnectInput[];
|
|
91
93
|
};
|
|
92
|
-
declare const SupportedConnectInputTypes: readonly [SidebarInputType.ValueText, SidebarInputType.DynamicEnum, SidebarInputType.Enum, SidebarInputType.Number, SidebarInputType.Email, SidebarInputType.URL, SidebarInputType.FieldMapper, SidebarInputType.BooleanInput, SidebarInputType.ComboInput, SidebarInputType.Password, SidebarInputType.Switch, SidebarInputType.ValueTextArea];
|
|
93
|
-
type SupportedConnectInputType = (typeof SupportedConnectInputTypes)[number];
|
|
94
|
-
export type SidebarInput =
|
|
94
|
+
declare const SupportedConnectInputTypes: readonly [SidebarInputType.ValueText, SidebarInputType.DynamicEnum, SidebarInputType.Enum, SidebarInputType.Number, SidebarInputType.Email, SidebarInputType.URL, SidebarInputType.FieldMapper, SidebarInputType.BooleanInput, SidebarInputType.ComboInput, SidebarInputType.Password, SidebarInputType.Switch, SidebarInputType.ValueTextArea, SidebarInputType.CustomDropdown, SidebarInputType.DynamicComboInput, SidebarInputType.FieldMapper, SidebarInputType.CopyableButtonInput, SidebarInputType.Permission];
|
|
95
|
+
export type SupportedConnectInputType = (typeof SupportedConnectInputTypes)[number];
|
|
96
|
+
export type SidebarInput = BooleanInput | SwitchInput | ValueTextInput | NumberInput | EmailInput | URLInput | PasswordInput | CustomDropdownInput | DynamicEnumInput | ComboInput | DynamicComboInput | FieldMapperInput | CopyableButtonInput | PermissionInput;
|
|
95
97
|
type SupportedConnectInput<T extends SidebarInput = SidebarInput> = Extract<T, {
|
|
96
98
|
type: SupportedConnectInputType;
|
|
97
99
|
}>;
|
|
@@ -99,7 +101,7 @@ type SupportedConnectInput<T extends SidebarInput = SidebarInput> = Extract<T, {
|
|
|
99
101
|
* A SerializedConnectInput is one that excludes the properties of a DynamicDataSource, which are
|
|
100
102
|
* loaded in at runtime rather than saved in the DB.
|
|
101
103
|
*/
|
|
102
|
-
type SerializedConnectInput<TInputType extends SupportedConnectInputType = SupportedConnectInputType> = {
|
|
104
|
+
export type SerializedConnectInput<TInputType extends SupportedConnectInputType = SupportedConnectInputType> = {
|
|
103
105
|
[T in SupportedConnectInputType]: Extract<SupportedConnectInput, {
|
|
104
106
|
type: T;
|
|
105
107
|
}> extends {
|
|
@@ -126,11 +128,15 @@ type SerializedConnectInput<TInputType extends SupportedConnectInputType = Suppo
|
|
|
126
128
|
type IntegrationWorkflowMetaMap = {
|
|
127
129
|
[id: string]: IntegrationWorkflowMeta;
|
|
128
130
|
};
|
|
129
|
-
type IntegrationWorkflowMeta = {
|
|
131
|
+
export type IntegrationWorkflowMeta = {
|
|
130
132
|
/**
|
|
131
133
|
* The ID of the WorkflowEntity.
|
|
132
134
|
*/
|
|
133
135
|
id: string;
|
|
136
|
+
/**
|
|
137
|
+
* The description of the WorkflowEntity.
|
|
138
|
+
*/
|
|
139
|
+
description?: string;
|
|
134
140
|
/**
|
|
135
141
|
* A longer-form description for the Workflow's functionality. Acts as a "subtitle" to the
|
|
136
142
|
* WorkflowEntity's `description` property.
|
|
@@ -161,6 +167,10 @@ type IntegrationWorkflowMeta = {
|
|
|
161
167
|
*/
|
|
162
168
|
permissions?: OrConditions;
|
|
163
169
|
};
|
|
170
|
+
export type CustomDropdownField = {
|
|
171
|
+
label: string;
|
|
172
|
+
value: string;
|
|
173
|
+
};
|
|
164
174
|
export type DynamicMappingField = {
|
|
165
175
|
label: string;
|
|
166
176
|
value: string;
|
|
@@ -170,6 +180,7 @@ export type DynamicMappingOptions = {
|
|
|
170
180
|
userCanRemoveMappings?: boolean;
|
|
171
181
|
userCanCreateFields?: boolean;
|
|
172
182
|
defaultFields?: string[];
|
|
183
|
+
useBYOFieldMappingOption?: boolean;
|
|
173
184
|
};
|
|
174
185
|
export type AuthenticatedConnectUser = {
|
|
175
186
|
authenticated: true;
|
|
@@ -227,4 +238,3 @@ export type IConnectUserWithProject = IConnectUser & {
|
|
|
227
238
|
export declare const INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS = "auto";
|
|
228
239
|
export declare const SELECTED_CREDENTIAL_ID_HEADER = "X-Paragon-Credential";
|
|
229
240
|
export declare const SELECTED_CREDENTIAL_CONFIG_ID_HEADER = "X-Paragon-Configuration-Id";
|
|
230
|
-
export {};
|
|
@@ -39,6 +39,10 @@ export type Props = {
|
|
|
39
39
|
apiInstallationOptions?: ModalApiInstallationOptions;
|
|
40
40
|
connectionError?: ParagonError | undefined;
|
|
41
41
|
selectedCredentialId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* This flag is used to show the portal after the oauth flow is complete
|
|
44
|
+
* This flag is set to true when the installIntegration method is called with showPortalAfterInstall option
|
|
45
|
+
*/
|
|
42
46
|
shouldShowPortalAfterInstall?: boolean;
|
|
43
47
|
};
|
|
44
48
|
export {};
|
package/dist/src/types/sdk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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';
|
|
@@ -7,8 +7,10 @@ import { IConnectIntegrationWithCredentialInfo, IIntegrationMetadata } from '../
|
|
|
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, IntegrationWorkflowState, UninstallOptions } from '../types/connect';
|
|
10
|
+
import { AuthenticatedConnectUser, DisableWorkflowOptions, DynamicMappingField, DynamicMappingOptions, GetIntegrationAccountOptions, IntegrationWorkflowMeta, IntegrationWorkflowState, SerializedConnectInput, UninstallOptions } from '../types/connect';
|
|
11
|
+
import { DataSource, DynamicDefaultInput, EnumInputValue } from './action';
|
|
11
12
|
import { Props as ConnectModalProps } from './connectModal';
|
|
13
|
+
import { DataType, KeyedSource } from './resolvers';
|
|
12
14
|
export type ConnectUser = {
|
|
13
15
|
authenticated: false;
|
|
14
16
|
} | AuthenticatedConnectUser;
|
|
@@ -47,7 +49,7 @@ export type SDKFunctionErrorMessage = {
|
|
|
47
49
|
id: string;
|
|
48
50
|
};
|
|
49
51
|
export type SDKReceivedMessage = SDKFunctionInvocationMessage;
|
|
50
|
-
export type InstallIntegrationOptions = Partial<Omit<InstallOptions, 'isApiInstallation'> & Omit<CallbackMap, 'onOpen' | 'onClose'
|
|
52
|
+
export type InstallIntegrationOptions = Partial<Omit<InstallOptions, 'isApiInstallation'> & Omit<CallbackMap, 'onOpen' | 'onClose'> & UserProvidedIntegrationConfig>;
|
|
51
53
|
export type CompleteInstallOptions = {
|
|
52
54
|
authorizationCode: string;
|
|
53
55
|
showPortalAfterInstall?: boolean;
|
|
@@ -65,6 +67,42 @@ export type LoadCustomDropdownOptionsResult = Promise<{
|
|
|
65
67
|
}[];
|
|
66
68
|
nextPageCursor: string | null;
|
|
67
69
|
}>;
|
|
70
|
+
export type DynamicFieldMappingOptionsResult = {
|
|
71
|
+
options: {
|
|
72
|
+
label: string;
|
|
73
|
+
value: string;
|
|
74
|
+
}[];
|
|
75
|
+
nextPageCursor: string | null;
|
|
76
|
+
};
|
|
77
|
+
export type DynamicFieldMappingObjectTypesLoader = (cursor?: string, search?: string) => Promise<DynamicFieldMappingOptionsResult>;
|
|
78
|
+
export type DynamicFieldMappingIntegrationFieldsLoader = (params: {
|
|
79
|
+
objectType: string;
|
|
80
|
+
}, cursor?: string, search?: string) => Promise<DynamicFieldMappingOptionsResult>;
|
|
81
|
+
export type DynamicFieldMappingLoaders = {
|
|
82
|
+
objectTypes: DynamicFieldMappingObjectTypesLoader;
|
|
83
|
+
integrationFields: DynamicFieldMappingIntegrationFieldsLoader;
|
|
84
|
+
};
|
|
85
|
+
export declare enum DynamicFieldMappingLoaderType {
|
|
86
|
+
OBJECT_TYPES = "objectTypes",
|
|
87
|
+
INTEGRATION_FIELDS = "integrationFields"
|
|
88
|
+
}
|
|
89
|
+
export type DynamicFieldMappingConfig = {
|
|
90
|
+
objectTypes: {
|
|
91
|
+
get: DynamicFieldMappingObjectTypesLoader;
|
|
92
|
+
};
|
|
93
|
+
integrationFields: {
|
|
94
|
+
get: DynamicFieldMappingIntegrationFieldsLoader;
|
|
95
|
+
};
|
|
96
|
+
applicationFields?: {
|
|
97
|
+
fields: {
|
|
98
|
+
label: string;
|
|
99
|
+
value: string;
|
|
100
|
+
}[];
|
|
101
|
+
defaultFields?: string[];
|
|
102
|
+
userCanRemoveMappings?: boolean;
|
|
103
|
+
userCanCreateFields?: boolean;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
68
106
|
export interface IConnectSDK {
|
|
69
107
|
authenticate(projectId: string, token: string, options?: AuthenticateOptions): Promise<void>;
|
|
70
108
|
connect(action: string, options: ConnectParams): void;
|
|
@@ -201,6 +239,38 @@ export interface IConnectSDK {
|
|
|
201
239
|
*/
|
|
202
240
|
destroyConfiguration(params: DeleteConfigurationOptions): Promise<void>;
|
|
203
241
|
updateConfiguration(dto: UpdateConfigurationOptions): Promise<IConnectCredentialConfig>;
|
|
242
|
+
getIntegrationConfig(integration: string): IntegrationConfig;
|
|
243
|
+
updateIntegrationUserSettings(integration: string, userSettingsUpdate: Record<string, any>, settings?: CredentialConfigOptions): Promise<{
|
|
244
|
+
userState: AuthenticatedConnectUser;
|
|
245
|
+
errors: string[];
|
|
246
|
+
}>;
|
|
247
|
+
updateWorkflowUserSettings(integration: string, workflowId: string, userSettingsUpdate: Record<string, any>, settings?: CredentialConfigOptions): Promise<{
|
|
248
|
+
userState: AuthenticatedConnectUser;
|
|
249
|
+
errors: string[];
|
|
250
|
+
}>;
|
|
251
|
+
updateWorkflowState(workflowStateUpdate: Record<string, boolean>, options?: CredentialConfigOptions): Promise<UpdateWorkflowStateResponse>;
|
|
252
|
+
setHeadless(headless: boolean): void;
|
|
253
|
+
getIntegrationId(action: string): string;
|
|
254
|
+
getAccountTypeOptions(params: string): any;
|
|
255
|
+
getPreOptions(params: string): any;
|
|
256
|
+
getPostOptions(params: string): any;
|
|
257
|
+
startOAuthFlow(action: string, apiInstallationOptions: InstallOptions & CredentialConfigOptions, options?: {
|
|
258
|
+
onSuccess?: (connectCredentialId: string) => void;
|
|
259
|
+
onError?: (error: unknown) => void;
|
|
260
|
+
}): void;
|
|
261
|
+
getFieldOptions(options: {
|
|
262
|
+
integration: string;
|
|
263
|
+
action: string;
|
|
264
|
+
search?: string;
|
|
265
|
+
cursor?: string | number | false;
|
|
266
|
+
parameters?: KeyedSource<DataType.ANY>[];
|
|
267
|
+
}): Promise<{
|
|
268
|
+
data: EnumInputValue[];
|
|
269
|
+
nestedData: DynamicDefaultInput[];
|
|
270
|
+
nextPageCursor: string | null;
|
|
271
|
+
}>;
|
|
272
|
+
getDataSourceOptions(integrationName: string, action: string): Promise<DataSource | undefined>;
|
|
273
|
+
installFlow: InstallFlow;
|
|
204
274
|
}
|
|
205
275
|
/**
|
|
206
276
|
* sdk install options
|
|
@@ -290,7 +360,7 @@ export type UserProvidedIntegrationConfig = {
|
|
|
290
360
|
* This will allow users to provide dynamic fields options for object mapping inputs
|
|
291
361
|
*/
|
|
292
362
|
mapObjectFields?: {
|
|
293
|
-
[objectName: string]: DynamicMappingField[] | DynamicMappingOptions;
|
|
363
|
+
[objectName: string]: DynamicMappingField[] | DynamicMappingOptions | DynamicFieldMappingConfig;
|
|
294
364
|
};
|
|
295
365
|
};
|
|
296
366
|
export type ConnectParams = CallbackMap & UserProvidedIntegrationConfig & InstallOptions & CredentialConfigOptions;
|
|
@@ -374,6 +444,7 @@ export type FilePickerInitOptions = {
|
|
|
374
444
|
developerKey: string;
|
|
375
445
|
appId?: string;
|
|
376
446
|
folderId?: string;
|
|
447
|
+
selectedCredentialId?: string;
|
|
377
448
|
};
|
|
378
449
|
export declare enum FilePickerStatus {
|
|
379
450
|
LOADING = "loading",
|
|
@@ -384,4 +455,19 @@ export interface ExternalFilePickerConstruct {
|
|
|
384
455
|
new (action: string, options: FilePickerOptions): IFilePicker;
|
|
385
456
|
(action: string, options: FilePickerOptions): IFilePicker;
|
|
386
457
|
}
|
|
458
|
+
export type IntegrationConfig = {
|
|
459
|
+
shortDescription?: string;
|
|
460
|
+
longDescription?: string;
|
|
461
|
+
availableUserSettings?: SerializedConnectInput[];
|
|
462
|
+
availableWorkflows: Omit<IntegrationWorkflowMeta, 'order' | 'permissions'>[];
|
|
463
|
+
hiddenWorkflows: Omit<IntegrationWorkflowMeta, 'order' | 'permissions'>[];
|
|
464
|
+
};
|
|
465
|
+
export type UpdateWorkflowStateError = {
|
|
466
|
+
workflowId: string;
|
|
467
|
+
message: string;
|
|
468
|
+
};
|
|
469
|
+
export type UpdateWorkflowStateResponse = {
|
|
470
|
+
user: ConnectUser;
|
|
471
|
+
errors: UpdateWorkflowStateError[];
|
|
472
|
+
};
|
|
387
473
|
export {};
|