@ikas/storefront-api 4.0.0-alpha.48 → 4.0.0-alpha.5
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.
- package/package.json +7 -7
- package/src/__api/models/Cart.ts +0 -2
- package/src/__api/models/CartStorefrontRoutingDynamicCurrencySettings.ts +0 -2
- package/src/__api/models/CartV2.ts +0 -7
- package/src/__api/models/CategoryFilterInput.ts +0 -2
- package/src/__api/models/CheckoutSettingsPrice.ts +0 -2
- package/src/__api/models/Country.ts +0 -4
- package/src/__api/models/CurrencyRate.ts +0 -4
- package/src/__api/models/LocationTranslations.ts +0 -2
- package/src/__api/models/OrderLineItem.ts +0 -12
- package/src/__api/models/OrderLineVariant.ts +0 -8
- package/src/__api/models/OrderLineVariantPrice.ts +0 -7
- package/src/__api/models/Product.ts +0 -5
- package/src/__api/models/ProductBackInStockRemind.ts +0 -2
- package/src/__api/models/ProductOptionSelectValueOtherPrice.ts +0 -2
- package/src/__api/models/ProductPrice.ts +0 -4
- package/src/__api/models/{StorefrontRaffle.ts → Raffle.ts} +16 -5
- package/src/__api/models/RafflePaginationResponse.ts +3 -5
- package/src/__api/models/RaffleParticipants.ts +10 -6
- package/src/__api/models/RaffleParticipantsInput.ts +4 -1
- package/src/__api/models/RaffleParticipantsUpdateInput.ts +24 -0
- package/src/__api/models/SearchProduct.ts +0 -5
- package/src/__api/models/SearchProductPrice.ts +0 -9
- package/src/__api/models/SearchVariant.ts +0 -3
- package/src/__api/models/StorefrontDynamicCurrencySettings.ts +0 -2
- package/src/__api/models/StorefrontOrder.ts +0 -2
- package/src/__api/models/StorefrontRouting.ts +0 -4
- package/src/__api/models/StorefrontTransaction.ts +0 -2
- package/src/__api/models/Variant.ts +0 -3
- package/src/__api/models/_base.ts +1 -2
- package/src/__api/mutations/addCouponCodeToCheckout.ts +1 -14
- package/src/__api/mutations/addItemToCart.ts +1 -34
- package/src/__api/mutations/createOrderRefundRequest.ts +1 -13
- package/src/__api/mutations/customerForgotPassword.ts +0 -3
- package/src/__api/mutations/customerLogin.ts +0 -3
- package/src/__api/mutations/customerRecoverPassword.ts +0 -3
- package/src/__api/mutations/registerCustomer.ts +0 -3
- package/src/__api/mutations/saveCart.ts +1 -34
- package/src/__api/mutations/saveCartCouponCode.ts +1 -34
- package/src/__api/mutations/saveCheckout.ts +1 -14
- package/src/__api/mutations/saveItemToCart.ts +1 -14
- package/src/__api/mutations/saveProductBackInStockRemind.ts +1 -2
- package/src/__api/mutations/saveRaffleParticipant.ts +3 -25
- package/src/__api/mutations/sendContactFormToMerchant.ts +0 -3
- package/src/__api/mutations/updateCartCampaignOffer.ts +1 -34
- package/src/__api/mutations/updateRaffleParticipant.ts +72 -0
- package/src/__api/queries/checkCustomerEmail.ts +0 -3
- package/src/__api/queries/getCart.ts +1 -14
- package/src/__api/queries/getCartById.ts +1 -34
- package/src/__api/queries/getCheckoutByCartId.ts +1 -14
- package/src/__api/queries/getCheckoutById.ts +1 -14
- package/src/__api/queries/getCurrencyRate.ts +1 -3
- package/src/__api/queries/getCustomerOrders.ts +1 -13
- package/src/__api/queries/getOrder.ts +1 -13
- package/src/__api/queries/getOrderByEmail.ts +1 -13
- package/src/__api/queries/getRaffleParticipants.ts +59 -0
- package/src/__api/queries/getRafflesByCustomerId.ts +74 -0
- package/src/__api/queries/getStorefront.ts +1 -4
- package/src/__api/queries/listCheckoutSettings.ts +1 -2
- package/src/__api/queries/listCountry.ts +1 -7
- package/src/__api/queries/listOrderTransactions.ts +1 -2
- package/src/__api/queries/listProduct.ts +1 -8
- package/src/__api/queries/listProductBackInStockRemind.ts +1 -2
- package/src/__api/queries/listProductOptionSet.ts +1 -3
- package/src/__api/queries/{listStorefrontRaffle.ts → listRaffle.ts} +10 -10
- package/src/__api/queries/searchProducts.ts +1 -10
- package/src/__api/types/index.ts +35 -183
- package/src/api/checkout/index.ts +1 -1
- package/src/api/customer/index.ts +0 -9
- package/src/api/file-upload/index.ts +29 -35
- package/src/api/location/index.ts +4 -13
- package/src/api/masterpass/index.ts +7 -7
- package/src/api/product/index.ts +3 -8
- package/src/api/raffle/index.ts +14 -12
- package/src/index.ts +7 -9
- package/src/__api/models/OrderLineBaseUnit.ts +0 -19
- package/src/__api/models/OrderLineVariantUnit.ts +0 -16
- package/src/__api/models/OrderLineVariantUnitType.ts +0 -16
- package/src/__api/models/OrderSessionInfo.ts +0 -49
- package/src/__api/models/OrderSessionInfoTrafficSource.ts +0 -18
- package/src/__api/models/OrderSessionUTM.ts +0 -21
- package/src/__api/models/OrderSessionUserAgent.ts +0 -18
- package/src/__api/models/ProductBaseUnitModel.ts +0 -21
- package/src/__api/models/SearchProductProductBaseUnit.ts +0 -23
- package/src/__api/models/SearchProductProductUnit.ts +0 -16
- package/src/__api/models/VariantUnitModel.ts +0 -17
- package/src/__api/queries/listRaffleParticipants.ts +0 -81
|
@@ -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
|
|
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",
|
|
@@ -73,13 +73,10 @@ export enum ResponseField {
|
|
|
73
73
|
PICK_UP_STOCK_LOCATION_IDS = "pickUpStockLocationIds",
|
|
74
74
|
ROUTINGS__COUNTRY_CODES = "routings.countryCodes",
|
|
75
75
|
ROUTINGS__CREATED_AT = "routings.createdAt",
|
|
76
|
-
ROUTINGS__CURRENCY_CODE = "routings.currencyCode",
|
|
77
|
-
ROUTINGS__CURRENCY_SYMBOL = "routings.currencySymbol",
|
|
78
76
|
ROUTINGS__DELETED = "routings.deleted",
|
|
79
77
|
ROUTINGS__DOMAIN = "routings.domain",
|
|
80
78
|
ROUTINGS__DYNAMIC_CURRENCY_SETTINGS__ROUNDING_FORMAT = "routings.dynamicCurrencySettings.roundingFormat",
|
|
81
79
|
ROUTINGS__DYNAMIC_CURRENCY_SETTINGS__TARGET_CURRENCY_CODE = "routings.dynamicCurrencySettings.targetCurrencyCode",
|
|
82
|
-
ROUTINGS__DYNAMIC_CURRENCY_SETTINGS__TARGET_CURRENCY_SYMBOL = "routings.dynamicCurrencySettings.targetCurrencySymbol",
|
|
83
80
|
ROUTINGS__ID = "routings.id",
|
|
84
81
|
ROUTINGS__LOCALE = "routings.locale",
|
|
85
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
|
|
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",
|
|
@@ -24,7 +24,6 @@ const listCountry = async (
|
|
|
24
24
|
$includeDeleted: Boolean,
|
|
25
25
|
$iso2: StringFilterInput,
|
|
26
26
|
$iso3: StringFilterInput,
|
|
27
|
-
$locale: String,
|
|
28
27
|
$search: String,
|
|
29
28
|
$updatedAt: DateFilterInput,
|
|
30
29
|
) {
|
|
@@ -33,7 +32,6 @@ const listCountry = async (
|
|
|
33
32
|
includeDeleted: $includeDeleted,
|
|
34
33
|
iso2: $iso2,
|
|
35
34
|
iso3: $iso3,
|
|
36
|
-
locale: $locale,
|
|
37
35
|
search: $search,
|
|
38
36
|
updatedAt: $updatedAt,
|
|
39
37
|
) ${returnFields}
|
|
@@ -54,27 +52,23 @@ export type QueryParams = {
|
|
|
54
52
|
includeDeleted?: boolean | null;
|
|
55
53
|
iso2?: StringFilterInput | null;
|
|
56
54
|
iso3?: StringFilterInput | null;
|
|
57
|
-
locale?: string | null;
|
|
58
55
|
search?: string | null;
|
|
59
56
|
updatedAt?: DateFilterInput | null;
|
|
60
57
|
};
|
|
61
58
|
|
|
62
59
|
const allReturnFields =
|
|
63
|
-
"{capital createdAt currency
|
|
60
|
+
"{capital createdAt currency deleted emoji emojiString id iso2 iso3 locationTranslations {en tr } name native phoneCode region subregion updatedAt }";
|
|
64
61
|
|
|
65
62
|
export enum ResponseField {
|
|
66
63
|
CAPITAL = "capital",
|
|
67
64
|
CREATED_AT = "createdAt",
|
|
68
65
|
CURRENCY = "currency",
|
|
69
|
-
CURRENCY_CODE = "currencyCode",
|
|
70
|
-
CURRENCY_SYMBOL = "currencySymbol",
|
|
71
66
|
DELETED = "deleted",
|
|
72
67
|
EMOJI = "emoji",
|
|
73
68
|
EMOJI_STRING = "emojiString",
|
|
74
69
|
ID = "id",
|
|
75
70
|
ISO2 = "iso2",
|
|
76
71
|
ISO3 = "iso3",
|
|
77
|
-
LOCATION_TRANSLATIONS__DE = "locationTranslations.de",
|
|
78
72
|
LOCATION_TRANSLATIONS__EN = "locationTranslations.en",
|
|
79
73
|
LOCATION_TRANSLATIONS__TR = "locationTranslations.tr",
|
|
80
74
|
NAME = "name",
|
|
@@ -51,14 +51,13 @@ export type QueryParams = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const allReturnFields =
|
|
54
|
-
"{amount checkoutId createdAt currencyCode
|
|
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 }
|
|
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",
|
|
@@ -80,9 +80,6 @@ export enum ResponseField {
|
|
|
80
80
|
DATA__ATTRIBUTES__PRODUCT_ATTRIBUTE_ID = "data.attributes.productAttributeId",
|
|
81
81
|
DATA__ATTRIBUTES__PRODUCT_ATTRIBUTE_OPTION_ID = "data.attributes.productAttributeOptionId",
|
|
82
82
|
DATA__ATTRIBUTES__VALUE = "data.attributes.value",
|
|
83
|
-
DATA__BASE_UNIT__BASE_AMOUNT = "data.baseUnit.baseAmount",
|
|
84
|
-
DATA__BASE_UNIT__TYPE = "data.baseUnit.type",
|
|
85
|
-
DATA__BASE_UNIT__UNIT_ID = "data.baseUnit.unitId",
|
|
86
83
|
DATA__BRAND_ID = "data.brandId",
|
|
87
84
|
DATA__CATEGORY_IDS = "data.categoryIds",
|
|
88
85
|
DATA__CREATED_AT = "data.createdAt",
|
|
@@ -140,8 +137,6 @@ export enum ResponseField {
|
|
|
140
137
|
DATA__VARIANTS__IS_ACTIVE = "data.variants.isActive",
|
|
141
138
|
DATA__VARIANTS__PRICES__BUY_PRICE = "data.variants.prices.buyPrice",
|
|
142
139
|
DATA__VARIANTS__PRICES__CURRENCY = "data.variants.prices.currency",
|
|
143
|
-
DATA__VARIANTS__PRICES__CURRENCY_CODE = "data.variants.prices.currencyCode",
|
|
144
|
-
DATA__VARIANTS__PRICES__CURRENCY_SYMBOL = "data.variants.prices.currencySymbol",
|
|
145
140
|
DATA__VARIANTS__PRICES__DISCOUNT_PRICE = "data.variants.prices.discountPrice",
|
|
146
141
|
DATA__VARIANTS__PRICES__PRICE_LIST_ID = "data.variants.prices.priceListId",
|
|
147
142
|
DATA__VARIANTS__PRICES__SELL_PRICE = "data.variants.prices.sellPrice",
|
|
@@ -149,8 +144,6 @@ export enum ResponseField {
|
|
|
149
144
|
DATA__VARIANTS__SKU = "data.variants.sku",
|
|
150
145
|
DATA__VARIANTS__STOCKS__STOCK_COUNT = "data.variants.stocks.stockCount",
|
|
151
146
|
DATA__VARIANTS__STOCKS__STOCK_LOCATION_ID = "data.variants.stocks.stockLocationId",
|
|
152
|
-
DATA__VARIANTS__UNIT__AMOUNT = "data.variants.unit.amount",
|
|
153
|
-
DATA__VARIANTS__UNIT__TYPE = "data.variants.unit.type",
|
|
154
147
|
DATA__VARIANTS__UPDATED_AT = "data.variants.updatedAt",
|
|
155
148
|
DATA__VARIANTS__VARIANT_VALUE_IDS__VARIANT_TYPE_ID = "data.variants.variantValueIds.variantTypeId",
|
|
156
149
|
DATA__VARIANTS__VARIANT_VALUE_IDS__VARIANT_VALUE_ID = "data.variants.variantValueIds.variantValueId",
|
|
@@ -64,7 +64,7 @@ export type QueryParams = {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
const allReturnFields =
|
|
67
|
-
"{createdAt customerId deleted email id productId storefrontId
|
|
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
|
|
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
|
|
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: "
|
|
22
|
+
operationName: "listRaffle",
|
|
23
23
|
config,
|
|
24
24
|
variables,
|
|
25
25
|
allReturnFields,
|
|
26
26
|
fields,
|
|
27
27
|
query: (returnFields: string) => `
|
|
28
|
-
query
|
|
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
|
-
|
|
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
|
|
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 }
|
|
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",
|
|
@@ -68,10 +68,6 @@ export enum ResponseField {
|
|
|
68
68
|
RESULTS__ATTRIBUTES__PRODUCT_ATTRIBUTE_OPTION__ID = "results.attributes.productAttributeOption.id",
|
|
69
69
|
RESULTS__ATTRIBUTES__PRODUCT_ATTRIBUTE_OPTION__NAME = "results.attributes.productAttributeOption.name",
|
|
70
70
|
RESULTS__ATTRIBUTES__VALUE = "results.attributes.value",
|
|
71
|
-
RESULTS__BASE_UNIT__BASE_AMOUNT = "results.baseUnit.baseAmount",
|
|
72
|
-
RESULTS__BASE_UNIT__TYPE = "results.baseUnit.type",
|
|
73
|
-
RESULTS__BASE_UNIT__UNIT__ID = "results.baseUnit.unit.id",
|
|
74
|
-
RESULTS__BASE_UNIT__UNIT__NAME = "results.baseUnit.unit.name",
|
|
75
71
|
RESULTS__BRAND__ID = "results.brand.id",
|
|
76
72
|
RESULTS__BRAND__NAME = "results.brand.name",
|
|
77
73
|
RESULTS__BRAND__SLUG = "results.brand.slug",
|
|
@@ -160,18 +156,13 @@ export enum ResponseField {
|
|
|
160
156
|
RESULTS__VARIANTS__IS_ACTIVE = "results.variants.isActive",
|
|
161
157
|
RESULTS__VARIANTS__PRICES__BUY_PRICE = "results.variants.prices.buyPrice",
|
|
162
158
|
RESULTS__VARIANTS__PRICES__CURRENCY = "results.variants.prices.currency",
|
|
163
|
-
RESULTS__VARIANTS__PRICES__CURRENCY_CODE = "results.variants.prices.currencyCode",
|
|
164
|
-
RESULTS__VARIANTS__PRICES__CURRENCY_SYMBOL = "results.variants.prices.currencySymbol",
|
|
165
159
|
RESULTS__VARIANTS__PRICES__DISCOUNT_PRICE = "results.variants.prices.discountPrice",
|
|
166
160
|
RESULTS__VARIANTS__PRICES__PRICE_LIST_ID = "results.variants.prices.priceListId",
|
|
167
161
|
RESULTS__VARIANTS__PRICES__SELL_PRICE = "results.variants.prices.sellPrice",
|
|
168
|
-
RESULTS__VARIANTS__PRICES__UNIT_PRICE = "results.variants.prices.unitPrice",
|
|
169
162
|
RESULTS__VARIANTS__SELL_IF_OUT_OF_STOCK = "results.variants.sellIfOutOfStock",
|
|
170
163
|
RESULTS__VARIANTS__SKU = "results.variants.sku",
|
|
171
164
|
RESULTS__VARIANTS__STOCKS__STOCK_COUNT = "results.variants.stocks.stockCount",
|
|
172
165
|
RESULTS__VARIANTS__STOCKS__STOCK_LOCATION_ID = "results.variants.stocks.stockLocationId",
|
|
173
|
-
RESULTS__VARIANTS__UNIT__AMOUNT = "results.variants.unit.amount",
|
|
174
|
-
RESULTS__VARIANTS__UNIT__TYPE = "results.variants.unit.type",
|
|
175
166
|
RESULTS__VARIANTS__VARIANT_VALUES__VARIANT_TYPE_ID = "results.variants.variantValues.variantTypeId",
|
|
176
167
|
RESULTS__VARIANTS__VARIANT_VALUES__VARIANT_VALUE_ID = "results.variants.variantValues.variantValueId",
|
|
177
168
|
RESULTS__VARIANTS__WEIGHT = "results.variants.weight",
|