node-appwrite
Advanced tools
Comparing version
@@ -18,3 +18,3 @@ 'use strict'; | ||
function getUserAgent() { | ||
let ua = "AppwriteNodeJSSDK/14.0.0-rc.2"; | ||
let ua = "AppwriteNodeJSSDK/14.0.0-rc.3"; | ||
const platform = []; | ||
@@ -55,3 +55,3 @@ if (typeof process !== "undefined") { | ||
"x-sdk-language": "nodejs", | ||
"x-sdk-version": "14.0.0-rc.2", | ||
"x-sdk-version": "14.0.0-rc.3", | ||
"user-agent": getUserAgent(), | ||
@@ -58,0 +58,0 @@ "X-Appwrite-Response-Format": "1.6.0" |
@@ -383,2 +383,15 @@ /** | ||
/** | ||
* Specifications List | ||
*/ | ||
type SpecificationList = { | ||
/** | ||
* Total number of specifications documents that matched your query. | ||
*/ | ||
total: number; | ||
/** | ||
* List of specifications. | ||
*/ | ||
specifications: Specification[]; | ||
}; | ||
/** | ||
* Database | ||
@@ -1732,2 +1745,6 @@ */ | ||
providerSilentMode: boolean; | ||
/** | ||
* Machine specification for builds and executions. | ||
*/ | ||
specification: string; | ||
}; | ||
@@ -2330,2 +2347,23 @@ /** | ||
/** | ||
* Specification | ||
*/ | ||
type Specification = { | ||
/** | ||
* Memory size in MB. | ||
*/ | ||
memory: number; | ||
/** | ||
* Number of CPUs. | ||
*/ | ||
cpus: number; | ||
/** | ||
* Is size enabled. | ||
*/ | ||
enabled: boolean; | ||
/** | ||
* Size slug. | ||
*/ | ||
slug: string; | ||
}; | ||
/** | ||
* MFA Challenge | ||
@@ -2332,0 +2370,0 @@ */ |
@@ -47,6 +47,7 @@ import { Client, UploadProgress } from '../client.js'; | ||
* @param {string} templateVersion | ||
* @param {string} specification | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.Function>} | ||
*/ | ||
create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string): Promise<Models.Function>; | ||
create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string, specification?: string): Promise<Models.Function>; | ||
/** | ||
@@ -62,2 +63,12 @@ * List runtimes | ||
/** | ||
* List available function runtime specifications | ||
* | ||
* List allowed function specifications for this instance. | ||
* | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.SpecificationList>} | ||
*/ | ||
listSpecifications(): Promise<Models.SpecificationList>; | ||
/** | ||
* List function templates | ||
@@ -117,6 +128,7 @@ * | ||
* @param {string} providerRootDirectory | ||
* @param {string} specification | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.Function>} | ||
*/ | ||
update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise<Models.Function>; | ||
update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>; | ||
/** | ||
@@ -254,3 +266,3 @@ * Delete function | ||
*/ | ||
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Execution>; | ||
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>; | ||
/** | ||
@@ -257,0 +269,0 @@ * Get execution |
@@ -65,6 +65,7 @@ 'use strict'; | ||
* @param {string} templateVersion | ||
* @param {string} specification | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.Function>} | ||
*/ | ||
async create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateVersion) { | ||
async create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateVersion, specification) { | ||
if (typeof functionId === "undefined") { | ||
@@ -144,2 +145,5 @@ throw new client.AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
if (typeof specification !== "undefined") { | ||
payload["specification"] = specification; | ||
} | ||
const uri = new URL(this.client.config.endpoint + apiPath); | ||
@@ -179,2 +183,25 @@ const apiHeaders = { | ||
/** | ||
* List available function runtime specifications | ||
* | ||
* List allowed function specifications for this instance. | ||
* | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.SpecificationList>} | ||
*/ | ||
async listSpecifications() { | ||
const apiPath = "/functions/specifications"; | ||
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 | ||
); | ||
} | ||
/** | ||
* List function templates | ||
@@ -291,6 +318,7 @@ * | ||
* @param {string} providerRootDirectory | ||
* @param {string} specification | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Models.Function>} | ||
*/ | ||
async update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory) { | ||
async update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, scopes, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification) { | ||
if (typeof functionId === "undefined") { | ||
@@ -352,2 +380,5 @@ throw new client.AppwriteException('Missing required parameter: "functionId"'); | ||
} | ||
if (typeof specification !== "undefined") { | ||
payload["specification"] = specification; | ||
} | ||
const uri = new URL(this.client.config.endpoint + apiPath); | ||
@@ -710,4 +741,3 @@ const apiHeaders = { | ||
*/ | ||
async createExecution(functionId, body, async, xpath, method, headers, scheduledAt, onProgress = (progress) => { | ||
}) { | ||
async createExecution(functionId, body, async, xpath, method, headers, scheduledAt) { | ||
if (typeof functionId === "undefined") { | ||
@@ -738,10 +768,9 @@ throw new client.AppwriteException('Missing required parameter: "functionId"'); | ||
const apiHeaders = { | ||
"content-type": "multipart/form-data" | ||
"content-type": "application/json" | ||
}; | ||
return await this.client.chunkedUpload( | ||
return await this.client.call( | ||
"post", | ||
uri, | ||
apiHeaders, | ||
payload, | ||
onProgress | ||
payload | ||
); | ||
@@ -748,0 +777,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.2", | ||
"version": "14.0.0-rc.3", | ||
"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
2376372
0.29%29502
0.36%