@thorprovider/storefront 0.13.1 → 0.13.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OrderDetailActionId, OrderDocument } from '@thorprovider/blocks/ports'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Host capability gate for the order-detail route.
|
|
@@ -9,7 +9,7 @@ import type { OrderActionId, OrderDocument } from '@thorprovider/blocks/ports'
|
|
|
9
9
|
* can really serve: project actions through it, and register exactly one handler
|
|
10
10
|
* per entry in the route panel.
|
|
11
11
|
*/
|
|
12
|
-
export const ORDER_DETAIL_HOST_ACTIONS: readonly
|
|
12
|
+
export const ORDER_DETAIL_HOST_ACTIONS: readonly OrderDetailActionId[] = [
|
|
13
13
|
'reorder',
|
|
14
14
|
'invoice',
|
|
15
15
|
'track',
|
|
@@ -33,16 +33,16 @@ export const ORDER_DETAIL_SUPPORT_HREF = '/contact'
|
|
|
33
33
|
*/
|
|
34
34
|
export function orderDetailHostActions(
|
|
35
35
|
supportHref: string = ORDER_DETAIL_SUPPORT_HREF,
|
|
36
|
-
): readonly
|
|
36
|
+
): readonly OrderDetailActionId[] {
|
|
37
37
|
if (supportHref !== '') return ORDER_DETAIL_HOST_ACTIONS
|
|
38
38
|
return ORDER_DETAIL_HOST_ACTIONS.filter((action) => action !== 'support')
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/** Project an authorised action set through the host's real capabilities. */
|
|
42
42
|
export function projectHostActions(
|
|
43
|
-
actions: readonly
|
|
43
|
+
actions: readonly OrderDetailActionId[],
|
|
44
44
|
supportHref: string = ORDER_DETAIL_SUPPORT_HREF,
|
|
45
|
-
):
|
|
45
|
+
): OrderDetailActionId[] {
|
|
46
46
|
const served = orderDetailHostActions(supportHref)
|
|
47
47
|
return actions.filter((action) => served.includes(action))
|
|
48
48
|
}
|
|
@@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation'
|
|
|
5
5
|
import { AfterSalesFlow } from '@thorprovider/blocks'
|
|
6
6
|
import { OrderDetail as OrderDetailSurface } from '@thorprovider/blocks'
|
|
7
7
|
import type { AfterSalesCaseType, AfterSalesRequest, OrderDetailProps } from '@thorprovider/blocks'
|
|
8
|
-
import type {
|
|
8
|
+
import type { OrderDetailActionId, OrderDetailSnapshot, OrderDocument } from '@thorprovider/blocks/ports'
|
|
9
9
|
|
|
10
10
|
import { ports } from '../../ports'
|
|
11
11
|
import { reorderOrderAction } from '../../actions'
|
|
@@ -98,7 +98,7 @@ export function AccountOrderDetailPanel({ props }: PanelProps) {
|
|
|
98
98
|
router.push('/account/orders')
|
|
99
99
|
}, [router])
|
|
100
100
|
|
|
101
|
-
const onAction = async (action:
|
|
101
|
+
const onAction = async (action: OrderDetailActionId) => {
|
|
102
102
|
switch (action) {
|
|
103
103
|
case 'reorder': {
|
|
104
104
|
if (busy) return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thorprovider/storefront",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Deterministic storefront scaffolder and installable OpenCode skill suite for Thor Commerce (Next.js, @thorprovider/blocks, @thorprovider/adapters, Medusa)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "bin/storefront.js",
|
package/scripts/candidate.mjs
CHANGED
|
@@ -435,8 +435,11 @@ export function verifyRegistryArtifact({
|
|
|
435
435
|
* `npm publish` returns before every registry edge serves the artifacts. A
|
|
436
436
|
* mirror that is still replicating answers 404 for a version that exists, so the
|
|
437
437
|
* acceptance gate polls instead of failing a release that published correctly.
|
|
438
|
+
* The linear backoff below waits ~3.5 minutes in total: acceptance starts ~30s
|
|
439
|
+
* after publishing, and a cold packument edge has been observed to take over a
|
|
440
|
+
* minute to serve a brand-new version.
|
|
438
441
|
*/
|
|
439
|
-
export const REGISTRY_RETRY = Object.freeze({ attempts:
|
|
442
|
+
export const REGISTRY_RETRY = Object.freeze({ attempts: 7, delayMs: 10_000 })
|
|
440
443
|
|
|
441
444
|
const defaultSleep = (ms) => new Promise((done) => setTimeout(done, ms))
|
|
442
445
|
|