feat: update getLogs to listLogs in users and account API

This commit is contained in:
Christy Jacob 2022-09-14 02:35:03 +05:30
parent 183bb2e92d
commit 937674a373
22 changed files with 32 additions and 30 deletions

View file

@ -15,6 +15,8 @@
- Renamed the following list endpoints to stay consistent with other endpoints [#3825](https://github.com/appwrite/appwrite/pull/3825)
- `getMemberships` to `listMemberships` in Teams API
- `getMemberships` to `listMemberships` in Users API
- `getLogs` to `listLogs` in Users API
- `getLogs` to `listLogs` in Accounts API
## Features
- Added the UI to see the Parent ID of all resources within the UI. [#3653](https://github.com/appwrite/appwrite/pull/3653)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1346,14 +1346,14 @@ App::get('/v1/account/sessions')
});
App::get('/v1/account/logs')
->desc('Get Account Logs')
->desc('List Account Logs')
->groups(['api', 'account'])
->label('scope', 'account')
->label('usage.metric', 'users.{scope}.requests.read')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'getLogs')
->label('sdk.description', '/docs/references/account/get-logs.md')
->label('sdk.method', 'listLogs')
->label('sdk.description', '/docs/references/account/list-logs.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_LOG_LIST)

View file

@ -531,14 +531,14 @@ App::get('/v1/users/:userId/memberships')
});
App::get('/v1/users/:userId/logs')
->desc('Get User Logs')
->desc('List User Logs')
->groups(['api', 'users'])
->label('scope', 'users.read')
->label('usage.metric', 'users.{scope}.requests.read')
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
->label('sdk.namespace', 'users')
->label('sdk.method', 'getLogs')
->label('sdk.description', '/docs/references/users/get-user-logs.md')
->label('sdk.method', 'listLogs')
->label('sdk.description', '/docs/references/users/list-user-logs.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_LOG_LIST)

View file

@ -298,7 +298,7 @@
<h2>Activity</h2>
<div
data-service="account.getLogs"
data-service="account.listLogs"
data-scope="console"
data-param-queries="limit(<?php echo APP_PAGING_LIMIT; ?>),offset({{router.params.offset|orZero}})"
data-param-queries-cast-to="array"
@ -340,7 +340,7 @@
</div>
<div class="pull-end text-align-center paging">
<form
data-service="account.getLogs"
data-service="account.listLogs"
data-event="submit"
data-scope="console"
data-name="securityLogs"
@ -353,7 +353,7 @@
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{securityLogs.total|pageTotal}}"></span>
<form
data-service="account.getLogs"
data-service="account.listLogs"
data-event="submit"
data-scope="console"
data-name="securityLogs"

View file

@ -570,7 +570,7 @@
<h2>Activity</h2>
<div
data-service="users.getLogs"
data-service="users.listLogs"
data-name="logs"
data-param-user-id="{{router.params.id}}"
data-event="load,logs-load">

View file

@ -56,7 +56,7 @@ let path='/account/email';let payload={};if(typeof email!=='undefined'){payload[
if(typeof password!=='undefined'){payload['password']=password;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('patch',uri,{'content-type':'application/json',},payload);});}
createJWT(){return __awaiter(this,void 0,void 0,function*(){let path='/account/jwt';let payload={};const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('post',uri,{'content-type':'application/json',},payload);});}
getLogs(queries){return __awaiter(this,void 0,void 0,function*(){let path='/account/logs';let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
listLogs(queries){return __awaiter(this,void 0,void 0,function*(){let path='/account/logs';let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('get',uri,{'content-type':'application/json',},payload);});}
updateName(name){return __awaiter(this,void 0,void 0,function*(){if(typeof name==='undefined'){throw new AppwriteException('Missing required parameter: "name"');}
let path='/account/name';let payload={};if(typeof name!=='undefined'){payload['name']=name;}
@ -913,7 +913,7 @@ updateEmail(userId,email){return __awaiter(this,void 0,void 0,function*(){if(typ
if(typeof email==='undefined'){throw new AppwriteException('Missing required parameter: "email"');}
let path='/users/{userId}/email'.replace('{userId}',userId);let payload={};if(typeof email!=='undefined'){payload['email']=email;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('patch',uri,{'content-type':'application/json',},payload);});}
getLogs(userId,queries){return __awaiter(this,void 0,void 0,function*(){if(typeof userId==='undefined'){throw new AppwriteException('Missing required parameter: "userId"');}
listLogs(userId,queries){return __awaiter(this,void 0,void 0,function*(){if(typeof userId==='undefined'){throw new AppwriteException('Missing required parameter: "userId"');}
let path='/users/{userId}/logs'.replace('{userId}',userId);let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('get',uri,{'content-type':'application/json',},payload);});}
listMemberships(userId){return __awaiter(this,void 0,void 0,function*(){if(typeof userId==='undefined'){throw new AppwriteException('Missing required parameter: "userId"');}

View file

@ -56,7 +56,7 @@ let path='/account/email';let payload={};if(typeof email!=='undefined'){payload[
if(typeof password!=='undefined'){payload['password']=password;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('patch',uri,{'content-type':'application/json',},payload);});}
createJWT(){return __awaiter(this,void 0,void 0,function*(){let path='/account/jwt';let payload={};const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('post',uri,{'content-type':'application/json',},payload);});}
getLogs(queries){return __awaiter(this,void 0,void 0,function*(){let path='/account/logs';let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
listLogs(queries){return __awaiter(this,void 0,void 0,function*(){let path='/account/logs';let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('get',uri,{'content-type':'application/json',},payload);});}
updateName(name){return __awaiter(this,void 0,void 0,function*(){if(typeof name==='undefined'){throw new AppwriteException('Missing required parameter: "name"');}
let path='/account/name';let payload={};if(typeof name!=='undefined'){payload['name']=name;}
@ -913,7 +913,7 @@ updateEmail(userId,email){return __awaiter(this,void 0,void 0,function*(){if(typ
if(typeof email==='undefined'){throw new AppwriteException('Missing required parameter: "email"');}
let path='/users/{userId}/email'.replace('{userId}',userId);let payload={};if(typeof email!=='undefined'){payload['email']=email;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('patch',uri,{'content-type':'application/json',},payload);});}
getLogs(userId,queries){return __awaiter(this,void 0,void 0,function*(){if(typeof userId==='undefined'){throw new AppwriteException('Missing required parameter: "userId"');}
listLogs(userId,queries){return __awaiter(this,void 0,void 0,function*(){if(typeof userId==='undefined'){throw new AppwriteException('Missing required parameter: "userId"');}
let path='/users/{userId}/logs'.replace('{userId}',userId);let payload={};if(typeof queries!=='undefined'){payload['queries']=queries;}
const uri=new URL(this.client.config.endpoint+path);return yield this.client.call('get',uri,{'content-type':'application/json',},payload);});}
listMemberships(userId){return __awaiter(this,void 0,void 0,function*(){if(typeof userId==='undefined'){throw new AppwriteException('Missing required parameter: "userId"');}

View file

@ -561,7 +561,7 @@
});
}
/**
* Get Account Logs
* List Account Logs
*
* Get currently logged in user list of latest security activity logs. Each
* log returns user IP address, location and date and time of log.
@ -570,7 +570,7 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
getLogs(queries) {
listLogs(queries) {
return __awaiter(this, void 0, void 0, function* () {
let path = '/account/logs';
let payload = {};
@ -6633,7 +6633,7 @@
});
}
/**
* Get User Logs
* List User Logs
*
* Get the user activity logs list by its unique ID.
*
@ -6642,7 +6642,7 @@
* @throws {AppwriteException}
* @returns {Promise}
*/
getLogs(userId, queries) {
listLogs(userId, queries) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof userId === 'undefined') {
throw new AppwriteException('Missing required parameter: "userId"');