Skip to content

Commit 851e598

Browse files
committed
chore: release rc
1 parent c2c1258 commit 851e598

File tree

13 files changed

+264
-31
lines changed

13 files changed

+264
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite Node.js SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.5.7-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

docs/examples/account/delete-mfa-authenticator.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ const client = new sdk.Client()
88
const account = new sdk.Account(client);
99

1010
const result = await account.deleteMfaAuthenticator(
11-
sdk.AuthenticatorType.Totp, // type
12-
'<OTP>' // otp
11+
sdk.AuthenticatorType.Totp // type
1312
);

docs/examples/functions/create-execution.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const sdk = require('node-appwrite');
2+
const fs = require('fs');
23

34
const client = new sdk.Client()
45
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint

docs/examples/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ const result = await functions.create(
2828
'<TEMPLATE_REPOSITORY>', // templateRepository (optional)
2929
'<TEMPLATE_OWNER>', // templateOwner (optional)
3030
'<TEMPLATE_ROOT_DIRECTORY>', // templateRootDirectory (optional)
31-
'<TEMPLATE_BRANCH>' // templateBranch (optional)
31+
'<TEMPLATE_VERSION>' // templateVersion (optional)
3232
);

docs/examples/functions/download-deployment.md renamed to docs/examples/functions/get-deployment-download.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const sdk = require('node-appwrite');
33
const client = new sdk.Client()
44
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
55
.setProject('&lt;YOUR_PROJECT_ID&gt;') // Your project ID
6-
.setKey('&lt;YOUR_API_KEY&gt;'); // Your secret API key
6+
.setSession(''); // The user session to authenticate with
77

88
const functions = new sdk.Functions(client);
99

10-
const result = await functions.downloadDeployment(
10+
const result = await functions.getDeploymentDownload(
1111
'<FUNCTION_ID>', // functionId
1212
'<DEPLOYMENT_ID>' // deploymentId
1313
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const sdk = require('node-appwrite');
2+
3+
const client = new sdk.Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('&lt;YOUR_PROJECT_ID&gt;'); // Your project ID
6+
7+
const functions = new sdk.Functions(client);
8+
9+
const result = await functions.getTemplate(
10+
'<TEMPLATE_ID>' // templateId
11+
);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const sdk = require('node-appwrite');
2+
3+
const client = new sdk.Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('&lt;YOUR_PROJECT_ID&gt;'); // Your project ID
6+
7+
const functions = new sdk.Functions(client);
8+
9+
const result = await functions.listTemplates(
10+
[], // runtimes (optional)
11+
[], // useCases (optional)
12+
1, // limit (optional)
13+
0 // offset (optional)
14+
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "node-appwrite",
33
"homepage": "https://appwrite.io/support",
44
"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",
5-
"version": "14.0.0-rc.1",
5+
"version": "14.0.0-rc.2",
66
"license": "BSD-3-Clause",
77
"main": "dist/index.js",
88
"type": "commonjs",

src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AppwriteException extends Error {
3333
}
3434

3535
function getUserAgent() {
36-
let ua = 'AppwriteNodeJSSDK/14.0.0-rc.1';
36+
let ua = 'AppwriteNodeJSSDK/14.0.0-rc.2';
3737

3838
// `process` is a global in Node.js, but not fully available in all runtimes.
3939
const platform: string[] = [];
@@ -82,9 +82,9 @@ class Client {
8282
'x-sdk-name': 'Node.js',
8383
'x-sdk-platform': 'server',
8484
'x-sdk-language': 'nodejs',
85-
'x-sdk-version': '14.0.0-rc.1',
85+
'x-sdk-version': '14.0.0-rc.2',
8686
'user-agent' : getUserAgent(),
87-
'X-Appwrite-Response-Format': '1.5.0',
87+
'X-Appwrite-Response-Format': '1.6.0',
8888
};
8989

9090
/**

src/models.ts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,19 @@ export namespace Models {
171171
*/
172172
functions: Function[];
173173
}
174+
/**
175+
* Function Templates List
176+
*/
177+
export type TemplateFunctionList = {
178+
/**
179+
* Total number of templates documents that matched your query.
180+
*/
181+
total: number;
182+
/**
183+
* List of templates.
184+
*/
185+
templates: TemplateFunction[];
186+
}
174187
/**
175188
* Runtimes List
176189
*/
@@ -1716,6 +1729,129 @@ export namespace Models {
17161729
*/
17171730
providerSilentMode: boolean;
17181731
}
1732+
/**
1733+
* Template Function
1734+
*/
1735+
export type TemplateFunction = {
1736+
/**
1737+
* Function Template Icon.
1738+
*/
1739+
icon: string;
1740+
/**
1741+
* Function Template ID.
1742+
*/
1743+
id: string;
1744+
/**
1745+
* Function Template Name.
1746+
*/
1747+
name: string;
1748+
/**
1749+
* Function Template Tagline.
1750+
*/
1751+
tagline: string;
1752+
/**
1753+
* Execution permissions.
1754+
*/
1755+
permissions: string[];
1756+
/**
1757+
* Function trigger events.
1758+
*/
1759+
events: string[];
1760+
/**
1761+
* Function execution schedult in CRON format.
1762+
*/
1763+
cron: string;
1764+
/**
1765+
* Function execution timeout in seconds.
1766+
*/
1767+
timeout: number;
1768+
/**
1769+
* Function use cases.
1770+
*/
1771+
useCases: string[];
1772+
/**
1773+
* List of runtimes that can be used with this template.
1774+
*/
1775+
runtimes: TemplateRuntime[];
1776+
/**
1777+
* Function Template Instructions.
1778+
*/
1779+
instructions: string;
1780+
/**
1781+
* VCS (Version Control System) Provider.
1782+
*/
1783+
vcsProvider: string;
1784+
/**
1785+
* VCS (Version Control System) Repository ID
1786+
*/
1787+
providerRepositoryId: string;
1788+
/**
1789+
* VCS (Version Control System) Owner.
1790+
*/
1791+
providerOwner: string;
1792+
/**
1793+
* VCS (Version Control System) branch version (tag).
1794+
*/
1795+
providerVersion: string;
1796+
/**
1797+
* Function variables.
1798+
*/
1799+
variables: TemplateVariable[];
1800+
/**
1801+
* Function scopes.
1802+
*/
1803+
scopes: string[];
1804+
}
1805+
/**
1806+
* Template Runtime
1807+
*/
1808+
export type TemplateRuntime = {
1809+
/**
1810+
* Runtime Name.
1811+
*/
1812+
name: string;
1813+
/**
1814+
* The build command used to build the deployment.
1815+
*/
1816+
commands: string;
1817+
/**
1818+
* The entrypoint file used to execute the deployment.
1819+
*/
1820+
entrypoint: string;
1821+
/**
1822+
* Path to function in VCS (Version Control System) repository
1823+
*/
1824+
providerRootDirectory: string;
1825+
}
1826+
/**
1827+
* Template Variable
1828+
*/
1829+
export type TemplateVariable = {
1830+
/**
1831+
* Variable Name.
1832+
*/
1833+
name: string;
1834+
/**
1835+
* Variable Description.
1836+
*/
1837+
description: string;
1838+
/**
1839+
* Variable Value.
1840+
*/
1841+
value: string;
1842+
/**
1843+
* Variable Placeholder.
1844+
*/
1845+
placeholder: string;
1846+
/**
1847+
* Is the variable required?
1848+
*/
1849+
required: boolean;
1850+
/**
1851+
* Variable Type.
1852+
*/
1853+
type: string;
1854+
}
17191855
/**
17201856
* Runtime
17211857
*/
@@ -1724,6 +1860,10 @@ export namespace Models {
17241860
* Runtime ID.
17251861
*/
17261862
$id: string;
1863+
/**
1864+
* Parent runtime key.
1865+
*/
1866+
key: string;
17271867
/**
17281868
* Runtime Name.
17291869
*/
@@ -1914,6 +2054,10 @@ export namespace Models {
19142054
* Function execution duration in seconds.
19152055
*/
19162056
duration: number;
2057+
/**
2058+
* The scheduled time for execution. If left empty, execution will be queued immediately.
2059+
*/
2060+
scheduledAt?: string;
19172061
}
19182062
/**
19192063
* Build

src/services/account.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
264264
);
265265
}
266266
/**
267-
* Add Authenticator
267+
* Create Authenticator
268268
*
269269
* Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.
270270
*
@@ -332,22 +332,15 @@ This endpoint can also be used to convert an anonymous account to a normal one,
332332
* Delete an authenticator for a user by ID.
333333
*
334334
* @param {AuthenticatorType} type
335-
* @param {string} otp
336335
* @throws {AppwriteException}
337336
* @returns {Promise<{}>}
338337
*/
339-
async deleteMfaAuthenticator(type: AuthenticatorType, otp: string): Promise<{}> {
338+
async deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> {
340339
if (typeof type === 'undefined') {
341340
throw new AppwriteException('Missing required parameter: "type"');
342341
}
343-
if (typeof otp === 'undefined') {
344-
throw new AppwriteException('Missing required parameter: "otp"');
345-
}
346342
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
347343
const payload: Payload = {};
348-
if (typeof otp !== 'undefined') {
349-
payload['otp'] = otp;
350-
}
351344
const uri = new URL(this.client.config.endpoint + apiPath);
352345

353346
const apiHeaders: { [header: string]: string } = {
@@ -362,7 +355,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
362355
);
363356
}
364357
/**
365-
* Create 2FA Challenge
358+
* Create MFA Challenge
366359
*
367360
* Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
368361
*
@@ -1378,7 +1371,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
13781371
);
13791372
}
13801373
/**
1381-
* Create phone verification (confirmation)
1374+
* Update phone verification (confirmation)
13821375
*
13831376
* Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user&#039;s phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
13841377
*

src/services/avatars.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre
103103
*
104104
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
105105
106+
This endpoint does not follow HTTP redirects.
106107
*
107108
* @param {string} url
108109
* @throws {AppwriteException}
@@ -182,6 +183,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre
182183
183184
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.
184185
186+
This endpoint does not follow HTTP redirects.
185187
*
186188
* @param {string} url
187189
* @param {number} width

0 commit comments

Comments
 (0)