create-ailk 0.38.0 → 0.40.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/dist/add-route.js +16 -1
- package/dist/body-heading.d.ts +2 -1
- package/dist/body-heading.js +31 -3
- package/dist/derive-architecture.js +3 -1
- package/dist/module-architecture.js +0 -3
- package/dist/remove-module.js +27 -14
- package/dist/routes.d.ts +36 -2
- package/dist/routes.js +269 -23
- package/dist/site-manifest.js +6 -4
- package/dist/site-roster.d.ts +11 -3
- package/dist/site-roster.js +48 -22
- package/dist/surfaces.d.ts +13 -3
- package/dist/surfaces.js +128 -194
- package/dist/sync-routes.js +22 -5
- package/dist/template-record.js +3 -1
- package/dist/topology.d.ts +11 -0
- package/dist/topology.js +253 -3
- package/package.json +3 -3
- package/templates/apps/web/CLAUDE.md +32 -4
- package/templates/apps/web/__tests__/__mocks__/next-intl-server.ts +6 -1
- package/templates/apps/web/__tests__/__mocks__/next-intl.ts +6 -1
- package/templates/apps/web/__tests__/auth/seam.test.ts +34 -0
- package/templates/apps/web/account.config.tsx +2 -3
- package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +1 -1
- package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
- package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +1 -1
- package/templates/apps/web/app/[locale]/layout.tsx +2 -2
- package/templates/apps/web/auth.config.tsx +107 -0
- package/templates/apps/web/auth.ts +2 -1
- package/templates/apps/web/i18n/request.ts +13 -2
- package/templates/apps/web/jest.config.cjs +10 -0
- package/templates/apps/web/lib/__tests__/deck-page.test.ts +9 -0
- package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +3 -0
- package/templates/apps/web/lib/__tests__/in-page-magnet-self-request.test.ts +1 -1
- package/templates/apps/web/lib/__tests__/in-page-magnet.test.ts +2 -2
- package/templates/apps/web/lib/__tests__/pricing-page.test.ts +1 -1
- package/templates/apps/web/lib/__tests__/server-api.test.ts +1 -1
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +17 -4
- package/templates/apps/web/lib/in-page-magnet.ts +2 -2
- package/templates/apps/web/lib/pricing-page.ts +3 -3
- package/templates/apps/web/lib/server-api.ts +1 -1
- package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-email.ts +1 -1
- package/templates/apps/web/{app/[locale]/contact → lib}/site-contact-lines.ts +1 -1
- package/templates/apps/web/lib/site-header.ts +1 -1
- package/templates/apps/web/lib/topology.generated.ts +5 -0
- package/templates/apps/web/messages/en.json +0 -271
- package/templates/apps/web/middleware.ts +12 -25
- package/templates/apps/web/next.config.mjs +15 -0
- package/templates/apps/web/package.json +2 -0
- package/templates/apps/web/site-pages.config.tsx +85 -0
- package/templates/apps/web/types/messages.d.ts +6 -1
- package/templates/tools/body-heading.ts +30 -3
- package/versions.json +50 -48
- package/templates/apps/web/app/[locale]/(auth)/__tests__/auth-pages.test.tsx +0 -322
- package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +0 -554
- package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/consent-actions.test.ts +0 -56
- package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/page.test.tsx +0 -164
- package/templates/apps/web/app/[locale]/(auth)/consent/consent-form.tsx +0 -132
- package/templates/apps/web/app/[locale]/(auth)/consent/consent.actions.ts +0 -51
- package/templates/apps/web/app/[locale]/(auth)/consent/page.tsx +0 -144
- package/templates/apps/web/app/[locale]/(auth)/forgot-password/forgot-password-card.tsx +0 -101
- package/templates/apps/web/app/[locale]/(auth)/forgot-password/page.tsx +0 -111
- package/templates/apps/web/app/[locale]/(auth)/layout.tsx +0 -81
- package/templates/apps/web/app/[locale]/(auth)/legal-footnote.tsx +0 -35
- package/templates/apps/web/app/[locale]/(auth)/reset-password/__tests__/return.test.tsx +0 -179
- package/templates/apps/web/app/[locale]/(auth)/reset-password/page.tsx +0 -157
- package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +0 -126
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/next-path.test.ts +0 -54
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +0 -628
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +0 -43
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +0 -266
- package/templates/apps/web/app/[locale]/(auth)/sign-in/next-path.ts +0 -20
- package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +0 -234
- package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +0 -37
- package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +0 -323
- package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +0 -93
- package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/page.test.tsx +0 -301
- package/templates/apps/web/app/[locale]/(auth)/sign-up/__tests__/sign-up-card.test.tsx +0 -309
- package/templates/apps/web/app/[locale]/(auth)/sign-up/page.tsx +0 -201
- package/templates/apps/web/app/[locale]/(auth)/sign-up/sign-up-card.tsx +0 -366
- package/templates/apps/web/app/[locale]/(auth)/use-auth-card-flow.ts +0 -116
- package/templates/apps/web/app/[locale]/(auth)/verify-email/__tests__/actions.test.ts +0 -94
- package/templates/apps/web/app/[locale]/(auth)/verify-email/actions.ts +0 -77
- package/templates/apps/web/app/[locale]/(auth)/verify-email/page.tsx +0 -154
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +0 -10
- package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/leads/__tests__/page.test.tsx +0 -205
- package/templates/apps/web/app/[locale]/(authed)/leads/components/LeadsTable.tsx +0 -137
- package/templates/apps/web/app/[locale]/(authed)/leads/page.tsx +0 -122
- package/templates/apps/web/app/[locale]/(authed)/waitlist/components/ForbiddenState.tsx +0 -24
- package/templates/apps/web/app/[locale]/(authed)/waitlist/format.ts +0 -111
- package/templates/apps/web/app/[locale]/[slug]/[detail]/__tests__/page.test.tsx +0 -402
- package/templates/apps/web/app/[locale]/[slug]/[detail]/page.tsx +0 -143
- package/templates/apps/web/app/[locale]/[slug]/__tests__/page.test.tsx +0 -148
- package/templates/apps/web/app/[locale]/[slug]/page.tsx +0 -109
- package/templates/apps/web/app/[locale]/about/[slug]/page.tsx +0 -46
- package/templates/apps/web/app/[locale]/about/__tests__/about-routes.test.tsx +0 -353
- package/templates/apps/web/app/[locale]/about/page.tsx +0 -122
- package/templates/apps/web/app/[locale]/alternatives/__tests__/page.test.tsx +0 -161
- package/templates/apps/web/app/[locale]/alternatives/page.tsx +0 -112
- package/templates/apps/web/app/[locale]/careers/[slug]/[action]/page.tsx +0 -244
- package/templates/apps/web/app/[locale]/careers/[slug]/apply.actions.ts +0 -325
- package/templates/apps/web/app/[locale]/careers/[slug]/job-application-form.ts +0 -120
- package/templates/apps/web/app/[locale]/careers/[slug]/page.tsx +0 -73
- package/templates/apps/web/app/[locale]/careers/__tests__/apply.actions.test.ts +0 -497
- package/templates/apps/web/app/[locale]/careers/__tests__/careers-hub.test.tsx +0 -172
- package/templates/apps/web/app/[locale]/careers/__tests__/careers-set.test.tsx +0 -153
- package/templates/apps/web/app/[locale]/careers/__tests__/job-application-form.test.ts +0 -141
- package/templates/apps/web/app/[locale]/careers/__tests__/job-apply-page.test.tsx +0 -546
- package/templates/apps/web/app/[locale]/careers/__tests__/page-renderer-migration.test.tsx +0 -189
- package/templates/apps/web/app/[locale]/careers/page.tsx +0 -165
- package/templates/apps/web/app/[locale]/case-studies/[slug]/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/case-studies/__tests__/hub-children.test.tsx +0 -65
- package/templates/apps/web/app/[locale]/case-studies/__tests__/page-renderer-migration.test.tsx +0 -125
- package/templates/apps/web/app/[locale]/case-studies/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/clients/__tests__/page-renderer-migration.test.tsx +0 -85
- package/templates/apps/web/app/[locale]/clients/page.tsx +0 -47
- package/templates/apps/web/app/[locale]/contact/ConversationalIntakeWrapper.tsx +0 -249
- package/templates/apps/web/app/[locale]/contact/__tests__/ConversationalIntakeWrapper.test.tsx +0 -400
- package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-magnet.test.ts +0 -138
- package/templates/apps/web/app/[locale]/contact/__tests__/contact-form-text.test.ts +0 -49
- package/templates/apps/web/app/[locale]/contact/__tests__/contact-magnet-page.test.tsx +0 -494
- package/templates/apps/web/app/[locale]/contact/__tests__/contact.actions.test.ts +0 -1122
- package/templates/apps/web/app/[locale]/contact/__tests__/intake-analytics.test.ts +0 -51
- package/templates/apps/web/app/[locale]/contact/__tests__/page-renderer-migration.test.tsx +0 -319
- package/templates/apps/web/app/[locale]/contact/contact-form-magnet.ts +0 -77
- package/templates/apps/web/app/[locale]/contact/contact-form-text.ts +0 -52
- package/templates/apps/web/app/[locale]/contact/contact.actions.ts +0 -403
- package/templates/apps/web/app/[locale]/contact/intake-analytics.ts +0 -49
- package/templates/apps/web/app/[locale]/contact/intake-script.ts +0 -92
- package/templates/apps/web/app/[locale]/contact/page.tsx +0 -267
- package/templates/apps/web/app/[locale]/courses/[slug]/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/courses/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/courses/__tests__/page-renderer-migration.test.tsx +0 -123
- package/templates/apps/web/app/[locale]/courses/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/events/[slug]/page.tsx +0 -57
- package/templates/apps/web/app/[locale]/events/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/events/__tests__/page-renderer-migration.test.tsx +0 -164
- package/templates/apps/web/app/[locale]/events/__tests__/program-event.test.tsx +0 -120
- package/templates/apps/web/app/[locale]/events/page.tsx +0 -60
- package/templates/apps/web/app/[locale]/faq/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/features/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/features/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/features/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/for/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/for/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/for/__tests__/page-renderer-migration.test.tsx +0 -90
- package/templates/apps/web/app/[locale]/for/page.tsx +0 -51
- package/templates/apps/web/app/[locale]/glossary/page.tsx +0 -53
- package/templates/apps/web/app/[locale]/how-to/[slug]/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/how-to/__tests__/page-renderer-migration.test.tsx +0 -78
- package/templates/apps/web/app/[locale]/how-to/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/integrations/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/integrations/__tests__/hub-children.test.tsx +0 -38
- package/templates/apps/web/app/[locale]/integrations/__tests__/page-renderer-migration.test.tsx +0 -141
- package/templates/apps/web/app/[locale]/integrations/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/launch-service/page.tsx +0 -44
- package/templates/apps/web/app/[locale]/newsletter/__tests__/page.test.tsx +0 -236
- package/templates/apps/web/app/[locale]/newsletter/page.tsx +0 -179
- package/templates/apps/web/app/[locale]/page.tsx +0 -147
- package/templates/apps/web/app/[locale]/partners/[slug]/page.tsx +0 -45
- package/templates/apps/web/app/[locale]/partners/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/partners/__tests__/page-renderer-migration.test.tsx +0 -125
- package/templates/apps/web/app/[locale]/partners/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/portfolio/[slug]/page.tsx +0 -46
- package/templates/apps/web/app/[locale]/portfolio/__tests__/hub-children.test.tsx +0 -38
- package/templates/apps/web/app/[locale]/portfolio/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/pricing/[slug]/__tests__/page.test.tsx +0 -324
- package/templates/apps/web/app/[locale]/pricing/[slug]/page.tsx +0 -87
- package/templates/apps/web/app/[locale]/pricing/__tests__/__snapshots__/unconnected.test.tsx.snap +0 -7
- package/templates/apps/web/app/[locale]/pricing/__tests__/offerings.test.tsx +0 -605
- package/templates/apps/web/app/[locale]/pricing/__tests__/page.test.tsx +0 -219
- package/templates/apps/web/app/[locale]/pricing/__tests__/pricing-pages.test.tsx +0 -215
- package/templates/apps/web/app/[locale]/pricing/__tests__/unconnected.test.tsx +0 -282
- package/templates/apps/web/app/[locale]/pricing/page.tsx +0 -120
- package/templates/apps/web/app/[locale]/privacy/page.tsx +0 -40
- package/templates/apps/web/app/[locale]/products/[slug]/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/products/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/products/__tests__/page-renderer-migration.test.tsx +0 -141
- package/templates/apps/web/app/[locale]/products/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/projects/[slug]/page.tsx +0 -37
- package/templates/apps/web/app/[locale]/projects/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/projects/__tests__/page-renderer-migration.test.tsx +0 -157
- package/templates/apps/web/app/[locale]/projects/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/purchase-policy/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/resources/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/resources/__tests__/hub-children.test.tsx +0 -38
- package/templates/apps/web/app/[locale]/resources/__tests__/page-renderer-migration.test.tsx +0 -151
- package/templates/apps/web/app/[locale]/resources/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/services/[slug]/[child]/page.tsx +0 -68
- package/templates/apps/web/app/[locale]/services/[slug]/page.tsx +0 -88
- package/templates/apps/web/app/[locale]/services/__tests__/hub-children.test.tsx +0 -158
- package/templates/apps/web/app/[locale]/services/__tests__/page-renderer-migration.test.tsx +0 -187
- package/templates/apps/web/app/[locale]/services/__tests__/service-detail-sections.test.tsx +0 -224
- package/templates/apps/web/app/[locale]/services/__tests__/service-families.test.tsx +0 -368
- package/templates/apps/web/app/[locale]/services/page.tsx +0 -71
- package/templates/apps/web/app/[locale]/software/[slug]/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/software/__tests__/page-renderer-migration.test.tsx +0 -81
- package/templates/apps/web/app/[locale]/software/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/team/[slug]/page.tsx +0 -45
- package/templates/apps/web/app/[locale]/team/__tests__/hub-children.test.tsx +0 -32
- package/templates/apps/web/app/[locale]/team/__tests__/team-routes.test.tsx +0 -161
- package/templates/apps/web/app/[locale]/team/page.tsx +0 -50
- package/templates/apps/web/app/[locale]/tech-articles/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/tech-articles/__tests__/page-renderer-migration.test.tsx +0 -82
- package/templates/apps/web/app/[locale]/tech-articles/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/templates/[slug]/__tests__/page.test.tsx +0 -203
- package/templates/apps/web/app/[locale]/templates/[slug]/page.tsx +0 -81
- package/templates/apps/web/app/[locale]/templates/__tests__/page.test.tsx +0 -237
- package/templates/apps/web/app/[locale]/templates/page.tsx +0 -114
- package/templates/apps/web/app/[locale]/terms/page.tsx +0 -40
- package/templates/apps/web/app/[locale]/testimonials/__tests__/page-renderer-migration.test.tsx +0 -85
- package/templates/apps/web/app/[locale]/testimonials/page.tsx +0 -51
- package/templates/apps/web/app/[locale]/thanks/[slug]/__tests__/page.test.tsx +0 -136
- package/templates/apps/web/app/[locale]/thanks/[slug]/page.tsx +0 -39
- package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe-rsc-boundary.test.tsx +0 -226
- package/templates/apps/web/app/[locale]/unsubscribe/__tests__/unsubscribe.test.tsx +0 -217
- package/templates/apps/web/app/[locale]/unsubscribe/page.tsx +0 -106
- package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe-button.tsx +0 -94
- package/templates/apps/web/app/[locale]/unsubscribe/unsubscribe.actions.ts +0 -55
- package/templates/apps/web/app/[locale]/vs/[slug]/__tests__/page.test.tsx +0 -100
- package/templates/apps/web/app/[locale]/vs/[slug]/page.tsx +0 -60
- package/templates/apps/web/app/[locale]/whitepapers/[slug]/page.tsx +0 -54
- package/templates/apps/web/app/[locale]/whitepapers/__tests__/page-renderer-migration.test.tsx +0 -82
- package/templates/apps/web/app/[locale]/whitepapers/page.tsx +0 -49
- package/templates/apps/web/app/[locale]/working-agreement/__tests__/page.test.tsx +0 -63
- package/templates/apps/web/app/[locale]/working-agreement/page.tsx +0 -41
- package/templates/apps/web/app/api/auth/[...all]/route.ts +0 -16
- package/templates/apps/web/app/api/auth/hub/__tests__/continuation.test.ts +0 -143
- package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +0 -749
- package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +0 -964
- package/templates/apps/web/app/api/auth/hub/authorize/route.ts +0 -390
- package/templates/apps/web/app/api/auth/hub/continuation.ts +0 -127
- package/templates/apps/web/app/api/auth/hub/continue/[ref]/__tests__/route.test.ts +0 -188
- package/templates/apps/web/app/api/auth/hub/continue/[ref]/route.ts +0 -53
- package/templates/apps/web/app/api/auth/hub/email/route.ts +0 -111
- package/templates/apps/web/app/api/auth/hub/entry-shared.ts +0 -163
- package/templates/apps/web/app/api/auth/hub/password/__tests__/return.test.ts +0 -86
- package/templates/apps/web/app/api/auth/hub/password/__tests__/route.test.ts +0 -368
- package/templates/apps/web/app/api/auth/hub/password/return.ts +0 -86
- package/templates/apps/web/app/api/auth/hub/password/route.ts +0 -171
- package/templates/apps/web/app/api/auth/hub/purchase/route.ts +0 -230
- package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +0 -174
- package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +0 -60
- package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +0 -97
- package/templates/apps/web/app/api/auth/mcp/__tests__/continuation.test.ts +0 -92
- package/templates/apps/web/app/api/auth/mcp/continuation.ts +0 -89
- package/templates/apps/web/app/api/auth/mcp/continue/[ref]/__tests__/route.test.ts +0 -59
- package/templates/apps/web/app/api/auth/mcp/continue/[ref]/route.ts +0 -41
- package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +0 -1166
- package/templates/apps/web/app/api/hub-session/callback/route.ts +0 -134
- package/templates/apps/web/app/api/hub-session/email/route.ts +0 -125
- package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +0 -49
- package/templates/apps/web/app/api/hub-session/one-tap/route.ts +0 -106
- package/templates/apps/web/app/api/hub-session/open/route.ts +0 -111
- package/templates/apps/web/app/api/hub-session/password/return/route.ts +0 -69
- package/templates/apps/web/app/api/hub-session/password/route.ts +0 -106
- package/templates/apps/web/app/api/hub-session/sign-in/route.ts +0 -91
- package/templates/apps/web/app/api/hub-session/sign-out/route.ts +0 -54
- package/templates/apps/web/components/sign-out-trigger.tsx +0 -62
- package/templates/apps/web/lib/__tests__/auth-routes.test.ts +0 -140
- package/templates/apps/web/lib/__tests__/hub-children.fixtures.ts +0 -279
- package/templates/apps/web/lib/__tests__/route-family.test.ts +0 -57
- package/templates/apps/web/lib/__tests__/service-listing.test.ts +0 -111
- package/templates/apps/web/lib/__tests__/template-listing.test.ts +0 -158
- package/templates/apps/web/lib/auth-routes.ts +0 -125
- package/templates/apps/web/lib/hub-children.tsx +0 -351
- package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +0 -433
- package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +0 -332
- package/templates/apps/web/lib/hub-session/config.ts +0 -110
- package/templates/apps/web/lib/hub-session/entry.ts +0 -238
- package/templates/apps/web/lib/hub-session/index.ts +0 -21
- package/templates/apps/web/lib/hub-session/one-tap.tsx +0 -148
- package/templates/apps/web/lib/hub-session/reseal.ts +0 -90
- package/templates/apps/web/lib/hub-session/seal.ts +0 -86
- package/templates/apps/web/lib/hub-session/session.ts +0 -298
- package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +0 -277
- package/templates/apps/web/lib/meet-placeholder.ts +0 -5
- package/templates/apps/web/lib/next-path.ts +0 -35
- package/templates/apps/web/lib/posting-title.ts +0 -39
- package/templates/apps/web/lib/route-family.ts +0 -69
- package/templates/apps/web/lib/service-listing.ts +0 -89
- package/templates/apps/web/lib/template-listing.ts +0 -169
- package/templates/apps/web/src/lib/__tests__/lead-write.test.ts +0 -187
- package/templates/apps/web/src/lib/lead-write.ts +0 -90
- /package/templates/apps/web/{app/[locale]/contact → lib}/__tests__/site-contact-lines.test.ts +0 -0
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The site's one lead writer (#8747): every lead carries `payload.site` (from
|
|
3
|
-
* `AILK_LEAD_SITE`) and `payload.page`, spread last so no caller field can
|
|
4
|
-
* override them; no `siteId` is sent (the hub names the tenant itself); only
|
|
5
|
-
* the visitor and consent-visitor headers are forwarded; a thrown submit
|
|
6
|
-
* resolves as `{ ok: false, status: 0 }` and logs no field value.
|
|
7
|
-
*/
|
|
8
|
-
jest.mock("@working-theory/api-client", () => ({
|
|
9
|
-
leads: { submit: jest.fn() },
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
import { leads } from "@working-theory/api-client";
|
|
13
|
-
|
|
14
|
-
import { writeLead } from "../lead-write";
|
|
15
|
-
|
|
16
|
-
const mockSubmit = leads.submit as jest.Mock;
|
|
17
|
-
const priorSite = process.env.AILK_LEAD_SITE;
|
|
18
|
-
|
|
19
|
-
afterEach(() => {
|
|
20
|
-
jest.clearAllMocks();
|
|
21
|
-
if (priorSite === undefined) delete process.env.AILK_LEAD_SITE;
|
|
22
|
-
else process.env.AILK_LEAD_SITE = priorSite;
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
type Body = { siteId?: unknown; source: string; email: string; payload: Record<string, unknown> };
|
|
26
|
-
|
|
27
|
-
function sentBody(): Body {
|
|
28
|
-
return mockSubmit.mock.calls[0][0] as Body;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
describe("writeLead — the site marker", () => {
|
|
32
|
-
it("marks payload.site from AILK_LEAD_SITE and payload.page from the caller, and sends no siteId", async () => {
|
|
33
|
-
process.env.AILK_LEAD_SITE = "wendihenry";
|
|
34
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: { id: "lead_1", persisted: "db" } });
|
|
35
|
-
|
|
36
|
-
const res = await writeLead({
|
|
37
|
-
source: "contact-form",
|
|
38
|
-
email: "jane@example.com",
|
|
39
|
-
page: "contact",
|
|
40
|
-
payload: { name: "Jane" },
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
expect(res.ok).toBe(true);
|
|
44
|
-
expect(sentBody()).toEqual({
|
|
45
|
-
source: "contact-form",
|
|
46
|
-
email: "jane@example.com",
|
|
47
|
-
payload: { name: "Jane", site: "wendihenry", page: "contact" },
|
|
48
|
-
});
|
|
49
|
-
expect(sentBody()).not.toHaveProperty("siteId");
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("a caller's own site or page field never overrides the marker", async () => {
|
|
53
|
-
process.env.AILK_LEAD_SITE = "wendihenry";
|
|
54
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: {} });
|
|
55
|
-
|
|
56
|
-
await writeLead({
|
|
57
|
-
source: "contact-form",
|
|
58
|
-
email: "jane@example.com",
|
|
59
|
-
page: "contact",
|
|
60
|
-
payload: { site: "attacker", page: "checkout" },
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
expect(sentBody().payload).toEqual({ site: "wendihenry", page: "contact" });
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("trims AILK_LEAD_SITE", async () => {
|
|
67
|
-
process.env.AILK_LEAD_SITE = " wendihenry\n";
|
|
68
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: {} });
|
|
69
|
-
|
|
70
|
-
await writeLead({ source: "contact-form", email: "jane@example.com", page: "contact" });
|
|
71
|
-
|
|
72
|
-
expect(sentBody().payload.site).toBe("wendihenry");
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it.each([
|
|
76
|
-
["unset", undefined],
|
|
77
|
-
["empty", ""],
|
|
78
|
-
["blank", " "],
|
|
79
|
-
])("with AILK_LEAD_SITE %s, writes no site — and drops a caller's own site", async (_label, value) => {
|
|
80
|
-
if (value === undefined) delete process.env.AILK_LEAD_SITE;
|
|
81
|
-
else process.env.AILK_LEAD_SITE = value;
|
|
82
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: {} });
|
|
83
|
-
|
|
84
|
-
await writeLead({
|
|
85
|
-
source: "contact-form",
|
|
86
|
-
email: "jane@example.com",
|
|
87
|
-
page: "contact",
|
|
88
|
-
payload: { name: "Jane", site: "attacker" },
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
expect(sentBody().payload).toEqual({ name: "Jane", page: "contact" });
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe("writeLead — forwarded headers", () => {
|
|
96
|
-
it("forwards only the visitor and consent-visitor headers", async () => {
|
|
97
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: {} });
|
|
98
|
-
|
|
99
|
-
await writeLead(
|
|
100
|
-
{ source: "contact-form", email: "jane@example.com", page: "contact" },
|
|
101
|
-
{
|
|
102
|
-
headers: {
|
|
103
|
-
"x-ailk-visitor-ip": "203.0.113.5",
|
|
104
|
-
"x-ailk-visitor-forward-key": "k",
|
|
105
|
-
"x-ailk-consent-visitor": "6f1e2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
|
|
106
|
-
"x-ailk-spoke-key": "forged",
|
|
107
|
-
"content-type": "text/plain",
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
expect(mockSubmit.mock.calls[0][1]).toEqual({
|
|
113
|
-
headers: {
|
|
114
|
-
"x-ailk-visitor-ip": "203.0.113.5",
|
|
115
|
-
"x-ailk-visitor-forward-key": "k",
|
|
116
|
-
"x-ailk-consent-visitor": "6f1e2a3b-4c5d-4e6f-8a9b-0c1d2e3f4a5b",
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it("calls leads.submit with one argument when no header survives", async () => {
|
|
122
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: {} });
|
|
123
|
-
|
|
124
|
-
await writeLead(
|
|
125
|
-
{ source: "contact-form", email: "jane@example.com", page: "contact" },
|
|
126
|
-
{ headers: { "x-ailk-spoke-key": "forged" } },
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
expect(mockSubmit.mock.calls[0]).toHaveLength(1);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
describe("writeLead — a thrown submit", () => {
|
|
134
|
-
it("resolves as status 0 and logs the error name only", async () => {
|
|
135
|
-
mockSubmit.mockRejectedValueOnce(new TypeError("fetch failed for jane@example.com"));
|
|
136
|
-
const spy = jest.spyOn(console, "error").mockImplementation(() => undefined);
|
|
137
|
-
|
|
138
|
-
const res = await writeLead({
|
|
139
|
-
source: "contact-form",
|
|
140
|
-
email: "jane@example.com",
|
|
141
|
-
page: "contact",
|
|
142
|
-
payload: { name: "Jane" },
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
expect(res).toEqual({ ok: false, status: 0, body: null });
|
|
146
|
-
const logged = spy.mock.calls.flat().map(String).join(" ");
|
|
147
|
-
expect(logged).toContain("TypeError");
|
|
148
|
-
expect(logged).not.toContain("jane@example.com");
|
|
149
|
-
expect(logged).not.toContain("Jane");
|
|
150
|
-
spy.mockRestore();
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it("passes the api-client's own failure through unchanged", async () => {
|
|
154
|
-
const failure = { ok: false, status: 503, body: { error: "lead_capture_not_configured" } };
|
|
155
|
-
mockSubmit.mockResolvedValueOnce(failure);
|
|
156
|
-
|
|
157
|
-
expect(
|
|
158
|
-
await writeLead({ source: "contact-form", email: "jane@example.com", page: "contact" }),
|
|
159
|
-
).toEqual(failure);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
describe("writeLead — terms acceptance (#8730)", () => {
|
|
164
|
-
it("sends consent: true at the top level when the caller says the terms were accepted", async () => {
|
|
165
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: {} });
|
|
166
|
-
|
|
167
|
-
await writeLead({
|
|
168
|
-
source: "contact-form",
|
|
169
|
-
email: "jane@example.com",
|
|
170
|
-
page: "contact",
|
|
171
|
-
consent: true,
|
|
172
|
-
payload: { name: "Jane" },
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
const body = mockSubmit.mock.calls[0][0] as Record<string, unknown>;
|
|
176
|
-
expect(body["consent"]).toBe(true);
|
|
177
|
-
expect((body["payload"] as Record<string, unknown>)["consent"]).toBeUndefined();
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it("sends no consent key at all when the caller does not set it", async () => {
|
|
181
|
-
mockSubmit.mockResolvedValueOnce({ ok: true, body: {} });
|
|
182
|
-
|
|
183
|
-
await writeLead({ source: "contact-form", email: "jane@example.com", page: "contact" });
|
|
184
|
-
|
|
185
|
-
expect(mockSubmit.mock.calls[0][0]).not.toHaveProperty("consent");
|
|
186
|
-
});
|
|
187
|
-
});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* lead-write.ts — this site's lead writer (#8747): the /contact action writes
|
|
3
|
-
* through it, and so can any other page that writes a lead.
|
|
4
|
-
*
|
|
5
|
-
* A lead goes to `POST /v1/leads/submit` through `@working-theory/api-client`.
|
|
6
|
-
* The API resolves the lead's workspace itself — from the spoke key on a hub,
|
|
7
|
-
* from its own site alias otherwise — and ignores a body `siteId`, so none is
|
|
8
|
-
* sent. The site marks itself in the payload instead: `payload.site` is
|
|
9
|
-
* `AILK_LEAD_SITE` (the same variable `apps/mcp`'s `capture_lead` reads,
|
|
10
|
-
* `LEAD_SITE_MARKER_KEY`) and `payload.page` the page key, both spread LAST so
|
|
11
|
-
* no caller field can override them. With `AILK_LEAD_SITE` unset or blank the
|
|
12
|
-
* lead carries no `site` at all — a caller's own `site` is dropped, never sent.
|
|
13
|
-
*
|
|
14
|
-
* The marker is attribution, not authorization: the route is public and a
|
|
15
|
-
* direct caller can write any `payload.site`. Nothing may gate on it.
|
|
16
|
-
*
|
|
17
|
-
* Terms acceptance (#8730): a caller that collected the visitor's acceptance
|
|
18
|
-
* passes `consent: true`, sent as the body's top-level `consent`. The API
|
|
19
|
-
* refuses a contact lead without it and records `payload.consent` itself, so
|
|
20
|
-
* nothing about the acceptance is written into the payload here.
|
|
21
|
-
*
|
|
22
|
-
* Forwarded headers: only the two `visitorForwardHeaders` builds (#7394) and
|
|
23
|
-
* the consent-visitor id (#8438 D12) reach the api-client, so no caller can
|
|
24
|
-
* set its own `x-ailk-spoke-key` or `content-type`. With none of the three,
|
|
25
|
-
* `leads.submit` is called with one argument.
|
|
26
|
-
*
|
|
27
|
-
* Never throws. The api-client's own result passes through unchanged, so a
|
|
28
|
-
* caller still reads the API's 503 `lead_capture_not_configured`. A thrown
|
|
29
|
-
* submit — the API could not be reached — resolves as
|
|
30
|
-
* `{ ok: false, status: 0, body: null }` and logs the error's NAME only: its
|
|
31
|
-
* message could echo the payload.
|
|
32
|
-
*/
|
|
33
|
-
import { leads } from "@working-theory/api-client";
|
|
34
|
-
import { LEAD_SITE_MARKER_KEY } from "@working-theory/validation";
|
|
35
|
-
|
|
36
|
-
export interface LeadWriteInput {
|
|
37
|
-
source: string;
|
|
38
|
-
email: string;
|
|
39
|
-
/** The page key the marker carries, e.g. `contact` or `checkout`. */
|
|
40
|
-
page: string;
|
|
41
|
-
/** The visitor accepted the terms (#8730). Sent only when `true`. */
|
|
42
|
-
consent?: boolean;
|
|
43
|
-
payload?: Record<string, unknown>;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
type SubmitInit = Parameters<typeof leads.submit>[1];
|
|
47
|
-
type SubmitResult = Awaited<ReturnType<typeof leads.submit>>;
|
|
48
|
-
|
|
49
|
-
/** The only request headers a lead write forwards. */
|
|
50
|
-
const FORWARDED_HEADERS = [
|
|
51
|
-
"x-ailk-visitor-ip",
|
|
52
|
-
"x-ailk-visitor-forward-key",
|
|
53
|
-
"x-ailk-consent-visitor",
|
|
54
|
-
] as const;
|
|
55
|
-
|
|
56
|
-
function forwardOnly(init: SubmitInit): SubmitInit {
|
|
57
|
-
const headers: Record<string, string> = {};
|
|
58
|
-
for (const name of FORWARDED_HEADERS) {
|
|
59
|
-
const value = init?.headers?.[name];
|
|
60
|
-
if (typeof value === "string") headers[name] = value;
|
|
61
|
-
}
|
|
62
|
-
return Object.keys(headers).length > 0 ? { headers } : undefined;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** The site marker from configuration, or `undefined` when unset or blank. */
|
|
66
|
-
function leadSite(): string | undefined {
|
|
67
|
-
return process.env.AILK_LEAD_SITE?.trim() || undefined;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export async function writeLead(input: LeadWriteInput, init?: SubmitInit): Promise<SubmitResult> {
|
|
71
|
-
const site = leadSite();
|
|
72
|
-
const { [LEAD_SITE_MARKER_KEY]: _callerSite, ...callerPayload } = input.payload ?? {};
|
|
73
|
-
const body = {
|
|
74
|
-
source: input.source,
|
|
75
|
-
email: input.email,
|
|
76
|
-
...(input.consent === true && { consent: true }),
|
|
77
|
-
payload: {
|
|
78
|
-
...callerPayload,
|
|
79
|
-
...(site && { [LEAD_SITE_MARKER_KEY]: site }),
|
|
80
|
-
page: input.page,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
const forward = forwardOnly(init);
|
|
84
|
-
try {
|
|
85
|
-
return forward ? await leads.submit(body, forward) : await leads.submit(body);
|
|
86
|
-
} catch (err) {
|
|
87
|
-
console.error(`[lead-write] submit failed: ${err instanceof Error ? err.name : "unknown"}`);
|
|
88
|
-
return { ok: false, status: 0, body: null };
|
|
89
|
-
}
|
|
90
|
-
}
|
/package/templates/apps/web/{app/[locale]/contact → lib}/__tests__/site-contact-lines.test.ts
RENAMED
|
File without changes
|