@commercetools-test-data/product-type
Version:
Data model for commercetools API ProductType
190 lines (144 loc) • 4.53 kB
Markdown
# @commercetools-test-data/product-type
This package provides the data model for the commercetools platform `ProductType` type
https://docs.commercetools.com/api/projects/productTypes#product-types
# Install
```bash
$ pnpm add -D @commercetools-test-data/product-type
```
# Usage
- [AttributeBooleanType](#attributebooleantype)<br>
- [AttributeDefinition](#attributedefinition)<br>
- [AttributeEnumType](#attributeenumtype)<br>
- [AttributeLocalizedEnumType](#attributelocalizedenumtype)<br>
- [AttributeLocalizedEnumValue](#attributelocalizedenumvalue)<br>
- [AttributeLocalizableTextType](#attributelocalizabletexttype)<br>
- [AttributeNumberType](#attributenumbertype)<br>
- [AttributePlainEnumValue](#attributeplainenumvalue)<br>
- [AttributeSetType](#attributesettype)<br>
- [AttributeReferenceType](#attributereferencetype)<br>
- [AttributeTextType](#attributetexttype)<br><br>
- [ProductType](#producttype)<br>
## `AttributeDefinition`
```ts
import {
AttributeDefinition,
AttributeDefinitionDraft,
type TAttributeDefinition,
type TAttributeDefinitionDraft,
} from '@commercetools-test-data/product-type';
const attributeDefinition =
AttributeDefinition.random().build<TAttributeDefinition>();
const attributeDefinitionDraft =
AttributeDefinitionDraft.random().build<TAttributeDefinitionDraft>();
// Presets
const emptyAttributeDefinitionPreset = AttributeDefinitionDraft.presets
.empty()
.build<TAttributeDefinitionDraft>();
```
## `AttributeBooleanType`
```ts
import {
AttributeBooleanType,
type TAttributeBooleanType,
} from '@commercetools-test-data/product-type';
const attributeBooleanType =
AttributeBooleanType.random().build<TAttributeBooleanType>();
```
## `AttributeEnumType`
```ts
import {
AttributeEnumType,
type TAttributeEnumType,
} from '@commercetools-test-data/product-type';
const attributeEnumType =
AttributeEnumType.random().build<TAttributeEnumType>();
```
## `AttributeLocalizedEnumType`
```ts
import {
AttributeLocalizedEnumType,
type TAttributeLocalizedEnumType,
type TAttributeLocalizedEnumValueGraphql,
} from '@commercetools-test-data/product-type';
const attributeLocalizedEnumType =
AttributePLocalizedEnumType.random().build<TAttributeLocalizedEnumValue>();
```
## `AttributeLocalizedEnumValue`
```ts
import {
AttributeLocalizedEnumValue,
type TAttributeLocalizedEnumValue,
type TAttributeLocalizedEnumValueGraphql,
} from '@commercetools-test-data/product-type';
const attributeLocalizedEnumValue =
AttributePLocalizedEnumValue.random().build<TAttributeLocalizedEnumValue>();
```
## `AttributeLocalizableTextType`
```ts
import {
AttributeLocalizableTextType,
type TAttributeLocalizableTextType,
} from '@commercetools-test-data/product-type';
const attributeLocalizableTextType =
AttributeLocalizableTextType.random().build<TattributeLocalizableTextType>();
```
## `AttributeNumberType`
```ts
import {
AttributeNumberType,
type TAttributeNumberType,
} from '@commercetools-test-data/product-type';
const attributeNumberType =
AttributeNumberType.random().build<TAttributeNumberType>();
```
## `AttributePlainEnumValue`
```ts
import {
AttributePlainEnumValue,
type TAttributePlainEnumValue,
type TAttributePlainEnumValueGraphql,
} from '@commercetools-test-data/product-type';
const attributePlainEnumValue =
AttributePlainEnumValue.random().build<TAttributePlainEnumValue>();
```
## `AttributeSetType`
```ts
import {
AttributeSetType,
type TAttributeSetType,
} from '@commercetools-test-data/product-type';
const attributeSetType = AttributeSetType.random().build<TAttributeSetType>();
```
## `AttributeReferenceType`
```ts
import {
AttributeReferenceType,
type TAttributeReferenceType,
} from '@commercetools-test-data/product-type';
const attributeReferenceType =
AttributeReferenceType.random().build<TAttributeReferenceType>();
```
## `AttributeTextType`
```ts
import {
AttributeTextType,
type TAttributeTextType,
} from '@commercetools-test-data/product-type';
const attributeTextType =
AttributeTextType.random().build<TAttributeTextType>();
```
## `ProductType`
```ts
import {
ProductType,
ProductTypeDraft,
type TProductType,
type TProductTypeDraft,
} from '@commercetools-test-data/product-type';
const productType = ProductType.random().build<TProductType>();
const productTypeDraft = ProductTypeDraft.random().build<TProductTypeDraft>();
// Presets
const emptyProductTypeDraft = ProductTypeDraft.presets
.empty()
.build<TProductTypeDraft>();
```