Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@useparagon/connect

Package Overview
Dependencies
Maintainers
26
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useparagon/connect - npm Package Compare versions

Comparing version 1.0.20-experimental.8 to 1.0.20

27

dist/src/ConnectSDK.d.ts
import { IConnectCredential } from './entities/connectCredential.interface';
import { IConnectCredentialConfig } from './entities/connectCredentialConfig.interface';
import { OauthCallbackResponse } from './entities/credential.interface';

@@ -8,3 +7,3 @@ import { IConnectIntegrationWithCredentialInfo, IIntegrationMetadata } from './entities/integration.interface';

import { ConnectSdkEnvironments } from './server.types';
import { AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, Props as ConnectModalProps, ConnectParams, ConnectUser, CreateConfigurationOptions, CredentialConfigOptions, DeleteConfigurationOptions, DisableWorkflowOptions, EventInfo, GetIntegrationAccountOptions, IConnectSDK, InstallIntegrationOptions, TriggerWorkflowRequest, UninstallOptions, UpdateConfigurationOptions } from './types';
import { AuthenticateOptions, AuthenticatedConnectUser, CompleteInstallOptions, Props as ConnectModalProps, ConnectParams, ConnectUser, DisableWorkflowOptions, EventInfo, GetIntegrationAccountOptions, IConnectSDK, InstallIntegrationOptions, TriggerWorkflowRequest, UninstallOptions } from './types';
export declare const PARAGON_OVERFLOW_EMPTY_VALUE = "PARAGON_OVERFLOW_EMPTY_VALUE";

@@ -57,3 +56,3 @@ export default class ConnectSDK extends SDKEventEmitter implements IConnectSDK {

* checks
* - if integration name is valid
* - if integartion name is valid
* - if integration is setup in project

@@ -121,4 +120,2 @@ * - if integration is active in project

connect(action: string, params?: ConnectParams): Promise<void>;
private setCredentialConfigForUserState;
private getCredentialAndConfig;
/**

@@ -158,3 +155,3 @@ * Retrieves an integration object from the loaded integrations based on the integration ID.

}): Promise<TResponse | undefined>;
event(name: string, payload: Record<string, unknown>, options?: CredentialConfigOptions): Promise<void>;
event(name: string, payload: Record<string, unknown>): Promise<void>;
/**

@@ -192,3 +189,3 @@ * @summary this will be called to close the modal

*/
workflow(workflowId: string, { selectedCredentialId, selectedConfigurationId, body, query, headers, }?: TriggerWorkflowRequest): Promise<object | undefined>;
workflow(workflowId: string, { selectedCredentialId, body, query, headers }?: TriggerWorkflowRequest): Promise<object | undefined>;
/**

@@ -204,3 +201,2 @@ * for programmatically installing an integration

disableWorkflow(workflowId: string, options?: DisableWorkflowOptions): Promise<void>;
enableWorkflow(workflowId: string, options?: CredentialConfigOptions): Promise<void>;
/**

@@ -214,2 +210,6 @@ * Get account details by integration type. To get accountAuth, includeAccountAuth should be true in options.

/**
* also returns false if unable to find workflow in configured workflow property of any integration
*/
private isWorkflowEnabled;
/**
* gets the user data from api `/sdk/me`

@@ -256,14 +256,3 @@ */

connectAction(resourceName: string, payload: Record<string, unknown>): Promise<IConnectCredential>;
/**
* Creates a new configuration using the provided credentials.
* @param {CreateConfigurationOptions} param0
* @returns {Promise<IConnectCredentialConfig> }
*/
createConfiguration({ credentialId, externalId, }: CreateConfigurationOptions): Promise<IConnectCredentialConfig>;
/**
* Destroys an existing configuration using the provided instance ID.
*/
destroyConfiguration({ id, credentialId }: DeleteConfigurationOptions): Promise<void>;
updateConfiguration({ id, credentialId, meta, }: UpdateConfigurationOptions): Promise<IConnectCredentialConfig>;
private pollForCredential;
}

@@ -1,2 +0,2 @@

import { IConnectCredentialConfig } from './connectCredentialConfig.interface';
import { ConnectCredentialConfig } from '../types/connect';
export interface IConnectCredential {

@@ -6,3 +6,3 @@ id: string;

integrationId: string;
configurations: IConnectCredentialConfig[];
config: ConnectCredentialConfig;
personaId: string;

@@ -9,0 +9,0 @@ isPreviewCredential: boolean;

import { ConnectCredentialProviderData, CredentialStatus, IConnectCredential } from '../entities/connectCredential.interface';
import { ConnectCredentialConfigMeta, IConnectCredentialConfig } from '../entities/connectCredentialConfig.interface';
import { PersonaMeta } from '../entities/persona.interface';
import { AccountType, DataSource, IntegrationConnectInput, SidebarInputType } from './action';
import { OrConditions } from './resolvers';
import { CredentialConfigOptions } from './sdk';
export interface SDKConnectCredentialConfig {
sharedSettings?: IntegrationSharedInputStateMap;
workflowSettings?: IntegrationWorkflowStateMap;
configMeta?: ConnectCredentialConfigMeta;
/**
* this refer `externalId` of credential config containing shared/workflow settings
*/
externalId?: string;
/**
* @deprecated - use `workflowSettings`
*/
export interface ConnectCredentialConfig {
configuredWorkflows?: IntegrationWorkflowStateMap;
/**
* @deprecated - use `configMeta`
*/
isIntegrationEnableTriggered?: boolean;
sharedSettings?: {
[inputId: string]: ConnectInputValue | undefined;
};
}

@@ -50,8 +37,5 @@ type ConnectInputValue = string | number | boolean | FieldMappingValue | ComboInputValue | undefined;

};
export type IntegrationWorkflowStateMap = {
type IntegrationWorkflowStateMap = {
[workflowId: string]: IntegrationWorkflowState | undefined;
};
export type IntegrationSharedInputStateMap = {
[inputId: string]: ConnectInputValue | undefined;
};
export type IntegrationWorkflowState = {

@@ -193,3 +177,2 @@ enabled: boolean;

credentialId?: string;
credentialConfigId?: string;
credentialStatus?: CredentialStatus;

@@ -199,4 +182,3 @@ providerId?: string;

allCredentials: IConnectCredential[];
allConfigurations: IConnectCredentialConfig[];
} & SDKConnectCredentialConfig;
} & ConnectCredentialConfig;
export type SDKIntegrationConfig = {

@@ -218,4 +200,8 @@ oauthInputs: IntegrationConnectInput[];

export type SDKIntegrationState = Partial<Record<string, SDKIntegration>>;
export type UninstallOptions = Pick<CredentialConfigOptions, 'selectedCredentialId'>;
export type DisableWorkflowOptions = CredentialConfigOptions;
export type UninstallOptions = {
selectedCredentialId?: string;
};
export type DisableWorkflowOptions = {
selectedCredentialId?: string;
};
/**

@@ -231,3 +217,2 @@ * method options for getIntegrationAccount in sdk

export declare const SELECTED_CREDENTIAL_ID_HEADER = "X-Paragon-Credential";
export declare const SELECTED_CREDENTIAL_CONFIG_ID_HEADER = "X-Paragon-Configuration-Id";
export {};
import ConnectSDK from '../ConnectSDK';
import { IConnectCredential } from '../entities/connectCredential.interface';
import { IConnectCredentialConfig } from '../entities/connectCredentialConfig.interface';
import { OauthCallbackResponse } from '../entities/credential.interface';

@@ -92,6 +91,2 @@ import { IConnectIntegrationWithCredentialInfo, IIntegrationMetadata } from '../entities/integration.interface';

disableWorkflow(workflowId: string, options: DisableWorkflowOptions): Promise<void>;
/**
* enables a workflow for the connected user and subscribe the workflows in hermes
*/
enableWorkflow(workflowId: string, options: CredentialConfigOptions): Promise<void>;
setUserMetadata(meta: PersonaMeta): Promise<AuthenticatedConnectUser>;

@@ -116,3 +111,3 @@ /**

*/
event(name: string, payload: Record<string, unknown>, options?: CredentialConfigOptions): Promise<void>;
event(name: string, payload: Record<string, unknown>): Promise<void>;
/**

@@ -170,22 +165,2 @@ * makes an connect proxy action request

closePortal(): void;
/**
* Creates a new configuration using the provided credentials.
*
* @param {CreateConfigurationOptions} params - An object containing the necessary parameters.
* @param {string} params.credentialId - The ID of the credential to create the configuration for.
* @param {string} params.externalId - (Optional) An external identifier associated with the configuration.
* @returns {Promise<ICreateConfiguration>} - A promise that resolves to the created configuration object.
*/
createConfiguration(params: CreateConfigurationOptions): Promise<IConnectCredentialConfig>;
/**
* Destroys an existing configuration using the provided instance ID.
*
* @param {DestroyConfigurationParams} params - An object containing the necessary parameters.
* @param {string} params.id - The ID of the configuration to be destroyed.
* @returns {Promise<void>} - A promise that resolves when the configuration is successfully destroyed.
*/
destroyConfiguration(params: {
id: string;
}): Promise<void>;
updateConfiguration(dto: UpdateConfigurationOptions): Promise<IConnectCredentialConfig>;
}

@@ -213,2 +188,3 @@ /**

allowMultipleCredentials?: boolean;
selectedCredentialId?: string;
/**

@@ -219,19 +195,2 @@ * used to override redirect url passed in getAuthUrl instead of our passport url

};
export type CredentialConfigOptions = {
selectedCredentialId?: string;
selectedConfigurationId?: string;
};
export type CreateConfigurationOptions = {
credentialId: string;
externalId?: string;
};
export type DeleteConfigurationOptions = {
id: string;
credentialId: string;
};
export type UpdateConfigurationOptions = {
id: string;
credentialId: string;
meta: Record<string, unknown>;
};
export type AuthenticateOptions = {

@@ -283,3 +242,3 @@ metadata?: PersonaMeta;

};
export type ConnectParams = CallbackMap & UserProvidedIntegrationConfig & InstallOptions & CredentialConfigOptions;
export type ConnectParams = CallbackMap & UserProvidedIntegrationConfig & InstallOptions;
export type EventInfo = {

@@ -312,6 +271,7 @@ type: SDK_EVENT;

}
export type TriggerWorkflowRequest = CredentialConfigOptions & {
export type TriggerWorkflowRequest = {
body?: RequestInit['body'] | object;
headers?: RequestInit['headers'];
query?: Record<string, string>;
selectedCredentialId?: string;
};

@@ -318,0 +278,0 @@ export interface IFilePicker {

@@ -14,7 +14,1 @@ import { NODE_ENV, PLATFORM_ENV } from '../types/environment';

}) => string;
/**
*
* @param externalId
* @returns
*/
export declare function sanitizeExternalConfigId(externalId: string): string;

@@ -31,4 +31,2 @@ /**

export declare function sleep(milliseconds: number): Promise<void>;
export declare const uuidPattern: RegExp;
export declare function isUUID(value: string | unknown): boolean;
/**

@@ -35,0 +33,0 @@ * keeps attempting to execute a method until a desired result is achieved

{
"name": "@useparagon/connect",
"version": "1.0.20-experimental.8",
"version": "1.0.20",
"description": "Embed integrations into your app with the Paragon SDK",

@@ -9,3 +9,2 @@ "main": "dist/src/index.js",

"scripts": {
"start:dev": "NODE_ENV=development webpack serve",
"build:prod": "yarn typecheck && yarn clean && webpack --config webpack.config.js",

@@ -65,3 +64,2 @@ "build:watch": "yarn build --watch",

"glob": "^10.3.10",
"html-webpack-plugin": "^5.6.3",
"jest": "^27.0.6",

@@ -71,3 +69,2 @@ "jest-fetch-mock": "useparagon/jest-fetch-mock.git#3.0.4",

"jest-json-reporter2": "^1.1.0",
"jsonwebtoken": "^9.0.2",
"node-notifier": "^10.0.0",

@@ -93,4 +90,3 @@ "nyc": "^15.1.0",

"webpack-bundle-analyzer": "^4.3.0",
"webpack-cli": "^5.0.2",
"webpack-dev-server": "^5.1.0"
"webpack-cli": "^5.0.2"
},

@@ -97,0 +93,0 @@ "license": "MIT",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc