@ikas/storefront-api 4.0.0-alpha.2 → 4.0.0-alpha.20

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.2",
3
+ "version": "4.0.0-alpha.20",
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.",
@@ -16,12 +16,13 @@
16
16
  "generate": "api-generator --generate --url=https://api.myikas.dev/api/sf/graphql --modelPath=./models.json --generatePath=./src/__api && prettier --write ./src/__api"
17
17
  },
18
18
  "dependencies": {
19
- "@ikas/fe-api-client": "^1.0.13"
19
+ "@ikas/fe-api-client": "^1.0.16",
20
+ "ts-essentials": "^7.0.1"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@rollup/plugin-commonjs": "^22.0.0",
23
- "@ikas/storefront-config": "^4.0.0-alpha.2",
24
- "@ikas/storefront-models": "^4.0.0-alpha.2",
24
+ "@ikas/storefront-config": "^4.0.0-alpha.20",
25
+ "@ikas/storefront-models": "^4.0.0-alpha.20",
25
26
  "@rollup/plugin-node-resolve": "^13.3.0",
26
27
  "prettier": "^2.2.1",
27
28
  "rollup": "^2.75.6",
@@ -31,12 +32,11 @@
31
32
  "typescript": "^4.7.2",
32
33
  "ttypescript": "^1.5.12",
33
34
  "typescript-transform-paths": "^2.2.2",
34
- "ts-essentials": "^7.0.1",
35
35
  "axios": "^0.26.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@ikas/storefront-config": "^4.0.0-alpha.2",
39
- "@ikas/storefront-models": "^4.0.0-alpha.2",
38
+ "@ikas/storefront-config": "^4.0.0-alpha.20",
39
+ "@ikas/storefront-models": "^4.0.0-alpha.20",
40
40
  "axios": "^0.26.0"
41
41
  }
42
42
  }
@@ -31,6 +31,7 @@ import {
31
31
  IkasFavoriteProduct,
32
32
  IkasLastViewedProduct,
33
33
  IkasOrder,
34
+ IkasOrderLineItem,
34
35
  IkasOrderRefundSettings,
35
36
  IkasOrderTransaction,
36
37
  initIkasCustomerAttribute,
@@ -192,6 +193,14 @@ export async function getOrders(params: GetCustomerOrdersQueryParams) {
192
193
  const response = await _getCustomerOrders(params);
193
194
  const data: IkasOrder[] | undefined = response.data as any;
194
195
 
196
+ data?.forEach((order) => {
197
+ if (order.orderLineItems?.length) {
198
+ order.orderLineItems = order.orderLineItems.filter(
199
+ (orderLineItem: IkasOrderLineItem) => !orderLineItem.deleted
200
+ );
201
+ }
202
+ });
203
+
195
204
  return new APIResponse(data, response.graphQLErrors);
196
205
  }
197
206
 
@@ -1,12 +1,12 @@
1
- import { QueryParams as GetMasterpassRequestTokenQueryParams } from "../../__api/queries/getMasterpassRequestToken";
1
+ import { QueryParams as GetMasterPassRequestTokenQueryParams } from "../../__api/queries/getMasterPassRequestToken";
2
2
 
3
- export type { GetMasterpassRequestTokenQueryParams };
3
+ export type { GetMasterPassRequestTokenQueryParams };
4
4
 
5
- export async function getMasterpassRequestToken(
6
- data: GetMasterpassRequestTokenQueryParams
5
+ export async function getMasterPassRequestToken(
6
+ data: GetMasterPassRequestTokenQueryParams
7
7
  ) {
8
- const _getMasterpassRequestToken = (
9
- await import("../../__api/queries/getMasterpassRequestToken")
8
+ const _getMasterPassRequestToken = (
9
+ await import("../../__api/queries/getMasterPassRequestToken")
10
10
  ).default;
11
- return await _getMasterpassRequestToken(data);
11
+ return await _getMasterPassRequestToken(data);
12
12
  }
@@ -266,6 +266,7 @@ function simpleToProduct(simple: SearchProduct): IkasProduct {
266
266
  shortDescription: simple.shortDescription || "",
267
267
  productOptionSetId: simple.productOptionSetId,
268
268
  variantTypes: simple.productVariantTypes.map((pvt) => ({
269
+ order: pvt.order,
269
270
  variantType: {
270
271
  id: pvt.variantType.id,
271
272
  name: pvt.variantType.name,
package/src/index.ts CHANGED
@@ -7,6 +7,8 @@ const onConfigChange = () => {
7
7
  "x-api-key": IkasStorefrontConfig.getApiKey() || "",
8
8
  "x-sfid": IkasStorefrontConfig.getStorefrontId() || "",
9
9
  "x-sfrid": IkasStorefrontConfig.getStorefrontRoutingId() || "",
10
+ "x-sid": IkasStorefrontConfig.getSessionId() || "",
11
+ "x-vid": IkasStorefrontConfig.getVisitorId() || "",
10
12
  };
11
13
 
12
14
  if (IkasStorefrontConfig.getCustomerToken()) {
@@ -48,5 +50,19 @@ export * from "./api/storefront";
48
50
  export { SaveMyCustomerInput } from "./__api/models/SaveMyCustomerInput";
49
51
  export { SaveCartInput } from "./__api/models/SaveCartInput";
50
52
  export { CheckStocksLineInput } from "./__api/models/CheckStocksLineInput";
53
+ export {
54
+ SortByDirectionEnum,
55
+ SortByTypeEnum,
56
+ MasterPassOperationTypeEnum,
57
+ } from "./__api/types";
58
+ export type {
59
+ SearchInputOrderByInput,
60
+ CreateStripePaymentIntentResponse,
61
+ RetrieveInstallmentInfoResponse,
62
+ TransactionResponse,
63
+ UpdateCartCampaignOfferInput,
64
+ CartLineOptionInput,
65
+ } from "./__api/types";
66
+
51
67
  export { APIResponse } from "@ikas/fe-api-client";
52
68
  export { Config as IkasAPIClientConfig };