Skip to content

Commit 3dbec65

Browse files
committed
Add new push message parameters
1 parent 7a2418c commit 3dbec65

File tree

17 files changed

+189
-49
lines changed

17 files changed

+189
-49
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite Node.js SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

docs/examples/databases/update-string-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ const result = await databases.updateStringAttribute(
1313
'', // key
1414
false, // required
1515
'<DEFAULT>', // default
16-
null, // size (optional)
16+
1, // size (optional)
1717
'' // newKey (optional)
1818
);

docs/examples/messaging/create-push.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const messaging = new sdk.Messaging(client);
99

1010
const result = await messaging.createPush(
1111
'<MESSAGE_ID>', // messageId
12-
'<TITLE>', // title
13-
'<BODY>', // body
12+
'<TITLE>', // title (optional)
13+
'<BODY>', // body (optional)
1414
[], // topics (optional)
1515
[], // users (optional)
1616
[], // targets (optional)
@@ -21,7 +21,10 @@ const result = await messaging.createPush(
2121
'<SOUND>', // sound (optional)
2222
'<COLOR>', // color (optional)
2323
'<TAG>', // tag (optional)
24-
'<BADGE>', // badge (optional)
24+
null, // badge (optional)
2525
false, // draft (optional)
26-
'' // scheduledAt (optional)
26+
'', // scheduledAt (optional)
27+
false, // contentAvailable (optional)
28+
false, // critical (optional)
29+
sdk.MessagePriority.Normal // priority (optional)
2730
);

docs/examples/messaging/update-push.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ const result = await messaging.updatePush(
2323
'<TAG>', // tag (optional)
2424
null, // badge (optional)
2525
false, // draft (optional)
26-
'' // scheduledAt (optional)
26+
'', // scheduledAt (optional)
27+
false, // contentAvailable (optional)
28+
false, // critical (optional)
29+
sdk.MessagePriority.Normal // priority (optional)
2730
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "node-appwrite",
33
"homepage": "https://appwrite.io/support",
44
"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",
5-
"version": "14.1.0",
5+
"version": "14.2.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/index.js",
88
"type": "commonjs",

src/client.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AppwriteException extends Error {
3333
}
3434

3535
function getUserAgent() {
36-
let ua = 'AppwriteNodeJSSDK/14.1.0';
36+
let ua = 'AppwriteNodeJSSDK/14.2.0';
3737

3838
// `process` is a global in Node.js, but not fully available in all runtimes.
3939
const platform: string[] = [];
@@ -82,7 +82,7 @@ class Client {
8282
'x-sdk-name': 'Node.js',
8383
'x-sdk-platform': 'server',
8484
'x-sdk-language': 'nodejs',
85-
'x-sdk-version': '14.1.0',
85+
'x-sdk-version': '14.2.0',
8686
'user-agent' : getUserAgent(),
8787
'X-Appwrite-Response-Format': '1.6.0',
8888
};
@@ -305,6 +305,10 @@ class Client {
305305
return response;
306306
}
307307

308+
async ping(): Promise<string> {
309+
return this.call('GET', new URL(this.config.endpoint + '/ping'));
310+
}
311+
308312
async redirect(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise<string> {
309313
const { uri, options } = this.prepareRequest(method, url, headers, params);
310314

src/enums/image-format.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export enum ImageFormat {
44
Gif = 'gif',
55
Png = 'png',
66
Webp = 'webp',
7+
Avif = 'avif',
78
}

src/enums/message-priority.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export enum MessagePriority {
2+
Normal = 'normal',
3+
High = 'high',
4+
}

src/enums/runtime.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export enum Runtime {
55
Node190 = 'node-19.0',
66
Node200 = 'node-20.0',
77
Node210 = 'node-21.0',
8+
Node22 = 'node-22',
89
Php80 = 'php-8.0',
910
Php81 = 'php-8.1',
1011
Php82 = 'php-8.2',
@@ -19,30 +20,42 @@ export enum Runtime {
1920
Python311 = 'python-3.11',
2021
Python312 = 'python-3.12',
2122
Pythonml311 = 'python-ml-3.11',
23+
Deno121 = 'deno-1.21',
24+
Deno124 = 'deno-1.24',
25+
Deno135 = 'deno-1.35',
2226
Deno140 = 'deno-1.40',
27+
Deno146 = 'deno-1.46',
28+
Deno20 = 'deno-2.0',
2329
Dart215 = 'dart-2.15',
2430
Dart216 = 'dart-2.16',
2531
Dart217 = 'dart-2.17',
2632
Dart218 = 'dart-2.18',
2733
Dart30 = 'dart-3.0',
2834
Dart31 = 'dart-3.1',
2935
Dart33 = 'dart-3.3',
30-
Dotnet31 = 'dotnet-3.1',
36+
Dart35 = 'dart-3.5',
3137
Dotnet60 = 'dotnet-6.0',
3238
Dotnet70 = 'dotnet-7.0',
39+
Dotnet80 = 'dotnet-8.0',
3340
Java80 = 'java-8.0',
3441
Java110 = 'java-11.0',
3542
Java170 = 'java-17.0',
3643
Java180 = 'java-18.0',
3744
Java210 = 'java-21.0',
45+
Java22 = 'java-22',
3846
Swift55 = 'swift-5.5',
3947
Swift58 = 'swift-5.8',
4048
Swift59 = 'swift-5.9',
49+
Swift510 = 'swift-5.10',
4150
Kotlin16 = 'kotlin-1.6',
4251
Kotlin18 = 'kotlin-1.8',
4352
Kotlin19 = 'kotlin-1.9',
53+
Kotlin20 = 'kotlin-2.0',
4454
Cpp17 = 'cpp-17',
4555
Cpp20 = 'cpp-20',
4656
Bun10 = 'bun-1.0',
57+
Bun11 = 'bun-1.1',
4758
Go123 = 'go-1.23',
59+
Static1 = 'static-1',
60+
Flutter324 = 'flutter-3.24',
4861
}

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export { IndexType } from './enums/index-type';
2727
export { Runtime } from './enums/runtime';
2828
export { ExecutionMethod } from './enums/execution-method';
2929
export { Name } from './enums/name';
30+
export { MessagePriority } from './enums/message-priority';
3031
export { SmtpEncryption } from './enums/smtp-encryption';
3132
export { Compression } from './enums/compression';
3233
export { ImageGravity } from './enums/image-gravity';

0 commit comments

Comments
 (0)