@scayle/storefront-core 8.6.0 → 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,21 @@
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
+
13
+ ## 8.6.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Remove duplicated export of `PromotionEffectType`. It was previously defined within `@scayle/storefront-core` and reexported from `@scayle/storefront-api`. Now only the the object literal and type from `@scayle/storefront-api` are exported.
18
+
3
19
  ## 8.6.0
4
20
 
5
21
  ### Minor Changes
@@ -1,8 +1,2 @@
1
- import type { PromotionEffect } from '../types';
2
1
  export declare const PROMOTION_PAGE_DEFAULT = 1;
3
2
  export declare const PROMOTION_PER_PAGE_DEFAULT = 100;
4
- export declare const PromotionEffectType: {
5
- readonly AUTOMATIC_DISCOUNT: "automatic_discount";
6
- readonly BUY_X_GET_Y: "buy_x_get_y";
7
- };
8
- export type PromotionEffectType = PromotionEffect['type'];
@@ -1,6 +1,2 @@
1
1
  export const PROMOTION_PAGE_DEFAULT = 1;
2
2
  export const PROMOTION_PER_PAGE_DEFAULT = 100;
3
- export const PromotionEffectType = {
4
- AUTOMATIC_DISCOUNT: "automatic_discount",
5
- BUY_X_GET_Y: "buy_x_get_y"
6
- };
@@ -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.0"}`).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.0",
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",
@@ -68,7 +68,7 @@
68
68
  "devDependencies": {
69
69
  "@scayle/eslint-config-storefront": "4.4.1",
70
70
  "@types/crypto-js": "4.2.2",
71
- "@types/node": "22.13.2",
71
+ "@types/node": "22.13.4",
72
72
  "@types/webpack-env": "1.18.8",
73
73
  "@vitest/coverage-v8": "2.1.9",
74
74
  "dprint": "0.49.0",