Shared variables

This commit is contained in:
Matej Bačo
2023-03-11 17:06:02 +01:00
parent 541cb010a6
commit 1f409b4e40
20 changed files with 291 additions and 34 deletions
@@ -7,7 +7,9 @@ use Appwrite\Utopia\Database\Validator\Queries\Base;
class Variables extends Base
{
public const ALLOWED_ATTRIBUTES = [
'key'
'key',
'resourceType',
'resourceId'
];
/**
+1 -1
View File
@@ -44,7 +44,7 @@ class Rule extends Model
])
->addRule('resourceId', [
'type' => self::TYPE_STRING,
'description' => 'ID of resource for the action type. If resourceType is "api" or "url", leave empty. If resourceType is "function", provide ID of the function.',
'description' => 'ID of resource for the action type. If resourceType is "api" or "url", it is empty. If resourceType is "function", it is ID of the function.',
'default' => '',
'example' => 'myAwesomeFunction',
])
@@ -41,11 +41,17 @@ class Variable extends Model
'default' => '',
'example' => 'myPa$$word1',
])
->addRule('functionId', [
->addRule('resourceType', [
'type' => self::TYPE_STRING,
'description' => 'Function ID.',
'description' => 'Service to which the variable belongs. Possible values are "project", "function"',
'default' => '',
'example' => '5e5ea5c16897e',
'example' => 'function',
])
->addRule('resourceId', [
'type' => self::TYPE_STRING,
'description' => 'ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function.',
'default' => '',
'example' => 'myAwesomeFunction',
])
;
}