Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
flex-plugins-api-toolkit
Advanced tools
A wrapper for performing the most common use cases of the Flex Plugins API.
Install this package using:
# Using npm
npm i -S flex-plugins-api-toolkit
# Using yarn
yarn add flex-plugins-api-toolkit
Instantiate a FlexPluginsAPIToolkit
client by providing username/password (AccountSid/AuthToken, API Key/Secret, or JWE token).
import FlexPluginsAPIToolkit from 'flex-plugins-api-toolkit';
// Instantiate the HTTP client
const toolkit = new FlexPluginsAPIToolkit(process.env.USERNAME, process.env.PASSWORD);
// In case of a JWE token, the username is "token" and the password is your JWE token.
The toolkit provides the following commands.
Note: If you are using the JWE token for authentication, then all identifiers (such as name
, version
, etc) must be the sid of the resource only.
This command deploys a new plugin version to Plugins API. This wrapper upserts a plugin (i.e., updates the plugin if it exists, otherwise creates a new plugin) and then creates a new version.
The command takes an argument object of the format:
interface DeployOption {
name: string;
url: string;
version: string;
friendlyName?: string;
description?: string;
changelog?: string;
isPrivate?: boolean;
}
The command returns a promise of type:
interface DeployPlugin {
pluginSid: string;
pluginVersionSid: string;
name: string;
version: string;
url: string;
friendlyName: string;
description: string;
changelog: string;
isPrivate: boolean;
}
This command creates a new configuration and installs a list of provided plugins.
The command takes an argument object of the format:
interface CreateConfigurationOption {
addPlugins: string[];
version: string;
removePlugins?: string[];
description?: string;
fromConfiguration?: 'active' | string;
}
where the addPlugins
field is an array of plugins formatted as pluginName@version
. It is the list of plugins, and their corresponding versions that you want to include in this plugin (you can use Sids or unique name/version):
const option = {
addPlugins: [
'plugin-sample@1.0.0',
'FPxxx@1.0.0',
'another-plugin@FVxxx',
'FPxxy@FVxxy'
],
...
}
The option removePlugins
is useful when you want to create a new configuration from an existing configuration but then remove some plugins. This parameter is an array of plugin names only:
const option = {
addPlugins: [
'plugin-sample@1.0.0',
'FPxxx@1.0.0',
'another-plugin@FVxxx',
'FPxxy@FVxxy'
],
removePlugins: ['pluginName'],
...
}
The command returns a promise of type:
export interface CreateConfiguration {
configurationSid: string;
version: string;
description: string;
dateCreated: string;
plugins: Array<{
pluginSid: string;
pluginVersionSid: string;
name: string;
version: string;
url: string;
friendlyName: string;
description: string;
changelog: string;
isPrivate: boolean;
phase: number;
}>;
}
This command creates a new release and activates the given configuration.
The command takes an argument object of the format:
interface ReleaseOption {
version: string;
}
where version
is the identifier of the configuration which can be either the version or its sid.
The command returns a promise of type:
interface Release {
releaseSid: string;
configurationSid: string;
version: string;
dateCreated: string;
}
This command returns information about a plugin and its versions.
The command takes an argument object of the format:
interface DescribePluginOption {
name: string;
}
where the name
is either the plugin's unique name or its sid.
The command returns a promise of type:
interface DescribePlugin {
sid: string;
name: string;
friendlyName: string;
description: string;
isActive: boolean;
dateCreated: string;
dateUpdated: string;
versions: Array<{
sid: string;
version: string;
url: string;
changelog: string;
isPrivate: boolean;
isActive: boolean;
dateCreated: string;
}>;
}
The field isActive
is set to true if this plugin is part of an active release. The associated version that is part of the active release also has isActive
set to true.
This command returns information about a plugin version.
The command takes an argument object of the format:
interface DescribePluginVersionOption {
name: string;
version: string;
}
where the name
is either the plugin's unique name or its sid; the version is either the plugin version's version or its sid.
The command returns a promise of type:
interface DescribePluginVersion {
sid: string;
version: string;
url: string;
changelog: string;
isPrivate: boolean;
isActive: boolean;
plugin: {
sid: string;
name: string;
friendlyName: string;
description: string;
dateCreated: string;
dateUpdated: string;
};
dateCreated: string;
}
The field isActive
is set to true if this plugin version is part of an active release.
This command returns information about a configuration, including a list of plugins included in it.
The command takes an argument object of the format:
interface DescribeConfigurationOption {
version: string;
}
where the version
is either the configuration's version or its sid.
The command returns a promise of type:
interface DescribeConfiguration {
sid: string;
version: string;
description: string;
isActive: boolean;
dateCreated: string;
plugins: Array<{
pluginSid: string;
pluginVersionSid: string;
name: string;
version: string;
url: string;
friendlyName: string;
description: string;
changelog: string;
isPrivate: boolean;
phase: number;
}>;
}
The field isActive
is set to true if this configuration is part of an active release.
This command returns information about a release.
The command takes an argument object of the format:
interface DescribeReleaseOption {
sid: string;
}
The command returns a promise of type:
interface Release {
sid: string;
configurationSid: string;
isActive: boolean;
dateCreated: string;
configuration: {
sid: string;
version: string;
description: string;
isActive: boolean;
dateCreated: string;
plugins: Array<{
pluginSid: string;
pluginVersionSid: string;
name: string;
version: string;
url: string;
friendlyName: string;
description: string;
changelog: string;
isPrivate: boolean;
phase: number;
}>;
}
}
The field isActive
is set to true if this release is the active release.
FAQs
Flex Plugins API Toolkit
The npm package flex-plugins-api-toolkit receives a total of 11 weekly downloads. As such, flex-plugins-api-toolkit popularity was classified as not popular.
We found that flex-plugins-api-toolkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.