Skip to content

Commit

Permalink
Merge pull request #15 from apioo/feat/add-server-gen
Browse files Browse the repository at this point in the history
add typescript server generator
  • Loading branch information
chriskapp authored Aug 20, 2024
2 parents bca5999 + 99a96d8 commit b411796
Show file tree
Hide file tree
Showing 269 changed files with 5,718 additions and 213 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class MyController
{
#[Get]
#[Path('/my/endpoint/:id')]
public function getModel(int $id, int $year): \My\Response\Model
public function getModel(#[Param] int $id, #[Query] int $year): \My\Response\Model
{
// @TODO implement
}

#[Post]
#[Path('/my/endpoint')]
public function insertModel(\My\Request\Model $model): \My\Response\Model
public function insertModel(#[Body] \My\Request\Model $model): \My\Response\Model
{
// @TODO implement
}
Expand Down
6 changes: 3 additions & 3 deletions bin/api
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env php
<?php
/*
* PSX is a open source PHP framework to develop RESTful APIs.
* For the current version and informations visit <http://phpsx.org>
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
<directory name="src/Generator/Client/Language" />
<directory name="src/Generator/Server/Template" />
</ignoreFiles>
</projectFiles>
</psalm>
2 changes: 1 addition & 1 deletion src/ApiManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/ApiManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
35 changes: 35 additions & 0 deletions src/Attribute/Body.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/*
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace PSX\Api\Attribute;

use Attribute;

/**
* Body
*
* @author Christoph Kappestein <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link https://phpsx.org
*/
#[Attribute(Attribute::TARGET_PARAMETER)]
class Body
{
}
2 changes: 1 addition & 1 deletion src/Attribute/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Exclude.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
41 changes: 41 additions & 0 deletions src/Attribute/Header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/*
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace PSX\Api\Attribute;

use Attribute;

/**
* Header
*
* @author Christoph Kappestein <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link https://phpsx.org
*/
#[Attribute(Attribute::TARGET_PARAMETER)]
class Header
{
public function __construct(
public ?string $name = null,
public ?string $description = null,
)
{
}
}
2 changes: 1 addition & 1 deletion src/Attribute/HeaderParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Incoming.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/MethodAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/OperationId.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Outgoing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
41 changes: 41 additions & 0 deletions src/Attribute/Param.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/*
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace PSX\Api\Attribute;

use Attribute;

/**
* Param
*
* @author Christoph Kappestein <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link https://phpsx.org
*/
#[Attribute(Attribute::TARGET_PARAMETER)]
class Param
{
public function __construct(
public ?string $name = null,
public ?string $description = null,
)
{
}
}
2 changes: 1 addition & 1 deletion src/Attribute/ParamAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/PathParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Put.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
41 changes: 41 additions & 0 deletions src/Attribute/Query.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/*
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace PSX\Api\Attribute;

use Attribute;

/**
* Query
*
* @author Christoph Kappestein <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link https://phpsx.org
*/
#[Attribute(Attribute::TARGET_PARAMETER)]
class Query
{
public function __construct(
public ?string $name = null,
public ?string $description = null,
)
{
}
}
2 changes: 1 addition & 1 deletion src/Attribute/QueryParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/SchemaAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* PSX is an open source PHP framework to develop RESTful APIs.
* For the current version and information visit <https://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
* Copyright (c) Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit b411796

Please sign in to comment.