npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@commercetools-test-data/product-tailoring

v10.18.2

Published

Data model for commercetools API ProductTailoring

Readme

@commercetools-test-data/product-tailoring

This package provides the data model for the commercetools platform ProductTailoring type

https://docs.commercetools.com/api/projects/product-tailoring

Install

$ pnpm add -D @commercetools-test-data/product-tailoring

Usage

import {
  ProductTailoringRest,
  ProductTailoringGraphql,
  ProductTailoringDataRest,
  ProductTailoringDataGraphql,
  ProductVariantTailoringRest,
  ProductVariantTailoringGraphql,
  ProductTailoringAttributeRest,
  ProductTailoringAttributeGraphql,
} from '@commercetools-test-data/product-tailoring';

// Basic REST models
const productTailoringRest = ProductTailoringRest.random().build();
const productTailoringDataRest = ProductTailoringDataRest.random().build();
const productVariantTailoringRest =
  ProductVariantTailoringRest.random().build();
const productTailoringAttributeRest =
  ProductTailoringAttributeRest.random().build();

// Basic GraphQL models
const productTailoringGraphql = ProductTailoringGraphql.random().build();
const productTailoringDataGraphql =
  ProductTailoringDataGraphql.random().build();
const productVariantTailoringGraphql =
  ProductVariantTailoringGraphql.random().build();
const productTailoringAttributeGraphql =
  ProductTailoringAttributeGraphql.random().build();

// Presets
const basicRestPreset = ProductTailoringRest.presets.basic().build();
const basicGraphqlPreset = ProductTailoringGraphql.presets.basic().build();

Models

ProductTailoring

The main model representing a product tailoring. Available in both REST and GraphQL variants.

Presets

Basic Preset

The basic preset provides a complete product tailoring with all essential fields and three variants. It includes:

  • Localized fields in English and German:

    • name: "Tailored Product" / "Angepasstes Produkt"
    • description: "Product tailored for specific market" / "Produkt für spezifischen Markt angepasst"
    • metaTitle: "Tailored Product - Meta Title" / "Angepasstes Produkt - Meta Titel"
    • metaDescription: "Meta description for tailored product" / "Meta-Beschreibung für angepasstes Produkt"
    • metaKeywords: "tailored, product, market" / "angepasst, produkt, markt"
    • slug: "tailored-product" / "angepasstes-produkt"
  • Product state:

    • key: "tailored-product-key"
    • published: true
    • hasStagedChanges: false
  • Three variants, each with:

    • Unique ID
    • Two product images with dimensions
    • Color attribute (localized)
    • Size attribute (localized)

Example:

// REST
const basicRest = ProductTailoringRest.presets.basic().build();

// GraphQL
const basicGraphql = ProductTailoringGraphql.presets.basic().build();

ProductTailoringData

Represents the data part of a product tailoring, containing the actual tailored fields.

Example:

const dataRest = ProductTailoringDataRest.random()
  .name(LocalizedString.presets.empty().en('Name').de('Name'))
  .description(
    LocalizedString.presets.empty().en('Description').de('Beschreibung')
  )
  .build();

const dataGraphql = ProductTailoringDataGraphql.random()
  .nameAllLocales(LocalizedString.presets.empty().en('Name').de('Name'))
  .descriptionAllLocales(
    LocalizedString.presets.empty().en('Description').de('Beschreibung')
  )
  .build();

ProductVariantTailoring

Represents a variant within a product tailoring, containing images, attributes, and other variant-specific data.

Example:

const variantRest = ProductVariantTailoringRest.random()
  .id(1)
  .images([
    /* ... */
  ])
  .attributes([
    /* ... */
  ])
  .build();

const variantGraphql = ProductVariantTailoringGraphql.random()
  .id(1)
  .images([
    /* ... */
  ])
  .attributesRaw([
    /* ... */
  ])
  .build();

ProductTailoringAttribute

Represents an attribute within a product variant tailoring.

Example:

const attributeRest = ProductTailoringAttributeRest.random()
  .name('color')
  .value(LocalizedString.presets.empty().en('Red').de('Rot'))
  .build();

const attributeGraphql = ProductTailoringAttributeGraphql.random()
  .name('color')
  .value({
    type: 'ltext',
    value: LocalizedString.presets.empty().en('Red').de('Rot'),
  })
  .build();