@hszrdm/create-commerce 1.11.2 → 1.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hszrdm/create-commerce",
3
- "version": "1.11.2",
3
+ "version": "1.12.0",
4
4
  "description": "Create a complete HSZRDM Commerce webshop project.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -97,6 +97,8 @@ SMTP_USER=
97
97
  SMTP_PASSWORD=
98
98
  SMTP_FROM="Example Store <system@example.com>"
99
99
  SMTP_REPLY_TO=
100
+ # Opcionális, a SMTP-szolgáltatónál engedélyezett alternatív feladócímek (Send As)
101
+ SMTP_ALLOWED_FROM_ADDRESSES=
100
102
 
101
103
  EMAIL_CUSTOMER_WELCOME_ENABLED=
102
104
  EMAIL_REGISTRATION_VERIFICATION_ENABLED=
@@ -23,7 +23,7 @@
23
23
  "start:prod": "cd .medusa/server && medusa start"
24
24
  },
25
25
  "dependencies": {
26
- "@hszrdm/core": "1.11.2",
26
+ "@hszrdm/core": "1.12.0",
27
27
  "@medusajs/admin-sdk": "2.22.2",
28
28
  "@medusajs/cli": "2.22.2",
29
29
  "@medusajs/draft-order": "2.22.2",
@@ -522,12 +522,16 @@ export function CheckoutFlow({ config }: { config: CoreConfig }) {
522
522
  setError(null)
523
523
  }
524
524
 
525
- /** Reconcile vendor widget selection with Core's current catalog where available. */
525
+ /** Reconcile widget points where another backend catalog lookup is required. */
526
526
  const verifyCarrierPickupPoint = async (kind: PickupKind, picked: CarrierPickupPoint | null) => {
527
527
  if (!kind || !picked || kind !== picked.provider) return picked
528
+ // GLS <gls-dpm> selects from the official live feed itself. Re-fetching the
529
+ // entire catalog via Core can independently fail with HTTP 503 and block
530
+ // checkout after a valid selection. Core still validates the saved point
531
+ // and verifies it with GLS again before generating a shipping label.
532
+ if (kind === "gls") return picked
528
533
  let candidates: JsonRecord[] | null = null
529
534
  if (kind === "foxpost") candidates = (await api.foxpostLockers()).lockers
530
- if (kind === "gls") candidates = (await api.glsDeliveryPoints()).deliveryPoints
531
535
  if (kind === "mpl") {
532
536
  candidates = (await api.mplDeliveryPlaces({ postCode: picked.postalCode })).deliveryPlaces
533
537
  }
@@ -1,5 +1,6 @@
1
1
  import assert from "node:assert/strict"
2
2
  import test from "node:test"
3
+ import { readFileSync } from "node:fs"
3
4
  import { normalizeCarrierPickupPoint, carrierPointToShippingData } from "../src/components/carrier-pickup-adapter.ts"
4
5
 
5
6
  test("FOXPOST 2in1 point preserves operator and place ID", () => {
@@ -67,3 +68,18 @@ test("invalid or incomplete widget selection is rejected", () => {
67
68
  assert.equal(normalizeCarrierPickupPoint("gls", { id: "X", name: "Incomplete" }), null)
68
69
  assert.equal(normalizeCarrierPickupPoint("packeta", null), null)
69
70
  })
71
+
72
+ test("official GLS widget point avoids a second full-feed lookup before Core shipping save", () => {
73
+ const flow = readFileSync(new URL("../src/components/checkout-flow.tsx", import.meta.url), "utf8")
74
+ const start = flow.indexOf("const verifyCarrierPickupPoint =")
75
+ const end = flow.indexOf("const saveShipping =", start)
76
+ assert.ok(start >= 0 && end > start)
77
+ const verify = flow.slice(start, end)
78
+ assert.match(verify, /if \(kind === "gls"\) return picked/)
79
+ assert.doesNotMatch(verify, /api\.glsDeliveryPoints\(/)
80
+ assert.match(verify, /api\.foxpostLockers\(\)/)
81
+ assert.match(verify, /api\.mplDeliveryPlaces\(/)
82
+ assert.match(flow, /const verifiedPoint = await verifyCarrierPickupPoint\(kind, selectedPickupPoint\)/)
83
+ assert.match(flow, /const data = shippingData\(kind, verifiedPoint, locale\)/)
84
+ assert.match(flow, /api\.addShippingMethod\(cartId, optionId, data\)/)
85
+ })