Skip to content

Commit ee5b08b

Browse files
Merge pull request #99 from appwrite/feat-push-params
Add new push message parameters
2 parents 7a2418c + 3dbec65 commit ee5b08b

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';

src/models.ts

Lines changed: 96 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,14 @@ export namespace Models {
490490
* Is attribute an array?
491491
*/
492492
array?: boolean;
493+
/**
494+
* Attribute creation date in ISO 8601 format.
495+
*/
496+
$createdAt: string;
497+
/**
498+
* Attribute update date in ISO 8601 format.
499+
*/
500+
$updatedAt: string;
493501
/**
494502
* Attribute size.
495503
*/
@@ -527,6 +535,14 @@ export namespace Models {
527535
* Is attribute an array?
528536
*/
529537
array?: boolean;
538+
/**
539+
* Attribute creation date in ISO 8601 format.
540+
*/
541+
$createdAt: string;
542+
/**
543+
* Attribute update date in ISO 8601 format.
544+
*/
545+
$updatedAt: string;
530546
/**
531547
* Minimum value to enforce for new documents.
532548
*/
@@ -568,6 +584,14 @@ export namespace Models {
568584
* Is attribute an array?
569585
*/
570586
array?: boolean;
587+
/**
588+
* Attribute creation date in ISO 8601 format.
589+
*/
590+
$createdAt: string;
591+
/**
592+
* Attribute update date in ISO 8601 format.
593+
*/
594+
$updatedAt: string;
571595
/**
572596
* Minimum value to enforce for new documents.
573597
*/
@@ -609,6 +633,14 @@ export namespace Models {
609633
* Is attribute an array?
610634
*/
611635
array?: boolean;
636+
/**
637+
* Attribute creation date in ISO 8601 format.
638+
*/
639+
$createdAt: string;
640+
/**
641+
* Attribute update date in ISO 8601 format.
642+
*/
643+
$updatedAt: string;
612644
/**
613645
* Default value for attribute when not provided. Cannot be set when attribute is required.
614646
*/
@@ -642,6 +674,14 @@ export namespace Models {
642674
* Is attribute an array?
643675
*/
644676
array?: boolean;
677+
/**
678+
* Attribute creation date in ISO 8601 format.
679+
*/
680+
$createdAt: string;
681+
/**
682+
* Attribute update date in ISO 8601 format.
683+
*/
684+
$updatedAt: string;
645685
/**
646686
* String format.
647687
*/
@@ -679,6 +719,14 @@ export namespace Models {
679719
* Is attribute an array?
680720
*/
681721
array?: boolean;
722+
/**
723+
* Attribute creation date in ISO 8601 format.
724+
*/
725+
$createdAt: string;
726+
/**
727+
* Attribute update date in ISO 8601 format.
728+
*/
729+
$updatedAt: string;
682730
/**
683731
* Array of elements in enumerated type.
684732
*/
@@ -720,6 +768,14 @@ export namespace Models {
720768
* Is attribute an array?
721769
*/
722770
array?: boolean;
771+
/**
772+
* Attribute creation date in ISO 8601 format.
773+
*/
774+
$createdAt: string;
775+
/**
776+
* Attribute update date in ISO 8601 format.
777+
*/
778+
$updatedAt: string;
723779
/**
724780
* String format.
725781
*/
@@ -757,6 +813,14 @@ export namespace Models {
757813
* Is attribute an array?
758814
*/
759815
array?: boolean;
816+
/**
817+
* Attribute creation date in ISO 8601 format.
818+
*/
819+
$createdAt: string;
820+
/**
821+
* Attribute update date in ISO 8601 format.
822+
*/
823+
$updatedAt: string;
760824
/**
761825
* String format.
762826
*/
@@ -794,6 +858,14 @@ export namespace Models {
794858
* Is attribute an array?
795859
*/
796860
array?: boolean;
861+
/**
862+
* Attribute creation date in ISO 8601 format.
863+
*/
864+
$createdAt: string;
865+
/**
866+
* Attribute update date in ISO 8601 format.
867+
*/
868+
$updatedAt: string;
797869
/**
798870
* ISO 8601 format.
799871
*/
@@ -831,6 +903,14 @@ export namespace Models {
831903
* Is attribute an array?
832904
*/
833905
array?: boolean;
906+
/**
907+
* Attribute creation date in ISO 8601 format.
908+
*/
909+
$createdAt: string;
910+
/**
911+
* Attribute update date in ISO 8601 format.
912+
*/
913+
$updatedAt: string;
834914
/**
835915
* The ID of the related collection.
836916
*/
@@ -884,6 +964,14 @@ export namespace Models {
884964
* Index orders.
885965
*/
886966
orders?: string[];
967+
/**
968+
* Index creation date in ISO 8601 format.
969+
*/
970+
$createdAt: string;
971+
/**
972+
* Index update date in ISO 8601 format.
973+
*/
974+
$updatedAt: string;
887975
}
888976
/**
889977
* Document
@@ -1596,11 +1684,11 @@ export namespace Models {
15961684
*/
15971685
userId: string;
15981686
/**
1599-
* User name.
1687+
* User name. Hide this attribute by toggling membership privacy in the Console.
16001688
*/
16011689
userName: string;
16021690
/**
1603-
* User email address.
1691+
* User email address. Hide this attribute by toggling membership privacy in the Console.
16041692
*/
16051693
userEmail: string;
16061694
/**
@@ -1624,7 +1712,7 @@ export namespace Models {
16241712
*/
16251713
confirm: boolean;
16261714
/**
1627-
* Multi factor authentication status, true if the user has MFA enabled or false otherwise.
1715+
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
16281716
*/
16291717
mfa: boolean;
16301718
/**
@@ -1689,7 +1777,7 @@ export namespace Models {
16891777
*/
16901778
events: string[];
16911779
/**
1692-
* Function execution schedult in CRON format.
1780+
* Function execution schedule in CRON format.
16931781
*/
16941782
schedule: string;
16951783
/**
@@ -2506,5 +2594,9 @@ export namespace Models {
25062594
* The target identifier.
25072595
*/
25082596
identifier: string;
2597+
/**
2598+
* Is the target expired.
2599+
*/
2600+
expired: boolean;
25092601
}
25102602
}

0 commit comments

Comments
 (0)