@sgflabs/storefront-core 0.1.17 → 0.1.18

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": "@sgflabs/storefront-core",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Shared storefront library consumed as raw TypeScript source by the brand apps.",
5
5
  "license": "PolyForm-Shield-1.0.0",
6
6
  "sideEffects": [
@@ -55,9 +55,9 @@
55
55
  "devDependencies": {
56
56
  "@sentry/nextjs": "^10.63.0",
57
57
  "@sgflabs/artha-go-sdk": "^0.3.0",
58
- "@sgflabs/gstin": "^0.1.17",
59
- "@sgflabs/page-spec": "^0.1.17",
60
- "@sgflabs/storefront-core-common": "^0.1.17",
58
+ "@sgflabs/gstin": "^0.1.18",
59
+ "@sgflabs/page-spec": "^0.1.18",
60
+ "@sgflabs/storefront-core-common": "^0.1.18",
61
61
  "@testing-library/dom": "^10.4.1",
62
62
  "@testing-library/jest-dom": "^7.0.0",
63
63
  "@testing-library/react": "^16.3.2",
@@ -73,9 +73,9 @@
73
73
  "peerDependencies": {
74
74
  "@sentry/nextjs": "^10.63.0",
75
75
  "@sgflabs/artha-go-sdk": "^0.3.0",
76
- "@sgflabs/gstin": "^0.1.17",
77
- "@sgflabs/page-spec": "^0.1.17",
78
- "@sgflabs/storefront-core-common": "^0.1.17",
76
+ "@sgflabs/gstin": "^0.1.18",
77
+ "@sgflabs/page-spec": "^0.1.18",
78
+ "@sgflabs/storefront-core-common": "^0.1.18",
79
79
  "next": "15.5.27",
80
80
  "react": "^19.3.1",
81
81
  "react-dom": "^19.3.1"
@@ -1,18 +1,16 @@
1
- import { getPublishableKey } from "../config"
2
1
  import { getPlatformTerms, getStoreLegal, type LegalDoc } from "./legal"
3
2
 
4
3
  /**
5
- * The documents a buyer must accept at checkout: on a tenant host the vendor's terms and the
6
- * marketplace terms, otherwise the platform terms (`getPlatformTerms`, unchanged). The apex key is
7
- * the env key, so it never pays for the tenant lookup. An empty list means no acceptance is required.
4
+ * The documents a buyer must accept at checkout: when the backend resolves the request's key to a
5
+ * vendor store, the vendor's terms and the marketplace terms, otherwise the platform terms
6
+ * (`getPlatformTerms`, unchanged). The backend's `scope` decides, never a comparison with the env
7
+ * key: a single-tenant storefront's env key can itself be a vendor's key, and the checkout gate
8
+ * then demands the vendor's terms. An empty list means no acceptance is required.
8
9
  */
9
10
  export const getCheckoutTermsDocs = async (): Promise<LegalDoc[]> => {
10
- const key = await getPublishableKey()
11
- if (key && key !== process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY) {
12
- const legal = await getStoreLegal()
13
- if (legal.scope === "vendor") {
14
- return [legal.policies.terms, legal.policies.marketplace_terms].filter((doc): doc is LegalDoc => doc !== null)
15
- }
11
+ const legal = await getStoreLegal()
12
+ if (legal.scope === "vendor") {
13
+ return [legal.policies.terms, legal.policies.marketplace_terms].filter((doc): doc is LegalDoc => doc !== null)
16
14
  }
17
15
  const platform = await getPlatformTerms()
18
16
  return platform ? [platform] : []