Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit a3c9905

Browse files
authored
Merge pull request #401 from mesilov/2.x
2.0 version
2 parents b69341f + 5703ff6 commit a3c9905

File tree

598 files changed

+24766
-5720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

598 files changed

+24766
-5720
lines changed

.github/workflows/integration.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ composer.lock
66
.phpunit.result.cache
77
tools/.env.local
88
tools/logs
9+
tests/ApplicationBridge/auth.json
910
examples/logs
1011
*.log
1112
.env.local

CHANGELOG.md

Lines changed: 192 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,187 @@
11
# bitrix24-php-sdk change log
22

3-
## 2.0-beta.2 — 1.04.2024
3+
## 2.0 — 28.08.2024
4+
* bump sdk version
5+
6+
## 2.0-beta.3 — 15.08.2024
47

58
### Added
9+
10+
* add dependencies
11+
* `symfony/console` version `^6 || ^7`
12+
* `symfony/dotenv` version `^6 || ^7`
13+
* `symfony/filesystem` version `^6 || ^7`
14+
* `symfony/mime` version `^6 || ^7`
15+
* `nesbot/carbon` version `3.3.*`
16+
* `mesilov/moneyphp-percentage` version `0.2.*`
17+
* add scope `bizproc` and [services](https://github.com/mesilov/bitrix24-php-sdk/issues/376) for work with workflows:
18+
* `Activity` – service for work with application activities:
19+
* `add` – adds new activity to a workflow
20+
* `delete` – delete an activity
21+
* `list` – returns list of activities, installed by the application
22+
* `log` – records data in the workflow log
23+
* `update` – update activity fields
24+
* `Robot` – service for work with application automation rules (robots):
25+
* `add` – registers new automation rule
26+
* `delete` – deletes registered automation rule
27+
* `list` – returns list of automation rules, registered by the application
28+
* `update` – updates fields of automation rules
29+
* `Event` – service for work with return parameters¨
30+
* `send` – Returns the output parameters to the activity
31+
* `Providers` — deprecated methods, not implemented
32+
* `Workflow` — service for work with workflow instances
33+
* `instances` – returns list of launched workflows
34+
* `kill` – delete a launched workflow
35+
* `start` – launches a workflow
36+
* `terminate` – stops an active workflow
37+
* `Template` — service for work with workflow templates
38+
* `add` – add a workflow template
39+
* `delete` – delete workflow template
40+
* `list` – returns list of workflow templates
41+
* `update` – update workflow template
42+
* `Tasks` — service for work with workflow tasks
43+
* `complete` – Complete workflow task
44+
* `list` – List of workflow tasks
45+
* add `WorkflowActivityDocumentType`
46+
* add method `Bitrix24\SDK\Core\Credentials\AccessToken::initFromWorkflowRequest`
47+
* add method `Bitrix24\SDK\Core\Credentials\AccessToken::initFromEventRequest`
48+
* add `Bitrix24\SDK\Infrastructure\Filesystem\Base64Encoder` for work with base64 encoding
49+
* add `Bitrix24\SDK\Core\Exceptions\FileNotFoundException` if file not found
50+
* add `Bitrix24\SDK\Core\Exceptions\MethodConfirmWaitingException` if api call waiting for confirm
51+
* add `Bitrix24\SDK\Core\Exceptions\UserNotFoundOrIsNotActiveException` exception if user not found, or it is not active
52+
* add `Bitrix24\SDK\Core\Result\UserInterfaceDialogCallResult` result of call UI
53+
* add `Bitrix24\SDK\Core\Result\EmptyResult` empty result
54+
* add `IncomingRobotRequest` wrapper for data from crm-robot request
55+
* add `IncomingWorkflowRequest` wrapper for data from biz proc activity request
56+
* add `Bitrix24\SDK\Core\Credentials::isWebhookContext` - for check is current context init from webhook
57+
* add method `Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest::getEventId` - for get event id
58+
* add method `Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest::getAuth` - get event auth token
59+
* add method `Bitrix24\SDK\Application\Requests\Events\EventAuthItem` - event auth token
60+
* add method `Bitrix24\SDK\Application\Requests\Events\EventInterface` - for event fabrics
61+
* add method `Bitrix24\SDK\Infrastructure\Filesystem\Base64Encoder::encodeCallRecord(string $filename): string` - for
62+
work with call records
63+
* add class `Bitrix24\SDK\Services\Main\Service\EventManager` - improve DX for work with events lifecycle bind or unbind
64+
* add method `Bitrix24\SDK\Services\Main\Common\EventHandlerMetadata` - improve DX for work with install events
65+
* add enum `Bitrix24\SDK\Services\CRM\Common\Result\DiscountType`
66+
* add exception `Bitrix24\SDK\Core\Exceptions\WrongAuthTypeException` – if you use wrong auth type.
67+
* add class fields filter `Bitrix24\SDK\Core\Fields\FieldsFilter` for fields filtration in result array.
68+
* improve DX – add [Rector](https://github.com/rectorphp/rector) for improve code quality and speed up releases cycle
69+
* improve DX – add attributes for generate documentation and calculate methods coverage.
70+
* command for generate documentation
71+
```shell
72+
php bin/console b24:util:generate-coverage-documentation
73+
```
74+
* improve DX – add [internal documentation](/docs/EN/documentation.md).
75+
676
### Changed
7-
* updated [dependencies versions](https://github.com/mesilov/bitrix24-php-sdk/issues/373):
8-
* require
9-
* `psr/log` `1.4.0``3.0.*`
10-
* `moneyphp/money` `4.3.*``4.5.*`
11-
* require-dev
12-
* `monolog/monolog` `2.9.*``3.5.*`
13-
* `phpunit/phpunit` `10.5.*``11.0.*`
77+
78+
* ❗️ migrate from `ramsey/uuid` to `symfony/uid`
79+
* ❗️ migrate from `DateTimeImmutable` to `CarbonImmutable` from [carbon](https://github.com/briannesbitt/carbon)
80+
* ❗️ refactor `Bitrix24\SDK\Application\Contracts`:
81+
82+
* ❗️ update scope `telephony`, scope fully rewritten
83+
* `ExternalCall` – work with external call:
84+
* `getCallRecordUploadUrl` – get url for upload call record file
85+
* `attachCallRecordInBase64` – attach call record encoded in base64
86+
* `register` – registers a call in Bitrix24
87+
* `searchCrmEntities` – retrieve information about a client from CRM by a telephone number via single request
88+
* `finishForUserPhoneInner` – completes the call, registers it in the statistics and hides the call ID screen
89+
from the user
90+
* `finishForUserId` – completes the call, registers it in the statistics and hides the call ID screen from the
91+
user
92+
* `show` – displays a call ID screen to the user
93+
* `hide` – hides call information window
94+
* `Call` – work with call:
95+
* `attachTranscription` – method adds a call transcript
96+
* `ExternalLine` – work with external line:
97+
* `add` – method adds an external line
98+
* `delete` – method delete external line
99+
* `get` – method gets external lines list
100+
* `Voximplant` – work with voximplant namespace:
101+
* `Sip` – work with sip lines:
102+
* `get` - get sip lines list
103+
* `add` - add new sip line
104+
* `delete` - delete sip line
105+
* `status` - pbx sip line registration status
106+
* `update` - update sip line settings
107+
* `getConnectorStatus` - returns the current status of the SIP Connector.
108+
* `User` - work with voximplant sip user mapped on bitrix24 user
109+
* `deactivatePhone` - method disables an indicator of SIP-phone availability
110+
* `activatePhone` - method raises the event of SIP-phone availability for an employee
111+
* `get` - method returns user settings
112+
* `Voices` - work with voximplant tts voices
113+
* `get` - method returns all voximplant voices
114+
* `Line` - work with voximplant sip lines
115+
* `outgoingSipSet` - method sets the selected SIP line as an outgoing line by default.
116+
* `get` - returns list of all of the available outgoing lines
117+
* `outgoingGet` - returns the currently selected line as an outgoing line by default.
118+
* `outgoingSet` - sets the selected line as an outgoing line by default.
119+
* `InfoCall` - work with voximplant info call functional
120+
* `startWithText` - method performs the call to the specified number with automatic voiceover of
121+
specified
122+
text
123+
* `startWithSound` - method makes a call to the specified number with playback of .mp3 format file by
124+
URL.
125+
* `Url` - work with links for browsing telephony scope pages
126+
* `get` - returns a set of links for browsing telephony scope pages.
127+
* add events with payload and `TelephonyEventsFabric`:
128+
* `OnExternalCallBackStart` - It is called when a visitor fills out a CRM form for callback. Your application
129+
shall be selected in the form settings as the line that to be used for a callback.
130+
* `OnExternalCallStart` - The event handler is called whenever a user clicks a phone number in CRM object to
131+
initiate an outbound call.
132+
* `OnVoximplantCallEnd` - The event is raised when conversation ends (history entry).
133+
* `OnVoximplantCallInit` - The event is raised when a call is being initialized (regarding the entry or start of
134+
an outbound call).
135+
* `OnVoximplantCallStart` - The event is raised when a conversation starts (operator responds to an inbound
136+
call; call recipient responds to an outbound call).
137+
* add `TranscriptMessage` – data structure for transcript message item
138+
* add `TranscriptMessageSide` – enum for describe side of diarization
139+
* add `CallType` – call types enum
140+
* add `CrmEntityType` – crm entity type enum
141+
* add `PbxType` – pbx type enum
142+
* add `SipRegistrationStatus` – pbx sip line registration status
143+
* ❗️ update scope `im`, add service `Notify`:
144+
* `fromSystem` - Sending system notification
145+
* `fromPersonal` - Sending personal notification
146+
* `delete` – Deleting notification
147+
* `markAsRead` - Cancels notification for read messages.
148+
* `markMessagesAsRead` – "Read" the list of notifications, excluding CONFIRM notification type.
149+
* `markMessagesAsUnread` – "Unread" the list of notifications, excluding CONFIRM notification type.
150+
* `confirm` – Interaction with notification buttons
151+
* `answer` – Response to notification, supporting quick reply
152+
* change signature `Bitrix24\SDK\Core\Credentials\AccessToken::getRefreshToken()?string;` - add nullable option for
153+
event tokens
154+
* change signature `Bitrix24\SDK\Core\Commands\Command::getName():?string` renamed to `getId():string`
155+
* add fields and change return types in `Bitrix24\SDK\Services\CRM\Deal\Result\DealProductRowItemResult`
156+
* change typehints in `Bitrix24\SDK\Services\CRM\Activity\Service\Activity::add`
157+
158+
### Deleted
159+
160+
* remove class `Bitrix24\SDK\Application\Requests\Events\OnApplicationInstall\Auth`
161+
* remove class `Bitrix24\SDK\Application\Requests\Events\OnApplicationUninstall\Auth`
162+
* remove method `Bitrix24\SDK\Core\Response\Response::__destruct`
163+
* remove interface `Bitrix24\SDK\Services\Telephony\Common\StatusSipCodeInterface`
164+
* remove class `Bitrix24\SDK\Services\Telephony\Common\StatusSipRegistrations`
165+
* remove class `Bitrix24\SDK\Services\Telephony\Common\TypeAtc`
166+
14167
### Bugfix
15-
### etc
168+
169+
* fix [typehint for Bitrix24 User entity with field ID](https://github.com/mesilov/bitrix24-php-sdk/issues/382)
170+
* fix [default arguments for Bitrix24 User get method](https://github.com/mesilov/bitrix24-php-sdk/issues/381)
171+
* fix [limit argument not worked in batch list and read model](https://github.com/mesilov/bitrix24-php-sdk/issues/389)
172+
173+
## 2.0-beta.2 — 1.04.2024
174+
175+
### Changed
176+
177+
* updated [dependencies versions](https://github.com/mesilov/bitrix24-php-sdk/issues/373):
178+
* require
179+
* `psr/log` `1.4.0``3.0.*`
180+
* `moneyphp/money` `4.3.*``4.5.*`
181+
* require-dev
182+
* `monolog/monolog` `2.9.*``3.5.*`
183+
* `phpunit/phpunit` `10.5.*``11.0.*`
184+
* added enum `DealSemanticStage` for deal field `STAGE_SEMANTIC_ID`
16185

17186
## 2.0-beta.1 — 18.02.2024
18187

@@ -38,13 +207,13 @@
38207
* add [crm item support](https://github.com/mesilov/bitrix24-php-sdk/issues/330)
39208
* add enum `DealStageSemanticId`
40209
* add Duplicate search support for `Bitrix24\SDK\Services\CRM\Duplicates\Service\Duplicate`
41-
* add `x-request-id` [header support](https://github.com/mesilov/bitrix24-php-sdk/issues/354)
210+
* add `x-request-id` [header support](https://github.com/mesilov/bitrix24-php-sdk/issues/354)
42211
* add CRM multifields support [header support](https://github.com/mesilov/bitrix24-php-sdk/issues/338)
43212
* `Email`
44213
* `Phone`
45214
* `Website`
46215
* `IM`
47-
* add [Catalog](https://github.com/mesilov/bitrix24-php-sdk/issues/364) scope services support
216+
* add [Catalog](https://github.com/mesilov/bitrix24-php-sdk/issues/364) scope services support
48217

49218
### Changed
50219

@@ -59,7 +228,7 @@
59228
to `Bitrix24\SDK\Services\Telephony\Requests\Events\OnExternalCallStart\OnExternalCallStart`
60229
* from `Bitrix24\SDK\Services\Telephony\Requests\Events\OnVoximplantCallEnd`
61230
to `Bitrix24\SDK\Services\Telephony\Requests\Events\OnVoximplantCallEnd\OnVoximplantCallEnd`
62-
* ❗Changes in `Bitrix24\SDK\Application\Contracts\Bitrix24Account\Bitrix24AccountInterface`:
231+
* ❗Changes in `Bitrix24\SDK\Application\Contracts\Bitrix24Account\Bitrix24AccountInterface`:
63232
* method `getContactPerson` renamed to `getContactPersonId`
64233
* added method `getApplicationVersion`
65234
* added method `updateApplicationVersion`
@@ -69,7 +238,7 @@
69238
* added method `markAsDeactivated`
70239
* added method `getBitrix24UserId`
71240
* removed method `markAccountAsDeleted`
72-
* changed method `markAsActive`
241+
* changed method `markAsActive`
73242
* ❗Changes in `Bitrix24\SDK\Application\Contracts\Bitrix24Account\Bitrix24AccountRepositoryInterface`:
74243
* method `saveAccount` renamed to `save`
75244
* method `deleteAccount` renamed to `delete`
@@ -85,7 +254,8 @@
85254
* fix [typehint at ContactItemResult](https://github.com/mesilov/bitrix24-php-sdk/issues/320)
86255
* fix [return types in DealCategoryItemResult](https://github.com/mesilov/bitrix24-php-sdk/issues/322)
87256
* fix [add auth node in telephony voximplant events requests](https://github.com/mesilov/bitrix24-php-sdk/issues/331)
88-
* fix [add helper metods isError for registerCallResult fortelephony](https://github.com/mesilov/bitrix24-php-sdk/issues/335)
257+
*
258+
fix [add helper metods isError for registerCallResult fortelephony](https://github.com/mesilov/bitrix24-php-sdk/issues/335)
89259
* fix [add return type for crm multifields phone, email, im](https://github.com/mesilov/bitrix24-php-sdk/issues/338)
90260
* fix errors in `ShowFieldsDescriptionCommand` metadata reader CLI command
91261
* fix errors for `ApplicationProfile` with empty scope
@@ -158,9 +328,15 @@
158328
are [consistent](https://github.com/mesilov/bitrix24-php-sdk/issues/303): `createFromWebhook`, `createFromOAuth`
159329
, `createFromPlacementRequest`
160330
*
161-
❗️deleted [unused class](https://github.com/mesilov/bitrix24-php-sdk/issues/303) `Bitrix24\SDK\Core\Response\DTO\ResponseDataCollection`
331+
332+
❗️deleted [unused class](https://github.com/mesilov/bitrix24-php-sdk/issues/303)
333+
`Bitrix24\SDK\Core\Response\DTO\ResponseDataCollection`
334+
162335
*
163-
❗️deleted [redundant class](https://github.com/mesilov/bitrix24-php-sdk/issues/303) `Bitrix24\SDK\Core\Response\DTO\Result`
336+
337+
❗️deleted [redundant class](https://github.com/mesilov/bitrix24-php-sdk/issues/303)
338+
`Bitrix24\SDK\Core\Response\DTO\Result`
339+
164340
* ❗️deleted [method](https://github.com/mesilov/bitrix24-php-sdk/issues/303) `CoreBuilder::withWebhookUrl`, use
165341
method `CoreBuilder::withCredentials`
166342

CONTRIBUTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
1. Fork the repo
66
2. Clone the repo to local
77
3. Install dependencies: `composer update` (this assumes you have 'composer' aliased to wherever your composer.phar lives)
8-
4. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate:
9-
`composer phpstan-analyse`
10-
`composer phpunit-run-unit-tests`
11-
`composer phpunit-run-integration-tests`
8+
4. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate.
129

1310
## Adding new features
1411

@@ -19,10 +16,12 @@ New features that does not have any BC Breaks are going to be added in next mino
1916

2017
## Codding standards
2118

22-
In order to fix codding standards please exeecute:
19+
In order to fix codding standards please execute:
2320

2421
```shell
25-
composer phpstan-analyse
22+
make lint-phpstan
23+
make lint-rector
24+
make lint-rector-fix
2625
```
2726

2827
## Patches and bugfixes
@@ -36,4 +35,4 @@ composer phpstan-analyse
3635
1. Make the changes/additions to the code, committing often and making clear what you've done
3736
2. Make sure you write tests for your code, located in the folder structure
3837
3. Run your tests (often and while coding)
39-
4. Create Pull Request on github to against proper branch
38+
4. Create Pull Request on GitHub to against proper branch

MIT-LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2022 Maxim Mesilov
1+
Copyright 2024 Maksim Mesilov
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

0 commit comments

Comments
 (0)