Skip to content

Commit 2bc43dc

Browse files
authored
Merge pull request #33 from appwrite/chore-update-version
Update console SDK with new descriptions
2 parents 9876f42 + f55c80f commit 2bc43dc

24 files changed

+256
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
3333
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
3434

3535
```html
36-
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/[email protected].6"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/[email protected].7"></script>
3737
```
3838

3939

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Client, Health } from "@appwrite.io/console";
2+
3+
const client = new Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
6+
7+
const health = new Health(client);
8+
9+
const result = await health.getQueueUsageCount(
10+
null // threshold (optional)
11+
);
12+
13+
console.log(result);
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Client, Messaging } from "@appwrite.io/console";
1+
import { Client, Messaging, MessagePriority } from "@appwrite.io/console";
22

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

99
const result = await messaging.createPush(
1010
'<MESSAGE_ID>', // messageId
11-
'<TITLE>', // title
12-
'<BODY>', // body
11+
'<TITLE>', // title (optional)
12+
'<BODY>', // body (optional)
1313
[], // topics (optional)
1414
[], // users (optional)
1515
[], // targets (optional)
@@ -20,9 +20,12 @@ const result = await messaging.createPush(
2020
'<SOUND>', // sound (optional)
2121
'<COLOR>', // color (optional)
2222
'<TAG>', // tag (optional)
23-
'<BADGE>', // badge (optional)
23+
null, // badge (optional)
2424
false, // draft (optional)
25-
'' // scheduledAt (optional)
25+
'', // scheduledAt (optional)
26+
false, // contentAvailable (optional)
27+
false, // critical (optional)
28+
MessagePriority.Normal // priority (optional)
2629
);
2730

2831
console.log(result);

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 "@appwrite.io/console";
1+
import { Client, Messaging, MessagePriority } from "@appwrite.io/console";
22

33
const client = new Client()
44
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
@@ -22,7 +22,10 @@ const result = await messaging.updatePush(
2222
'<TAG>', // tag (optional)
2323
null, // badge (optional)
2424
false, // draft (optional)
25-
'' // scheduledAt (optional)
25+
'', // scheduledAt (optional)
26+
false, // contentAvailable (optional)
27+
false, // critical (optional)
28+
MessagePriority.Normal // priority (optional)
2629
);
2730

2831
console.log(result);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@appwrite.io/console",
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": "1.4.6",
5+
"version": "1.4.7",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class Client {
316316
'x-sdk-name': 'Console',
317317
'x-sdk-platform': 'console',
318318
'x-sdk-language': 'web',
319-
'x-sdk-version': '1.4.6',
319+
'x-sdk-version': '1.4.7',
320320
'X-Appwrite-Response-Format': '1.6.0',
321321
};
322322

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/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export { Runtime } from './enums/runtime';
4545
export { FunctionUsageRange } from './enums/function-usage-range';
4646
export { ExecutionMethod } from './enums/execution-method';
4747
export { Name } from './enums/name';
48+
export { MessagePriority } from './enums/message-priority';
4849
export { SmtpEncryption } from './enums/smtp-encryption';
4950
export { BillingPlan } from './enums/billing-plan';
5051
export { ProjectUsageRange } from './enums/project-usage-range';

src/services/account.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export class Account {
115115
/**
116116
* List billing addresses
117117
*
118+
* List all billing addresses for a user.
118119
*
119120
* @param {string[]} queries
120121
* @throws {AppwriteException}
@@ -143,6 +144,7 @@ export class Account {
143144
/**
144145
* Create new billing address
145146
*
147+
* Add a new billing address to a user&#039;s account.
146148
*
147149
* @param {string} country
148150
* @param {string} streetAddress
@@ -203,6 +205,7 @@ export class Account {
203205
/**
204206
* Get billing address
205207
*
208+
* Get a specific billing address for a user using it&#039;s ID.
206209
*
207210
* @param {string} billingAddressId
208211
* @throws {AppwriteException}
@@ -231,6 +234,7 @@ export class Account {
231234
/**
232235
* Update billing address
233236
*
237+
* Update a specific billing address using it&#039;s ID.
234238
*
235239
* @param {string} billingAddressId
236240
* @param {string} country
@@ -295,6 +299,7 @@ export class Account {
295299
/**
296300
* Delete billing address
297301
*
302+
* Delete a specific billing address using it&#039;s ID.
298303
*
299304
* @param {string} billingAddressId
300305
* @throws {AppwriteException}
@@ -323,6 +328,7 @@ export class Account {
323328
/**
324329
* Get coupon details
325330
*
331+
* Get coupon details for an account.
326332
*
327333
* @param {string} couponId
328334
* @throws {AppwriteException}
@@ -450,6 +456,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
450456
/**
451457
* List invoices
452458
*
459+
* List all invoices tied to an account.
453460
*
454461
* @param {string[]} queries
455462
* @throws {AppwriteException}
@@ -695,9 +702,9 @@ This endpoint can also be used to convert an anonymous account to a normal one,
695702
* @param {string} challengeId
696703
* @param {string} otp
697704
* @throws {AppwriteException}
698-
* @returns {Promise<{}>}
705+
* @returns {Promise<Models.Session>}
699706
*/
700-
async updateMfaChallenge(challengeId: string, otp: string): Promise<{}> {
707+
async updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session> {
701708
if (typeof challengeId === 'undefined') {
702709
throw new AppwriteException('Missing required parameter: "challengeId"');
703710
}
@@ -897,6 +904,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
897904
/**
898905
* List payment methods
899906
*
907+
* List payment methods for this account.
900908
*
901909
* @param {string[]} queries
902910
* @throws {AppwriteException}
@@ -925,6 +933,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
925933
/**
926934
* Create new payment method
927935
*
936+
* Create a new payment method for the current user account.
928937
*
929938
* @throws {AppwriteException}
930939
* @returns {Promise<Models.PaymentMethod>}
@@ -949,6 +958,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
949958
/**
950959
* Get payment method
951960
*
961+
* Get a specific payment method for the user.
952962
*
953963
* @param {string} paymentMethodId
954964
* @throws {AppwriteException}
@@ -977,6 +987,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
977987
/**
978988
* Update payment method
979989
*
990+
* Update a new payment method for the current user account.
980991
*
981992
* @param {string} paymentMethodId
982993
* @param {number} expiryMonth
@@ -1019,6 +1030,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
10191030
/**
10201031
* Delete payment method
10211032
*
1033+
* Delete a specific payment method from a user&#039;s account.
10221034
*
10231035
* @param {string} paymentMethodId
10241036
* @throws {AppwriteException}
@@ -1047,6 +1059,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
10471059
/**
10481060
* Update payment method provider id
10491061
*
1062+
* Update payment method provider.
10501063
*
10511064
* @param {string} paymentMethodId
10521065
* @param {string} providerMethodId
@@ -1089,6 +1102,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
10891102
/**
10901103
* Update payment method with new setup with mandates for indian cards
10911104
*
1105+
* Update payment method mandate options.
10921106
*
10931107
* @param {string} paymentMethodId
10941108
* @throws {AppwriteException}
@@ -1695,6 +1709,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
16951709
/**
16961710
* Create push target
16971711
*
1712+
* Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.
16981713
*
16991714
* @param {string} targetId
17001715
* @param {string} identifier
@@ -1737,6 +1752,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
17371752
/**
17381753
* Update push target
17391754
*
1755+
* Update the currently logged in user&#039;s push notification target. You can modify the target&#039;s identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.
17401756
*
17411757
* @param {string} targetId
17421758
* @param {string} identifier
@@ -1772,6 +1788,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
17721788
/**
17731789
* Delete push target
17741790
*
1791+
* Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.
17751792
*
17761793
* @param {string} targetId
17771794
* @throws {AppwriteException}

src/services/assistant.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class Assistant {
1212
/**
1313
* Ask query
1414
*
15+
* Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite&#039;s AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream.
1516
*
1617
* @param {string} prompt
1718
* @throws {AppwriteException}

0 commit comments

Comments
 (0)