node-appwrite
Advanced tools
Comparing version
@@ -18,3 +18,3 @@ 'use strict'; | ||
function getUserAgent() { | ||
let ua = "AppwriteNodeJSSDK/17.0.0"; | ||
let ua = "AppwriteNodeJSSDK/17.1.0"; | ||
const platform = []; | ||
@@ -55,3 +55,3 @@ if (typeof process !== "undefined") { | ||
"x-sdk-language": "nodejs", | ||
"x-sdk-version": "17.0.0", | ||
"x-sdk-version": "17.1.0", | ||
"user-agent": getUserAgent(), | ||
@@ -223,4 +223,4 @@ "X-Appwrite-Response-Format": "1.7.0" | ||
async chunkedUpload(method, url, headers = {}, originalPayload = {}, onProgress) { | ||
const file = Object.values(originalPayload).find((value) => value instanceof nodeFetchNativeWithAgent.File); | ||
if (!file) { | ||
const [fileParam, file] = Object.entries(originalPayload).find(([_, value]) => value instanceof nodeFetchNativeWithAgent.File) ?? []; | ||
if (!file || !fileParam) { | ||
throw new Error("File not found in payload"); | ||
@@ -240,3 +240,4 @@ } | ||
const chunk = file.slice(start, end); | ||
let payload = { ...originalPayload, file: new nodeFetchNativeWithAgent.File([chunk], file.name) }; | ||
let payload = { ...originalPayload }; | ||
payload[fileParam] = new nodeFetchNativeWithAgent.File([chunk], file.name); | ||
response = await this.call(method, url, headers, payload); | ||
@@ -243,0 +244,0 @@ if (onProgress && typeof onProgress === "function") { |
@@ -39,2 +39,3 @@ declare enum BuildRuntime { | ||
Dart35 = "dart-3.5", | ||
Dart38 = "dart-3.8", | ||
Dotnet60 = "dotnet-6.0", | ||
@@ -65,5 +66,6 @@ Dotnet70 = "dotnet-7.0", | ||
Flutter327 = "flutter-3.27", | ||
Flutter329 = "flutter-3.29" | ||
Flutter329 = "flutter-3.29", | ||
Flutter332 = "flutter-3.32" | ||
} | ||
export { BuildRuntime }; |
@@ -41,2 +41,3 @@ 'use strict'; | ||
BuildRuntime2["Dart35"] = "dart-3.5"; | ||
BuildRuntime2["Dart38"] = "dart-3.8"; | ||
BuildRuntime2["Dotnet60"] = "dotnet-6.0"; | ||
@@ -68,2 +69,3 @@ BuildRuntime2["Dotnet70"] = "dotnet-7.0"; | ||
BuildRuntime2["Flutter329"] = "flutter-3.29"; | ||
BuildRuntime2["Flutter332"] = "flutter-3.32"; | ||
return BuildRuntime2; | ||
@@ -70,0 +72,0 @@ })(BuildRuntime || {}); |
@@ -7,5 +7,6 @@ declare enum ImageFormat { | ||
Heic = "heic", | ||
Avif = "avif" | ||
Avif = "avif", | ||
Gif = "gif" | ||
} | ||
export { ImageFormat }; |
@@ -10,2 +10,3 @@ 'use strict'; | ||
ImageFormat2["Avif"] = "avif"; | ||
ImageFormat2["Gif"] = "gif"; | ||
return ImageFormat2; | ||
@@ -12,0 +13,0 @@ })(ImageFormat || {}); |
@@ -39,2 +39,3 @@ declare enum Runtime { | ||
Dart35 = "dart-3.5", | ||
Dart38 = "dart-3.8", | ||
Dotnet60 = "dotnet-6.0", | ||
@@ -65,5 +66,6 @@ Dotnet70 = "dotnet-7.0", | ||
Flutter327 = "flutter-3.27", | ||
Flutter329 = "flutter-3.29" | ||
Flutter329 = "flutter-3.29", | ||
Flutter332 = "flutter-3.32" | ||
} | ||
export { Runtime }; |
@@ -41,2 +41,3 @@ 'use strict'; | ||
Runtime2["Dart35"] = "dart-3.5"; | ||
Runtime2["Dart38"] = "dart-3.8"; | ||
Runtime2["Dotnet60"] = "dotnet-6.0"; | ||
@@ -68,2 +69,3 @@ Runtime2["Dotnet70"] = "dotnet-7.0"; | ||
Runtime2["Flutter329"] = "flutter-3.29"; | ||
Runtime2["Flutter332"] = "flutter-3.32"; | ||
return Runtime2; | ||
@@ -70,0 +72,0 @@ })(Runtime || {}); |
@@ -455,3 +455,5 @@ import { Client } from '../client.js'; | ||
/** | ||
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. | ||
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. | ||
Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. | ||
* | ||
@@ -466,4 +468,5 @@ * @param {string} databaseId | ||
/** | ||
* Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. | ||
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. | ||
Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. | ||
* | ||
@@ -476,5 +479,7 @@ * @param {string} databaseId | ||
*/ | ||
upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents?: object[]): Promise<Models.DocumentList<Document>>; | ||
upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>; | ||
/** | ||
* Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. | ||
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. | ||
Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. | ||
* | ||
@@ -490,3 +495,5 @@ * @param {string} databaseId | ||
/** | ||
* Bulk delete documents using queries, if no queries are passed then all documents are deleted. | ||
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. | ||
Bulk delete documents using queries, if no queries are passed then all documents are deleted. | ||
* | ||
@@ -512,2 +519,16 @@ * @param {string} databaseId | ||
/** | ||
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. | ||
Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. | ||
* | ||
* @param {string} databaseId | ||
* @param {string} collectionId | ||
* @param {string} documentId | ||
* @param {object} data | ||
* @param {string[]} permissions | ||
* @throws {AppwriteException} | ||
* @returns {Promise<Document>} | ||
*/ | ||
upsertDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document>; | ||
/** | ||
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. | ||
@@ -514,0 +535,0 @@ * |
@@ -19,3 +19,3 @@ import { Client } from '../client.js'; | ||
/** | ||
* Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter. | ||
* Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. | ||
* | ||
@@ -22,0 +22,0 @@ * @param {string} bucketId |
@@ -40,3 +40,3 @@ 'use strict'; | ||
/** | ||
* Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter. | ||
* Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter. | ||
* | ||
@@ -43,0 +43,0 @@ * @param {string} bucketId |
@@ -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": "17.0.0", | ||
"version": "17.1.0", | ||
"license": "BSD-3-Clause", | ||
@@ -8,0 +8,0 @@ "main": "dist/index.js", |
# Appwrite Node.js SDK | ||
 | ||
 | ||
 | ||
[](https://travis-ci.com/appwrite/sdk-generator) | ||
@@ -6,0 +6,0 @@ [](https://twitter.com/appwrite) |
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
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
Sorry, the diff of this file is too big to display
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
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2620095
0.7%31321
0.44%1
Infinity%2
100%