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

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 +2 -0
  3. package/src/__api/models/CartStorefrontRoutingDynamicCurrencySettings.ts +2 -0
  4. package/src/__api/models/CartV2.ts +2 -0
  5. package/src/__api/models/CheckoutSettingsPrice.ts +2 -0
  6. package/src/__api/models/Country.ts +4 -0
  7. package/src/__api/models/CurrencyRate.ts +4 -0
  8. package/src/__api/models/OrderLineItem.ts +2 -0
  9. package/src/__api/models/OrderLineVariantPrice.ts +2 -0
  10. package/src/__api/models/ProductBackInStockRemind.ts +2 -0
  11. package/src/__api/models/ProductOptionSelectValueOtherPrice.ts +2 -0
  12. package/src/__api/models/ProductPrice.ts +4 -0
  13. package/src/__api/models/RafflePaginationResponse.ts +5 -3
  14. package/src/__api/models/RaffleParticipants.ts +8 -10
  15. package/src/__api/models/RaffleParticipantsInput.ts +1 -4
  16. package/src/__api/models/SearchProductPrice.ts +4 -0
  17. package/src/__api/models/StorefrontDynamicCurrencySettings.ts +2 -0
  18. package/src/__api/models/StorefrontOrder.ts +2 -0
  19. package/src/__api/models/{Raffle.ts → StorefrontRaffle.ts} +5 -16
  20. package/src/__api/models/StorefrontTransaction.ts +2 -0
  21. package/src/__api/models/_base.ts +2 -1
  22. package/src/__api/mutations/addCouponCodeToCheckout.ts +5 -1
  23. package/src/__api/mutations/addItemToCart.ts +4 -1
  24. package/src/__api/mutations/createOrderRefundRequest.ts +4 -1
  25. package/src/__api/mutations/saveCart.ts +4 -1
  26. package/src/__api/mutations/saveCartCouponCode.ts +4 -1
  27. package/src/__api/mutations/saveCheckout.ts +5 -1
  28. package/src/__api/mutations/saveItemToCart.ts +5 -1
  29. package/src/__api/mutations/saveProductBackInStockRemind.ts +2 -1
  30. package/src/__api/mutations/saveRaffleParticipant.ts +25 -3
  31. package/src/__api/mutations/updateCartCampaignOffer.ts +4 -1
  32. package/src/__api/queries/getCart.ts +5 -1
  33. package/src/__api/queries/getCartById.ts +4 -1
  34. package/src/__api/queries/getCheckoutByCartId.ts +5 -1
  35. package/src/__api/queries/getCheckoutById.ts +5 -1
  36. package/src/__api/queries/getCurrencyRate.ts +3 -1
  37. package/src/__api/queries/getCustomerOrders.ts +4 -1
  38. package/src/__api/queries/getOrder.ts +4 -1
  39. package/src/__api/queries/getOrderByEmail.ts +4 -1
  40. package/src/__api/queries/getStorefront.ts +2 -1
  41. package/src/__api/queries/listCheckoutSettings.ts +2 -1
  42. package/src/__api/queries/listCountry.ts +3 -1
  43. package/src/__api/queries/listOrderTransactions.ts +2 -1
  44. package/src/__api/queries/listProduct.ts +3 -1
  45. package/src/__api/queries/listProductBackInStockRemind.ts +2 -1
  46. package/src/__api/queries/listProductOptionSet.ts +3 -1
  47. package/src/__api/queries/listRaffleParticipants.ts +81 -0
  48. package/src/__api/queries/{listRaffle.ts → listStorefrontRaffle.ts} +10 -10
  49. package/src/__api/queries/searchProducts.ts +3 -1
  50. package/src/__api/types/index.ts +43 -35
  51. package/src/api/checkout/index.ts +1 -1
  52. package/src/api/customer/index.ts +9 -0
  53. package/src/api/file-upload/index.ts +35 -29
  54. package/src/api/masterpass/index.ts +7 -7
  55. package/src/api/product/index.ts +1 -0
  56. package/src/api/raffle/index.ts +12 -14
  57. package/src/index.ts +9 -7
  58. package/src/__api/models/RaffleParticipantsUpdateInput.ts +0 -24
  59. package/src/__api/mutations/updateRaffleParticipant.ts +0 -72
  60. package/src/__api/queries/getRaffleParticipants.ts +0 -59
  61. package/src/__api/queries/getRafflesByCustomerId.ts +0 -74
@@ -57,12 +57,14 @@ export type QueryParams = {
57
57
  };
58
58
 
59
59
  const allReturnFields =
60
- "{capital createdAt currency deleted emoji emojiString id iso2 iso3 locationTranslations {en tr } name native phoneCode region subregion updatedAt }";
60
+ "{capital createdAt currency currencyCode currencySymbol 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",
66
68
  DELETED = "deleted",
67
69
  EMOJI = "emoji",
68
70
  EMOJI_STRING = "emojiString",
@@ -51,13 +51,14 @@ export type QueryParams = {
51
51
  };
52
52
 
53
53
  const allReturnFields =
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 }";
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 }";
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",
61
62
  CUSTOMER_ID = "customerId",
62
63
  DELETED = "deleted",
63
64
  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 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 currencyCode currencySymbol 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,6 +137,8 @@ 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",
140
142
  DATA__VARIANTS__PRICES__DISCOUNT_PRICE = "data.variants.prices.discountPrice",
141
143
  DATA__VARIANTS__PRICES__PRICE_LIST_ID = "data.variants.prices.priceListId",
142
144
  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 updatedAt variantId }";
67
+ "{createdAt customerId deleted email id productId storefrontId storefrontRoutingId updatedAt variantId }";
68
68
 
69
69
  export enum ResponseField {
70
70
  CREATED_AT = "createdAt",
@@ -74,6 +74,7 @@ export enum ResponseField {
74
74
  ID = "id",
75
75
  PRODUCT_ID = "productId",
76
76
  STOREFRONT_ID = "storefrontId",
77
+ STOREFRONT_ROUTING_ID = "storefrontRoutingId",
77
78
  UPDATED_AT = "updatedAt",
78
79
  VARIANT_ID = "variantId",
79
80
  }
@@ -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 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 }";
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 }";
55
55
 
56
56
  export enum ResponseField {
57
57
  CREATED_AT = "createdAt",
@@ -73,6 +73,7 @@ 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",
76
77
  OPTIONS__OTHER_PRICES__PRICE = "options.otherPrices.price",
77
78
  OPTIONS__PRICE = "options.price",
78
79
  OPTIONS__REQUIRED_OPTION_ID = "options.requiredOptionId",
@@ -86,6 +87,7 @@ export enum ResponseField {
86
87
  OPTIONS__SELECT_SETTINGS__VALUES__ID = "options.selectSettings.values.id",
87
88
  OPTIONS__SELECT_SETTINGS__VALUES__ORDER = "options.selectSettings.values.order",
88
89
  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",
89
91
  OPTIONS__SELECT_SETTINGS__VALUES__OTHER_PRICES__PRICE = "options.selectSettings.values.otherPrices.price",
90
92
  OPTIONS__SELECT_SETTINGS__VALUES__PRICE = "options.selectSettings.values.price",
91
93
  OPTIONS__SELECT_SETTINGS__VALUES__THUMBNAIL_IMAGE_ID = "options.selectSettings.values.thumbnailImageId",
@@ -0,0 +1,81 @@
1
+ import {
2
+ fetchQuery,
3
+ ConfigType,
4
+ APIResponse,
5
+ handleAPIError,
6
+ } from "@ikas/fe-api-client";
7
+ import { RaffleParticipants } from "../types";
8
+
9
+ const listRaffleParticipants = async (
10
+ fields?: string[],
11
+ config?: ConfigType
12
+ ) => {
13
+ try {
14
+ const { data, errors } = await fetchQuery({
15
+ operationName: "listRaffleParticipants",
16
+ config,
17
+ allReturnFields,
18
+ fields,
19
+ query: (returnFields: string) => `
20
+ query listRaffleParticipants {
21
+ listRaffleParticipants ${returnFields}
22
+ }
23
+ `,
24
+ });
25
+
26
+ return new APIResponse<RaffleParticipants[]>(
27
+ data?.listRaffleParticipants,
28
+ errors
29
+ );
30
+ } catch (err) {
31
+ return handleAPIError(err);
32
+ }
33
+ };
34
+
35
+ export default listRaffleParticipants;
36
+
37
+ const allReturnFields =
38
+ "{applicationDate appliedProduct {productId variantId } createdAt customerId deleted email extraData firstName fullName id isDeliveredCargo lastName phone raffle {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 } raffleId status 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
+ LAST_NAME = "lastName",
54
+ PHONE = "phone",
55
+ RAFFLE__CREATED_AT = "raffle.createdAt",
56
+ RAFFLE__DATE_RANGE__END = "raffle.dateRange.end",
57
+ RAFFLE__DATE_RANGE__START = "raffle.dateRange.start",
58
+ RAFFLE__DELETED = "raffle.deleted",
59
+ RAFFLE__ID = "raffle.id",
60
+ RAFFLE__METADATA__CANONICALS = "raffle.metadata.canonicals",
61
+ RAFFLE__METADATA__CREATED_AT = "raffle.metadata.createdAt",
62
+ RAFFLE__METADATA__DELETED = "raffle.metadata.deleted",
63
+ RAFFLE__METADATA__DESCRIPTION = "raffle.metadata.description",
64
+ RAFFLE__METADATA__DISABLE_INDEX = "raffle.metadata.disableIndex",
65
+ RAFFLE__METADATA__ID = "raffle.metadata.id",
66
+ RAFFLE__METADATA__PAGE_TITLE = "raffle.metadata.pageTitle",
67
+ RAFFLE__METADATA__SLUG = "raffle.metadata.slug",
68
+ RAFFLE__METADATA__TARGET_ID = "raffle.metadata.targetId",
69
+ RAFFLE__METADATA__TARGET_TYPE = "raffle.metadata.targetType",
70
+ RAFFLE__METADATA__UPDATED_AT = "raffle.metadata.updatedAt",
71
+ RAFFLE__NAME = "raffle.name",
72
+ RAFFLE__REQUIRED_CUSTOMER_ACCOUNT = "raffle.requiredCustomerAccount",
73
+ RAFFLE__STATUS = "raffle.status",
74
+ RAFFLE__UPDATED_AT = "raffle.updatedAt",
75
+ RAFFLE__VARIANTS__PRODUCT_ID = "raffle.variants.productId",
76
+ RAFFLE__VARIANTS__VARIANT_ID = "raffle.variants.variantId",
77
+ RAFFLE__VERIFICATION_TYPE = "raffle.verificationType",
78
+ RAFFLE_ID = "raffleId",
79
+ STATUS = "status",
80
+ UPDATED_AT = "updatedAt",
81
+ }
@@ -12,20 +12,20 @@ import {
12
12
  RafflePaginationResponse,
13
13
  } from "../types";
14
14
 
15
- const listRaffle = async (
15
+ const listStorefrontRaffle = 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: "listRaffle",
22
+ operationName: "listStorefrontRaffle",
23
23
  config,
24
24
  variables,
25
25
  allReturnFields,
26
26
  fields,
27
27
  query: (returnFields: string) => `
28
- query listRaffle (
28
+ query listStorefrontRaffle (
29
29
  $end: DateFilterInput,
30
30
  $id: StringFilterInput,
31
31
  $includeDeleted: Boolean,
@@ -36,7 +36,7 @@ const listRaffle = async (
36
36
  $status: BooleanFilterInput,
37
37
  $updatedAt: DateFilterInput,
38
38
  ) {
39
- listRaffle (
39
+ listStorefrontRaffle (
40
40
  end: $end,
41
41
  id: $id,
42
42
  includeDeleted: $includeDeleted,
@@ -51,13 +51,16 @@ const listRaffle = async (
51
51
  `,
52
52
  });
53
53
 
54
- return new APIResponse<RafflePaginationResponse>(data?.listRaffle, errors);
54
+ return new APIResponse<RafflePaginationResponse>(
55
+ data?.listStorefrontRaffle,
56
+ errors
57
+ );
55
58
  } catch (err) {
56
59
  return handleAPIError(err);
57
60
  }
58
61
  };
59
62
 
60
- export default listRaffle;
63
+ export default listStorefrontRaffle;
61
64
 
62
65
  export type QueryParams = {
63
66
  end?: DateFilterInput | null;
@@ -72,7 +75,7 @@ export type QueryParams = {
72
75
  };
73
76
 
74
77
  const allReturnFields =
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 }";
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 }";
76
79
 
77
80
  export enum ResponseField {
78
81
  COUNT = "count",
@@ -93,9 +96,6 @@ export enum ResponseField {
93
96
  DATA__METADATA__TARGET_TYPE = "data.metadata.targetType",
94
97
  DATA__METADATA__UPDATED_AT = "data.metadata.updatedAt",
95
98
  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 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 currencyCode currencySymbol 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,6 +156,8 @@ 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",
159
161
  RESULTS__VARIANTS__PRICES__DISCOUNT_PRICE = "results.variants.prices.discountPrice",
160
162
  RESULTS__VARIANTS__PRICES__PRICE_LIST_ID = "results.variants.prices.priceListId",
161
163
  RESULTS__VARIANTS__PRICES__SELL_PRICE = "results.variants.prices.sellPrice",
@@ -415,6 +415,13 @@ 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
+
418
425
  export enum ShippingMethodEnum {
419
426
  CLICK_AND_COLLECT = "CLICK_AND_COLLECT",
420
427
  NO_SHIPMENT = "NO_SHIPMENT",
@@ -734,6 +741,7 @@ export interface Cart {
734
741
  createdAt: any | null;
735
742
  createdBy: CartCreatedByEnum | null;
736
743
  currencyCode: string | null;
744
+ currencySymbol: string | null;
737
745
  customerId: string | null;
738
746
  deleted: boolean | null;
739
747
  dueDate: any;
@@ -776,6 +784,7 @@ export interface CartStorefrontRouting {
776
784
  export interface CartStorefrontRoutingDynamicCurrencySettings {
777
785
  roundingFormat: string | null;
778
786
  targetCurrencyCode: string;
787
+ targetCurrencySymbol: string | null;
779
788
  }
780
789
 
781
790
  export interface CartV2 {
@@ -792,6 +801,7 @@ export interface CartV2 {
792
801
  createdBy: CartCreatedByEnum | null;
793
802
  currencyCode: string;
794
803
  currencyRates: OrderCurrencyRate[];
804
+ currencySymbol: string | null;
795
805
  customer: OrderCustomer | null;
796
806
  customerId: string | null;
797
807
  deleted: boolean | null;
@@ -967,6 +977,7 @@ export interface CheckoutSettings {
967
977
 
968
978
  export interface CheckoutSettingsPrice {
969
979
  currencyCode: string;
980
+ currencySymbol: string | null;
970
981
  price: number;
971
982
  }
972
983
 
@@ -998,6 +1009,8 @@ export interface Country {
998
1009
  capital: string | null;
999
1010
  createdAt: any | null;
1000
1011
  currency: string | null;
1012
+ currencyCode: string | null;
1013
+ currencySymbol: string | null;
1001
1014
  deleted: boolean | null;
1002
1015
  emoji: string | null;
1003
1016
  emojiString: string | null;
@@ -1022,6 +1035,8 @@ export interface CreateStripePaymentIntentResponse {
1022
1035
 
1023
1036
  export interface CurrencyRate {
1024
1037
  baseCurrency: string;
1038
+ baseCurrencyCode: string | null;
1039
+ baseCurrencySymbol: string | null;
1025
1040
  createdAt: any | null;
1026
1041
  date: any;
1027
1042
  deleted: boolean | null;
@@ -1526,6 +1541,7 @@ export interface OrderLineDiscount {
1526
1541
  export interface OrderLineItem {
1527
1542
  createdAt: any | null;
1528
1543
  currencyCode: string | null;
1544
+ currencySymbol: string | null;
1529
1545
  deleted: boolean | null;
1530
1546
  discount: OrderLineDiscount | null;
1531
1547
  discountPrice: number | null;
@@ -1594,6 +1610,7 @@ export interface OrderLineVariantCategoryPath {
1594
1610
  export interface OrderLineVariantPrice {
1595
1611
  buyPrice: number | null;
1596
1612
  currency: string | null;
1613
+ currencySymbol: string | null;
1597
1614
  discountPrice: number | null;
1598
1615
  priceListId: string | null;
1599
1616
  sellPrice: number;
@@ -1794,6 +1811,7 @@ export interface ProductBackInStockRemind {
1794
1811
  id: string;
1795
1812
  productId: string;
1796
1813
  storefrontId: string;
1814
+ storefrontRoutingId: string | null;
1797
1815
  updatedAt: any | null;
1798
1816
  variantId: string;
1799
1817
  }
@@ -1944,6 +1962,7 @@ export interface ProductOptionSelectValue {
1944
1962
 
1945
1963
  export interface ProductOptionSelectValueOtherPrice {
1946
1964
  currencyCode: string;
1965
+ currencySymbol: string | null;
1947
1966
  price: number;
1948
1967
  }
1949
1968
 
@@ -1990,6 +2009,8 @@ export interface ProductPaginationResponse {
1990
2009
  export interface ProductPrice {
1991
2010
  buyPrice: number | null;
1992
2011
  currency: string | null;
2012
+ currencyCode: string | null;
2013
+ currencySymbol: string | null;
1993
2014
  discountPrice: number | null;
1994
2015
  priceListId: string | null;
1995
2016
  sellPrice: number;
@@ -2034,23 +2055,6 @@ export interface ProductVariantType {
2034
2055
  variantValueIds: string[] | null;
2035
2056
  }
2036
2057
 
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
-
2054
2058
  export interface RaffleDateRangeField {
2055
2059
  end: any | null;
2056
2060
  start: any | null;
@@ -2072,7 +2076,7 @@ export interface RaffleMetadata {
2072
2076
 
2073
2077
  export interface RafflePaginationResponse {
2074
2078
  count: number;
2075
- data: Raffle[];
2079
+ data: StorefrontRaffle[];
2076
2080
  hasNext: boolean;
2077
2081
  limit: number;
2078
2082
  page: number;
@@ -2090,11 +2094,11 @@ export interface RaffleParticipants {
2090
2094
  fullName: string;
2091
2095
  id: string;
2092
2096
  isDeliveredCargo: boolean | null;
2093
- isSendEmail: boolean | null;
2094
- isWinner: boolean | null;
2095
2097
  lastName: string;
2096
2098
  phone: string | null;
2099
+ raffle: StorefrontRaffle;
2097
2100
  raffleId: string;
2101
+ status: RaffleParticipantStatusEnum | null;
2098
2102
  updatedAt: any | null;
2099
2103
  }
2100
2104
 
@@ -2215,6 +2219,8 @@ export interface SearchProductImage {
2215
2219
  export interface SearchProductPrice {
2216
2220
  buyPrice: number | null;
2217
2221
  currency: string | null;
2222
+ currencyCode: string | null;
2223
+ currencySymbol: string | null;
2218
2224
  discountPrice: number | null;
2219
2225
  priceListId: string | null;
2220
2226
  sellPrice: number;
@@ -2375,6 +2381,7 @@ export interface StorefrontDomain {
2375
2381
  export interface StorefrontDynamicCurrencySettings {
2376
2382
  roundingFormat: string | null;
2377
2383
  targetCurrencyCode: string;
2384
+ targetCurrencySymbol: string | null;
2378
2385
  }
2379
2386
 
2380
2387
  export interface StorefrontLocalization {
@@ -2394,6 +2401,7 @@ export interface StorefrontOrder {
2394
2401
  createdAt: any | null;
2395
2402
  currencyCode: string;
2396
2403
  currencyRates: OrderCurrencyRate[];
2404
+ currencySymbol: string | null;
2397
2405
  customer: OrderCustomer | null;
2398
2406
  customerId: string | null;
2399
2407
  deleted: boolean | null;
@@ -2423,6 +2431,20 @@ export interface StorefrontOrder {
2423
2431
  updatedAt: any | null;
2424
2432
  }
2425
2433
 
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
+
2426
2448
  export interface StorefrontRouting {
2427
2449
  countryCodes: string[] | null;
2428
2450
  createdAt: any | null;
@@ -2453,6 +2475,7 @@ export interface StorefrontTransaction {
2453
2475
  checkoutId: string | null;
2454
2476
  createdAt: any | null;
2455
2477
  currencyCode: string;
2478
+ currencySymbol: string | null;
2456
2479
  customerId: string | null;
2457
2480
  deleted: boolean | null;
2458
2481
  error: TransactionError | null;
@@ -2872,27 +2895,12 @@ export interface RaffleMetadataTargetTypeEnumFilter {
2872
2895
 
2873
2896
  export interface RaffleParticipantsInput {
2874
2897
  appliedProduct: AppliedProductInput;
2875
- createdAt?: any | null;
2876
- deleted?: boolean | null;
2877
2898
  email: string;
2878
2899
  extraData?: any | null;
2879
2900
  firstName: string;
2880
- id?: string | null;
2881
2901
  lastName: string;
2882
2902
  phone?: string | null;
2883
2903
  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;
2896
2904
  }
2897
2905
 
2898
2906
  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 as IkasAvailableStockLocation[] | undefined,
108
+ response.data?.stockLocations as IkasAvailableStockLocation[] | undefined,
109
109
  response.graphQLErrors
110
110
  );
111
111
  }
@@ -31,6 +31,7 @@ import {
31
31
  IkasFavoriteProduct,
32
32
  IkasLastViewedProduct,
33
33
  IkasOrder,
34
+ IkasOrderLineItem,
34
35
  IkasOrderRefundSettings,
35
36
  IkasOrderTransaction,
36
37
  initIkasCustomerAttribute,
@@ -192,6 +193,14 @@ export async function getOrders(params: GetCustomerOrdersQueryParams) {
192
193
  const response = await _getCustomerOrders(params);
193
194
  const data: IkasOrder[] | undefined = response.data as any;
194
195
 
196
+ data?.forEach((order) => {
197
+ if (order.orderLineItems?.length) {
198
+ order.orderLineItems = order.orderLineItems.filter(
199
+ (orderLineItem: IkasOrderLineItem) => !orderLineItem.deleted
200
+ );
201
+ }
202
+ });
203
+
195
204
  return new APIResponse(data, response.graphQLErrors);
196
205
  }
197
206
 
@@ -1,38 +1,44 @@
1
1
  import { IkasProductOption } from "@ikas/storefront-models";
2
- import { IkasStorefrontConfig } from "@ikas/storefront-config";
2
+ import { QueryParams as GetProductOptionFileUrlQueryParams } from "../../__api/queries/getProductOptionFileUrl";
3
+ import { IkasProductOptionFileUrl } from "@ikas/storefront-models";
4
+ import { APIResponse } from "@ikas/fe-api-client";
5
+ import axios from "axios";
3
6
 
4
- export async function uploadProductOptionFile(
5
- file: File,
6
- option: IkasProductOption
7
+ export type { GetProductOptionFileUrlQueryParams };
8
+
9
+ export async function getProductOptionFileUrl(
10
+ params: GetProductOptionFileUrlQueryParams,
11
+ file: File
7
12
  ) {
8
- const URL = `${IkasStorefrontConfig.getAdminApiUrl()}/upload-product-option-file`;
9
- const response = await fetch(URL, {
10
- method: "POST",
13
+ const _getProductOptionFileUrl = (
14
+ await import("../../__api/queries/getProductOptionFileUrl")
15
+ ).default;
16
+ const response = await _getProductOptionFileUrl(params);
17
+ return new APIResponse(
18
+ response.data
19
+ ? {
20
+ ...(response.data as unknown as IkasProductOptionFileUrl),
21
+ file: file,
22
+ }
23
+ : null,
24
+ response.graphQLErrors
25
+ );
26
+ }
27
+
28
+ export async function uploadFile(params: IkasProductOptionFileUrl, file: File) {
29
+ const config = {
11
30
  headers: {
12
- "x-api-key": IkasStorefrontConfig.getApiKey() || "",
13
- "x-sfid": IkasStorefrontConfig.getStorefrontId() || "",
14
- "x-sfrid": IkasStorefrontConfig.getStorefrontRoutingId() || "",
15
- "Content-Type": "application/json",
16
- Accept: "application/json",
31
+ "Content-Type": "multipart/form-data",
17
32
  },
18
- body: JSON.stringify({
19
- base64: await getBase64(file),
20
- fileName: file.name,
21
- productOptionSetId: option.productOptionSetId,
22
- productOptionId: option.id,
23
- }),
33
+ };
34
+ const data = new FormData();
35
+ Object.entries(params.fields).forEach(([key, value]) => {
36
+ //@ts-ignore
37
+ data.append(key, value);
24
38
  });
25
39
 
26
- if (!response.ok) {
27
- return null;
28
- }
29
- return await response.text();
30
- }
40
+ data.append("file", file);
31
41
 
32
- export function getBase64(file: File): Promise<string | null> {
33
- return new Promise((resolve) => {
34
- const reader = new FileReader();
35
- reader.addEventListener("load", () => resolve(reader.result as string));
36
- reader.readAsDataURL(file);
37
- });
42
+ const res = await axios.post(params.url, data, config);
43
+ return res.status === 200 || res.status === 204;
38
44
  }
@@ -1,12 +1,12 @@
1
- import { QueryParams as GetMasterpassRequestTokenQueryParams } from "../../__api/queries/getMasterpassRequestToken";
1
+ import { QueryParams as GetMasterPassRequestTokenQueryParams } from "../../__api/queries/getMasterPassRequestToken";
2
2
 
3
- export type { GetMasterpassRequestTokenQueryParams };
3
+ export type { GetMasterPassRequestTokenQueryParams };
4
4
 
5
- export async function getMasterpassRequestToken(
6
- data: GetMasterpassRequestTokenQueryParams
5
+ export async function getMasterPassRequestToken(
6
+ data: GetMasterPassRequestTokenQueryParams
7
7
  ) {
8
- const _getMasterpassRequestToken = (
9
- await import("../../__api/queries/getMasterpassRequestToken")
8
+ const _getMasterPassRequestToken = (
9
+ await import("../../__api/queries/getMasterPassRequestToken")
10
10
  ).default;
11
- return await _getMasterpassRequestToken(data);
11
+ return await _getMasterPassRequestToken(data);
12
12
  }
@@ -266,6 +266,7 @@ function simpleToProduct(simple: SearchProduct): IkasProduct {
266
266
  shortDescription: simple.shortDescription || "",
267
267
  productOptionSetId: simple.productOptionSetId,
268
268
  variantTypes: simple.productVariantTypes.map((pvt) => ({
269
+ order: pvt.order,
269
270
  variantType: {
270
271
  id: pvt.variantType.id,
271
272
  name: pvt.variantType.name,