Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@thread-together/ts-bigcommerce
Advanced tools
A BigCommerce SDK written in typescript.
Two open source libraries for the BigCommerce API were evaluated.
0.0.0
and published 5 years ago.Each API has request types, response types and series of functions to interact with that API. This library makes use of the Either type for API responses. Per convention, Left
is an error and Right
is success.
Example:
import { BrandRequest, createBrand } from 'ts-bigcommerce';
const brand: BrandRequest = { name: 'Some unique brand name' };
createBrand(brand).then(result => {
if (result.isLeft()) {
console.log(result.value);
throw new Error('Failed to create brand');
} else {
console.log(`Brand id is ${result.value.data.id}`);
}
});
More examples for how to use this library can be found in the tests
directory.
BigCommerce has three main concepts around an item:
physical
or digital
. We are selling clothes, so the type will always be physical
. I will elide this from examples below.BigCommerce organizes these concepts in the following way: Brand -> Product -> Variant
. Most fashion brands organize items in the following way: Brand -> Style -> Sku
. These sort of map 1:1, but BigCommerce gives more flexibility.
The SKU can be assigned at the Product level (known as a Simple Product) or at the Variant level (known as Complex Product).
Brand { name: Urban Decay } -> Product { name: Eyeshadow Palette, price: 20.00, weight: 1, sku: 1234 }
Notice that the SKU is attached to the Product and the price is specified. Many beauty products have no variants, such as size or color.
Brand { name: Theory } -> Product { name: Textured Linen Classic Blazer, price: 0.00, weight: 1 } -> Variant { size: 4, color: Beige Clay Multi, price: 495.00, sku: 5678 }
Notice that the SKU is attached to the Variant. Almost all apparel products have size and color variants. Also notice that the price on the Product is not specified, but the price on the Variant is. I want to establish a convention that the price is always set at the lowest level.
Brand { name: AG Jeans } -> Product { name: The Farrah Skinny Ankle, price: 0.00, weight: 1 } -> Variant { size: 24, color: 4 Years Deep Willows, inseam: 28, price: 215.00, sku: EMP177704YDPW }
Notice that the SKU is attached to the Variant and is alphanumeric. Some apparel products, such as jeans, have unique variants. In this case, inseam is specified on the Variant. Other examples are heel height and shoe width.
Every Product must specify one or more categories. BigCommerce allows for the creation of a tree of categories and each of those categories is referenced through a category id. Each category can contain a lot of information. In these examples are focused on the category name and category id. When creating an item, the leaf category id is specified.
Category:
Women { id: 1 } -> Clothing { id: 2 } -> Apparel { id: 3 }
.
Product:
Brand { name: Theory } -> Product { name: Textured Linen Classic Blazer, categories: [ 3 ], price: 0.00, weight: 1 } -> Variant { size: 4, color: Beige Clay Multi, price: 495.00, sku: 5678 }
A Product may belong to multiple categories. Consider kids shoes that either boys or girls could wear.
Categories:
Shoes { id: 10 } -> Girls' Shoes { id: 11 } -> Sneakers { id: 12 }
Shoes { id: 10 } -> Boys' Shoes { id: 15 } -> Sneakers { id: 16 }
Product:
Brand { name: PUMA } -> Product { name: Smash V2 Sneaker, categories: [ 12, 16 ], price: 0.00, weight: 1 } -> Variant { size: 4, color: Red, price: 35.00, sku: 9012 }
npm run build -- --watch
The tests require a .env
environment file to provide required BigCommerce API authentication values. Copy .env.example
to .env
and fill in the values with real API credentials.
To run the tests, type npm test
.
The ts-bigcommerce
package is is a file dependency for other packages. Publish changes by running npm build
.
FAQs
A BigCommerce SDK written in typescript.
The npm package @thread-together/ts-bigcommerce receives a total of 40 weekly downloads. As such, @thread-together/ts-bigcommerce popularity was classified as not popular.
We found that @thread-together/ts-bigcommerce demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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 threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.