Skip to content

Commit 93e1ded

Browse files
Merge pull request #103 from appwrite/dev
feat: SDK update for version 15.2.0
2 parents d3fb1b7 + a5be412 commit 93e1ded

7 files changed

Lines changed: 22 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 15.2.0
4+
5+
* Added: Realtime connections now send the configured JWT for authentication.
6+
37
## 15.1.1
48

59
* Breaking: Removed `getQueuePriorityBuilds` from `Health` along with the `/health/queue/builds-priority` endpoint

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/console@15.1.1"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@15.2.0"></script>
3737
```
3838

3939

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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 abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
5-
"version": "15.1.1",
5+
"version": "15.2.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {

src/client.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class Client {
392392
'x-sdk-name': 'Console',
393393
'x-sdk-platform': 'console',
394394
'x-sdk-language': 'web',
395-
'x-sdk-version': '15.1.1',
395+
'x-sdk-version': '15.2.0',
396396
'X-Appwrite-Response-Format': '1.9.5',
397397
};
398398

@@ -717,7 +717,11 @@ class Client {
717717

718718
const encodedProject = encodeURIComponent((this.config.project as string) ?? '');
719719
// URL carries only the project; channels/queries are sent via subscribe message.
720-
const queryParams = 'project=' + encodedProject;
720+
let queryParams = 'project=' + encodedProject;
721+
722+
if (this.config.jwt) {
723+
queryParams += '&jwt=' + encodeURIComponent(this.config.jwt as string);
724+
}
721725

722726
const url = this.config.endpointRealtime + '/realtime?' + queryParams;
723727

src/services/realtime.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ export class Realtime {
205205
}
206206

207207
// URL carries only the project; channels/queries are sent via the subscribe message.
208-
const queryParams = `project=${projectId}`;
208+
let queryParams = `project=${projectId}`;
209+
210+
const jwt = this.client.config.jwt;
211+
if (jwt) {
212+
queryParams += `&jwt=${encodeURIComponent(jwt)}`;
213+
}
209214

210215
const endpoint =
211216
this.client.config.endpointRealtime !== ''

src/services/usage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class Usage {
2323
* @param {string} params.resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
2424
* @param {string} params.resourceId - Resource id filter.
2525
* @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
26-
* @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
26+
* @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resource, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
2727
* @param {string} params.startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
2828
* @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
2929
* @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
@@ -47,7 +47,7 @@ export class Usage {
4747
* @param {string} resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
4848
* @param {string} resourceId - Resource id filter.
4949
* @param {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
50-
* @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
50+
* @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resource, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
5151
* @param {string} startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
5252
* @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
5353
* @param {string} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.

0 commit comments

Comments
 (0)