@ikas/storefront-api 4.0.0-alpha.44 → 4.0.0-alpha.45
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 +5 -5
- package/src/__api/models/SearchProduct.ts +5 -5
- package/src/__api/mutations/customerForgotPassword.ts +3 -0
- package/src/__api/mutations/customerLogin.ts +3 -0
- package/src/__api/mutations/customerRecoverPassword.ts +3 -0
- package/src/__api/mutations/registerCustomer.ts +3 -0
- package/src/__api/mutations/sendContactFormToMerchant.ts +3 -0
- package/src/__api/queries/checkCustomerEmail.ts +3 -0
- package/src/__api/queries/searchProducts.ts +4 -4
- package/src/__api/types/index.ts +1 -1
- package/src/api/product/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-api",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.45",
|
|
4
4
|
"author": "Umut Ozan Yıldırım",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "API functions that returns models from the ikas-storefront-models package.",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
24
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
25
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
24
|
+
"@ikas/storefront-config": "^4.0.0-alpha.45",
|
|
25
|
+
"@ikas/storefront-models": "^4.0.0-alpha.45",
|
|
26
26
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
27
27
|
"prettier": "^2.2.1",
|
|
28
28
|
"rollup": "^2.75.6",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"axios": "^0.26.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
39
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
38
|
+
"@ikas/storefront-config": "^4.0.0-alpha.45",
|
|
39
|
+
"@ikas/storefront-models": "^4.0.0-alpha.45",
|
|
40
40
|
"axios": "^0.26.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DeepReadonly } from "ts-essentials";
|
|
2
2
|
import { SearchProductAttributeValueData } from "./SearchProductAttributeValue";
|
|
3
|
+
import { ProductBaseUnitModelData } from "./ProductBaseUnitModel";
|
|
3
4
|
import { SearchProductBrandData } from "./SearchProductBrand";
|
|
4
5
|
import { SearchCategoryData } from "./SearchCategory";
|
|
5
6
|
import { SearchHTMLMetaDataData } from "./SearchHTMLMetaData";
|
|
6
|
-
import { ProductBaseUnitModelData } from "./ProductBaseUnitModel";
|
|
7
7
|
import { SearchProductVariantTypeData } from "./SearchProductVariantType";
|
|
8
8
|
import { SearchProductTagData } from "./SearchProductTag";
|
|
9
9
|
import { ProductTranslationData } from "./ProductTranslation";
|
|
@@ -11,6 +11,7 @@ import { SearchVariantData } from "./SearchVariant";
|
|
|
11
11
|
|
|
12
12
|
export class SearchProductData {
|
|
13
13
|
attributes: SearchProductAttributeValueData[] | null;
|
|
14
|
+
baseUnit: ProductBaseUnitModelData | null;
|
|
14
15
|
brand: SearchProductBrandData | null;
|
|
15
16
|
categories: SearchCategoryData[] | null;
|
|
16
17
|
deleted: boolean | null;
|
|
@@ -20,7 +21,6 @@ export class SearchProductData {
|
|
|
20
21
|
metaData: SearchHTMLMetaDataData | null;
|
|
21
22
|
name: string;
|
|
22
23
|
productOptionSetId: string | null;
|
|
23
|
-
productUnit: ProductBaseUnitModelData | null;
|
|
24
24
|
productVariantTypes: SearchProductVariantTypeData[];
|
|
25
25
|
salesChannelIds: string[] | null;
|
|
26
26
|
shortDescription: string | null;
|
|
@@ -34,6 +34,9 @@ export class SearchProductData {
|
|
|
34
34
|
this.attributes = data.attributes
|
|
35
35
|
? data.attributes.map((s) => new SearchProductAttributeValueData(s))
|
|
36
36
|
: null;
|
|
37
|
+
this.baseUnit = data.baseUnit
|
|
38
|
+
? new ProductBaseUnitModelData(data.baseUnit)
|
|
39
|
+
: null;
|
|
37
40
|
this.brand = data.brand ? new SearchProductBrandData(data.brand) : null;
|
|
38
41
|
this.categories = data.categories
|
|
39
42
|
? data.categories.map((s) => new SearchCategoryData(s))
|
|
@@ -49,9 +52,6 @@ export class SearchProductData {
|
|
|
49
52
|
: null;
|
|
50
53
|
this.name = data.name || "";
|
|
51
54
|
this.productOptionSetId = data.productOptionSetId || null;
|
|
52
|
-
this.productUnit = data.productUnit
|
|
53
|
-
? new ProductBaseUnitModelData(data.productUnit)
|
|
54
|
-
: null;
|
|
55
55
|
this.productVariantTypes = data.productVariantTypes
|
|
56
56
|
? data.productVariantTypes.map((s) => new SearchProductVariantTypeData(s))
|
|
57
57
|
: [];
|
|
@@ -16,10 +16,12 @@ const customerForgotPassword = async (
|
|
|
16
16
|
variables,
|
|
17
17
|
query: `
|
|
18
18
|
mutation customerForgotPassword (
|
|
19
|
+
$captchaToken: String,
|
|
19
20
|
$email: String!,
|
|
20
21
|
$locale: String,
|
|
21
22
|
) {
|
|
22
23
|
customerForgotPassword (
|
|
24
|
+
captchaToken: $captchaToken,
|
|
23
25
|
email: $email,
|
|
24
26
|
locale: $locale,
|
|
25
27
|
)
|
|
@@ -36,6 +38,7 @@ const customerForgotPassword = async (
|
|
|
36
38
|
export default customerForgotPassword;
|
|
37
39
|
|
|
38
40
|
export type QueryParams = {
|
|
41
|
+
captchaToken?: string | null;
|
|
39
42
|
email: string;
|
|
40
43
|
locale?: string | null;
|
|
41
44
|
};
|
|
@@ -20,10 +20,12 @@ const customerLogin = async (
|
|
|
20
20
|
fields,
|
|
21
21
|
query: (returnFields: string) => `
|
|
22
22
|
mutation customerLogin (
|
|
23
|
+
$captchaToken: String,
|
|
23
24
|
$email: String!,
|
|
24
25
|
$password: String!,
|
|
25
26
|
) {
|
|
26
27
|
customerLogin (
|
|
28
|
+
captchaToken: $captchaToken,
|
|
27
29
|
email: $email,
|
|
28
30
|
password: $password,
|
|
29
31
|
) ${returnFields}
|
|
@@ -40,6 +42,7 @@ const customerLogin = async (
|
|
|
40
42
|
export default customerLogin;
|
|
41
43
|
|
|
42
44
|
export type QueryParams = {
|
|
45
|
+
captchaToken?: string | null;
|
|
43
46
|
email: string;
|
|
44
47
|
password: string;
|
|
45
48
|
};
|
|
@@ -16,11 +16,13 @@ const customerRecoverPassword = async (
|
|
|
16
16
|
variables,
|
|
17
17
|
query: `
|
|
18
18
|
mutation customerRecoverPassword (
|
|
19
|
+
$captchaToken: String,
|
|
19
20
|
$password: String!,
|
|
20
21
|
$passwordAgain: String!,
|
|
21
22
|
$token: String!,
|
|
22
23
|
) {
|
|
23
24
|
customerRecoverPassword (
|
|
25
|
+
captchaToken: $captchaToken,
|
|
24
26
|
password: $password,
|
|
25
27
|
passwordAgain: $passwordAgain,
|
|
26
28
|
token: $token,
|
|
@@ -38,6 +40,7 @@ const customerRecoverPassword = async (
|
|
|
38
40
|
export default customerRecoverPassword;
|
|
39
41
|
|
|
40
42
|
export type QueryParams = {
|
|
43
|
+
captchaToken?: string | null;
|
|
41
44
|
password: string;
|
|
42
45
|
passwordAgain: string;
|
|
43
46
|
token: string;
|
|
@@ -21,6 +21,7 @@ const registerCustomer = async (
|
|
|
21
21
|
query: (returnFields: string) => `
|
|
22
22
|
mutation registerCustomer (
|
|
23
23
|
$attributes: [CustomerAttributeValueInput!],
|
|
24
|
+
$captchaToken: String,
|
|
24
25
|
$email: String!,
|
|
25
26
|
$firstName: String!,
|
|
26
27
|
$isAcceptMarketing: Boolean,
|
|
@@ -30,6 +31,7 @@ const registerCustomer = async (
|
|
|
30
31
|
) {
|
|
31
32
|
registerCustomer (
|
|
32
33
|
attributes: $attributes,
|
|
34
|
+
captchaToken: $captchaToken,
|
|
33
35
|
email: $email,
|
|
34
36
|
firstName: $firstName,
|
|
35
37
|
isAcceptMarketing: $isAcceptMarketing,
|
|
@@ -54,6 +56,7 @@ export default registerCustomer;
|
|
|
54
56
|
|
|
55
57
|
export type QueryParams = {
|
|
56
58
|
attributes?: CustomerAttributeValueInput[] | null;
|
|
59
|
+
captchaToken?: string | null;
|
|
57
60
|
email: string;
|
|
58
61
|
firstName: string;
|
|
59
62
|
isAcceptMarketing?: boolean | null;
|
|
@@ -16,6 +16,7 @@ const sendContactFormToMerchant = async (
|
|
|
16
16
|
variables,
|
|
17
17
|
query: `
|
|
18
18
|
mutation sendContactFormToMerchant (
|
|
19
|
+
$captchaToken: String,
|
|
19
20
|
$email: String!,
|
|
20
21
|
$firstName: String!,
|
|
21
22
|
$lastName: String!,
|
|
@@ -24,6 +25,7 @@ const sendContactFormToMerchant = async (
|
|
|
24
25
|
$referer: String,
|
|
25
26
|
) {
|
|
26
27
|
sendContactFormToMerchant (
|
|
28
|
+
captchaToken: $captchaToken,
|
|
27
29
|
email: $email,
|
|
28
30
|
firstName: $firstName,
|
|
29
31
|
lastName: $lastName,
|
|
@@ -44,6 +46,7 @@ const sendContactFormToMerchant = async (
|
|
|
44
46
|
export default sendContactFormToMerchant;
|
|
45
47
|
|
|
46
48
|
export type QueryParams = {
|
|
49
|
+
captchaToken?: string | null;
|
|
47
50
|
email: string;
|
|
48
51
|
firstName: string;
|
|
49
52
|
lastName: string;
|
|
@@ -20,10 +20,12 @@ const checkCustomerEmail = async (
|
|
|
20
20
|
fields,
|
|
21
21
|
query: (returnFields: string) => `
|
|
22
22
|
query checkCustomerEmail (
|
|
23
|
+
$captchaToken: String,
|
|
23
24
|
$email: String!,
|
|
24
25
|
$locale: String,
|
|
25
26
|
) {
|
|
26
27
|
checkCustomerEmail (
|
|
28
|
+
captchaToken: $captchaToken,
|
|
27
29
|
email: $email,
|
|
28
30
|
locale: $locale,
|
|
29
31
|
) ${returnFields}
|
|
@@ -43,6 +45,7 @@ const checkCustomerEmail = async (
|
|
|
43
45
|
export default checkCustomerEmail;
|
|
44
46
|
|
|
45
47
|
export type QueryParams = {
|
|
48
|
+
captchaToken?: string | null;
|
|
46
49
|
email: string;
|
|
47
50
|
locale?: string | null;
|
|
48
51
|
};
|
|
@@ -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
|
|
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 } baseUnit {baseAmount type unitId } 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 unitPrice } sellIfOutOfStock sku stocks {stockCount stockLocationId } unit {amount type } variantValues {variantTypeId variantValueId } weight } weight } totalCount }";
|
|
46
46
|
|
|
47
47
|
export enum ResponseField {
|
|
48
48
|
COUNT = "count",
|
|
@@ -68,6 +68,9 @@ 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.unitId",
|
|
71
74
|
RESULTS__BRAND__ID = "results.brand.id",
|
|
72
75
|
RESULTS__BRAND__NAME = "results.brand.name",
|
|
73
76
|
RESULTS__BRAND__SLUG = "results.brand.slug",
|
|
@@ -106,9 +109,6 @@ export enum ResponseField {
|
|
|
106
109
|
RESULTS__META_DATA__TRANSLATIONS__PAGE_TITLE = "results.metaData.translations.pageTitle",
|
|
107
110
|
RESULTS__NAME = "results.name",
|
|
108
111
|
RESULTS__PRODUCT_OPTION_SET_ID = "results.productOptionSetId",
|
|
109
|
-
RESULTS__PRODUCT_UNIT__BASE_AMOUNT = "results.productUnit.baseAmount",
|
|
110
|
-
RESULTS__PRODUCT_UNIT__TYPE = "results.productUnit.type",
|
|
111
|
-
RESULTS__PRODUCT_UNIT__UNIT_ID = "results.productUnit.unitId",
|
|
112
112
|
RESULTS__PRODUCT_VARIANT_TYPES__ORDER = "results.productVariantTypes.order",
|
|
113
113
|
RESULTS__PRODUCT_VARIANT_TYPES__VARIANT_TYPE__ID = "results.productVariantTypes.variantType.id",
|
|
114
114
|
RESULTS__PRODUCT_VARIANT_TYPES__VARIANT_TYPE__NAME = "results.productVariantTypes.variantType.name",
|
package/src/__api/types/index.ts
CHANGED
|
@@ -2270,6 +2270,7 @@ export interface SearchHTMLMetaDataOverride {
|
|
|
2270
2270
|
|
|
2271
2271
|
export interface SearchProduct {
|
|
2272
2272
|
attributes: SearchProductAttributeValue[] | null;
|
|
2273
|
+
baseUnit: ProductBaseUnitModel | null;
|
|
2273
2274
|
brand: SearchProductBrand | null;
|
|
2274
2275
|
categories: SearchCategory[] | null;
|
|
2275
2276
|
deleted: boolean | null;
|
|
@@ -2279,7 +2280,6 @@ export interface SearchProduct {
|
|
|
2279
2280
|
metaData: SearchHTMLMetaData | null;
|
|
2280
2281
|
name: string;
|
|
2281
2282
|
productOptionSetId: string | null;
|
|
2282
|
-
productUnit: ProductBaseUnitModel | null;
|
|
2283
2283
|
productVariantTypes: SearchProductVariantType[];
|
|
2284
2284
|
salesChannelIds: string[] | null;
|
|
2285
2285
|
shortDescription: string | null;
|
package/src/api/product/index.ts
CHANGED
|
@@ -256,7 +256,7 @@ function simpleToProduct(simple: SearchProduct): IkasProduct {
|
|
|
256
256
|
})) || [],
|
|
257
257
|
tags: simple.tags || [],
|
|
258
258
|
description: simple.description || "",
|
|
259
|
-
baseUnit: simple.
|
|
259
|
+
baseUnit: simple.baseUnit as unknown as IkasProductBaseUnit,
|
|
260
260
|
metaData:
|
|
261
261
|
{
|
|
262
262
|
...simple.metaData,
|