@ikas/storefront-api 4.0.0-alpha.5 → 4.0.0-alpha.50

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 (87) hide show
  1. package/package.json +7 -7
  2. package/src/__api/models/Cart.ts +2 -0
  3. package/src/__api/models/CartStorefrontRoutingDynamicCurrencySettings.ts +2 -0
  4. package/src/__api/models/CartV2.ts +7 -0
  5. package/src/__api/models/CategoryFilterInput.ts +2 -0
  6. package/src/__api/models/CheckoutSettingsPrice.ts +2 -0
  7. package/src/__api/models/Country.ts +4 -0
  8. package/src/__api/models/CurrencyRate.ts +4 -0
  9. package/src/__api/models/LocationTranslations.ts +2 -0
  10. package/src/__api/models/OrderLineBaseUnit.ts +19 -0
  11. package/src/__api/models/OrderLineItem.ts +12 -0
  12. package/src/__api/models/OrderLineVariant.ts +8 -0
  13. package/src/__api/models/OrderLineVariantPrice.ts +7 -0
  14. package/src/__api/models/OrderLineVariantUnit.ts +16 -0
  15. package/src/__api/models/OrderLineVariantUnitType.ts +16 -0
  16. package/src/__api/models/OrderSessionInfo.ts +49 -0
  17. package/src/__api/models/OrderSessionInfoTrafficSource.ts +18 -0
  18. package/src/__api/models/OrderSessionUTM.ts +21 -0
  19. package/src/__api/models/OrderSessionUserAgent.ts +18 -0
  20. package/src/__api/models/Product.ts +5 -0
  21. package/src/__api/models/ProductBackInStockRemind.ts +2 -0
  22. package/src/__api/models/ProductBaseUnitModel.ts +21 -0
  23. package/src/__api/models/ProductOptionSelectValueOtherPrice.ts +2 -0
  24. package/src/__api/models/ProductPrice.ts +4 -0
  25. package/src/__api/models/RafflePaginationResponse.ts +5 -3
  26. package/src/__api/models/RaffleParticipants.ts +6 -10
  27. package/src/__api/models/RaffleParticipantsInput.ts +1 -4
  28. package/src/__api/models/SearchProduct.ts +5 -0
  29. package/src/__api/models/SearchProductPrice.ts +9 -0
  30. package/src/__api/models/SearchProductProductBaseUnit.ts +23 -0
  31. package/src/__api/models/SearchProductProductUnit.ts +16 -0
  32. package/src/__api/models/SearchVariant.ts +3 -0
  33. package/src/__api/models/StorefrontDynamicCurrencySettings.ts +2 -0
  34. package/src/__api/models/StorefrontOrder.ts +2 -0
  35. package/src/__api/models/{Raffle.ts → StorefrontRaffle.ts} +5 -16
  36. package/src/__api/models/StorefrontRouting.ts +4 -0
  37. package/src/__api/models/StorefrontTransaction.ts +2 -0
  38. package/src/__api/models/Variant.ts +3 -0
  39. package/src/__api/models/VariantUnitModel.ts +17 -0
  40. package/src/__api/models/_base.ts +2 -1
  41. package/src/__api/mutations/addCouponCodeToCheckout.ts +14 -1
  42. package/src/__api/mutations/addItemToCart.ts +34 -1
  43. package/src/__api/mutations/createOrderRefundRequest.ts +13 -1
  44. package/src/__api/mutations/customerForgotPassword.ts +3 -0
  45. package/src/__api/mutations/customerLogin.ts +3 -0
  46. package/src/__api/mutations/customerRecoverPassword.ts +3 -0
  47. package/src/__api/mutations/registerCustomer.ts +3 -0
  48. package/src/__api/mutations/saveCart.ts +34 -1
  49. package/src/__api/mutations/saveCartCouponCode.ts +34 -1
  50. package/src/__api/mutations/saveCheckout.ts +14 -1
  51. package/src/__api/mutations/saveItemToCart.ts +14 -1
  52. package/src/__api/mutations/saveProductBackInStockRemind.ts +2 -1
  53. package/src/__api/mutations/saveRaffleParticipant.ts +25 -3
  54. package/src/__api/mutations/sendContactFormToMerchant.ts +3 -0
  55. package/src/__api/mutations/updateCartCampaignOffer.ts +34 -1
  56. package/src/__api/queries/checkCustomerEmail.ts +3 -0
  57. package/src/__api/queries/getCart.ts +14 -1
  58. package/src/__api/queries/getCartById.ts +34 -1
  59. package/src/__api/queries/getCheckoutByCartId.ts +14 -1
  60. package/src/__api/queries/getCheckoutById.ts +14 -1
  61. package/src/__api/queries/getCurrencyRate.ts +3 -1
  62. package/src/__api/queries/getCustomerOrders.ts +13 -1
  63. package/src/__api/queries/getOrder.ts +13 -1
  64. package/src/__api/queries/getOrderByEmail.ts +13 -1
  65. package/src/__api/queries/getStorefront.ts +4 -1
  66. package/src/__api/queries/listCheckoutSettings.ts +2 -1
  67. package/src/__api/queries/listCountry.ts +7 -1
  68. package/src/__api/queries/listOrderTransactions.ts +2 -1
  69. package/src/__api/queries/listProduct.ts +8 -1
  70. package/src/__api/queries/listProductBackInStockRemind.ts +2 -1
  71. package/src/__api/queries/listProductOptionSet.ts +3 -1
  72. package/src/__api/queries/listRaffleParticipants.ts +81 -0
  73. package/src/__api/queries/{listRaffle.ts → listStorefrontRaffle.ts} +10 -10
  74. package/src/__api/queries/searchProducts.ts +10 -1
  75. package/src/__api/types/index.ts +183 -35
  76. package/src/api/checkout/index.ts +1 -1
  77. package/src/api/customer/index.ts +9 -0
  78. package/src/api/file-upload/index.ts +35 -29
  79. package/src/api/location/index.ts +13 -4
  80. package/src/api/masterpass/index.ts +7 -7
  81. package/src/api/product/index.ts +8 -3
  82. package/src/api/raffle/index.ts +12 -14
  83. package/src/index.ts +9 -7
  84. package/src/__api/models/RaffleParticipantsUpdateInput.ts +0 -24
  85. package/src/__api/mutations/updateRaffleParticipant.ts +0 -72
  86. package/src/__api/queries/getRaffleParticipants.ts +0 -59
  87. package/src/__api/queries/getRafflesByCustomerId.ts +0 -74
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront-api",
3
- "version": "4.0.0-alpha.5",
3
+ "version": "4.0.0-alpha.50",
4
4
  "author": "Umut Ozan Yıldırım",
5
5
  "license": "ISC",
6
6
  "description": "API functions that returns models from the ikas-storefront-models package.",
@@ -16,12 +16,13 @@
16
16
  "generate": "api-generator --generate --url=https://api.myikas.dev/api/sf/graphql --modelPath=./models.json --generatePath=./src/__api && prettier --write ./src/__api"
17
17
  },
18
18
  "dependencies": {
19
- "@ikas/fe-api-client": "^1.0.13"
19
+ "@ikas/fe-api-client": "^1.0.16",
20
+ "ts-essentials": "^7.0.1"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@rollup/plugin-commonjs": "^22.0.0",
23
- "@ikas/storefront-config": "^4.0.0-alpha.5",
24
- "@ikas/storefront-models": "^4.0.0-alpha.5",
24
+ "@ikas/storefront-config": "^4.0.0-alpha.50",
25
+ "@ikas/storefront-models": "^4.0.0-alpha.50",
25
26
  "@rollup/plugin-node-resolve": "^13.3.0",
26
27
  "prettier": "^2.2.1",
27
28
  "rollup": "^2.75.6",
@@ -31,12 +32,11 @@
31
32
  "typescript": "^4.7.2",
32
33
  "ttypescript": "^1.5.12",
33
34
  "typescript-transform-paths": "^2.2.2",
34
- "ts-essentials": "^7.0.1",
35
35
  "axios": "^0.26.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@ikas/storefront-config": "^4.0.0-alpha.5",
39
- "@ikas/storefront-models": "^4.0.0-alpha.5",
38
+ "@ikas/storefront-config": "^4.0.0-alpha.50",
39
+ "@ikas/storefront-models": "^4.0.0-alpha.50",
40
40
  "axios": "^0.26.0"
41
41
  }
42
42
  }
@@ -10,6 +10,7 @@ export class CartData extends BaseModelData {
10
10
  campaignOffers: CartCampaignOfferData[] | null;
11
11
  createdBy: CartCreatedByEnum | null;
12
12
  currencyCode: string | null;
13
+ currencySymbol: string | null;
13
14
  customerId: string | null;
14
15
  dueDate: any;
15
16
  itemCount: number;
@@ -33,6 +34,7 @@ export class CartData extends BaseModelData {
33
34
  : null;
34
35
  this.createdBy = data.createdBy || null;
35
36
  this.currencyCode = data.currencyCode || null;
37
+ this.currencySymbol = data.currencySymbol || null;
36
38
  this.customerId = data.customerId || null;
37
39
  this.dueDate = data.dueDate || null;
38
40
  this.itemCount = data.itemCount || 0;
@@ -3,12 +3,14 @@ import { DeepReadonly } from "ts-essentials";
3
3
  export class CartStorefrontRoutingDynamicCurrencySettingsData {
4
4
  roundingFormat: string | null;
5
5
  targetCurrencyCode: string;
6
+ targetCurrencySymbol: string | null;
6
7
 
7
8
  constructor(
8
9
  data: Partial<CartStorefrontRoutingDynamicCurrencySettingsData> = {}
9
10
  ) {
10
11
  this.roundingFormat = data.roundingFormat || null;
11
12
  this.targetCurrencyCode = data.targetCurrencyCode || "";
13
+ this.targetCurrencySymbol = data.targetCurrencySymbol || null;
12
14
  }
13
15
  }
14
16
 
@@ -17,6 +17,7 @@ import { OrderCustomerData } from "./OrderCustomer";
17
17
  import { OrderGiftPackageLineData } from "./OrderGiftPackageLine";
18
18
  import { OrderAdjustmentData } from "./OrderAdjustment";
19
19
  import { OrderLineItemData } from "./OrderLineItem";
20
+ import { OrderSessionInfoData } from "./OrderSessionInfo";
20
21
  import { OrderShippingLineData } from "./OrderShippingLine";
21
22
  import { OrderStorefrontRoutingData } from "./OrderStorefrontRouting";
22
23
  import { OrderTaxLineData } from "./OrderTaxLine";
@@ -34,6 +35,7 @@ export class CartV2Data extends BaseModelData {
34
35
  createdBy: CartCreatedByEnum | null;
35
36
  currencyCode: string;
36
37
  currencyRates: OrderCurrencyRateData[];
38
+ currencySymbol: string | null;
37
39
  customer: OrderCustomerData | null;
38
40
  customerId: string | null;
39
41
  dueDate: any | null;
@@ -53,6 +55,7 @@ export class CartV2Data extends BaseModelData {
53
55
  recoverEmailStatus: CheckoutRecoveryEmailStatusEnum | null;
54
56
  recoveryStatus: CheckoutRecoveryStatusEnum | null;
55
57
  salesChannelId: string;
58
+ sessionInfo: OrderSessionInfoData | null;
56
59
  shippingAddress: OrderAddressData | null;
57
60
  shippingLines: OrderShippingLineData[] | null;
58
61
  shippingMethod: ShippingMethodEnum;
@@ -96,6 +99,7 @@ export class CartV2Data extends BaseModelData {
96
99
  this.currencyRates = data.currencyRates
97
100
  ? data.currencyRates.map((o) => new OrderCurrencyRateData(o))
98
101
  : [];
102
+ this.currencySymbol = data.currencySymbol || null;
99
103
  this.customer = data.customer ? new OrderCustomerData(data.customer) : null;
100
104
  this.customerId = data.customerId || null;
101
105
  this.dueDate = data.dueDate || null;
@@ -127,6 +131,9 @@ export class CartV2Data extends BaseModelData {
127
131
  this.recoverEmailStatus = data.recoverEmailStatus || null;
128
132
  this.recoveryStatus = data.recoveryStatus || null;
129
133
  this.salesChannelId = data.salesChannelId || "";
134
+ this.sessionInfo = data.sessionInfo
135
+ ? new OrderSessionInfoData(data.sessionInfo)
136
+ : null;
130
137
  this.shippingAddress = data.shippingAddress
131
138
  ? new OrderAddressData(data.shippingAddress)
132
139
  : null;
@@ -3,10 +3,12 @@ import { DeepReadonly } from "ts-essentials";
3
3
  export class CategoryFilterInputData {
4
4
  eq: string | null;
5
5
  in: string[] | null;
6
+ nin: string[] | null;
6
7
 
7
8
  constructor(data: Partial<CategoryFilterInputData> = {}) {
8
9
  this.eq = data.eq || null;
9
10
  this.in = data.in || null;
11
+ this.nin = data.nin || null;
10
12
  }
11
13
  }
12
14
 
@@ -2,10 +2,12 @@ import { DeepReadonly } from "ts-essentials";
2
2
 
3
3
  export class CheckoutSettingsPriceData {
4
4
  currencyCode: string;
5
+ currencySymbol: string | null;
5
6
  price: number;
6
7
 
7
8
  constructor(data: Partial<CheckoutSettingsPriceData> = {}) {
8
9
  this.currencyCode = data.currencyCode || "";
10
+ this.currencySymbol = data.currencySymbol || null;
9
11
  this.price = data.price || 0;
10
12
  }
11
13
  }
@@ -5,6 +5,8 @@ import { LocationTranslationsData } from "./LocationTranslations";
5
5
  export class CountryData extends BaseModelData {
6
6
  capital: string | null;
7
7
  currency: string | null;
8
+ currencyCode: string | null;
9
+ currencySymbol: string | null;
8
10
  emoji: string | null;
9
11
  emojiString: string | null;
10
12
  iso2: string | null;
@@ -21,6 +23,8 @@ export class CountryData extends BaseModelData {
21
23
 
22
24
  this.capital = data.capital || null;
23
25
  this.currency = data.currency || null;
26
+ this.currencyCode = data.currencyCode || null;
27
+ this.currencySymbol = data.currencySymbol || null;
24
28
  this.emoji = data.emoji || null;
25
29
  this.emojiString = data.emojiString || null;
26
30
  this.iso2 = data.iso2 || null;
@@ -4,6 +4,8 @@ import { CurrencyRateDataData } from "./CurrencyRateData";
4
4
 
5
5
  export class CurrencyRateData extends BaseModelData {
6
6
  baseCurrency: string;
7
+ baseCurrencyCode: string | null;
8
+ baseCurrencySymbol: string | null;
7
9
  date: any;
8
10
  rates: CurrencyRateDataData[];
9
11
 
@@ -11,6 +13,8 @@ export class CurrencyRateData extends BaseModelData {
11
13
  super(data);
12
14
 
13
15
  this.baseCurrency = data.baseCurrency || "";
16
+ this.baseCurrencyCode = data.baseCurrencyCode || null;
17
+ this.baseCurrencySymbol = data.baseCurrencySymbol || null;
14
18
  this.date = data.date || null;
15
19
  this.rates = data.rates
16
20
  ? data.rates.map((c) => new CurrencyRateDataData(c))
@@ -1,10 +1,12 @@
1
1
  import { DeepReadonly } from "ts-essentials";
2
2
 
3
3
  export class LocationTranslationsData {
4
+ de: string | null;
4
5
  en: string;
5
6
  tr: string;
6
7
 
7
8
  constructor(data: Partial<LocationTranslationsData> = {}) {
9
+ this.de = data.de || null;
8
10
  this.en = data.en || "";
9
11
  this.tr = data.tr || "";
10
12
  }
@@ -0,0 +1,19 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+ import { ProductUnitTypeEnum } from "../types";
3
+ import { OrderLineVariantUnitTypeData } from "./OrderLineVariantUnitType";
4
+
5
+ export class OrderLineBaseUnitData {
6
+ baseAmount: number;
7
+ type: ProductUnitTypeEnum;
8
+ unit: OrderLineVariantUnitTypeData | null;
9
+
10
+ constructor(data: Partial<OrderLineBaseUnitData> = {}) {
11
+ this.baseAmount = data.baseAmount || 0;
12
+ this.type = data.type || ProductUnitTypeEnum.CENTILITER;
13
+ this.unit = data.unit ? new OrderLineVariantUnitTypeData(data.unit) : null;
14
+ }
15
+ }
16
+
17
+ export class OrderLineBaseUnit extends OrderLineBaseUnitData {}
18
+ export type PartialOrderLineBaseUnit = Partial<OrderLineBaseUnit>;
19
+ export type ReadOnlyOrderLineBaseUnit = DeepReadonly<OrderLineBaseUnit>;
@@ -7,9 +7,11 @@ import { OrderLineVariantData } from "./OrderLineVariant";
7
7
 
8
8
  export class OrderLineItemData extends BaseModelData {
9
9
  currencyCode: string | null;
10
+ currencySymbol: string | null;
10
11
  discount: OrderLineDiscountData | null;
11
12
  discountPrice: number | null;
12
13
  finalPrice: number | null;
14
+ finalUnitPrice: number | null;
13
15
  options: OrderLineOptionData[] | null;
14
16
  originalOrderLineItemId: string | null;
15
17
  price: number;
@@ -18,12 +20,14 @@ export class OrderLineItemData extends BaseModelData {
18
20
  statusUpdatedAt: any | null;
19
21
  stockLocationId: string | null;
20
22
  taxValue: number | null;
23
+ unitPrice: number | null;
21
24
  variant: OrderLineVariantData;
22
25
 
23
26
  constructor(data: Partial<OrderLineItemData> = {}) {
24
27
  super(data);
25
28
 
26
29
  this.currencyCode = data.currencyCode || null;
30
+ this.currencySymbol = data.currencySymbol || null;
27
31
  this.discount = data.discount
28
32
  ? new OrderLineDiscountData(data.discount)
29
33
  : null;
@@ -35,6 +39,10 @@ export class OrderLineItemData extends BaseModelData {
35
39
  data.finalPrice !== undefined && data.finalPrice !== null
36
40
  ? data.finalPrice
37
41
  : null;
42
+ this.finalUnitPrice =
43
+ data.finalUnitPrice !== undefined && data.finalUnitPrice !== null
44
+ ? data.finalUnitPrice
45
+ : null;
38
46
  this.options = data.options
39
47
  ? data.options.map((o) => new OrderLineOptionData(o))
40
48
  : null;
@@ -48,6 +56,10 @@ export class OrderLineItemData extends BaseModelData {
48
56
  data.taxValue !== undefined && data.taxValue !== null
49
57
  ? data.taxValue
50
58
  : null;
59
+ this.unitPrice =
60
+ data.unitPrice !== undefined && data.unitPrice !== null
61
+ ? data.unitPrice
62
+ : null;
51
63
  this.variant = data.variant
52
64
  ? new OrderLineVariantData(data.variant)
53
65
  : new OrderLineVariantData();
@@ -1,11 +1,14 @@
1
1
  import { DeepReadonly } from "ts-essentials";
2
+ import { OrderLineBaseUnitData } from "./OrderLineBaseUnit";
2
3
  import { OrderLineVariantBrandData } from "./OrderLineVariantBrand";
3
4
  import { OrderLineVariantCategoryData } from "./OrderLineVariantCategory";
4
5
  import { OrderLineVariantPriceData } from "./OrderLineVariantPrice";
6
+ import { OrderLineVariantUnitData } from "./OrderLineVariantUnit";
5
7
  import { OrderLineVariantVariantValuesData } from "./OrderLineVariantVariantValues";
6
8
 
7
9
  export class OrderLineVariantData {
8
10
  barcodeList: string[] | null;
11
+ baseUnit: OrderLineBaseUnitData | null;
9
12
  brand: OrderLineVariantBrandData | null;
10
13
  categories: OrderLineVariantCategoryData[] | null;
11
14
  id: string | null;
@@ -18,11 +21,15 @@ export class OrderLineVariantData {
18
21
  tagIds: string[] | null;
19
22
  taxValue: number | null;
20
23
  type: number | null;
24
+ unit: OrderLineVariantUnitData | null;
21
25
  variantValues: OrderLineVariantVariantValuesData[] | null;
22
26
  weight: number | null;
23
27
 
24
28
  constructor(data: Partial<OrderLineVariantData> = {}) {
25
29
  this.barcodeList = data.barcodeList || null;
30
+ this.baseUnit = data.baseUnit
31
+ ? new OrderLineBaseUnitData(data.baseUnit)
32
+ : null;
26
33
  this.brand = data.brand ? new OrderLineVariantBrandData(data.brand) : null;
27
34
  this.categories = data.categories
28
35
  ? data.categories.map((o) => new OrderLineVariantCategoryData(o))
@@ -43,6 +50,7 @@ export class OrderLineVariantData {
43
50
  : null;
44
51
  this.type =
45
52
  data.type !== undefined && data.type !== null ? data.type : null;
53
+ this.unit = data.unit ? new OrderLineVariantUnitData(data.unit) : null;
46
54
  this.variantValues = data.variantValues
47
55
  ? data.variantValues.map((o) => new OrderLineVariantVariantValuesData(o))
48
56
  : null;
@@ -3,9 +3,11 @@ import { DeepReadonly } from "ts-essentials";
3
3
  export class OrderLineVariantPriceData {
4
4
  buyPrice: number | null;
5
5
  currency: string | null;
6
+ currencySymbol: string | null;
6
7
  discountPrice: number | null;
7
8
  priceListId: string | null;
8
9
  sellPrice: number;
10
+ unitPrice: number | null;
9
11
 
10
12
  constructor(data: Partial<OrderLineVariantPriceData> = {}) {
11
13
  this.buyPrice =
@@ -13,12 +15,17 @@ export class OrderLineVariantPriceData {
13
15
  ? data.buyPrice
14
16
  : null;
15
17
  this.currency = data.currency || null;
18
+ this.currencySymbol = data.currencySymbol || null;
16
19
  this.discountPrice =
17
20
  data.discountPrice !== undefined && data.discountPrice !== null
18
21
  ? data.discountPrice
19
22
  : null;
20
23
  this.priceListId = data.priceListId || null;
21
24
  this.sellPrice = data.sellPrice || 0;
25
+ this.unitPrice =
26
+ data.unitPrice !== undefined && data.unitPrice !== null
27
+ ? data.unitPrice
28
+ : null;
22
29
  }
23
30
  }
24
31
 
@@ -0,0 +1,16 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+ import { ProductUnitTypeEnum } from "../types";
3
+
4
+ export class OrderLineVariantUnitData {
5
+ amount: number;
6
+ type: ProductUnitTypeEnum;
7
+
8
+ constructor(data: Partial<OrderLineVariantUnitData> = {}) {
9
+ this.amount = data.amount || 0;
10
+ this.type = data.type || ProductUnitTypeEnum.CENTILITER;
11
+ }
12
+ }
13
+
14
+ export class OrderLineVariantUnit extends OrderLineVariantUnitData {}
15
+ export type PartialOrderLineVariantUnit = Partial<OrderLineVariantUnit>;
16
+ export type ReadOnlyOrderLineVariantUnit = DeepReadonly<OrderLineVariantUnit>;
@@ -0,0 +1,16 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+
3
+ export class OrderLineVariantUnitTypeData {
4
+ id: string;
5
+ name: string;
6
+
7
+ constructor(data: Partial<OrderLineVariantUnitTypeData> = {}) {
8
+ this.id = data.id || "";
9
+ this.name = data.name || "";
10
+ }
11
+ }
12
+
13
+ export class OrderLineVariantUnitType extends OrderLineVariantUnitTypeData {}
14
+ export type PartialOrderLineVariantUnitType = Partial<OrderLineVariantUnitType>;
15
+ export type ReadOnlyOrderLineVariantUnitType =
16
+ DeepReadonly<OrderLineVariantUnitType>;
@@ -0,0 +1,49 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+ import { OrderSessionInfoTrafficSourceData } from "./OrderSessionInfoTrafficSource";
3
+ import { OrderSessionUserAgentData } from "./OrderSessionUserAgent";
4
+ import { OrderSessionUTMData } from "./OrderSessionUTM";
5
+
6
+ export class OrderSessionInfoData {
7
+ countryCode: string | null;
8
+ durationMS: number | null;
9
+ end: any | null;
10
+ host: string | null;
11
+ ip: string | null;
12
+ referer: string | null;
13
+ salesChannelId: string | null;
14
+ sessionId: string | null;
15
+ start: any | null;
16
+ storefrontId: string | null;
17
+ trafficSource: OrderSessionInfoTrafficSourceData | null;
18
+ userAgent: OrderSessionUserAgentData | null;
19
+ utm: OrderSessionUTMData | null;
20
+ visitorId: string | null;
21
+
22
+ constructor(data: Partial<OrderSessionInfoData> = {}) {
23
+ this.countryCode = data.countryCode || null;
24
+ this.durationMS =
25
+ data.durationMS !== undefined && data.durationMS !== null
26
+ ? data.durationMS
27
+ : null;
28
+ this.end = data.end || null;
29
+ this.host = data.host || null;
30
+ this.ip = data.ip || null;
31
+ this.referer = data.referer || null;
32
+ this.salesChannelId = data.salesChannelId || null;
33
+ this.sessionId = data.sessionId || null;
34
+ this.start = data.start || null;
35
+ this.storefrontId = data.storefrontId || null;
36
+ this.trafficSource = data.trafficSource
37
+ ? new OrderSessionInfoTrafficSourceData(data.trafficSource)
38
+ : null;
39
+ this.userAgent = data.userAgent
40
+ ? new OrderSessionUserAgentData(data.userAgent)
41
+ : null;
42
+ this.utm = data.utm ? new OrderSessionUTMData(data.utm) : null;
43
+ this.visitorId = data.visitorId || null;
44
+ }
45
+ }
46
+
47
+ export class OrderSessionInfo extends OrderSessionInfoData {}
48
+ export type PartialOrderSessionInfo = Partial<OrderSessionInfo>;
49
+ export type ReadOnlyOrderSessionInfo = DeepReadonly<OrderSessionInfo>;
@@ -0,0 +1,18 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+ import { SFAnalyticsTrafficSourceEnum } from "../types";
3
+
4
+ export class OrderSessionInfoTrafficSourceData {
5
+ source: string | null;
6
+ type: SFAnalyticsTrafficSourceEnum;
7
+
8
+ constructor(data: Partial<OrderSessionInfoTrafficSourceData> = {}) {
9
+ this.source = data.source || null;
10
+ this.type = data.type || SFAnalyticsTrafficSourceEnum.ADS_OTHER;
11
+ }
12
+ }
13
+
14
+ export class OrderSessionInfoTrafficSource extends OrderSessionInfoTrafficSourceData {}
15
+ export type PartialOrderSessionInfoTrafficSource =
16
+ Partial<OrderSessionInfoTrafficSource>;
17
+ export type ReadOnlyOrderSessionInfoTrafficSource =
18
+ DeepReadonly<OrderSessionInfoTrafficSource>;
@@ -0,0 +1,21 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+
3
+ export class OrderSessionUTMData {
4
+ campaign: string | null;
5
+ content: string | null;
6
+ medium: string | null;
7
+ source: string | null;
8
+ term: string | null;
9
+
10
+ constructor(data: Partial<OrderSessionUTMData> = {}) {
11
+ this.campaign = data.campaign || null;
12
+ this.content = data.content || null;
13
+ this.medium = data.medium || null;
14
+ this.source = data.source || null;
15
+ this.term = data.term || null;
16
+ }
17
+ }
18
+
19
+ export class OrderSessionUTM extends OrderSessionUTMData {}
20
+ export type PartialOrderSessionUTM = Partial<OrderSessionUTM>;
21
+ export type ReadOnlyOrderSessionUTM = DeepReadonly<OrderSessionUTM>;
@@ -0,0 +1,18 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+ import { UserAgentDeviceType } from "../types";
3
+
4
+ export class OrderSessionUserAgentData {
5
+ deviceType: UserAgentDeviceType;
6
+ name: string;
7
+ os: string;
8
+
9
+ constructor(data: Partial<OrderSessionUserAgentData> = {}) {
10
+ this.deviceType = data.deviceType || UserAgentDeviceType.CAMERA;
11
+ this.name = data.name || "";
12
+ this.os = data.os || "";
13
+ }
14
+ }
15
+
16
+ export class OrderSessionUserAgent extends OrderSessionUserAgentData {}
17
+ export type PartialOrderSessionUserAgent = Partial<OrderSessionUserAgent>;
18
+ export type ReadOnlyOrderSessionUserAgent = DeepReadonly<OrderSessionUserAgent>;
@@ -2,6 +2,7 @@ import { DeepReadonly } from "ts-essentials";
2
2
  import BaseModelData from "./_base";
3
3
  import { ProductTypeEnum } from "../types";
4
4
  import { ProductAttributeValueData } from "./ProductAttributeValue";
5
+ import { ProductBaseUnitModelData } from "./ProductBaseUnitModel";
5
6
  import { HTMLMetaDataData } from "./HTMLMetaData";
6
7
  import { ProductVariantTypeData } from "./ProductVariantType";
7
8
  import { ProductTranslationData } from "./ProductTranslation";
@@ -9,6 +10,7 @@ import { VariantData } from "./Variant";
9
10
 
10
11
  export class ProductData extends BaseModelData {
11
12
  attributes: ProductAttributeValueData[] | null;
13
+ baseUnit: ProductBaseUnitModelData | null;
12
14
  brandId: string | null;
13
15
  categoryIds: string[] | null;
14
16
  description: string | null;
@@ -33,6 +35,9 @@ export class ProductData extends BaseModelData {
33
35
  this.attributes = data.attributes
34
36
  ? data.attributes.map((p) => new ProductAttributeValueData(p))
35
37
  : null;
38
+ this.baseUnit = data.baseUnit
39
+ ? new ProductBaseUnitModelData(data.baseUnit)
40
+ : null;
36
41
  this.brandId = data.brandId || null;
37
42
  this.categoryIds = data.categoryIds || null;
38
43
  this.description = data.description || null;
@@ -6,6 +6,7 @@ export class ProductBackInStockRemindData extends BaseModelData {
6
6
  email: string;
7
7
  productId: string;
8
8
  storefrontId: string;
9
+ storefrontRoutingId: string | null;
9
10
  variantId: string;
10
11
 
11
12
  constructor(data: Partial<ProductBackInStockRemindData> = {}) {
@@ -15,6 +16,7 @@ export class ProductBackInStockRemindData extends BaseModelData {
15
16
  this.email = data.email || "";
16
17
  this.productId = data.productId || "";
17
18
  this.storefrontId = data.storefrontId || "";
19
+ this.storefrontRoutingId = data.storefrontRoutingId || null;
18
20
  this.variantId = data.variantId || "";
19
21
  }
20
22
  }
@@ -0,0 +1,21 @@
1
+ import { DeepReadonly } from "ts-essentials";
2
+ import { ProductUnitTypeEnum } from "../types";
3
+
4
+ export class ProductBaseUnitModelData {
5
+ baseAmount: number | null;
6
+ type: ProductUnitTypeEnum;
7
+ unitId: string | null;
8
+
9
+ constructor(data: Partial<ProductBaseUnitModelData> = {}) {
10
+ this.baseAmount =
11
+ data.baseAmount !== undefined && data.baseAmount !== null
12
+ ? data.baseAmount
13
+ : null;
14
+ this.type = data.type || ProductUnitTypeEnum.CENTILITER;
15
+ this.unitId = data.unitId || null;
16
+ }
17
+ }
18
+
19
+ export class ProductBaseUnitModel extends ProductBaseUnitModelData {}
20
+ export type PartialProductBaseUnitModel = Partial<ProductBaseUnitModel>;
21
+ export type ReadOnlyProductBaseUnitModel = DeepReadonly<ProductBaseUnitModel>;
@@ -2,10 +2,12 @@ import { DeepReadonly } from "ts-essentials";
2
2
 
3
3
  export class ProductOptionSelectValueOtherPriceData {
4
4
  currencyCode: string;
5
+ currencySymbol: string | null;
5
6
  price: number;
6
7
 
7
8
  constructor(data: Partial<ProductOptionSelectValueOtherPriceData> = {}) {
8
9
  this.currencyCode = data.currencyCode || "";
10
+ this.currencySymbol = data.currencySymbol || null;
9
11
  this.price = data.price || 0;
10
12
  }
11
13
  }
@@ -3,6 +3,8 @@ import { DeepReadonly } from "ts-essentials";
3
3
  export class ProductPriceData {
4
4
  buyPrice: number | null;
5
5
  currency: string | null;
6
+ currencyCode: string | null;
7
+ currencySymbol: string | null;
6
8
  discountPrice: number | null;
7
9
  priceListId: string | null;
8
10
  sellPrice: number;
@@ -13,6 +15,8 @@ export class ProductPriceData {
13
15
  ? data.buyPrice
14
16
  : null;
15
17
  this.currency = data.currency || null;
18
+ this.currencyCode = data.currencyCode || null;
19
+ this.currencySymbol = data.currencySymbol || null;
16
20
  this.discountPrice =
17
21
  data.discountPrice !== undefined && data.discountPrice !== null
18
22
  ? data.discountPrice
@@ -1,16 +1,18 @@
1
1
  import { DeepReadonly } from "ts-essentials";
2
- import { RaffleData } from "./Raffle";
2
+ import { StorefrontRaffleData } from "./StorefrontRaffle";
3
3
 
4
4
  export class RafflePaginationResponseData {
5
5
  count: number;
6
- data: RaffleData[];
6
+ data: StorefrontRaffleData[];
7
7
  hasNext: boolean;
8
8
  limit: number;
9
9
  page: number;
10
10
 
11
11
  constructor(data: Partial<RafflePaginationResponseData> = {}) {
12
12
  this.count = data.count || 0;
13
- this.data = data.data ? data.data.map((r) => new RaffleData(r)) : [];
13
+ this.data = data.data
14
+ ? data.data.map((s) => new StorefrontRaffleData(s))
15
+ : [];
14
16
  this.hasNext = data.hasNext || false;
15
17
  this.limit = data.limit || 0;
16
18
  this.page = data.page || 0;
@@ -1,6 +1,8 @@
1
1
  import { DeepReadonly } from "ts-essentials";
2
2
  import BaseModelData from "./_base";
3
+ import { RaffleParticipantStatusEnum } from "../types";
3
4
  import { AppliedProductData } from "./AppliedProduct";
5
+ import { StorefrontRaffleData } from "./StorefrontRaffle";
4
6
 
5
7
  export class RaffleParticipantsData extends BaseModelData {
6
8
  applicationDate: any;
@@ -11,11 +13,11 @@ export class RaffleParticipantsData extends BaseModelData {
11
13
  firstName: string;
12
14
  fullName: string;
13
15
  isDeliveredCargo: boolean | null;
14
- isSendEmail: boolean | null;
15
- isWinner: boolean | null;
16
16
  lastName: string;
17
17
  phone: string | null;
18
+ raffle: StorefrontRaffleData | null;
18
19
  raffleId: string;
20
+ status: RaffleParticipantStatusEnum | null;
19
21
 
20
22
  constructor(data: Partial<RaffleParticipantsData> = {}) {
21
23
  super(data);
@@ -33,17 +35,11 @@ export class RaffleParticipantsData extends BaseModelData {
33
35
  data.isDeliveredCargo !== undefined && data.isDeliveredCargo !== null
34
36
  ? data.isDeliveredCargo
35
37
  : null;
36
- this.isSendEmail =
37
- data.isSendEmail !== undefined && data.isSendEmail !== null
38
- ? data.isSendEmail
39
- : null;
40
- this.isWinner =
41
- data.isWinner !== undefined && data.isWinner !== null
42
- ? data.isWinner
43
- : null;
44
38
  this.lastName = data.lastName || "";
45
39
  this.phone = data.phone || null;
40
+ this.raffle = data.raffle ? new StorefrontRaffleData(data.raffle) : null;
46
41
  this.raffleId = data.raffleId || "";
42
+ this.status = data.status || null;
47
43
  }
48
44
  }
49
45
 
@@ -1,8 +1,7 @@
1
1
  import { DeepReadonly } from "ts-essentials";
2
- import BaseModelData from "./_base";
3
2
  import { AppliedProductInputData } from "./AppliedProductInput";
4
3
 
5
- export class RaffleParticipantsInputData extends BaseModelData {
4
+ export class RaffleParticipantsInputData {
6
5
  appliedProduct: AppliedProductInputData;
7
6
  email: string;
8
7
  extraData: any | null;
@@ -12,8 +11,6 @@ export class RaffleParticipantsInputData extends BaseModelData {
12
11
  raffleId: string;
13
12
 
14
13
  constructor(data: Partial<RaffleParticipantsInputData> = {}) {
15
- super(data);
16
-
17
14
  this.appliedProduct = data.appliedProduct
18
15
  ? new AppliedProductInputData(data.appliedProduct)
19
16
  : new AppliedProductInputData();