feat(packages): add standalone auth and payment
This commit is contained in:
26
README.md
26
README.md
@@ -2,8 +2,30 @@
|
||||
|
||||
Shared client packages consumed by `marketplaces` and other projects.
|
||||
|
||||
- `packages/auth` — `@marketplaces/auth`. Real implementation. Two independent mechanisms: `telegram/` (live QR/session auth, customer + admin) and `ed25519/` (challenge/response admin auth, backend not shipped yet).
|
||||
- `packages/payment` — `@marketplaces/payment`. Scaffold only, no implementation yet.
|
||||
- `packages/auth` — `@marketplaces/auth`. Standalone Angular UI + gateway for QR, credentials and Yandex auth.
|
||||
- `packages/payment` — `@marketplaces/payment`. Standalone Angular UI + gateway for QR, card, SBP and Yandex Pay.
|
||||
|
||||
The packages call separate central services. They never derive or call the tenant API. Each request automatically includes the page hostname as `X-Marketplace-Domain`; central Auth/Payment APIs resolve that domain to the project.
|
||||
|
||||
```ts
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
provideHttpClient(),
|
||||
provideMarketplacesAuth({ apiUrl: 'https://auth.example.net' }),
|
||||
provideMarketplacesPayment({ apiUrl: 'https://payments.example.net' }),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
```html
|
||||
<mp-auth qr credentials yandex mode="admin"
|
||||
(authenticated)="onLogin($event)" />
|
||||
|
||||
<mp-payment qr card sbp yandexPay [request]="checkout"
|
||||
(completed)="onPaid($event)" />
|
||||
```
|
||||
|
||||
Import `MarketplacesAuthComponent` / `MarketplacesPaymentComponent` into the consuming standalone component. See `docs/BACKEND-CONTRACT.md` for central API and CORS requirements.
|
||||
|
||||
Consumer documentation lives in the `marketplaces` repo: `docs/PACKAGES-USAGE.md`. Rationale: `docs/context/adrs/ADR-0001-extract-auth-and-payment-into-shared-marketplaces-packages.md`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user