Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
->in(__DIR__ . '/src/Services/CRM/Documentgenerator/Numerator/')
->in(__DIR__ . '/src/Services/Entity/Section/')
->in(__DIR__ . '/src/Services/Department/')
->in(__DIR__ . '/src/Services/Landing/')
->in(__DIR__ . '/src/Services/Paysystem/')
->in(__DIR__ . '/src/Services/Sale/')
->in(__DIR__ . '/src/Services/Task/')
Expand Down
85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,91 @@

### Added

- Added service `Services\Landing\Site\Service\Site` with support methods,
see [landing.site.* methods](https://github.com/bitrix24/b24phpsdk/issues/267):
- `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
- Added service `Services\Landing\SysPage\Service\SysPage` with support methods,
see [landing.syspage.* methods](https://github.com/bitrix24/b24phpsdk/issues/267):
- `set` sets a special page for the site
- `get` retrieves the list of special pages
- `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](https://github.com/bitrix24/b24phpsdk/issues/267):
- `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 from the page
- `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](https://github.com/bitrix24/b24phpsdk/issues/267):
- `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](https://github.com/bitrix24/b24phpsdk/issues/267):
- `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\Sale\Delivery\Service\Delivery` with support methods,
see [sale.delivery.* methods](https://github.com/bitrix24/b24phpsdk/issues/255):
- `add` adds a delivery service
Expand Down
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ help:
@echo "test-integration-sale-payment-item-basket - run PaymentItemBasket integration tests"
@echo "test-integration-sale-payment-item-shipment - run PaymentItemShipment integration tests"
@echo "test-integration-sale-property-relation - run PropertyRelation integration tests"
@echo "test-integration-landing-page - run Landing Page integration tests"
@echo "test-integration-landing-syspage - run Landing SysPage integration tests"
@echo "test-integration-scope-landing-template - run Landing Template integration tests"


.PHONY: docker-init
Expand Down Expand Up @@ -218,6 +221,29 @@ test-integration-scope-log:
test-integration-scope-sale:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_sale

.PHONY: test-integration-scope-landing
test-integration-scope-landing:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_landing

.PHONY: test-integration-scope-landing-template
test-integration-scope-landing-template:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_landing_template

.PHONY: test-integration-landing-block
test-integration-landing-block:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_landing_block

.PHONY: test-integration-landing-site
test-integration-landing-site:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_landing_site

.PHONY: test-integration-landing-page
test-integration-landing-page:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_landing_page

.PHONY: test-integration-landing-syspage
test-integration-landing-syspage:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_landing_syspage
.PHONY: test-integration-scope-disk
test-integration-scope-disk:
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_scope_disk
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ parameters:
- tests/Integration/Services/CRM/Requisites
- tests/Integration/Services/Task
- tests/Integration/Services/Sale
- tests/Integration/Services/Landing
- tests/Integration/Services/Disk
- tests/Integration/Services/Calendar
- tests/Integration/Services/CRM/Documentgenerator/Numerator
Expand Down
18 changes: 18 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@
<testsuite name="integration_tests_sale_order">
<directory>./tests/Integration/Services/Sale/Order/</directory>
</testsuite>
<testsuite name="integration_tests_scope_landing">
<directory>./tests/Integration/Services/Landing/</directory>
</testsuite>
<testsuite name="integration_tests_landing_site">
<directory>./tests/Integration/Services/Landing/Site/</directory>
</testsuite>
<testsuite name="integration_tests_landing_page">
<directory>./tests/Integration/Services/Landing/Page/</directory>
</testsuite>
<testsuite name="integration_tests_landing_syspage">
<directory>./tests/Integration/Services/Landing/SysPage/</directory>
</testsuite>
<testsuite name="integration_tests_sale_cashbox_handler">
<directory>./tests/Integration/Services/Sale/CashboxHandler/</directory>
</testsuite>
Expand Down Expand Up @@ -205,6 +217,12 @@
<testsuite name="integration_tests_sale_shipment_item">
<directory>./tests/Integration/Services/Sale/ShipmentItem/</directory>
</testsuite>
<testsuite name="integration_tests_scope_landing_template">
<directory>./tests/Integration/Services/Landing/Template/</directory>
</testsuite>
<testsuite name="integration_tests_landing_block">
<directory>./tests/Integration/Services/Landing/Block/</directory>
</testsuite>
<testsuite name="integration_tests_crm_documentgenerator_numerator">
<directory>./tests/Integration/Services/CRM/Documentgenerator/Numerator/</directory>
</testsuite>
Expand Down
2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
__DIR__ . '/tests/Integration/Services/Task',
__DIR__ . '/src/Services/Sale',
__DIR__ . '/tests/Integration/Services/Sale',
__DIR__ . '/src/Services/Landing',
__DIR__ . '/tests/Integration/Services/Landing',
__DIR__ . '/src/Services/Disk',
__DIR__ . '/tests/Integration/Services/Disk',
__DIR__ . '/src/Services/Calendar',
Expand Down
38 changes: 38 additions & 0 deletions src/Services/Landing/Block/Result/BlockContentItemResult.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

/**
* This file is part of the bitrix24-php-sdk package.
*
* © Sally Fancen <[email protected]>
*
* 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\Landing\Block\Result;

use Bitrix24\SDK\Core\Result\AbstractItem;

/**
* @property-read non-negative-int $id
* @property-read string $sections
* @property-read string $active
* @property-read string $access
* @property-read string $anchor
* @property-read string $php
* @property-read string $designed
* @property-read string $repoId
* @property-read string $content
* @property-read string $content_ext
* @property-read array $css
* @property-read array $js
* @property-read array $assetStrings
* @property-read array $lang
* @property-read array $manifest
* @property-read array $dynamicParams
*/
class BlockContentItemResult extends AbstractItem
{
}
28 changes: 28 additions & 0 deletions src/Services/Landing/Block/Result/BlockContentResult.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is part of the bitrix24-php-sdk package.
*
* © Sally Fancen <[email protected]>
*
* 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\Landing\Block\Result;

use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Result\AbstractResult;

class BlockContentResult extends AbstractResult
{
/**
* @throws BaseException
*/
public function getContent(): BlockContentItemResult
{
return new BlockContentItemResult($this->getCoreResponse()->getResponseData()->getResult());
}
}
28 changes: 28 additions & 0 deletions src/Services/Landing/Block/Result/BlockItemResult.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is part of the bitrix24-php-sdk package.
*
* © Sally Fancen <[email protected]>
*
* 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\Landing\Block\Result;

use Bitrix24\SDK\Core\Result\AbstractItem;

/**
* @property-read non-negative-int $id
* @property-read non-negative-int $lid
* @property-read string $code
* @property-read string $name
* @property-read string $active
* @property-read array $meta
*/
class BlockItemResult extends AbstractItem
{
}
35 changes: 35 additions & 0 deletions src/Services/Landing/Block/Result/BlockManifestItemResult.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/**
* This file is part of the bitrix24-php-sdk package.
*
* © Sally Fancen <[email protected]>
*
* 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\Landing\Block\Result;

use Bitrix24\SDK\Core\Result\AbstractItem;

/**
* @property-read array $block
* @property-read array $cards
* @property-read array $nodes
* @property-read array $style
* @property-read array $assets
* @property-read array $groups
* @property-read int $timestamp
* @property-read array $attrs
* @property-read array $callbacks
* @property-read array $menu
* @property-read string $namespace
* @property-read string $code
* @property-read string $preview
*/
class BlockManifestItemResult extends AbstractItem
{
}
28 changes: 28 additions & 0 deletions src/Services/Landing/Block/Result/BlockManifestResult.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is part of the bitrix24-php-sdk package.
*
* © Sally Fancen <[email protected]>
*
* 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\Landing\Block\Result;

use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Result\AbstractResult;

class BlockManifestResult extends AbstractResult
{
/**
* @throws BaseException
*/
public function getManifest(): BlockManifestItemResult
{
return new BlockManifestItemResult($this->getCoreResponse()->getResponseData()->getResult());
}
}
28 changes: 28 additions & 0 deletions src/Services/Landing/Block/Result/BlockResult.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is part of the bitrix24-php-sdk package.
*
* © Sally Fancen <[email protected]>
*
* 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\Landing\Block\Result;

use Bitrix24\SDK\Core\Exceptions\BaseException;
use Bitrix24\SDK\Core\Result\AbstractResult;

class BlockResult extends AbstractResult
{
/**
* @throws BaseException
*/
public function getBlock(): BlockItemResult
{
return new BlockItemResult($this->getCoreResponse()->getResponseData()->getResult());
}
}
Loading