@stackframe/react 2.8.63 → 2.8.64
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/components/team-switcher.js +1 -1
- package/dist/components/team-switcher.js.map +1 -1
- package/dist/components-page/account-settings/payments/payments-page.js +20 -5
- package/dist/components-page/account-settings/payments/payments-page.js.map +1 -1
- package/dist/components-page/account-settings.js +65 -3
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/components-page/cli-auth-confirm.js +1 -7
- package/dist/components-page/cli-auth-confirm.js.map +1 -1
- package/dist/esm/components/team-switcher.js +1 -1
- package/dist/esm/components/team-switcher.js.map +1 -1
- package/dist/esm/components-page/account-settings/payments/payments-page.js +21 -6
- package/dist/esm/components-page/account-settings/payments/payments-page.js.map +1 -1
- package/dist/esm/components-page/account-settings.js +66 -4
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/components-page/cli-auth-confirm.js +1 -7
- package/dist/esm/components-page/cli-auth-confirm.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components-page/account-settings.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { Skeleton, Typography } from '@stackframe/stack-ui';\nimport { Contact, ShieldCheck, Bell, Monitor, Key, Settings, CirclePlus, CreditCard } from 'lucide-react';\nimport React, { Suspense } from \"react\";\nimport { useStackApp, useUser } from '..';\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { SidebarLayout } from '../components/elements/sidebar-layout';\nimport { TeamIcon } from '../components/team-icon';\nimport { useTranslation } from \"../lib/translations\";\nimport { ActiveSessionsPage } from \"./account-settings/active-sessions/active-sessions-page\";\nimport { ApiKeysPage } from \"./account-settings/api-keys/api-keys-page\";\nimport { EmailsAndAuthPage } from './account-settings/email-and-auth/email-and-auth-page';\nimport { NotificationsPage } from './account-settings/notifications/notifications-page';\nimport { ProfilePage } from \"./account-settings/profile-page/profile-page\";\nimport { PaymentsPage } from \"./account-settings/payments/payments-page\";\nimport { SettingsPage } from './account-settings/settings/settings-page';\nimport { TeamCreationPage } from './account-settings/teams/team-creation-page';\nimport { TeamPage } from './account-settings/teams/team-page';\n\nconst iconMap = {\n Contact,\n ShieldCheck,\n Bell,\n Monitor,\n Key,\n Settings,\n CirclePlus,\n CreditCard,\n} as const;\n\nconst Icon = ({ name }: { name: keyof typeof iconMap }) => {\n const LucideIcon = iconMap[name];\n return <LucideIcon className=\"mr-2 h-4 w-4\"/>;\n};\n\nexport function AccountSettings(props: {\n fullPage?: boolean,\n extraItems?: ({\n title: string,\n content: React.ReactNode,\n id: string,\n } & ({\n icon?: React.ReactNode,\n } | {\n iconName?: keyof typeof iconMap,\n }))[],\n mockUser?: {\n displayName?: string,\n profileImageUrl?: string,\n },\n mockApiKeys?: Array<{\n id: string,\n description: string,\n createdAt: string,\n expiresAt?: string,\n manuallyRevokedAt?: string,\n }>,\n mockProject?: {\n config: {\n allowUserApiKeys: boolean,\n clientTeamCreationEnabled: boolean,\n },\n },\n mockSessions?: Array<{\n id: string,\n isCurrentSession: boolean,\n isImpersonation?: boolean,\n createdAt: string,\n lastUsedAt?: string,\n geoInfo?: {\n ip?: string,\n cityName?: string,\n },\n }>,\n}) {\n const { t } = useTranslation();\n const userFromHook = useUser({ or: props.mockUser ? 'return-null' : 'redirect' });\n const stackApp = useStackApp();\n const projectFromHook = stackApp.useProject();\n\n // Use mock data if provided, otherwise use real data\n const user = props.mockUser ? {\n useTeams: () => [], // Mock empty teams for now\n useBilling: () => ({ hasCustomer: false }), // Mock empty billing for now\n } : userFromHook;\n\n const project = props.mockProject || projectFromHook;\n const teams = user?.useTeams() || [];\n const billing = user?.useBilling() || null;\n\n // If we're not in mock mode and don't have a user, the useUser hook will handle redirect\n if (!props.mockUser && !userFromHook) {\n return null;\n }\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className=\"self-stretch flex-grow w-full\">\n <SidebarLayout\n items={([\n {\n title: t('My Profile'),\n type: 'item',\n id: 'profile',\n icon: <Icon name=\"Contact\"/>,\n content: <ProfilePage mockUser={props.mockUser}/>,\n },\n {\n title: t('Emails & Auth'),\n type: 'item',\n id: 'auth',\n icon: <Icon name=\"ShieldCheck\"/>,\n content: <Suspense fallback={<EmailsAndAuthPageSkeleton/>}>\n <EmailsAndAuthPage mockMode={!!props.mockUser}/>\n </Suspense>,\n },\n {\n title: t('Notifications'),\n type: 'item',\n id: 'notifications',\n icon: <Icon name=\"Bell\"/>,\n content: <Suspense fallback={<NotificationsPageSkeleton/>}>\n <NotificationsPage/>\n </Suspense>,\n },\n {\n title: t('Active Sessions'),\n type: 'item',\n id: 'sessions',\n icon: <Icon name=\"Monitor\"/>,\n content: <Suspense fallback={<ActiveSessionsPageSkeleton/>}>\n <ActiveSessionsPage mockSessions={props.mockSessions} mockMode={!!props.mockUser}/>\n </Suspense>,\n },\n ...(project.config.allowUserApiKeys ? [{\n title: t('API Keys'),\n type: 'item',\n id: 'api-keys',\n icon: <Icon name=\"Key\" />,\n content: <Suspense fallback={<ApiKeysPageSkeleton/>}>\n <ApiKeysPage mockApiKeys={props.mockApiKeys} mockMode={!!props.mockUser} />\n </Suspense>,\n }] as const : []),\n {\n title: t('Payments'),\n type: 'item',\n id: 'payments',\n icon: <Icon name=\"CreditCard\" />,\n content: <Suspense fallback={<PaymentsPageSkeleton/>}>\n <PaymentsPage mockMode={!!props.mockUser} />\n </Suspense>,\n },\n {\n title: t('Settings'),\n type: 'item',\n id: 'settings',\n icon: <Icon name=\"Settings\"/>,\n content: <SettingsPage mockMode={!!props.mockUser}/>,\n },\n ...(props.extraItems?.map(item => ({\n title: item.title,\n type: 'item',\n id: item.id,\n icon: (() => {\n const iconName = (item as any).iconName as keyof typeof iconMap | undefined;\n if (iconName) {\n return <Icon name={iconName}/>;\n } else if ((item as any).icon) {\n return (item as any).icon;\n }\n return null;\n })(),\n content: item.content,\n } as const)) || []),\n ...(teams.length > 0 || project.config.clientTeamCreationEnabled) ? [{\n title: t('Teams'),\n type: 'divider',\n }] as const : [],\n ...teams.map(team => ({\n title: <div className='flex gap-2 items-center w-full'>\n <TeamIcon team={team}/>\n <Typography className=\"max-w-[320px] md:w-[90%] truncate\">{team.displayName}</Typography>\n </div>,\n type: 'item',\n id: `team-${team.id}`,\n content: <Suspense fallback={<TeamPageSkeleton/>}>\n <TeamPage team={team}/>\n </Suspense>,\n } as const)),\n ...project.config.clientTeamCreationEnabled ? [{\n title: t('Create a team'),\n icon: <Icon name=\"CirclePlus\"/>,\n type: 'item',\n id: 'team-creation',\n content: <Suspense fallback={<TeamCreationSkeleton/>}>\n <TeamCreationPage mockMode={!!props.mockUser} />\n </Suspense>,\n }] as const : [],\n ] as const).filter((p) => p.type === 'divider' || (p as any).content )}\n title={t(\"Account Settings\")}\n />\n </div>\n </MaybeFullPage>\n );\n}\n\nfunction PageLayout(props: { children: React.ReactNode }) {\n return (\n <div className='flex flex-col gap-6'>\n {props.children}\n </div>\n );\n}\n\nfunction EmailsAndAuthPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n </PageLayout>;\n}\n\nfunction ActiveSessionsPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-6 w-48 mb-2\"/>\n <Skeleton className=\"h-4 w-full mb-4\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction ApiKeysPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction PaymentsPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-6 w-48 mb-2\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction TeamPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction TeamCreationSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n </PageLayout>;\n}\n\nfunction NotificationsPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n </PageLayout>;\n}\n"],"mappings":";;;AAOA,SAAS,UAAU,kBAAkB;AACrC,SAAS,SAAS,aAAa,MAAM,SAAS,KAAK,UAAU,YAAY,kBAAkB;AAC3F,SAAgB,gBAAgB;AAChC,SAAS,aAAa,eAAe;AACrC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AAehB,cAmJY,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EA,SAAS,4BAA4B;AACnC,SAAO,qBAAC,cACN;AAAA,wBAAC,YAAS,WAAU,mBAAiB;AAAA,IACrC,oBAAC,YAAS,WAAU,mBAAiB;AAAA,KACvC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components-page/account-settings.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { runAsynchronouslyWithAlert } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { Skeleton, Typography } from '@stackframe/stack-ui';\nimport { Contact, ShieldCheck, Bell, Monitor, Key, Settings, CirclePlus, CreditCard } from 'lucide-react';\nimport React, { Suspense, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useStackApp, useUser } from '..';\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { SidebarLayout } from '../components/elements/sidebar-layout';\nimport { TeamIcon } from '../components/team-icon';\nimport { useTranslation } from \"../lib/translations\";\nimport { ActiveSessionsPage } from \"./account-settings/active-sessions/active-sessions-page\";\nimport { ApiKeysPage } from \"./account-settings/api-keys/api-keys-page\";\nimport { EmailsAndAuthPage } from './account-settings/email-and-auth/email-and-auth-page';\nimport { NotificationsPage } from './account-settings/notifications/notifications-page';\nimport { ProfilePage } from \"./account-settings/profile-page/profile-page\";\nimport { PaymentsPage } from \"./account-settings/payments/payments-page\";\nimport { SettingsPage } from './account-settings/settings/settings-page';\nimport { TeamCreationPage } from './account-settings/teams/team-creation-page';\nimport { TeamPage } from './account-settings/teams/team-page';\n\nconst iconMap = {\n Contact,\n ShieldCheck,\n Bell,\n Monitor,\n Key,\n Settings,\n CirclePlus,\n CreditCard,\n} as const;\n\nconst Icon = ({ name }: { name: keyof typeof iconMap }) => {\n const LucideIcon = iconMap[name];\n return <LucideIcon className=\"mr-2 h-4 w-4\"/>;\n};\n\nexport function AccountSettings(props: {\n fullPage?: boolean,\n extraItems?: ({\n title: string,\n content: React.ReactNode,\n id: string,\n } & ({\n icon?: React.ReactNode,\n } | {\n iconName?: keyof typeof iconMap,\n }))[],\n mockUser?: {\n displayName?: string,\n profileImageUrl?: string,\n },\n mockApiKeys?: Array<{\n id: string,\n description: string,\n createdAt: string,\n expiresAt?: string,\n manuallyRevokedAt?: string,\n }>,\n mockProject?: {\n config: {\n allowUserApiKeys: boolean,\n clientTeamCreationEnabled: boolean,\n },\n },\n mockSessions?: Array<{\n id: string,\n isCurrentSession: boolean,\n isImpersonation?: boolean,\n createdAt: string,\n lastUsedAt?: string,\n geoInfo?: {\n ip?: string,\n cityName?: string,\n },\n }>,\n}) {\n const { t } = useTranslation();\n const userFromHook = useUser({ or: props.mockUser ? 'return-null' : 'redirect' });\n const stackApp = useStackApp();\n const projectFromHook = stackApp.useProject();\n\n // Use mock data if provided, otherwise use real data\n const user = props.mockUser ? {\n useTeams: () => [], // Mock empty teams for now\n useBilling: () => ({ hasCustomer: false }), // Mock empty billing for now\n } : userFromHook;\n\n const project = props.mockProject || projectFromHook;\n const teams = user?.useTeams() || [];\n const billing = user?.useBilling() || null;\n const teamsKey = useMemo(() => teams.map(team => team.id).join(\"|\"), [teams]);\n const teamsById = useMemo(() => teams, [teamsKey]);\n const userRef = useRef(userFromHook ?? null);\n const userId = userFromHook?.id ?? null;\n const [paymentsAvailability, setPaymentsAvailability] = useState<{\n userHasProducts: boolean,\n teamIdsWithProducts: Set<string>,\n isReady: boolean,\n }>(() => ({\n userHasProducts: false,\n teamIdsWithProducts: new Set<string>(),\n isReady: !!props.mockUser,\n }));\n\n useEffect(() => {\n userRef.current = userFromHook ?? null;\n }, [userFromHook]);\n\n useEffect(() => {\n if (props.mockUser || !userId) {\n return;\n }\n let cancelled = false;\n runAsynchronouslyWithAlert(async () => {\n const currentUser = userRef.current;\n if (!currentUser || currentUser.id !== userId) {\n return;\n }\n const [userProducts, teamsWithProducts] = await Promise.all([\n currentUser.listProducts({ limit: 1 }),\n Promise.all(teamsById.map(async (team) => {\n const isTeamAdmin = await currentUser.hasPermission(team, \"team_admin\");\n if (!isTeamAdmin) {\n return null;\n }\n const teamProducts = await team.listProducts({ limit: 1 });\n const hasTeamProducts = teamProducts.some((product) => product.customerType === \"team\");\n return hasTeamProducts ? team.id : null;\n })),\n ]);\n if (cancelled) {\n return;\n }\n const userHasProducts = userProducts.some((product) => product.customerType === \"user\");\n const teamIdsWithProducts = new Set<string>(teamsWithProducts.filter((id): id is string => id !== null));\n setPaymentsAvailability({\n userHasProducts,\n teamIdsWithProducts,\n isReady: true,\n });\n });\n return () => {\n cancelled = true;\n };\n }, [props.mockUser, teamsById, userId]);\n\n const teamsWithProducts = useMemo(\n () => teamsById.filter(team => paymentsAvailability.teamIdsWithProducts.has(team.id)),\n [paymentsAvailability.teamIdsWithProducts, teamsById],\n );\n const shouldShowPaymentsTab = props.mockUser\n || (paymentsAvailability.isReady\n && (paymentsAvailability.userHasProducts || teamsWithProducts.length > 0));\n\n // If we're not in mock mode and don't have a user, the useUser hook will handle redirect\n if (!props.mockUser && !userFromHook) {\n return null;\n }\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className=\"self-stretch flex-grow w-full\">\n <SidebarLayout\n items={([\n {\n title: t('My Profile'),\n type: 'item',\n id: 'profile',\n icon: <Icon name=\"Contact\"/>,\n content: <ProfilePage mockUser={props.mockUser}/>,\n },\n {\n title: t('Emails & Auth'),\n type: 'item',\n id: 'auth',\n icon: <Icon name=\"ShieldCheck\"/>,\n content: <Suspense fallback={<EmailsAndAuthPageSkeleton/>}>\n <EmailsAndAuthPage mockMode={!!props.mockUser}/>\n </Suspense>,\n },\n {\n title: t('Notifications'),\n type: 'item',\n id: 'notifications',\n icon: <Icon name=\"Bell\"/>,\n content: <Suspense fallback={<NotificationsPageSkeleton/>}>\n <NotificationsPage/>\n </Suspense>,\n },\n {\n title: t('Active Sessions'),\n type: 'item',\n id: 'sessions',\n icon: <Icon name=\"Monitor\"/>,\n content: <Suspense fallback={<ActiveSessionsPageSkeleton/>}>\n <ActiveSessionsPage mockSessions={props.mockSessions} mockMode={!!props.mockUser}/>\n </Suspense>,\n },\n ...(project.config.allowUserApiKeys ? [{\n title: t('API Keys'),\n type: 'item',\n id: 'api-keys',\n icon: <Icon name=\"Key\" />,\n content: <Suspense fallback={<ApiKeysPageSkeleton/>}>\n <ApiKeysPage mockApiKeys={props.mockApiKeys} mockMode={!!props.mockUser} />\n </Suspense>,\n }] as const : []),\n ...(shouldShowPaymentsTab ? [{\n title: t('Payments'),\n type: 'item',\n id: 'payments',\n icon: <Icon name=\"CreditCard\" />,\n content: <Suspense fallback={<PaymentsPageSkeleton/>}>\n <PaymentsPage\n mockMode={!!props.mockUser}\n allowPersonal={paymentsAvailability.userHasProducts}\n availableTeams={teamsWithProducts}\n />\n </Suspense>,\n }] as const : []),\n {\n title: t('Settings'),\n type: 'item',\n id: 'settings',\n icon: <Icon name=\"Settings\"/>,\n content: <SettingsPage mockMode={!!props.mockUser}/>,\n },\n ...(props.extraItems?.map(item => ({\n title: item.title,\n type: 'item',\n id: item.id,\n icon: (() => {\n const iconName = (item as any).iconName as keyof typeof iconMap | undefined;\n if (iconName) {\n return <Icon name={iconName}/>;\n } else if ((item as any).icon) {\n return (item as any).icon;\n }\n return null;\n })(),\n content: item.content,\n } as const)) || []),\n ...(teams.length > 0 || project.config.clientTeamCreationEnabled) ? [{\n title: t('Teams'),\n type: 'divider',\n }] as const : [],\n ...teams.map(team => ({\n title: <div className='flex gap-2 items-center w-full'>\n <TeamIcon team={team}/>\n <Typography className=\"max-w-[320px] md:w-[90%] truncate\">{team.displayName}</Typography>\n </div>,\n type: 'item',\n id: `team-${team.id}`,\n content: <Suspense fallback={<TeamPageSkeleton/>}>\n <TeamPage team={team}/>\n </Suspense>,\n } as const)),\n ...project.config.clientTeamCreationEnabled ? [{\n title: t('Create a team'),\n icon: <Icon name=\"CirclePlus\"/>,\n type: 'item',\n id: 'team-creation',\n content: <Suspense fallback={<TeamCreationSkeleton/>}>\n <TeamCreationPage mockMode={!!props.mockUser} />\n </Suspense>,\n }] as const : [],\n ] as const).filter((p) => p.type === 'divider' || (p as any).content )}\n title={t(\"Account Settings\")}\n />\n </div>\n </MaybeFullPage>\n );\n}\n\nfunction PageLayout(props: { children: React.ReactNode }) {\n return (\n <div className='flex flex-col gap-6'>\n {props.children}\n </div>\n );\n}\n\nfunction EmailsAndAuthPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n </PageLayout>;\n}\n\nfunction ActiveSessionsPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-6 w-48 mb-2\"/>\n <Skeleton className=\"h-4 w-full mb-4\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction ApiKeysPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction PaymentsPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-6 w-48 mb-2\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction TeamPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-[200px] w-full mt-1 rounded-md\"/>\n </PageLayout>;\n}\n\nfunction TeamCreationSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n </PageLayout>;\n}\n\nfunction NotificationsPageSkeleton() {\n return <PageLayout>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n <Skeleton className=\"h-9 w-full mt-1\"/>\n </PageLayout>;\n}\n"],"mappings":";;;AAOA,SAAS,kCAAkC;AAC3C,SAAS,UAAU,kBAAkB;AACrC,SAAS,SAAS,aAAa,MAAM,SAAS,KAAK,UAAU,YAAY,kBAAkB;AAC3F,SAAgB,UAAuB,WAAW,SAAS,QAAQ,gBAAgB;AACnF,SAAS,aAAa,eAAe;AACrC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AAehB,cAsNY,YAtNZ;AAbT,IAAM,UAAU;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,OAAO,CAAC,EAAE,KAAK,MAAsC;AACzD,QAAM,aAAa,QAAQ,IAAI;AAC/B,SAAO,oBAAC,cAAW,WAAU,gBAAc;AAC7C;AAEO,SAAS,gBAAgB,OAuC7B;AACD,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,eAAe,QAAQ,EAAE,IAAI,MAAM,WAAW,gBAAgB,WAAW,CAAC;AAChF,QAAM,WAAW,YAAY;AAC7B,QAAM,kBAAkB,SAAS,WAAW;AAG5C,QAAM,OAAO,MAAM,WAAW;AAAA,IAC5B,UAAU,MAAM,CAAC;AAAA;AAAA,IACjB,YAAY,OAAO,EAAE,aAAa,MAAM;AAAA;AAAA,EAC1C,IAAI;AAEJ,QAAM,UAAU,MAAM,eAAe;AACrC,QAAM,QAAQ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AACnC,SAAO,qBAAC,cACN;AAAA,wBAAC,YAAS,WAAU,mBAAiB;AAAA,IACrC,oBAAC,YAAS,WAAU,mBAAiB;AAAA,KACvC;AACF;","names":["teamsWithProducts"]}
|
|
@@ -54,9 +54,7 @@ function CliAuthConfirmation({ fullPage = true }) {
|
|
|
54
54
|
{
|
|
55
55
|
title: t("CLI Authorization Successful"),
|
|
56
56
|
fullPage,
|
|
57
|
-
|
|
58
|
-
primaryAction: () => window.close(),
|
|
59
|
-
children: /* @__PURE__ */ jsx(Typography, { children: t("The CLI application has been authorized successfully. You can now close this window and return to the command line.") })
|
|
57
|
+
children: /* @__PURE__ */ jsx(Typography, { children: t("The CLI application has been authorized successfully. You can close this window and return to the command line.") })
|
|
60
58
|
}
|
|
61
59
|
);
|
|
62
60
|
}
|
|
@@ -68,8 +66,6 @@ function CliAuthConfirmation({ fullPage = true }) {
|
|
|
68
66
|
fullPage,
|
|
69
67
|
primaryButtonText: t("Try Again"),
|
|
70
68
|
primaryAction: () => setError(null),
|
|
71
|
-
secondaryButtonText: t("Cancel"),
|
|
72
|
-
secondaryAction: () => window.close(),
|
|
73
69
|
children: [
|
|
74
70
|
/* @__PURE__ */ jsx(Typography, { className: "text-red-600", children: t("Failed to authorize the CLI application:") }),
|
|
75
71
|
/* @__PURE__ */ jsx(Typography, { className: "text-red-600", children: error.message })
|
|
@@ -84,8 +80,6 @@ function CliAuthConfirmation({ fullPage = true }) {
|
|
|
84
80
|
fullPage,
|
|
85
81
|
primaryButtonText: authorizing ? t("Authorizing...") : t("Authorize"),
|
|
86
82
|
primaryAction: handleAuthorize,
|
|
87
|
-
secondaryButtonText: t("Cancel"),
|
|
88
|
-
secondaryAction: () => window.close(),
|
|
89
83
|
children: [
|
|
90
84
|
/* @__PURE__ */ jsx(Typography, { children: t("A command line application is requesting access to your account. Click the button below to authorize it.") }),
|
|
91
85
|
/* @__PURE__ */ jsx(Typography, { variant: "destructive", children: t("WARNING: Make sure you trust the command line application, as it will gain access to your account. If you did not initiate this request, you can close this page and ignore it. We will never send you this link via email or any other means.") })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components-page/cli-auth-confirm.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { Typography } from \"@stackframe/stack-ui\";\nimport { useState } from \"react\";\nimport { stackAppInternalsSymbol, useStackApp } from \"..\";\nimport { MessageCard } from \"../components/message-cards/message-card\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function CliAuthConfirmation({ fullPage = true }: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const app = useStackApp();\n const [authorizing, setAuthorizing] = useState(false);\n const [success, setSuccess] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const user = app.useUser({ or: \"redirect\" });\n\n const handleAuthorize = async () => {\n if (authorizing) return;\n\n setAuthorizing(true);\n try {\n // Get login code from URL query parameters\n const urlParams = new URLSearchParams(window.location.search);\n const loginCode = urlParams.get(\"login_code\");\n\n if (!loginCode) {\n throw new Error(\"Missing login code in URL parameters\");\n }\n const refreshToken = (await user.currentSession.getTokens()).refreshToken;\n if (!refreshToken) {\n throw new Error(\"You must be logged in to authorize CLI access\");\n }\n\n // Use the internal API to send the CLI login request\n const result = await (app as any)[stackAppInternalsSymbol].sendRequest(\"/auth/cli/complete\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n login_code: loginCode,\n refresh_token: (await user.currentSession.getTokens()).refreshToken\n })\n });\n\n if (!result.ok) {\n throw new Error(`Authorization failed: ${result.status} ${await result.text()}`);\n }\n\n setSuccess(true);\n } catch (err) {\n setError(err as Error);\n } finally {\n setAuthorizing(false);\n }\n };\n\n if (success) {\n return (\n <MessageCard\n title={t(\"CLI Authorization Successful\")}\n fullPage={fullPage}\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components-page/cli-auth-confirm.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { Typography } from \"@stackframe/stack-ui\";\nimport { useState } from \"react\";\nimport { stackAppInternalsSymbol, useStackApp } from \"..\";\nimport { MessageCard } from \"../components/message-cards/message-card\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function CliAuthConfirmation({ fullPage = true }: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const app = useStackApp();\n const [authorizing, setAuthorizing] = useState(false);\n const [success, setSuccess] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const user = app.useUser({ or: \"redirect\" });\n\n const handleAuthorize = async () => {\n if (authorizing) return;\n\n setAuthorizing(true);\n try {\n // Get login code from URL query parameters\n const urlParams = new URLSearchParams(window.location.search);\n const loginCode = urlParams.get(\"login_code\");\n\n if (!loginCode) {\n throw new Error(\"Missing login code in URL parameters\");\n }\n const refreshToken = (await user.currentSession.getTokens()).refreshToken;\n if (!refreshToken) {\n throw new Error(\"You must be logged in to authorize CLI access\");\n }\n\n // Use the internal API to send the CLI login request\n const result = await (app as any)[stackAppInternalsSymbol].sendRequest(\"/auth/cli/complete\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n login_code: loginCode,\n refresh_token: (await user.currentSession.getTokens()).refreshToken\n })\n });\n\n if (!result.ok) {\n throw new Error(`Authorization failed: ${result.status} ${await result.text()}`);\n }\n\n setSuccess(true);\n } catch (err) {\n setError(err as Error);\n } finally {\n setAuthorizing(false);\n }\n };\n\n if (success) {\n return (\n <MessageCard\n title={t(\"CLI Authorization Successful\")}\n fullPage={fullPage}\n >\n <Typography>\n {t(\"The CLI application has been authorized successfully. You can close this window and return to the command line.\")}\n </Typography>\n </MessageCard>\n );\n }\n\n if (error) {\n return (\n <MessageCard\n title={t(\"Authorization Failed\")}\n fullPage={fullPage}\n primaryButtonText={t(\"Try Again\")}\n primaryAction={() => setError(null)}\n >\n <Typography className=\"text-red-600\">\n {t(\"Failed to authorize the CLI application:\")}\n </Typography>\n <Typography className=\"text-red-600\">\n {error.message}\n </Typography>\n </MessageCard>\n );\n }\n\n return (\n <MessageCard\n title={t(\"Authorize CLI Application\")}\n fullPage={fullPage}\n primaryButtonText={authorizing ? t(\"Authorizing...\") : t(\"Authorize\")}\n primaryAction={handleAuthorize}\n >\n <Typography>\n {t(\"A command line application is requesting access to your account. Click the button below to authorize it.\")}\n </Typography>\n <Typography variant=\"destructive\">\n {t(\"WARNING: Make sure you trust the command line application, as it will gain access to your account. If you did not initiate this request, you can close this page and ignore it. We will never send you this link via email or any other means.\")}\n </Typography>\n </MessageCard>\n );\n}\n"],"mappings":";;;AAOA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,yBAAyB,mBAAmB;AACrD,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AA0DvB,cASF,YATE;AAxDD,SAAS,oBAAoB,EAAE,WAAW,KAAK,GAA2B;AAC/E,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,MAAM,YAAY;AACxB,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AACpD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAuB,IAAI;AAErD,QAAM,OAAO,IAAI,QAAQ,EAAE,IAAI,WAAW,CAAC;AAE3C,QAAM,kBAAkB,YAAY;AAClC,QAAI,YAAa;AAEjB,mBAAe,IAAI;AACnB,QAAI;AAEF,YAAM,YAAY,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAC5D,YAAM,YAAY,UAAU,IAAI,YAAY;AAE5C,UAAI,CAAC,WAAW;AACd,cAAM,IAAI,MAAM,sCAAsC;AAAA,MACxD;AACA,YAAM,g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A,MAEf;AAAA,4BAAC,cACE,YAAE,0GAA0G,GAC/G;AAAA,QACA,oBAAC,cAAW,SAAQ,eACjB,YAAE,gPAAgP,GACrP;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -10,7 +10,7 @@ import { Store } from "@stackframe/stack-shared/dist/utils/stores";
|
|
|
10
10
|
import React, { useCallback } from "react";
|
|
11
11
|
import { stackAppInternalsSymbol } from "../../common.js";
|
|
12
12
|
var process = globalThis.process ?? { env: {} };
|
|
13
|
-
var clientVersion = "js @stackframe/react@2.8.
|
|
13
|
+
var clientVersion = "js @stackframe/react@2.8.64";
|
|
14
14
|
if (clientVersion.startsWith("STACK_COMPILE_TIME")) {
|
|
15
15
|
throw new StackAssertionError("Client version was not replaced. Something went wrong during build!");
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/lib/stack-app/apps/implementations/common.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { AsyncCache } from \"@stackframe/stack-shared/dist/utils/caches\";\nimport { isBrowserLike } from \"@stackframe/stack-shared/dist/utils/env\";\nimport { StackAssertionError, concatStacktraces, throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\nimport { getGlobal } from \"@stackframe/stack-shared/dist/utils/globals\";\nimport { filterUndefined, omit } from \"@stackframe/stack-shared/dist/utils/objects\";\nimport { ReactPromise } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { suspendIfSsr, use } from \"@stackframe/stack-shared/dist/utils/react\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { Store } from \"@stackframe/stack-shared/dist/utils/stores\";\nimport React, { useCallback } from \"react\"; // THIS_LINE_PLATFORM react-like\nimport { HandlerUrls, stackAppInternalsSymbol } from \"../../common\";\n\n// hack to make sure process is defined in non-node environments\nconst process = (globalThis as any).process ?? { env: {} }; // THIS_LINE_PLATFORM js react\n\nexport const clientVersion = \"js @stackframe/react@2.8.63\";\nif (clientVersion.startsWith(\"STACK_COMPILE_TIME\")) {\n throw new StackAssertionError(\"Client version was not replaced. Something went wrong during build!\");\n}\n\nconst replaceStackPortPrefix = <T extends string | undefined>(input: T): T => {\n if (!input) return input;\n const prefix = process.env.NEXT_PUBLIC_STACK_PORT_PREFIX;\n return prefix ? input.replace(/\\$\\{NEXT_PUBLIC_STACK_PORT_PREFIX:-81\\}/g, prefix) as T : input;\n};\n\n\nexport const createCache = <D extends any[], T>(fetcher: (dependencies: D) => Promise<T>) => {\n return new AsyncCache<D, Result<T>>(\n async (dependencies) => await Result.fromThrowingAsync(async () => await fetcher(dependencies)),\n {},\n );\n};\n\nexport const createCacheBySession = <D extends any[], T>(fetcher: (session: InternalSession, extraDependencies: D) => Promise<T> ) => {\n return new AsyncCache<[InternalSession, ...D], Result<T>>(\n async ([session, ...extraDependencies]) => await Result.fromThrowingAsync(async () => await fetcher(session, extraDependencies)),\n {\n onSubscribe: ([session], refresh) => {\n const handler = session.onInvalidate(() => refresh());\n return () => handler.unsubscribe();\n },\n },\n );\n};\n\n\ntype AppLike = { [stackAppInternalsSymbol]: { getConstructorOptions: () => any } };\nexport function resolveConstructorOptions<T extends { inheritsFrom?: AppLike }>(options: T): T & { inheritsFrom?: undefined } {\n return {\n ...options.inheritsFrom?.[stackAppInternalsSymbol].getConstructorOptions() ?? {},\n ...filterUndefined(omit(options, [\"inheritsFrom\"])),\n };\n}\n\nexport function getUrls(partial: Partial<HandlerUrls>): HandlerUrls {\n const handler = partial.handler ?? \"/handler\";\n const home = partial.home ?? \"/\";\n const afterSignIn = partial.afterSignIn ?? home;\n return {\n handler,\n signIn: `${handler}/sign-in`,\n afterSignIn: home,\n signUp: `${handler}/sign-up`,\n afterSignUp: afterSignIn,\n signOut: `${handler}/sign-out`,\n afterSignOut: home,\n emailVerification: `${handler}/email-verification`,\n passwordReset: `${handler}/password-reset`,\n forgotPassword: `${handler}/forgot-password`,\n oauthCallback: `${handler}/oauth-callback`,\n magicLinkCallback: `${handler}/magic-link-callback`,\n home: home,\n accountSettings: `${handler}/account-settings`,\n error: `${handler}/error`,\n teamInvitation: `${handler}/team-invitation`,\n mfa: `${handler}/mfa`,\n onboarding: `${handler}/onboarding`,\n ...filterUndefined(partial),\n };\n}\n\nexport function getDefaultProjectId() {\n return process.env.NEXT_PUBLIC_STACK_PROJECT_ID || process.env.STACK_PROJECT_ID || throwErr(new Error(\"Welcome to Stack Auth! It seems that you haven't provided a project ID. Please create a project on the Stack dashboard at https://app.stack-auth.com and put it in the NEXT_PUBLIC_STACK_PROJECT_ID environment variable.\"));\n}\n\nexport function getDefaultPublishableClientKey() {\n return process.env.NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY || process.env.STACK_PUBLISHABLE_CLIENT_KEY || throwErr(new Error(\"Welcome to Stack Auth! It seems that you haven't provided a publishable client key. Please create an API key for your project on the Stack dashboard at https://app.stack-auth.com and copy your publishable client key into the NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY environment variable.\"));\n}\n\nexport function getDefaultSecretServerKey() {\n return process.env.STACK_SECRET_SERVER_KEY || throwErr(new Error(\"No secret server key provided. Please copy your key from the Stack dashboard and put it in the STACK_SECRET_SERVER_KEY environment variable.\"));\n}\n\nexport function getDefaultSuperSecretAdminKey() {\n return process.env.STACK_SUPER_SECRET_ADMIN_KEY || throwErr(new Error(\"No super secret admin key provided. Please copy your key from the Stack dashboard and put it in the STACK_SUPER_SECRET_ADMIN_KEY environment variable.\"));\n}\n\nexport function getDefaultExtraRequestHeaders() {\n return JSON.parse(process.env.NEXT_PUBLIC_STACK_EXTRA_REQUEST_HEADERS || process.env.STACK_EXTRA_REQUEST_HEADERS || '{}');\n}\n\n/**\n * Returns the base URL for the Stack API.\n *\n * The URL can be specified in several ways, in order of precedence:\n * 1. Directly through userSpecifiedBaseUrl parameter as string or browser/server object\n * 2. Through environment variables:\n * - Browser: NEXT_PUBLIC_BROWSER_STACK_API_URL\n * - Server: NEXT_PUBLIC_SERVER_STACK_API_URL\n * - Fallback: NEXT_PUBLIC_STACK_API_URL or NEXT_PUBLIC_STACK_URL\n * 3. Default base URL if none of the above are specified\n *\n * The function also ensures the URL doesn't end with a trailing slash\n * by removing it if present.\n *\n * @param userSpecifiedBaseUrl - Optional URL override as string or {browser, server} object\n * @returns The configured base URL without trailing slash\n\n */\nexport function getBaseUrl(userSpecifiedBaseUrl: string | { browser: string, server: string } | undefined) {\n let url;\n if (userSpecifiedBaseUrl) {\n if (typeof userSpecifiedBaseUrl === \"string\") {\n url = userSpecifiedBaseUrl;\n } else {\n if (isBrowserLike()) {\n url = userSpecifiedBaseUrl.browser;\n } else {\n url = userSpecifiedBaseUrl.server;\n }\n }\n } else {\n // note: NEXT_PUBLIC_BROWSER_STACK_API_URL was renamed to NEXT_PUBLIC_STACK_API_URL_BROWSER, and NEXT_PUBLIC_STACK_URL to NEXT_PUBLIC_STACK_API_URL\n if (isBrowserLike()) {\n url = process.env.NEXT_PUBLIC_BROWSER_STACK_API_URL || process.env.NEXT_PUBLIC_STACK_API_URL_BROWSER || process.env.STACK_API_URL_BROWSER;\n } else {\n url = process.env.NEXT_PUBLIC_SERVER_STACK_API_URL || process.env.NEXT_PUBLIC_STACK_API_URL_SERVER || process.env.STACK_API_URL_SERVER;\n }\n url = url || process.env.NEXT_PUBLIC_STACK_API_URL || process.env.STACK_API_URL || process.env.NEXT_PUBLIC_STACK_URL || defaultBaseUrl;\n }\n\n return replaceStackPortPrefix(url.endsWith('/') ? url.slice(0, -1) : url);\n}\nexport const defaultBaseUrl = \"https://api.stack-auth.com\";\n\nexport type TokenObject = {\n accessToken: string | null,\n refreshToken: string | null,\n};\n\nexport function createEmptyTokenStore() {\n return new Store<TokenObject>({\n refreshToken: null,\n accessToken: null,\n });\n}\n\n\nconst cachePromiseByHookId = new Map<string, ReactPromise<Result<unknown>>>();\nexport function useAsyncCache<D extends any[], T>(cache: AsyncCache<D, Result<T>>, dependencies: D, caller: string): T {\n // we explicitly don't want to run this hook in SSR\n suspendIfSsr(caller);\n\n // on the dashboard, we do some perf monitoring for pre-fetching which should hook right in here\n const asyncCacheHooks: any[] = getGlobal(\"use-async-cache-execution-hooks\") ?? [];\n for (const hook of asyncCacheHooks) {\n hook({ cache, caller, dependencies });\n }\n\n const id = React.useId();\n\n // whenever the dependencies change, we need to refresh the promise cache\n React.useEffect(() => {\n cachePromiseByHookId.delete(id);\n }, [...dependencies, id]);\n\n const subscribe = useCallback((cb: () => void) => {\n const { unsubscribe } = cache.onStateChange(dependencies, () => {\n cachePromiseByHookId.delete(id);\n cb();\n });\n return unsubscribe;\n }, [cache, ...dependencies]);\n const getSnapshot = useCallback(() => {\n // React checks whether a promise passed to `use` is still the same as the previous one by comparing the reference.\n // If we didn't cache here, this wouldn't work because the promise would be recreated every time the value changes.\n if (!cachePromiseByHookId.has(id)) {\n cachePromiseByHookId.set(id, cache.getOrWait(dependencies, \"read-write\"));\n }\n return cachePromiseByHookId.get(id) as ReactPromise<Result<T>>;\n }, [cache, ...dependencies]);\n\n // note: we must use React.useSyncExternalStore instead of importing the function directly, as it will otherwise\n // throw an error on Next.js (\"can't import useSyncExternalStore from the server\")\n const promise = React.useSyncExternalStore(\n subscribe,\n getSnapshot,\n () => throwErr(new Error(\"getServerSnapshot should never be called in useAsyncCache because we restrict to CSR earlier\"))\n );\n\n const result = use(promise);\n if (result.status === \"error\") {\n const error = result.error;\n if (error instanceof Error && !(error as any).__stackHasConcatenatedStacktraces) {\n concatStacktraces(error, new Error());\n (error as any).__stackHasConcatenatedStacktraces = true;\n }\n throw error;\n }\n return result.data;\n}\n"],"mappings":";AAKA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB,mBAAmB,gBAAgB;AACjE,SAAS,iBAAiB;AAC1B,SAAS,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ACjC,2BAAqB,IAAI,IAAI,MAAM,UAAU,cAAc,YAAY,CAAC;AAAA,IAC1E;AACA,WAAO,qBAAqB,IAAI,EAAE;AAAA,EACpC,GAAG,CAAC,OAAO,GAAG,YAAY,CAAC;AAI3B,QAAM,UAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA,MAAM,SAAS,IAAI,MAAM,8FAA8F,CAAC;AAAA,EAC1H;AAEA,QAAM,SAAS,IAAI,OAAO;AAC1B,MAAI,OAAO,WAAW,SAAS;AAC7B,UAAM,QAAQ,OAAO;AACrB,QAAI,iBAAiB,SAAS,CAAE,MAAc,mCAAmC;AAC/E,wBAAkB,OAAO,IAAI,MAAM,CAAC;AACpC,MAAC,MAAc,oCAAoC;AAAA,IACrD;AACA,UAAM;AAAA,EACR;AACA,SAAO,OAAO;AAChB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/lib/stack-app/apps/implementations/common.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { AsyncCache } from \"@stackframe/stack-shared/dist/utils/caches\";\nimport { isBrowserLike } from \"@stackframe/stack-shared/dist/utils/env\";\nimport { StackAssertionError, concatStacktraces, throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\nimport { getGlobal } from \"@stackframe/stack-shared/dist/utils/globals\";\nimport { filterUndefined, omit } from \"@stackframe/stack-shared/dist/utils/objects\";\nimport { ReactPromise } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { suspendIfSsr, use } from \"@stackframe/stack-shared/dist/utils/react\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { Store } from \"@stackframe/stack-shared/dist/utils/stores\";\nimport React, { useCallback } from \"react\"; // THIS_LINE_PLATFORM react-like\nimport { HandlerUrls, stackAppInternalsSymbol } from \"../../common\";\n\n// hack to make sure process is defined in non-node environments\nconst process = (globalThis as any).process ?? { env: {} }; // THIS_LINE_PLATFORM js react\n\nexport const clientVersion = \"js @stackframe/react@2.8.64\";\nif (clientVersion.startsWith(\"STACK_COMPILE_TIME\")) {\n throw new StackAssertionError(\"Client version was not replaced. Something went wrong during build!\");\n}\n\nconst replaceStackPortPrefix = <T extends string | undefined>(input: T): T => {\n if (!input) return input;\n const prefix = process.env.NEXT_PUBLIC_STACK_PORT_PREFIX;\n return prefix ? input.replace(/\\$\\{NEXT_PUBLIC_STACK_PORT_PREFIX:-81\\}/g, prefix) as T : input;\n};\n\n\nexport const createCache = <D extends any[], T>(fetcher: (dependencies: D) => Promise<T>) => {\n return new AsyncCache<D, Result<T>>(\n async (dependencies) => await Result.fromThrowingAsync(async () => await fetcher(dependencies)),\n {},\n );\n};\n\nexport const createCacheBySession = <D extends any[], T>(fetcher: (session: InternalSession, extraDependencies: D) => Promise<T> ) => {\n return new AsyncCache<[InternalSession, ...D], Result<T>>(\n async ([session, ...extraDependencies]) => await Result.fromThrowingAsync(async () => await fetcher(session, extraDependencies)),\n {\n onSubscribe: ([session], refresh) => {\n const handler = session.onInvalidate(() => refresh());\n return () => handler.unsubscribe();\n },\n },\n );\n};\n\n\ntype AppLike = { [stackAppInternalsSymbol]: { getConstructorOptions: () => any } };\nexport function resolveConstructorOptions<T extends { inheritsFrom?: AppLike }>(options: T): T & { inheritsFrom?: undefined } {\n return {\n ...options.inheritsFrom?.[stackAppInternalsSymbol].getConstructorOptions() ?? {},\n ...filterUndefined(omit(options, [\"inheritsFrom\"])),\n };\n}\n\nexport function getUrls(partial: Partial<HandlerUrls>): HandlerUrls {\n const handler = partial.handler ?? \"/handler\";\n const home = partial.home ?? \"/\";\n const afterSignIn = partial.afterSignIn ?? home;\n return {\n handler,\n signIn: `${handler}/sign-in`,\n afterSignIn: home,\n signUp: `${handler}/sign-up`,\n afterSignUp: afterSignIn,\n signOut: `${handler}/sign-out`,\n afterSignOut: home,\n emailVerification: `${handler}/email-verification`,\n passwordReset: `${handler}/password-reset`,\n forgotPassword: `${handler}/forgot-password`,\n oauthCallback: `${handler}/oauth-callback`,\n magicLinkCallback: `${handler}/magic-link-callback`,\n home: home,\n accountSettings: `${handler}/account-settings`,\n error: `${handler}/error`,\n teamInvitation: `${handler}/team-invitation`,\n mfa: `${handler}/mfa`,\n onboarding: `${handler}/onboarding`,\n ...filterUndefined(partial),\n };\n}\n\nexport function getDefaultProjectId() {\n return process.env.NEXT_PUBLIC_STACK_PROJECT_ID || process.env.STACK_PROJECT_ID || throwErr(new Error(\"Welcome to Stack Auth! It seems that you haven't provided a project ID. Please create a project on the Stack dashboard at https://app.stack-auth.com and put it in the NEXT_PUBLIC_STACK_PROJECT_ID environment variable.\"));\n}\n\nexport function getDefaultPublishableClientKey() {\n return process.env.NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY || process.env.STACK_PUBLISHABLE_CLIENT_KEY || throwErr(new Error(\"Welcome to Stack Auth! It seems that you haven't provided a publishable client key. Please create an API key for your project on the Stack dashboard at https://app.stack-auth.com and copy your publishable client key into the NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY environment variable.\"));\n}\n\nexport function getDefaultSecretServerKey() {\n return process.env.STACK_SECRET_SERVER_KEY || throwErr(new Error(\"No secret server key provided. Please copy your key from the Stack dashboard and put it in the STACK_SECRET_SERVER_KEY environment variable.\"));\n}\n\nexport function getDefaultSuperSecretAdminKey() {\n return process.env.STACK_SUPER_SECRET_ADMIN_KEY || throwErr(new Error(\"No super secret admin key provided. Please copy your key from the Stack dashboard and put it in the STACK_SUPER_SECRET_ADMIN_KEY environment variable.\"));\n}\n\nexport function getDefaultExtraRequestHeaders() {\n return JSON.parse(process.env.NEXT_PUBLIC_STACK_EXTRA_REQUEST_HEADERS || process.env.STACK_EXTRA_REQUEST_HEADERS || '{}');\n}\n\n/**\n * Returns the base URL for the Stack API.\n *\n * The URL can be specified in several ways, in order of precedence:\n * 1. Directly through userSpecifiedBaseUrl parameter as string or browser/server object\n * 2. Through environment variables:\n * - Browser: NEXT_PUBLIC_BROWSER_STACK_API_URL\n * - Server: NEXT_PUBLIC_SERVER_STACK_API_URL\n * - Fallback: NEXT_PUBLIC_STACK_API_URL or NEXT_PUBLIC_STACK_URL\n * 3. Default base URL if none of the above are specified\n *\n * The function also ensures the URL doesn't end with a trailing slash\n * by removing it if present.\n *\n * @param userSpecifiedBaseUrl - Optional URL override as string or {browser, server} object\n * @returns The configured base URL without trailing slash\n\n */\nexport function getBaseUrl(userSpecifiedBaseUrl: string | { browser: string, server: string } | undefined) {\n let url;\n if (userSpecifiedBaseUrl) {\n if (typeof userSpecifiedBaseUrl === \"string\") {\n url = userSpecifiedBaseUrl;\n } else {\n if (isBrowserLike()) {\n url = userSpecifiedBaseUrl.browser;\n } else {\n url = userSpecifiedBaseUrl.server;\n }\n }\n } else {\n // note: NEXT_PUBLIC_BROWSER_STACK_API_URL was renamed to NEXT_PUBLIC_STACK_API_URL_BROWSER, and NEXT_PUBLIC_STACK_URL to NEXT_PUBLIC_STACK_API_URL\n if (isBrowserLike()) {\n url = process.env.NEXT_PUBLIC_BROWSER_STACK_API_URL || process.env.NEXT_PUBLIC_STACK_API_URL_BROWSER || process.env.STACK_API_URL_BROWSER;\n } else {\n url = process.env.NEXT_PUBLIC_SERVER_STACK_API_URL || process.env.NEXT_PUBLIC_STACK_API_URL_SERVER || process.env.STACK_API_URL_SERVER;\n }\n url = url || process.env.NEXT_PUBLIC_STACK_API_URL || process.env.STACK_API_URL || process.env.NEXT_PUBLIC_STACK_URL || defaultBaseUrl;\n }\n\n return replaceStackPortPrefix(url.endsWith('/') ? url.slice(0, -1) : url);\n}\nexport const defaultBaseUrl = \"https://api.stack-auth.com\";\n\nexport type TokenObject = {\n accessToken: string | null,\n refreshToken: string | null,\n};\n\nexport function createEmptyTokenStore() {\n return new Store<TokenObject>({\n refreshToken: null,\n accessToken: null,\n });\n}\n\n\nconst cachePromiseByHookId = new Map<string, ReactPromise<Result<unknown>>>();\nexport function useAsyncCache<D extends any[], T>(cache: AsyncCache<D, Result<T>>, dependencies: D, caller: string): T {\n // we explicitly don't want to run this hook in SSR\n suspendIfSsr(caller);\n\n // on the dashboard, we do some perf monitoring for pre-fetching which should hook right in here\n const asyncCacheHooks: any[] = getGlobal(\"use-async-cache-execution-hooks\") ?? [];\n for (const hook of asyncCacheHooks) {\n hook({ cache, caller, dependencies });\n }\n\n const id = React.useId();\n\n // whenever the dependencies change, we need to refresh the promise cache\n React.useEffect(() => {\n cachePromiseByHookId.delete(id);\n }, [...dependencies, id]);\n\n const subscribe = useCallback((cb: () => void) => {\n const { unsubscribe } = cache.onStateChange(dependencies, () => {\n cachePromiseByHookId.delete(id);\n cb();\n });\n return unsubscribe;\n }, [cache, ...dependencies]);\n const getSnapshot = useCallback(() => {\n // React checks whether a promise passed to `use` is still the same as the previous one by comparing the reference.\n // If we didn't cache here, this wouldn't work because the promise would be recreated every time the value changes.\n if (!cachePromiseByHookId.has(id)) {\n cachePromiseByHookId.set(id, cache.getOrWait(dependencies, \"read-write\"));\n }\n return cachePromiseByHookId.get(id) as ReactPromise<Result<T>>;\n }, [cache, ...dependencies]);\n\n // note: we must use React.useSyncExternalStore instead of importing the function directly, as it will otherwise\n // throw an error on Next.js (\"can't import useSyncExternalStore from the server\")\n const promise = React.useSyncExternalStore(\n subscribe,\n getSnapshot,\n () => throwErr(new Error(\"getServerSnapshot should never be called in useAsyncCache because we restrict to CSR earlier\"))\n );\n\n const result = use(promise);\n if (result.status === \"error\") {\n const error = result.error;\n if (error instanceof Error && !(error as any).__stackHasConcatenatedStacktraces) {\n concatStacktraces(error, new Error());\n (error as any).__stackHasConcatenatedStacktraces = true;\n }\n throw error;\n }\n return result.data;\n}\n"],"mappings":";AAKA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB,mBAAmB,gBAAgB;AACjE,SAAS,iBAAiB;AAC1B,SAAS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