Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
retoolrpc
JavaScript client packageReview Retool's RPC documentation before installing the JavaScript package.
You can use npm
, yarn
, or pnpm
to install the package.
# Using npm
npm install retoolrpc
# Using yarn
yarn add retoolrpc
# Using pnpm
pnpm add retoolrpc
import { RetoolRPC } from 'retoolrpc'
// for CommonJS, uses `require`, e.g.:
// var { RetoolRPC} = require('retoolrpc')
const rpc = new RetoolRPC({
apiToken: 'your-api-token-here', // Replace this token with your API token
host: 'http://localhost:3000/', // Replace this host with your host
resourceId: 'resource-id', // Replace this resource ID with your ID
environmentName: 'production', // Replace this environment name with your name (defaults to production)
pollingIntervalMs: 1000, // The polling interval for the RPC
pollingTimeoutMs: 5000, // The polling timeout for the RPC
version: '0.0.1', // An optional version number for functions schemas
logLevel: 'info', // Change to 'debug' for verbose logging or use own logger implementation by passing a logger param
})
rpc.register({
name: 'helloWorld',
arguments: {
name: { type: 'string', description: 'Your name', required: true },
},
implementation: async (args, context) => {
return {
message: `Hello ${args.name}!`,
context,
}
},
})
await rpc.listen()
For users of Sequelize, we offer an ORM mixin that enables the addition of fundamental model functions with a single function call, registerModel
. When you register a model with rpc
, it automatically registers various remote functions for the model, including create
, update
, createOrUpdate
, findByPk
, findBy
, and findAll
. You can find additional details here.
Following is an example of registering a User
model:
import { RetoolRPC, sequelizeMixin } from 'retoolrpc'
import { User } from './orm/models' // the path to your model may be different
const CustomRPC = sequelizeMixin(RetoolRPC)
const rpc = new CustomRPC({ ... })
rpc.registerModel({
model: Experiment,
findByAttributes: ['id', 'name'],
writeAttributes: ['name'],
})
We plan to support other ORMs in the future.
FAQs
TypeScript package for Retool RPC
The npm package retoolrpc receives a total of 5,176 weekly downloads. As such, retoolrpc popularity was classified as popular.
We found that retoolrpc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.