Skip to content

Commit

Permalink
chore(): Ебал это на коммиты разбивать
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexXanderGrib committed Dec 7, 2021
1 parent 5f14ef9 commit bb8997e
Show file tree
Hide file tree
Showing 25 changed files with 637 additions and 203 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"new-cap": "off",
"unicorn/prefer-node-protocol": "off"
"unicorn/prefer-node-protocol": "off",
"camelcase": "off"
},
"overrides": [
{
Expand Down
85 changes: 60 additions & 25 deletions docs/api/classes/YMApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

**`see`** [Описание](https://yoomoney.ru/docs/wallet)

**`export`**

## Table of contents

### Constructors
Expand Down Expand Up @@ -35,17 +37,21 @@

**new YMApi**(`token`, `endpoint?`, `agent?`)

Creates an instance of API.

**`memberof`** API

#### Parameters

| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `token` | `string` | `undefined` | Токен авторизации пользователя |
| `endpoint` | `string` | `"https://yoomoney.ru/api"` | По умолчанию `https://yoomoney.ru/api` |
| `endpoint` | `string` | `"https://yoomoney.ru/api"` | - |
| `agent?` | `Agent` \| (`parsedUrl`: `URL`) => `Agent` | `undefined` | - |

#### Defined in

[src/api.ts:32](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L32)
[src/api.ts:36](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L36)

## Properties

Expand Down Expand Up @@ -75,13 +81,15 @@ ___

Требуемые права токена: `account-info`.

**`throws`** {YMApiError}

#### Returns

`Promise`<[`AccountInfoResponse`](../modules/ymTypes.md#accountinforesponse)\>

#### Defined in

[src/api.ts:71](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L71)
[src/api.ts:77](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L77)

___

Expand All @@ -91,6 +99,8 @@ ___

Позволяет совершить вызов произвольного метода API

**`throws`** {YMApiError}

#### Type parameters

| Name | Type |
Expand All @@ -110,57 +120,66 @@ ___

#### Defined in

[src/api.ts:47](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L47)
[src/api.ts:52](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L52)

___

### incomingTransferAccept

**incomingTransferAccept**(`parameters`): `Promise`<[`IncomingTransferAcceptResponse`](../modules/ymTypes.md#incomingtransferacceptresponse)\>

Прием входящих переводов, защищенных кодом протекции, и переводов до востребования.
Прием входящих переводов, защищенных кодом протекции, и
переводов до востребования.

Количество попыток приема входящего перевода с кодом протекции ограничено. При исчерпании количества попыток, перевод автоматически отвергается (перевод возвращается отправителю).
Количество попыток приема входящего перевода с кодом протекции
ограничено. При исчерпании количества попыток, перевод
автоматически отвергается (перевод возвращается отправителю).

Требуемые права токена: `incoming-transfers`

**`throws`** {YMApiError}

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `parameters` | [`IncomingTransferAcceptParams`](../modules/ymTypes.md#incomingtransferacceptparams) | Параметры вызова |
| `parameters` | [`IncomingTransferAcceptParameters`](../modules/ymTypes.md#incomingtransferacceptparameters) | Параметры вызова |

#### Returns

`Promise`<[`IncomingTransferAcceptResponse`](../modules/ymTypes.md#incomingtransferacceptresponse)\>

#### Defined in

[src/api.ts:141](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L141)
[src/api.ts:163](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L163)

___

### incomingTransferReject

**incomingTransferReject**(`parameters`): `Promise`<[`IncomingTransferRejectResponse`](../modules/ymTypes.md#incomingtransferrejectresponse)\>

Отмена входящих переводов, защищенных кодом протекции, и переводов до востребования. При отмене перевода он возвращается отправителю.
Отмена входящих переводов, защищенных кодом протекции, и
переводов до востребования. При отмене перевода он возвращается
отправителю.

Требуемые права токена: `incoming-transfers`

**`throws`** {YMApiError}

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `parameters` | [`IncomingTransferRejectParams`](../modules/ymTypes.md#incomingtransferrejectparams) | Параметры вызова |
| `parameters` | [`IncomingTransferRejectParameters`](../modules/ymTypes.md#incomingtransferrejectparameters) | Параметры вызова |

#### Returns

`Promise`<[`IncomingTransferRejectResponse`](../modules/ymTypes.md#incomingtransferrejectresponse)\>

#### Defined in

[src/api.ts:155](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L155)
[src/api.ts:180](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L180)

___

Expand All @@ -172,19 +191,21 @@ ___

Требуемые права токена: `operation-details`.

**`throws`** {YMApiError}

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `parameters` | [`OperationDetailsParams`](../modules/ymTypes.md#operationdetailsparams) | Параметры вызова |
| `parameters` | [`OperationDetailsParameters`](../modules/ymTypes.md#operationdetailsparameters) | Параметры вызова |

#### Returns

`Promise`<[`Operation`](../modules/ymTypes.md#operation)\>

#### Defined in

[src/api.ts:97](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L97)
[src/api.ts:105](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L105)

___

Expand All @@ -196,64 +217,78 @@ ___

Требуемые права токена: `operation-history`.

**`throws`** {YMApiError}

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `parameters` | [`OperationHistoryParams`](../modules/ymTypes.md#operationhistoryparams) | Параметры вызова |
| Name | Type |
| :------ | :------ |
| `parameters` | [`OperationHistoryParameters`](../modules/ymTypes.md#operationhistoryparameters) |

#### Returns

`Promise`<[`OperationHistoryResponse`](../modules/ymTypes.md#operationhistoryresponse)\>

#### Defined in

[src/api.ts:83](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L83)
[src/api.ts:90](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L90)

___

### processPayment

**processPayment**(`parameters`): `Promise`<[`ProcessPaymentResponse`](../modules/ymTypes.md#processpaymentresponse)\>

Подтверждение платежа, ранее созданного методом [request-payment](https://yoomoney.ru/docs/wallet/process-payments/request-payment). Указание метода проведения платежа.
Подтверждение платежа, ранее созданного методом
[request-payment](https://yoomoney.ru/docs/wallet/process-payments/request-payment).
Указание метода проведения платежа.

**`throws`** {YMApiError}

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `parameters` | [`ProcessPaymentParams`](../modules/ymTypes.md#processpaymentparams) | Параметры вызова |
| `parameters` | [`ProcessPaymentParameters`](../modules/ymTypes.md#processpaymentparameters) | Параметры вызова |

#### Returns

`Promise`<[`ProcessPaymentResponse`](../modules/ymTypes.md#processpaymentresponse)\>

#### Defined in

[src/api.ts:125](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L125)
[src/api.ts:143](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L143)

___

### requestPayment

**requestPayment**(`parameters`): `Promise`<[`RequestPaymentResponse`](../modules/ymTypes.md#requestpaymentresponse)\>

Создание платежа, проверка параметров и возможности приема платежа магазином или перевода средств на счет пользователя ЮMoney.
Создание платежа, проверка параметров и возможности приема
платежа магазином или перевода средств на счет пользователя
ЮMoney.

Требуемые права токена:
- для платежа в магазин: `payment.to-pattern` («шаблон платежа») или `payment-shop`.
- для перевода средств на счета других пользователей: `payment.to-account` («идентификатор получателя», «тип идентификатора») или `payment-p2p`.
- для платежа в магазин: `payment.to-pattern`
(«шаблон платежа») или `payment-shop`.

- для перевода средств на счета других пользователей:
`payment.to-account` («идентификатор получателя»,
«тип идентификатора») или `payment-p2p`.

**`throws`** {YMApiError}

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `parameters` | [`RequestPaymentParams`](../modules/ymTypes.md#requestpaymentparams) | Параметры вызова |
| `parameters` | [`RequestPaymentParameters`](../modules/ymTypes.md#requestpaymentparameters) | Параметры вызова |

#### Returns

`Promise`<[`RequestPaymentResponse`](../modules/ymTypes.md#requestpaymentresponse)\>

#### Defined in

[src/api.ts:113](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L113)
[src/api.ts:128](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L128)
4 changes: 2 additions & 2 deletions docs/api/classes/YMApiError.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Error.constructor

#### Defined in

[src/api.ts:15](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L15)
[src/api.ts:15](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L15)

## Properties

Expand All @@ -60,7 +60,7 @@ Error.constructor

#### Defined in

[src/api.ts:9](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/api.ts#L9)
[src/api.ts:9](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/api.ts#L9)

___

Expand Down
26 changes: 20 additions & 6 deletions docs/api/classes/YMAuth.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

**`see`** [Описание протокола](https://yoomoney.ru/docs/wallet/using-api/authorization/basics)

**`export`**

## Table of contents

### Constructors
Expand All @@ -31,19 +33,23 @@

**new YMAuth**(`clientId`, `redirectUrl`, `clientSecret?`, `endpoint?`, `agent?`)

Creates an instance of Auth.

**`memberof`** Auth

#### Parameters

| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `clientId` | `string` | `undefined` | ID приложения |
| `redirectUrl` | `string` | `undefined` | URL-перенаправления |
| `clientSecret?` | `string` | `undefined` | Секретное Слово |
| `endpoint` | `string` | `"https://yoomoney.ru/oauth"` | По умолчанию `https://yoomoney.ru/oauth` |
| `clientSecret?` | `string` | `undefined` | - |
| `endpoint` | `string` | `"https://yoomoney.ru/oauth"` | - |
| `agent?` | `Agent` \| (`parsedUrl`: `URL`) => `Agent` | `undefined` | - |

#### Defined in

[src/auth.ts:40](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/auth.ts#L40)
[src/auth.ts:46](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/auth.ts#L46)

## Properties

Expand Down Expand Up @@ -81,11 +87,17 @@ ___

**exchangeCode2Token**(`code`): `Promise`<`string`\>

Обменивает временный токен на постоянный токен авторизации

**`memberof`** Auth

**`throws`** {YMAuthError}

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `code` | `string` | Временный токен (authorization code), подлежащий обмену на постоянный токен авторизации |
| `code` | `string` | Временный токен (authorization code) |

#### Returns

Expand All @@ -95,7 +107,7 @@ ___

#### Defined in

[src/auth.ts:75](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/auth.ts#L75)
[src/auth.ts:85](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/auth.ts#L85)

___

Expand All @@ -105,6 +117,8 @@ ___

Генерирует html-форму перенаправления пользователя на авторизацию

**`memberof`** Auth

#### Parameters

| Name | Type |
Expand All @@ -118,4 +132,4 @@ ___

#### Defined in

[src/auth.ts:55](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/auth.ts#L55)
[src/auth.ts:62](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/auth.ts#L62)
4 changes: 3 additions & 1 deletion docs/api/classes/YMAuthError.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Ошибка в процессе авторизации

**`export`**

## Hierarchy

- `Error`
Expand Down Expand Up @@ -47,7 +49,7 @@ Error.constructor

#### Defined in

[src/auth.ts:22](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/ca8499d/src/auth.ts#L22)
[src/auth.ts:24](https://github.com/AlexXanderGrib/yoomoney-sdk/blob/5f14ef9/src/auth.ts#L24)

## Properties

Expand Down
Loading

0 comments on commit bb8997e

Please sign in to comment.