@labdigital/commercetools-mock 3.0.0-beta.0 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/index.mjs +551 -551
  2. package/dist/index.mjs.map +1 -1
  3. package/package.json +1 -1
  4. package/src/schemas/generated/associate-role.ts +4 -4
  5. package/src/schemas/generated/attribute-group.ts +2 -2
  6. package/src/schemas/generated/business-unit.ts +14 -14
  7. package/src/schemas/generated/cart-discount.ts +13 -13
  8. package/src/schemas/generated/cart.ts +30 -30
  9. package/src/schemas/generated/category.ts +10 -10
  10. package/src/schemas/generated/channel.ts +6 -6
  11. package/src/schemas/generated/common.ts +270 -272
  12. package/src/schemas/generated/custom-object.ts +1 -1
  13. package/src/schemas/generated/customer-group.ts +2 -2
  14. package/src/schemas/generated/customer.ts +27 -27
  15. package/src/schemas/generated/discount-code.ts +11 -11
  16. package/src/schemas/generated/discount-group.ts +3 -3
  17. package/src/schemas/generated/extension.ts +2 -2
  18. package/src/schemas/generated/inventory-entry.ts +7 -7
  19. package/src/schemas/generated/my-quote-request.ts +1 -1
  20. package/src/schemas/generated/order-edit.ts +5 -5
  21. package/src/schemas/generated/order-from-cart.ts +9 -9
  22. package/src/schemas/generated/payment.ts +14 -14
  23. package/src/schemas/generated/product-discount.ts +4 -4
  24. package/src/schemas/generated/product-selection.ts +4 -4
  25. package/src/schemas/generated/product-tailoring.ts +10 -10
  26. package/src/schemas/generated/product-type.ts +2 -2
  27. package/src/schemas/generated/product.ts +15 -15
  28. package/src/schemas/generated/quote-request.ts +5 -5
  29. package/src/schemas/generated/quote.ts +4 -4
  30. package/src/schemas/generated/recurrence-policy.ts +2 -2
  31. package/src/schemas/generated/recurring-order.ts +5 -5
  32. package/src/schemas/generated/review.ts +11 -11
  33. package/src/schemas/generated/shipping-method.ts +7 -7
  34. package/src/schemas/generated/shopping-list.ts +11 -11
  35. package/src/schemas/generated/staged-quote.ts +4 -4
  36. package/src/schemas/generated/standalone-price.ts +12 -12
  37. package/src/schemas/generated/state.ts +5 -5
  38. package/src/schemas/generated/store.ts +7 -7
  39. package/src/schemas/generated/subscription.ts +5 -5
  40. package/src/schemas/generated/tax-category.ts +3 -3
  41. package/src/schemas/generated/type.ts +2 -2
  42. package/src/schemas/generated/zone.ts +3 -3
  43. package/src/server.ts +6 -4
@@ -7,5 +7,5 @@ export const CustomObjectDraftSchema = z.object({
7
7
  container: z.string(),
8
8
  key: z.string(),
9
9
  value: z.unknown(),
10
- version: z.number().int().optional(),
10
+ version: z.number().int().nullish(),
11
11
  });
@@ -5,7 +5,7 @@ import { z } from "zod";
5
5
  import { CustomFieldsDraftSchema } from "./common.ts";
6
6
 
7
7
  export const CustomerGroupDraftSchema = z.object({
8
- key: z.string().optional(),
8
+ key: z.string().nullish(),
9
9
  groupName: z.string(),
10
- custom: CustomFieldsDraftSchema.optional(),
10
+ custom: CustomFieldsDraftSchema.nullish(),
11
11
  });
@@ -14,34 +14,34 @@ import {
14
14
  } from "./common.ts";
15
15
 
16
16
  export const CustomerDraftSchema = z.object({
17
- key: z.string().optional(),
18
- customerNumber: z.string().optional(),
19
- externalId: z.string().optional(),
17
+ key: z.string().nullish(),
18
+ customerNumber: z.string().nullish(),
19
+ externalId: z.string().nullish(),
20
20
  email: z.string(),
21
- password: z.string().optional(),
22
- firstName: z.string().optional(),
23
- lastName: z.string().optional(),
24
- middleName: z.string().optional(),
25
- title: z.string().optional(),
26
- anonymousCartId: z.string().optional(),
27
- anonymousCart: CartResourceIdentifierSchema.optional(),
28
- anonymousId: z.string().optional(),
29
- dateOfBirth: z.string().optional(),
30
- companyName: z.string().optional(),
31
- vatId: z.string().optional(),
32
- addresses: z.array(BaseAddressSchema).optional(),
33
- defaultShippingAddress: z.number().int().optional(),
34
- shippingAddresses: z.array(z.number().int()).optional(),
35
- defaultBillingAddress: z.number().int().optional(),
36
- billingAddresses: z.array(z.number().int()).optional(),
37
- isEmailVerified: z.boolean().optional(),
38
- customerGroup: CustomerGroupResourceIdentifierSchema.optional(),
21
+ password: z.string().nullish(),
22
+ firstName: z.string().nullish(),
23
+ lastName: z.string().nullish(),
24
+ middleName: z.string().nullish(),
25
+ title: z.string().nullish(),
26
+ anonymousCartId: z.string().nullish(),
27
+ anonymousCart: CartResourceIdentifierSchema.nullish(),
28
+ anonymousId: z.string().nullish(),
29
+ dateOfBirth: z.string().nullish(),
30
+ companyName: z.string().nullish(),
31
+ vatId: z.string().nullish(),
32
+ addresses: z.array(BaseAddressSchema).nullish(),
33
+ defaultShippingAddress: z.number().int().nullish(),
34
+ shippingAddresses: z.array(z.number().int()).nullish(),
35
+ defaultBillingAddress: z.number().int().nullish(),
36
+ billingAddresses: z.array(z.number().int()).nullish(),
37
+ isEmailVerified: z.boolean().nullish(),
38
+ customerGroup: CustomerGroupResourceIdentifierSchema.nullish(),
39
39
  customerGroupAssignments: z
40
40
  .array(CustomerGroupAssignmentDraftSchema)
41
- .optional(),
42
- custom: CustomFieldsDraftSchema.optional(),
43
- locale: LocaleSchema.optional(),
44
- salutation: z.string().optional(),
45
- stores: z.array(StoreResourceIdentifierSchema).optional(),
46
- authenticationMode: AuthenticationModeSchema.optional(),
41
+ .nullish(),
42
+ custom: CustomFieldsDraftSchema.nullish(),
43
+ locale: LocaleSchema.nullish(),
44
+ salutation: z.string().nullish(),
45
+ stores: z.array(StoreResourceIdentifierSchema).nullish(),
46
+ authenticationMode: AuthenticationModeSchema.nullish(),
47
47
  });
@@ -9,17 +9,17 @@ import {
9
9
  } from "./common.ts";
10
10
 
11
11
  export const DiscountCodeDraftSchema = z.object({
12
- key: z.string().optional(),
13
- name: LocalizedStringSchema.optional(),
14
- description: LocalizedStringSchema.optional(),
12
+ key: z.string().nullish(),
13
+ name: LocalizedStringSchema.nullish(),
14
+ description: LocalizedStringSchema.nullish(),
15
15
  code: z.string(),
16
16
  cartDiscounts: z.array(CartDiscountResourceIdentifierSchema),
17
- cartPredicate: z.string().optional(),
18
- isActive: z.boolean().optional(),
19
- maxApplications: z.number().int().optional(),
20
- maxApplicationsPerCustomer: z.number().int().optional(),
21
- custom: CustomFieldsDraftSchema.optional(),
22
- groups: z.array(z.string()).optional(),
23
- validFrom: z.string().optional(),
24
- validUntil: z.string().optional(),
17
+ cartPredicate: z.string().nullish(),
18
+ isActive: z.boolean().nullish(),
19
+ maxApplications: z.number().int().nullish(),
20
+ maxApplicationsPerCustomer: z.number().int().nullish(),
21
+ custom: CustomFieldsDraftSchema.nullish(),
22
+ groups: z.array(z.string()).nullish(),
23
+ validFrom: z.string().nullish(),
24
+ validUntil: z.string().nullish(),
25
25
  });
@@ -5,9 +5,9 @@ import { z } from "zod";
5
5
  import { LocalizedStringSchema } from "./common.ts";
6
6
 
7
7
  export const DiscountGroupDraftSchema = z.object({
8
- name: LocalizedStringSchema.optional(),
8
+ name: LocalizedStringSchema.nullish(),
9
9
  key: z.string(),
10
- description: LocalizedStringSchema.optional(),
10
+ description: LocalizedStringSchema.nullish(),
11
11
  sortOrder: z.string(),
12
- isActive: z.boolean().optional(),
12
+ isActive: z.boolean().nullish(),
13
13
  });
@@ -8,8 +8,8 @@ import {
8
8
  } from "./common.ts";
9
9
 
10
10
  export const ExtensionDraftSchema = z.object({
11
- key: z.string().optional(),
11
+ key: z.string().nullish(),
12
12
  destination: ExtensionDestinationSchema,
13
13
  triggers: z.array(ExtensionTriggerSchema),
14
- timeoutInMs: z.number().int().optional(),
14
+ timeoutInMs: z.number().int().nullish(),
15
15
  });
@@ -9,12 +9,12 @@ import {
9
9
 
10
10
  export const InventoryEntryDraftSchema = z.object({
11
11
  sku: z.string(),
12
- key: z.string().optional(),
13
- supplyChannel: ChannelResourceIdentifierSchema.optional(),
12
+ key: z.string().nullish(),
13
+ supplyChannel: ChannelResourceIdentifierSchema.nullish(),
14
14
  quantityOnStock: z.number().int(),
15
- minCartQuantity: z.number().int().optional(),
16
- maxCartQuantity: z.number().int().optional(),
17
- restockableInDays: z.number().int().optional(),
18
- expectedDelivery: z.string().optional(),
19
- custom: CustomFieldsDraftSchema.optional(),
15
+ minCartQuantity: z.number().int().nullish(),
16
+ maxCartQuantity: z.number().int().nullish(),
17
+ restockableInDays: z.number().int().nullish(),
18
+ expectedDelivery: z.string().nullish(),
19
+ custom: CustomFieldsDraftSchema.nullish(),
20
20
  });
@@ -6,5 +6,5 @@ import { z } from "zod";
6
6
  export const MyQuoteRequestDraftSchema = z.object({
7
7
  cartId: z.string(),
8
8
  cartVersion: z.number().int(),
9
- comment: z.string().optional(),
9
+ comment: z.string().nullish(),
10
10
  });
@@ -9,10 +9,10 @@ import {
9
9
  } from "./common.ts";
10
10
 
11
11
  export const OrderEditDraftSchema = z.object({
12
- key: z.string().optional(),
12
+ key: z.string().nullish(),
13
13
  resource: OrderReferenceSchema,
14
- stagedActions: z.array(StagedOrderUpdateActionSchema).optional(),
15
- custom: CustomFieldsDraftSchema.optional(),
16
- comment: z.string().optional(),
17
- dryRun: z.boolean().optional(),
14
+ stagedActions: z.array(StagedOrderUpdateActionSchema).nullish(),
15
+ custom: CustomFieldsDraftSchema.nullish(),
16
+ comment: z.string().nullish(),
17
+ dryRun: z.boolean().nullish(),
18
18
  });
@@ -12,14 +12,14 @@ import {
12
12
  } from "./common.ts";
13
13
 
14
14
  export const OrderFromCartDraftSchema = z.object({
15
- id: z.string().optional(),
16
- cart: CartResourceIdentifierSchema.optional(),
15
+ id: z.string().nullish(),
16
+ cart: CartResourceIdentifierSchema.nullish(),
17
17
  version: z.number().int(),
18
- orderNumber: z.string().optional(),
19
- purchaseOrderNumber: z.string().optional(),
20
- paymentState: PaymentStateSchema.optional(),
21
- shipmentState: ShipmentStateSchema.optional(),
22
- orderState: OrderStateSchema.optional(),
23
- state: StateResourceIdentifierSchema.optional(),
24
- custom: CustomFieldsDraftSchema.optional(),
18
+ orderNumber: z.string().nullish(),
19
+ purchaseOrderNumber: z.string().nullish(),
20
+ paymentState: PaymentStateSchema.nullish(),
21
+ shipmentState: ShipmentStateSchema.nullish(),
22
+ orderState: OrderStateSchema.nullish(),
23
+ state: StateResourceIdentifierSchema.nullish(),
24
+ custom: CustomFieldsDraftSchema.nullish(),
25
25
  });
@@ -12,19 +12,19 @@ import {
12
12
  } from "./common.ts";
13
13
 
14
14
  export const PaymentDraftSchema = z.object({
15
- customer: CustomerResourceIdentifierSchema.optional(),
16
- anonymousId: z.string().optional(),
17
- externalId: z.string().optional(),
18
- interfaceId: z.string().optional(),
15
+ customer: CustomerResourceIdentifierSchema.nullish(),
16
+ anonymousId: z.string().nullish(),
17
+ externalId: z.string().nullish(),
18
+ interfaceId: z.string().nullish(),
19
19
  amountPlanned: MoneySchema,
20
- amountAuthorized: MoneySchema.optional(),
21
- authorizedUntil: z.string().optional(),
22
- amountPaid: MoneySchema.optional(),
23
- amountRefunded: MoneySchema.optional(),
24
- paymentMethodInfo: PaymentMethodInfoDraftSchema.optional(),
25
- paymentStatus: PaymentStatusDraftSchema.optional(),
26
- transactions: z.array(TransactionDraftSchema).optional(),
27
- interfaceInteractions: z.array(CustomFieldsDraftSchema).optional(),
28
- custom: CustomFieldsDraftSchema.optional(),
29
- key: z.string().optional(),
20
+ amountAuthorized: MoneySchema.nullish(),
21
+ authorizedUntil: z.string().nullish(),
22
+ amountPaid: MoneySchema.nullish(),
23
+ amountRefunded: MoneySchema.nullish(),
24
+ paymentMethodInfo: PaymentMethodInfoDraftSchema.nullish(),
25
+ paymentStatus: PaymentStatusDraftSchema.nullish(),
26
+ transactions: z.array(TransactionDraftSchema).nullish(),
27
+ interfaceInteractions: z.array(CustomFieldsDraftSchema).nullish(),
28
+ custom: CustomFieldsDraftSchema.nullish(),
29
+ key: z.string().nullish(),
30
30
  });
@@ -9,12 +9,12 @@ import {
9
9
 
10
10
  export const ProductDiscountDraftSchema = z.object({
11
11
  name: LocalizedStringSchema,
12
- key: z.string().optional(),
13
- description: LocalizedStringSchema.optional(),
12
+ key: z.string().nullish(),
13
+ description: LocalizedStringSchema.nullish(),
14
14
  value: ProductDiscountValueDraftSchema,
15
15
  predicate: z.string(),
16
16
  sortOrder: z.string(),
17
17
  isActive: z.boolean(),
18
- validFrom: z.string().optional(),
19
- validUntil: z.string().optional(),
18
+ validFrom: z.string().nullish(),
19
+ validUntil: z.string().nullish(),
20
20
  });
@@ -10,9 +10,9 @@ import {
10
10
  } from "./common.ts";
11
11
 
12
12
  export const ProductSelectionDraftSchema = z.object({
13
- key: z.string().optional(),
13
+ key: z.string().nullish(),
14
14
  name: LocalizedStringSchema,
15
- custom: CustomFieldsDraftSchema.optional(),
16
- type: ProductSelectionTypeEnumSchema.optional(),
17
- mode: ProductSelectionModeSchema.optional(),
15
+ custom: CustomFieldsDraftSchema.nullish(),
16
+ type: ProductSelectionTypeEnumSchema.nullish(),
17
+ mode: ProductSelectionModeSchema.nullish(),
18
18
  });
@@ -11,16 +11,16 @@ import {
11
11
  } from "./common.ts";
12
12
 
13
13
  export const ProductTailoringDraftSchema = z.object({
14
- key: z.string().optional(),
14
+ key: z.string().nullish(),
15
15
  store: StoreResourceIdentifierSchema,
16
16
  product: ProductResourceIdentifierSchema,
17
- name: LocalizedStringSchema.optional(),
18
- description: LocalizedStringSchema.optional(),
19
- metaTitle: LocalizedStringSchema.optional(),
20
- metaDescription: LocalizedStringSchema.optional(),
21
- metaKeywords: LocalizedStringSchema.optional(),
22
- slug: LocalizedStringSchema.optional(),
23
- publish: z.boolean().optional(),
24
- variants: z.array(ProductVariantTailoringDraftSchema).optional(),
25
- attributes: z.array(ProductTailoringAttributeSchema).optional(),
17
+ name: LocalizedStringSchema.nullish(),
18
+ description: LocalizedStringSchema.nullish(),
19
+ metaTitle: LocalizedStringSchema.nullish(),
20
+ metaDescription: LocalizedStringSchema.nullish(),
21
+ metaKeywords: LocalizedStringSchema.nullish(),
22
+ slug: LocalizedStringSchema.nullish(),
23
+ publish: z.boolean().nullish(),
24
+ variants: z.array(ProductVariantTailoringDraftSchema).nullish(),
25
+ attributes: z.array(ProductTailoringAttributeSchema).nullish(),
26
26
  });
@@ -5,8 +5,8 @@ import { z } from "zod";
5
5
  import { AttributeDefinitionDraftSchema } from "./common.ts";
6
6
 
7
7
  export const ProductTypeDraftSchema = z.object({
8
- key: z.string().optional(),
8
+ key: z.string().nullish(),
9
9
  name: z.string(),
10
10
  description: z.string(),
11
- attributes: z.array(AttributeDefinitionDraftSchema).optional(),
11
+ attributes: z.array(AttributeDefinitionDraftSchema).nullish(),
12
12
  });
@@ -19,19 +19,19 @@ export const ProductDraftSchema = z.object({
19
19
  productType: ProductTypeResourceIdentifierSchema,
20
20
  name: LocalizedStringSchema,
21
21
  slug: LocalizedStringSchema,
22
- key: z.string().optional(),
23
- description: LocalizedStringSchema.optional(),
24
- categories: z.array(CategoryResourceIdentifierSchema).optional(),
25
- categoryOrderHints: CategoryOrderHintsSchema.optional(),
26
- metaTitle: LocalizedStringSchema.optional(),
27
- metaDescription: LocalizedStringSchema.optional(),
28
- metaKeywords: LocalizedStringSchema.optional(),
29
- masterVariant: ProductVariantDraftSchema.optional(),
30
- variants: z.array(ProductVariantDraftSchema).optional(),
31
- taxCategory: TaxCategoryResourceIdentifierSchema.optional(),
32
- searchKeywords: SearchKeywordsSchema.optional(),
33
- state: StateResourceIdentifierSchema.optional(),
34
- publish: z.boolean().optional(),
35
- priceMode: ProductPriceModeEnumSchema.optional(),
36
- attributes: z.array(AttributeSchema).optional(),
22
+ key: z.string().nullish(),
23
+ description: LocalizedStringSchema.nullish(),
24
+ categories: z.array(CategoryResourceIdentifierSchema).nullish(),
25
+ categoryOrderHints: CategoryOrderHintsSchema.nullish(),
26
+ metaTitle: LocalizedStringSchema.nullish(),
27
+ metaDescription: LocalizedStringSchema.nullish(),
28
+ metaKeywords: LocalizedStringSchema.nullish(),
29
+ masterVariant: ProductVariantDraftSchema.nullish(),
30
+ variants: z.array(ProductVariantDraftSchema).nullish(),
31
+ taxCategory: TaxCategoryResourceIdentifierSchema.nullish(),
32
+ searchKeywords: SearchKeywordsSchema.nullish(),
33
+ state: StateResourceIdentifierSchema.nullish(),
34
+ publish: z.boolean().nullish(),
35
+ priceMode: ProductPriceModeEnumSchema.nullish(),
36
+ attributes: z.array(AttributeSchema).nullish(),
37
37
  });
@@ -11,9 +11,9 @@ import {
11
11
  export const QuoteRequestDraftSchema = z.object({
12
12
  cart: CartResourceIdentifierSchema,
13
13
  cartVersion: z.number().int(),
14
- key: z.string().optional(),
15
- comment: z.string().optional(),
16
- custom: CustomFieldsDraftSchema.optional(),
17
- state: StateReferenceSchema.optional(),
18
- purchaseOrderNumber: z.string().optional(),
14
+ key: z.string().nullish(),
15
+ comment: z.string().nullish(),
16
+ custom: CustomFieldsDraftSchema.nullish(),
17
+ state: StateReferenceSchema.nullish(),
18
+ purchaseOrderNumber: z.string().nullish(),
19
19
  });
@@ -9,10 +9,10 @@ import {
9
9
  } from "./common.ts";
10
10
 
11
11
  export const QuoteDraftSchema = z.object({
12
- key: z.string().optional(),
12
+ key: z.string().nullish(),
13
13
  stagedQuote: StagedQuoteResourceIdentifierSchema,
14
14
  stagedQuoteVersion: z.number().int(),
15
- stagedQuoteStateToSent: z.boolean().optional(),
16
- state: StateReferenceSchema.optional(),
17
- custom: CustomFieldsDraftSchema.optional(),
15
+ stagedQuoteStateToSent: z.boolean().nullish(),
16
+ state: StateReferenceSchema.nullish(),
17
+ custom: CustomFieldsDraftSchema.nullish(),
18
18
  });
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  export const RecurrencePolicyDraftSchema = z.object({
11
11
  key: z.string(),
12
- name: LocalizedStringSchema.optional(),
13
- description: LocalizedStringSchema.optional(),
12
+ name: LocalizedStringSchema.nullish(),
13
+ description: LocalizedStringSchema.nullish(),
14
14
  schedule: RecurrencePolicyScheduleDraftSchema,
15
15
  });
@@ -9,11 +9,11 @@ import {
9
9
  } from "./common.ts";
10
10
 
11
11
  export const RecurringOrderDraftSchema = z.object({
12
- key: z.string().optional(),
12
+ key: z.string().nullish(),
13
13
  cart: CartResourceIdentifierSchema,
14
14
  cartVersion: z.number().int(),
15
- startsAt: z.string().optional(),
16
- expiresAt: z.string().optional(),
17
- state: StateResourceIdentifierSchema.optional(),
18
- custom: CustomFieldsDraftSchema.optional(),
15
+ startsAt: z.string().nullish(),
16
+ expiresAt: z.string().nullish(),
17
+ state: StateResourceIdentifierSchema.nullish(),
18
+ custom: CustomFieldsDraftSchema.nullish(),
19
19
  });
@@ -10,15 +10,15 @@ import {
10
10
  } from "./common.ts";
11
11
 
12
12
  export const ReviewDraftSchema = z.object({
13
- key: z.string().optional(),
14
- uniquenessValue: z.string().optional(),
15
- locale: LocaleSchema.optional(),
16
- authorName: z.string().optional(),
17
- title: z.string().optional(),
18
- text: z.string().optional(),
19
- target: z.unknown().optional(),
20
- state: StateResourceIdentifierSchema.optional(),
21
- rating: z.number().int().optional(),
22
- customer: CustomerResourceIdentifierSchema.optional(),
23
- custom: CustomFieldsDraftSchema.optional(),
13
+ key: z.string().nullish(),
14
+ uniquenessValue: z.string().nullish(),
15
+ locale: LocaleSchema.nullish(),
16
+ authorName: z.string().nullish(),
17
+ title: z.string().nullish(),
18
+ text: z.string().nullish(),
19
+ target: z.unknown().nullish(),
20
+ state: StateResourceIdentifierSchema.nullish(),
21
+ rating: z.number().int().nullish(),
22
+ customer: CustomerResourceIdentifierSchema.nullish(),
23
+ custom: CustomFieldsDraftSchema.nullish(),
24
24
  });
@@ -10,15 +10,15 @@ import {
10
10
  } from "./common.ts";
11
11
 
12
12
  export const ShippingMethodDraftSchema = z.object({
13
- key: z.string().optional(),
13
+ key: z.string().nullish(),
14
14
  name: z.string(),
15
- localizedName: LocalizedStringSchema.optional(),
16
- description: z.string().optional(),
17
- localizedDescription: LocalizedStringSchema.optional(),
15
+ localizedName: LocalizedStringSchema.nullish(),
16
+ description: z.string().nullish(),
17
+ localizedDescription: LocalizedStringSchema.nullish(),
18
18
  taxCategory: TaxCategoryResourceIdentifierSchema,
19
19
  zoneRates: z.array(ZoneRateDraftSchema),
20
- active: z.boolean().optional(),
20
+ active: z.boolean().nullish(),
21
21
  isDefault: z.boolean(),
22
- predicate: z.string().optional(),
23
- custom: CustomFieldsDraftSchema.optional(),
22
+ predicate: z.string().nullish(),
23
+ custom: CustomFieldsDraftSchema.nullish(),
24
24
  });
@@ -14,15 +14,15 @@ import {
14
14
 
15
15
  export const ShoppingListDraftSchema = z.object({
16
16
  name: LocalizedStringSchema,
17
- slug: LocalizedStringSchema.optional(),
18
- customer: CustomerResourceIdentifierSchema.optional(),
19
- key: z.string().optional(),
20
- description: LocalizedStringSchema.optional(),
21
- anonymousId: z.string().optional(),
22
- deleteDaysAfterLastModification: z.number().int().optional(),
23
- lineItems: z.array(ShoppingListLineItemDraftSchema).optional(),
24
- textLineItems: z.array(TextLineItemDraftSchema).optional(),
25
- store: StoreResourceIdentifierSchema.optional(),
26
- businessUnit: BusinessUnitResourceIdentifierSchema.optional(),
27
- custom: CustomFieldsDraftSchema.optional(),
17
+ slug: LocalizedStringSchema.nullish(),
18
+ customer: CustomerResourceIdentifierSchema.nullish(),
19
+ key: z.string().nullish(),
20
+ description: LocalizedStringSchema.nullish(),
21
+ anonymousId: z.string().nullish(),
22
+ deleteDaysAfterLastModification: z.number().int().nullish(),
23
+ lineItems: z.array(ShoppingListLineItemDraftSchema).nullish(),
24
+ textLineItems: z.array(TextLineItemDraftSchema).nullish(),
25
+ store: StoreResourceIdentifierSchema.nullish(),
26
+ businessUnit: BusinessUnitResourceIdentifierSchema.nullish(),
27
+ custom: CustomFieldsDraftSchema.nullish(),
28
28
  });
@@ -11,8 +11,8 @@ import {
11
11
  export const StagedQuoteDraftSchema = z.object({
12
12
  quoteRequest: QuoteRequestResourceIdentifierSchema,
13
13
  quoteRequestVersion: z.number().int(),
14
- quoteRequestStateToAccepted: z.boolean().optional(),
15
- key: z.string().optional(),
16
- custom: CustomFieldsDraftSchema.optional(),
17
- state: StateReferenceSchema.optional(),
14
+ quoteRequestStateToAccepted: z.boolean().nullish(),
15
+ key: z.string().nullish(),
16
+ custom: CustomFieldsDraftSchema.nullish(),
17
+ state: StateReferenceSchema.nullish(),
18
18
  });
@@ -15,18 +15,18 @@ import {
15
15
  } from "./common.ts";
16
16
 
17
17
  export const StandalonePriceDraftSchema = z.object({
18
- key: z.string().optional(),
18
+ key: z.string().nullish(),
19
19
  sku: z.string(),
20
20
  value: MoneySchema,
21
- country: CountryCodeSchema.optional(),
22
- customerGroup: CustomerGroupResourceIdentifierSchema.optional(),
23
- channel: ChannelResourceIdentifierSchema.optional(),
24
- validFrom: z.string().optional(),
25
- validUntil: z.string().optional(),
26
- tiers: z.array(PriceTierDraftSchema).optional(),
27
- discounted: DiscountedPriceDraftSchema.optional(),
28
- custom: CustomFieldsDraftSchema.optional(),
29
- recurrencePolicy: RecurrencePolicyResourceIdentifierSchema.optional(),
30
- staged: StagedPriceDraftSchema.optional(),
31
- active: z.boolean().optional(),
21
+ country: CountryCodeSchema.nullish(),
22
+ customerGroup: CustomerGroupResourceIdentifierSchema.nullish(),
23
+ channel: ChannelResourceIdentifierSchema.nullish(),
24
+ validFrom: z.string().nullish(),
25
+ validUntil: z.string().nullish(),
26
+ tiers: z.array(PriceTierDraftSchema).nullish(),
27
+ discounted: DiscountedPriceDraftSchema.nullish(),
28
+ custom: CustomFieldsDraftSchema.nullish(),
29
+ recurrencePolicy: RecurrencePolicyResourceIdentifierSchema.nullish(),
30
+ staged: StagedPriceDraftSchema.nullish(),
31
+ active: z.boolean().nullish(),
32
32
  });
@@ -12,9 +12,9 @@ import {
12
12
  export const StateDraftSchema = z.object({
13
13
  key: z.string(),
14
14
  type: StateTypeEnumSchema,
15
- name: LocalizedStringSchema.optional(),
16
- description: LocalizedStringSchema.optional(),
17
- initial: z.boolean().optional(),
18
- roles: z.array(StateRoleEnumSchema).optional(),
19
- transitions: z.array(StateResourceIdentifierSchema).optional(),
15
+ name: LocalizedStringSchema.nullish(),
16
+ description: LocalizedStringSchema.nullish(),
17
+ initial: z.boolean().nullish(),
18
+ roles: z.array(StateRoleEnumSchema).nullish(),
19
+ transitions: z.array(StateResourceIdentifierSchema).nullish(),
20
20
  });
@@ -13,11 +13,11 @@ import {
13
13
 
14
14
  export const StoreDraftSchema = z.object({
15
15
  key: z.string(),
16
- name: LocalizedStringSchema.optional(),
17
- languages: z.array(LocaleSchema).optional(),
18
- countries: z.array(StoreCountrySchema).optional(),
19
- distributionChannels: z.array(ChannelResourceIdentifierSchema).optional(),
20
- supplyChannels: z.array(ChannelResourceIdentifierSchema).optional(),
21
- productSelections: z.array(ProductSelectionSettingDraftSchema).optional(),
22
- custom: CustomFieldsDraftSchema.optional(),
16
+ name: LocalizedStringSchema.nullish(),
17
+ languages: z.array(LocaleSchema).nullish(),
18
+ countries: z.array(StoreCountrySchema).nullish(),
19
+ distributionChannels: z.array(ChannelResourceIdentifierSchema).nullish(),
20
+ supplyChannels: z.array(ChannelResourceIdentifierSchema).nullish(),
21
+ productSelections: z.array(ProductSelectionSettingDraftSchema).nullish(),
22
+ custom: CustomFieldsDraftSchema.nullish(),
23
23
  });
@@ -12,9 +12,9 @@ import {
12
12
 
13
13
  export const SubscriptionDraftSchema = z.object({
14
14
  destination: DestinationSchema,
15
- key: z.string().optional(),
16
- messages: z.array(MessageSubscriptionSchema).optional(),
17
- changes: z.array(ChangeSubscriptionSchema).optional(),
18
- events: z.array(EventSubscriptionSchema).optional(),
19
- format: DeliveryFormatSchema.optional(),
15
+ key: z.string().nullish(),
16
+ messages: z.array(MessageSubscriptionSchema).nullish(),
17
+ changes: z.array(ChangeSubscriptionSchema).nullish(),
18
+ events: z.array(EventSubscriptionSchema).nullish(),
19
+ format: DeliveryFormatSchema.nullish(),
20
20
  });
@@ -6,7 +6,7 @@ import { TaxRateDraftSchema } from "./common.ts";
6
6
 
7
7
  export const TaxCategoryDraftSchema = z.object({
8
8
  name: z.string(),
9
- description: z.string().optional(),
10
- rates: z.array(TaxRateDraftSchema).optional(),
11
- key: z.string().optional(),
9
+ description: z.string().nullish(),
10
+ rates: z.array(TaxRateDraftSchema).nullish(),
11
+ key: z.string().nullish(),
12
12
  });
@@ -11,7 +11,7 @@ import {
11
11
  export const TypeDraftSchema = z.object({
12
12
  key: z.string(),
13
13
  name: LocalizedStringSchema,
14
- description: LocalizedStringSchema.optional(),
14
+ description: LocalizedStringSchema.nullish(),
15
15
  resourceTypeIds: z.array(ResourceTypeIdSchema),
16
- fieldDefinitions: z.array(FieldDefinitionSchema).optional(),
16
+ fieldDefinitions: z.array(FieldDefinitionSchema).nullish(),
17
17
  });
@@ -5,8 +5,8 @@ import { z } from "zod";
5
5
  import { LocationSchema } from "./common.ts";
6
6
 
7
7
  export const ZoneDraftSchema = z.object({
8
- key: z.string().optional(),
8
+ key: z.string().nullish(),
9
9
  name: z.string(),
10
- description: z.string().optional(),
11
- locations: z.array(LocationSchema).optional(),
10
+ description: z.string().nullish(),
11
+ locations: z.array(LocationSchema).nullish(),
12
12
  });