@scayle/storefront-core 8.6.1 → 8.7.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,15 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 8.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **\[Testing\]** Create and expose externally `userFactory`
8
+
9
+ ### Patch Changes
10
+
11
+ - The `domain` property on `RpcContext` is optional
12
+
3
13
  ## 8.6.1
4
14
 
5
15
  ### Patch Changes
@@ -35,7 +35,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
35
35
  carrier,
36
36
  basketId: context.basketKey,
37
37
  campaignKey: context.campaignKey
38
- }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.6.1"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
38
+ }).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.7.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
39
39
  return {
40
40
  accessToken: refreshedAccessToken,
41
41
  checkoutJwt
@@ -1 +1,2 @@
1
1
  export * from '@scayle/storefront-api/dist/test/factories';
2
+ export * from './user';
@@ -1 +1,2 @@
1
1
  export * from "@scayle/storefront-api/dist/test/factories";
2
+ export * from "./user.mjs";
@@ -0,0 +1,3 @@
1
+ import { Factory } from 'fishery';
2
+ import type { ShopUser } from '../../types';
3
+ export declare const userFactory: Factory<ShopUser, any, ShopUser>;
@@ -0,0 +1,16 @@
1
+ import { Factory } from "fishery";
2
+ export const userFactory = Factory.define(() => ({
3
+ id: 1,
4
+ app_id: 1,
5
+ completed_orders: 0,
6
+ createdAt: "2024-12-12T09:08:06+01:00",
7
+ updatedAt: "2025-02-14T07:29:05+01:00",
8
+ email: "user@example.org",
9
+ firstName: "John",
10
+ lastName: "Neil",
11
+ gender: "n",
12
+ publicKey: "test-public-key",
13
+ referenceKey: "test-ref-key",
14
+ isGuest: false,
15
+ isReturningCustomer: false
16
+ }));
@@ -75,7 +75,7 @@ export type RpcContext = {
75
75
  sapiClient: StorefrontAPIClient;
76
76
  cached: CachedType;
77
77
  shopId: number;
78
- domain: string;
78
+ domain?: string;
79
79
  withParams?: WithParams;
80
80
  campaignKey?: string;
81
81
  destroySessionsForUserId: (userId: number, sessionsToKeep?: string[]) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "8.6.1",
3
+ "version": "8.7.0",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",