@commercetools-test-data/channel
TypeScript icon, indicating that this package has built-in type declarations

10.18.2 • Public • Published

@commercetools-test-data/channel

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

https://docs.commercetools.com/api/projects/channels

Install

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

Usage

import {
  ChannelRest,
  ChannelDraftRest,
  ChannelGraphql,
  ChannelDraftGraphql,
} from '@commercetools-test-data/inventory-entry';

const channelRest = ChannelRest.random().build();
const channelDraftRest = ChannelDraftRest.random().build();

const channelGraphql = ChannelGraphql.random().build();
const channelDraftGraphql = ChannelDraftGraphql.random().build();

// Presets
const withInventorySupplyAndProductDistributionRolesRest =
  ChannelDraftRest.presets
    .withInventorySupplyAndProductDistributionRoles()
    .build();
const withInventorySupplyAndProductDistributionRolesGraphql =
  ChannelDraftGraphql.presets
    .withInventorySupplyAndProductDistributionRoles()
    .build();

For backwards compatibility, we still support using the generic data models, but you should consider them legacy as we will be removing them in the future.

import {
  Channel,
  ChannelDraft,
  type TChannel,
  type TChannelDraft,
} from '@commercetools-test-data/channel';

const channel = Channel.random().build<TChannel>();
const channelDraft = ChannelDraft.random().build<TChannelDraft>();

// Presets
const withInventorySupplyAndProductDistributionRoles = ChannelDraft.presets
  .withInventorySupplyAndProductDistributionRoles()
  .build<TChannelDraft>();

Package Sidebar

Install

npm i @commercetools-test-data/channel

Weekly Downloads

6,229

Version

10.18.2

License

MIT

Unpacked Size

80.6 kB

Total Files

12

Last publish

Collaborators

  • emmenko
  • commercetools-admin
  • tdeekens