@scayle/storefront-core 7.34.0 → 7.34.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 7.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix type errors
8
+
3
9
  ## 7.34.0
4
10
 
5
11
  ### Minor Changes
@@ -26,9 +26,7 @@ export declare class OAuthClient {
26
26
  * Execute a user login on the OAuth API and receive a token set
27
27
  * @param payload
28
28
  */
29
- login(payload: LoginRequest & {
30
- shopId: string;
31
- }): Promise<Oauth>;
29
+ login(payload: LoginRequest): Promise<Oauth>;
32
30
  /**
33
31
  * Execute a guest user login on the OAuth API and receive a token set
34
32
  * @param payload
@@ -76,7 +76,7 @@ const oauthGuestLogin = async (guest, context) => {
76
76
  const shopId = context.shopId;
77
77
  const client = (0, _oauth.getOAuthClient)(context);
78
78
  try {
79
- const tokens = client.guestLogin({
79
+ const tokens = await client.guestLogin({
80
80
  ...guest,
81
81
  shop_id: shopId
82
82
  });
@@ -105,7 +105,7 @@ const refreshAccessToken = async context => {
105
105
  refreshToken: tokens?.refresh_token
106
106
  });
107
107
  return {
108
- success: !!response.data
108
+ success: !!tokens
109
109
  };
110
110
  } catch (error) {
111
111
  const err = convertErrorForRpcCall(error, [_constants.HttpStatusCode.BAD_REQUEST, _constants.HttpStatusCode.UNAUTHORIZED]);
@@ -83,7 +83,7 @@ export const oauthGuestLogin = async (guest, context) => {
83
83
  const shopId = context.shopId;
84
84
  const client = getOAuthClient(context);
85
85
  try {
86
- const tokens = client.guestLogin({
86
+ const tokens = await client.guestLogin({
87
87
  ...guest,
88
88
  shop_id: shopId
89
89
  });
@@ -114,7 +114,7 @@ export const refreshAccessToken = async (context) => {
114
114
  accessToken: tokens?.access_token,
115
115
  refreshToken: tokens?.refresh_token
116
116
  });
117
- return { success: !!response.data };
117
+ return { success: !!tokens };
118
118
  } catch (error) {
119
119
  const err = convertErrorForRpcCall(error, [
120
120
  HttpStatusCode.BAD_REQUEST,
@@ -1,4 +1,5 @@
1
- import type { ProductWith, VariantDetail } from '@aboutyou/backbone';
1
+ import type { ProductWith } from '@aboutyou/backbone';
2
+ import type { VariantDetail } from '@aboutyou/backbone/endpoints/variants/variantsByIds';
2
3
  import { RpcHandler } from '../../types';
3
4
  export interface FetchVariantsParams {
4
5
  ids: number[];
@@ -49,6 +49,8 @@ export interface GuestRequest {
49
49
  }
50
50
  export interface SendResetPasswordEmailRequest {
51
51
  email: string;
52
+ reset_url: string;
53
+ shop_id: number;
52
54
  }
53
55
  export interface UpdatePasswordByHashRequest {
54
56
  password: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "7.34.0",
3
+ "version": "7.34.1",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -48,6 +48,7 @@
48
48
  "clean": "rimraf ./dist",
49
49
  "build:legacy": "tsc -p tsconfig.legacy.json",
50
50
  "build": "unbuild",
51
+ "typecheck": "tsc --noEmit -p tsconfig.json",
51
52
  "format": "prettier --ignore-unknown --log-level warn --check .",
52
53
  "format:fix": "prettier --ignore-unknown --log-level warn --write .",
53
54
  "lint": "eslint . --format gitlab",
@@ -71,19 +72,19 @@
71
72
  "@scayle/eslint-config-storefront": "3.2.6",
72
73
  "@scayle/prettier-config-storefront": "2.0.2",
73
74
  "@types/crypto-js": "4.2.1",
74
- "@types/node": "20.10.5",
75
+ "@types/node": "20.10.6",
75
76
  "@types/webpack-env": "1.18.4",
76
- "@vitest/coverage-v8": "1.1.0",
77
+ "@vitest/coverage-v8": "1.1.1",
77
78
  "eslint": "8.56.0",
78
79
  "eslint-formatter-gitlab": "5.1.0",
79
80
  "prettier": "3.0.0",
80
- "publint": "0.2.6",
81
+ "publint": "0.2.7",
81
82
  "rimraf": "5.0.5",
82
83
  "ts-node": "10.9.2",
83
84
  "typescript": "5.3.3",
84
85
  "unbuild": "2.0.0",
85
86
  "unstorage": "1.10.1",
86
- "vitest": "1.1.0"
87
+ "vitest": "1.1.1"
87
88
  },
88
89
  "optionalDependencies": {
89
90
  "redis": "4"