Skip to content

Add IM\Dialog service for im.dialog.* support#451

Merged
mesilov merged 18 commits intov3-devfrom
feature/425-add-im-dialog-service
Apr 29, 2026
Merged

Add IM\Dialog service for im.dialog.* support#451
mesilov merged 18 commits intov3-devfrom
feature/425-add-im-dialog-service

Conversation

@mesilov
Copy link
Copy Markdown
Collaborator

@mesilov mesilov commented Apr 21, 2026

Q A
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #425
License MIT

Adds the new IM\\Dialog service and result wrappers for the im.dialog.* scope. The PR wires the service into IMServiceBuilder, covers the new endpoints with unit and live integration tests, and adds dedicated annotation validation for dialog, message, and dialog-user result items.

Test plan

  • make lint-cs-fixer
  • make lint-rector
  • make lint-phpstan
  • make lint-deptrac
  • make test-unit
  • make test-integration-im-dialog

Closes #425

@mesilov mesilov added this to the 3.2.0 milestone Apr 21, 2026
@mesilov mesilov self-assigned this Apr 21, 2026
@mesilov mesilov added the enhancement in REST-API New feature or request in REST-API label Apr 21, 2026
@mesilov mesilov linked an issue Apr 21, 2026 that may be closed by this pull request
16 tasks
mesilov added 17 commits April 23, 2026 18:04
…prove error handling docs

- Ensure `Core::call()` routes array-structured 401 errors through `ApiLevelErrorHandler`.
- Add `bitrix_rest_v3_exception_accessdeniedexception` to `ApiLevelErrorHandler` cases.
- Update tests to cover v3 unauthorized error handling.
- Document typing for date/time arguments and API metadata link standards.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…able` for improved type safety

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…g.get` in ResultItem pipeline

- Introduced `.tasks/425/im.dialog.get/result-item.payload.yaml` for defining canonical payloads.
- Added `.tasks/425/im.dialog.get/result-item.verification-report.yaml` for API verification results.
- Updated ResultItem pipeline to ensure these files align with Bitrix24 REST standards.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
- Added `ResultItemGeneratorCommand` for managing build, verify, apply, and generate stages of ResultItem pipelines.
- Introduced `DefaultResultItemGeneratorWorkflow` for handling OpenAPI and REST docs payload generation and validation.
- Added unit tests to validate pipeline stages and workflow logic.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…` with runtime field type casting

- Added `AbstractAnnotatedItem` with Typhoon-based runtime type casting for annotated fields.
- Updated `DialogItemResult` to extend `AbstractAnnotatedItem` for PHPDoc-based type casting of magic getters.
- Added unit tests to verify field type casting logic based on annotations.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…e annotated getters

- Added unit and integration tests to validate runtime field type casting in `ContactItemResult`.
- Integrated additional logic for array and user field handling in annotated getters.
- Defined workflow for testing edge cases like nullable fields and smart process item retrieval.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…r `DialogTest`

- Updated `Factory::getBulkItemsReader` to accept application credentials.
- Modified `Factory::getCore` logic to conditionally load application credentials.
- Refactored `DialogTest` for better readability and updated imports.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…ialogItemResult`

- Replaced `AbstractItem` references with `AbstractAnnotatedItem` in test cases.
- Ensured test coverage aligns with updated class structure and annotations.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…and update tests

- Updated `Dialog::messagesSearch` to use `CarbonImmutable` for date filters, ensuring type safety and proper serialization to REST API format.
- Adjusted integration and unit tests to reflect `CarbonImmutable` usage in date handling.
- Added `typhoon/reflection` as a runtime dependency due to updates in result-item casting logic.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…`b24phpsdk-maintainer`

- Updated `SKILL.md` to mandate using SDK file generators (`*ItemResult`, `*SelectBuilder`, `*ItemBuilder`) before manual edits.
- Added generator usage rules, including dependency on `openapi.json` and testing requirements.
- Updated changelog to reflect the new guidelines.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…adStateItemResult` from REST payloads

- Updated `ChatItemResult`, `DialogUserItemResult`, and `DialogReadStateItemResult` to reflect REST docs-based payload shapes.
- Migrated from `AbstractItem` to `AbstractAnnotatedItem` for enhanced type annotations and runtime type casting.
- Extended SDK generator workflow and added tests to support REST responses for `im.chat.get`, `im.dialog.read`, and `im.dialog.users.list`.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
- Updated `SKILL.md` and `AGENTS.md` to mandate running `make lint-rector` before reporting tasks as completed, including microtasks.
- Adjusted guidelines to ensure Rector checks are enforced for all implementation tasks.
- Updated changelog to reflect the new requirements.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
@mesilov mesilov marked this pull request as ready for review April 29, 2026 05:18
@mesilov mesilov merged commit e89e12a into v3-dev Apr 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement in REST-API New feature or request in REST-API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add IM\Dialog service for im.dialog.* support

1 participant