@tokenoftrust/storefront-runner 4.11.10 → 4.11.11
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.
|
@@ -31,26 +31,31 @@ export const UNPAID_DELEGATION_NOTE =
|
|
|
31
31
|
"unpaid — no delegation needed. Ship-on-behalf delegation becomes available once the live " +
|
|
32
32
|
"site is activated.";
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
export type
|
|
34
|
+
/** A capability the owner's grant form offers. */
|
|
35
|
+
export type OwnerGrantCapability = "ship-on-behalf" | "customer-contact-read";
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
38
|
+
* What the owner's "Grant access" form offers this viewer. Customer contact access is a support
|
|
39
|
+
* grant unrelated to payment, so a real owner always gets it. Ship-on-behalf is offered only once
|
|
40
|
+
* the store can go live: before that an invited developer can already add changes AND publish
|
|
41
|
+
* them (both `merge-to-preview` and `publish-live` admit the "unpaid-store-developer" basis,
|
|
42
|
+
* lib/publication/pipeline/admission.ts), so the owner sees {@link UNPAID_DELEGATION_NOTE} for it
|
|
43
|
+
* instead. A non-owner gets no form and the gate's explanation. PURE.
|
|
43
44
|
*/
|
|
44
|
-
export function
|
|
45
|
+
export function resolveOwnerGrantForm(
|
|
45
46
|
storefrontMode: string | null | undefined,
|
|
46
47
|
tenants: readonly TenantMembership[] | undefined,
|
|
47
48
|
resource: string,
|
|
48
49
|
staff?: StaffAdmission,
|
|
49
|
-
):
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return
|
|
50
|
+
): { offers: OwnerGrantCapability[]; note: string | null; gate: DelegateGate } {
|
|
51
|
+
const gate = resolveDelegateGate(tenants, resource, staff);
|
|
52
|
+
if (gate.mode !== "owner") return { offers: [], note: gate.explanation, gate };
|
|
53
|
+
const paid = storefrontModeAllowsGoLive(storefrontMode);
|
|
54
|
+
return {
|
|
55
|
+
offers: paid ? ["ship-on-behalf", "customer-contact-read"] : ["customer-contact-read"],
|
|
56
|
+
note: paid ? null : UNPAID_DELEGATION_NOTE,
|
|
57
|
+
gate,
|
|
58
|
+
};
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.11",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|