node-appwrite
Advanced tools
Comparing version
@@ -18,3 +18,3 @@ 'use strict'; | ||
function getUserAgent() { | ||
let ua = "AppwriteNodeJSSDK/14.0.0-rc.4"; | ||
let ua = "AppwriteNodeJSSDK/14.0.0"; | ||
const platform = []; | ||
@@ -55,3 +55,3 @@ if (typeof process !== "undefined") { | ||
"x-sdk-language": "nodejs", | ||
"x-sdk-version": "14.0.0-rc.4", | ||
"x-sdk-version": "14.0.0", | ||
"user-agent": getUserAgent(), | ||
@@ -58,0 +58,0 @@ "X-Appwrite-Response-Format": "1.6.0" |
@@ -175,15 +175,2 @@ /** | ||
/** | ||
* Function Templates List | ||
*/ | ||
type TemplateFunctionList = { | ||
/** | ||
* Total number of templates documents that matched your query. | ||
*/ | ||
total: number; | ||
/** | ||
* List of templates. | ||
*/ | ||
templates: TemplateFunction[]; | ||
}; | ||
/** | ||
* Runtimes List | ||
@@ -1751,125 +1738,2 @@ */ | ||
/** | ||
* Template Function | ||
*/ | ||
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 | ||
*/ | ||
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 | ||
*/ | ||
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 | ||
@@ -1876,0 +1740,0 @@ */ |
@@ -72,25 +72,2 @@ import { Client, UploadProgress } from '../client.js'; | ||
/** | ||
* List function templates | ||
* | ||
* List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method. | ||
* | ||
* @param {string[]} runtimes | ||
* @param {string[]} useCases | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.TemplateFunctionList>} | ||
*/ | ||
listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number): Promise<Models.TemplateFunctionList>; | ||
/** | ||
* 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<Models.TemplateFunction>} | ||
*/ | ||
getTemplate(templateId: string): Promise<Models.TemplateFunction>; | ||
/** | ||
* Get function | ||
@@ -97,0 +74,0 @@ * |
@@ -204,66 +204,2 @@ 'use strict'; | ||
/** | ||
* List function templates | ||
* | ||
* List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method. | ||
* | ||
* @param {string[]} runtimes | ||
* @param {string[]} useCases | ||
* @param {number} limit | ||
* @param {number} offset | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.TemplateFunctionList>} | ||
*/ | ||
async listTemplates(runtimes, useCases, limit, offset) { | ||
const apiPath = "/functions/templates"; | ||
const payload = {}; | ||
if (typeof runtimes !== "undefined") { | ||
payload["runtimes"] = runtimes; | ||
} | ||
if (typeof useCases !== "undefined") { | ||
payload["useCases"] = useCases; | ||
} | ||
if (typeof limit !== "undefined") { | ||
payload["limit"] = limit; | ||
} | ||
if (typeof offset !== "undefined") { | ||
payload["offset"] = offset; | ||
} | ||
const uri = new URL(this.client.config.endpoint + apiPath); | ||
const apiHeaders = { | ||
"content-type": "application/json" | ||
}; | ||
return await this.client.call( | ||
"get", | ||
uri, | ||
apiHeaders, | ||
payload | ||
); | ||
} | ||
/** | ||
* 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<Models.TemplateFunction>} | ||
*/ | ||
async getTemplate(templateId) { | ||
if (typeof templateId === "undefined") { | ||
throw new client.AppwriteException('Missing required parameter: "templateId"'); | ||
} | ||
const apiPath = "/functions/templates/{templateId}".replace("{templateId}", templateId); | ||
const payload = {}; | ||
const uri = new URL(this.client.config.endpoint + apiPath); | ||
const apiHeaders = { | ||
"content-type": "application/json" | ||
}; | ||
return await this.client.call( | ||
"get", | ||
uri, | ||
apiHeaders, | ||
payload | ||
); | ||
} | ||
/** | ||
* Get function | ||
@@ -270,0 +206,0 @@ * |
@@ -5,3 +5,3 @@ { | ||
"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", | ||
"version": "14.0.0-rc.4", | ||
"version": "14.0.0", | ||
"license": "BSD-3-Clause", | ||
@@ -8,0 +8,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
-100%2357804
-0.79%29219
-0.97%