@ikas/storefront-api 4.0.0-alpha.46 → 4.0.0-alpha.47
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
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.47",
|
|
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.47",
|
|
25
|
+
"@ikas/storefront-models": "^4.0.0-alpha.47",
|
|
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.47",
|
|
39
|
+
"@ikas/storefront-models": "^4.0.0-alpha.47",
|
|
40
40
|
"axios": "^0.26.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeepReadonly } from "ts-essentials";
|
|
2
2
|
import { SearchProductAttributeValueData } from "./SearchProductAttributeValue";
|
|
3
|
-
import {
|
|
3
|
+
import { SearchProductProductBaseUnitData } from "./SearchProductProductBaseUnit";
|
|
4
4
|
import { SearchProductBrandData } from "./SearchProductBrand";
|
|
5
5
|
import { SearchCategoryData } from "./SearchCategory";
|
|
6
6
|
import { SearchHTMLMetaDataData } from "./SearchHTMLMetaData";
|
|
@@ -11,7 +11,7 @@ import { SearchVariantData } from "./SearchVariant";
|
|
|
11
11
|
|
|
12
12
|
export class SearchProductData {
|
|
13
13
|
attributes: SearchProductAttributeValueData[] | null;
|
|
14
|
-
baseUnit:
|
|
14
|
+
baseUnit: SearchProductProductBaseUnitData | null;
|
|
15
15
|
brand: SearchProductBrandData | null;
|
|
16
16
|
categories: SearchCategoryData[] | null;
|
|
17
17
|
deleted: boolean | null;
|
|
@@ -35,7 +35,7 @@ export class SearchProductData {
|
|
|
35
35
|
? data.attributes.map((s) => new SearchProductAttributeValueData(s))
|
|
36
36
|
: null;
|
|
37
37
|
this.baseUnit = data.baseUnit
|
|
38
|
-
? new
|
|
38
|
+
? new SearchProductProductBaseUnitData(data.baseUnit)
|
|
39
39
|
: null;
|
|
40
40
|
this.brand = data.brand ? new SearchProductBrandData(data.brand) : null;
|
|
41
41
|
this.categories = data.categories
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DeepReadonly } from "ts-essentials";
|
|
2
|
+
import { ProductUnitTypeEnum } from "../types";
|
|
3
|
+
import { SearchProductProductUnitData } from "./SearchProductProductUnit";
|
|
4
|
+
|
|
5
|
+
export class SearchProductProductBaseUnitData {
|
|
6
|
+
baseAmount: number;
|
|
7
|
+
type: ProductUnitTypeEnum;
|
|
8
|
+
unit: SearchProductProductUnitData;
|
|
9
|
+
|
|
10
|
+
constructor(data: Partial<SearchProductProductBaseUnitData> = {}) {
|
|
11
|
+
this.baseAmount = data.baseAmount || 0;
|
|
12
|
+
this.type = data.type || ProductUnitTypeEnum.CENTILITER;
|
|
13
|
+
this.unit = data.unit
|
|
14
|
+
? new SearchProductProductUnitData(data.unit)
|
|
15
|
+
: new SearchProductProductUnitData();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class SearchProductProductBaseUnit extends SearchProductProductBaseUnitData {}
|
|
20
|
+
export type PartialSearchProductProductBaseUnit =
|
|
21
|
+
Partial<SearchProductProductBaseUnit>;
|
|
22
|
+
export type ReadOnlySearchProductProductBaseUnit =
|
|
23
|
+
DeepReadonly<SearchProductProductBaseUnit>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DeepReadonly } from "ts-essentials";
|
|
2
|
+
|
|
3
|
+
export class SearchProductProductUnitData {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
|
|
7
|
+
constructor(data: Partial<SearchProductProductUnitData> = {}) {
|
|
8
|
+
this.id = data.id || "";
|
|
9
|
+
this.name = data.name || "";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class SearchProductProductUnit extends SearchProductProductUnitData {}
|
|
14
|
+
export type PartialSearchProductProductUnit = Partial<SearchProductProductUnit>;
|
|
15
|
+
export type ReadOnlySearchProductProductUnit =
|
|
16
|
+
DeepReadonly<SearchProductProductUnit>;
|
|
@@ -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 } baseUnit {baseAmount type
|
|
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 unit {id name } } 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",
|
|
@@ -70,7 +70,8 @@ export enum ResponseField {
|
|
|
70
70
|
RESULTS__ATTRIBUTES__VALUE = "results.attributes.value",
|
|
71
71
|
RESULTS__BASE_UNIT__BASE_AMOUNT = "results.baseUnit.baseAmount",
|
|
72
72
|
RESULTS__BASE_UNIT__TYPE = "results.baseUnit.type",
|
|
73
|
-
|
|
73
|
+
RESULTS__BASE_UNIT__UNIT__ID = "results.baseUnit.unit.id",
|
|
74
|
+
RESULTS__BASE_UNIT__UNIT__NAME = "results.baseUnit.unit.name",
|
|
74
75
|
RESULTS__BRAND__ID = "results.brand.id",
|
|
75
76
|
RESULTS__BRAND__NAME = "results.brand.name",
|
|
76
77
|
RESULTS__BRAND__SLUG = "results.brand.slug",
|
package/src/__api/types/index.ts
CHANGED
|
@@ -2270,7 +2270,7 @@ export interface SearchHTMLMetaDataOverride {
|
|
|
2270
2270
|
|
|
2271
2271
|
export interface SearchProduct {
|
|
2272
2272
|
attributes: SearchProductAttributeValue[] | null;
|
|
2273
|
-
baseUnit:
|
|
2273
|
+
baseUnit: SearchProductProductBaseUnit | null;
|
|
2274
2274
|
brand: SearchProductBrand | null;
|
|
2275
2275
|
categories: SearchCategory[] | null;
|
|
2276
2276
|
deleted: boolean | null;
|
|
@@ -2345,6 +2345,17 @@ export interface SearchProductPrice {
|
|
|
2345
2345
|
unitPrice: number | null;
|
|
2346
2346
|
}
|
|
2347
2347
|
|
|
2348
|
+
export interface SearchProductProductBaseUnit {
|
|
2349
|
+
baseAmount: number;
|
|
2350
|
+
type: ProductUnitTypeEnum;
|
|
2351
|
+
unit: SearchProductProductUnit;
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
export interface SearchProductProductUnit {
|
|
2355
|
+
id: string;
|
|
2356
|
+
name: string;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2348
2359
|
export interface SearchProductStockLocation {
|
|
2349
2360
|
stockCount: number;
|
|
2350
2361
|
stockLocationId: string;
|