
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@tailor-platform/db-test
Advanced tools
This is a simple library to test graphql workflows and pipelines. As a side feature, also generates graphql queries automatically and saves them to a folder.
Creates a .gql file for each query type (getOne(singular), list(plural), create, update, delete, and bulkUpsert) for the given type(s). File names are in the format of {queryName}.gql, such as createPurchaseOrder.gql
npm exec gqlprint -- --type PurchaseOrder --output my-output-directory
npm exec gqlprint -- --type ["PurchaseOrder","PurchaseOrderLineItem"] --output my-output-directory
npm exec gqlprint -- --cue my-cue-tailor-db.json --output my-output-directory
Runs tailor tests. To do this it follows these steps:
npm exec tailor-test my-tests-folder
Create json files with the following format
{
"TableName": {
"customEasyAccessName": {
"requiredValue1": "value1",
"requiredValue2": "value2"
}
}
}
For example:
{
"CostPool": {
"costPool1": {
"name": "TEST COST POOL1"
}
}
}
You don't need to specify the id of each record, it will be automatically generated.
On the other hand here is how you specify foreign keys
{
"ParentTable": {
"parentTable1": {
"name": "Parent"
}
},
"ChildTable": {
"childTable1": {
"parentTableID": { "UUID": "ParentTable.parentTable1" },
"name": "Child"
}
}
}
Basically, if you need to assign a UUID, in that field you need the following object:
{ "UUID": "ParentTable.parentTable1" }
Which points to the parentTable1 object inside ParentTable
NOTES
- The order in which you create data does not matter. It will be ordered before creation automatically.
- File names do not matter.
- If there is an error in the data an error will be thrown
- If there is a loop in the db structure an error will be thrown
import { context } from "@tailor-platform/db-test";
test("this is a demo test", async () => {
// All json files in the data folder is loaded to the context.env object
// You can access your objects like this
const contact = context.env.Contact.contact1;
// All fields of contact will automatically be fetched
// even if they don't exist on the json data
const createdAt = contact.createdAt;
// The context loads everything in a depth of 3 by default,
// This means if contact had a contactParent
// you could do this
const contactParent = context.env.Contact.contact1.contactParent;
// and here is how you could access the name
const contactParentName = context.env.Contact.contact1.contactParent.name;
// All of the data in context.env will automatically be deleted
// If you create a record be sure to add it to the environment
const newContact = context.create("Contact", {
name: "Daniel Alvarez",
});
context.addToEnv("Contact", "myNewContact", newContact);
});
import { context } from "@tailor-platform/db-test";
test("this is a demo test", async () => {
const contact = context.env.Contact.contact1;
// To CREATE pass the TableName as the fist argument
// and variables as the second
const newContact = await context.create("Contact", {
name: "Daniel Alvarez",
});
// use addToEnv if you want the record to be deleted after the tests
context.addToEnv("Contact", "myNewContact", newContact);
// To UDPATE pass the TableName as the fist argument
// id as the second
// and variables as the third
await context.update("Contact", contact.id, {
name: "Alvarez Daniel",
});
// After this update the context will be automatically updated
// so if you do this:
console.log(contact.name);
// You'll get "Alvarez Daniel"
// To DELETE pass the TableName as the first argument
// and the id as the second
await context.delete("Contact", contact.id);
// Deleting in tests is not reccomended
// but you can do it if you need to
// To FETCH pass the TableName as the first argument
// and UUID as the second
const myFetchedContact = await context.fetch(
"Contact",
"aaaa-bbbb-cccc-dddddddd-eeee",
);
// To FETCH ALL pass the TableName as the first argument
// This returns a list of all contact objects
const allContacts = await context.fetchAll("Contact");
// To FETCH ALL WITH A TAILOR FILTER
// pass the TableName as the first argument
// pass the tailor filter as the second
const filteredContacts = await context.fetchAll("Contact", {
name: { in: ["Daniel", "Yutaro", "Yo"] },
});
});
import { context } from "@tailor-platform/db-test";
test("this is a demo test", async () => {
// To run pipelines use the runPipeline method
// It takes the exact pipeline name as the first argument
// and the input variables as the second
const myPipelineResult = await context.runPipeline("myPipeline", {
input: {
myInputVars: "something",
},
});
// If your pipeline doesn't need arguments you
// can leave them empty
const myPipelineNoArgsResult = await context.runPipeline("myPipelineNoArgs");
// The data in context.env will be automatically
// refreshed after runPipeline runs
});
FAQs
Unit testing library for the tailor platform
We found that @tailor-platform/db-test 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.