Skip to content

Commit 3dbbc2d

Browse files
committed
chore: release rc
1 parent 445c374 commit 3dbbc2d

File tree

13 files changed

+314
-43
lines changed

13 files changed

+314
-43
lines changed

README.md

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

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.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 Client()
88
const account = new Account(client);
99

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

docs/examples/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ const response = 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 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";
33
const client = new 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 Functions(client);
99

10-
const result = functions.downloadDeployment(
10+
const result = 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+
import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";
2+
3+
const client = new 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 Functions(client);
8+
9+
const response = 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+
import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";
2+
3+
const client = new 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 Functions(client);
8+
9+
const response = await functions.listTemplates(
10+
[], // runtimes (optional)
11+
[], // useCases (optional)
12+
1, // limit (optional)
13+
0 // offset (optional)
14+
);

src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ export class Client {
1111
endpoint: string = 'https://cloud.appwrite.io/v1';
1212
headers: Payload = {
1313
'content-type': '',
14-
'user-agent' : `AppwriteDenoSDK/11.0.0 (${Deno.build.os}; ${Deno.build.arch})`,
14+
'user-agent' : `AppwriteDenoSDK/12.0.0-rc.1 (${Deno.build.os}; ${Deno.build.arch})`,
1515
'x-sdk-name': 'Deno',
1616
'x-sdk-platform': 'server',
1717
'x-sdk-language': 'deno',
18-
'x-sdk-version': '11.0.0',
19-
'X-Appwrite-Response-Format':'1.5.0',
18+
'x-sdk-version': '12.0.0-rc.1',
19+
'X-Appwrite-Response-Format':'1.6.0',
2020
};
2121

2222
/**

src/models.d.ts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ export namespace Models {
168168
*/
169169
functions: Function[];
170170
}
171+
/**
172+
* Function Templates List
173+
*/
174+
export type TemplateFunctionList = {
175+
/**
176+
* Total number of templates documents that matched your query.
177+
*/
178+
total: number;
179+
/**
180+
* List of templates.
181+
*/
182+
templates: TemplateFunction[];
183+
}
171184
/**
172185
* Runtimes List
173186
*/
@@ -1711,6 +1724,129 @@ export namespace Models {
17111724
*/
17121725
providerSilentMode: boolean;
17131726
}
1727+
/**
1728+
* Template Function
1729+
*/
1730+
export type TemplateFunction = {
1731+
/**
1732+
* Function Template Icon.
1733+
*/
1734+
icon: string;
1735+
/**
1736+
* Function Template ID.
1737+
*/
1738+
id: string;
1739+
/**
1740+
* Function Template Name.
1741+
*/
1742+
name: string;
1743+
/**
1744+
* Function Template Tagline.
1745+
*/
1746+
tagline: string;
1747+
/**
1748+
* Execution permissions.
1749+
*/
1750+
permissions: string[];
1751+
/**
1752+
* Function trigger events.
1753+
*/
1754+
events: string[];
1755+
/**
1756+
* Function execution schedult in CRON format.
1757+
*/
1758+
cron: string;
1759+
/**
1760+
* Function execution timeout in seconds.
1761+
*/
1762+
timeout: number;
1763+
/**
1764+
* Function use cases.
1765+
*/
1766+
useCases: string[];
1767+
/**
1768+
* List of runtimes that can be used with this template.
1769+
*/
1770+
runtimes: TemplateRuntime[];
1771+
/**
1772+
* Function Template Instructions.
1773+
*/
1774+
instructions: string;
1775+
/**
1776+
* VCS (Version Control System) Provider.
1777+
*/
1778+
vcsProvider: string;
1779+
/**
1780+
* VCS (Version Control System) Repository ID
1781+
*/
1782+
providerRepositoryId: string;
1783+
/**
1784+
* VCS (Version Control System) Owner.
1785+
*/
1786+
providerOwner: string;
1787+
/**
1788+
* VCS (Version Control System) branch version (tag).
1789+
*/
1790+
providerVersion: string;
1791+
/**
1792+
* Function variables.
1793+
*/
1794+
variables: TemplateVariable[];
1795+
/**
1796+
* Function scopes.
1797+
*/
1798+
scopes: string[];
1799+
}
1800+
/**
1801+
* Template Runtime
1802+
*/
1803+
export type TemplateRuntime = {
1804+
/**
1805+
* Runtime Name.
1806+
*/
1807+
name: string;
1808+
/**
1809+
* The build command used to build the deployment.
1810+
*/
1811+
commands: string;
1812+
/**
1813+
* The entrypoint file used to execute the deployment.
1814+
*/
1815+
entrypoint: string;
1816+
/**
1817+
* Path to function in VCS (Version Control System) repository
1818+
*/
1819+
providerRootDirectory: string;
1820+
}
1821+
/**
1822+
* Template Variable
1823+
*/
1824+
export type TemplateVariable = {
1825+
/**
1826+
* Variable Name.
1827+
*/
1828+
name: string;
1829+
/**
1830+
* Variable Description.
1831+
*/
1832+
description: string;
1833+
/**
1834+
* Variable Value.
1835+
*/
1836+
value: string;
1837+
/**
1838+
* Variable Placeholder.
1839+
*/
1840+
placeholder: string;
1841+
/**
1842+
* Is the variable required?
1843+
*/
1844+
required: boolean;
1845+
/**
1846+
* Variable Type.
1847+
*/
1848+
type: string;
1849+
}
17141850
/**
17151851
* Runtime
17161852
*/
@@ -1719,6 +1855,10 @@ export namespace Models {
17191855
* Runtime ID.
17201856
*/
17211857
$id: string;
1858+
/**
1859+
* Parent runtime key.
1860+
*/
1861+
key: string;
17221862
/**
17231863
* Runtime Name.
17241864
*/
@@ -1909,6 +2049,10 @@ export namespace Models {
19092049
* Function execution duration in seconds.
19102050
*/
19112051
duration: number;
2052+
/**
2053+
* The scheduled time for execution. If left empty, execution will be queued immediately.
2054+
*/
2055+
scheduledAt?: string;
19122056
}
19132057
/**
19142058
* Build

src/services/account.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export class Account extends Service {
286286
);
287287
}
288288
/**
289-
* Add Authenticator
289+
* Create Authenticator
290290
*
291291
* Add an authenticator app to be used as an MFA factor. Verify the
292292
* authenticator using the [verify
@@ -358,25 +358,17 @@ export class Account extends Service {
358358
* Delete an authenticator for a user by ID.
359359
*
360360
* @param {AuthenticatorType} type
361-
* @param {string} otp
362361
* @throws {AppwriteException}
363362
* @returns {Promise}
364363
*/
365-
async deleteMfaAuthenticator(type: AuthenticatorType, otp: string): Promise<Response> {
364+
async deleteMfaAuthenticator(type: AuthenticatorType): Promise<Response> {
366365
if (typeof type === 'undefined') {
367366
throw new AppwriteException('Missing required parameter: "type"');
368367
}
369368

370-
if (typeof otp === 'undefined') {
371-
throw new AppwriteException('Missing required parameter: "otp"');
372-
}
373-
374369
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
375370
const payload: Payload = {};
376371

377-
if (typeof otp !== 'undefined') {
378-
payload['otp'] = otp;
379-
}
380372
return await this.client.call(
381373
'delete',
382374
apiPath,
@@ -388,7 +380,7 @@ export class Account extends Service {
388380
);
389381
}
390382
/**
391-
* Create 2FA Challenge
383+
* Create MFA Challenge
392384
*
393385
* Begin the process of MFA verification after sign-in. Finish the flow with
394386
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
@@ -1499,7 +1491,7 @@ export class Account extends Service {
14991491
);
15001492
}
15011493
/**
1502-
* Create phone verification (confirmation)
1494+
* Update phone verification (confirmation)
15031495
*
15041496
* Use this endpoint to complete the user phone verification process. Use the
15051497
* **userId** and **secret** that were sent to your user's phone number to

src/services/avatars.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export class Avatars extends Service {
131131
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
132132
* website URL.
133133
*
134+
* This endpoint does not follow HTTP redirects.
134135
*
135136
* @param {string} url
136137
* @throws {AppwriteException}
@@ -222,6 +223,7 @@ export class Avatars extends Service {
222223
* image at source quality. If dimensions are not specified, the default size
223224
* of image returned is 400x400px.
224225
*
226+
* This endpoint does not follow HTTP redirects.
225227
*
226228
* @param {string} url
227229
* @param {number} width

0 commit comments

Comments
 (0)