@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.
Files changed (337) hide show
  1. package/LICENSE +58 -0
  2. package/README.md +40 -0
  3. package/apps/storefront/.dev.vars.example +41 -0
  4. package/apps/storefront/.env.example +24 -0
  5. package/apps/storefront/astro.config.mjs +245 -0
  6. package/apps/storefront/env.d.ts +155 -0
  7. package/apps/storefront/lib/ensure-preview-reconcile-secret.sh +31 -0
  8. package/apps/storefront/lib/resolve-cf-token.sh +48 -0
  9. package/apps/storefront/lib/resolve-tot-credentials.sh +69 -0
  10. package/apps/storefront/migrations/0000_baseline.sql +54 -0
  11. package/apps/storefront/migrations/0001_products_fts.sql +9 -0
  12. package/apps/storefront/migrations/README.md +54 -0
  13. package/apps/storefront/migrations/meta/0000_snapshot.json +347 -0
  14. package/apps/storefront/migrations/meta/0001_snapshot.json +347 -0
  15. package/apps/storefront/migrations/meta/_journal.json +20 -0
  16. package/apps/storefront/package.json +41 -0
  17. package/apps/storefront/public/brand/northwind-logo-dark.svg +4 -0
  18. package/apps/storefront/public/brand/northwind-logo-light.svg +4 -0
  19. package/apps/storefront/public/brand/northwind-og.svg +13 -0
  20. package/apps/storefront/public/favicon.svg +5 -0
  21. package/apps/storefront/public/js/dashboard-team.js +147 -0
  22. package/apps/storefront/public/js/dashboard-vendor-search.js +115 -0
  23. package/apps/storefront/src/components/Badge.astro +34 -0
  24. package/apps/storefront/src/components/Breadcrumbs.astro +45 -0
  25. package/apps/storefront/src/components/CollectionCard.astro +56 -0
  26. package/apps/storefront/src/components/EmptyState.astro +35 -0
  27. package/apps/storefront/src/components/Img.astro +68 -0
  28. package/apps/storefront/src/components/ProductCard.astro +228 -0
  29. package/apps/storefront/src/components/Section.astro +39 -0
  30. package/apps/storefront/src/components/Seo.astro +70 -0
  31. package/apps/storefront/src/components/WidgetFrame.astro +34 -0
  32. package/apps/storefront/src/components/auth/AuthBadge.astro +44 -0
  33. package/apps/storefront/src/components/chrome/AnnouncementBar.astro +108 -0
  34. package/apps/storefront/src/components/chrome/MegaMenu.astro +26 -0
  35. package/apps/storefront/src/components/chrome/NavDropdown.astro +116 -0
  36. package/apps/storefront/src/components/chrome/SiteFooter.astro +181 -0
  37. package/apps/storefront/src/components/chrome/SiteHeader.astro +181 -0
  38. package/apps/storefront/src/components/chrome/UtilityNav.astro +79 -0
  39. package/apps/storefront/src/components/commerce/FoxyLoader.astro +23 -0
  40. package/apps/storefront/src/components/commerce/PriceDisplay.astro +91 -0
  41. package/apps/storefront/src/components/commerce/ProductCarousel.astro +197 -0
  42. package/apps/storefront/src/components/commerce/ProductGrid.astro +75 -0
  43. package/apps/storefront/src/components/commerce/RatingStars.astro +58 -0
  44. package/apps/storefront/src/components/compliance/NicotineWarning.astro +33 -0
  45. package/apps/storefront/src/components/home/Hero.astro +164 -0
  46. package/apps/storefront/src/components/islands/AgeGate.tsx +105 -0
  47. package/apps/storefront/src/components/islands/ImageGallery.tsx +237 -0
  48. package/apps/storefront/src/components/islands/IsolatedAgeGate.tsx +73 -0
  49. package/apps/storefront/src/components/islands/MobileNav.tsx +239 -0
  50. package/apps/storefront/src/components/islands/QuickView.tsx +138 -0
  51. package/apps/storefront/src/components/islands/RecentlyViewed.tsx +122 -0
  52. package/apps/storefront/src/components/islands/SavedList.tsx +99 -0
  53. package/apps/storefront/src/components/islands/SearchTypeahead.tsx +248 -0
  54. package/apps/storefront/src/components/islands/VariantSelector.tsx +378 -0
  55. package/apps/storefront/src/components/marketing/CardGrid.astro +72 -0
  56. package/apps/storefront/src/components/marketing/CodeSample.astro +20 -0
  57. package/apps/storefront/src/components/marketing/CtaBand.astro +24 -0
  58. package/apps/storefront/src/components/marketing/Faq.astro +37 -0
  59. package/apps/storefront/src/components/marketing/Integrations.astro +63 -0
  60. package/apps/storefront/src/components/marketing/MarketingBlocks.astro +53 -0
  61. package/apps/storefront/src/components/marketing/MarketingCtas.astro +48 -0
  62. package/apps/storefront/src/components/marketing/MarketingHero.astro +72 -0
  63. package/apps/storefront/src/components/marketing/ProofStrip.astro +37 -0
  64. package/apps/storefront/src/components/marketing/SplitCompare.astro +53 -0
  65. package/apps/storefront/src/components/marketing/Steps.astro +36 -0
  66. package/apps/storefront/src/components/marketing/Testimonials.astro +38 -0
  67. package/apps/storefront/src/components/marketing/TrustBar.astro +22 -0
  68. package/apps/storefront/src/components/nav/Footer.astro +148 -0
  69. package/apps/storefront/src/components/nav/Header.astro +190 -0
  70. package/apps/storefront/src/components/plp/ActiveFilters.astro +79 -0
  71. package/apps/storefront/src/components/plp/FacetSidebar.astro +146 -0
  72. package/apps/storefront/src/components/plp/Pagination.astro +99 -0
  73. package/apps/storefront/src/components/plp/SortSelect.astro +64 -0
  74. package/apps/storefront/src/config/devTenants.ts +16 -0
  75. package/apps/storefront/src/config/kvTenantResolver.ts +87 -0
  76. package/apps/storefront/src/config/resolver.ts +46 -0
  77. package/apps/storefront/src/config/tenants.ts +193 -0
  78. package/apps/storefront/src/layouts/Layout.astro +303 -0
  79. package/apps/storefront/src/lib/analytics/index.ts +47 -0
  80. package/apps/storefront/src/lib/auth/brokerAssertion.ts +136 -0
  81. package/apps/storefront/src/lib/auth/devAuth.ts +90 -0
  82. package/apps/storefront/src/lib/auth/gatePage.ts +81 -0
  83. package/apps/storefront/src/lib/auth/identityToken.ts +341 -0
  84. package/apps/storefront/src/lib/auth/loginGate.ts +107 -0
  85. package/apps/storefront/src/lib/auth/route.ts +146 -0
  86. package/apps/storefront/src/lib/auth/session.ts +203 -0
  87. package/apps/storefront/src/lib/auth/totAccessClient.ts +503 -0
  88. package/apps/storefront/src/lib/basePath.ts +41 -0
  89. package/apps/storefront/src/lib/cfImage.ts +55 -0
  90. package/apps/storefront/src/lib/chrome/model.ts +65 -0
  91. package/apps/storefront/src/lib/colors.ts +97 -0
  92. package/apps/storefront/src/lib/content-edit/client.ts +230 -0
  93. package/apps/storefront/src/lib/content-edit/index.ts +14 -0
  94. package/apps/storefront/src/lib/content-edit/route.ts +25 -0
  95. package/apps/storefront/src/lib/content-edit/types.ts +19 -0
  96. package/apps/storefront/src/lib/cspStaticHashes.ts +24 -0
  97. package/apps/storefront/src/lib/d1/catalog.ts +289 -0
  98. package/apps/storefront/src/lib/dashboard/staffAdmission.ts +43 -0
  99. package/apps/storefront/src/lib/dashboard/staffVendorAccess.ts +449 -0
  100. package/apps/storefront/src/lib/dashboard/tenantSelection.ts +136 -0
  101. package/apps/storefront/src/lib/dashboard/vendorQuery.ts +61 -0
  102. package/apps/storefront/src/lib/demoGate.ts +113 -0
  103. package/apps/storefront/src/lib/dev/ai-widget-client.js +127 -0
  104. package/apps/storefront/src/lib/dev/cliSignInCode.ts +132 -0
  105. package/apps/storefront/src/lib/diag/redact.ts +20 -0
  106. package/apps/storefront/src/lib/edgeCache.ts +128 -0
  107. package/apps/storefront/src/lib/email/magicLinkInviteEmail.ts +62 -0
  108. package/apps/storefront/src/lib/env.ts +60 -0
  109. package/apps/storefront/src/lib/fixtures/sampleProducts.ts +130 -0
  110. package/apps/storefront/src/lib/format.ts +29 -0
  111. package/apps/storefront/src/lib/foxyCommerce.ts +49 -0
  112. package/apps/storefront/src/lib/imageAttrs.ts +55 -0
  113. package/apps/storefront/src/lib/jsonld.ts +136 -0
  114. package/apps/storefront/src/lib/maintenance.ts +71 -0
  115. package/apps/storefront/src/lib/memoryKv.ts +32 -0
  116. package/apps/storefront/src/lib/messaging/messagesClient.ts +143 -0
  117. package/apps/storefront/src/lib/placeholder.ts +99 -0
  118. package/apps/storefront/src/lib/previewReload.ts +125 -0
  119. package/apps/storefront/src/lib/rawMarketingHtml.ts +133 -0
  120. package/apps/storefront/src/lib/search/index.ts +74 -0
  121. package/apps/storefront/src/lib/sections.ts +129 -0
  122. package/apps/storefront/src/lib/securityHeaders.ts +31 -0
  123. package/apps/storefront/src/lib/storyblok/content-model.ts +289 -0
  124. package/apps/storefront/src/lib/storyblok/provider.ts +524 -0
  125. package/apps/storefront/src/lib/tenantRouting.ts +91 -0
  126. package/apps/storefront/src/lib/tot/ToTClient.ts +177 -0
  127. package/apps/storefront/src/lib/tot/d1Client.ts +62 -0
  128. package/apps/storefront/src/lib/tot/query.ts +187 -0
  129. package/apps/storefront/src/lib/tot/totClientInterface.ts +30 -0
  130. package/apps/storefront/src/lib/url.ts +119 -0
  131. package/apps/storefront/src/lib/wishlist.ts +63 -0
  132. package/apps/storefront/src/middleware/index.ts +413 -0
  133. package/apps/storefront/src/pages/404.astro +61 -0
  134. package/apps/storefront/src/pages/[...slug].astro +90 -0
  135. package/apps/storefront/src/pages/api/auth/logout.ts +21 -0
  136. package/apps/storefront/src/pages/api/auth/magic-exchange.ts +107 -0
  137. package/apps/storefront/src/pages/api/auth/send.ts +85 -0
  138. package/apps/storefront/src/pages/api/auth/verify.ts +135 -0
  139. package/apps/storefront/src/pages/api/cache-purge.ts +44 -0
  140. package/apps/storefront/src/pages/api/content-edit/ai-edit.ts +64 -0
  141. package/apps/storefront/src/pages/api/csp-report.ts +25 -0
  142. package/apps/storefront/src/pages/api/dashboard/enter-vendor.ts +124 -0
  143. package/apps/storefront/src/pages/api/dashboard/vendor-search.ts +120 -0
  144. package/apps/storefront/src/pages/api/dev/cli-signin-code.ts +44 -0
  145. package/apps/storefront/src/pages/api/newsletter.ts +104 -0
  146. package/apps/storefront/src/pages/api/request-access.ts +172 -0
  147. package/apps/storefront/src/pages/auth/login.astro +149 -0
  148. package/apps/storefront/src/pages/auth/magic.astro +105 -0
  149. package/apps/storefront/src/pages/capabilities.astro +292 -0
  150. package/apps/storefront/src/pages/collections/[handle].astro +154 -0
  151. package/apps/storefront/src/pages/collections/index.astro +59 -0
  152. package/apps/storefront/src/pages/dashboard/[appDomain]/index.astro +100 -0
  153. package/apps/storefront/src/pages/dashboard/[appDomain]/team.astro +154 -0
  154. package/apps/storefront/src/pages/dashboard/index.astro +160 -0
  155. package/apps/storefront/src/pages/dev.astro +653 -0
  156. package/apps/storefront/src/pages/index.astro +290 -0
  157. package/apps/storefront/src/pages/llms.txt.ts +92 -0
  158. package/apps/storefront/src/pages/products/[handle].astro +443 -0
  159. package/apps/storefront/src/pages/robots.txt.ts +24 -0
  160. package/apps/storefront/src/pages/saved.astro +35 -0
  161. package/apps/storefront/src/pages/search.astro +150 -0
  162. package/apps/storefront/src/pages/sitemap.xml.ts +78 -0
  163. package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +646 -0
  164. package/apps/storefront/src/pages/style-guide/[tenant]/index.astro +85 -0
  165. package/apps/storefront/src/pages/style-guide/index.astro +94 -0
  166. package/apps/storefront/src/pages/tenants/[id]/[...path].ts +57 -0
  167. package/apps/storefront/src/styles/global.css +277 -0
  168. package/apps/storefront/src/themes/reference.ts +61 -0
  169. package/apps/storefront/src/themes/schema.ts +111 -0
  170. package/apps/storefront/src/themes/tenants/index.ts +51 -0
  171. package/apps/storefront/tsconfig.json +16 -0
  172. package/apps/storefront/vitest.config.ts +22 -0
  173. package/apps/storefront/wrangler.toml +175 -0
  174. package/package.json +23 -0
  175. package/packages/public-runtime/LICENSE +58 -0
  176. package/packages/public-runtime/package.json +22 -0
  177. package/packages/public-runtime/src/binary-path.ts +68 -0
  178. package/packages/public-runtime/src/capabilities.ts +89 -0
  179. package/packages/public-runtime/src/catalog-api.ts +81 -0
  180. package/packages/public-runtime/src/catalog-d1.ts +192 -0
  181. package/packages/public-runtime/src/csp.ts +109 -0
  182. package/packages/public-runtime/src/customization-preview.ts +197 -0
  183. package/packages/public-runtime/src/customization-reconcile.ts +63 -0
  184. package/packages/public-runtime/src/customization-runtime.ts +157 -0
  185. package/packages/public-runtime/src/customization-scripts.ts +64 -0
  186. package/packages/public-runtime/src/customization-versioning.ts +95 -0
  187. package/packages/public-runtime/src/foxy.ts +184 -0
  188. package/packages/public-runtime/src/index.ts +30 -0
  189. package/packages/public-runtime/src/product.ts +159 -0
  190. package/packages/public-runtime/src/search.ts +45 -0
  191. package/packages/public-runtime/src/tenant-assets.ts +444 -0
  192. package/packages/public-runtime/src/tenant.ts +243 -0
  193. package/packages/public-runtime/tsconfig.json +8 -0
  194. package/packages/public-runtime/vitest.config.ts +8 -0
  195. package/pnpm-workspace.yaml +7 -0
  196. package/scripts/build/copy-tenant-assets.mjs +69 -0
  197. package/scripts/tot-dev.mjs +439 -0
  198. package/tenants/bigdvapor/content/blog.json +52 -0
  199. package/tenants/bigdvapor/content/chrome.html +149 -0
  200. package/tenants/bigdvapor/content/chrome.json +47 -0
  201. package/tenants/bigdvapor/content/home.html +463 -0
  202. package/tenants/bigdvapor/content/home.json +73 -0
  203. package/tenants/bigdvapor/content/pages/about.json +5 -0
  204. package/tenants/bigdvapor/content/pages/privacy.json +6 -0
  205. package/tenants/bigdvapor/content/pages/shipping-returns.json +6 -0
  206. package/tenants/bigdvapor/content/pages-html/blogs/news.html +86 -0
  207. package/tenants/bigdvapor/content/pages-html/pages/about-us.html +106 -0
  208. package/tenants/bigdvapor/content/pages-html/pages/contact-us.html +61 -0
  209. package/tenants/bigdvapor/content/pages-html/pages/privacy-policy.html +72 -0
  210. package/tenants/bigdvapor/content/pages-html/pages/shipping-returns.html +172 -0
  211. package/tenants/bigdvapor/content/themes/bigd-navy.json +109 -0
  212. package/tenants/bigdvapor/public/img/brands/adjust-vape-disposable.png +0 -0
  213. package/tenants/bigdvapor/public/img/brands/again-vape-disposable.png +0 -0
  214. package/tenants/bigdvapor/public/img/brands/al-fakher-vape-disposable.png +0 -0
  215. package/tenants/bigdvapor/public/img/brands/arro-vape-disposable.png +0 -0
  216. package/tenants/bigdvapor/public/img/brands/cookies-vape-disposable.png +0 -0
  217. package/tenants/bigdvapor/public/img/brands/core-vape-disposable.png +0 -0
  218. package/tenants/bigdvapor/public/img/brands/cyclone-vape-disposable.png +0 -0
  219. package/tenants/bigdvapor/public/img/brands/dinner-lady-vape-disposable.png +0 -0
  220. package/tenants/bigdvapor/public/img/brands/extre-bar-vape-disposable.png +0 -0
  221. package/tenants/bigdvapor/public/img/brands/fifty-bar-vape-disposable.jpg +0 -0
  222. package/tenants/bigdvapor/public/img/brands/firerose-vape-disposable.jpg +0 -0
  223. package/tenants/bigdvapor/public/img/brands/flavor-beast-vape-disposable.jpg +0 -0
  224. package/tenants/bigdvapor/public/img/brands/foger-vape-disposable.png +0 -0
  225. package/tenants/bigdvapor/public/img/brands/kk-energy-vape-disposable.png +0 -0
  226. package/tenants/bigdvapor/public/img/brands/kumi-vape-disposable.png +0 -0
  227. package/tenants/bigdvapor/public/img/brands/lost-vape-dispoable.png +0 -0
  228. package/tenants/bigdvapor/public/img/brands/melo-labs-vape-disposable.png +0 -0
  229. package/tenants/bigdvapor/public/img/brands/mixo-vape-disposable.webp +0 -0
  230. package/tenants/bigdvapor/public/img/brands/one-tank-vape-disposable.jpg +0 -0
  231. package/tenants/bigdvapor/public/img/brands/oxbar-vape-disposable.webp +0 -0
  232. package/tenants/bigdvapor/public/img/brands/pillow-talk-vape-disposable.jpg +0 -0
  233. package/tenants/bigdvapor/public/img/brands/pod-king-vape-disposable.jpg +0 -0
  234. package/tenants/bigdvapor/public/img/brands/raz-vape-disposable.png +0 -0
  235. package/tenants/bigdvapor/public/img/hero-texas.jpg +0 -0
  236. package/tenants/bigdvapor/public/img/og.jpg +0 -0
  237. package/tenants/bigdvapor/public/img/pages/AdobeStock_202106312_web.jpg +0 -0
  238. package/tenants/bigdvapor/public/img/pages/CREW_web.jpg +0 -0
  239. package/tenants/bigdvapor/public/img/pages/Hero-Image.jpg +0 -0
  240. package/tenants/bigdvapor/public/img/tiles/adjust.png +0 -0
  241. package/tenants/bigdvapor/public/img/tiles/again.png +0 -0
  242. package/tenants/bigdvapor/public/img/tiles/al-fakher.png +0 -0
  243. package/tenants/bigdvapor/public/img/tiles/arro.png +0 -0
  244. package/tenants/bigdvapor/public/img/tiles/cookies.png +0 -0
  245. package/tenants/bigdvapor/public/img/tiles/core.png +0 -0
  246. package/tenants/bigdvapor/public/img/tiles/cyclone.png +0 -0
  247. package/tenants/bigdvapor/public/img/tiles/disposables.svg +23 -0
  248. package/tenants/bigdvapor/public/logo-wordmark.png +0 -0
  249. package/tenants/bigdvapor/public/pages/home.css +118 -0
  250. package/tenants/bigdvapor/public/pages/mkt.css +185 -0
  251. package/tenants/bigdvapor/public/pages/page.css +148 -0
  252. package/tenants/bigdvapor/public/themes/bigd-navy.css +73 -0
  253. package/tenants/bigdvapor/theme.json +12 -0
  254. package/tenants/giantvapes/content/chrome.html +152 -0
  255. package/tenants/giantvapes/content/chrome.json +94 -0
  256. package/tenants/giantvapes/content/home.html +194 -0
  257. package/tenants/giantvapes/content/home.json +50 -0
  258. package/tenants/giantvapes/content/pages/about.json +10 -0
  259. package/tenants/giantvapes/content/pages/privacy.json +6 -0
  260. package/tenants/giantvapes/content/pages/shipping-returns.json +6 -0
  261. package/tenants/giantvapes/content/pages-html/blogs/news.html +68 -0
  262. package/tenants/giantvapes/content/pages-html/pages/about-us.html +95 -0
  263. package/tenants/giantvapes/content/pages-html/pages/contact-us.html +68 -0
  264. package/tenants/giantvapes/content/pages-html/pages/privacy-policy.html +65 -0
  265. package/tenants/giantvapes/content/pages-html/pages/shipping-returns.html +77 -0
  266. package/tenants/giantvapes/content/themes/giant-navy.json +73 -0
  267. package/tenants/giantvapes/public/img/hero-suicide-bunny.jpg +0 -0
  268. package/tenants/giantvapes/public/img/hero.webp +0 -0
  269. package/tenants/giantvapes/public/img/og.jpg +0 -0
  270. package/tenants/giantvapes/public/logo-wordmark.png +0 -0
  271. package/tenants/giantvapes/public/pages/home.css +120 -0
  272. package/tenants/giantvapes/public/pages/mkt.css +185 -0
  273. package/tenants/giantvapes/public/pages/page.css +155 -0
  274. package/tenants/giantvapes/public/themes/giant-navy.css +76 -0
  275. package/tenants/giantvapes/theme.json +39 -0
  276. package/tenants/home/content/chrome.json +11 -0
  277. package/tenants/home/content/home.html +304 -0
  278. package/tenants/home/content/home.json +13 -0
  279. package/tenants/home/public/js/storefront.js +210 -0
  280. package/tenants/home/public/logo-wordmark.png +0 -0
  281. package/tenants/home/public/pages/storefront.css +212 -0
  282. package/tenants/home/theme.json +6 -0
  283. package/tenants/tokenoftrust/.tot/config.json +9 -0
  284. package/tenants/tokenoftrust/content/chrome.json +55 -0
  285. package/tenants/tokenoftrust/content/home.html +723 -0
  286. package/tenants/tokenoftrust/content/home.json +233 -0
  287. package/tenants/tokenoftrust/content/pages-html/careers.html +231 -0
  288. package/tenants/tokenoftrust/content/pages-html/company.html +275 -0
  289. package/tenants/tokenoftrust/content/pages-html/contact/contact-sales.html +188 -0
  290. package/tenants/tokenoftrust/content/pages-html/contact/startup-apply.html +206 -0
  291. package/tenants/tokenoftrust/content/pages-html/contact.html +178 -0
  292. package/tenants/tokenoftrust/content/pages-html/industries/adult-content-age-verification.html +286 -0
  293. package/tenants/tokenoftrust/content/pages-html/industries/cannabis.html +277 -0
  294. package/tenants/tokenoftrust/content/pages-html/pact-act-pricing.html +289 -0
  295. package/tenants/tokenoftrust/content/pages-html/pricing.html +483 -0
  296. package/tenants/tokenoftrust/content/pages-html/product/age-assurance/age-estimation.html +278 -0
  297. package/tenants/tokenoftrust/content/pages-html/product/age-assurance/age-gate.html +279 -0
  298. package/tenants/tokenoftrust/content/pages-html/product/age-assurance/age-verification.html +265 -0
  299. package/tenants/tokenoftrust/content/pages-html/product/age-assurance.html +173 -0
  300. package/tenants/tokenoftrust/content/pages-html/product/compliance/aml.html +214 -0
  301. package/tenants/tokenoftrust/content/pages-html/product/compliance/pact-act.html +226 -0
  302. package/tenants/tokenoftrust/content/pages-html/product/fraud-prevention.html +254 -0
  303. package/tenants/tokenoftrust/content/pages-html/product/social-profile-verification.html +212 -0
  304. package/tenants/tokenoftrust/content/pages-html/product/tax/excise-tax.html +213 -0
  305. package/tenants/tokenoftrust/content/pages-html/product/verification/aml.html +259 -0
  306. package/tenants/tokenoftrust/content/pages-html/product/verification/biometric-selfie.html +305 -0
  307. package/tenants/tokenoftrust/content/pages-html/product/verification/coverage.html +254 -0
  308. package/tenants/tokenoftrust/content/pages-html/product/verification/document-verification.html +306 -0
  309. package/tenants/tokenoftrust/content/pages-html/product/verification/electronic-identity-verification.html +304 -0
  310. package/tenants/tokenoftrust/content/pages-html/product/verification/government-id-verification.html +308 -0
  311. package/tenants/tokenoftrust/content/pages-html/product/verification.html +183 -0
  312. package/tenants/tokenoftrust/content/pages-html/product.html +228 -0
  313. package/tenants/tokenoftrust/content/pages-html/resources/integrations/bigcommerce-integration.html +220 -0
  314. package/tenants/tokenoftrust/content/pages-html/resources/integrations/shopify-integration.html +221 -0
  315. package/tenants/tokenoftrust/content/pages-html/resources/integrations/wordpress.html +220 -0
  316. package/tenants/tokenoftrust/content/pages-html/resources/integrations.html +172 -0
  317. package/tenants/tokenoftrust/content/pages-html/resources/refer-a-friend-program.html +317 -0
  318. package/tenants/tokenoftrust/content/pages-html/resources.html +177 -0
  319. package/tenants/tokenoftrust/content/pages-html/reviews.html +273 -0
  320. package/tenants/tokenoftrust/content/pages-html/solutions.html +292 -0
  321. package/tenants/tokenoftrust/content/pages-html/vlp-alcohol.html +289 -0
  322. package/tenants/tokenoftrust/content/pages-html/vlp-cigars-and-tobacco.html +286 -0
  323. package/tenants/tokenoftrust/content/pages-html/vlp-firearm-accessories.html +267 -0
  324. package/tenants/tokenoftrust/content/pages-html/vlp-peptides.html +273 -0
  325. package/tenants/tokenoftrust/content/themes/tot-navy.json +88 -0
  326. package/tenants/tokenoftrust/public/favicon.png +0 -0
  327. package/tenants/tokenoftrust/public/logo-icon.png +0 -0
  328. package/tenants/tokenoftrust/public/logo-wordmark.png +0 -0
  329. package/tenants/tokenoftrust/public/pages/company.css +108 -0
  330. package/tenants/tokenoftrust/public/pages/home.css +457 -0
  331. package/tenants/tokenoftrust/public/pages/mkt.css +482 -0
  332. package/tenants/tokenoftrust/public/pages/pricing.css +214 -0
  333. package/tenants/tokenoftrust/public/pages/solutions.css +66 -0
  334. package/tenants/tokenoftrust/public/themes/tot-navy-1.0.0.css +136 -0
  335. package/tenants/tokenoftrust/public/themes/tot-navy.css +358 -0
  336. package/tenants/tokenoftrust/theme.json +31 -0
  337. package/tsconfig.base.json +20 -0
@@ -0,0 +1,69 @@
1
+ # resolve-tot-credentials.sh — resolve storefront's OWN ToT app identity: the
2
+ # credentials it uses to authenticate ITSELF to the MCP forge/grant surface
3
+ # (credential_validate -> repo_provision / tenant_checkout / grant_* / ...).
4
+ # Distinct from TOT_CATALOG_* — the client creds storefront uses to read the ToT
5
+ # catalog API (see RUNBOOK.md); these two may reuse the same apiClient keys but
6
+ # serve different call sites. SOURCED (not executed) by provision.sh,
7
+ # sync-secrets.sh, and ad hoc by scripts/tenant/provision-gitea-repo.mjs runs.
8
+ #
9
+ # TOT_APP_DOMAIN + MCP_BASE_URL default to storefront's proven qa binding:
10
+ # tot-mcp's infrastructure/resources.env.json has
11
+ # .environments.qa.appNamespaces["storefront.tokenoftrust.com"] == "storefront"
12
+ # and docs/architecture/tot-git-repo-mcp-architecture.md lists mcp.qa.tokenoftrust.com
13
+ # as the qa MCP endpoint. Override either via env once a test/production binding
14
+ # exists (see devbook://app-binding Recipe A for how a new binding gets added).
15
+ #
16
+ # TOT_API_KEY / TOT_SECRET_KEY: env wins; else SSM SecureString at
17
+ # /tot/app/storefront/{tot-api-key,tot-secret-key}. Seed those once via
18
+ # scripts/secrets/put-tot-secret.sh --name /tot/app/storefront/tot-api-key
19
+ # scripts/secrets/put-tot-secret.sh --name /tot/app/storefront/tot-secret-key
20
+ # (silent prompt, never in argv/history/disk — same shape as put-cf-secret.sh).
21
+ #
22
+ # MCP_SERVICE_SHARED_SECRET: env wins; else the SAME shared SSM SecureString
23
+ # tot-mcp mints (decision mcp-shared-secret-single-source-ssm) — storefront READS
24
+ # it so both sides agree without a manual dev-var. The path is PARAMETERIZED via
25
+ # MCP_SERVICE_SHARED_SECRET_SSM_PARAM (one-line config). recordDeveloperAppBinding
26
+ # reads MCP_SERVICE_SHARED_SECRET from the Worker env at runtime (unchanged).
27
+ # Confirmed shared param (one hardwired path): /tot/dev-access/mcp-service-shared-secret (tot-mcp mints it).
28
+ #
29
+ # No live verification here (unlike resolve-cf-token.sh's /user/tokens/verify) —
30
+ # credential_validate IS the verification, and every caller does that as its own
31
+ # first step. A silent no-op if nothing resolves; callers then fail at that
32
+ # validation with a clear MCP-side error instead of a confusing local one.
33
+ TOT_APP_DOMAIN="${TOT_APP_DOMAIN:-storefront.tokenoftrust.com}"
34
+ MCP_BASE_URL="${MCP_BASE_URL:-https://mcp.qa.tokenoftrust.com}"
35
+ export TOT_APP_DOMAIN MCP_BASE_URL
36
+
37
+ # Shared MCP service-secret SSM path — ONE hardwired shared param that tot-mcp
38
+ # mints and both sides read (decision mcp-shared-secret-one-hardwired-path). It's a
39
+ # single storefront<->mcp<->Gitea relationship, NOT per-env: no env-code, no
40
+ # per-tier path — the plain constant below. SecureString, us-east-1, same AWS
41
+ # account (242086487598). The env-var escape hatch stays for edge cases, but the
42
+ # default IS this constant.
43
+ MCP_SERVICE_SHARED_SECRET_SSM_PARAM="${MCP_SERVICE_SHARED_SECRET_SSM_PARAM:-/tot/dev-access/mcp-service-shared-secret}"
44
+
45
+ if command -v aws >/dev/null 2>&1; then
46
+ if [ -z "${TOT_API_KEY:-}" ]; then
47
+ _tot_api_key="$(aws ssm get-parameter --name /tot/app/storefront/tot-api-key --with-decryption --query Parameter.Value --output text 2>/dev/null || true)"
48
+ if [ -n "$_tot_api_key" ] && [ "$_tot_api_key" != "None" ]; then
49
+ export TOT_API_KEY="$_tot_api_key"
50
+ echo "Loaded TOT_API_KEY from SSM (/tot/app/storefront/tot-api-key)"
51
+ fi
52
+ fi
53
+ if [ -z "${TOT_SECRET_KEY:-}" ]; then
54
+ _tot_secret_key="$(aws ssm get-parameter --name /tot/app/storefront/tot-secret-key --with-decryption --query Parameter.Value --output text 2>/dev/null || true)"
55
+ if [ -n "$_tot_secret_key" ] && [ "$_tot_secret_key" != "None" ]; then
56
+ export TOT_SECRET_KEY="$_tot_secret_key"
57
+ echo "Loaded TOT_SECRET_KEY from SSM (/tot/app/storefront/tot-secret-key)"
58
+ fi
59
+ fi
60
+ # Same mechanism as TOT_* above: env wins, else the SHARED SSM SecureString.
61
+ if [ -z "${MCP_SERVICE_SHARED_SECRET:-}" ]; then
62
+ _mcp_shared_secret="$(aws ssm get-parameter --name "$MCP_SERVICE_SHARED_SECRET_SSM_PARAM" --with-decryption --query Parameter.Value --output text 2>/dev/null || true)"
63
+ if [ -n "$_mcp_shared_secret" ] && [ "$_mcp_shared_secret" != "None" ]; then
64
+ export MCP_SERVICE_SHARED_SECRET="$_mcp_shared_secret"
65
+ echo "Loaded MCP_SERVICE_SHARED_SECRET from SSM ($MCP_SERVICE_SHARED_SECRET_SSM_PARAM)"
66
+ fi
67
+ fi
68
+ unset _tot_api_key _tot_secret_key _mcp_shared_secret
69
+ fi
@@ -0,0 +1,54 @@
1
+ CREATE TABLE `collections` (
2
+ `handle` text PRIMARY KEY NOT NULL,
3
+ `title` text NOT NULL,
4
+ `position` integer DEFAULT 99 NOT NULL,
5
+ `data` text NOT NULL
6
+ );
7
+ --> statement-breakpoint
8
+ CREATE TABLE `customization_pointers` (
9
+ `tenant_id` text PRIMARY KEY NOT NULL,
10
+ `rev` integer NOT NULL,
11
+ `live` text NOT NULL,
12
+ `test` text NOT NULL
13
+ );
14
+ --> statement-breakpoint
15
+ CREATE TABLE `customization_versions` (
16
+ `tenant_id` text NOT NULL,
17
+ `path` text NOT NULL,
18
+ `version_id` text NOT NULL,
19
+ `size` integer NOT NULL,
20
+ `created_at` text NOT NULL,
21
+ `content` text NOT NULL,
22
+ PRIMARY KEY(`tenant_id`, `path`, `version_id`)
23
+ );
24
+ --> statement-breakpoint
25
+ CREATE TABLE `product_collections` (
26
+ `handle` text NOT NULL,
27
+ `collection` text NOT NULL
28
+ );
29
+ --> statement-breakpoint
30
+ CREATE INDEX `idx_pc_collection` ON `product_collections` (`collection`);--> statement-breakpoint
31
+ CREATE TABLE `product_facets` (
32
+ `handle` text NOT NULL,
33
+ `name` text NOT NULL,
34
+ `value` text NOT NULL
35
+ );
36
+ --> statement-breakpoint
37
+ CREATE INDEX `idx_pf_name` ON `product_facets` (`name`,`value`);--> statement-breakpoint
38
+ CREATE TABLE `products` (
39
+ `handle` text PRIMARY KEY NOT NULL,
40
+ `title` text NOT NULL,
41
+ `vendor` text,
42
+ `product_type` text,
43
+ `tags` text DEFAULT '[]' NOT NULL,
44
+ `description_text` text DEFAULT '' NOT NULL,
45
+ `price_min` real NOT NULL,
46
+ `price_max` real NOT NULL,
47
+ `currency` text NOT NULL,
48
+ `image` text,
49
+ `available` integer DEFAULT 0 NOT NULL,
50
+ `status` text NOT NULL,
51
+ `position` integer DEFAULT 0 NOT NULL,
52
+ `created_at` text,
53
+ `data` text NOT NULL
54
+ );
@@ -0,0 +1,9 @@
1
+ -- Custom SQL migration file, put your code below! --
2
+ -- FTS5 (trigram) virtual table for typo-tolerant product search. Drizzle can't model
3
+ -- CREATE VIRTUAL TABLE, so this is hand-maintained — keep it in step with
4
+ -- CATALOG_D1_SCHEMA in @tot/private-controlplane (the structural equivalence test in
5
+ -- src/lib/d1/schema.test.ts enforces that the migrations reproduce that contract).
6
+ CREATE VIRTUAL TABLE IF NOT EXISTS products_fts USING fts5 (
7
+ handle UNINDEXED, title, vendor, product_type, tags, description_text,
8
+ tokenize = 'trigram'
9
+ );
@@ -0,0 +1,54 @@
1
+ # D1 provision migrations (Drizzle Kit)
2
+
3
+ The catalog + customization D1 schema as numbered migrations, applied by `provision.sh`
4
+ (the **provision** lifecycle phase — never `deploy`, never runtime). Generated by
5
+ **Drizzle Kit** (ADR-0002), applied by `wrangler d1 migrations apply`.
6
+
7
+ ## Source of truth
8
+
9
+ - **`src/lib/d1/schema.ts`** (Drizzle schema) is the source of truth for migration
10
+ *generation*. `drizzle-kit generate` diffs it into numbered `migrations/*.sql`
11
+ (+ `meta/` journal) and owns the SQLite table-rebuild logic for `ALTER`s.
12
+ - **`products_fts`** (FTS5 virtual table) can't be modelled by Drizzle — it's a custom
13
+ migration (`0001_products_fts.sql`), hand-maintained.
14
+ - The raw-SQL read model + ETL still consume `CATALOG_D1_SCHEMA`/`CUSTOMIZATION_D1_SCHEMA`
15
+ (`@tot/private-controlplane`). A **structural** equivalence test (`src/lib/d1/schema.test.ts`,
16
+ PRAGMA-based) asserts the migrations reproduce that contract, so generator and read
17
+ model can't drift.
18
+
19
+ ## Safety (D1 has no rollback)
20
+
21
+ `src/lib/d1/migrationSafety.ts` + its test **fail CI** on any unmarked `DROP TABLE` /
22
+ `DROP COLUMN` (which also catches SQLite column-dropping rebuilds), because the
23
+ equivalence test only proves *end-state* correctness, not a safe transition. An
24
+ *intended* destructive change must opt in, in the migration file:
25
+
26
+ ```sql
27
+ -- allow-destructive: <why this data loss is intended>
28
+ ```
29
+
30
+ ## Workflows
31
+
32
+ **Regular change (add/alter a column, table):**
33
+ 1. Edit `src/lib/d1/schema.ts`.
34
+ 2. `pnpm --filter @tot/storefront gen:migrations` (Drizzle emits the next numbered SQL,
35
+ including SQLite table-rebuilds for unsupported `ALTER`s).
36
+ 3. If a column was removed, add `-- allow-destructive: <reason>` to the generated file.
37
+ 4. Update the matching `@tot/private-controlplane` const so the equivalence test stays green; commit
38
+ schema + generated `.sql` + journal together.
39
+
40
+ **Custom SQL (e.g. a new FTS table, trigger):**
41
+ `pnpm --filter @tot/storefront gen:migrations:custom` → fill in the emitted file.
42
+
43
+ Never renumber or rewrite a *shipped* id (`wrangler` tracks applied ids); only append.
44
+
45
+ ## Applying
46
+
47
+ `provision.sh --env=<env>` runs, after creating the D1 database:
48
+
49
+ ```sh
50
+ wrangler d1 migrations apply CATALOG_DB --env <env> [--remote|--local]
51
+ ```
52
+
53
+ > Catalog + customization tables share the **one** `CATALOG_DB` binding (one edge DB),
54
+ > per `src/lib/customization/d1Store.ts`.
@@ -0,0 +1,347 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "3667f8d8-a1ba-49ac-809a-c06004bad5d6",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
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
+ "schemas": {},
341
+ "tables": {},
342
+ "columns": {}
343
+ },
344
+ "internal": {
345
+ "indexes": {}
346
+ }
347
+ }