Added user delete method to the console SDK
This commit is contained in:
parent
3abfd53d88
commit
626d0d7281
|
@ -1,7 +1,7 @@
|
|||
# Appwrite Web SDK
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1)
|
||||
|
||||
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
|
||||
Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Appwrite Console SDK
|
||||
|
||||
![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
|
||||
![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1)
|
||||
|
||||
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
|
||||
Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
|
||||
|
|
15
app/sdks/console-web/docs/examples/users/delete-user.md
Normal file
15
app/sdks/console-web/docs/examples/users/delete-user.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
let sdk = new Appwrite();
|
||||
|
||||
sdk
|
||||
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
|
||||
.setProject('5df5acd0d48c2') // Your project ID
|
||||
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
|
||||
;
|
||||
|
||||
let promise = sdk.users.deleteUser('[USER_ID]');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response); // Success
|
||||
}, function (error) {
|
||||
console.log(error); // Failure
|
||||
});
|
|
@ -4750,6 +4750,30 @@
|
|||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete User
|
||||
*
|
||||
* Delete a user by its unique ID.
|
||||
*
|
||||
* @param {string} userId
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
deleteUser: function(userId) {
|
||||
if(userId === undefined) {
|
||||
throw new Error('Missing required parameter: "userId"');
|
||||
}
|
||||
|
||||
let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId);
|
||||
|
||||
let payload = {};
|
||||
|
||||
return http
|
||||
.delete(path, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get User Logs
|
||||
*
|
||||
|
|
3
app/sdks/console-web/src/sdk.min.js
vendored
3
app/sdks/console-web/src/sdk.min.js
vendored
|
@ -415,7 +415,8 @@ let path='/users';let payload={};if(email){payload.email=email}
|
|||
if(password){payload.password=password}
|
||||
if(name){payload.name=name}
|
||||
return http.post(path,{'content-type':'application/json',},payload)},get:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},deleteUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
|
||||
if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
|
||||
|
|
11
app/sdks/console-web/types/index.d.ts
vendored
11
app/sdks/console-web/types/index.d.ts
vendored
|
@ -1706,6 +1706,17 @@ declare namespace Appwrite {
|
|||
*/
|
||||
get(userId: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Delete User
|
||||
*
|
||||
* Delete a user by its unique ID.
|
||||
*
|
||||
* @param {string} userId
|
||||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
deleteUser(userId: string): Promise<object>;
|
||||
|
||||
/**
|
||||
* Get User Logs
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue