From 4e7d25ef3394cf201f1745f96dda7f873683dd06 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 6 Dec 2020 08:35:58 +0200 Subject: [PATCH 1/2] Updated events docs --- app/config/events.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/app/config/events.php b/app/config/events.php index db1bbc2434..d66c8471d8 100644 --- a/app/config/events.php +++ b/app/config/events.php @@ -6,95 +6,126 @@ return [ 'account.create' => [ 'description' => 'This event triggers when the account is created.', + 'note' => '', ], 'account.update.email' => [ 'description' => 'This event triggers when the account email address is updated.', + 'note' => '', ], 'account.update.name' => [ 'description' => 'This event triggers when the account name is updated.', + 'note' => '', ], 'account.update.password' => [ 'description' => 'This event triggers when the account password is updated.', + 'note' => '', ], 'account.update.prefs' => [ 'description' => 'This event triggers when the account preferences are updated.', + 'note' => '', ], 'account.recovery.create' => [ 'description' => 'This event triggers when the account recovery token is created.', + 'note' => 'version >= 0.7', ], 'account.recovery.update' => [ 'description' => 'This event triggers when the account recovery token is validated.', + 'note' => 'version >= 0.7', ], 'account.verification.create' => [ 'description' => 'This event triggers when the account verification token is created.', + 'note' => 'version >= 0.7', ], 'account.verification.update' => [ 'description' => 'This event triggers when the account verification token is validated.', + 'note' => 'version >= 0.7', ], 'account.delete' => [ 'description' => 'This event triggers when the account is deleted.', + 'note' => '', ], 'account.sessions.create' => [ 'description' => 'This event triggers when the account session is created.', + 'note' => '', ], 'account.sessions.delete' => [ 'description' => 'This event triggers when the account session is deleted.', + 'note' => '', ], 'database.collections.create' => [ 'description' => 'This event triggers when a database collection is created.', + 'note' => '', ], 'database.collections.update' => [ 'description' => 'This event triggers when a database collection is updated.', + 'note' => '', ], 'database.collections.delete' => [ 'description' => 'This event triggers when a database collection is deleted.', + 'note' => '', ], 'database.documents.create' => [ 'description' => 'This event triggers when a database document is created.', + 'note' => '', ], 'database.documents.update' => [ 'description' => 'This event triggers when a database document is updated.', + 'note' => '', ], 'database.documents.delete' => [ 'description' => 'This event triggers when a database document is deleted.', + 'note' => '', ], 'storage.files.create' => [ 'description' => 'This event triggers when a storage file is created.', + 'note' => '', ], 'storage.files.update' => [ 'description' => 'This event triggers when a storage file is updated.', + 'note' => '', ], 'storage.files.delete' => [ 'description' => 'This event triggers when a storage file is deleted.', + 'note' => '', ], 'users.create' => [ 'description' => 'This event triggers when a user is created from the users API.', + 'note' => 'version >= 0.7', ], 'users.update.status' => [ 'description' => 'This event triggers when a user status is updated from the users API.', + 'note' => 'version >= 0.7', ], 'users.delete' => [ 'description' => 'This event triggers when a user is deleted from users API.', + 'note' => 'version >= 0.7', ], 'users.sessions.delete' => [ 'description' => 'This event triggers when a user session is deleted from users API.', + 'note' => 'version >= 0.7', ], 'teams.create' => [ 'description' => 'This event triggers when a team is created.', + 'note' => 'version >= 0.7', ], 'teams.update' => [ 'description' => 'This event triggers when a team is updated.', + 'note' => 'version >= 0.7', ], 'teams.delete' => [ 'description' => 'This event triggers when a team is deleted.', + 'note' => 'version >= 0.7', ], 'teams.memberships.create' => [ 'description' => 'This event triggers when a team memberships is created.', + 'note' => 'version >= 0.7', ], 'teams.memberships.update.status' => [ 'description' => 'This event triggers when a team memberships status is updated.', + 'note' => 'version >= 0.7', ], 'teams.memberships.delete' => [ 'description' => 'This event triggers when a team memberships is deleted.', + 'note' => 'version >= 0.7', ], ]; \ No newline at end of file From da287226ca83a480826534ca55e3f3323f485b5d Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 6 Dec 2020 08:42:56 +0200 Subject: [PATCH 2/2] Updated model types --- app/config/events.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/config/events.php b/app/config/events.php index d66c8471d8..2bb3862fdf 100644 --- a/app/config/events.php +++ b/app/config/events.php @@ -3,129 +3,163 @@ /** * List of publicly accessiable system events */ + +use Appwrite\Utopia\Response; + return [ 'account.create' => [ 'description' => 'This event triggers when the account is created.', + 'model' => Response::MODEL_USER, 'note' => '', ], 'account.update.email' => [ 'description' => 'This event triggers when the account email address is updated.', + 'model' => Response::MODEL_USER, 'note' => '', ], 'account.update.name' => [ 'description' => 'This event triggers when the account name is updated.', + 'model' => Response::MODEL_USER, 'note' => '', ], 'account.update.password' => [ 'description' => 'This event triggers when the account password is updated.', + 'model' => Response::MODEL_USER, 'note' => '', ], 'account.update.prefs' => [ 'description' => 'This event triggers when the account preferences are updated.', + 'model' => Response::MODEL_USER, 'note' => '', ], 'account.recovery.create' => [ 'description' => 'This event triggers when the account recovery token is created.', + 'model' => Response::MODEL_TOKEN, 'note' => 'version >= 0.7', ], 'account.recovery.update' => [ 'description' => 'This event triggers when the account recovery token is validated.', + 'model' => Response::MODEL_TOKEN, 'note' => 'version >= 0.7', ], 'account.verification.create' => [ 'description' => 'This event triggers when the account verification token is created.', + 'model' => Response::MODEL_TOKEN, 'note' => 'version >= 0.7', ], 'account.verification.update' => [ 'description' => 'This event triggers when the account verification token is validated.', + 'model' => Response::MODEL_TOKEN, 'note' => 'version >= 0.7', ], 'account.delete' => [ 'description' => 'This event triggers when the account is deleted.', + 'model' => Response::MODEL_USER, 'note' => '', ], 'account.sessions.create' => [ 'description' => 'This event triggers when the account session is created.', + 'model' => Response::MODEL_SESSION, 'note' => '', ], 'account.sessions.delete' => [ 'description' => 'This event triggers when the account session is deleted.', + 'model' => Response::MODEL_SESSION, 'note' => '', ], 'database.collections.create' => [ 'description' => 'This event triggers when a database collection is created.', + 'model' => Response::MODEL_COLLECTION, 'note' => '', ], 'database.collections.update' => [ 'description' => 'This event triggers when a database collection is updated.', + 'model' => Response::MODEL_COLLECTION, 'note' => '', ], 'database.collections.delete' => [ 'description' => 'This event triggers when a database collection is deleted.', + 'model' => Response::MODEL_COLLECTION, 'note' => '', ], 'database.documents.create' => [ 'description' => 'This event triggers when a database document is created.', + 'model' => Response::MODEL_ANY, 'note' => '', ], 'database.documents.update' => [ 'description' => 'This event triggers when a database document is updated.', + 'model' => Response::MODEL_ANY, 'note' => '', ], 'database.documents.delete' => [ 'description' => 'This event triggers when a database document is deleted.', + 'model' => Response::MODEL_ANY, 'note' => '', ], 'storage.files.create' => [ 'description' => 'This event triggers when a storage file is created.', + 'model' => Response::MODEL_FILE, 'note' => '', ], 'storage.files.update' => [ 'description' => 'This event triggers when a storage file is updated.', + 'model' => Response::MODEL_FILE, 'note' => '', ], 'storage.files.delete' => [ 'description' => 'This event triggers when a storage file is deleted.', + 'model' => Response::MODEL_FILE, 'note' => '', ], 'users.create' => [ 'description' => 'This event triggers when a user is created from the users API.', + 'model' => Response::MODEL_USER, 'note' => 'version >= 0.7', ], 'users.update.status' => [ 'description' => 'This event triggers when a user status is updated from the users API.', + 'model' => Response::MODEL_USER, 'note' => 'version >= 0.7', ], 'users.delete' => [ 'description' => 'This event triggers when a user is deleted from users API.', + 'model' => Response::MODEL_USER, 'note' => 'version >= 0.7', ], 'users.sessions.delete' => [ 'description' => 'This event triggers when a user session is deleted from users API.', + 'model' => Response::MODEL_SESSION, 'note' => 'version >= 0.7', ], 'teams.create' => [ 'description' => 'This event triggers when a team is created.', + 'model' => Response::MODEL_TEAM, 'note' => 'version >= 0.7', ], 'teams.update' => [ 'description' => 'This event triggers when a team is updated.', + 'model' => Response::MODEL_TEAM, 'note' => 'version >= 0.7', ], 'teams.delete' => [ 'description' => 'This event triggers when a team is deleted.', + 'model' => Response::MODEL_TEAM, 'note' => 'version >= 0.7', ], 'teams.memberships.create' => [ 'description' => 'This event triggers when a team memberships is created.', + 'model' => Response::MODEL_MEMBERSHIP, 'note' => 'version >= 0.7', ], 'teams.memberships.update.status' => [ 'description' => 'This event triggers when a team memberships status is updated.', + 'model' => Response::MODEL_MEMBERSHIP, 'note' => 'version >= 0.7', ], 'teams.memberships.delete' => [ 'description' => 'This event triggers when a team memberships is deleted.', + 'model' => Response::MODEL_MEMBERSHIP, 'note' => 'version >= 0.7', ], ]; \ No newline at end of file