Skip to content

Commit 6727be3

Browse files
committed
chore: updates for appwrite 1.6.x
1 parent d9cc7ea commit 6727be3

File tree

5 files changed

+1
-195
lines changed

5 files changed

+1
-195
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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('<YOUR_PROJECT_ID>') // Your project ID
6-
.setSession(''); // The user session to authenticate with
6+
.setKey('<YOUR_API_KEY>'); // Your secret API key
77

88
const functions = new Functions(client);
99

docs/examples/functions/get-template.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/models.d.ts

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,129 +1728,6 @@ export namespace Models {
17281728
*/
17291729
specification: string;
17301730
}
1731-
/**
1732-
* Template Function
1733-
*/
1734-
export type TemplateFunction = {
1735-
/**
1736-
* Function Template Icon.
1737-
*/
1738-
icon: string;
1739-
/**
1740-
* Function Template ID.
1741-
*/
1742-
id: string;
1743-
/**
1744-
* Function Template Name.
1745-
*/
1746-
name: string;
1747-
/**
1748-
* Function Template Tagline.
1749-
*/
1750-
tagline: string;
1751-
/**
1752-
* Execution permissions.
1753-
*/
1754-
permissions: string[];
1755-
/**
1756-
* Function trigger events.
1757-
*/
1758-
events: string[];
1759-
/**
1760-
* Function execution schedult in CRON format.
1761-
*/
1762-
cron: string;
1763-
/**
1764-
* Function execution timeout in seconds.
1765-
*/
1766-
timeout: number;
1767-
/**
1768-
* Function use cases.
1769-
*/
1770-
useCases: string[];
1771-
/**
1772-
* List of runtimes that can be used with this template.
1773-
*/
1774-
runtimes: TemplateRuntime[];
1775-
/**
1776-
* Function Template Instructions.
1777-
*/
1778-
instructions: string;
1779-
/**
1780-
* VCS (Version Control System) Provider.
1781-
*/
1782-
vcsProvider: string;
1783-
/**
1784-
* VCS (Version Control System) Repository ID
1785-
*/
1786-
providerRepositoryId: string;
1787-
/**
1788-
* VCS (Version Control System) Owner.
1789-
*/
1790-
providerOwner: string;
1791-
/**
1792-
* VCS (Version Control System) branch version (tag).
1793-
*/
1794-
providerVersion: string;
1795-
/**
1796-
* Function variables.
1797-
*/
1798-
variables: TemplateVariable[];
1799-
/**
1800-
* Function scopes.
1801-
*/
1802-
scopes: string[];
1803-
}
1804-
/**
1805-
* Template Runtime
1806-
*/
1807-
export type TemplateRuntime = {
1808-
/**
1809-
* Runtime Name.
1810-
*/
1811-
name: string;
1812-
/**
1813-
* The build command used to build the deployment.
1814-
*/
1815-
commands: string;
1816-
/**
1817-
* The entrypoint file used to execute the deployment.
1818-
*/
1819-
entrypoint: string;
1820-
/**
1821-
* Path to function in VCS (Version Control System) repository
1822-
*/
1823-
providerRootDirectory: string;
1824-
}
1825-
/**
1826-
* Template Variable
1827-
*/
1828-
export type TemplateVariable = {
1829-
/**
1830-
* Variable Name.
1831-
*/
1832-
name: string;
1833-
/**
1834-
* Variable Description.
1835-
*/
1836-
description: string;
1837-
/**
1838-
* Variable Value.
1839-
*/
1840-
value: string;
1841-
/**
1842-
* Variable Placeholder.
1843-
*/
1844-
placeholder: string;
1845-
/**
1846-
* Is the variable required?
1847-
*/
1848-
required: boolean;
1849-
/**
1850-
* Variable Type.
1851-
*/
1852-
type: string;
1853-
}
18541731
/**
18551732
* Runtime
18561733
*/

src/services/functions.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -226,35 +226,6 @@ export class Functions extends Service {
226226
'json'
227227
);
228228
}
229-
/**
230-
* Get function template
231-
*
232-
* Get a function template using ID. You can use template details in
233-
* [createFunction](/docs/references/cloud/server-nodejs/functions#create)
234-
* method.
235-
*
236-
* @param {string} templateId
237-
* @throws {AppwriteException}
238-
* @returns {Promise}
239-
*/
240-
async getTemplate(templateId: string): Promise<Models.TemplateFunction> {
241-
if (typeof templateId === 'undefined') {
242-
throw new AppwriteException('Missing required parameter: "templateId"');
243-
}
244-
245-
const apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId);
246-
const payload: Payload = {};
247-
248-
return await this.client.call(
249-
'get',
250-
apiPath,
251-
{
252-
'content-type': 'application/json',
253-
},
254-
payload,
255-
'json'
256-
);
257-
}
258229
/**
259230
* Get function
260231
*

test/services/functions.test.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -97,37 +97,6 @@ describe('Functions service', () => {
9797
});
9898

9999

100-
test('test method getTemplate()', async () => {
101-
const data = {
102-
'icon': 'icon-lightning-bolt',
103-
'id': 'starter',
104-
'name': 'Starter function',
105-
'tagline': 'A simple function to get started.',
106-
'permissions': [],
107-
'events': [],
108-
'cron': '0 0 * * *',
109-
'timeout': 300,
110-
'useCases': [],
111-
'runtimes': [],
112-
'instructions': 'For documentation and instructions check out <link>.',
113-
'vcsProvider': 'github',
114-
'providerRepositoryId': 'templates',
115-
'providerOwner': 'appwrite',
116-
'providerVersion': 'main',
117-
'variables': [],
118-
'scopes': [],};
119-
120-
const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data)));
121-
122-
const response = await functions.getTemplate(
123-
'<TEMPLATE_ID>',
124-
);
125-
126-
assertEquals(response, data);
127-
stubbedFetch.restore();
128-
});
129-
130-
131100
test('test method get()', async () => {
132101
const data = {
133102
'\$id': '5e5ea5c16897e',

0 commit comments

Comments
 (0)