Skip to content

Commit 7ee0200

Browse files
committed
docs: general documentation improvements
1 parent d0d0c2a commit 7ee0200

13 files changed

Lines changed: 92 additions & 16 deletions

File tree

apps/www/eslint.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
2+
import nextTypescript from "eslint-config-next/typescript";
3+
4+
const eslintConfig = [
5+
...nextCoreWebVitals,
6+
...nextTypescript,
7+
{
8+
ignores: [
9+
"node_modules/**",
10+
".next/**",
11+
"out/**",
12+
"build/**",
13+
"next-env.d.ts",
14+
],
15+
},
16+
];
17+
18+
export default eslintConfig;

apps/www/package.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"geist": "^1.3.1",
3232
"lucide-react": "^0.460.0",
3333
"mdx": "^0.3.1",
34-
"next": "15.0.3",
34+
"next": "16.0.8",
3535
"next-themes": "^0.4.3",
36-
"react": "19.0.0-rc-66855b96-20241106",
37-
"react-dom": "19.0.0-rc-66855b96-20241106",
36+
"react": "19.2.1",
37+
"react-dom": "19.2.1",
3838
"react-icons": "^5.3.0",
3939
"rehype-katex": "^7.0.1",
4040
"rehype-shiki": "^0.0.9",
@@ -47,15 +47,23 @@
4747
"@tailwindcss/postcss": "^4.1.7",
4848
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
4949
"@types/node": "^20",
50-
"@types/react": "npm:types-react@19.0.0-rc.1",
51-
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
50+
"@types/react": "19.2.7",
51+
"@types/react-dom": "19.2.3",
5252
"prettier": "^3.5.3",
5353
"prettier-plugin-tailwindcss": "^0.6.9",
5454
"tailwindcss": "^4.1.7",
55-
"typescript": "^5"
55+
"typescript": "^5",
56+
"eslint": "^9",
57+
"eslint-config-next": "16.0.8"
5658
},
5759
"overrides": {
5860
"@types/react": "npm:types-react@19.0.0-rc.1",
5961
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1"
62+
},
63+
"pnpm": {
64+
"overrides": {
65+
"@types/react": "19.2.7",
66+
"@types/react-dom": "19.2.3"
67+
}
6068
}
6169
}

apps/www/src/content/docs/getting-started/installation.mdx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,54 @@ export class AppModule {}
130130

131131
В этом случае конфигурация будет храниться в отдельном файле, что улучшает структуру и позволяет легче управлять параметрами окружения.
132132

133+
### Работа через прокси
134+
135+
Некоторым приложениям требуется отправлять запросы к API YooKassa через прокси-сервер. Данные модуль поддерживает такой сценарий с помощью параметра `proxyUrl`.
136+
137+
#### Когда нужен прокси?
138+
139+
Используйте proxyUrl, если:
140+
141+
сервер работает за корпоративным прокси;
142+
нужно логировать / инспектировать трафик;
143+
есть ограничения на исходящие запросы;
144+
требуется скрыть исходящий IP;
145+
146+
Поддерживаются HTTP и HTTPS прокси:
147+
148+
```
149+
http://127.0.0.1:8080
150+
https://proxy.example.com:443
151+
```
152+
153+
#### Переменная окружения
154+
155+
Добавьте значение в `.env`:
156+
157+
```bash
158+
YOOKASSA_PROXY_URL=http://127.0.0.1:8080
159+
```
160+
161+
#### Использование в синхронной конфигурации
162+
163+
```typescript
164+
import { YookassaModule } from 'nestjs-yookassa'
165+
166+
YookassaModule.forRoot({
167+
shopId: process.env.YOOKASSA_SHOP_ID,
168+
apiKey: process.env.YOOKASSA_SECRET_KEY,
169+
proxyUrl: process.env.YOOKASSA_PROXY_URL // прокси активируется при наличии
170+
})
171+
```
172+
173+
#### Использование в асинхронной конфигурации
174+
175+
```typescript
176+
useFactory: config => ({
177+
shopId: config.get('YOOKASSA_SHOP_ID'),
178+
apiKey: config.get('YOOKASSA_SECRET_KEY'),
179+
proxyUrl: config.get('YOOKASSA_PROXY_URL')
180+
})
181+
```
182+
133183
</Steps>

apps/www/src/content/docs/invoices/create.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class InvoiceService {
5353
expires_at: '2025-08-30T10:00:00.000Z'
5454
}
5555

56-
const invoice = await this.yookassaService.createInvoice(invoiceData)
56+
const invoice = await this.yookassaService.invoices.create(invoiceData)
5757

5858
return invoice
5959
}

apps/www/src/content/docs/invoices/info.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class InvoiceService {
1919
async getInvoiceDetails() {
2020
const invoiceId = '123456'; // Уникальный идентификатор счёта
2121

22-
const invoice = await this.yookassaService.getInvoice(invoiceId);
22+
const invoice = await this.yookassaService.invoices.getById(invoiceId);
2323

2424
return invoice;
2525
}

apps/www/src/content/docs/payments/cancel.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class PaymentService {
2323
async cancelPayment() {
2424
const paymentId = '123456'
2525

26-
const canceledPayment = await this.yookassaService.cancelPayment(paymentId);
26+
const canceledPayment = await this.yookassaService.payments.cancel(paymentId);
2727

2828
return canceledPayment
2929
}

apps/www/src/content/docs/payments/confirm.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class PaymentService {
2323
async capturePayment() {
2424
const paymentId = '123456'
2525

26-
const capturedPayment = await this.yookassaService.capturePayment(paymentId);
26+
const capturedPayment = await this.yookassaService.payments.capture(paymentId);
2727

2828
return capturedPayment
2929
}

apps/www/src/content/docs/payments/create.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class PaymentService {
6565
},
6666
}
6767

68-
const newPayment = await this.yookassaService.createPayment(paymentData);
68+
const newPayment = await this.yookassaService.payments.create(paymentData);
6969

7070
return newPayment;
7171
}

apps/www/src/content/docs/payments/info.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class PaymentService {
2121
async getPaymentDetails() {
2222
const paymentId = '123456'; // Уникальный ID платежа
2323

24-
const payment = await this.yookassaService.getPaymentDetails(paymentId);
24+
const payment = await this.yookassaService.payments.getById(paymentId);
2525

2626
return payment
2727
}

apps/www/src/content/docs/payments/list.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class PaymentService {
4040
const from = '2025-01-01'; // Начальная дата фильтра
4141
const to = '2025-01-31'; // Конечная дата фильтра
4242

43-
const payments = await this.yookassaService.getPayments(limit, from, to);
43+
const payments = await this.yookassaService.payments.getAll(limit, from, to);
4444

4545
return payments
4646
}

0 commit comments

Comments
 (0)