8.0.0 • Published 8 days ago

@commercetools-test-data/commons v8.0.0

Weekly downloads
1,570
License
MIT
Repository
github
Last release
8 days ago

@commercetools-test-data/commons

This package provides the data model for the commercetools platform common types

https://docs.commercetools.com/api/types

Install

$ pnpm add -D @commercetools-test-data/commons

Usage

Address

import {
  Address,
  AddressDraft,
  type TAddress,
  type TAddressDraft,
} from '@commercetools-test-data/commons';

const address = Address.random().build<TAddress>();
const addressDraft = AddressDraft.random().build<TAddressDraft>();

CentPrecisionMoney

import {
  CentPrecisionMoney,
  CentPrecisionMoneyDraft,
  type TCentPrecisionMoney,
  type TCentPrecisionMoneyDraft,
} from '@commercetools-test-data/commons';

const centPrecisionMoney =
  CentPrecisionMoney.random().build<TCentPrecisionMoney>();
const centPrecisionMoneyDraft =
  CentPrecisionMoneyDraft.random().build<TCentPrecisionMoneyDraft>();

ClientLogging

import {
  ClientLogging,
  type TClientLogging,
} from '@commercetools-test-data/commons';
const clientLogging = ClientLogging.random().build<TClientLogging>();

HighPrecisionMoney

import {
  HighPrecisionMoney,
  HighPrecisionMoneyDraft,
  type THighPrecisionMoney,
  type THighPrecisionMoneyDraft,
} from '@commercetools-test-data/commons';

const highPrecisionMoney =
  HighPrecisionMoney.random().build<THighPrecisionMoney>();
const highPrecisionMoneyDraft =
  HighPrecisionMoneyDraft.random().build<THighPrecisionMoneyDraft>();

KeyReference

import {
  KeyReference,
  KeyReferenceDraft,
  type TKeyReference,
  type TKeyReferenceDraft,
} from '@commercetools-test-data/commons';

const productKeyRef = KeyReference.random()
  .typeId('product')
  .build<TKeyReference<'product'>>();
const productKeyRefDraft = KeyReferenceDraft.random()
  .typeId('product')
  .build<TKeyReferenceDraft<'product'>>();

LocalizedString

import {
  LocalizedString,
  LocalizedStringDraft,
  type TLocalizedString,
  type TLocalizedStringDraft,
} from '@commercetools-test-data/commons';

const name = LocalizedString.random().build<TLocalizedString>();
const nameDraft = LocalizedStringDraft.random().build<TLocalizedString>();

// Presets
const emptyName = LocalizedString.presets.empty().build<TLocalizedString>();
const emptyNameDraft = LocalizedStringDraft.presets
  .empty()
  .build<TLocalizedStringDraft>();

Money

import {
  Money,
  MoneyDraft,
  type TMoney,
  type TMoneyDraft,
} from '@commercetools-test-data/money';

const Money = Money.random().build<TMoney>();
const MoneyDraft = MoneyDraft.random().build<TMoneyDraft>();

Price

import {
  Price,
  PriceDraft,
  type TPrice,
  type TPriceDraft,
} from '@commercetools-test-data/commons';

const price = Price.random().build<TPrice>();
const priceDraft = PriceDraft.random().build<TPriceDraft>();

Reference

import {
  Reference,
  ReferenceDraft,
  type TReference,
  type TReferenceDraft,
} from '@commercetools-test-data/commons';

const productRef = Reference.random()
  .typeId('product')
  .build<TReference<'product'>>();
const productRefDraft = ReferenceDraft.random()
  .typeId('product')
  .build<TReferenceDraft<'product'>>();

// Presets
const categoryRef = Reference.presets
  .category()
  .build<TReference<'category'>>();
const categoryRefDraft = ReferenceDraft.presets
  .category()
  .build<TReferenceDraft<'category'>>();

PriceTier

import { PriceTier, type TPriceTier } from '@commercetools-test-data/commons';

const productRef = PriceTier.random().build<TPriceTier>();

// Presets
const categoryRef = PriceTier.presets.build<TPriceTier>();
@everything-registry/sub-chunk-190@infinitebrahmanuniverse/nolb-_comm@commercetools-test-data/cart-discount@commercetools-test-data/cart-discount-value-absolute@commercetools-test-data/cart-discount-value-fixed@commercetools-test-data/cart-discount-value-gift-line-item@commercetools-test-data/cart-discount-value-relative@commercetools-test-data/category@commercetools-test-data/custom-application@commercetools-test-data/custom-object@commercetools-test-data/custom-view@commercetools-test-data/customer@commercetools-test-data/associate-role@commercetools-test-data/attribute@commercetools-test-data/attribute-definition@commercetools-test-data/attribute-plain-enum-value@commercetools-test-data/attribute-type@commercetools-test-data/business-unit@commercetools-test-data/cart@commercetools-test-data/cent-precision-money@commercetools-test-data/channel@commercetools-test-data/organization@commercetools-test-data/payment@commercetools-test-data/price@commercetools-test-data/product@commercetools-test-data/product-catalog-data@commercetools-test-data/product-data@commercetools-test-data/image@commercetools-test-data/inventory-entry@commercetools-test-data/line-item@commercetools-test-data/money@commercetools-test-data/order@commercetools-test-data/discount-code@commercetools-test-data/customer-group@commercetools-test-data/quote@commercetools-test-data/quote-request@commercetools-test-data/review@commercetools-test-data/shipping-method@commercetools-test-data/shopping-list@commercetools-test-data/staged-quote@commercetools-test-data/zone@commercetools-test-data/product-discount-value-external@commercetools-test-data/product-discount-value-relative@commercetools-test-data/product-selection@commercetools-test-data/product-type@commercetools-test-data/product-variant@commercetools-test-data/standalone-price@commercetools-test-data/state@commercetools-test-data/store@commercetools-test-data/tax-category@commercetools-test-data/tax-rate@commercetools-test-data/product-discount@commercetools-test-data/product-discount-value-absolute@commercetools-test-data/type@commercetools-test-data/user
8.0.0

8 days ago

7.11.0

15 days ago

7.10.0

20 days ago

7.9.1

1 month ago

7.9.0

1 month ago

7.8.0

1 month ago

7.6.0

1 month ago

7.7.1

1 month ago

7.7.0

1 month ago

7.5.0

2 months ago

7.4.0

2 months ago

7.3.0

2 months ago

7.2.13

2 months ago

7.2.12

2 months ago

7.2.11

2 months ago

7.2.10

2 months ago

7.2.9

2 months ago

7.2.8

2 months ago

7.2.7

2 months ago

7.2.6

2 months ago

7.2.5

2 months ago

7.2.4

2 months ago

7.2.3

2 months ago

7.2.2

2 months ago

7.2.1

2 months ago

7.1.1

2 months ago

7.1.0

2 months ago

7.2.0

2 months ago

7.0.0

3 months ago

6.11.0

4 months ago

6.10.0

4 months ago

6.9.0

5 months ago

6.8.1

5 months ago

6.8.0

5 months ago

6.5.0

6 months ago

6.6.0

6 months ago

5.8.2

9 months ago

5.8.1

10 months ago

5.8.0

10 months ago

5.9.0

9 months ago

6.0.0

8 months ago

5.10.1

8 months ago

5.10.0

8 months ago

6.1.0

7 months ago

6.1.1

7 months ago

5.11.2

8 months ago

5.11.1

8 months ago

5.11.0

8 months ago

6.2.0

7 months ago

6.3.4

7 months ago

6.3.3

7 months ago

6.3.6

7 months ago

6.3.5

7 months ago

6.3.8

7 months ago

6.3.7

7 months ago

6.3.0

7 months ago

6.3.2

7 months ago

6.3.1

7 months ago

6.4.2

6 months ago

6.4.1

6 months ago

6.4.0

7 months ago

5.7.0

10 months ago

5.5.1

11 months ago

5.5.0

11 months ago

5.6.0

11 months ago

5.4.1

11 months ago

5.4.0

11 months ago

5.3.6

11 months ago

5.3.5

11 months ago

5.3.3

12 months ago

5.3.2

12 months ago

5.3.1

12 months ago

5.3.0

12 months ago

5.0.0

1 year ago

5.1.1

12 months ago

5.1.0

12 months ago

5.2.0

12 months ago

5.3.4

12 months ago

4.11.0

1 year ago

4.11.1

1 year ago

4.10.0

1 year ago

4.9.0

1 year ago

4.4.0

1 year ago

4.8.0

1 year ago

4.7.0

1 year ago

4.3.0

1 year ago

4.6.0

1 year ago

4.5.0

1 year ago

4.2.2

1 year ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.0

2 years ago

4.1.1

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago