Compare commits
114 commits
develop
...
shift-1309
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b095525cf8 | ||
![]() |
e6566cbd54 | ||
![]() |
ebe6a65c56 | ||
![]() |
5496e0ed04 | ||
![]() |
258eff794e | ||
![]() |
dc6d6cce6b | ||
![]() |
9bf61c8bbe | ||
![]() |
19b662e271 | ||
![]() |
c5eabf6c8f | ||
![]() |
b1cd122c8f | ||
![]() |
a3fb951a43 | ||
![]() |
713c9c11db | ||
![]() |
7f3d2dd7f7 | ||
![]() |
ca0a90e775 | ||
![]() |
100c62f4f2 | ||
![]() |
e780f8778e | ||
![]() |
0b6715b9d6 | ||
![]() |
6be445c7dc | ||
![]() |
822bd42748 | ||
![]() |
299e52b8da | ||
![]() |
0679acd7f3 | ||
![]() |
e309038e0f | ||
![]() |
f76e21f278 | ||
![]() |
efd277608d | ||
![]() |
669b536c65 | ||
![]() |
3b8431b523 | ||
![]() |
3898ebc5b0 | ||
![]() |
b84c6afaef | ||
![]() |
5ff272fd5a | ||
![]() |
12d1435a89 | ||
![]() |
77be077bf5 | ||
![]() |
393c86aaac | ||
![]() |
3ed6bbd699 | ||
![]() |
c09128537f | ||
![]() |
a3b68aba98 | ||
![]() |
55c25c4ffc | ||
![]() |
679c456421 | ||
![]() |
666969068a | ||
![]() |
54e58ff185 | ||
![]() |
7b1390f10e | ||
![]() |
4b1059f28c | ||
![]() |
baf0e9f9b9 | ||
![]() |
4417ddea8c | ||
![]() |
1f16ad467a | ||
![]() |
52d415b939 | ||
![]() |
084374ceb7 | ||
![]() |
d84ed76c24 | ||
![]() |
88bcd8a027 | ||
![]() |
ee4018e0b3 | ||
![]() |
123448817c | ||
![]() |
289ba37b64 | ||
![]() |
44e5614976 | ||
![]() |
4fe3803570 | ||
![]() |
d3941bb95d | ||
![]() |
049b6fc3ec | ||
![]() |
fbaa7b10ea | ||
![]() |
a5d45ccbb8 | ||
![]() |
47ed8cde3a | ||
![]() |
c66139f913 | ||
![]() |
2b9dd876dc | ||
![]() |
ea333eba0a | ||
![]() |
683e04ac50 | ||
![]() |
a7725e1fae | ||
![]() |
2f69dcc3c7 | ||
![]() |
9a6cb97feb | ||
![]() |
5bd6f99cac | ||
![]() |
eb3a5d5763 | ||
![]() |
03d9bebde0 | ||
![]() |
b341bb0b24 | ||
![]() |
639fd8ccfe | ||
![]() |
3f1832926f | ||
![]() |
1e87b7b8fc | ||
![]() |
e26f1bc83b | ||
![]() |
a11615fbb5 | ||
![]() |
f21df09282 | ||
![]() |
9b255a5f45 | ||
![]() |
8e49e3fd2a | ||
![]() |
a18acba0c5 | ||
![]() |
0d4ac50e0e | ||
![]() |
6db31f110f | ||
![]() |
6582687f4f | ||
![]() |
40b9d6324a | ||
![]() |
9401b1a4ad | ||
![]() |
381f8635c6 | ||
![]() |
52f67b23b9 | ||
![]() |
8c744f84d3 | ||
![]() |
907f227b65 | ||
![]() |
fc39daa521 | ||
![]() |
e78c413d4a | ||
![]() |
a36e4ddaf8 | ||
![]() |
3725d155c5 | ||
![]() |
a87955c292 | ||
![]() |
4515d66df3 | ||
![]() |
24aad273e2 | ||
![]() |
43fcfec4bc | ||
![]() |
92ba6d9f5e | ||
![]() |
6390a3ba6e | ||
![]() |
c58422b1d7 | ||
![]() |
cd1fc3dc28 | ||
![]() |
00cce95c24 | ||
![]() |
6e47afcbc3 | ||
![]() |
a9af4df049 | ||
![]() |
88cee5cc24 | ||
![]() |
1277e1b284 | ||
![]() |
2f2acf0814 | ||
![]() |
aa9dfe7548 | ||
![]() |
a5b04ac3ef | ||
![]() |
194feda2a5 | ||
![]() |
0b6763ce03 | ||
![]() |
70d01d8c0b | ||
![]() |
de7a6cc42a | ||
![]() |
a8249a456a | ||
![]() |
fc9050dc3e | ||
![]() |
b337b38914 |
1076 changed files with 30478 additions and 14101 deletions
2
.env.ci
2
.env.ci
|
@ -15,7 +15,7 @@ DB_DATABASE=convoy
|
|||
DB_USERNAME=convoy_user
|
||||
DB_PASSWORD=YzLa2BCBwDGWVkpG
|
||||
|
||||
CACHE_DRIVER=redis
|
||||
CACHE_STORE=redis
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=redis
|
||||
SESSION_DRIVER=redis
|
||||
|
|
|
@ -4,9 +4,9 @@ APP_KEY=
|
|||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
APP_TIMEZONE=UTC
|
||||
APP_LOCALE=en
|
||||
APP_MAINTENANCE_DRIVER=cache
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=database
|
||||
|
@ -15,7 +15,7 @@ DB_DATABASE=convoy
|
|||
DB_USERNAME=convoy_user
|
||||
DB_PASSWORD=
|
||||
|
||||
CACHE_DRIVER=redis
|
||||
CACHE_STORE=redis
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=redis
|
||||
SESSION_DRIVER=redis
|
||||
|
|
50
.env.full_example
Normal file
50
.env.full_example
Normal file
|
@ -0,0 +1,50 @@
|
|||
APP_NAME=Convoy
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_TIMEZONE=UTC
|
||||
APP_LOCALE=en
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
APP_MAINTENANCE_STORE=database
|
||||
BCRYPT_ROUNDS=12
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=database
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=convoy
|
||||
DB_USERNAME=convoy_user
|
||||
DB_PASSWORD=
|
||||
|
||||
CACHE_STORE=redis
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=redis
|
||||
SESSION_DRIVER=redis
|
||||
SESSION_LIFETIME=525600
|
||||
SESSION_ENCRYPT=false
|
||||
SESSION_PATH=/
|
||||
SESSION_DOMAIN=null
|
||||
|
||||
REDIS_HOST=redis
|
||||
REDIS_PASSWORD=
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=mailhog
|
||||
MAIL_PORT=1025
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
PHP_XDEBUG=false
|
||||
PHP_XDEBUG_MODE='debug'
|
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
|
@ -45,6 +45,7 @@ jobs:
|
|||
files_to_include=(
|
||||
".editorconfig"
|
||||
".env.example"
|
||||
".env.full_example"
|
||||
".gitattributes"
|
||||
".gitignore"
|
||||
".prettierignore"
|
||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -19,4 +19,10 @@ _ide_*.php
|
|||
stats.html
|
||||
.fleet
|
||||
lang/php_*.json
|
||||
/resources/scripts/routeTree.gen.ts
|
||||
.DS_Store
|
||||
._.DS_Store
|
||||
**/.DS_Store
|
||||
**/._.DS_Store
|
||||
.php-cs-fixer.cache
|
||||
.phpunit.cache
|
165
.php-cs-fixer.php
Normal file
165
.php-cs-fixer.php
Normal file
|
@ -0,0 +1,165 @@
|
|||
<?php
|
||||
|
||||
use PhpCsFixer\Config;
|
||||
use PhpCsFixer\Finder;
|
||||
|
||||
$rules = [
|
||||
'array_indentation' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'binary_operator_spaces' => [
|
||||
'default' => 'single_space',
|
||||
'operators' => ['=>' => null],
|
||||
],
|
||||
'blank_line_after_namespace' => true,
|
||||
'blank_line_after_opening_tag' => true,
|
||||
'blank_line_before_statement' => [
|
||||
'statements' => ['return'],
|
||||
],
|
||||
'braces' => true,
|
||||
'cast_spaces' => true,
|
||||
'class_attributes_separation' => [
|
||||
'elements' => [
|
||||
'const' => 'one',
|
||||
'method' => 'one',
|
||||
'property' => 'one',
|
||||
'trait_import' => 'none',
|
||||
],
|
||||
],
|
||||
'class_definition' => [
|
||||
'multi_line_extends_each_single_line' => true,
|
||||
'single_item_single_line' => true,
|
||||
'single_line' => true,
|
||||
],
|
||||
'concat_space' => [
|
||||
'spacing' => 'none',
|
||||
],
|
||||
'constant_case' => ['case' => 'lower'],
|
||||
'declare_equal_normalize' => true,
|
||||
'elseif' => true,
|
||||
'encoding' => true,
|
||||
'full_opening_tag' => true,
|
||||
'fully_qualified_strict_types' => true, // added by Shift
|
||||
'function_declaration' => true,
|
||||
'function_typehint_space' => true,
|
||||
'general_phpdoc_tag_rename' => true,
|
||||
'heredoc_to_nowdoc' => true,
|
||||
'include' => true,
|
||||
'increment_style' => ['style' => 'post'],
|
||||
'indentation_type' => true,
|
||||
'linebreak_after_opening_tag' => true,
|
||||
'line_ending' => true,
|
||||
'lowercase_cast' => true,
|
||||
'lowercase_keywords' => true,
|
||||
'lowercase_static_reference' => true, // added from Symfony
|
||||
'magic_method_casing' => true, // added from Symfony
|
||||
'magic_constant_casing' => true,
|
||||
'method_argument_space' => [
|
||||
'on_multiline' => 'ignore',
|
||||
],
|
||||
'multiline_whitespace_before_semicolons' => [
|
||||
'strategy' => 'no_multi_line',
|
||||
],
|
||||
'native_function_casing' => true,
|
||||
'no_alias_functions' => true,
|
||||
'no_extra_blank_lines' => [
|
||||
'tokens' => [
|
||||
'extra',
|
||||
'throw',
|
||||
'use',
|
||||
],
|
||||
],
|
||||
'no_blank_lines_after_class_opening' => true,
|
||||
'no_blank_lines_after_phpdoc' => true,
|
||||
'no_closing_tag' => true,
|
||||
'no_empty_phpdoc' => true,
|
||||
'no_empty_statement' => true,
|
||||
'no_leading_import_slash' => true,
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
'no_mixed_echo_print' => [
|
||||
'use' => 'echo',
|
||||
],
|
||||
'no_multiline_whitespace_around_double_arrow' => true,
|
||||
'no_short_bool_cast' => true,
|
||||
'no_singleline_whitespace_before_semicolons' => true,
|
||||
'no_spaces_after_function_name' => true,
|
||||
'no_spaces_around_offset' => [
|
||||
'positions' => ['inside', 'outside'],
|
||||
],
|
||||
'no_spaces_inside_parenthesis' => true,
|
||||
'no_trailing_comma_in_list_call' => true,
|
||||
'no_trailing_comma_in_singleline_array' => true,
|
||||
'no_trailing_whitespace' => true,
|
||||
'no_trailing_whitespace_in_comment' => true,
|
||||
'no_unneeded_control_parentheses' => [
|
||||
'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'],
|
||||
],
|
||||
'no_unreachable_default_argument_value' => true,
|
||||
'no_useless_return' => true,
|
||||
'no_whitespace_before_comma_in_array' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'normalize_index_brace' => true,
|
||||
'not_operator_with_successor_space' => true,
|
||||
'object_operator_without_whitespace' => true,
|
||||
'ordered_imports' => ['sort_algorithm' => 'alpha'],
|
||||
'psr_autoloading' => true,
|
||||
'phpdoc_indent' => true,
|
||||
'phpdoc_inline_tag_normalizer' => true,
|
||||
'phpdoc_no_access' => true,
|
||||
'phpdoc_no_package' => true,
|
||||
'phpdoc_no_useless_inheritdoc' => true,
|
||||
'phpdoc_scalar' => true,
|
||||
'phpdoc_single_line_var_spacing' => true,
|
||||
'phpdoc_summary' => false,
|
||||
'phpdoc_to_comment' => false, // override to preserve user preference
|
||||
'phpdoc_tag_type' => true,
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_types' => true,
|
||||
'phpdoc_var_without_name' => true,
|
||||
'self_accessor' => true,
|
||||
'short_scalar_cast' => true,
|
||||
'simplified_null_return' => false, // disabled as "risky"
|
||||
'single_blank_line_at_eof' => true,
|
||||
'single_blank_line_before_namespace' => true,
|
||||
'single_class_element_per_statement' => [
|
||||
'elements' => ['const', 'property'],
|
||||
],
|
||||
'single_import_per_statement' => true,
|
||||
'single_line_after_imports' => true,
|
||||
'single_line_comment_style' => [
|
||||
'comment_types' => ['hash'],
|
||||
],
|
||||
'single_quote' => true,
|
||||
'space_after_semicolon' => true,
|
||||
'standardize_not_equals' => true,
|
||||
'switch_case_semicolon_to_colon' => true,
|
||||
'switch_case_space' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
|
||||
'trim_array_spaces' => true,
|
||||
'unary_operator_spaces' => true,
|
||||
'visibility_required' => [
|
||||
'elements' => ['method', 'property'],
|
||||
],
|
||||
'whitespace_after_comma_in_array' => true,
|
||||
];
|
||||
|
||||
|
||||
$finder = Finder::create()
|
||||
->in([
|
||||
__DIR__ . '/app',
|
||||
__DIR__ . '/config',
|
||||
__DIR__ . '/database',
|
||||
__DIR__ . '/resources',
|
||||
__DIR__ . '/routes',
|
||||
__DIR__ . '/tests',
|
||||
])
|
||||
->name('*.php')
|
||||
->notName('*.blade.php')
|
||||
->ignoreDotFiles(true)
|
||||
->ignoreVCS(true);
|
||||
|
||||
return (new Config())
|
||||
->setFinder($finder)
|
||||
->setRules($rules)
|
||||
->setRiskyAllowed(true)
|
||||
->setUsingCache(true);
|
|
@ -1,29 +1,37 @@
|
|||
{
|
||||
"arrowParens": "avoid",
|
||||
"bracketSameLine": false,
|
||||
"bracketSpacing": true,
|
||||
"embeddedLanguageFormatting": "auto",
|
||||
"htmlWhitespaceSensitivity": "css",
|
||||
"insertPragma": false,
|
||||
"jsxSingleQuote": true,
|
||||
"printWidth": 80,
|
||||
"proseWrap": "preserve",
|
||||
"quoteProps": "consistent",
|
||||
"requirePragma": false,
|
||||
"semi": false,
|
||||
"singleAttributePerLine": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "es5",
|
||||
"useTabs": false,
|
||||
"vueIndentScriptAndStyle": false,
|
||||
"tabWidth": 4,
|
||||
"importOrderSeparation": true,
|
||||
"importOrderSortSpecifiers": true,
|
||||
"importOrder": [
|
||||
"^@/api/(.*)$",
|
||||
"^@/components/elements/(.*)$",
|
||||
"^@/components/(.*)$",
|
||||
"^[./]"
|
||||
],
|
||||
"plugins": ["@trivago/prettier-plugin-sort-imports"]
|
||||
"arrowParens": "avoid",
|
||||
"bracketSameLine": false,
|
||||
"bracketSpacing": true,
|
||||
"embeddedLanguageFormatting": "auto",
|
||||
"htmlWhitespaceSensitivity": "css",
|
||||
"insertPragma": false,
|
||||
"jsxSingleQuote": true,
|
||||
"printWidth": 80,
|
||||
"proseWrap": "preserve",
|
||||
"quoteProps": "consistent",
|
||||
"requirePragma": false,
|
||||
"semi": false,
|
||||
"singleAttributePerLine": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "es5",
|
||||
"useTabs": false,
|
||||
"vueIndentScriptAndStyle": false,
|
||||
"tabWidth": 4,
|
||||
"importOrderSeparation": true,
|
||||
"importOrderSortSpecifiers": true,
|
||||
"importOrder": [
|
||||
"<THIRD_PARTY_MODULES>",
|
||||
"^@/lib/(.*)$",
|
||||
"^@/api/(.*)$",
|
||||
"^@/components/layouts/(.*)$",
|
||||
"^@/components/interfaces/(.*)$",
|
||||
"^@/components/ui/(.*)$",
|
||||
"^@/components/(.*)$",
|
||||
"^@/assets/(.*)$",
|
||||
"^[./]"
|
||||
],
|
||||
"plugins": [
|
||||
"@trivago/prettier-plugin-sort-imports",
|
||||
"prettier-plugin-tailwindcss"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Actions\Fortify;
|
||||
namespace App\Actions\Fortify;
|
||||
|
||||
use Convoy\Models\User;
|
||||
use Illuminate\Validation\Rule;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Laravel\Fortify\Contracts\CreatesNewUsers;
|
||||
|
||||
class CreateNewUser implements CreatesNewUsers
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Actions\Fortify;
|
||||
namespace App\Actions\Fortify;
|
||||
|
||||
use Laravel\Fortify\Rules\Password;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Actions\Fortify;
|
||||
namespace App\Actions\Fortify;
|
||||
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Actions\Fortify;
|
||||
namespace App\Actions\Fortify;
|
||||
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Actions\Fortify;
|
||||
namespace App\Actions\Fortify;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
|
||||
|
||||
class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Casts;
|
||||
namespace App\Casts;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class NullableEncrypter implements CastsAttributes
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ class NullableEncrypter implements CastsAttributes
|
|||
*/
|
||||
public function get(Model $model, string $key, mixed $value, array $attributes): ?string
|
||||
{
|
||||
return !empty($value) ? app(Encrypter::class)->decrypt($value) : null;
|
||||
return ! empty($value) ? app(Encrypter::class)->decrypt($value) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,6 +25,6 @@ class NullableEncrypter implements CastsAttributes
|
|||
*/
|
||||
public function set(Model $model, string $key, mixed $value, array $attributes): ?string
|
||||
{
|
||||
return !empty($value) ? app(Encrypter::class)->encrypt($value) : null;
|
||||
return ! empty($value) ? app(Encrypter::class)->encrypt($value) : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Casts;
|
||||
namespace App\Casts;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MebibytesToAndFromBytes implements CastsAttributes
|
||||
class StorageSizeCast implements CastsAttributes
|
||||
{
|
||||
/**
|
||||
* Cast the given value.
|
||||
*/
|
||||
public function get(Model $model, string $key, mixed $value, array $attributes): ?int
|
||||
{
|
||||
return !is_null($value) ? $value * 1048576 : $value; // Convert from megabytes to bytes
|
||||
return $value >= 0 ? $value * 1048576 : -1; // Convert from megabytes to bytes
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,6 +20,8 @@ class MebibytesToAndFromBytes implements CastsAttributes
|
|||
*/
|
||||
public function set(Model $model, string $key, mixed $value, array $attributes): ?int
|
||||
{
|
||||
return !is_null($value) ? intval(floor($value / 1048576)) : $value; // Convert from bytes to megabytes to prevent overflow
|
||||
return $value >= 0 ? intval(
|
||||
floor($value / 1048576),
|
||||
) : -1; // Convert from bytes to megabytes to prevent overflow
|
||||
}
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Console\Commands\Maintenance;
|
||||
namespace App\Console\Commands\Maintenance;
|
||||
|
||||
use App\Repositories\Eloquent\BackupRepository;
|
||||
use Carbon\CarbonImmutable;
|
||||
use InvalidArgumentException;
|
||||
use Illuminate\Console\Command;
|
||||
use Convoy\Repositories\Eloquent\BackupRepository;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class PruneOrphanedBackupsCommand extends Command
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Console\Commands\Maintenance;
|
||||
namespace App\Console\Commands\Maintenance;
|
||||
|
||||
use Convoy\Models\Node;
|
||||
use App\Jobs\Node\PruneUsersJob;
|
||||
use App\Models\Node;
|
||||
use Illuminate\Console\Command;
|
||||
use Convoy\Jobs\Node\PruneUsersJob;
|
||||
use Illuminate\Console\View\Components\Task;
|
||||
|
||||
class PruneUsersCommand extends Command
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Console\Commands\Server;
|
||||
namespace App\Console\Commands\Server;
|
||||
|
||||
use Convoy\Models\Server;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ResetUsagesCommand extends Command
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Console\Commands\Server;
|
||||
namespace App\Console\Commands\Server;
|
||||
|
||||
use Convoy\Models\Node;
|
||||
use App\Jobs\Node\SyncServerRateLimitsJob;
|
||||
use App\Models\Node;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Console\View\Components\Task;
|
||||
use Convoy\Jobs\Node\SyncServerRateLimitsJob;
|
||||
|
||||
class UpdateRateLimitsCommand extends Command
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Console\Commands\Server;
|
||||
namespace App\Console\Commands\Server;
|
||||
|
||||
use Convoy\Models\Node;
|
||||
use App\Jobs\Node\SyncServerUsagesJob;
|
||||
use App\Models\Node;
|
||||
use Illuminate\Console\Command;
|
||||
use Convoy\Jobs\Node\SyncServerUsagesJob;
|
||||
use Illuminate\Console\View\Components\Task;
|
||||
|
||||
class UpdateUsagesCommand extends Command
|
||||
|
|
|
@ -23,13 +23,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Convoy\Console\Commands\User;
|
||||
namespace App\Console\Commands\User;
|
||||
|
||||
use App\Exceptions\Model\DataValidationException;
|
||||
use App\Models\User;
|
||||
use Exception;
|
||||
use Convoy\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Convoy\Exceptions\Model\DataValidationException;
|
||||
|
||||
class MakeUserCommand extends Command
|
||||
{
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Console;
|
||||
|
||||
use Convoy\Models\ActivityLog;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Database\Console\PruneCommand;
|
||||
use Convoy\Console\Commands\Server\ResetUsagesCommand;
|
||||
use Convoy\Console\Commands\Server\UpdateUsagesCommand;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
use Convoy\Console\Commands\Maintenance\PruneUsersCommand;
|
||||
use Convoy\Console\Commands\Server\UpdateRateLimitsCommand;
|
||||
use Convoy\Console\Commands\Maintenance\PruneOrphanedBackupsCommand;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
$schedule->command('queue:prune-batches')->daily();
|
||||
|
||||
if (config('backups.prune_age')) {
|
||||
// Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted.
|
||||
$schedule->command(PruneOrphanedBackupsCommand::class)->everyThirtyMinutes();
|
||||
}
|
||||
|
||||
if (config('activity.prune_days')) {
|
||||
$schedule->command(PruneCommand::class, ['--model' => [ActivityLog::class]])->daily();
|
||||
}
|
||||
|
||||
$schedule->command(ResetUsagesCommand::class)->daily();
|
||||
$schedule->command(PruneUsersCommand::class)->daily();
|
||||
$schedule->command(UpdateUsagesCommand::class)->everyFiveMinutes();
|
||||
$schedule->command(UpdateRateLimitsCommand::class)->everyTenMinutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*/
|
||||
protected function commands(): void
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
//require base_path('routes/console.php');
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Contracts\Repository;
|
||||
namespace App\Contracts\Repository;
|
||||
|
||||
use Convoy\Models\Server;
|
||||
use Convoy\Models\ActivityLog;
|
||||
use App\Models\ActivityLog;
|
||||
use App\Models\Server;
|
||||
|
||||
interface ActivityRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Contracts\Repository;
|
||||
namespace App\Contracts\Repository;
|
||||
|
||||
use App\Exceptions\Model\DataValidationException;
|
||||
use App\Exceptions\Repository\RecordNotFoundException;
|
||||
use Closure;
|
||||
use Illuminate\Support\Collection;
|
||||
use Convoy\Exceptions\Model\DataValidationException;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Convoy\Exceptions\Repository\RecordNotFoundException;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
interface RepositoryInterface
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Contracts\Repository;
|
||||
namespace App\Contracts\Repository;
|
||||
|
||||
use Convoy\Models\Server;
|
||||
use Convoy\Exceptions\Repository\RecordNotFoundException;
|
||||
use App\Exceptions\Repository\RecordNotFoundException;
|
||||
use App\Models\Server;
|
||||
|
||||
interface ServerRepositoryInterface extends RepositoryInterface
|
||||
{
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Helpers;
|
||||
namespace App\Data\Helpers;
|
||||
|
||||
use App\Enums\Helpers\ChecksumAlgorithm;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Convoy\Enums\Helpers\ChecksumAlgorithm;
|
||||
|
||||
class ChecksumData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public string $checksum,
|
||||
public string $checksum,
|
||||
public ChecksumAlgorithm $algorithm,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Node\Access;
|
||||
namespace App\Data\Node\Access;
|
||||
|
||||
use App\Enums\Node\Access\RealmType;
|
||||
use Carbon\Carbon;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\Casts\EnumCast;
|
||||
use Convoy\Enums\Node\Access\RealmType;
|
||||
use Spatie\LaravelData\Attributes\WithCast;
|
||||
use Spatie\LaravelData\Attributes\Validation\Min;
|
||||
use Spatie\LaravelData\Attributes\Validation\Max;
|
||||
use Spatie\LaravelData\Attributes\Validation\Min;
|
||||
use Spatie\LaravelData\Attributes\WithCast;
|
||||
use Spatie\LaravelData\Casts\EnumCast;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class CreateUserData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
#[WithCast(EnumCast::class)]
|
||||
public RealmType $realm_type,
|
||||
public bool $enabled,
|
||||
public bool $enabled,
|
||||
#[Min(1), Max(60)]
|
||||
public ?string $username = null,
|
||||
public ?string $username = null,
|
||||
#[Min(1), Max(64)]
|
||||
public ?string $password = null,
|
||||
public ?Carbon $expires_at = null,
|
||||
)
|
||||
{
|
||||
public ?string $password = null,
|
||||
public ?Carbon $expires_at = null,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Node\Access;
|
||||
namespace App\Data\Node\Access;
|
||||
|
||||
use App\Enums\Node\Access\RealmType;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Convoy\Enums\Node\Access\RealmType;
|
||||
|
||||
class UserCredentialsData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public string $username,
|
||||
public string $username,
|
||||
public RealmType $realm_type,
|
||||
public string $ticket,
|
||||
public string $csrf_token,
|
||||
)
|
||||
{
|
||||
|
||||
public string $ticket,
|
||||
public string $csrf_token,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function fromRaw(array $raw): UserCredentialsData
|
||||
public static function fromRaw(array $raw): self
|
||||
{
|
||||
return new self(...[
|
||||
'username' => explode('@', $raw['username'])[0],
|
||||
|
@ -26,4 +24,4 @@ class UserCredentialsData extends Data
|
|||
'csrf_token' => $raw['CSRFPreventionToken'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Node\Access;
|
||||
namespace App\Data\Node\Access;
|
||||
|
||||
use App\Enums\Node\Access\RealmType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Arr;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\Casts\EnumCast;
|
||||
use Convoy\Enums\Node\Access\RealmType;
|
||||
use Spatie\LaravelData\Attributes\WithCast;
|
||||
use Spatie\LaravelData\Casts\EnumCast;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class UserData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public string $username,
|
||||
public ?string $email,
|
||||
public string $username,
|
||||
public ?string $email,
|
||||
#[WithCast(EnumCast::class)]
|
||||
public RealmType $realm_type,
|
||||
public bool $enabled,
|
||||
public ?Carbon $expires_at,
|
||||
)
|
||||
{
|
||||
public bool $enabled,
|
||||
public ?Carbon $expires_at,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function fromRaw(array $raw): UserData
|
||||
public static function fromRaw(array $raw): self
|
||||
{
|
||||
return new self(...[
|
||||
'username' => explode('@', $raw['userid'])[0],
|
||||
'email' => Arr::get($raw, 'email'),
|
||||
'realm_type' => RealmType::from($raw['realm-type']),
|
||||
'enabled' => (bool)$raw['enable'],
|
||||
'enabled' => (bool) $raw['enable'],
|
||||
'expires_at' => Arr::get($raw, 'expire') ? Carbon::createFromTimestamp($raw['expire']) : null,
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Node\Storage;
|
||||
namespace App\Data\Node\Storage;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -9,8 +9,7 @@ class FileMetaData extends Data
|
|||
public function __construct(
|
||||
public string $file_name,
|
||||
public string $mime_type,
|
||||
public int $size,
|
||||
)
|
||||
{
|
||||
public int $size,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Node\Storage;
|
||||
namespace App\Data\Node\Storage;
|
||||
|
||||
use Carbon\CarbonInterface;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
@ -8,10 +8,9 @@ use Spatie\LaravelData\Data;
|
|||
class IsoData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public string $file_name,
|
||||
public int $size,
|
||||
public string $file_name,
|
||||
public int $size,
|
||||
public CarbonInterface $created_at,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
24
app/Data/Node/Storage/StorageData.php
Normal file
24
app/Data/Node/Storage/StorageData.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Data\Node\Storage;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class StorageData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public string $name,
|
||||
public int $used,
|
||||
public int $free,
|
||||
public int $total,
|
||||
public bool $enabled,
|
||||
public bool $online,
|
||||
public bool $has_kvm,
|
||||
public bool $has_lxc,
|
||||
public bool $has_lxc_templates,
|
||||
public bool $has_backups,
|
||||
public bool $has_iso,
|
||||
public bool $has_snippets,
|
||||
) {
|
||||
}
|
||||
}
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Deployments;
|
||||
namespace App\Data\Server\Deployments;
|
||||
|
||||
use App\Data\Server\Eloquent\AddressData;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Convoy\Data\Server\Eloquent\AddressData;
|
||||
|
||||
class CloudinitAddressConfigData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public ?AddressData $ipv4,
|
||||
public ?AddressData $ipv6,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Deployments;
|
||||
namespace App\Data\Server\Deployments;
|
||||
|
||||
use Convoy\Models\Server;
|
||||
use Convoy\Models\Template;
|
||||
use App\Models\Server;
|
||||
use App\Models\Template;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class ServerDeploymentData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public Server $server,
|
||||
public Server $server,
|
||||
public ?Template $template,
|
||||
public ?string $account_password,
|
||||
public bool $should_create_server,
|
||||
public bool $start_on_completion,
|
||||
)
|
||||
{
|
||||
public string $account_password,
|
||||
public bool $should_create_server,
|
||||
public bool $start_on_completion,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Eloquent;
|
||||
namespace App\Data\Server\Eloquent;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\Attributes\Validation\IP;
|
||||
use Spatie\LaravelData\Attributes\Validation\In;
|
||||
use Spatie\LaravelData\Attributes\Validation\IP;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class AddressData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public int $id,
|
||||
public int $address_pool_id,
|
||||
public ?int $server_id,
|
||||
public int $id,
|
||||
public int $address_pool_id,
|
||||
public ?int $server_id,
|
||||
#[In(['ipv4', 'ipv6'])]
|
||||
public string $type,
|
||||
public string $type,
|
||||
#[IP]
|
||||
public string $address,
|
||||
public int $cidr,
|
||||
public string $gateway,
|
||||
public string $address,
|
||||
public int $cidr,
|
||||
public string $gateway,
|
||||
public ?string $mac_address,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Eloquent;
|
||||
namespace App\Data\Server\Eloquent;
|
||||
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
|
||||
class ServerAddressesData extends Data
|
||||
{
|
||||
|
@ -13,7 +13,6 @@ class ServerAddressesData extends Data
|
|||
public DataCollection $ipv4,
|
||||
#[DataCollectionOf(AddressData::class)]
|
||||
public DataCollection $ipv6,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Eloquent;
|
||||
namespace App\Data\Server\Eloquent;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class ServerEloquentData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public int $id,
|
||||
public string $uuid_short,
|
||||
public string $uuid,
|
||||
public int $node_id,
|
||||
public string $hostname,
|
||||
public string $name,
|
||||
public ?string $description,
|
||||
public ?string $status,
|
||||
public int $id,
|
||||
public string $uuid_short,
|
||||
public string $uuid,
|
||||
public int $node_id,
|
||||
public string $hostname,
|
||||
public string $name,
|
||||
public ?string $description,
|
||||
public ?string $status,
|
||||
public ServerUsagesData $usages,
|
||||
public ServerLimitsData $limits,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Eloquent;
|
||||
namespace App\Data\Server\Eloquent;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class ServerLimitsData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public int $cpu,
|
||||
public int $memory,
|
||||
public int $disk,
|
||||
public ?int $snapshots,
|
||||
public ?int $backups,
|
||||
public ?int $bandwidth,
|
||||
public int $cpu,
|
||||
public int $memory,
|
||||
public int $disk,
|
||||
public ?int $snapshots,
|
||||
public ?int $backups,
|
||||
public ?int $bandwidth,
|
||||
public ServerAddressesData $addresses,
|
||||
public ?string $mac_address,
|
||||
)
|
||||
{
|
||||
public ?string $mac_address,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Eloquent;
|
||||
namespace App\Data\Server\Eloquent;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -8,7 +8,6 @@ class ServerUsagesData extends Data
|
|||
{
|
||||
public function __construct(
|
||||
public int $bandwidth,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server;
|
||||
namespace App\Data\Server;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -9,7 +9,6 @@ class MacAddressData extends Data
|
|||
public function __construct(
|
||||
public ?string $proxmox,
|
||||
public ?string $eloquent,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Config;
|
||||
namespace App\Data\Server\Proxmox\Config;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -9,7 +9,6 @@ class AddressConfigData extends Data
|
|||
public function __construct(
|
||||
public ?AddressData $ipv4,
|
||||
public ?AddressData $ipv6,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Config;
|
||||
namespace App\Data\Server\Proxmox\Config;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -8,9 +8,8 @@ class AddressData extends Data
|
|||
{
|
||||
public function __construct(
|
||||
public string $address,
|
||||
public int $cidr,
|
||||
public int $cidr,
|
||||
public string $gateway,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Config;
|
||||
namespace App\Data\Server\Proxmox\Config;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\Casts\EnumCast;
|
||||
use Convoy\Enums\Server\DiskInterface;
|
||||
use App\Enums\Server\DiskInterface;
|
||||
use Spatie\LaravelData\Attributes\WithCast;
|
||||
use Spatie\LaravelData\Casts\EnumCast;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class DiskData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
#[WithCast(EnumCast::class)]
|
||||
public DiskInterface $interface,
|
||||
public bool $is_primary_disk,
|
||||
|
||||
public bool $is_media,
|
||||
public ?string $media_name,
|
||||
|
||||
public int $size,
|
||||
)
|
||||
{
|
||||
public bool $is_primary_disk,
|
||||
public bool $is_media,
|
||||
public ?string $media_name,
|
||||
public int $size,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Config;
|
||||
namespace App\Data\Server\Proxmox\Config;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -8,7 +8,6 @@ class MediaData extends Data
|
|||
{
|
||||
public function __construct(
|
||||
//
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Config;
|
||||
namespace App\Data\Server\Proxmox\Config;
|
||||
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
|
||||
class ServerConfigData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public string $mac_address,
|
||||
public string $mac_address,
|
||||
#[DataCollectionOf(DiskData::class)]
|
||||
public DataCollection $boot_order,
|
||||
#[DataCollectionOf(DiskData::class)]
|
||||
public DataCollection $disks,
|
||||
/* public AddressConfigData $addresses */
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Console;
|
||||
namespace App\Data\Server\Proxmox\Console;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class NoVncCredentialsData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public int $port,
|
||||
public int $port,
|
||||
public string $ticket,
|
||||
public string $pve_auth_cookie,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Console;
|
||||
namespace App\Data\Server\Proxmox\Console;
|
||||
|
||||
use App\Enums\Node\Access\RealmType;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Convoy\Enums\Node\Access\RealmType;
|
||||
|
||||
class XTermCredentialsData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public int $port,
|
||||
public string $ticket,
|
||||
public string $username,
|
||||
public int $port,
|
||||
public string $ticket,
|
||||
public string $username,
|
||||
public RealmType $realm_type,
|
||||
public string $pve_auth_cookie,
|
||||
)
|
||||
{
|
||||
public string $pve_auth_cookie,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox;
|
||||
namespace App\Data\Server\Proxmox;
|
||||
|
||||
use App\Data\Server\Proxmox\Config\ServerConfigData;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Convoy\Data\Server\Proxmox\Config\ServerConfigData;
|
||||
|
||||
class ServerProxmoxData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public int $id,
|
||||
public string $uuid_short,
|
||||
public string $uuid,
|
||||
public int $node_id,
|
||||
public string $state,
|
||||
public bool $locked,
|
||||
public int $id,
|
||||
public string $uuid_short,
|
||||
public string $uuid,
|
||||
public int $node_id,
|
||||
public string $state,
|
||||
public bool $locked,
|
||||
public ServerConfigData $config,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox;
|
||||
namespace App\Data\Server\Proxmox;
|
||||
|
||||
use App\Enums\Server\State;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Convoy\Enums\Server\State;
|
||||
|
||||
class ServerStateData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public State $state,
|
||||
public float $cpu_used,
|
||||
public int $memory_total,
|
||||
public int $memory_used,
|
||||
public int $uptime,
|
||||
)
|
||||
{
|
||||
public int $memory_total,
|
||||
public int $memory_used,
|
||||
public int $uptime,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function fromRaw(array $raw)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Usages;
|
||||
namespace App\Data\Server\Proxmox\Usages;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -9,7 +9,6 @@ class ServerDiskData extends Data
|
|||
public function __construct(
|
||||
public int $write,
|
||||
public int $read,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Usages;
|
||||
namespace App\Data\Server\Proxmox\Usages;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
|
@ -9,7 +9,6 @@ class ServerNetworkData extends Data
|
|||
public function __construct(
|
||||
public int $in,
|
||||
public int $out,
|
||||
)
|
||||
{
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
18
app/Data/Server/Proxmox/Usages/ServerTimepointData.php
Normal file
18
app/Data/Server/Proxmox/Usages/ServerTimepointData.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Data\Server\Proxmox\Usages;
|
||||
|
||||
use Carbon\CarbonImmutable;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class ServerTimepointData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public float $cpu_used,
|
||||
public float $memory_used,
|
||||
public ServerNetworkData $network,
|
||||
public ServerDiskData $disk,
|
||||
public CarbonImmutable $timestamp,
|
||||
) {
|
||||
}
|
||||
}
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Data\Server\Proxmox\Usages;
|
||||
namespace App\Data\Server\Proxmox\Usages;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class ServerUsagesData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public int $bandwidth,
|
||||
public int $bandwidth,
|
||||
public ServerNetworkData $network,
|
||||
public ServerDiskData $disk,
|
||||
)
|
||||
{
|
||||
public ServerDiskData $disk,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Activity;
|
||||
namespace App\Enums\Activity;
|
||||
|
||||
enum Status: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Api;
|
||||
namespace App\Enums\Api;
|
||||
|
||||
enum ApiKeyType: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Helpers;
|
||||
namespace App\Enums\Helpers;
|
||||
|
||||
enum ChecksumAlgorithm: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Network;
|
||||
namespace App\Enums\Network;
|
||||
|
||||
enum AddressType: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Node\Access;
|
||||
namespace App\Enums\Node\Access;
|
||||
|
||||
enum RealmType: string
|
||||
{
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Node\Storage;
|
||||
namespace App\Enums\Node\Storage;
|
||||
|
||||
enum ContentType: string
|
||||
{
|
||||
case KVM_IMAGES = 'images';
|
||||
case LXC_DATA = 'rootdir';
|
||||
case LXC_TEMPLATES = 'vztmpl';
|
||||
case BACKUPS = 'backup';
|
||||
case ISO = 'iso';
|
||||
case VZTMPL = 'vztmpl';
|
||||
case SNIPPETS = 'snippets';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum AuthenticationType: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum BackupCompressionType: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum BackupMode: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum BiosType: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum ConsoleType: string
|
||||
{
|
||||
|
|
9
app/Enums/Server/DeploymentType.php
Normal file
9
app/Enums/Server/DeploymentType.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum DeploymentType: string
|
||||
{
|
||||
case INSTALL = 'install';
|
||||
case REINSTALL = 'reinstall';
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum DiskInterface: string
|
||||
{
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
|
||||
enum MetricParameter: string
|
||||
{
|
||||
case AVERAGE = 'AVERAGE';
|
||||
case MAX = 'MAX';
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
|
||||
enum MetricTimeframe: string
|
||||
{
|
||||
case HOUR = 'hour';
|
||||
case DAY = 'day';
|
||||
case WEEK = 'week';
|
||||
case MONTH = 'month';
|
||||
case YEAR = 'year';
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum PowerAction: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum State: string
|
||||
{
|
||||
|
|
9
app/Enums/Server/StatisticConsolidatorFunction.php
Normal file
9
app/Enums/Server/StatisticConsolidatorFunction.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum StatisticConsolidatorFunction: string
|
||||
{
|
||||
case AVERAGE = 'AVERAGE';
|
||||
case MAX = 'MAX';
|
||||
}
|
12
app/Enums/Server/StatisticTimeRange.php
Normal file
12
app/Enums/Server/StatisticTimeRange.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum StatisticTimeRange: string
|
||||
{
|
||||
case HOUR_AGO = 'hour';
|
||||
case DAY_AGO = 'day';
|
||||
case WEEK_AGO = 'week';
|
||||
case MONTH_AGO = 'month';
|
||||
case YEAR_AGO = 'year';
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum Status: string
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Enums\Server;
|
||||
namespace App\Enums\Server;
|
||||
|
||||
enum SuspensionAction: string
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Events\Activity;
|
||||
namespace App\Events\Activity;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Convoy\Models\ActivityLog;
|
||||
use App\Models\ActivityLog;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
abstract class Activity
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions;
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions;
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
use Throwable;
|
||||
|
||||
class DisplayException extends ConvoyException implements HttpExceptionInterface
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions;
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Http\Server;
|
||||
namespace App\Exceptions\Http\Server;
|
||||
|
||||
use Throwable;
|
||||
use Convoy\Models\Server;
|
||||
use App\Models\Server;
|
||||
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
|
||||
use Throwable;
|
||||
|
||||
class ServerStatusConflictException extends ConflictHttpException
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Model;
|
||||
namespace App\Exceptions\Model;
|
||||
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Convoy\Exceptions\ConvoyException;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use App\Exceptions\ConvoyException;
|
||||
use Illuminate\Contracts\Support\MessageProvider;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
||||
class DataValidationException extends ConvoyException implements HttpExceptionInterface, MessageProvider
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exceptions\Repository\Eloquent;
|
||||
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class TooManyRootSnapshotsException extends DisplayException
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
'The snapshot tree can\'t be constructed because there are too many root snapshots.',
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Repository\Proxmox;
|
||||
namespace App\Exceptions\Repository\Proxmox;
|
||||
|
||||
use Illuminate\Http\Client\Response;
|
||||
use App\Exceptions\Repository\RepositoryException;
|
||||
use Illuminate\Http\Client\RequestException;
|
||||
use Convoy\Exceptions\Repository\RepositoryException;
|
||||
use Illuminate\Http\Client\Response;
|
||||
|
||||
class ProxmoxConnectionException extends RepositoryException
|
||||
{
|
||||
public function __construct(Response $response, RequestException $exception)
|
||||
{
|
||||
parent::__construct($response->reason() . PHP_EOL . $exception->getMessage() . PHP_EOL . $exception->getTraceAsString(), $exception->getCode(), $exception);
|
||||
}
|
||||
public function __construct(Response $response, RequestException $exception)
|
||||
{
|
||||
parent::__construct($response->reason().PHP_EOL.$exception->getMessage().PHP_EOL.$exception->getTraceAsString(), $exception->getCode(), $exception);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Repository;
|
||||
namespace App\Exceptions\Repository;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Repository;
|
||||
namespace App\Exceptions\Repository;
|
||||
|
||||
use Convoy\Exceptions\ConvoyException;
|
||||
use App\Exceptions\ConvoyException;
|
||||
|
||||
class RepositoryException extends ConvoyException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Api;
|
||||
namespace App\Exceptions\Service\Api;
|
||||
|
||||
use App\Exceptions\ConvoyException;
|
||||
use Throwable;
|
||||
use Convoy\Exceptions\ConvoyException;
|
||||
|
||||
class InvalidJWTException extends ConvoyException
|
||||
{
|
||||
|
@ -10,4 +11,4 @@ class InvalidJWTException extends ConvoyException
|
|||
{
|
||||
parent::__construct(message: 'Invalid JWT token', previous: $previous);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Backup;
|
||||
namespace App\Exceptions\Service\Backup;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class BackupLockedException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Backup;
|
||||
namespace App\Exceptions\Service\Backup;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class TooManyBackupsException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Deployment;
|
||||
namespace App\Exceptions\Service\Deployment;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class InvalidTemplateException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Network;
|
||||
namespace App\Exceptions\Service\Network;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class AddressInUseException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Node\IsoLibrary;
|
||||
namespace App\Exceptions\Service\Node\IsoLibrary;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class InvalidIsoLinkException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Server\Allocation;
|
||||
namespace App\Exceptions\Service\Server\Allocation;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class IsoAlreadyMountedException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Server\Allocation;
|
||||
namespace App\Exceptions\Service\Server\Allocation;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class IsoAlreadyUnmountedException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Server\Allocation;
|
||||
namespace App\Exceptions\Service\Server\Allocation;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class NoAvailableDiskInterfaceException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Server\Allocation;
|
||||
namespace App\Exceptions\Service\Server\Allocation;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class NoUniqueUuidComboException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Exceptions\Service\Server\Allocation;
|
||||
namespace App\Exceptions\Service\Server\Allocation;
|
||||
|
||||
use Convoy\Exceptions\DisplayException;
|
||||
use App\Exceptions\DisplayException;
|
||||
|
||||
class NoUniqueVmidException extends DisplayException
|
||||
{
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Extensions\Lcobucci\JWT\Validation;
|
||||
namespace App\Extensions\Lcobucci\JWT\Validation;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use Carbon\CarbonInterface;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Carbon\CarbonInterface;
|
||||
use DateTimeImmutable;
|
||||
use Psr\Clock\ClockInterface;
|
||||
|
||||
class Clock implements ClockInterface
|
||||
{
|
||||
private CarbonInterface $date;
|
||||
|
||||
public function __construct(?CarbonInterface $date = null) {
|
||||
public function __construct(?CarbonInterface $date = null)
|
||||
{
|
||||
$this->date = $date ?? CarbonImmutable::now();
|
||||
}
|
||||
|
||||
|
|
72
app/Extensions/Spatie/Fractal/RecursiveSerializer.php
Normal file
72
app/Extensions/Spatie/Fractal/RecursiveSerializer.php
Normal file
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace App\Extensions\Spatie\Fractal;
|
||||
|
||||
use League\Fractal\Serializer\ArraySerializer;
|
||||
|
||||
class RecursiveSerializer extends ArraySerializer
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function collection(?string $resourceKey, array $data): array
|
||||
{
|
||||
return ['data' => $data];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function item(?string $resourceKey, array $data): array
|
||||
{
|
||||
return ['data' => $data];
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively serialize included data
|
||||
*
|
||||
* @param string $resourceKey
|
||||
* @param array $data
|
||||
* @param array $includedData
|
||||
* @return array
|
||||
*/
|
||||
public function recursiveInclude($resourceKey, array $data, array $includedData): array
|
||||
{
|
||||
foreach ($includedData as $include) {
|
||||
if (isset($data[$include])) {
|
||||
$data[$include] = $this->recursiveInclude(
|
||||
$include,
|
||||
$data[$include],
|
||||
$includedData[$include],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges included data with transformed data recursively
|
||||
*
|
||||
* @param array $transformedData
|
||||
* @param array $includedData
|
||||
* @return array
|
||||
*/
|
||||
public function mergeIncludes(array $transformedData, array $includedData): array
|
||||
{
|
||||
$transformedData = parent::mergeIncludes($transformedData, $includedData);
|
||||
|
||||
// Recursively include any nested data
|
||||
foreach ($includedData as $key => $value) {
|
||||
if (isset($transformedData[$key])) {
|
||||
$transformedData[$key] = $this->recursiveInclude(
|
||||
$key,
|
||||
$transformedData[$key],
|
||||
$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $transformedData;
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Facades;
|
||||
namespace App\Facades;
|
||||
|
||||
use App\Services\Activity\ActivityLogService;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Convoy\Services\Activity\ActivityLogService;
|
||||
|
||||
class Activity extends Facade
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Facades;
|
||||
namespace App\Facades;
|
||||
|
||||
use App\Services\Activity\ActivityLogBatchService;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Convoy\Services\Activity\ActivityLogBatchService;
|
||||
|
||||
class LogBatch extends Facade
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Facades;
|
||||
namespace App\Facades;
|
||||
|
||||
use App\Services\Activity\ActivityLogTargetableService;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Convoy\Services\Activity\ActivityLogTargetableService;
|
||||
|
||||
class LogTarget extends Facade
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Convoy\Helpers;
|
||||
namespace App\Helpers;
|
||||
|
||||
use Convoy\Enums\Network\AddressType;
|
||||
use App\Enums\Network\AddressType;
|
||||
use GMP;
|
||||
|
||||
function ipv6ToInteger(string $ip): GMP
|
||||
|
@ -42,4 +42,4 @@ function getAddressesFromRange(AddressType $type, string $from, string $to): arr
|
|||
}
|
||||
|
||||
return $addresses;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue