mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch '0.7.x' of https://github.com/appwrite/appwrite into feat-migration-v06
This commit is contained in:
@@ -16,13 +16,14 @@ class Auth
|
||||
/**
|
||||
* User Roles.
|
||||
*/
|
||||
const USER_ROLE_GUEST = 0;
|
||||
const USER_ROLE_MEMBER = 1;
|
||||
const USER_ROLE_ADMIN = 2;
|
||||
const USER_ROLE_DEVELOPER = 3;
|
||||
const USER_ROLE_OWNER = 4;
|
||||
const USER_ROLE_APP = 5;
|
||||
const USER_ROLE_SYSTEM = 6;
|
||||
const USER_ROLE_GUEST = 'guest';
|
||||
const USER_ROLE_MEMBER = 'member';
|
||||
const USER_ROLE_ADMIN = 'admin';
|
||||
const USER_ROLE_DEVELOPER = 'developer';
|
||||
const USER_ROLE_OWNER = 'owner';
|
||||
const USER_ROLE_APP = 'app';
|
||||
const USER_ROLE_SYSTEM = 'system';
|
||||
const USER_ROLE_ALL = '*';
|
||||
|
||||
/**
|
||||
* Token Types.
|
||||
|
||||
@@ -13,27 +13,32 @@ class Collection extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Collection ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$permissions', [
|
||||
'type' => Response::MODEL_PERMISSIONS,
|
||||
'description' => 'Collection permissions.',
|
||||
'default' => new \stdClass,
|
||||
'example' => new \stdClass,
|
||||
'array' => false,
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Collection name.',
|
||||
'default' => '',
|
||||
'example' => 'Movies',
|
||||
])
|
||||
->addRule('dateCreated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Collection creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('dateUpdated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Collection creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981550,
|
||||
])
|
||||
->addRule('rules', [
|
||||
|
||||
@@ -13,11 +13,13 @@ class Continent extends Model
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Continent name.',
|
||||
'default' => '',
|
||||
'example' => 'Europe',
|
||||
])
|
||||
->addRule('code', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Continent two letter code.',
|
||||
'default' => '',
|
||||
'example' => 'EU',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,11 +13,13 @@ class Country extends Model
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Country name.',
|
||||
'default' => '',
|
||||
'example' => 'United States',
|
||||
])
|
||||
->addRule('code', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Country two-character ISO 3166-1 alpha code.',
|
||||
'default' => '',
|
||||
'example' => 'US',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,36 +13,43 @@ class Currency extends Model
|
||||
->addRule('symbol', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Currency symbol.',
|
||||
'default' => '',
|
||||
'example' => '$',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Currency name.',
|
||||
'default' => '',
|
||||
'example' => 'US dollar',
|
||||
])
|
||||
->addRule('symbolNative', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Currency native symbol.',
|
||||
'default' => '',
|
||||
'example' => '$',
|
||||
])
|
||||
->addRule('decimalDigits', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Number of decimal digits.',
|
||||
'default' => 0,
|
||||
'example' => 2,
|
||||
])
|
||||
->addRule('rounding', [
|
||||
'type' => self::TYPE_FLOAT,
|
||||
'description' => 'Currency digit rounding.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('code', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.',
|
||||
'default' => '',
|
||||
'example' => 'USD',
|
||||
])
|
||||
->addRule('namePlural', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Currency plural name',
|
||||
'default' => '',
|
||||
'example' => 'US dollars',
|
||||
])
|
||||
// ->addRule('locations', [
|
||||
|
||||
@@ -18,26 +18,31 @@ class Domain extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Domain ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('domain', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Domain name.',
|
||||
'default' => '',
|
||||
'example' => 'appwrite.company.com',
|
||||
])
|
||||
->addRule('registerable', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Registerable domain name.',
|
||||
'default' => '',
|
||||
'example' => 'company.com',
|
||||
])
|
||||
->addRule('tld', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'TLD name.',
|
||||
'default' => '',
|
||||
'example' => 'com',
|
||||
])
|
||||
->addRule('verification', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Verification process status.',
|
||||
'default' => false,
|
||||
'example' => true,
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,16 +13,19 @@ class Error extends Model
|
||||
->addRule('message', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Error message.',
|
||||
'default' => '',
|
||||
'example' => 'Not found',
|
||||
])
|
||||
->addRule('code', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Error code.',
|
||||
'default' => '',
|
||||
'example' => '404',
|
||||
])
|
||||
->addRule('version', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Server version number.',
|
||||
'default' => '',
|
||||
'example' => '1.0',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -19,16 +19,19 @@ class ErrorDev extends Error
|
||||
->addRule('file', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'File path.',
|
||||
'default' => '',
|
||||
'example' => '/usr/code/vendor/utopia-php/framework/src/App.php',
|
||||
])
|
||||
->addRule('line', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Line number.',
|
||||
'default' => 0,
|
||||
'example' => 209,
|
||||
])
|
||||
->addRule('trace', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Error trace.',
|
||||
'default' => [],
|
||||
'example' => [
|
||||
''
|
||||
],
|
||||
|
||||
@@ -13,46 +13,55 @@ class Execution extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Execution ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('functionId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea6g16897e',
|
||||
])
|
||||
->addRule('dateCreated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'The execution creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('trigger', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.',
|
||||
'default' => '',
|
||||
'example' => 'http',
|
||||
])
|
||||
->addRule('status', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.',
|
||||
'default' => '',
|
||||
'example' => 'processing',
|
||||
])
|
||||
->addRule('exitCode', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'The script exit code.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('stdout', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The script stdout output string.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
])
|
||||
->addRule('stderr', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The script stderr output string.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
])
|
||||
->addRule('time', [
|
||||
'type' => self::TYPE_FLOAT,
|
||||
'description' => 'The script execution time in seconds.',
|
||||
'default' => 0,
|
||||
'example' => 0.400,
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,37 +13,44 @@ class File extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'File ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$permissions', [
|
||||
'type' => Response::MODEL_PERMISSIONS,
|
||||
'description' => 'File permissions.',
|
||||
'default' => new \stdClass,
|
||||
'example' => new \stdClass,
|
||||
'array' => false,
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'File name.',
|
||||
'default' => '',
|
||||
'example' => 'Pink.png',
|
||||
])
|
||||
->addRule('dateCreated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'File creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('signature', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'File MD5 signature.',
|
||||
'default' => '',
|
||||
'example' => '5d529fd02b544198ae075bd57c1762bb',
|
||||
])
|
||||
->addRule('mimeType', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'File mime type.',
|
||||
'default' => '',
|
||||
'example' => 'image/png',
|
||||
])
|
||||
->addRule('sizeOriginal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'File original size in bytes.',
|
||||
'default' => 0,
|
||||
'example' => 17890,
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,37 +13,44 @@ class Func extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$permissions', [
|
||||
'type' => Response::MODEL_PERMISSIONS,
|
||||
'description' => 'Function permissions.',
|
||||
'default' => new \stdClass,
|
||||
'example' => new \stdClass,
|
||||
'array' => false,
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function name.',
|
||||
'default' => '',
|
||||
'example' => 'My Function',
|
||||
])
|
||||
->addRule('dateCreated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Function creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('dateUpdated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Function update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981257,
|
||||
])
|
||||
->addRule('status', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function status. Possible values: disabled, enabled',
|
||||
'default' => '',
|
||||
'example' => 'enabled',
|
||||
])
|
||||
->addRule('env', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function execution environment.',
|
||||
'default' => '',
|
||||
'example' => 'python-3.8',
|
||||
])
|
||||
->addRule('tag', [
|
||||
@@ -74,14 +81,14 @@ class Func extends Model
|
||||
->addRule('scheduleNext', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Function next scheduled execution date in Unix timestamp.',
|
||||
'example' => 1592981292,
|
||||
'default' => 0,
|
||||
'example' => 1592981292,
|
||||
])
|
||||
->addRule('schedulePrevious', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Function next scheduled execution date in Unix timestamp.',
|
||||
'example' => 1592981237,
|
||||
'default' => 0,
|
||||
'example' => 1592981237,
|
||||
])
|
||||
->addRule('timeout', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
|
||||
@@ -18,11 +18,13 @@ class Key extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Key ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Key name.',
|
||||
'default' => '',
|
||||
'example' => 'My API Key',
|
||||
])
|
||||
->addRule('scopes', [
|
||||
@@ -35,6 +37,7 @@ class Key extends Model
|
||||
->addRule('secret', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Secret key.',
|
||||
'default' => '',
|
||||
'example' => '919c2d18fb5d4...a2ae413da83346ad2',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,16 +13,19 @@ class Language extends Model
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Language name.',
|
||||
'default' => '',
|
||||
'example' => 'Italian',
|
||||
])
|
||||
->addRule('code', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Language two-character ISO 639-1 codes.',
|
||||
'default' => '',
|
||||
'example' => 'it',
|
||||
])
|
||||
->addRule('nativeName', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Language native name.',
|
||||
'default' => '',
|
||||
'example' => 'Italiano',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,26 +13,31 @@ class Locale extends Model
|
||||
->addRule('ip', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'User IP address.',
|
||||
'default' => '',
|
||||
'example' => '127.0.0.1',
|
||||
])
|
||||
->addRule('countryCode', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format',
|
||||
'default' => '',
|
||||
'example' => 'US',
|
||||
])
|
||||
->addRule('country', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Country name. This field support localization.',
|
||||
'default' => '',
|
||||
'example' => 'United States',
|
||||
])
|
||||
->addRule('continentCode', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.',
|
||||
'default' => '',
|
||||
'example' => 'NA',
|
||||
])
|
||||
->addRule('continent', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Continent name. This field support localization.',
|
||||
'default' => '',
|
||||
'example' => 'North America',
|
||||
])
|
||||
->addRule('eu', [
|
||||
@@ -44,6 +49,7 @@ class Locale extends Model
|
||||
->addRule('currency', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format',
|
||||
'default' => '',
|
||||
'example' => 'USD',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,16 +13,19 @@ class Log extends Model
|
||||
->addRule('event', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Event name.',
|
||||
'default' => '',
|
||||
'example' => 'account.sessions.create',
|
||||
])
|
||||
->addRule('ip', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'IP session in use when the session was created.',
|
||||
'default' => '',
|
||||
'example' => '127.0.0.1',
|
||||
])
|
||||
->addRule('time', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Log creation time in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('osCode', [
|
||||
|
||||
@@ -13,16 +13,19 @@ class Membership extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Membership ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('userId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'User ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('teamId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Team ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
@@ -40,16 +43,19 @@ class Membership extends Model
|
||||
->addRule('invited', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Date, the user has been invited to join the team in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('joined', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Date, the user has accepted the invitation to join the team in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('confirm', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'User confirmation status, true if the user has joined the team or false otherwise.',
|
||||
'default' => false,
|
||||
'example' => false,
|
||||
])
|
||||
->addRule('roles', [
|
||||
|
||||
@@ -13,12 +13,14 @@ class Permissions extends Model
|
||||
->addRule('read', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Read permissions.',
|
||||
'default' => [],
|
||||
'example' => ['*', 'user:5e5ea5c16897e'],
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('write', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Write permissions.',
|
||||
'default' => [],
|
||||
'example' => ['*', 'user:5e5ea5c16897e'],
|
||||
'array' => true,
|
||||
])
|
||||
|
||||
@@ -13,16 +13,19 @@ class Phone extends Model
|
||||
->addRule('code', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Phone code.',
|
||||
'default' => '',
|
||||
'example' => '+1',
|
||||
])
|
||||
->addRule('countryCode', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Country two-character ISO 3166-1 alpha code.',
|
||||
'default' => '',
|
||||
'example' => 'US',
|
||||
])
|
||||
->addRule('countryName', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Country name.',
|
||||
'default' => '',
|
||||
'example' => 'United States',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -18,21 +18,25 @@ class Platform extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Platform ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Platform name.',
|
||||
'default' => '',
|
||||
'example' => 'My Web App',
|
||||
])
|
||||
->addRule('type', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.',
|
||||
'default' => '',
|
||||
'example' => 'My Web App',
|
||||
])
|
||||
->addRule('key', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.',
|
||||
'default' => '',
|
||||
'example' => 'com.company.appname',
|
||||
])
|
||||
// ->addRule('store', [
|
||||
@@ -43,6 +47,7 @@ class Platform extends Model
|
||||
->addRule('hostname', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Web app hostname. Empty string for other platforms.',
|
||||
'default' => '',
|
||||
'example' => true,
|
||||
])
|
||||
->addRule('httpUser', [
|
||||
|
||||
@@ -19,6 +19,7 @@ class Project extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Project ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
@@ -36,6 +37,7 @@ class Project extends Model
|
||||
->addRule('teamId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Project team ID.',
|
||||
'default' => '',
|
||||
'example' => '1592981250',
|
||||
])
|
||||
->addRule('logo', [
|
||||
|
||||
@@ -13,6 +13,7 @@ class Rule extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Rule ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$collection', [ // TODO remove this from public response
|
||||
@@ -23,32 +24,37 @@ class Rule extends Model
|
||||
->addRule('type', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Rule type. Possible values: ',
|
||||
'default' => '',
|
||||
'example' => 'title',
|
||||
])
|
||||
->addRule('key', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Rule key.',
|
||||
'default' => '',
|
||||
'example' => 'title',
|
||||
])
|
||||
->addRule('label', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Rule label.',
|
||||
'default' => '',
|
||||
'example' => 'Title',
|
||||
])
|
||||
->addRule('default', [ // TODO should be of mixed types
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Rule default value.',
|
||||
'example' => 'Movie Name',
|
||||
'default' => '',
|
||||
'example' => 'Movie Name',
|
||||
])
|
||||
->addRule('array', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Is array?',
|
||||
'default' => false,
|
||||
'example' => false,
|
||||
])
|
||||
->addRule('required', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Is required?',
|
||||
'default' => false,
|
||||
'example' => true,
|
||||
])
|
||||
->addRule('list', [
|
||||
|
||||
@@ -13,6 +13,7 @@ class Session extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Session ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('userId', [
|
||||
|
||||
@@ -13,26 +13,31 @@ class Tag extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Tag ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('functionId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea6g16897e',
|
||||
])
|
||||
->addRule('dateCreated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'The tag creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('command', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The entrypoint command in use to execute the tag code.',
|
||||
'default' => '',
|
||||
'example' => 'enabled',
|
||||
])
|
||||
->addRule('size', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The code size in bytes.',
|
||||
'default' => '',
|
||||
'example' => 'python-3.8',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -18,26 +18,31 @@ class Task extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Task ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Task name.',
|
||||
'default' => '',
|
||||
'example' => 'My Task',
|
||||
])
|
||||
->addRule('security', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Indicated if SSL / TLS Certificate verification is enabled.',
|
||||
'default' => true,
|
||||
'example' => true,
|
||||
])
|
||||
->addRule('httpMethod', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Task HTTP Method.',
|
||||
'default' => '',
|
||||
'example' => 'POST',
|
||||
])
|
||||
->addRule('httpUrl', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Task HTTP URL.',
|
||||
'default' => '',
|
||||
'example' => 'https://example.com/task',
|
||||
])
|
||||
->addRule('httpHeaders', [
|
||||
@@ -80,11 +85,13 @@ class Task extends Model
|
||||
->addRule('schedule', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Task schedule in CRON syntax.',
|
||||
'default' => '',
|
||||
'example' => '* * * * *',
|
||||
])
|
||||
->addRule('status', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Task status. Possible values: play, pause', // TODO - change to enabled disabled
|
||||
'default' => '',
|
||||
'example' => 'enabled',
|
||||
])
|
||||
->addRule('updated', [
|
||||
|
||||
@@ -13,6 +13,7 @@ class Team extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Team ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
@@ -24,11 +25,13 @@ class Team extends Model
|
||||
->addRule('dateCreated', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Team creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('sum', [ // TODO change key name?
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total sum of team members.',
|
||||
'default' => 0,
|
||||
'example' => 7,
|
||||
])
|
||||
;
|
||||
|
||||
@@ -13,17 +13,19 @@ class Token extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Token ID.',
|
||||
'default' => '',
|
||||
'example' => 'bb8ea5c16897e',
|
||||
])
|
||||
->addRule('userId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'User ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c168bb8',
|
||||
])
|
||||
->addRule('secret', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.',
|
||||
'default' => 0,
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
])
|
||||
->addRule('expire', [
|
||||
|
||||
@@ -13,26 +13,31 @@ class User extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'User ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'User name.',
|
||||
'default' => '',
|
||||
'example' => 'John Doe',
|
||||
])
|
||||
->addRule('registration', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'User registration date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('status', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'User status. 0 for Unactivated, 1 for active and 2 is blocked.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('email', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'User email address.',
|
||||
'default' => '',
|
||||
'example' => 'john@appwrite.io',
|
||||
])
|
||||
->addRule('emailVerification', [
|
||||
|
||||
@@ -18,16 +18,19 @@ class Webhook extends Model
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Webhook ID.',
|
||||
'default' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Webhook name.',
|
||||
'default' => '',
|
||||
'example' => 'My Webhook',
|
||||
])
|
||||
->addRule('url', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Webhook URL endpoint.',
|
||||
'default' => '',
|
||||
'example' => 'https://example.com/webhook',
|
||||
])
|
||||
->addRule('events', [
|
||||
@@ -40,6 +43,7 @@ class Webhook extends Model
|
||||
->addRule('security', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Indicated if SSL / TLS Certificate verification is enabled.',
|
||||
'default' => true,
|
||||
'example' => true,
|
||||
])
|
||||
->addRule('httpUser', [
|
||||
|
||||
Reference in New Issue
Block a user