From a3d44da278b1deaf357ac98e82f7e8332fa4c31d Mon Sep 17 00:00:00 2001 From: Veronica Akhmetova <264936994+fatestr1ngs@users.noreply.github.com> Date: Thu, 2 Jul 2026 17:07:52 +0400 Subject: [PATCH 1/2] Add Note service for note.* v3 support (#515) Implements all 25 note.* methods (Knowledge Base 2.0): Collection, Document (incl. tree and search), and File, with typed select builders and cursor pagination for note.collection.list. --- .tasks/515/plan.md | 605 ++++++++++++++++++ CHANGELOG.md | 8 + Makefile | 16 + docs/open-api/openapi.json | 2 +- phpunit.xml.dist | 15 + .../Result/ArchivedCollectionResult.php | 28 + .../Result/CollectionFieldItemResult.php | 35 + .../Result/CollectionFieldResult.php | 28 + .../Result/CollectionFieldsResult.php | 34 + .../Result/CollectionItemResult.php | 39 ++ .../Collection/Result/CollectionResult.php | 28 + .../Collection/Result/CollectionsResult.php | 45 ++ .../Result/DeletedCollectionResult.php | 28 + .../Note/Collection/Service/Collection.php | 281 ++++++++ .../Service/CollectionListCursor.php | 47 ++ .../Service/CollectionListPagination.php | 43 ++ .../Service/CollectionSelectBuilder.php | 71 ++ .../Result/ArchivedDocumentResult.php | 28 + .../Document/Result/DeletedDocumentResult.php | 28 + .../Result/DocumentFieldItemResult.php | 35 + .../Document/Result/DocumentFieldResult.php | 28 + .../Document/Result/DocumentFieldsResult.php | 34 + .../Document/Result/DocumentItemResult.php | 41 ++ .../Note/Document/Result/DocumentResult.php | 28 + .../Result/DocumentSearchFieldItemResult.php | 35 + .../Result/DocumentSearchFieldResult.php | 28 + .../Result/DocumentSearchFieldsResult.php | 34 + .../Result/DocumentSearchItemResult.php | 30 + .../Document/Result/DocumentSearchResult.php | 42 ++ .../Result/DocumentTreeFieldItemResult.php | 35 + .../Result/DocumentTreeFieldResult.php | 28 + .../Result/DocumentTreeFieldsResult.php | 34 + .../Result/DocumentTreeItemResult.php | 32 + .../Document/Result/DocumentTreeResult.php | 42 ++ .../Note/Document/Service/Document.php | 437 +++++++++++++ .../Service/DocumentSelectBuilder.php | 83 +++ .../Note/File/Result/FileFieldItemResult.php | 35 + .../Note/File/Result/FileFieldResult.php | 28 + .../Note/File/Result/FileFieldsResult.php | 34 + .../Note/File/Result/FileItemResult.php | 33 + src/Services/Note/File/Result/FileResult.php | 28 + src/Services/Note/File/Service/File.php | 138 ++++ src/Services/Note/NoteServiceBuilder.php | 61 ++ src/Services/ServiceBuilder.php | 15 + .../Result/CollectionFieldItemResultTest.php | 65 ++ .../Result/CollectionItemResultTest.php | 83 +++ .../Collection/Service/CollectionTest.php | 154 +++++ .../Result/DocumentFieldItemResultTest.php | 65 ++ .../Result/DocumentItemResultTest.php | 94 +++ .../DocumentSearchFieldItemResultTest.php | 65 ++ .../Result/DocumentSearchItemResultTest.php | 106 +++ .../DocumentTreeFieldItemResultTest.php | 65 ++ .../Result/DocumentTreeItemResultTest.php | 94 +++ .../Note/Document/Service/DocumentTest.php | 195 ++++++ .../File/Result/FileFieldItemResultTest.php | 65 ++ .../Note/File/Result/FileItemResultTest.php | 102 +++ .../Services/Note/File/Service/FileTest.php | 99 +++ .../Collection/Service/CollectionTest.php | 220 +++++++ .../Note/Document/Service/DocumentTest.php | 220 +++++++ .../Services/Note/File/Service/FileTest.php | 120 ++++ 60 files changed, 4618 insertions(+), 1 deletion(-) create mode 100644 .tasks/515/plan.md create mode 100644 src/Services/Note/Collection/Result/ArchivedCollectionResult.php create mode 100644 src/Services/Note/Collection/Result/CollectionFieldItemResult.php create mode 100644 src/Services/Note/Collection/Result/CollectionFieldResult.php create mode 100644 src/Services/Note/Collection/Result/CollectionFieldsResult.php create mode 100644 src/Services/Note/Collection/Result/CollectionItemResult.php create mode 100644 src/Services/Note/Collection/Result/CollectionResult.php create mode 100644 src/Services/Note/Collection/Result/CollectionsResult.php create mode 100644 src/Services/Note/Collection/Result/DeletedCollectionResult.php create mode 100644 src/Services/Note/Collection/Service/Collection.php create mode 100644 src/Services/Note/Collection/Service/CollectionListCursor.php create mode 100644 src/Services/Note/Collection/Service/CollectionListPagination.php create mode 100644 src/Services/Note/Collection/Service/CollectionSelectBuilder.php create mode 100644 src/Services/Note/Document/Result/ArchivedDocumentResult.php create mode 100644 src/Services/Note/Document/Result/DeletedDocumentResult.php create mode 100644 src/Services/Note/Document/Result/DocumentFieldItemResult.php create mode 100644 src/Services/Note/Document/Result/DocumentFieldResult.php create mode 100644 src/Services/Note/Document/Result/DocumentFieldsResult.php create mode 100644 src/Services/Note/Document/Result/DocumentItemResult.php create mode 100644 src/Services/Note/Document/Result/DocumentResult.php create mode 100644 src/Services/Note/Document/Result/DocumentSearchFieldItemResult.php create mode 100644 src/Services/Note/Document/Result/DocumentSearchFieldResult.php create mode 100644 src/Services/Note/Document/Result/DocumentSearchFieldsResult.php create mode 100644 src/Services/Note/Document/Result/DocumentSearchItemResult.php create mode 100644 src/Services/Note/Document/Result/DocumentSearchResult.php create mode 100644 src/Services/Note/Document/Result/DocumentTreeFieldItemResult.php create mode 100644 src/Services/Note/Document/Result/DocumentTreeFieldResult.php create mode 100644 src/Services/Note/Document/Result/DocumentTreeFieldsResult.php create mode 100644 src/Services/Note/Document/Result/DocumentTreeItemResult.php create mode 100644 src/Services/Note/Document/Result/DocumentTreeResult.php create mode 100644 src/Services/Note/Document/Service/Document.php create mode 100644 src/Services/Note/Document/Service/DocumentSelectBuilder.php create mode 100644 src/Services/Note/File/Result/FileFieldItemResult.php create mode 100644 src/Services/Note/File/Result/FileFieldResult.php create mode 100644 src/Services/Note/File/Result/FileFieldsResult.php create mode 100644 src/Services/Note/File/Result/FileItemResult.php create mode 100644 src/Services/Note/File/Result/FileResult.php create mode 100644 src/Services/Note/File/Service/File.php create mode 100644 src/Services/Note/NoteServiceBuilder.php create mode 100644 tests/Integration/Services/Note/Collection/Result/CollectionFieldItemResultTest.php create mode 100644 tests/Integration/Services/Note/Collection/Result/CollectionItemResultTest.php create mode 100644 tests/Integration/Services/Note/Collection/Service/CollectionTest.php create mode 100644 tests/Integration/Services/Note/Document/Result/DocumentFieldItemResultTest.php create mode 100644 tests/Integration/Services/Note/Document/Result/DocumentItemResultTest.php create mode 100644 tests/Integration/Services/Note/Document/Result/DocumentSearchFieldItemResultTest.php create mode 100644 tests/Integration/Services/Note/Document/Result/DocumentSearchItemResultTest.php create mode 100644 tests/Integration/Services/Note/Document/Result/DocumentTreeFieldItemResultTest.php create mode 100644 tests/Integration/Services/Note/Document/Result/DocumentTreeItemResultTest.php create mode 100644 tests/Integration/Services/Note/Document/Service/DocumentTest.php create mode 100644 tests/Integration/Services/Note/File/Result/FileFieldItemResultTest.php create mode 100644 tests/Integration/Services/Note/File/Result/FileItemResultTest.php create mode 100644 tests/Integration/Services/Note/File/Service/FileTest.php create mode 100644 tests/Unit/Services/Note/Collection/Service/CollectionTest.php create mode 100644 tests/Unit/Services/Note/Document/Service/DocumentTest.php create mode 100644 tests/Unit/Services/Note/File/Service/FileTest.php diff --git a/.tasks/515/plan.md b/.tasks/515/plan.md new file mode 100644 index 00000000..df347668 --- /dev/null +++ b/.tasks/515/plan.md @@ -0,0 +1,605 @@ +# Plan: Add note.* v3 service — Knowledge Base 2.0 (25 methods) (issue #515) + +## Context + +Bitrix24 REST API v3 exposes a `note.*` scope (Knowledge Base 2.0) with 25 methods across +5 method groups. None of it is implemented in the SDK yet (`src/Services/` has no `Note` +directory). This is confirmed against the live OpenAPI snapshot rebuilt via +`make oa-schema-build` (`docs/open-api/openapi.json`, 2026-07-02). + +All 25 methods use the v3 response envelope: single item → `result.item`, list → `result.items` +(sometimes with an extra pagination field), boolean toggle → `result.result` (a **second** +nested `result` key, not a bare boolean — confirmed from the schema, e.g. +`note.collection.archive` → `{"result": {"result": true}}`). + +### Correction found during live verification (post-implementation) + +The OpenAPI schema describes every `*.field.list` response as a **flat array** directly under +`result` (e.g. `note.collection.field.list` → `{"result": [...]}`). Live testing against a real +portal (once the `note` scope was granted) showed the actual wire format wraps it one level +deeper, exactly like every other list endpoint: `{"result": {"items": [...]}}`. All five +`*FieldsResult::getFields()` implementations (`Collection`, `Document`, `DocumentTree`, +`DocumentSearch`, `File`) were written against the schema first, caught failing against the +live API (`testFieldList` asserted `'name'` was in the list and failed), and fixed to read +`getResult()['items']`. `*.field.get` (single field) matched the schema as documented +(`result.item`) and needed no fix. Lesson: for this scope, OpenAPI schema is a starting point, +not a substitute for one live call per response shape before shipping. + +Separately: manual `curl` verification against `note.*` endpoints must use `/rest/api///`, +not `/rest///` — REST v3 methods are routed under an extra `/api` path segment +(see `src/Core/EndpointUrlFormatter.php:93-97`). The SDK itself builds this correctly for +`ApiVersion::v3` calls; this only matters when curling the API by hand outside the SDK. + +### Method groups (from the OpenAPI schema) + +| Group | Methods | Count | +|---|---|---| +| Collection | `add`, `archive`, `delete`, `field.get`, `field.list`, `get`, `list`, `update` | 8 | +| Document | `add`, `archive`, `delete`, `field.get`, `field.list`, `get`, `update` | 7 | +| Document search | `search.field.get`, `search.field.list`, `search.list` | 3 | +| Document tree | `tree.field.get`, `tree.field.list`, `tree.list` | 3 | +| File | `add`, `field.get`, `field.list`, `get` | 4 | + +Total: 25. Note there is **no plain `note.document.list`** — documents are only enumerated via +`note.document.tree.list` (by `collectionId`) or `note.document.search.list` (full-text query). + +### Design decisions (grounded in existing SDK precedent) + +1. **Three service classes**, per the issue's own proposed solution and to keep `Document` + (its richest entity) self-contained: `Collection.php`, `Document.php` (folds in `tree.*` + and `search.*`), `File.php`. Registered via `NoteServiceBuilder`. +2. **Boolean-result methods** (`archive`, `delete`) get a dedicated `ArchivedResult` + / `DeletedResult` extending `Core\Result\DeletedItemResult`/custom, overriding + `isSuccess()` to read `getResult()['result']` — mirrors + `Documentgenerator\Document\Result\DeletedDocumentResult`, adjusted for the extra nesting + level that `note.*` uses. +3. **Field-discovery DTO** (`bitrix.rest.dtofielddto`, shared by all 5 `field.get`/`field.list` + pairs) is **duplicated per entity** as `FieldItemResult`, not shared across + entities — this matches the newest precedent in the codebase, + `Timeman\RecordField\Result\RecordFieldItemResult`, for the exact same DTO. +4. **Cursor pagination.** Confirmed against the official docs + (https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-list.html): + `note.collection.list` takes a `Pagination` parameter — its own named type, `limit` + (1-200, default 50) plus a nested `afterCursor` object (itself a named type, `position` + + `id`, both required together) — and returns `items` + `nextCursor{position,id}|null`. + A precedent exists on the *request* side: `Main\Service\EventLogTailCursor` (used by the + already-implemented `main.eventlog.tail`, confirmed via its own docs at + https://apidocs.bitrix24.com/api-reference/rest-v3/main/main-eventlog-tail.html — the only + other cursor-shaped method in the whole OpenAPI schema, checked by grepping the full schema + for "ursor", 2 hits total) is a typed value object with a `toArray()` method, passed into + the service method instead of a raw array. Follow that idiom, but mirror the docs' own + two-level structure instead of flattening it: `Collection\Service\CollectionListCursor` + (the inner `afterCursor`: `position`/`id`) wrapped by + `Collection\Service\CollectionListPagination` (the outer `Pagination`: `limit` + + `?CollectionListCursor`) — see § Files to Create, item 3. + What's genuinely new for this SDK is the **response** side: `main.eventlog.tail` does not + return a server-side "next cursor" at all — per its integration test + (`tests/Integration/Services/Main/Service/EventLogTest.php:109-112`), the caller manually + pulls the last item's `id` out of the response and builds the next `EventLogTailCursor` + by hand. `note.collection.list` instead returns a ready-made `nextCursor` object from the + server. So `CollectionsResult::getNextCursor(): ?CollectionListCursor` parses that object + and hands back a typed, round-trippable cursor — pass it straight into the next `list()` + call via a fresh `CollectionListPagination`. `null` signals end-of-list. +5. **No `Batch.php`.** The issue's boilerplate mentions "Batch.php where list/add methods + support batch", but the closest recent precedent (`Timeman\Record`/`RecordField`, PR #519) + shipped without one, and `note.*` has no documented batch-specific behavior beyond the + generic Bitrix24 batch endpoint any method already supports. Skipping it keeps scope + aligned with actual need; can be revisited in a follow-up issue if requested. +6. **SelectBuilder** generated for `Collection` (`get`/`list` share the same `select` field + set) and `Document` (`get`). Not generated for `File`, `DocumentTree`, `DocumentSearch` — + none of their methods accept a `select` parameter. +7. Date fields (`createdAt`, `updatedAt`) are typed `CarbonImmutable` in `@property-read` + annotations, consistent with `RecordItemResult` and the maintainer rule in + `.claude/skills/b24phpsdk-maintainer/SKILL.md` ("Service method date/time arguments"). + The DTOs only expose them as read-only output fields (no service method takes a date + argument), so this only affects `ItemResult` annotations, not method signatures. +8. `note.document.tree.*` returns a **recursive** tree (`children: DocumentTreeItemDto[]`) — + `DocumentTreeItemResult` needs a `@property-read array $children` + annotation, exercising `AbstractAnnotatedItem::castArrayValue()`'s typed-array casting. + +### Generators (mandatory per SKILL.md before manual edits) + +Run `make oa-schema-build` first (**already done** for this planning session). + +| File | Generator command | +|---|---| +| `Collection/Result/CollectionItemResult.php` | `php bin/console b24-dev:result-item-generator note.collection.get --stage=all` | +| `Collection/Result/CollectionFieldItemResult.php` | `php bin/console b24-dev:result-item-generator note.collection.field.get --stage=all` | +| `Document/Result/DocumentItemResult.php` | `php bin/console b24-dev:result-item-generator note.document.get --stage=all` | +| `Document/Result/DocumentFieldItemResult.php` | `php bin/console b24-dev:result-item-generator note.document.field.get --stage=all` | +| `Document/Result/DocumentTreeFieldItemResult.php` | `php bin/console b24-dev:result-item-generator note.document.tree.field.get --stage=all` | +| `Document/Result/DocumentSearchFieldItemResult.php` | `php bin/console b24-dev:result-item-generator note.document.search.field.get --stage=all` | +| `File/Result/FileItemResult.php` | `php bin/console b24-dev:result-item-generator note.file.get --stage=all` | +| `File/Result/FileFieldItemResult.php` | `php bin/console b24-dev:result-item-generator note.file.field.get --stage=all` | +| `Collection/Service/CollectionSelectBuilder.php` | `php bin/console b24-dev:generate-select-builder bitrix.note.collectionitemdto --namespace=Bitrix24\\SDK\\Services\\Note\\Collection\\Service --class-name=CollectionSelectBuilder --output=src/Services/Note/Collection/Service/CollectionSelectBuilder.php` | +| `Document/Service/DocumentSelectBuilder.php` | `php bin/console b24-dev:generate-select-builder bitrix.note.documentitemdto --namespace=Bitrix24\\SDK\\Services\\Note\\Document\\Service --class-name=DocumentSelectBuilder --output=src/Services/Note/Document/Service/DocumentSelectBuilder.php` | + +`DocumentTreeItemResult`, `DocumentSearchItemResult` are **not** generator-covered entity DTOs +in the same sense (`bitrix.note.documenttreeitemdto` / `bitrix.note.searchresultitemdto` are +plain nested response shapes, not standalone list/get entities with their own CRUD) — written +by hand, reason logged here per SKILL.md ("If the generator cannot be used ... write the +reason explicitly in plan.md"). + +The `build`/`verify` stages of `b24-dev:result-item-generator` call the live portal +(`tests/.env.local` webhook). Before running them for `get`-based generators, seed at least +one real `Collection`, `Document`, and `File` on the portal (via direct `curl` against the +webhook, per SKILL.md's "Webhook URL format" section) so the generator has real data to +introspect. + +--- + +## Files to Create + +### 1. `src/Services/Note/NoteServiceBuilder.php` + +```php +namespace Bitrix24\SDK\Services\Note; + +use Bitrix24\SDK\Attributes\ApiServiceBuilderMetadata; +use Bitrix24\SDK\Core\Credentials\Scope; +use Bitrix24\SDK\Services\AbstractServiceBuilder; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Services\Note\File\Service\File; + +#[ApiServiceBuilderMetadata(new Scope(['note']))] +class NoteServiceBuilder extends AbstractServiceBuilder +{ + public function collection(): Collection { /* cached instance, ctor($this->core, $this->log) */ } + public function document(): Document { /* cached instance */ } + public function file(): File { /* cached instance */ } +} +``` + +### 2. `src/Services/Note/Collection/Service/Collection.php` + +`#[ApiServiceMetadata(new Scope(['note']))]`, extends `AbstractService`. Methods +(each `#[ApiEndpointMetadata('note.collection.', 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/...', '...', ApiVersion::v3)]`): + +```php +public function add(string $name, ?int $position = null): CollectionResult; +public function archive(int $id): ArchivedCollectionResult; +public function delete(?int $id = null, array $filter = []): DeletedCollectionResult; +public function fieldGet(string $name, array $select = []): CollectionFieldResult; +public function fieldList(array $select = []): CollectionFieldsResult; +public function get(int $id, array|CollectionSelectBuilder $select = []): CollectionResult; +public function list(?CollectionListPagination $pagination = null): CollectionsResult; +public function update(int $id, array $fields, array $filter = []): CollectionResult; +``` + +`list()` builds the request payload as +`$pagination !== null ? ['pagination' => $pagination->toArray()] : []`. + +`list()`/`get()`: if `$select instanceof SelectBuilderInterface`, call `buildSelect()`, same +pattern as `Timeman\Record\Service\Record::list()`. + +### 3. `src/Services/Note/Collection/Service/CollectionListCursor.php` and `CollectionListPagination.php` +(hand-written, reason: plain value objects, not generator-covered entity/select-builder contracts) + +The official docs for `note.collection.list` +(https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-list.html) +document `Pagination` as its own named parameter type — `limit` plus a nested `afterCursor` +object (itself documented as its own named type, `position` + `id`) — not two loose scalars. +Model that two-level structure as two value objects instead of flattening it into the method +signature, extending the `EventLogTailCursor` idiom (§ design decision 4) to match the shape +the docs actually describe: + +```php +final class CollectionListCursor +{ + public function __construct( + private readonly int $position, + private readonly int $id, + ) { + } + + public function toArray(): array + { + return ['position' => $this->position, 'id' => $this->id]; + } + + public static function fromArray(array $data): self + { + return new self((int)$data['position'], (int)$data['id']); + } +} + +final class CollectionListPagination +{ + public function __construct( + private readonly int $limit = 50, + private readonly ?CollectionListCursor $afterCursor = null, + ) { + } + + public function toArray(): array + { + return array_filter( + [ + 'limit' => $this->limit, + 'afterCursor' => $this->afterCursor?->toArray(), + ], + static fn (mixed $v): bool => $v !== null + ); + } +} +``` + +`CollectionsResult::getNextCursor()` still returns `?CollectionListCursor` only (§7) — the +server's `nextCursor` field never includes `limit`, so the inner value object is what round-trips +into the next call: `$note->collection()->list(new CollectionListPagination(afterCursor: $result->getNextCursor()))`. + +### 4. `src/Services/Note/Collection/Service/CollectionSelectBuilder.php` + +Generated (see generator table above); typed builder over `bitrix.note.collectionitemdto` +fields (`id`, `name`, `position`, `policyLevel`, `createdBy`, `createdAt`, `updatedBy`, `updatedAt`). + +### 5. `src/Services/Note/Collection/Result/CollectionItemResult.php` + +Generated. Expected annotations: + +```php +/** + * @property-read int $id + * @property-read string $name + * @property-read int|null $position + * @property-read string|null $policyLevel + * @property-read int|null $createdBy + * @property-read CarbonImmutable $createdAt + * @property-read int|null $updatedBy + * @property-read CarbonImmutable $updatedAt + */ +class CollectionItemResult extends AbstractAnnotatedItem {} +``` + +### 6. `src/Services/Note/Collection/Result/CollectionResult.php` + +```php +class CollectionResult extends AbstractResult +{ + /** @throws BaseException */ + public function collection(): CollectionItemResult + { + return new CollectionItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} +``` + +### 7. `src/Services/Note/Collection/Result/CollectionsResult.php` + +```php +class CollectionsResult extends AbstractResult +{ + /** @return CollectionItemResult[] @throws BaseException */ + public function getCollections(): array { /* map result.items */ } + + /** @throws BaseException */ + public function getNextCursor(): ?CollectionListCursor + { + $cursor = $this->getCoreResponse()->getResponseData()->getResult()['nextCursor'] ?? null; + + return $cursor === null ? null : CollectionListCursor::fromArray($cursor); + } +} +``` + +### 8. `src/Services/Note/Collection/Result/ArchivedCollectionResult.php` and `DeletedCollectionResult.php` + +```php +class ArchivedCollectionResult extends AbstractResult +{ + /** @throws BaseException */ + public function isSuccess(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['result'] ?? false); + } +} +// DeletedCollectionResult: identical body, distinct class per SDK per-method-result convention. +``` + +### 9. `src/Services/Note/Collection/Result/CollectionFieldItemResult.php`, `CollectionFieldResult.php`, `CollectionFieldsResult.php` + +`CollectionFieldItemResult` generated (see table); shape identical to +`Timeman\RecordField\Result\RecordFieldItemResult` (`name`, `type`, `title`, `description`, +`validationRules`, `requiredGroups`, `filterable`, `sortable`, `editable`, `multiple`, +`elementType`). `CollectionFieldResult::field(): CollectionFieldItemResult` (from `result.item`). +`CollectionFieldsResult::getFields(): array` (from flat `result` array). + +### 10. `src/Services/Note/Document/Service/Document.php` + +13 methods, all `#[ApiEndpointMetadata('note.document.', ...)]`: + +```php +public function add(int $collectionId, string $title, ?int $parentId = null, ?string $markdown = null): DocumentResult; +public function archive(int $id): ArchivedDocumentResult; +public function delete(?int $id = null, array $filter = []): DeletedDocumentResult; +public function fieldGet(string $name, array $select = []): DocumentFieldResult; +public function fieldList(array $select = []): DocumentFieldsResult; +public function get(int $id, array|DocumentSelectBuilder $select = []): DocumentResult; +public function update(int $id, array $fields, array $filter = [], ?bool $overwrite = null): DocumentResult; + +public function treeList(int $collectionId): DocumentTreeResult; +public function treeFieldGet(string $name, array $select = []): DocumentTreeFieldResult; +public function treeFieldList(array $select = []): DocumentTreeFieldsResult; + +public function searchList(string $query, int $limit = 0): DocumentSearchResult; +public function searchFieldGet(string $name, array $select = []): DocumentSearchFieldResult; +public function searchFieldList(array $select = []): DocumentSearchFieldsResult; +``` + +### 11. `src/Services/Note/Document/Service/DocumentSelectBuilder.php` + +Generated, over `bitrix.note.documentitemdto`. + +### 12. `src/Services/Note/Document/Result/DocumentItemResult.php` + +Generated: + +```php +/** + * @property-read int $id + * @property-read int $collectionId + * @property-read int|null $parentId + * @property-read string $title + * @property-read string|null $markdown + * @property-read int|null $position + * @property-read int|null $createdBy + * @property-read int|null $updatedBy + * @property-read CarbonImmutable $createdAt + * @property-read CarbonImmutable $updatedAt + */ +class DocumentItemResult extends AbstractAnnotatedItem {} +``` + +### 13. `src/Services/Note/Document/Result/DocumentResult.php`, `ArchivedDocumentResult.php`, `DeletedDocumentResult.php` + +Same shape as Collection's equivalents (§6, §8), adapted to `DocumentItemResult`. + +### 14. `src/Services/Note/Document/Result/DocumentFieldItemResult.php`, `DocumentFieldResult.php`, `DocumentFieldsResult.php` + +Same shape as §9, generated for `note.document.field.get`. + +### 15. `src/Services/Note/Document/Result/DocumentTreeItemResult.php` (hand-written, reason: not a standalone CRUD entity) + +```php +/** + * @property-read int $id + * @property-read int $collectionId + * @property-read int|null $parentId + * @property-read string $title + * @property-read int|null $position + * @property-read array $children + */ +class DocumentTreeItemResult extends AbstractAnnotatedItem {} +``` + +### 16. `src/Services/Note/Document/Result/DocumentTreeResult.php` (hand-written) + +```php +class DocumentTreeResult extends AbstractResult +{ + /** @return DocumentTreeItemResult[] @throws BaseException */ + public function getItems(): array { /* map result.items */ } + + /** @throws BaseException */ + public function isTruncated(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['truncated'] ?? false); + } +} +``` + +### 17. `src/Services/Note/Document/Result/DocumentTreeFieldItemResult.php`, `DocumentTreeFieldResult.php`, `DocumentTreeFieldsResult.php` + +Same shape as §9/§14, generated for `note.document.tree.field.get`. + +### 18. `src/Services/Note/Document/Result/DocumentSearchItemResult.php` (hand-written, reason: search-result projection, not a CRUD entity) + +```php +/** + * @property-read int $documentId + * @property-read int $collectionId + * @property-read string $title + * @property-read float $score + * @property-read string|null $snippet + * @property-read bool $sharedAccess + */ +class DocumentSearchItemResult extends AbstractAnnotatedItem {} +``` + +### 19. `src/Services/Note/Document/Result/DocumentSearchResult.php` (hand-written) + +```php +class DocumentSearchResult extends AbstractResult +{ + /** @return DocumentSearchItemResult[] @throws BaseException */ + public function getItems(): array { /* map result.items */ } + + /** @throws BaseException */ + public function hasMore(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['hasMore'] ?? false); + } +} +``` + +### 20. `src/Services/Note/Document/Result/DocumentSearchFieldItemResult.php`, `DocumentSearchFieldResult.php`, `DocumentSearchFieldsResult.php` + +Same shape as §9/§14/§17, generated for `note.document.search.field.get`. + +### 21. `src/Services/Note/File/Service/File.php` + +```php +#[ApiServiceMetadata(new Scope(['note']))] +class File extends AbstractService +{ + public function add(int $documentId, string $fileName, string $fileContent): FileResult; + public function fieldGet(string $name, array $select = []): FileFieldResult; + public function fieldList(array $select = []): FileFieldsResult; + public function get(int $id, int $documentId): FileResult; +} +``` + +`fileContent` is the raw/base64 file payload per the REST v3 schema (`type: string`) — +confirm exact encoding against `note.file.add` docs during Step 2 doc lookup (bitrix24 MCP +unavailable this session; verify against `apidocs.bitrix24.com` directly, or against a real +`curl` call, before finalizing the method's PHPDoc). + +### 22. `src/Services/Note/File/Result/FileItemResult.php` + +Generated: + +```php +/** + * @property-read int $id + * @property-read int $documentId + * @property-read string $name + * @property-read int|null $size + * @property-read string|null $mimeType + * @property-read string|null $assetType + * @property-read string|null $assetMarkdown + */ +class FileItemResult extends AbstractAnnotatedItem {} +``` + +### 23. `src/Services/Note/File/Result/FileResult.php` + +Same shape as §6, adapted to `FileItemResult`. + +### 24. `src/Services/Note/File/Result/FileFieldItemResult.php`, `FileFieldResult.php`, `FileFieldsResult.php` + +Same shape as §9/§14/§17/§20, generated for `note.file.field.get`. + +--- + +## Test files (mirrors every file above under `tests/Unit/` and `tests/Integration/`) + +### Unit tests (`tests/Unit/Services/Note/...`, use `NullCore`/`NullBatch`) + +- `Collection/Service/CollectionTest.php` +- `Document/Service/DocumentTest.php` +- `File/Service/FileTest.php` + +Each asserts the correct REST method name and payload shape is sent to `CoreInterface::call()` +(via `createMock(CoreInterface::class)` with `expects($this->once())->method('call')->with(...)`), +for every public method, following the `docs/testing.md` unit test pattern. + +### Integration tests (`tests/Integration/Services/Note/...`, use `Factory::getServiceBuilder()`) + +- `Collection/Service/CollectionTest.php` — full CRUD + archive + list w/ cursor, `tearDown()` + deletes any collection created during the test. +- `Document/Service/DocumentTest.php` — CRUD + archive + tree + search, `tearDown()` cleans up. +- `File/Service/FileTest.php` — add/get, `tearDown()` cleans up. + +### Mandatory `*ItemResultTest` annotation/type-cast tests (one per `*ItemResult` with `@property-read`) + +Per SKILL.md, exactly two test methods each (`testAllFieldsAreAnnotated`, +`testAllFieldsHasValidTypeCastingInMagicGetters`): + +- `tests/Integration/Services/Note/Collection/Result/CollectionItemResultTest.php` +- `tests/Integration/Services/Note/Collection/Result/CollectionFieldItemResultTest.php` +- `tests/Integration/Services/Note/Document/Result/DocumentItemResultTest.php` +- `tests/Integration/Services/Note/Document/Result/DocumentFieldItemResultTest.php` +- `tests/Integration/Services/Note/Document/Result/DocumentTreeItemResultTest.php` +- `tests/Integration/Services/Note/Document/Result/DocumentTreeFieldItemResultTest.php` +- `tests/Integration/Services/Note/Document/Result/DocumentSearchItemResultTest.php` +- `tests/Integration/Services/Note/Document/Result/DocumentSearchFieldItemResultTest.php` +- `tests/Integration/Services/Note/File/Result/FileItemResultTest.php` +- `tests/Integration/Services/Note/File/Result/FileFieldItemResultTest.php` + +(10 files — one per `*ItemResult` class; `DocumentTreeItemResultTest` and +`DocumentSearchItemResultTest` fetch their raw item via `treeList()`/`searchList()` instead of +a `get()`, since those entities have no standalone `get` endpoint.) + +--- + +## Files to Modify + +### 1. `src/Services/ServiceBuilder.php` + +Confirmed exact pattern from `getMailServiceScope()` (line 404) — add, alphabetically placed +near `getTimemanScope()` (line 475): + +```php +public function getNoteScope(): NoteServiceBuilder +{ + if (!isset($this->serviceCache[__METHOD__])) { + $this->serviceCache[__METHOD__] = new NoteServiceBuilder( + $this->core, + $this->batch, + $this->bulkItemsReader, + $this->log + ); + } + + return $this->serviceCache[__METHOD__]; +} +``` + +Add `use Bitrix24\SDK\Services\Note\NoteServiceBuilder;` to the import block. + +### 2. `phpunit.xml.dist` + +Add one integration `` block per entity, following the existing +`test-integration-` naming style: + +```xml + + tests/Integration/Services/Note/Collection + + + tests/Integration/Services/Note/Document + + + tests/Integration/Services/Note/File + +``` + +### 3. `Makefile` + +```makefile +test-integration-note-collection: + docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_note_collection + +test-integration-note-document: + docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_note_document + +test-integration-note-file: + docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_note_file +``` + +(match the exact `docker-compose run` invocation style already used by neighboring +`test-integration-timeman-*` targets — copy verbatim and rename.) + +### 4. `CHANGELOG.md` + +Under `## X.Y.Z Unreleased` → `### Added`: + +```markdown +- Added Note scope (`note.*`, Knowledge Base 2.0): Collection, Document (incl. tree and search), and File services ([#515](https://github.com/bitrix24/b24phpsdk/issues/515)) +``` + +--- + +## Deptrac compliance + +All new code lives under `src/Services/Note/**`, importing only from `Core` (`AbstractService`, +`AbstractResult`, `AbstractAnnotatedItem`, `DeletedItemResult`, exceptions, `ApiVersion`, +`Scope`, `SelectBuilderInterface`) and `Services\AbstractServiceBuilder`. No cross-service +imports (does not depend on any other `Services\\*`). This matches the `Services` +layer rule (`Core`, `Application`, `Legacy` allowed) — no new deptrac violations expected. + +--- + +## Verification + +```bash +make lint-cs-fixer +make lint-rector +make lint-phpstan +make lint-deptrac +make test-unit +make test-integration-note-collection +make test-integration-note-document +make test-integration-note-file +``` diff --git a/CHANGELOG.md b/CHANGELOG.md index ac030197..fbb12c93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ ### Added +- Added service `Services\Note` (Knowledge Base 2.0) with support for `note.collection.*`, `note.document.*` + (incl. `note.document.tree.*` and `note.document.search.*`), and `note.file.*` methods, + see [note REST v3](https://apidocs.bitrix24.com/api-reference/rest-v3/note/index.html) ([#515](https://github.com/bitrix24/b24phpsdk/issues/515)): + - `Collection`: `add`, `archive`, `delete`, `fieldGet`, `fieldList`, `get`, `list` (typed `CollectionSelectBuilder` + and cursor pagination via `CollectionListPagination`/`CollectionListCursor`), `update` + - `Document`: `add`, `archive`, `delete`, `fieldGet`, `fieldList`, `get` (typed `DocumentSelectBuilder`), `update`, + `treeList`/`treeFieldGet`/`treeFieldList`, `searchList`/`searchFieldGet`/`searchFieldList` + - `File`: `add`, `fieldGet`, `fieldList`, `get` - Added services `Services\Timeman\Record\Service\Record` and `Services\Timeman\RecordField\Service\RecordField` with support for v3 `timeman.record.*` methods, see [timeman REST v3](https://apidocs.bitrix24.com/api-reference/rest-v3/timeman/index.html) ([#518](https://github.com/bitrix24/b24phpsdk/issues/518)): diff --git a/Makefile b/Makefile index 53a12d42..a307b947 100644 --- a/Makefile +++ b/Makefile @@ -625,6 +625,22 @@ test-integration-scope-timeman: test-integration-timeman-record: docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_scope_timeman_record +.PHONY: test-integration-scope-note +test-integration-scope-note: + docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_scope_note + +.PHONY: test-integration-note-collection +test-integration-note-collection: + docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_scope_note_collection + +.PHONY: test-integration-note-document +test-integration-note-document: + docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_scope_note_document + +.PHONY: test-integration-note-file +test-integration-note-file: + docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_scope_note_file + .PHONY: integration_tests_sale integration_tests_sale: docker compose run --rm php-cli $(PHPUNIT) --testsuite integration_tests_sale diff --git a/docs/open-api/openapi.json b/docs/open-api/openapi.json index bf99b10a..a2090cda 100644 --- a/docs/open-api/openapi.json +++ b/docs/open-api/openapi.json @@ -1 +1 @@ -{"openapi":"3.0.0","info":{"title":"Bitrix24 REST V3 API","version":"1.0.0"},"servers":[],"tags":[{"name":"humanresources","description":"humanresources module methods"},{"name":"mail","description":"mail module methods"},{"name":"main","description":"main module methods"},{"name":"note","description":"note module methods"},{"name":"rest","description":"rest module methods"},{"name":"tasks","description":"tasks module methods"},{"name":"timeman","description":"timeman module methods"},{"name":"vibecodeconnector","description":"vibecodeconnector module methods"}],"paths":{"\/humanresources.node.communication.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.communication.edit":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.move":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.remove":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.add":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.set":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.employee.search":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["userId","name","workPosition","avatar","url","departments","teams"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.employeedto"}}}}}}}}}},"\/humanresources.employee.subordinates":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["userId","name","workPosition","avatar","url","departments","teams"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.employee.count":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.employee.multidepartment":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}}},"\/humanresources.node.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"name":{"type":"string","example":"ASC"},"createdAt":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}},"\/humanresources.node.search":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"name":{"type":"string","example":"ASC"},"createdAt":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}},"\/humanresources.node.count":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.children":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}},"\/humanresources.node.add":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.edit":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.move":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.mailbox.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","email","senderName"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.mail.mailboxdto"}}}}}}}}}}},"\/mail.mailbox.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","email","senderName"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.mailboxdto"}}}}}}}}}},"\/mail.mailbox.senders":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","email","senderName"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.mailboxdto"}}}}}}}}}},"\/mail.message.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","mailboxId","mailboxEmail","subject","from","to","cc","date","isSeen","hasAttachments","url","bindings","body"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.mail.messagedto"}}}}}}}}}}},"\/mail.message.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","mailboxId","mailboxEmail","subject","from","to","cc","date","isSeen","hasAttachments","url","bindings","body"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.messagedto"}}}}}}}}}},"\/mail.message.send":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.reply":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.forward":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createcrmactivity":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/mail.message.removecrmactivity":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/mail.message.thread":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","mailboxId","mailboxEmail","subject","from","to","cc","date","isSeen","hasAttachments","url","bindings","body"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.movetofolder":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createtask":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createcalendarevent":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createchat":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createfeedpost":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.recipient.listcontacts":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","email","name"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.recipientdto"}}}}}}}}}},"\/mail.recipient.listemployees":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","email","name"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.recipientdto"}}}}}}}}}},"\/main.eventlog.list":{"post":{"summary":"Метод получения списка","description":"Получить список записей по выбору","tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","timestampX","severity","auditTypeId","moduleId","itemId","remoteAddr","userAgent","requestUri","siteId","userId","guestId","description"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"timestampX":{"type":"string","example":"ASC"},"auditTypeId":{"type":"string","example":"ASC"},"userId":{"type":"string","example":"ASC"},"guestId":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.main.eventlogdto"}}}}}}}}}},"\/main.eventlog.get":{"post":{"summary":"Метод получения элемента","description":"Получить конкретную запись по идентификатору","tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","timestampX","severity","auditTypeId","moduleId","itemId","remoteAddr","userAgent","requestUri","siteId","userId","guestId","description"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.main.eventlogdto"}}}}}}}}}}},"\/main.eventlog.tail":{"post":{"summary":"Метод отслеживания","description":"Получить последние записи","tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","timestampX","severity","auditTypeId","moduleId","itemId","remoteAddr","userAgent","requestUri","siteId","userId","guestId","description"]},"filter":{"type":"array"},"cursor":{"type":"object","example":{"field":"id","value":0,"order":"ASC"}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.main.eventlogdto"}}}}}}}}}},"\/note.document.search.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string"},"pagination":{"type":"object","properties":{"limit":{"type":"integer"}}}}}}}},"responses":{"200":{"content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.searchresultitemdto"}},"hasMore":{"type":"boolean"}}}}}}}}}}},"\/note.document.tree.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","required":["collectionId"],"properties":{"collectionId":{"type":"integer"}}}}}},"responses":{"200":{"content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.documenttreeitemdto"}},"truncated":{"type":"boolean"}}}}},"example":{"result":{"items":[{"id":10,"collectionId":123,"parentId":null,"title":"Введение","position":1,"children":[{"id":11,"collectionId":123,"parentId":10,"title":"Глава 1","position":1,"children":[]}]}],"truncated":false}}}}}}}},"\/note.collection.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"afterCursor":{"type":"object","properties":{"position":{"type":"integer"},"id":{"type":"integer"}}}}}}}}}},"responses":{"200":{"content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}},"nextCursor":{"type":"object","nullable":true,"properties":{"position":{"type":"integer"},"id":{"type":"integer"}}}}}}}}}}}}},"\/note.collection.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","position","policyLevel","createdBy","createdAt","updatedBy","updatedAt"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}}}}}}}}}}},"\/note.collection.add":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"name":{"type":"string"},"position":{"type":"integer","format":"int64"}},"required":["name"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}}}}}}}}}}},"\/note.collection.update":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}}}}}}}}}}},"\/note.collection.archive":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.collection.delete":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.document.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","collectionId","parentId","title","markdown","position","createdBy","updatedBy","createdAt","updatedAt"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.documentitemdto"}}}}}}}}}}},"\/note.document.add":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"collectionId":{"type":"integer","format":"int64"},"parentId":{"type":"integer","format":"int64"},"title":{"type":"string"},"markdown":{"type":"string"}},"required":["collectionId","title"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.documentitemdto"}}}}}}}}}}},"\/note.document.update":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"overwrite":{"type":"boolean","example":true},"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"title":{"type":"string"},"markdown":{"type":"string"}}},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.documentitemdto"}}}}}}}}}}},"\/note.document.archive":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.document.delete":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.file.add":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"documentId":{"type":"integer","example":1},"fileName":{"type":"string","example":"string"},"fileContent":{"type":"string","example":"string"}},"required":["documentId","fileName","fileContent"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.fileitemdto"}}}}}}}}}}},"\/note.file.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"documentId":{"type":"integer","example":1}},"required":["id","documentId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.fileitemdto"}}}}}}}}}}},"\/rest.documentation.openapi":{"post":{"summary":"Документация Open API","description":"Метод для получения документации продукта в Open API формате","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"summary":"Документация Open API","description":"Метод для получения документации продукта в Open API формате","tags":["rest"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/rest.scope.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filterModule":{"type":"string","example":"string"},"filterController":{"type":"string","example":"string"},"filterMethod":{"type":"string","example":"string"}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.field.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/humanresources.node.member.field.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/humanresources.employee.field.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/humanresources.employee.field.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/humanresources.node.field.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/humanresources.node.field.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/mail.mailbox.field.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/mail.mailbox.field.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/mail.message.field.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/mail.message.field.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/mail.recipient.field.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/mail.recipient.field.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/main.eventlog.field.list":{"post":{"tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/main.eventlog.field.get":{"post":{"tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.document.search.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.document.search.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.document.tree.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.document.tree.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.collection.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.collection.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.document.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.document.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.file.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.file.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.app.scoperequest.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.app.scoperequest.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.access.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.access.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.embedding.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.embedding.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.local.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.local.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.personal.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.personal.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.placement.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.placement.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.incomingwebhook.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.incomingwebhook.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/tasks.task.chat.message.field.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/tasks.task.chat.message.field.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/tasks.task.result.field.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/tasks.task.result.field.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/tasks.task.field.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/tasks.task.field.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/timeman.record.field.list":{"post":{"tags":["timeman"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/timeman.record.field.get":{"post":{"tags":["timeman"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.access.field.list":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.access.field.get":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.field.list":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.field.get":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.field.list":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.field.get":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.app.scoperequest.add":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"scopes":{"type":"array"},"comment":{"type":"string"}},"required":["scopes","comment"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequestdto"}}}}}}}}}}},"\/rest.app.scoperequest.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","appId","scopes","status","currentState","comment","createdAt","history"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequestdto"}}}}}}}}}}},"\/rest.app.scoperequest.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","appId","scopes","status","currentState","comment","createdAt","history"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequestdto"}}}}}}}}}},"\/rest.portal.license.get":{"post":{"summary":"Gets portal license information","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"summary":"Gets portal license information","tags":["rest"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/rest.application.access.set":{"post":{"summary":"Устанавливает коды доступа для приложения","description":"Replaces all existing access codes for the application with the provided ones.\n\t\tFor personal applications, the owner user access code is always added to the saved access codes.\n\t\tAccess codes define which users or groups can use the application.\n\t\tAdministrators and personal application owners always have access regardless of access codes.\n\t\tFor shared applications, if no access codes are set, the application is available to everyone.\n\t\tFor personal applications, if no access codes are set, only the owner and administrators have access.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022codes\u0022: [\u0022UA\u0022, \u0022D1\u0022]\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["clientId","codes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.access.delete":{"post":{"summary":"Удаляет коды доступа приложения","description":"Removes specified access codes from the application.\n\t\tOnly the provided codes are removed; other existing codes remain unchanged.\n\t\tAdministrators and personal application owners always have access regardless of access codes.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022codes\u0022: [\u0022D1\u0022]\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["clientId","codes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.access.reset":{"post":{"summary":"Сбрасывает доступ приложения к значениям по умолчанию","description":"Removes all custom access codes and restores the default access settings for the application.\n\t\tFor personal applications, the default is the owner and administrators only.\n\t\tFor shared applications, the default is no restrictions (available to everyone).\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.access.get":{"post":{"summary":"Возвращает коды доступа приложения","description":"Returns the current access codes assigned to the application,\n\t\tincluding detailed information about each code (provider and display name).\n\t\tAdministrators and personal application owners always have access regardless of access codes.\n\t\tFor shared applications, if no access codes are set, the application is available to everyone.\n\t\tFor personal applications, if no access codes are set, only the owner and administrators have access.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["clientId","codes","codesDetails"]}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.accessdto"}}}}}}}}}}},"\/rest.application.embedding.list":{"post":{"summary":"Возвращает список мест встроек приложения","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["id","userId","placement","handler","title","description","groupName","additional","options","languages"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.embeddingdto"}}}}}}}}}},"\/rest.application.embedding.add":{"post":{"summary":"Добавляет новое место встройки для приложения","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022placement\u0022: \u0022IM_CONTEXT_MENU\u0022,\n\t\t\t\u0022handler\u0022: \u0022https:\/\/example.com\/embed\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"placement":{"type":"string","example":"string"},"handler":{"type":"string","example":"string"},"userId":{"type":"integer","example":1},"title":{"type":"string","example":"string"},"description":{"type":"string","example":"string"},"groupName":{"type":"string","example":"string"},"settings":{"type":"array"},"languages":{"type":"array"}},"required":["clientId","placement","handler","userId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.embedding.delete":{"post":{"summary":"Удаляет место встройки","description":"If `handler` is provided, only the embedding with that handler will be deleted.\n\t\tIf `userId` is provided, only the embedding for that user will be deleted.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022placement\u0022:\u0022IM_CONTEXT_MENU\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"placement":{"type":"string","example":"string"},"handler":{"type":"string","example":"string"},"userId":{"type":"integer","example":1}},"required":["clientId","placement"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/rest.application.local.install":{"post":{"summary":"Устанавливает локальное общее приложение","description":"Request example:\n\t\t{\n\t\t\t\u0022title\u0022: \u0022Test application\u0022,\n\t\t\t\u0022handlerUrl\u0022: \u0022https:\/\/example.com\u0022,\n\t\t\t\u0022scopes\u0022: [\u0022crm\u0022],\n\t\t\t\u0022mobile\u0022: false,\n\t\t\t\u0022menuTitles\u0022: {\n\t\t\t\t\u0022en\u0022: \u0022Test application\u0022\n\t\t\t}\n\t\t}\n\t\tIf `menuTitles` is omitted, the application is installed as API-only: \n\t\tit is not shown in the Bitrix24 interface, and its only way to access the portal is through the REST API, \n\t\tbut it can still add embeddings.","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"handlerUrl":{"type":"string","example":"string"},"scopes":{"type":"array"},"mobile":{"type":"boolean","example":true},"menuTitles":{"type":"array"},"clientId":{"type":"string","example":"string"},"applicationToken":{"type":"string","example":"string"},"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]}},"required":["title","handlerUrl","scopes","mobile","menuTitles","attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"},"oauthToken":{"$ref":"#\/components\/schemas\/bitrix.rest.oauthtokendto"}}}}}}}}}}},"\/rest.application.local.uninstall":{"post":{"summary":"Удаляет локальное общее приложение","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.personal.install":{"post":{"summary":"Устанавливает локальное персональное приложение","description":"Request example:\n\t\t{\n\t\t\t\u0022title\u0022: \u0022Test application\u0022,\n\t\t\t\u0022handlerUrl\u0022: \u0022https:\/\/example.com\u0022,\n\t\t\t\u0022scopes\u0022: [\u0022crm\u0022],\n\t\t\t\u0022mobile\u0022: false,\n\t\t\t\u0022menuTitles\u0022: {\n\t\t\t\t\u0022en\u0022: \u0022Test application\u0022\n\t\t\t}\n\t\t}\n\t\tIf `menuTitles` is omitted, the application is installed as API-only: \n\t\tit is not shown in the Bitrix24 interface, and its only way to access the portal is through the REST API, \n\t\tbut it can still add embeddings.","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"handlerUrl":{"type":"string","example":"string"},"scopes":{"type":"array"},"mobile":{"type":"boolean","example":true},"menuTitles":{"type":"array"},"clientId":{"type":"string","example":"string"},"applicationToken":{"type":"string","example":"string"},"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]}},"required":["title","handlerUrl","scopes","mobile","menuTitles","attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"},"oauthToken":{"$ref":"#\/components\/schemas\/bitrix.rest.oauthtokendto"}}}}}}}}}}},"\/rest.application.personal.uninstall":{"post":{"summary":"Удаляет локальное персональное приложение","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.placement.list":{"post":{"summary":"Возвращает список доступных мест встраивания","description":"If `scope` is provided, only placements for that scope are returned, and other parameters are ignored.\n\t\tIf `showAll` is `true`, all available placements are returned.\n\t\tIf `clientId` is provided, only placements available to that application are returned.\n\t\tIf no parameters are provided, all available placements are returned.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"scope":{"type":"string","example":"string"},"showAll":{"type":"boolean","example":true}},"required":["showAll"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/rest.application.getbyclientid":{"post":{"summary":"Получает приложение по OAuth client ID","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"}}}}}}}}}}},"\/rest.application.list":{"post":{"summary":"Возвращает список установленных приложений","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"clientId":{"type":"string","example":"ASC"},"title":{"type":"string","example":"ASC"},"version":{"type":"string","example":"ASC"},"dateCreate":{"type":"string","example":"ASC"},"dateInstall":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}},"required":["attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"}}}}}}}}}},"\/rest.incomingwebhook.add":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"scopes":{"type":"array"},"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["url","scopes","title","active","userId","dateCreate","attributes"]}},"required":["title","scopes","attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.incomingwebhookdto"}}}}}}}}}}},"\/rest.incomingwebhook.update":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"scopes":{"type":"array"},"title":{"type":"string"}}}},"required":["id","fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.incomingwebhook.delete":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.incomingwebhook.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["url","scopes","title","active","userId","dateCreate","attributes"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"dateCreate":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.incomingwebhookdto"}}}}}}}}}},"\/tasks.task.chat.message.send":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"taskId":{"type":"integer","format":"int64"},"text":{"type":"string"}},"required":["taskId","text"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.access.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/tasks.task.file.attach":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"taskId":{"type":"integer","example":1},"fileIds":{"type":"array"}},"required":["taskId","fileIds"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.result.add":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"taskId":{"type":"integer","format":"int64"},"text":{"type":"string"}},"required":["taskId","text"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}}},"\/tasks.task.result.addfromchatmessage":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"text":{"type":"string"},"messageId":{"type":"integer","format":"int64"}},"required":["messageId"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}}},"\/tasks.task.result.update":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}}},"\/tasks.task.result.delete":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.result.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"select":{"type":"array","items":{"type":"string"},"example":["id","taskId","text","authorId","createdAt","updatedAt","status","fileIds","rights","messageId"]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"authorId":{"type":"string","example":"ASC"},"createdAt":{"type":"string","example":"ASC"},"updatedAt":{"type":"string","example":"ASC"},"status":{"type":"string","example":"ASC"},"messageId":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}},"\/tasks.task.update":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"responsibleId":{"type":"integer","format":"int64"},"deadline":{"type":"string","format":"date-time"},"needsControl":{"type":"boolean"},"startPlan":{"type":"string","format":"date-time"},"endPlan":{"type":"string","format":"date-time"},"fileIds":{"type":"array"},"checklist":{"type":"array"},"groupId":{"type":"integer","format":"int64"},"stageId":{"type":"integer","format":"int64"},"epicId":{"type":"integer","format":"int64"},"storyPoints":{"type":"integer","format":"int64"},"flowId":{"type":"integer","format":"int64"},"priority":{"type":"string"},"status":{"type":"string"},"statusChanged":{"type":"string","format":"date-time"},"parentId":{"type":"integer","format":"int64"},"containsChecklist":{"type":"boolean"},"containsSubTasks":{"type":"boolean"},"containsRelatedTasks":{"type":"boolean"},"containsGanttLinks":{"type":"boolean"},"containsPlacements":{"type":"boolean"},"containsResults":{"type":"boolean"},"numberOfReminders":{"type":"integer","format":"int64"},"chatId":{"type":"integer","format":"int64"},"plannedDuration":{"type":"integer","format":"int64"},"actualDuration":{"type":"integer","format":"int64"},"durationType":{"type":"string"},"started":{"type":"string","format":"date-time"},"estimatedTime":{"type":"integer","format":"int64"},"replicate":{"type":"boolean"},"changed":{"type":"string","format":"date-time"},"changedById":{"type":"integer","format":"int64"},"statusChangedById":{"type":"integer","format":"int64"},"closedById":{"type":"integer","format":"int64"},"closed":{"type":"string","format":"date-time"},"activity":{"type":"string","format":"date-time"},"guid":{"type":"string"},"xmlId":{"type":"string"},"exchangeId":{"type":"string"},"exchangeModified":{"type":"string"},"outlookVersion":{"type":"integer","format":"int64"},"mark":{"type":"string"},"allowsChangeDeadline":{"type":"boolean"},"allowsTimeTracking":{"type":"boolean"},"matchesWorkTime":{"type":"boolean"},"addInReport":{"type":"boolean"},"isMultitask":{"type":"boolean"},"siteId":{"type":"string"},"forkedByTemplateId":{"type":"integer","format":"int64"},"deadlineCount":{"type":"integer","format":"int64"},"declineReason":{"type":"string"},"forumTopicId":{"type":"integer","format":"int64"},"link":{"type":"string"},"rights":{"type":"array"},"archiveLink":{"type":"string"},"crmItemIds":{"type":"array"},"reminders":{"type":"array"},"requireResult":{"type":"boolean"},"matchesSubTasksTime":{"type":"boolean"},"autocompleteSubTasks":{"type":"boolean"},"allowsChangeDatePlan":{"type":"boolean"},"emailId":{"type":"integer","format":"int64"},"maxDeadlineChangeDate":{"type":"string","format":"date-time"},"maxDeadlineChanges":{"type":"integer","format":"int64"},"requireDeadlineChangeReason":{"type":"boolean"},"inFavorite":{"type":"array"},"inPin":{"type":"array"},"inGroupPin":{"type":"array"},"inMute":{"type":"array"},"dependsOn":{"type":"array"},"scenarios":{"type":"array"}}},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.delete":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.add":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"creatorId":{"type":"integer","format":"int64"},"responsibleId":{"type":"integer","format":"int64"},"deadline":{"type":"string","format":"date-time"},"needsControl":{"type":"boolean"},"startPlan":{"type":"string","format":"date-time"},"endPlan":{"type":"string","format":"date-time"},"fileIds":{"type":"array"},"checklist":{"type":"array"},"groupId":{"type":"integer","format":"int64"},"stageId":{"type":"integer","format":"int64"},"epicId":{"type":"integer","format":"int64"},"storyPoints":{"type":"integer","format":"int64"},"flowId":{"type":"integer","format":"int64"},"priority":{"type":"string"},"status":{"type":"string"},"statusChanged":{"type":"string","format":"date-time"},"parentId":{"type":"integer","format":"int64"},"containsChecklist":{"type":"boolean"},"containsSubTasks":{"type":"boolean"},"containsRelatedTasks":{"type":"boolean"},"containsGanttLinks":{"type":"boolean"},"containsPlacements":{"type":"boolean"},"containsResults":{"type":"boolean"},"numberOfReminders":{"type":"integer","format":"int64"},"chatId":{"type":"integer","format":"int64"},"plannedDuration":{"type":"integer","format":"int64"},"actualDuration":{"type":"integer","format":"int64"},"durationType":{"type":"string"},"started":{"type":"string","format":"date-time"},"estimatedTime":{"type":"integer","format":"int64"},"replicate":{"type":"boolean"},"changed":{"type":"string","format":"date-time"},"changedById":{"type":"integer","format":"int64"},"statusChangedById":{"type":"integer","format":"int64"},"closedById":{"type":"integer","format":"int64"},"closed":{"type":"string","format":"date-time"},"activity":{"type":"string","format":"date-time"},"guid":{"type":"string"},"xmlId":{"type":"string"},"exchangeId":{"type":"string"},"exchangeModified":{"type":"string"},"outlookVersion":{"type":"integer","format":"int64"},"mark":{"type":"string"},"allowsChangeDeadline":{"type":"boolean"},"allowsTimeTracking":{"type":"boolean"},"matchesWorkTime":{"type":"boolean"},"addInReport":{"type":"boolean"},"isMultitask":{"type":"boolean"},"siteId":{"type":"string"},"forkedByTemplateId":{"type":"integer","format":"int64"},"deadlineCount":{"type":"integer","format":"int64"},"declineReason":{"type":"string"},"forumTopicId":{"type":"integer","format":"int64"},"link":{"type":"string"},"rights":{"type":"array"},"archiveLink":{"type":"string"},"crmItemIds":{"type":"array"},"reminders":{"type":"array"},"requireResult":{"type":"boolean"},"matchesSubTasksTime":{"type":"boolean"},"autocompleteSubTasks":{"type":"boolean"},"allowsChangeDatePlan":{"type":"boolean"},"emailId":{"type":"integer","format":"int64"},"maxDeadlineChangeDate":{"type":"string","format":"date-time"},"maxDeadlineChanges":{"type":"integer","format":"int64"},"requireDeadlineChangeReason":{"type":"boolean"},"inFavorite":{"type":"array"},"inPin":{"type":"array"},"inGroupPin":{"type":"array"},"inMute":{"type":"array"},"dependsOn":{"type":"array"},"scenarios":{"type":"array"}},"required":["title","creatorId","responsibleId"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto"}}}}}}}}}}},"\/tasks.task.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","title","description","creatorId","created","responsibleId","deadline","needsControl","startPlan","endPlan","fileIds","checklist","groupId","stageId","epicId","storyPoints","flowId","priority","status","statusChanged","parentId","containsChecklist","containsSubTasks","containsRelatedTasks","containsGanttLinks","containsPlacements","containsResults","numberOfReminders","chatId","plannedDuration","actualDuration","durationType","started","estimatedTime","replicate","changed","changedById","statusChangedById","closedById","closed","activity","guid","xmlId","exchangeId","exchangeModified","outlookVersion","mark","allowsChangeDeadline","allowsTimeTracking","matchesWorkTime","addInReport","isMultitask","siteId","forkedByTemplateId","deadlineCount","declineReason","forumTopicId","link","rights","archiveLink","crmItemIds","crmItems","reminders","elapsedTime","requireResult","matchesSubTasksTime","autocompleteSubTasks","allowsChangeDatePlan","emailId","maxDeadlineChangeDate","maxDeadlineChanges","requireDeadlineChangeReason","inFavorite","inPin","inGroupPin","inMute","source","dependsOn","scenarios"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto"}}}}}}}}}}},"\/tasks.task.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","title","description","creatorId","created","responsibleId","deadline","needsControl","startPlan","endPlan","fileIds","checklist","groupId","stageId","epicId","storyPoints","flowId","priority","status","statusChanged","parentId","containsChecklist","containsSubTasks","containsRelatedTasks","containsGanttLinks","containsPlacements","containsResults","numberOfReminders","chatId","plannedDuration","actualDuration","durationType","started","estimatedTime","replicate","changed","changedById","statusChangedById","closedById","closed","activity","guid","xmlId","exchangeId","exchangeModified","outlookVersion","mark","allowsChangeDeadline","allowsTimeTracking","matchesWorkTime","addInReport","isMultitask","siteId","forkedByTemplateId","deadlineCount","declineReason","forumTopicId","link","rights","archiveLink","crmItemIds","crmItems","reminders","elapsedTime","requireResult","matchesSubTasksTime","autocompleteSubTasks","allowsChangeDatePlan","emailId","maxDeadlineChangeDate","maxDeadlineChanges","requireDeadlineChangeReason","inFavorite","inPin","inGroupPin","inMute","source","dependsOn","scenarios"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"title":{"type":"string","example":"ASC"},"creatorId":{"type":"string","example":"ASC"},"created":{"type":"string","example":"ASC"},"responsibleId":{"type":"string","example":"ASC"},"deadline":{"type":"string","example":"ASC"},"startPlan":{"type":"string","example":"ASC"},"endPlan":{"type":"string","example":"ASC"},"groupId":{"type":"string","example":"ASC"},"priority":{"type":"string","example":"ASC"},"status":{"type":"string","example":"ASC"},"started":{"type":"string","example":"ASC"},"estimatedTime":{"type":"string","example":"ASC"},"changed":{"type":"string","example":"ASC"},"closed":{"type":"string","example":"ASC"},"activity":{"type":"string","example":"ASC"},"mark":{"type":"string","example":"ASC"},"allowsChangeDeadline":{"type":"string","example":"ASC"},"allowsTimeTracking":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto"}}}}}}}}}},"\/timeman.record.list":{"post":{"tags":["timeman"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"select":{"type":"array","items":{"type":"string"},"example":["id","userId","startTime","endTime","duration","breakLength","state","isApproved"]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"userId":{"type":"string","example":"ASC"},"startTime":{"type":"string","example":"ASC"},"endTime":{"type":"string","example":"ASC"},"duration":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.timeman.recorddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.access.set":{"post":{"description":"Replaces all ACL access codes for a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1},"accessCodes":{"type":"array"}},"required":["catalogItemId","accessCodes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.set":{"post":{"description":"Pins a catalog item for the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1}},"required":["catalogItemId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.delete":{"post":{"description":"Removes the current REST user pin from a catalog item","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1}},"required":["catalogItemId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.add":{"post":{"description":"Creates a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"type":{"type":"string","example":"string"},"accessType":{"type":"string","example":"string"},"description":{"type":"string","example":"string"},"editUrl":{"type":"string","example":"string"},"viewUrl":{"type":"string","example":"string"},"chatId":{"type":"integer","example":1},"externalId":{"type":"string","example":"string"},"iss":{"type":"string","example":"string"}},"required":["title","type","accessType"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"integer","format":"int64"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.update":{"post":{"description":"Updates editable fields of a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1},"fields":{"type":"object","properties":{"title":{"type":"string"},"accessType":{"type":"string"},"description":{"type":"string"},"editUrl":{"type":"string"},"viewUrl":{"type":"string"},"chatId":{"type":"integer","format":"int64"},"externalId":{"type":"string"}}}},"required":["catalogItemId","fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.delete":{"post":{"description":"Deletes a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1}},"required":["catalogItemId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/batch":{"post":{"tags":[],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":[],"summary":"Метод Batch","description":"Метод позволяет реализовать вызов нескольких методов в рамках одного запроса"}},"\/documentation":{"post":{"summary":"Документация Open API","description":"Метод для получения документации продукта в Open API формате","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"summary":"Документация Open API","description":"Метод для получения документации продукта в Open API формате","tags":["rest"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/scopes":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filterModule":{"type":"string","example":"string"},"filterController":{"type":"string","example":"string"},"filterMethod":{"type":"string","example":"string"}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}}},"components":{"schemas":{"bitrix.humanresources.nodememberdto":{"type":"object","properties":{"userId":{"type":"integer","format":"int64","title":"userId"},"name":{"type":"string","title":"name"},"workPosition":{"type":"string","title":"workPosition"},"role":{"type":"string","title":"role"},"avatar":{"type":"string","title":"avatar"},"url":{"type":"string","title":"url"}}},"bitrix.humanresources.employeedto":{"type":"object","properties":{"userId":{"type":"integer","format":"int64","title":"userId"},"name":{"type":"string","title":"name"},"workPosition":{"type":"string","title":"workPosition"},"avatar":{"type":"string","title":"avatar"},"url":{"type":"string","title":"url"},"departments":{"type":"array","title":"departments"},"teams":{"type":"array","title":"teams"}}},"bitrix.humanresources.nodedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"type":{"type":"string","title":"type"},"structureId":{"type":"integer","format":"int64","title":"structureId"},"parentId":{"type":"integer","format":"int64","title":"parentId"},"description":{"type":"string","title":"description"},"accessCode":{"type":"string","title":"accessCode"},"userCount":{"type":"integer","format":"int64","title":"userCount"},"colorName":{"type":"string","title":"colorName"},"xmlId":{"type":"string","title":"xmlId"},"createdAt":{"type":"string","title":"createdAt"},"updatedAt":{"type":"string","title":"updatedAt"},"members":{"type":"array","title":"members"}}},"bitrix.mail.mailboxdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"email":{"type":"string","title":"email"},"senderName":{"type":"string","title":"senderName"}}},"bitrix.mail.messagedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"mailboxId":{"type":"integer","format":"int64","title":"mailboxId"},"mailboxEmail":{"type":"string","title":"mailboxEmail"},"subject":{"type":"string","title":"subject"},"from":{"type":"string","title":"from"},"to":{"type":"string","title":"to"},"cc":{"type":"string","title":"cc"},"date":{"type":"string","title":"date"},"isSeen":{"type":"boolean","title":"isSeen"},"hasAttachments":{"type":"boolean","title":"hasAttachments"},"url":{"type":"string","title":"url"},"bindings":{"type":"array","title":"bindings"},"body":{"type":"string","title":"body"}}},"bitrix.mail.recipientdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"email":{"type":"string","title":"email"},"name":{"type":"string","title":"name"}}},"bitrix.main.eventlogdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"ID записи","description":"Уникальный идентификатор записи в журнале событий"},"timestampX":{"type":"string","format":"date-time","title":"Время события","description":"Дата и время когда произошло событие"},"severity":{"type":"string","title":"Уровень важности","description":"Уровень серьезности события (INFO, WARNING, ERROR, etc.)"},"auditTypeId":{"type":"string","title":"Тип события","description":"Идентификатор типа аудиторского события"},"moduleId":{"type":"string","title":"Модуль","description":"Модуль в котором произошло событие"},"itemId":{"type":"string","title":"ID элемента","description":"Идентификатор элемента связанного с событием"},"remoteAddr":{"type":"string","title":"IP адрес","description":"IP адрес пользователя вызвавшего событие"},"userAgent":{"type":"string","title":"User Agent","description":"Браузер и операционная система пользователя"},"requestUri":{"type":"string","title":"URI запроса","description":"URL по которому был выполнен запрос"},"siteId":{"type":"string","title":"ID сайта","description":"Идентификатор сайта на котором произошло событие"},"userId":{"type":"integer","format":"int64","title":"ID пользователя","description":"Идентификатор пользователя вызвавшего событие"},"guestId":{"type":"integer","format":"int64","title":"ID гостя","description":"Идентификатор гостя (неавторизованного пользователя)"},"description":{"type":"string","title":"Описание события","description":"Подробное описание произошедшего события"}}},"bitrix.note.searchresultitemdto":{"type":"object","properties":{"documentId":{"type":"integer","format":"int64","title":"documentId"},"collectionId":{"type":"integer","format":"int64","title":"collectionId"},"title":{"type":"string","title":"title"},"score":{"type":"float","title":"score"},"snippet":{"type":"string","title":"snippet"},"sharedAccess":{"type":"boolean","title":"sharedAccess"}}},"bitrix.note.documenttreeitemdto":{"type":"object","properties":{"id":{"type":"integer"},"collectionId":{"type":"integer"},"parentId":{"type":"integer","nullable":true},"title":{"type":"string"},"position":{"type":"integer"},"children":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.documenttreeitemdto"}}}},"bitrix.note.collectionitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"position":{"type":"integer","format":"int64","title":"position"},"policyLevel":{"type":"string","title":"policyLevel"},"createdBy":{"type":"integer","format":"int64","title":"createdBy"},"createdAt":{"type":"string","title":"createdAt"},"updatedBy":{"type":"integer","format":"int64","title":"updatedBy"},"updatedAt":{"type":"string","title":"updatedAt"}}},"bitrix.note.documentitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"collectionId":{"type":"integer","format":"int64","title":"collectionId"},"parentId":{"type":"integer","format":"int64","title":"parentId"},"title":{"type":"string","title":"title"},"markdown":{"type":"string","title":"markdown"},"position":{"type":"integer","format":"int64","title":"position"},"createdBy":{"type":"integer","format":"int64","title":"createdBy"},"updatedBy":{"type":"integer","format":"int64","title":"updatedBy"},"createdAt":{"type":"string","title":"createdAt"},"updatedAt":{"type":"string","title":"updatedAt"}}},"bitrix.note.fileitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"documentId":{"type":"integer","format":"int64","title":"documentId"},"name":{"type":"string","title":"name"},"size":{"type":"integer","format":"int64","title":"size"},"mimeType":{"type":"string","title":"mimeType"},"assetType":{"type":"string","title":"assetType"},"assetMarkdown":{"type":"string","title":"assetMarkdown"}}},"bitrix.rest.enumdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"entityId":{"type":"string","title":"entityId"},"fieldId":{"type":"integer","format":"int64","title":"fieldId"},"value":{"type":"string","title":"value"},"isDefault":{"type":"boolean","title":"isDefault"},"sort":{"type":"integer","format":"int64","title":"sort"},"xmlId":{"type":"string","title":"xmlId"}}},"bitrix.rest.customdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"entityId":{"type":"string","title":"entityId"},"name":{"type":"string","title":"name"},"userTypeId":{"type":"string","title":"userTypeId"},"xmlId":{"type":"string","title":"xmlId"},"sort":{"type":"integer","format":"int64","title":"sort"},"isMultiple":{"type":"boolean","title":"isMultiple"},"isMandatory":{"type":"boolean","title":"isMandatory"},"showFilter":{"type":"string","title":"showFilter"},"showInList":{"type":"boolean","title":"showInList"},"editInList":{"type":"boolean","title":"editInList"},"isSearchable":{"type":"boolean","title":"isSearchable"},"settings":{"type":"array","title":"settings"},"editFormLabel":{"title":"editFormLabel"},"listColumnLabel":{"title":"listColumnLabel"},"listFilterLabel":{"title":"listFilterLabel"},"errorMessage":{"title":"errorMessage"},"helpMessage":{"title":"helpMessage"}}},"bitrix.rest.dtofielddto":{"type":"object","properties":{"name":{"type":"string","title":"name"},"type":{"type":"string","title":"type"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"validationRules":{"type":"array","title":"validationRules"},"requiredGroups":{"type":"array","title":"requiredGroups"},"filterable":{"type":"boolean","title":"filterable"},"sortable":{"type":"boolean","title":"sortable"},"editable":{"type":"boolean","title":"editable"},"multiple":{"type":"boolean","title":"multiple"},"elementType":{"type":"string","title":"elementType"}}},"bitrix.rest.scoperequestdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"appId":{"type":"integer","format":"int64","title":"appId"},"scopes":{"type":"array","title":"scopes"},"status":{"type":"string","title":"status"},"currentState":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequeststatusdto","title":"currentState"},"comment":{"type":"string","title":"comment"},"createdAt":{"type":"string","format":"date-time","title":"createdAt"},"history":{"title":"history"}}},"bitrix.rest.scoperequeststatusdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"requestId":{"type":"integer","format":"int64","title":"requestId"},"status":{"type":"string","title":"status"},"comment":{"type":"string","title":"comment"},"createdAt":{"type":"string","format":"date-time","title":"createdAt"}}},"bitrix.rest.accessdto":{"type":"object","properties":{"clientId":{"type":"string","title":"Application client ID"},"codes":{"type":"array","title":"Application access codes"},"codesDetails":{"type":"array","title":"Access code details with provider and display name"}}},"bitrix.rest.embeddingdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"ID"},"userId":{"type":"integer","format":"int64","title":"User ID"},"placement":{"type":"string","title":"Placement name"},"handler":{"type":"string","title":"Placement Handler URI"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"groupName":{"type":"string","title":"groupName"},"additional":{"type":"string","title":"additional"},"options":{"type":"array","title":"options"},"languages":{"title":"languages"}}},"bitrix.rest.appdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"Application inner identification"},"clientId":{"type":"string","title":"Application client ID"},"clientSecret":{"type":"string","title":"Application client secret"},"applicationToken":{"type":"string","title":"Application token (shared secret used to authenticate webhook callbacks from the portal)"},"scopes":{"type":"array","title":"Application scopes"},"title":{"type":"string","title":"Application title"},"url":{"type":"string","title":"Handler URL"},"urlInstall":{"type":"string","title":"Installation URL"},"urlSettings":{"type":"string","title":"Settings URL"},"mobile":{"type":"boolean","title":"Mobile application flag"},"version":{"type":"string","title":"Application version"},"active":{"type":"boolean","title":"Application active flag"},"installed":{"type":"boolean","title":"Application installed flag"},"dateCreate":{"type":"string","title":"Date of creation"},"dateInstall":{"type":"string","title":"Date of installation"},"attributes":{"type":"array","title":"Application external attributes"}}},"bitrix.rest.oauthtokendto":{"type":"object","properties":{"accessToken":{"type":"string","title":"OAuth access token"},"refreshToken":{"type":"string","title":"OAuth refresh token"},"expiresIn":{"type":"integer","format":"int64","title":"Access token lifetime in seconds"},"serverEndpoint":{"type":"string","title":"REST server endpoint"}}},"bitrix.rest.placementdto":{"type":"object","properties":{"placement":{"type":"string","title":"placement"}}},"bitrix.rest.incomingwebhookdto":{"type":"object","properties":{"url":{"type":"string","title":"Webhook handler URL"},"scopes":{"type":"array","title":"Webhook scopes"},"title":{"type":"string","title":"Webhook title"},"active":{"type":"boolean","title":"Active flag"},"userId":{"type":"integer","format":"int64","title":"Owner user id"},"dateCreate":{"type":"string","title":"Date of creation"},"attributes":{"type":"array","title":"Incoming webhook external attributes"}}},"bitrix.tasks.messagedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"text":{"type":"string","title":"text"}}},"bitrix.tasks.resultdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"text":{"type":"string","title":"text"},"authorId":{"type":"integer","format":"int64","title":"authorId"},"author":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"author"},"createdAt":{"type":"string","format":"date-time","title":"createdAt"},"updatedAt":{"type":"string","format":"date-time","title":"updatedAt"},"status":{"type":"string","title":"status"},"fileIds":{"type":"array","title":"fileIds"},"rights":{"type":"array","title":"rights"},"messageId":{"type":"integer","format":"int64","title":"messageId"}}},"bitrix.tasks.userdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"role":{"type":"string","title":"role"},"image":{"$ref":"#\/components\/schemas\/bitrix.tasks.filedto","title":"image"},"gender":{"type":"string","title":"gender"},"email":{"type":"string","title":"email"},"externalAuthId":{"type":"string","title":"externalAuthId"},"rights":{"type":"array","title":"rights"}}},"bitrix.tasks.filedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"src":{"type":"string","title":"src"},"name":{"type":"string","title":"name"},"width":{"type":"integer","format":"int64","title":"width"},"height":{"type":"integer","format":"int64","title":"height"},"size":{"type":"integer","format":"int64","title":"size"},"subDir":{"type":"string","title":"subDir"},"contentType":{"type":"string","title":"contentType"},"file":{"type":"array","title":"file"}}},"bitrix.tasks.taskdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"creatorId":{"type":"integer","format":"int64","title":"creatorId"},"creator":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"creator"},"created":{"type":"string","format":"date-time","title":"created"},"responsibleId":{"type":"integer","format":"int64","title":"responsibleId"},"responsible":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"responsible"},"deadline":{"type":"string","format":"date-time","title":"deadline"},"needsControl":{"type":"boolean","title":"needsControl"},"startPlan":{"type":"string","format":"date-time","title":"startPlan"},"endPlan":{"type":"string","format":"date-time","title":"endPlan"},"fileIds":{"type":"array","title":"fileIds"},"checklist":{"type":"array","title":"checklist"},"groupId":{"type":"integer","format":"int64","title":"groupId"},"group":{"$ref":"#\/components\/schemas\/bitrix.tasks.groupdto","title":"group"},"stageId":{"type":"integer","format":"int64","title":"stageId"},"stage":{"$ref":"#\/components\/schemas\/bitrix.tasks.stagedto","title":"stage"},"epicId":{"type":"integer","format":"int64","title":"epicId"},"storyPoints":{"type":"integer","format":"int64","title":"storyPoints"},"flowId":{"type":"integer","format":"int64","title":"flowId"},"flow":{"$ref":"#\/components\/schemas\/bitrix.tasks.flowdto","title":"flow"},"priority":{"type":"string","title":"priority"},"status":{"type":"string","title":"status"},"statusChanged":{"type":"string","format":"date-time","title":"statusChanged"},"accomplices":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto"},"title":"accomplices"},"auditors":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto"},"title":"auditors"},"parentId":{"type":"integer","format":"int64","title":"parentId"},"parent":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto","title":"parent"},"containsChecklist":{"type":"boolean","title":"containsChecklist"},"containsSubTasks":{"type":"boolean","title":"containsSubTasks"},"containsRelatedTasks":{"type":"boolean","title":"containsRelatedTasks"},"containsGanttLinks":{"type":"boolean","title":"containsGanttLinks"},"containsPlacements":{"type":"boolean","title":"containsPlacements"},"containsResults":{"type":"boolean","title":"containsResults"},"numberOfReminders":{"type":"integer","format":"int64","title":"numberOfReminders"},"chatId":{"type":"integer","format":"int64","title":"chatId"},"chat":{"$ref":"#\/components\/schemas\/bitrix.tasks.chatdto","title":"chat"},"plannedDuration":{"type":"integer","format":"int64","title":"plannedDuration"},"actualDuration":{"type":"integer","format":"int64","title":"actualDuration"},"durationType":{"type":"string","title":"durationType"},"started":{"type":"string","format":"date-time","title":"started"},"estimatedTime":{"type":"integer","format":"int64","title":"estimatedTime"},"replicate":{"type":"boolean","title":"replicate"},"changed":{"type":"string","format":"date-time","title":"changed"},"changedById":{"type":"integer","format":"int64","title":"changedById"},"changedBy":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"changedBy"},"statusChangedById":{"type":"integer","format":"int64","title":"statusChangedById"},"statusChangedBy":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"statusChangedBy"},"closedById":{"type":"integer","format":"int64","title":"closedById"},"closedBy":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"closedBy"},"closed":{"type":"string","format":"date-time","title":"closed"},"activity":{"type":"string","format":"date-time","title":"activity"},"guid":{"type":"string","title":"guid"},"xmlId":{"type":"string","title":"xmlId"},"exchangeId":{"type":"string","title":"exchangeId"},"exchangeModified":{"type":"string","title":"exchangeModified"},"outlookVersion":{"type":"integer","format":"int64","title":"outlookVersion"},"mark":{"type":"string","title":"mark"},"allowsChangeDeadline":{"type":"boolean","title":"allowsChangeDeadline"},"allowsTimeTracking":{"type":"boolean","title":"allowsTimeTracking"},"matchesWorkTime":{"type":"boolean","title":"matchesWorkTime"},"addInReport":{"type":"boolean","title":"addInReport"},"isMultitask":{"type":"boolean","title":"isMultitask"},"siteId":{"type":"string","title":"siteId"},"forkedByTemplateId":{"type":"integer","format":"int64","title":"forkedByTemplateId"},"forkedByTemplate":{"$ref":"#\/components\/schemas\/bitrix.tasks.templatedto","title":"forkedByTemplate"},"deadlineCount":{"type":"integer","format":"int64","title":"deadlineCount"},"declineReason":{"type":"string","title":"declineReason"},"forumTopicId":{"type":"integer","format":"int64","title":"forumTopicId"},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.tagdto"},"title":"tags"},"link":{"type":"string","title":"link"},"userFields":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.userfielddto"},"title":"userFields"},"rights":{"type":"array","title":"rights"},"archiveLink":{"type":"string","title":"archiveLink"},"crmItemIds":{"type":"array","title":"crmItemIds"},"crmItems":{"$ref":"#\/components\/schemas\/bitrix.tasks.crmitemdto","title":"crmItems"},"reminders":{"type":"array","title":"reminders"},"elapsedTime":{"$ref":"#\/components\/schemas\/bitrix.tasks.elapsedtimedto","title":"elapsedTime"},"requireResult":{"type":"boolean","title":"requireResult"},"matchesSubTasksTime":{"type":"boolean","title":"matchesSubTasksTime"},"autocompleteSubTasks":{"type":"boolean","title":"autocompleteSubTasks"},"allowsChangeDatePlan":{"type":"boolean","title":"allowsChangeDatePlan"},"emailId":{"type":"integer","format":"int64","title":"emailId"},"email":{"$ref":"#\/components\/schemas\/bitrix.tasks.emaildto","title":"email"},"maxDeadlineChangeDate":{"type":"string","format":"date-time","title":"maxDeadlineChangeDate"},"maxDeadlineChanges":{"type":"integer","format":"int64","title":"maxDeadlineChanges"},"requireDeadlineChangeReason":{"type":"boolean","title":"requireDeadlineChangeReason"},"inFavorite":{"type":"array","title":"inFavorite"},"inPin":{"type":"array","title":"inPin"},"inGroupPin":{"type":"array","title":"inGroupPin"},"inMute":{"type":"array","title":"inMute"},"source":{"$ref":"#\/components\/schemas\/bitrix.tasks.sourcedto","title":"source"},"dependsOn":{"type":"array","title":"dependsOn"},"scenarios":{"type":"array","title":"scenarios"}}},"bitrix.tasks.groupdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"image":{"$ref":"#\/components\/schemas\/bitrix.tasks.filedto","title":"image"},"type":{"type":"string","title":"type"},"isVisible":{"type":"boolean","title":"isVisible"}}},"bitrix.tasks.stagedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"title":{"type":"string","title":"title"},"color":{"type":"string","title":"color"}}},"bitrix.tasks.flowdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"}}},"bitrix.tasks.chatdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"entityId":{"type":"integer","format":"int64","title":"entityId"},"entityType":{"type":"string","title":"entityType"}}},"bitrix.tasks.templatedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"task":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto","title":"task"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"creator":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"creator"},"responsibleCollection":{"type":"array","title":"responsibleCollection"},"deadlineAfterTs":{"type":"integer","format":"int64","title":"deadlineAfterTs"},"startDatePlanTs":{"type":"integer","format":"int64","title":"startDatePlanTs"},"endDatePlanTs":{"type":"integer","format":"int64","title":"endDatePlanTs"},"replicate":{"type":"boolean","title":"replicate"},"fileIds":{"type":"array","title":"fileIds"},"checklist":{"type":"array","title":"checklist"},"group":{"$ref":"#\/components\/schemas\/bitrix.tasks.groupdto","title":"group"},"priority":{"type":"string","title":"priority"},"accomplices":{"type":"array","title":"accomplices"},"auditors":{"type":"array","title":"auditors"},"parent":{"$ref":"#\/components\/schemas\/bitrix.tasks.templatedto","title":"parent"},"replicateParams":{"$ref":"#\/components\/schemas\/bitrix.tasks.replicateparamsdto","title":"replicateParams"}}},"bitrix.tasks.replicateparamsdto":{"type":"object","properties":{"period":{"type":"string","title":"period"},"everyDay":{"type":"string","title":"everyDay"},"workdayOnly":{"type":"string","title":"workdayOnly"},"dailyMonthInterval":{"type":"string","title":"dailyMonthInterval"},"everyWeek":{"type":"string","title":"everyWeek"},"monthlyType":{"type":"string","title":"monthlyType"},"monthlyDayNum":{"type":"string","title":"monthlyDayNum"},"monthlyMonthNum1":{"type":"string","title":"monthlyMonthNum1"},"monthlyWeekDayNum":{"type":"string","title":"monthlyWeekDayNum"},"monthlyWeekDay":{"type":"string","title":"monthlyWeekDay"},"monthlyMonthNum2":{"type":"string","title":"monthlyMonthNum2"},"yearlyType":{"type":"string","title":"yearlyType"},"yearlyDayNum":{"type":"string","title":"yearlyDayNum"},"yearlyMonth1":{"type":"string","title":"yearlyMonth1"},"yearlyWeekDayNum":{"type":"string","title":"yearlyWeekDayNum"},"yearlyWeekDay":{"type":"string","title":"yearlyWeekDay"},"yearlyMonth2":{"type":"string","title":"yearlyMonth2"},"time":{"type":"string","title":"time"},"timezoneOffset":{"type":"string","title":"timezoneOffset"},"startDate":{"type":"string","title":"startDate"},"repeatTill":{"type":"string","title":"repeatTill"},"endDate":{"type":"string","title":"endDate"},"times":{"type":"string","title":"times"}}},"bitrix.tasks.tagdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"ownerId":{"type":"integer","format":"int64","title":"ownerId"},"owner":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"owner"},"groupId":{"type":"integer","format":"int64","title":"groupId"},"group":{"$ref":"#\/components\/schemas\/bitrix.tasks.groupdto","title":"group"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"task":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto","title":"task"}}},"bitrix.tasks.userfielddto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"key":{"type":"string","title":"key"},"value":{"title":"value"}}},"bitrix.tasks.crmitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"type":{"type":"string","title":"type"},"title":{"type":"string","title":"title"}}},"bitrix.tasks.elapsedtimedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"userId":{"type":"integer","format":"int64","title":"userId"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"minutes":{"type":"integer","format":"int64","title":"minutes"},"seconds":{"type":"integer","format":"int64","title":"seconds"},"source":{"type":"string","title":"source"},"text":{"type":"string","title":"text"},"createdAtTs":{"type":"integer","format":"int64","title":"createdAtTs"},"startTs":{"type":"integer","format":"int64","title":"startTs"},"stopTs":{"type":"integer","format":"int64","title":"stopTs"}}},"bitrix.tasks.emaildto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"mailboxId":{"type":"integer","format":"int64","title":"mailboxId"},"title":{"type":"string","title":"title"},"body":{"type":"string","title":"body"},"from":{"type":"string","title":"from"},"dateTs":{"type":"integer","format":"int64","title":"dateTs"},"link":{"type":"string","title":"link"}}},"bitrix.tasks.sourcedto":{"type":"object","properties":{"type":{"type":"string","title":"type"},"data":{"type":"array","title":"data"}}},"bitrix.timeman.recorddto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"userId":{"type":"integer","format":"int64","title":"userId"},"startTime":{"type":"string","format":"date-time","title":"startTime"},"endTime":{"type":"string","format":"date-time","title":"endTime"},"duration":{"type":"integer","format":"int64","title":"duration"},"breakLength":{"type":"integer","format":"int64","title":"breakLength"},"state":{"$ref":"#\/components\/schemas\/bitrix.timeman.recordstatedto","title":"state"},"isApproved":{"type":"boolean","title":"isApproved"}}},"bitrix.timeman.recordstatedto":{"type":"object","properties":{"status":{"type":"string","title":"status"},"recommendedCloseTime":{"type":"integer","format":"int64","title":"recommendedCloseTime"}}},"bitrix.vibecodeconnector.accessdto":{"type":"object","properties":{"catalogItemId":{"type":"integer","format":"int64","title":"Catalog item identifier"},"accessCodes":{"type":"array","title":"Catalog item access codes"}}},"bitrix.vibecodeconnector.catalogitemdto":{"type":"object","properties":{"catalogItemId":{"type":"integer","format":"int64","title":"Catalog item identifier"},"title":{"type":"string","title":"Title"},"type":{"type":"string","title":"Item type"},"accessType":{"type":"string","title":"Access type"},"description":{"type":"string","title":"Description"},"editUrl":{"type":"string","title":"Edit URL"},"viewUrl":{"type":"string","title":"View URL"},"chatId":{"type":"integer","format":"int64","title":"Chat identifier"},"externalId":{"type":"string","title":"External identifier"},"ownerId":{"type":"integer","format":"int64","title":"Owner user identifier"},"color":{"type":"string","title":"Color"},"createdAt":{"type":"string","title":"Date of creation (ISO-8601)"},"updatedAt":{"type":"string","title":"Date of last update (ISO-8601)"}}}}}} \ No newline at end of file +{"openapi":"3.0.0","info":{"title":"Bitrix24 REST V3 API","version":"1.0.0"},"servers":[],"tags":[{"name":"humanresources","description":"humanresources module methods"},{"name":"mail","description":"mail module methods"},{"name":"main","description":"main module methods"},{"name":"note","description":"note module methods"},{"name":"rest","description":"rest module methods"},{"name":"tasks","description":"tasks module methods"},{"name":"timeman","description":"timeman module methods"},{"name":"vibecodeconnector","description":"vibecodeconnector module methods"}],"paths":{"\/humanresources.employee.search":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["userId","name","workPosition","avatar","url","departments","teams"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.employeedto"}}}}}}}}}},"\/humanresources.employee.subordinates":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["userId","name","workPosition","avatar","url","departments","teams"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.employee.count":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.employee.multidepartment":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}}},"\/humanresources.node.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"name":{"type":"string","example":"ASC"},"createdAt":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}},"\/humanresources.node.search":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"name":{"type":"string","example":"ASC"},"createdAt":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}},"\/humanresources.node.count":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.children":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","type","structureId","parentId","description","accessCode","userCount","colorName","xmlId","createdAt","updatedAt","members"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.humanresources.nodedto"}}}}}}}}}},"\/humanresources.node.add":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.edit":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.move":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.communication.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.communication.edit":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.move":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.remove":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.add":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.node.member.set":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["humanresources"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.mailbox.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","email","senderName"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.mail.mailboxdto"}}}}}}}}}}},"\/mail.mailbox.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","email","senderName"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.mailboxdto"}}}}}}}}}},"\/mail.mailbox.senders":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","name","email","senderName"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.mailboxdto"}}}}}}}}}},"\/mail.message.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","mailboxId","mailboxEmail","subject","from","to","cc","date","isSeen","hasAttachments","url","bindings","body"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.mail.messagedto"}}}}}}}}}}},"\/mail.message.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","mailboxId","mailboxEmail","subject","from","to","cc","date","isSeen","hasAttachments","url","bindings","body"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.messagedto"}}}}}}}}}},"\/mail.message.send":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.reply":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.forward":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createcrmactivity":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/mail.message.removecrmactivity":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/mail.message.thread":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","mailboxId","mailboxEmail","subject","from","to","cc","date","isSeen","hasAttachments","url","bindings","body"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.movetofolder":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createtask":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createcalendarevent":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createchat":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.message.createfeedpost":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"tags":["mail"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/mail.recipient.listcontacts":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","email","name"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.recipientdto"}}}}}}}}}},"\/mail.recipient.listemployees":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","email","name"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.mail.recipientdto"}}}}}}}}}},"\/main.eventlog.list":{"post":{"summary":"Retrieve record list","description":"Retrieves a list of specified records.","tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","timestampX","severity","auditTypeId","moduleId","itemId","remoteAddr","userAgent","requestUri","siteId","userId","guestId","description"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"timestampX":{"type":"string","example":"ASC"},"auditTypeId":{"type":"string","example":"ASC"},"userId":{"type":"string","example":"ASC"},"guestId":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.main.eventlogdto"}}}}}}}}}},"\/main.eventlog.get":{"post":{"summary":"Retrieve record","description":"Retrieves a record by the specified ID.","tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","timestampX","severity","auditTypeId","moduleId","itemId","remoteAddr","userAgent","requestUri","siteId","userId","guestId","description"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.main.eventlogdto"}}}}}}}}}}},"\/main.eventlog.tail":{"post":{"summary":"Track records","description":"Retrieves the most recent records.","tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","timestampX","severity","auditTypeId","moduleId","itemId","remoteAddr","userAgent","requestUri","siteId","userId","guestId","description"]},"filter":{"type":"array"},"cursor":{"type":"object","example":{"field":"id","value":0,"order":"ASC"}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.main.eventlogdto"}}}}}}}}}},"\/note.collection.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"afterCursor":{"type":"object","properties":{"position":{"type":"integer"},"id":{"type":"integer"}}}}}}}}}},"responses":{"200":{"content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}},"nextCursor":{"type":"object","nullable":true,"properties":{"position":{"type":"integer"},"id":{"type":"integer"}}}}}}}}}}}}},"\/note.collection.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","name","position","policyLevel","createdBy","createdAt","updatedBy","updatedAt"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}}}}}}}}}}},"\/note.collection.add":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"name":{"type":"string"},"position":{"type":"integer","format":"int64"}},"required":["name"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}}}}}}}}}}},"\/note.collection.update":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.collectionitemdto"}}}}}}}}}}},"\/note.collection.archive":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.collection.delete":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.document.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","collectionId","parentId","title","markdown","position","createdBy","updatedBy","createdAt","updatedAt"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.documentitemdto"}}}}}}}}}}},"\/note.document.add":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"collectionId":{"type":"integer","format":"int64"},"parentId":{"type":"integer","format":"int64"},"title":{"type":"string"},"markdown":{"type":"string"}},"required":["collectionId","title"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.documentitemdto"}}}}}}}}}}},"\/note.document.update":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"overwrite":{"type":"boolean","example":true},"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"title":{"type":"string"},"markdown":{"type":"string"}}},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.documentitemdto"}}}}}}}}}}},"\/note.document.archive":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.document.delete":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/note.document.tree.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","required":["collectionId"],"properties":{"collectionId":{"type":"integer"}}}}}},"responses":{"200":{"content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.documenttreeitemdto"}},"truncated":{"type":"boolean"}}}}},"example":{"result":{"items":[{"id":10,"collectionId":123,"parentId":null,"title":"Введение","position":1,"children":[{"id":11,"collectionId":123,"parentId":10,"title":"Глава 1","position":1,"children":[]}]}],"truncated":false}}}}}}}},"\/note.document.search.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string"},"pagination":{"type":"object","properties":{"limit":{"type":"integer"}}}}}}}},"responses":{"200":{"content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.searchresultitemdto"}},"hasMore":{"type":"boolean"}}}}}}}}}}},"\/note.file.add":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"documentId":{"type":"integer","example":1},"fileName":{"type":"string","example":"string"},"fileContent":{"type":"string","example":"string"}},"required":["documentId","fileName","fileContent"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.fileitemdto"}}}}}}}}}}},"\/note.file.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"documentId":{"type":"integer","example":1}},"required":["id","documentId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.note.fileitemdto"}}}}}}}}}}},"\/rest.scope.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filterModule":{"type":"string","example":"string"},"filterController":{"type":"string","example":"string"},"filterMethod":{"type":"string","example":"string"}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/rest.documentation.openapi":{"post":{"summary":"Get Open API documentation","description":"Retrieves documentation in Open API format.","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"summary":"Get Open API documentation","description":"Retrieves documentation in Open API format.","tags":["rest"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/humanresources.employee.field.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/humanresources.employee.field.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/humanresources.node.field.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/humanresources.node.field.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/humanresources.node.member.field.list":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/humanresources.node.member.field.get":{"post":{"tags":["humanresources"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/mail.mailbox.field.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/mail.mailbox.field.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/mail.message.field.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/mail.message.field.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/mail.recipient.field.list":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/mail.recipient.field.get":{"post":{"tags":["mail"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/main.eventlog.field.list":{"post":{"tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/main.eventlog.field.get":{"post":{"tags":["main"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.collection.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.collection.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.document.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.document.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.document.tree.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.document.tree.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.document.search.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.document.search.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/note.file.field.list":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/note.file.field.get":{"post":{"tags":["note"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.app.scoperequest.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.app.scoperequest.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.incomingwebhook.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.incomingwebhook.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.access.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.access.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.embedding.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.embedding.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.local.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.local.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.personal.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.personal.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.application.placement.field.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/rest.application.placement.field.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/tasks.task.field.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/tasks.task.field.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/tasks.task.chat.message.field.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/tasks.task.chat.message.field.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/tasks.task.result.field.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/tasks.task.result.field.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/timeman.record.field.list":{"post":{"tags":["timeman"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/timeman.record.field.get":{"post":{"tags":["timeman"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.field.list":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.field.get":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.access.field.list":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.access.field.get":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.field.list":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.field.get":{"post":{"tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["name","type","title","description","validationRules","requiredGroups","filterable","sortable","editable","multiple","elementType"]}},"required":["name"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.dtofielddto"}}}}}}}}}}},"\/rest.app.scoperequest.add":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"scopes":{"type":"array"},"comment":{"type":"string"}},"required":["scopes","comment"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequestdto"}}}}}}}}}}},"\/rest.app.scoperequest.get":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","appId","scopes","status","currentState","comment","createdAt","history"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequestdto"}}}}}}}}}}},"\/rest.app.scoperequest.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","appId","scopes","status","currentState","comment","createdAt","history"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequestdto"}}}}}}}}}},"\/rest.application.getbyclientid":{"post":{"summary":"Returns the application by OAuth client ID","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"}}}}}}}}}}},"\/rest.application.list":{"post":{"summary":"Returns a list of installed applications","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"clientId":{"type":"string","example":"ASC"},"title":{"type":"string","example":"ASC"},"version":{"type":"string","example":"ASC"},"dateCreate":{"type":"string","example":"ASC"},"dateInstall":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}},"required":["attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"}}}}}}}}}},"\/rest.incomingwebhook.add":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"scopes":{"type":"array"},"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["url","scopes","title","active","userId","dateCreate","attributes"]}},"required":["title","scopes","attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.incomingwebhookdto"}}}}}}}}}}},"\/rest.incomingwebhook.update":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"scopes":{"type":"array"},"title":{"type":"string"}}}},"required":["id","fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.incomingwebhook.delete":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.incomingwebhook.list":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["url","scopes","title","active","userId","dateCreate","attributes"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"dateCreate":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.incomingwebhookdto"}}}}}}}}}},"\/rest.application.access.set":{"post":{"summary":"Sets the application access codes","description":"Replaces all existing access codes for the application with the provided ones.\n\t\tFor personal applications, the owner user access code is always added to the saved access codes.\n\t\tAccess codes define which users or groups can use the application.\n\t\tAdministrators and personal application owners always have access regardless of access codes.\n\t\tFor shared applications, if no access codes are set, the application is available to everyone.\n\t\tFor personal applications, if no access codes are set, only the owner and administrators have access.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022codes\u0022: [\u0022UA\u0022, \u0022D1\u0022]\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["clientId","codes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.access.delete":{"post":{"summary":"Deletes the application access codes","description":"Removes specified access codes from the application.\n\t\tOnly the provided codes are removed; other existing codes remain unchanged.\n\t\tAdministrators and personal application owners always have access regardless of access codes.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022codes\u0022: [\u0022D1\u0022]\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"codes":{"type":"array","items":{"type":"string"}}},"required":["clientId","codes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.access.reset":{"post":{"summary":"Resets the application access to default values","description":"Removes all custom access codes and restores the default access settings for the application.\n\t\tFor personal applications, the default is the owner and administrators only.\n\t\tFor shared applications, the default is no restrictions (available to everyone).\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.access.get":{"post":{"summary":"Returns the application access codes","description":"Returns the current access codes assigned to the application,\n\t\tincluding detailed information about each code (provider and display name).\n\t\tAdministrators and personal application owners always have access regardless of access codes.\n\t\tFor shared applications, if no access codes are set, the application is available to everyone.\n\t\tFor personal applications, if no access codes are set, only the owner and administrators have access.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["clientId","codes","codesDetails"]}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.accessdto"}}}}}}}}}}},"\/rest.application.embedding.list":{"post":{"summary":"Returns a list of application embedding areas","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"select":{"type":"array","items":{"type":"string"},"example":["id","userId","placement","handler","title","description","groupName","additional","options","languages"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object"},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.rest.embeddingdto"}}}}}}}}}},"\/rest.application.embedding.add":{"post":{"summary":"Adds a new application embedding area","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022placement\u0022: \u0022IM_CONTEXT_MENU\u0022,\n\t\t\t\u0022handler\u0022: \u0022https:\/\/example.com\/embed\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"placement":{"type":"string","example":"string"},"handler":{"type":"string","example":"string"},"userId":{"type":"integer","example":1},"title":{"type":"string","example":"string"},"description":{"type":"string","example":"string"},"groupName":{"type":"string","example":"string"},"settings":{"type":"array"},"languages":{"type":"array"}},"required":["clientId","placement","handler","userId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.embedding.delete":{"post":{"summary":"Deletes an existing embedding area","description":"If `handler` is provided, only the embedding with that handler will be deleted.\n\t\tIf `userId` is provided, only the embedding for that user will be deleted.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022,\n\t\t\t\u0022placement\u0022:\u0022IM_CONTEXT_MENU\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"placement":{"type":"string","example":"string"},"handler":{"type":"string","example":"string"},"userId":{"type":"integer","example":1}},"required":["clientId","placement"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/rest.application.local.install":{"post":{"summary":"Installs a local shared application","description":"Request example:\n\t\t{\n\t\t\t\u0022title\u0022: \u0022Test application\u0022,\n\t\t\t\u0022handlerUrl\u0022: \u0022https:\/\/example.com\u0022,\n\t\t\t\u0022scopes\u0022: [\u0022crm\u0022],\n\t\t\t\u0022mobile\u0022: false,\n\t\t\t\u0022menuTitles\u0022: {\n\t\t\t\t\u0022en\u0022: \u0022Test application\u0022\n\t\t\t}\n\t\t}\n\t\tIf `menuTitles` is omitted, the application is installed as API-only: \n\t\tit is not shown in the Bitrix24 interface, and its only way to access the portal is through the REST API, \n\t\tbut it can still add embeddings.","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"handlerUrl":{"type":"string","example":"string"},"scopes":{"type":"array"},"mobile":{"type":"boolean","example":true},"menuTitles":{"type":"array"},"clientId":{"type":"string","example":"string"},"applicationToken":{"type":"string","example":"string"},"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]}},"required":["title","handlerUrl","scopes","mobile","menuTitles","attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"},"oauthToken":{"$ref":"#\/components\/schemas\/bitrix.rest.oauthtokendto"}}}}}}}}}}},"\/rest.application.local.uninstall":{"post":{"summary":"Uninstalls an existing local shared application","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.personal.install":{"post":{"summary":"Installs a local personal application","description":"Request example:\n\t\t{\n\t\t\t\u0022title\u0022: \u0022Test application\u0022,\n\t\t\t\u0022handlerUrl\u0022: \u0022https:\/\/example.com\u0022,\n\t\t\t\u0022scopes\u0022: [\u0022crm\u0022],\n\t\t\t\u0022mobile\u0022: false,\n\t\t\t\u0022menuTitles\u0022: {\n\t\t\t\t\u0022en\u0022: \u0022Test application\u0022\n\t\t\t}\n\t\t}\n\t\tIf `menuTitles` is omitted, the application is installed as API-only: \n\t\tit is not shown in the Bitrix24 interface, and its only way to access the portal is through the REST API, \n\t\tbut it can still add embeddings.","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"handlerUrl":{"type":"string","example":"string"},"scopes":{"type":"array"},"mobile":{"type":"boolean","example":true},"menuTitles":{"type":"array"},"clientId":{"type":"string","example":"string"},"applicationToken":{"type":"string","example":"string"},"attributes":{"type":"array"},"select":{"type":"array","items":{"type":"string"},"example":["id","clientId","clientSecret","applicationToken","scopes","title","url","urlInstall","urlSettings","mobile","version","active","installed","dateCreate","dateInstall","attributes"]}},"required":["title","handlerUrl","scopes","mobile","menuTitles","attributes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.rest.appdto"},"oauthToken":{"$ref":"#\/components\/schemas\/bitrix.rest.oauthtokendto"}}}}}}}}}}},"\/rest.application.personal.uninstall":{"post":{"summary":"Uninstalls an existing local personal application","description":"Request example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"}},"required":["clientId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/rest.application.placement.list":{"post":{"summary":"Returns a list of available embedding areas","description":"If `scope` is provided, only placements for that scope are returned, and other parameters are ignored.\n\t\tIf `showAll` is `true`, all available placements are returned.\n\t\tIf `clientId` is provided, only placements available to that application are returned.\n\t\tIf no parameters are provided, all available placements are returned.\n\t\tRequest example:\n\t\t{\n\t\t\t\u0022clientId\u0022: \u0022local.69b9196bdbd793.03286491\u0022\n\t\t}","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","example":"string"},"scope":{"type":"string","example":"string"},"showAll":{"type":"boolean","example":true}},"required":["showAll"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/rest.portal.license.get":{"post":{"summary":"Gets portal license information","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"summary":"Gets portal license information","tags":["rest"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/tasks.task.update":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"responsibleId":{"type":"integer","format":"int64"},"deadline":{"type":"string","format":"date-time"},"needsControl":{"type":"boolean"},"startPlan":{"type":"string","format":"date-time"},"endPlan":{"type":"string","format":"date-time"},"fileIds":{"type":"array"},"checklist":{"type":"array"},"groupId":{"type":"integer","format":"int64"},"stageId":{"type":"integer","format":"int64"},"epicId":{"type":"integer","format":"int64"},"storyPoints":{"type":"integer","format":"int64"},"flowId":{"type":"integer","format":"int64"},"priority":{"type":"string"},"status":{"type":"string"},"statusChanged":{"type":"string","format":"date-time"},"parentId":{"type":"integer","format":"int64"},"containsChecklist":{"type":"boolean"},"containsSubTasks":{"type":"boolean"},"containsRelatedTasks":{"type":"boolean"},"containsGanttLinks":{"type":"boolean"},"containsPlacements":{"type":"boolean"},"containsResults":{"type":"boolean"},"numberOfReminders":{"type":"integer","format":"int64"},"chatId":{"type":"integer","format":"int64"},"plannedDuration":{"type":"integer","format":"int64"},"actualDuration":{"type":"integer","format":"int64"},"durationType":{"type":"string"},"started":{"type":"string","format":"date-time"},"estimatedTime":{"type":"integer","format":"int64"},"replicate":{"type":"boolean"},"changed":{"type":"string","format":"date-time"},"changedById":{"type":"integer","format":"int64"},"statusChangedById":{"type":"integer","format":"int64"},"closedById":{"type":"integer","format":"int64"},"closed":{"type":"string","format":"date-time"},"activity":{"type":"string","format":"date-time"},"guid":{"type":"string"},"xmlId":{"type":"string"},"exchangeId":{"type":"string"},"exchangeModified":{"type":"string"},"outlookVersion":{"type":"integer","format":"int64"},"mark":{"type":"string"},"allowsChangeDeadline":{"type":"boolean"},"allowsTimeTracking":{"type":"boolean"},"matchesWorkTime":{"type":"boolean"},"addInReport":{"type":"boolean"},"isMultitask":{"type":"boolean"},"siteId":{"type":"string"},"forkedByTemplateId":{"type":"integer","format":"int64"},"deadlineCount":{"type":"integer","format":"int64"},"declineReason":{"type":"string"},"forumTopicId":{"type":"integer","format":"int64"},"link":{"type":"string"},"rights":{"type":"array"},"archiveLink":{"type":"string"},"crmItemIds":{"type":"array"},"reminders":{"type":"array"},"requireResult":{"type":"boolean"},"matchesSubTasksTime":{"type":"boolean"},"autocompleteSubTasks":{"type":"boolean"},"allowsChangeDatePlan":{"type":"boolean"},"emailId":{"type":"integer","format":"int64"},"maxDeadlineChangeDate":{"type":"string","format":"date-time"},"maxDeadlineChanges":{"type":"integer","format":"int64"},"requireDeadlineChangeReason":{"type":"boolean"},"inFavorite":{"type":"array"},"inPin":{"type":"array"},"inGroupPin":{"type":"array"},"inMute":{"type":"array"},"dependsOn":{"type":"array"},"scenarios":{"type":"array"}}},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.delete":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.add":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"creatorId":{"type":"integer","format":"int64"},"responsibleId":{"type":"integer","format":"int64"},"deadline":{"type":"string","format":"date-time"},"needsControl":{"type":"boolean"},"startPlan":{"type":"string","format":"date-time"},"endPlan":{"type":"string","format":"date-time"},"fileIds":{"type":"array"},"checklist":{"type":"array"},"groupId":{"type":"integer","format":"int64"},"stageId":{"type":"integer","format":"int64"},"epicId":{"type":"integer","format":"int64"},"storyPoints":{"type":"integer","format":"int64"},"flowId":{"type":"integer","format":"int64"},"priority":{"type":"string"},"status":{"type":"string"},"statusChanged":{"type":"string","format":"date-time"},"parentId":{"type":"integer","format":"int64"},"containsChecklist":{"type":"boolean"},"containsSubTasks":{"type":"boolean"},"containsRelatedTasks":{"type":"boolean"},"containsGanttLinks":{"type":"boolean"},"containsPlacements":{"type":"boolean"},"containsResults":{"type":"boolean"},"numberOfReminders":{"type":"integer","format":"int64"},"chatId":{"type":"integer","format":"int64"},"plannedDuration":{"type":"integer","format":"int64"},"actualDuration":{"type":"integer","format":"int64"},"durationType":{"type":"string"},"started":{"type":"string","format":"date-time"},"estimatedTime":{"type":"integer","format":"int64"},"replicate":{"type":"boolean"},"changed":{"type":"string","format":"date-time"},"changedById":{"type":"integer","format":"int64"},"statusChangedById":{"type":"integer","format":"int64"},"closedById":{"type":"integer","format":"int64"},"closed":{"type":"string","format":"date-time"},"activity":{"type":"string","format":"date-time"},"guid":{"type":"string"},"xmlId":{"type":"string"},"exchangeId":{"type":"string"},"exchangeModified":{"type":"string"},"outlookVersion":{"type":"integer","format":"int64"},"mark":{"type":"string"},"allowsChangeDeadline":{"type":"boolean"},"allowsTimeTracking":{"type":"boolean"},"matchesWorkTime":{"type":"boolean"},"addInReport":{"type":"boolean"},"isMultitask":{"type":"boolean"},"siteId":{"type":"string"},"forkedByTemplateId":{"type":"integer","format":"int64"},"deadlineCount":{"type":"integer","format":"int64"},"declineReason":{"type":"string"},"forumTopicId":{"type":"integer","format":"int64"},"link":{"type":"string"},"rights":{"type":"array"},"archiveLink":{"type":"string"},"crmItemIds":{"type":"array"},"reminders":{"type":"array"},"requireResult":{"type":"boolean"},"matchesSubTasksTime":{"type":"boolean"},"autocompleteSubTasks":{"type":"boolean"},"allowsChangeDatePlan":{"type":"boolean"},"emailId":{"type":"integer","format":"int64"},"maxDeadlineChangeDate":{"type":"string","format":"date-time"},"maxDeadlineChanges":{"type":"integer","format":"int64"},"requireDeadlineChangeReason":{"type":"boolean"},"inFavorite":{"type":"array"},"inPin":{"type":"array"},"inGroupPin":{"type":"array"},"inMute":{"type":"array"},"dependsOn":{"type":"array"},"scenarios":{"type":"array"}},"required":["title","creatorId","responsibleId"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto"}}}}}}}}}}},"\/tasks.task.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"select":{"type":"array","items":{"type":"string"},"example":["id","title","description","creatorId","created","responsibleId","deadline","needsControl","startPlan","endPlan","fileIds","checklist","groupId","stageId","epicId","storyPoints","flowId","priority","status","statusChanged","parentId","containsChecklist","containsSubTasks","containsRelatedTasks","containsGanttLinks","containsPlacements","containsResults","numberOfReminders","chatId","plannedDuration","actualDuration","durationType","started","estimatedTime","replicate","changed","changedById","statusChangedById","closedById","closed","activity","guid","xmlId","exchangeId","exchangeModified","outlookVersion","mark","allowsChangeDeadline","allowsTimeTracking","matchesWorkTime","addInReport","isMultitask","siteId","forkedByTemplateId","deadlineCount","declineReason","forumTopicId","link","rights","archiveLink","crmItemIds","crmItems","reminders","elapsedTime","requireResult","matchesSubTasksTime","autocompleteSubTasks","allowsChangeDatePlan","emailId","maxDeadlineChangeDate","maxDeadlineChanges","requireDeadlineChangeReason","inFavorite","inPin","inGroupPin","inMute","source","dependsOn","scenarios"]}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto"}}}}}}}}}}},"\/tasks.task.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"select":{"type":"array","items":{"type":"string"},"example":["id","title","description","creatorId","created","responsibleId","deadline","needsControl","startPlan","endPlan","fileIds","checklist","groupId","stageId","epicId","storyPoints","flowId","priority","status","statusChanged","parentId","containsChecklist","containsSubTasks","containsRelatedTasks","containsGanttLinks","containsPlacements","containsResults","numberOfReminders","chatId","plannedDuration","actualDuration","durationType","started","estimatedTime","replicate","changed","changedById","statusChangedById","closedById","closed","activity","guid","xmlId","exchangeId","exchangeModified","outlookVersion","mark","allowsChangeDeadline","allowsTimeTracking","matchesWorkTime","addInReport","isMultitask","siteId","forkedByTemplateId","deadlineCount","declineReason","forumTopicId","link","rights","archiveLink","crmItemIds","crmItems","reminders","elapsedTime","requireResult","matchesSubTasksTime","autocompleteSubTasks","allowsChangeDatePlan","emailId","maxDeadlineChangeDate","maxDeadlineChanges","requireDeadlineChangeReason","inFavorite","inPin","inGroupPin","inMute","source","dependsOn","scenarios"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"title":{"type":"string","example":"ASC"},"creatorId":{"type":"string","example":"ASC"},"created":{"type":"string","example":"ASC"},"responsibleId":{"type":"string","example":"ASC"},"deadline":{"type":"string","example":"ASC"},"startPlan":{"type":"string","example":"ASC"},"endPlan":{"type":"string","example":"ASC"},"groupId":{"type":"string","example":"ASC"},"priority":{"type":"string","example":"ASC"},"status":{"type":"string","example":"ASC"},"started":{"type":"string","example":"ASC"},"estimatedTime":{"type":"string","example":"ASC"},"changed":{"type":"string","example":"ASC"},"closed":{"type":"string","example":"ASC"},"activity":{"type":"string","example":"ASC"},"mark":{"type":"string","example":"ASC"},"allowsChangeDeadline":{"type":"string","example":"ASC"},"allowsTimeTracking":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto"}}}}}}}}}},"\/tasks.task.access.get":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1}},"required":["id"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/tasks.task.file.attach":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"taskId":{"type":"integer","example":1},"fileIds":{"type":"array"}},"required":["taskId","fileIds"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.chat.message.send":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"taskId":{"type":"integer","format":"int64"},"text":{"type":"string"}},"required":["taskId","text"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.result.add":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"taskId":{"type":"integer","format":"int64"},"text":{"type":"string"}},"required":["taskId","text"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}}},"\/tasks.task.result.addfromchatmessage":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"text":{"type":"string"},"messageId":{"type":"integer","format":"int64"}},"required":["messageId"]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}}},"\/tasks.task.result.update":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"fields":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}},"required":["fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"item":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}}},"\/tasks.task.result.delete":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":1},"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/tasks.task.result.list":{"post":{"tags":["tasks"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"select":{"type":"array","items":{"type":"string"},"example":["id","taskId","text","authorId","createdAt","updatedAt","status","fileIds","rights","messageId"]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"authorId":{"type":"string","example":"ASC"},"createdAt":{"type":"string","example":"ASC"},"updatedAt":{"type":"string","example":"ASC"},"status":{"type":"string","example":"ASC"},"messageId":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.resultdto"}}}}}}}}}},"\/timeman.record.list":{"post":{"tags":["timeman"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filter":{"type":"array","example":[["id","\u003E=",1],["id",1],["id","in",[1,2,3]]]},"select":{"type":"array","items":{"type":"string"},"example":["id","userId","startTime","endTime","duration","breakLength","state","isApproved"]},"order":{"type":"object","properties":{"id":{"type":"string","example":"ASC"},"userId":{"type":"string","example":"ASC"},"startTime":{"type":"string","example":"ASC"},"endTime":{"type":"string","example":"ASC"},"duration":{"type":"string","example":"ASC"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","example":2},"limit":{"type":"integer","example":20},"offset":{"type":"integer","example":0}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.timeman.recorddto"}}}}}}}}}},"\/vibecodeconnector.catalog.item.add":{"post":{"description":"Creates a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"string"},"type":{"type":"string","example":"string"},"accessType":{"type":"string","example":"string"},"description":{"type":"string","example":"string"},"editUrl":{"type":"string","example":"string"},"viewUrl":{"type":"string","example":"string"},"chatId":{"type":"integer","example":1},"externalId":{"type":"string","example":"string"},"iss":{"type":"string","example":"string"}},"required":["title","type","accessType"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"integer","format":"int64"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.update":{"post":{"description":"Updates editable fields of a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1},"fields":{"type":"object","properties":{"title":{"type":"string"},"accessType":{"type":"string"},"description":{"type":"string"},"editUrl":{"type":"string"},"viewUrl":{"type":"string"},"chatId":{"type":"integer","format":"int64"},"externalId":{"type":"string"}}}},"required":["catalogItemId","fields"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.delete":{"post":{"description":"Deletes a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1}},"required":["catalogItemId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.access.set":{"post":{"description":"Replaces all ACL access codes for a catalog item owned by the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1},"accessCodes":{"type":"array"}},"required":["catalogItemId","accessCodes"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.set":{"post":{"description":"Pins a catalog item for the current REST user","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1}},"required":["catalogItemId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/vibecodeconnector.catalog.item.pin.delete":{"post":{"description":"Removes the current REST user pin from a catalog item","tags":["vibecodeconnector"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"catalogItemId":{"type":"integer","example":1}},"required":["catalogItemId"]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object","properties":{"result":{"type":"boolean"}}}}}}}}}}},"\/batch":{"post":{"tags":[],"requestBody":{"content":{"application\/json":{"schema":{"type":"object"}}}},"responses":[],"summary":"Batch request","description":"Executes a batch call of multiple methods inside a single request."}},"\/documentation":{"post":{"summary":"Get Open API documentation","description":"Retrieves documentation in Open API format.","tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":[]}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}},"get":{"summary":"Get Open API documentation","description":"Retrieves documentation in Open API format.","tags":["rest"],"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}},"\/scopes":{"post":{"tags":["rest"],"requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"filterModule":{"type":"string","example":"string"},"filterController":{"type":"string","example":"string"},"filterMethod":{"type":"string","example":"string"}}}}}},"responses":{"200":{"description":"Success response","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}}}}}},"components":{"schemas":{"bitrix.humanresources.employeedto":{"type":"object","properties":{"userId":{"type":"integer","format":"int64","title":"userId"},"name":{"type":"string","title":"name"},"workPosition":{"type":"string","title":"workPosition"},"avatar":{"type":"string","title":"avatar"},"url":{"type":"string","title":"url"},"departments":{"type":"array","title":"departments"},"teams":{"type":"array","title":"teams"}}},"bitrix.humanresources.nodedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"type":{"type":"string","title":"type"},"structureId":{"type":"integer","format":"int64","title":"structureId"},"parentId":{"type":"integer","format":"int64","title":"parentId"},"description":{"type":"string","title":"description"},"accessCode":{"type":"string","title":"accessCode"},"userCount":{"type":"integer","format":"int64","title":"userCount"},"colorName":{"type":"string","title":"colorName"},"xmlId":{"type":"string","title":"xmlId"},"createdAt":{"type":"string","title":"createdAt"},"updatedAt":{"type":"string","title":"updatedAt"},"members":{"type":"array","title":"members"}}},"bitrix.humanresources.nodememberdto":{"type":"object","properties":{"userId":{"type":"integer","format":"int64","title":"userId"},"name":{"type":"string","title":"name"},"workPosition":{"type":"string","title":"workPosition"},"role":{"type":"string","title":"role"},"avatar":{"type":"string","title":"avatar"},"url":{"type":"string","title":"url"}}},"bitrix.mail.mailboxdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"email":{"type":"string","title":"email"},"senderName":{"type":"string","title":"senderName"}}},"bitrix.mail.messagedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"mailboxId":{"type":"integer","format":"int64","title":"mailboxId"},"mailboxEmail":{"type":"string","title":"mailboxEmail"},"subject":{"type":"string","title":"subject"},"from":{"type":"string","title":"from"},"to":{"type":"string","title":"to"},"cc":{"type":"string","title":"cc"},"date":{"type":"string","title":"date"},"isSeen":{"type":"boolean","title":"isSeen"},"hasAttachments":{"type":"boolean","title":"hasAttachments"},"url":{"type":"string","title":"url"},"bindings":{"type":"array","title":"bindings"},"body":{"type":"string","title":"body"}}},"bitrix.mail.recipientdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"email":{"type":"string","title":"email"},"name":{"type":"string","title":"name"}}},"bitrix.main.eventlogdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"Record ID","description":"Unique event log entry ID."},"timestampX":{"type":"string","format":"date-time","title":"Event time","description":"Event date and time."},"severity":{"type":"string","title":"Severity","description":"Event severity level (INFO, WARNING, ERROR, etc.)"},"auditTypeId":{"type":"string","title":"Event type","description":"Audit event type ID."},"moduleId":{"type":"string","title":"Module","description":"The module that produced the event."},"itemId":{"type":"string","title":"Item ID","description":"The ID of an item associated with the event."},"remoteAddr":{"type":"string","title":"IP address","description":"The IP address of a user associated with the event."},"userAgent":{"type":"string","title":"User Agent","description":"The User Agent string: the user\u0027s browser and OS."},"requestUri":{"type":"string","title":"Request URL","description":"The URL that was used to initiate the request."},"siteId":{"type":"string","title":"Site ID","description":"The ID of a site associated with the event."},"userId":{"type":"integer","format":"int64","title":"User ID","description":"The ID of a user associated with the event."},"guestId":{"type":"integer","format":"int64","title":"Guest ID","description":"The ID of a guest (i.e. a user who didn\u0027t log in)."},"description":{"type":"string","title":"Event description","description":"Detailed event description."}}},"bitrix.note.collectionitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"position":{"type":"integer","format":"int64","title":"position"},"policyLevel":{"type":"string","title":"policyLevel"},"createdBy":{"type":"integer","format":"int64","title":"createdBy"},"createdAt":{"type":"string","title":"createdAt"},"updatedBy":{"type":"integer","format":"int64","title":"updatedBy"},"updatedAt":{"type":"string","title":"updatedAt"}}},"bitrix.note.documentitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"collectionId":{"type":"integer","format":"int64","title":"collectionId"},"parentId":{"type":"integer","format":"int64","title":"parentId"},"title":{"type":"string","title":"title"},"markdown":{"type":"string","title":"markdown"},"position":{"type":"integer","format":"int64","title":"position"},"createdBy":{"type":"integer","format":"int64","title":"createdBy"},"updatedBy":{"type":"integer","format":"int64","title":"updatedBy"},"createdAt":{"type":"string","title":"createdAt"},"updatedAt":{"type":"string","title":"updatedAt"}}},"bitrix.note.documenttreeitemdto":{"type":"object","properties":{"id":{"type":"integer"},"collectionId":{"type":"integer"},"parentId":{"type":"integer","nullable":true},"title":{"type":"string"},"position":{"type":"integer"},"children":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.note.documenttreeitemdto"}}}},"bitrix.note.searchresultitemdto":{"type":"object","properties":{"documentId":{"type":"integer","format":"int64","title":"documentId"},"collectionId":{"type":"integer","format":"int64","title":"collectionId"},"title":{"type":"string","title":"title"},"score":{"type":"float","title":"score"},"snippet":{"type":"string","title":"snippet"},"sharedAccess":{"type":"boolean","title":"sharedAccess"}}},"bitrix.note.fileitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"documentId":{"type":"integer","format":"int64","title":"documentId"},"name":{"type":"string","title":"name"},"size":{"type":"integer","format":"int64","title":"size"},"mimeType":{"type":"string","title":"mimeType"},"assetType":{"type":"string","title":"assetType"},"assetMarkdown":{"type":"string","title":"assetMarkdown"}}},"bitrix.rest.dtofielddto":{"type":"object","properties":{"name":{"type":"string","title":"name"},"type":{"type":"string","title":"type"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"validationRules":{"type":"array","title":"validationRules"},"requiredGroups":{"type":"array","title":"requiredGroups"},"filterable":{"type":"boolean","title":"filterable"},"sortable":{"type":"boolean","title":"sortable"},"editable":{"type":"boolean","title":"editable"},"multiple":{"type":"boolean","title":"multiple"},"elementType":{"type":"string","title":"elementType"}}},"bitrix.rest.customdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"entityId":{"type":"string","title":"entityId"},"name":{"type":"string","title":"name"},"userTypeId":{"type":"string","title":"userTypeId"},"xmlId":{"type":"string","title":"xmlId"},"sort":{"type":"integer","format":"int64","title":"sort"},"isMultiple":{"type":"boolean","title":"isMultiple"},"isMandatory":{"type":"boolean","title":"isMandatory"},"showFilter":{"type":"string","title":"showFilter"},"showInList":{"type":"boolean","title":"showInList"},"editInList":{"type":"boolean","title":"editInList"},"isSearchable":{"type":"boolean","title":"isSearchable"},"settings":{"type":"array","title":"settings"},"editFormLabel":{"title":"editFormLabel"},"listColumnLabel":{"title":"listColumnLabel"},"listFilterLabel":{"title":"listFilterLabel"},"errorMessage":{"title":"errorMessage"},"helpMessage":{"title":"helpMessage"}}},"bitrix.rest.enumdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"entityId":{"type":"string","title":"entityId"},"fieldId":{"type":"integer","format":"int64","title":"fieldId"},"value":{"type":"string","title":"value"},"isDefault":{"type":"boolean","title":"isDefault"},"sort":{"type":"integer","format":"int64","title":"sort"},"xmlId":{"type":"string","title":"xmlId"}}},"bitrix.rest.scoperequestdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"appId":{"type":"integer","format":"int64","title":"appId"},"scopes":{"type":"array","title":"scopes"},"status":{"type":"string","title":"status"},"currentState":{"$ref":"#\/components\/schemas\/bitrix.rest.scoperequeststatusdto","title":"currentState"},"comment":{"type":"string","title":"comment"},"createdAt":{"type":"string","format":"date-time","title":"createdAt"},"history":{"title":"history"}}},"bitrix.rest.scoperequeststatusdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"requestId":{"type":"integer","format":"int64","title":"requestId"},"status":{"type":"string","title":"status"},"comment":{"type":"string","title":"comment"},"createdAt":{"type":"string","format":"date-time","title":"createdAt"}}},"bitrix.rest.appdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"Application inner identification"},"clientId":{"type":"string","title":"Application client ID"},"clientSecret":{"type":"string","title":"Application client secret"},"applicationToken":{"type":"string","title":"Application token (shared secret used to authenticate webhook callbacks from the portal)"},"scopes":{"type":"array","title":"Application scopes"},"title":{"type":"string","title":"Application title"},"url":{"type":"string","title":"Handler URL"},"urlInstall":{"type":"string","title":"Installation URL"},"urlSettings":{"type":"string","title":"Settings URL"},"mobile":{"type":"boolean","title":"Mobile application flag"},"version":{"type":"string","title":"Application version"},"active":{"type":"boolean","title":"Application active flag"},"installed":{"type":"boolean","title":"Application installed flag"},"dateCreate":{"type":"string","title":"Date of creation"},"dateInstall":{"type":"string","title":"Date of installation"},"attributes":{"type":"array","title":"Application external attributes"}}},"bitrix.rest.incomingwebhookdto":{"type":"object","properties":{"url":{"type":"string","title":"Webhook handler URL"},"scopes":{"type":"array","title":"Webhook scopes"},"title":{"type":"string","title":"Webhook title"},"active":{"type":"boolean","title":"Active flag"},"userId":{"type":"integer","format":"int64","title":"Owner user id"},"dateCreate":{"type":"string","title":"Date of creation"},"attributes":{"type":"array","title":"Incoming webhook external attributes"}}},"bitrix.rest.accessdto":{"type":"object","properties":{"clientId":{"type":"string","title":"Application client ID"},"codes":{"type":"array","title":"Application access codes"},"codesDetails":{"type":"array","title":"Access code details with provider and display name"}}},"bitrix.rest.embeddingdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"ID"},"userId":{"type":"integer","format":"int64","title":"User ID"},"placement":{"type":"string","title":"Placement name"},"handler":{"type":"string","title":"Placement Handler URI"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"groupName":{"type":"string","title":"groupName"},"additional":{"type":"string","title":"additional"},"options":{"type":"array","title":"options"},"languages":{"title":"languages"}}},"bitrix.rest.oauthtokendto":{"type":"object","properties":{"accessToken":{"type":"string","title":"OAuth access token"},"refreshToken":{"type":"string","title":"OAuth refresh token"},"expiresIn":{"type":"integer","format":"int64","title":"Access token lifetime in seconds"},"serverEndpoint":{"type":"string","title":"REST server endpoint"}}},"bitrix.rest.placementdto":{"type":"object","properties":{"placement":{"type":"string","title":"placement"}}},"bitrix.tasks.taskdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"creatorId":{"type":"integer","format":"int64","title":"creatorId"},"creator":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"creator"},"created":{"type":"string","format":"date-time","title":"created"},"responsibleId":{"type":"integer","format":"int64","title":"responsibleId"},"responsible":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"responsible"},"deadline":{"type":"string","format":"date-time","title":"deadline"},"needsControl":{"type":"boolean","title":"needsControl"},"startPlan":{"type":"string","format":"date-time","title":"startPlan"},"endPlan":{"type":"string","format":"date-time","title":"endPlan"},"fileIds":{"type":"array","title":"fileIds"},"checklist":{"type":"array","title":"checklist"},"groupId":{"type":"integer","format":"int64","title":"groupId"},"group":{"$ref":"#\/components\/schemas\/bitrix.tasks.groupdto","title":"group"},"stageId":{"type":"integer","format":"int64","title":"stageId"},"stage":{"$ref":"#\/components\/schemas\/bitrix.tasks.stagedto","title":"stage"},"epicId":{"type":"integer","format":"int64","title":"epicId"},"storyPoints":{"type":"integer","format":"int64","title":"storyPoints"},"flowId":{"type":"integer","format":"int64","title":"flowId"},"flow":{"$ref":"#\/components\/schemas\/bitrix.tasks.flowdto","title":"flow"},"priority":{"type":"string","title":"priority"},"status":{"type":"string","title":"status"},"statusChanged":{"type":"string","format":"date-time","title":"statusChanged"},"accomplices":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto"},"title":"accomplices"},"auditors":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto"},"title":"auditors"},"parentId":{"type":"integer","format":"int64","title":"parentId"},"parent":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto","title":"parent"},"containsChecklist":{"type":"boolean","title":"containsChecklist"},"containsSubTasks":{"type":"boolean","title":"containsSubTasks"},"containsRelatedTasks":{"type":"boolean","title":"containsRelatedTasks"},"containsGanttLinks":{"type":"boolean","title":"containsGanttLinks"},"containsPlacements":{"type":"boolean","title":"containsPlacements"},"containsResults":{"type":"boolean","title":"containsResults"},"numberOfReminders":{"type":"integer","format":"int64","title":"numberOfReminders"},"chatId":{"type":"integer","format":"int64","title":"chatId"},"chat":{"$ref":"#\/components\/schemas\/bitrix.tasks.chatdto","title":"chat"},"plannedDuration":{"type":"integer","format":"int64","title":"plannedDuration"},"actualDuration":{"type":"integer","format":"int64","title":"actualDuration"},"durationType":{"type":"string","title":"durationType"},"started":{"type":"string","format":"date-time","title":"started"},"estimatedTime":{"type":"integer","format":"int64","title":"estimatedTime"},"replicate":{"type":"boolean","title":"replicate"},"changed":{"type":"string","format":"date-time","title":"changed"},"changedById":{"type":"integer","format":"int64","title":"changedById"},"changedBy":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"changedBy"},"statusChangedById":{"type":"integer","format":"int64","title":"statusChangedById"},"statusChangedBy":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"statusChangedBy"},"closedById":{"type":"integer","format":"int64","title":"closedById"},"closedBy":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"closedBy"},"closed":{"type":"string","format":"date-time","title":"closed"},"activity":{"type":"string","format":"date-time","title":"activity"},"guid":{"type":"string","title":"guid"},"xmlId":{"type":"string","title":"xmlId"},"exchangeId":{"type":"string","title":"exchangeId"},"exchangeModified":{"type":"string","title":"exchangeModified"},"outlookVersion":{"type":"integer","format":"int64","title":"outlookVersion"},"mark":{"type":"string","title":"mark"},"allowsChangeDeadline":{"type":"boolean","title":"allowsChangeDeadline"},"allowsTimeTracking":{"type":"boolean","title":"allowsTimeTracking"},"matchesWorkTime":{"type":"boolean","title":"matchesWorkTime"},"addInReport":{"type":"boolean","title":"addInReport"},"isMultitask":{"type":"boolean","title":"isMultitask"},"siteId":{"type":"string","title":"siteId"},"forkedByTemplateId":{"type":"integer","format":"int64","title":"forkedByTemplateId"},"forkedByTemplate":{"$ref":"#\/components\/schemas\/bitrix.tasks.templatedto","title":"forkedByTemplate"},"deadlineCount":{"type":"integer","format":"int64","title":"deadlineCount"},"declineReason":{"type":"string","title":"declineReason"},"forumTopicId":{"type":"integer","format":"int64","title":"forumTopicId"},"tags":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.tagdto"},"title":"tags"},"link":{"type":"string","title":"link"},"userFields":{"type":"array","items":{"$ref":"#\/components\/schemas\/bitrix.tasks.userfielddto"},"title":"userFields"},"rights":{"type":"array","title":"rights"},"archiveLink":{"type":"string","title":"archiveLink"},"crmItemIds":{"type":"array","title":"crmItemIds"},"crmItems":{"$ref":"#\/components\/schemas\/bitrix.tasks.crmitemdto","title":"crmItems"},"reminders":{"type":"array","title":"reminders"},"elapsedTime":{"$ref":"#\/components\/schemas\/bitrix.tasks.elapsedtimedto","title":"elapsedTime"},"requireResult":{"type":"boolean","title":"requireResult"},"matchesSubTasksTime":{"type":"boolean","title":"matchesSubTasksTime"},"autocompleteSubTasks":{"type":"boolean","title":"autocompleteSubTasks"},"allowsChangeDatePlan":{"type":"boolean","title":"allowsChangeDatePlan"},"emailId":{"type":"integer","format":"int64","title":"emailId"},"email":{"$ref":"#\/components\/schemas\/bitrix.tasks.emaildto","title":"email"},"maxDeadlineChangeDate":{"type":"string","format":"date-time","title":"maxDeadlineChangeDate"},"maxDeadlineChanges":{"type":"integer","format":"int64","title":"maxDeadlineChanges"},"requireDeadlineChangeReason":{"type":"boolean","title":"requireDeadlineChangeReason"},"inFavorite":{"type":"array","title":"inFavorite"},"inPin":{"type":"array","title":"inPin"},"inGroupPin":{"type":"array","title":"inGroupPin"},"inMute":{"type":"array","title":"inMute"},"source":{"$ref":"#\/components\/schemas\/bitrix.tasks.sourcedto","title":"source"},"dependsOn":{"type":"array","title":"dependsOn"},"scenarios":{"type":"array","title":"scenarios"}}},"bitrix.tasks.userdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"role":{"type":"string","title":"role"},"image":{"$ref":"#\/components\/schemas\/bitrix.tasks.filedto","title":"image"},"gender":{"type":"string","title":"gender"},"email":{"type":"string","title":"email"},"externalAuthId":{"type":"string","title":"externalAuthId"},"rights":{"type":"array","title":"rights"}}},"bitrix.tasks.filedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"src":{"type":"string","title":"src"},"name":{"type":"string","title":"name"},"width":{"type":"integer","format":"int64","title":"width"},"height":{"type":"integer","format":"int64","title":"height"},"size":{"type":"integer","format":"int64","title":"size"},"subDir":{"type":"string","title":"subDir"},"contentType":{"type":"string","title":"contentType"},"file":{"type":"array","title":"file"}}},"bitrix.tasks.groupdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"image":{"$ref":"#\/components\/schemas\/bitrix.tasks.filedto","title":"image"},"type":{"type":"string","title":"type"},"isVisible":{"type":"boolean","title":"isVisible"}}},"bitrix.tasks.stagedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"title":{"type":"string","title":"title"},"color":{"type":"string","title":"color"}}},"bitrix.tasks.flowdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"}}},"bitrix.tasks.chatdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"entityId":{"type":"integer","format":"int64","title":"entityId"},"entityType":{"type":"string","title":"entityType"}}},"bitrix.tasks.templatedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"task":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto","title":"task"},"title":{"type":"string","title":"title"},"description":{"type":"string","title":"description"},"creator":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"creator"},"responsibleCollection":{"type":"array","title":"responsibleCollection"},"deadlineAfterTs":{"type":"integer","format":"int64","title":"deadlineAfterTs"},"startDatePlanTs":{"type":"integer","format":"int64","title":"startDatePlanTs"},"endDatePlanTs":{"type":"integer","format":"int64","title":"endDatePlanTs"},"replicate":{"type":"boolean","title":"replicate"},"fileIds":{"type":"array","title":"fileIds"},"checklist":{"type":"array","title":"checklist"},"group":{"$ref":"#\/components\/schemas\/bitrix.tasks.groupdto","title":"group"},"priority":{"type":"string","title":"priority"},"accomplices":{"type":"array","title":"accomplices"},"auditors":{"type":"array","title":"auditors"},"parent":{"$ref":"#\/components\/schemas\/bitrix.tasks.templatedto","title":"parent"},"replicateParams":{"$ref":"#\/components\/schemas\/bitrix.tasks.replicateparamsdto","title":"replicateParams"}}},"bitrix.tasks.replicateparamsdto":{"type":"object","properties":{"period":{"type":"string","title":"period"},"everyDay":{"type":"string","title":"everyDay"},"workdayOnly":{"type":"string","title":"workdayOnly"},"dailyMonthInterval":{"type":"string","title":"dailyMonthInterval"},"everyWeek":{"type":"string","title":"everyWeek"},"monthlyType":{"type":"string","title":"monthlyType"},"monthlyDayNum":{"type":"string","title":"monthlyDayNum"},"monthlyMonthNum1":{"type":"string","title":"monthlyMonthNum1"},"monthlyWeekDayNum":{"type":"string","title":"monthlyWeekDayNum"},"monthlyWeekDay":{"type":"string","title":"monthlyWeekDay"},"monthlyMonthNum2":{"type":"string","title":"monthlyMonthNum2"},"yearlyType":{"type":"string","title":"yearlyType"},"yearlyDayNum":{"type":"string","title":"yearlyDayNum"},"yearlyMonth1":{"type":"string","title":"yearlyMonth1"},"yearlyWeekDayNum":{"type":"string","title":"yearlyWeekDayNum"},"yearlyWeekDay":{"type":"string","title":"yearlyWeekDay"},"yearlyMonth2":{"type":"string","title":"yearlyMonth2"},"time":{"type":"string","title":"time"},"timezoneOffset":{"type":"string","title":"timezoneOffset"},"startDate":{"type":"string","title":"startDate"},"repeatTill":{"type":"string","title":"repeatTill"},"endDate":{"type":"string","title":"endDate"},"times":{"type":"string","title":"times"}}},"bitrix.tasks.tagdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"name":{"type":"string","title":"name"},"ownerId":{"type":"integer","format":"int64","title":"ownerId"},"owner":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"owner"},"groupId":{"type":"integer","format":"int64","title":"groupId"},"group":{"$ref":"#\/components\/schemas\/bitrix.tasks.groupdto","title":"group"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"task":{"$ref":"#\/components\/schemas\/bitrix.tasks.taskdto","title":"task"}}},"bitrix.tasks.userfielddto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"key":{"type":"string","title":"key"},"value":{"title":"value"}}},"bitrix.tasks.crmitemdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"type":{"type":"string","title":"type"},"title":{"type":"string","title":"title"}}},"bitrix.tasks.elapsedtimedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"userId":{"type":"integer","format":"int64","title":"userId"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"minutes":{"type":"integer","format":"int64","title":"minutes"},"seconds":{"type":"integer","format":"int64","title":"seconds"},"source":{"type":"string","title":"source"},"text":{"type":"string","title":"text"},"createdAtTs":{"type":"integer","format":"int64","title":"createdAtTs"},"startTs":{"type":"integer","format":"int64","title":"startTs"},"stopTs":{"type":"integer","format":"int64","title":"stopTs"}}},"bitrix.tasks.emaildto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"mailboxId":{"type":"integer","format":"int64","title":"mailboxId"},"title":{"type":"string","title":"title"},"body":{"type":"string","title":"body"},"from":{"type":"string","title":"from"},"dateTs":{"type":"integer","format":"int64","title":"dateTs"},"link":{"type":"string","title":"link"}}},"bitrix.tasks.sourcedto":{"type":"object","properties":{"type":{"type":"string","title":"type"},"data":{"type":"array","title":"data"}}},"bitrix.tasks.messagedto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"text":{"type":"string","title":"text"}}},"bitrix.tasks.resultdto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"taskId":{"type":"integer","format":"int64","title":"taskId"},"text":{"type":"string","title":"text"},"authorId":{"type":"integer","format":"int64","title":"authorId"},"author":{"$ref":"#\/components\/schemas\/bitrix.tasks.userdto","title":"author"},"createdAt":{"type":"string","format":"date-time","title":"createdAt"},"updatedAt":{"type":"string","format":"date-time","title":"updatedAt"},"status":{"type":"string","title":"status"},"fileIds":{"type":"array","title":"fileIds"},"rights":{"type":"array","title":"rights"},"messageId":{"type":"integer","format":"int64","title":"messageId"}}},"bitrix.timeman.recorddto":{"type":"object","properties":{"id":{"type":"integer","format":"int64","title":"id"},"userId":{"type":"integer","format":"int64","title":"userId"},"startTime":{"type":"string","format":"date-time","title":"startTime"},"endTime":{"type":"string","format":"date-time","title":"endTime"},"duration":{"type":"integer","format":"int64","title":"duration"},"breakLength":{"type":"integer","format":"int64","title":"breakLength"},"state":{"$ref":"#\/components\/schemas\/bitrix.timeman.recordstatedto","title":"state"},"isApproved":{"type":"boolean","title":"isApproved"}}},"bitrix.timeman.recordstatedto":{"type":"object","properties":{"status":{"type":"string","title":"status"},"recommendedCloseTime":{"type":"integer","format":"int64","title":"recommendedCloseTime"}}},"bitrix.vibecodeconnector.catalogitemdto":{"type":"object","properties":{"catalogItemId":{"type":"integer","format":"int64","title":"Catalog item identifier"},"title":{"type":"string","title":"Title"},"type":{"type":"string","title":"Item type"},"accessType":{"type":"string","title":"Access type"},"description":{"type":"string","title":"Description"},"editUrl":{"type":"string","title":"Edit URL"},"viewUrl":{"type":"string","title":"View URL"},"chatId":{"type":"integer","format":"int64","title":"Chat identifier"},"externalId":{"type":"string","title":"External identifier"},"ownerId":{"type":"integer","format":"int64","title":"Owner user identifier"},"color":{"type":"string","title":"Color"},"createdAt":{"type":"string","title":"Date of creation (ISO-8601)"},"updatedAt":{"type":"string","title":"Date of last update (ISO-8601)"}}},"bitrix.vibecodeconnector.accessdto":{"type":"object","properties":{"catalogItemId":{"type":"integer","format":"int64","title":"Catalog item identifier"},"accessCodes":{"type":"array","title":"Catalog item access codes"}}}}}} \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a0fbb94a..61e782e5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -405,6 +405,21 @@ ./tests/Integration/Services/Timeman/RecordField/Service/RecordFieldTest.php ./tests/Integration/Services/Timeman/RecordField/Result/RecordFieldItemResultTest.php + + ./tests/Integration/Services/Note/ + + + ./tests/Integration/Services/Note/Collection/Service/ + ./tests/Integration/Services/Note/Collection/Result/ + + + ./tests/Integration/Services/Note/Document/Service/ + ./tests/Integration/Services/Note/Document/Result/ + + + ./tests/Integration/Services/Note/File/Service/ + ./tests/Integration/Services/Note/File/Result/ + ./tests/Integration/Services/Biconnector/ diff --git a/src/Services/Note/Collection/Result/ArchivedCollectionResult.php b/src/Services/Note/Collection/Result/ArchivedCollectionResult.php new file mode 100644 index 00000000..bfc7a698 --- /dev/null +++ b/src/Services/Note/Collection/Result/ArchivedCollectionResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class ArchivedCollectionResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function isSuccess(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['result'] ?? false); + } +} diff --git a/src/Services/Note/Collection/Result/CollectionFieldItemResult.php b/src/Services/Note/Collection/Result/CollectionFieldItemResult.php new file mode 100644 index 00000000..1a64dc2d --- /dev/null +++ b/src/Services/Note/Collection/Result/CollectionFieldItemResult.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * Field metadata entry returned by `note.collection.field.get` / `note.collection.field.list`. + * + * @property-read string $name + * @property-read string $type + * @property-read string $title + * @property-read string|null $description + * @property-read array|null $validationRules + * @property-read array|null $requiredGroups + * @property-read bool $filterable + * @property-read bool $sortable + * @property-read bool $editable + * @property-read bool $multiple + * @property-read string|null $elementType + */ +class CollectionFieldItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Collection/Result/CollectionFieldResult.php b/src/Services/Note/Collection/Result/CollectionFieldResult.php new file mode 100644 index 00000000..5c398544 --- /dev/null +++ b/src/Services/Note/Collection/Result/CollectionFieldResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class CollectionFieldResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function field(): CollectionFieldItemResult + { + return new CollectionFieldItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/Collection/Result/CollectionFieldsResult.php b/src/Services/Note/Collection/Result/CollectionFieldsResult.php new file mode 100644 index 00000000..05bc372c --- /dev/null +++ b/src/Services/Note/Collection/Result/CollectionFieldsResult.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class CollectionFieldsResult extends AbstractResult +{ + /** + * @return CollectionFieldItemResult[] + * @throws BaseException + */ + public function getFields(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new CollectionFieldItemResult($item); + } + + return $items; + } +} diff --git a/src/Services/Note/Collection/Result/CollectionItemResult.php b/src/Services/Note/Collection/Result/CollectionItemResult.php new file mode 100644 index 00000000..0cd87433 --- /dev/null +++ b/src/Services/Note/Collection/Result/CollectionItemResult.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Attributes\OpenApiEntity; +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionSelectBuilder; +use Carbon\CarbonImmutable; + +/** + * A single knowledge base ("collection") returned by `note.collection.*`. + * + * @property-read int $id + * @property-read string $name + * @property-read int|null $position + * @property-read string|null $policyLevel + * @property-read int|null $createdBy + * @property-read CarbonImmutable $createdAt + * @property-read int|null $updatedBy + * @property-read CarbonImmutable $updatedAt + */ +#[OpenApiEntity( + entityKey: 'bitrix.note.collectionitemdto', + selectBuilder: CollectionSelectBuilder::class, +)] +class CollectionItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Collection/Result/CollectionResult.php b/src/Services/Note/Collection/Result/CollectionResult.php new file mode 100644 index 00000000..86b71146 --- /dev/null +++ b/src/Services/Note/Collection/Result/CollectionResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class CollectionResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function collection(): CollectionItemResult + { + return new CollectionItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/Collection/Result/CollectionsResult.php b/src/Services/Note/Collection/Result/CollectionsResult.php new file mode 100644 index 00000000..9bcf21f2 --- /dev/null +++ b/src/Services/Note/Collection/Result/CollectionsResult.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionListCursor; + +class CollectionsResult extends AbstractResult +{ + /** + * @return CollectionItemResult[] + * @throws BaseException + */ + public function getCollections(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new CollectionItemResult($item); + } + + return $items; + } + + /** + * @throws BaseException + */ + public function getNextCursor(): ?CollectionListCursor + { + $cursor = $this->getCoreResponse()->getResponseData()->getResult()['nextCursor'] ?? null; + + return $cursor === null ? null : CollectionListCursor::fromArray($cursor); + } +} diff --git a/src/Services/Note/Collection/Result/DeletedCollectionResult.php b/src/Services/Note/Collection/Result/DeletedCollectionResult.php new file mode 100644 index 00000000..29fdc97e --- /dev/null +++ b/src/Services/Note/Collection/Result/DeletedCollectionResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DeletedCollectionResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function isSuccess(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['result'] ?? false); + } +} diff --git a/src/Services/Note/Collection/Service/Collection.php b/src/Services/Note/Collection/Service/Collection.php new file mode 100644 index 00000000..ef0d26e2 --- /dev/null +++ b/src/Services/Note/Collection/Service/Collection.php @@ -0,0 +1,281 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Service; + +use Bitrix24\SDK\Attributes\ApiEndpointMetadata; +use Bitrix24\SDK\Attributes\ApiServiceMetadata; +use Bitrix24\SDK\Core\Contracts\ApiVersion; +use Bitrix24\SDK\Core\Contracts\SelectBuilderInterface; +use Bitrix24\SDK\Core\Credentials\Scope; +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Filters\FilterBuilderInterface; +use Bitrix24\SDK\Services\AbstractService; +use Bitrix24\SDK\Services\Note\Collection\Result\ArchivedCollectionResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionFieldResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionFieldsResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionsResult; +use Bitrix24\SDK\Services\Note\Collection\Result\DeletedCollectionResult; + +#[ApiServiceMetadata(new Scope(['note']))] +class Collection extends AbstractService +{ + /** + * Creates a new knowledge base (collection). + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-add.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.add', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-add.html', + 'Creates a new knowledge base.', + ApiVersion::v3 + )] + public function add(string $name, ?int $position = null): CollectionResult + { + return new CollectionResult( + $this->core->call( + 'note.collection.add', + [ + 'fields' => array_filter( + [ + 'name' => $name, + 'position' => $position, + ], + static fn (mixed $value): bool => $value !== null + ), + ], + ApiVersion::v3 + ) + ); + } + + /** + * Archives a knowledge base. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-archive.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.archive', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-archive.html', + 'Archives a knowledge base.', + ApiVersion::v3 + )] + public function archive(int $id): ArchivedCollectionResult + { + return new ArchivedCollectionResult( + $this->core->call('note.collection.archive', ['id' => $id], ApiVersion::v3) + ); + } + + /** + * Deletes a knowledge base by id or by filter. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-delete.html + * + * @param array|FilterBuilderInterface $filter Filter conditions (REST v3 format) + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.delete', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-delete.html', + 'Deletes a knowledge base.', + ApiVersion::v3 + )] + public function delete(?int $id = null, array|FilterBuilderInterface $filter = []): DeletedCollectionResult + { + if ($filter instanceof FilterBuilderInterface) { + $filter = $filter->toArray(); + } + + return new DeletedCollectionResult( + $this->core->call( + 'note.collection.delete', + array_filter( + [ + 'id' => $id, + 'filter' => $filter, + ], + static fn (mixed $value): bool => $value !== null && $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of a single `note.collection` field. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-field-get.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.field.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-field-get.html', + 'Returns metadata of a single collection field.', + ApiVersion::v3 + )] + public function fieldGet(string $name, array $select = []): CollectionFieldResult + { + return new CollectionFieldResult( + $this->core->call( + 'note.collection.field.get', + array_filter( + [ + 'name' => $name, + 'select' => $select, + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of all `note.collection` fields. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-field-list.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.field.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-field-list.html', + 'Returns metadata of all collection fields.', + ApiVersion::v3 + )] + public function fieldList(array $select = []): CollectionFieldsResult + { + return new CollectionFieldsResult( + $this->core->call( + 'note.collection.field.list', + array_filter(['select' => $select], static fn (mixed $value): bool => $value !== []), + ApiVersion::v3 + ) + ); + } + + /** + * Returns a single knowledge base by id. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-get.html + * + * @param array|CollectionSelectBuilder $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-get.html', + 'Returns a single knowledge base by id.', + ApiVersion::v3 + )] + public function get(int $id, array|CollectionSelectBuilder $select = []): CollectionResult + { + if ($select instanceof SelectBuilderInterface) { + $select = $select->buildSelect(); + } + + return new CollectionResult( + $this->core->call( + 'note.collection.get', + array_filter( + [ + 'id' => $id, + 'select' => $select, + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns a cursor-paginated list of knowledge bases available to the user. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-list.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-list.html', + 'Returns a list of knowledge bases available to the user.', + ApiVersion::v3 + )] + public function list(?CollectionListPagination $pagination = null): CollectionsResult + { + return new CollectionsResult( + $this->core->call( + 'note.collection.list', + $pagination !== null ? ['pagination' => $pagination->toArray()] : [], + ApiVersion::v3 + ) + ); + } + + /** + * Updates a knowledge base by id or by filter. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-update.html + * + * @param array $fields fields to update, e.g. ['name' => 'New name'] + * @param array|FilterBuilderInterface $filter Filter conditions (REST v3 format) + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.collection.update', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-update.html', + 'Updates a knowledge base.', + ApiVersion::v3 + )] + public function update(?int $id, array $fields, array|FilterBuilderInterface $filter = []): CollectionResult + { + if ($filter instanceof FilterBuilderInterface) { + $filter = $filter->toArray(); + } + + return new CollectionResult( + $this->core->call( + 'note.collection.update', + array_filter( + [ + 'id' => $id, + 'fields' => $fields, + 'filter' => $filter, + ], + static fn (mixed $value): bool => $value !== null && $value !== [] + ), + ApiVersion::v3 + ) + ); + } +} diff --git a/src/Services/Note/Collection/Service/CollectionListCursor.php b/src/Services/Note/Collection/Service/CollectionListCursor.php new file mode 100644 index 00000000..f88cff04 --- /dev/null +++ b/src/Services/Note/Collection/Service/CollectionListCursor.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Service; + +/** + * The `afterCursor` object documented for `note.collection.list`. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-list.html + */ +final class CollectionListCursor +{ + public function __construct( + private readonly int $position, + private readonly int $id, + ) { + } + + /** + * @return array{position: int, id: int} + */ + public function toArray(): array + { + return [ + 'position' => $this->position, + 'id' => $this->id, + ]; + } + + /** + * @param array{position: int, id: int} $data + */ + public static function fromArray(array $data): self + { + return new self((int)$data['position'], (int)$data['id']); + } +} diff --git a/src/Services/Note/Collection/Service/CollectionListPagination.php b/src/Services/Note/Collection/Service/CollectionListPagination.php new file mode 100644 index 00000000..c4ff93f7 --- /dev/null +++ b/src/Services/Note/Collection/Service/CollectionListPagination.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Service; + +/** + * The `Pagination` object documented for `note.collection.list`: page size plus an + * optional cursor pointing at the last item of the previous page. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/collection/note-collection-list.html + */ +final class CollectionListPagination +{ + public function __construct( + private readonly int $limit = 50, + private readonly ?CollectionListCursor $afterCursor = null, + ) { + } + + /** + * @return array{limit?: int, afterCursor?: array{position: int, id: int}} + */ + public function toArray(): array + { + return array_filter( + [ + 'limit' => $this->limit, + 'afterCursor' => $this->afterCursor?->toArray(), + ], + static fn (mixed $value): bool => $value !== null + ); + } +} diff --git a/src/Services/Note/Collection/Service/CollectionSelectBuilder.php b/src/Services/Note/Collection/Service/CollectionSelectBuilder.php new file mode 100644 index 00000000..7290a966 --- /dev/null +++ b/src/Services/Note/Collection/Service/CollectionSelectBuilder.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +// This class was automatically generated by the b24-dev:generate-select-builder command. +// Source: OpenAPI schema snapshot (docs/open-api/openapi.json). +// To regenerate, run: php bin/console b24-dev:generate-select-builder bitrix.note.collectionitemdto + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Collection\Service; + +use Bitrix24\SDK\Services\AbstractSelectBuilder; + +class CollectionSelectBuilder extends AbstractSelectBuilder +{ + public function __construct() + { + $this->select[] = 'id'; + } + + public function createdAt(): self + { + $this->select[] = 'createdAt'; + return $this; + } + + public function createdBy(): self + { + $this->select[] = 'createdBy'; + return $this; + } + + public function name(): self + { + $this->select[] = 'name'; + return $this; + } + + public function policyLevel(): self + { + $this->select[] = 'policyLevel'; + return $this; + } + + public function position(): self + { + $this->select[] = 'position'; + return $this; + } + + public function updatedAt(): self + { + $this->select[] = 'updatedAt'; + return $this; + } + + public function updatedBy(): self + { + $this->select[] = 'updatedBy'; + return $this; + } + +} diff --git a/src/Services/Note/Document/Result/ArchivedDocumentResult.php b/src/Services/Note/Document/Result/ArchivedDocumentResult.php new file mode 100644 index 00000000..acbae536 --- /dev/null +++ b/src/Services/Note/Document/Result/ArchivedDocumentResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class ArchivedDocumentResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function isSuccess(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['result'] ?? false); + } +} diff --git a/src/Services/Note/Document/Result/DeletedDocumentResult.php b/src/Services/Note/Document/Result/DeletedDocumentResult.php new file mode 100644 index 00000000..8b1cd4e1 --- /dev/null +++ b/src/Services/Note/Document/Result/DeletedDocumentResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DeletedDocumentResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function isSuccess(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['result'] ?? false); + } +} diff --git a/src/Services/Note/Document/Result/DocumentFieldItemResult.php b/src/Services/Note/Document/Result/DocumentFieldItemResult.php new file mode 100644 index 00000000..69d715d4 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentFieldItemResult.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * Field metadata entry returned by `note.document.field.get` / `note.document.field.list`. + * + * @property-read string $name + * @property-read string $type + * @property-read string $title + * @property-read string|null $description + * @property-read array|null $validationRules + * @property-read array|null $requiredGroups + * @property-read bool $filterable + * @property-read bool $sortable + * @property-read bool $editable + * @property-read bool $multiple + * @property-read string|null $elementType + */ +class DocumentFieldItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Document/Result/DocumentFieldResult.php b/src/Services/Note/Document/Result/DocumentFieldResult.php new file mode 100644 index 00000000..30b94447 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentFieldResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentFieldResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function field(): DocumentFieldItemResult + { + return new DocumentFieldItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/Document/Result/DocumentFieldsResult.php b/src/Services/Note/Document/Result/DocumentFieldsResult.php new file mode 100644 index 00000000..e167393e --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentFieldsResult.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentFieldsResult extends AbstractResult +{ + /** + * @return DocumentFieldItemResult[] + * @throws BaseException + */ + public function getFields(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new DocumentFieldItemResult($item); + } + + return $items; + } +} diff --git a/src/Services/Note/Document/Result/DocumentItemResult.php b/src/Services/Note/Document/Result/DocumentItemResult.php new file mode 100644 index 00000000..31d6c83f --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentItemResult.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Attributes\OpenApiEntity; +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; +use Bitrix24\SDK\Services\Note\Document\Service\DocumentSelectBuilder; +use Carbon\CarbonImmutable; + +/** + * A single knowledge-base document returned by `note.document.*`. + * + * @property-read int $id + * @property-read int $collectionId + * @property-read int|null $parentId + * @property-read string $title + * @property-read string|null $markdown + * @property-read int|null $position + * @property-read int|null $createdBy + * @property-read int|null $updatedBy + * @property-read CarbonImmutable $createdAt + * @property-read CarbonImmutable $updatedAt + */ +#[OpenApiEntity( + entityKey: 'bitrix.note.documentitemdto', + selectBuilder: DocumentSelectBuilder::class, +)] +class DocumentItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Document/Result/DocumentResult.php b/src/Services/Note/Document/Result/DocumentResult.php new file mode 100644 index 00000000..3489ff04 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function document(): DocumentItemResult + { + return new DocumentItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/Document/Result/DocumentSearchFieldItemResult.php b/src/Services/Note/Document/Result/DocumentSearchFieldItemResult.php new file mode 100644 index 00000000..b9ad31a2 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentSearchFieldItemResult.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * Field metadata entry returned by `note.document.search.field.get` / `note.document.search.field.list`. + * + * @property-read string $name + * @property-read string $type + * @property-read string $title + * @property-read string|null $description + * @property-read array|null $validationRules + * @property-read array|null $requiredGroups + * @property-read bool $filterable + * @property-read bool $sortable + * @property-read bool $editable + * @property-read bool $multiple + * @property-read string|null $elementType + */ +class DocumentSearchFieldItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Document/Result/DocumentSearchFieldResult.php b/src/Services/Note/Document/Result/DocumentSearchFieldResult.php new file mode 100644 index 00000000..446bf7f2 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentSearchFieldResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentSearchFieldResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function field(): DocumentSearchFieldItemResult + { + return new DocumentSearchFieldItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/Document/Result/DocumentSearchFieldsResult.php b/src/Services/Note/Document/Result/DocumentSearchFieldsResult.php new file mode 100644 index 00000000..8ff63c9c --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentSearchFieldsResult.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentSearchFieldsResult extends AbstractResult +{ + /** + * @return DocumentSearchFieldItemResult[] + * @throws BaseException + */ + public function getFields(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new DocumentSearchFieldItemResult($item); + } + + return $items; + } +} diff --git a/src/Services/Note/Document/Result/DocumentSearchItemResult.php b/src/Services/Note/Document/Result/DocumentSearchItemResult.php new file mode 100644 index 00000000..1243f69f --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentSearchItemResult.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * A single full-text search hit returned by `note.document.search.list`. + * + * @property-read int $documentId + * @property-read int $collectionId + * @property-read string $title + * @property-read float $score + * @property-read string|null $snippet + * @property-read bool $sharedAccess + */ +class DocumentSearchItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Document/Result/DocumentSearchResult.php b/src/Services/Note/Document/Result/DocumentSearchResult.php new file mode 100644 index 00000000..acaefb37 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentSearchResult.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentSearchResult extends AbstractResult +{ + /** + * @return DocumentSearchItemResult[] + * @throws BaseException + */ + public function getItems(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new DocumentSearchItemResult($item); + } + + return $items; + } + + /** + * @throws BaseException + */ + public function hasMore(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['hasMore'] ?? false); + } +} diff --git a/src/Services/Note/Document/Result/DocumentTreeFieldItemResult.php b/src/Services/Note/Document/Result/DocumentTreeFieldItemResult.php new file mode 100644 index 00000000..e987c156 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentTreeFieldItemResult.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * Field metadata entry returned by `note.document.tree.field.get` / `note.document.tree.field.list`. + * + * @property-read string $name + * @property-read string $type + * @property-read string $title + * @property-read string|null $description + * @property-read array|null $validationRules + * @property-read array|null $requiredGroups + * @property-read bool $filterable + * @property-read bool $sortable + * @property-read bool $editable + * @property-read bool $multiple + * @property-read string|null $elementType + */ +class DocumentTreeFieldItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Document/Result/DocumentTreeFieldResult.php b/src/Services/Note/Document/Result/DocumentTreeFieldResult.php new file mode 100644 index 00000000..dd47091e --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentTreeFieldResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentTreeFieldResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function field(): DocumentTreeFieldItemResult + { + return new DocumentTreeFieldItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/Document/Result/DocumentTreeFieldsResult.php b/src/Services/Note/Document/Result/DocumentTreeFieldsResult.php new file mode 100644 index 00000000..823db64d --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentTreeFieldsResult.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentTreeFieldsResult extends AbstractResult +{ + /** + * @return DocumentTreeFieldItemResult[] + * @throws BaseException + */ + public function getFields(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new DocumentTreeFieldItemResult($item); + } + + return $items; + } +} diff --git a/src/Services/Note/Document/Result/DocumentTreeItemResult.php b/src/Services/Note/Document/Result/DocumentTreeItemResult.php new file mode 100644 index 00000000..4ecc3f7a --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentTreeItemResult.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * A single node of the document tree returned by `note.document.tree.list`. + * + * `children` is recursive: each element is itself a `DocumentTreeItemResult`. + * + * @property-read int $id + * @property-read int $collectionId + * @property-read int|null $parentId + * @property-read string $title + * @property-read int|null $position + * @property-read array $children + */ +class DocumentTreeItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/Document/Result/DocumentTreeResult.php b/src/Services/Note/Document/Result/DocumentTreeResult.php new file mode 100644 index 00000000..1775a349 --- /dev/null +++ b/src/Services/Note/Document/Result/DocumentTreeResult.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class DocumentTreeResult extends AbstractResult +{ + /** + * @return DocumentTreeItemResult[] + * @throws BaseException + */ + public function getItems(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new DocumentTreeItemResult($item); + } + + return $items; + } + + /** + * @throws BaseException + */ + public function isTruncated(): bool + { + return (bool)($this->getCoreResponse()->getResponseData()->getResult()['truncated'] ?? false); + } +} diff --git a/src/Services/Note/Document/Service/Document.php b/src/Services/Note/Document/Service/Document.php new file mode 100644 index 00000000..c83a35cf --- /dev/null +++ b/src/Services/Note/Document/Service/Document.php @@ -0,0 +1,437 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Service; + +use Bitrix24\SDK\Attributes\ApiEndpointMetadata; +use Bitrix24\SDK\Attributes\ApiServiceMetadata; +use Bitrix24\SDK\Core\Contracts\ApiVersion; +use Bitrix24\SDK\Core\Contracts\SelectBuilderInterface; +use Bitrix24\SDK\Core\Credentials\Scope; +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Filters\FilterBuilderInterface; +use Bitrix24\SDK\Services\AbstractService; +use Bitrix24\SDK\Services\Note\Document\Result\ArchivedDocumentResult; +use Bitrix24\SDK\Services\Note\Document\Result\DeletedDocumentResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentFieldResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentFieldsResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchFieldResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchFieldsResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeFieldResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeFieldsResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeResult; + +#[ApiServiceMetadata(new Scope(['note']))] +class Document extends AbstractService +{ + /** + * Creates a new document inside a knowledge base. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-add.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.add', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-add.html', + 'Creates a new document inside a knowledge base.', + ApiVersion::v3 + )] + public function add(int $collectionId, string $title, ?int $parentId = null, ?string $markdown = null): DocumentResult + { + return new DocumentResult( + $this->core->call( + 'note.document.add', + [ + 'fields' => array_filter( + [ + 'collectionId' => $collectionId, + 'title' => $title, + 'parentId' => $parentId, + 'markdown' => $markdown, + ], + static fn (mixed $value): bool => $value !== null + ), + ], + ApiVersion::v3 + ) + ); + } + + /** + * Archives a document. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-archive.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.archive', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-archive.html', + 'Archives a document.', + ApiVersion::v3 + )] + public function archive(int $id): ArchivedDocumentResult + { + return new ArchivedDocumentResult( + $this->core->call('note.document.archive', ['id' => $id], ApiVersion::v3) + ); + } + + /** + * Deletes a document by id or by filter. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-delete.html + * + * @param array|FilterBuilderInterface $filter Filter conditions (REST v3 format) + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.delete', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-delete.html', + 'Deletes a document.', + ApiVersion::v3 + )] + public function delete(?int $id = null, array|FilterBuilderInterface $filter = []): DeletedDocumentResult + { + if ($filter instanceof FilterBuilderInterface) { + $filter = $filter->toArray(); + } + + return new DeletedDocumentResult( + $this->core->call( + 'note.document.delete', + array_filter( + [ + 'id' => $id, + 'filter' => $filter, + ], + static fn (mixed $value): bool => $value !== null && $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of a single `note.document` field. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-field-get.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.field.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-field-get.html', + 'Returns metadata of a single document field.', + ApiVersion::v3 + )] + public function fieldGet(string $name, array $select = []): DocumentFieldResult + { + return new DocumentFieldResult( + $this->core->call( + 'note.document.field.get', + array_filter( + [ + 'name' => $name, + 'select' => $select, + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of all `note.document` fields. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-field-list.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.field.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-field-list.html', + 'Returns metadata of all document fields.', + ApiVersion::v3 + )] + public function fieldList(array $select = []): DocumentFieldsResult + { + return new DocumentFieldsResult( + $this->core->call( + 'note.document.field.list', + array_filter(['select' => $select], static fn (mixed $value): bool => $value !== []), + ApiVersion::v3 + ) + ); + } + + /** + * Returns a single document by id. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-get.html + * + * @param array|DocumentSelectBuilder $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-get.html', + 'Returns a single document by id.', + ApiVersion::v3 + )] + public function get(int $id, array|DocumentSelectBuilder $select = []): DocumentResult + { + if ($select instanceof SelectBuilderInterface) { + $select = $select->buildSelect(); + } + + return new DocumentResult( + $this->core->call( + 'note.document.get', + array_filter( + [ + 'id' => $id, + 'select' => $select, + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Updates a document by id or by filter. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-update.html + * + * @param array $fields fields to update, e.g. ['title' => 'New title'] + * @param array|FilterBuilderInterface $filter Filter conditions (REST v3 format) + * @param bool|null $overwrite when true, replaces markdown instead of merging it + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.update', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-update.html', + 'Updates a document.', + ApiVersion::v3 + )] + public function update( + ?int $id, + array $fields, + array|FilterBuilderInterface $filter = [], + ?bool $overwrite = null + ): DocumentResult { + if ($filter instanceof FilterBuilderInterface) { + $filter = $filter->toArray(); + } + + return new DocumentResult( + $this->core->call( + 'note.document.update', + array_filter( + [ + 'id' => $id, + 'fields' => $fields, + 'filter' => $filter, + 'overwrite' => $overwrite, + ], + static fn (mixed $value): bool => $value !== null && $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the document tree of a knowledge base. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-tree-list.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.tree.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-tree-list.html', + 'Returns the document tree of a knowledge base.', + ApiVersion::v3 + )] + public function treeList(int $collectionId): DocumentTreeResult + { + return new DocumentTreeResult( + $this->core->call('note.document.tree.list', ['collectionId' => $collectionId], ApiVersion::v3) + ); + } + + /** + * Returns the metadata of a single `note.document.tree` field. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-tree-field-get.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.tree.field.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-tree-field-get.html', + 'Returns metadata of a single document tree field.', + ApiVersion::v3 + )] + public function treeFieldGet(string $name, array $select = []): DocumentTreeFieldResult + { + return new DocumentTreeFieldResult( + $this->core->call( + 'note.document.tree.field.get', + array_filter( + [ + 'name' => $name, + 'select' => $select, + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of all `note.document.tree` fields. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-tree-field-list.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.tree.field.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-tree-field-list.html', + 'Returns metadata of all document tree fields.', + ApiVersion::v3 + )] + public function treeFieldList(array $select = []): DocumentTreeFieldsResult + { + return new DocumentTreeFieldsResult( + $this->core->call( + 'note.document.tree.field.list', + array_filter(['select' => $select], static fn (mixed $value): bool => $value !== []), + ApiVersion::v3 + ) + ); + } + + /** + * Performs a full-text search across documents. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-search-list.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.search.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-search-list.html', + 'Performs a full-text search across documents.', + ApiVersion::v3 + )] + public function searchList(string $query, int $limit = 0): DocumentSearchResult + { + return new DocumentSearchResult( + $this->core->call( + 'note.document.search.list', + array_filter( + [ + 'query' => $query, + 'pagination' => array_filter(['limit' => $limit], static fn (int $v): bool => $v !== 0), + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of a single `note.document.search` field. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-search-field-get.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.search.field.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-search-field-get.html', + 'Returns metadata of a single document search field.', + ApiVersion::v3 + )] + public function searchFieldGet(string $name, array $select = []): DocumentSearchFieldResult + { + return new DocumentSearchFieldResult( + $this->core->call( + 'note.document.search.field.get', + array_filter( + [ + 'name' => $name, + 'select' => $select, + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of all `note.document.search` fields. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-search-field-list.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.document.search.field.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/document/note-document-search-field-list.html', + 'Returns metadata of all document search fields.', + ApiVersion::v3 + )] + public function searchFieldList(array $select = []): DocumentSearchFieldsResult + { + return new DocumentSearchFieldsResult( + $this->core->call( + 'note.document.search.field.list', + array_filter(['select' => $select], static fn (mixed $value): bool => $value !== []), + ApiVersion::v3 + ) + ); + } +} diff --git a/src/Services/Note/Document/Service/DocumentSelectBuilder.php b/src/Services/Note/Document/Service/DocumentSelectBuilder.php new file mode 100644 index 00000000..02b3dabd --- /dev/null +++ b/src/Services/Note/Document/Service/DocumentSelectBuilder.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +// This class was automatically generated by the b24-dev:generate-select-builder command. +// Source: OpenAPI schema snapshot (docs/open-api/openapi.json). +// To regenerate, run: php bin/console b24-dev:generate-select-builder bitrix.note.documentitemdto + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\Document\Service; + +use Bitrix24\SDK\Services\AbstractSelectBuilder; + +class DocumentSelectBuilder extends AbstractSelectBuilder +{ + public function __construct() + { + $this->select[] = 'id'; + } + + public function collectionId(): self + { + $this->select[] = 'collectionId'; + return $this; + } + + public function createdAt(): self + { + $this->select[] = 'createdAt'; + return $this; + } + + public function createdBy(): self + { + $this->select[] = 'createdBy'; + return $this; + } + + public function markdown(): self + { + $this->select[] = 'markdown'; + return $this; + } + + public function parentId(): self + { + $this->select[] = 'parentId'; + return $this; + } + + public function position(): self + { + $this->select[] = 'position'; + return $this; + } + + public function title(): self + { + $this->select[] = 'title'; + return $this; + } + + public function updatedAt(): self + { + $this->select[] = 'updatedAt'; + return $this; + } + + public function updatedBy(): self + { + $this->select[] = 'updatedBy'; + return $this; + } + +} diff --git a/src/Services/Note/File/Result/FileFieldItemResult.php b/src/Services/Note/File/Result/FileFieldItemResult.php new file mode 100644 index 00000000..f3aa1f8a --- /dev/null +++ b/src/Services/Note/File/Result/FileFieldItemResult.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\File\Result; + +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * Field metadata entry returned by `note.file.field.get` / `note.file.field.list`. + * + * @property-read string $name + * @property-read string $type + * @property-read string $title + * @property-read string|null $description + * @property-read array|null $validationRules + * @property-read array|null $requiredGroups + * @property-read bool $filterable + * @property-read bool $sortable + * @property-read bool $editable + * @property-read bool $multiple + * @property-read string|null $elementType + */ +class FileFieldItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/File/Result/FileFieldResult.php b/src/Services/Note/File/Result/FileFieldResult.php new file mode 100644 index 00000000..9d3cf988 --- /dev/null +++ b/src/Services/Note/File/Result/FileFieldResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\File\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class FileFieldResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function field(): FileFieldItemResult + { + return new FileFieldItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/File/Result/FileFieldsResult.php b/src/Services/Note/File/Result/FileFieldsResult.php new file mode 100644 index 00000000..f409b168 --- /dev/null +++ b/src/Services/Note/File/Result/FileFieldsResult.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\File\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class FileFieldsResult extends AbstractResult +{ + /** + * @return FileFieldItemResult[] + * @throws BaseException + */ + public function getFields(): array + { + $items = []; + foreach ($this->getCoreResponse()->getResponseData()->getResult()['items'] as $item) { + $items[] = new FileFieldItemResult($item); + } + + return $items; + } +} diff --git a/src/Services/Note/File/Result/FileItemResult.php b/src/Services/Note/File/Result/FileItemResult.php new file mode 100644 index 00000000..98625b67 --- /dev/null +++ b/src/Services/Note/File/Result/FileItemResult.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\File\Result; + +use Bitrix24\SDK\Attributes\OpenApiEntity; +use Bitrix24\SDK\Core\Result\AbstractAnnotatedItem; + +/** + * A single document file attachment returned by `note.file.*`. + * + * @property-read int $id + * @property-read int $documentId + * @property-read string $name + * @property-read int|null $size + * @property-read string|null $mimeType + * @property-read string|null $assetType + * @property-read string|null $assetMarkdown + */ +#[OpenApiEntity(entityKey: 'bitrix.note.fileitemdto')] +class FileItemResult extends AbstractAnnotatedItem +{ +} diff --git a/src/Services/Note/File/Result/FileResult.php b/src/Services/Note/File/Result/FileResult.php new file mode 100644 index 00000000..53ddbeaa --- /dev/null +++ b/src/Services/Note/File/Result/FileResult.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\File\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Result\AbstractResult; + +class FileResult extends AbstractResult +{ + /** + * @throws BaseException + */ + public function file(): FileItemResult + { + return new FileItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); + } +} diff --git a/src/Services/Note/File/Service/File.php b/src/Services/Note/File/Service/File.php new file mode 100644 index 00000000..ea125860 --- /dev/null +++ b/src/Services/Note/File/Service/File.php @@ -0,0 +1,138 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note\File\Service; + +use Bitrix24\SDK\Attributes\ApiEndpointMetadata; +use Bitrix24\SDK\Attributes\ApiServiceMetadata; +use Bitrix24\SDK\Core\Contracts\ApiVersion; +use Bitrix24\SDK\Core\Credentials\Scope; +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\AbstractService; +use Bitrix24\SDK\Services\Note\File\Result\FileFieldResult; +use Bitrix24\SDK\Services\Note\File\Result\FileFieldsResult; +use Bitrix24\SDK\Services\Note\File\Result\FileResult; + +#[ApiServiceMetadata(new Scope(['note']))] +class File extends AbstractService +{ + /** + * Uploads a file attachment to a document. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-add.html + * + * @param string $fileContent Base64-encoded binary file content + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.file.add', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-add.html', + 'Uploads a file to a document.', + ApiVersion::v3 + )] + public function add(int $documentId, string $fileName, string $fileContent): FileResult + { + return new FileResult( + $this->core->call( + 'note.file.add', + [ + 'documentId' => $documentId, + 'fileName' => $fileName, + 'fileContent' => $fileContent, + ], + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of a single `note.file` field. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-field-get.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.file.field.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-field-get.html', + 'Returns metadata of a single file field.', + ApiVersion::v3 + )] + public function fieldGet(string $name, array $select = []): FileFieldResult + { + return new FileFieldResult( + $this->core->call( + 'note.file.field.get', + array_filter( + [ + 'name' => $name, + 'select' => $select, + ], + static fn (mixed $value): bool => $value !== [] + ), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the metadata of all `note.file` fields. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-field-list.html + * + * @param array $select + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.file.field.list', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-field-list.html', + 'Returns metadata of all file fields.', + ApiVersion::v3 + )] + public function fieldList(array $select = []): FileFieldsResult + { + return new FileFieldsResult( + $this->core->call( + 'note.file.field.list', + array_filter(['select' => $select], static fn (mixed $value): bool => $value !== []), + ApiVersion::v3 + ) + ); + } + + /** + * Returns the document file data and a Markdown block for insertion into the document. + * + * @link https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-get.html + * + * @throws BaseException + * @throws TransportException + */ + #[ApiEndpointMetadata( + 'note.file.get', + 'https://apidocs.bitrix24.com/api-reference/rest-v3/note/file/note-file-get.html', + 'Returns the document file data and a Markdown block for insertion into the document.', + ApiVersion::v3 + )] + public function get(int $id, int $documentId): FileResult + { + return new FileResult( + $this->core->call('note.file.get', ['id' => $id, 'documentId' => $documentId], ApiVersion::v3) + ); + } +} diff --git a/src/Services/Note/NoteServiceBuilder.php b/src/Services/Note/NoteServiceBuilder.php new file mode 100644 index 00000000..567bee10 --- /dev/null +++ b/src/Services/Note/NoteServiceBuilder.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Services\Note; + +use Bitrix24\SDK\Attributes\ApiServiceBuilderMetadata; +use Bitrix24\SDK\Core\Credentials\Scope; +use Bitrix24\SDK\Services\AbstractServiceBuilder; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Services\Note\File\Service\File; + +#[ApiServiceBuilderMetadata(new Scope(['note']))] +class NoteServiceBuilder extends AbstractServiceBuilder +{ + public function collection(): Collection + { + if (!isset($this->serviceCache[__METHOD__])) { + $this->serviceCache[__METHOD__] = new Collection( + $this->core, + $this->log + ); + } + + return $this->serviceCache[__METHOD__]; + } + + public function document(): Document + { + if (!isset($this->serviceCache[__METHOD__])) { + $this->serviceCache[__METHOD__] = new Document( + $this->core, + $this->log + ); + } + + return $this->serviceCache[__METHOD__]; + } + + public function file(): File + { + if (!isset($this->serviceCache[__METHOD__])) { + $this->serviceCache[__METHOD__] = new File( + $this->core, + $this->log + ); + } + + return $this->serviceCache[__METHOD__]; + } +} diff --git a/src/Services/ServiceBuilder.php b/src/Services/ServiceBuilder.php index 04cced9e..8cf88891 100644 --- a/src/Services/ServiceBuilder.php +++ b/src/Services/ServiceBuilder.php @@ -44,6 +44,7 @@ use Bitrix24\SDK\Services\Lists\ListsServiceBuilder; use Bitrix24\SDK\Services\MailService\MailServiceServiceBuilder; use Bitrix24\SDK\Services\Messageservice\MessageserviceServiceBuilder; +use Bitrix24\SDK\Services\Note\NoteServiceBuilder; use Bitrix24\SDK\Services\Rest\RestServiceBuilder; use Bitrix24\SDK\Services\Timeman\TimemanServiceBuilder; use Psr\Log\LoggerInterface; @@ -430,6 +431,20 @@ public function getMessageserviceScope(): MessageserviceServiceBuilder return $this->serviceCache[__METHOD__]; } + public function getNoteScope(): NoteServiceBuilder + { + if (!isset($this->serviceCache[__METHOD__])) { + $this->serviceCache[__METHOD__] = new NoteServiceBuilder( + $this->core, + $this->batch, + $this->bulkItemsReader, + $this->log + ); + } + + return $this->serviceCache[__METHOD__]; + } + public function getRestScope(): RestServiceBuilder { if (!isset($this->serviceCache[__METHOD__])) { diff --git a/tests/Integration/Services/Note/Collection/Result/CollectionFieldItemResultTest.php b/tests/Integration/Services/Note/Collection/Result/CollectionFieldItemResultTest.php new file mode 100644 index 00000000..697c17b6 --- /dev/null +++ b/tests/Integration/Services/Note/Collection/Result/CollectionFieldItemResultTest.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionFieldItemResult; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(CollectionFieldItemResult::class)] +class CollectionFieldItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Collection $collectionService; + + #[\Override] + protected function setUp(): void + { + $this->collectionService = Factory::getServiceBuilder()->getNoteScope()->collection(); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in CollectionFieldItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->collectionService->fieldGet('name') + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), CollectionFieldItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in CollectionFieldItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $field = $this->collectionService->fieldGet('name')->field(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($field, CollectionFieldItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Collection/Result/CollectionItemResultTest.php b/tests/Integration/Services/Note/Collection/Result/CollectionItemResultTest.php new file mode 100644 index 00000000..c4b90b5b --- /dev/null +++ b/tests/Integration/Services/Note/Collection/Result/CollectionItemResultTest.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Collection\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionItemResult; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(CollectionItemResult::class)] +class CollectionItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Collection $collectionService; + + private int $collectionId; + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function setUp(): void + { + $this->collectionService = Factory::getServiceBuilder()->getNoteScope()->collection(); + $this->collectionId = $this->collectionService->add('SDK annotation test collection ' . time()) + ->collection()->id; + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function tearDown(): void + { + $this->collectionService->delete($this->collectionId); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in CollectionItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->collectionService->get($this->collectionId) + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), CollectionItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in CollectionItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $collection = $this->collectionService->get($this->collectionId)->collection(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($collection, CollectionItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Collection/Service/CollectionTest.php b/tests/Integration/Services/Note/Collection/Service/CollectionTest.php new file mode 100644 index 00000000..607db0a3 --- /dev/null +++ b/tests/Integration/Services/Note/Collection/Service/CollectionTest.php @@ -0,0 +1,154 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Collection\Service; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionListCursor; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionListPagination; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionSelectBuilder; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Collection::class)] +class CollectionTest extends TestCase +{ + private Collection $collectionService; + + /** + * @var int[] + */ + private array $createdCollectionIds = []; + + #[\Override] + protected function setUp(): void + { + $this->collectionService = Factory::getServiceBuilder()->getNoteScope()->collection(); + } + + #[\Override] + protected function tearDown(): void + { + foreach ($this->createdCollectionIds as $id) { + $this->collectionService->delete($id); + } + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.collection.add creates a knowledge base and note.collection.get returns it')] + public function testAddAndGet(): void + { + $added = $this->collectionService->add('SDK test collection ' . time()); + $collectionId = $added->collection()->id; + $this->createdCollectionIds[] = $collectionId; + + $this->assertGreaterThan(0, $collectionId); + + $fetched = $this->collectionService->get($collectionId, (new CollectionSelectBuilder())->name()); + $this->assertSame($collectionId, $fetched->collection()->id); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.collection.update renames a knowledge base')] + public function testUpdate(): void + { + $added = $this->collectionService->add('SDK test collection ' . time()); + $collectionId = $added->collection()->id; + $this->createdCollectionIds[] = $collectionId; + + $updated = $this->collectionService->update($collectionId, ['name' => 'SDK renamed collection']); + $this->assertSame('SDK renamed collection', $updated->collection()->name); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.collection.archive marks a knowledge base as archived')] + public function testArchive(): void + { + $added = $this->collectionService->add('SDK test collection ' . time()); + $collectionId = $added->collection()->id; + $this->createdCollectionIds[] = $collectionId; + + $this->assertTrue($this->collectionService->archive($collectionId)->isSuccess()); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.collection.delete removes a knowledge base')] + public function testDelete(): void + { + $added = $this->collectionService->add('SDK test collection ' . time()); + $collectionId = $added->collection()->id; + + $this->assertTrue($this->collectionService->delete($collectionId)->isSuccess()); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.collection.list returns knowledge bases and paginates via a cursor')] + public function testListWithCursor(): void + { + $result = $this->collectionService->list(new CollectionListPagination(1)); + + $collections = $result->getCollections(); + $this->assertNotEmpty($collections); + $this->assertGreaterThan(0, $collections[0]->id); + + $nextCursor = $result->getNextCursor(); + if ($nextCursor instanceof CollectionListCursor) { + $secondPage = $this->collectionService->list(new CollectionListPagination(1, $nextCursor)); + $this->assertIsArray($secondPage->getCollections()); + } + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.collection.field.list returns collection field metadata')] + public function testFieldList(): void + { + $fields = $this->collectionService->fieldList()->getFields(); + $this->assertNotEmpty($fields); + + $names = array_map(static fn ($field) => $field->name, $fields); + $this->assertContains('name', $names); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.collection.field.get returns a single collection field descriptor')] + public function testFieldGet(): void + { + $field = $this->collectionService->fieldGet('name')->field(); + $this->assertSame('name', $field->name); + } +} diff --git a/tests/Integration/Services/Note/Document/Result/DocumentFieldItemResultTest.php b/tests/Integration/Services/Note/Document/Result/DocumentFieldItemResultTest.php new file mode 100644 index 00000000..73c9149f --- /dev/null +++ b/tests/Integration/Services/Note/Document/Result/DocumentFieldItemResultTest.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentFieldItemResult; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(DocumentFieldItemResult::class)] +class DocumentFieldItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Document $documentService; + + #[\Override] + protected function setUp(): void + { + $this->documentService = Factory::getServiceBuilder()->getNoteScope()->document(); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentFieldItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->documentService->fieldGet('title') + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), DocumentFieldItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentFieldItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $field = $this->documentService->fieldGet('title')->field(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($field, DocumentFieldItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Document/Result/DocumentItemResultTest.php b/tests/Integration/Services/Note/Document/Result/DocumentItemResultTest.php new file mode 100644 index 00000000..67703bea --- /dev/null +++ b/tests/Integration/Services/Note/Document/Result/DocumentItemResultTest.php @@ -0,0 +1,94 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentItemResult; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(DocumentItemResult::class)] +class DocumentItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Collection $collectionService; + + private Document $documentService; + + private int $collectionId; + + private int $documentId; + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function setUp(): void + { + $serviceBuilder = Factory::getServiceBuilder(); + $this->collectionService = $serviceBuilder->getNoteScope()->collection(); + $this->documentService = $serviceBuilder->getNoteScope()->document(); + + $this->collectionId = $this->collectionService->add('SDK document annotation test ' . time()) + ->collection()->id; + $this->documentId = $this->documentService->add($this->collectionId, 'Annotation test document', null, '# Hi') + ->document()->id; + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function tearDown(): void + { + $this->documentService->delete($this->documentId); + $this->collectionService->delete($this->collectionId); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->documentService->get($this->documentId) + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), DocumentItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $document = $this->documentService->get($this->documentId)->document(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($document, DocumentItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Document/Result/DocumentSearchFieldItemResultTest.php b/tests/Integration/Services/Note/Document/Result/DocumentSearchFieldItemResultTest.php new file mode 100644 index 00000000..4d6f4918 --- /dev/null +++ b/tests/Integration/Services/Note/Document/Result/DocumentSearchFieldItemResultTest.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchFieldItemResult; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(DocumentSearchFieldItemResult::class)] +class DocumentSearchFieldItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Document $documentService; + + #[\Override] + protected function setUp(): void + { + $this->documentService = Factory::getServiceBuilder()->getNoteScope()->document(); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentSearchFieldItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->documentService->searchFieldGet('title') + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), DocumentSearchFieldItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentSearchFieldItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $field = $this->documentService->searchFieldGet('title')->field(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($field, DocumentSearchFieldItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Document/Result/DocumentSearchItemResultTest.php b/tests/Integration/Services/Note/Document/Result/DocumentSearchItemResultTest.php new file mode 100644 index 00000000..943576dc --- /dev/null +++ b/tests/Integration/Services/Note/Document/Result/DocumentSearchItemResultTest.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchItemResult; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(DocumentSearchItemResult::class)] +class DocumentSearchItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Collection $collectionService; + + private Document $documentService; + + private int $collectionId; + + private int $documentId; + + private string $searchTitle; + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function setUp(): void + { + $serviceBuilder = Factory::getServiceBuilder(); + $this->collectionService = $serviceBuilder->getNoteScope()->collection(); + $this->documentService = $serviceBuilder->getNoteScope()->document(); + + $this->searchTitle = 'UniqueSearchAnnotationTerm' . time(); + $this->collectionId = $this->collectionService->add('SDK search annotation test ' . time()) + ->collection()->id; + $this->documentId = $this->documentService->add($this->collectionId, $this->searchTitle, null, 'searchable body') + ->document()->id; + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function tearDown(): void + { + $this->documentService->delete($this->documentId); + $this->collectionService->delete($this->collectionId); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentSearchItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $items = $this->documentService->searchList($this->searchTitle) + ->getCoreResponse()->getResponseData()->getResult()['items']; + + if ($items === []) { + $this->markTestSkipped('Search index has not caught up with the freshly created document yet.'); + } + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($items[0]), DocumentSearchItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentSearchItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $items = $this->documentService->searchList($this->searchTitle)->getItems(); + + if ($items === []) { + $this->markTestSkipped('Search index has not caught up with the freshly created document yet.'); + } + + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($items[0], DocumentSearchItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Document/Result/DocumentTreeFieldItemResultTest.php b/tests/Integration/Services/Note/Document/Result/DocumentTreeFieldItemResultTest.php new file mode 100644 index 00000000..905b74bb --- /dev/null +++ b/tests/Integration/Services/Note/Document/Result/DocumentTreeFieldItemResultTest.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeFieldItemResult; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(DocumentTreeFieldItemResult::class)] +class DocumentTreeFieldItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Document $documentService; + + #[\Override] + protected function setUp(): void + { + $this->documentService = Factory::getServiceBuilder()->getNoteScope()->document(); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentTreeFieldItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->documentService->treeFieldGet('title') + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), DocumentTreeFieldItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentTreeFieldItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $field = $this->documentService->treeFieldGet('title')->field(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($field, DocumentTreeFieldItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Document/Result/DocumentTreeItemResultTest.php b/tests/Integration/Services/Note/Document/Result/DocumentTreeItemResultTest.php new file mode 100644 index 00000000..9e029cce --- /dev/null +++ b/tests/Integration/Services/Note/Document/Result/DocumentTreeItemResultTest.php @@ -0,0 +1,94 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Document\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeItemResult; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(DocumentTreeItemResult::class)] +class DocumentTreeItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Collection $collectionService; + + private Document $documentService; + + private int $collectionId; + + private int $documentId; + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function setUp(): void + { + $serviceBuilder = Factory::getServiceBuilder(); + $this->collectionService = $serviceBuilder->getNoteScope()->collection(); + $this->documentService = $serviceBuilder->getNoteScope()->document(); + + $this->collectionId = $this->collectionService->add('SDK tree annotation test ' . time()) + ->collection()->id; + $this->documentId = $this->documentService->add($this->collectionId, 'Tree annotation test document') + ->document()->id; + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function tearDown(): void + { + $this->documentService->delete($this->documentId); + $this->collectionService->delete($this->collectionId); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentTreeItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $items = $this->documentService->treeList($this->collectionId) + ->getCoreResponse()->getResponseData()->getResult()['items']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($items[0]), DocumentTreeItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in DocumentTreeItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $items = $this->documentService->treeList($this->collectionId)->getItems(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($items[0], DocumentTreeItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/Document/Service/DocumentTest.php b/tests/Integration/Services/Note/Document/Service/DocumentTest.php new file mode 100644 index 00000000..d0e7b1e5 --- /dev/null +++ b/tests/Integration/Services/Note/Document/Service/DocumentTest.php @@ -0,0 +1,195 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\Document\Service; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Services\Note\Document\Service\DocumentSelectBuilder; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Document::class)] +class DocumentTest extends TestCase +{ + private Collection $collectionService; + + private Document $documentService; + + private int $collectionId; + + /** + * @var int[] + */ + private array $createdDocumentIds = []; + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function setUp(): void + { + $serviceBuilder = Factory::getServiceBuilder(); + $this->collectionService = $serviceBuilder->getNoteScope()->collection(); + $this->documentService = $serviceBuilder->getNoteScope()->document(); + + $this->collectionId = $this->collectionService->add('SDK document test collection ' . time()) + ->collection()->id; + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function tearDown(): void + { + foreach ($this->createdDocumentIds as $id) { + $this->documentService->delete($id); + } + + $this->collectionService->delete($this->collectionId); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.add creates a document and note.document.get returns it')] + public function testAddAndGet(): void + { + $added = $this->documentService->add($this->collectionId, 'Onboarding guide', null, '# Hello'); + $documentId = $added->document()->id; + $this->createdDocumentIds[] = $documentId; + + $this->assertGreaterThan(0, $documentId); + $this->assertSame($this->collectionId, $added->document()->collectionId); + + $fetched = $this->documentService->get($documentId, (new DocumentSelectBuilder())->title()->markdown()); + $this->assertSame('Onboarding guide', $fetched->document()->title); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.update renames a document')] + public function testUpdate(): void + { + $added = $this->documentService->add($this->collectionId, 'Original title'); + $documentId = $added->document()->id; + $this->createdDocumentIds[] = $documentId; + + $updated = $this->documentService->update($documentId, ['title' => 'Updated title']); + $this->assertSame('Updated title', $updated->document()->title); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.archive marks a document as archived')] + public function testArchive(): void + { + $added = $this->documentService->add($this->collectionId, 'To be archived'); + $documentId = $added->document()->id; + $this->createdDocumentIds[] = $documentId; + + $this->assertTrue($this->documentService->archive($documentId)->isSuccess()); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.delete removes a document')] + public function testDelete(): void + { + $added = $this->documentService->add($this->collectionId, 'To be deleted'); + $documentId = $added->document()->id; + + $this->assertTrue($this->documentService->delete($documentId)->isSuccess()); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.field.list returns document field metadata')] + public function testFieldList(): void + { + $fields = $this->documentService->fieldList()->getFields(); + $this->assertNotEmpty($fields); + + $names = array_map(static fn ($field) => $field->name, $fields); + $this->assertContains('title', $names); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.tree.list returns the document tree of a knowledge base')] + public function testTreeList(): void + { + $added = $this->documentService->add($this->collectionId, 'Tree root document'); + $documentId = $added->document()->id; + $this->createdDocumentIds[] = $documentId; + + $tree = $this->documentService->treeList($this->collectionId); + $ids = array_map(static fn ($item) => $item->id, $tree->getItems()); + $this->assertContains($documentId, $ids); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.tree.field.list returns document tree field metadata')] + public function testTreeFieldList(): void + { + $fields = $this->documentService->treeFieldList()->getFields(); + $this->assertNotEmpty($fields); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.search.list performs a full-text search across documents')] + public function testSearchList(): void + { + $uniqueTitle = 'UniqueSearchTerm' . time(); + $added = $this->documentService->add($this->collectionId, $uniqueTitle, null, 'searchable body'); + $this->createdDocumentIds[] = $added->document()->id; + + $result = $this->documentService->searchList($uniqueTitle); + $this->assertIsArray($result->getItems()); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.document.search.field.list returns document search field metadata')] + public function testSearchFieldList(): void + { + $fields = $this->documentService->searchFieldList()->getFields(); + $this->assertNotEmpty($fields); + } +} diff --git a/tests/Integration/Services/Note/File/Result/FileFieldItemResultTest.php b/tests/Integration/Services/Note/File/Result/FileFieldItemResultTest.php new file mode 100644 index 00000000..72f055dd --- /dev/null +++ b/tests/Integration/Services/Note/File/Result/FileFieldItemResultTest.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\File\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\File\Result\FileFieldItemResult; +use Bitrix24\SDK\Services\Note\File\Service\File; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(FileFieldItemResult::class)] +class FileFieldItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private File $fileService; + + #[\Override] + protected function setUp(): void + { + $this->fileService = Factory::getServiceBuilder()->getNoteScope()->file(); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in FileFieldItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->fileService->fieldGet('name') + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), FileFieldItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in FileFieldItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $field = $this->fileService->fieldGet('name')->field(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($field, FileFieldItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/File/Result/FileItemResultTest.php b/tests/Integration/Services/Note/File/Result/FileItemResultTest.php new file mode 100644 index 00000000..b697dcfd --- /dev/null +++ b/tests/Integration/Services/Note/File/Result/FileItemResultTest.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\File\Result; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Services\Note\File\Result\FileItemResult; +use Bitrix24\SDK\Services\Note\File\Service\File; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(FileItemResult::class)] +class FileItemResultTest extends TestCase +{ + use CustomBitrix24Assertions; + + private Collection $collectionService; + + private Document $documentService; + + private File $fileService; + + private int $collectionId; + + private int $documentId; + + private int $fileId; + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function setUp(): void + { + $serviceBuilder = Factory::getServiceBuilder(); + $this->collectionService = $serviceBuilder->getNoteScope()->collection(); + $this->documentService = $serviceBuilder->getNoteScope()->document(); + $this->fileService = $serviceBuilder->getNoteScope()->file(); + + $this->collectionId = $this->collectionService->add('SDK file annotation test ' . time()) + ->collection()->id; + $this->documentId = $this->documentService->add($this->collectionId, 'File annotation test document') + ->document()->id; + $this->fileId = $this->fileService->add($this->documentId, 'note.txt', base64_encode('content')) + ->file()->id; + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function tearDown(): void + { + $this->documentService->delete($this->documentId); + $this->collectionService->delete($this->collectionId); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in FileItemResult are annotated in phpdoc and match with raw api response')] + public function testAllFieldsAreAnnotated(): void + { + $rawItem = $this->fileService->get($this->fileId, $this->documentId) + ->getCoreResponse()->getResponseData()->getResult()['item']; + + $this->assertBitrix24AllResultItemFieldsAnnotated(array_keys($rawItem), FileItemResult::class); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[Test] + #[TestDox('all fields in FileItemResult have valid type casting in magic getters')] + public function testAllFieldsHasValidTypeCastingInMagicGetters(): void + { + $file = $this->fileService->get($this->fileId, $this->documentId)->file(); + $this->assertBitrix24ResultItemFieldsTypeCastMatchAnnotations($file, FileItemResult::class); + } +} diff --git a/tests/Integration/Services/Note/File/Service/FileTest.php b/tests/Integration/Services/Note/File/Service/FileTest.php new file mode 100644 index 00000000..55f7fbd2 --- /dev/null +++ b/tests/Integration/Services/Note/File/Service/FileTest.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Integration\Services\Note\File\Service; + +use Bitrix24\SDK\Core\Exceptions\BaseException; +use Bitrix24\SDK\Core\Exceptions\TransportException; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Services\Note\File\Service\File; +use Bitrix24\SDK\Tests\Integration\Factory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; + +#[CoversClass(File::class)] +class FileTest extends TestCase +{ + private Collection $collectionService; + + private Document $documentService; + + private File $fileService; + + private int $collectionId; + + private int $documentId; + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function setUp(): void + { + $serviceBuilder = Factory::getServiceBuilder(); + $this->collectionService = $serviceBuilder->getNoteScope()->collection(); + $this->documentService = $serviceBuilder->getNoteScope()->document(); + $this->fileService = $serviceBuilder->getNoteScope()->file(); + + $this->collectionId = $this->collectionService->add('SDK file test collection ' . time()) + ->collection()->id; + $this->documentId = $this->documentService->add($this->collectionId, 'File test document') + ->document()->id; + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[\Override] + protected function tearDown(): void + { + $this->documentService->delete($this->documentId); + $this->collectionService->delete($this->collectionId); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.file.add uploads a file and note.file.get returns it')] + public function testAddAndGet(): void + { + $content = base64_encode('plain text file content'); + $added = $this->fileService->add($this->documentId, 'note.txt', $content); + $fileId = $added->file()->id; + + $this->assertGreaterThan(0, $fileId); + $this->assertSame($this->documentId, $added->file()->documentId); + + $fetched = $this->fileService->get($fileId, $this->documentId); + $this->assertSame($fileId, $fetched->file()->id); + } + + /** + * @throws BaseException + * @throws TransportException + */ + #[TestDox('note.file.field.list returns file field metadata')] + public function testFieldList(): void + { + $fields = $this->fileService->fieldList()->getFields(); + $this->assertNotEmpty($fields); + + $names = array_map(static fn ($field) => $field->name, $fields); + $this->assertContains('name', $names); + } +} diff --git a/tests/Unit/Services/Note/Collection/Service/CollectionTest.php b/tests/Unit/Services/Note/Collection/Service/CollectionTest.php new file mode 100644 index 00000000..c701742c --- /dev/null +++ b/tests/Unit/Services/Note/Collection/Service/CollectionTest.php @@ -0,0 +1,220 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Unit\Services\Note\Collection\Service; + +use Bitrix24\SDK\Core\ApiLevelErrorHandler; +use Bitrix24\SDK\Core\Commands\Command; +use Bitrix24\SDK\Core\Contracts\CoreInterface; +use Bitrix24\SDK\Core\Response\Response; +use Bitrix24\SDK\Services\Note\Collection\Result\ArchivedCollectionResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionFieldResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionFieldsResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionResult; +use Bitrix24\SDK\Services\Note\Collection\Result\CollectionsResult; +use Bitrix24\SDK\Services\Note\Collection\Result\DeletedCollectionResult; +use Bitrix24\SDK\Services\Note\Collection\Service\Collection; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionListCursor; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionListPagination; +use Bitrix24\SDK\Services\Note\Collection\Service\CollectionSelectBuilder; +use Bitrix24\SDK\Tests\Unit\Stubs\NullCore; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; +use Psr\Log\NullLogger; +use Symfony\Component\HttpClient\Response\MockResponse; + +#[CoversClass(Collection::class)] +class CollectionTest extends TestCase +{ + private Collection $service; + + #[\Override] + protected function setUp(): void + { + $this->service = new Collection(new NullCore(), new NullLogger()); + } + + #[Test] + public function testAddReturnsCollectionResult(): void + { + $this->assertInstanceOf(CollectionResult::class, $this->service->add('Sales KB')); + } + + #[Test] + public function testArchiveReturnsArchivedCollectionResult(): void + { + $this->assertInstanceOf(ArchivedCollectionResult::class, $this->service->archive(1)); + } + + #[Test] + public function testDeleteReturnsDeletedCollectionResult(): void + { + $this->assertInstanceOf(DeletedCollectionResult::class, $this->service->delete(1)); + } + + #[Test] + public function testFieldGetReturnsCollectionFieldResult(): void + { + $this->assertInstanceOf(CollectionFieldResult::class, $this->service->fieldGet('name')); + } + + #[Test] + public function testFieldListReturnsCollectionFieldsResult(): void + { + $this->assertInstanceOf(CollectionFieldsResult::class, $this->service->fieldList()); + } + + #[Test] + public function testGetReturnsCollectionResult(): void + { + $this->assertInstanceOf(CollectionResult::class, $this->service->get(1)); + } + + #[Test] + public function testListReturnsCollectionsResult(): void + { + $this->assertInstanceOf(CollectionsResult::class, $this->service->list()); + } + + #[Test] + public function testUpdateReturnsCollectionResult(): void + { + $this->assertInstanceOf(CollectionResult::class, $this->service->update(1, ['name' => 'Renamed'])); + } + + #[Test] + #[TestDox('add() calls note.collection.add with a nested fields object')] + public function testAddSendsNestedFields(): void + { + [$method, $captured] = $this->call(static fn (Collection $service) => $service->add('Sales KB', 5)); + + $this->assertSame('note.collection.add', $method); + $this->assertSame(['fields' => ['name' => 'Sales KB', 'position' => 5]], $captured); + } + + #[Test] + #[TestDox('get() forwards a plain select array unchanged')] + public function testGetForwardsPlainSelect(): void + { + [$method, $captured] = $this->call(static fn (Collection $service) => $service->get(42, ['id', 'name'])); + + $this->assertSame('note.collection.get', $method); + $this->assertSame(42, $captured['id']); + $this->assertSame(['id', 'name'], $captured['select']); + } + + #[Test] + #[TestDox('get() builds select from a CollectionSelectBuilder')] + public function testGetBuildsSelectFromBuilder(): void + { + $select = (new CollectionSelectBuilder())->name()->position(); + + [$method, $captured] = $this->call(static fn (Collection $service) => $service->get(42, $select)); + + $this->assertSame('note.collection.get', $method); + $this->assertSame($select->buildSelect(), $captured['select']); + } + + #[Test] + #[TestDox('list() sends no pagination key when called without arguments')] + public function testListWithoutPaginationSendsEmptyPayload(): void + { + [$method, $captured] = $this->call(static fn (Collection $service) => $service->list()); + + $this->assertSame('note.collection.list', $method); + $this->assertArrayNotHasKey('pagination', $captured); + } + + #[Test] + #[TestDox('list() forwards limit and afterCursor from a typed CollectionListPagination')] + public function testListForwardsTypedPagination(): void + { + $pagination = new CollectionListPagination(50, new CollectionListCursor(10, 99)); + + [$method, $captured] = $this->call(static fn (Collection $service) => $service->list($pagination)); + + $this->assertSame('note.collection.list', $method); + $this->assertSame( + ['limit' => 50, 'afterCursor' => ['position' => 10, 'id' => 99]], + $captured['pagination'] + ); + } + + #[Test] + #[TestDox('delete() forwards id when provided')] + public function testDeleteForwardsId(): void + { + [$method, $captured] = $this->call(static fn (Collection $service) => $service->delete(7)); + + $this->assertSame('note.collection.delete', $method); + $this->assertSame(7, $captured['id']); + $this->assertArrayNotHasKey('filter', $captured); + } + + #[Test] + #[TestDox('delete() forwards filter when no id is given')] + public function testDeleteForwardsFilter(): void + { + [$method, $captured] = $this->call( + static fn (Collection $service) => $service->delete(null, [['id', '>=', 10]]) + ); + + $this->assertSame('note.collection.delete', $method); + $this->assertArrayNotHasKey('id', $captured); + $this->assertSame([['id', '>=', 10]], $captured['filter']); + } + + #[Test] + #[TestDox('update() sends id and nested fields')] + public function testUpdateSendsIdAndFields(): void + { + [$method, $captured] = $this->call( + static fn (Collection $service) => $service->update(3, ['name' => 'New name']) + ); + + $this->assertSame('note.collection.update', $method); + $this->assertSame(3, $captured['id']); + $this->assertSame(['name' => 'New name'], $captured['fields']); + } + + /** + * @return array{0: string, 1: array} + */ + private function call(callable $action): array + { + $method = null; + $captured = []; + $response = new Response( + new MockResponse(''), + new Command('', []), + new ApiLevelErrorHandler(new NullLogger()), + new NullLogger() + ); + + $core = $this->createStub(CoreInterface::class); + $core->method('call')->willReturnCallback( + function (string $apiMethod, array $parameters = []) use (&$method, &$captured, $response): Response { + $method = $apiMethod; + $captured = $parameters; + + return $response; + } + ); + + $action(new Collection($core, new NullLogger())); + + return [$method, $captured]; + } +} diff --git a/tests/Unit/Services/Note/Document/Service/DocumentTest.php b/tests/Unit/Services/Note/Document/Service/DocumentTest.php new file mode 100644 index 00000000..399c2efb --- /dev/null +++ b/tests/Unit/Services/Note/Document/Service/DocumentTest.php @@ -0,0 +1,220 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Unit\Services\Note\Document\Service; + +use Bitrix24\SDK\Core\ApiLevelErrorHandler; +use Bitrix24\SDK\Core\Commands\Command; +use Bitrix24\SDK\Core\Contracts\CoreInterface; +use Bitrix24\SDK\Core\Response\Response; +use Bitrix24\SDK\Services\Note\Document\Result\ArchivedDocumentResult; +use Bitrix24\SDK\Services\Note\Document\Result\DeletedDocumentResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentFieldResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentFieldsResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchFieldResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchFieldsResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentSearchResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeFieldResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeFieldsResult; +use Bitrix24\SDK\Services\Note\Document\Result\DocumentTreeResult; +use Bitrix24\SDK\Services\Note\Document\Service\Document; +use Bitrix24\SDK\Services\Note\Document\Service\DocumentSelectBuilder; +use Bitrix24\SDK\Tests\Unit\Stubs\NullCore; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; +use Psr\Log\NullLogger; +use Symfony\Component\HttpClient\Response\MockResponse; + +#[CoversClass(Document::class)] +class DocumentTest extends TestCase +{ + private Document $service; + + #[\Override] + protected function setUp(): void + { + $this->service = new Document(new NullCore(), new NullLogger()); + } + + #[Test] + public function testAddReturnsDocumentResult(): void + { + $this->assertInstanceOf(DocumentResult::class, $this->service->add(1, 'Onboarding guide')); + } + + #[Test] + public function testArchiveReturnsArchivedDocumentResult(): void + { + $this->assertInstanceOf(ArchivedDocumentResult::class, $this->service->archive(1)); + } + + #[Test] + public function testDeleteReturnsDeletedDocumentResult(): void + { + $this->assertInstanceOf(DeletedDocumentResult::class, $this->service->delete(1)); + } + + #[Test] + public function testFieldGetReturnsDocumentFieldResult(): void + { + $this->assertInstanceOf(DocumentFieldResult::class, $this->service->fieldGet('title')); + } + + #[Test] + public function testFieldListReturnsDocumentFieldsResult(): void + { + $this->assertInstanceOf(DocumentFieldsResult::class, $this->service->fieldList()); + } + + #[Test] + public function testGetReturnsDocumentResult(): void + { + $this->assertInstanceOf(DocumentResult::class, $this->service->get(1)); + } + + #[Test] + public function testUpdateReturnsDocumentResult(): void + { + $this->assertInstanceOf(DocumentResult::class, $this->service->update(1, ['title' => 'Renamed'])); + } + + #[Test] + public function testTreeListReturnsDocumentTreeResult(): void + { + $this->assertInstanceOf(DocumentTreeResult::class, $this->service->treeList(1)); + } + + #[Test] + public function testTreeFieldGetReturnsDocumentTreeFieldResult(): void + { + $this->assertInstanceOf(DocumentTreeFieldResult::class, $this->service->treeFieldGet('title')); + } + + #[Test] + public function testTreeFieldListReturnsDocumentTreeFieldsResult(): void + { + $this->assertInstanceOf(DocumentTreeFieldsResult::class, $this->service->treeFieldList()); + } + + #[Test] + public function testSearchListReturnsDocumentSearchResult(): void + { + $this->assertInstanceOf(DocumentSearchResult::class, $this->service->searchList('onboarding')); + } + + #[Test] + public function testSearchFieldGetReturnsDocumentSearchFieldResult(): void + { + $this->assertInstanceOf(DocumentSearchFieldResult::class, $this->service->searchFieldGet('title')); + } + + #[Test] + public function testSearchFieldListReturnsDocumentSearchFieldsResult(): void + { + $this->assertInstanceOf(DocumentSearchFieldsResult::class, $this->service->searchFieldList()); + } + + #[Test] + #[TestDox('add() sends collectionId, title, parentId and markdown as nested fields')] + public function testAddSendsNestedFields(): void + { + [$method, $captured] = $this->call( + static fn (Document $service) => $service->add(1, 'Onboarding guide', 5, '# Hello') + ); + + $this->assertSame('note.document.add', $method); + $this->assertSame( + ['collectionId' => 1, 'title' => 'Onboarding guide', 'parentId' => 5, 'markdown' => '# Hello'], + $captured['fields'] + ); + } + + #[Test] + #[TestDox('get() builds select from a DocumentSelectBuilder')] + public function testGetBuildsSelectFromBuilder(): void + { + $select = (new DocumentSelectBuilder())->title()->markdown(); + + [$method, $captured] = $this->call(static fn (Document $service) => $service->get(1, $select)); + + $this->assertSame('note.document.get', $method); + $this->assertSame($select->buildSelect(), $captured['select']); + } + + #[Test] + #[TestDox('update() forwards overwrite flag alongside id and fields')] + public function testUpdateForwardsOverwriteFlag(): void + { + [$method, $captured] = $this->call( + static fn (Document $service) => $service->update(1, ['markdown' => '# New'], [], true) + ); + + $this->assertSame('note.document.update', $method); + $this->assertSame(1, $captured['id']); + $this->assertSame(['markdown' => '# New'], $captured['fields']); + $this->assertTrue($captured['overwrite']); + } + + #[Test] + #[TestDox('treeList() sends collectionId')] + public function testTreeListSendsCollectionId(): void + { + [$method, $captured] = $this->call(static fn (Document $service) => $service->treeList(9)); + + $this->assertSame('note.document.tree.list', $method); + $this->assertSame(9, $captured['collectionId']); + } + + #[Test] + #[TestDox('searchList() sends query and optional limit')] + public function testSearchListSendsQueryAndLimit(): void + { + [$method, $captured] = $this->call(static fn (Document $service) => $service->searchList('onboarding', 10)); + + $this->assertSame('note.document.search.list', $method); + $this->assertSame('onboarding', $captured['query']); + $this->assertSame(10, $captured['pagination']['limit']); + } + + /** + * @return array{0: string, 1: array} + */ + private function call(callable $action): array + { + $method = null; + $captured = []; + $response = new Response( + new MockResponse(''), + new Command('', []), + new ApiLevelErrorHandler(new NullLogger()), + new NullLogger() + ); + + $core = $this->createStub(CoreInterface::class); + $core->method('call')->willReturnCallback( + function (string $apiMethod, array $parameters = []) use (&$method, &$captured, $response): Response { + $method = $apiMethod; + $captured = $parameters; + + return $response; + } + ); + + $action(new Document($core, new NullLogger())); + + return [$method, $captured]; + } +} diff --git a/tests/Unit/Services/Note/File/Service/FileTest.php b/tests/Unit/Services/Note/File/Service/FileTest.php new file mode 100644 index 00000000..477f36b4 --- /dev/null +++ b/tests/Unit/Services/Note/File/Service/FileTest.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the MIT-LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Bitrix24\SDK\Tests\Unit\Services\Note\File\Service; + +use Bitrix24\SDK\Core\ApiLevelErrorHandler; +use Bitrix24\SDK\Core\Commands\Command; +use Bitrix24\SDK\Core\Contracts\CoreInterface; +use Bitrix24\SDK\Core\Response\Response; +use Bitrix24\SDK\Services\Note\File\Result\FileFieldResult; +use Bitrix24\SDK\Services\Note\File\Result\FileFieldsResult; +use Bitrix24\SDK\Services\Note\File\Result\FileResult; +use Bitrix24\SDK\Services\Note\File\Service\File; +use Bitrix24\SDK\Tests\Unit\Stubs\NullCore; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\TestDox; +use PHPUnit\Framework\TestCase; +use Psr\Log\NullLogger; +use Symfony\Component\HttpClient\Response\MockResponse; + +#[CoversClass(File::class)] +class FileTest extends TestCase +{ + private File $service; + + #[\Override] + protected function setUp(): void + { + $this->service = new File(new NullCore(), new NullLogger()); + } + + #[Test] + public function testAddReturnsFileResult(): void + { + $this->assertInstanceOf(FileResult::class, $this->service->add(1, 'diagram.png', base64_encode('binary'))); + } + + #[Test] + public function testFieldGetReturnsFileFieldResult(): void + { + $this->assertInstanceOf(FileFieldResult::class, $this->service->fieldGet('name')); + } + + #[Test] + public function testFieldListReturnsFileFieldsResult(): void + { + $this->assertInstanceOf(FileFieldsResult::class, $this->service->fieldList()); + } + + #[Test] + public function testGetReturnsFileResult(): void + { + $this->assertInstanceOf(FileResult::class, $this->service->get(1, 2)); + } + + #[Test] + #[TestDox('add() sends documentId, fileName and base64 fileContent')] + public function testAddSendsDocumentIdFileNameAndContent(): void + { + $content = base64_encode('binary-data'); + + [$method, $captured] = $this->call(static fn (File $service) => $service->add(1, 'diagram.png', $content)); + + $this->assertSame('note.file.add', $method); + $this->assertSame(1, $captured['documentId']); + $this->assertSame('diagram.png', $captured['fileName']); + $this->assertSame($content, $captured['fileContent']); + } + + #[Test] + #[TestDox('get() sends id and documentId')] + public function testGetSendsIdAndDocumentId(): void + { + [$method, $captured] = $this->call(static fn (File $service) => $service->get(3, 7)); + + $this->assertSame('note.file.get', $method); + $this->assertSame(3, $captured['id']); + $this->assertSame(7, $captured['documentId']); + } + + /** + * @return array{0: string, 1: array} + */ + private function call(callable $action): array + { + $method = null; + $captured = []; + $response = new Response( + new MockResponse(''), + new Command('', []), + new ApiLevelErrorHandler(new NullLogger()), + new NullLogger() + ); + + $core = $this->createStub(CoreInterface::class); + $core->method('call')->willReturnCallback( + function (string $apiMethod, array $parameters = []) use (&$method, &$captured, $response): Response { + $method = $apiMethod; + $captured = $parameters; + + return $response; + } + ); + + $action(new File($core, new NullLogger())); + + return [$method, $captured]; + } +} From e92f84a6448b689a7dbddd3f8ca776900b50addc Mon Sep 17 00:00:00 2001 From: Veronica Akhmetova <264936994+fatestr1ngs@users.noreply.github.com> Date: Thu, 2 Jul 2026 20:13:52 +0400 Subject: [PATCH 2/2] Fix Rector variable-naming finding in Collection unit test (#515) RenameVariableToMatchNewTypeRector flagged $pagination for not matching its CollectionListPagination type. --- .../Unit/Services/Note/Collection/Service/CollectionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Unit/Services/Note/Collection/Service/CollectionTest.php b/tests/Unit/Services/Note/Collection/Service/CollectionTest.php index c701742c..99c454cd 100644 --- a/tests/Unit/Services/Note/Collection/Service/CollectionTest.php +++ b/tests/Unit/Services/Note/Collection/Service/CollectionTest.php @@ -141,9 +141,9 @@ public function testListWithoutPaginationSendsEmptyPayload(): void #[TestDox('list() forwards limit and afterCursor from a typed CollectionListPagination')] public function testListForwardsTypedPagination(): void { - $pagination = new CollectionListPagination(50, new CollectionListCursor(10, 99)); + $collectionListPagination = new CollectionListPagination(50, new CollectionListCursor(10, 99)); - [$method, $captured] = $this->call(static fn (Collection $service) => $service->list($pagination)); + [$method, $captured] = $this->call(static fn (Collection $service) => $service->list($collectionListPagination)); $this->assertSame('note.collection.list', $method); $this->assertSame(