Skip to content

Commit 083c7f5

Browse files
Merge pull request #25 from appwrite/feat-push-params
Add new push message parameters
2 parents 4b346af + 2551a1c commit 083c7f5

20 files changed

+256
-76
lines changed

README.md

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

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.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 response = 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: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts";
1+
import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts";
22

33
const client = new Client()
44
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,8 +9,8 @@ const messaging = new Messaging(client);
99

1010
const response = 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 response = 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+
MessagePriority.Normal // priority (optional)
2730
);

docs/examples/messaging/update-push.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts";
1+
import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts";
22

33
const client = new Client()
44
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
@@ -23,5 +23,8 @@ const response = 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+
MessagePriority.Normal // priority (optional)
2730
);

mod.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { IndexType } from "./src/enums/index-type.ts";
2828
import { Runtime } from "./src/enums/runtime.ts";
2929
import { ExecutionMethod } from "./src/enums/execution-method.ts";
3030
import { Name } from "./src/enums/name.ts";
31+
import { MessagePriority } from "./src/enums/message-priority.ts";
3132
import { SmtpEncryption } from "./src/enums/smtp-encryption.ts";
3233
import { Compression } from "./src/enums/compression.ts";
3334
import { ImageGravity } from "./src/enums/image-gravity.ts";
@@ -66,6 +67,7 @@ export {
6667
Runtime,
6768
ExecutionMethod,
6869
Name,
70+
MessagePriority,
6971
SmtpEncryption,
7072
Compression,
7173
ImageGravity,

src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export class Client {
1111
endpoint: string = 'https://cloud.appwrite.io/v1';
1212
headers: Payload = {
1313
'content-type': '',
14-
'user-agent' : `AppwriteDenoSDK/12.1.0 (${Deno.build.os}; ${Deno.build.arch})`,
14+
'user-agent' : `AppwriteDenoSDK/12.2.0 (${Deno.build.os}; ${Deno.build.arch})`,
1515
'x-sdk-name': 'Deno',
1616
'x-sdk-platform': 'server',
1717
'x-sdk-language': 'deno',
18-
'x-sdk-version': '12.1.0',
18+
'x-sdk-version': '12.2.0',
1919
'X-Appwrite-Response-Format':'1.6.0',
2020
};
2121

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/models.d.ts

Lines changed: 96 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,14 @@ export namespace Models {
487487
* Is attribute an array?
488488
*/
489489
array?: boolean;
490+
/**
491+
* Attribute creation date in ISO 8601 format.
492+
*/
493+
$createdAt: string;
494+
/**
495+
* Attribute update date in ISO 8601 format.
496+
*/
497+
$updatedAt: string;
490498
/**
491499
* Attribute size.
492500
*/
@@ -524,6 +532,14 @@ export namespace Models {
524532
* Is attribute an array?
525533
*/
526534
array?: boolean;
535+
/**
536+
* Attribute creation date in ISO 8601 format.
537+
*/
538+
$createdAt: string;
539+
/**
540+
* Attribute update date in ISO 8601 format.
541+
*/
542+
$updatedAt: string;
527543
/**
528544
* Minimum value to enforce for new documents.
529545
*/
@@ -565,6 +581,14 @@ export namespace Models {
565581
* Is attribute an array?
566582
*/
567583
array?: boolean;
584+
/**
585+
* Attribute creation date in ISO 8601 format.
586+
*/
587+
$createdAt: string;
588+
/**
589+
* Attribute update date in ISO 8601 format.
590+
*/
591+
$updatedAt: string;
568592
/**
569593
* Minimum value to enforce for new documents.
570594
*/
@@ -606,6 +630,14 @@ export namespace Models {
606630
* Is attribute an array?
607631
*/
608632
array?: boolean;
633+
/**
634+
* Attribute creation date in ISO 8601 format.
635+
*/
636+
$createdAt: string;
637+
/**
638+
* Attribute update date in ISO 8601 format.
639+
*/
640+
$updatedAt: string;
609641
/**
610642
* Default value for attribute when not provided. Cannot be set when attribute is required.
611643
*/
@@ -639,6 +671,14 @@ export namespace Models {
639671
* Is attribute an array?
640672
*/
641673
array?: boolean;
674+
/**
675+
* Attribute creation date in ISO 8601 format.
676+
*/
677+
$createdAt: string;
678+
/**
679+
* Attribute update date in ISO 8601 format.
680+
*/
681+
$updatedAt: string;
642682
/**
643683
* String format.
644684
*/
@@ -676,6 +716,14 @@ export namespace Models {
676716
* Is attribute an array?
677717
*/
678718
array?: boolean;
719+
/**
720+
* Attribute creation date in ISO 8601 format.
721+
*/
722+
$createdAt: string;
723+
/**
724+
* Attribute update date in ISO 8601 format.
725+
*/
726+
$updatedAt: string;
679727
/**
680728
* Array of elements in enumerated type.
681729
*/
@@ -717,6 +765,14 @@ export namespace Models {
717765
* Is attribute an array?
718766
*/
719767
array?: boolean;
768+
/**
769+
* Attribute creation date in ISO 8601 format.
770+
*/
771+
$createdAt: string;
772+
/**
773+
* Attribute update date in ISO 8601 format.
774+
*/
775+
$updatedAt: string;
720776
/**
721777
* String format.
722778
*/
@@ -754,6 +810,14 @@ export namespace Models {
754810
* Is attribute an array?
755811
*/
756812
array?: boolean;
813+
/**
814+
* Attribute creation date in ISO 8601 format.
815+
*/
816+
$createdAt: string;
817+
/**
818+
* Attribute update date in ISO 8601 format.
819+
*/
820+
$updatedAt: string;
757821
/**
758822
* String format.
759823
*/
@@ -791,6 +855,14 @@ export namespace Models {
791855
* Is attribute an array?
792856
*/
793857
array?: boolean;
858+
/**
859+
* Attribute creation date in ISO 8601 format.
860+
*/
861+
$createdAt: string;
862+
/**
863+
* Attribute update date in ISO 8601 format.
864+
*/
865+
$updatedAt: string;
794866
/**
795867
* ISO 8601 format.
796868
*/
@@ -828,6 +900,14 @@ export namespace Models {
828900
* Is attribute an array?
829901
*/
830902
array?: boolean;
903+
/**
904+
* Attribute creation date in ISO 8601 format.
905+
*/
906+
$createdAt: string;
907+
/**
908+
* Attribute update date in ISO 8601 format.
909+
*/
910+
$updatedAt: string;
831911
/**
832912
* The ID of the related collection.
833913
*/
@@ -881,6 +961,14 @@ export namespace Models {
881961
* Index orders.
882962
*/
883963
orders?: string[];
964+
/**
965+
* Index creation date in ISO 8601 format.
966+
*/
967+
$createdAt: string;
968+
/**
969+
* Index update date in ISO 8601 format.
970+
*/
971+
$updatedAt: string;
884972
}
885973
/**
886974
* Document
@@ -1591,11 +1679,11 @@ export namespace Models {
15911679
*/
15921680
userId: string;
15931681
/**
1594-
* User name.
1682+
* User name. Hide this attribute by toggling membership privacy in the Console.
15951683
*/
15961684
userName: string;
15971685
/**
1598-
* User email address.
1686+
* User email address. Hide this attribute by toggling membership privacy in the Console.
15991687
*/
16001688
userEmail: string;
16011689
/**
@@ -1619,7 +1707,7 @@ export namespace Models {
16191707
*/
16201708
confirm: boolean;
16211709
/**
1622-
* Multi factor authentication status, true if the user has MFA enabled or false otherwise.
1710+
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
16231711
*/
16241712
mfa: boolean;
16251713
/**
@@ -1684,7 +1772,7 @@ export namespace Models {
16841772
*/
16851773
events: string[];
16861774
/**
1687-
* Function execution schedult in CRON format.
1775+
* Function execution schedule in CRON format.
16881776
*/
16891777
schedule: string;
16901778
/**
@@ -2501,5 +2589,9 @@ export namespace Models {
25012589
* The target identifier.
25022590
*/
25032591
identifier: string;
2592+
/**
2593+
* Is the target expired.
2594+
*/
2595+
expired: boolean;
25042596
}
25052597
}

0 commit comments

Comments
 (0)