Skip to content

Commit

Permalink
chore: release rc
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Aug 17, 2024
1 parent 445c374 commit 3dbbc2d
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Deno SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.5.7-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ const client = new Client()
const account = new Account(client);

const response = await account.deleteMfaAuthenticator(
AuthenticatorType.Totp, // type
'<OTP>' // otp
AuthenticatorType.Totp // type
);
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ const response = await functions.create(
'<TEMPLATE_REPOSITORY>', // templateRepository (optional)
'<TEMPLATE_OWNER>', // templateOwner (optional)
'<TEMPLATE_ROOT_DIRECTORY>', // templateRootDirectory (optional)
'<TEMPLATE_BRANCH>' // templateBranch (optional)
'<TEMPLATE_VERSION>' // templateVersion (optional)
);
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";
const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('&lt;YOUR_PROJECT_ID&gt;') // Your project ID
.setKey('&lt;YOUR_API_KEY&gt;'); // Your secret API key
.setSession(''); // The user session to authenticate with

const functions = new Functions(client);

const result = functions.downloadDeployment(
const result = functions.getDeploymentDownload(
'<FUNCTION_ID>', // functionId
'<DEPLOYMENT_ID>' // deploymentId
);
11 changes: 11 additions & 0 deletions docs/examples/functions/get-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('&lt;YOUR_PROJECT_ID&gt;'); // Your project ID

const functions = new Functions(client);

const response = await functions.getTemplate(
'<TEMPLATE_ID>' // templateId
);
14 changes: 14 additions & 0 deletions docs/examples/functions/list-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('&lt;YOUR_PROJECT_ID&gt;'); // Your project ID

const functions = new Functions(client);

const response = await functions.listTemplates(
[], // runtimes (optional)
[], // useCases (optional)
1, // limit (optional)
0 // offset (optional)
);
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export class Client {
endpoint: string = 'https://cloud.appwrite.io/v1';
headers: Payload = {
'content-type': '',
'user-agent' : `AppwriteDenoSDK/11.0.0 (${Deno.build.os}; ${Deno.build.arch})`,
'user-agent' : `AppwriteDenoSDK/12.0.0-rc.1 (${Deno.build.os}; ${Deno.build.arch})`,
'x-sdk-name': 'Deno',
'x-sdk-platform': 'server',
'x-sdk-language': 'deno',
'x-sdk-version': '11.0.0',
'X-Appwrite-Response-Format':'1.5.0',
'x-sdk-version': '12.0.0-rc.1',
'X-Appwrite-Response-Format':'1.6.0',
};

/**
Expand Down
144 changes: 144 additions & 0 deletions src/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ export namespace Models {
*/
functions: Function[];
}
/**
* Function Templates List
*/
export type TemplateFunctionList = {
/**
* Total number of templates documents that matched your query.
*/
total: number;
/**
* List of templates.
*/
templates: TemplateFunction[];
}
/**
* Runtimes List
*/
Expand Down Expand Up @@ -1711,6 +1724,129 @@ export namespace Models {
*/
providerSilentMode: boolean;
}
/**
* Template Function
*/
export type TemplateFunction = {
/**
* Function Template Icon.
*/
icon: string;
/**
* Function Template ID.
*/
id: string;
/**
* Function Template Name.
*/
name: string;
/**
* Function Template Tagline.
*/
tagline: string;
/**
* Execution permissions.
*/
permissions: string[];
/**
* Function trigger events.
*/
events: string[];
/**
* Function execution schedult in CRON format.
*/
cron: string;
/**
* Function execution timeout in seconds.
*/
timeout: number;
/**
* Function use cases.
*/
useCases: string[];
/**
* List of runtimes that can be used with this template.
*/
runtimes: TemplateRuntime[];
/**
* Function Template Instructions.
*/
instructions: string;
/**
* VCS (Version Control System) Provider.
*/
vcsProvider: string;
/**
* VCS (Version Control System) Repository ID
*/
providerRepositoryId: string;
/**
* VCS (Version Control System) Owner.
*/
providerOwner: string;
/**
* VCS (Version Control System) branch version (tag).
*/
providerVersion: string;
/**
* Function variables.
*/
variables: TemplateVariable[];
/**
* Function scopes.
*/
scopes: string[];
}
/**
* Template Runtime
*/
export type TemplateRuntime = {
/**
* Runtime Name.
*/
name: string;
/**
* The build command used to build the deployment.
*/
commands: string;
/**
* The entrypoint file used to execute the deployment.
*/
entrypoint: string;
/**
* Path to function in VCS (Version Control System) repository
*/
providerRootDirectory: string;
}
/**
* Template Variable
*/
export type TemplateVariable = {
/**
* Variable Name.
*/
name: string;
/**
* Variable Description.
*/
description: string;
/**
* Variable Value.
*/
value: string;
/**
* Variable Placeholder.
*/
placeholder: string;
/**
* Is the variable required?
*/
required: boolean;
/**
* Variable Type.
*/
type: string;
}
/**
* Runtime
*/
Expand All @@ -1719,6 +1855,10 @@ export namespace Models {
* Runtime ID.
*/
$id: string;
/**
* Parent runtime key.
*/
key: string;
/**
* Runtime Name.
*/
Expand Down Expand Up @@ -1909,6 +2049,10 @@ export namespace Models {
* Function execution duration in seconds.
*/
duration: number;
/**
* The scheduled time for execution. If left empty, execution will be queued immediately.
*/
scheduledAt?: string;
}
/**
* Build
Expand Down
16 changes: 4 additions & 12 deletions src/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export class Account extends Service {
);
}
/**
* Add Authenticator
* Create Authenticator
*
* Add an authenticator app to be used as an MFA factor. Verify the
* authenticator using the [verify
Expand Down Expand Up @@ -358,25 +358,17 @@ export class Account extends Service {
* Delete an authenticator for a user by ID.
*
* @param {AuthenticatorType} type
* @param {string} otp
* @throws {AppwriteException}
* @returns {Promise}
*/
async deleteMfaAuthenticator(type: AuthenticatorType, otp: string): Promise<Response> {
async deleteMfaAuthenticator(type: AuthenticatorType): Promise<Response> {
if (typeof type === 'undefined') {
throw new AppwriteException('Missing required parameter: "type"');
}

if (typeof otp === 'undefined') {
throw new AppwriteException('Missing required parameter: "otp"');
}

const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
const payload: Payload = {};

if (typeof otp !== 'undefined') {
payload['otp'] = otp;
}
return await this.client.call(
'delete',
apiPath,
Expand All @@ -388,7 +380,7 @@ export class Account extends Service {
);
}
/**
* Create 2FA Challenge
* Create MFA Challenge
*
* Begin the process of MFA verification after sign-in. Finish the flow with
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
Expand Down Expand Up @@ -1499,7 +1491,7 @@ export class Account extends Service {
);
}
/**
* Create phone verification (confirmation)
* Update phone verification (confirmation)
*
* Use this endpoint to complete the user phone verification process. Use the
* **userId** and **secret** that were sent to your user's phone number to
Expand Down
2 changes: 2 additions & 0 deletions src/services/avatars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export class Avatars extends Service {
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
* website URL.
*
* This endpoint does not follow HTTP redirects.
*
* @param {string} url
* @throws {AppwriteException}
Expand Down Expand Up @@ -222,6 +223,7 @@ export class Avatars extends Service {
* image at source quality. If dimensions are not specified, the default size
* of image returned is 400x400px.
*
* This endpoint does not follow HTTP redirects.
*
* @param {string} url
* @param {number} width
Expand Down
Loading

0 comments on commit 3dbbc2d

Please sign in to comment.