diff --git a/eslint.config.js b/eslint.config.js index 22d25668e3..c383d06664 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -24,7 +24,8 @@ export default defineConfig( rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects. // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors - 'no-undef': 'off' + 'no-undef': 'off', + 'svelte/no-navigation-without-resolve': 'off' } }, { diff --git a/src/partials/databases-events.md b/src/partials/databases-events.md index 0a88c60476..ea03aaf3c3 100644 --- a/src/partials/databases-events.md +++ b/src/partials/databases-events.md @@ -71,9 +71,9 @@ --- -- `databases.*.tables.*.row.*.upsert` +- `databases.*.tables.*.rows.*.upsert` - This event triggers when a row is upserted. - Returns [Document Object](/docs/references/cloud/models/document) + Returns [Row Object](/docs/references/cloud/models/row) --- diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 49dbeea3a9..86b52ed7d6 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -59,7 +59,7 @@ let realtime = Realtime(client) // Subscribe to files channel let subscription = realtime.subscribe(channels: ["files"]) { response in - if (message.events!.contains("buckets.*.files.*.create")) { + if (response.events!.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(String(describing: response)) } @@ -77,7 +77,7 @@ val client = Client(context) val realtime = Realtime(client) // Subscribe to files channel -let subscription = realtime.subscribe("files") { +val subscription = realtime.subscribe("files") { if(it.events.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(it.payload.toString()); @@ -153,10 +153,10 @@ let client = Client() let realtime = Realtime(client) -let subscription = realtime.subscribe(channel: "account", callback: { response in +let subscription = realtime.subscribe(channel: "account") { response in // Callback will be executed on all account events. print(String(describing: response)) -}) +} ``` ```client-android-kotlin @@ -181,7 +181,7 @@ val subscription = realtime.subscribe("account") { You can also listen to multiple channels at once by passing an array of channels. This will trigger the callback for any events for all channels passed. -In this example we are listening to the row A and all files by subscribing to the `databases.A.tables.A.rows.A` and `files` channels. +In this example we are listening to a specific row and all files by subscribing to the `databases..tables..rows.` and `files` channels. {% multicode %} ```client-web @@ -191,8 +191,8 @@ const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); -client.subscribe(['tables.A.rows.A', 'files'], response => { - // Callback will be executed on changes for rows A and all files. +client.subscribe(['databases..tables..rows.', 'files'], response => { + // Callback will be executed on changes for the specific row and all files. console.log(response); }); ``` @@ -206,10 +206,10 @@ final client = Client() final realtime = Realtime(client); -final subscription = realtime.subscribe(['databases.A.tables.A.rows.A', 'files']); +final subscription = realtime.subscribe(['databases..tables..rows.', 'files']); subscription.stream.listen((response) { - // Callback will be executed on changes for rows A and all files. + // Callback will be executed on changes for the specific row and all files. print(response); }) ``` @@ -224,8 +224,8 @@ let client = Client() let realtime = Realtime(client) -realtime.subscribe(channels: ["databases.A.tables.A.rows.A", "files"]) { response in - // Callback will be executed on changes for rows A and all files. +realtime.subscribe(channels: ["databases..tables..rows.", "files"]) { response in + // Callback will be executed on changes for the specific row and all files. print(String(describing: response)) } ``` @@ -239,8 +239,8 @@ val client = Client(context) .setProject("") val realtime = Realtime(client) -realtime.subscribe("databases.A.tables.A.rows.A", "files") { - // Callback will be executed on changes for rows A and all files. +realtime.subscribe(listOf("databases..tables..rows.", "files")) { + // Callback will be executed on changes for the specific row and all files. print(it.toString()) } ``` @@ -412,7 +412,9 @@ The response will look like this: # Channels {% #channels %} -A list of all channels available you can subscribe to. IDs cannot be wildcards. +A list of channels you can subscribe to. Replace `` with your resource ID or use `*` for wildcards. + +## Account {% #account %} {% table %} * Channel @@ -420,45 +422,76 @@ A list of all channels available you can subscribe to. IDs cannot be wildcards. --- * `account` * All account related events (session create, name update...) ---- -* `databases..tables..rows` -* Any create/update/delete events to any row in a table + +{% /table %} + +## Databases {% #databases %} + +{% table %} +* Channel +* Description --- * `rows` * Any create/update/delete events to any row --- +* `databases..tables..rows` +* Any create/update/delete events to any row in a table +--- * `databases..tables..rows.` -* Any update/delete events to a given row +* Any create/update/delete events to a given row +{% /table %} + +## Storage {% #storage %} + +{% table %} +* Channel +* Description --- * `files` * Any create/update/delete events to any file --- +* `buckets..files` +* Any create/update/delete events to any file of the given bucket +--- * `buckets..files.` -* Any update/delete events to a given file of the given bucket +* Any create/update/delete events to a given file of the given bucket + +{% /table %} + +## Functions {% #functions %} + +{% table %} +* Channel +* Description --- -* `buckets..files` -* Any update/delete events to any file of the given bucket +* `executions` +* Any execution event +--- +* `executions.` +* Any execution event to a given execution +--- +* `functions.` +* Any execution event to a given function + +{% /table %} + +## Teams & Memberships {% #teams %} + +{% table %} +* Channel +* Description --- * `teams` -* Any create/update/delete events to a any team +* Any create/update/delete events to any team --- * `teams.` -* Any update/delete events to a given team +* Any create/update/delete events to a given team --- * `memberships` -* Any create/update/delete events to a any membership +* Any create/update/delete events to any membership --- * `memberships.` -* Any update/delete events to a given membership ---- -* `executions` -* Any update to executions ---- -* `executions.` -* Any update to a given execution ---- -* `functions.` -* Any execution event to a given function +* Any create/update/delete events to a given membership {% /table %} @@ -512,4 +545,4 @@ built up several times by multiple components' life cycles. ## Server SDKs {% #server-sdks %} -We currently are not offering access to realtime with Server SDKs and an API key. \ No newline at end of file +We currently are not offering access to realtime with Server SDKs and an API key.