@scayle/storefront-core 8.20.1 → 8.22.0

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,24 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 8.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Allow passing `authUrlParameters` to the `getExternalIdpRedirect` RPC method. This parameter is an optional `Record<string, string>`. Values provided here will be processed by the Auth service and appended to the final redirect URL.
8
+ - Exported the `ShopCountryCustomData` interface.
9
+
10
+ ## 8.21.0
11
+
12
+ ### Minor Changes
13
+
14
+ - Expose the following filter types from `storefront-api`:
15
+
16
+ - `FilterItemWithValues`
17
+ - `BooleanFilterItemWithValues`
18
+ - `RangeFilterItemWithValues`
19
+ - `IdenfitierFilterItemWithValues`
20
+ - `AttributesFilterValue`
21
+
3
22
  ## 8.20.1
4
23
 
5
24
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -68,4 +68,4 @@ export type RpcMethodParameters<N extends RpcMethodName> = Parameters<RpcMethod<
68
68
  */
69
69
  export type RpcMethodReturnType<N extends RpcMethodName> = ReturnType<RpcMethod<N>>;
70
70
  export type RpcMethodCall = <N extends RpcMethodName, P extends RpcMethodParameters<N>, TResult extends Exclude<Awaited<RpcMethodReturnType<N>>, Response>>(...args: P extends RpcContext ? [N] : [N, P]) => Promise<TResult>;
71
- export { ExistingItemHandling, AddToBasketFailureKind, UpdateBasketItemFailureKind, AddToWishlistFailureKind, PromotionEffectType, FilterTypes, APISortOption, APISortOrder, type ProductSortConfig, } from '@scayle/storefront-api';
71
+ export { ExistingItemHandling, AddToBasketFailureKind, UpdateBasketItemFailureKind, AddToWishlistFailureKind, PromotionEffectType, FilterTypes, APISortOption, APISortOrder, type ProductSortConfig, type ShopCountryCustomData, } from '@scayle/storefront-api';
@@ -36,7 +36,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
36
36
  carrier,
37
37
  basketId: context.basketKey,
38
38
  campaignKey
39
- }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.20.1"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
39
+ }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.22.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
40
40
  return {
41
41
  accessToken: refreshedAccessToken,
42
42
  checkoutJwt
@@ -6,6 +6,7 @@ import type { RpcHandler } from '../../../types';
6
6
  *
7
7
  * @param params The parameters for retrieving the external IDP redirect.
8
8
  * @param params.queryParams Optional query parameters to include in the redirect URLs.
9
+ * @param params.authUrlParameters Optional query parameters to provide to the IDP service.
9
10
  * @param context The RPC context.
10
11
  *
11
12
  * @returns A record mapping IDP keys to their corresponding redirect URLs,
@@ -14,6 +15,7 @@ import type { RpcHandler } from '../../../types';
14
15
  */
15
16
  export declare const getExternalIdpRedirect: RpcHandler<{
16
17
  queryParams?: Record<string, string>;
18
+ authUrlParameters?: Record<string, string>;
17
19
  }, Record<string, string>>;
18
20
  /**
19
21
  * Handles the IDP login callback.
@@ -4,7 +4,7 @@ import { HttpStatusCode, HttpStatusMessage } from "../../../constants/index.mjs"
4
4
  import { hasSession } from "../../../types/index.mjs";
5
5
  import { getOAuthClient } from "../../../api/oauth.mjs";
6
6
  import { postLogin } from "../session.mjs";
7
- export const getExternalIdpRedirect = async function getExternalIdpRedirect2({ queryParams }, context) {
7
+ export const getExternalIdpRedirect = async function getExternalIdpRedirect2({ queryParams, authUrlParameters }, context) {
8
8
  if (!context.idp?.enabled) {
9
9
  return {};
10
10
  }
@@ -35,7 +35,8 @@ export const getExternalIdpRedirect = async function getExternalIdpRedirect2({ q
35
35
  const jwtPayload = await new SignJWT({
36
36
  idpKey,
37
37
  callbackUrl: redirectUrl.toString(),
38
- clientId: OAuthClient.clientId.toString()
38
+ clientId: OAuthClient.clientId.toString(),
39
+ authUrlParameters
39
40
  }).setProtectedHeader({ alg: "HS256", typ: "JWT" }).setIssuedAt().setExpirationTime("2h").sign(secret);
40
41
  const url = new URL(`${OAuthClient.baseURL}/auth/external/redirect`);
41
42
  url.searchParams.set("shopId", `${context.shopId}`);
@@ -1,7 +1,6 @@
1
1
  import type { AttributeWithBooleanValueFilter, AttributeWithValuesFilter, FiltersEndpointResponseData, ProductSearchQuery, ProductSortConfig, ProductsSearchEndpointParameters } from '@scayle/storefront-api';
2
2
  import type { Query } from './router';
3
- export type { AttributesFilterItemWithValues } from '@scayle/storefront-api';
4
- export type { AttributeWithBooleanValueFilter, AttributeWithValuesFilter, AttributeKey, } from '@scayle/storefront-api';
3
+ export type { FilterItemWithValues, BooleanFilterItemWithValues, AttributesFilterItemWithValues, RangeFilterItemWithValues, IdenfitierFilterItemWithValues, AttributesFilterValue, AttributeWithBooleanValueFilter, AttributeWithValuesFilter, AttributeKey, } from '@scayle/storefront-api';
5
4
  /**
6
5
  * Parameters for filtering products.
7
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "8.20.1",
3
+ "version": "8.22.0",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -77,9 +77,9 @@
77
77
  "devDependencies": {
78
78
  "@scayle/eslint-config-storefront": "4.5.0",
79
79
  "@types/crypto-js": "4.2.2",
80
- "@types/node": "22.14.0",
80
+ "@types/node": "22.14.1",
81
81
  "@types/webpack-env": "1.18.8",
82
- "@vitest/coverage-v8": "2.1.9",
82
+ "@vitest/coverage-v8": "3.1.1",
83
83
  "dprint": "0.49.1",
84
84
  "eslint": "9.24.0",
85
85
  "eslint-formatter-gitlab": "5.1.0",
@@ -89,7 +89,7 @@
89
89
  "typescript": "5.8.3",
90
90
  "unbuild": "3.5.0",
91
91
  "unstorage": "1.15.0",
92
- "vitest": "2.1.9"
92
+ "vitest": "3.1.1"
93
93
  },
94
94
  "volta": {
95
95
  "node": "22.14.0"