@ikas/storefront-api 4.0.0-alpha.3 → 4.0.0-alpha.31
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 +2 -0
- package/src/__api/models/CartStorefrontRoutingDynamicCurrencySettings.ts +2 -0
- package/src/__api/models/CartV2.ts +2 -0
- package/src/__api/models/CheckoutSettingsPrice.ts +2 -0
- package/src/__api/models/Country.ts +4 -0
- package/src/__api/models/CurrencyRate.ts +4 -0
- package/src/__api/models/OrderLineItem.ts +2 -0
- package/src/__api/models/OrderLineVariantPrice.ts +2 -0
- package/src/__api/models/ProductBackInStockRemind.ts +2 -0
- package/src/__api/models/ProductOptionSelectValueOtherPrice.ts +2 -0
- package/src/__api/models/ProductPrice.ts +4 -0
- package/src/__api/models/RafflePaginationResponse.ts +5 -3
- package/src/__api/models/RaffleParticipants.ts +8 -10
- package/src/__api/models/RaffleParticipantsInput.ts +1 -4
- package/src/__api/models/SearchProductPrice.ts +4 -0
- package/src/__api/models/StorefrontDynamicCurrencySettings.ts +2 -0
- package/src/__api/models/StorefrontOrder.ts +2 -0
- package/src/__api/models/{Raffle.ts → StorefrontRaffle.ts} +5 -16
- package/src/__api/models/StorefrontTransaction.ts +2 -0
- package/src/__api/mutations/addCouponCodeToCheckout.ts +5 -1
- package/src/__api/mutations/addItemToCart.ts +4 -1
- package/src/__api/mutations/createOrderRefundRequest.ts +4 -1
- package/src/__api/mutations/saveCart.ts +4 -1
- package/src/__api/mutations/saveCartCouponCode.ts +4 -1
- package/src/__api/mutations/saveCheckout.ts +5 -1
- package/src/__api/mutations/saveItemToCart.ts +5 -1
- package/src/__api/mutations/saveProductBackInStockRemind.ts +2 -1
- package/src/__api/mutations/saveRaffleParticipant.ts +25 -3
- package/src/__api/mutations/updateCartCampaignOffer.ts +4 -1
- package/src/__api/queries/getCart.ts +5 -1
- package/src/__api/queries/getCartById.ts +4 -1
- package/src/__api/queries/getCheckoutByCartId.ts +5 -1
- package/src/__api/queries/getCheckoutById.ts +5 -1
- package/src/__api/queries/getCurrencyRate.ts +3 -1
- package/src/__api/queries/getCustomerOrders.ts +4 -1
- package/src/__api/queries/getOrder.ts +4 -1
- package/src/__api/queries/getOrderByEmail.ts +4 -1
- package/src/__api/queries/getStorefront.ts +2 -1
- package/src/__api/queries/listCheckoutSettings.ts +2 -1
- package/src/__api/queries/listCountry.ts +3 -1
- package/src/__api/queries/listOrderTransactions.ts +2 -1
- package/src/__api/queries/listProduct.ts +3 -1
- package/src/__api/queries/listProductBackInStockRemind.ts +2 -1
- package/src/__api/queries/listProductOptionSet.ts +3 -1
- package/src/__api/queries/listRaffleParticipants.ts +81 -0
- package/src/__api/queries/{listRaffle.ts → listStorefrontRaffle.ts} +10 -10
- package/src/__api/queries/searchProducts.ts +3 -1
- package/src/__api/types/index.ts +43 -35
- package/src/api/customer/index.ts +9 -0
- package/src/api/masterpass/index.ts +7 -7
- package/src/api/product/index.ts +1 -0
- package/src/api/raffle/index.ts +12 -14
- package/src/index.ts +9 -7
- package/src/__api/models/RaffleParticipantsUpdateInput.ts +0 -24
- package/src/__api/mutations/updateRaffleParticipant.ts +0 -72
- package/src/__api/queries/getRaffleParticipants.ts +0 -59
- package/src/__api/queries/getRafflesByCustomerId.ts +0 -74
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fetchQuery,
|
|
3
|
-
ConfigType,
|
|
4
|
-
APIResponse,
|
|
5
|
-
handleAPIError,
|
|
6
|
-
} from "@ikas/fe-api-client";
|
|
7
|
-
import { RaffleParticipantsUpdateInput, RaffleParticipants } from "../types";
|
|
8
|
-
|
|
9
|
-
const updateRaffleParticipant = async (
|
|
10
|
-
variables: QueryParams,
|
|
11
|
-
fields?: string[],
|
|
12
|
-
config?: ConfigType
|
|
13
|
-
) => {
|
|
14
|
-
try {
|
|
15
|
-
const { data, errors } = await fetchQuery({
|
|
16
|
-
operationName: "updateRaffleParticipant",
|
|
17
|
-
config,
|
|
18
|
-
variables,
|
|
19
|
-
allReturnFields,
|
|
20
|
-
fields,
|
|
21
|
-
query: (returnFields: string) => `
|
|
22
|
-
mutation updateRaffleParticipant (
|
|
23
|
-
$input: RaffleParticipantsUpdateInput!,
|
|
24
|
-
$participantId: String!,
|
|
25
|
-
) {
|
|
26
|
-
updateRaffleParticipant (
|
|
27
|
-
input: $input,
|
|
28
|
-
participantId: $participantId,
|
|
29
|
-
) ${returnFields}
|
|
30
|
-
}
|
|
31
|
-
`,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return new APIResponse<RaffleParticipants>(
|
|
35
|
-
data?.updateRaffleParticipant,
|
|
36
|
-
errors
|
|
37
|
-
);
|
|
38
|
-
} catch (err) {
|
|
39
|
-
return handleAPIError(err);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default updateRaffleParticipant;
|
|
44
|
-
|
|
45
|
-
export type QueryParams = {
|
|
46
|
-
input: RaffleParticipantsUpdateInput;
|
|
47
|
-
participantId: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const allReturnFields =
|
|
51
|
-
"{applicationDate appliedProduct {productId variantId } createdAt customerId deleted email extraData firstName fullName id isDeliveredCargo isSendEmail isWinner lastName phone raffleId updatedAt }";
|
|
52
|
-
|
|
53
|
-
export enum ResponseField {
|
|
54
|
-
APPLICATION_DATE = "applicationDate",
|
|
55
|
-
APPLIED_PRODUCT__PRODUCT_ID = "appliedProduct.productId",
|
|
56
|
-
APPLIED_PRODUCT__VARIANT_ID = "appliedProduct.variantId",
|
|
57
|
-
CREATED_AT = "createdAt",
|
|
58
|
-
CUSTOMER_ID = "customerId",
|
|
59
|
-
DELETED = "deleted",
|
|
60
|
-
EMAIL = "email",
|
|
61
|
-
EXTRA_DATA = "extraData",
|
|
62
|
-
FIRST_NAME = "firstName",
|
|
63
|
-
FULL_NAME = "fullName",
|
|
64
|
-
ID = "id",
|
|
65
|
-
IS_DELIVERED_CARGO = "isDeliveredCargo",
|
|
66
|
-
IS_SEND_EMAIL = "isSendEmail",
|
|
67
|
-
IS_WINNER = "isWinner",
|
|
68
|
-
LAST_NAME = "lastName",
|
|
69
|
-
PHONE = "phone",
|
|
70
|
-
RAFFLE_ID = "raffleId",
|
|
71
|
-
UPDATED_AT = "updatedAt",
|
|
72
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -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
|
-
}
|