Comparing version 16.0.2 to 16.1.0
@@ -5,3 +5,3 @@ { | ||
"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", | ||
"version": "16.0.2", | ||
"version": "16.1.0", | ||
"license": "BSD-3-Clause", | ||
@@ -8,0 +8,0 @@ "main": "dist/cjs/sdk.js", |
@@ -36,3 +36,3 @@ # Appwrite Web SDK | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/appwrite@16.0.2"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/appwrite@16.1.0"></script> | ||
``` | ||
@@ -39,0 +39,0 @@ |
@@ -22,5 +22,5 @@ import { Models } from './models'; | ||
/** | ||
* Type of the response: 'error', 'event', 'connected', or 'response'. | ||
* Type of the response: 'error', 'event', 'connected', 'pong', or 'response'. | ||
*/ | ||
type: 'error' | 'event' | 'connected' | 'response'; | ||
type: 'error' | 'event' | 'connected' | 'response' | 'pong'; | ||
@@ -133,2 +133,4 @@ /** | ||
type TimeoutHandle = ReturnType<typeof setTimeout> | number; | ||
/** | ||
@@ -144,7 +146,12 @@ * Realtime interface representing the structure of a realtime communication object. | ||
/** | ||
* Timeout duration for communication operations. | ||
* Timeout for reconnect operations. | ||
*/ | ||
timeout?: number; | ||
timeout?: TimeoutHandle; | ||
/** | ||
* Heartbeat interval for the realtime connection. | ||
*/ | ||
heartbeat?: TimeoutHandle; | ||
/** | ||
* URL for establishing the WebSocket connection. | ||
@@ -203,2 +210,7 @@ */ | ||
/** | ||
* Function to create a new heartbeat interval. | ||
*/ | ||
createHeartbeat: () => void; | ||
/** | ||
* Function to clean up resources associated with specified channels. | ||
@@ -310,3 +322,3 @@ * | ||
'x-sdk-language': 'web', | ||
'x-sdk-version': '16.0.2', | ||
'x-sdk-version': '16.1.0', | ||
'X-Appwrite-Response-Format': '1.6.0', | ||
@@ -402,2 +414,3 @@ }; | ||
timeout: undefined, | ||
heartbeat: undefined, | ||
url: '', | ||
@@ -428,2 +441,13 @@ channels: new Set(), | ||
}, | ||
createHeartbeat: () => { | ||
if (this.realtime.heartbeat) { | ||
clearTimeout(this.realtime.heartbeat); | ||
} | ||
this.realtime.heartbeat = window?.setInterval(() => { | ||
this.realtime.socket?.send(JSON.stringify({ | ||
type: 'ping' | ||
})); | ||
}, 20_000); | ||
}, | ||
createSocket: () => { | ||
@@ -462,2 +486,3 @@ if (this.realtime.channels.size < 1) { | ||
this.realtime.reconnectAttempts = 0; | ||
this.realtime.createHeartbeat(); | ||
}); | ||
@@ -680,2 +705,6 @@ this.realtime.socket.addEventListener('close', event => { | ||
async ping(): Promise<string> { | ||
return this.call('GET', new URL(this.config.endpoint + '/ping')); | ||
} | ||
async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}, responseType = 'json'): Promise<any> { | ||
@@ -682,0 +711,0 @@ const { uri, options } = this.prepareRequest(method, url, headers, params); |
@@ -7,2 +7,3 @@ export enum ImageFormat { | ||
Webp = 'webp', | ||
Avif = 'avif', | ||
} |
@@ -845,7 +845,7 @@ /** | ||
/** | ||
* User name. | ||
* User name. Hide this attribute by toggling membership privacy in the Console. | ||
*/ | ||
userName: string; | ||
/** | ||
* User email address. | ||
* User email address. Hide this attribute by toggling membership privacy in the Console. | ||
*/ | ||
@@ -874,3 +874,3 @@ userEmail: string; | ||
/** | ||
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. | ||
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. | ||
*/ | ||
@@ -1203,3 +1203,7 @@ mfa: boolean; | ||
identifier: string; | ||
/** | ||
* Is the target expired. | ||
*/ | ||
expired: boolean; | ||
} | ||
} |
@@ -132,3 +132,3 @@ import { Service } from '../service'; | ||
/** | ||
* List Identities | ||
* List identities | ||
* | ||
@@ -277,3 +277,3 @@ * Get the list of identities for the currently logged in user. | ||
/** | ||
* Create Authenticator | ||
* Create authenticator | ||
* | ||
@@ -307,3 +307,3 @@ * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. | ||
/** | ||
* Verify Authenticator | ||
* Verify authenticator | ||
* | ||
@@ -344,3 +344,3 @@ * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. | ||
/** | ||
* Delete Authenticator | ||
* Delete authenticator | ||
* | ||
@@ -374,3 +374,3 @@ * Delete an authenticator for a user by ID. | ||
/** | ||
* Create MFA Challenge | ||
* Create MFA challenge | ||
* | ||
@@ -407,3 +407,3 @@ * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. | ||
/** | ||
* Create MFA Challenge (confirmation) | ||
* Create MFA challenge (confirmation) | ||
* | ||
@@ -447,3 +447,3 @@ * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. | ||
/** | ||
* List Factors | ||
* List factors | ||
* | ||
@@ -473,3 +473,3 @@ * List the factors available on the account to be used as a MFA challange. | ||
/** | ||
* Get MFA Recovery Codes | ||
* Get MFA recovery codes | ||
* | ||
@@ -499,3 +499,3 @@ * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. | ||
/** | ||
* Create MFA Recovery Codes | ||
* Create MFA recovery codes | ||
* | ||
@@ -525,3 +525,3 @@ * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. | ||
/** | ||
* Regenerate MFA Recovery Codes | ||
* Regenerate MFA recovery codes | ||
* | ||
@@ -528,0 +528,0 @@ * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. |
@@ -40,3 +40,3 @@ import { Service } from '../service'; | ||
/** | ||
* List Locale Codes | ||
* List locale codes | ||
* | ||
@@ -43,0 +43,0 @@ * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). |
@@ -181,3 +181,3 @@ import { Service } from '../service'; | ||
/** | ||
* Delete File | ||
* Delete file | ||
* | ||
@@ -184,0 +184,0 @@ * Delete a file by its unique ID. Only users with write permissions have access to delete this resource. |
@@ -185,3 +185,3 @@ import { Service } from '../service'; | ||
* | ||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. | ||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. | ||
* | ||
@@ -286,3 +286,3 @@ * @param {string} teamId | ||
* | ||
* Get a team member by the membership unique id. All team members have read access for this resource. | ||
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. | ||
* | ||
@@ -289,0 +289,0 @@ * @param {string} teamId |
@@ -195,2 +195,3 @@ import { Models } from './models'; | ||
chunkedUpload(method: string, url: URL, headers: Headers | undefined, originalPayload: Payload | undefined, onProgress: (progress: UploadProgress) => void): Promise<any>; | ||
ping(): Promise<string>; | ||
call(method: string, url: URL, headers?: Headers, params?: Payload, responseType?: string): Promise<any>; | ||
@@ -197,0 +198,0 @@ static flatten(data: Payload, prefix?: string): Payload; |
@@ -6,3 +6,4 @@ export declare enum ImageFormat { | ||
Png = "png", | ||
Webp = "webp" | ||
Webp = "webp", | ||
Avif = "avif" | ||
} |
@@ -845,7 +845,7 @@ /** | ||
/** | ||
* User name. | ||
* User name. Hide this attribute by toggling membership privacy in the Console. | ||
*/ | ||
userName: string; | ||
/** | ||
* User email address. | ||
* User email address. Hide this attribute by toggling membership privacy in the Console. | ||
*/ | ||
@@ -874,3 +874,3 @@ userEmail: string; | ||
/** | ||
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. | ||
* Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. | ||
*/ | ||
@@ -1203,3 +1203,7 @@ mfa: boolean; | ||
identifier: string; | ||
/** | ||
* Is the target expired. | ||
*/ | ||
expired: boolean; | ||
}; | ||
} |
@@ -45,3 +45,3 @@ import { Client } from '../client'; | ||
/** | ||
* List Identities | ||
* List identities | ||
* | ||
@@ -95,3 +95,3 @@ * Get the list of identities for the currently logged in user. | ||
/** | ||
* Create Authenticator | ||
* Create authenticator | ||
* | ||
@@ -106,3 +106,3 @@ * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. | ||
/** | ||
* Verify Authenticator | ||
* Verify authenticator | ||
* | ||
@@ -118,3 +118,3 @@ * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. | ||
/** | ||
* Delete Authenticator | ||
* Delete authenticator | ||
* | ||
@@ -129,3 +129,3 @@ * Delete an authenticator for a user by ID. | ||
/** | ||
* Create MFA Challenge | ||
* Create MFA challenge | ||
* | ||
@@ -140,3 +140,3 @@ * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. | ||
/** | ||
* Create MFA Challenge (confirmation) | ||
* Create MFA challenge (confirmation) | ||
* | ||
@@ -152,3 +152,3 @@ * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. | ||
/** | ||
* List Factors | ||
* List factors | ||
* | ||
@@ -162,3 +162,3 @@ * List the factors available on the account to be used as a MFA challange. | ||
/** | ||
* Get MFA Recovery Codes | ||
* Get MFA recovery codes | ||
* | ||
@@ -172,3 +172,3 @@ * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. | ||
/** | ||
* Create MFA Recovery Codes | ||
* Create MFA recovery codes | ||
* | ||
@@ -182,3 +182,3 @@ * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. | ||
/** | ||
* Regenerate MFA Recovery Codes | ||
* Regenerate MFA recovery codes | ||
* | ||
@@ -185,0 +185,0 @@ * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. |
@@ -18,3 +18,3 @@ import { Client } from '../client'; | ||
/** | ||
* List Locale Codes | ||
* List locale codes | ||
* | ||
@@ -21,0 +21,0 @@ * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). |
@@ -65,3 +65,3 @@ import { Client, UploadProgress } from '../client'; | ||
/** | ||
* Delete File | ||
* Delete file | ||
* | ||
@@ -68,0 +68,0 @@ * Delete a file by its unique ID. Only users with write permissions have access to delete this resource. |
@@ -63,3 +63,3 @@ import { Client } from '../client'; | ||
* | ||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. | ||
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. | ||
* | ||
@@ -99,3 +99,3 @@ * @param {string} teamId | ||
* | ||
* Get a team member by the membership unique id. All team members have read access for this resource. | ||
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. | ||
* | ||
@@ -102,0 +102,0 @@ * @param {string} teamId |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1471929
21506