@ikas/storefront-api 4.0.0-alpha.29 → 4.0.0-alpha.30

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 (54) hide show
  1. package/package.json +5 -5
  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/mutations/addCouponCodeToCheckout.ts +5 -1
  22. package/src/__api/mutations/addItemToCart.ts +4 -1
  23. package/src/__api/mutations/createOrderRefundRequest.ts +4 -1
  24. package/src/__api/mutations/saveCart.ts +4 -1
  25. package/src/__api/mutations/saveCartCouponCode.ts +4 -1
  26. package/src/__api/mutations/saveCheckout.ts +5 -1
  27. package/src/__api/mutations/saveItemToCart.ts +5 -1
  28. package/src/__api/mutations/saveProductBackInStockRemind.ts +2 -1
  29. package/src/__api/mutations/saveRaffleParticipant.ts +25 -3
  30. package/src/__api/mutations/updateCartCampaignOffer.ts +4 -1
  31. package/src/__api/queries/getCart.ts +5 -1
  32. package/src/__api/queries/getCartById.ts +4 -1
  33. package/src/__api/queries/getCheckoutByCartId.ts +5 -1
  34. package/src/__api/queries/getCheckoutById.ts +5 -1
  35. package/src/__api/queries/getCurrencyRate.ts +3 -1
  36. package/src/__api/queries/getCustomerOrders.ts +4 -1
  37. package/src/__api/queries/getOrder.ts +4 -1
  38. package/src/__api/queries/getOrderByEmail.ts +4 -1
  39. package/src/__api/queries/getStorefront.ts +2 -1
  40. package/src/__api/queries/listCheckoutSettings.ts +2 -1
  41. package/src/__api/queries/listCountry.ts +3 -1
  42. package/src/__api/queries/listOrderTransactions.ts +2 -1
  43. package/src/__api/queries/listProduct.ts +3 -1
  44. package/src/__api/queries/listProductBackInStockRemind.ts +2 -1
  45. package/src/__api/queries/listProductOptionSet.ts +3 -1
  46. package/src/__api/queries/listRaffleParticipants.ts +81 -0
  47. package/src/__api/queries/{listRaffle.ts → listStorefrontRaffle.ts} +10 -10
  48. package/src/__api/queries/searchProducts.ts +3 -1
  49. package/src/__api/types/index.ts +43 -35
  50. package/src/api/raffle/index.ts +12 -14
  51. package/src/__api/models/RaffleParticipantsUpdateInput.ts +0 -24
  52. package/src/__api/mutations/updateRaffleParticipant.ts +0 -72
  53. package/src/__api/queries/getRaffleParticipants.ts +0 -59
  54. package/src/__api/queries/getRafflesByCustomerId.ts +0 -74
@@ -1,74 +0,0 @@
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
- }