🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

@commercetools-test-data/cart

Package Overview
Dependencies
Maintainers
3
Versions
477
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-test-data/cart

Data model for commercetools API Cart

latest
Source
npmnpm
Version
10.18.2
Version published
Weekly downloads
880
-42.18%
Maintainers
3
Weekly downloads
 
Created
Source

@commercetools-test-data/cart

This package provides the data model for the commercetools platform Cart representations

https://docs.commercetools.com/api/projects/carts#representations

Install

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

Usage

Cart

import {
  Cart,
  CartDraft,
  type TCart,
  type TCartDraft,
} from '@commercetools-test-data/cart';

const cart = Cart.random().build<TCart>();
const cartDraft = CartDraft.random().build<TCartDraft>();

// Presets
const emptyCartDraft = CartDraft.presets.empty().build<TCartDraft>();

CustomLineItem

import {
  CustomLineItemRest,
  CustomLineItemDraftRest,
  CustomLineItemGraphql,
  CustomLineItemDraftGraphql,
} from '@commercetools-test-data/cart';

const restCustomLineItem = CustomLineItemRest.random().build();
const graphqlCustomLineItem = CustomLineItemGraphql.random().build();

const restCustomLineItemDraft = CustomLineItemDraftRest.random().build();
const graphqlCustomLineItemDraft = CustomLineItemDraftGraphql.random().build();

LineItem

import {
  LineItemRest,
  LineItemDraftRest
  LineItemGraphql,
  LineItemDraftGraphql,
} from '@commercetools-test-data/cart';

const restLineItem = LineItemRest.random().build();
const graphqlLineItem = LineItemGraphql.random().build();

const restLineItemDraft = LineItemDraftRest.random().build();
const graphqlLineItemDraft = LineItemDraftGraphql.random().build()

// Presets
const restEmptyLineItemDraft = LineItemDraftRest.presets.empty().build();
const graphqlEmptyLineItemDraft = LineItemDraftGraphql.presets.empty().build()

TaxPortion

import {
  TaxPortionRest,
  TaxPortionDraftRest,
  TaxPortionGraphql,
  TaxPortionDraftGraphql,
} from '@commercetools-test-data/cart';

const restTaxPortion = TaxPortionRest.random().build();
const graphqlTaxPortion = TaxPortionGraphql.random().build();

const restTaxPortionDraft = TaxPortionDraftRest.random().build();
const graphqlTaxPortionDraft = TaxPortionDraftGraphql.random().build();

TaxedItemPrice

import {
  TaxedItemPriceRest,
  TaxedItemPriceGraphql,
} from '@commercetools-test-data/cart';

const restTaxedItemPrice = TaxedItemPriceRest.random().build();
const graphqlTaxedItemPrice = TaxedItemPriceGraphql.random().build();

ShippingInfo

import {
  ShippingInfoRest,
  ShippingInfoGraphql,
} from '@commercetools-test-data/cart';

const restShippingInfo = ShippingInfoRest.random().build();
const graphqlShippingInfo = ShippingInfoGraphql.random().build();

TaxedPrice

import {
  TaxedPriceRest,
  TaxedPriceGraphql,
} from '@commercetools-test-data/cart';

const restTaxedPrice = TaxedPriceRest.random().build();
const graphqlTaxedPrice = TaxedPriceGraphql.random().build();

DirectDiscount

import {
  DirectDiscountRest,
  DirectDiscountGraphql,
  DirectDiscountDraftRest,
  DirectDiscountDraftGraphql,
} from '@commercetools-test-data/cart';

const restDirectDiscount = DirectDiscountRest.random().build();
const graphqlDirectDiscount = DirectDiscountGraphql.random().build();

const restDirectDiscountDraft = DirectDiscountDraftRest.random().build();
const graphqlDirectDiscountDraft = DirectDiscountDraftGraphql.random().build();

DiscountedLineItemPortion

import {
  DiscountedLineItemPortionRest,
  DiscountedLineItemPortionGraphql,
  DiscountedLineItemPortionDraftRest,
  DiscountedLineItemPortionDraftGraphql,
} from '@commercetools-test-data/cart';

const restDiscountedLineItemPortion =
  DiscountedLineItemPortionRest.random().build();
const graphqlDiscountedLineItemPortion =
  DiscountedLineItemPortionGraphql.random().build();

const restDiscountedLineItemPortionDraft =
  DiscountedLineItemPortionDraftRest.random().build();
const graphqlDiscountedLineItemPortionDraft =
  DiscountedLineItemPortionDraftGraphql.random().build();

DiscountedLineItemPrice

import {
  DiscountedLineItemPriceRest,
  DiscountedLineItemPriceGraphql,
} from '@commercetools-test-data/cart';

const restDiscountedLineItemPrice =
  DiscountedLineItemPriceRest.random().build();
const graphqlDiscountedLineItemPrice =
  DiscountedLineItemPriceGraphql.random().build();

DiscountedLineItemPriceForQuantity

import {
  DiscountedLineItemPriceForQuantityRest,
  DiscountedLineItemPriceForQuantityGraphql,
} from '@commercetools-test-data/cart';

const restDiscountedLineItemPriceForQuantity =
  DiscountedLineItemPriceForQuantityRest.random().build();
const graphqlDiscountedLineItemPriceForQuantity =
  DiscountedLineItemPriceForQuantityGraphql.random().build();

Keywords

javascript

FAQs

Package last updated on 08 May 2025

Did you know?

Socket

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.

Install

Related posts