Compare commits

...

16 Commits

Author SHA1 Message Date
Jin Yi
6dbe00d47c fix: prevent logged-in users from accessing login page unless switching accounts (#6478)
## Summary
- Prevents logged-in users from viewing the login page unnecessarily  
- Adds explicit account switching flow with query parameter
- Fixes issue where logged-in users could see the login page when
directly navigating to `/cloud/login`

## Changes
1. Added `beforeEnter` guard to `cloud-login` route to check
authentication status
2. Redirect authenticated users to `cloud-user-check` (which handles
survey, waitlist, and main page routing)
3. Added `switchAccount` query parameter to allow intentional access to
login page for account switching
4. Updated CloudClaimInviteView and CloudWaitlistView to include the
`switchAccount` parameter when users click "Switch accounts"
5. Reverted UserCheckView to use `window.location.href = '/'` instead of
`router.replace('/')` to prevent infinite loading issue

## Context
The change in UserCheckView reverts to the original implementation
(`window.location.href = '/'`) because using `router.replace('/')`
caused an infinite loading issue. The direct window navigation avoids
the router's internal state issues and ensures a clean redirect to the
main application.

## Test plan
- [ ] Navigate to `/cloud/login` while logged in → Should redirect to
appropriate page
- [ ] Click "Switch accounts" from waitlist or invite views → Should
stay on login page
- [ ] Complete login flow → Should redirect properly based on user
status
- [ ] Verify no infinite loading occurs when redirecting to main app

🤖 Generated with [Claude Code](https://claude.ai/code)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6478-fix-prevent-logged-in-users-from-accessing-login-page-unless-switching-accounts-29d6d73d3650815a9d98c11951425241)
by [Unito](https://www.unito.io)

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-01 06:52:24 +09:00
Christian Byrne
daa9aff1f3 [Backport] update subscription panel for new designs (#6397)
## Summary
Backport of PR #6378 to `rh-test` branch.

## Changes
- Extract credit calculations into useSubscriptionCredits composable
- Extract action handlers into useSubscriptionActions composable
- Add comprehensive component and unit tests
- Update subscription panel layout to match Figma design exactly
- Add proper design tokens for modal card surfaces
- Update terminology from "API Nodes" to "Partner Nodes"
- Make credit breakdown dynamic with real API data
- Add proper loading states and error handling
- Remove unused tailwindcss eslint dependencies

## Conflicts Resolved
- Resolved merge conflicts in `packages/design-system/src/css/style.css`
related to button surface CSS variables

## Test plan
- Existing tests pass
- New tests for subscription composables and components

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6397-Backport-update-subscription-panel-for-new-designs-29c6d73d3650812aaa12ff242fd5e078)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com>
2025-10-30 22:11:13 -07:00
Jin Yi
5fa4dcdc67 fix: force token refresh for session cookie creation (#6477)
## Summary
- Force token refresh when creating session cookies to prevent
authentication failures
- Fixes Sentry issue #6976234063 affecting 29 users

🤖 Generated with [Claude Code](https://claude.ai/code)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6477-fix-force-token-refresh-for-session-cookie-creation-29d6d73d365081c394c1d8f672884fd8)
by [Unito](https://www.unito.io)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-30 22:10:46 -07:00
Jin Yi
61660a8128 fix: improve whitelist feature flag comments for clarity (#6457)
## Summary

This PR improves code comments to accurately describe the whitelist
feature flag implementation logic.

## Changes

- Updated comments in `router.ts` and `UserCheckView.vue` to clarify
that the feature flag is checked first before user status
- Removed unreachable comment after return statement in
`UserCheckView.vue`
- Comments now accurately reflect the actual code execution order

## Technical Details

The logic flow remains unchanged:
1. Check `require_whitelist` feature flag first (defaults to `true`)
2. If flag is `true` AND user status is not `'active'`, redirect to
waitlist
3. If flag is `false`, allow all users to proceed regardless of status

## Testing

No functional changes - only comment improvements for better code
maintainability.

🤖 Generated with [Claude Code](https://claude.ai/code)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6457-fix-improve-whitelist-feature-flag-comments-for-clarity-29c6d73d365081cf8a59d662118f7243)
by [Unito](https://www.unito.io)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-31 11:50:50 +09:00
Jin Yi
b575a8d7a2 fix: prevent unwanted login redirects during WebSocket reconnection (#6410)
## 🐛 Problem

Users were experiencing the following issues during WebSocket
reconnection:

1. Automatic redirect to login page after "Reconnecting" toast message
appears
2. Automatic re-login after a few seconds, returning to the main
interface
3. This cycle repeats, severely degrading user experience

## 🔍 Root Cause Analysis

### 1. Router Guard Catching Too Many Errors
```typescript
// Problematic code
try {
  const { getUserCloudStatus, getSurveyCompletedStatus } = await import('@/api/auth')
  const userStatus = await getUserCloudStatus()
  // ...
} catch (error) {
  // All types of errors are caught here
  return next({ name: 'cloud-user-check' })
}
```

With dynamic import inside the try block, the following were all being
caught:
- Errors during `@/api/auth` module loading
- Runtime errors from the API singleton
- Actual API call errors

Everything was caught and redirected to `cloud-user-check`.

### 2. Full Page Reload in UserCheckView
```typescript
// Problematic code
window.location.href = '/'  // Full page reload!
```

This caused:
- Loss of SPA benefits
- Firebase Auth re-initialization → temporarily null user
- Router guard re-execution → potential for another redirect

##  Solution

### 1. router.ts: Move dynamic import outside try block
```typescript
// After fix
const { getUserCloudStatus, getSurveyCompletedStatus } = await import('@/api/auth')

try {
  // Only API calls inside try
  const userStatus = await getUserCloudStatus()
  // ...
} catch (error) {
  // Now only catches pure API call errors
  return next({ name: 'cloud-user-check' })
}
```

### 2. UserCheckView.vue: Use SPA routing
```typescript
// After fix
await router.replace('/')  // Use Vue Router instead of window.location.href
```

🤖 Generated with [Claude Code](https://claude.ai/code)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6410-fix-prevent-unwanted-login-redirects-during-WebSocket-reconnection-29c6d73d3650818a8a1acbdcebd2f703)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitHub Action <action@github.com>
2025-10-31 11:16:22 +09:00
Comfy Org PR Bot
750a9d882a [backport rh-test] use shared composable for subscription (#6395)
Backport of #6390 to `rh-test`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6395-backport-rh-test-use-shared-composable-for-subscription-29c6d73d365081928afdf080703793e7)
by [Unito](https://www.unito.io)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
2025-10-30 12:56:50 -07:00
Arjan Singh
2febb24d6c [rh-test] ci: update lockfile 2025-10-30 12:34:50 -07:00
Arjan Singh
d42e38300d [rh-test] ci: update pnpm-lock file (#6465)
## Summary

Messed it up with last manual backport.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6465-rh-test-ci-update-pnpm-lock-file-29c6d73d365081209727f48fe67150ac)
by [Unito](https://www.unito.io)
2025-10-30 12:24:12 -07:00
Arjan Singh
20687c2945 [rh-test backport] ci: add sentryVitePlugin (#6394) (#6463)
Note: had to manually resolve conflicts on this one.

This will be used to upload source maps in configured environments.

Docs:
https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/vite/



page](https://www.notion.so/PR-6394-ci-add-sentryVitePlugin-29c6d73d365081239f48f2fd261736d5)
by [Unito](https://www.unito.io)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6463-rh-test-backport-ci-add-sentryVitePlugin-6394-29c6d73d365081d2b7cdce59a2c5529d)
by [Unito](https://www.unito.io)
2025-10-30 11:52:14 -07:00
Christian Byrne
b32a1e9ce8 [feat] add troubleshooting details to auth timeout view (#6380)
## Summary
- Enhances authentication timeout error page with actionable
troubleshooting information
- Adds collapsible technical error details for debugging
- Shows common causes: firewall blocks, VPN restrictions, browser
extensions, regional limitations
- Disables incompatible tailwindcss eslint plugin (Tailwind v4
compatibility issue)

## Changes
- Updated `CloudAuthTimeoutView.vue` with troubleshooting section and
collapsible technical details
- Pass error message from router to timeout view via route params
- Added i18n strings for new troubleshooting content
- Removed `eslint-plugin-tailwindcss` (incompatible with Tailwind
v4.1.12)
- Cleaned up unused knip entries

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6380-feat-add-troubleshooting-details-to-auth-timeout-view-29b6d73d365081fea4e3d46b804d3116)
by [Unito](https://www.unito.io)
2025-10-29 19:31:56 -07:00
Comfy Org PR Bot
94cb6bf294 [backport rh-test] refactor subscription composable (#6376)
Backport of #6365 to `rh-test`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6376-backport-rh-test-refactor-subscription-composable-29b6d73d365081d7b9d8fc583b914de4)
by [Unito](https://www.unito.io)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
2025-10-29 10:58:15 -07:00
Christian Byrne
379f27a001 fix: remove unnecessary route guard from subscription enforcement (#6377)
Removes the route guard logic from requireActiveSubscription that was
checking for /cloud/* paths. The logout fix already prevents stale
extension state by using full page navigation, making this route
checking unnecessary and overly complex.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6377-fix-remove-unnecessary-route-guard-from-subscription-enforcement-29b6d73d365081738620e9c1d4efe1b2)
by [Unito](https://www.unito.io)

---------

Co-authored-by: GitHub Action <action@github.com>
2025-10-29 09:46:22 -07:00
Christian Byrne
17ae4cbf53 Fix subscription dialog appearing during onboarding (#6367)
Fixes subscription dialog incorrectly appearing on cloud onboarding
pages (email verification, survey, waitlist). Root cause: logout uses
SPA routing leaving extensions with stale auth state. Solution: (1) use
full page navigation for logout to reset app state, (2) add defensive
route guard to skip subscription checks on /cloud/* paths. Prevents
subscription modal from showing during account switching and onboarding
flows.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6367-Fix-subscription-dialog-appearing-during-onboarding-29b6d73d3650818d88e0d59ade7de02e)
by [Unito](https://www.unito.io)
2025-10-29 08:45:21 -07:00
Christian Byrne
97949c61fb remove email verification temporarily (#6366)
## Summary

- Temporarily remove email verification. After susbcription gating was
enabled, this is less important
- Will re-add the logic back at a later time, defering requirement until
time to subscribe
- For time being, typo emails can be resolved through custom service
(https://support.comfy.org/hc/en-us/requests/new?tf_42243568391700=ccloud&tf_123456=X)
- Keep the route and redirect for deprecation. Not really needed since
the server falls back to root route anyway but generally good practice
and is more resistant to future changes + avoids a single extra routing
step in that scenario.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6366-remove-email-verification-temporarily-29b6d73d3650810095a4e7c4591b3327)
by [Unito](https://www.unito.io)
2025-10-29 00:23:48 -07:00
Comfy Org PR Bot
84ce6c183d [backport rh-test] add dynamic config field for requiring/not requiring whitelist (#6356)
Backport of #6355 to `rh-test`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6356-backport-rh-test-add-dynamic-config-field-for-requiring-not-requiring-whitelist-29b6d73d36508151bd9dc34a4d62bcf1)
by [Unito](https://www.unito.io)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
2025-10-28 20:16:20 -07:00
Comfy Org PR Bot
9adf0c179f [backport rh-test] update subscription dialog (#6351)
Backport of #6350 to `rh-test`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6351-backport-rh-test-update-subscription-dialog-29a6d73d365081f284f1f5a9127e2cb3)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
Co-authored-by: GitHub Action <action@github.com>
2025-10-28 20:16:10 -07:00
46 changed files with 1462 additions and 671 deletions

View File

@@ -5,7 +5,7 @@ import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescrip
import { importX } from 'eslint-plugin-import-x'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import storybook from 'eslint-plugin-storybook'
import tailwind from 'eslint-plugin-tailwindcss'
// import tailwind from 'eslint-plugin-tailwindcss'
import unusedImports from 'eslint-plugin-unused-imports'
import pluginVue from 'eslint-plugin-vue'
import { defineConfig } from 'eslint/config'
@@ -34,11 +34,11 @@ const settings = {
],
noWarnOnMultipleProjects: true
})
],
tailwindcss: {
config: `${import.meta.dirname}/packages/design-system/src/css/style.css`,
functions: ['cn', 'clsx', 'tw']
}
]
// tailwindcss: {
// config: `${import.meta.dirname}/packages/design-system/src/css/style.css`,
// functions: ['cn', 'clsx', 'tw']
// }
} as const
const commonParserOptions = {
@@ -97,7 +97,7 @@ export default defineConfig([
// Difference in typecheck on CI vs Local
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore Bad types in the plugin
tailwind.configs['flat/recommended'],
// tailwind.configs['flat/recommended'],
pluginVue.configs['flat/recommended'],
eslintPluginPrettierRecommended,
storybook.configs['flat/recommended'],
@@ -129,7 +129,7 @@ export default defineConfig([
'import-x/no-relative-packages': 'error',
'unused-imports/no-unused-imports': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'tailwindcss/no-custom-classname': 'off', // TODO: fix
// 'tailwindcss/no-custom-classname': 'off', // TODO: fix
'vue/no-v-html': 'off',
// Enforce dark-theme: instead of dark: prefix
'vue/no-restricted-class': ['error', '/^dark:/'],

1
global.d.ts vendored
View File

@@ -8,6 +8,7 @@ declare const __USE_PROD_CONFIG__: boolean
interface Window {
__CONFIG__: {
mixpanel_token?: string
require_whitelist?: boolean
subscription_required?: boolean
server_health_alert?: {
message: string

View File

@@ -52,12 +52,12 @@
"@nx/vite": "catalog:",
"@pinia/testing": "catalog:",
"@playwright/test": "catalog:",
"@sentry/vite-plugin": "catalog:",
"@storybook/addon-docs": "catalog:",
"@storybook/vue3": "catalog:",
"@storybook/vue3-vite": "catalog:",
"@tailwindcss/vite": "catalog:",
"@trivago/prettier-plugin-sort-imports": "catalog:",
"@types/eslint-plugin-tailwindcss": "catalog:",
"@types/fs-extra": "catalog:",
"@types/jsdom": "catalog:",
"@types/node": "catalog:",
@@ -74,7 +74,6 @@
"eslint-plugin-import-x": "catalog:",
"eslint-plugin-prettier": "catalog:",
"eslint-plugin-storybook": "catalog:",
"eslint-plugin-tailwindcss": "catalog:",
"eslint-plugin-unused-imports": "catalog:",
"eslint-plugin-vue": "catalog:",
"fs-extra": "^11.2.0",

View File

@@ -126,6 +126,11 @@
--content-hover-bg: #adadad;
--content-hover-fg: #000;
--button-surface: var(--color-white);
--button-surface-contrast: var(--color-black);
--modal-card-button-surface: var(--color-smoke-300);
/* Code styling colors for help menu*/
--code-text-color: rgb(0 122 255 / 1);
--code-bg-color: rgb(96 165 250 / 0.2);
@@ -168,6 +173,15 @@
.dark-theme {
--accent-primary: var(--color-pure-white);
--backdrop: var(--color-neutral-900);
--button-surface: var(--color-charcoal-600);
--button-surface-contrast: var(--color-white);
--button-hover-surface: var(--color-charcoal-600);
--button-active-surface: var(--color-charcoal-600);
--button-icon: var(--color-smoke-800);
--modal-card-button-surface: var(--color-charcoal-300);
--dialog-surface: var(--color-neutral-700);
--node-component-border: var(--color-stone-200);
--node-component-border-error: var(--color-danger-100);
@@ -196,6 +210,12 @@
@theme inline {
--color-backdrop: var(--backdrop);
--color-button-active-surface: var(--button-active-surface);
--color-button-hover-surface: var(--button-hover-surface);
--color-button-icon: var(--button-icon);
--color-button-surface: var(--button-surface);
--color-button-surface-contrast: var(--button-surface-contrast);
--color-modal-card-button-surface: var(--modal-card-button-surface);
--color-dialog-surface: var(--dialog-surface);
--color-node-component-border: var(--node-component-border);
--color-node-component-executing: var(--node-component-executing);

285
pnpm-lock.yaml generated
View File

@@ -66,6 +66,9 @@ catalogs:
'@primevue/themes':
specifier: ^4.2.5
version: 4.2.5
'@sentry/vite-plugin':
specifier: ^4.6.0
version: 4.6.0
'@sentry/vue':
specifier: ^8.48.0
version: 8.48.0
@@ -84,9 +87,6 @@ catalogs:
'@trivago/prettier-plugin-sort-imports':
specifier: ^5.2.0
version: 5.2.2
'@types/eslint-plugin-tailwindcss':
specifier: ^3.17.0
version: 3.17.0
'@types/fs-extra':
specifier: ^11.0.4
version: 11.0.4
@@ -150,9 +150,6 @@ catalogs:
eslint-plugin-storybook:
specifier: ^9.1.6
version: 9.1.6
eslint-plugin-tailwindcss:
specifier: 4.0.0-beta.0
version: 4.0.0-beta.0
eslint-plugin-unused-imports:
specifier: ^4.2.0
version: 4.2.0
@@ -285,6 +282,7 @@ catalogs:
overrides:
'@types/eslint': '-'
'@eslint/core': 0.17.0
importers:
@@ -486,6 +484,9 @@ importers:
'@playwright/test':
specifier: 'catalog:'
version: 1.52.0
'@sentry/vite-plugin':
specifier: 'catalog:'
version: 4.6.0
'@storybook/addon-docs':
specifier: 'catalog:'
version: 9.1.1(@types/react@19.1.9)(storybook@9.1.6(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@5.4.19(@types/node@20.14.10)(lightningcss@1.30.1)(terser@5.39.2)))
@@ -501,9 +502,6 @@ importers:
'@trivago/prettier-plugin-sort-imports':
specifier: 'catalog:'
version: 5.2.2(@vue/compiler-sfc@3.5.13)(prettier@3.6.2)
'@types/eslint-plugin-tailwindcss':
specifier: 'catalog:'
version: 3.17.0
'@types/fs-extra':
specifier: 'catalog:'
version: 11.0.4
@@ -552,9 +550,6 @@ importers:
eslint-plugin-storybook:
specifier: 'catalog:'
version: 9.1.6(eslint@9.35.0(jiti@2.4.2))(storybook@9.1.6(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@5.4.19(@types/node@20.14.10)(lightningcss@1.30.1)(terser@5.39.2)))(typescript@5.9.2)
eslint-plugin-tailwindcss:
specifier: 'catalog:'
version: 4.0.0-beta.0(tailwindcss@4.1.12)
eslint-plugin-unused-imports:
specifier: 'catalog:'
version: 4.2.0(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.35.0(jiti@2.4.2))(typescript@5.9.2))(eslint@9.35.0(jiti@2.4.2))(typescript@5.9.2))(eslint@9.35.0(jiti@2.4.2))
@@ -1773,8 +1768,8 @@ packages:
resolution: {integrity: sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/core@0.15.2':
resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==}
'@eslint/core@0.17.0':
resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/eslintrc@3.3.1':
@@ -2658,14 +2653,78 @@ packages:
resolution: {integrity: sha512-csILVupc5RkrsTrncuUTGmlB56FQSFjXPYWG8I8yBTGlXEJ+o8oTuF6+55R4vbw3EIzBveXWi4kEBbnQlXW/eg==}
engines: {node: '>=14.18'}
'@sentry/babel-plugin-component-annotate@4.6.0':
resolution: {integrity: sha512-3soTX50JPQQ51FSbb4qvNBf4z/yP7jTdn43vMTp9E4IxvJ9HKJR7OEuKkCMszrZmWsVABXl02msqO7QisePdiQ==}
engines: {node: '>= 14'}
'@sentry/browser@8.48.0':
resolution: {integrity: sha512-fuuVULB5/1vI8NoIwXwR3xwhJJqk+y4RdSdajExGF7nnUDBpwUJyXsmYJnOkBO+oLeEs58xaCpotCKiPUNnE3g==}
engines: {node: '>=14.18'}
'@sentry/bundler-plugin-core@4.6.0':
resolution: {integrity: sha512-Fub2XQqrS258jjS8qAxLLU1k1h5UCNJ76i8m4qZJJdogWWaF8t00KnnTyp9TEDJzrVD64tRXS8+HHENxmeUo3g==}
engines: {node: '>= 14'}
'@sentry/cli-darwin@2.57.0':
resolution: {integrity: sha512-v1wYQU3BcCO+Z3OVxxO+EnaW4oQhuOza6CXeYZ0z5ftza9r0QQBLz3bcZKTVta86xraNm0z8GDlREwinyddOxQ==}
engines: {node: '>=10'}
os: [darwin]
'@sentry/cli-linux-arm64@2.57.0':
resolution: {integrity: sha512-Kh1jTsMV5Fy/RvB381N/woXe1qclRMqsG6kM3Gq6m6afEF/+k3PyQdNW3HXAola6d63EptokLtxPG2xjWQ+w9Q==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux, freebsd, android]
'@sentry/cli-linux-arm@2.57.0':
resolution: {integrity: sha512-uNHB8xyygqfMd1/6tFzl9NUkuVefg7jdZtM/vVCQVaF/rJLWZ++Wms+LLhYyKXKN8yd7J9wy7kTEl4Qu4jWbGQ==}
engines: {node: '>=10'}
cpu: [arm]
os: [linux, freebsd, android]
'@sentry/cli-linux-i686@2.57.0':
resolution: {integrity: sha512-EYXghoK/tKd0zqz+KD/ewXXE3u1HLCwG89krweveytBy/qw7M5z58eFvw+iGb1Vnbl1f/fRD0G4E0AbEsPfmpg==}
engines: {node: '>=10'}
cpu: [x86, ia32]
os: [linux, freebsd, android]
'@sentry/cli-linux-x64@2.57.0':
resolution: {integrity: sha512-CyZrP/ssHmAPLSzfd4ydy7icDnwmDD6o3QjhkWwVFmCd+9slSBMQxpIqpamZmrWE6X4R+xBRbSUjmdoJoZ5yMw==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux, freebsd, android]
'@sentry/cli-win32-arm64@2.57.0':
resolution: {integrity: sha512-wji/GGE4Lh5I/dNCsuVbg6fRvttvZRG6db1yPW1BSvQRh8DdnVy1CVp+HMqSq0SRy/S4z60j2u+m4yXMoCL+5g==}
engines: {node: '>=10'}
cpu: [arm64]
os: [win32]
'@sentry/cli-win32-i686@2.57.0':
resolution: {integrity: sha512-hWvzyD7bTPh3b55qvJ1Okg3Wbl0Km8xcL6KvS7gfBl6uss+I6RldmQTP0gJKdHSdf/QlJN1FK0b7bLnCB3wHsg==}
engines: {node: '>=10'}
cpu: [x86, ia32]
os: [win32]
'@sentry/cli-win32-x64@2.57.0':
resolution: {integrity: sha512-QWYV/Y0sbpDSTyA4XQBOTaid4a6H2Iwa1Z8UI+qNxFlk0ADSEgIqo2NrRHDU8iRnghTkecQNX1NTt/7mXN3f/A==}
engines: {node: '>=10'}
cpu: [x64]
os: [win32]
'@sentry/cli@2.57.0':
resolution: {integrity: sha512-oC4HPrVIX06GvUTgK0i+WbNgIA9Zl5YEcwf9N4eWFJJmjonr2j4SML9Hn2yNENbUWDgwepy4MLod3P8rM4bk/w==}
engines: {node: '>= 10'}
hasBin: true
'@sentry/core@8.48.0':
resolution: {integrity: sha512-VGwYgTfLpvJ5LRO5A+qWo1gpo6SfqaGXL9TOzVgBucAdpzbrYHpZ87sEarDVq/4275uk1b0S293/mfsskFczyw==}
engines: {node: '>=14.18'}
'@sentry/vite-plugin@4.6.0':
resolution: {integrity: sha512-fMR2d+EHwbzBa0S1fp45SNUTProxmyFBp+DeBWWQOSP9IU6AH6ea2rqrpMAnp/skkcdW4z4LSRrOEpMZ5rWXLw==}
engines: {node: '>= 14'}
'@sentry/vue@8.48.0':
resolution: {integrity: sha512-hqm9X7hz1vMQQB1HBYezrDBQihZk6e/MxWIG1wMJoClcBnD1Sh7y+D36UwaQlR4Gr/Ftiz+Bb0DxuAYHoUS4ow==}
engines: {node: '>=14.18'}
@@ -3029,9 +3088,6 @@ packages:
'@types/diff-match-patch@1.0.36':
resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==}
'@types/eslint-plugin-tailwindcss@3.17.0':
resolution: {integrity: sha512-ucQGf2YIdTcndYcxRU3UdZgmhUHsOlbIF4BaRtl0op+7k2JmqM2i3aXZ6XIcfZgVq1ZKov7VM5c/BR81ukmkyg==}
'@types/estree@1.0.5':
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
@@ -3575,6 +3631,10 @@ packages:
resolution: {integrity: sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==}
engines: {node: '>= 10.0.0'}
agent-base@6.0.2:
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
engines: {node: '>= 6.0.0'}
agent-base@7.1.4:
resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==}
engines: {node: '>= 14'}
@@ -4574,12 +4634,6 @@ packages:
eslint: '>=8'
storybook: ^9.1.6
eslint-plugin-tailwindcss@4.0.0-beta.0:
resolution: {integrity: sha512-WWCajZgQu38Sd67ZCl2W6i3MRzqB0d+H8s4qV9iB6lBJbsDOIpIlj6R1Fj2FXkoWErbo05pZnZYbCGIU9o/DsA==}
engines: {node: '>=18.12.0'}
peerDependencies:
tailwindcss: ^3.4.0 || ^4.0.0
eslint-plugin-unused-imports@4.2.0:
resolution: {integrity: sha512-hLbJ2/wnjKq4kGA9AUaExVFIbNzyxYdVo49QZmKCnhk5pc9wcYRbfgLHvWJ8tnsdcseGhoUAddm9gn/lt+d74w==}
peerDependencies:
@@ -4854,6 +4908,9 @@ packages:
resolution: {integrity: sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==}
engines: {node: '>=14.14'}
fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
fsevents@2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
@@ -4934,6 +4991,10 @@ packages:
engines: {node: 20 || >=22}
hasBin: true
glob@9.3.5:
resolution: {integrity: sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==}
engines: {node: '>=16 || 14 >=14.17'}
global-directory@4.0.1:
resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==}
engines: {node: '>=18'}
@@ -5063,6 +5124,10 @@ packages:
resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==}
engines: {node: '>= 14'}
https-proxy-agent@5.0.1:
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
engines: {node: '>= 6'}
https-proxy-agent@7.0.6:
resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==}
engines: {node: '>= 14'}
@@ -5748,6 +5813,10 @@ packages:
magic-string@0.30.19:
resolution: {integrity: sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==}
magic-string@0.30.8:
resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==}
engines: {node: '>=12'}
magicast@0.3.5:
resolution: {integrity: sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==}
@@ -5968,6 +6037,10 @@ packages:
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
engines: {node: '>=10'}
minimatch@8.0.4:
resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==}
engines: {node: '>=16 || 14 >=14.17'}
minimatch@9.0.1:
resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==}
engines: {node: '>=16 || 14 >=14.17'}
@@ -5983,6 +6056,10 @@ packages:
minimist@1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
minipass@4.2.8:
resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==}
engines: {node: '>=8'}
minipass@7.1.2:
resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
engines: {node: '>=16 || 14 >=14.17'}
@@ -6414,6 +6491,10 @@ packages:
process-nextick-args@2.0.1:
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
progress@2.0.3:
resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
engines: {node: '>=0.4.0'}
promise@7.3.1:
resolution: {integrity: sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==}
@@ -7012,11 +7093,6 @@ packages:
resolution: {integrity: sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==}
engines: {node: '>=10.0.0'}
tailwind-api-utils@1.0.3:
resolution: {integrity: sha512-KpzUHkH1ug1sq4394SLJX38ZtpeTiqQ1RVyFTTSY2XuHsNSTWUkRo108KmyyrMWdDbQrLYkSHaNKj/a3bmA4sQ==}
peerDependencies:
tailwindcss: ^3.3.0 || ^4.0.0 || ^4.0.0-beta
tailwind-merge@2.6.0:
resolution: {integrity: sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA==}
@@ -7301,6 +7377,9 @@ packages:
'@nuxt/kit':
optional: true
unplugin@1.0.1:
resolution: {integrity: sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==}
unplugin@1.16.1:
resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==}
engines: {node: '>=14.0.0'}
@@ -7475,6 +7554,9 @@ packages:
vue-component-type-helpers@3.1.1:
resolution: {integrity: sha512-B0kHv7qX6E7+kdc5nsaqjdGZ1KwNKSUQDWGy7XkTYT7wFsOpkEyaJ1Vq79TjwrrtuLRgizrTV7PPuC4rRQo+vw==}
vue-component-type-helpers@3.1.2:
resolution: {integrity: sha512-ch3/SKBtxdZq18vsEntiGCdSszCRNfhX5QaTxjSacCAXLlNQRXfXo+ANjoQEYJMsJOJy1/vHF6Tkc4s85MS+zw==}
vue-demi@0.14.10:
resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==}
engines: {node: '>=12'}
@@ -7571,6 +7653,13 @@ packages:
resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
engines: {node: '>=12'}
webpack-sources@3.3.3:
resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==}
engines: {node: '>=10.13.0'}
webpack-virtual-modules@0.5.0:
resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==}
webpack-virtual-modules@0.6.2:
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
@@ -8851,7 +8940,7 @@ snapshots:
'@eslint/config-helpers@0.3.1': {}
'@eslint/core@0.15.2':
'@eslint/core@0.17.0':
dependencies:
'@types/json-schema': 7.0.15
@@ -8875,7 +8964,7 @@ snapshots:
'@eslint/plugin-kit@0.3.5':
dependencies:
'@eslint/core': 0.15.2
'@eslint/core': 0.17.0
levn: 0.4.1
'@firebase/analytics-compat@0.2.18(@firebase/app-compat@0.2.53)(@firebase/app@0.11.4)':
@@ -10024,6 +10113,8 @@ snapshots:
'@sentry-internal/browser-utils': 8.48.0
'@sentry/core': 8.48.0
'@sentry/babel-plugin-component-annotate@4.6.0': {}
'@sentry/browser@8.48.0':
dependencies:
'@sentry-internal/browser-utils': 8.48.0
@@ -10032,8 +10123,74 @@ snapshots:
'@sentry-internal/replay-canvas': 8.48.0
'@sentry/core': 8.48.0
'@sentry/bundler-plugin-core@4.6.0':
dependencies:
'@babel/core': 7.27.1
'@sentry/babel-plugin-component-annotate': 4.6.0
'@sentry/cli': 2.57.0
dotenv: 16.6.1
find-up: 5.0.0
glob: 9.3.5
magic-string: 0.30.8
unplugin: 1.0.1
transitivePeerDependencies:
- encoding
- supports-color
'@sentry/cli-darwin@2.57.0':
optional: true
'@sentry/cli-linux-arm64@2.57.0':
optional: true
'@sentry/cli-linux-arm@2.57.0':
optional: true
'@sentry/cli-linux-i686@2.57.0':
optional: true
'@sentry/cli-linux-x64@2.57.0':
optional: true
'@sentry/cli-win32-arm64@2.57.0':
optional: true
'@sentry/cli-win32-i686@2.57.0':
optional: true
'@sentry/cli-win32-x64@2.57.0':
optional: true
'@sentry/cli@2.57.0':
dependencies:
https-proxy-agent: 5.0.1
node-fetch: 2.7.0
progress: 2.0.3
proxy-from-env: 1.1.0
which: 2.0.2
optionalDependencies:
'@sentry/cli-darwin': 2.57.0
'@sentry/cli-linux-arm': 2.57.0
'@sentry/cli-linux-arm64': 2.57.0
'@sentry/cli-linux-i686': 2.57.0
'@sentry/cli-linux-x64': 2.57.0
'@sentry/cli-win32-arm64': 2.57.0
'@sentry/cli-win32-i686': 2.57.0
'@sentry/cli-win32-x64': 2.57.0
transitivePeerDependencies:
- encoding
- supports-color
'@sentry/core@8.48.0': {}
'@sentry/vite-plugin@4.6.0':
dependencies:
'@sentry/bundler-plugin-core': 4.6.0
unplugin: 1.0.1
transitivePeerDependencies:
- encoding
- supports-color
'@sentry/vue@8.48.0(pinia@2.2.2(typescript@5.9.2)(vue@3.5.13(typescript@5.9.2)))(vue@3.5.13(typescript@5.9.2))':
dependencies:
'@sentry/browser': 8.48.0
@@ -10104,7 +10261,7 @@ snapshots:
storybook: 9.1.6(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@5.4.19(@types/node@20.14.10)(lightningcss@1.30.1)(terser@5.39.2))
type-fest: 2.19.0
vue: 3.5.13(typescript@5.9.2)
vue-component-type-helpers: 3.1.1
vue-component-type-helpers: 3.1.2
'@swc/helpers@0.5.17':
dependencies:
@@ -10409,8 +10566,6 @@ snapshots:
'@types/diff-match-patch@1.0.36': {}
'@types/eslint-plugin-tailwindcss@3.17.0': {}
'@types/estree@1.0.5': {}
'@types/estree@1.0.8': {}
@@ -11035,6 +11190,12 @@ snapshots:
address@1.2.2: {}
agent-base@6.0.2:
dependencies:
debug: 4.4.3
transitivePeerDependencies:
- supports-color
agent-base@7.1.4: {}
agentkeepalive@4.6.0:
@@ -12176,14 +12337,6 @@ snapshots:
- supports-color
- typescript
eslint-plugin-tailwindcss@4.0.0-beta.0(tailwindcss@4.1.12):
dependencies:
fast-glob: 3.3.3
postcss: 8.5.6
synckit: 0.11.11
tailwind-api-utils: 1.0.3(tailwindcss@4.1.12)
tailwindcss: 4.1.12
eslint-plugin-unused-imports@4.2.0(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.35.0(jiti@2.4.2))(typescript@5.9.2))(eslint@9.35.0(jiti@2.4.2))(typescript@5.9.2))(eslint@9.35.0(jiti@2.4.2)):
dependencies:
eslint: 9.35.0(jiti@2.4.2)
@@ -12218,7 +12371,7 @@ snapshots:
'@eslint-community/regexpp': 4.12.1
'@eslint/config-array': 0.21.0
'@eslint/config-helpers': 0.3.1
'@eslint/core': 0.15.2
'@eslint/core': 0.17.0
'@eslint/eslintrc': 3.3.1
'@eslint/js': 9.35.0
'@eslint/plugin-kit': 0.3.5
@@ -12542,6 +12695,8 @@ snapshots:
jsonfile: 6.2.0
universalify: 2.0.1
fs.realpath@1.0.0: {}
fsevents@2.3.2:
optional: true
@@ -12636,6 +12791,13 @@ snapshots:
package-json-from-dist: 1.0.0
path-scurry: 2.0.0
glob@9.3.5:
dependencies:
fs.realpath: 1.0.0
minimatch: 8.0.4
minipass: 4.2.8
path-scurry: 1.11.1
global-directory@4.0.1:
dependencies:
ini: 4.1.1
@@ -12766,6 +12928,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
https-proxy-agent@5.0.1:
dependencies:
agent-base: 6.0.2
debug: 4.4.3
transitivePeerDependencies:
- supports-color
https-proxy-agent@7.0.6:
dependencies:
agent-base: 7.1.4
@@ -13455,6 +13624,10 @@ snapshots:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
magic-string@0.30.8:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
magicast@0.3.5:
dependencies:
'@babel/parser': 7.28.4
@@ -13860,6 +14033,10 @@ snapshots:
dependencies:
brace-expansion: 2.0.2
minimatch@8.0.4:
dependencies:
brace-expansion: 2.0.2
minimatch@9.0.1:
dependencies:
brace-expansion: 2.0.2
@@ -13874,6 +14051,8 @@ snapshots:
minimist@1.2.8: {}
minipass@4.2.8: {}
minipass@7.1.2: {}
minizlib@3.0.2:
@@ -14357,6 +14536,8 @@ snapshots:
process-nextick-args@2.0.1: {}
progress@2.0.3: {}
promise@7.3.1:
dependencies:
asap: 2.0.6
@@ -15194,13 +15375,6 @@ snapshots:
string-width: 4.2.3
strip-ansi: 6.0.1
tailwind-api-utils@1.0.3(tailwindcss@4.1.12):
dependencies:
enhanced-resolve: 5.18.3
jiti: 2.5.1
local-pkg: 1.1.2
tailwindcss: 4.1.12
tailwind-merge@2.6.0: {}
tailwindcss-primeui@0.6.1(tailwindcss@4.1.12):
@@ -15492,6 +15666,13 @@ snapshots:
- rollup
- supports-color
unplugin@1.0.1:
dependencies:
acorn: 8.15.0
chokidar: 3.6.0
webpack-sources: 3.3.3
webpack-virtual-modules: 0.5.0
unplugin@1.16.1:
dependencies:
acorn: 8.15.0
@@ -15746,6 +15927,8 @@ snapshots:
vue-component-type-helpers@3.1.1: {}
vue-component-type-helpers@3.1.2: {}
vue-demi@0.14.10(vue@3.5.13(typescript@5.9.2)):
dependencies:
vue: 3.5.13(typescript@5.9.2)
@@ -15838,6 +16021,10 @@ snapshots:
webidl-conversions@7.0.0: {}
webpack-sources@3.3.3: {}
webpack-virtual-modules@0.5.0: {}
webpack-virtual-modules@0.6.2: {}
websocket-driver@0.7.4:

View File

@@ -23,13 +23,13 @@ catalog:
'@primevue/forms': ^4.2.5
'@primevue/icons': 4.2.5
'@primevue/themes': ^4.2.5
'@sentry/vite-plugin': ^4.6.0
'@sentry/vue': ^8.48.0
'@storybook/addon-docs': ^9.1.1
'@storybook/vue3': ^9.1.1
'@storybook/vue3-vite': ^9.1.1
'@tailwindcss/vite': ^4.1.12
'@trivago/prettier-plugin-sort-imports': ^5.2.0
'@types/eslint-plugin-tailwindcss': ^3.17.0
'@types/fs-extra': ^11.0.4
'@types/jsdom': ^21.1.7
'@types/node': ^20.14.8
@@ -51,7 +51,6 @@ catalog:
eslint-plugin-import-x: ^4.16.1
eslint-plugin-prettier: ^5.5.4
eslint-plugin-storybook: ^9.1.6
eslint-plugin-tailwindcss: 4.0.0-beta.0
eslint-plugin-unused-imports: ^4.2.0
eslint-plugin-vue: ^10.4.0
firebase: ^11.6.0
@@ -62,6 +61,7 @@ catalog:
jsdom: ^26.1.0
knip: ^5.62.0
lint-staged: ^15.2.7
mixpanel-browser: ^2.71.0
nx: 21.4.1
pinia: ^2.1.7
postcss-html: ^1.8.0
@@ -94,13 +94,9 @@ catalog:
zod: ^3.23.8
zod-to-json-schema: ^3.24.1
zod-validation-error: ^3.3.0
mixpanel-browser: ^2.71.0
cleanupUnusedCatalogs: true
overrides:
'@types/eslint': '-'
ignoredBuiltDependencies:
- '@firebase/util'
- protobufjs
@@ -115,3 +111,7 @@ onlyBuiltDependencies:
- esbuild
- nx
- oxc-resolver
overrides:
'@eslint/core': 0.17.0
'@types/eslint': '-'

View File

@@ -37,7 +37,7 @@
>
{{ badge.label }}
</div>
<div class="text-sm font-semibold">{{ badge.text }}</div>
<div class="text-sm font-inter">{{ badge.text }}</div>
<div v-if="badge.tooltip" class="text-xs">
{{ badge.tooltip }}
</div>
@@ -90,7 +90,7 @@
>
{{ badge.label }}
</div>
<div class="text-sm font-semibold">{{ badge.text }}</div>
<div class="text-sm font-inter">{{ badge.text }}</div>
<div v-if="badge.tooltip" class="text-xs">
{{ badge.tooltip }}
</div>
@@ -117,7 +117,7 @@
>
{{ badge.label }}
</div>
<div class="font-inter text-sm font-extrabold" :class="textClasses">
<div class="font-inter text-sm" :class="textClasses">
{{ badge.text }}
</div>
</div>
@@ -177,7 +177,7 @@ const textClasses = computed(() => {
return 'text-warning-100'
case 'info':
default:
return 'text-slate-100'
return 'text-text-primary'
}
})

View File

@@ -1,6 +1,6 @@
import { FirebaseError } from 'firebase/app'
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useRoute } from 'vue-router'
import { useErrorHandling } from '@/composables/useErrorHandling'
import { t } from '@/i18n'
@@ -17,7 +17,6 @@ export const useFirebaseAuthActions = () => {
const authStore = useFirebaseAuthStore()
const toastStore = useToastStore()
const route = useRoute()
const router = useRouter()
const { wrapWithErrorHandlingAsync, toastErrorHandler } = useErrorHandling()
const accessError = ref(false)
@@ -55,14 +54,19 @@ export const useFirebaseAuthActions = () => {
life: 5000
})
// Redirect to login page if we're on cloud domain
// CRITICAL: Use full page navigation for logout to prevent stale app state
// Issue: SPA routing during logout can leave extensions loaded with stale auth state
// This causes subscription dialogs to appear incorrectly during re-login onboarding
// Full page reload ensures complete app state reset and proper onboarding flow
const hostname = window.location.hostname
if (hostname.includes('cloud.comfy.org')) {
if (route.query.inviteCode) {
const inviteCode = route.query.inviteCode
await router.push({ name: 'cloud-login', query: { inviteCode } })
const inviteCode = Array.isArray(route.query.inviteCode)
? route.query.inviteCode[0]
: route.query.inviteCode
window.location.href = `/cloud/login?inviteCode=${encodeURIComponent(inviteCode || '')}`
} else {
await router.push({ name: 'cloud-login' })
window.location.href = '/cloud/login'
}
}
}, reportError)

View File

@@ -1958,7 +1958,6 @@
"cloudClaimInvite_processingTitle": "معالجة رمز الدعوة...",
"cloudClaimInvite_claimButton": "استلام الدعوة",
"cloudSorryContactSupport_title": "عذراً، اتصل بالدعم",
"cloudVerifyEmail_title": "التحقق من البريد الإلكتروني",
"cloudPrivateBeta_title": "Cloud حالياً في مرحلة البيتا الخاصة",
"cloudPrivateBeta_desc": "سجل الدخول للانضمام إلى قائمة الانتظار. سنخطرك عندما يصبح الوصول للبيتا متاحاً. تم إخطارك بالفعل؟ سجل الدخول لبدء استخدام Comfy Cloud.",
"cloudForgotPassword_title": "نسيت كلمة المرور",

View File

@@ -1931,18 +1931,24 @@
"renewsDate": "Renews {date}",
"expiresDate": "Expires {date}",
"manageSubscription": "Manage subscription",
"apiNodesBalance": "\"API Nodes\" Credit Balance",
"apiNodesDescription": "For running commercial/proprietary models",
"partnerNodesBalance": "\"Partner Nodes\" Credit Balance",
"partnerNodesDescription": "For running commercial/proprietary models",
"totalCredits": "Total credits",
"viewUsageHistory": "View usage history",
"addApiCredits": "Add API credits",
"addCredits": "Add credits",
"monthlyCreditsRollover": "These credits will rollover to the next month",
"monthlyBonusDescription": "Monthly credit bonus",
"prepaidDescription": "Pre-paid credits",
"prepaidCreditsInfo": "Credits purchased separately that don't expire",
"nextBillingCycle": "next billing cycle",
"yourPlanIncludes": "Your plan includes:",
"viewMoreDetails": "View more details",
"learnMore": "Learn more",
"messageSupport": "Message support",
"invoiceHistory": "Invoice history",
"benefits": {
"benefit1": "$10 in monthly credits for API models — top up when needed",
"benefit1": "Monthly credits for Partner Nodes — top up when needed",
"benefit2": "Up to 30 min runtime per job"
},
"required": {
@@ -2114,7 +2120,18 @@
"authTimeout": {
"title": "Connection Taking Too Long",
"message": "We're having trouble connecting to ComfyUI Cloud. This could be due to a slow connection or temporary service issue.",
"restart": "Sign Out & Try Again"
"restart": "Sign Out & Try Again",
"troubleshooting": "Common causes:",
"causes": [
"Corporate firewall or proxy blocking authentication services",
"VPN or network restrictions",
"Browser extensions interfering with requests",
"Regional network limitations",
"Try a different browser or network"
],
"technicalDetails": "Technical Details",
"helpText": "Need help? Contact",
"supportLink": "support"
}
},
"cloudFooter_needHelp": "Need Help?",
@@ -2152,18 +2169,6 @@
"cloudSurvey_steps_purpose": "What will you primarily use ComfyUI for?",
"cloudSurvey_steps_industry": "What's your primary industry?",
"cloudSurvey_steps_making": "What do you plan on making?",
"cloudVerifyEmail_toast_message": "We've sent a verification email to {email}. Please check your inbox and click the link to verify your email address.",
"cloudVerifyEmail_failed_toast_message": "Failed to send verification email. Please contact support.",
"cloudVerifyEmail_title": "Check your email",
"cloudVerifyEmail_back": "Back",
"cloudVerifyEmail_sent": "A verification link was sent to:",
"cloudVerifyEmail_clickToContinue": "Click the link in that email to automatically\ncontinue onto the next steps.",
"cloudVerifyEmail_tip": "Tip: Dont forget to check your spam folder\nif you dont see it.",
"cloudVerifyEmail_didntReceive": "Didn't receive the email?",
"cloudVerifyEmail_resend": "Resend email",
"cloudVerifyEmail_toast_title": "Email sent",
"cloudVerifyEmail_toast_summary": "Check your inbox for a new verification email.",
"cloudVerifyEmail_toast_failed": "Failed to send verification email. Please try again.",
"cloudInvite_title": "YOU'RE INVITED",
"cloudInvite_subtitle": "This invite can only be used once. Double check youre signed into the account you want to use.",
"cloudInvite_switchAccounts": "Switch accounts",

View File

@@ -1955,7 +1955,6 @@
"cloudClaimInvite_processingTitle": "Procesando código de invitación...",
"cloudClaimInvite_claimButton": "Reclamar Invitación",
"cloudSorryContactSupport_title": "Lo sentimos, contacta al soporte",
"cloudVerifyEmail_title": "Verificación de Correo",
"cloudPrivateBeta_title": "Cloud está actualmente en beta privada",
"cloudPrivateBeta_desc": "Inicia sesión para unirte a la lista de espera. Te notificaremos cuando tengas acceso al beta. ¿Ya recibiste la notificación? Inicia sesión para empezar a usar Comfy Cloud.",
"cloudForgotPassword_title": "Olvidé mi Contraseña",

View File

@@ -1949,7 +1949,6 @@
"cloudClaimInvite_processingTitle": "Traitement du code d'invitation...",
"cloudClaimInvite_claimButton": "Réclamer l'Invitation",
"cloudSorryContactSupport_title": "Désolé, contactez le support",
"cloudVerifyEmail_title": "Vérification d'Email",
"cloudPrivateBeta_title": "Cloud est actuellement en bêta privée",
"cloudPrivateBeta_desc": "Connectez-vous pour rejoindre la liste d'attente. Nous vous préviendrons quand vous aurez accès à la bêta. Déjà notifié ? Connectez-vous pour commencer à utiliser Comfy Cloud.",
"cloudForgotPassword_title": "Mot de passe oublié",

View File

@@ -1955,7 +1955,6 @@
"cloudClaimInvite_processingTitle": "招待コードを処理中...",
"cloudClaimInvite_claimButton": "招待を申請",
"cloudSorryContactSupport_title": "申し訳ございません、サポートにお問い合わせください",
"cloudVerifyEmail_title": "メール確認",
"cloudPrivateBeta_title": "Cloudは現在プライベートベータ版です",
"cloudPrivateBeta_desc": "サインインしてウェイトリストに登録してください。ベータアクセスが可能になりましたらお知らせします。すでに通知を受け取りましたかサインインしてComfy Cloudを始めてください。",
"cloudForgotPassword_title": "パスワードを忘れた",

View File

@@ -1955,7 +1955,6 @@
"cloudClaimInvite_processingTitle": "초대 코드 확인중...",
"cloudClaimInvite_claimButton": "초대 요청하기",
"cloudSorryContactSupport_title": "죄송합니다, 지원팀에 문의해주세요",
"cloudVerifyEmail_title": "이메일 확인",
"cloudPrivateBeta_title": "Cloud는 현재 비공개 베타 버전입니다",
"cloudPrivateBeta_desc": "로그인하여 대기자 명단에 등록하세요. 베타 버전이 오픈될 때 알려드릴게요. 이미 알림을 받으셨다면? 로그인하여 Comfy Cloud를 시작해보세요.",
"cloudForgotPassword_title": "비밀번호 찾기",

View File

@@ -1955,7 +1955,6 @@
"cloudClaimInvite_processingTitle": "Обработка кода приглашения...",
"cloudClaimInvite_claimButton": "Получить приглашение",
"cloudSorryContactSupport_title": "Извините, свяжитесь с поддержкой",
"cloudVerifyEmail_title": "Подтверждение email",
"cloudPrivateBeta_title": "Cloud сейчас в приватной бете",
"cloudPrivateBeta_desc": "Войдите, чтобы присоединиться к списку ожидания. Мы уведомим вас, когда будет доступен бета-доступ. Уже получили уведомление? Войдите и начните работать с Comfy Cloud.",
"cloudForgotPassword_title": "Забыли пароль",

View File

@@ -1955,7 +1955,6 @@
"cloudClaimInvite_processingTitle": "處理邀請碼中...",
"cloudClaimInvite_claimButton": "領取邀請",
"cloudSorryContactSupport_title": "抱歉,請聯繫用戶支援",
"cloudVerifyEmail_title": "郵箱驗證",
"cloudPrivateBeta_title": "Cloud 目前處於內測階段",
"cloudPrivateBeta_desc": "登入即可加入等候名單,當您有內測資格時我們將及時通知。已收到通知?登入即可開始使用 Comfy Cloud。",
"cloudForgotPassword_title": "忘記密碼",

View File

@@ -1958,7 +1958,6 @@
"cloudClaimInvite_processingTitle": "处理邀请码中...",
"cloudClaimInvite_claimButton": "领取邀请",
"cloudSorryContactSupport_title": "抱歉,请联系用户支持",
"cloudVerifyEmail_title": "邮箱验证",
"cloudPrivateBeta_title": "Cloud 目前处于内测阶段",
"cloudPrivateBeta_desc": "登录即可加入等候名单,当您有内测资格时我们将及时通知。已收到通知?登录即可开始使用 Comfy Cloud。",
"cloudForgotPassword_title": "忘记密码",

View File

@@ -16,7 +16,23 @@ export const cloudOnboardingRoutes: RouteRecordRaw[] = [
path: 'login',
name: 'cloud-login',
component: () =>
import('@/platform/onboarding/cloud/CloudLoginView.vue')
import('@/platform/onboarding/cloud/CloudLoginView.vue'),
beforeEnter: async (to, _from, next) => {
// Only redirect if not explicitly switching accounts
if (!to.query.switchAccount) {
const { useCurrentUser } = await import(
'@/composables/auth/useCurrentUser'
)
const { isLoggedIn } = useCurrentUser()
if (isLoggedIn.value) {
// User is already logged in, redirect to user-check
// user-check will handle survey, waitlist, or main page routing
return next({ name: 'cloud-user-check' })
}
}
next()
}
},
{
path: 'signup',
@@ -68,8 +84,10 @@ export const cloudOnboardingRoutes: RouteRecordRaw[] = [
{
path: 'verify-email',
name: 'cloud-verify-email',
component: () =>
import('@/platform/onboarding/cloud/CloudVerifyEmailView.vue')
redirect: (to) => ({
name: 'cloud-user-check',
query: to.query
})
},
{
path: 'sorry-contact-support',
@@ -81,7 +99,8 @@ export const cloudOnboardingRoutes: RouteRecordRaw[] = [
path: 'auth-timeout',
name: 'cloud-auth-timeout',
component: () =>
import('@/platform/onboarding/cloud/CloudAuthTimeoutView.vue')
import('@/platform/onboarding/cloud/CloudAuthTimeoutView.vue'),
props: true
}
]
}

View File

@@ -15,7 +15,7 @@ export const useSessionCookie = () => {
if (!isCloud) return
const authStore = useFirebaseAuthStore()
const authHeader = await authStore.getAuthHeader()
const authHeader = await authStore.getAuthHeader(true)
if (!authHeader) {
throw new Error('No auth header available for session creation')

View File

@@ -2,10 +2,14 @@
<Button
:label="label || $t('subscription.required.subscribe')"
:size="size"
:class="buttonClass"
:loading="isLoading"
:disabled="isPolling"
severity="primary"
:pt="{
root: {
class: 'w-full font-bold'
}
}"
@click="handleSubscribe"
/>
</template>
@@ -22,11 +26,9 @@ withDefaults(
defineProps<{
label?: string
size?: 'small' | 'large'
buttonClass?: string
}>(),
{
size: 'large',
buttonClass: 'w-full font-bold'
size: 'large'
}
)

View File

@@ -1,15 +1,15 @@
<template>
<div class="flex flex-col gap-3">
<div class="flex flex-col items-start gap-1 self-stretch">
<div class="flex items-start gap-2">
<i class="pi pi-check mt-1 text-sm" />
<span class="text-sm">
<i class="pi pi-check mt-1 text-xs text-text-primary" />
<span class="text-sm text-text-primary">
{{ $t('subscription.benefits.benefit1') }}
</span>
</div>
<div class="flex items-start gap-2">
<i class="pi pi-check mt-1 text-sm" />
<span class="text-sm">
<i class="pi pi-check mt-1 text-xs text-text-primary" />
<span class="text-sm text-text-primary">
{{ $t('subscription.benefits.benefit2') }}
</span>
</div>
@@ -19,8 +19,15 @@
text
icon="pi pi-external-link"
icon-pos="left"
size="small"
class="self-start !p-0 text-sm hover:!bg-transparent [&]:!text-[inherit]"
class="flex h-8 min-h-6 py-2 px-0 items-center gap-2 rounded text-text-secondary"
:pt="{
icon: {
class: 'text-xs text-text-secondary'
},
label: {
class: 'text-sm text-text-secondary'
}
}"
@click="handleViewMoreDetails"
/>
</div>
@@ -30,6 +37,6 @@
import Button from 'primevue/button'
const handleViewMoreDetails = () => {
window.open('https://www.comfy.org/cloud', '_blank')
window.open('https://www.comfy.org/cloud/pricing', '_blank')
}
</script>

View File

@@ -1,10 +1,10 @@
<template>
<TabPanel value="PlanCredits" class="subscription-container h-full">
<div class="flex h-full flex-col">
<div class="flex items-center gap-2">
<h2 class="text-2xl">
<div class="flex h-full flex-col gap-6">
<div class="flex items-baseline gap-2">
<span class="text-2xl font-inter font-semibold leading-tight">
{{ $t('subscription.title') }}
</h2>
</span>
<CloudBadge
reverse-order
background-color="var(--p-dialog-background)"
@@ -12,17 +12,20 @@
</div>
<div class="grow overflow-auto">
<div class="rounded-lg border border-charcoal-400 p-4">
<div class="rounded-2xl border border-interface-stroke p-6">
<div>
<div class="flex items-center justify-between">
<div>
<div class="flex items-baseline gap-1">
<span class="text-2xl font-bold">{{
formattedMonthlyPrice
<div class="flex items-baseline gap-1 font-inter font-semibold">
<span class="text-2xl">{{ formattedMonthlyPrice }}</span>
<span class="text-base">{{
$t('subscription.perMonth')
}}</span>
<span>{{ $t('subscription.perMonth') }}</span>
</div>
<div v-if="isActiveSubscription" class="text-xs text-muted">
<div
v-if="isActiveSubscription"
class="text-sm text-text-secondary"
>
<template v-if="isCancelled">
{{
$t('subscription.expiresDate', {
@@ -43,105 +46,164 @@
v-if="isActiveSubscription"
:label="$t('subscription.manageSubscription')"
severity="secondary"
class="text-xs"
class="text-xs bg-interface-menu-component-surface-selected"
:pt="{
root: {
style: 'border-radius: 8px; padding: 8px 16px;'
},
label: {
class: 'text-text-primary'
}
}"
@click="manageSubscription"
/>
<SubscribeButton
v-else
:label="$t('subscription.subscribeNow')"
size="small"
button-class="text-xs"
class="text-xs"
@subscribed="handleRefresh"
/>
</div>
</div>
<div class="grid grid-cols-1 gap-6 rounded-lg pt-10 lg:grid-cols-2">
<div class="flex flex-col">
<div class="grid grid-cols-1 gap-6 pt-9 lg:grid-cols-2">
<div class="flex flex-col flex-1">
<div class="flex flex-col gap-3">
<div class="flex flex-col">
<div class="text-sm">
{{ $t('subscription.apiNodesBalance') }}
{{ $t('subscription.partnerNodesBalance') }}
</div>
<div class="flex items-center">
<div class="text-xs text-muted">
{{ $t('subscription.apiNodesDescription') }}
<div class="text-sm text-muted">
{{ $t('subscription.partnerNodesDescription') }}
</div>
</div>
</div>
<div
class="flex flex-col gap-3 rounded-lg border p-4 dark-theme:border-0 dark-theme:bg-charcoal-600"
:class="
cn(
'relative flex flex-col gap-6 rounded-2xl p-5',
'bg-smoke-100 dark-theme:bg-charcoal-600'
)
"
>
<Button
v-tooltip="refreshTooltip"
icon="pi pi-sync"
text
size="small"
class="absolute top-0.5 right-0"
:loading="isLoadingBalance"
:pt="{
icon: {
class: 'text-text-secondary text-xs'
},
loadingIcon: {
class: 'text-text-secondary text-xs'
}
}"
@click="handleRefresh"
/>
<div class="flex flex-col gap-2">
<div class="text-sm text-text-secondary">
{{ $t('subscription.totalCredits') }}
</div>
<Skeleton
v-if="isLoadingBalance"
width="8rem"
height="2rem"
/>
<div v-else class="text-2xl font-bold">
${{ totalCredits }}
</div>
</div>
<!-- Credit Breakdown -->
<div class="flex flex-col gap-1">
<div class="flex items-center gap-4">
<Skeleton
v-if="isLoadingBalance"
width="3rem"
height="1rem"
/>
<div v-else class="text-sm text-text-secondary font-bold">
${{ monthlyBonusCredits }}
</div>
<div class="flex items-center gap-1">
<div class="text-sm text-text-secondary">
{{ $t('subscription.monthlyBonusDescription') }}
</div>
<Button
v-tooltip="$t('subscription.monthlyCreditsRollover')"
icon="pi pi-question-circle"
text
rounded
size="small"
class="h-4 w-4"
:pt="{
icon: {
class: 'text-text-secondary text-xs'
}
}"
/>
</div>
</div>
<div class="flex items-center gap-4">
<Skeleton
v-if="isLoadingBalance"
width="3rem"
height="1rem"
/>
<div v-else class="text-sm text-text-secondary font-bold">
${{ prepaidCredits }}
</div>
<div class="flex items-center gap-1">
<div class="text-sm text-text-secondary">
{{ $t('subscription.prepaidDescription') }}
</div>
<Button
v-tooltip="$t('subscription.prepaidCreditsInfo')"
icon="pi pi-question-circle"
text
rounded
size="small"
class="h-4 w-4"
:pt="{
icon: {
class: 'text-text-secondary text-xs'
}
}"
/>
</div>
</div>
</div>
<div class="flex items-center justify-between">
<div>
<div class="text-xs text-muted">
{{ $t('subscription.totalCredits') }}
</div>
<div class="text-2xl font-bold">${{ totalCredits }}</div>
</div>
<Button
icon="pi pi-sync"
severity="secondary"
size="small"
:loading="isLoadingBalance"
@click="handleRefresh"
/>
</div>
<div
v-if="latestEvents.length > 0"
class="flex flex-col gap-2 pt-3 text-xs"
>
<div
v-for="event in latestEvents"
:key="event.event_id"
class="flex items-center justify-between py-1"
<a
href="https://platform.comfy.org/profile/usage"
target="_blank"
rel="noopener noreferrer"
class="text-sm text-text-secondary underline hover:text-text-secondary"
style="text-decoration: underline"
>
<div class="flex flex-col gap-0.5">
<span class="font-medium">
{{
event.event_type
? customerEventService.formatEventType(
event.event_type
)
: ''
}}
</span>
<span class="text-muted">
{{
event.createdAt
? customerEventService.formatDate(event.createdAt)
: ''
}}
</span>
</div>
<div
v-if="event.params?.amount !== undefined"
class="font-bold"
>
${{
customerEventService.formatAmount(
event.params.amount as number
)
}}
</div>
</div>
</div>
<div class="flex items-center justify-between pt-2">
<Button
:label="$t('subscription.viewUsageHistory')"
text
severity="secondary"
class="p-0 text-xs text-muted"
@click="handleViewUsageHistory"
/>
{{ $t('subscription.viewUsageHistory') }}
</a>
<Button
v-if="isActiveSubscription"
:label="$t('subscription.addApiCredits')"
:label="$t('subscription.addCredits')"
severity="secondary"
class="text-xs"
class="p-2 min-h-8 bg-interface-menu-component-surface-selected"
:pt="{
root: {
style: 'border-radius: 8px;'
},
label: {
class: 'text-sm'
}
}"
@click="handleAddApiCredits"
/>
</div>
@@ -149,7 +211,7 @@
</div>
</div>
<div class="flex flex-col gap-3">
<div class="flex flex-col gap-2 flex-1">
<div class="text-sm">
{{ $t('subscription.yourPlanIncludes') }}
</div>
@@ -161,7 +223,7 @@
</div>
<div
class="flex items-center justify-between border-t border-charcoal-400 pt-3"
class="flex items-center justify-between border-t border-interface-stroke pt-3"
>
<div class="flex gap-2">
<Button
@@ -170,7 +232,15 @@
severity="secondary"
icon="pi pi-question-circle"
class="text-xs"
@click="handleLearnMore"
:pt="{
label: {
class: 'text-text-secondary'
},
icon: {
class: 'text-text-secondary text-xs'
}
}"
@click="handleLearnMoreClick"
/>
<Button
:label="$t('subscription.messageSupport')"
@@ -178,6 +248,15 @@
severity="secondary"
icon="pi pi-comment"
class="text-xs"
:loading="isLoadingSupport"
:pt="{
label: {
class: 'text-text-secondary'
},
icon: {
class: 'text-text-secondary text-xs'
}
}"
@click="handleMessageSupport"
/>
</div>
@@ -189,6 +268,14 @@
icon="pi pi-external-link"
icon-pos="right"
class="text-xs"
:pt="{
label: {
class: 'text-text-secondary'
},
icon: {
class: 'text-text-secondary text-xs'
}
}"
@click="handleInvoiceHistory"
/>
</div>
@@ -198,26 +285,16 @@
<script setup lang="ts">
import Button from 'primevue/button'
import Skeleton from 'primevue/skeleton'
import TabPanel from 'primevue/tabpanel'
import { computed, onMounted, ref } from 'vue'
import CloudBadge from '@/components/topbar/CloudBadge.vue'
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
import SubscribeButton from '@/platform/cloud/subscription/components/SubscribeButton.vue'
import SubscriptionBenefits from '@/platform/cloud/subscription/components/SubscriptionBenefits.vue'
import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
import type { AuditLog } from '@/services/customerEventsService'
import { useCustomerEventsService } from '@/services/customerEventsService'
import { useDialogService } from '@/services/dialogService'
import { useCommandStore } from '@/stores/commandStore'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
import { formatMetronomeCurrency } from '@/utils/formatUtil'
const dialogService = useDialogService()
const authActions = useFirebaseAuthActions()
const commandStore = useCommandStore()
const authStore = useFirebaseAuthStore()
const customerEventService = useCustomerEventsService()
import { useSubscriptionActions } from '@/platform/cloud/subscription/composables/useSubscriptionActions'
import { useSubscriptionCredits } from '@/platform/cloud/subscription/composables/useSubscriptionCredits'
import { cn } from '@/utils/tailwindUtil'
const {
isActiveSubscription,
@@ -226,54 +303,20 @@ const {
formattedEndDate,
formattedMonthlyPrice,
manageSubscription,
handleViewUsageHistory,
handleLearnMore,
handleInvoiceHistory,
fetchStatus
handleInvoiceHistory
} = useSubscription()
const latestEvents = ref<AuditLog[]>([])
const { totalCredits, monthlyBonusCredits, prepaidCredits, isLoadingBalance } =
useSubscriptionCredits()
const totalCredits = computed(() => {
if (!authStore.balance) return '0.00'
return formatMetronomeCurrency(authStore.balance.amount_micros, 'usd')
})
const isLoadingBalance = computed(() => authStore.isFetchingBalance)
const fetchLatestEvents = async () => {
try {
const response = await customerEventService.getMyEvents({
page: 1,
limit: 2
})
if (response?.events) {
latestEvents.value = response.events
}
} catch (error) {
console.error('[SubscriptionPanel] Error fetching latest events:', error)
}
}
onMounted(() => {
void handleRefresh()
})
const handleAddApiCredits = () => {
dialogService.showTopUpCreditsDialog()
}
const handleMessageSupport = async () => {
await commandStore.execute('Comfy.ContactSupport')
}
const handleRefresh = async () => {
await Promise.all([
authActions.fetchBalance(),
fetchStatus(),
fetchLatestEvents()
])
}
const {
isLoadingSupport,
refreshTooltip,
handleAddApiCredits,
handleMessageSupport,
handleRefresh,
handleLearnMoreClick
} = useSubscriptionActions()
</script>
<style scoped>

View File

@@ -1,5 +1,15 @@
<template>
<div class="grid h-full grid-cols-5 px-10 pb-10">
<div class="relative grid h-full grid-cols-5">
<!-- Custom close button -->
<Button
icon="pi pi-times"
text
rounded
class="absolute top-2.5 right-2.5 z-10 h-8 w-8 p-0 text-white hover:bg-white/20"
:aria-label="$t('g.close')"
@click="onClose"
/>
<div
class="relative col-span-2 flex items-center justify-center overflow-hidden rounded-sm"
>
@@ -8,7 +18,7 @@
loop
muted
playsinline
class="h-full min-w-[125%] object-cover"
class="h-full min-w-[125%] object-cover p-0"
style="margin-left: -20%"
>
<source
@@ -18,17 +28,18 @@
</video>
</div>
<div class="col-span-3 flex flex-col justify-between pl-8">
<div class="col-span-3 flex flex-col justify-between p-8">
<div>
<div class="flex flex-col gap-4">
<div class="flex flex-col gap-6">
<div class="inline-flex items-center gap-2">
<div class="text-sm text-muted">
<div class="text-text-primary text-sm text-muted">
{{ $t('subscription.required.title') }}
</div>
<CloudBadge
reverse-order
no-padding
background-color="var(--p-dialog-background)"
use-subscription
/>
</div>
@@ -41,19 +52,36 @@
<SubscriptionBenefits class="mt-6 text-muted" />
</div>
<div class="flex flex-col">
<SubscribeButton @subscribed="handleSubscribed" />
<div class="flex flex-col pt-8">
<SubscribeButton
class="rounded-lg px-4 py-2"
:pt="{
root: {
style: 'background: var(--color-accent-blue, #0B8CE9);'
},
label: {
class: 'font-inter font-[700] text-sm'
}
}"
@subscribed="handleSubscribed"
/>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import Button from 'primevue/button'
import CloudBadge from '@/components/topbar/CloudBadge.vue'
import SubscribeButton from '@/platform/cloud/subscription/components/SubscribeButton.vue'
import SubscriptionBenefits from '@/platform/cloud/subscription/components/SubscriptionBenefits.vue'
import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
defineProps<{
onClose: () => void
}>()
const emit = defineEmits<{
close: [subscribed: boolean]
}>()

View File

@@ -1,3 +1,4 @@
import { createSharedComposable } from '@vueuse/core'
import { computed, ref, watch } from 'vue'
import { useCurrentUser } from '@/composables/auth/useCurrentUser'
@@ -14,34 +15,30 @@ import {
useFirebaseAuthStore
} from '@/stores/firebaseAuthStore'
interface CloudSubscriptionCheckoutResponse {
type CloudSubscriptionCheckoutResponse = {
checkout_url: string
}
interface CloudSubscriptionStatusResponse {
type CloudSubscriptionStatusResponse = {
is_active: boolean
subscription_id: string
renewal_date: string | null
end_date?: string | null
}
const subscriptionStatus = ref<CloudSubscriptionStatusResponse | null>(null)
function useSubscriptionInternal() {
const subscriptionStatus = ref<CloudSubscriptionStatusResponse | null>(null)
const isActiveSubscription = computed(() => {
if (!isCloud || !window.__CONFIG__?.subscription_required) return true
const isSubscribedOrIsNotCloud = computed(() => {
if (!isCloud || !window.__CONFIG__?.subscription_required) return true
return subscriptionStatus.value?.is_active ?? false
})
let isWatchSetup = false
export function useSubscription() {
const authActions = useFirebaseAuthActions()
return subscriptionStatus.value?.is_active ?? false
})
const { reportError, accessBillingPortal } = useFirebaseAuthActions()
const dialogService = useDialogService()
const { getAuthHeader } = useFirebaseAuthStore()
const { wrapWithErrorHandlingAsync } = useErrorHandling()
const { reportError } = useFirebaseAuthActions()
const { isLoggedIn } = useCurrentUser()
@@ -54,7 +51,7 @@ export function useSubscription() {
const renewalDate = new Date(subscriptionStatus.value.renewal_date)
return renewalDate.toLocaleDateString('en-US', {
return renewalDate.toLocaleDateString(undefined, {
month: 'short',
day: 'numeric',
year: 'numeric'
@@ -66,7 +63,7 @@ export function useSubscription() {
const endDate = new Date(subscriptionStatus.value.end_date)
return endDate.toLocaleDateString('en-US', {
return endDate.toLocaleDateString(undefined, {
month: 'short',
day: 'numeric',
year: 'numeric'
@@ -77,9 +74,10 @@ export function useSubscription() {
() => `$${MONTHLY_SUBSCRIPTION_PRICE.toFixed(0)}`
)
const fetchStatus = wrapWithErrorHandlingAsync(async () => {
return await fetchSubscriptionStatus()
}, reportError)
const fetchStatus = wrapWithErrorHandlingAsync(
fetchSubscriptionStatus,
reportError
)
const subscribe = wrapWithErrorHandlingAsync(async () => {
const response = await initiateSubscriptionCheckout()
@@ -100,17 +98,17 @@ export function useSubscription() {
useTelemetry()?.trackSubscription('modal_opened')
}
dialogService.showSubscriptionRequiredDialog()
void dialogService.showSubscriptionRequiredDialog()
}
const manageSubscription = async () => {
await authActions.accessBillingPortal()
await accessBillingPortal()
}
const requireActiveSubscription = async (): Promise<void> => {
await fetchSubscriptionStatus()
if (!isActiveSubscription.value) {
if (!isSubscribedOrIsNotCloud.value) {
showSubscriptionDialog()
}
}
@@ -124,61 +122,55 @@ export function useSubscription() {
}
const handleInvoiceHistory = async () => {
await authActions.accessBillingPortal()
await accessBillingPortal()
}
/**
* Fetch the current cloud subscription status for the authenticated user
* @returns Subscription status or null if no subscription exists
*/
const fetchSubscriptionStatus =
async (): Promise<CloudSubscriptionStatusResponse | null> => {
const authHeader = await getAuthHeader()
if (!authHeader) {
throw new FirebaseAuthStoreError(
t('toastMessages.userNotAuthenticated')
)
}
const response = await fetch(
`${COMFY_API_BASE_URL}/customers/cloud-subscription-status`,
{
headers: {
...authHeader,
'Content-Type': 'application/json'
}
}
)
if (!response.ok) {
const errorData = await response.json()
throw new FirebaseAuthStoreError(
t('toastMessages.failedToFetchSubscription', {
error: errorData.message
})
)
}
const statusData = await response.json()
subscriptionStatus.value = statusData
return statusData
async function fetchSubscriptionStatus(): Promise<CloudSubscriptionStatusResponse | null> {
const authHeader = await getAuthHeader()
if (!authHeader) {
throw new FirebaseAuthStoreError(t('toastMessages.userNotAuthenticated'))
}
if (!isWatchSetup) {
isWatchSetup = true
watch(
() => isLoggedIn.value,
async (loggedIn) => {
if (loggedIn) {
await fetchSubscriptionStatus()
} else {
subscriptionStatus.value = null
const response = await fetch(
`${COMFY_API_BASE_URL}/customers/cloud-subscription-status`,
{
headers: {
...authHeader,
'Content-Type': 'application/json'
}
},
{ immediate: true }
}
)
if (!response.ok) {
const errorData = await response.json()
throw new FirebaseAuthStoreError(
t('toastMessages.failedToFetchSubscription', {
error: errorData.message
})
)
}
const statusData = await response.json()
subscriptionStatus.value = statusData
return statusData
}
watch(
() => isLoggedIn.value,
async (loggedIn) => {
if (loggedIn) {
await fetchSubscriptionStatus()
} else {
subscriptionStatus.value = null
}
},
{ immediate: true }
)
const initiateSubscriptionCheckout =
async (): Promise<CloudSubscriptionCheckoutResponse> => {
const authHeader = await getAuthHeader()
@@ -213,7 +205,7 @@ export function useSubscription() {
return {
// State
isActiveSubscription,
isActiveSubscription: isSubscribedOrIsNotCloud,
isCancelled,
formattedRenewalDate,
formattedEndDate,
@@ -230,3 +222,5 @@ export function useSubscription() {
handleInvoiceHistory
}
}
export const useSubscription = createSharedComposable(useSubscriptionInternal)

View File

@@ -0,0 +1,66 @@
import { computed, onMounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
import { useDialogService } from '@/services/dialogService'
import { useCommandStore } from '@/stores/commandStore'
/**
* Composable for handling subscription panel actions and loading states
*/
export function useSubscriptionActions() {
const { t } = useI18n()
const dialogService = useDialogService()
const authActions = useFirebaseAuthActions()
const commandStore = useCommandStore()
const { fetchStatus, formattedRenewalDate } = useSubscription()
const isLoadingSupport = ref(false)
const refreshTooltip = computed(() => {
const date =
formattedRenewalDate.value || t('subscription.nextBillingCycle')
return `Refreshes on ${date}`
})
onMounted(() => {
void handleRefresh()
})
const handleAddApiCredits = () => {
dialogService.showTopUpCreditsDialog()
}
const handleMessageSupport = async () => {
try {
isLoadingSupport.value = true
await commandStore.execute('Comfy.ContactSupport')
} catch (error) {
console.error('[useSubscriptionActions] Error contacting support:', error)
} finally {
isLoadingSupport.value = false
}
}
const handleRefresh = async () => {
try {
await Promise.all([authActions.fetchBalance(), fetchStatus()])
} catch (error) {
console.error('[useSubscriptionActions] Error refreshing data:', error)
}
}
const handleLearnMoreClick = () => {
window.open('https://docs.comfy.org/get_started/cloud', '_blank')
}
return {
isLoadingSupport,
refreshTooltip,
handleAddApiCredits,
handleMessageSupport,
handleRefresh,
handleLearnMoreClick
}
}

View File

@@ -0,0 +1,61 @@
import { computed } from 'vue'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
import { formatMetronomeCurrency } from '@/utils/formatUtil'
/**
* Composable for handling subscription credit calculations and formatting
*/
export function useSubscriptionCredits() {
const authStore = useFirebaseAuthStore()
const totalCredits = computed(() => {
if (!authStore.balance?.amount_micros) return '0.00'
try {
return formatMetronomeCurrency(authStore.balance.amount_micros, 'usd')
} catch (error) {
console.error(
'[useSubscriptionCredits] Error formatting total credits:',
error
)
return '0.00'
}
})
const monthlyBonusCredits = computed(() => {
const balance = authStore.balance as any
if (!balance?.cloud_credit_balance_micros) return '0.00'
try {
return formatMetronomeCurrency(balance.cloud_credit_balance_micros, 'usd')
} catch (error) {
console.error(
'[useSubscriptionCredits] Error formatting monthly bonus credits:',
error
)
return '0.00'
}
})
const prepaidCredits = computed(() => {
const balance = authStore.balance as any
if (!balance?.prepaid_balance_micros) return '0.00'
try {
return formatMetronomeCurrency(balance.prepaid_balance_micros, 'usd')
} catch (error) {
console.error(
'[useSubscriptionCredits] Error formatting prepaid credits:',
error
)
return '0.00'
}
})
const isLoadingBalance = computed(() => authStore.isFetchingBalance)
return {
totalCredits,
monthlyBonusCredits,
prepaidCredits,
isLoadingBalance
}
}

View File

@@ -0,0 +1,38 @@
import { defineAsyncComponent } from 'vue'
import { useDialogService } from '@/services/dialogService'
import { useDialogStore } from '@/stores/dialogStore'
const DIALOG_KEY = 'subscription-required'
export const useSubscriptionDialog = () => {
const dialogService = useDialogService()
const dialogStore = useDialogStore()
function hide() {
dialogStore.closeDialog({ key: DIALOG_KEY })
}
function show() {
dialogService.showLayoutDialog({
key: DIALOG_KEY,
component: defineAsyncComponent(
() =>
import(
'@/platform/cloud/subscription/components/SubscriptionRequiredDialogContent.vue'
)
),
props: {
onClose: hide
},
dialogComponentProps: {
style: 'width: 700px;'
}
})
}
return {
show,
hide
}
}

View File

@@ -1,13 +1,67 @@
<template>
<div class="flex h-full items-center justify-center p-8">
<div class="max-w-[100vw] text-center lg:w-96">
<h2 class="mb-4 text-xl">
<div class="flex h-full items-center justify-center p-6">
<div class="max-w-[100vw] text-center lg:w-[500px]">
<h2 class="mb-3 text-xl text-text-primary">
{{ $t('cloudOnboarding.authTimeout.title') }}
</h2>
<p class="mb-6 text-gray-600">
<p class="mb-5 text-muted">
{{ $t('cloudOnboarding.authTimeout.message') }}
</p>
<!-- Troubleshooting Section -->
<div
class="mb-4 rounded bg-surface-700 px-3 py-2 text-left dark-theme:bg-surface-800"
>
<h3 class="mb-2 text-sm font-semibold text-text-primary">
{{ $t('cloudOnboarding.authTimeout.troubleshooting') }}
</h3>
<ul class="space-y-1.5 text-sm text-muted">
<li
v-for="(cause, index) in $tm('cloudOnboarding.authTimeout.causes')"
:key="index"
class="flex gap-2"
>
<span></span>
<span>{{ cause }}</span>
</li>
</ul>
</div>
<!-- Technical Details (Collapsible) -->
<div v-if="errorMessage" class="mb-4 text-left">
<button
class="flex w-full items-center justify-between rounded bg-surface-600 px-4 py-2 text-sm text-muted transition-colors hover:bg-surface-500 dark-theme:bg-surface-700 dark-theme:hover:bg-surface-600"
@click="showTechnicalDetails = !showTechnicalDetails"
>
<span>{{ $t('cloudOnboarding.authTimeout.technicalDetails') }}</span>
<i
:class="[
'pi',
showTechnicalDetails ? 'pi-chevron-up' : 'pi-chevron-down'
]"
></i>
</button>
<div
v-if="showTechnicalDetails"
class="mt-2 rounded bg-surface-800 p-4 font-mono text-xs text-muted break-all dark-theme:bg-surface-900"
>
{{ errorMessage }}
</div>
</div>
<!-- Helpful Links -->
<p class="mb-5 text-center text-sm text-gray-600">
{{ $t('cloudOnboarding.authTimeout.helpText') }}
<a
href="https://support.comfy.org"
class="cursor-pointer text-blue-400 no-underline"
target="_blank"
rel="noopener noreferrer"
>
{{ $t('cloudOnboarding.authTimeout.supportLink') }}</a
>.
</p>
<div class="flex flex-col gap-3">
<Button
:label="$t('cloudOnboarding.authTimeout.restart')"
@@ -21,12 +75,20 @@
<script setup lang="ts">
import Button from 'primevue/button'
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
interface Props {
errorMessage?: string
}
defineProps<Props>()
const router = useRouter()
const { logout } = useFirebaseAuthActions()
const showTechnicalDetails = ref(false)
const handleRestart = async () => {
await logout()

View File

@@ -98,7 +98,10 @@ const inviteCode = computed(() => route.query.inviteCode as string)
const onSwitchAccounts = () => {
void router.push({
name: 'cloud-login',
query: { inviteCode: inviteCode.value }
query: {
switchAccount: 'true',
inviteCode: inviteCode.value
}
})
}
const onClickSupport = () => {

View File

@@ -17,23 +17,16 @@ onMounted(async () => {
const inviteCode = route.params.code as string | undefined
if (firebaseAuthStore.isAuthenticated) {
const { isEmailVerified } = firebaseAuthStore
if (!isEmailVerified) {
// User is logged in but email not verified
await router.push({ name: 'cloud-verify-email', query: { inviteCode } })
// User is logged in - no email verification check needed
if (inviteCode) {
// Handle invite code flow - go to invite check
await router.push({
name: 'cloud-invite-check',
query: { inviteCode }
})
} else {
// User is logged in and verified
if (inviteCode) {
// Handle invite code flow - go to invite check
await router.push({
name: 'cloud-invite-check',
query: { inviteCode }
})
} else {
// Normal login flow - go to user check
await router.push({ name: 'cloud-user-check' })
}
// Normal login flow - go to user check
await router.push({ name: 'cloud-user-check' })
}
} else {
// User is not logged in - proceed to login page

View File

@@ -115,7 +115,6 @@ import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthAction
import CloudSignInForm from '@/platform/onboarding/cloud/components/CloudSignInForm.vue'
import { useToastStore } from '@/platform/updates/common/toastStore'
import type { SignInData } from '@/schemas/signInSchema'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
import { translateAuthError } from '@/utils/authErrorTranslation'
const { t } = useI18n()
@@ -140,20 +139,15 @@ const onSuccess = async () => {
})
// Check if there's an invite code
const inviteCode = route.query.inviteCode as string | undefined
const { isEmailVerified } = useFirebaseAuthStore()
if (!isEmailVerified) {
await router.push({ name: 'cloud-verify-email', query: { inviteCode } })
if (inviteCode) {
// Handle invite code flow - go to invite check
await router.push({
name: 'cloud-invite-check',
query: { inviteCode }
})
} else {
if (inviteCode) {
// Handle invite code flow - go to invite check
await router.push({
name: 'cloud-invite-check',
query: { inviteCode }
})
} else {
// Normal login flow - go to user check
await router.push({ name: 'cloud-user-check' })
}
// Normal login flow - go to user check
await router.push({ name: 'cloud-user-check' })
}
}

View File

@@ -104,7 +104,6 @@ import { isCloud } from '@/platform/distribution/types'
import { useTelemetry } from '@/platform/telemetry'
import { useToastStore } from '@/platform/updates/common/toastStore'
import type { SignUpData } from '@/schemas/signInSchema'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
import { translateAuthError } from '@/utils/authErrorTranslation'
import { isInChina } from '@/utils/networkUtil'
@@ -127,20 +126,8 @@ const onSuccess = async () => {
summary: 'Sign up Completed',
life: 2000
})
// Check if email verification is needed
const { isEmailVerified } = useFirebaseAuthStore()
const inviteCode = route.query.inviteCode as string | undefined
if (!isEmailVerified) {
// Redirect to email verification with fromAuth flag
await router.push({
name: 'cloud-verify-email',
query: { inviteCode, fromAuth: 'true' }
})
} else {
// The invite code will be handled after the user is logged in
await router.push({ path: '/', query: route.query })
}
// Direct redirect to main app - email verification removed
await router.push({ path: '/', query: route.query })
}
// Custom error handler for inline display

View File

@@ -1,191 +0,0 @@
<template>
<div class="mx-auto max-w-[640px] px-6 py-8">
<!-- Back button -->
<button
type="button"
class="text-foreground/80 flex size-10 items-center justify-center rounded-lg border border-white bg-transparent"
aria-label="{{ t('cloudVerifyEmail_back') }}"
@click="goBack"
>
<i class="pi pi-arrow-left" />
</button>
<!-- Title -->
<h1 class="mt-8 text-2xl font-semibold">
{{ t('cloudVerifyEmail_title') }}
</h1>
<!-- Body copy -->
<p class="text-foreground/80 mt-6 mb-0 text-base">
{{ t('cloudVerifyEmail_sent') }}
</p>
<p class="mt-2 text-base font-medium">{{ authStore.userEmail }}</p>
<p class="text-foreground/80 mt-6 text-base whitespace-pre-line">
{{ t('cloudVerifyEmail_clickToContinue') }}
</p>
<p class="text-foreground/80 mt-6 text-base whitespace-pre-line">
{{ t('cloudVerifyEmail_tip') }}
</p>
<p class="text-foreground/80 mt-6 mb-0 text-base">
{{ t('cloudVerifyEmail_didntReceive') }}
</p>
<p class="text-foreground/80 mt-1 text-base">
<span class="cursor-pointer text-blue-400 no-underline" @click="onSend">
{{ t('cloudVerifyEmail_resend') }}</span
>
</p>
</div>
</template>
<script setup lang="ts">
import { onMounted, onUnmounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRoute, useRouter } from 'vue-router'
import { useFirebaseAuth } from 'vuefire'
import { isCloud } from '@/platform/distribution/types'
import { useTelemetry } from '@/platform/telemetry'
import { useToastStore } from '@/platform/updates/common/toastStore'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
const authStore = useFirebaseAuthStore()
const auth = useFirebaseAuth()!
const router = useRouter()
const route = useRoute()
const { t } = useI18n()
const toastStore = useToastStore()
let intervalId: number | null = null
let timeoutId: number | null = null
const redirectInProgress = ref(false)
function clearPolling(): void {
if (intervalId !== null) {
clearInterval(intervalId)
intervalId = null
}
if (timeoutId !== null) {
clearTimeout(timeoutId)
timeoutId = null
}
}
async function redirectToNextStep(): Promise<void> {
if (redirectInProgress.value) return
redirectInProgress.value = true
clearPolling()
const inviteCode = route.query.inviteCode as string | undefined
if (inviteCode) {
await router.push({
name: 'cloud-invite-check',
query: { inviteCode }
})
} else {
await router.push({ name: 'cloud-user-check' })
}
}
const goBack = async () => {
const inviteCode = route.query.inviteCode as string | undefined
const authStore = useFirebaseAuthStore()
// If the user is already verified (email link already clicked),
// continue to the next step automatically.
if (authStore.isEmailVerified) {
await router.push({
name: 'cloud-invite-check',
query: inviteCode ? { inviteCode } : {}
})
} else {
await router.push({
name: 'cloud-login',
query: {
inviteCode
}
})
}
}
async function onSend() {
try {
await authStore.verifyEmail()
// Track email verification requested
if (isCloud) {
useTelemetry()?.trackEmailVerification('requested')
}
toastStore.add({
severity: 'info',
summary: t('cloudVerifyEmail_toast_title'),
detail: t('cloudVerifyEmail_toast_summary'),
life: 2000
})
} catch (e) {
toastStore.add({
severity: 'error',
summary: t('cloudVerifyEmail_toast_failed'),
life: 2000
})
}
}
onMounted(async () => {
// Track email verification screen opened
if (isCloud) {
useTelemetry()?.trackEmailVerification('opened')
}
// If the user is already verified (email link already clicked),
// continue to the next step automatically.
if (authStore.isEmailVerified) {
return redirectToNextStep()
}
// Only send verification email automatically if coming from signup/login flow
// Check if 'fromAuth' query parameter is present
const fromAuth = route.query.fromAuth === 'true'
if (fromAuth) {
await onSend()
// Remove fromAuth query parameter after sending email to prevent re-sending on refresh
const { fromAuth: _, ...remainingQuery } = route.query
await router.replace({
name: route.name as string,
query: remainingQuery
})
}
// Start polling to check email verification status
intervalId = window.setInterval(async () => {
if (auth.currentUser && !redirectInProgress.value) {
await auth.currentUser.reload()
if (auth.currentUser?.emailVerified) {
// Track email verification completed
if (isCloud) {
useTelemetry()?.trackEmailVerification('completed')
}
void redirectToNextStep()
}
}
}, 5000) // Check every 5 seconds
// Stop polling after 5 minutes
timeoutId = window.setTimeout(
() => {
clearPolling()
},
5 * 60 * 1000
)
})
onUnmounted(() => {
clearPolling()
})
</script>

View File

@@ -52,7 +52,8 @@ const router = useRouter()
const onSwitchAccounts = () => {
void router.push({
name: 'cloud-login'
name: 'cloud-login',
query: { switchAccount: 'true' }
})
}

View File

@@ -61,19 +61,25 @@ const {
return
}
// Survey is required for all users
if (!surveyStatus) {
skeletonType.value = 'survey'
await router.replace({ name: 'cloud-survey' })
return
}
if (cloudUserStats.status !== 'active') {
// Check if we should enforce whitelist requirement
const requireWhitelist = window.__CONFIG__?.require_whitelist ?? true
// Check feature flag and redirect non-active users if whitelist is required
if (requireWhitelist && cloudUserStats.status !== 'active') {
// Feature flag ON: Show waitlist page for non-active users
skeletonType.value = 'waitlist'
await router.replace({ name: 'cloud-waitlist' })
return
}
// User is fully onboarded
// User is fully onboarded (active or whitelist check disabled)
window.location.href = '/'
}),
null,

View File

@@ -14,6 +14,7 @@ type ServerHealthAlert = {
*/
export type RemoteConfig = {
mixpanel_token?: string
require_whitelist?: boolean
subscription_required?: boolean
server_health_alert?: ServerHealthAlert
}

View File

@@ -347,24 +347,6 @@ export class MixpanelTelemetryProvider implements TelemetryProvider {
}
}
trackEmailVerification(stage: 'opened' | 'requested' | 'completed'): void {
let eventName: TelemetryEventName
switch (stage) {
case 'opened':
eventName = TelemetryEvents.USER_EMAIL_VERIFY_OPENED
break
case 'requested':
eventName = TelemetryEvents.USER_EMAIL_VERIFY_REQUESTED
break
case 'completed':
eventName = TelemetryEvents.USER_EMAIL_VERIFY_COMPLETED
break
}
this.trackEvent(eventName)
}
trackTemplate(metadata: TemplateMetadata): void {
this.trackEvent(TelemetryEvents.TEMPLATE_WORKFLOW_OPENED, metadata)
}

View File

@@ -104,9 +104,6 @@ export interface TelemetryProvider {
// Survey flow events
trackSurvey(stage: 'opened' | 'submitted', responses?: SurveyResponses): void
// Email verification events
trackEmailVerification(stage: 'opened' | 'requested' | 'completed'): void
// Template workflow events
trackTemplate(metadata: TemplateMetadata): void
@@ -141,11 +138,6 @@ export const TelemetryEvents = {
USER_SURVEY_OPENED: 'app:user_survey_opened',
USER_SURVEY_SUBMITTED: 'app:user_survey_submitted',
// Email Verification
USER_EMAIL_VERIFY_OPENED: 'app:user_email_verify_opened',
USER_EMAIL_VERIFY_REQUESTED: 'app:user_email_verify_requested',
USER_EMAIL_VERIFY_COMPLETED: 'app:user_email_verify_completed',
// Template Tracking
TEMPLATE_WORKFLOW_OPENED: 'app:template_workflow_opened',

View File

@@ -129,8 +129,13 @@ router.beforeEach(async (to, _from, next) => {
})
} catch (error) {
console.error('Auth initialization failed:', error)
// Navigate to auth timeout recovery page
return next({ name: 'cloud-auth-timeout' })
// Navigate to auth timeout recovery page with error details
return next({
name: 'cloud-auth-timeout',
params: {
errorMessage: error instanceof Error ? error.message : String(error)
}
})
}
}
@@ -178,32 +183,28 @@ router.beforeEach(async (to, _from, next) => {
// User is logged in - check if they need onboarding
// For root path, check actual user status to handle waitlisted users
if (!isElectron() && isLoggedIn && to.path === '/') {
// Import auth functions dynamically to avoid circular dependency
const { getUserCloudStatus, getSurveyCompletedStatus } = await import(
'@/api/auth'
)
try {
// Check email verification first
const authStore = useFirebaseAuthStore()
if (!authStore.isEmailVerified) {
// Don't pass fromAuth here since this is from root navigation, not auth flow
return next({ name: 'cloud-verify-email' })
}
// Import auth functions dynamically to avoid circular dependency
const { getUserCloudStatus, getSurveyCompletedStatus } = await import(
'@/api/auth'
)
// Check user's actual status
const userStatus = await getUserCloudStatus()
const surveyCompleted = await getSurveyCompletedStatus()
// If user is not active (waitlisted), redirect based on survey status
if (userStatus.status !== 'active') {
if (!surveyCompleted) {
return next({ name: 'cloud-survey' })
} else {
return next({ name: 'cloud-waitlist' })
}
// Survey is required for all users regardless of whitelist status
if (!surveyCompleted) {
return next({ name: 'cloud-survey' })
}
// User is active, allow access to root
// Check if we should enforce whitelist requirement
const requireWhitelist = window.__CONFIG__?.require_whitelist ?? true
// Check feature flag and redirect non-active users if whitelist is required
if (requireWhitelist && userStatus.status !== 'active') {
return next({ name: 'cloud-waitlist' })
}
// User is active or whitelist check disabled: Allow access to root
} catch (error) {
console.error('Failed to check user status:', error)
// On error, redirect to user-check as fallback

View File

@@ -433,8 +433,12 @@ export class ComfyApi extends EventTarget {
await this.#waitForAuthInitialization()
// Add Firebase JWT token if user is logged in
// Force refresh token on reconnection to avoid 401 errors
const isReconnecting =
options.headers && 'X-Reconnecting' in options.headers
try {
const authHeader = await useFirebaseAuthStore().getAuthHeader()
const authHeader =
await useFirebaseAuthStore().getAuthHeader(isReconnecting)
if (authHeader) {
if (Array.isArray(options.headers)) {
for (const [key, value] of Object.entries(authHeader)) {
@@ -542,9 +546,10 @@ export class ComfyApi extends EventTarget {
let existingSession = window.name
// Get auth token if available
// Force refresh on reconnect to avoid stale tokens
let authToken: string | undefined
try {
authToken = await useFirebaseAuthStore().getIdToken()
authToken = await useFirebaseAuthStore().getIdToken(isReconnect)
} catch (error) {
// Continue without auth token if there's an error
console.warn('Could not get auth token for WebSocket connection:', error)

View File

@@ -1,5 +1,4 @@
import { merge } from 'es-toolkit/compat'
import { defineAsyncComponent } from 'vue'
import type { Component } from 'vue'
import ApiNodesSignInContent from '@/components/dialog/content/ApiNodesSignInContent.vue'
@@ -70,6 +69,7 @@ export const useDialogService = () => {
| 'server-config'
| 'user'
| 'credits'
| 'subscription'
) {
const props = panel ? { props: { defaultPanel: panel } } : undefined
@@ -487,35 +487,16 @@ export const useDialogService = () => {
})
}
function showSubscriptionRequiredDialog() {
async function showSubscriptionRequiredDialog() {
if (!isCloud || !window.__CONFIG__?.subscription_required) {
return
}
dialogStore.showDialog({
key: 'subscription-required',
component: defineAsyncComponent(
() =>
import(
'@/platform/cloud/subscription/components/SubscriptionRequiredDialogContent.vue'
)
),
props: {
onClose: () => {
dialogStore.closeDialog({ key: 'subscription-required' })
}
},
dialogComponentProps: {
closable: true,
style: 'width: 700px;',
pt: {
header: { class: '!p-0 !m-0' },
content: {
class: 'overflow-hidden !p-0 !m-0'
}
}
}
})
const { useSubscriptionDialog } = await import(
'@/platform/cloud/subscription/composables/useSubscriptionDialog'
)
const { show } = useSubscriptionDialog()
show()
}
return {

View File

@@ -9,7 +9,6 @@ import {
getAdditionalUserInfo,
onAuthStateChanged,
onIdTokenChanged,
sendEmailVerification,
sendPasswordResetEmail,
setPersistence,
signInWithEmailAndPassword,
@@ -82,9 +81,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
const isAuthenticated = computed(() => !!currentUser.value)
const userEmail = computed(() => currentUser.value?.email)
const userId = computed(() => currentUser.value?.uid)
const isEmailVerified = computed(
() => currentUser.value?.emailVerified ?? false
)
// Get auth from VueFire and listen for auth state changes
// From useFirebaseAuth docs:
@@ -110,10 +106,12 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
}
})
const getIdToken = async (): Promise<string | undefined> => {
const getIdToken = async (
forceRefresh = false
): Promise<string | undefined> => {
if (!currentUser.value) return
try {
return await currentUser.value.getIdToken()
return await currentUser.value.getIdToken(forceRefresh)
} catch (error: unknown) {
if (
error instanceof FirebaseError &&
@@ -144,9 +142,11 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
* - An ApiKeyAuthHeader with X-API-KEY if API key exists
* - null if neither authentication method is available
*/
const getAuthHeader = async (): Promise<AuthHeader | null> => {
const getAuthHeader = async (
forceRefresh = false
): Promise<AuthHeader | null> => {
// If available, set header with JWT used to identify the user to Firebase service
const token = await getIdToken()
const token = await getIdToken(forceRefresh)
if (token) {
return {
Authorization: `Bearer ${token}`
@@ -349,14 +349,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
await updatePassword(currentUser.value, newPassword)
}
/** Send email verification to current user */
const verifyEmail = async (): Promise<void> => {
if (!currentUser.value) {
throw new FirebaseAuthStoreError(t('toastMessages.userNotAuthenticated'))
}
await sendEmailVerification(currentUser.value)
}
/** Delete the current user account */
const _deleteAccount = async (): Promise<void> => {
if (!currentUser.value) {
@@ -440,7 +432,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
// State
loading,
currentUser,
isEmailVerified,
isInitialized,
balance,
lastBalanceUpdateTime,
@@ -466,7 +457,6 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
sendPasswordReset,
updatePassword: _updatePassword,
getAuthHeader,
verifyEmail,
deleteAccount: _deleteAccount
}
})

View File

@@ -0,0 +1,213 @@
import { createTestingPinia } from '@pinia/testing'
import { mount } from '@vue/test-utils'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { createI18n } from 'vue-i18n'
import SubscriptionPanel from '@/platform/cloud/subscription/components/SubscriptionPanel.vue'
// Mock composables
const mockSubscriptionData = {
isActiveSubscription: false,
isCancelled: false,
formattedRenewalDate: '2024-12-31',
formattedEndDate: '2024-12-31',
formattedMonthlyPrice: '$9.99',
manageSubscription: vi.fn(),
handleInvoiceHistory: vi.fn()
}
const mockCreditsData = {
totalCredits: '10.00',
monthlyBonusCredits: '5.00',
prepaidCredits: '5.00',
isLoadingBalance: false
}
const mockActionsData = {
isLoadingSupport: false,
refreshTooltip: 'Refreshes on 2024-12-31',
handleAddApiCredits: vi.fn(),
handleMessageSupport: vi.fn(),
handleRefresh: vi.fn(),
handleLearnMoreClick: vi.fn()
}
vi.mock('@/platform/cloud/subscription/composables/useSubscription', () => ({
useSubscription: () => mockSubscriptionData
}))
vi.mock(
'@/platform/cloud/subscription/composables/useSubscriptionCredits',
() => ({
useSubscriptionCredits: () => mockCreditsData
})
)
vi.mock(
'@/platform/cloud/subscription/composables/useSubscriptionActions',
() => ({
useSubscriptionActions: () => mockActionsData
})
)
// Create i18n instance for testing
const i18n = createI18n({
legacy: false,
locale: 'en',
messages: {
en: {
subscription: {
title: 'Subscription',
perMonth: '/ month',
subscribeNow: 'Subscribe Now',
manageSubscription: 'Manage Subscription',
partnerNodesBalance: 'Partner Nodes Balance',
partnerNodesDescription: 'Credits for partner nodes',
totalCredits: 'Total Credits',
monthlyBonusDescription: 'Monthly bonus',
prepaidDescription: 'Prepaid credits',
monthlyCreditsRollover: 'Monthly credits rollover info',
prepaidCreditsInfo: 'Prepaid credits info',
viewUsageHistory: 'View Usage History',
addCredits: 'Add Credits',
yourPlanIncludes: 'Your plan includes',
learnMore: 'Learn More',
messageSupport: 'Message Support',
invoiceHistory: 'Invoice History',
renewsDate: 'Renews {date}',
expiresDate: 'Expires {date}'
}
}
}
})
function createWrapper(overrides = {}) {
return mount(SubscriptionPanel, {
global: {
plugins: [createTestingPinia({ createSpy: vi.fn }), i18n],
stubs: {
CloudBadge: true,
SubscribeButton: true,
SubscriptionBenefits: true,
Button: {
template:
'<button @click="$emit(\'click\')" :disabled="loading" :data-testid="label" :data-icon="icon">{{ label }}</button>',
props: [
'loading',
'label',
'icon',
'text',
'severity',
'size',
'iconPos',
'pt'
],
emits: ['click']
},
Skeleton: {
template: '<div class="skeleton"></div>'
}
}
},
...overrides
})
}
describe('SubscriptionPanel', () => {
beforeEach(() => {
vi.clearAllMocks()
})
describe('subscription state functionality', () => {
it('shows correct UI for active subscription', () => {
mockSubscriptionData.isActiveSubscription = true
const wrapper = createWrapper()
expect(wrapper.text()).toContain('Manage Subscription')
expect(wrapper.text()).toContain('Add Credits')
})
it('shows correct UI for inactive subscription', () => {
mockSubscriptionData.isActiveSubscription = false
const wrapper = createWrapper()
expect(wrapper.findComponent({ name: 'SubscribeButton' }).exists()).toBe(
true
)
expect(wrapper.text()).not.toContain('Manage Subscription')
expect(wrapper.text()).not.toContain('Add Credits')
})
it('shows renewal date for active non-cancelled subscription', () => {
mockSubscriptionData.isActiveSubscription = true
mockSubscriptionData.isCancelled = false
const wrapper = createWrapper()
expect(wrapper.text()).toContain('Renews 2024-12-31')
})
it('shows expiry date for cancelled subscription', () => {
mockSubscriptionData.isActiveSubscription = true
mockSubscriptionData.isCancelled = true
const wrapper = createWrapper()
expect(wrapper.text()).toContain('Expires 2024-12-31')
})
})
describe('credit display functionality', () => {
it('displays dynamic credit values correctly', () => {
const wrapper = createWrapper()
expect(wrapper.text()).toContain('$10.00') // totalCredits
expect(wrapper.text()).toContain('$5.00') // both monthlyBonus and prepaid
})
it('shows loading skeleton when fetching balance', () => {
mockCreditsData.isLoadingBalance = true
const wrapper = createWrapper()
expect(wrapper.findAll('.skeleton').length).toBeGreaterThan(0)
})
it('hides skeleton when balance loaded', () => {
mockCreditsData.isLoadingBalance = false
const wrapper = createWrapper()
expect(wrapper.findAll('.skeleton').length).toBe(0)
})
})
describe('action buttons', () => {
it('should call handleLearnMoreClick when learn more is clicked', async () => {
const wrapper = createWrapper()
const learnMoreButton = wrapper.find('[data-testid="Learn More"]')
await learnMoreButton.trigger('click')
expect(mockActionsData.handleLearnMoreClick).toHaveBeenCalledOnce()
})
it('should call handleMessageSupport when message support is clicked', async () => {
const wrapper = createWrapper()
const supportButton = wrapper.find('[data-testid="Message Support"]')
await supportButton.trigger('click')
expect(mockActionsData.handleMessageSupport).toHaveBeenCalledOnce()
})
it('should call handleRefresh when refresh button is clicked', async () => {
const wrapper = createWrapper()
// Find the refresh button by icon
const refreshButton = wrapper.find('[data-icon="pi pi-sync"]')
await refreshButton.trigger('click')
expect(mockActionsData.handleRefresh).toHaveBeenCalledOnce()
})
})
describe('loading states', () => {
it('should show loading state on support button when loading', () => {
mockActionsData.isLoadingSupport = true
const wrapper = createWrapper()
const supportButton = wrapper.find('[data-testid="Message Support"]')
expect(supportButton.attributes('disabled')).toBeDefined()
})
it('should show loading state on refresh button when loading balance', () => {
mockCreditsData.isLoadingBalance = true
const wrapper = createWrapper()
const refreshButton = wrapper.find('[data-icon="pi pi-sync"]')
expect(refreshButton.attributes('disabled')).toBeDefined()
})
})
})

View File

@@ -0,0 +1,137 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { useSubscriptionActions } from '@/platform/cloud/subscription/composables/useSubscriptionActions'
// Mock dependencies
const mockFetchBalance = vi.fn()
const mockFetchStatus = vi.fn()
const mockShowTopUpCreditsDialog = vi.fn()
const mockExecute = vi.fn()
const mockT = vi.fn((key: string) => {
if (key === 'subscription.nextBillingCycle') return 'next billing cycle'
return key
})
vi.mock('vue-i18n', () => ({
useI18n: () => ({
t: mockT
})
}))
vi.mock('@/composables/auth/useFirebaseAuthActions', () => ({
useFirebaseAuthActions: () => ({
fetchBalance: mockFetchBalance
})
}))
const mockFormattedRenewalDate = { value: '2024-12-31' }
vi.mock('@/platform/cloud/subscription/composables/useSubscription', () => ({
useSubscription: () => ({
fetchStatus: mockFetchStatus,
formattedRenewalDate: mockFormattedRenewalDate
})
}))
vi.mock('@/services/dialogService', () => ({
useDialogService: () => ({
showTopUpCreditsDialog: mockShowTopUpCreditsDialog
})
}))
vi.mock('@/stores/commandStore', () => ({
useCommandStore: () => ({
execute: mockExecute
})
}))
// Mock window.open
const mockOpen = vi.fn()
Object.defineProperty(window, 'open', {
writable: true,
value: mockOpen
})
describe('useSubscriptionActions', () => {
beforeEach(() => {
vi.clearAllMocks()
mockFormattedRenewalDate.value = '2024-12-31'
})
describe('refreshTooltip', () => {
it('should format tooltip with renewal date', () => {
const { refreshTooltip } = useSubscriptionActions()
expect(refreshTooltip.value).toBe('Refreshes on 2024-12-31')
})
it('should use fallback text when no renewal date', () => {
mockFormattedRenewalDate.value = ''
const { refreshTooltip } = useSubscriptionActions()
expect(refreshTooltip.value).toBe('Refreshes on next billing cycle')
expect(mockT).toHaveBeenCalledWith('subscription.nextBillingCycle')
})
})
describe('handleAddApiCredits', () => {
it('should call showTopUpCreditsDialog', () => {
const { handleAddApiCredits } = useSubscriptionActions()
handleAddApiCredits()
expect(mockShowTopUpCreditsDialog).toHaveBeenCalledOnce()
})
})
describe('handleMessageSupport', () => {
it('should execute support command and manage loading state', async () => {
const { handleMessageSupport, isLoadingSupport } =
useSubscriptionActions()
expect(isLoadingSupport.value).toBe(false)
const promise = handleMessageSupport()
expect(isLoadingSupport.value).toBe(true)
await promise
expect(mockExecute).toHaveBeenCalledWith('Comfy.ContactSupport')
expect(isLoadingSupport.value).toBe(false)
})
it('should handle errors gracefully', async () => {
mockExecute.mockRejectedValueOnce(new Error('Command failed'))
const { handleMessageSupport, isLoadingSupport } =
useSubscriptionActions()
await handleMessageSupport()
expect(isLoadingSupport.value).toBe(false)
})
})
describe('handleRefresh', () => {
it('should call both fetchBalance and fetchStatus', async () => {
const { handleRefresh } = useSubscriptionActions()
await handleRefresh()
expect(mockFetchBalance).toHaveBeenCalledOnce()
expect(mockFetchStatus).toHaveBeenCalledOnce()
})
it('should handle errors gracefully', async () => {
mockFetchBalance.mockRejectedValueOnce(new Error('Fetch failed'))
const { handleRefresh } = useSubscriptionActions()
// Should not throw
await expect(handleRefresh()).resolves.toBeUndefined()
})
})
describe('handleLearnMoreClick', () => {
it('should open learn more URL', () => {
const { handleLearnMoreClick } = useSubscriptionActions()
handleLearnMoreClick()
expect(mockOpen).toHaveBeenCalledWith(
'https://docs.comfy.org/get_started/cloud',
'_blank'
)
})
})
})

View File

@@ -0,0 +1,146 @@
import { createPinia, setActivePinia } from 'pinia'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { useSubscriptionCredits } from '@/platform/cloud/subscription/composables/useSubscriptionCredits'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
// Mock Firebase Auth and related modules
vi.mock('vuefire', () => ({
useFirebaseAuth: vi.fn(() => ({
onAuthStateChanged: vi.fn(),
setPersistence: vi.fn()
}))
}))
vi.mock('firebase/auth', () => ({
onAuthStateChanged: vi.fn(() => {
// Mock the callback to be called immediately for testing
return vi.fn()
}),
onIdTokenChanged: vi.fn(),
setPersistence: vi.fn().mockResolvedValue(undefined),
browserLocalPersistence: {},
GoogleAuthProvider: class {
addScope = vi.fn()
setCustomParameters = vi.fn()
},
GithubAuthProvider: class {
addScope = vi.fn()
setCustomParameters = vi.fn()
}
}))
// Mock other dependencies
vi.mock('@/services/dialogService', () => ({
useDialogService: () => ({
showDialog: vi.fn()
})
}))
vi.mock('@/platform/telemetry', () => ({
useTelemetry: () => ({
track: vi.fn()
})
}))
vi.mock('@/stores/toastStore', () => ({
useToastStore: () => ({
add: vi.fn()
})
}))
vi.mock('@/stores/apiKeyAuthStore', () => ({
useApiKeyAuthStore: () => ({
headers: {}
})
}))
// Mock formatMetronomeCurrency
vi.mock('@/utils/formatUtil', () => ({
formatMetronomeCurrency: vi.fn((micros: number) => {
// Simple mock that converts micros to dollars
return (micros / 1000000).toFixed(2)
})
}))
describe('useSubscriptionCredits', () => {
let authStore: ReturnType<typeof useFirebaseAuthStore>
beforeEach(() => {
setActivePinia(createPinia())
authStore = useFirebaseAuthStore()
vi.clearAllMocks()
})
describe('totalCredits', () => {
it('should return "0.00" when balance is null', () => {
authStore.balance = null
const { totalCredits } = useSubscriptionCredits()
expect(totalCredits.value).toBe('0.00')
})
it('should return "0.00" when amount_micros is missing', () => {
authStore.balance = {} as any
const { totalCredits } = useSubscriptionCredits()
expect(totalCredits.value).toBe('0.00')
})
it('should format amount_micros correctly', () => {
authStore.balance = { amount_micros: 5000000 } as any
const { totalCredits } = useSubscriptionCredits()
expect(totalCredits.value).toBe('5.00')
})
it('should handle formatting errors gracefully', async () => {
const mockFormatMetronomeCurrency = vi.mocked(
await import('@/utils/formatUtil')
).formatMetronomeCurrency
mockFormatMetronomeCurrency.mockImplementationOnce(() => {
throw new Error('Formatting error')
})
authStore.balance = { amount_micros: 5000000 } as any
const { totalCredits } = useSubscriptionCredits()
expect(totalCredits.value).toBe('0.00')
})
})
describe('monthlyBonusCredits', () => {
it('should return "0.00" when cloud_credit_balance_micros is missing', () => {
authStore.balance = {} as any
const { monthlyBonusCredits } = useSubscriptionCredits()
expect(monthlyBonusCredits.value).toBe('0.00')
})
it('should format cloud_credit_balance_micros correctly', () => {
authStore.balance = { cloud_credit_balance_micros: 2500000 } as any
const { monthlyBonusCredits } = useSubscriptionCredits()
expect(monthlyBonusCredits.value).toBe('2.50')
})
})
describe('prepaidCredits', () => {
it('should return "0.00" when prepaid_balance_micros is missing', () => {
authStore.balance = {} as any
const { prepaidCredits } = useSubscriptionCredits()
expect(prepaidCredits.value).toBe('0.00')
})
it('should format prepaid_balance_micros correctly', () => {
authStore.balance = { prepaid_balance_micros: 7500000 } as any
const { prepaidCredits } = useSubscriptionCredits()
expect(prepaidCredits.value).toBe('7.50')
})
})
describe('isLoadingBalance', () => {
it('should reflect authStore.isFetchingBalance', () => {
authStore.isFetchingBalance = true
const { isLoadingBalance } = useSubscriptionCredits()
expect(isLoadingBalance.value).toBe(true)
authStore.isFetchingBalance = false
expect(isLoadingBalance.value).toBe(false)
})
})
})

View File

@@ -1,3 +1,4 @@
import { sentryVitePlugin } from '@sentry/vite-plugin'
import tailwindcss from '@tailwindcss/vite'
import vue from '@vitejs/plugin-vue'
import dotenv from 'dotenv'
@@ -226,7 +227,28 @@ export default defineConfig({
deep: true,
extensions: ['vue'],
directoryAsNamespace: true
})
}),
// Sentry sourcemap upload plugin
// Only runs during cloud production builds when all Sentry env vars are present
// Requires: SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT env vars
...(DISTRIBUTION === 'cloud' &&
process.env.SENTRY_AUTH_TOKEN &&
process.env.SENTRY_ORG &&
process.env.SENTRY_PROJECT &&
!IS_DEV
? [
sentryVitePlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
// Delete source maps after upload to prevent public access
filesToDeleteAfterUpload: ['**/*.map']
}
})
]
: [])
],
build: {