1
0
Fork 0
mirror of synced 2024-09-28 07:21:35 +12:00

add param types for vars and file

This commit is contained in:
Everly Precia Suresh 2022-05-14 10:11:38 +00:00
parent 5c70875098
commit eeb7ba120f

View file

@ -55,7 +55,7 @@ App::post('/v1/functions')
->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Function maximum execution time in seconds.', true)
->inject('response')
->inject('dbForProject')
->action(function (string $functionId, string $name, array $execute, string $runtime, $vars, ?array $events, ?string $schedule, int $timeout, Response $response, Database $dbForProject) {
->action(function (string $functionId, string $name, array $execute, string $runtime, array $vars, ?array $events, ?string $schedule, int $timeout, Response $response, Database $dbForProject) {
$functionId = ($functionId == 'unique()') ? $dbForProject->getId() : $functionId;
$function = $dbForProject->createDocument('functions', new Document([
@ -294,7 +294,7 @@ App::put('/v1/functions/:functionId')
->inject('dbForProject')
->inject('project')
->inject('user')
->action(function (string $functionId, string $name, array $execute, $vars, ?array $events, ?string $schedule, ?int $timeout, Response $response, Database $dbForProject, Document $project, $user) {
->action(function (string $functionId, string $name, array $execute, array $vars, ?array $events, ?string $schedule, ?int $timeout, Response $response, Database $dbForProject, Document $project, $user) {
$function = $dbForProject->getDocument('functions', $functionId);
@ -453,7 +453,7 @@ App::post('/v1/functions/:functionId/deployments')
->inject('project')
->inject('deviceFunctions')
->inject('deviceLocal')
->action(function (string $functionId, string $entrypoint, $file, bool $activate, Request $request, Response $response, Database $dbForProject, Stats $usage, $user, Document $project, Device $deviceFunctions, Device $deviceLocal) {
->action(function (string $functionId, string $entrypoint, array $file, bool $activate, Request $request, Response $response, Database $dbForProject, Stats $usage, $user, Document $project, Device $deviceFunctions, Device $deviceLocal) {
$function = $dbForProject->getDocument('functions', $functionId);