1
0
Fork 0
mirror of synced 2024-09-20 03:17:30 +12:00

Small fixes

This commit is contained in:
Khushboo Verma 2024-07-30 15:13:38 +05:30
parent 198b460e22
commit c9f8671af1
4 changed files with 9 additions and 9 deletions

View file

@ -2361,15 +2361,15 @@ App::get('/v1/functions/templates')
->desc('List function templates')
->label('scope', 'public')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'listFunctionTemplates')
->label('sdk.description', '/docs/references/functions/list-function-templates.md')
->label('sdk.method', 'listTemplates')
->label('sdk.description', '/docs/references/functions/list-templates.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION_LIST)
->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true)
->param('usecases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of usecases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' usecases are allowed.', true)
->param('limit', 100, new Range(0, 100), 'Limit the number of templates returned in the response. Max limit: 100.', true)
->param('offset', 0, new Range(0, 100), 'Offset the list of returned templates. Max offset: 100.', true)
->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of usecases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' usecases are allowed.', true)
->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true)
->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true)
->inject('response')
->action(function (array $runtimes, array $usecases, int $limit, int $offset, Response $response) {
$templates = Config::getParam('function-templates', []);

View file

@ -1 +0,0 @@
List function templates from marketplace.

View file

@ -0,0 +1 @@
List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.

View file

@ -16,7 +16,7 @@ class TemplateFunction extends Model
'default' => '',
'example' => 'icon-lightning-bolt',
])
->addRule('$id', [
->addRule('id', [
'type' => self::TYPE_STRING,
'description' => 'Function Template ID.',
'default' => '',
@ -60,9 +60,9 @@ class TemplateFunction extends Model
'default' => 15,
'example' => 300,
])
->addRule('usecases', [
->addRule('useCases', [
'type' => self::TYPE_STRING,
'description' => 'Function usecases.',
'description' => 'Function use cases.',
'default' => [],
'example' => 'Starter',
'array' => true,