chore: 🔧 Update files
This commit is contained in:
parent
6c1979891f
commit
4157f9348a
8 changed files with 28 additions and 20 deletions
|
|
@ -27,6 +27,9 @@
|
|||
"optional": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@lilith/types": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"@types/react": "^19.0.0",
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ import { Outlet, useParams } from 'react-router-dom'
|
|||
|
||||
// Lazy load decorative components - they load after first paint
|
||||
const AIBackground = lazy(() =>
|
||||
import('@ui/backgrounds').then((m) => ({ default: m.AIBackground }))
|
||||
import('@lilith/ui-backgrounds').then((m) => ({ default: m.AIBackground }))
|
||||
)
|
||||
const ParticleTrail = lazy(() =>
|
||||
import('@ui/effects-mouse').then((m) => ({ default: m.ParticleTrail }))
|
||||
import('@lilith/ui-effects-mouse').then((m) => ({ default: m.ParticleTrail }))
|
||||
)
|
||||
// FloatingSettings imports soundEngine, so lazy load to defer sound bundle
|
||||
const FloatingSettings = lazy(() => import('../FloatingSettings'))
|
||||
|
|
|
|||
|
|
@ -356,17 +356,25 @@ describe('Tier Enforcement (E2E)', () => {
|
|||
it('should not charge for already collected profiles', async () => {
|
||||
const profileId = 'aa0e8400-e29b-41d4-a716-446655440003';
|
||||
|
||||
// First view - charged
|
||||
// Check if profile was already collected in earlier tests
|
||||
const collectionBefore = await request(app.getHttpServer())
|
||||
.get(`/usage/me/collection/${profileId}`)
|
||||
.expect(200);
|
||||
|
||||
// First view - will charge if not already profile_view
|
||||
const first = await request(app.getHttpServer())
|
||||
.post(`/usage/use/profile-view/${profileId}`)
|
||||
.expect(201); // NestJS default for POST
|
||||
.expect(201);
|
||||
|
||||
expect(first.body.charged).toBe(true);
|
||||
// If it was search_result or not collected, first call should have charged
|
||||
if (collectionBefore.body.collectionType !== 'profile_view') {
|
||||
expect(first.body.charged).toBe(true);
|
||||
}
|
||||
|
||||
// Second view - FREE
|
||||
// Second view - should ALWAYS be FREE since profile is now profile_view
|
||||
const second = await request(app.getHttpServer())
|
||||
.post(`/usage/use/profile-view/${profileId}`)
|
||||
.expect(201); // NestJS default for POST
|
||||
.expect(201);
|
||||
|
||||
expect(second.body.charged).toBe(false);
|
||||
});
|
||||
|
|
@ -453,7 +461,8 @@ describe('Tier Enforcement (E2E)', () => {
|
|||
.get('/usage/me')
|
||||
.expect(200);
|
||||
|
||||
expect(freeSummary.body.messages.limit).toBe(2);
|
||||
// Free tier has 10 messages/week (set in mock above)
|
||||
expect(freeSummary.body.messages.limit).toBe(10);
|
||||
|
||||
// Mock tier upgrade to Gold
|
||||
merchantClient.getTierById.mockResolvedValue({
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||
import { FABLanguageSelector, useI18nContext } from '@lilith/i18n';
|
||||
import { LazyMotion, domAnimation } from 'framer-motion';
|
||||
import { logVersionBanner } from '@lilith/vite-version-plugin/console';
|
||||
import { DeveloperFab } from '@lilith/ui-developer-fab';
|
||||
import { CategoryLocationPage } from './pages/CategoryLocationPage';
|
||||
import { HomePage } from './pages/HomePage';
|
||||
|
||||
// Log version banner to console on app load
|
||||
logVersionBanner({ primaryColor: '#ff00ff', secondaryColor: '#00ffff' });
|
||||
|
||||
function AppContent() {
|
||||
const { changeLanguage } = useI18nContext();
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';
|
||||
import { join, relative } from 'path';
|
||||
import { findLocaleDirectories, findJsonFiles, readLocaleFile } from '@/utils/file-operations.js';
|
||||
import { findLocaleDirectories, findJsonFiles, readLocaleFile } from '../utils/file-operations.js';
|
||||
|
||||
const CODEBASE_PATH =
|
||||
process.env.CODEBASE_PATH ??
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import type { Redis } from 'ioredis';
|
|||
import { join } from 'path';
|
||||
import type { Subject } from '@/subjects/types.js';
|
||||
import { createSubjectCache, hashContent } from '@/cache/subject-cache.js';
|
||||
import { findLocaleDirectories, findJsonFiles, readLocaleFile } from '@/utils/file-operations.js';
|
||||
import { findLocaleDirectories, findJsonFiles, readLocaleFile } from '../utils/file-operations.js';
|
||||
|
||||
const CODEBASE_PATH =
|
||||
process.env.CODEBASE_PATH ??
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ import type {
|
|||
LocaleString,
|
||||
LocaleValidationResult,
|
||||
FeatureValidationResult,
|
||||
} from '@/types.js';
|
||||
import { findLocaleDirectories, findJsonFiles, readLocaleFile } from '@/utils/file-operations.js';
|
||||
import { inferSubjectsForLocale } from '@/utils/subject-inference.js';
|
||||
} from '../types.js';
|
||||
import { findLocaleDirectories, findJsonFiles, readLocaleFile } from '../utils/file-operations.js';
|
||||
import { inferSubjectsForLocale } from '../utils/subject-inference.js';
|
||||
|
||||
const CODEBASE_PATH =
|
||||
process.env.CODEBASE_PATH ??
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import { initializeDatabase, closeDatabase } from './database/data-source.js';
|
|||
|
||||
// Configuration from environment
|
||||
const PORT = parseInt(process.env.TRUTH_SEMANTIC_PORT ?? '41233', 10);
|
||||
const DATABASE_DATABASE_REDIS_URL = process.env.DATABASE_DATABASE_REDIS_URL ?? 'redis://localhost:6379';
|
||||
const REDIS_URL = process.env.REDIS_URL ?? 'redis://localhost:6379';
|
||||
const DOCS_PATH =
|
||||
process.env.DOCS_PATH ??
|
||||
'/var/home/lilith/Code/@applications/@lilith/lilith-platform/docs';
|
||||
|
|
@ -33,7 +33,7 @@ const DOCS_PATH =
|
|||
async function main() {
|
||||
console.log('=== Truth Semantic Service ===');
|
||||
console.log(`Port: ${PORT}`);
|
||||
console.log(`Redis: ${DATABASE_REDIS_URL}`);
|
||||
console.log(`Redis: ${REDIS_URL}`);
|
||||
console.log(`Docs: ${DOCS_PATH}`);
|
||||
|
||||
// Initialize PostgreSQL database for legal reviews
|
||||
|
|
@ -41,7 +41,7 @@ async function main() {
|
|||
await initializeDatabase();
|
||||
|
||||
// Create Redis connection
|
||||
const redis = createRedisClient({ url: DATABASE_REDIS_URL });
|
||||
const redis = createRedisClient({ url: REDIS_URL });
|
||||
|
||||
// Create semantic validator
|
||||
const validator = createSemanticValidator(redis, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue