- ADR-0001: decision to extract auth/payment into shared @marketplaces/* packages - Scaffold packages/auth, packages/payment; @marketplaces/auth now holds the real telegram (customer+admin QR/session) and ed25519 (future admin challenge/response) auth implementation, pushed to sources.vitanova.network/sdarbinyan/vitanovaPackages - Rewire ~30 call sites to import from @marketplaces/auth; delete migrated originals from core/auth, core/admin-auth, services/, models/ - Replace environment coupling with AUTH_API_URL/TELEGRAM_BOT_USERNAME injection tokens and isDevMode(); wired as file:packages/auth pending registry publish - Add TRACK-S §8: bootstrap per-marketplace admin login + marketplace-scoped sub-admin invite/role endpoints - Build, arch:check:boundaries, and full test suite (103/103) all green Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
37 lines
1.9 KiB
TypeScript
37 lines
1.9 KiB
TypeScript
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection, isDevMode } from '@angular/core';
|
|
import { provideRouter, withInMemoryScrolling } from '@angular/router';
|
|
import { provideHttpClient, withInterceptors, withXhr } from '@angular/common/http';
|
|
|
|
import { routes } from './app.routes';
|
|
import { cacheInterceptor } from './interceptors/cache.interceptor';
|
|
import { apiBaseUrlInterceptor } from './interceptors/api-base-url.interceptor';
|
|
import { apiHeadersInterceptor } from './interceptors/api-headers.interceptor';
|
|
import { mockDataInterceptor } from './interceptors/mock-data.interceptor';
|
|
import { adminAuthHeadersInterceptor, Ed25519VerificationService, NoopEd25519VerificationService, AUTH_API_URL, TELEGRAM_BOT_USERNAME } from '@marketplaces/auth';
|
|
import { provideServiceWorker } from '@angular/service-worker';
|
|
import { MediaRepository } from './core/media/media-repository';
|
|
import { MockMediaRepository } from './core/media/mock-media-repository.service';
|
|
import { environment } from '../environments/environment';
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideBrowserGlobalErrorListeners(),
|
|
provideZoneChangeDetection({ eventCoalescing: true }),
|
|
provideRouter(
|
|
routes,
|
|
withInMemoryScrolling({ scrollPositionRestoration: 'top' })
|
|
),
|
|
provideHttpClient(withXhr(),
|
|
withInterceptors([mockDataInterceptor, apiBaseUrlInterceptor, apiHeadersInterceptor, adminAuthHeadersInterceptor, cacheInterceptor])
|
|
),
|
|
{ provide: AUTH_API_URL, useValue: environment.authApiUrl },
|
|
{ provide: TELEGRAM_BOT_USERNAME, useValue: environment.telegramBot },
|
|
{ provide: Ed25519VerificationService, useClass: NoopEd25519VerificationService },
|
|
{ provide: MediaRepository, useClass: MockMediaRepository },
|
|
provideServiceWorker('ngsw-worker.js', {
|
|
enabled: !isDevMode(),
|
|
registrationStrategy: 'registerWhenStable:30000'
|
|
})
|
|
]
|
|
};
|