diff --git a/.gitattributes b/.gitattributes index aa53e3c..2f3dbc2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ -# Переводы строк нормализуются на уровне репозитория, иначе результат зависит от -# локального core.autocrlf разработчика: при autocrlf=true рабочая копия -# получает CRLF, и `gofmt -l .` — та самая проверка, которую гоняет CI — -# локально ругается на все файлы сразу. +# Line endings are normalized at the repository level, otherwise the result +# depends on the developer's local core.autocrlf: at autocrlf=true the working +# copy gets CRLF, and `gofmt -l .` — the very check CI runs — complains locally +# about every file at once. * text=auto eol=lf *.go text eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fbbe28..b1ae850 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ section: it was fixed **before publication** and went into `0.1.0` — see the Exactly one thing was in the way: the SDK unconditionally appended `.json` to the method, and v3 does not accept that suffix — `…/rest/api/1/TOKEN/documentation` answers 200 while `documentation.json` - answers 404, "method `documentation.json` not found". The suffix is now + answers 404, "Метод `documentation.json` не найден". The suffix is now appended for v1 only, and **v1's behaviour did not change in any respect** — there are separate regression tests for that. @@ -79,9 +79,9 @@ section: it was fixed **before publication** and went into `0.1.0` — see the sent. - **`APIError.Validation`** — the fields a v3 request was rejected over. The - code and the text of every such error are equally generic ("an error while - validating the request object"), so the list of fields is the only part that - says what exactly is wrong. v1 has no equivalent; there it is empty. + code and the text of every such error are equally generic + ("Ошибка при валидации объекта запроса"), so the list of fields is the only + part that says what exactly is wrong. v1 has no equivalent; there it is empty. - **`Result` with `Kind()`.** One and the same field is answered by Bitrix24 with more than one shape, and which one it is depends on the **data**, not on @@ -245,13 +245,14 @@ section: it was fixed **before publication** and went into `0.1.0` — see the v3 does have a `batch` method, but it is a different protocol: commands go into the **root** of the body as `{"method": …, "query": {…}}`, the reply is - an **array** in the order sent (the command keys are discarded), and the first - failing command aborts the whole request instead of producing `result_error`. - So `Batch`, `Ref`, `Halt` and `BatchResult` — the v1 protocol — have nothing - to map onto, and the partial failure `BatchError` exists for does not happen - there. The refusal takes the place of the portal's answer to a v1 batch body: - `BITRIX_REST_V3_EXCEPTION_INVALIDSELECTEXCEPTION`, "cannot parse the select - expression" — a message about `select` in response to a request that has none. + an **array** in submission order (the command keys are discarded), and the + first failing command aborts the whole request instead of producing + `result_error`. So `Batch`, `Ref`, `Halt` and `BatchResult` — the v1 + protocol — have nothing to map onto, and the partial failure `BatchError` + exists for does not happen there. The refusal takes the place of the portal's + answer to a v1 batch body: `BITRIX_REST_V3_EXCEPTION_INVALIDSELECTEXCEPTION`, + "Не удается распознать выражение select" — a message about `select` in + response to a request that has none. Both sentinels name what to use instead: `Core.Call` with `pagination`, and `Core.Call` with `batch`. @@ -265,7 +266,7 @@ Everything below is a cloud portal's answers, captured through the SDK's own calls. - `.json`: `…/rest/api/1/TOKEN/documentation` → 200, - `…/documentation.json` → 404, "method `documentation.json` not found". + `…/documentation.json` → 404, "Метод `documentation.json` не найден". - The success envelope matches v1's: `humanresources.employee.count` → `{"result":{"total":19},"time":{…}}`, `Unwrap(res.Result, "total")` = `19`. - Error shapes (9 different ones): nested — `…METHODNOTFOUNDEXCEPTION` (404),