@ikas/storefront-api 4.0.0-alpha.38 → 4.0.0-alpha.4

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 (61) hide show
  1. package/package.json +7 -7
  2. package/src/__api/models/Cart.ts +0 -2
  3. package/src/__api/models/CartStorefrontRoutingDynamicCurrencySettings.ts +0 -2
  4. package/src/__api/models/CartV2.ts +0 -2
  5. package/src/__api/models/CheckoutSettingsPrice.ts +0 -2
  6. package/src/__api/models/Country.ts +0 -4
  7. package/src/__api/models/CurrencyRate.ts +0 -4
  8. package/src/__api/models/OrderLineItem.ts +0 -2
  9. package/src/__api/models/OrderLineVariantPrice.ts +0 -2
  10. package/src/__api/models/ProductBackInStockRemind.ts +0 -2
  11. package/src/__api/models/ProductOptionSelectValueOtherPrice.ts +0 -2
  12. package/src/__api/models/ProductPrice.ts +0 -4
  13. package/src/__api/models/{StorefrontRaffle.ts → Raffle.ts} +16 -5
  14. package/src/__api/models/RafflePaginationResponse.ts +3 -5
  15. package/src/__api/models/RaffleParticipants.ts +10 -8
  16. package/src/__api/models/RaffleParticipantsInput.ts +4 -1
  17. package/src/__api/models/RaffleParticipantsUpdateInput.ts +24 -0
  18. package/src/__api/models/SearchProductPrice.ts +0 -4
  19. package/src/__api/models/StorefrontDynamicCurrencySettings.ts +0 -2
  20. package/src/__api/models/StorefrontOrder.ts +0 -2
  21. package/src/__api/models/StorefrontTransaction.ts +0 -2
  22. package/src/__api/models/_base.ts +1 -2
  23. package/src/__api/mutations/addCouponCodeToCheckout.ts +1 -5
  24. package/src/__api/mutations/addItemToCart.ts +1 -4
  25. package/src/__api/mutations/createOrderRefundRequest.ts +1 -4
  26. package/src/__api/mutations/saveCart.ts +1 -4
  27. package/src/__api/mutations/saveCartCouponCode.ts +1 -4
  28. package/src/__api/mutations/saveCheckout.ts +1 -5
  29. package/src/__api/mutations/saveItemToCart.ts +1 -5
  30. package/src/__api/mutations/saveProductBackInStockRemind.ts +1 -2
  31. package/src/__api/mutations/saveRaffleParticipant.ts +3 -25
  32. package/src/__api/mutations/updateCartCampaignOffer.ts +1 -4
  33. package/src/__api/mutations/updateRaffleParticipant.ts +72 -0
  34. package/src/__api/queries/getCart.ts +1 -5
  35. package/src/__api/queries/getCartById.ts +1 -4
  36. package/src/__api/queries/getCheckoutByCartId.ts +1 -5
  37. package/src/__api/queries/getCheckoutById.ts +1 -5
  38. package/src/__api/queries/getCurrencyRate.ts +1 -3
  39. package/src/__api/queries/getCustomerOrders.ts +1 -4
  40. package/src/__api/queries/getOrder.ts +1 -4
  41. package/src/__api/queries/getOrderByEmail.ts +1 -4
  42. package/src/__api/queries/getRaffleParticipants.ts +59 -0
  43. package/src/__api/queries/getRafflesByCustomerId.ts +74 -0
  44. package/src/__api/queries/getStorefront.ts +1 -2
  45. package/src/__api/queries/listCheckoutSettings.ts +1 -2
  46. package/src/__api/queries/listCountry.ts +1 -3
  47. package/src/__api/queries/listOrderTransactions.ts +1 -2
  48. package/src/__api/queries/listProduct.ts +1 -3
  49. package/src/__api/queries/listProductBackInStockRemind.ts +1 -2
  50. package/src/__api/queries/listProductOptionSet.ts +1 -3
  51. package/src/__api/queries/{listStorefrontRaffle.ts → listRaffle.ts} +10 -10
  52. package/src/__api/queries/searchProducts.ts +1 -3
  53. package/src/__api/types/index.ts +35 -43
  54. package/src/api/checkout/index.ts +1 -1
  55. package/src/api/customer/index.ts +0 -9
  56. package/src/api/file-upload/index.ts +29 -35
  57. package/src/api/masterpass/index.ts +7 -7
  58. package/src/api/product/index.ts +0 -1
  59. package/src/api/raffle/index.ts +14 -12
  60. package/src/index.ts +7 -9
  61. package/src/__api/queries/listRaffleParticipants.ts +0 -81
@@ -45,7 +45,7 @@ export type QueryParams = {
45
45
  };
46
46
 
47
47
  const allReturnFields =
48
- "{billingAddress {addressLine1 addressLine2 city {code id name } company country {code id iso2 iso3 name } district {code id name } firstName id identityNumber isDefault lastName phone postalCode state {code id name } taxNumber taxOffice } cancelReason cancelledAt createdAt currencyCode currencyRates {code originalRate rate } currencySymbol customer {email firstName fullName id isGuestCheckout lastName notificationsAccepted phone } customerId deleted giftPackageLines {price taxValue } giftPackageNote id invoices {appId appName createdAt id invoiceNumber storeAppId type } isGiftPackage merchantId note orderAdjustments {amount amountType appliedOrderLines {amount appliedQuantity isAutoCreated orderLineId } campaignId campaignType couponId name order type } orderLineItems {createdAt currencyCode currencySymbol deleted discount {amount amountType campaignOfferId campaignOfferProductId maxApplicableQuantity reason } discountPrice finalPrice id options {name productOptionId productOptionsSetId type values {name price value } } originalOrderLineItemId price quantity status statusUpdatedAt stockLocationId taxValue updatedAt variant {barcodeList brand {id name } categories {categoryPath {id name } id name } id mainImageId name prices {buyPrice currency currencySymbol discountPrice priceListId sellPrice } productId sku slug tagIds taxValue type variantValues {order variantTypeId variantTypeName variantValueId variantValueName } weight } } orderNumber orderPackageStatus orderPackages {createdAt deleted errorMessage id note orderLineItemIds orderPackageFulfillStatus orderPackageNumber stockLocationId trackingInfo {barcode cargoCompany isSendNotification trackingLink trackingNumber } updatedAt } orderPaymentStatus orderTagIds orderedAt paymentMethods {paymentGatewayCode paymentGatewayId paymentGatewayName price type } shippingAddress {addressLine1 addressLine2 city {code id name } company country {code id iso2 iso3 name } district {code id name } firstName id identityNumber isDefault lastName phone postalCode state {code id name } taxNumber taxOffice } shippingLines {finalPrice isRefunded paymentMethod price shippingSettingsId shippingZoneRateId taxValue title } shippingMethod status taxLines {price rate } totalFinalPrice totalPrice updatedAt }";
48
+ "{billingAddress {addressLine1 addressLine2 city {code id name } company country {code id iso2 iso3 name } district {code id name } firstName id identityNumber isDefault lastName phone postalCode state {code id name } taxNumber taxOffice } cancelReason cancelledAt createdAt currencyCode currencyRates {code originalRate rate } customer {email firstName fullName id isGuestCheckout lastName notificationsAccepted phone } customerId deleted giftPackageLines {price taxValue } giftPackageNote id invoices {appId appName createdAt id invoiceNumber storeAppId type } isGiftPackage merchantId note orderAdjustments {amount amountType appliedOrderLines {amount appliedQuantity isAutoCreated orderLineId } campaignId campaignType couponId name order type } orderLineItems {createdAt currencyCode deleted discount {amount amountType campaignOfferId campaignOfferProductId maxApplicableQuantity reason } discountPrice finalPrice id options {name productOptionId productOptionsSetId type values {name price value } } originalOrderLineItemId price quantity status statusUpdatedAt stockLocationId taxValue updatedAt variant {barcodeList brand {id name } categories {categoryPath {id name } id name } id mainImageId name prices {buyPrice currency discountPrice priceListId sellPrice } productId sku slug tagIds taxValue type variantValues {order variantTypeId variantTypeName variantValueId variantValueName } weight } } orderNumber orderPackageStatus orderPackages {createdAt deleted errorMessage id note orderLineItemIds orderPackageFulfillStatus orderPackageNumber stockLocationId trackingInfo {barcode cargoCompany isSendNotification trackingLink trackingNumber } updatedAt } orderPaymentStatus orderTagIds orderedAt paymentMethods {paymentGatewayCode paymentGatewayId paymentGatewayName price type } shippingAddress {addressLine1 addressLine2 city {code id name } company country {code id iso2 iso3 name } district {code id name } firstName id identityNumber isDefault lastName phone postalCode state {code id name } taxNumber taxOffice } shippingLines {finalPrice isRefunded paymentMethod price shippingSettingsId shippingZoneRateId taxValue title } shippingMethod status taxLines {price rate } totalFinalPrice totalPrice updatedAt }";
49
49
 
50
50
  export enum ResponseField {
51
51
  BILLING_ADDRESS__ADDRESS_LINE1 = "billingAddress.addressLine1",
@@ -81,7 +81,6 @@ export enum ResponseField {
81
81
  CURRENCY_RATES__CODE = "currencyRates.code",
82
82
  CURRENCY_RATES__ORIGINAL_RATE = "currencyRates.originalRate",
83
83
  CURRENCY_RATES__RATE = "currencyRates.rate",
84
- CURRENCY_SYMBOL = "currencySymbol",
85
84
  CUSTOMER__EMAIL = "customer.email",
86
85
  CUSTOMER__FIRST_NAME = "customer.firstName",
87
86
  CUSTOMER__FULL_NAME = "customer.fullName",
@@ -120,7 +119,6 @@ export enum ResponseField {
120
119
  ORDER_ADJUSTMENTS__TYPE = "orderAdjustments.type",
121
120
  ORDER_LINE_ITEMS__CREATED_AT = "orderLineItems.createdAt",
122
121
  ORDER_LINE_ITEMS__CURRENCY_CODE = "orderLineItems.currencyCode",
123
- ORDER_LINE_ITEMS__CURRENCY_SYMBOL = "orderLineItems.currencySymbol",
124
122
  ORDER_LINE_ITEMS__DELETED = "orderLineItems.deleted",
125
123
  ORDER_LINE_ITEMS__DISCOUNT__AMOUNT = "orderLineItems.discount.amount",
126
124
  ORDER_LINE_ITEMS__DISCOUNT__AMOUNT_TYPE = "orderLineItems.discount.amountType",
@@ -158,7 +156,6 @@ export enum ResponseField {
158
156
  ORDER_LINE_ITEMS__VARIANT__NAME = "orderLineItems.variant.name",
159
157
  ORDER_LINE_ITEMS__VARIANT__PRICES__BUY_PRICE = "orderLineItems.variant.prices.buyPrice",
160
158
  ORDER_LINE_ITEMS__VARIANT__PRICES__CURRENCY = "orderLineItems.variant.prices.currency",
161
- ORDER_LINE_ITEMS__VARIANT__PRICES__CURRENCY_SYMBOL = "orderLineItems.variant.prices.currencySymbol",
162
159
  ORDER_LINE_ITEMS__VARIANT__PRICES__DISCOUNT_PRICE = "orderLineItems.variant.prices.discountPrice",
163
160
  ORDER_LINE_ITEMS__VARIANT__PRICES__PRICE_LIST_ID = "orderLineItems.variant.prices.priceListId",
164
161
  ORDER_LINE_ITEMS__VARIANT__PRICES__SELL_PRICE = "orderLineItems.variant.prices.sellPrice",
@@ -0,0 +1,59 @@
1
+ import {
2
+ fetchQuery,
3
+ ConfigType,
4
+ APIResponse,
5
+ handleAPIError,
6
+ } from "@ikas/fe-api-client";
7
+ import { RaffleParticipants } from "../types";
8
+
9
+ const getRaffleParticipants = async (
10
+ fields?: string[],
11
+ config?: ConfigType
12
+ ) => {
13
+ try {
14
+ const { data, errors } = await fetchQuery({
15
+ operationName: "getRaffleParticipants",
16
+ config,
17
+ allReturnFields,
18
+ fields,
19
+ query: (returnFields: string) => `
20
+ query getRaffleParticipants {
21
+ getRaffleParticipants ${returnFields}
22
+ }
23
+ `,
24
+ });
25
+
26
+ return new APIResponse<RaffleParticipants[]>(
27
+ data?.getRaffleParticipants,
28
+ errors
29
+ );
30
+ } catch (err) {
31
+ return handleAPIError(err);
32
+ }
33
+ };
34
+
35
+ export default getRaffleParticipants;
36
+
37
+ const allReturnFields =
38
+ "{applicationDate appliedProduct {productId variantId } createdAt customerId deleted email extraData firstName fullName id isDeliveredCargo isSendEmail isWinner lastName phone raffleId updatedAt }";
39
+
40
+ export enum ResponseField {
41
+ APPLICATION_DATE = "applicationDate",
42
+ APPLIED_PRODUCT__PRODUCT_ID = "appliedProduct.productId",
43
+ APPLIED_PRODUCT__VARIANT_ID = "appliedProduct.variantId",
44
+ CREATED_AT = "createdAt",
45
+ CUSTOMER_ID = "customerId",
46
+ DELETED = "deleted",
47
+ EMAIL = "email",
48
+ EXTRA_DATA = "extraData",
49
+ FIRST_NAME = "firstName",
50
+ FULL_NAME = "fullName",
51
+ ID = "id",
52
+ IS_DELIVERED_CARGO = "isDeliveredCargo",
53
+ IS_SEND_EMAIL = "isSendEmail",
54
+ IS_WINNER = "isWinner",
55
+ LAST_NAME = "lastName",
56
+ PHONE = "phone",
57
+ RAFFLE_ID = "raffleId",
58
+ UPDATED_AT = "updatedAt",
59
+ }
@@ -0,0 +1,74 @@
1
+ import {
2
+ fetchQuery,
3
+ ConfigType,
4
+ APIResponse,
5
+ handleAPIError,
6
+ } from "@ikas/fe-api-client";
7
+ import { Raffle } from "../types";
8
+
9
+ const getRafflesByCustomerId = async (
10
+ variables: QueryParams,
11
+ fields?: string[],
12
+ config?: ConfigType
13
+ ) => {
14
+ try {
15
+ const { data, errors } = await fetchQuery({
16
+ operationName: "getRafflesByCustomerId",
17
+ config,
18
+ variables,
19
+ allReturnFields,
20
+ fields,
21
+ query: (returnFields: string) => `
22
+ query getRafflesByCustomerId (
23
+ $winnerFilter: Boolean,
24
+ ) {
25
+ getRafflesByCustomerId (
26
+ winnerFilter: $winnerFilter,
27
+ ) ${returnFields}
28
+ }
29
+ `,
30
+ });
31
+
32
+ return new APIResponse<Raffle[]>(data?.getRafflesByCustomerId, errors);
33
+ } catch (err) {
34
+ return handleAPIError(err);
35
+ }
36
+ };
37
+
38
+ export default getRafflesByCustomerId;
39
+
40
+ export type QueryParams = {
41
+ winnerFilter?: boolean | null;
42
+ };
43
+
44
+ const allReturnFields =
45
+ "{createdAt dateRange {end start } deleted id metadata {canonicals createdAt deleted description disableIndex id pageTitle slug targetId targetType updatedAt } name participantCount raffleParticipantCreatedMailExtraData raffleParticipantWinnerMailExtraData requiredCustomerAccount status updatedAt variants {productId variantId } verificationType }";
46
+
47
+ export enum ResponseField {
48
+ CREATED_AT = "createdAt",
49
+ DATE_RANGE__END = "dateRange.end",
50
+ DATE_RANGE__START = "dateRange.start",
51
+ DELETED = "deleted",
52
+ ID = "id",
53
+ METADATA__CANONICALS = "metadata.canonicals",
54
+ METADATA__CREATED_AT = "metadata.createdAt",
55
+ METADATA__DELETED = "metadata.deleted",
56
+ METADATA__DESCRIPTION = "metadata.description",
57
+ METADATA__DISABLE_INDEX = "metadata.disableIndex",
58
+ METADATA__ID = "metadata.id",
59
+ METADATA__PAGE_TITLE = "metadata.pageTitle",
60
+ METADATA__SLUG = "metadata.slug",
61
+ METADATA__TARGET_ID = "metadata.targetId",
62
+ METADATA__TARGET_TYPE = "metadata.targetType",
63
+ METADATA__UPDATED_AT = "metadata.updatedAt",
64
+ NAME = "name",
65
+ PARTICIPANT_COUNT = "participantCount",
66
+ RAFFLE_PARTICIPANT_CREATED_MAIL_EXTRA_DATA = "raffleParticipantCreatedMailExtraData",
67
+ RAFFLE_PARTICIPANT_WINNER_MAIL_EXTRA_DATA = "raffleParticipantWinnerMailExtraData",
68
+ REQUIRED_CUSTOMER_ACCOUNT = "requiredCustomerAccount",
69
+ STATUS = "status",
70
+ UPDATED_AT = "updatedAt",
71
+ VARIANTS__PRODUCT_ID = "variants.productId",
72
+ VARIANTS__VARIANT_ID = "variants.variantId",
73
+ VERIFICATION_TYPE = "verificationType",
74
+ }
@@ -42,7 +42,7 @@ export type QueryParams = {
42
42
  };
43
43
 
44
44
  const allReturnFields =
45
- "{analytics4Id createdAt deleted domains {createdAt deleted id isDefault merchantDomainId name redirectDomainName updatedAt } emailSettingsId fbAccessToken fbpId gtmId id localizations {createdAt deleted id isDefault locale name updatedAt } mainStorefrontThemeId name pickUpStockLocationIds routings {countryCodes createdAt deleted domain dynamicCurrencySettings {roundingFormat targetCurrencyCode targetCurrencySymbol } id locale path priceListId updatedAt } salesChannelId socialLoginSettings {apiKey apiSecret provider } status themes {createdAt deleted id isMainTheme name status themeId themeVersionId updatedAt } tiktokPixelId token universalAnalyticsId updatedAt }";
45
+ "{analytics4Id createdAt deleted domains {createdAt deleted id isDefault merchantDomainId name redirectDomainName updatedAt } emailSettingsId fbAccessToken fbpId gtmId id localizations {createdAt deleted id isDefault locale name updatedAt } mainStorefrontThemeId name pickUpStockLocationIds routings {countryCodes createdAt deleted domain dynamicCurrencySettings {roundingFormat targetCurrencyCode } id locale path priceListId updatedAt } salesChannelId socialLoginSettings {apiKey apiSecret provider } status themes {createdAt deleted id isMainTheme name status themeId themeVersionId updatedAt } tiktokPixelId token universalAnalyticsId updatedAt }";
46
46
 
47
47
  export enum ResponseField {
48
48
  ANALYTICS4_ID = "analytics4Id",
@@ -77,7 +77,6 @@ export enum ResponseField {
77
77
  ROUTINGS__DOMAIN = "routings.domain",
78
78
  ROUTINGS__DYNAMIC_CURRENCY_SETTINGS__ROUNDING_FORMAT = "routings.dynamicCurrencySettings.roundingFormat",
79
79
  ROUTINGS__DYNAMIC_CURRENCY_SETTINGS__TARGET_CURRENCY_CODE = "routings.dynamicCurrencySettings.targetCurrencyCode",
80
- ROUTINGS__DYNAMIC_CURRENCY_SETTINGS__TARGET_CURRENCY_SYMBOL = "routings.dynamicCurrencySettings.targetCurrencySymbol",
81
80
  ROUTINGS__ID = "routings.id",
82
81
  ROUTINGS__LOCALE = "routings.locale",
83
82
  ROUTINGS__PATH = "routings.path",
@@ -51,13 +51,12 @@ export type QueryParams = {
51
51
  };
52
52
 
53
53
  const allReturnFields =
54
- "{createdAt deleted giftPackagePriceList {currencyCode currencySymbol price } id identityNumberRequirement isAccountRequired isGiftPackageEnabled isShowPostalCode isTermsAndConditionsDefaultChecked options {name required } phoneRequirement postalCodeRequirement showCheckoutNote showTermsAndConditionsCheckbox storefrontId updatedAt }";
54
+ "{createdAt deleted giftPackagePriceList {currencyCode price } id identityNumberRequirement isAccountRequired isGiftPackageEnabled isShowPostalCode isTermsAndConditionsDefaultChecked options {name required } phoneRequirement postalCodeRequirement showCheckoutNote showTermsAndConditionsCheckbox storefrontId updatedAt }";
55
55
 
56
56
  export enum ResponseField {
57
57
  CREATED_AT = "createdAt",
58
58
  DELETED = "deleted",
59
59
  GIFT_PACKAGE_PRICE_LIST__CURRENCY_CODE = "giftPackagePriceList.currencyCode",
60
- GIFT_PACKAGE_PRICE_LIST__CURRENCY_SYMBOL = "giftPackagePriceList.currencySymbol",
61
60
  GIFT_PACKAGE_PRICE_LIST__PRICE = "giftPackagePriceList.price",
62
61
  ID = "id",
63
62
  IDENTITY_NUMBER_REQUIREMENT = "identityNumberRequirement",
@@ -57,14 +57,12 @@ export type QueryParams = {
57
57
  };
58
58
 
59
59
  const allReturnFields =
60
- "{capital createdAt currency currencyCode currencySymbol deleted emoji emojiString id iso2 iso3 locationTranslations {en tr } name native phoneCode region subregion updatedAt }";
60
+ "{capital createdAt currency deleted emoji emojiString id iso2 iso3 locationTranslations {en tr } name native phoneCode region subregion updatedAt }";
61
61
 
62
62
  export enum ResponseField {
63
63
  CAPITAL = "capital",
64
64
  CREATED_AT = "createdAt",
65
65
  CURRENCY = "currency",
66
- CURRENCY_CODE = "currencyCode",
67
- CURRENCY_SYMBOL = "currencySymbol",
68
66
  DELETED = "deleted",
69
67
  EMOJI = "emoji",
70
68
  EMOJI_STRING = "emojiString",
@@ -51,14 +51,13 @@ export type QueryParams = {
51
51
  };
52
52
 
53
53
  const allReturnFields =
54
- "{amount checkoutId createdAt currencyCode currencySymbol customerId deleted error {code declineCode message } id orderId paymentGatewayCode paymentGatewayId paymentGatewayName paymentMethod paymentMethodDetail {bankName binNumber cardAssociation cardFamily cardType installment {installmentCount installmentPrice originalRate rate totalPrice } lastFourDigits threeDSecure } processedAt refundReason status type updatedAt }";
54
+ "{amount checkoutId createdAt currencyCode customerId deleted error {code declineCode message } id orderId paymentGatewayCode paymentGatewayId paymentGatewayName paymentMethod paymentMethodDetail {bankName binNumber cardAssociation cardFamily cardType installment {installmentCount installmentPrice originalRate rate totalPrice } lastFourDigits threeDSecure } processedAt refundReason status type updatedAt }";
55
55
 
56
56
  export enum ResponseField {
57
57
  AMOUNT = "amount",
58
58
  CHECKOUT_ID = "checkoutId",
59
59
  CREATED_AT = "createdAt",
60
60
  CURRENCY_CODE = "currencyCode",
61
- CURRENCY_SYMBOL = "currencySymbol",
62
61
  CUSTOMER_ID = "customerId",
63
62
  DELETED = "deleted",
64
63
  ERROR__CODE = "error.code",
@@ -72,7 +72,7 @@ export type QueryParams = {
72
72
  };
73
73
 
74
74
  const allReturnFields =
75
- "{count data {attributes {imageIds productAttributeId productAttributeOptionId value } brandId categoryIds createdAt deleted description groupVariantsByVariantTypeId id maxQuantityPerCart metaData {canonicals createdAt deleted description disableIndex id metadataOverrides {description language pageTitle storefrontId storefrontRegionId } pageTitle redirectTo slug targetId targetType translations {description locale pageTitle } updatedAt } name productOptionSetId productVariantTypes {order variantTypeId variantValueIds } salesChannelIds shortDescription tagIds translations {description locale name } type updatedAt variants {attributes {imageIds productAttributeId productAttributeOptionId value } barcodeList createdAt deleted hsCode id images {imageId isMain isVideo order } isActive prices {buyPrice currency currencyCode currencySymbol discountPrice priceListId sellPrice } sellIfOutOfStock sku stocks {stockCount stockLocationId } updatedAt variantValueIds {variantTypeId variantValueId } weight } vendorId weight } hasNext limit page }";
75
+ "{count data {attributes {imageIds productAttributeId productAttributeOptionId value } brandId categoryIds createdAt deleted description groupVariantsByVariantTypeId id maxQuantityPerCart metaData {canonicals createdAt deleted description disableIndex id metadataOverrides {description language pageTitle storefrontId storefrontRegionId } pageTitle redirectTo slug targetId targetType translations {description locale pageTitle } updatedAt } name productOptionSetId productVariantTypes {order variantTypeId variantValueIds } salesChannelIds shortDescription tagIds translations {description locale name } type updatedAt variants {attributes {imageIds productAttributeId productAttributeOptionId value } barcodeList createdAt deleted hsCode id images {imageId isMain isVideo order } isActive prices {buyPrice currency discountPrice priceListId sellPrice } sellIfOutOfStock sku stocks {stockCount stockLocationId } updatedAt variantValueIds {variantTypeId variantValueId } weight } vendorId weight } hasNext limit page }";
76
76
 
77
77
  export enum ResponseField {
78
78
  COUNT = "count",
@@ -137,8 +137,6 @@ export enum ResponseField {
137
137
  DATA__VARIANTS__IS_ACTIVE = "data.variants.isActive",
138
138
  DATA__VARIANTS__PRICES__BUY_PRICE = "data.variants.prices.buyPrice",
139
139
  DATA__VARIANTS__PRICES__CURRENCY = "data.variants.prices.currency",
140
- DATA__VARIANTS__PRICES__CURRENCY_CODE = "data.variants.prices.currencyCode",
141
- DATA__VARIANTS__PRICES__CURRENCY_SYMBOL = "data.variants.prices.currencySymbol",
142
140
  DATA__VARIANTS__PRICES__DISCOUNT_PRICE = "data.variants.prices.discountPrice",
143
141
  DATA__VARIANTS__PRICES__PRICE_LIST_ID = "data.variants.prices.priceListId",
144
142
  DATA__VARIANTS__PRICES__SELL_PRICE = "data.variants.prices.sellPrice",
@@ -64,7 +64,7 @@ export type QueryParams = {
64
64
  };
65
65
 
66
66
  const allReturnFields =
67
- "{createdAt customerId deleted email id productId storefrontId storefrontRoutingId updatedAt variantId }";
67
+ "{createdAt customerId deleted email id productId storefrontId updatedAt variantId }";
68
68
 
69
69
  export enum ResponseField {
70
70
  CREATED_AT = "createdAt",
@@ -74,7 +74,6 @@ export enum ResponseField {
74
74
  ID = "id",
75
75
  PRODUCT_ID = "productId",
76
76
  STOREFRONT_ID = "storefrontId",
77
- STOREFRONT_ROUTING_ID = "storefrontRoutingId",
78
77
  UPDATED_AT = "updatedAt",
79
78
  VARIANT_ID = "variantId",
80
79
  }
@@ -51,7 +51,7 @@ export type QueryParams = {
51
51
  };
52
52
 
53
53
  const allReturnFields =
54
- "{createdAt deleted id name options {createdAt dateSettings {max maxRelativeNextDate min minRelativeNextDate } deleted fileSettings {allowedExtensions maxQuantity minQuantity } id isOptional name optionalText order otherPrices {currencyCode currencySymbol price } price requiredOptionId requiredOptionValueIds selectSettings {maxSelect minSelect type values {colorCode createdAt deleted id order otherPrices {currencyCode currencySymbol price } price thumbnailImageId updatedAt value } } textSettings {max min } type updatedAt } translations {locale options {id name optionalText values {id value } } } updatedAt }";
54
+ "{createdAt deleted id name options {createdAt dateSettings {max maxRelativeNextDate min minRelativeNextDate } deleted fileSettings {allowedExtensions maxQuantity minQuantity } id isOptional name optionalText order otherPrices {currencyCode price } price requiredOptionId requiredOptionValueIds selectSettings {maxSelect minSelect type values {colorCode createdAt deleted id order otherPrices {currencyCode price } price thumbnailImageId updatedAt value } } textSettings {max min } type updatedAt } translations {locale options {id name optionalText values {id value } } } updatedAt }";
55
55
 
56
56
  export enum ResponseField {
57
57
  CREATED_AT = "createdAt",
@@ -73,7 +73,6 @@ export enum ResponseField {
73
73
  OPTIONS__OPTIONAL_TEXT = "options.optionalText",
74
74
  OPTIONS__ORDER = "options.order",
75
75
  OPTIONS__OTHER_PRICES__CURRENCY_CODE = "options.otherPrices.currencyCode",
76
- OPTIONS__OTHER_PRICES__CURRENCY_SYMBOL = "options.otherPrices.currencySymbol",
77
76
  OPTIONS__OTHER_PRICES__PRICE = "options.otherPrices.price",
78
77
  OPTIONS__PRICE = "options.price",
79
78
  OPTIONS__REQUIRED_OPTION_ID = "options.requiredOptionId",
@@ -87,7 +86,6 @@ export enum ResponseField {
87
86
  OPTIONS__SELECT_SETTINGS__VALUES__ID = "options.selectSettings.values.id",
88
87
  OPTIONS__SELECT_SETTINGS__VALUES__ORDER = "options.selectSettings.values.order",
89
88
  OPTIONS__SELECT_SETTINGS__VALUES__OTHER_PRICES__CURRENCY_CODE = "options.selectSettings.values.otherPrices.currencyCode",
90
- OPTIONS__SELECT_SETTINGS__VALUES__OTHER_PRICES__CURRENCY_SYMBOL = "options.selectSettings.values.otherPrices.currencySymbol",
91
89
  OPTIONS__SELECT_SETTINGS__VALUES__OTHER_PRICES__PRICE = "options.selectSettings.values.otherPrices.price",
92
90
  OPTIONS__SELECT_SETTINGS__VALUES__PRICE = "options.selectSettings.values.price",
93
91
  OPTIONS__SELECT_SETTINGS__VALUES__THUMBNAIL_IMAGE_ID = "options.selectSettings.values.thumbnailImageId",
@@ -12,20 +12,20 @@ import {
12
12
  RafflePaginationResponse,
13
13
  } from "../types";
14
14
 
15
- const listStorefrontRaffle = async (
15
+ const listRaffle = async (
16
16
  variables: QueryParams,
17
17
  fields?: string[],
18
18
  config?: ConfigType
19
19
  ) => {
20
20
  try {
21
21
  const { data, errors } = await fetchQuery({
22
- operationName: "listStorefrontRaffle",
22
+ operationName: "listRaffle",
23
23
  config,
24
24
  variables,
25
25
  allReturnFields,
26
26
  fields,
27
27
  query: (returnFields: string) => `
28
- query listStorefrontRaffle (
28
+ query listRaffle (
29
29
  $end: DateFilterInput,
30
30
  $id: StringFilterInput,
31
31
  $includeDeleted: Boolean,
@@ -36,7 +36,7 @@ const listStorefrontRaffle = async (
36
36
  $status: BooleanFilterInput,
37
37
  $updatedAt: DateFilterInput,
38
38
  ) {
39
- listStorefrontRaffle (
39
+ listRaffle (
40
40
  end: $end,
41
41
  id: $id,
42
42
  includeDeleted: $includeDeleted,
@@ -51,16 +51,13 @@ const listStorefrontRaffle = async (
51
51
  `,
52
52
  });
53
53
 
54
- return new APIResponse<RafflePaginationResponse>(
55
- data?.listStorefrontRaffle,
56
- errors
57
- );
54
+ return new APIResponse<RafflePaginationResponse>(data?.listRaffle, errors);
58
55
  } catch (err) {
59
56
  return handleAPIError(err);
60
57
  }
61
58
  };
62
59
 
63
- export default listStorefrontRaffle;
60
+ export default listRaffle;
64
61
 
65
62
  export type QueryParams = {
66
63
  end?: DateFilterInput | null;
@@ -75,7 +72,7 @@ export type QueryParams = {
75
72
  };
76
73
 
77
74
  const allReturnFields =
78
- "{count data {createdAt dateRange {end start } deleted id metadata {canonicals createdAt deleted description disableIndex id pageTitle slug targetId targetType updatedAt } name requiredCustomerAccount status updatedAt variants {productId variantId } verificationType } hasNext limit page }";
75
+ "{count data {createdAt dateRange {end start } deleted id metadata {canonicals createdAt deleted description disableIndex id pageTitle slug targetId targetType updatedAt } name participantCount raffleParticipantCreatedMailExtraData raffleParticipantWinnerMailExtraData requiredCustomerAccount status updatedAt variants {productId variantId } verificationType } hasNext limit page }";
79
76
 
80
77
  export enum ResponseField {
81
78
  COUNT = "count",
@@ -96,6 +93,9 @@ export enum ResponseField {
96
93
  DATA__METADATA__TARGET_TYPE = "data.metadata.targetType",
97
94
  DATA__METADATA__UPDATED_AT = "data.metadata.updatedAt",
98
95
  DATA__NAME = "data.name",
96
+ DATA__PARTICIPANT_COUNT = "data.participantCount",
97
+ DATA__RAFFLE_PARTICIPANT_CREATED_MAIL_EXTRA_DATA = "data.raffleParticipantCreatedMailExtraData",
98
+ DATA__RAFFLE_PARTICIPANT_WINNER_MAIL_EXTRA_DATA = "data.raffleParticipantWinnerMailExtraData",
99
99
  DATA__REQUIRED_CUSTOMER_ACCOUNT = "data.requiredCustomerAccount",
100
100
  DATA__STATUS = "data.status",
101
101
  DATA__UPDATED_AT = "data.updatedAt",
@@ -42,7 +42,7 @@ export type QueryParams = {
42
42
  };
43
43
 
44
44
  const allReturnFields =
45
- "{count data facets {id values {count id } } limit page results {attributes {imageIds productAttribute {id name tableTemplate {columns {id name } rows {id name } } translations {description locale name options {id name } } type } productAttributeOption {id name } value } brand {id name slug translations {description locale name } } categories {id name path {id name slug translations {description locale name } } slug translations {description locale name } } deleted description groupVariantsByVariantTypeId id metaData {canonicals description disableIndex metadataOverrides {description language pageTitle storefrontId storefrontRegionId } pageTitle redirectTo slug translations {description locale pageTitle } } name productOptionSetId productVariantTypes {order variantType {id name selectionType translations {locale name values {id name } } values {colorCode id name thumbnailImageId } } variantValueIds } salesChannelIds shortDescription tags {id name translations {description locale name } } translations {description locale name } type variants {attributes {imageIds productAttribute {id name tableTemplate {columns {id name } rows {id name } } translations {description locale name options {id name } } type } productAttributeOption {id name } value } barcodeList deleted id images {id isMain isVideo order } isActive prices {buyPrice currency currencyCode currencySymbol discountPrice priceListId sellPrice } sellIfOutOfStock sku stocks {stockCount stockLocationId } variantValues {variantTypeId variantValueId } weight } weight } totalCount }";
45
+ "{count data facets {id values {count id } } limit page results {attributes {imageIds productAttribute {id name tableTemplate {columns {id name } rows {id name } } translations {description locale name options {id name } } type } productAttributeOption {id name } value } brand {id name slug translations {description locale name } } categories {id name path {id name slug translations {description locale name } } slug translations {description locale name } } deleted description groupVariantsByVariantTypeId id metaData {canonicals description disableIndex metadataOverrides {description language pageTitle storefrontId storefrontRegionId } pageTitle redirectTo slug translations {description locale pageTitle } } name productOptionSetId productVariantTypes {order variantType {id name selectionType translations {locale name values {id name } } values {colorCode id name thumbnailImageId } } variantValueIds } salesChannelIds shortDescription tags {id name translations {description locale name } } translations {description locale name } type variants {attributes {imageIds productAttribute {id name tableTemplate {columns {id name } rows {id name } } translations {description locale name options {id name } } type } productAttributeOption {id name } value } barcodeList deleted id images {id isMain isVideo order } isActive prices {buyPrice currency discountPrice priceListId sellPrice } sellIfOutOfStock sku stocks {stockCount stockLocationId } variantValues {variantTypeId variantValueId } weight } weight } totalCount }";
46
46
 
47
47
  export enum ResponseField {
48
48
  COUNT = "count",
@@ -156,8 +156,6 @@ export enum ResponseField {
156
156
  RESULTS__VARIANTS__IS_ACTIVE = "results.variants.isActive",
157
157
  RESULTS__VARIANTS__PRICES__BUY_PRICE = "results.variants.prices.buyPrice",
158
158
  RESULTS__VARIANTS__PRICES__CURRENCY = "results.variants.prices.currency",
159
- RESULTS__VARIANTS__PRICES__CURRENCY_CODE = "results.variants.prices.currencyCode",
160
- RESULTS__VARIANTS__PRICES__CURRENCY_SYMBOL = "results.variants.prices.currencySymbol",
161
159
  RESULTS__VARIANTS__PRICES__DISCOUNT_PRICE = "results.variants.prices.discountPrice",
162
160
  RESULTS__VARIANTS__PRICES__PRICE_LIST_ID = "results.variants.prices.priceListId",
163
161
  RESULTS__VARIANTS__PRICES__SELL_PRICE = "results.variants.prices.sellPrice",
@@ -415,13 +415,6 @@ export enum RaffleMetadataTargetTypeEnum {
415
415
  RAFFLE = "RAFFLE",
416
416
  }
417
417
 
418
- export enum RaffleParticipantStatusEnum {
419
- COMPLETED = "COMPLETED",
420
- IN_PROGRESS = "IN_PROGRESS",
421
- LOSER = "LOSER",
422
- WINNER = "WINNER",
423
- }
424
-
425
418
  export enum ShippingMethodEnum {
426
419
  CLICK_AND_COLLECT = "CLICK_AND_COLLECT",
427
420
  NO_SHIPMENT = "NO_SHIPMENT",
@@ -741,7 +734,6 @@ export interface Cart {
741
734
  createdAt: any | null;
742
735
  createdBy: CartCreatedByEnum | null;
743
736
  currencyCode: string | null;
744
- currencySymbol: string | null;
745
737
  customerId: string | null;
746
738
  deleted: boolean | null;
747
739
  dueDate: any;
@@ -784,7 +776,6 @@ export interface CartStorefrontRouting {
784
776
  export interface CartStorefrontRoutingDynamicCurrencySettings {
785
777
  roundingFormat: string | null;
786
778
  targetCurrencyCode: string;
787
- targetCurrencySymbol: string | null;
788
779
  }
789
780
 
790
781
  export interface CartV2 {
@@ -801,7 +792,6 @@ export interface CartV2 {
801
792
  createdBy: CartCreatedByEnum | null;
802
793
  currencyCode: string;
803
794
  currencyRates: OrderCurrencyRate[];
804
- currencySymbol: string | null;
805
795
  customer: OrderCustomer | null;
806
796
  customerId: string | null;
807
797
  deleted: boolean | null;
@@ -977,7 +967,6 @@ export interface CheckoutSettings {
977
967
 
978
968
  export interface CheckoutSettingsPrice {
979
969
  currencyCode: string;
980
- currencySymbol: string | null;
981
970
  price: number;
982
971
  }
983
972
 
@@ -1009,8 +998,6 @@ export interface Country {
1009
998
  capital: string | null;
1010
999
  createdAt: any | null;
1011
1000
  currency: string | null;
1012
- currencyCode: string | null;
1013
- currencySymbol: string | null;
1014
1001
  deleted: boolean | null;
1015
1002
  emoji: string | null;
1016
1003
  emojiString: string | null;
@@ -1035,8 +1022,6 @@ export interface CreateStripePaymentIntentResponse {
1035
1022
 
1036
1023
  export interface CurrencyRate {
1037
1024
  baseCurrency: string;
1038
- baseCurrencyCode: string | null;
1039
- baseCurrencySymbol: string | null;
1040
1025
  createdAt: any | null;
1041
1026
  date: any;
1042
1027
  deleted: boolean | null;
@@ -1541,7 +1526,6 @@ export interface OrderLineDiscount {
1541
1526
  export interface OrderLineItem {
1542
1527
  createdAt: any | null;
1543
1528
  currencyCode: string | null;
1544
- currencySymbol: string | null;
1545
1529
  deleted: boolean | null;
1546
1530
  discount: OrderLineDiscount | null;
1547
1531
  discountPrice: number | null;
@@ -1610,7 +1594,6 @@ export interface OrderLineVariantCategoryPath {
1610
1594
  export interface OrderLineVariantPrice {
1611
1595
  buyPrice: number | null;
1612
1596
  currency: string | null;
1613
- currencySymbol: string | null;
1614
1597
  discountPrice: number | null;
1615
1598
  priceListId: string | null;
1616
1599
  sellPrice: number;
@@ -1811,7 +1794,6 @@ export interface ProductBackInStockRemind {
1811
1794
  id: string;
1812
1795
  productId: string;
1813
1796
  storefrontId: string;
1814
- storefrontRoutingId: string | null;
1815
1797
  updatedAt: any | null;
1816
1798
  variantId: string;
1817
1799
  }
@@ -1962,7 +1944,6 @@ export interface ProductOptionSelectValue {
1962
1944
 
1963
1945
  export interface ProductOptionSelectValueOtherPrice {
1964
1946
  currencyCode: string;
1965
- currencySymbol: string | null;
1966
1947
  price: number;
1967
1948
  }
1968
1949
 
@@ -2009,8 +1990,6 @@ export interface ProductPaginationResponse {
2009
1990
  export interface ProductPrice {
2010
1991
  buyPrice: number | null;
2011
1992
  currency: string | null;
2012
- currencyCode: string | null;
2013
- currencySymbol: string | null;
2014
1993
  discountPrice: number | null;
2015
1994
  priceListId: string | null;
2016
1995
  sellPrice: number;
@@ -2055,6 +2034,23 @@ export interface ProductVariantType {
2055
2034
  variantValueIds: string[] | null;
2056
2035
  }
2057
2036
 
2037
+ export interface Raffle {
2038
+ createdAt: any | null;
2039
+ dateRange: RaffleDateRangeField | null;
2040
+ deleted: boolean | null;
2041
+ id: string;
2042
+ metadata: RaffleMetadata;
2043
+ name: string;
2044
+ participantCount: number | null;
2045
+ raffleParticipantCreatedMailExtraData: string | null;
2046
+ raffleParticipantWinnerMailExtraData: string | null;
2047
+ requiredCustomerAccount: boolean;
2048
+ status: boolean;
2049
+ updatedAt: any | null;
2050
+ variants: RaffleVariantInformation[];
2051
+ verificationType: VerificationTypeEnum;
2052
+ }
2053
+
2058
2054
  export interface RaffleDateRangeField {
2059
2055
  end: any | null;
2060
2056
  start: any | null;
@@ -2076,7 +2072,7 @@ export interface RaffleMetadata {
2076
2072
 
2077
2073
  export interface RafflePaginationResponse {
2078
2074
  count: number;
2079
- data: StorefrontRaffle[];
2075
+ data: Raffle[];
2080
2076
  hasNext: boolean;
2081
2077
  limit: number;
2082
2078
  page: number;
@@ -2094,11 +2090,11 @@ export interface RaffleParticipants {
2094
2090
  fullName: string;
2095
2091
  id: string;
2096
2092
  isDeliveredCargo: boolean | null;
2093
+ isSendEmail: boolean | null;
2094
+ isWinner: boolean | null;
2097
2095
  lastName: string;
2098
2096
  phone: string | null;
2099
- raffle: StorefrontRaffle;
2100
2097
  raffleId: string;
2101
- status: RaffleParticipantStatusEnum | null;
2102
2098
  updatedAt: any | null;
2103
2099
  }
2104
2100
 
@@ -2219,8 +2215,6 @@ export interface SearchProductImage {
2219
2215
  export interface SearchProductPrice {
2220
2216
  buyPrice: number | null;
2221
2217
  currency: string | null;
2222
- currencyCode: string | null;
2223
- currencySymbol: string | null;
2224
2218
  discountPrice: number | null;
2225
2219
  priceListId: string | null;
2226
2220
  sellPrice: number;
@@ -2381,7 +2375,6 @@ export interface StorefrontDomain {
2381
2375
  export interface StorefrontDynamicCurrencySettings {
2382
2376
  roundingFormat: string | null;
2383
2377
  targetCurrencyCode: string;
2384
- targetCurrencySymbol: string | null;
2385
2378
  }
2386
2379
 
2387
2380
  export interface StorefrontLocalization {
@@ -2401,7 +2394,6 @@ export interface StorefrontOrder {
2401
2394
  createdAt: any | null;
2402
2395
  currencyCode: string;
2403
2396
  currencyRates: OrderCurrencyRate[];
2404
- currencySymbol: string | null;
2405
2397
  customer: OrderCustomer | null;
2406
2398
  customerId: string | null;
2407
2399
  deleted: boolean | null;
@@ -2431,20 +2423,6 @@ export interface StorefrontOrder {
2431
2423
  updatedAt: any | null;
2432
2424
  }
2433
2425
 
2434
- export interface StorefrontRaffle {
2435
- createdAt: any | null;
2436
- dateRange: RaffleDateRangeField | null;
2437
- deleted: boolean | null;
2438
- id: string;
2439
- metadata: RaffleMetadata;
2440
- name: string;
2441
- requiredCustomerAccount: boolean;
2442
- status: boolean;
2443
- updatedAt: any | null;
2444
- variants: RaffleVariantInformation[];
2445
- verificationType: VerificationTypeEnum;
2446
- }
2447
-
2448
2426
  export interface StorefrontRouting {
2449
2427
  countryCodes: string[] | null;
2450
2428
  createdAt: any | null;
@@ -2475,7 +2453,6 @@ export interface StorefrontTransaction {
2475
2453
  checkoutId: string | null;
2476
2454
  createdAt: any | null;
2477
2455
  currencyCode: string;
2478
- currencySymbol: string | null;
2479
2456
  customerId: string | null;
2480
2457
  deleted: boolean | null;
2481
2458
  error: TransactionError | null;
@@ -2895,12 +2872,27 @@ export interface RaffleMetadataTargetTypeEnumFilter {
2895
2872
 
2896
2873
  export interface RaffleParticipantsInput {
2897
2874
  appliedProduct: AppliedProductInput;
2875
+ createdAt?: any | null;
2876
+ deleted?: boolean | null;
2898
2877
  email: string;
2899
2878
  extraData?: any | null;
2900
2879
  firstName: string;
2880
+ id?: string | null;
2901
2881
  lastName: string;
2902
2882
  phone?: string | null;
2903
2883
  raffleId: string;
2884
+ updatedAt?: any | null;
2885
+ }
2886
+
2887
+ export interface RaffleParticipantsUpdateInput {
2888
+ createdAt?: any | null;
2889
+ deleted?: boolean | null;
2890
+ firstName?: string | null;
2891
+ id?: string | null;
2892
+ lastName?: string | null;
2893
+ participantId: string;
2894
+ phone?: string | null;
2895
+ updatedAt?: any | null;
2904
2896
  }
2905
2897
 
2906
2898
  export interface RetrieveInstallmentInfoInput {
@@ -105,7 +105,7 @@ export async function getAvailableStockLocations(
105
105
  ).default;
106
106
  const response = await _getAvailableStockLocations(params);
107
107
  return new APIResponse(
108
- response.data?.stockLocations as IkasAvailableStockLocation[] | undefined,
108
+ response.data as IkasAvailableStockLocation[] | undefined,
109
109
  response.graphQLErrors
110
110
  );
111
111
  }
@@ -31,7 +31,6 @@ import {
31
31
  IkasFavoriteProduct,
32
32
  IkasLastViewedProduct,
33
33
  IkasOrder,
34
- IkasOrderLineItem,
35
34
  IkasOrderRefundSettings,
36
35
  IkasOrderTransaction,
37
36
  initIkasCustomerAttribute,
@@ -193,14 +192,6 @@ export async function getOrders(params: GetCustomerOrdersQueryParams) {
193
192
  const response = await _getCustomerOrders(params);
194
193
  const data: IkasOrder[] | undefined = response.data as any;
195
194
 
196
- data?.forEach((order) => {
197
- if (order.orderLineItems?.length) {
198
- order.orderLineItems = order.orderLineItems.filter(
199
- (orderLineItem: IkasOrderLineItem) => !orderLineItem.deleted
200
- );
201
- }
202
- });
203
-
204
195
  return new APIResponse(data, response.graphQLErrors);
205
196
  }
206
197