node-appwrite
Advanced tools
Comparing version
@@ -15,3 +15,3 @@ const sdk = require('node-appwrite'); | ||
let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', fs.createReadStream(__dirname + '/file.png'), false); | ||
let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false); | ||
@@ -18,0 +18,0 @@ promise.then(function (response) { |
@@ -15,3 +15,3 @@ const sdk = require('node-appwrite'); | ||
let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', fs.createReadStream(__dirname + '/file.png')); | ||
let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', 'file.png'); | ||
@@ -18,0 +18,0 @@ promise.then(function (response) { |
@@ -13,4 +13,4 @@ const URL = require('url').URL; | ||
'content-type': '', | ||
'x-sdk-version': 'appwrite:nodejs:5.1.0', | ||
'X-Appwrite-Response-Format' : '0.13.0', | ||
'x-sdk-version': 'appwrite:nodejs:6.0.0', | ||
'X-Appwrite-Response-Format' : '0.14.0', | ||
}; | ||
@@ -17,0 +17,0 @@ this.selfSigned = false; |
@@ -27,23 +27,2 @@ const Service = require('../service.js'); | ||
/** | ||
* Delete Account | ||
* | ||
* Delete a currently logged in user account. Behind the scene, the user | ||
* record is not deleted but permanently blocked from any access. This is done | ||
* to avoid deleted accounts being overtaken by new users with the same email | ||
* address. Any user-related resources like documents or storage files should | ||
* be deleted separately. | ||
* | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async delete() { | ||
let path = '/account'; | ||
let payload = {}; | ||
return await this.client.call('delete', path, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Update Account Email | ||
@@ -149,3 +128,3 @@ * | ||
* to pass in the new password, and the old password. For users created with | ||
* OAuth and Team Invites, oldPassword is optional. | ||
* OAuth, Team Invites and Magic URL, oldPassword is optional. | ||
* | ||
@@ -388,2 +367,6 @@ * @param {string} password | ||
* | ||
* Access tokens have limited lifespan and expire to mitigate security risks. | ||
* If session was created using an OAuth provider, this route can be used to | ||
* "refresh" the access token. | ||
* | ||
* @param {string} sessionId | ||
@@ -432,2 +415,21 @@ * @throws {AppwriteException} | ||
/** | ||
* Update Account Status | ||
* | ||
* Block the currently logged in user account. Behind the scene, the user | ||
* record is not deleted but permanently blocked from any access. To | ||
* completely delete a user, use the Users API instead. | ||
* | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async updateStatus() { | ||
let path = '/account/status'; | ||
let payload = {}; | ||
return await this.client.call('patch', path, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Create Email Verification | ||
@@ -434,0 +436,0 @@ * |
@@ -13,5 +13,10 @@ const Service = require('../service.js'); | ||
* You can use this endpoint to show different browser icons to your users. | ||
* The code argument receives the browser code as it appears in your user | ||
* /account/sessions endpoint. Use width, height and quality arguments to | ||
* change the output settings. | ||
* The code argument receives the browser code as it appears in your user [GET | ||
* /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use | ||
* width, height and quality arguments to change the output settings. | ||
* | ||
* When one dimension is specified and the other is 0, the image is scaled | ||
* with preserved aspect ratio. If both dimensions are 0, the API provides an | ||
* image at source quality. If dimensions are not specified, the default size | ||
* of image returned is 100x100px. | ||
* | ||
@@ -56,2 +61,8 @@ * @param {string} code | ||
* output settings. | ||
* | ||
* When one dimension is specified and the other is 0, the image is scaled | ||
* with preserved aspect ratio. If both dimensions are 0, the API provides an | ||
* image at source quality. If dimensions are not specified, the default size | ||
* of image returned is 100x100px. | ||
* | ||
* | ||
@@ -124,2 +135,8 @@ * @param {string} code | ||
* height and quality arguments to change the output settings. | ||
* | ||
* When one dimension is specified and the other is 0, the image is scaled | ||
* with preserved aspect ratio. If both dimensions are 0, the API provides an | ||
* image at source quality. If dimensions are not specified, the default size | ||
* of image returned is 100x100px. | ||
* | ||
* | ||
@@ -165,2 +182,8 @@ * @param {string} code | ||
* image is properly served using a TLS protocol. | ||
* | ||
* When one dimension is specified and the other is 0, the image is scaled | ||
* with preserved aspect ratio. If both dimensions are 0, the API provides an | ||
* image at source quality. If dimensions are not specified, the default size | ||
* of image returned is 400x400px. | ||
* | ||
* | ||
@@ -211,2 +234,8 @@ * @param {string} url | ||
* the same initials. | ||
* | ||
* When one dimension is specified and the other is 0, the image is scaled | ||
* with preserved aspect ratio. If both dimensions are 0, the API provides an | ||
* image at source quality. If dimensions are not specified, the default size | ||
* of image returned is 100x100px. | ||
* | ||
* | ||
@@ -255,2 +284,3 @@ * @param {string} name | ||
* parameters to change the size and style of the resulting image. | ||
* | ||
* | ||
@@ -257,0 +287,0 @@ * @param {string} text |
@@ -928,5 +928,3 @@ const Service = require('../service.js'); | ||
* | ||
* Delete a document by its unique ID. This endpoint deletes only the parent | ||
* documents, its attributes and relations to other documents. Child documents | ||
* **will not** be deleted. | ||
* Delete a document by its unique ID. | ||
* | ||
@@ -933,0 +931,0 @@ * @param {string} collectionId |
@@ -133,3 +133,3 @@ const Service = require('../service.js'); | ||
/** | ||
* List the currently active function runtimes. | ||
* List runtimes | ||
* | ||
@@ -136,0 +136,0 @@ * Get a list of all runtimes that are currently active on your instance. |
@@ -131,20 +131,2 @@ const Service = require('../service.js'); | ||
/** | ||
* Get Usage Queue | ||
* | ||
* Get the number of usage stats that are waiting to be processed in the | ||
* Appwrite internal queue server. | ||
* | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async getQueueUsage() { | ||
let path = '/health/queue/usage'; | ||
let payload = {}; | ||
return await this.client.call('get', path, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Get Webhooks Queue | ||
@@ -151,0 +133,0 @@ * |
@@ -131,3 +131,7 @@ const Service = require('../service.js'); | ||
* | ||
* Delete a user by its unique ID. | ||
* Delete a user by its unique ID, thereby releasing it's ID. Since ID is | ||
* released and can be reused, all user-related resources like documents or | ||
* storage files should be deleted before user deletion. If you want to keep | ||
* ID reserved, use the [updateStatus](/docs/server/users#usersUpdateStatus) | ||
* endpoint instead. | ||
* | ||
@@ -215,2 +219,24 @@ * @param {string} userId | ||
/** | ||
* Get User Memberships | ||
* | ||
* Get the user membership list by its unique ID. | ||
* | ||
* @param {string} userId | ||
* @throws {AppwriteException} | ||
* @returns {Promise} | ||
*/ | ||
async getMemberships(userId) { | ||
if (typeof userId === 'undefined') { | ||
throw new AppwriteException('Missing required parameter: "userId"'); | ||
} | ||
let path = '/users/{userId}/memberships'.replace('{userId}', userId); | ||
let payload = {}; | ||
return await this.client.call('get', path, { | ||
'content-type': 'application/json', | ||
}, payload); | ||
} | ||
/** | ||
* Update Name | ||
@@ -406,3 +432,4 @@ * | ||
* | ||
* Update the user status by its unique ID. | ||
* Update the user status by its unique ID. Use this endpoint as an | ||
* alternative to deleting a user if you want to keep user's ID reserved. | ||
* | ||
@@ -409,0 +436,0 @@ * @param {string} userId |
@@ -5,3 +5,3 @@ { | ||
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", | ||
"version": "5.1.0", | ||
"version": "6.0.0", | ||
"license": "BSD-3-Clause", | ||
@@ -16,5 +16,5 @@ "main": "./index.js", | ||
"dependencies": { | ||
"axios": "^0.26.1", | ||
"axios": "^0.27.2", | ||
"form-data": "^4.0.0" | ||
} | ||
} |
# Appwrite Node.js SDK | ||
 | ||
 | ||
 | ||
[](https://travis-ci.com/appwrite/sdk-generator) | ||
@@ -9,3 +9,3 @@ [](https://twitter.com/appwrite) | ||
**This SDK is compatible with Appwrite server version 0.13.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** | ||
**This SDK is compatible with Appwrite server version 0.14.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** | ||
@@ -12,0 +12,0 @@ > This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code. |
Sorry, the diff of this file is too big to display
309244
1.29%7156
1.09%+ Added
- Removed
Updated