Skip to content

Commit 1d412e5

Browse files
TatevikGrtatevikg1
andauthored
ISSUE-345: add endpoints
* ISSUE-345: add validator * ISSUE-345: update configs * ISSUE-345: refactor * ISSUE-345: update core * ISSUE-345: return 422 * ISSUE-345: return 409 * ISSUE-345: test fix * ISSUE-345: snake to camel config * ISSUE-345: add tests * ISSUE-345: use swagger schemas * ISSUE-345: update subscriber * ISSUE-345: refactor session controller * ISSUE-345: test fix * ISSUE-345: refactor swagger * ISSUE-345: delete subscriber endpoint * ISSUE-345: 422 in schema * ISSUE-345: create subscriber list endpoint * ISSUE-345: new version * ISSUE-345: test fix * ISSUE-345: pipeline fix * ISSUE-345: doc fix * ISSUE-345: subscriberListManager methods * ISSUE-345: Request folder * ISSUE-345: create subscription endpoint * ISSUE-345: add subscription date to response * ISSUE-345: delete subscription endpoint * ISSUE-345: test fix * ISSUE-345: refactor subscription * ISSUE-345: remove from list * ISSUE-345: get campaigns endpoint * ISSUE-345: update runner * ISSUE-345: create message endpoint * ISSUE-345: get message by id endpoint * ISSUE-345: template id validation * ISSUE-345: fixtures in folders * ISSUE-345: campaign controller test * ISSUE-345: subscription controller test * ISSUE-345: add unit tests * ISSUE-345: phpstan + phpcs fix * ISSUE-345: update message endpoint * ISSUE-345: template controller * ISSUE-345: template by id * ISSUE-345: template property naming * ISSUE-345: create template endpoint * ISSUE-345: fix required/optional fields * ISSUE-345: delete message endpoint * ISSUE-345: validate that template has placeholder * ISSUE-345: add tests * ISSUE-345: use Constraint directory * ISSUE-345: add tests * ISSUE-345: delete template endpoint * ISSUE-345: fix 404 + template controller test * ISSUE-345: admin controller * ISSUE-345: fix createdAt/updatedAt * ISSUE-345: fix swagger * ISSUE-345: list cursor pagination * ISSUE-345: refactor validation logic * ISSUE-345: pagination data provider * ISSUE-345: subscriptions * ISSUE-345: paginated templates * ISSUE-345: split controller * ISSUE-345: add tests --------- Co-authored-by: Tatevik <[email protected]>
1 parent a177a59 commit 1d412e5

File tree

148 files changed

+8042
-807
lines changed

Some content is hidden

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

148 files changed

+8042
-807
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: [push, pull_request]
33
jobs:
44
main:
55
name: phpList Base Dist on PHP ${{ matrix.php-versions }}, with dist ${{ matrix.dependencies }} [Build, Test]
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-22.04
77
env:
88
DB_DATABASE: phplist
99
DB_USERNAME: root

.github/workflows/restapi-docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
make-restapi-docs:
1010
name: Checkout phpList rest-api and generate docs specification (OpenAPI latest-restapi.json)
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212
steps:
1313
- name: Checkout Repository
1414
uses: actions/checkout@v3
@@ -41,7 +41,7 @@ jobs:
4141

4242
deploy-docs:
4343
name: Deploy REST API Specification
44-
runs-on: ubuntu-20.04
44+
runs-on: ubuntu-22.04
4545
needs: make-restapi-docs
4646
steps:
4747
- name: Setup Node.js

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@
3131
},
3232
"require": {
3333
"php": "^8.1",
34-
"phplist/core": "v5.0.0-alpha3",
34+
"phplist/core": "v5.0.0-alpha6",
3535
"friendsofsymfony/rest-bundle": "*",
3636
"symfony/test-pack": "^1.0",
3737
"symfony/process": "^6.4",
38-
"zircote/swagger-php": "^4.11"
38+
"zircote/swagger-php": "^4.11",
39+
"ext-dom": "*"
3940
},
4041
"require-dev": {
4142
"phpunit/phpunit": "^10.0",

config/services.yml

+4-18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
imports:
2+
- { resource: 'services/*.yml' }
13
services:
24
Psr\Container\ContainerInterface:
35
alias: 'service_container'
@@ -8,10 +10,6 @@ services:
810
autowire: true
911
tags: ['controller.service_arguments']
1012

11-
# Symfony\Component\Serializer\SerializerInterface:
12-
# autowire: true
13-
# autoconfigure: true
14-
1513
my.secure_handler:
1614
class: PhpList\RestBundle\ViewHandler\SecuredViewHandler
1715

@@ -24,17 +22,5 @@ services:
2422
autowire: true
2523
autoconfigure: true
2624

27-
PhpList\Core\Domain\Repository\Messaging\SubscriberListRepository:
28-
autowire: true
29-
autoconfigure: true
30-
31-
PhpList\RestBundle\EventListener\ExceptionListener:
32-
tags:
33-
- { name: kernel.event_listener, event: kernel.exception }
34-
35-
PhpList\RestBundle\EventListener\ResponseListener:
36-
tags:
37-
- { name: kernel.event_listener, event: kernel.response }
38-
PhpList\RestBundle\Serializer\SubscriberNormalizer:
39-
tags: [ 'serializer.normalizer' ]
40-
autowire: true
25+
GuzzleHttp\ClientInterface:
26+
class: GuzzleHttp\Client

config/services/builders.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
PhpList\RestBundle\Service\Builder\MessageBuilder:
8+
autowire: true
9+
autoconfigure: true
10+
11+
PhpList\RestBundle\Service\Builder\MessageFormatBuilder:
12+
autowire: true
13+
autoconfigure: true
14+
15+
PhpList\RestBundle\Service\Builder\MessageScheduleBuilder:
16+
autowire: true
17+
autoconfigure: true
18+
19+
PhpList\RestBundle\Service\Builder\MessageContentBuilder:
20+
autowire: true
21+
autoconfigure: true
22+
23+
PhpList\RestBundle\Service\Builder\MessageOptionsBuilder:
24+
autowire: true
25+
autoconfigure: true

config/services/factories.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
PhpList\RestBundle\Service\Factory\PaginationCursorRequestFactory:
8+
autowire: true
9+
autoconfigure: true

config/services/listeners.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
PhpList\RestBundle\EventListener\ExceptionListener:
8+
tags:
9+
- { name: kernel.event_listener, event: kernel.exception }
10+
11+
PhpList\RestBundle\EventListener\ResponseListener:
12+
tags:
13+
- { name: kernel.event_listener, event: kernel.response }

config/services/managers.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
PhpList\RestBundle\Service\Manager\SubscriberManager:
8+
autowire: true
9+
autoconfigure: true
10+
11+
PhpList\RestBundle\Service\Manager\SessionManager:
12+
autowire: true
13+
autoconfigure: true
14+
15+
PhpList\RestBundle\Service\Manager\SubscriberListManager:
16+
autowire: true
17+
autoconfigure: true
18+
19+
PhpList\RestBundle\Service\Manager\SubscriptionManager:
20+
autowire: true
21+
autoconfigure: true
22+
23+
PhpList\RestBundle\Service\Manager\MessageManager:
24+
autowire: true
25+
autoconfigure: true
26+
27+
PhpList\RestBundle\Service\Manager\TemplateManager:
28+
autowire: true
29+
autoconfigure: true
30+
31+
PhpList\RestBundle\Service\Manager\TemplateImageManager:
32+
autowire: true
33+
autoconfigure: true
34+
35+
PhpList\RestBundle\Service\Manager\AdministratorManager:
36+
autowire: true
37+
autoconfigure: true

config/services/normalizers.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter: ~
8+
9+
Symfony\Component\Serializer\Normalizer\ObjectNormalizer:
10+
arguments:
11+
$classMetadataFactory: '@?serializer.mapping.class_metadata_factory'
12+
$nameConverter: '@Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter'
13+
14+
PhpList\RestBundle\Serializer\SubscriberNormalizer:
15+
tags: [ 'serializer.normalizer' ]
16+
autowire: true
17+
18+
PhpList\RestBundle\Serializer\AdministratorTokenNormalizer:
19+
tags: [ 'serializer.normalizer' ]
20+
autowire: true
21+
22+
PhpList\RestBundle\Serializer\SubscriberListNormalizer:
23+
tags: [ 'serializer.normalizer' ]
24+
autowire: true
25+
26+
PhpList\RestBundle\Serializer\SubscriptionNormalizer:
27+
tags: [ 'serializer.normalizer' ]
28+
autowire: true
29+
30+
PhpList\RestBundle\Serializer\MessageNormalizer:
31+
tags: [ 'serializer.normalizer' ]
32+
autowire: true
33+
34+
PhpList\RestBundle\Serializer\TemplateImageNormalizer:
35+
tags: [ 'serializer.normalizer' ]
36+
autowire: true
37+
38+
PhpList\RestBundle\Serializer\TemplateNormalizer:
39+
tags: [ 'serializer.normalizer' ]
40+
autowire: true
41+
42+
PhpList\RestBundle\Serializer\AdministratorNormalizer:
43+
tags: [ 'serializer.normalizer' ]
44+
autowire: true
45+
46+
PhpList\RestBundle\Serializer\CursorPaginationNormalizer:
47+
autowire: true

config/services/providers.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
_defaults:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
PhpList\RestBundle\Service\Provider\PaginatedDataProvider:
8+
autowire: true
9+
autoconfigure: true

config/services/validators.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
services:
2+
PhpList\RestBundle\Validator\RequestValidator:
3+
autowire: true
4+
autoconfigure: true
5+
public: false
6+
7+
PhpList\RestBundle\Validator\Constraint\UniqueEmailValidator:
8+
autowire: true
9+
autoconfigure: true
10+
tags: [ 'validator.constraint_validator' ]
11+
12+
PhpList\RestBundle\Validator\Constraint\EmailExistsValidator:
13+
autowire: true
14+
autoconfigure: true
15+
tags: [ 'validator.constraint_validator' ]
16+
17+
PhpList\RestBundle\Validator\Constraint\TemplateExistsValidator:
18+
autowire: true
19+
autoconfigure: true
20+
tags: [ 'validator.constraint_validator' ]
21+
22+
PhpList\RestBundle\Validator\TemplateLinkValidator:
23+
autowire: true
24+
autoconfigure: true
25+
26+
PhpList\RestBundle\Validator\TemplateImageValidator:
27+
autowire: true
28+
autoconfigure: true
29+
30+
PhpList\RestBundle\Validator\Constraint\ContainsPlaceholderValidator:
31+
tags: ['validator.constraint_validator']
32+
33+
PhpList\RestBundle\Validator\Constraint\UniqueLoginNameValidator:
34+
autowire: true
35+
autoconfigure: true
36+
tags: [ 'validator.constraint_validator' ]

0 commit comments

Comments
 (0)