@commercetools-test-data/product
v10.11.2
Published
Data models for commercetools API Product
Downloads
11,072
Readme
@commercetools-test-data/product
This package provides the data models for the commercetools platform Product
type representations.
https://docs.commercetools.com/api/projects/products#product
Install
$ pnpm add -D @commercetools-test-data/product
Usage
Attribute
import {
Attribute,
AttributeDraft,
type TAttribute,
type TAttributeDraft,
} from '@commercetools-test-data/product';
const attribute = Attribute.random().build<TAttribute>();
const attributeDraftGraphql =
AttributeDraft.random().buildGraphql<TAttributeDraft>();
Image
import { Image, type TImage } from '@commercetools-test-data/product';
const image = Image.random().build<TImage>();
Product
import {
Product,
ProductDraft,
type TProduct,
type TProductDraft,
} from '@commercetools-test-data/product';
const product = Product.random().build<TProduct>();
const productDraft = ProductDraft.random().build<TProductDraft>();
ProductCatalogData
import {
ProductCatalogData,
type TProductCatalogData,
} from '@commercetools-test-data/product';
const productCatalogData =
ProductCatalogData.random().build<TProductCatalogData>();
ProductData
import {
ProductData,
type TProductData,
} from '@commercetools-test-data/product';
// For REST entities
const productDataRest = ProductData.random().buildRest<TProductData>();
// For Graphql entities
const productDataGraphql = ProductData.random().buildGraphql<TProductData>();
ProductVariant
import {
ProductVariant,
ProductVariantDraft,
type TProductVariant,
type TProductVariantDraft,
} from '@commercetools-test-data/product';
const productVariant = ProductVariant.random().build<TProductVariant>();
const productVariantDraft =
ProductVariantDraft.random().build<TProductVariantDraft>();