@useparagon/connect 1.0.24-experimental.12 → 1.0.24-experimental.13
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/index.html +161 -0
- package/dist/src/index.js +5924 -0
- package/dist/src/sandbox/sandbox.d.ts +10 -0
- package/dist/src/sandbox.js +43817 -0
- package/dist/src/src/ConnectSDK.d.ts +266 -0
- package/dist/src/src/SDKEventEmitter.d.ts +56 -0
- package/dist/src/src/constants.d.ts +2 -0
- package/dist/src/src/entities/base.entity.d.ts +5 -0
- package/dist/src/src/entities/connectCredential.interface.d.ts +41 -0
- package/dist/src/src/entities/connectCredentialConfig.interface.d.ts +31 -0
- package/dist/src/src/entities/credential.interface.d.ts +15 -0
- package/dist/src/src/entities/customIntegration.interface.d.ts +60 -0
- package/dist/src/src/entities/integration.interface.d.ts +45 -0
- package/dist/src/src/entities/integrationConfig.interface.d.ts +9 -0
- package/dist/src/src/entities/license.interface.d.ts +6 -0
- package/dist/src/src/entities/persona.interface.d.ts +34 -0
- package/dist/src/src/entities/project.interface.d.ts +32 -0
- package/dist/src/src/entities/steps.d.ts +30 -0
- package/dist/src/src/entities/team.interface.d.ts +19 -0
- package/dist/src/src/entities/user.interface.d.ts +23 -0
- package/dist/src/src/entities/workflow.interface.d.ts +11 -0
- package/dist/src/src/file-picker/integrations/googledrive.d.ts +24 -0
- package/dist/src/src/file-picker/integrations/index.d.ts +7 -0
- package/dist/src/src/file-picker/integrations/onedrive.d.ts +35 -0
- package/dist/src/src/file-picker/types/baseFilePicker.d.ts +51 -0
- package/dist/src/src/file-picker/types/externalFilePicker.d.ts +9 -0
- package/dist/src/src/file-picker/types/index.d.ts +1 -0
- package/dist/src/src/helpers/ConnectUserContext.d.ts +18 -0
- package/dist/src/src/helpers/index.d.ts +29 -0
- package/dist/src/src/helpers/oauth.d.ts +22 -0
- package/dist/src/src/index.d.ts +8 -0
- package/dist/src/src/server.types.d.ts +14 -0
- package/dist/src/src/types/action.d.ts +266 -0
- package/dist/src/src/types/billing.d.ts +2 -0
- package/dist/src/src/types/connect.d.ts +226 -0
- package/dist/src/src/types/connectModal.d.ts +35 -0
- package/dist/src/src/types/environment.d.ts +16 -0
- package/dist/src/src/types/execution.d.ts +5 -0
- package/dist/src/src/types/index.d.ts +9 -0
- package/dist/src/src/types/resolvers.d.ts +297 -0
- package/dist/src/src/types/sdk.d.ts +391 -0
- package/dist/src/src/types/stripe.d.ts +23 -0
- package/dist/src/src/utils/connect.d.ts +19 -0
- package/dist/src/src/utils/crypto.d.ts +7 -0
- package/dist/src/src/utils/generic.d.ts +41 -0
- package/dist/src/src/utils/http.d.ts +57 -0
- package/dist/src/src/utils/throttle.d.ts +118 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IBaseEntity } from './base.entity';
|
|
2
|
+
import { ITeamMember } from './team.interface';
|
|
3
|
+
export declare enum OnboardingStage {
|
|
4
|
+
ADD_TEAM_DETAILS = "ADD_TEAM_DETAILS",
|
|
5
|
+
PROMPT_TUTORIAL = "PROMPT_TUTORIAL",
|
|
6
|
+
IN_TUTORIAL = "IN_TUTORIAL",
|
|
7
|
+
COMPLETED = "COMPLETED",
|
|
8
|
+
COMPLETED_SKIPPED_TUTORIAL = "COMPLETED_SKIPPED_TUTORIAL"
|
|
9
|
+
}
|
|
10
|
+
export interface IUser extends IBaseEntity {
|
|
11
|
+
firstName: string;
|
|
12
|
+
middleName: string;
|
|
13
|
+
lastName: string;
|
|
14
|
+
email: string;
|
|
15
|
+
password: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
teamMembers: ITeamMember[];
|
|
18
|
+
onboardingStage: OnboardingStage;
|
|
19
|
+
admin: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface IUserSanitized extends Omit<IUser, 'admin' | 'password'> {
|
|
22
|
+
impersonated?: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IBaseEntity } from './base.entity';
|
|
2
|
+
import { IProject } from './project.interface';
|
|
3
|
+
export interface IWorkflow extends IBaseEntity {
|
|
4
|
+
description: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
project: IProject;
|
|
7
|
+
teamId?: string;
|
|
8
|
+
isOnboardingWorkflow?: boolean;
|
|
9
|
+
integrationId?: string;
|
|
10
|
+
}
|
|
11
|
+
export type IWorkflowBase = Omit<IWorkflow, 'project' | 'projectId'>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="google.picker" />
|
|
2
|
+
import ConnectSDK from '../../ConnectSDK';
|
|
3
|
+
import { FilePickerInitOptions, FilePickerOptions } from '../../types';
|
|
4
|
+
import { BaseFilePicker } from '../types/baseFilePicker';
|
|
5
|
+
export declare class GoogleDriveFilePicker extends BaseFilePicker {
|
|
6
|
+
private dependencyStatus;
|
|
7
|
+
private accessToken;
|
|
8
|
+
protected instance: google.picker.Picker;
|
|
9
|
+
constructor(options: FilePickerOptions, connectSDKInstance: ConnectSDK);
|
|
10
|
+
private get google();
|
|
11
|
+
getInstance(): google.picker.Picker | null;
|
|
12
|
+
open(): boolean;
|
|
13
|
+
init(options: FilePickerInitOptions): Promise<boolean>;
|
|
14
|
+
protected onScriptLoaded(): void;
|
|
15
|
+
protected onScriptError(): void;
|
|
16
|
+
/**
|
|
17
|
+
* triggers when gapi.load('picker') loads picker successfully
|
|
18
|
+
* */
|
|
19
|
+
private onPickerLoaded;
|
|
20
|
+
/**
|
|
21
|
+
* triggers when user interacts with google file picker modal
|
|
22
|
+
* */
|
|
23
|
+
private pickerCallback;
|
|
24
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GoogleDriveFilePicker } from './googledrive';
|
|
2
|
+
import { OneDriveFilePicker } from './onedrive';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
GoogleDriveFilePicker: typeof GoogleDriveFilePicker;
|
|
5
|
+
OneDriveFilePicker: typeof OneDriveFilePicker;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import ConnectSDK from '../../ConnectSDK';
|
|
2
|
+
import { FilePickerInitOptions, FilePickerOptions } from '../../types';
|
|
3
|
+
import { BaseFilePicker } from '../types/baseFilePicker';
|
|
4
|
+
export declare class OneDriveFilePicker extends BaseFilePicker {
|
|
5
|
+
readonly options: FilePickerOptions;
|
|
6
|
+
readonly connectSDKInstance: ConnectSDK;
|
|
7
|
+
private dependencyStatus;
|
|
8
|
+
private accessToken;
|
|
9
|
+
private domain;
|
|
10
|
+
constructor(options: FilePickerOptions, connectSDKInstance: ConnectSDK);
|
|
11
|
+
getInstance(): null;
|
|
12
|
+
open(): boolean;
|
|
13
|
+
init(options: FilePickerInitOptions): Promise<boolean>;
|
|
14
|
+
protected onScriptLoaded(): void;
|
|
15
|
+
protected onScriptError(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Combines multiple path segments into a single normalized path.
|
|
18
|
+
*
|
|
19
|
+
* - Removes any leading or trailing slashes from each segment.
|
|
20
|
+
* - Ensures the resulting path uses forward slashes (`/`) as the separator.
|
|
21
|
+
* - Does not add a leading or trailing slash to the final combined path.
|
|
22
|
+
*
|
|
23
|
+
* @param paths - An array of path segments to combine.
|
|
24
|
+
* @returns The combined and normalized path as a string.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const combinedPath = combinePaths('folder1/', '/folder2/', '/file.txt');
|
|
28
|
+
* // Result: 'folder1/folder2/file.txt'
|
|
29
|
+
*/
|
|
30
|
+
private combinePaths;
|
|
31
|
+
private launchPicker;
|
|
32
|
+
private setupMessageListener;
|
|
33
|
+
private initializePort;
|
|
34
|
+
private handlePickerCommand;
|
|
35
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import ConnectSDK from '../../ConnectSDK';
|
|
2
|
+
import { FilePickerInitOptions, FilePickerOptions, IFilePicker } from '../../types';
|
|
3
|
+
import { DeferredPromise } from '../../utils/generic';
|
|
4
|
+
export declare abstract class BaseFilePicker implements IFilePicker {
|
|
5
|
+
protected instance: unknown;
|
|
6
|
+
protected options: FilePickerOptions;
|
|
7
|
+
protected initOptions: FilePickerInitOptions;
|
|
8
|
+
abstract open(): boolean;
|
|
9
|
+
abstract init(options: FilePickerInitOptions): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* to be initialised inside {init} method
|
|
12
|
+
* */
|
|
13
|
+
protected dependenciesPromise: DeferredPromise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* bind to the script tag
|
|
16
|
+
*/
|
|
17
|
+
protected abstract onScriptLoaded(): void;
|
|
18
|
+
/**
|
|
19
|
+
* bind to the script tag
|
|
20
|
+
*/
|
|
21
|
+
protected abstract onScriptError(): void;
|
|
22
|
+
protected connectSDKInstance: ConnectSDK;
|
|
23
|
+
constructor(options: FilePickerOptions, connectSDKInstance: ConnectSDK);
|
|
24
|
+
protected initialiseDependencyPromise(): void;
|
|
25
|
+
getInstance(): unknown;
|
|
26
|
+
/**
|
|
27
|
+
* to append script in body
|
|
28
|
+
*/
|
|
29
|
+
protected injectScript(url: string): void;
|
|
30
|
+
protected checkIfScriptLoaded(id: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Validates that the required fields in the options object are present and non-empty.
|
|
33
|
+
*
|
|
34
|
+
* - Checks for missing or empty fields and throws corresponding error messages.
|
|
35
|
+
*
|
|
36
|
+
* @param options - The options object to validate.
|
|
37
|
+
* @param requiredFields - An array of tuples where each tuple contains:
|
|
38
|
+
* - The key to check in the options object.
|
|
39
|
+
* - The error message to throw if the key is missing or empty.
|
|
40
|
+
*
|
|
41
|
+
* @returns A promise that resolves to `true` if all validations pass.
|
|
42
|
+
* @throws An error with the specified message if any validation fails.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await this.validateInitOptions(options, [
|
|
46
|
+
* ['developerKey', 'Please provide a valid developer key'],
|
|
47
|
+
* ['clientId', 'Please provide a valid client ID'],
|
|
48
|
+
* ]);
|
|
49
|
+
*/
|
|
50
|
+
protected validateInitOptions(options: Record<string, any>, requiredFields: [key: string, fieldName: string][]): Promise<boolean>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ConnectSDK from '../../ConnectSDK';
|
|
2
|
+
import { ExternalFilePickerConstruct, FilePickerInitOptions, FilePickerOptions, IFilePicker } from '../../types';
|
|
3
|
+
export default class ExternalFilePicker implements IFilePicker {
|
|
4
|
+
constructor(action: string, options: FilePickerOptions, connectSingleton: ConnectSDK);
|
|
5
|
+
open(): boolean;
|
|
6
|
+
init(options: FilePickerInitOptions): Promise<boolean>;
|
|
7
|
+
getInstance(): any;
|
|
8
|
+
}
|
|
9
|
+
export declare const buildExternalFilePickerInstance: (connectSingleton: ConnectSDK) => ExternalFilePickerConstruct;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ExternalFilePicker, buildExternalFilePickerInstance, } from './externalFilePicker';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import ConnectSDK from '../ConnectSDK';
|
|
2
|
+
import { IConnectSDKProject } from '../entities/project.interface';
|
|
3
|
+
import { ConnectSdkEnvironments } from '../server.types';
|
|
4
|
+
import { AuthenticatedConnectUser } from '../types/connect';
|
|
5
|
+
import { ConnectUser, EventInfo, UserProvidedIntegrationConfig } from '../types/sdk';
|
|
6
|
+
export type IConnectUserContext = {
|
|
7
|
+
user: ConnectUser;
|
|
8
|
+
projectId?: string;
|
|
9
|
+
updateUser?: (user: Partial<AuthenticatedConnectUser>) => void;
|
|
10
|
+
sendAuthenticatedRequest: ConnectSDK['sendConnectRequest'];
|
|
11
|
+
environments: ConnectSdkEnvironments;
|
|
12
|
+
project?: IConnectSDKProject;
|
|
13
|
+
triggerSDKEvent?: (eventInfo: EventInfo) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Ender user supplied integration config
|
|
16
|
+
*/
|
|
17
|
+
endUserIntegrationConfig?: UserProvidedIntegrationConfig;
|
|
18
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SDKIntegration } from '../types/connect';
|
|
2
|
+
import { DataType, KeyedSource } from '../types/resolvers';
|
|
3
|
+
import { NonNullUndefinedField } from '../types/sdk';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param param - KeyedSource<DataType.ANY>[]
|
|
7
|
+
* @description parse KeyedSource for non-dynamic sources
|
|
8
|
+
* @returns {Record<string, string | boolean | undefined>} - parsed key-value pair object
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseKeyedSource(param: KeyedSource<DataType.ANY>[]): Record<string, string | boolean | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* strips null and undefined keys from object
|
|
13
|
+
* @param obj
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function stripUndefinedAndNull<T extends object>(obj: T): NonNullUndefinedField<T>;
|
|
17
|
+
/**
|
|
18
|
+
* provides the action state object after a credential is deleted.
|
|
19
|
+
* @param `deletedCredentialId` (string): The ID of the credential that was deleted.
|
|
20
|
+
* @param `deletedActionState` (`SDKIntegration`): The user state for the action whose credential was deleted
|
|
21
|
+
* @returns an object of type `SDKIntegration`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getActionStateForCredentialDelete: (deletedCredentialId: string, deletedActionState: SDKIntegration) => SDKIntegration;
|
|
24
|
+
/**
|
|
25
|
+
* check if string is empty or not
|
|
26
|
+
* @param value
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare const isStringEmpty: (value: unknown) => boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IConnectIntegrationWithCredentialInfo } from '../entities/integration.interface';
|
|
2
|
+
import { DataType, KeyedSource } from '../types/resolvers';
|
|
3
|
+
import { InstallOptions } from '../types/sdk';
|
|
4
|
+
import { IConnectUserContext } from './ConnectUserContext';
|
|
5
|
+
export declare const CREDENTIAL_POLL_INTERVAL = 3000;
|
|
6
|
+
export declare const MAX_POLL_DURATION = 60000;
|
|
7
|
+
export type OAuthFlowOptions = {
|
|
8
|
+
context: IConnectUserContext;
|
|
9
|
+
integration: IConnectIntegrationWithCredentialInfo;
|
|
10
|
+
endUserSuppliedValues?: {
|
|
11
|
+
[inputId: string]: string;
|
|
12
|
+
};
|
|
13
|
+
authParams?: KeyedSource<DataType.ANY>[] | undefined;
|
|
14
|
+
isPreviewMode?: boolean;
|
|
15
|
+
installOptions?: InstallOptions;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* start oauth flow with new popup
|
|
19
|
+
* @param param0
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare const startOAuthFlow: ({ context, integration, endUserSuppliedValues, authParams, isPreviewMode, installOptions, }: OAuthFlowOptions, sessionId: string) => Window | undefined | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ConnectSDK from './ConnectSDK';
|
|
2
|
+
import { ExternalFilePickerConstruct, IConnectSDK } from './types';
|
|
3
|
+
export * from './types/index';
|
|
4
|
+
export declare const connectSingleton: ConnectSDK;
|
|
5
|
+
export declare const paragon: IConnectSDK & {
|
|
6
|
+
ExternalFilePicker: ExternalFilePickerConstruct;
|
|
7
|
+
};
|
|
8
|
+
export default ConnectSDK;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* environment variables needed for connect sdk
|
|
3
|
+
*/
|
|
4
|
+
export type ConnectSdkEnvironments = {
|
|
5
|
+
CDN_PUBLIC_URL: string;
|
|
6
|
+
CONNECT_PUBLIC_URL: string;
|
|
7
|
+
DASHBOARD_PUBLIC_URL: string;
|
|
8
|
+
NODE_ENV: string;
|
|
9
|
+
PASSPORT_PUBLIC_URL: string;
|
|
10
|
+
PLATFORM_ENV: string;
|
|
11
|
+
WORKER_PROXY_PUBLIC_URL: string;
|
|
12
|
+
VERSION: string;
|
|
13
|
+
ZEUS_PUBLIC_URL: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AuthenticationScheme } from '../entities/credential.interface';
|
|
3
|
+
import { SidebarInput } from './connect';
|
|
4
|
+
import { DataType, KeyedSource, Source } from './resolvers';
|
|
5
|
+
export declare enum SidebarInputType {
|
|
6
|
+
Auth = "AUTH",
|
|
7
|
+
Enum = "ENUM",
|
|
8
|
+
DynamicEnum = "DYNAMIC_ENUM",
|
|
9
|
+
Intent = "INTENT",
|
|
10
|
+
Text = "TEXT",
|
|
11
|
+
TextArea = "TEXTAREA",
|
|
12
|
+
ValueText = "TEXT_NO_VARS",
|
|
13
|
+
ValueTextArea = "TEXTAREA_NO_VARS",
|
|
14
|
+
Code = "CODE",
|
|
15
|
+
ActionButton = "ACTION_BUTTON",
|
|
16
|
+
Conditional = "CONDITIONAL",
|
|
17
|
+
DynamicConditional = "DYNAMIC_CONDITIONAL",
|
|
18
|
+
NestedList = "NESTED_LIST",
|
|
19
|
+
File = "FILE",
|
|
20
|
+
EditableDynamicEnum = "EDITABLE_DYNAMIC_ENUM",
|
|
21
|
+
EditableEnum = "EDITABLE_ENUM",
|
|
22
|
+
BooleanInput = "BOOLEAN_INPUT",
|
|
23
|
+
UserSuppliedCredential = "USER_SUPPLIED_CREDENTIAL",
|
|
24
|
+
NativeDynamicEnumInput = "NATIVE_DYNAMIC_INPUT",
|
|
25
|
+
TimeConstraintInput = "TIME_CONSTRAINT_INPUT",
|
|
26
|
+
LinesListInput = "LinesListInput",
|
|
27
|
+
LinesListDynamicInput = "LinesListDynamicInput",
|
|
28
|
+
Number = "NUMBER",
|
|
29
|
+
Email = "EMAIL",
|
|
30
|
+
URL = "URL",
|
|
31
|
+
EnumTextAreaPairInput = "EnumTextAreaPairInput",
|
|
32
|
+
FieldMapper = "FIELD_MAPPER",
|
|
33
|
+
ComboInput = "COMBO_INPUT",
|
|
34
|
+
Password = "PASSWORD",
|
|
35
|
+
Switch = "SWITCH"
|
|
36
|
+
}
|
|
37
|
+
interface BaseInput {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
subtitle?: ReactNode;
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/**
|
|
43
|
+
* if not provided then treated as true
|
|
44
|
+
*/
|
|
45
|
+
required?: boolean;
|
|
46
|
+
defaultValue?: any;
|
|
47
|
+
documentationLink?: string;
|
|
48
|
+
documentationLinkLabel?: string;
|
|
49
|
+
/**
|
|
50
|
+
* hide input in sidebarsection
|
|
51
|
+
*/
|
|
52
|
+
hidden?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* can not change value if readOnly
|
|
55
|
+
*/
|
|
56
|
+
readOnly?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface IntegrationConnectInput extends BaseInput {
|
|
59
|
+
type: SidebarInputType.ValueText | SidebarInputType.Password | SidebarInputType.DynamicEnum | SidebarInputType.ComboInput | SidebarInputType.Enum | SidebarInputType.Switch | SidebarInputType.ValueTextArea;
|
|
60
|
+
inputType?: string;
|
|
61
|
+
prefixLabel?: string;
|
|
62
|
+
suffixLabel?: string;
|
|
63
|
+
sourceType?: string;
|
|
64
|
+
fallbackText?: string;
|
|
65
|
+
hiddenInConnect?: boolean;
|
|
66
|
+
}
|
|
67
|
+
type EnumSection<T = any> = {
|
|
68
|
+
title: string;
|
|
69
|
+
items: EnumInputValue<T>[];
|
|
70
|
+
};
|
|
71
|
+
type EnumInputValue<T = any> = {
|
|
72
|
+
value: T;
|
|
73
|
+
label: string;
|
|
74
|
+
/**
|
|
75
|
+
* subtitle property is for displaying a little helper text to explain the item in dropdown
|
|
76
|
+
*/
|
|
77
|
+
subtitle?: string;
|
|
78
|
+
};
|
|
79
|
+
export declare enum TokenType {
|
|
80
|
+
ACCESS_TOKEN = "ACCESS_TOKEN",
|
|
81
|
+
REFRESH_TOKEN = "REFRESH_TOKEN",
|
|
82
|
+
BOT_TOKEN = "BOT_TOKEN",
|
|
83
|
+
KLAVIYO_API_KEY = "KLAVIYO_API_KEY",
|
|
84
|
+
MARKETO_CLIENT_ID = "MARKETO_CLIENT_ID",
|
|
85
|
+
MARKETO_CLIENT_SECRET = "MARKETO_CLIENT_SECRETI",
|
|
86
|
+
MARKETO_ENDPOINT = "MARKETO_ENDPOINT",
|
|
87
|
+
MARKETO_IDENTITY = "MARKETO_IDENTITY",
|
|
88
|
+
MONDAY_API_TOKEN = "MONDAY_API_TOKEN",
|
|
89
|
+
ORACLE_CLOUD_URL = "ORACLE_CLOUD_URL",
|
|
90
|
+
ORACLE_PASSWORD = "ORACLE_PASSWORD",
|
|
91
|
+
ORACLE_USERNAME = "ORACLE_USERNAME",
|
|
92
|
+
SAGE_INTACCT_COMPANY_ID = "SAGE_INTACCT_COMPANY_ID",
|
|
93
|
+
SAGE_INTACCT_USER_ID = "SAGE_INTACCT_USER_ID",
|
|
94
|
+
SAGE_INTACCT_USER_PASSWORD = "SAGE_INTACCT_USER_PASSWORD",
|
|
95
|
+
SAILTHRU_COMPANY_KEY = "SAILTHRU_COMPANY_KEY",
|
|
96
|
+
SAILTHRU_COMPANY_SECRET = "SAILTHRU_COMPANY_SECRET",
|
|
97
|
+
SERVICENOW_PASSWORD = "SERVICENOW_PASSWORD",
|
|
98
|
+
SERVICENOW_SUBDOMAIN = "SERVICENOW_SUBDOMAIN",
|
|
99
|
+
SERVICENOW_USERNAME = "SERVICENOW_USERNAME",
|
|
100
|
+
TABLEAU_PERSONAL_ACCESS_TOKEN_NAME = "TABLEAU_PERSONAL_ACCESS_TOKEN_NAME",
|
|
101
|
+
TABLEAU_PERSONAL_ACCESS_TOKEN_SECRET = "TABLEAU_PERSONAL_ACCESS_TOKEN_SECRET",
|
|
102
|
+
TABLEAU_SERVER_NAME = "TABLEAU_SERVER_NAME",
|
|
103
|
+
TABLEAU_SITE_ID = "TABLEAU_SITE_ID",
|
|
104
|
+
TRELLO_API_KEY = "TRELLO_API_KEY",
|
|
105
|
+
TRELLO_API_TOKEN = "TRELLO_API_TOKEN",
|
|
106
|
+
WOOCOMMERCE_CONSUMER_KEY = "WOOCOMMERCE_CONSUMER_KEY",
|
|
107
|
+
WOOCOMMERCE_CONSUMER_SECRET = "WOOCOMMERCE_CONSUMER_SECRET",
|
|
108
|
+
WOOCOMMERCE_STORE_DOMAIN = "WOOCOMMERCE_STORE_DOMAIN",
|
|
109
|
+
WORKABLE_API_ACCESS_TOKEN = "WORKABLE_API_ACCESS_TOKEN",
|
|
110
|
+
WORKABLE_ACCOUNT_SUBDOMAIN = "WORKABLE_ACCOUNT_SUBDOMAIN",
|
|
111
|
+
ZOHO_CRM_ACCOUNTS_SERVER = "ZOHO_CRM_ACCOUNTS_SERVER",
|
|
112
|
+
ZOHO_CRM_API_DOMAIN = "ZOHO_CRM_API_DOMAIN"
|
|
113
|
+
}
|
|
114
|
+
export type DataSource = DynamicDataSource<any> | StaticEnumDataSource | FieldMapperDataSource | ComboInputDataSource;
|
|
115
|
+
type BasicDataSource = {
|
|
116
|
+
/**
|
|
117
|
+
* title for data source
|
|
118
|
+
*/
|
|
119
|
+
title: string;
|
|
120
|
+
/**
|
|
121
|
+
* description for data source
|
|
122
|
+
*/
|
|
123
|
+
subtitle?: ReactNode;
|
|
124
|
+
/**
|
|
125
|
+
* If specified, instructionalText replaces the default text explaining the input under the selection,
|
|
126
|
+
* e.g. "Let your users select <input name> from their <integration name> account."
|
|
127
|
+
*/
|
|
128
|
+
instructionalText?: ReactNode;
|
|
129
|
+
/**
|
|
130
|
+
* If true, this property hides this data source as a Connect field type.
|
|
131
|
+
* @default false
|
|
132
|
+
*/
|
|
133
|
+
hideFromConnectFieldTypes?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* If true, dataSource will be fetched in pagination format
|
|
136
|
+
* @default false
|
|
137
|
+
*/
|
|
138
|
+
supportPagination?: boolean;
|
|
139
|
+
};
|
|
140
|
+
type DynamicDataSource<TValues = EnumInputValue[]> = BasicDataSource & {
|
|
141
|
+
type: DataSourceType.DYNAMIC;
|
|
142
|
+
/**
|
|
143
|
+
* If provided, the response from the refresh method will be saved into the step.
|
|
144
|
+
*/
|
|
145
|
+
cacheKey?: string;
|
|
146
|
+
/**
|
|
147
|
+
* This array is used to determine whether or not the input's values should be
|
|
148
|
+
* refreshed. Strings can be used to specify a KeyedSource dependency within
|
|
149
|
+
* `options.actionParameters`, and a function can be used to specify any other
|
|
150
|
+
* dependency within the step's parameters.
|
|
151
|
+
*
|
|
152
|
+
* If `refreshDependencies` is an empty array, the input will refresh on mount.
|
|
153
|
+
* If `refreshDependencies` is not provided, the input will not refresh unless
|
|
154
|
+
* manually invoked (i.e., by a button).
|
|
155
|
+
*/
|
|
156
|
+
refreshDependencies?: (string | ((options: ActionStepParameters) => any))[];
|
|
157
|
+
/**
|
|
158
|
+
* When the data comes back from the intent requested by the `refresh` method,
|
|
159
|
+
* this is the method used to map the data into the input + cache
|
|
160
|
+
*/
|
|
161
|
+
mapRefreshToValues: (response: any) => TValues;
|
|
162
|
+
/**
|
|
163
|
+
* This method is responsible for specifying the action, intent and parameters
|
|
164
|
+
* for loading the data into the input
|
|
165
|
+
*/
|
|
166
|
+
getRefreshActionParameters: (options: ActionStepParameters, inputs: SidebarInput[], activeInput: SidebarInput) => ActionStepParameters;
|
|
167
|
+
/**
|
|
168
|
+
* called after the input refreshes w/ the values mapped from `mapRefreshToValues`
|
|
169
|
+
*/
|
|
170
|
+
onRefresh?: (value: any) => ActionResponse;
|
|
171
|
+
};
|
|
172
|
+
type ActionResponse = AlertActionResponse | DispatchActionResponse;
|
|
173
|
+
type AlertActionResponse = {
|
|
174
|
+
type: ActionResponseType.ALERT;
|
|
175
|
+
status: ActionResponseStatus;
|
|
176
|
+
message: string;
|
|
177
|
+
};
|
|
178
|
+
type DispatchActionResponse = {
|
|
179
|
+
type: ActionResponseType.DISPATCH;
|
|
180
|
+
status: ActionResponseStatus;
|
|
181
|
+
id: string;
|
|
182
|
+
source: Source;
|
|
183
|
+
};
|
|
184
|
+
declare enum ActionResponseStatus {
|
|
185
|
+
INFO = "INFO",
|
|
186
|
+
ERROR = "ERROR",
|
|
187
|
+
SUCCESS = "SUCCESS"
|
|
188
|
+
}
|
|
189
|
+
declare enum ActionResponseType {
|
|
190
|
+
NONE = "NONE",
|
|
191
|
+
RE_AUTHENTICATE = "RE_AUTHENTICATE",
|
|
192
|
+
ALERT = "ALERT",
|
|
193
|
+
DISPATCH = "DISPATCH"
|
|
194
|
+
}
|
|
195
|
+
type StaticEnumDataSource = BasicDataSource & {
|
|
196
|
+
type: DataSourceType.STATIC_ENUM;
|
|
197
|
+
/**
|
|
198
|
+
* id for data source
|
|
199
|
+
*/
|
|
200
|
+
id: string;
|
|
201
|
+
values: EnumInputValue[] | EnumSection[];
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* A FieldMapperDataSource refers to a source that is able to drive an input that is responsible
|
|
205
|
+
* for mapping remote/integration fields to local/project fields.
|
|
206
|
+
*/
|
|
207
|
+
type FieldMapperDataSource = BasicDataSource & {
|
|
208
|
+
id: string;
|
|
209
|
+
type: DataSourceType.FIELD_MAPPER;
|
|
210
|
+
recordSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
211
|
+
fieldSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* A ComboInputDataSource refers to a source that is able to drive an input that is responsible
|
|
215
|
+
* for combining the remote/integration fields to local/project fields.
|
|
216
|
+
*/
|
|
217
|
+
type ComboInputDataSource = BasicDataSource & {
|
|
218
|
+
id: string;
|
|
219
|
+
type: DataSourceType.COMBO_INPUT;
|
|
220
|
+
mainInputSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
221
|
+
dependentInputSource: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
222
|
+
fieldSource?: DynamicDataSource<(EnumSection | EnumInputValue)[]>;
|
|
223
|
+
};
|
|
224
|
+
type BaseActionStepParameters = {
|
|
225
|
+
actionType: string;
|
|
226
|
+
credentials: string[];
|
|
227
|
+
retryOnFailure?: boolean;
|
|
228
|
+
ignoreFailure?: boolean;
|
|
229
|
+
};
|
|
230
|
+
declare enum DataSourceType {
|
|
231
|
+
DYNAMIC = "DYNAMIC_DATA_SOURCE",
|
|
232
|
+
STATIC_ENUM = "STATIC_ENUM_DATA_SOURCE",
|
|
233
|
+
FIELD_MAPPER = "FIELD_MAPPER_DATA_SOURCE",
|
|
234
|
+
COMBO_INPUT = "COMBO_INPUT_DATA_SOURCE"
|
|
235
|
+
}
|
|
236
|
+
type ActionStepParameters = BaseActionStepParameters & {
|
|
237
|
+
intent: string;
|
|
238
|
+
actionParameters: KeyedSource<DataType.ANY>[];
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* It will override the action alias for making files name more cleaner
|
|
242
|
+
*/
|
|
243
|
+
export declare const overrideActionAlias: Partial<Record<string, string>>;
|
|
244
|
+
export declare const AUTH_TOKEN_ALLOWED_INTEGRATIONS: Record<string, Record<'accessTokenPath', string>>;
|
|
245
|
+
export type AccountType = {
|
|
246
|
+
/**
|
|
247
|
+
* Provide a unique identifier for this account type, so that the relevant `sidebarSections`
|
|
248
|
+
* or `oauthParameters` will be consumed by the AuthSelector accordingly.
|
|
249
|
+
*/
|
|
250
|
+
id: string;
|
|
251
|
+
/**
|
|
252
|
+
* authentication scheme
|
|
253
|
+
*/
|
|
254
|
+
scheme: AuthenticationScheme;
|
|
255
|
+
/**
|
|
256
|
+
* For AuthenticationScheme.OAUTH-schemed credentials, specify value sources to be passed
|
|
257
|
+
* through to the getAuthEssentials action.
|
|
258
|
+
*/
|
|
259
|
+
oauthParameters?: KeyedSource<DataType.ANY>[];
|
|
260
|
+
/**
|
|
261
|
+
* Specify additional user inputs that are required to start the OAuth flow, i.e. a name
|
|
262
|
+
* or subdomain prefix for a service that is a part of the OAuth authorization URL.
|
|
263
|
+
*/
|
|
264
|
+
endUserSuppliedValues?: IntegrationConnectInput[];
|
|
265
|
+
};
|
|
266
|
+
export {};
|