
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@commercetools-test-data/commons
Advanced tools
This package provides the data model for the commercetools platform common types
https://docs.commercetools.com/api/types
$ pnpm add -D @commercetools-test-data/commons
Addressimport {
Address,
AddressDraft,
type TAddress,
type TAddressDraft,
} from '@commercetools-test-data/commons';
const address = Address.random().build<TAddress>();
const addressDraft = AddressDraft.random().build<TAddressDraft>();
import {
CentPrecisionMoney,
CentPrecisionMoneyDraft,
type TCentPrecisionMoney,
type TCentPrecisionMoneyDraft,
} from '@commercetools-test-data/commons';
const centPrecisionMoney =
CentPrecisionMoney.random().build<TCentPrecisionMoney>();
const centPrecisionMoneyDraft =
CentPrecisionMoneyDraft.random().build<TCentPrecisionMoneyDraft>();
import {
ClientLogging,
type TClientLogging,
} from '@commercetools-test-data/commons';
const clientLogging = ClientLogging.random().build<TClientLogging>();
KeyReferenceimport {
KeyReference,
type TKeyReference,
} from '@commercetools-test-data/commons';
const productKeyRef = KeyReference.random()
.typeId('product')
.build<TKeyReference<'product'>>();
LocalizedStringimport {
LocalizedString,
type TLocalizedString,
} from '@commercetools-test-data/commons';
const name = LocalizedString.random().build<TLocalizedString>();
// Presets
const emptyName = LocalizedString.presets.empty().build<TLocalizedString>();
Moneyimport { Money, type TMoney } from '@commercetools-test-data/money';
const Money = Money.random().build<TMoney>();
Priceimport {
Price,
PriceDraft,
type TPrice,
type TPriceDraft,
} from '@commercetools-test-data/commons';
const price = Price.random().build<TPrice>();
const priceDraft = PriceDraft.random().build<TPriceDraft>();
Referenceimport { Reference, type TReference } from '@commercetools-test-data/commons';
const productRef = Reference.random()
.typeId('product')
.build<TReference<'product'>>();
// Presets
const categoryRef = Reference.presets
.category()
.build<TReference<'category'>>();
FAQs
Data model for commercetools platform common types
The npm package @commercetools-test-data/commons receives a total of 2,846 weekly downloads. As such, @commercetools-test-data/commons popularity was classified as popular.
We found that @commercetools-test-data/commons demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.