Skip to content

Commit

Permalink
chore: updates for appwrite 1.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Aug 27, 2024
1 parent 57c82e7 commit 18bd0ca
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 208 deletions.
14 changes: 0 additions & 14 deletions docs/examples/functions/get-deployment-download.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/examples/functions/get-template.md

This file was deleted.

123 changes: 0 additions & 123 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,129 +875,6 @@ export namespace Models {
*/
roles: string[];
}
/**
* 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;
}
/**
* Execution
*/
Expand Down
58 changes: 0 additions & 58 deletions src/services/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,6 @@ export class Functions extends Service {
super(client);
}

/**
* Get function template
*
* Get a function template using ID. You can use template details in
* [createFunction](/docs/references/cloud/server-nodejs/functions#create)
* method.
*
* @param {string} templateId
* @throws {AppwriteException}
* @returns {Promise}
*/
async getTemplate(templateId: string): Promise<Models.TemplateFunction> {
if (typeof templateId === 'undefined') {
throw new AppwriteException('Missing required parameter: "templateId"');
}

const apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId);
const payload: Payload = {};

const uri = new URL(this.client.config.endpoint + apiPath);
return await this.client.call('get', uri, {
'content-type': 'application/json',
}, payload);
}

/**
* Download deployment
*
* Get a Deployment's contents by its unique ID. This endpoint supports range
* requests for partial or streaming file download.
*
* @param {string} functionId
* @param {string} deploymentId
* @throws {AppwriteException}
* @returns {URL}
*/
getDeploymentDownload(functionId: string, deploymentId: string): URL {
if (typeof functionId === 'undefined') {
throw new AppwriteException('Missing required parameter: "functionId"');
}

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

const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
const payload: Payload = {};

const uri = new URL(this.client.config.endpoint + apiPath);
payload['project'] = this.client.config.project;


for (const [key, value] of Object.entries(Service.flatten(payload))) {
uri.searchParams.append(key, value);
}
return uri;
}

/**
* List executions
*
Expand Down

0 comments on commit 18bd0ca

Please sign in to comment.