Skip to content

3.0.0

Latest

Choose a tag to compare

@mesilov mesilov released this 27 Feb 05:49
5f5e08e

Added

API v3 support: Tasks & EventLog

  • Added support for Bitrix24 API v3
  • Added REST 3.0 API version support:
    • Core\Contracts\ApiVersion - enum for API version support (v1, v3) with helper methods isV3() and isV1()
    • Core\EndpointUrlFormatter - formats API request URLs based on API version, handles V3 API prefix /rest/api, manages case-sensitive method handling, and request ID parameter placement for strict methods
  • Switched Task domain methods to Bitrix24 API v3 and documented services/methods currently using v3:
    • Services\Task\Service\Task: get (tasks.task.get), add (tasks.task.add), delete (tasks.task.delete), update (tasks.task.update)
    • Services\Task\Service\TaskChat: sendMessage (tasks.task.chat.message.send)
    • Services\Task\Service\TaskFile: attachExists (tasks.task.file.attach)
    • Services\Main\Service\Documentation: getSchema (documentation)
  • Added type-safe filter builder system for REST 3.0 filtering (#338):
    • FilterBuilderInterface - contract for all filter builders
    • AbstractFilterBuilder - base implementation with AND/OR logic support
    • FieldConditionBuilder - provides all 8 REST 3.0 operators: =, !=, >, >=, <, <=, in, between
    • TaskFilter - type-safe filter for Task entity with 30 field accessors
    • Fluent API with method chaining: ->title()->eq('ASAP')
    • OR logic support with callback pattern: ->or(function(TaskFilter $f) {...})
    • User field support: ->userField('UF_CRM_TASK')->eq('value')
    • Raw array fallback: ->raw([['field', 'operator', 'value']])
    • Backward compatible with existing array-based filters
    • Updated Task::list() to accept TaskFilter or array via union type
    • Comprehensive unit tests with 54 test cases covering all operators and features
  • Added select builder infrastructure for type-safe field selection:
    • Core\Contracts\SelectBuilderInterface - contract with buildSelect() and withUserFields() methods
    • Services\AbstractSelectBuilder - base implementation for select builders
    • Services\Task\Service\TaskItemSelectBuilder - type-safe select builder for Task entity with field methods: title(), description(), creatorId(), creator(), created(), chat()
  • Added comprehensive filter documentation:
    • src/Filters/docs/README.md - unified guide covering REST 3.0 filtering principles, type-safe filter builders, all 8 operators, field type mapping, usage examples with TaskFilter, and complete migration guide from generic to type-safe approach
  • Added OpenAPI schema infrastructure (#338):
    • Services\Main\Service\Documentation - new service with getSchema() method for retrieving OpenAPI documentation from REST 3.0 /documentation endpoint
    • OpenApi\Infrastructure\Console\SchemaBuilder - console command b24-dev:build-schema for fetching and saving OpenAPI schema to docs/open-api/openapi.json
    • DocumentationResult - DTO returning raw OpenAPI payload as string
    • Integration test: tests/Integration/Services/Main/Service/DocumentationTest.php
  • Added Core\Contracts\SortOrder enum (Ascending = 'ASC', Descending = 'DESC') —
    type-safe sort direction for use across all REST v3 API calls.
  • Added service Services\Main\Service\EventLog with REST v3 event log methods
    (scope: main, requires administrator access),
    see main.eventlog.* methods:
    • get(int $id, array|EventLogSelectBuilder $select) — returns a single event log entry by ID
      (main.eventlog.get)
    • list(array|EventLogSelectBuilder $select, array|EventLogFilter $filter, array $order, array $pagination) — returns a list of entries with filtering and pagination
      (main.eventlog.list)
    • tail(array|EventLogSelectBuilder $select, array|EventLogFilter $filter, EventLogTailCursor $cursor) — returns new entries after a cursor point for polling/sync scenarios
      (main.eventlog.tail)
  • Added Services\Main\Service\EventLogSelectBuilder — fluent select builder for event log fields
  • Added Services\Main\Service\EventLogFilter — type-safe filter builder with typed condition builders
    per field (IntFieldConditionBuilder, DateTimeFieldConditionBuilder, StringFieldConditionBuilder)
  • Added Services\Main\Service\EventLogTailCursor — immutable value object for the tail cursor
    (field, order: SortOrder, value, limit), serialized via toArray()
  • Typed EventLogItemResult::$remoteAddr as Darsyn\IP\Version\Multi|null instead of string|null.
    darsyn/ip was already a dependency but unused in result items.
    Multi::factory() auto-detects IPv4/IPv6 and returns a value object supporting CIDR range checks,
    protocol-appropriate string representation, and strict typing.
    Applies the same null/empty-string guard used by $timestampX to handle absent API fields safely.

Everything else

  • Added deptrac/deptrac (^3.0) as a dev dependency — architectural layer enforcement tool.
    Rules are declared in deptrac.yaml; run via make lint-deptrac (also part of make lint-all).
    Layer boundaries: Core → nothing; ApplicationCore, Services; InfrastructureCore, Services;
    ServicesCore, Application, Legacy; LegacyCore, Application, Services.
    22 pre-existing violations are recorded in skip_violations with TODO comments tracking required refactoring.
  • Added Services\AbstractSelectBuilder::allSystemFields() — convenience method that uses reflection
    to discover and call all public zero-parameter field methods declared in the concrete subclass,
    collecting all available system fields in a single call. Supports chaining with withUserFields().
    Works automatically for any existing or future AbstractSelectBuilder descendant without any changes to them.
  • Added src/Legacy/ namespace with LegacyServiceBuilder and LegacyTaskServiceBuilder,
    accessible via $serviceBuilder->getLegacyServiceBuilder()->getTaskScope()->task().
    Preserves access to all Bitrix24 REST API v1 task methods (list, fields, delegate,
    start, pause, defer, complete, etc.) for users migrating to the v3 SDK.
    All classes under Bitrix24\SDK\Legacy\ are marked @deprecated and will be removed
    once v3 reaches feature parity with v1.
  • Added OpenApi\Domain\OpenApiSchemaReader for programmatic reading and navigation of the OpenAPI specification,
    with support for component schemas, field type extraction, $ref resolution, and request/response schema access
  • Added service Services\Lists\Lists\Service\Lists with support methods,
    see lists.* methods:
    • add creates a universal list, with batch calls support
    • update updates a universal list, with batch calls support
    • get returns data of a universal list or an array of lists, with batch calls support
    • delete deletes a universal list, with batch calls support
    • getIBlockTypeId returns the identifier of the information block type
  • Added service Services\Lists\Field\Service\Field with support methods,
    see lists.field.* methods:
    • add creates a field for the universal list, with batch calls support
    • update updates a field of the universal list, with batch calls support
    • get returns data about a field or list of fields
    • delete deletes a field from the universal list, with batch calls support
    • types returns a list of available field types for the list
    • addByCode helper method to create field by iblock code
    • updateByCode helper method to update field by iblock code
    • getByCode helper method to get field(s) by iblock code
    • deleteByCode helper method to delete field by iblock code
  • Added service Services\Lists\Section\Service\Section with support methods,
    see lists.section.* methods:
    • add creates a section for the universal list, with batch calls support
    • update updates a section of the universal list, with batch calls support
    • get returns data about a section or list of sections
    • delete deletes a section from the universal list, with batch calls support
  • Added service Services\Lists\Element\Service\Element with support methods,
    see lists.element.* methods:
    • add creates an element for the universal list, with batch calls support
    • update updates an element of the universal list, with batch calls support
    • get returns data about an element or list of elements, with batch calls support
    • delete deletes an element from the universal list, with batch calls support
    • getFileUrl returns file URL from element field
  • Added service Services\Landing\Site\Service\Site with support methods,
    see landing.site.* methods:
    • add adds a site
    • getList retrieves a list of sites
    • update updates site parameters
    • delete deletes a site
    • getPublicUrl returns the full URL of the site(s)
    • getPreview returns the preview image URL of the site
    • publication publishes the site and all its pages
    • unpublic unpublishes the site and all its pages
    • markDelete marks the site as deleted
    • markUnDelete restores the site from the trash
    • getAdditionalFields returns additional fields of the site
    • fullExport exports the site to ZIP archive
    • getFolders retrieves the site folders
    • addFolder adds a folder to the site
    • updateFolder updates folder parameters
    • publicationFolder publishes the site's folder
    • unPublicFolder unpublishes the site's folder
    • markFolderDelete marks the folder as deleted
    • markFolderUnDelete restores the folder from the trash
    • getRights returns access permissions of the current user for the specified site
    • setRights sets access permissions for the site
  • Added service Services\Landing\SysPage\Service\SysPage with support methods,
    see landing.syspage.* methods:
    • set sets a special page for the site
    • get retrieves the list of special pages
  • Added service Services\Landing\Role\Service\Role with support methods,
    see landing.role.* methods:
    • isEnabled checks if role model is enabled
    • enable enables or disables the role model
    • getList retrieves a list of available roles
    • getRights gets role rights for sites
    • setRights sets role rights for sites
    • setAccessCodes sets access codes for a role
    • getSpecialPage retrieves the address of the special page on the site
    • deleteForLanding deletes all mentions of the page as a special one
    • deleteForSite deletes all special pages of the site
  • Added service Services\Landing\Page\Service\Page with support methods,
    see landing.landing.* methods:
    • add adds a page
    • addByTemplate creates a page from a template
    • copy copies a page
    • delete deletes a page
    • update updates page parameters
    • getList retrieves a list of pages
    • getAdditionalFields returns additional fields of the page
    • getPreview returns the preview image URL of the page
    • getPublicUrl returns the full URL of the page
    • resolveIdByPublicUrl resolves page ID by its public URL
    • publish publishes the page
    • unpublish unpublishes the page
    • markDeleted marks the page as deleted
    • markUnDeleted restores the page from the trash
    • move moves a page to another site or folder
    • removeEntities removes entities from the page
    • addBlock adds a block to the page
    • copyBlock copies a block within the page
    • deleteBlock deletes a block by its identifier
    • moveBlockDown moves a block down on the page
    • moveBlockUp moves a block up on the page
    • moveBlock moves a block to a specific position
    • hideBlock hides a block on the page
    • showBlock shows a block on the page
    • markBlockDeleted marks a block as deleted
    • markBlockUnDeleted restores a block from the trash
    • addBlockToFavorites adds a block to favorites
    • removeBlockFromFavorites removes a block from favorites
  • Added service Services\Landing\Block\Service\Block with support methods,
    see landing.block.* methods:
    • list retrieves a list of page blocks
    • getById retrieves a block by its identifier
    • getContent retrieves the content of a block
    • getManifest retrieves the manifest of a block
    • getRepository retrieves blocks from the repository
    • getManifestFile retrieves block manifest from repository
    • getContentFromRepository retrieves block content from repository
    • updateNodes updates block content
    • updateAttrs updates block node attributes
    • updateStyles updates block styles
    • updateContent updates block content with arbitrary content
    • updateCards bulk updates block cards
    • cloneCard clones a block card
    • addCard adds a card with modified content
    • removeCard removes a block card
    • uploadFile uploads and attaches image to block
    • changeAnchor changes anchor symbol code
    • changeNodeName changes tag name
  • Added service Services\Landing\Template\Service\Template with support methods,
    see landing.template.* methods:
    • getList retrieves a list of templates
    • getLandingRef retrieves a list of included areas for the page
    • getSiteRef retrieves a list of included areas for the site
    • setLandingRef sets the included areas for the page
    • setSiteRef sets the included areas for the site
  • Added service Services\Landing\Repo\Service\Repo with support methods,
    see landing.repo.* methods:
    • getList retrieves a list of blocks from the current application
    • register adds a block to the repository
    • unregister deletes a block from the repository
    • checkContent checks the content for dangerous substrings
  • Added service Services\Landing\Demos\Service\Demos with support methods,
    see landing.demos.* methods:
    • register registers a template in the site and page creation wizard
    • unregister deletes the registered partner template
    • getList retrieves a list of available partner templates for the current application
    • getSiteList retrieves a list of available templates for creating sites
    • getPageList retrieves a list of available templates for creating pages
  • Added service Services\IMOpenLines\Connector\Service\Connector with support methods,
    see imconnector.* methods:
    • list method returns a list of available connectors
    • register method registers a new connector
    • activate method activates or deactivates a connector
    • unregister method unregisters a connector
    • status method retrieves connector status information
    • setData method sets connector data
    • sendMessages method sends messages through the connector
    • updateMessages method updates messages
    • deleteMessages method deletes messages
    • sendStatusDelivery method sends message delivery status
    • sendStatusReading method sends message reading status
    • setChatName method sets chat name
  • Added service Services\IMOpenLines\Config\Service\Config with support methods,
    see imopenlines.config.*:
    • add adds a new open line
    • delete deletes an open line
    • get retrieves an open line by Id
    • getList retrieves a list of open lines
    • getPath gets a link to the public page of open lines in the account
    • update modifies an open line
    • joinNetwork connects an external open line to the account
    • getRevision retrieves information about API revisions
  • Added service Services\IMOpenLines\CRMChat\Service\Chat with support methods,
    see imopenlines.crm.chat.*:
    • get retrieves chats for a CRM object
    • getLastId retrieves the ID of the last chat associated with a CRM entity
    • addUser adds a user to a CRM entity chat
    • deleteUser removes a user from the CRM entity chat
  • Added service Services\IMOpenLines\Message\Service\Message with support methods,
    see imopenlines.crm.message., imopenlines.message.:
    • addCrmMessage sends a message to the open line on behalf of an employee or bot in a chat linked to a CRM entity
    • quickSave saves a message from the open line chat to the list of quick answers
    • sessionStart starts a new dialogue session based on a message
  • Added service Services\IMOpenLines\Bot\Service\Bot with support methods,
    see imopenlines.bot.*:
    • sendMessage sends an automatic message via the chatbot
    • transferToOperator switches the conversation to a free operator
    • transferToUser transfers the conversation to a specific operator by user ID
    • transferToQueue transfers the conversation to another open line queue
    • finishSession ends the current session
  • Added service Services\IMOpenLines\Operator\Service\Operator with support methods,
    see imopenlines.operator.*:
    • answer takes the dialog for the current operator
    • finish ends the dialogue by the current operator
    • anotherFinish finishes the dialog of another operator
    • skip skips the dialog for the current operator
    • spam marks the conversation as "spam" by the current operator
    • transfer transfers the dialogue to another operator or line
  • Added service Services\IMOpenLines\Session\Service\Session with support methods,
    see imopenlines.session.*:
    • createCrmLead creates a lead based on the dialogue
    • getDialog retrieves information about the operator's dialogue (chat) in the open line
    • startMessageSession starts a new dialogue session based on a message
    • voteHead votes for the session head
    • getHistory gets session history
    • intercept intercepts the session
    • join joins the session
    • pinAll pins all sessions
    • pin pins a specific session
    • setSilent sets silent mode for session
    • unpinAll unpins all sessions
    • open opens a session
    • start starts a session
  • Added service Services\SonetGroup\Service\SonetGroup with support methods,
    see sonet_group.* methods:
    • create creates a social network group/project
    • update modifies group parameters
    • delete deletes a social network group
    • get gets detailed information about a specific workgroup
    • list gets list of workgroups with filtering
    • getGroups gets list of social network groups (simpler version)
    • getUserGroups gets list of current user's groups
    • addUser adds users to group without invitation process
    • deleteUser removes users from group
    • setOwner changes group owner
  • Added isPartner(): bool method to ContactPersonInterface to check if the contact person is a partner employee,
    see details:
    • Returns true if the contact person has a Bitrix24 partner ID set
    • Returns false if no partner ID is associated with the contact person
    • Provides a convenience method instead of checking getBitrix24PartnerId() !== null

Changed

  • Removed deprecated RemoteEventsFabric test file (tests/Unit/Services/RemoteEventsFabricTest.php);
    RemoteEventsFactoryTest already provides full coverage of the replacement class

  • Removed unused use Bitrix24\SDK\Services\RemoteEventsFabric imports from
    CRMServiceBuilderTest, IMServiceBuilderTest, and MainServiceBuilderTest

  • Fixed PHPUnit 12 deprecations in RemoteEventsFactoryTest: replaced createStub() + ->with()
    (no-op combination) with createStub() + ->willReturn() only

  • Breaking changes in Bitrix24PartnerInterface and Bitrix24PartnerRepositoryInterface,
    see details:

    • Renamed getBitrix24PartnerId(): int to getBitrix24PartnerNumber(): int in Bitrix24PartnerInterface to clarify that this method returns the partner's external vendor site number (visible on bitrix24.com/partners/), not an internal database ID
    • Renamed findByBitrix24PartnerId(int $bitrix24PartnerId) to findByBitrix24PartnerNumber(int $bitrix24PartnerNumber) in Bitrix24PartnerRepositoryInterface
    • Migration: Replace all calls to getBitrix24PartnerId() with getBitrix24PartnerNumber() and findByBitrix24PartnerId() with findByBitrix24PartnerNumber() in Bitrix24PartnerInterface implementations
  • Updated Task::list() method to accept TaskFilter|array via union type - backward compatible with existing array-based filters while supporting new type-safe TaskFilter instances

  • Updated Symfony dependencies to support OpenAPI schema builder infrastructure

  • Refactored integration tests: renamed Fabric.php to Factory.php for consistency

  • ContactPersonInterface::markMobilePhoneAsVerified() now accepts an optional ?CarbonImmutable $verifiedAt = null
    parameter. When omitted, the behaviour is identical to before (defaults to the current timestamp).
    Allows callers to supply a specific verification time (e.g. historical imports).

  • ContactPersonInterface::markEmailAsVerified() now accepts an optional
    ?CarbonImmutable $verifiedAt = null parameter.
    When null (default), the current timestamp is used — fully backward-compatible.
    Callers may supply an explicit date when restoring state from persistence or syncing external data.
    Updated: ContactPersonInterface, ContactPersonReferenceEntityImplementation,
    ContactPersons.md documentation, added testMarkEmailAsVerifiedWithSpecificDate unit test.

Fixed

  • Fixed handling of scope and licence_family fields.