@tokenoftrust/storefront-runner 0.1.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/LICENSE +58 -0
- package/README.md +40 -0
- package/apps/storefront/.dev.vars.example +41 -0
- package/apps/storefront/.env.example +24 -0
- package/apps/storefront/astro.config.mjs +245 -0
- package/apps/storefront/env.d.ts +155 -0
- package/apps/storefront/lib/ensure-preview-reconcile-secret.sh +31 -0
- package/apps/storefront/lib/resolve-cf-token.sh +48 -0
- package/apps/storefront/lib/resolve-tot-credentials.sh +69 -0
- package/apps/storefront/migrations/0000_baseline.sql +54 -0
- package/apps/storefront/migrations/0001_products_fts.sql +9 -0
- package/apps/storefront/migrations/README.md +54 -0
- package/apps/storefront/migrations/meta/0000_snapshot.json +347 -0
- package/apps/storefront/migrations/meta/0001_snapshot.json +347 -0
- package/apps/storefront/migrations/meta/_journal.json +20 -0
- package/apps/storefront/package.json +41 -0
- package/apps/storefront/public/brand/northwind-logo-dark.svg +4 -0
- package/apps/storefront/public/brand/northwind-logo-light.svg +4 -0
- package/apps/storefront/public/brand/northwind-og.svg +13 -0
- package/apps/storefront/public/favicon.svg +5 -0
- package/apps/storefront/public/js/dashboard-team.js +147 -0
- package/apps/storefront/public/js/dashboard-vendor-search.js +115 -0
- package/apps/storefront/src/components/Badge.astro +34 -0
- package/apps/storefront/src/components/Breadcrumbs.astro +45 -0
- package/apps/storefront/src/components/CollectionCard.astro +56 -0
- package/apps/storefront/src/components/EmptyState.astro +35 -0
- package/apps/storefront/src/components/Img.astro +68 -0
- package/apps/storefront/src/components/ProductCard.astro +228 -0
- package/apps/storefront/src/components/Section.astro +39 -0
- package/apps/storefront/src/components/Seo.astro +70 -0
- package/apps/storefront/src/components/WidgetFrame.astro +34 -0
- package/apps/storefront/src/components/auth/AuthBadge.astro +44 -0
- package/apps/storefront/src/components/chrome/AnnouncementBar.astro +108 -0
- package/apps/storefront/src/components/chrome/MegaMenu.astro +26 -0
- package/apps/storefront/src/components/chrome/NavDropdown.astro +116 -0
- package/apps/storefront/src/components/chrome/SiteFooter.astro +181 -0
- package/apps/storefront/src/components/chrome/SiteHeader.astro +181 -0
- package/apps/storefront/src/components/chrome/UtilityNav.astro +79 -0
- package/apps/storefront/src/components/commerce/FoxyLoader.astro +23 -0
- package/apps/storefront/src/components/commerce/PriceDisplay.astro +91 -0
- package/apps/storefront/src/components/commerce/ProductCarousel.astro +197 -0
- package/apps/storefront/src/components/commerce/ProductGrid.astro +75 -0
- package/apps/storefront/src/components/commerce/RatingStars.astro +58 -0
- package/apps/storefront/src/components/compliance/NicotineWarning.astro +33 -0
- package/apps/storefront/src/components/home/Hero.astro +164 -0
- package/apps/storefront/src/components/islands/AgeGate.tsx +105 -0
- package/apps/storefront/src/components/islands/ImageGallery.tsx +237 -0
- package/apps/storefront/src/components/islands/IsolatedAgeGate.tsx +73 -0
- package/apps/storefront/src/components/islands/MobileNav.tsx +239 -0
- package/apps/storefront/src/components/islands/QuickView.tsx +138 -0
- package/apps/storefront/src/components/islands/RecentlyViewed.tsx +122 -0
- package/apps/storefront/src/components/islands/SavedList.tsx +99 -0
- package/apps/storefront/src/components/islands/SearchTypeahead.tsx +248 -0
- package/apps/storefront/src/components/islands/VariantSelector.tsx +378 -0
- package/apps/storefront/src/components/marketing/CardGrid.astro +72 -0
- package/apps/storefront/src/components/marketing/CodeSample.astro +20 -0
- package/apps/storefront/src/components/marketing/CtaBand.astro +24 -0
- package/apps/storefront/src/components/marketing/Faq.astro +37 -0
- package/apps/storefront/src/components/marketing/Integrations.astro +63 -0
- package/apps/storefront/src/components/marketing/MarketingBlocks.astro +53 -0
- package/apps/storefront/src/components/marketing/MarketingCtas.astro +48 -0
- package/apps/storefront/src/components/marketing/MarketingHero.astro +72 -0
- package/apps/storefront/src/components/marketing/ProofStrip.astro +37 -0
- package/apps/storefront/src/components/marketing/SplitCompare.astro +53 -0
- package/apps/storefront/src/components/marketing/Steps.astro +36 -0
- package/apps/storefront/src/components/marketing/Testimonials.astro +38 -0
- package/apps/storefront/src/components/marketing/TrustBar.astro +22 -0
- package/apps/storefront/src/components/nav/Footer.astro +148 -0
- package/apps/storefront/src/components/nav/Header.astro +190 -0
- package/apps/storefront/src/components/plp/ActiveFilters.astro +79 -0
- package/apps/storefront/src/components/plp/FacetSidebar.astro +146 -0
- package/apps/storefront/src/components/plp/Pagination.astro +99 -0
- package/apps/storefront/src/components/plp/SortSelect.astro +64 -0
- package/apps/storefront/src/config/devTenants.ts +16 -0
- package/apps/storefront/src/config/kvTenantResolver.ts +87 -0
- package/apps/storefront/src/config/resolver.ts +46 -0
- package/apps/storefront/src/config/tenants.ts +193 -0
- package/apps/storefront/src/layouts/Layout.astro +303 -0
- package/apps/storefront/src/lib/analytics/index.ts +47 -0
- package/apps/storefront/src/lib/auth/brokerAssertion.ts +136 -0
- package/apps/storefront/src/lib/auth/devAuth.ts +90 -0
- package/apps/storefront/src/lib/auth/gatePage.ts +81 -0
- package/apps/storefront/src/lib/auth/identityToken.ts +341 -0
- package/apps/storefront/src/lib/auth/loginGate.ts +107 -0
- package/apps/storefront/src/lib/auth/route.ts +146 -0
- package/apps/storefront/src/lib/auth/session.ts +203 -0
- package/apps/storefront/src/lib/auth/totAccessClient.ts +503 -0
- package/apps/storefront/src/lib/basePath.ts +41 -0
- package/apps/storefront/src/lib/cfImage.ts +55 -0
- package/apps/storefront/src/lib/chrome/model.ts +65 -0
- package/apps/storefront/src/lib/colors.ts +97 -0
- package/apps/storefront/src/lib/content-edit/client.ts +230 -0
- package/apps/storefront/src/lib/content-edit/index.ts +14 -0
- package/apps/storefront/src/lib/content-edit/route.ts +25 -0
- package/apps/storefront/src/lib/content-edit/types.ts +19 -0
- package/apps/storefront/src/lib/cspStaticHashes.ts +24 -0
- package/apps/storefront/src/lib/d1/catalog.ts +289 -0
- package/apps/storefront/src/lib/dashboard/staffAdmission.ts +43 -0
- package/apps/storefront/src/lib/dashboard/staffVendorAccess.ts +449 -0
- package/apps/storefront/src/lib/dashboard/tenantSelection.ts +136 -0
- package/apps/storefront/src/lib/dashboard/vendorQuery.ts +61 -0
- package/apps/storefront/src/lib/demoGate.ts +113 -0
- package/apps/storefront/src/lib/dev/ai-widget-client.js +127 -0
- package/apps/storefront/src/lib/dev/cliSignInCode.ts +132 -0
- package/apps/storefront/src/lib/diag/redact.ts +20 -0
- package/apps/storefront/src/lib/edgeCache.ts +128 -0
- package/apps/storefront/src/lib/email/magicLinkInviteEmail.ts +62 -0
- package/apps/storefront/src/lib/env.ts +60 -0
- package/apps/storefront/src/lib/fixtures/sampleProducts.ts +130 -0
- package/apps/storefront/src/lib/format.ts +29 -0
- package/apps/storefront/src/lib/foxyCommerce.ts +49 -0
- package/apps/storefront/src/lib/imageAttrs.ts +55 -0
- package/apps/storefront/src/lib/jsonld.ts +136 -0
- package/apps/storefront/src/lib/maintenance.ts +71 -0
- package/apps/storefront/src/lib/memoryKv.ts +32 -0
- package/apps/storefront/src/lib/messaging/messagesClient.ts +143 -0
- package/apps/storefront/src/lib/placeholder.ts +99 -0
- package/apps/storefront/src/lib/previewReload.ts +125 -0
- package/apps/storefront/src/lib/rawMarketingHtml.ts +133 -0
- package/apps/storefront/src/lib/search/index.ts +74 -0
- package/apps/storefront/src/lib/sections.ts +129 -0
- package/apps/storefront/src/lib/securityHeaders.ts +31 -0
- package/apps/storefront/src/lib/storyblok/content-model.ts +289 -0
- package/apps/storefront/src/lib/storyblok/provider.ts +524 -0
- package/apps/storefront/src/lib/tenantRouting.ts +91 -0
- package/apps/storefront/src/lib/tot/ToTClient.ts +177 -0
- package/apps/storefront/src/lib/tot/d1Client.ts +62 -0
- package/apps/storefront/src/lib/tot/query.ts +187 -0
- package/apps/storefront/src/lib/tot/totClientInterface.ts +30 -0
- package/apps/storefront/src/lib/url.ts +119 -0
- package/apps/storefront/src/lib/wishlist.ts +63 -0
- package/apps/storefront/src/middleware/index.ts +413 -0
- package/apps/storefront/src/pages/404.astro +61 -0
- package/apps/storefront/src/pages/[...slug].astro +90 -0
- package/apps/storefront/src/pages/api/auth/logout.ts +21 -0
- package/apps/storefront/src/pages/api/auth/magic-exchange.ts +107 -0
- package/apps/storefront/src/pages/api/auth/send.ts +85 -0
- package/apps/storefront/src/pages/api/auth/verify.ts +135 -0
- package/apps/storefront/src/pages/api/cache-purge.ts +44 -0
- package/apps/storefront/src/pages/api/content-edit/ai-edit.ts +64 -0
- package/apps/storefront/src/pages/api/csp-report.ts +25 -0
- package/apps/storefront/src/pages/api/dashboard/enter-vendor.ts +124 -0
- package/apps/storefront/src/pages/api/dashboard/vendor-search.ts +120 -0
- package/apps/storefront/src/pages/api/dev/cli-signin-code.ts +44 -0
- package/apps/storefront/src/pages/api/newsletter.ts +104 -0
- package/apps/storefront/src/pages/api/request-access.ts +172 -0
- package/apps/storefront/src/pages/auth/login.astro +149 -0
- package/apps/storefront/src/pages/auth/magic.astro +105 -0
- package/apps/storefront/src/pages/capabilities.astro +292 -0
- package/apps/storefront/src/pages/collections/[handle].astro +154 -0
- package/apps/storefront/src/pages/collections/index.astro +59 -0
- package/apps/storefront/src/pages/dashboard/[appDomain]/index.astro +100 -0
- package/apps/storefront/src/pages/dashboard/[appDomain]/team.astro +154 -0
- package/apps/storefront/src/pages/dashboard/index.astro +160 -0
- package/apps/storefront/src/pages/dev.astro +653 -0
- package/apps/storefront/src/pages/index.astro +290 -0
- package/apps/storefront/src/pages/llms.txt.ts +92 -0
- package/apps/storefront/src/pages/products/[handle].astro +443 -0
- package/apps/storefront/src/pages/robots.txt.ts +24 -0
- package/apps/storefront/src/pages/saved.astro +35 -0
- package/apps/storefront/src/pages/search.astro +150 -0
- package/apps/storefront/src/pages/sitemap.xml.ts +78 -0
- package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +646 -0
- package/apps/storefront/src/pages/style-guide/[tenant]/index.astro +85 -0
- package/apps/storefront/src/pages/style-guide/index.astro +94 -0
- package/apps/storefront/src/pages/tenants/[id]/[...path].ts +57 -0
- package/apps/storefront/src/styles/global.css +277 -0
- package/apps/storefront/src/themes/reference.ts +61 -0
- package/apps/storefront/src/themes/schema.ts +111 -0
- package/apps/storefront/src/themes/tenants/index.ts +51 -0
- package/apps/storefront/tsconfig.json +16 -0
- package/apps/storefront/vitest.config.ts +22 -0
- package/apps/storefront/wrangler.toml +175 -0
- package/package.json +23 -0
- package/packages/public-runtime/LICENSE +58 -0
- package/packages/public-runtime/package.json +22 -0
- package/packages/public-runtime/src/binary-path.ts +68 -0
- package/packages/public-runtime/src/capabilities.ts +89 -0
- package/packages/public-runtime/src/catalog-api.ts +81 -0
- package/packages/public-runtime/src/catalog-d1.ts +192 -0
- package/packages/public-runtime/src/csp.ts +109 -0
- package/packages/public-runtime/src/customization-preview.ts +197 -0
- package/packages/public-runtime/src/customization-reconcile.ts +63 -0
- package/packages/public-runtime/src/customization-runtime.ts +157 -0
- package/packages/public-runtime/src/customization-scripts.ts +64 -0
- package/packages/public-runtime/src/customization-versioning.ts +95 -0
- package/packages/public-runtime/src/foxy.ts +184 -0
- package/packages/public-runtime/src/index.ts +30 -0
- package/packages/public-runtime/src/product.ts +159 -0
- package/packages/public-runtime/src/search.ts +45 -0
- package/packages/public-runtime/src/tenant-assets.ts +444 -0
- package/packages/public-runtime/src/tenant.ts +243 -0
- package/packages/public-runtime/tsconfig.json +8 -0
- package/packages/public-runtime/vitest.config.ts +8 -0
- package/pnpm-workspace.yaml +7 -0
- package/scripts/build/copy-tenant-assets.mjs +69 -0
- package/scripts/tot-dev.mjs +439 -0
- package/tenants/bigdvapor/content/blog.json +52 -0
- package/tenants/bigdvapor/content/chrome.html +149 -0
- package/tenants/bigdvapor/content/chrome.json +47 -0
- package/tenants/bigdvapor/content/home.html +463 -0
- package/tenants/bigdvapor/content/home.json +73 -0
- package/tenants/bigdvapor/content/pages/about.json +5 -0
- package/tenants/bigdvapor/content/pages/privacy.json +6 -0
- package/tenants/bigdvapor/content/pages/shipping-returns.json +6 -0
- package/tenants/bigdvapor/content/pages-html/blogs/news.html +86 -0
- package/tenants/bigdvapor/content/pages-html/pages/about-us.html +106 -0
- package/tenants/bigdvapor/content/pages-html/pages/contact-us.html +61 -0
- package/tenants/bigdvapor/content/pages-html/pages/privacy-policy.html +72 -0
- package/tenants/bigdvapor/content/pages-html/pages/shipping-returns.html +172 -0
- package/tenants/bigdvapor/content/themes/bigd-navy.json +109 -0
- package/tenants/bigdvapor/public/img/brands/adjust-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/again-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/al-fakher-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/arro-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/cookies-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/core-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/cyclone-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/dinner-lady-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/extre-bar-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/fifty-bar-vape-disposable.jpg +0 -0
- package/tenants/bigdvapor/public/img/brands/firerose-vape-disposable.jpg +0 -0
- package/tenants/bigdvapor/public/img/brands/flavor-beast-vape-disposable.jpg +0 -0
- package/tenants/bigdvapor/public/img/brands/foger-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/kk-energy-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/kumi-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/lost-vape-dispoable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/melo-labs-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/brands/mixo-vape-disposable.webp +0 -0
- package/tenants/bigdvapor/public/img/brands/one-tank-vape-disposable.jpg +0 -0
- package/tenants/bigdvapor/public/img/brands/oxbar-vape-disposable.webp +0 -0
- package/tenants/bigdvapor/public/img/brands/pillow-talk-vape-disposable.jpg +0 -0
- package/tenants/bigdvapor/public/img/brands/pod-king-vape-disposable.jpg +0 -0
- package/tenants/bigdvapor/public/img/brands/raz-vape-disposable.png +0 -0
- package/tenants/bigdvapor/public/img/hero-texas.jpg +0 -0
- package/tenants/bigdvapor/public/img/og.jpg +0 -0
- package/tenants/bigdvapor/public/img/pages/AdobeStock_202106312_web.jpg +0 -0
- package/tenants/bigdvapor/public/img/pages/CREW_web.jpg +0 -0
- package/tenants/bigdvapor/public/img/pages/Hero-Image.jpg +0 -0
- package/tenants/bigdvapor/public/img/tiles/adjust.png +0 -0
- package/tenants/bigdvapor/public/img/tiles/again.png +0 -0
- package/tenants/bigdvapor/public/img/tiles/al-fakher.png +0 -0
- package/tenants/bigdvapor/public/img/tiles/arro.png +0 -0
- package/tenants/bigdvapor/public/img/tiles/cookies.png +0 -0
- package/tenants/bigdvapor/public/img/tiles/core.png +0 -0
- package/tenants/bigdvapor/public/img/tiles/cyclone.png +0 -0
- package/tenants/bigdvapor/public/img/tiles/disposables.svg +23 -0
- package/tenants/bigdvapor/public/logo-wordmark.png +0 -0
- package/tenants/bigdvapor/public/pages/home.css +118 -0
- package/tenants/bigdvapor/public/pages/mkt.css +185 -0
- package/tenants/bigdvapor/public/pages/page.css +148 -0
- package/tenants/bigdvapor/public/themes/bigd-navy.css +73 -0
- package/tenants/bigdvapor/theme.json +12 -0
- package/tenants/giantvapes/content/chrome.html +152 -0
- package/tenants/giantvapes/content/chrome.json +94 -0
- package/tenants/giantvapes/content/home.html +194 -0
- package/tenants/giantvapes/content/home.json +50 -0
- package/tenants/giantvapes/content/pages/about.json +10 -0
- package/tenants/giantvapes/content/pages/privacy.json +6 -0
- package/tenants/giantvapes/content/pages/shipping-returns.json +6 -0
- package/tenants/giantvapes/content/pages-html/blogs/news.html +68 -0
- package/tenants/giantvapes/content/pages-html/pages/about-us.html +95 -0
- package/tenants/giantvapes/content/pages-html/pages/contact-us.html +68 -0
- package/tenants/giantvapes/content/pages-html/pages/privacy-policy.html +65 -0
- package/tenants/giantvapes/content/pages-html/pages/shipping-returns.html +77 -0
- package/tenants/giantvapes/content/themes/giant-navy.json +73 -0
- package/tenants/giantvapes/public/img/hero-suicide-bunny.jpg +0 -0
- package/tenants/giantvapes/public/img/hero.webp +0 -0
- package/tenants/giantvapes/public/img/og.jpg +0 -0
- package/tenants/giantvapes/public/logo-wordmark.png +0 -0
- package/tenants/giantvapes/public/pages/home.css +120 -0
- package/tenants/giantvapes/public/pages/mkt.css +185 -0
- package/tenants/giantvapes/public/pages/page.css +155 -0
- package/tenants/giantvapes/public/themes/giant-navy.css +76 -0
- package/tenants/giantvapes/theme.json +39 -0
- package/tenants/home/content/chrome.json +11 -0
- package/tenants/home/content/home.html +304 -0
- package/tenants/home/content/home.json +13 -0
- package/tenants/home/public/js/storefront.js +210 -0
- package/tenants/home/public/logo-wordmark.png +0 -0
- package/tenants/home/public/pages/storefront.css +212 -0
- package/tenants/home/theme.json +6 -0
- package/tenants/tokenoftrust/.tot/config.json +9 -0
- package/tenants/tokenoftrust/content/chrome.json +55 -0
- package/tenants/tokenoftrust/content/home.html +723 -0
- package/tenants/tokenoftrust/content/home.json +233 -0
- package/tenants/tokenoftrust/content/pages-html/careers.html +231 -0
- package/tenants/tokenoftrust/content/pages-html/company.html +275 -0
- package/tenants/tokenoftrust/content/pages-html/contact/contact-sales.html +188 -0
- package/tenants/tokenoftrust/content/pages-html/contact/startup-apply.html +206 -0
- package/tenants/tokenoftrust/content/pages-html/contact.html +178 -0
- package/tenants/tokenoftrust/content/pages-html/industries/adult-content-age-verification.html +286 -0
- package/tenants/tokenoftrust/content/pages-html/industries/cannabis.html +277 -0
- package/tenants/tokenoftrust/content/pages-html/pact-act-pricing.html +289 -0
- package/tenants/tokenoftrust/content/pages-html/pricing.html +483 -0
- package/tenants/tokenoftrust/content/pages-html/product/age-assurance/age-estimation.html +278 -0
- package/tenants/tokenoftrust/content/pages-html/product/age-assurance/age-gate.html +279 -0
- package/tenants/tokenoftrust/content/pages-html/product/age-assurance/age-verification.html +265 -0
- package/tenants/tokenoftrust/content/pages-html/product/age-assurance.html +173 -0
- package/tenants/tokenoftrust/content/pages-html/product/compliance/aml.html +214 -0
- package/tenants/tokenoftrust/content/pages-html/product/compliance/pact-act.html +226 -0
- package/tenants/tokenoftrust/content/pages-html/product/fraud-prevention.html +254 -0
- package/tenants/tokenoftrust/content/pages-html/product/social-profile-verification.html +212 -0
- package/tenants/tokenoftrust/content/pages-html/product/tax/excise-tax.html +213 -0
- package/tenants/tokenoftrust/content/pages-html/product/verification/aml.html +259 -0
- package/tenants/tokenoftrust/content/pages-html/product/verification/biometric-selfie.html +305 -0
- package/tenants/tokenoftrust/content/pages-html/product/verification/coverage.html +254 -0
- package/tenants/tokenoftrust/content/pages-html/product/verification/document-verification.html +306 -0
- package/tenants/tokenoftrust/content/pages-html/product/verification/electronic-identity-verification.html +304 -0
- package/tenants/tokenoftrust/content/pages-html/product/verification/government-id-verification.html +308 -0
- package/tenants/tokenoftrust/content/pages-html/product/verification.html +183 -0
- package/tenants/tokenoftrust/content/pages-html/product.html +228 -0
- package/tenants/tokenoftrust/content/pages-html/resources/integrations/bigcommerce-integration.html +220 -0
- package/tenants/tokenoftrust/content/pages-html/resources/integrations/shopify-integration.html +221 -0
- package/tenants/tokenoftrust/content/pages-html/resources/integrations/wordpress.html +220 -0
- package/tenants/tokenoftrust/content/pages-html/resources/integrations.html +172 -0
- package/tenants/tokenoftrust/content/pages-html/resources/refer-a-friend-program.html +317 -0
- package/tenants/tokenoftrust/content/pages-html/resources.html +177 -0
- package/tenants/tokenoftrust/content/pages-html/reviews.html +273 -0
- package/tenants/tokenoftrust/content/pages-html/solutions.html +292 -0
- package/tenants/tokenoftrust/content/pages-html/vlp-alcohol.html +289 -0
- package/tenants/tokenoftrust/content/pages-html/vlp-cigars-and-tobacco.html +286 -0
- package/tenants/tokenoftrust/content/pages-html/vlp-firearm-accessories.html +267 -0
- package/tenants/tokenoftrust/content/pages-html/vlp-peptides.html +273 -0
- package/tenants/tokenoftrust/content/themes/tot-navy.json +88 -0
- package/tenants/tokenoftrust/public/favicon.png +0 -0
- package/tenants/tokenoftrust/public/logo-icon.png +0 -0
- package/tenants/tokenoftrust/public/logo-wordmark.png +0 -0
- package/tenants/tokenoftrust/public/pages/company.css +108 -0
- package/tenants/tokenoftrust/public/pages/home.css +457 -0
- package/tenants/tokenoftrust/public/pages/mkt.css +482 -0
- package/tenants/tokenoftrust/public/pages/pricing.css +214 -0
- package/tenants/tokenoftrust/public/pages/solutions.css +66 -0
- package/tenants/tokenoftrust/public/themes/tot-navy-1.0.0.css +136 -0
- package/tenants/tokenoftrust/public/themes/tot-navy.css +358 -0
- package/tenants/tokenoftrust/theme.json +31 -0
- package/tsconfig.base.json +20 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "408adb62-118e-4ad2-8e29-e30d1c924f04",
|
|
3
|
+
"prevId": "3667f8d8-a1ba-49ac-809a-c06004bad5d6",
|
|
4
|
+
"version": "6",
|
|
5
|
+
"dialect": "sqlite",
|
|
6
|
+
"tables": {
|
|
7
|
+
"collections": {
|
|
8
|
+
"name": "collections",
|
|
9
|
+
"columns": {
|
|
10
|
+
"handle": {
|
|
11
|
+
"name": "handle",
|
|
12
|
+
"type": "text",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": false
|
|
16
|
+
},
|
|
17
|
+
"title": {
|
|
18
|
+
"name": "title",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"position": {
|
|
25
|
+
"name": "position",
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": true,
|
|
29
|
+
"autoincrement": false,
|
|
30
|
+
"default": 99
|
|
31
|
+
},
|
|
32
|
+
"data": {
|
|
33
|
+
"name": "data",
|
|
34
|
+
"type": "text",
|
|
35
|
+
"primaryKey": false,
|
|
36
|
+
"notNull": true,
|
|
37
|
+
"autoincrement": false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"indexes": {},
|
|
41
|
+
"foreignKeys": {},
|
|
42
|
+
"compositePrimaryKeys": {},
|
|
43
|
+
"uniqueConstraints": {},
|
|
44
|
+
"checkConstraints": {}
|
|
45
|
+
},
|
|
46
|
+
"customization_pointers": {
|
|
47
|
+
"name": "customization_pointers",
|
|
48
|
+
"columns": {
|
|
49
|
+
"tenant_id": {
|
|
50
|
+
"name": "tenant_id",
|
|
51
|
+
"type": "text",
|
|
52
|
+
"primaryKey": true,
|
|
53
|
+
"notNull": true,
|
|
54
|
+
"autoincrement": false
|
|
55
|
+
},
|
|
56
|
+
"rev": {
|
|
57
|
+
"name": "rev",
|
|
58
|
+
"type": "integer",
|
|
59
|
+
"primaryKey": false,
|
|
60
|
+
"notNull": true,
|
|
61
|
+
"autoincrement": false
|
|
62
|
+
},
|
|
63
|
+
"live": {
|
|
64
|
+
"name": "live",
|
|
65
|
+
"type": "text",
|
|
66
|
+
"primaryKey": false,
|
|
67
|
+
"notNull": true,
|
|
68
|
+
"autoincrement": false
|
|
69
|
+
},
|
|
70
|
+
"test": {
|
|
71
|
+
"name": "test",
|
|
72
|
+
"type": "text",
|
|
73
|
+
"primaryKey": false,
|
|
74
|
+
"notNull": true,
|
|
75
|
+
"autoincrement": false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"indexes": {},
|
|
79
|
+
"foreignKeys": {},
|
|
80
|
+
"compositePrimaryKeys": {},
|
|
81
|
+
"uniqueConstraints": {},
|
|
82
|
+
"checkConstraints": {}
|
|
83
|
+
},
|
|
84
|
+
"customization_versions": {
|
|
85
|
+
"name": "customization_versions",
|
|
86
|
+
"columns": {
|
|
87
|
+
"tenant_id": {
|
|
88
|
+
"name": "tenant_id",
|
|
89
|
+
"type": "text",
|
|
90
|
+
"primaryKey": false,
|
|
91
|
+
"notNull": true,
|
|
92
|
+
"autoincrement": false
|
|
93
|
+
},
|
|
94
|
+
"path": {
|
|
95
|
+
"name": "path",
|
|
96
|
+
"type": "text",
|
|
97
|
+
"primaryKey": false,
|
|
98
|
+
"notNull": true,
|
|
99
|
+
"autoincrement": false
|
|
100
|
+
},
|
|
101
|
+
"version_id": {
|
|
102
|
+
"name": "version_id",
|
|
103
|
+
"type": "text",
|
|
104
|
+
"primaryKey": false,
|
|
105
|
+
"notNull": true,
|
|
106
|
+
"autoincrement": false
|
|
107
|
+
},
|
|
108
|
+
"size": {
|
|
109
|
+
"name": "size",
|
|
110
|
+
"type": "integer",
|
|
111
|
+
"primaryKey": false,
|
|
112
|
+
"notNull": true,
|
|
113
|
+
"autoincrement": false
|
|
114
|
+
},
|
|
115
|
+
"created_at": {
|
|
116
|
+
"name": "created_at",
|
|
117
|
+
"type": "text",
|
|
118
|
+
"primaryKey": false,
|
|
119
|
+
"notNull": true,
|
|
120
|
+
"autoincrement": false
|
|
121
|
+
},
|
|
122
|
+
"content": {
|
|
123
|
+
"name": "content",
|
|
124
|
+
"type": "text",
|
|
125
|
+
"primaryKey": false,
|
|
126
|
+
"notNull": true,
|
|
127
|
+
"autoincrement": false
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"indexes": {},
|
|
131
|
+
"foreignKeys": {},
|
|
132
|
+
"compositePrimaryKeys": {
|
|
133
|
+
"customization_versions_tenant_id_path_version_id_pk": {
|
|
134
|
+
"columns": [
|
|
135
|
+
"tenant_id",
|
|
136
|
+
"path",
|
|
137
|
+
"version_id"
|
|
138
|
+
],
|
|
139
|
+
"name": "customization_versions_tenant_id_path_version_id_pk"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"uniqueConstraints": {},
|
|
143
|
+
"checkConstraints": {}
|
|
144
|
+
},
|
|
145
|
+
"product_collections": {
|
|
146
|
+
"name": "product_collections",
|
|
147
|
+
"columns": {
|
|
148
|
+
"handle": {
|
|
149
|
+
"name": "handle",
|
|
150
|
+
"type": "text",
|
|
151
|
+
"primaryKey": false,
|
|
152
|
+
"notNull": true,
|
|
153
|
+
"autoincrement": false
|
|
154
|
+
},
|
|
155
|
+
"collection": {
|
|
156
|
+
"name": "collection",
|
|
157
|
+
"type": "text",
|
|
158
|
+
"primaryKey": false,
|
|
159
|
+
"notNull": true,
|
|
160
|
+
"autoincrement": false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"indexes": {
|
|
164
|
+
"idx_pc_collection": {
|
|
165
|
+
"name": "idx_pc_collection",
|
|
166
|
+
"columns": [
|
|
167
|
+
"collection"
|
|
168
|
+
],
|
|
169
|
+
"isUnique": false
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"foreignKeys": {},
|
|
173
|
+
"compositePrimaryKeys": {},
|
|
174
|
+
"uniqueConstraints": {},
|
|
175
|
+
"checkConstraints": {}
|
|
176
|
+
},
|
|
177
|
+
"product_facets": {
|
|
178
|
+
"name": "product_facets",
|
|
179
|
+
"columns": {
|
|
180
|
+
"handle": {
|
|
181
|
+
"name": "handle",
|
|
182
|
+
"type": "text",
|
|
183
|
+
"primaryKey": false,
|
|
184
|
+
"notNull": true,
|
|
185
|
+
"autoincrement": false
|
|
186
|
+
},
|
|
187
|
+
"name": {
|
|
188
|
+
"name": "name",
|
|
189
|
+
"type": "text",
|
|
190
|
+
"primaryKey": false,
|
|
191
|
+
"notNull": true,
|
|
192
|
+
"autoincrement": false
|
|
193
|
+
},
|
|
194
|
+
"value": {
|
|
195
|
+
"name": "value",
|
|
196
|
+
"type": "text",
|
|
197
|
+
"primaryKey": false,
|
|
198
|
+
"notNull": true,
|
|
199
|
+
"autoincrement": false
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"indexes": {
|
|
203
|
+
"idx_pf_name": {
|
|
204
|
+
"name": "idx_pf_name",
|
|
205
|
+
"columns": [
|
|
206
|
+
"name",
|
|
207
|
+
"value"
|
|
208
|
+
],
|
|
209
|
+
"isUnique": false
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"foreignKeys": {},
|
|
213
|
+
"compositePrimaryKeys": {},
|
|
214
|
+
"uniqueConstraints": {},
|
|
215
|
+
"checkConstraints": {}
|
|
216
|
+
},
|
|
217
|
+
"products": {
|
|
218
|
+
"name": "products",
|
|
219
|
+
"columns": {
|
|
220
|
+
"handle": {
|
|
221
|
+
"name": "handle",
|
|
222
|
+
"type": "text",
|
|
223
|
+
"primaryKey": true,
|
|
224
|
+
"notNull": true,
|
|
225
|
+
"autoincrement": false
|
|
226
|
+
},
|
|
227
|
+
"title": {
|
|
228
|
+
"name": "title",
|
|
229
|
+
"type": "text",
|
|
230
|
+
"primaryKey": false,
|
|
231
|
+
"notNull": true,
|
|
232
|
+
"autoincrement": false
|
|
233
|
+
},
|
|
234
|
+
"vendor": {
|
|
235
|
+
"name": "vendor",
|
|
236
|
+
"type": "text",
|
|
237
|
+
"primaryKey": false,
|
|
238
|
+
"notNull": false,
|
|
239
|
+
"autoincrement": false
|
|
240
|
+
},
|
|
241
|
+
"product_type": {
|
|
242
|
+
"name": "product_type",
|
|
243
|
+
"type": "text",
|
|
244
|
+
"primaryKey": false,
|
|
245
|
+
"notNull": false,
|
|
246
|
+
"autoincrement": false
|
|
247
|
+
},
|
|
248
|
+
"tags": {
|
|
249
|
+
"name": "tags",
|
|
250
|
+
"type": "text",
|
|
251
|
+
"primaryKey": false,
|
|
252
|
+
"notNull": true,
|
|
253
|
+
"autoincrement": false,
|
|
254
|
+
"default": "'[]'"
|
|
255
|
+
},
|
|
256
|
+
"description_text": {
|
|
257
|
+
"name": "description_text",
|
|
258
|
+
"type": "text",
|
|
259
|
+
"primaryKey": false,
|
|
260
|
+
"notNull": true,
|
|
261
|
+
"autoincrement": false,
|
|
262
|
+
"default": "''"
|
|
263
|
+
},
|
|
264
|
+
"price_min": {
|
|
265
|
+
"name": "price_min",
|
|
266
|
+
"type": "real",
|
|
267
|
+
"primaryKey": false,
|
|
268
|
+
"notNull": true,
|
|
269
|
+
"autoincrement": false
|
|
270
|
+
},
|
|
271
|
+
"price_max": {
|
|
272
|
+
"name": "price_max",
|
|
273
|
+
"type": "real",
|
|
274
|
+
"primaryKey": false,
|
|
275
|
+
"notNull": true,
|
|
276
|
+
"autoincrement": false
|
|
277
|
+
},
|
|
278
|
+
"currency": {
|
|
279
|
+
"name": "currency",
|
|
280
|
+
"type": "text",
|
|
281
|
+
"primaryKey": false,
|
|
282
|
+
"notNull": true,
|
|
283
|
+
"autoincrement": false
|
|
284
|
+
},
|
|
285
|
+
"image": {
|
|
286
|
+
"name": "image",
|
|
287
|
+
"type": "text",
|
|
288
|
+
"primaryKey": false,
|
|
289
|
+
"notNull": false,
|
|
290
|
+
"autoincrement": false
|
|
291
|
+
},
|
|
292
|
+
"available": {
|
|
293
|
+
"name": "available",
|
|
294
|
+
"type": "integer",
|
|
295
|
+
"primaryKey": false,
|
|
296
|
+
"notNull": true,
|
|
297
|
+
"autoincrement": false,
|
|
298
|
+
"default": 0
|
|
299
|
+
},
|
|
300
|
+
"status": {
|
|
301
|
+
"name": "status",
|
|
302
|
+
"type": "text",
|
|
303
|
+
"primaryKey": false,
|
|
304
|
+
"notNull": true,
|
|
305
|
+
"autoincrement": false
|
|
306
|
+
},
|
|
307
|
+
"position": {
|
|
308
|
+
"name": "position",
|
|
309
|
+
"type": "integer",
|
|
310
|
+
"primaryKey": false,
|
|
311
|
+
"notNull": true,
|
|
312
|
+
"autoincrement": false,
|
|
313
|
+
"default": 0
|
|
314
|
+
},
|
|
315
|
+
"created_at": {
|
|
316
|
+
"name": "created_at",
|
|
317
|
+
"type": "text",
|
|
318
|
+
"primaryKey": false,
|
|
319
|
+
"notNull": false,
|
|
320
|
+
"autoincrement": false
|
|
321
|
+
},
|
|
322
|
+
"data": {
|
|
323
|
+
"name": "data",
|
|
324
|
+
"type": "text",
|
|
325
|
+
"primaryKey": false,
|
|
326
|
+
"notNull": true,
|
|
327
|
+
"autoincrement": false
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
"indexes": {},
|
|
331
|
+
"foreignKeys": {},
|
|
332
|
+
"compositePrimaryKeys": {},
|
|
333
|
+
"uniqueConstraints": {},
|
|
334
|
+
"checkConstraints": {}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"views": {},
|
|
338
|
+
"enums": {},
|
|
339
|
+
"_meta": {
|
|
340
|
+
"columns": {},
|
|
341
|
+
"schemas": {},
|
|
342
|
+
"tables": {}
|
|
343
|
+
},
|
|
344
|
+
"internal": {
|
|
345
|
+
"indexes": {}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"idx": 0,
|
|
7
|
+
"version": "6",
|
|
8
|
+
"when": 1782682889991,
|
|
9
|
+
"tag": "0000_baseline",
|
|
10
|
+
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "6",
|
|
15
|
+
"when": 1782682914716,
|
|
16
|
+
"tag": "0001_products_fts",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tot/storefront-runner",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Token of Trust storefront RUNNER — source-available multi-tenant renderer (control plane carved out).",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"copy-tenant-assets": "node ../../scripts/build/copy-tenant-assets.mjs",
|
|
9
|
+
"predev": "node ../../scripts/build/copy-tenant-assets.mjs",
|
|
10
|
+
"dev": "astro dev",
|
|
11
|
+
"start": "astro dev",
|
|
12
|
+
"prebuild": "node ../../scripts/build/copy-tenant-assets.mjs",
|
|
13
|
+
"build": "astro build",
|
|
14
|
+
"preview": "wrangler dev ./dist/_worker.js/index.js",
|
|
15
|
+
"typecheck": "astro check && tsc --noEmit",
|
|
16
|
+
"astro": "astro",
|
|
17
|
+
"test": "NODE_OPTIONS=--experimental-sqlite vitest run"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@astrojs/cloudflare": "^14.0.1",
|
|
21
|
+
"@astrojs/preact": "^6.0.0",
|
|
22
|
+
"@storyblok/astro": "^10.0.0",
|
|
23
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
24
|
+
"@tot/public-runtime": "workspace:*",
|
|
25
|
+
"astro": "^7.0.3",
|
|
26
|
+
"fuse.js": "^7.4.2",
|
|
27
|
+
"jose": "^6.2.3",
|
|
28
|
+
"preact": "^10.29.2",
|
|
29
|
+
"tailwindcss": "^4.3.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@astrojs/check": "^0.9.4",
|
|
33
|
+
"dependency-cruiser": "^18.0.0",
|
|
34
|
+
"drizzle-kit": "^0.31.10",
|
|
35
|
+
"drizzle-orm": "^0.45.2",
|
|
36
|
+
"typescript": "^5.6.3",
|
|
37
|
+
"vitest": "2.1.8",
|
|
38
|
+
"wrangler": "^4.105.0"
|
|
39
|
+
},
|
|
40
|
+
"license": "SEE LICENSE IN LICENSE"
|
|
41
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="180" height="32" viewBox="0 0 180 32">
|
|
2
|
+
<text x="0" y="25" font-family="Space Grotesk, system-ui, sans-serif" font-size="26" font-weight="700" fill="#1C2624" letter-spacing="-1">Northwind</text>
|
|
3
|
+
<circle cx="170" cy="8" r="4" fill="#B5612F"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="180" height="32" viewBox="0 0 180 32">
|
|
2
|
+
<text x="0" y="25" font-family="Space Grotesk, system-ui, sans-serif" font-size="26" font-weight="700" fill="#F4F1EA" letter-spacing="-1">Northwind</text>
|
|
3
|
+
<circle cx="170" cy="8" r="4" fill="#B5612F"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630" viewBox="0 0 1200 630">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#1F3A34"/>
|
|
5
|
+
<stop offset="100%" stop-color="#16241F"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="1200" height="630" fill="url(#bg)"/>
|
|
9
|
+
<text x="80" y="300" font-family="Space Grotesk, system-ui, sans-serif" font-size="118" font-weight="700" fill="#F4F1EA" letter-spacing="-3">Northwind</text>
|
|
10
|
+
<text x="84" y="380" font-family="Space Grotesk, system-ui, sans-serif" font-size="118" font-weight="700" fill="#B5612F" letter-spacing="-3">grey season.</text>
|
|
11
|
+
<text x="84" y="470" font-family="ui-monospace, monospace" font-size="26" fill="#F4F1EA" opacity="0.7" letter-spacing="4">CONSIDERED APPAREL & HOME GOODS</text>
|
|
12
|
+
<circle cx="1090" cy="120" r="14" fill="#B5612F"/>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
2
|
+
<rect width="32" height="32" rx="6" fill="#1F3A34"/>
|
|
3
|
+
<path d="M9 23V9h2.4l9.2 10.2V9H23v14h-2.4L11.4 12.8V23H9z" fill="#F4F1EA"/>
|
|
4
|
+
<circle cx="24" cy="9" r="2" fill="#B5612F"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client behavior for /dashboard/<appDomain>/team (#8425 Stage 0).
|
|
3
|
+
*
|
|
4
|
+
* Served as a STATIC same-origin file (public/) and referenced via
|
|
5
|
+
* <script src="/js/dashboard-team.js">, so the strict production CSP allows it via
|
|
6
|
+
* `script-src 'self'` — no nonce, no per-build hash. (An inline <script> here is
|
|
7
|
+
* blocked: Astro's `is:inline` drops the templated nonce, and a processed inline
|
|
8
|
+
* script needs its content-hash pinned in cspStaticHashes on every change. An
|
|
9
|
+
* external 'self' file avoids both.)
|
|
10
|
+
*
|
|
11
|
+
* The tenant appDomain is read from the members-table `data-tenant` attribute (no
|
|
12
|
+
* server-injected values), so this file is fully static.
|
|
13
|
+
*/
|
|
14
|
+
(function () {
|
|
15
|
+
const $ = (id) => document.getElementById(id);
|
|
16
|
+
const membersBody = $("members");
|
|
17
|
+
if (!membersBody) return;
|
|
18
|
+
const tenant = membersBody.dataset.tenant;
|
|
19
|
+
|
|
20
|
+
function renderMembers(members) {
|
|
21
|
+
membersBody.replaceChildren();
|
|
22
|
+
if (!members || !members.length) {
|
|
23
|
+
const tr = document.createElement("tr");
|
|
24
|
+
const td = document.createElement("td");
|
|
25
|
+
td.colSpan = 3; td.className = "muted";
|
|
26
|
+
td.textContent = "No developers invited yet.";
|
|
27
|
+
tr.appendChild(td); membersBody.appendChild(tr);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
for (const m of members) {
|
|
31
|
+
const tr = document.createElement("tr");
|
|
32
|
+
const dev = document.createElement("td");
|
|
33
|
+
dev.textContent = m.developer;
|
|
34
|
+
const roles = document.createElement("td");
|
|
35
|
+
roles.textContent = (m.roles || []).join(", ") || "developer";
|
|
36
|
+
const act = document.createElement("td");
|
|
37
|
+
act.className = "act";
|
|
38
|
+
const btn = document.createElement("button");
|
|
39
|
+
btn.type = "button";
|
|
40
|
+
btn.className = "rowbtn";
|
|
41
|
+
btn.textContent = "Resend invite";
|
|
42
|
+
btn.title = "Re-send the sign-in email to " + m.developer;
|
|
43
|
+
btn.addEventListener("click", () => resend(m.developer, btn));
|
|
44
|
+
act.appendChild(btn);
|
|
45
|
+
tr.appendChild(dev); tr.appendChild(roles); tr.appendChild(act);
|
|
46
|
+
membersBody.appendChild(tr);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function resend(email, btn) {
|
|
51
|
+
if (btn) btn.disabled = true;
|
|
52
|
+
showMsg("", "Re-sending the sign-in email to " + email + "…");
|
|
53
|
+
try {
|
|
54
|
+
const res = await fetch("/api/grants/team-invite", {
|
|
55
|
+
method: "POST",
|
|
56
|
+
headers: { "content-type": "application/json", accept: "application/json" },
|
|
57
|
+
body: JSON.stringify({ tenant, email }),
|
|
58
|
+
});
|
|
59
|
+
const body = await res.json().catch(() => ({}));
|
|
60
|
+
if (res.ok) {
|
|
61
|
+
showMsg("ok", "Re-sent the sign-in email to " + (body.developer || email) + ".");
|
|
62
|
+
} else {
|
|
63
|
+
showMsg("err", body.error || ("Couldn't resend (HTTP " + res.status + ")."));
|
|
64
|
+
}
|
|
65
|
+
} catch (e) {
|
|
66
|
+
showMsg("err", "Couldn't resend: " + (e && e.message ? e.message : e));
|
|
67
|
+
} finally {
|
|
68
|
+
if (btn) btn.disabled = false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function renderError(msg) {
|
|
73
|
+
membersBody.replaceChildren();
|
|
74
|
+
const tr = document.createElement("tr");
|
|
75
|
+
const td = document.createElement("td");
|
|
76
|
+
td.colSpan = 2; td.className = "muted";
|
|
77
|
+
td.textContent = msg;
|
|
78
|
+
tr.appendChild(td); membersBody.appendChild(tr);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function loadMembers() {
|
|
82
|
+
try {
|
|
83
|
+
const res = await fetch("/api/grants/team-members?tenant=" + encodeURIComponent(tenant), {
|
|
84
|
+
headers: { accept: "application/json" },
|
|
85
|
+
});
|
|
86
|
+
const body = await res.json().catch(() => ({}));
|
|
87
|
+
if (res.ok) renderMembers(body.members);
|
|
88
|
+
else renderError(body.error || ("Couldn't load members (HTTP " + res.status + ")."));
|
|
89
|
+
} catch (e) {
|
|
90
|
+
renderError("Couldn't load members: " + (e && e.message ? e.message : e));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function showMsg(kind, text) {
|
|
95
|
+
const el = $("msg");
|
|
96
|
+
el.className = "msg " + kind;
|
|
97
|
+
el.textContent = text;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function invite() {
|
|
101
|
+
const email = $("email").value.trim();
|
|
102
|
+
if (!email) { showMsg("err", "Enter a developer email."); return; }
|
|
103
|
+
const btn = $("inviteBtn");
|
|
104
|
+
btn.disabled = true;
|
|
105
|
+
showMsg("", "Sending…");
|
|
106
|
+
try {
|
|
107
|
+
// The role selector is present only for ToT staff (#8453); members are
|
|
108
|
+
// developer-only. tot20 ignores a non-staff role, so sending it is harmless.
|
|
109
|
+
const roleEl = $("role");
|
|
110
|
+
const role = roleEl && roleEl.value ? roleEl.value : undefined;
|
|
111
|
+
const noteEl = $("note");
|
|
112
|
+
const note = noteEl && noteEl.value.trim() ? noteEl.value.trim() : undefined;
|
|
113
|
+
const payload = { tenant, email };
|
|
114
|
+
if (role) payload.role = role;
|
|
115
|
+
if (note) payload.note = note;
|
|
116
|
+
const res = await fetch("/api/grants/team-invite", {
|
|
117
|
+
method: "POST",
|
|
118
|
+
headers: { "content-type": "application/json", accept: "application/json" },
|
|
119
|
+
body: JSON.stringify(payload),
|
|
120
|
+
});
|
|
121
|
+
const body = await res.json().catch(() => ({}));
|
|
122
|
+
if (res.ok) {
|
|
123
|
+
const already = body.changed === false;
|
|
124
|
+
showMsg("ok", (already ? "Already a developer — re-sent the sign-in email to " : "Invited ") + (body.developer || email) + ".");
|
|
125
|
+
$("email").value = "";
|
|
126
|
+
if (noteEl) noteEl.value = "";
|
|
127
|
+
loadMembers();
|
|
128
|
+
} else {
|
|
129
|
+
showMsg("err", body.error || ("Invite failed (HTTP " + res.status + ")."));
|
|
130
|
+
}
|
|
131
|
+
} catch (e) {
|
|
132
|
+
showMsg("err", "Invite failed: " + (e && e.message ? e.message : e));
|
|
133
|
+
} finally {
|
|
134
|
+
btn.disabled = false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// The invite form now shows for members AND ToT staff (#8453), but wire the invite
|
|
139
|
+
// handlers only when the form is present (defensive). The members list always loads.
|
|
140
|
+
const inviteBtn = $("inviteBtn");
|
|
141
|
+
const emailInput = $("email");
|
|
142
|
+
if (inviteBtn && emailInput) {
|
|
143
|
+
inviteBtn.addEventListener("click", invite);
|
|
144
|
+
emailInput.addEventListener("keydown", (e) => { if (e.key === "Enter") invite(); });
|
|
145
|
+
}
|
|
146
|
+
loadMembers();
|
|
147
|
+
})();
|